Skip to contentSkip to conversation

ixgbevf: Handle extended IPv6 headers in tx path

PATCH Superseded Mark D Rustad 2 participants 2 messages Nov 7, 2015 – Nov 13, 2015

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbevf: Handle extended IPv6 headers in tx path

Check for and handle IPv6 extended headers so that tx checksum offload can be done. Thanks to Tom Herbert for noticing this problem. Note that the goto back to process the final protocol value can never result in a loop, because it cannot be yet another extended header. Handling them in this manner avoids adding further checks to the non-extended header hot path.

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +18 -1
index 3d257279e770..06d29e11aaf4 100644
@@ -3367,6 +3367,7 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,
 			break;
 		}
 
+again:
 		switch (l4_hdr) {
 		case IPPROTO_TCP:
 			type_tucmd |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
@@ -3383,7 +3384,23 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,
 					IXGBE_ADVTXD_L4LEN_SHIFT;
 			break;
 		default:
-			if (unlikely(net_ratelimit())) {
+			if (first->protocol == htons(ETH_P_IPV6) &&
+			    ipv6_ext_hdr(l4_hdr)) {
+				unsigned int offset = 0;
+				int ret;
+
+				ret = ipv6_find_hdr(skb, &offset, -1, NULL,
+						    NULL);
+				if (ret > 0) {
+					l4_hdr = ret;
+					goto again;
+				}
+				if (unlikely(net_ratelimit())) {
+					dev_warn(tx_ring->dev,
+						 "ipv6_find_hdr returned %d\n",
+						 ret);
+				}
+			} else if (unlikely(net_ratelimit())) {
 				dev_warn(tx_ring->dev,
 					 "partial checksum but l4 proto=%x!\n",
 					 l4_hdr);
#1 lore raw

PATCH 1/1 ixgbevf: Handle extended IPv6 headers in tx path

Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Mark D Rustad
Sent: Friday, November 06, 2015 4:36 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH] ixgbevf: Handle extended IPv6 headers in tx path

Quoted 8 lines

Check for and handle IPv6 extended headers so that tx checksum offload can be done. Thanks to Tom Herbert for noticing this problem. Note that the goto back to process the final protocol value can never result in a loop, because it cannot be yet another extended header. Handling them in this manner avoids adding further checks to the non-extended header hot path.