linux_dsm_epyc7002/drivers/net
Ido Schimmel 63963d0f9d mlxsw: switchx2: Do not modify cloned SKBs during xmit
The driver needs to prepend a Tx header to each packet it is
transmitting. The header includes information such as the egress port
and traffic class.

The addition of the header requires the driver to modify the SKB's
header and therefore it must not be shared. Otherwise, we risk hitting
various race conditions.

For example, when a packet is flooded (cloned) by the bridge driver to
two switch ports swp1 and swp2:

t0 - mlxsw_sp_port_xmit() is called for swp1. Tx header is prepended with
     swp1's port number
t1 - mlxsw_sp_port_xmit() is called for swp2. Tx header is prepended with
     swp2's port number, overwriting swp1's port number
t2 - The device processes data buffer from t0. Packet is transmitted via
     swp2
t3 - The device processes data buffer from t1. Packet is transmitted via
     swp2

Usually, the device is fast enough and transmits the packet before its
Tx header is overwritten, but this is not the case in emulated
environments.

Fix this by making sure the SKB's header is writable by calling
skb_cow_head(). Since the function ensures we have headroom to push the
Tx header, the check further in the function can be removed.

v2:
* Use skb_cow_head() instead of skb_unshare() as suggested by Jakub
* Remove unnecessary check regarding headroom

Fixes: 31557f0f97 ("mlxsw: Introduce Mellanox SwitchX-2 ASIC support")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-15 04:16:30 -08:00
..
appletalk
arcnet
bonding bonding: fix active-backup transition after link failure 2019-12-14 16:22:34 -08:00
caif
can can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode 2020-01-02 15:34:27 +01:00
dsa net: dsa: mv88e6xxx: Preserve priority when setting CPU port. 2020-01-06 13:35:11 -08:00
ethernet mlxsw: switchx2: Do not modify cloned SKBs during xmit 2020-01-15 04:16:30 -08:00
fddi
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
hamradio 6pack,mkiss: fix possible deadlock 2019-12-13 21:49:29 -08:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
ieee802154
ipvlan
netdevsim devlink: correct misspelling of snapshot 2020-01-11 14:30:24 -08:00
phy net: phy: DP83822: Update Kconfig with DP83825I support 2020-01-10 23:32:54 -08:00
plip
ppp pppoe: remove redundant BUG_ON() check in pppoe_pernet 2019-12-07 11:52:23 -08:00
slip
team
usb r8152: add missing endpoint sanity check 2020-01-14 18:43:21 -08:00
vmxnet3
wan net: wan: sdla: Fix cast from pointer to integer of different size 2020-01-06 13:30:03 -08:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
xen-netback xen-netback: avoid race that can lead to NULL pointer dereference 2019-12-15 11:40:15 -08:00
dummy.c
eql.c
geneve.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
gtp.c gtp: fix bad unlock balance in gtp_encap_enable_socket 2020-01-08 12:42:49 -08:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c macvlan: do not assume mac_header is set in macvlan_broadcast() 2020-01-08 12:52:33 -08:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c vxlan: fix tos value before xmit 2020-01-02 16:35:48 -08:00
xen-netfront.c