DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function
@ 2016-03-22 13:13 Zhe Tao
  2016-03-22 13:38 ` Ananyev, Konstantin
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
  0 siblings, 2 replies; 13+ messages in thread
From: Zhe Tao @ 2016-03-22 13:13 UTC (permalink / raw)
  To: dev; +Cc: zhe.tao

Issue:
when using the following CLI in testpmd to enable ipv6 TSO feature
=============
set verbose 1
csum set ip hw 0
csum set udp hw 0
csum set tcp hw 0
csum set sctp hw 0
csum set outer-ip hw 0
csum parse_tunnel on 0
tso set 800 0
set fwd csum

start
=============

We will not get we want, the ipv6 packets sent out from IXIA can be received by
i40e, but cannot forward to another port.
The root cause is when HW doing the TSO offload for packets, it not only depends
on the context descriptor to define the MSS and TSO payload size, it also
need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
set the ipv6 type flag into the data descriptor when the packets are for
ipv6 TSO.  
 
Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 1488f2f..ffd6dba 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1545,6 +1545,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	uint16_t slen;
 	uint64_t buf_dma_addr;
 	union i40e_tx_offload tx_offload = {0};
+	bool enable_checksum = 0;
 
 	txq = tx_queue;
 	sw_ring = txq->sw_ring;
@@ -1620,7 +1621,13 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		/* Enable checksum offloading */
 		cd_tunneling_params = 0;
-		if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) {
+		/* Check whether need to do checksum or not */
+		if ((ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) ||
+		    ((ol_flags & PKT_TX_IPV6) && (ol_flags & PKT_TX_TCP_SEG))) {
+			enable_checksum = 1;
+		}
+
+		if (enable_checksum) {
 			i40e_txd_enable_checksum(ol_flags, &td_cmd, &td_offset,
 				tx_offload, &cd_tunneling_params);
 		}
-- 
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function
  2016-03-22 13:13 [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function Zhe Tao
@ 2016-03-22 13:38 ` Ananyev, Konstantin
  2016-03-22 18:41   ` Zhe Tao
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
  1 sibling, 1 reply; 13+ messages in thread
From: Ananyev, Konstantin @ 2016-03-22 13:38 UTC (permalink / raw)
  To: Tao, Zhe, dev; +Cc: Tao, Zhe

Hi, 

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
> Sent: Tuesday, March 22, 2016 1:14 PM
> To: dev@dpdk.org
> Cc: Tao, Zhe
> Subject: [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function
> 
> Issue:
> when using the following CLI in testpmd to enable ipv6 TSO feature
> =============
> set verbose 1
> csum set ip hw 0
> csum set udp hw 0
> csum set tcp hw 0
> csum set sctp hw 0
> csum set outer-ip hw 0
> csum parse_tunnel on 0
> tso set 800 0
> set fwd csum
> 
> start
> =============
> 
> We will not get we want, the ipv6 packets sent out from IXIA can be received by
> i40e, but cannot forward to another port.
> The root cause is when HW doing the TSO offload for packets, it not only depends
> on the context descriptor to define the MSS and TSO payload size, it also
> need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
> but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
> set the ipv6 type flag into the data descriptor when the packets are for
> ipv6 TSO.
> 
> Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 1488f2f..ffd6dba 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -1545,6 +1545,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>  	uint16_t slen;
>  	uint64_t buf_dma_addr;
>  	union i40e_tx_offload tx_offload = {0};
> +	bool enable_checksum = 0;
> 
>  	txq = tx_queue;
>  	sw_ring = txq->sw_ring;
> @@ -1620,7 +1621,13 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
> 
>  		/* Enable checksum offloading */
>  		cd_tunneling_params = 0;
> -		if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) {
> +		/* Check whether need to do checksum or not */
> +		if ((ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) ||
> +		    ((ol_flags & PKT_TX_IPV6) && (ol_flags & PKT_TX_TCP_SEG))) {
> +			enable_checksum = 1;
> +		}
> +
> +		if (enable_checksum) {
>  			i40e_txd_enable_checksum(ol_flags, &td_cmd, &td_offset,
>  				tx_offload, &cd_tunneling_params);
>  		}


Wonder can't we just include PKT_TX_TCP_SEG into I40E_TX_CKSUM_OFFLOAD_MASK,
and keep i40e_xmit_pkts() unchanged?
Konstantin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function
  2016-03-22 13:38 ` Ananyev, Konstantin
