From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D2D32DE0 for ; Tue, 10 Feb 2015 07:03:36 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 09 Feb 2015 22:03:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,548,1418112000"; d="scan'208";a="683490349" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga002.jf.intel.com with ESMTP; 09 Feb 2015 22:03:05 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Feb 2015 14:03:03 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by shsmsx102.ccr.corp.intel.com ([169.254.2.62]) with mapi id 14.03.0195.001; Tue, 10 Feb 2015 14:03:03 +0800 From: "Zhang, Helin" To: Olivier Matz , "dev@dpdk.org" Thread-Topic: [PATCH v2 03/20] i40e: call i40e_txd_enable_checksum only for offloaded packets Thread-Index: AQHQQFyWjtKsfOOTWkKLI/2HKPDxX5zpbO/g Date: Tue, 10 Feb 2015 06:03:02 +0000 Message-ID: References: <1422623775-8050-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-4-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1423041925-26956-4-git-send-email-olivier.matz@6wind.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 v2 03/20] i40e: call i40e_txd_enable_checksum only for offloaded packets 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, 10 Feb 2015 06:03:38 -0000 > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Wednesday, February 4, 2015 5:25 PM > To: dev@dpdk.org > Cc: Ananyev, Konstantin; Liu, Jijiang; Zhang, Helin; olivier.matz@6wind.c= om > Subject: [PATCH v2 03/20] i40e: call i40e_txd_enable_checksum only for > offloaded packets >=20 > From i40e datasheet: >=20 > The IP header type and its offload. In case of tunneling, the IIPT > relates to the inner IP header. See also EIPT field for the outer > (External) IP header offload. >=20 > 00 - non IP packet or packet type is not defined by software > 01 - IPv6 packet > 10 - IPv4 packet with no IP checksum offload > 11 - IPv4 packet with IP checksum offload >=20 > Therefore it is not needed to fill the IIPT field if no offload is reques= ted (we can > keep the value to 00). For instance, the linux driver code does not set i= t when > (skb->ip_summed !=3D CHECKSUM_PARTIAL). We can do the same in the dpdk > driver. >=20 > The function i40e_txd_enable_checksum() that fills the offload registers = can > only be called for packets requiring an offload. >=20 > Signed-off-by: Olivier Matz > --- > lib/librte_pmd_i40e/i40e_rxtx.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_r= xtx.c > index 8e9df96..9acdeee 100644 > --- a/lib/librte_pmd_i40e/i40e_rxtx.c > +++ b/lib/librte_pmd_i40e/i40e_rxtx.c > @@ -74,6 +74,11 @@ >=20 > #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | > I40E_TX_DESC_CMD_RS) >=20 > +#define I40E_TX_CKSUM_OFFLOAD_MASK ( \ > + PKT_TX_IP_CKSUM | \ > + PKT_TX_L4_MASK | \ > + PKT_TX_OUTER_IP_CKSUM) > + > #define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \ > (uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM) >=20 > @@ -1272,10 +1277,12 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, uint16_t nb_pkts) >=20 > /* Enable checksum offloading */ > cd_tunneling_params =3D 0; > - i40e_txd_enable_checksum(ol_flags, &td_cmd, &td_offset, > - l2_len, l3_len, outer_l2_len, > - outer_l3_len, > - &cd_tunneling_params); > + if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) { likely should be added. > + i40e_txd_enable_checksum(ol_flags, &td_cmd, &td_offset, > + l2_len, l3_len, outer_l2_len, > + outer_l3_len, > + &cd_tunneling_params); > + } As this code changes are in fast path, performance regression test is neede= d. I would like to see the performance difference with or without this patch set. Hope= fully nothing different. If you need any helps, just let me know. Regards, Helin >=20 > if (unlikely(nb_ctx)) { > /* Setup TX context descriptor if required */ > -- > 2.1.4