From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id DE2E83772 for ; Mon, 24 Oct 2016 14:56:45 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 24 Oct 2016 05:56:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="23041516" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga005.jf.intel.com with ESMTP; 24 Oct 2016 05:56:44 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.177]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0248.002; Mon, 24 Oct 2016 13:56:43 +0100 From: "Ananyev, Konstantin" To: "Kulasek, TomaszX" , "dev@dpdk.org" CC: "olivier.matz@6wind.com" Thread-Topic: [PATCH v8 1/6] ethdev: add Tx preparation Thread-Index: AQHSK6npwSXXPzaQDkC9bhxU/0FwXKC3hxBw///65ACAABH/sA== Date: Mon, 24 Oct 2016 12:56:42 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0CB102@irsmsx105.ger.corp.intel.com> References: <1477057376-16224-1-git-send-email-tomaszx.kulasek@intel.com> <1477061177-15828-1-git-send-email-tomaszx.kulasek@intel.com> <1477061177-15828-2-git-send-email-tomaszx.kulasek@intel.com> <2601191342CEEE43887BDE71AB9772583F0CB086@irsmsx105.ger.corp.intel.com> <3042915272161B4EB253DA4D77EB373A14F44670@IRSMSX102.ger.corp.intel.com> In-Reply-To: <3042915272161B4EB253DA4D77EB373A14F44670@IRSMSX102.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 1/6] ethdev: add Tx preparation 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: Mon, 24 Oct 2016 12:56:46 -0000 > -----Original Message----- > From: Kulasek, TomaszX > Sent: Monday, October 24, 2016 1:49 PM > To: Ananyev, Konstantin ; dev@dpdk.org > Cc: olivier.matz@6wind.com > Subject: RE: [PATCH v8 1/6] ethdev: add Tx preparation >=20 > Hi Konstantin, >=20 > > -----Original Message----- > > From: Ananyev, Konstantin > > Sent: Monday, October 24, 2016 14:15 > > To: Kulasek, TomaszX ; dev@dpdk.org > > Cc: olivier.matz@6wind.com > > Subject: RE: [PATCH v8 1/6] ethdev: add Tx preparation > > > > Hi Tomasz, > > >=20 > [...] >=20 > > > > > > +/** > > > + * Fix pseudo header checksum > > > + * > > > + * This function fixes pseudo header checksum for TSO and non-TSO > > > +tcp/udp in > > > + * provided mbufs packet data. > > > + * > > > + * - for non-TSO tcp/udp packets full pseudo-header checksum is coun= ted > > and set > > > + * in packet data, > > > + * - for TSO the IP payload length is not included in pseudo header. > > > + * > > > + * This function expects that used headers are in the first data > > > +segment of > > > + * mbuf, and are not fragmented. > > > + * > > > + * @param m > > > + * The packet mbuf to be validated. > > > + * @return > > > + * 0 if checksum is initialized properly > > > + */ > > > +static inline int > > > +rte_phdr_cksum_fix(struct rte_mbuf *m) { > > > + struct ipv4_hdr *ipv4_hdr; > > > + struct ipv6_hdr *ipv6_hdr; > > > + struct tcp_hdr *tcp_hdr; > > > + struct udp_hdr *udp_hdr; > > > + uint64_t ol_flags =3D m->ol_flags; > > > + uint64_t inner_l3_offset =3D m->l2_len; > > > + > > > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) > > > + inner_l3_offset +=3D m->outer_l2_len + m->outer_l3_len; > > > + > > > + /* headers are fragmented */ > > > + if (unlikely(rte_pktmbuf_data_len(m) >=3D inner_l3_offset + m->l3_l= en > > + > > > + m->l4_len)) > > > > Might be better to move that check into rte_validate_tx_offload(), so i= t > > would be called only when TX_DEBUG is on. >=20 > While unfragmented headers are not general requirements for Tx offloads, = and this requirement is for this particular implementation, > maybe for performance reasons will be better to keep it here, and just ad= d #if DEBUG to leave rte_validate_tx_offload more generic. Hmm and what is the advantage to pollute that code with more ifdefs? Again, why unfragmented headers are not general requirements? As long as DPDK pseudo-headear csum calculation routines can't handle fragm= ented case, it pretty much is a general requirement, no? Konstantin >=20 > > Another thing, shouldn't it be: > > if (rte_pktmbuf_data_len(m) < inner_l3_offset + m->l3_len + m->l4_len) = ? >=20 > Yes, it should. >=20 > > Konstantin > > >=20 > Tomasz