@ 2016-03-22 18:41   ` Zhe Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Zhe Tao @ 2016-03-22 18:41 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: dev

On Tue, Mar 22, 2016 at 09:38:55PM +0800, Ananyev, Konstantin wrote:
> Hi, 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
> > Sent: Tuesday, March 22, 2016 1:14 PM
> > To: dev@dpdk.org
> > Cc: Tao, Zhe
> > Subject: [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function
> > 
> > Issue:
> > when using the following CLI in testpmd to enable ipv6 TSO feature
> > =============
> > set verbose 1
> > csum set ip hw 0
> > csum set udp hw 0
> > csum set tcp hw 0
> > csum set sctp hw 0
> > csum set outer-ip hw 0
> > csum parse_tunnel on 0
> > tso set 800 0
> > set fwd csum
> > 
> > start
> > =============
> > 
> > We will not get we want, the ipv6 packets sent out from IXIA can be received by
> > i40e, but cannot forward to another port.
> > The root cause is when HW doing the TSO offload for packets, it not only depends
> > on the context descriptor to define the MSS and TSO payload size, it also
> > need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
> > but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
> > set the ipv6 type flag into the data descriptor when the packets are for
> > ipv6 TSO.
> > 
> > Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> > 
> > Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> > ---
> >  drivers/net/i40e/i40e_rxtx.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> > index 1488f2f..ffd6dba 100644
> > --- a/drivers/net/i40e/i40e_rxtx.c
> > +++ b/drivers/net/i40e/i40e_rxtx.c
> > @@ -1545,6 +1545,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
> >  	uint16_t slen;
> >  	uint64_t buf_dma_addr;
> >  	union i40e_tx_offload tx_offload = {0};
> > +	bool enable_checksum = 0;
> > 
> >  	txq = tx_queue;
> >  	sw_ring = txq->sw_ring;
> > @@ -1620,7 +1621,13 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
> > 
> >  		/* Enable checksum offloading */
> >  		cd_tunneling_params = 0;
> > -		if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) {
> > +		/* Check whether need to do checksum or not */
> > +		if ((ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) ||
> > +		    ((ol_flags & PKT_TX_IPV6) && (ol_flags & PKT_TX_TCP_SEG))) {
> > +			enable_checksum = 1;
> > +		}
> > +
> > +		if (enable_checksum) {
> >  			i40e_txd_enable_checksum(ol_flags, &td_cmd, &td_offset,
> >  				tx_offload, &cd_tunneling_params);
> >  		}
> 
> 
> Wonder can't we just include PKT_TX_TCP_SEG into I40E_TX_CKSUM_OFFLOAD_MASK,
> and keep i40e_xmit_pkts() unchanged?
> Konstantin
agreed with you, checked the code again, the logic for ipv4 TSO also has some problem,
so should add PKT_TX_TCP_SEG flag for both ipv4&ipv6 TSO to the offload mask.
 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
  2016-03-22 13:13 [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function Zhe Tao
  2016-03-22 13:38 ` Ananyev, Konstantin
