From: Alexander Duyck <alexander.duyck@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
amirv@mellanox.com, 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 14:53:43 -0700 [thread overview]
Message-ID: <536E9FE7.6060809@gmail.com> (raw)
In-Reply-To: <1399744197.7973.11.camel@edumazet-glaptop2.roam.corp.google.com>
On 05/10/2014 10:49 AM, Eric Dumazet wrote:
> On Sat, 2014-05-10 at 10:12 -0700, Alexander Duyck wrote:
>
>> 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.
> Its actually possible to prepare an skb with the needed parts so that
> skb_flow_dissect() has no copy to do.
>
> Its a 10 lines helper maybe.
>
> I already mentioned this in the past, I fail to understand your
> resistance.
>
> I will provide it unless someone beats me, because its the week end and
> I have other plans at the moment.
I'm more of a fan of purpose built functions in hot-path. In the case
of skb_flow_dissect, it is meant to collect the inputs for a Jenkins
hash. If we also expand it to get the length my concern is that it may
do both, but it won't be very efficient at doing either, and that
doesn't even take into account that somebody at some point might want
the flow dissector to not do things like coalesce IPv6 addresses to
support things like a Toeplitz hash which would slow things down further.
I can wait for the patch. I don't really see what you're talking about
since we are trying to linearize the header portion of the buffers and
for jumbos frames all 2K of the buffer has been used so you can't do any
tricks like use a paged frag for the head.
Thanks,
Alex
next prev parent reply other threads:[~2014-05-10 21:53 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
2014-05-10 17:49 ` Eric Dumazet
2014-05-10 21:53 ` Alexander Duyck [this message]
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=536E9FE7.6060809@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=eric.dumazet@gmail.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).