netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davide Ciminaghi <ciminaghi@gnudd.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Raffaele Recalcati <raffaele.recalcati@bticino.it>,
	"David S. Miller" <davem@davemloft.net>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Thomas Meyer <thomas@m3y3r.de>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net/ethernet: ks8851_mll fix rx frame buffer overflow
Date: Wed, 28 Mar 2012 12:51:20 +0200	[thread overview]
Message-ID: <20120328105120.GE22721@mail.gnudd.com> (raw)
In-Reply-To: <1332920391.3547.46.camel@edumazet-glaptop>

On Wed, Mar 28, 2012 at 09:39:51AM +0200, Eric Dumazet wrote:
> On Wed, 2012-03-28 at 09:05 +0200, Raffaele Recalcati wrote:
> > Hi Eric,
> > 
> > On 07:39 Tue 27 Mar     , Eric Dumazet wrote:
> > > Le mardi 27 mars 2012 ?? 15:01 +0200, Davide Ciminaghi a ??crit :

...

> 
> So the limit should be 255, not 256.
> (0xFFFF >> 8 -> 0xFF)
> 
> ks->frame_cnt = ks_rdreg16(ks, KS_RXFCTR) >> 8;
> 
> I cant see how 256 can be stored in a 8bit field ?
>
you're right, we'll resend the patch with 255.
Well actually, since the chip appears to have 12K of internal rx buffers
and the shortest ethernet frame should be 64 bytes long, maybe the limit could
be set to 12*1024/64 = 192 frames, but I think 255 is safer.
 

Thanks and regards
Davide

      reply	other threads:[~2012-03-28 10:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:01 [PATCH] net/ethernet: ks8851_mll fix rx frame buffer overflow Davide Ciminaghi
2012-03-27 14:39 ` Eric Dumazet
2012-03-27 21:31   ` David Miller
2012-03-28  7:05   ` Raffaele Recalcati
2012-03-28  7:12     ` David Miller
2012-03-28  7:39     ` Eric Dumazet
2012-03-28 10:51       ` Davide Ciminaghi [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=20120328105120.GE22721@mail.gnudd.com \
    --to=ciminaghi@gnudd.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mcuos.com@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=raffaele.recalcati@bticino.it \
    --cc=thomas@m3y3r.de \
    /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).