@ 2016-03-23  3:27 ` Zhe Tao
  2016-03-23 12:46   ` Ananyev, Konstantin
                     ` (3 more replies)
  1 sibling, 4 replies; 13+ messages in thread
From: Zhe Tao @ 2016-03-23  3:27 UTC (permalink / raw)
  To: dev; +Cc: zhe.tao, jingjing.wu

Issue:
when using the following CLI in testpmd to enable ipv6 TSO feature
=============
set verbose 1
csum set ip hw 0
csum set udp hw 0
csum set tcp hw 0
csum set sctp hw 0
csum set outer-ip hw 0
csum parse_tunnel on 0
tso set 800 0
set fwd csum

start
=============

We will not get we want, the ipv6 packets sent out from IXIA can be received by
i40e, but cannot forward to another port.
The root cause is when HW doing the TSO offload for packets, it not only depends
on the context descriptor to define the MSS and TSO payload size, it also
need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
set the ipv6 type flag into the data descriptor when the packets are for
ipv6 TSO.  
 
Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
---
v2: change condition check for ipv6 TSO checksum offload
    use a more clear check method which include both ipv4 & ipv6 TSO


 drivers/net/i40e/i40e_rxtx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 1488f2f..3422ec2 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -73,9 +73,16 @@
 
 #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS)
 
+/* need to add the TSO flag to the checksum offload mask
+ * even the packets like ipv6 doesn't need the checksum for ip header
+ * but the FW need to know whether this TCP packets is ipv4 or ipv6,
+ * so add this kind of information in the checksum offload field in the
+ * normal data descriptor.
+ */
 #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
 		PKT_TX_IP_CKSUM |		 \
 		PKT_TX_L4_MASK |		 \
+		PKT_TX_TCP_SEG |		 \
 		PKT_TX_OUTER_IP_CKSUM)
 
 static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
@ 2016-03-23 12:46   ` Ananyev, Konstantin
  2016-03-24 14:58   ` Bruce Richardson
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Ananyev, Konstantin @ 2016-03-23 12:46 UTC (permalink / raw)
  To: Tao, Zhe, dev; +Cc: Tao, Zhe, Wu, Jingjing



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
> Sent: Wednesday, March 23, 2016 3:28 AM
> To: dev@dpdk.org
> Cc: Tao, Zhe; Wu, Jingjing
> Subject: [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
> 
> Issue:
> when using the following CLI in testpmd to enable ipv6 TSO feature
> =============
> set verbose 1
> csum set ip hw 0
> csum set udp hw 0
> csum set tcp hw 0
> csum set sctp hw 0
> csum set outer-ip hw 0
> csum parse_tunnel on 0
> tso set 800 0
> set fwd csum
> 
> start
> =============
> 
> We will not get we want, the ipv6 packets sent out from IXIA can be received by
> i40e, but cannot forward to another port.
> The root cause is when HW doing the TSO offload for packets, it not only depends
> on the context descriptor to define the MSS and TSO payload size, it also
> need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
> but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
> set the ipv6 type flag into the data descriptor when the packets are for
> ipv6 TSO.
> 
> Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> ---
> v2: change condition check for ipv6 TSO checksum offload
>     use a more clear check method which include both ipv4 & ipv6 TSO
> 
> 
>  drivers/net/i40e/i40e_rxtx.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 1488f2f..3422ec2 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -73,9 +73,16 @@
> 
>  #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS)
> 
> +/* need to add the TSO flag to the checksum offload mask
> + * even the packets like ipv6 doesn't need the checksum for ip header
> + * but the FW need to know whether this TCP packets is ipv4 or ipv6,
> + * so add this kind of information in the checksum offload field in the
> + * normal data descriptor.
> + */
>  #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
>  		PKT_TX_IP_CKSUM |		 \
>  		PKT_TX_L4_MASK |		 \
> +		PKT_TX_TCP_SEG |		 \
>  		PKT_TX_OUTER_IP_CKSUM)
> 
>  static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
  2016-03-23 12:46   ` Ananyev, Konstantin
