linux/drivers/net/ethernet
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
..
3com 3c59x: mask LAST_FRAG bit from length field in ring 2016-02-29 17:03:35 -05:00
8390 pcnet_cs: add new id 2016-02-16 16:06:13 -05:00
adaptec
adi net: bfin_mac: Use phy_find_first() instead of open-coding it 2016-01-11 00:00:34 -05:00
aeroflex mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
agere et131x: check return value of dma_alloc_coherent 2016-02-17 23:32:05 -05:00
allwinner
alteon
altera net: eth: altera: do not free array priv->mdio->irq 2016-03-06 22:59:18 -05:00
amd lance: Return correct error code 2016-02-18 14:58:47 -05:00
apm drivers: net: xgene: fix extra IRQ issue 2016-01-24 22:15:56 -08:00
apple
arc net: arc_emac: fix sk_buff leak 2016-02-16 15:26:30 -05:00
atheros ethernet/atheros/alx: sanitize buffer sizing and padding 2016-01-06 15:05:25 -05:00
aurora net: ethernet: nb8800: support fixed-link DT node 2016-02-24 11:32:11 -05:00
broadcom bnx2x: fix indentation in bnx2x_sp_task() 2016-03-02 13:31:57 -05:00
brocade bna: fix list corruption 2016-03-01 15:19:43 -05:00
cadence net: macb: fix build warning 2016-01-25 10:51:52 -08:00
calxeda
cavium net: thunderx: Fix for Qset error due to CQ full 2016-02-25 16:25:34 -05:00
chelsio cxgb3: fix up vpd strings for kstrto*() 2016-02-19 15:49:31 -05:00
cirrus
cisco enic: increment devcmd2 result ring in case of timeout 2016-02-09 04:48:01 -05:00
davicom net: ethernet: davicom: fix devicetree irq resource 2016-02-21 22:40:49 -05:00
dec drivers/net: fix eisa_driver probe section mismatch 2015-12-14 00:24:22 -05:00
dlink
emulex be2net: don't enable multicast flag in be_enable_if_filters() routine 2016-03-03 17:18:03 -05:00
ezchip net: Fix dependencies for !HAS_IOMEM archs 2016-01-28 16:03:19 -08:00
faraday net: ethernet: faraday: Use phy_find_first() instead of open coding it 2016-01-10 22:05:30 -05:00
freescale gianfar: Enable eTSEC-106 erratum w/a for MPC8548E Rev2 2016-03-06 22:44:42 -05:00
fujitsu fmvj18x_cs: fix incorrect indexing of dev->dev_addr[] when copying the MAC address 2016-02-21 22:08:43 -05:00
hisilicon net: hns: enet specifies a reference to dsaf 2016-01-21 12:02:31 -08:00
hp net: hp100: remove unnecessary #ifdefs 2016-01-29 20:33:38 -08:00
i825xx
ibm ibmvnic: Fix ibmvnic_capability struct 2016-03-03 16:36:31 -05:00
intel net: i40e: shut up uninitialized variable warnings 2016-01-25 15:49:36 -08:00
marvell net: mvneta: Fix race condition during stopping 2016-02-13 06:02:19 -05:00
mellanox mlxsw: pci: Correctly determine if descriptor queue is full 2016-03-07 11:39:15 -05:00
micrel
microchip
moxa net: moxa: fix an error code 2016-03-03 17:17:14 -05:00
myricom
natsemi natsemi: add checks for dma mapping errors 2015-12-19 12:58:46 -05:00
neterion net: vxge: avoid unused function warnings 2016-01-29 20:33:39 -08:00
netronome nfp: call netif_carrier_off() during init 2015-12-18 15:31:36 -05:00
nuvoton
nvidia
nxp net: lpc_eth: Remove unused variables 2016-01-10 22:50:14 -05:00
octeon
oki-semi net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
packetengines
pasemi
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-06 22:54:18 -05:00
qualcomm net: qca_spi: clear IFF_TX_SKB_SHARING 2016-02-25 16:12:15 -05:00
rdc mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
realtek r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_41~48 2016-03-02 13:59:14 -05:00
renesas net: ethernet: renesas: sh_eth: don't open code of_device_get_match_data() 2016-03-03 16:38:23 -05:00
rocker switchdev: Require RTNL mutex to be held when sending FDB notifications 2016-01-28 16:21:31 -08:00
samsung phy: Add API for {un}registering an mdio device to a bus. 2016-01-07 14:31:26 -05:00
seeq
sfc sfc: Downgrade or remove some error messages 2015-12-23 22:06:39 -05:00
sgi
silan
sis
smsc net: smc91x: propagate irq return code 2016-02-16 15:02:23 -05:00
stmicro stmmac: Fix 'eth0: No PHY found' regression 2016-03-03 15:02:05 -05:00
sun sunvnet: Initialize network_header and transport_header in vnet_rx_one() 2016-01-19 14:48:15 -05:00
synopsys dwc_eth_qos: do phy_start before resetting hardware 2016-03-02 14:57:15 -05:00
tehuti
ti net: netcp: rework the code for get/set sw_data in dma desc 2016-02-21 22:03:15 -05:00
tile tilepro: use to_delayed_work 2016-01-04 16:07:16 -05:00
toshiba net: tc35815: Drop unused variable 2016-01-10 23:31:25 -05:00
tundra
via
wiznet
xilinx phy: Add an mdio_device structure 2016-01-07 14:31:26 -05:00
xircom
xscale
dnet.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
dnet.h
ec_bhf.c
ethoc.c net/ethoc: do not free array priv->mdio->irq 2016-03-06 22:58:51 -05:00
fealnx.c
jme.c net: jme: fix suspend/resume on JMC260 2016-02-24 23:58:21 -05:00
jme.h
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-03 21:09:12 -05:00
korina.c
lantiq_etop.c net: lantiq_etop.c: Use helper to find first phy 2016-01-10 18:03:47 -05:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-03 21:09:12 -05:00
netx-eth.c