From: Alexander Duyck <alexander.duyck@gmail.com>
To: David Miller <davem@davemloft.net>, amirv@mellanox.com
Cc: netdev@vger.kernel.org, idos@mellanox.com,
jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com,
bruce.w.allan@intel.com, carolyn.wyborny@intel.com,
donald.c.skidmore@intel.com, gregory.v.rose@intel.com,
alexander.h.duyck@intel.com, john.ronciak@intel.com,
mitch.a.williams@intel.com, yevgenyp@mellanox.com,
ogerlitz@mellanox.com
Subject: Re: [PATCH net-next 1/2] net: Expose header length compution function
Date: Sat, 10 May 2014 10:12:20 -0700 [thread overview]
Message-ID: <536E5DF4.8010908@gmail.com> (raw)
In-Reply-To: <20140509.162454.1317479460010270185.davem@davemloft.net>
On 05/09/2014 01:24 PM, David Miller wrote:
> From: Amir Vadai <amirv@mellanox.com>
> Date: Thu, 8 May 2014 15:50:33 +0300
>
>> From: Ido Shamay <idos@mellanox.com>
>>
>> This commit exposes an header length compution generic function,
>> introduced in some of Intel's Etherent drivers (igb and ixgbe),
>> to net public namespace under the name __net_get_headlen,
>> where it can be used by other vendors and removes code duplication.
>>
>> Signed-off-by: Ido Shamay <idos@mellanox.com>
>> Signed-off-by: Amir Vadai <amirv@mellanox.com>
>
> First of all, this appears (at least to me) to duplicate a lot of
> what the existing flow dissector can do.
>
> For example, you can probably call skb_flow_dissect() and the
> filled in flow_keys has much of what you need. If it doesn't
> have everything you need consider extending it.
>
> Even if that won't work out, you must add a detailed comment, with
> kernel doc, above the declaration for this new interface in the
> header file.
>
> I honestly still have no idea exactly what this function does and
> exactly what it's trying to achieve.
Actually the flow keys with the exception of maybe thoff and ip_proto
are pretty much useless to us for our purpose. As is we are left to
then go off and compute the header length of the transport before we get
to the information we need.
The two functions are very similar though. It might be worth while to
actually park the two next to each other so that it is obvious that when
one gets updated to support a new protocol the other should as well. So
for example the headlen function could pick up some of the tunnel stuff.
The main difference between __net_get_headlen() and skb_flow_dissect()
is that skb_flow_dissect is meant to work on a packet headed in either
direction, as such there are multiple calls to skb_copy_bits and all the
copies out of the paged area that go with it. __net_get_headlen() is
meant to be called by the base netdev on a linear buffer to parse
through everything from the start of the Ethernet header to the start of
the data section and determine the length of that region. So one
obvious difference is that we care about the length of non-l4 headers,
whereas skb_flow_dissect does not.
Thanks,
Alex
next prev parent reply other threads:[~2014-05-10 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 12:50 [PATCH net-next 0/2] net, igb, mlx4: Copy exact header to SKB linear buffer Amir Vadai
2014-05-08 12:50 ` [PATCH net-next 1/2] net: Expose header length compution function Amir Vadai
2014-05-08 15:18 ` Alexander Duyck
2014-05-09 20:24 ` David Miller
2014-05-10 17:12 ` Alexander Duyck [this message]
2014-05-10 17:49 ` Eric Dumazet
2014-05-10 21:53 ` Alexander Duyck
2014-05-19 21:01 ` Eric Dumazet
2014-05-21 15:03 ` Alexander Duyck
2014-05-21 15:51 ` Eric Dumazet
2014-05-21 16:45 ` Alexander Duyck
2014-05-21 17:41 ` Eric Dumazet
2014-05-08 12:50 ` [PATCH net-next 2/2] net/mlx4_en: Copy exact header to SKB linear part Amir Vadai
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=536E5DF4.8010908@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=amirv@mellanox.com \
--cc=bruce.w.allan@intel.com \
--cc=carolyn.wyborny@intel.com \
--cc=davem@davemloft.net \
--cc=donald.c.skidmore@intel.com \
--cc=gregory.v.rose@intel.com \
--cc=idos@mellanox.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=john.ronciak@intel.com \
--cc=mitch.a.williams@intel.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=yevgenyp@mellanox.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).