netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Nicolae Rosia <nicolae.rosia@certsign.ro>,
	netdev@vger.kernel.org, 'Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH net-next] net: macb: replace literal constant with NET_IP_ALIGN
Date: Wed, 01 Jul 2015 16:00:56 -0700	[thread overview]
Message-ID: <1435791656.12101.128.camel@perches.com> (raw)
In-Reply-To: <1435788837.8526.3.camel@edumazet-glaptop2.roam.corp.google.com>

On Thu, 2015-07-02 at 00:13 +0200, Eric Dumazet wrote:
> On Wed, 2015-07-01 at 10:06 -0700, Joe Perches wrote:
> > On Wed, 2015-07-01 at 12:56 +0200, Eric Dumazet wrote:
> > > On Tue, 2015-06-30 at 20:25 +0300, Nicolae Rosia wrote:
> > > > diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> > []
> > > > @@ -2554,9 +2554,9 @@ static void at91ether_rx(struct net_device *dev)
> > > >  	while (lp->rx_ring[lp->rx_tail].addr & MACB_BIT(RX_USED)) {
> > > >  		p_recv = lp->rx_buffers + lp->rx_tail * AT91ETHER_MAX_RBUFF_SZ;
> > > >  		pktlen = MACB_BF(RX_FRMLEN, lp->rx_ring[lp->rx_tail].ctrl);
> > > > -		skb = netdev_alloc_skb(dev, pktlen + 2);
> > > > +		skb = netdev_alloc_skb(dev, pktlen + NET_IP_ALIGN);
> > > >  		if (skb) {
> > > > -			skb_reserve(skb, 2);
> > > > +			skb_reserve(skb, NET_IP_ALIGN);
> > > >  			memcpy(skb_put(skb, pktlen), p_recv, pktlen);
> > > >  
> > > >  			skb->protocol = eth_type_trans(skb, dev);
> > > 
> > > Then please use netdev_alloc_skb_ip_align(), so that you get rid of
> > > skb_reserve()
> > 
> > It seems there are ~50 of these in the kernel tree
> > that could be converted.
> > 
> 
> Make sure the 2 is really NET_IP_ALIGN
> 
> Some hardwares need 2, even if NET_IP_ALIGN is 0 (on x86 arches for
> example)
> 
> I would rather not touch this without testing the change on real
> hardware.

Nor I really.

Most all of those are in fairly old hardware drivers.

I just wanted to point out that more exist.

  reply	other threads:[~2015-07-01 23:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 17:25 [PATCH net-next] net: macb: replace literal constant with NET_IP_ALIGN Nicolae Rosia
2015-07-01 10:03 ` Nicolas Ferre
2015-07-01 10:56 ` Eric Dumazet
2015-07-01 13:29   ` Nicolae Rosia
2015-07-01 13:44     ` Eric Dumazet
2015-07-01 14:29       ` Nicolae Rosia
2015-07-01 15:33         ` Eric Dumazet
2015-07-01 15:53           ` Nicolae Rosia
2015-07-01 16:19             ` Eric Dumazet
2015-07-01 17:06   ` Joe Perches
2015-07-01 22:13     ` Eric Dumazet
2015-07-01 23:00       ` Joe Perches [this message]
2015-07-03 16:18       ` David Laight
2015-07-03 16:39         ` Eric Dumazet
2015-07-06  8:54           ` David Laight

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=1435791656.12101.128.camel@perches.com \
    --to=joe@perches.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolae.rosia@certsign.ro \
    --cc=nicolas.ferre@atmel.com \
    /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).