From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net] ip: hash fragments consistently Date: Fri, 9 Nov 2018 11:44:01 -0800 Message-ID: References: <9b22fd3a35416b3145f1245466167b001925ce1a.1532357173.git.pabeni@redhat.com> <211e391b-3537-560b-0522-9ea595848477@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , soukjin bae To: Paolo Abeni , netdev@vger.kernel.org Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:34577 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725752AbeKJF0F (ORCPT ); Sat, 10 Nov 2018 00:26:05 -0500 Received: by mail-pg1-f196.google.com with SMTP id 17so1017047pgg.1 for ; Fri, 09 Nov 2018 11:44:03 -0800 (PST) In-Reply-To: <211e391b-3537-560b-0522-9ea595848477@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 07/23/2018 09:26 AM, Eric Dumazet wrote: > > > On 07/23/2018 07:50 AM, Paolo Abeni wrote: >> The skb hash for locally generated ip[v6] fragments belonging >> to the same datagram can vary in several circumstances: >> * for connected UDP[v6] sockets, the first fragment get its hash >> via set_owner_w()/skb_set_hash_from_sk() >> * for unconnected IPv6 UDPv6 sockets, the first fragment can get >> its hash via ip6_make_flowlabel()/skb_get_hash_flowi6(), if >> auto_flowlabel is enabled >> >> For the following frags the hash is usually computed via >> skb_get_hash(). >> The above can cause OoO for unconnected IPv6 UDPv6 socket: in that >> scenario the egress tx queue can be selected on a per packet basis >> via the skb hash. >> It may also fool flow-oriented schedulers to place fragments belonging >> to the same datagram in different flows. >> > > It also fools bond_xmit_hash(), packets of the same datagram can be sent on > two bonding slaves instead of one, meaning adding pressure on the defrag unit > in receiver. > > Reviewed-by: Eric Dumazet > Also we might note that flow dissector itself is buggy as found by Soukjin Bae ( https://patchwork.ozlabs.org/patch/994601/ ) I will send a v2 of his patch with a different changelog. Defrag is fixed [1] but the bug in flow dissector is adding extra work and hash inconsistencies. [1] https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=0d5b9311baf27bb545f187f12ecfd558220c607d