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 3E2A5A054F; Wed, 17 Mar 2021 00:05:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F14D940A4B; Wed, 17 Mar 2021 00:05:58 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by mails.dpdk.org (Postfix) with ESMTP id C22AF40040 for ; Wed, 17 Mar 2021 00:05:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzwAcAYBmuS6LCG2O6UebzPhPt960nfu7uriVmvFfnXgF5stGGFrmboqYEQhwycyqqGcmfuqxDhSS3lVrz3n0InUySLyGuipASZNuPjY/6kMM6PgaZbi4FXXvbb+g9ltwDfvqSyhcB/ZAUVp+njmdRv6YFrPWBPMdOVCcyVDh/QnlE83tgFIKTegy1F6bn5KLVXCI9jvUo4F1l7k+sqtPjppI+GfceW2iWNnwFYMxkgebN+uW60IHoOA3z3cC5B0jOXuKKHG2LkE1ffpDrOPwC674uoQXPjHPA1oPKUDw2Xnp8/aLRj+OdRsrxxgMc3jVwttag+Fu4tRI1S1icEwBg== 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=xdRkyXaokBTyKL7H3Rn+oUV8HbTy1yKZ1S4HTkFbGdI=; b=WBonJAh7x8DlVE99LOVGbOVLShRjIB1sMhwBjkmVTBbx+wUA4UeZkZ/bAvcwIITEZNbHEw0juwvsohOOh/PY42VUIvLr3q9GE1FdQSwIsz1nCGuqYT+mucn/rIQB6gfRUOPW5RtnLll3VY1yQYf8x052sXO6U5NYdBdINVSeZca0+9YtLrFtPJcO+8BrsehAVyQmvErnJpesV5iabWWR8N0hW4IagMhKhQeiWvaH+1y/s2vuWwsPfPBU8S5MAxY0ggjjfu6Bis5dSiSJ+wpJbglS2tzIFJDzDIQRbs6Zg3t8JJVFh3cCYF5Kn6xdAopG3VpdVMIXLCN77JyaJwn28g== 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=xdRkyXaokBTyKL7H3Rn+oUV8HbTy1yKZ1S4HTkFbGdI=; b=q/jY/ltJcBMjGpIN4w647I8+qFmogtslPDAdUBkrhHY6XzwNV2Sir3M+o16unUnezbP/l1l3EFEgLMDrTsMUi3WqEM7sTMDmg29UQbasqh2IDj85k+3MokIt8jujaDiwzkSAVZThaTmGlg7yebLegPzlAsoPVRnkn1vdQ3aZY3HszygHl6muonjjN88Ew6QTCSw+99VS4L295DZRZZtO/N2CTp+6zOwv6+2Tpnwi5nTWxzCX8n6FRRgiPZ1twvw7nQuLNv2HQuyQ7mqTtaxSjAnXkEaIzy3fluLT6UnCwKbt73vtiTvc2s+ANOUKlVonprOORcNdQsSQFVxvf2Fo6g== Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB2892.namprd12.prod.outlook.com (2603:10b6:5:182::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Tue, 16 Mar 2021 23:05:56 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308%7]) with mapi id 15.20.3933.032; Tue, 16 Mar 2021 23:05:56 +0000 From: Ori Kam To: Ivan Malov , "dev@dpdk.org" CC: Andrew Rybchenko , Andy Moreton , NBU-Contact-Thomas Monjalon , Ferruh Yigit Thread-Topic: [PATCH 02/10] ethdev: reuse header definition in flow pattern item VLAN Thread-Index: AQHXFyKMAg7HEpHowUWoQF+b21k5mKqHQ40A Date: Tue, 16 Mar 2021 23:05:56 +0000 Message-ID: References: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> <20210312093143.28186-2-ivan.malov@oktetlabs.ru> In-Reply-To: <20210312093143.28186-2-ivan.malov@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.145.126] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 69b1b8b3-3db8-44d6-2d40-08d8e8d00e69 x-ms-traffictypediagnostic: DM6PR12MB2892: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OOXHr4XI2uZAe911yFVSp2CRReIVerLm5PLRcvxEQB2XPaZuwu2OOK0TxdehE8vaOIxZswOtQUIUST1XoztywURbttw16JUFt1/Fv1b5w7hJWOweLyJBIJ/+7L8DZmVC3QkeiS0IR6QQC0+qbrMBjWF41xPoJ8LMFYA5DQfTEkOEnsAEq4DRQTbO8/n+tpxxEWbELn+AKaXWLFTpyUvr8ET7TSB7zAUcC+OJ/768YyanQAt561Rj/LOBIwnDReQ9V4RYb43cqOHHlEIiAA8pQ98Vv01y9bT3Nx8nkmX2/uckkCk/6SfUcgUJTzUCqPYcESEJji/ltKn8a4z150ZWNMecloNWgUWB/3ggEEzs4MsQJLYd3A494LxJ/33E1ck+DJ9Ggvc+W/0IDujSuIjYIfYL3VTQuYF32w5UnNUq00tsGF6lwX08PxqLWhXLXzkSZCC4+9rIFPxPjnCO6xaEpe+AFO2WDTF5n4cL6MAWyr2if5/NY0xGbhYyPVoAEOTLEL1jBhZkVN+3+neJp4Znxwq9Ewtv5JhzRkodRBsgxZaoqrVI0y3bTDoJi5bok1ps x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(366004)(39860400002)(396003)(54906003)(71200400001)(33656002)(52536014)(186003)(9686003)(2906002)(5660300002)(55016002)(478600001)(4326008)(86362001)(66476007)(8936002)(7696005)(83380400001)(66446008)(76116006)(64756008)(66946007)(66556008)(26005)(110136005)(6506007)(316002)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?CWOw8AlDdPhSurdCBfHuafXVCj0gjSYEog9SQ0YIaIRAC0xLHRzgzvG+HOJe?= =?us-ascii?Q?sqGZ0gLhqgQ41d92mUTjKs11zxnSIxU9DLtEGknHFbr0iISqY/gvVz2axDjN?= =?us-ascii?Q?INq/chFHrvEzkYPcyd/oD8Tma9ZqoQ6f8IsZ8MR0aRidhkbxQIULP2MVn15g?= =?us-ascii?Q?KagRoq2SoNeavocLh5R47FML9kD82TI+aW5jFh+QClLUSzTdWi5vhEIhY8/j?= =?us-ascii?Q?SC2a8J1ivFV6sPjFeXOCsAuEAtpo/GJHmHBbXwUaT2JnDBj4QFisZZoTrvkI?= =?us-ascii?Q?l8iY3ZS1+mNfDMgLfpKSi3uZjBaNPEt2kwp/IAJN+/ZqAd5OGMCHTK3nIT6K?= =?us-ascii?Q?mhnYojLZWN1w674gklgFFBejILk/q8OB3mMH1beK5jPrSqnxlRaA+ood3Lp2?= =?us-ascii?Q?bJ9lLbnJkqtu8zK2cHaxTO7bic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ascii?Q?CVSokne3nm/FfFZUhokRIVfP?= 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: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69b1b8b3-3db8-44d6-2d40-08d8e8d00e69 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2021 23:05:56.5290 (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: t1WIGXkaprBmIGHJI1y9CKaa7a6HgY+u4IpuyIWWhAFNx0bWlPQjfc8A9taL3ywmpLc1S6eCVIXRP3ku4crhoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2892 Subject: Re: [dpdk-dev] [PATCH 02/10] ethdev: reuse header definition in flow pattern item VLAN 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" Hi Ivan, > -----Original Message----- > From: Ivan Malov > Sent: Friday, March 12, 2021 11:32 AM >=20 > One ought to reuse existing header structs in flow items. > This particular item contains non-header fields, so it's > important to keep the header fields in a separate struct. >=20 > Signed-off-by: Ivan Malov > Reviewed-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > --- > lib/librte_ethdev/rte_flow.h | 22 ++++++++++++++++------ > 1 file changed, 16 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index 96fd93ee1..b9b349669 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -778,13 +778,23 @@ static const struct rte_flow_item_eth > rte_flow_item_eth_mask =3D { > * If a @p VLAN item is present in the pattern, then only tagged packets= will > * match the pattern. > * The field @p has_more_vlan can be used to match any type of tagged > packets, > - * instead of using the @p inner_type field. > - * If the @p inner_type and @p has_more_vlan fields are not specified, > + * instead of using the @p eth_proto field of @p hdr. > + * If the @p eth_proto of @p hdr and @p has_more_vlan fields are not > specified, > * then any tagged packets will match the pattern. > */ > +RTE_STD_C11 > struct rte_flow_item_vlan { > - rte_be16_t tci; /**< Tag control information. */ > - rte_be16_t inner_type; /**< Inner EtherType or TPID. */ > + union { > + struct { > + /* > + * These fields are retained for compatibility. > + * Please switch to the new header field below. > + */ > + rte_be16_t tci; /**< Tag control information. */ > + rte_be16_t inner_type; /**< Inner EtherType or TPID. > */ > + }; > + struct rte_vlan_hdr hdr; > + }; > uint32_t has_more_vlan:1; > /**< Packet header contains at least one more VLAN, after this VLAN. > */ > uint32_t reserved:31; /**< Reserved, must be zero. */ > @@ -793,8 +803,8 @@ struct rte_flow_item_vlan { > /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */ > #ifndef __cplusplus > static const struct rte_flow_item_vlan rte_flow_item_vlan_mask =3D { > - .tci =3D RTE_BE16(0x0fff), > - .inner_type =3D RTE_BE16(0x0000), > + .hdr.vlan_tci =3D RTE_BE16(0x0fff), > + .hdr.eth_proto =3D RTE_BE16(0x0000), > }; > #endif >=20 > -- > 2.20.1 Acked-by: Ori Kam Best, Ori