From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E6D272B9C for ; Fri, 26 Feb 2016 02:37:12 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 25 Feb 2016 17:37:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="54982829" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 25 Feb 2016 17:37:11 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 25 Feb 2016 17:37:11 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 25 Feb 2016 17:37:11 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Fri, 26 Feb 2016 09:37:08 +0800 From: "Lu, Wenzhuo" To: "Ananyev, Konstantin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX checksum off-load Thread-Index: AQHRb9xElXeE0rXm9kGzAEeCEQ6fr589jE2g Date: Fri, 26 Feb 2016 01:37:08 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09090343596B@shsmsx102.ccr.corp.intel.com> References: <1452496044-17524-1-git-send-email-wenzhuo.lu@intel.com> <1455765467-3465-1-git-send-email-wenzhuo.lu@intel.com> <1455765467-3465-6-git-send-email-wenzhuo.lu@intel.com> <2601191342CEEE43887BDE71AB97725836B0B405@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725836B0B405@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX checksum off-load X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 01:37:13 -0000 Hi Konstantin, > -----Original Message----- > From: Ananyev, Konstantin > Sent: Thursday, February 25, 2016 10:53 PM > To: Lu, Wenzhuo; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX > checksum off-load >=20 > Hi Wenzhuo, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > Sent: Thursday, February 18, 2016 3:18 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX > > checksum off-load > > > > The patch add VxLAN & NVGRE TX checksum off-load. When the flag of > > outer IP header checksum offload is set, we'll set the context > > descriptor to enable this checksum off-load. > > > > Also update release note for VxLAN & NVGRE checksum off-load support. > > > > Signed-off-by: Wenzhuo Lu > > --- > > doc/guides/rel_notes/release_2_3.rst | 8 ++++++++ > > drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++ > > drivers/net/ixgbe/ixgbe_rxtx.c | 18 ++++++++++++++++-- > > drivers/net/ixgbe/ixgbe_rxtx.h | 1 + > > 4 files changed, 29 insertions(+), 2 deletions(-) > > > > diff --git a/doc/guides/rel_notes/release_2_3.rst > > b/doc/guides/rel_notes/release_2_3.rst > > index 99de186..5dce7fb 100644 > > --- a/doc/guides/rel_notes/release_2_3.rst > > +++ b/doc/guides/rel_notes/release_2_3.rst > > @@ -4,6 +4,14 @@ DPDK Release 2.3 > > New Features > > ------------ > > > > +* **Added support for VxLAN & NVGRE checksum off-load on X550.** > > + > > + * Added support for VxLAN & NVGRE RX/TX checksum off-load on > > + X550. RX/TX checksum off-load is provided on both inner and > > + outer IP header and TCP header. > > + * Added functions to support VxLAN port configuration. The > > + default VxLAN port number is 4789 but this can be updated > > + programmatically. > > > > Resolved Issues > > --------------- > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > index fd9751e..3c3aa72 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > @@ -2811,6 +2811,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info) > > DEV_TX_OFFLOAD_SCTP_CKSUM | > > DEV_TX_OFFLOAD_TCP_TSO; > > > > + if (hw->mac.type =3D=3D ixgbe_mac_X550 || > > + hw->mac.type =3D=3D ixgbe_mac_X550EM_x) > > + dev_info->tx_offload_capa |=3D > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; > > + > > dev_info->default_rxconf =3D (struct rte_eth_rxconf) { > > .rx_thresh =3D { > > .pthresh =3D IXGBE_DEFAULT_RX_PTHRESH, diff --git > > a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > > index 4ed9ddd..8eab768 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > @@ -85,7 +85,8 @@ > > PKT_TX_VLAN_PKT | \ > > PKT_TX_IP_CKSUM | \ > > PKT_TX_L4_MASK | \ > > - PKT_TX_TCP_SEG) > > + PKT_TX_TCP_SEG | \ > > + PKT_TX_OUTER_IP_CKSUM) > > > > static inline struct rte_mbuf * > > rte_rxmbuf_alloc(struct rte_mempool *mp) @@ -364,6 +365,7 @@ > > ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq, > > uint32_t ctx_idx; > > uint32_t vlan_macip_lens; > > union ixgbe_tx_offload tx_offload_mask; > > + uint32_t seqnum_seed =3D 0; > > > > ctx_idx =3D txq->ctx_curr; > > tx_offload_mask.data =3D 0; > > @@ -430,6 +432,15 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq, > > } > > } > > > > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) { > > + tx_offload_mask.outer_l3_len |=3D ~0; > > + tx_offload_mask.l2_len |=3D ~0; > > + seqnum_seed |=3D tx_offload.outer_l3_len > > + << IXGBE_ADVTXD_OUTER_IPLEN; > > + seqnum_seed |=3D tx_offload.l2_len > > + << IXGBE_ADVTXD_TUNNEL_LEN; > > + } > > + > > txq->ctx_cache[ctx_idx].flags =3D ol_flags; > > txq->ctx_cache[ctx_idx].tx_offload.data =3D > > tx_offload_mask.data & tx_offload.data; @@ -441,7 +452,7 > @@ > > ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq, > > vlan_macip_lens |=3D ((uint32_t)tx_offload.vlan_tci << > IXGBE_ADVTXD_VLAN_SHIFT); > > ctx_txd->vlan_macip_lens =3D rte_cpu_to_le_32(vlan_macip_lens); > > ctx_txd->mss_l4len_idx =3D rte_cpu_to_le_32(mss_l4len_idx); > > - ctx_txd->seqnum_seed =3D 0; > > + ctx_txd->seqnum_seed =3D seqnum_seed; > > } > > > > /* > > @@ -492,6 +503,8 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags) > > cmdtype |=3D IXGBE_ADVTXD_DCMD_VLE; > > if (ol_flags & PKT_TX_TCP_SEG) > > cmdtype |=3D IXGBE_ADVTXD_DCMD_TSE; > > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) > > + cmdtype |=3D (1 << IXGBE_ADVTXD_OUTERIPCS_SHIFT); > > return cmdtype; > > } > > > > @@ -623,6 +636,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, > > tx_offload.l4_len =3D tx_pkt->l4_len; > > tx_offload.vlan_tci =3D tx_pkt->vlan_tci; > > tx_offload.tso_segsz =3D tx_pkt->tso_segsz; > > + tx_offload.outer_l3_len =3D tx_pkt->outer_l3_len; > > > > /* If new context need be built or reuse the exist ctx. */ > > ctx =3D what_advctx_update(txq, tx_ol_req, diff --git > > a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h > > index 475a800..26ff35f 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx.h > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.h > > @@ -168,6 +168,7 @@ union ixgbe_tx_offload { > > uint64_t l2_len:7; /**< L2 (MAC) Header Length. */ > > uint64_t l3_len:9; /**< L3 (IP) Header Length. */ > > uint64_t l4_len:8; /**< L4 (TCP/UDP) Header Length. */ > > + uint64_t outer_l3_len:8; /**< Outer L3 (IP) Hdr Length. */ >=20 > I think you are missing outer_l2_len here. > Right now, for tunnel packet you setup: > TUNNELLEN=3Dmbuf->l2_len; > MACLEN=3Dmbuf->l2_len; > Though as I could read x550 spec it should be: > MACLEN=3Dmbuf->outer_l2_len; > TUNNELLEN=3Dmbuf->l2_len; >=20 > Konstantin Yes, you're right. I cannot set the value of MACLEN to l2_len. I still need= outer_l2_len. Thanks for the comments. I'll correct this mistake. >=20 > > uint64_t tso_segsz:16; /**< TCP TSO segment size */ > > uint64_t vlan_tci:16; > > /**< VLAN Tag Control Identifier (CPU order). */ > > -- > > 1.9.3