Skip to contentSkip to conversation

sunvnet: fix rx packet length check to allow for TSO

PATCH Applied David L Stevens 3 participants 3 messages Jan 13, 2015

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

PATCH 1/1 sunvnet: fix rx packet length check to allow for TSO

This patch fixes the rx packet length check in the sunvnet driver to allow for a TSO max packet length greater than the LDC channel negotiated MTU. These are negotiated separately and there is no requirement that port->tsolen be less than port->rmtu, but if it isn't, it'll drop packets with rx length errors.

---
 drivers/net/ethernet/sun/sunvnet.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/ethernet/sun/sunvnet.c +6 -1
index d2835bf..b5a1d3d 100644
@@ -351,10 +351,15 @@ static int vnet_rx_one(struct vnet_port *port, struct vio_net_desc *desc)
 	unsigned int len = desc->size;
 	unsigned int copy_len;
 	struct sk_buff *skb;
+	int maxlen;
 	int err;
 
 	err = -EMSGSIZE;
-	if (unlikely(len < ETH_ZLEN || len > port->rmtu)) {
+	if (port->tso && port->tsolen > port->rmtu)
+		maxlen = port->tsolen;
+	else
+		maxlen = port->rmtu;
+	if (unlikely(len < ETH_ZLEN || len > maxlen)) {
 		dev->stats.rx_length_errors++;
 		goto out_dropped;
 	}
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · David L Stevens

This patch fixes the rx packet length check in the sunvnet driver to allow for a TSO max packet length greater than the LDC channel negotiated MTU. These are negotiated separately and there is no requirement that port->tsolen be less than port->rmtu, but if it isn't, it'll drop packets with rx length errors.

--Sowmini

maintainer Applied
#2 lore raw
In reply to David L Stevens

From: David L Stevens <[email protected]>
Date: Tue, 13 Jan 2015 12:45:05 -0500

Quoted 7 lines

This patch fixes the rx packet length check in the sunvnet driver to allow for a TSO max packet length greater than the LDC channel negotiated MTU. These are negotiated separately and there is no requirement that port->tsolen be less than port->rmtu, but if it isn't, it'll drop packets with rx length errors.

Applied, thanks David.