diff mbox

[dpdk-dev] ixgbe: fix a problem with NIC TSO offload

Message ID 20141209171447.9954.48212.stgit@gklab-18-011.igk.intel.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

miroslaw.walukiewicz@intel.com Dec. 9, 2014, 5:14 p.m. UTC
From: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>

The patch fixes a minor issue with setting up of TSO feature for
ixgbe NICs.

The values for l4_len and tso_segsz was chagned first by txoffload mask
and next set up in the NIC descriptor.

Signed-off-by: Mirek Walukiewicz <miroslaw.walukiewicz@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Konstantin Ananyev Dec. 9, 2014, 6:40 p.m. UTC | #1
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of miroslaw.walukiewicz@intel.com

> Sent: Tuesday, December 09, 2014 5:15 PM

> To: dev@dpdk.org

> Subject: [dpdk-dev] [PATCH] ixgbe: fix a problem with NIC TSO offload

> 

> From: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>

> 

> The patch fixes a minor issue with setting up of TSO feature for

> ixgbe NICs.

> 

> The values for l4_len and tso_segsz was chagned first by txoffload mask

> and next set up in the NIC descriptor.

> 

> Signed-off-by: Mirek Walukiewicz <miroslaw.walukiewicz@intel.com>

> ---

>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c |    4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> index 8559ef6..c9c3104 100644

> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> @@ -390,13 +390,13 @@ ixgbe_set_xmit_ctx(struct igb_tx_queue* txq,

>  		type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4 |

>  			IXGBE_ADVTXD_TUCMD_L4T_TCP |

>  			IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;

> +		mss_l4len_idx |= tx_offload.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT;

> +		mss_l4len_idx |= tx_offload.l4_len << IXGBE_ADVTXD_L4LEN_SHIFT;


Didn't  understand your comment above...
By whom tx_offload.l4_len will be changed?
As I can see, below only tx_offload_mask is updated, tx_offload is intact.
Konstantin

> 

>  		tx_offload_mask.l2_len = ~0;

>  		tx_offload_mask.l3_len = ~0;

>  		tx_offload_mask.l4_len = ~0;

>  		tx_offload_mask.tso_segsz = ~0;

> -		mss_l4len_idx |= tx_offload.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT;

> -		mss_l4len_idx |= tx_offload.l4_len << IXGBE_ADVTXD_L4LEN_SHIFT;

>  	} else { /* no TSO, check if hardware checksum is needed */

>  		if (ol_flags & PKT_TX_IP_CKSUM) {

>  			type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4;
miroslaw.walukiewicz@intel.com Dec. 9, 2014, 6:44 p.m. UTC | #2
You are completely right. I did not catch the mask. I will remove the patch.

Mirek

> -----Original Message-----

> From: Ananyev, Konstantin

> Sent: Tuesday, December 9, 2014 7:41 PM

> To: Walukiewicz, Miroslaw; dev@dpdk.org

> Subject: RE: [dpdk-dev] [PATCH] ixgbe: fix a problem with NIC TSO offload

> 

> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of

> miroslaw.walukiewicz@intel.com

> > Sent: Tuesday, December 09, 2014 5:15 PM

> > To: dev@dpdk.org

> > Subject: [dpdk-dev] [PATCH] ixgbe: fix a problem with NIC TSO offload

> >

> > From: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>

> >

> > The patch fixes a minor issue with setting up of TSO feature for

> > ixgbe NICs.

> >

> > The values for l4_len and tso_segsz was chagned first by txoffload mask

> > and next set up in the NIC descriptor.

> >

> > Signed-off-by: Mirek Walukiewicz <miroslaw.walukiewicz@intel.com>

> > ---

> >  lib/librte_pmd_ixgbe/ixgbe_rxtx.c |    4 ++--

> >  1 file changed, 2 insertions(+), 2 deletions(-)

> >

> > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> > index 8559ef6..c9c3104 100644

> > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c

> > @@ -390,13 +390,13 @@ ixgbe_set_xmit_ctx(struct igb_tx_queue* txq,

> >  		type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4 |

> >  			IXGBE_ADVTXD_TUCMD_L4T_TCP |

> >  			IXGBE_ADVTXD_DTYP_CTXT |

> IXGBE_ADVTXD_DCMD_DEXT;

> > +		mss_l4len_idx |= tx_offload.tso_segsz <<

> IXGBE_ADVTXD_MSS_SHIFT;

> > +		mss_l4len_idx |= tx_offload.l4_len <<

> IXGBE_ADVTXD_L4LEN_SHIFT;

> 

> Didn't  understand your comment above...

> By whom tx_offload.l4_len will be changed?

> As I can see, below only tx_offload_mask is updated, tx_offload is intact.

> Konstantin

> 

> >

> >  		tx_offload_mask.l2_len = ~0;

> >  		tx_offload_mask.l3_len = ~0;

> >  		tx_offload_mask.l4_len = ~0;

> >  		tx_offload_mask.tso_segsz = ~0;

> > -		mss_l4len_idx |= tx_offload.tso_segsz <<

> IXGBE_ADVTXD_MSS_SHIFT;

> > -		mss_l4len_idx |= tx_offload.l4_len <<

> IXGBE_ADVTXD_L4LEN_SHIFT;

> >  	} else { /* no TSO, check if hardware checksum is needed */

> >  		if (ol_flags & PKT_TX_IP_CKSUM) {

> >  			type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4;
diff mbox

Patch

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index 8559ef6..c9c3104 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -390,13 +390,13 @@  ixgbe_set_xmit_ctx(struct igb_tx_queue* txq,
 		type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4 |
 			IXGBE_ADVTXD_TUCMD_L4T_TCP |
 			IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
+		mss_l4len_idx |= tx_offload.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT;
+		mss_l4len_idx |= tx_offload.l4_len << IXGBE_ADVTXD_L4LEN_SHIFT;
 
 		tx_offload_mask.l2_len = ~0;
 		tx_offload_mask.l3_len = ~0;
 		tx_offload_mask.l4_len = ~0;
 		tx_offload_mask.tso_segsz = ~0;
-		mss_l4len_idx |= tx_offload.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT;
-		mss_l4len_idx |= tx_offload.l4_len << IXGBE_ADVTXD_L4LEN_SHIFT;
 	} else { /* no TSO, check if hardware checksum is needed */
 		if (ol_flags & PKT_TX_IP_CKSUM) {
 			type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4;