Skip to contentSkip to conversation

tg3: Expand 4g_overflow_test workaround to skb fragments of any size.

PATCH Applied Nithin Nayak Sujir 2 participants 2 messages Dec 20, 2013 – Dec 27, 2013

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

PATCH v2 1/1 tg3: Expand 4g_overflow_test workaround to skb fragments of any size.

The current driver assumes that an skb fragment can only be upto jumbo size. Presumably this was a fast-path optimization. This assumption is no longer true as fragments can be upto 32k.

v2: Remove unnecessary parantheses per Eric Dumazet.

---
 drivers/net/ethernet/broadcom/tg3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +1 -1
index f3dd93b..15a66e4 100644
@@ -7622,7 +7622,7 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
 {
 	u32 base = (u32) mapping & 0xffffffff;
 
-	return (base > 0xffffdcc0) && (base + len + 8 < base);
+	return base + len + 8 < base;
 }
 
 /* Test for TSO DMA buffers that cross into regions which are within MSS bytes
Signature · 1 line
1.8.1.4
maintainer Applied
#1 lore raw

From: Nithin Nayak Sujir <[email protected]>
Date: Thu, 19 Dec 2013 17:44:11 -0800

Quoted 9 lines

The current driver assumes that an skb fragment can only be upto jumbo size. Presumably this was a fast-path optimization. This assumption is no longer true as fragments can be upto 32k.

v2: Remove unnecessary parantheses per Eric Dumazet.

Applied, thank you.