[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140227.165801.2026085171656485226.davem@davemloft.net>
Date: Thu, 27 Feb 2014 16:58:01 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: amirv@...lanox.com
Cc: eric.dumazet@...il.com, David.Laight@...LAB.COM,
netdev@...r.kernel.org, yevgenyp@...lanox.com,
ogerlitz@...lanox.com, eugenia@...lanox.com
Subject: Re: net/mlx4_en: Pad ethernet packets smaller than 17 bytes
From: Amir Vadai <amirv@...lanox.com>
Date: Thu, 27 Feb 2014 23:47:54 +0200
> On 27/02/14 15:36 -0500, David Miller wrote:
>> From: Amir Vadai <amirv@...lanox.com>
>> Date: Thu, 27 Feb 2014 17:46:37 +0200
>>
>> > On 27/02/14 06:44 -0800, Eric Dumazet wrote:
>> >> On Thu, 2014-02-27 at 16:02 +0200, Amir Vadai wrote:
>> >> >
>> >> > Yes, skb will not be classified as inline-able if nr_frags != 1.
>> >> > See is_inline()
>> >
>> > Maybe I wasn't accurate enough. inline-able skb must have:
>> > 1. skb->len < inline_thold
>> > 2. nr_frags <= 1
>> >
>> > Default value for inline_thold is 104 and it is a module parameter
>> > that can be changed.
>>
>> BTW, the canonical way to deal with minimum length requirements is to
>> use skb_padto().
>
> I think that in this case it will be a bit of an overshoot. It
> will add many unnecessary operations because it need to make sure that
> there is enough space in the skb linear buffer for the padding. And in
> my case the restriction is on the hardware buffer, so IMHO there is no
> need to manipulate the skb.
If you're copying the packet into a bounce buffer, yes. But skb_padto()
is the thing to use if you're DMA'ing directly out of the SKB's buffer
memory.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists