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 920952BC2 for ; Tue, 22 Mar 2016 14:38:59 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 22 Mar 2016 06:38:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,377,1455004800"; d="scan'208";a="769058849" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga003.jf.intel.com with ESMTP; 22 Mar 2016 06:38:58 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 13:38:56 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.35]) by irsmsx111.ger.corp.intel.com ([169.254.2.127]) with mapi id 14.03.0248.002; Tue, 22 Mar 2016 13:38:56 +0000 From: "Ananyev, Konstantin" To: "Tao, Zhe" , "dev@dpdk.org" CC: "Tao, Zhe" Thread-Topic: [dpdk-dev] [PATCH] i40e: fix ipv6 TSO issue for tx function Thread-Index: AQHRhDzFA1Wsv9sdHUCt/vWJKstsaJ9ldY1g Date: Tue, 22 Mar 2016 13:38:55 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B1FA93@irsmsx105.ger.corp.intel.com> References: <1458652425-6167-1-git-send-email-zhe.tao@intel.com> In-Reply-To: <1458652425-6167-1-git-send-email-zhe.tao@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWI0MTMzMjctYWY4Zi00NzM5LTgwYjctYjA4MzAwMDlkNzc0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlFPU1ljRVpGWklkMUpPWmpYMWFRTkJwTFloOHpzYjkxNm9KcjZsUlhwRVU9In0= 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] i40e: fix ipv6 TSO issue for tx function 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: Tue, 22 Mar 2016 13:39:00 -0000 Hi,=20 > -----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 >=20 > Issue: > when using the following CLI in testpmd to enable ipv6 TSO feature > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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 >=20 > start > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > We will not get we want, the ipv6 packets sent out from IXIA can be recei= ved 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 c= sum, > but ipv6 doesn't need the csum. We need to use the i40e_txd_enable_checks= um to > set the ipv6 type flag into the data descriptor when the packets are for > ipv6 TSO. >=20 > Fixes: e3f0151f (i40e: enable Tx checksum only for offloaded packets) >=20 > Signed-off-by: Zhe Tao > --- > drivers/net/i40e/i40e_rxtx.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > 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 =3D {0}; > + bool enable_checksum =3D 0; >=20 > txq =3D tx_queue; > sw_ring =3D txq->sw_ring; > @@ -1620,7 +1621,13 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **t= x_pkts, uint16_t nb_pkts) >=20 > /* Enable checksum offloading */ > cd_tunneling_params =3D 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 =3D 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