Skip to contentSkip to conversation

sunvnet: failed trigger should not cause BUG_ON()

PATCH Applied David L Stevens 3 participants 3 messages Feb 19, 2015 – Feb 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunvnet: failed trigger should not cause BUG_ON()

An error return from __vnet_tx_trigger() sets the TX descriptor to VIO_DESC_FREE while leaving port->tx_bufs[txi].skb set. This leads to a BUG_ON() the next time this descriptor is used.

This patch frees the pending skb when getting a trigger error to match the VIO_DESC_FREE state.

---
 drivers/net/ethernet/sun/sunvnet.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/sun/sunvnet.c +2 -0
index 2b10b85..0943fb3 100644
@@ -1414,6 +1414,8 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (unlikely(err < 0)) {
 		netdev_info(dev, "TX trigger error %d\n", err);
 		d->hdr.state = VIO_DESC_FREE;
+		skb = port->tx_bufs[txi].skb;
+		port->tx_bufs[txi].skb = NULL;
 		dev->stats.tx_carrier_errors++;
 		goto out_dropped;
 	}
Signature · 1 line
1.7.1
maintainer Applied
#2 lore raw
In reply to David L Stevens

From: David L Stevens <[email protected]>
Date: Thu, 19 Feb 2015 13:15:49 -0500

Quoted 8 lines

An error return from __vnet_tx_trigger() sets the TX descriptor to VIO_DESC_FREE while leaving port->tx_bufs[txi].skb set. This leads to a BUG_ON() the next time this descriptor is used.

This patch frees the pending skb when getting a trigger error to match the VIO_DESC_FREE state.

Applied, thanks David.