@ 2016-03-24 14:58   ` Bruce Richardson
  2016-03-24 15:00   ` Bruce Richardson
  2016-03-31 12:15   ` [dpdk-dev] [PATCH v3] i40e: fix " Zhe Tao
  3 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2016-03-24 14:58 UTC (permalink / raw)
  To: Zhe Tao; +Cc: dev, jingjing.wu

On Wed, Mar 23, 2016 at 11:27:50AM +0800, Zhe Tao wrote:
> Issue:
> when using the following CLI in testpmd to enable ipv6 TSO feature
> =============
> set verbose 1
> csum set ip hw 0
> csum set udp hw 0
> csum set tcp hw 0
> csum set sctp hw 0
> csum set outer-ip hw 0
> csum parse_tunnel on 0
> tso set 800 0
> set fwd csum
> 
> start
> =============
> 
> We will not get we want, the ipv6 packets sent out from IXIA can be received by
> i40e, but cannot forward to another port.
> The root cause is when HW doing the TSO offload for packets, it not only depends
> on the context descriptor to define the MSS and TSO payload size, it also
> need to know whether this packets is ipv4 or ipv6, ipv4 need the header csum,
> but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checksum to
> set the ipv6 type flag into the data descriptor when the packets are for
> ipv6 TSO.  
>  
> Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> ---
> v2: change condition check for ipv6 TSO checksum offload
>     use a more clear check method which include both ipv4 & ipv6 TSO
> 
> 
>  drivers/net/i40e/i40e_rxtx.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 1488f2f..3422ec2 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -73,9 +73,16 @@
>  
>  #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS)
>  
> +/* need to add the TSO flag to the checksum offload mask
> + * even the packets like ipv6 doesn't need the checksum for ip header
> + * but the FW need to know whether this TCP packets is ipv4 or ipv6,
> + * so add this kind of information in the checksum offload field in the
> + * normal data descriptor.
> + */
>  #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
>  		PKT_TX_IP_CKSUM |		 \
>  		PKT_TX_L4_MASK |		 \
> +		PKT_TX_TCP_SEG |		 \
>  		PKT_TX_OUTER_IP_CKSUM)
>  
>  static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
> -- 

To be honest, I'm a little confused by the patch description and the comment
added into the code. The commit message talks about flagging to the HW whether
a packet is IPv4 or IPv6. However, the change made is to add a TCP segmentation
bit to an offload mask - something that seems irrelevant to telling if something
is IPv4 or v6.

As for the comment itself. The comment reads like a commit message for a patch,
rather than as the comment on a macro. The comment talks exclusively about the
TSO part of the mask, and ignores the other values in it. It also suffers the
same problem as the commit message of not explaining how a TSO flag ties in
with identifying IPv4 or v6.

Could you please reword the commit message and rework the comment to be a proper
comment on the whole macro and resubmit the patch. 

Thanks,
/Bruce

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
  2016-03-23 12:46   ` Ananyev, Konstantin
  2016-03-24 14:58   ` Bruce Richardson
@ 2016-03-24 15:00   ` Bruce Richardson
  2016-03-31  3:58     ` Zhe Tao
  2016-03-31 12:15   ` [dpdk-dev] [PATCH v3] i40e: fix " Zhe Tao
  3 siblings, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2016-03-24 15:00 UTC (permalink / raw)
  To: Zhe Tao; +Cc: dev, jingjing.wu

On Wed, Mar 23, 2016 at 11:27:50AM +0800, Zhe Tao wrote:
> Issue:
> when using the following CLI in testpmd to enable ipv6 TSO feature
> =============
> set verbose 1
> csum set ip hw 0
> csum set udp hw 0
> csum set tcp hw 0
> csum set sctp hw 0
> csum set outer-ip hw 0
> csum parse_tunnel on 0
> tso set 800 0
> set fwd csum
> 
> start
> =============

The "===" lines in the message are confusing patchwork. For a new version of
this patch can you indent the commands rather than putting the "===" above and 
below. E.g.

 Issue:
 when using the following CLI in testpmd to enable ipv6 TSO feature

 	set verbose 1
 	csum set ip hw 0
 	csum set udp hw 0
	....

Thanks,
/Bruce

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v2] i40e: fix ipv6 TSO issue for tx function
  2016-03-24 15:00   ` Bruce Richardson
@ 2016-03-31  3:58     ` Zhe Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Zhe Tao @ 2016-03-31  3:58 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, jingjing.wu

