From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA6E3A0547; Sun, 18 Apr 2021 21:24:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76B1641108; Sun, 18 Apr 2021 21:24:49 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2084.outbound.protection.outlook.com [40.107.92.84]) by mails.dpdk.org (Postfix) with ESMTP id 165B9410D7 for ; Sun, 18 Apr 2021 21:24:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a92LhS3ZEXtIZK5ETrNKhBf1XNfLhK5FUcsFQ9FEKo2UJ4Nw33FDqHBLPuMIQHEpVdY/BGNtEwQ6y2efUi86WdPNysogg3bomwS8MBctdXVPYKiedhx9IwAthUOnCfg6uguZ1L7Ooi3brmA8Szqv2qIQyjAxcYyFlDCaHVz7W1QPCqeCEiuiWU+SvSBZennyg/0gg+8srQn2jv6k7twUyueKyPzJ5DMcKQUBYpMjlJcO+gSCq5xteCl5sTEWKvgemg3mcP/tdqSllYVkokG9T38JPCvmtTMByFSt9b8BcVcOzolX5QNk771zmM9oKwz0K0d1OPDqs9Ob4BOs7JY/ow== 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=NzAc7nK0BKo+WK7011wHRNbSlIgOZynV+OH3jkHcxVU=; b=D04qnKJN7w+y/w/iP+c9+YSKy0b88tzO7hb1OVyNIw8TbI08334fe/uBg4C8gKZJzRkXimPXfob4YMYsgB4wO2Cr205jR1JbwOYUSwxnTjAn/ukMIWsS8K76jda65wsKW3+hD+k6Ltikcx0hqAAI5HcB990Bu/Ymqg2BSJ6dxOCLP1MBv2oGXWMFhrawUYlh0R+rPxpQsUFZTbTklXoFTxaaCO5JxsKQ5FaRxd/xZ7xhlEwNuJOWoJMlkN8fTFxsBv4vFjhOxfhEVJqTKGclkuf3uWe0zmdFVKGvSojHJ5FX+jd9YFI1S1wowOyXH5qVpI3haLgjj0Q5/ZAly2uDpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NzAc7nK0BKo+WK7011wHRNbSlIgOZynV+OH3jkHcxVU=; b=OzlzWoVWfy1U0ZumySXM2rVMuT3dlPvOHqNRxqjBIe2Alll46q+k410NTg5sBU3OAhi4dtaYlOtZ9Gex6sm5hRD1XJo0G/aethcLjwWpEHeDO28jBV/wdnFD6QgwmWkBYY20llZdj+rRsSAlS1uznrQxyCfBx2bBoKZLzqnRb7aRK4/Jpiv7fL5ZNacokGzqwTNNVjy/1sO8cnRConpfu6OJInHBlmpFRzZI9Zhol1tf0xZgR8HWa6j/X7LvmJMbbysgRvXC5g18MkUJHdnx2c+REUhxS8kzkhqBdFgnqXPmfI9Ea87rj+msDO/j72av+2PVtu7Vur+WMAahCHmkVA== Received: from BY5PR12MB4834.namprd12.prod.outlook.com (2603:10b6:a03:1b2::17) by BYAPR12MB3030.namprd12.prod.outlook.com (2603:10b6:a03:ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16; Sun, 18 Apr 2021 19:24:45 +0000 Received: from BY5PR12MB4834.namprd12.prod.outlook.com ([fe80::45ab:9d36:e3f8:40e2]) by BY5PR12MB4834.namprd12.prod.outlook.com ([fe80::45ab:9d36:e3f8:40e2%3]) with mapi id 15.20.4042.024; Sun, 18 Apr 2021 19:24:45 +0000 From: Gregory Etelson To: NBU-Contact-Thomas Monjalon CC: Ori Kam , "ajit.khaparde@broadcom.com" , "andrew.rybchenko@oktetlabs.ru" , "dev@dpdk.org" , "ferruh.yigit@intel.com" , "jerinj@marvell.com" , "jerinjacobk@gmail.com" , "olivier.matz@6wind.com" , Slava Ovsiienko , Matan Azrad , Raslan Darawsheh Thread-Topic: [PATCH v6 1/2] ethdev: add packet integrity checks Thread-Index: AQHXNGrGXzsRNgFL5UK7nrCHlgqIwaq6k7QAgAALurA= Date: Sun, 18 Apr 2021 19:24:45 +0000 Message-ID: References: <20210418155136.23684-1-getelson@nvidia.com> <20210418155136.23684-2-getelson@nvidia.com> <1821559.2F0b4OcNhU@thomas> In-Reply-To: <1821559.2F0b4OcNhU@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [176.230.227.114] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4472b22b-7742-4eaa-3ebd-08d9029fa00d x-ms-traffictypediagnostic: BYAPR12MB3030: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True 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: bqHbR7dx4Dk62cp55aUrz4l584Xgvne34/voXjy+bIlUlIswiiNZg/vaaaoclsQptbl7D344jp1RrwtARFy0VL+tECr9Bn4nPE8ZDAGYNE6Swc0otOSjOOQzCYUV8on6KO6H/00KI0Ds+A2h1DyzL5RL0EzTYXL5Vk/bjMT+I1KBHOvqVxBe6HOkNhlk287hH+1CSFqT10AlvUtT2dCrx0x/JsUBzgRwkmAfHEryhE94QTt70w2pRN4pYrkn4cGSMjJsY0mggium/IQUlavvjSg4HDm9F0a6p42ExMEkR3z2cgjIRtMV9kRptQzQ6y+7c5M8aJ+5KIUBtdSqZ5Q3fH7EUnstbaDiQ7sAxlEKyPjQi7oUKlcmpmwvbtusT99bLqOnjdhbfmxw3ON1to3jdMMbwcJO6rzqt180yLoBK1Ul3YnYdxfFElIDTXOUWNDHLZYPOXAJHrehfcPyaLuCZX3fT562kbeVAAbjN0TirZFuOgAjiaxYwBcfDClTVMVU88euTv2hYgR2/H+IQQWLl/Lqebn9TJ+EmArsC5+gEqpgdgUzbtNy4wW33V4Kt+ntrQkJCNQS7lnjsMTaA4P3wudIp2fWn5HJqwt3N9/F8zA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4834.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(7696005)(186003)(6916009)(5660300002)(66476007)(107886003)(66446008)(38100700002)(66556008)(122000001)(33656002)(2906002)(66946007)(64756008)(8936002)(71200400001)(76116006)(4326008)(6506007)(54906003)(9686003)(8676002)(55016002)(478600001)(86362001)(316002)(83380400001)(52536014)(53546011)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?PolSFzAcHvSK5tjvMUmimWECC2tmv6InQH8+ImZVr0Cx8dQdCKVhYYf/fygX?= =?us-ascii?Q?g7YC7zfSW1KYc/LUwyVNW5gNElyCSV2BJYqS9r2GVcI0bsQV8FcNk45a7eE4?= =?us-ascii?Q?CsJLW0I5YGMpRtSCRp1vPT+i60+ZUJjYBKebMgm9AyDDacpyxyB+AiWcBKXq?= =?us-ascii?Q?Ykpzy7KEiVUVbv/ojOIUzUgzJIk0l7RuxkIdNsVTEC61oTGgcRuZcrTRAU6W?= =?us-ascii?Q?8qX/0/Q1w3Htdk3gtYtqTEYrIV3QtRdW0q95gxf8wC9c+WJ8/MPKXM8NPd+v?= =?us-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oKZ3IXKAZzeXtW?= =?us-ascii?Q?IlYJX0kTLRZ169aK55QRgXJ2uIGah6kt9bwfM7LNdf8paSlu0WPxIU/oVn5L?= =?us-ascii?Q?ycFiq0Hr51zK5/xmny3YlyXVUfL3Oczc1jS6cdDJoaoTSuvc9PI5+qWyPKDF?= =?us-ascii?Q?LyREy/1k4K6IaAXopFypcQ4N?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4834.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4472b22b-7742-4eaa-3ebd-08d9029fa00d X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2021 19:24:45.6904 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lvWjpg24MUyBplpBF9jZ8UmabMX0CfdXZIhpNAtK10gAums+I850yFv/eFYNTVTJf3c51Or2308HTqzU8U40Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3030 Subject: Re: [dpdk-dev] [PATCH v6 1/2] ethdev: add packet integrity checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Hello Thomas, I modified the following drivers/net/mlx5/mlx5_flow_age.c compilation comma= nd to produce pre-processed source code output: 1 # 1 "../drivers/net/mlx5/mlx5_flow_age.c" 2 # 1 "/.autodirect/mtrswgwork/getelson/src/dpdk/stable/build-dev//" 3 # 1 "" 4 #define __STDC__ 1 ** 5 #define __STDC_VERSION__ 201112L 6 #define __STDC_UTF_16__ 1 According to the result, the built-in __STDC_VERSION__ macro was set to 201= 112L. Therefore, in rte_common.h, RTE_STD_C11 macro was evaluated as empty value: Source code: 30 #ifndef typeof 31 #define typeof __typeof__ 32 #endif 33 34 #ifndef asm 35 #define asm __asm__ 36 #endif 37 38 /** C extension macro for environments lacking C11 features. */ 39 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L 40 #define RTE_STD_C11 __extension__ 41 #else 42 #define RTE_STD_C11 43 #endif Preprocessor output: # 29 "../lib/librte_eal/include/rte_common.h" 2 #define typeof __typeof__ #define asm __asm__ #define RTE_STD_C11 According to these results, RTE_STD_C11 location in code has no significanc= e, because it will always be replaced with empty string. After I changed RTE_STD_C11 condition like this:=20 - #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L + #if !defined(__STDC_VERSION__) || __STDC_VERSION__ <=3D 201112L -__extension__ +RTE_STD_C11 struct rte_flow_item_integrity { the compilation completed successfully both for 32 and 64 bits value. Regards, Gregory.=20 The compilation command was copied from `ninja --verbose` output: cc -Idrivers/libtmp_rte_net_mlx5.a.p -Idrivers -I../drivers -Idrivers/net/m= lx5 -I../drivers/net/mlx5 \ -Idrivers/net/mlx5/linux -I../drivers/net/mlx5/linux -Ilib/librte_ethdev -I= ../lib/librte_ethdev \ -I. -I.. -Iconfig -I../config -Ilib/librte_eal/include -I../lib/librte_eal/= include -Ilib/librte_eal/linux/include \ -I../lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../lib/lib= rte_eal/x86/include \ -Ilib/librte_eal/common -I../lib/librte_eal/common -Ilib/librte_eal -I../li= b/librte_eal \ -Ilib/librte_kvargs -I../lib/librte_kvargs -Ilib/librte_metrics -I../lib/li= brte_metrics \ -Ilib/librte_telemetry -I../lib/librte_telemetry -Ilib/librte_net -I../lib/= librte_net \ -Ilib/librte_mbuf -I../lib/librte_mbuf -Ilib/librte_mempool -I../lib/librte= _mempool \ -Ilib/librte_ring -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_m= eter -Idrivers/bus/pci \ -I../drivers/bus/pci -I../drivers/bus/pci/linux -Ilib/librte_pci -I../lib/l= ibrte_pci \ -Idrivers/bus/vdev -I../drivers/bus/vdev -Ilib/librte_hash -I../lib/librte_= hash \ -Ilib/librte_rcu -I../lib/librte_rcu -Idrivers/common/mlx5 -I../drivers/com= mon/mlx5 \ -Idrivers/common/mlx5/linux -I../drivers/common/mlx5/linux -I/usr//usr/incl= ude \ -I/usr/include/libnl3 -pipe -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -g= \ -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat \ -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prot= otypes \ -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wst= rict-prototypes \ -Wundef -Wwrite-strings -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC= \ -march=3Dnative -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -std=3Dc11 \ -Wno-strict-prototypes -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=3D60= 0 \ -pedantic -DPEDANTIC -MD -MQ drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_= flow_age.c.o \ -MF drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_age.c.o.d \ -o drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_age.c.o -c ../drivers= /net/mlx5/mlx5_flow_age.c=20 > -----Original Message----- > From: Thomas Monjalon > Sent: Sunday, April 18, 2021 21:12 > To: Gregory Etelson > Cc: Ori Kam ; ajit.khaparde@broadcom.com; > andrew.rybchenko@oktetlabs.ru; dev@dpdk.org; ferruh.yigit@intel.com; > jerinj@marvell.com; jerinjacobk@gmail.com; olivier.matz@6wind.com; > Slava Ovsiienko ; Gregory Etelson > ; Matan Azrad ; Raslan > Darawsheh > Subject: Re: [PATCH v6 1/2] ethdev: add packet integrity checks >=20 > External email: Use caution opening links or attachments >=20 >=20 > 18/04/2021 17:51, Gregory Etelson: > > +__extension__ >=20 > That still doesn't make sense, as in v5. > The things which require a macro are anonymous union, anonymous struct > and some bit fields with special sizes. >=20 > > +struct rte_flow_item_integrity { > > + /**< Tunnel encapsulation level the item should apply to. > > + * @see rte_flow_action_rss > > + */ > > + uint32_t level; >=20 > Should have RTE_STD_C11 here. >=20 > > + union { >=20 > Should have RTE_STD_C11 here. >=20 > > + struct { > > + /**< The packet is valid after passing all HW che= cks. */ > > + uint64_t packet_ok:1; > > + /**< L2 layer is valid after passing all HW check= s. */ > > + uint64_t l2_ok:1; > > + /**< L3 layer is valid after passing all HW check= s. */ > > + uint64_t l3_ok:1; > > + /**< L4 layer is valid after passing all HW check= s. */ > > + uint64_t l4_ok:1; > > + /**< L2 layer CRC is valid. */ > > + uint64_t l2_crc_ok:1; > > + /**< IPv4 layer checksum is valid. */ > > + uint64_t ipv4_csum_ok:1; > > + /**< L4 layer checksum is valid. */ > > + uint64_t l4_csum_ok:1; > > + /**< The l3 length is smaller than the frame leng= th. */ > > + uint64_t l3_len_ok:1; > > + uint64_t reserved:56; >=20 > The reserved space looks useless since it is in an union. >=20 > > + }; >=20 > I'm not sure about the 64-bit bitfields. > Maybe that's why you need __extension__. > I feel 32 bits are enough. >=20 > > + uint64_t value; > > + }; > > +}; >=20 >=20