From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E0C9A046B for ; Fri, 28 Jun 2019 12:48:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2C2B5587; Fri, 28 Jun 2019 12:48:02 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4EAA85424; Fri, 28 Jun 2019 12:48:00 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2019 03:47:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,427,1557212400"; d="scan'208";a="153338549" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga007.jf.intel.com with ESMTP; 28 Jun 2019 03:47:57 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.143]) by IRSMSX103.ger.corp.intel.com ([169.254.3.140]) with mapi id 14.03.0439.000; Fri, 28 Jun 2019 11:47:56 +0100 From: "Ananyev, Konstantin" To: Ivan Malov , Olivier Matz CC: "dev@dpdk.org" , Andrew Rybchenko , Stephen Hemminger , "Kulasek, TomaszX" , "stable@dpdk.org" Thread-Topic: [PATCH v3] net: fix the way how L4 checksum choice is tested Thread-Index: AQHVLV9/vDlDRExBA0OCyhPse3GXdKaw4vTg Date: Fri, 28 Jun 2019 10:47:56 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801689E6B90@IRSMSX104.ger.corp.intel.com> References: <20190529173337.31157-1-ivan.malov@oktetlabs.ru> <20190628031309.24215-1-ivan.malov@oktetlabs.ru> In-Reply-To: <20190628031309.24215-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDZkOWY5ZTktYjIyNS00Mzc0LWJjMTktZTIzNzJkMzg0YjE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRGJtU1wvdnU0S3FcL2Q1MHI1Q3NpSGg1RFR1aFwvdU12OHAxVThZSzlveEFuMURYQVc2SlNkSnlYZHNVTVJ2ajRZRiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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] net: fix the way how L4 checksum choice is tested 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" > -----Original Message----- > From: Ivan Malov [mailto:ivan.malov@oktetlabs.ru] > Sent: Friday, June 28, 2019 4:13 AM > To: Olivier Matz > Cc: dev@dpdk.org; Ananyev, Konstantin ; And= rew Rybchenko ; Stephen > Hemminger ; Kulasek, TomaszX ; stable@dpdk.org > Subject: [PATCH v3] net: fix the way how L4 checksum choice is tested >=20 > The API to prepare checksum offloads mistreats L4 > checksum type enum values as self-contained flags. >=20 > Turning these flag checks into enum checks causes > warnings by GCC about possibly uninitialised IPv4 > header pointer. The issue was found to show up in > the case of GCC versions 4.8.5 and 5.4.0, however, > it might be the case for a wider variety of other > versions. Initialise the pointer upon declaration. > and explain the reason behind this in the comment. >=20 > Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") > Cc: Tomasz Kulasek > Cc: stable@dpdk.org >=20 > Signed-off-by: Ivan Malov > Reviewed-by: Andrew Rybchenko > --- > lib/librte_net/rte_net.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h > index 7be69f8..d240206 100644 > --- a/lib/librte_net/rte_net.h > +++ b/lib/librte_net/rte_net.h > @@ -112,7 +112,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, > static inline int > rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) > { > - struct rte_ipv4_hdr *ipv4_hdr; > + /* Initialise ipv4_hdr to avoid false positive compiler warnings. */ > + struct rte_ipv4_hdr *ipv4_hdr =3D NULL; > struct rte_ipv6_hdr *ipv6_hdr; > struct rte_tcp_hdr *tcp_hdr; > struct rte_udp_hdr *udp_hdr; > @@ -150,7 +151,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, > ipv4_hdr->hdr_checksum =3D 0; > } >=20 > - if ((ol_flags & PKT_TX_UDP_CKSUM) =3D=3D PKT_TX_UDP_CKSUM) { > + if ((ol_flags & PKT_TX_L4_MASK) =3D=3D PKT_TX_UDP_CKSUM) { > if (ol_flags & PKT_TX_IPV4) { > udp_hdr =3D (struct rte_udp_hdr *)((char *)ipv4_hdr + > m->l3_len); > @@ -166,7 +167,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, > udp_hdr->dgram_cksum =3D rte_ipv6_phdr_cksum(ipv6_hdr, > ol_flags); > } > - } else if ((ol_flags & PKT_TX_TCP_CKSUM) || > + } else if ((ol_flags & PKT_TX_L4_MASK) =3D=3D PKT_TX_TCP_CKSUM || > (ol_flags & PKT_TX_TCP_SEG)) { > if (ol_flags & PKT_TX_IPV4) { > /* non-TSO tcp or TSO */ > -- Acked-by: Konstantin Ananyev > 1.8.3.1