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 0A131A0351; Thu, 6 Aug 2020 12:25:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D93BF1C0B2; Thu, 6 Aug 2020 12:25:56 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30060.outbound.protection.outlook.com [40.107.3.60]) by dpdk.org (Postfix) with ESMTP id 7FDD129D2 for ; Tue, 4 Aug 2020 17:47:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GTyqp3q8j3lCxM3bqmpdCv33oMmi34z45rUNUNIVK0NClaOMDu6AkFJHYMUWhHMoRLJuYRRVabj38X+4tm36pDGs+4da3O+FVYWASB/sLCpdrSUqKF4qOC/Fpo1N13lj8DRrh+pok/wfmsJQQPlkzplo6mPPyY4wbgWW8aluSBhAenb0n2TH3AyE/f6qSQYwvSVS9hQYTfhCeA9vIiTXrc5sS9q99x8I4GDKLWD4W9Cy7ZEkVapgeFN2SjgeVPX0Uroh/CRT3VI3AfhGayaWlvoX9d4JTu8jWqKJZp/MnKelj6IkBMd4DreUY3po6Sbs4JMY2bGSpMQ6KhLAOZChhA== 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=dfI1+nz9moLwdfqbkePl5MRXzle9O5RkOkBT1KiQD/4=; b=RHyqakgcGDYsjrw/SXAWFhE1fBSiz24vQjxEhTNpjUUwbuLXXwWoI3DCEzcWOkBJVv7ruELMkCbo1soofG3Bbnr1ecQ3VtPIgsOTQ4sSzV3VvTmblPapl9xPeUOsYuhHukH8Wzj3KvsX6LvMdENCuZRUTVMxfJn5HjnHiVM7O+V8olvlaStlYcpFPb2ytB9JuWBeZMUoUckUqJYewhYIuw1E6mwcypezmFi1Sdr6Q/StPs165FdXb3Ud4HZjF6L6HlYBl5tZ+K2owUsT5KOUQHyMEOd2JinPW48fAJQgUXp+993JKJLMfSIZ3OFrdMJ6+Jq0tHhULrK6iO7kYj3nBg== 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=dfI1+nz9moLwdfqbkePl5MRXzle9O5RkOkBT1KiQD/4=; b=gDhBWnrU05aqsW24YEdhe/DUgviGYPoX1fCWTyOpRWieDjc14RgpAtrEx6iSjMHz67kiCZ6jCofQLXwqGq84WNWGHTliDkNXzz8DLEdOWFW8R6e+jWydW5ROy/wjrH5Ozmv92UKjlnALHMehAxxLs+QQhh+Qttdwd7KmvH2IRgg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from DB8PR05MB6603.eurprd05.prod.outlook.com (2603:10a6:10:ac::33) by DBBPR05MB6444.eurprd05.prod.outlook.com (2603:10a6:10:d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.15; Tue, 4 Aug 2020 15:47:14 +0000 Received: from DB8PR05MB6603.eurprd05.prod.outlook.com ([fe80::d065:d11c:e0e9:9d7b]) by DB8PR05MB6603.eurprd05.prod.outlook.com ([fe80::d065:d11c:e0e9:9d7b%5]) with mapi id 15.20.3239.021; Tue, 4 Aug 2020 15:47:14 +0000 To: Dekel Peled , ferruh.yigit@intel.com, arybchenko@solarflare.com, orika@mellanox.com, thomas@monjalon.net Cc: asafp@mellanox.com, matan@mellanox.com, dev@dpdk.org References: <6e8b7c61a92b51749b11ac3bfae5c0201352f9b3.1596550675.git.dekelp@mellanox.com> From: Eli Britstein Message-ID: <3730207f-8882-094e-16f8-3680c80096c1@mellanox.com> Date: Tue, 4 Aug 2020 18:47:10 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <6e8b7c61a92b51749b11ac3bfae5c0201352f9b3.1596550675.git.dekelp@mellanox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To DB8PR05MB6603.eurprd05.prod.outlook.com (2603:10a6:10:ac::33) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.23] (46.120.174.220) by AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.14 via Frontend Transport; Tue, 4 Aug 2020 15:47:13 +0000 X-Originating-IP: [46.120.174.220] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4abc8813-615d-4be6-5460-08d8388da8bb X-MS-TrafficTypeDiagnostic: DBBPR05MB6444: 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:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VEDr3+tpqokzbXUZyovXldbrRpJ2P8V4b5gJCDQUchzbvAPrpB6IQX+ttzg3NdNPbpUIE8Lxu+mwoj+RPHzJMSYlwjh73a/20mueI1KAe0nzuzF5EZ++EFVmhbgHYqBv9qZ6u5vr3MNKUIBsCbRwocNN9R9nUHOL32nZ1mepk7nhkldGmulHZmpsdH+UsWeZxtuRC+Zms9CNM0YARZZQ+bjuk1Unr3Qk1F1mYZRwul6NRI8mlEMZrwpHALUIDpx1tQAOJQoSpDs5w5EIoXnVwL3+0XKHMA+Uia2mKWSjzFwhoj6DDTntIwDX/agW9ozhhcyVtY/eQuiH+B/m0KBz7fh4Rv2BnkSJ/jPXuuL2ImeUQG/qTxeF0NTCdr/BdMEW+Xij6aaXf0Hxcjh+UM0WwL869typHz4lR05y1tXmM/cf98bcXI5nI07nyMyLtm+rXhnsYvM1SG5L9pV/nVAf/g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR05MB6603.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(346002)(396003)(376002)(136003)(316002)(16576012)(31696002)(86362001)(53546011)(4326008)(31686004)(83380400001)(36756003)(478600001)(66476007)(66556008)(66946007)(2906002)(5660300002)(52116002)(8936002)(26005)(966005)(2616005)(16526019)(6486002)(956004)(8676002)(186003)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: v8b9G87D7QuDB8UIBS2b79I43H8MYPiaeNJqF4OgskoOOAW+9uZTxSuGzzSkKUHacK7xJNoznDmPgOYKv1Os1h7thF5DV33OWBRJThZFCALj+z+Zpq4WRMmolTYTDFi3kwS4DEBfdLEoC4ti6f6RQ80s1Cbj7m5czpYFJ5lDGqcQVMq7fUUkpPEEZ8oCbHkgsl0QceIJEQ/0zh5KDtTbaJpF3cjVw0UHr4397RxMVB7nWW0LOWk7N1Z0v/YAhFFB8eJE4KFqaGcgWIT/fu1EbXmYqg96lB+I8efT0JKtTg05IB9KSTonfnojyJ3hn9h5ofVcx7vWWLhgmL4/jnD+fpJErqFyL5ocb8wabOG6bmgPqRoH0kxQa9BsG3Y/+Y6b0/Xugy5cdyifUwqn+CpFzqHBEqizqB2faox5dJC/+Cq6o/Ka6PExQQDNfoZ5cb4046k9G0sjeU954XlYmcrYM5NsywWkxhATUdc1nH1rYW/Y3BDlHhq3CTd6PZ+lYL8YGvC26YVrx/NZwtuM3vdpDEOw1sOwCJg+P6ij0LuRAj4/vB9noyLaj0tzQafQwFkltVL5gAtTEoShCLtH1Nd/1/Y1bpsEFmF2nuZ44mIzyXQmNmfb1gqn8cV1V4Jy7+F6nqIQVkeaQgTKFIkG040RCQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4abc8813-615d-4be6-5460-08d8388da8bb X-MS-Exchange-CrossTenant-AuthSource: DB8PR05MB6603.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2020 15:47:14.7137 (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: jKgJkK631K7zapXK7UoYPyQCqAEmaIbrauczNuLJC+OhPsw8fby2v/qxgrcxZySbQJHW/oLqm5dt9TbWe6tTlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR05MB6444 X-Mailman-Approved-At: Thu, 06 Aug 2020 12:25:55 +0200 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" On 8/4/2020 6:36 PM, Dekel Peled wrote: > 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 criteria. > > [1] http://mails.dpdk.org/archives/dev/2020-May/166257.html > > 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. */ We can deduct from num_of_vlans the values of cvlan_exist/svlan_exist, so those are redundant fields. Keeping them introduce a conflicting match. For example num_of_vlans=0 and cvlan_exist=1. > }; > > /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */