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 B426E45CB3; Fri, 8 Nov 2024 15:48:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5135843348; Fri, 8 Nov 2024 15:48:13 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2073.outbound.protection.outlook.com [40.107.236.73]) by mails.dpdk.org (Postfix) with ESMTP id BAE674025C for ; Fri, 8 Nov 2024 15:48:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oudZgXKj2yDwql9nDoSgv+OM90JULokaDImWCSkR0CfKPuLxa0ud/usUV4G8Z7O/+1okiKEQUtYpvnCfKA+ZLClPvBoFDie8ho5HNiQi8RQZot4g7yPyDF51FUfXvMT1a/nF6ioW/QJ05wUYnFLgVmx7DFsK7gygZaS4at3Tz+2W7wVrelxqz63Y7zeTDdjM11fGjqWxXVsl2Rk5TPNQrzaMhg2qGEmrYz5wyQrLzc6jAUFvvfEEqhZKIl/xJPD4ajN15vc49XJe49AYVCHqgPs9Dz9vUQ5Hgnm+F2X58+lESR2y6u1ZZNMggF8SbL9x70miq3/7Av1FhUhhoWZDFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vGMNZv4hZoo8CXufYD3mdQQdTY9uRjd4cNHkTT75Sws=; b=RY+Cp8TUOTO9mgEhXuJVEvExvSksJSWiWmf93B1lViWUhx5pMEXF6pO8UGyCildAwrUI/WkX5hdarvXYbWsz4JG6s2QTWkRsMAw9g1eVO63sYBdCD1f5k177MNHIZw/P1YKvnr5Q/E9ZiVIazvqA+lvMg3DTTMWfcW81CYXKPa+dkZha7qAtfWoQ/350iE1Zc9YGQBeLIZZWSAAkVvDX6FQRN25lR88rxO5Utd8H+yvpjmDybUN5jX1h6Rij9QvzedaoS5uYeEc2FYov0v4Qci3j1ZWvEqydiNmIGqdLaFIITH7czkuCE07aF72s0hM9WrNNVCGaPpz4bEuk22e10A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vGMNZv4hZoo8CXufYD3mdQQdTY9uRjd4cNHkTT75Sws=; b=EKB+VK0WG6CvcKZHGoMawPzOhbGWTavEG+c0WKwKL22v2qRDPP9dU6AYJQE1LSBHjF4cQKE8siOKTl5QT9thl58SakdV7Z/P9nz2nbowLDYaL5vpVh0zKOAGWDHBhBMA0ryqNaM65gSJ4dhMtPM+QcaSu0KqQbNcOiqa7Fzy47w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by IA0PR12MB8907.namprd12.prod.outlook.com (2603:10b6:208:492::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21; Fri, 8 Nov 2024 14:48:08 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%3]) with mapi id 15.20.8137.019; Fri, 8 Nov 2024 14:48:08 +0000 Message-ID: Date: Fri, 8 Nov 2024 14:48:03 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 07/10] net/mlx5: add legacy unicast flow rules management To: Dariusz Sosnowski , Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad Cc: dev@dpdk.org References: <20241017075738.190064-1-dsosnowski@nvidia.com> <20241022120618.512091-1-dsosnowski@nvidia.com> <20241022120618.512091-8-dsosnowski@nvidia.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20241022120618.512091-8-dsosnowski@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB8PR06CA0025.eurprd06.prod.outlook.com (2603:10a6:10:100::38) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|IA0PR12MB8907:EE_ X-MS-Office365-Filtering-Correlation-Id: 9eac3748-36b4-4471-1fdf-08dd00045c58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Z2hLakxTZEgrZ1hRb2NmbEZhc2N2QXErRFJwQzd5UFlNbWZjYVBKMGl4U25z?= =?utf-8?B?Znl6RXc2QnY3cUwwaVNWNEMwNDNHN0FrMmJHcXNUUzZjcDB5aHBmQk5QRUFo?= =?utf-8?B?RjhtNXhBMWp5NVlGVEwvbHdrcWNRSmE1Znlob2phWGNTeXBNZ1JqM3JjSFVm?= =?utf-8?B?ZldrdnhrUEsvY3dha3RDM2lobkNCQWpGbGRnOFRxeEg0ZiswWE1vT1gzS2hm?= =?utf-8?B?MDRkYTYyV2s4TXUxbFBuZ2xoUlVuUHE2c1V1UjVpVWEyeG1qVTIxc1RtUVpI?= =?utf-8?B?WmhaQ3F5R0g4ZWVndlV4TDFzeXUvM2llM3gvaUl2TmFnaThrcUpUZDBVTm45?= =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E4VHAvMHordEJZ?= =?utf-8?B?czE1WGtheWpKWHg3NU1GbVgzdEdoTGJQZzRLUnlsMjVKcmJHS2RWbFdKemlw?= =?utf-8?B?U1pVOXMrNHV1WTVVbFRwRSs3VEtEc1hYQUp2VS80UVFiTG1xUlEremRLekpU?= =?utf-8?B?Qi9adWJQdFFzV2ZzQ0RFQ0liczN4RXBXQ2dmR3pTN0MzRE1ZWDBuMy8zMm9O?= =?utf-8?B?YmFUazRYY29NcmQrSWVnNnpqUjlYcUt0YThKZThnRXNFNDErS2ZLVVVaN01s?= =?utf-8?B?WEl1d2ZHSjMyc2hoTjMrZWpTc1pSTmovV2NSSmVMT1F4ajlRUlJERFJ2QVdT?= =?utf-8?B?ajlqeGtPem1VbC9QajIwUDRhaHFKbmpzU3FnNWxSbzEvZWJaOWdsN05FbjVG?= =?utf-8?B?cUpGSmlaMy93aUFFcDVrZitNREZsMWcyeE9tSUI1M2hTY0dWejRneTNPQnNV?= =?utf-8?B?YTh1RXJ1c0QxUEJKRWIrS0ZiSEFqM0hRZjNsOXEzWWFURUtReVNqUmtYOUVr?= =?utf-8?Q?nbuMwy0pbw/QCq3wYv7/7u0v8yWe2co45sFLrJz?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dm5uenJjYjZrSjlmWUVHVnFjZjdpamJJbWQwTEt5RVhCVkJxNFpnTmQzYTQ0?= =?utf-8?B?OXZraHJVbDEyZHV0S212WVFGNUdVUU1ZeTFZNC81UjdIWUFnT0FLQm5nVGxl?= =?utf-8?B?L2VXTDhyU3o2RnozaWY0c3BFYTRIc0NaMVNZMjR3UWdaZ0ZBdjVDSm9JT1p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MHdYNHJ2Z3k2M1ZRYjFYSVNmWjBSMm0vWWtiQVhyU1BtaWdXTGpkMjgydCtr?= =?utf-8?B?d3lLcGhGMit3UldrZ2x6a1J5ODNHOUd6T0tGbE1yTjY5TU1aU2NzL0JrVGFt?= =?utf-8?B?WGlvQktmTk5NR21hai8yWStDaERIWEdjMHIrQVdaQXhxOU5Qc011LzVrejdo?= =?utf-8?Q?TliaMb3/hE7FaWj8fUJeNeAP0?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9eac3748-36b4-4471-1fdf-08dd00045c58 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2024 14:48:08.7116 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vdvaNpRyBlqfhjkdYSV85I3eeg876LZ3+IXSghX8rWkgYgrbKNoWVmNFZOx2fFJt X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8907 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 10/22/2024 1:06 PM, Dariusz Sosnowski wrote: > This patch adds the following internal functions for creation of > unicast DMAC flow rules: > > - mlx5_legacy_dmac_flow_create() - simple wrapper over > mlx5_ctrl_flow(). > - mlx5_legacy_dmac_vlan_flow_create() - simple wrapper over > mlx5_ctrl_flow_vlan(). > > These will be used as a basis for implementing dynamic > additions of unicast DMAC or unicast DMAC with VLAN > control flow rules when new addresses/VLANs are added. > > Also, this path adds the following internal functions > for destructions of unicast DMAC flow rules: > > - mlx5_legacy_ctrl_flow_destroy() - assuming a flow rule is on the > control flow rule list, destroy it. > - mlx5_legacy_dmac_flow_destroy() - find and destroy a flow rule > with given unicast DMAC. > - mlx5_legacy_dmac_flow_destroy() - find and destroy a flow rule > with given unicast DMAC and VLAN ID. > > These will be used as a basis for implementing dynamic > removals of unicast DMAC or unicast DMAC with VLAN > control flow rules when addresses/VLANs are removed. > > At the moment, no relevant flow rules are registered on the list > when working with Verbs or DV flow engine. > This will be added in the follow up commit. > > Signed-off-by: Dariusz Sosnowski > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow.c | 80 ++++++++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_flow.h | 19 +++++++++ > 2 files changed, 99 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 62e3bca2f0..0d83357eb0 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -8532,6 +8532,86 @@ mlx5_ctrl_flow(struct rte_eth_dev *dev, > return mlx5_ctrl_flow_vlan(dev, eth_spec, eth_mask, NULL, NULL); > } > > +int > +mlx5_legacy_dmac_flow_create(struct rte_eth_dev *dev, const struct rte_ether_addr *addr) > +{ > + struct rte_flow_item_eth unicast = { > + .hdr.dst_addr = *addr, > + }; > + struct rte_flow_item_eth unicast_mask = { > + .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff", > + }; > Initialization as string breaks build [3] with experimental gcc-15 [1], please see [2]. [1] gcc 15.0.0 "gcc (GCC) 15.0.0 20241107 (experimental)" [2] https://git.dpdk.org/dpdk/commit/?id=e0d947a1e6c2 [3] ../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_flow_create’: ../drivers/net/mlx5/mlx5_flow.c:8568:44: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization] 8568 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff", | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_vlan_flow_create’: ../drivers/net/mlx5/mlx5_flow.c:8583:44: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization] 8583 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff", | ^~~~~~~~~~~~~~~~~~~~~~~~~~