Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305100

Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout

From Tom Herbert <tom@herbertland.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout
Date 2016-01-09 01:20 +0100
Message-ID <qOPq9-5WM-5@gated-at.bofh.it> (permalink)
References <qOfd0-6ef-15@gated-at.bofh.it> <qOiky-8ew-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jan 7, 2016 at 4:52 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2016-01-07 at 10:33 +0100, Vitaly Kuznetsov wrote:
>> Recent changes to 'struct flow_keys' (e.g commit d34af823ff40 ("net: Add
>>  VLAN ID to flow_keys")) introduced a performance regression in netvsc
>> driver. Is problem is, however, not the above mentioned commit but the
>> fact that netvsc_set_hash() function did some assumptions on the struct
>> flow_keys data layout and this is wrong. We need to extract the data we
>> need (src/dst addresses and ports) after the dissect.
>>
>> The issue could also be solved in a completely different way: as suggested
>> by Eric instead of our own homegrown netvsc_set_hash() we could use
>> skb_get_hash() which does more or less the same. Unfortunately, the
>> testing done by Simon showed that Hyper-V hosts are not happy with our
>> Jenkins hash, selecting the output queue with the current algorithm based
>> on Toeplitz hash works significantly better.
>
> Were tests done on IPv6 traffic ?
>
> Toeplitz hash takes at least 100 ns to hash 12 bytes (one iteration per
> bit : 96 iterations)
>
> For IPv6 it is 3 times this, since we have to hash 36 bytes.
>
> I do not see how it can compete with skb_get_hash() that directly gives
> skb->hash for local TCP flows.
>
> See commits b73c3d0e4f0e1961e15bec18720e48aabebe2109
> ("net: Save TX flow hash in sock and set in skbuf on xmit")
> and 877d1f6291f8e391237e324be58479a3e3a7407c
> ("net: Set sk_txhash from a random number")
>
> I understand Microsoft loves Toeplitz, but this looks not well placed
> here.
>
+1

We need a little more of an explanation on why "Toeplitz hash works
significantly better" than Jenkins hash. We already know that Toeplitz
is expensive to do in SW and there has been some proposals to optimize
it which don't seem to have been applied to hv_netvsc (I believe Eric
had a good implementation). Assuming skb_get_hash isn't sufficient the
Toeplitz hash should be in a common library anyway, we really don't
want drivers or modules inventing new ways to hash packets this point!

Tom

> I suspect there is another problem.
>
> Please share your numbers and test methodology, and the alternative
> patch Simon tested so that we can double check it.
>
> Thanks.
>
> PS: For the time being this patch can probably be applied on -net tree,
> as it fixes a real bug.
>
>
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-01-07 10:40 +0100
  Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-07 14:00 +0100
    Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct flow_keys layout Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-01-07 14:30 +0100
      Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout John Fastabend <john.fastabend@gmail.com> - 2016-01-08 02:10 +0100
        RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout KY Srinivasan <kys@microsoft.com> - 2016-01-08 04:50 +0100
          Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout John Fastabend <john.fastabend@gmail.com> - 2016-01-08 07:20 +0100
            RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout KY Srinivasan <kys@microsoft.com> - 2016-01-08 19:10 +0100
      RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-08 22:10 +0100
    Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Tom Herbert <tom@herbertland.com> - 2016-01-09 01:20 +0100
  Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout David Miller <davem@davemloft.net> - 2016-01-10 23:30 +0100
    RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-14 00:30 +0100
      Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout David Miller <davem@davemloft.net> - 2016-01-14 06:00 +0100
      Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Tom Herbert <tom@herbertland.com> - 2016-01-14 18:20 +0100
        Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-14 19:00 +0100
          Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-14 19:30 +0100
            RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-14 19:40 +0100
              Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Tom Herbert <tom@herbertland.com> - 2016-01-14 19:50 +0100
                RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-14 20:20 +0100
                Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Tom Herbert <tom@herbertland.com> - 2016-01-14 20:50 +0100
                RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-14 21:30 +0100
                Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Tom Herbert <tom@herbertland.com> - 2016-01-14 22:50 +0100
                Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout David Miller <davem@davemloft.net> - 2016-01-14 23:10 +0100
                Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-14 23:10 +0100
                RE: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Haiyang Zhang <haiyangz@microsoft.com> - 2016-01-14 23:50 +0100
      Re: [PATCH net-next] hv_netvsc: don't make assumptions on struct  flow_keys layout Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-14 19:00 +0100

csiph-web