diff mbox

[dpdk-dev,v2] ixgbe: fix TSO in IPv6

Message ID 1434982878-6466-1-git-send-email-david.marchand@6wind.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

David Marchand June 22, 2015, 2:21 p.m. UTC
From: Didier Pallard <didier.pallard@6wind.com>

When TSO is used with IPv6, generated frames are incorrect.
L4 frame is OK, but length field of IPv6 header was not populated correctly.

IXGBE_ADVTXD_TUCMD_IPV6 flag is set for better readability, even if it does
nothing.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

---
 drivers/net/ixgbe/ixgbe_rxtx.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Helin Zhang June 22, 2015, 2:23 p.m. UTC | #1
> -----Original Message-----
> From: David Marchand [mailto:david.marchand@6wind.com]
> Sent: Monday, June 22, 2015 10:21 PM
> To: dev@dpdk.org
> Cc: Ananyev, Konstantin; Zhang, Helin; Didier Pallard
> Subject: [PATCH v2] ixgbe: fix TSO in IPv6
> 
> From: Didier Pallard <didier.pallard@6wind.com>
> 
> When TSO is used with IPv6, generated frames are incorrect.
> L4 frame is OK, but length field of IPv6 header was not populated correctly.
> 
> IXGBE_ADVTXD_TUCMD_IPV6 flag is set for better readability, even if it does
> nothing.
> 
> Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Thomas Monjalon June 22, 2015, 2:59 p.m. UTC | #2
> > From: Didier Pallard <didier.pallard@6wind.com>
> > 
> > When TSO is used with IPv6, generated frames are incorrect.
> > L4 frame is OK, but length field of IPv6 header was not populated correctly.
> > 
> > IXGBE_ADVTXD_TUCMD_IPV6 flag is set for better readability, even if it does
> > nothing.
> > 
> > Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
> > Signed-off-by: David Marchand <david.marchand@6wind.com>
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Acked-by: Helin Zhang <helin.zhang@intel.com>

Applied, thanks
diff mbox

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 7cc26ef..3ace8a8 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -375,10 +375,15 @@  ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
 
 	/* check if TCP segmentation required for this packet */
 	if (ol_flags & PKT_TX_TCP_SEG) {
-		/* implies IP cksum and TCP cksum */
-		type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4 |
-			IXGBE_ADVTXD_TUCMD_L4T_TCP |
-			IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
+		/* implies IP cksum in IPv4 */
+		if (ol_flags & PKT_TX_IP_CKSUM)
+			type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4 |
+				IXGBE_ADVTXD_TUCMD_L4T_TCP |
+				IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
+		else
+			type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV6 |
+				IXGBE_ADVTXD_TUCMD_L4T_TCP |
+				IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
 
 		tx_offload_mask.l2_len |= ~0;
 		tx_offload_mask.l3_len |= ~0;