From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9D68C48BD7 for ; Thu, 27 Jun 2019 13:09:34 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 69F442084B for ; Thu, 27 Jun 2019 13:09:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69F442084B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFCA62D13; Thu, 27 Jun 2019 15:09:33 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1E60A23D for ; Thu, 27 Jun 2019 15:09:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 06:09:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,423,1557212400"; d="scan'208";a="189056630" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga002.fm.intel.com with ESMTP; 27 Jun 2019 06:09:29 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.143]) by irsmsx105.ger.corp.intel.com ([169.254.7.184]) with mapi id 14.03.0439.000; Thu, 27 Jun 2019 14:09:28 +0100 From: "Ananyev, Konstantin" To: Ivan Malov , Olivier Matz CC: "dev@dpdk.org" , Andrew Rybchenko Thread-Topic: [PATCH v2] mbuf: outer offsets are undefined for non-tunnel packets Thread-Index: AQHVKqZe1X7n1xnLjECNTOOJErgXI6avfOFQ Date: Thu, 27 Jun 2019 13:09:27 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801689E609E@IRSMSX104.ger.corp.intel.com> References: <20190412150542.12026-1-ivan.malov@oktetlabs.ru> <20190624160206.21014-1-ivan.malov@oktetlabs.ru> In-Reply-To: <20190624160206.21014-1-ivan.malov@oktetlabs.ru> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2VjN2ZkYWUtNThlNC00NTViLTg4YzUtYTU5ZDAxYTE5YzQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRGI2Qks2T3BxVkh6WVRQVzFKeDI2NlRcL2ZjWk5QWDMrQ2Y3SFZueWM2OGNZWXJtVHg0WitvcjdrdlRtYnJPTHkifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] mbuf: outer offsets are undefined for non-tunnel packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > The default policy for offload-specific fields is that > they are undefined unless the corresponding offloads are > requested in mbuf ol_flags. This is also the case for outer > L2 and L3 length fields which must not be assumed to contain > zeros for non-tunnel packets. The patch clarifies this behaviour > in the comments. PMDs which mistakenly assume these fields > to be zero for non-tunnel packets are expected to comply > with the clarified comment and have dedicated fixes. >=20 > Signed-off-by: Ivan Malov > --- > lib/librte_mbuf/rte_mbuf.h | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 0d9fef0..26a0b14 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -702,7 +702,18 @@ struct rte_mbuf { > uint64_t tso_segsz:RTE_MBUF_TSO_SEGSZ_BITS; > /**< TCP TSO segment size */ >=20 > - /* fields for TX offloading of tunnels */ > + /* > + * Fields for Tx offloading of tunnels. > + * These are undefined for packets which don't request > + * any tunnel offloads (outer IP or UDP checksum, > + * tunnel TSO). > + * > + * PMDs are advised not to use these fields > + * unconditionally when calculating offsets. I'd use something stronger then 'are advised not to'. Might be something like: 'should not use'. BTW, from the previous discussion, right now we do have some misbehaving PMDs that need to be fixed, correct? Apart from that: Acked-by: Konstantin Ananyev =20 > + * > + * Applications are expected to set appropriate tunnel > + * offload flags when they fill in these fields. > + */ > uint64_t outer_l3_len:RTE_MBUF_OUTL3_LEN_BITS; > /**< Outer L3 (IP) Hdr Length. */ > uint64_t outer_l2_len:RTE_MBUF_OUTL2_LEN_BITS; > -- > 1.8.3.1