linux/drivers/net
suresh kumar 5bf8eda381 bonding: do not discard lowest hash bit for non layer3+4 hashing
[ Upstream commit 49aefd1317 ]

Commit b5f862180d was introduced to discard lowest hash bit for layer3+4 hashing
but it also removes last bit from non layer3+4 hashing

Below script shows layer2+3 hashing will result in same slave to be used with above commit.
$ cat hash.py
#/usr/bin/python3.6

h_dests=[0xa0, 0xa1]
h_source=0xe3
hproto=0x8
saddr=0x1e7aa8c0
daddr=0x17aa8c0

for h_dest in h_dests:
    hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr)
    hash ^= hash >> 16
    hash ^= hash >> 8
    print(hash)

print("with last bit removed")
for h_dest in h_dests:
    hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr)
    hash ^= hash >> 16
    hash ^= hash >> 8
    hash = hash >> 1
    print(hash)

Output:
$ python3.6 hash.py
522133332
522133333   <-------------- will result in both slaves being used

with last bit removed
261066666
261066666   <-------------- only single slave used

Signed-off-by: suresh kumar <suresh2514@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-09 09:14:40 +02:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:12:46 +01:00
bonding bonding: do not discard lowest hash bit for non layer3+4 hashing 2022-05-09 09:14:40 +02:00
caif
can can: etas_es58x: es58x_fd_rx_event_msg(): initialize rx_event_msg before calling es58x_check_msg_len() 2022-04-13 20:59:08 +02:00
dsa net: dsa: lantiq_gswip: Don't set GSWIP_MII_CFG_RMII_CLK 2022-05-09 09:14:38 +02:00
ethernet Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits" 2022-05-09 09:14:39 +02:00
fddi
fjes fjes: Check for error irq 2021-12-29 12:28:44 +01:00
hamradio hamradio: remove needs_free_netdev to avoid UAF 2022-04-20 09:34:04 +02:00
hippi
hyperv hv_netvsc: Add check for kvmalloc_array 2022-03-23 09:16:42 +01:00
ieee802154 net: ieee802154: ca8210: Fix lifs/sifs periods 2022-02-23 12:03:11 +01:00
ipa net: ipa: fix a build dependency 2022-04-20 09:34:21 +02:00
ipvlan
mctp
mdio net: mdio: don't defer probe forever if PHY IRQ provider is missing 2022-04-20 09:34:10 +02:00
netdevsim ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt 2022-02-23 12:03:10 +01:00
pcs
phy net: phy: marvell10g: fix return value on error 2022-05-09 09:14:37 +02:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 11:03:52 +01:00
slip drivers: net: slip: fix NPD bug in sl_tx_timeout() 2022-04-20 09:34:17 +02:00
team
usb net: usb: aqc111: Fix out-of-bounds accesses in RX fixup 2022-04-20 09:34:16 +02:00
vmxnet3 vmxnet3: fix minimum vectors alloc issue 2021-12-17 10:30:14 +01:00
wan
wireguard wireguard: device: check for metadata_dst with skb_valid_dst() 2022-05-09 09:14:35 +02:00
wireless brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant 2022-04-27 14:38:56 +02:00
wwan net: wwan: Fix MRU mismatch issue which may lead to data connection lost 2022-01-27 11:05:40 +01:00
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-03-16 14:23:41 +01:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-04-08 14:23:41 +02:00
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:34:09 +01:00
macvlan.c macvlan: Fix leaking skb in source mode with nodst option 2022-04-20 09:34:13 +02:00
macvtap.c macvtap: advertise link netns via netlink 2022-04-13 20:59:07 +02:00
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 20:59:07 +02:00
thunderbolt.c
tun.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 20:59:07 +02:00
veth.c veth: Ensure eth header is in skb's linear part 2022-04-20 09:34:10 +02:00
virtio_net.c virtio_net: fix wrong buf address calculation when using xdp 2022-05-09 09:14:31 +02:00
vrf.c vrf: fix packet sniffing for traffic originating from ip tunnels 2022-04-13 20:59:15 +02:00
vsockmon.c
vxlan.c vxlan: fix error return code in vxlan_fdb_append 2022-04-27 14:38:55 +02:00
xen-netfront.c xen/netfront: react properly to failing gnttab_end_foreign_access_ref() 2022-03-11 12:22:37 +01:00