* Re: [Bug 120441] af_packet no longer uses symmetric hashing
[not found] <511F6A17-BD35-4846-A717-1463B74D7F2A@gmail.com>
@ 2016-06-16 14:37 ` Daniel Borkmann
2016-06-16 14:40 ` Derek Ditch
2016-06-16 14:50 ` Hannes Frederic Sowa
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Borkmann @ 2016-06-16 14:37 UTC (permalink / raw)
To: Derek Ditch; +Cc: netdev, tom, jiri, willemb, eric
On 06/16/2016 03:57 PM, Derek Ditch wrote:
[...]
>> Begin forwarded message:
>>
>> From: bugzilla-daemon@bugzilla.kernel.org
>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>> Date: June 16, 2016 at 07:35:54 -0500
>> To: derek.ditch@gmail.com
>>
>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
Just thinking out loud, perhaps one way would be to implement your own fanout
hashing via eBPF demuxer, f.e. in case CPU selection etc wouldn't work. Another
option could be to have a (2nd) customizable hash demux that would enforce to
always go through the flow-dissector and where you would have a socket option
to control keys for it, but I presume that seems rather less desirable.
>> --- Comment #2 from Eric Leblond <eric@regit.org> ---
>> This patch has been introduced in 4.2.
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>> Begin forwarded message:
>>
>> From: bugzilla-daemon@bugzilla.kernel.org
>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>> Date: June 16, 2016 at 06:59:58 -0500
>> To: derek.ditch@gmail.com
>>
>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
>>
>> Eric Leblond <eric@regit.org> changed:
>>
>> What |Removed |Added
>> ----------------------------------------------------------------------------
>> CC| |eric@regit.org
>>
>> --- Comment #1 from Eric Leblond <eric@regit.org> ---
>> It seems the problem has been introduced by
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=42aecaa9bb2bd57eb8d61b4565cee5d3640863fb
>> where the symetrical jhash_3words function has been replaced by jhash2.
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug 120441] af_packet no longer uses symmetric hashing
2016-06-16 14:37 ` [Bug 120441] af_packet no longer uses symmetric hashing Daniel Borkmann
@ 2016-06-16 14:40 ` Derek Ditch
2016-06-16 14:50 ` Hannes Frederic Sowa
1 sibling, 0 replies; 5+ messages in thread
From: Derek Ditch @ 2016-06-16 14:40 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: netdev, tom, jiri, willemb, eric
> On 16Jun 2016, at 09:37, Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 06/16/2016 03:57 PM, Derek Ditch wrote:
> [...]
>>> Begin forwarded message:
>>>
>>> From: bugzilla-daemon@bugzilla.kernel.org
>>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>>> Date: June 16, 2016 at 07:35:54 -0500
>>> To: derek.ditch@gmail.com
>>>
>>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
>
> Just thinking out loud, perhaps one way would be to implement your own fanout
> hashing via eBPF demuxer, f.e. in case CPU selection etc wouldn't work. Another
> option could be to have a (2nd) customizable hash demux that would enforce to
> always go through the flow-dissector and where you would have a socket option
> to control keys for it, but I presume that seems rather less desirable.
It’s less desirable, but at the moment seems like the path of least resistance. I haven’t written an eBPF program before, so I’m reading up on that. Once I get that worked out I can add that to the socket. Have you implemented this in netsniff-ng or something else yet, Daniel?
—
Derek Ditch
derek.ditch@gmail.com
GPG: 0x2543A3B5
>
>>> --- Comment #2 from Eric Leblond <eric@regit.org> ---
>>> This patch has been introduced in 4.2.
>>>
>>> --
>>> You are receiving this mail because:
>>> You reported the bug.
>>> Begin forwarded message:
>>>
>>> From: bugzilla-daemon@bugzilla.kernel.org
>>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>>> Date: June 16, 2016 at 06:59:58 -0500
>>> To: derek.ditch@gmail.com
>>>
>>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
>>>
>>> Eric Leblond <eric@regit.org> changed:
>>>
>>> What |Removed |Added
>>> ----------------------------------------------------------------------------
>>> CC| |eric@regit.org
>>>
>>> --- Comment #1 from Eric Leblond <eric@regit.org> ---
>>> It seems the problem has been introduced by
>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=42aecaa9bb2bd57eb8d61b4565cee5d3640863fb
>>> where the symetrical jhash_3words function has been replaced by jhash2.
>>>
>>> --
>>> You are receiving this mail because:
>>> You reported the bug.
>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug 120441] af_packet no longer uses symmetric hashing
2016-06-16 14:37 ` [Bug 120441] af_packet no longer uses symmetric hashing Daniel Borkmann
2016-06-16 14:40 ` Derek Ditch
@ 2016-06-16 14:50 ` Hannes Frederic Sowa
2016-06-16 15:18 ` Daniel Borkmann
1 sibling, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2016-06-16 14:50 UTC (permalink / raw)
To: Daniel Borkmann, Derek Ditch; +Cc: netdev, tom, jiri, willemb, eric
On 16.06.2016 16:37, Daniel Borkmann wrote:
> On 06/16/2016 03:57 PM, Derek Ditch wrote:
> [...]
>>> Begin forwarded message:
>>>
>>> From: bugzilla-daemon@bugzilla.kernel.org
>>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>>> Date: June 16, 2016 at 07:35:54 -0500
>>> To: derek.ditch@gmail.com
>>>
>>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
>
> Just thinking out loud, perhaps one way would be to implement your own
> fanout
> hashing via eBPF demuxer, f.e. in case CPU selection etc wouldn't work.
> Another
> option could be to have a (2nd) customizable hash demux that would
> enforce to
> always go through the flow-dissector and where you would have a socket
> option
> to control keys for it, but I presume that seems rather less desirable.
Isn't a symmetric hashing for af-packet something very fundamental?
Looks much more like a bug to me.
Bye,
Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug 120441] af_packet no longer uses symmetric hashing
2016-06-16 14:50 ` Hannes Frederic Sowa
@ 2016-06-16 15:18 ` Daniel Borkmann
2016-06-16 15:32 ` Willem de Bruijn
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Borkmann @ 2016-06-16 15:18 UTC (permalink / raw)
To: Hannes Frederic Sowa, Derek Ditch; +Cc: netdev, tom, jiri, willemb, eric
On 06/16/2016 04:50 PM, Hannes Frederic Sowa wrote:
> On 16.06.2016 16:37, Daniel Borkmann wrote:
>> On 06/16/2016 03:57 PM, Derek Ditch wrote:
>> [...]
>>>> Begin forwarded message:
>>>>
>>>> From: bugzilla-daemon@bugzilla.kernel.org
>>>> Subject: [Bug 120441] af_packet no longer uses symmetric hashing
>>>> Date: June 16, 2016 at 07:35:54 -0500
>>>> To: derek.ditch@gmail.com
>>>>
>>>> https://bugzilla.kernel.org/show_bug.cgi?id=120441
>>
>> Just thinking out loud, perhaps one way would be to implement your own
>> fanout
>> hashing via eBPF demuxer, f.e. in case CPU selection etc wouldn't work.
>> Another
>> option could be to have a (2nd) customizable hash demux that would
>> enforce to
>> always go through the flow-dissector and where you would have a socket
>> option
>> to control keys for it, but I presume that seems rather less desirable.
>
> Isn't a symmetric hashing for af-packet something very fundamental?
> Looks much more like a bug to me.
I agree it would be useful resp. fundamental. I'm not quite sure whether
PACKET_FANOUT_HASH always had this guarantee since the initial implementation
f.e. depending on whether the skb got fanout demuxed from RX or TX paths,
you would either use a hw hash or it would have gone through the kernel's
(predecessor) flow dissector (and therefore potentially to different packet
sockets eventually). It might be the case that this got noticed due to the
flow dissector nowadays collecting more input for building its hash, hmm.
> Bye,
> Hannes
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug 120441] af_packet no longer uses symmetric hashing
2016-06-16 15:18 ` Daniel Borkmann
@ 2016-06-16 15:32 ` Willem de Bruijn
0 siblings, 0 replies; 5+ messages in thread
From: Willem de Bruijn @ 2016-06-16 15:32 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Hannes Frederic Sowa, Derek Ditch, Network Development,
Tom Herbert, jiri, Willem de Bruijn, eric
>> Isn't a symmetric hashing for af-packet something very fundamental?
>> Looks much more like a bug to me.
>
>
> I agree it would be useful resp. fundamental. I'm not quite sure whether
> PACKET_FANOUT_HASH always had this guarantee since the initial
> implementation
It is based on rxhash, which is intended to have this property. See for
instance the commit messages from commit b249dcb82d32 ("rps:
consistent rxhash")
"In case we compute a software skb->rxhash, we can generate a
consistent hash : Its value will be the same in both flow directions."
commit 6862234238e8 ("net: small bug on rxhash calculation") also
explicitly refers to this property.
> f.e. depending on whether the skb got fanout demuxed from RX or TX paths,
> you would either use a hw hash or it would have gone through the kernel's
> (predecessor) flow dissector
It's quite possible that not all hardware hash implementations do the
right thing, indeed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-06-16 15:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <511F6A17-BD35-4846-A717-1463B74D7F2A@gmail.com>
2016-06-16 14:37 ` [Bug 120441] af_packet no longer uses symmetric hashing Daniel Borkmann
2016-06-16 14:40 ` Derek Ditch
2016-06-16 14:50 ` Hannes Frederic Sowa
2016-06-16 15:18 ` Daniel Borkmann
2016-06-16 15:32 ` Willem de Bruijn
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).