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 91577A04A6; Thu, 27 Jan 2022 13:15:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DB73427A3; Thu, 27 Jan 2022 13:15:43 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 76D374067C for ; Thu, 27 Jan 2022 13:15:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643285742; x=1674821742; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=DaDLhUL+DwoRCNFpsEqgJbawoiIBNGU6qS9IHdUYDDg=; b=U7FHU7AdCk+5WRsvXMdn1QJ+XHkIsXCXcQjvYPq02LAxQ9rynj/5JHKo U5eON+jTn7D0jWlbnq9IyUC7r2nG4xvWi8iaY/kTVEDH/eq+uwnuWuV89 ni8R49p6zumvQMRLhK7Vm/y6eCMesQzjkwPMEcC7kXFQGnE4z1wVS4jfx RSS80MjUfqYZ0P6F1PwCjfuKrlIR++oOYYftvBUm+tYFsMKkaRWA4jlrQ /MsmLMRaANvI9pzVXv5ibcK8K2hIfE7oELLKnO1UA0V4VsrWNivRhOyMA owDKyqEGxOujXcGb7Qxi2nymyzwiS15VykkAHa+tRgYASpAml6F4WWowI Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10239"; a="244435570" X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="244435570" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2022 04:15:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="769714613" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 27 Jan 2022 04:15:41 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 27 Jan 2022 04:15:41 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 27 Jan 2022 04:15:41 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 27 Jan 2022 04:15:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SfkPZ2iQdUswh9a9YLZAItze3DD1MYsDtEoGcSuC759hiUxP4HnzTQPO+K8TylSG4AWoHCyCEOOMyMDu6W+WWl3AewIoTnBceRjl8rl5xmVyUigdOeXeBf3gB5saYwKWot6RMyK5KqZ+G7/2zCsPs1aV34+TTvkoC7WteYAumLz+rnLmRRM9UR0VbgYuwjWiE24MAWf/bGiRK65G4N90mTuKRNRzxK5VVa6uiXayKyEwLlEowMdSDWcMsotQgUvJHPZK+TZIkDXGLuLT4zzU5+jymbd3MQ/+QX5nHVbXrKBi5DZOqTmQHrExoGR3Y71ZdV9bph2gvLEDOFnZTMo8Bg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wBkJ36/2ZFZGdZDUsGdU7GxjtNcGcp70hKsHul9tnpo=; b=AOPfVT8KgW59DOAhlDFAABghqBLc0pwLKmxHSIOiycv9XIS8D3Ng6Q1afCLLyVsvaTBHF7VltdCH/C1yDQvDZ/KplYMPtl5IvunoEfHwlR4AtxeFq6bLVXnp89ZlivtG2+LJQ2xFIingupPZVyVzZGxSqlWiywy67h4J1AOHIHz/JK7AgfqqfCTQC8fdRY44kokfPzidehvviFxDOh1QZ3YhxfPpEnOFJg8YJ4Y6pVPM6XRjCf5RVrEVg/T7LkBsfbb6FbKzgy9FNZmpaxcJdGwmV8SYaBqejhtx9cgxSOrr+EViKda4U+ByY7K/nUE7A4a3qD1Xd0Lypw6rKUwHzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by SN6PR11MB2959.namprd11.prod.outlook.com (2603:10b6:805:db::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Thu, 27 Jan 2022 12:15:32 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4930.017; Thu, 27 Jan 2022 12:15:32 +0000 Message-ID: <412d1c04-8b88-57e2-d53f-fbe84825b3af@intel.com> Date: Thu, 27 Jan 2022 12:15:26 +0000 Subject: Re: [PATCH v2] net/enic: add support for eCPRI matching Content-Language: en-US To: John Daley , CC: , Hyong Youb Kim References: <20220114031036.19052-2-johndale@cisco.com> <20220126214802.1412-1-johndale@cisco.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20220126214802.1412-1-johndale@cisco.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB9PR05CA0024.eurprd05.prod.outlook.com (2603:10a6:10:1da::29) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a32c77c2-c0d9-4a9e-e9d5-08d9e18eb722 X-MS-TrafficTypeDiagnostic: SN6PR11MB2959:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2aCN/1eok0L1CAEV8LjGumn+tipRzxaIfALzh8PFA3U87XoGBj+YwLwF3ICScNK0GxMiC7xCWOmPw+9w9vI7gU9DoNS0vc3slwaD/IanTuJUhKngYUZMjkSh+emS00kOUYl5QiP7oe94LvPrCNEBp8YApq984X5TU5UfMfZf0o1RTfpflXZLaBjbJm+/Wv31TapvviglSBmnrxEZk2Iuz6h/Jp1tpbY9QLA76SpeSxLFTwtDHg0wtiZl2mrNQgXOPTnJNktw3Yift5+5x3vqqvDxHi3a4j0wEEPByO6qYrKNhMOyuDA5Dg+o1XJ4GHIOuFcuBAxSsEMYrvf7b5CvbXCGvpDkt9LEkTrl1S5MuWDW5669aGrmKjhJQ4JA8gvy5uK45aUzkSxB4DySZOzftqwNtWsivm8TeMb9IAN3iLuIP6ub3m1ORHDQ2lDtP4RwO9jifThQRydxt6w29BiMgsZZ2oxo+Yon2q7Hna9v1WR4k0aIKQ98t4GNf7uDfOxPN4GqZXIjn2u5ZtCmwbUKE6DgeLl4zMHaR2vDEsJcDDlGvl2jbCKOKlvr0skcriJx0ra9q+ChRRX9D2FePiuUFh3zdjbTenQVFiJNNlhj485IJFd+wA/WfRO1Z5vzwMcy9M30puP2jElztau0JZblhlLKmyAO2rqNhl/nHuZlnJuWKrouypf529TYC1EPqpRWSFDFpMCEf7SGvMQ1MhL5dQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(5660300002)(6506007)(2906002)(2616005)(6512007)(6486002)(83380400001)(36756003)(86362001)(31686004)(53546011)(82960400001)(508600001)(6666004)(26005)(186003)(316002)(4326008)(8936002)(66556008)(66946007)(66476007)(8676002)(31696002)(44832011)(38100700002)(45980500001)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TGpNWFJtVm9hanZvQ0g2ZGY5ekExWkp1ZmNwVWNSZnFQb2Z0eVFJV0dCTjVO?= =?utf-8?B?VXVCS2ZHMGp2cGRZK0lPWTlWNjRoZkVLRkE2OWk5ZVQ2Ty9kbjlNN2ZhcHBx?= =?utf-8?B?UUEyMmxqbjhoeWxsS2dEeFdoMUpiTHppSXJnUk40dXJ6RTNYeHNmR1gvUmE3?= =?utf-8?B?NXArVnU5Mlkyb3pwdHRkYncyQ1k0ZnlFWmJjSmxGaVhZNFQrejhUdXZDWXd0?= =?utf-8?B?Nzg5U1ErdkdlVnAzOG1UR0hnRUI2RWVsSTBsSzhJUC8rUzU5Y1NRdWtmMWRU?= =?utf-8?B?blNMc0xpbnlpWldTMlNOTkVwZ0RPemJQZ0RPUHh6eEp6NmcxeHdtNWU4cnRr?= =?utf-8?B?SE9ZQy9TTWE0YTMyZXZya2d2VDNZZVlvb0N5VXNReG4rZCtrS1k0TysrYklP?= =?utf-8?B?VldNenBGbmFLY0Q1OXhqVzZkN1ZRQ21pM0FRdEpNeldjbzY4c3hrcGp0OEpG?= =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S-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 12:15:32.7196 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Vt7Y0zyLxeWMAWU5TBoYxAHl4p+36YCk5qxYkjQ5LZnaTmU+6m2zhscUDPQ6j4sZLtzUatufiGH44ojLqbPrKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2959 X-OriginatorOrg: intel.com 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 On 1/26/2022 9:48 PM, John Daley wrote: > eCPRI message can be over Ethernet layer (.1Q supported also) or over > UDP layer. Message header formats are the same in these two variants. > > Only up though the first packet header in the PDU can be matched. > RSS on the eCPRI header fields is not supported. > > Signed-off-by: John Daley > Reviewed-by: Hyong Youb Kim > --- > v2 - include enic.ini update > > doc/guides/nics/features/enic.ini | 1 + > doc/guides/rel_notes/release_22_03.rst | 1 + > drivers/net/enic/enic_fm_flow.c | 65 ++++++++++++++++++++++++++ > 3 files changed, 67 insertions(+) > > diff --git a/doc/guides/nics/features/enic.ini b/doc/guides/nics/features/enic.ini > index c3bcead05e..88e4ef8c64 100644 > --- a/doc/guides/nics/features/enic.ini > +++ b/doc/guides/nics/features/enic.ini > @@ -53,6 +53,7 @@ vlan = Y > vxlan = Y > geneve = Y > geneve_opt = Y > +ecpri = Y Can you please add in alphabetical order, as in 'doc/guides/nics/features/default.ini'? > > [rte_flow actions] > count = Y > diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst > index b38dc54e62..52d1e32cf6 100644 > --- a/doc/guides/rel_notes/release_22_03.rst > +++ b/doc/guides/rel_notes/release_22_03.rst > @@ -58,6 +58,7 @@ New Features > * **Updated Cisco enic driver.** > > * Added rte_flow support for matching GENEVE packets. > + * Added rte_flow support for matching eCPRI packets. > > Removed Items > ------------- > diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c > index 752ffeb5c5..589c9253e1 100644 > --- a/drivers/net/enic/enic_fm_flow.c > +++ b/drivers/net/enic/enic_fm_flow.c > @@ -237,6 +237,7 @@ static enic_copy_item_fn enic_fm_copy_item_vxlan; > static enic_copy_item_fn enic_fm_copy_item_gtp; > static enic_copy_item_fn enic_fm_copy_item_geneve; > static enic_copy_item_fn enic_fm_copy_item_geneve_opt; > +static enic_copy_item_fn enic_fm_copy_item_ecpri; > > /* Ingress actions */ > static const enum rte_flow_action_type enic_fm_supported_ig_actions[] = { > @@ -392,6 +393,15 @@ static const struct enic_fm_items enic_fm_items[] = { > RTE_FLOW_ITEM_TYPE_END, > }, > }, > + [RTE_FLOW_ITEM_TYPE_ECPRI] = { > + .copy_item = enic_fm_copy_item_ecpri, > + .valid_start_item = 1, > + .prev_items = (const enum rte_flow_item_type[]) { > + RTE_FLOW_ITEM_TYPE_ETH, > + RTE_FLOW_ITEM_TYPE_UDP, > + RTE_FLOW_ITEM_TYPE_END, > + }, > + }, > }; > > static int > @@ -877,6 +887,61 @@ enic_fm_copy_item_geneve_opt(struct copy_item_args *arg) > return 0; > } > > +/* Match eCPRI combined message header */ > +static int > +enic_fm_copy_item_ecpri(struct copy_item_args *arg) > +{ > + const struct rte_flow_item *item = arg->item; > + const struct rte_flow_item_ecpri *spec = item->spec; > + const struct rte_flow_item_ecpri *mask = item->mask; > + struct fm_tcam_match_entry *entry = arg->fm_tcam_entry; > + struct fm_header_set *fm_data, *fm_mask; > + uint8_t *fm_data_to, *fm_mask_to; > + > + ENICPMD_FUNC_TRACE(); > + > + /* Tunneling not supported- only matching on inner eCPRI fields. */ > + if (arg->header_level > 0) > + return -EINVAL; > + > + /* Need both spec and mask */ > + if (!spec || !mask) > + return -EINVAL; > + > + fm_data = &entry->ftm_data.fk_hdrset[0]; > + fm_mask = &entry->ftm_mask.fk_hdrset[0]; > + > + /* eCPRI can only follow L2/VLAN layer if ethernet type is 0xAEFE. */ > + if (!(fm_data->fk_metadata & FKM_UDP) && > + (fm_mask->l2.eth.fk_ethtype != UINT16_MAX || > + rte_cpu_to_be_16(fm_data->l2.eth.fk_ethtype) != > + RTE_ETHER_TYPE_ECPRI)) > + return -EINVAL; > + > + if (fm_data->fk_metadata & FKM_UDP) { > + /* eCPRI on UDP */ > + fm_data->fk_header_select |= FKH_L4RAW; > + fm_mask->fk_header_select |= FKH_L4RAW; > + fm_data_to = &fm_data->l4.rawdata[sizeof(fm_data->l4.udp)]; > + fm_mask_to = &fm_mask->l4.rawdata[sizeof(fm_data->l4.udp)]; > + } else { > + /* eCPRI directly after Etherent header */ > + fm_data->fk_header_select |= FKH_L3RAW; > + fm_mask->fk_header_select |= FKH_L3RAW; > + fm_data_to = &fm_data->l3.rawdata[0]; > + fm_mask_to = &fm_mask->l3.rawdata[0]; > + } > + > + /* > + * Use the raw L3 or L4 buffer to match eCPRI since fm_header_set does > + * not have eCPRI header. Only 1st message header of PDU can be matched. > + * "C" * bit ignored. > + */ > + memcpy(fm_data_to, spec, sizeof(*spec)); > + memcpy(fm_mask_to, mask, sizeof(*mask)); > + return 0; > +} > + > /* > * Currently, raw pattern match is very limited. It is intended for matching > * UDP tunnel header (e.g. vxlan or geneve).