linux-stable/drivers/net
Ido Schimmel 5091730d77 mlxsw: pci: Correctly determine if descriptor queue is full
The descriptor queues for sending (SDQs) and receiving (RDQs) packets
are managed by two counters - producer and consumer - which are both
16-bit in size. A queue is considered full when the difference between
the two equals the queue's maximum number of descriptors.

However, if the producer counter overflows, then it's possible for the
full queue check to fail, as it doesn't take the overflow into account.
In such a case, descriptors already passed to the device - but for which
a completion has yet to be posted - will be overwritten, thereby causing
undefined behavior. The above can be achieved under heavy load (~30
netperf instances).

Fix that by casting the subtraction result to u16, preventing it from
being treated as a signed integer.

Fixes: eda6500a98 ("mlxsw: Add PCI bus implementation")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-07 11:39:15 -05:00
..
appletalk
arcnet
bonding bonding: don't use stale speed and duplex information 2016-02-16 15:14:01 -05:00
caif
can can: mcp251x: avoid write to error flag register if it's unnecessary 2016-03-04 08:45:17 +01:00
cris
dsa net: dsa: mv88e6xxx: Add support for Marvell 88E6240 2016-02-16 16:04:07 -05:00
ethernet mlxsw: pci: Correctly determine if descriptor queue is full 2016-03-07 11:39:15 -05:00
fddi defxx: fix build warning 2016-01-25 10:51:52 -08:00
fjes
hamradio
hippi
hyperv hv_netvsc: Restore needed_headroom request 2016-02-13 06:04:44 -05:00
ieee802154
ipvlan
irda net/irda: bfin_sir: remove duplicate defines 2016-01-21 10:45:45 -08:00
phy phy: micrel: Disable auto negotiation on startup 2016-03-01 16:52:09 -05:00
plip net: plip: use new parport device model 2016-01-09 21:02:05 -05:00
ppp ppp: lock ppp->flags in ppp_read() and ppp_poll() 2016-03-01 16:15:07 -05:00
slip
team team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid 2016-01-18 11:52:38 -05:00
usb asix: do not free array priv->mdio->irq 2016-03-06 22:56:48 -05:00
vmxnet3 Driver: Vmxnet3: Update Rx ring 2 max size 2016-02-21 22:04:15 -05:00
wan dscc4: Undefined signed int shift 2016-02-13 06:10:21 -05:00
wimax
wireless rtlwifi 2016-02-19 15:51:18 -05:00
xen-netback xen-netback: free queues after freeing the net device 2016-01-15 15:13:19 -05:00
dummy.c
eql.c
geneve.c lwt: fix rx checksum setting for lwt devices tunneling over ipv6 2016-02-19 15:39:30 -05:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macvlan.c macvlan: make operstate and carrier more accurate 2016-01-29 12:15:45 -08:00
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c
veth.c
virtio_net.c
vrf.c net: vrf: Remove direct access to skb->data 2016-02-25 15:34:26 -05:00
vxlan.c vxlan: fix missing options_len update on RX with collect metadata 2016-03-03 17:10:31 -05:00
xen-netfront.c xen-netfront: request Tx response events more often 2016-01-28 16:08:55 -08:00