OSDN Git Service

net: axienet: fix for TX busy handling
authorRobert Hancock <robert.hancock@calian.com>
Tue, 18 Jan 2022 21:41:31 +0000 (15:41 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jan 2022 11:29:14 +0000 (11:29 +0000)
commitbb193e3db8b86a63f26889c99e14fd30c9ebd72a
tree1d7820c71ce146312cff3190c0af52caa77c03dd
parentaba57a823d2985a2cc8c74a2535f3a88e68d9424
net: axienet: fix for TX busy handling

Network driver documentation indicates we should be avoiding returning
NETDEV_TX_BUSY from ndo_start_xmit in normal cases, since it requires
the packets to be requeued. Instead the queue should be stopped after
a packet is added to the TX ring when there may not be enough room for an
additional one. Also, when TX ring entries are completed, we should only
wake the queue if we know there is room for another full maximally
fragmented packet.

Print a warning if there is insufficient space at the start of start_xmit,
since this should no longer happen.

Combined with increasing the default TX ring size (in a subsequent
patch), this appears to recover the TX performance lost by previous changes
to actually manage the TX ring state properly.

Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c