From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 71AA72959 for ; Thu, 25 Feb 2016 15:53:27 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 25 Feb 2016 06:53:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="911131178" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga001.fm.intel.com with ESMTP; 25 Feb 2016 06:53:16 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.237]) by IRSMSX152.ger.corp.intel.com ([169.254.6.34]) with mapi id 14.03.0248.002; Thu, 25 Feb 2016 14:53:15 +0000 From: "Ananyev, Konstantin" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX checksum off-load Thread-Index: AQHRafsdpW5YQDe2hkWmNhEEZohk+Z884oLw Date: Thu, 25 Feb 2016 14:53:15 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B0B405@irsmsx105.ger.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> In-Reply-To: <1455765467-3465-6-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWI1OGZjZDMtMmE0ZC00MzAyLWJiYjgtM2FiMzg1ZWRhOGVhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlVXMkZEMWxKbzRPZEMyOHp6ZGZtRWdmYjNqSlVRQktvTEJDSWQ5OUdZVE09In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] 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: Thu, 25 Feb 2016 14:53:28 -0000 Hi Wenzhuo, > -----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 checks= um off-load >=20 > 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. >=20 > Also update release note for VxLAN & NVGRE checksum off-load support. >=20 > 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(-) >=20 > 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 > ------------ >=20 > +* **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. >=20 > Resolved Issues > --------------- > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.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; >=20 > + 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_rxt= x.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) >=20 > 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; >=20 > 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, > } > } >=20 > + 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_VLA= N_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; > } >=20 > /* > @@ -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; > } >=20 > @@ -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; >=20 > /* 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_rxt= x.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. */ I think you are missing outer_l2_len here. Right now, for tunnel packet you setup: TUNNELLEN=3Dmbuf->l2_len;=20 MACLEN=3Dmbuf->l2_len; Though as I could read x550 spec it should be: MACLEN=3Dmbuf->outer_l2_len; TUNNELLEN=3Dmbuf->l2_len; Konstantin > uint64_t tso_segsz:16; /**< TCP TSO segment size */ > uint64_t vlan_tci:16; > /**< VLAN Tag Control Identifier (CPU order). */ > -- > 1.9.3