On Thu, Mar 24, 2016 at 03:00:14PM +0000, Bruce Richardson wrote:
> On Wed, Mar 23, 2016 at 11:27:50AM +0800, Zhe Tao wrote:
> > Issue:
> > when using the following CLI in testpmd to enable ipv6 TSO feature
> > =============
> > set verbose 1
> > csum set ip hw 0
> > csum set udp hw 0
> > csum set tcp hw 0
> > csum set sctp hw 0
> > csum set outer-ip hw 0
> > csum parse_tunnel on 0
> > tso set 800 0
> > set fwd csum
> > 
> > start
> > =============
> 
> The "===" lines in the message are confusing patchwork. For a new version of
> this patch can you indent the commands rather than putting the "===" above and 
> below. E.g.
> 
>  Issue:
>  when using the following CLI in testpmd to enable ipv6 TSO feature
> 
>  	set verbose 1
>  	csum set ip hw 0
>  	csum set udp hw 0
> 	....
> 
> Thanks,
> /Bruce
very good advise, will send the new patch, thanks!
Zhe Tao

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-dev] [PATCH v3] i40e: fix TSO issue for tx function
  2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
                     ` (2 preceding siblings ...)
  2016-03-24 15:00   ` Bruce Richardson
@ 2016-03-31 12:15   ` Zhe Tao
  2016-03-31 12:18     ` Bruce Richardson
  2016-04-06  8:16     ` [dpdk-dev] [PATCH v4] " Zhe Tao
  3 siblings, 2 replies; 13+ messages in thread
From: Zhe Tao @ 2016-03-31 12:15 UTC (permalink / raw)
  To: dev; +Cc: zhe.tao, jingjing.wu

Issue:

when using the following CLI in testpmd to enable ipv6 TSO feature
(set --txqflags=0 in the testpmd command)
	set verbose 1
	csum set ip hw 0
	csum set udp hw 0
	csum set tcp hw 0
	csum set sctp hw 0
	csum set outer-ip hw 0
	csum parse_tunnel on 0
	tso set 800 0
	set fwd csum
	start

We will not get what we want, the ipv6 packets sent out from IXIA can be 
received by i40e, but cannot forward to another port.
The root cause is when HW doing the TSO offload for packets, it does not only
depends on the context descriptor to define the MSS and TSO payload size, it
also need to know whether this packets is ipv4 or ipv6, we use 
i40e_txd_enable_checksum to generate the related fields for data descriptor.
But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
will set the ip csum flag when the packet is ipv4 and TSO is enabled but 
will not set the flag for ipv6 and this flag will cause the
i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
flag is set.
 
Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
---
 drivers/net/i40e/i40e_rxtx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 81cde6c..6e3fd25 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -76,6 +76,7 @@
 #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
 		PKT_TX_IP_CKSUM |		 \
 		PKT_TX_L4_MASK |		 \
+		PKT_TX_TCP_SEG |		 \
 		PKT_TX_OUTER_IP_CKSUM)
 
 static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
-- 
v2: changed condition check for ipv6 TSO checksum offload
    use a more clear check method which include both ipv4 & ipv6 TSO
v3: edited the commit log and title because this problem exists for both
    ipv4 and ipv6
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v3] i40e: fix TSO issue for tx function
  2016-03-31 12:15   ` [dpdk-dev] [PATCH v3] i40e: fix " Zhe Tao
@ 2016-03-31 12:18     ` Bruce Richardson
  2016-04-06  8:16     ` [dpdk-dev] [PATCH v4] " Zhe Tao
  1 sibling, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2016-03-31 12:18 UTC (permalink / raw)
  To: Zhe Tao; +Cc: dev, jingjing.wu

