mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Freddy Xin <freddy@asix.com.tw>
To: David Laight <David.Laight@ACULAB.COM>,
	netdev@vger.kernel.org, davem@davemloft.net,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	louis@asix.com.tw, allan@asix.com.tw
Subject: Re: [PATCH 1/1] AX88179_178A: Add FLAG_HW_IPALIGN to determine whether reserving NET_IP_ALIGN bytes for an SKB.
Date: Mon, 16 Dec 2013 14:54:32 +0800	[thread overview]
Message-ID: <52AEA3A8.2020906@asix.com.tw> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B748A@saturn3.aculab.com>


On 2013年12月13日 18:36, David Laight wrote:
>> From: freddy@asix.com.tw
> ...
>> -	skb = __netdev_alloc_skb_ip_align(dev->net, size, flags);
>> +	if (dev->driver_info->flags & FLAG_HW_IPALIGN)
>> +		skb = __netdev_alloc_skb(dev->net, size, flags);
>> +	else
>> +		skb = __netdev_alloc_skb_ip_align(dev->net, size, flags);
> Given the definition:
> static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
>                  unsigned int length, gfp_t gfp)
> {
>          struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
>
>          if (NET_IP_ALIGN && skb)
>                  skb_reserve(skb, NET_IP_ALIGN);
>          return skb;
> }
>
> It really ought to be possible to code that without an extra conditional.
>
> 	David
>
>
>
>
The AX88179_178A driver do need to know the value of NET_IP_ALIGN
to determine whether enabling the feature that makes IP header align
on a dword-aligned address, but according to the comments from David
Miller, I need to consider all situations, not just for the case that
NET_IP_ALIGN is zero, so the condition added in rx_submit is just used to
determine whether reserving NET_IP_ALIGN bytes for each SKB.

Freddy

  reply	other threads:[~2013-12-16  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13  9:25 freddy
2013-12-13 10:36 ` David Laight
2013-12-16  6:54   ` Freddy Xin [this message]
2013-12-16 10:09     ` David Laight
2013-12-19  3:14       ` Freddy Xin
2013-12-19 10:01         ` 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=52AEA3A8.2020906@asix.com.tw \
    --to=freddy@asix.com.tw \
    --cc=David.Laight@ACULAB.COM \
    --cc=allan@asix.com.tw \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=louis@asix.com.tw \
    --cc=netdev@vger.kernel.org \
    /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

Powered by JetHome