9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Andreas Zell <zell@imageaccess.de>
To: 9fans@9fans.net
Subject: Re: [9fans] Latest pull killed my server
Date: Wed,  1 Apr 2009 14:23:28 +0000	[thread overview]
Message-ID: <e230f347-4f61-4bc0-b96e-b019e6f8a3b0@h28g2000yqd.googlegroups.com> (raw)
In-Reply-To: <3840643f-ce10-46dc-891a-7a31f6d489c4@l1g2000yqk.googlegroups.com>

On 31 Mrz., 15:03, quans...@quanstro.net (erik quanstrom) wrote:
>         /* compute log10(ether->mbps) into lg */
>         for(lg = 0, mb = ether->mbps; mb >= 10; lg++)
>                 mb /= 10;
>         if (lg > 0)
>                 lg--;
>         if (lg > 14)                 /* 2^(14+17) = 2?? */
>                 lg = 14;
>         /* allocate larger output queues for higher-speed interfaces */
>         bsz = 1UL << (lg + 17);           /* 2?? = 128K, bsz = 2? � 128K */
>         while (bsz > mainmem->maxsize / 8 && bsz > 128*1024)
>                 bsz /= 2;
>
>         netifinit(ether, name, Ntypes, bsz);>>        while (ether->oq == nil && bsz > 128*1024) {
>
>                 bsz /= 2;
>                 ether->oq = qopen(bsz, Qmsg, 0, 0);
>                 ether->limit = bsz;
>         }
>         if(ether->oq == nil)
>                 panic("etherreset %s", name);
>
> the simple fix would be to change the > on the marked
> line to >=.  but i think the while loop could be tossed
> since malloc panics on failure and since qopen only allocates
> sizeof(Queue) regardless of the limit argument.  i had
> this code when i wrote the myricom driver (qio sets q->limit itself).
>
>         j = ether->mbps;
>         if(j > 1000)
>                 j *= 10;
>         for(i = 0; j >= 100; i++)
>                 j /= 10;
>         i = (128<<i) * 1024;
>         netifinit(ether, name, Ntypes, i);
>         if(ether->oq == nil)
>                 ether->oq = qopen(i, Qmsg, 0, 0);
>         if(ether->oq == nil)
>                 panic("etherreset %s", name);
>
> by the way, a quick scan shows
>         ether2114x
>         etherrhine
> are capable of setting mbps to 0 on startup.  this should
> be legal, since ethernet can be connected after boot.
>
> - erik

It work's

Thank you.

AZ.



      parent reply	other threads:[~2009-04-01 14:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30 21:26 vmhaas
2009-03-30 21:33 ` erik quanstrom
2009-03-31 11:18 ` Andreas Zell
2009-03-31 12:54   ` erik quanstrom
2009-04-01 14:23   ` Andreas Zell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e230f347-4f61-4bc0-b96e-b019e6f8a3b0@h28g2000yqd.googlegroups.com \
    --to=zell@imageaccess.de \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).