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 5D223A0526; Tue, 21 Jul 2020 10:11:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB8AF1C027; Tue, 21 Jul 2020 10:11:14 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2053.outbound.protection.outlook.com [40.107.22.53]) by dpdk.org (Postfix) with ESMTP id 5D4941BFEF; Tue, 21 Jul 2020 10:11:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URJ678iHcxTW6HffaryYL5vkDsdr4DzNF5CTg1mlBWHlIoTybPrE7HuvCI9m1/s6fGBcw885rDByaMr1aoHEdwRXhcNJMTLFJSfE3bX9yYFcXu5wec9IB82mgJomcBd5SNZwj4EUtzgQCWHqsbqpOZADGz+PpvIxssjeelvRsZRnFT2UB0vvVTMnyTTl2iuM8IR0yHe/+vz36wlW80b2aNbDuvEGSBBfjIg+vzx5rYRhbxefo9fK+L7u9nNBm7oE2hchQ4LEI/bkDcSFRv0FoTpqOMbUawaDgfKPA7WYqs/zO++AHbUVEg2tx1elAKmaDwo3yfKpTJI/dqfwpjh7Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3MX7tij6Q81A2dYYrZGfjvXwfv8OVujitdkIAuAYDP8=; b=Xa5M8NegoMJO8gpNm4t38ve1EaDoDhYiB/UYJNg8Gu8eI7Ihda4S19DEt9MhlQcN7y1KE9VrUSX5LublC0+xL/XHJfYoReHyy5kjirl/pNEnGXQko1y5KeiIKy0Cku0Q06c4bTzg5rB7gMWwVBu2Tkw4+nv9jz8QYYo3FHmpSjPFuQYszynJ99h15mRHt+lAIXvi5Y2s1T1vX/iG3YTK1vQbVFCnMXnuoomQT6rtJjrSY42Vu/+2SxTscmhAFpFimF/eZmcEzzAU/i90oDj7LreNnH1WWyOxwsFunRIuXOmuqYwD0XI83CeR9yHMnDvY3sFQmztUCUUUwq76QZvUOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3MX7tij6Q81A2dYYrZGfjvXwfv8OVujitdkIAuAYDP8=; b=ZmQbmahOwfQx/0sRTyAh0AxuWz+XjSJ9tjXFRAf6ppn0YNtjvIS5VWnI8U0gD21nB279VnO7R6JiWKYjbtrjEKN6orAixFt86WN1Gw7UQzPw4ZE4UyCCGbuwrWMAJInJ53l5RrVIWNEqMArZTv5ZAnIrX4HE5nJNdVRYMwXLE3s= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Tue, 21 Jul 2020 08:11:12 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012%5]) with mapi id 15.20.3195.026; Tue, 21 Jul 2020 08:11:12 +0000 From: Raslan Darawsheh To: Olivier Matz CC: Ferruh Yigit , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net: fix compilation with pedantic enabled Thread-Index: AQHWW2prhqFNoRFqYEyi0nK3CzOslKkRLpWAgAB2UYCAAAUxcIAABkaAgAAE0sA= Date: Tue, 21 Jul 2020 08:11:12 +0000 Message-ID: References: <1594901556-11826-1-git-send-email-rasland@mellanox.com> <20200721070925.GF5869@platinum> <20200721075027.GG5869@platinum> In-Reply-To: <20200721075027.GG5869@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bde08ebf-b6f7-4151-9997-08d82d4da1e7 x-ms-traffictypediagnostic: AM0PR05MB6707: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +YMzHJWcNmKGEtBGOAEnc+FWEeVeJsef5HHjXZEjfP9q2vAZoCXea9NI3EfRnlpDF5Hyit5jfMPESjNYmPywd40cHEBiQhCCYn6t9vcWS4/d5q50/Rp3rQpj+OLH6Jo80FS+SXs9zBBSGwNefRFsIaEyhaFUdRti8HAph3r+rRW6rjrvM/0qlwF/C1P3MjGgXES61qYdxsE2LlfOfPiuWrXBUtnvtutS9ckXKMbOAFiAImK/qw4zocrEugyW9aq2l/IpOngNo3XoaL9J+Y39zW+NdpNsOg5UkjaNu7vn2B1ah93xoiuzwQxjUstUsfzBMNSEYAfPdrpgHW6Pt5WfiePX08WQbyhSs+zHcGHP1TA1LVi7/iSIZGe3RwkvjxajmH8I9OfIVTvHvi7/ofV56swJkEKQb0iL5H7eWKsZcKRoiLckgOezoUEv+TnApVqVh1e8iDLVqdBOn2ILRaODoPhoobH5ykb88hVml2SIFL4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(346002)(366004)(396003)(136003)(478600001)(71200400001)(83380400001)(66946007)(9686003)(66476007)(316002)(83080400001)(66446008)(64756008)(66556008)(186003)(966005)(76116006)(55016002)(54906003)(6506007)(2906002)(52536014)(33656002)(26005)(4326008)(5660300002)(6916009)(45080400002)(8936002)(7696005)(8676002)(86362001)(53546011); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: reWUtI/AUERGLRdRf8JdGEwAbuI1H/7qEb18Pms5jSEmbH8A9n0kh6qM0ZcpoOZdyBIVYxwDzJXRRPU3GHSJgM3TKfzI2qtaU4RbUCDKN/SgR5xAHKLpxQeI5ZAmACD4XRr/04O8KqTpRV9ESpM2B+/SHzt7mw64vh908Dogm9Fw26bW8NiONLM0PKMHL53NuULtxKP4YPg+5+8TlUV0N2SE6fmzu6W2PA5dIyDft7/XuHYBi7hL7ZKzJ49xJ5gqyYTUWzjDvgtAN91cxrBsTJ1Pv9nCpakCbBuJjanBkAu9pKcXRZdwgeQuD7c0ltaqDw6/sMwpuk4dKx0VDQe2Y9XUHQJ82hFWOIS/7YZPqT6cUjhhx9CZE5hSEjSZvncg9C/Ni65pQK8EBJuMMd0HulNYcslERJaavgNal4jXfSmZCtzof17XpW4pjNWPg9dq2W7EPEA7zRX2uHqJOFb2nnqxOAol08uWz0M7MX93kWQ1VAy83u2XJw3mjxipbIty x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6707.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bde08ebf-b6f7-4151-9997-08d82d4da1e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 08:11:12.3403 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ns1rVN4JGJKoi7CfR1BFbVeYwZ0239XV14roHYgCutHx6vOvC7/SFtduep0QjXt1OaYi6+QD5+Xvsvu0b2asRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6707 Subject: Re: [dpdk-dev] [PATCH] net: fix compilation with pedantic enabled 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" Hi Olivier, > -----Original Message----- > From: Olivier Matz > Sent: Tuesday, July 21, 2020 10:50 AM > To: Raslan Darawsheh > Cc: Ferruh Yigit ; dev@dpdk.org; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net: fix compilation with pedantic enable= d >=20 > Hi Raslan, >=20 > On Tue, Jul 21, 2020 at 07:37:51AM +0000, Raslan Darawsheh wrote: > > Hi, > > > -----Original Message----- > > > From: Olivier Matz > > > Sent: Tuesday, July 21, 2020 10:09 AM > > > To: Ferruh Yigit > > > Cc: Raslan Darawsheh ; dev@dpdk.org; > > > stable@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] net: fix compilation with pedantic > enabled > > > > > > Hi, > > > > > > On Tue, Jul 21, 2020 at 01:05:57AM +0100, Ferruh Yigit wrote: > > > > On 7/16/2020 1:12 PM, Raslan Darawsheh wrote: > > > > > when trying to compile rte_mpls with pedantic enabled, > > > > > it will complain about bit field defintion. > > > > > error: type of bit-field 'bs' is a GCC extension [-Werror=3Dpedan= tic] > > > > > error: type of bit-field 'tc' is a GCC extension [-Werror=3Dpedan= tic] > > > > > error: type of bit-field 'tag_lsb' is a GCC extension [-Werror=3D= pedantic] > > > > ' > > > > I tried to reproduce by adding to '-pedantic' to 'rte_net.c' (which= uses > > > > 'rte_mpls.h') but not able to get the warning. Is this happen with > specific > > > > version of the compiler? > > > > Yes It happens only with old compilers, maybe I should have mentioned > that in the commit log (my mistake). > > gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28) > > > > > > > > > > > > > > > > This fixes the compilation error. > > > > > > > > > > Fixes: e480cf487a0d ("net: add MPLS header structure") > > > > > Cc: olivier.matz@6wind.com > > > > > Cc: stable@dpdk.org > > > > > > > > > > Signed-off-by: Raslan Darawsheh > > > > > --- > > > > > lib/librte_net/rte_mpls.h | 12 ++++++------ > > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > > > diff --git a/lib/librte_net/rte_mpls.h b/lib/librte_net/rte_mpls.= h > > > > > index db91707..ecd1f64 100644 > > > > > --- a/lib/librte_net/rte_mpls.h > > > > > +++ b/lib/librte_net/rte_mpls.h > > > > > @@ -24,13 +24,13 @@ extern "C" { > > > > > struct rte_mpls_hdr { > > > > > uint16_t tag_msb; /**< Label(msb). */ > > > > > #if RTE_BYTE_ORDER =3D=3D RTE_BIG_ENDIAN > > > > > - uint8_t tag_lsb:4; /**< Label(lsb). */ > > > > > - uint8_t tc:3; /**< Traffic class. */ > > > > > - uint8_t bs:1; /**< Bottom of stack. */ > > > > > + uint32_t tag_lsb:4; /**< Label(lsb). */ > > > > > + uint32_t tc:3; /**< Traffic class. */ > > > > > + uint32_t bs:1; /**< Bottom of stack. */ > > > > > #else > > > > > - uint8_t bs:1; /**< Bottom of stack. */ > > > > > - uint8_t tc:3; /**< Traffic class. */ > > > > > - uint8_t tag_lsb:4; /**< label(lsb) */ > > > > > + uint32_t bs:1; /**< Bottom of stack. */ > > > > > + uint32_t tc:3; /**< Traffic class. */ > > > > > + uint32_t tag_lsb:4; /**< label(lsb) */ > > > > > #endif > > > > > uint8_t ttl; /**< Time to live. */ > > > > > } __rte_packed; > > > > > > > > The struct size keeps same after change, do you know if this behavi= or is > > > part of > > > > standard and guaranteed? > > > > > > I have the same fear. > > To my understanding and please correct me if I'm wrong, the type of the > bit fields shouldn't change the size of the structure, > > As long as the bit order is kept the same, and I made a small test for = it and > checked the size of the struct it gave 4 bytes (sizeof()) with both defin= itions. >=20 > You are probably right, however we saw some differences in the > behavior in specific conditions. > See > https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpatch > work.dpdk.org%2Fpatch%2F70458%2F&data=3D02%7C01%7Crasland%40 > mellanox.com%7C023ed8bf39414a67c72a08d82d4abcd8%7Ca652971c7d2e4d > 9ba6a4d149256f461b%7C0%7C0%7C637309146327936161&sdata=3DFloAa6 > Xhg%2FNwIyUSNER808q%2FYJ3ZsunczM%2FyQKxs5NA%3D&reserved=3D > 0 for instance. >=20 Thanks for pointing me to this, I'll send a V2 having __extension__ instead= then, > > > > > > Would it make sense to add __extension__ instead? We already do that > > > for gre, for instance. > > Yes I guess this can work as well, > > > > Kindest regards > > Raslan Darawsheh Kindest regards, Raslan Darawsheh