On Thu, Mar 31, 2016 at 08:15:58PM +0800, Zhe Tao wrote:
> Issue:
> 
> when using the following CLI in testpmd to enable ipv6 TSO feature
> (set --txqflags=0 in the testpmd command)
> 	set verbose 1
> 	csum set ip hw 0
> 	csum set udp hw 0
> 	csum set tcp hw 0
> 	csum set sctp hw 0
> 	csum set outer-ip hw 0
> 	csum parse_tunnel on 0
> 	tso set 800 0
> 	set fwd csum
> 	start
> 
> We will not get what we want, the ipv6 packets sent out from IXIA can be 
> received by i40e, but cannot forward to another port.
> The root cause is when HW doing the TSO offload for packets, it does not only
> depends on the context descriptor to define the MSS and TSO payload size, it
> also need to know whether this packets is ipv4 or ipv6, we use 
> i40e_txd_enable_checksum to generate the related fields for data descriptor.
> But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
> set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
> will set the ip csum flag when the packet is ipv4 and TSO is enabled but 
> will not set the flag for ipv6 and this flag will cause the
> i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
> set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
> The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
> flag is set.
>  
> Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)

Missing sign-off in this version.

> ---
>  drivers/net/i40e/i40e_rxtx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 81cde6c..6e3fd25 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -76,6 +76,7 @@
>  #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
>  		PKT_TX_IP_CKSUM |		 \
>  		PKT_TX_L4_MASK |		 \
> +		PKT_TX_TCP_SEG |		 \
>  		PKT_TX_OUTER_IP_CKSUM)
>  
>  static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
> -- 
> v2: changed condition check for ipv6 TSO checksum offload
>     use a more clear check method which include both ipv4 & ipv6 TSO
> v3: edited the commit log and title because this problem exists for both
>     ipv4 and ipv6
> 2.1.4
> 

This version history is clearer when placed immediately below the commit description.
You also need to use a 3-character cut-line, rather than 2-char, in that case.

/Bruce

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-dev] [PATCH v4] i40e: fix TSO issue for tx function
  2016-03-31 12:15   ` [dpdk-dev] [PATCH v3] i40e: fix " Zhe Tao
  2016-03-31 12:18     ` Bruce Richardson
@ 2016-04-06  8:16     ` Zhe Tao
  2016-04-06 11:23       ` Ananyev, Konstantin
  1 sibling, 1 reply; 13+ messages in thread
From: Zhe Tao @ 2016-04-06  8:16 UTC (permalink / raw)
  To: dev; +Cc: zhe.tao, jingjing.wu

Issue:

when using the following CLI in testpmd to enable ipv6 TSO feature
(set --txqflags=0 in the testpmd command)
	set verbose 1
	csum set ip hw 0
	csum set udp hw 0
	csum set tcp hw 0
	csum set sctp hw 0
	csum set outer-ip hw 0
	csum parse_tunnel on 0
	tso set 800 0
	set fwd csum
	start

We will not get what we want, the ipv6 packets sent out from IXIA can be 
received by i40e, but cannot forward to another port.
The root cause is when HW doing the TSO offload for packets, it does not only
depends on the context descriptor to define the MSS and TSO payload size, it
also need to know whether this packets is ipv4 or ipv6, we use 
i40e_txd_enable_checksum to generate the related fields for data descriptor.
But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
will set the ip csum flag when the packet is ipv4 and TSO is enabled but 
will not set the flag for ipv6 and this flag will cause the
i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
flag is set.
 
Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)

Signed-off-by: Zhe Tao <zhe.tao@intel.com>

---
v2: changed condition check for ipv6 TSO checksum offload
    use a more clear check method which include both ipv4 & ipv6 TSO
v3: edited the commit log and title because this problem exists for both
    ipv4 and ipv6
v4: moved the history under the commit log 
---
 drivers/net/i40e/i40e_rxtx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 59909f3..4d35d83 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -76,6 +76,7 @@
 #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
 		PKT_TX_IP_CKSUM |		 \
 		PKT_TX_L4_MASK |		 \
