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 4A942A053A; Wed, 5 Aug 2020 08:48:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C03F2B98; Wed, 5 Aug 2020 08:48:20 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130082.outbound.protection.outlook.com [40.107.13.82]) by dpdk.org (Postfix) with ESMTP id 89E0829D2 for ; Wed, 5 Aug 2020 08:48:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bkPsrSICLjG+IM0BgCdobEXdHZbei9a1lIaF0RkjVmP+rPgWrV1XH3RuS4qTqs9F1Q4v6s1T9NAeJxBrybA/FVu2fECafKn9K3+tqB09O+Qn/3mnmySpYLXQesmId1IYyBu2eVELNLLf+oBrFnooxeRD9GwfkEWFRZq/HcoacgHPkTnGv5HTclfGWM13xZlld9oW8Sbr61vUI1nI+03iIFrU85dmDj+p0Z5Zd8+rU9ZFjpPwzhxkwg4qb3lLGSVrMeyW0Y6dYZBfkbrYhq6RR8uXcaLJtBzvCgfa0XrEXCcOSvQ6Ut5lddTsV78bH7pYti/DlNXx2RzricCEO8p8Wg== 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=ZvmbK5Ge6fAMaPMOy4QsxSnA3I+kqREjUh0IASdGqLs=; b=cefBayRMmNyj7BPb2vwDzWaMam6FnML2Si2hC0UfoJG7ibGzSoKZMUmb8fohzREngbWG+lY84Q2Ptz1DPA+A4DpLBv/KiaEhKNOnHJZWj/HRDeipdRwoVfE2mE7H+Dy00S8Qy+rBkztrnYpYIM/d8VMAzC4W14re44FEosNHd+LUO0BfsGkDjCY/FZa4Hx8NQpVm7g3GV1biOSYkTzt/bXzEHCDml/Z3dbizMBLwg7iq3bBgazR2eGm9vtmpEGvVV0azrAy5lT0LA772jvevngVGqA3v45MnpJbBtvN9ILAZBTFfCQa5YTSkRzjItdeKKKG1cCTPG4C5mPo4OC/5Gg== 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=ZvmbK5Ge6fAMaPMOy4QsxSnA3I+kqREjUh0IASdGqLs=; b=Ch7OSXX9oWstPO3E4Xi6CJWMGG/L4wlG3YY2BV1pwALhqnj9lS5V+1i5a5ozAN6ADIRaF/X27/n8bfHwS3ayeU2YYjXNFHT8V9OfCcZBrvotEFcFTxUeBCD63CeuUu1YlbJImHBfwv/EV8sJG9dBNFnnWhQgxtKpGrxjchJSCWU= Received: from VI1PR05MB5390.eurprd05.prod.outlook.com (2603:10a6:803:8d::23) by VI1PR05MB3328.eurprd05.prod.outlook.com (2603:10a6:802:1d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Wed, 5 Aug 2020 06:48:17 +0000 Received: from VI1PR05MB5390.eurprd05.prod.outlook.com ([fe80::f4a6:fe4e:514e:7697]) by VI1PR05MB5390.eurprd05.prod.outlook.com ([fe80::f4a6:fe4e:514e:7697%5]) with mapi id 15.20.3239.022; Wed, 5 Aug 2020 06:48:17 +0000 From: Dekel Peled To: Stephen Hemminger CC: "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" , Ori Kam , Thomas Monjalon , Asaf Penso , Matan Azrad , Eli Britstein , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC] ethdev: add VLAN attributes to ETH item Thread-Index: AQHWanVcAq1H72cMB0WIuO3IMmhoSakoIeKAgADv65A= Date: Wed, 5 Aug 2020 06:48:17 +0000 Message-ID: References: <6e8b7c61a92b51749b11ac3bfae5c0201352f9b3.1596550675.git.dekelp@mellanox.com> <20200804092209.1d68e8c2@hermes.lan> In-Reply-To: <20200804092209.1d68e8c2@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [5.29.54.105] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ee3f8974-ba8d-414a-b427-08d8390b88c4 x-ms-traffictypediagnostic: VI1PR05MB3328: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EsmicxB4mZBLXVFitcH3CdK2f0ITt89ubJgUgkRoNervYOrPYTCODw0gUP8RWN88Na3PGE2A59eanfvwh7TyT75pKGmJCkeNsWjezUoTS06DHuv+WeH4iIzBHc0lza8Gtbos5bB8wnYYz1+ZlFWQAT1M1iTNwsTFPWSPnqoMMye+CrqWKvG7TadT8Doc8qnEcyW4SyNqqJlI4ois3bRm1Hq8bBw8Ud/WqkDC18RmdQsRc5Sw1wFRpuHjRQAnIxgvMfY+PRzOPsxlEyM9So1knwZT4pgb+YW31ys2ubmTspjWQ/JYkRJQRVABacCTRFEvcZ/HERpICJF+EKjaitiO+tlknb/j6w7pcFkkxA/6seeNAHuYdVKO0sxTmnuU8T6oCyzdKOpgjohJ3G5QwL+ulw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5390.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(396003)(39860400002)(376002)(366004)(136003)(7696005)(8936002)(8676002)(478600001)(2906002)(54906003)(186003)(53546011)(316002)(6506007)(5660300002)(33656002)(45080400002)(966005)(71200400001)(26005)(6916009)(83380400001)(83080400001)(52536014)(76116006)(66446008)(64756008)(66556008)(66476007)(9686003)(86362001)(55016002)(66946007)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: A9Gk7ZEKv4F2qWapogrrCXto+Te8LCOeYIs2j5ZwF+WNh1rF1aIgfnyY1UnK292Mu57cIJNrpwYl1ojNYOe0KmNFcrO54jciKzcpLcU8Tb0kh0bSjZ827uiBJXclPVd+517rqpLWatb5XUJu8U2G3fbs3NJtpG+WqH6bfCE8fEIzf1O2s46sqhbv07vwCw0hIyOey3E0KbXhxDAx9XQcfSitRfXX2toUTBl4EW3gGakHSa7krfyXtIpU8UK1l1ctUkskQq7MIxJ01Et78JPyhDGE4WVR67/7xjsUF9nckblNUIZ0aaPKISIua5Wh546Sa/soFkMgTZFkPZu3SnImV5KobUV/6imcYPsk3FAgPJYIT8zTDAInz7BP3A2DFEonqQIB9d9GurRdmp7FiiijO6FvX+Rvm+GHoGv5Bj2vKwR4LDeulNyvzBz3ux57BhIMtrveSumPFoIoG458nade9TcE665d1Hx5YtkEO7VQkKCiWFmFGpsa0v30Aaldw3abBAk9G5UxDy9WPyNW9CokSgU1g0um7xKSPCwL/O9PAdv3bwrMNprF/WDf6I4L7g8O8/EAOAwC0trHj6StKPR36RFRf7uobBAAuxKxOLFFjMFVpJrudyRJpXLd5+AictWl5UPRT1gYnPfV9wcsjHmLHw== 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: VI1PR05MB5390.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee3f8974-ba8d-414a-b427-08d8390b88c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2020 06:48:17.3741 (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: ueYMGX4uEVVGzHLecOskGwr4GSZHw49zeLJYOh5sslmjgVsAqbY9HyT9nPecGysI6D3TUE64U7fZ5Vgka7EyuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3328 Subject: Re: [dpdk-dev] [RFC] ethdev: add VLAN attributes to ETH item 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" Thanks, PSB. > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, August 4, 2020 7:22 PM > To: Dekel Peled > Cc: ferruh.yigit@intel.com; arybchenko@solarflare.com; Ori Kam > ; Thomas Monjalon ; Asaf > Penso ; Matan Azrad ; Eli > Britstein ; dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC] ethdev: add VLAN attributes to ETH item >=20 > On Tue, 4 Aug 2020 18:36:20 +0300 > Dekel Peled wrote: >=20 > > In existing code the match on tagged/untagged packets is not explicit. > > Recent documentation update [1] describes the different patterns and > > clarifies the intended use of different patterns. > > > > This patch proposes an update to ETH item struct, to clearly define > > the required characteristic of a packet, and enable precise match crite= ria. > > > > [1] > > > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fmails > > .dpdk.org%2Farchives%2Fdev%2F2020- > May%2F166257.html&data=3D02%7C01%7 > > > Cdekelp%40mellanox.com%7Cc1ca8148f6ad42ad532708d838928c72%7Ca6529 > 71c7d > > > 2e4d9ba6a4d149256f461b%7C0%7C0%7C637321549359549952&sdata=3DW > kklrEiL > > KzWsd4UJCt5MKlWw40qIhiVn3vUPEjzE%2BNo%3D&reserved=3D0 > > > > Signed-off-by: Dekel Peled > > --- > > lib/librte_ethdev/rte_flow.h | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/lib/librte_ethdev/rte_flow.h > > b/lib/librte_ethdev/rte_flow.h index cf0eccb..345feb5 100644 > > --- a/lib/librte_ethdev/rte_flow.h > > +++ b/lib/librte_ethdev/rte_flow.h > > @@ -726,11 +726,20 @@ struct rte_flow_item_raw { > > * If the @p ETH item is the only item in the pattern, and the @p type= field > > * is not specified, then both tagged and untagged packets will match = the > > * pattern. > > + * The fields @p cvlan_exist and @p svlan_exist can be used to match > > + specific > > + * packet types, instead of using the @p type field. This can be used > > + to match > > + * on packets that do/don't contain either cvlan, svlan, or both. > > + * The field @p num_of_vlans can be used to match packets by the > > + exact number > > + * of VLANs in header. > > */ > > struct rte_flow_item_eth { > > struct rte_ether_addr dst; /**< Destination MAC. */ > > struct rte_ether_addr src; /**< Source MAC. */ > > rte_be16_t type; /**< EtherType or TPID. */ > > + uint32_t cvlan_exist:1; /**< C-tag VLAN exist in header. */ > > + uint32_t svlan_exist:1; /**< S-tag VLAN exist in header. */ > > + uint32_t reserved:14; /**< Reserved, must be zero. */ > > + uint32_t num_of_vlans:16; /**< Number of VLANs in header. */ > > }; > > > > /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */ >=20 > You are making life easy for you but harder for existing users of > flow_item_eth API. >=20 I think new and existing users of this item can benefit from the new fields= . > Why not add new flow_item for vlan and handle multiple levels there. There is already rte_flow_item_vlan available. The proposed update is intended to clarify the use of this item. For example pattern 'eth / ipv4 / end' can be interpreted as no-vlan, or as= any-vlan. The pattern 'eth / vlan / ipv4 / end' can be interpreted as one-vlan, or ma= ny-vlans. The proposed update will allow specific match on vlan attributes of packet,= without ambiguity. Regards, Dekel