linux/drivers/net/ethernet/sun
Dwight Engen 03f0d176df vio: fix reuse of vio_dring slot
commit d0aedcd4f1 upstream.

vio_dring_avail() will allow use of every dring entry, but when the last
entry is allocated then dr->prod == dr->cons which is indistinguishable from
the ring empty condition. This causes the next allocation to reuse an entry.
When this happens in sunvdc, the server side vds driver begins nack'ing the
messages and ends up resetting the ldc channel. This problem does not effect
sunvnet since it checks for < 2.

The fix here is to just never allocate the very last dring slot so that full
and empty are not the same condition. The request start path was changed to
check for the ring being full a bit earlier, and to stop the blk_queue if
there is no space left. The blk_queue will be restarted once the ring is
only half full again. The number of ring entries was increased to 512 which
matches the sunvnet and Solaris vdc drivers, and greatly reduces the
frequency of hitting the ring full condition and the associated blk_queue
stop/starting. The checks in sunvent were adjusted to account for
vio_dring_avail() returning 1 less.

Orabug: 19441666
OraBZ: 14983

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2014-11-27 11:21:59 +00:00
..
cassini.c net: cassini: use nested lock annotation 2014-05-09 16:34:10 -04:00
cassini.h ethernet: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
Kconfig Merge branch 'akpm' (incoming from Andrew) 2013-02-21 17:38:49 -08:00
Makefile net: Fix sungem_phy sharing. 2011-08-16 00:16:49 -07:00
niu.c niu: Use pci_enable_msix_range() instead of pci_enable_msix() 2014-02-18 15:33:34 -05:00
niu.h cassini/niu/sun*: Move the Sun drivers 2011-08-11 02:33:43 -07:00
sunbmac.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sunbmac.h sunbmac: use standard #defines from mii.h. 2011-08-25 11:08:21 +02:00
sungem.c sungem: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:12 -07:00
sungem.h cassini/niu/sun*: Move the Sun drivers 2011-08-11 02:33:43 -07:00
sunhme.c net: sunhme: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:53 -04:00
sunhme.h sunhme: stop using net_device.{base_addr, irq}. 2012-04-07 11:47:03 +02:00
sunqe.c net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
sunqe.h cassini/niu/sun*: Move the Sun drivers 2011-08-11 02:33:43 -07:00
sunvnet.c vio: fix reuse of vio_dring slot 2014-11-27 11:21:59 +00:00
sunvnet.h cassini/niu/sun*: Move the Sun drivers 2011-08-11 02:33:43 -07:00