+		PKT_TX_TCP_SEG |		 \
 		PKT_TX_OUTER_IP_CKSUM)
 
 static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v4] i40e: fix TSO issue for tx function
  2016-04-06  8:16     ` [dpdk-dev] [PATCH v4] " Zhe Tao
@ 2016-04-06 11:23       ` Ananyev, Konstantin
  2016-04-06 13:43         ` Thomas Monjalon
  0 siblings, 1 reply; 13+ messages in thread
From: Ananyev, Konstantin @ 2016-04-06 11:23 UTC (permalink / raw)
  To: Tao, Zhe, dev; +Cc: Tao, Zhe, Wu, Jingjing



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
> Sent: Wednesday, April 06, 2016 9:17 AM
> To: dev@dpdk.org
> Cc: Tao, Zhe; Wu, Jingjing
> Subject: [dpdk-dev] [PATCH v4] i40e: fix TSO issue for tx function
> 
> Issue:
> 
> when using the following CLI in testpmd to enable ipv6 TSO feature
> (set --txqflags=0 in the testpmd command)
> 	set verbose 1
> 	csum set ip hw 0
> 	csum set udp hw 0
> 	csum set tcp hw 0
> 	csum set sctp hw 0
> 	csum set outer-ip hw 0
> 	csum parse_tunnel on 0
> 	tso set 800 0
> 	set fwd csum
> 	start
> 
> We will not get what we want, the ipv6 packets sent out from IXIA can be
> received by i40e, but cannot forward to another port.
> The root cause is when HW doing the TSO offload for packets, it does not only
> depends on the context descriptor to define the MSS and TSO payload size, it
> also need to know whether this packets is ipv4 or ipv6, we use
> i40e_txd_enable_checksum to generate the related fields for data descriptor.
> But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
> set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
> will set the ip csum flag when the packet is ipv4 and TSO is enabled but
> will not set the flag for ipv6 and this flag will cause the
> i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
> set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
> The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
> flag is set.
> 
> Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> 
> ---
> v2: changed condition check for ipv6 TSO checksum offload
>     use a more clear check method which include both ipv4 & ipv6 TSO
> v3: edited the commit log and title because this problem exists for both
>     ipv4 and ipv6
> v4: moved the history under the commit log
> ---
>  drivers/net/i40e/i40e_rxtx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 59909f3..4d35d83 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -76,6 +76,7 @@
>  #define I40E_TX_CKSUM_OFFLOAD_MASK (		 \
>  		PKT_TX_IP_CKSUM |		 \
>  		PKT_TX_L4_MASK |		 \
> +		PKT_TX_TCP_SEG |		 \
>  		PKT_TX_OUTER_IP_CKSUM)
> 
>  static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-dev] [PATCH v4] i40e: fix TSO issue for tx function
  2016-04-06 11:23       ` Ananyev, Konstantin
@ 2016-04-06 13:43         ` Thomas Monjalon
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Monjalon @ 2016-04-06 13:43 UTC (permalink / raw)
  To: Tao, Zhe; +Cc: dev, Ananyev, Konstantin, Wu, Jingjing

> > We will not get what we want, the ipv6 packets sent out from IXIA can be
> > received by i40e, but cannot forward to another port.
> > The root cause is when HW doing the TSO offload for packets, it does not only
> > depends on the context descriptor to define the MSS and TSO payload size, it
> > also need to know whether this packets is ipv4 or ipv6, we use
> > i40e_txd_enable_checksum to generate the related fields for data descriptor.
> > But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
> > set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
> > will set the ip csum flag when the packet is ipv4 and TSO is enabled but
> > will not set the flag for ipv6 and this flag will cause the
> > i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
> > set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
> > The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
> > flag is set.
> > 
> > Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets)
> > 
> > Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-04-06 13:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-22 13:13 [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function Zhe Tao
2016-03-22 13:38 ` Ananyev, Konstantin
2016-03-22 18:41   ` Zhe Tao
2016-03-23  3:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
2016-03-23 12:46   ` Ananyev, Konstantin
2016-03-24 14:58   ` Bruce Richardson
2016-03-24 15:00   ` Bruce Richardson
2016-03-31  3:58     ` Zhe Tao
2016-03-31 12:15   ` [dpdk-dev] [PATCH v3] i40e: fix " Zhe Tao
2016-03-31 12:18     ` Bruce Richardson
2016-04-06  8:16     ` [dpdk-dev] [PATCH v4] " Zhe Tao
2016-04-06 11:23       ` Ananyev, Konstantin
2016-04-06 13:43         ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).