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 626A34618C for ; Tue, 4 Feb 2025 10:28:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3EEA40661; Tue, 4 Feb 2025 10:28:52 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2065.outbound.protection.outlook.com [40.107.212.65]) by mails.dpdk.org (Postfix) with ESMTP id C5D9C40265 for ; Tue, 4 Feb 2025 10:28:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vN++51by7YPzSjue4/W9oFI2KaNaiNBhVxKzOLYx1PvwKV5fb1scWqhn+exSbmJactMpybbC9/ksLaxl9Pr0yxfTdsBcAJ3tcK2lKcs67qRQMTR2paRkfsJ+8tAD0M2iEI4dbJAcggNGdD8v2y2OaVfr5llPJDMxqmNeBuJk5XUfzLkAnxXx9b/oHmQH/Hn9AQJ21nbNBuEJvTzm25J3zL5NXG75VbP4Eyy3EuZRDqN5bOh423r2z4arfoJLoW0cofCM8qoDtqPY4MIxTVDrfhTK0P+Pk7oRr3jf2gWcmUZ4gqWKjEuaMfX7ZSspyFIt/QdlmaYdOIHL5oOiRrHuug== 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=aeVLqd3+T6RGWZ6j+5Qv24TCK75eI1pcU0cGX0HePMw=; b=BGJL6sSDVWhoxuNXxiGwGGUiVMrM6WWTJXxGJSXoz2COoKoFgvFqmVtvVsxoaR68bXAUW4lHKcixbanp+1NoKeagbABA3c5L1pSd4OVWpMbKB0r5DmJPHH71kWA42xa0f/+fcXzN9GICi7ON2ucYy2MCjVcBNlfKWE4y0X2Pxs97tGwo0nadKaddvfoAUOcyJk9hUEuc5ZNqa2Aty5IqLZemwudt/6qQAFQHBCqfKCWNHBYHJgmiZB3upDN4eBItZT8nTSbOaMhM8Odo/G+RG9s1f4nbC22rnKabFeAg7/Pl6ChK+MMz7dFU/fs4CFJU7rvhETOpj7m0feKWgKl6HA== 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=aeVLqd3+T6RGWZ6j+5Qv24TCK75eI1pcU0cGX0HePMw=; b=fq8WQ+7VbrdDvZ0kNB9ArosTjjj9/gWBeZpQEFWwIazUAgKn/o3UQR245vDeuwppVZdpQz6PPP2SPVl/T6mHCDr8psKO+GF9xY6P8Ie9HRM65cKAZAi20RHIcwmC27SPHAd3PX2Wv6tMgFv8qVTPFL+mibqHFDIKT2WoXN4UWMFbxU4m7BkdYENmxgMU/cOzB9DgV0hT0dgsVNzfly1n9AR8srsjgNOp+C/x+X5k4ymCE5KbqrZogps+gzr0Qti1Kv7rwpvZHo4YI0pa1sQSOeT5+z2NrNQ/jiKYDnlDu9enE84AXw2R34F/C3643B3Ka3iAXLCkaSPWyKkYPzYhaA== Received: from CH3PR12MB8460.namprd12.prod.outlook.com (2603:10b6:610:156::15) by SJ2PR12MB8829.namprd12.prod.outlook.com (2603:10b6:a03:4d0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.25; Tue, 4 Feb 2025 09:28:48 +0000 Received: from CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5]) by CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5%7]) with mapi id 15.20.8398.021; Tue, 4 Feb 2025 09:28:48 +0000 From: Dariusz Sosnowski To: Sid ali cherrati , Dmitry Kozlyuk , Anatoly Burakov , Vladimir Medvedkin CC: "users@dpdk.org" Subject: RE: DPDK Flow Filtering Not Working as Expected Thread-Topic: DPDK Flow Filtering Not Working as Expected Thread-Index: AQHbcaVd7ui2AUaNrkOZSwihMwHpKLMshocAgAkbtQCAABMZgIAAAZqAgAAjQoCAAQ6MMA== Date: Tue, 4 Feb 2025 09:28:48 +0000 Message-ID: References: <20250128214616.3f9324de@sovereign> <20250203180007.2c5e0607@sovereign> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3PR12MB8460:EE_|SJ2PR12MB8829:EE_ x-ms-office365-filtering-correlation-id: 9ace8245-71a0-4084-7ea5-08dd44fe5473 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?mhYPOzY/srzkehIyzovB2PXUwrvmD3kHpL6EwU8IK+FqwDStvUWZqv5wyO?= =?iso-8859-1?Q?yR2uGPjmY3wor8o1dC7rCH1qR98y6e6CiGzhrSU6Zw7UsVrAIpvOvghVwi?= =?iso-8859-1?Q?EGIeuQlEw+yFfZl/sw3yxQYPrYk6i5lMS4u7inDSKRDdhsBvH03Sb+sSk7?= =?iso-8859-1?Q?XTXbunkFxMgF0jNOFCSkqiDm4NPgu4t8E/TECRcrAOINKvP62NooKH/825?= =?iso-8859-1?Q?C0GzNp11qxwo8Ko78ecBsuOyt92FWgD78ONxV/ekxTOz8ToFF5wigT2ORj?= =?iso-8859-1?Q?tvD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Tvdv+gzo5mr2/5?= =?iso-8859-1?Q?eYkce+g1c1FT32p+RGPbL82wtCH+r6W8fTGuT2awrYr5PP1/WKLhr92RZ2?= =?iso-8859-1?Q?cJ+Lba1z49nsCW1xWKKRZHzwSbdAM6x4F2weuIO2M6FUQfVDfb+wRGXSJ8?= =?iso-8859-1?Q?5kmWB76to6o+ikbCUSDWFjFggt0hMbpcVdewTbuhkJ/eHdFvYdac4xONei?= =?iso-8859-1?Q?oyQOraWa7+du2Z72y3nGLWniNnBsGerAG92NLmgCSTPs9rkBKNeNk8LYav?= =?iso-8859-1?Q?O0M2Q6ORVGn1mxrSPkvE6V6JKH+6YR1w6oFKUUYFdRFrxeNG9+YfZ4RQ5S?= =?iso-8859-1?Q?SLo6bsqwWLPq5Z3A6i0440?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB8460.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?4tUHAFI6mVuwr45TxoQlO8PxoINYtA92fZuN+wSGnnfmYcRnNMGEpptm91?= =?iso-8859-1?Q?rd4YCPV84mFFDiXVcm1ZM/PTmIw52C8DbBG7xA1KfwnTjOYjYoBB97hbRq?= =?iso-8859-1?Q?gLrPtJRrRRiiqMJar8v6q131+Lro+TEAX3i6FUI9v20kFKRU0Po3Qdggdu?= =?iso-8859-1?Q?TyJmorHn8PF/i7kA0SIUdiIyHrWU82/tt5PReCPQxMzDKQQ5+l6GLl8wMN?= =?iso-8859-1?Q?1IamkpZQvZO+lbW8GS4i4rSz8UGnmKI2P8kQq4RGNMnnRb33+aqJ6V7cYy?= =?iso-8859-1?Q?MJgBabfqzzlKhfXlr3tK4eMiykFQFGfEcea/BV5Xi5masgdH7T6KetulrF?= =?iso-8859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z/5t/vf/XPrxpHaO/HP?= =?iso-8859-1?Q?xVs3GZSCdBBMsS3/vErpn0ZsPbDXAy+Pajisw6DnwQ5DJX8gBLPvULVI7u?= =?iso-8859-1?Q?2nxtvF85Za7gsP5w66hzhLYZghadYIf1wyUtXFMeTXKgwK8h7MGIA14H0z?= =?iso-8859-1?Q?xzP1aFJ+7JiWNT2Wan8hJAxCYW46NTlDhzUudjXgHeytC2Z2uOpFui5u5T?= =?iso-8859-1?Q?TJcugXxmMu+XuY5bC8Z33pUyUN/mm9uoJmp7kizbv3ABzrizcUfjgE82GH?= =?iso-8859-1?Q?JbLjkbW1GijATiQHvt4fqs5HuabDOcddHEmuAiBpo6GVHbLwiBfqsn7MYm?= =?iso-8859-1?Q?/3pV//tQT83ez/rOI50FlXyt/NAHXMUIohfQWMv1MT7RoQI8LNhtTDXxD2?= =?iso-8859-1?Q?drt7efByDInXyq6oyolcU9HIFA8XenNW93?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8460.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ace8245-71a0-4084-7ea5-08dd44fe5473 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2025 09:28:48.5145 (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: g3WVPHI4rEkJYK2axjSk1sgutEtdF2EmPFyh/Eyw6EhH4yyP5Pe9ESk2w4n7bcxuCrtbksH7F+oelQZnIQtatA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8829 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Hi, Anatoly, Vladimir - Would you be able to help with the issue regarding DROP= action not being supported on X540-AT2? Best regards, Dariusz Sosnowski > From: Sid ali cherrati =20 > Sent: Monday, February 3, 2025 18:12 > To: Dmitry Kozlyuk > Cc: users@dpdk.org > Subject: Re: DPDK Flow Filtering Not Working as Expected >=20 > External email: Use caution opening links or attachments=20 >=20 > Here is a better version of the code :=20 >=20 > #include > "../include/flow.h" >=20 > #include > >=20 > #include > >=20 >=20 >=20 > int > flow_filtering(uint16_t > port_id, > uint32_t > ip_addr, > uint16_t > udp_port) { >=20 > struct > rte_flow_error > error; >=20 > struct > rte_flow_attr > attr > =3D { .ingress > =3D > 1, .priority > =3D > 0 }; >=20 > struct > rte_flow_item > pattern[4]; >=20 > struct > rte_flow_action > action[2]; >=20 > struct > rte_flow > *flow; >=20 >=20 >=20 > // D=E9finir le motif Ethernet >=20 > memset(pattern, > 0, > sizeof(pattern)); >=20 > pattern[0].type > =3D > RTE_FLOW_ITEM_TYPE_ETH; >=20 >=20 >=20 > // D=E9finir le motif IPv4 >=20 > struct > rte_flow_item_ipv4 > ipv4_spec > =3D { .hdr.dst_addr > =3D > RTE_BE32(ip_addr) }; >=20 > struct > rte_flow_item_ipv4 > ipv4_mask > =3D { .hdr.dst_addr > =3D > RTE_BE32(0xFFFFFFFF) }; >=20 > pattern[1].type > =3D > RTE_FLOW_ITEM_TYPE_IPV4; >=20 > pattern[1].spec > =3D > &ipv4_spec; >=20 > pattern[1].mask > =3D > &ipv4_mask; >=20 >=20 >=20 > // D=E9finir le motif UDP >=20 > struct > rte_flow_item_udp > udp_spec > =3D { .hdr.dst_port > =3D > RTE_BE16(udp_port) }; >=20 > struct > rte_flow_item_udp > udp_mask > =3D { .hdr.dst_port > =3D > RTE_BE16(0xFFFF) }; >=20 > pattern[2].type > =3D > RTE_FLOW_ITEM_TYPE_UDP; >=20 > pattern[2].spec > =3D > &udp_spec; >=20 > pattern[2].mask > =3D > &udp_mask; >=20 >=20 >=20 > // Terminer le motif >=20 > pattern[3].type > =3D > RTE_FLOW_ITEM_TYPE_END; >=20 >=20 >=20 > // D=E9finir l'action >=20 > action[0].type > =3D > RTE_FLOW_ACTION_TYPE_QUEUE; >=20 > struct > rte_flow_action_queue > queue_action > =3D { .index > =3D > 0 }; >=20 > action[0].conf > =3D > &queue_action; >=20 > action[1].type > =3D > RTE_FLOW_ACTION_TYPE_END; >=20 >=20 >=20 > // Cr=E9er la r=E8gle de flux >=20 > flow > =3D > rte_flow_create(port_id, > &attr, > pattern, > action, > &error); >=20 > if (flow > =3D=3D > NULL) { >=20 > printf("Erreur lors de la cr=E9ation de la r=E8gle de flux : > %s\n", > error.message); >=20 > return > -1; >=20 > } >=20 >=20 >=20 > printf("R=E8gle de flux cr=E9=E9e avec succ=E8s pour IP > %u.%u.%u.%u > et port UDP %u\n", >=20 > (ip_addr > >> > 24) > & > 0xFF, (ip_addr > >> > 16) > & > 0xFF, >=20 > (ip_addr > >> > 8) > & > 0xFF, > ip_addr > & > 0xFF, > udp_port); >=20 >=20 >=20 > return > 0; >=20 > } >=20 >=20 >=20 > int > create_drop_all_rule(uint16_t > port_id) { >=20 > struct > rte_flow_attr > attr > =3D { .ingress > =3D > 1, .priority > =3D > 1 }; >=20 > struct > rte_flow_item > pattern[2]; >=20 > struct > rte_flow_action > actions[2]; >=20 > struct > rte_flow > *flow > =3D > NULL; >=20 > struct > rte_flow_error > error; >=20 >=20 >=20 > pattern[0].type > =3D > RTE_FLOW_ITEM_TYPE_ETH; >=20 > pattern[1].type > =3D > RTE_FLOW_ITEM_TYPE_END; >=20 >=20 >=20 > // Actions >=20 > actions[0].type > =3D > RTE_FLOW_ACTION_TYPE_DROP; >=20 > actions[0].conf > =3D > NULL; >=20 > actions[1].type > =3D > RTE_FLOW_ACTION_TYPE_END; >=20 >=20 >=20 > // Validation & Cr=E9ation >=20 > if (rte_flow_validate(port_id, > &attr, > pattern, > actions, > &error) > !=3D > 0) { >=20 > printf("=C9chec validation: > %s\n", > error.message); >=20 > return > -1; >=20 > } >=20 >=20 >=20 > flow > =3D > rte_flow_create(port_id, > &attr, > pattern, > actions, > &error); >=20 > if (flow > =3D=3D > NULL) { >=20 > printf("=C9chec cr=E9ation: > %s\n", > error.message); >=20 > return > -1; >=20 > } >=20 >=20 >=20 > printf("R=E8gle DROP cr=E9=E9e.\n"); >=20 > return > 0; >=20 > } >=20 >=20 >=20 >=20 >=20 >=20 > Le lun. 3 f=E9vr. 2025 =E0 16:05, Sid ali cherrati a =E9crit : > I pointed where the error is occurring on the code below :=20 > #include "../include/flow.h" > #include > #include >=20 > int flow_filtering(uint16_t port_id, uint32_t ip_addr, uint16_t udp_port)= { > struct rte_flow_error error; > struct rte_flow_attr attr =3D { .ingress =3D 1, .priority =3D 0 }; > struct rte_flow_item pattern[4]; > struct rte_flow_action action[2]; > struct rte_flow *flow; >=20 > // D=E9finir le motif Ethernet > memset(pattern, 0, sizeof(pattern)); > pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; >=20 > // D=E9finir le motif IPv4 > struct rte_flow_item_ipv4 ipv4_spec =3D { .hdr.dst_addr =3D RTE_BE32(ip_a= ddr) }; > struct rte_flow_item_ipv4 ipv4_mask =3D { .hdr.dst_addr =3D RTE_BE32(0xFF= FFFFFF) }; > pattern[1].type =3D RTE_FLOW_ITEM_TYPE_IPV4; > pattern[1].spec =3D &ipv4_spec; > pattern[1].mask =3D &ipv4_mask; >=20 > // D=E9finir le motif UDP > struct rte_flow_item_udp udp_spec =3D { .hdr.dst_port =3D RTE_BE16(udp_po= rt) }; > struct rte_flow_item_udp udp_mask =3D { .hdr.dst_port =3D RTE_BE16(0xFFFF= ) }; > pattern[2].type =3D RTE_FLOW_ITEM_TYPE_UDP; > pattern[2].spec =3D &udp_spec; > pattern[2].mask =3D &udp_mask; >=20 > // Terminer le motif > pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END; >=20 > // D=E9finir l'action > action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE; > struct rte_flow_action_queue queue_action =3D { .index =3D 0 }; > action[0].conf =3D &queue_action; > action[1].type =3D RTE_FLOW_ACTION_TYPE_END; >=20 > // Cr=E9er la r=E8gle de flux > flow =3D rte_flow_create(port_id, &attr, pattern, action, &error); > if (!flow) { > printf("Erreur lors de la cr=E9ation de la r=E8gle de flux : %s\n", error= .message); > return -1; > } >=20 > printf("R=E8gle de flux cr=E9=E9e avec succ=E8s pour IP %u.%u.%u.%u et po= rt UDP %u\n", > (ip_addr >> 24) & 0xFF, (ip_addr >> 16) & 0xFF, > (ip_addr >> 8) & 0xFF, ip_addr & 0xFF, udp_port); >=20 > return 0; > } >=20 > int create_drop_all_rule(uint16_t port_id) { > struct rte_flow_attr attr =3D { .ingress =3D 1, .priority =3D 1}; > struct rte_flow_item pattern[2]; > struct rte_flow_action actions[2]; > struct rte_flow *flow; > struct rte_flow_error error; >=20 > pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; > pattern[1].type =3D RTE_FLOW_ITEM_TYPE_END; >=20 > actions[0].type =3D RTE_FLOW_ACTION_TYPE_DROP; > actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; >=20 > if (!rte_flow_validate(port_id, &attr, pattern, actions, &error)){ > flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error); > } >=20 > if (flow !=3D 0) { // Its happening Here <--- !!! ---> > printf("Erreur cr=E9ation r=E8gle DROP: %s (Type: %d, Cause: %p)\n",=20 > error.message, error.type, error.cause); > return -1; > } >=20 > printf("Default drop rule created successfully.\n"); > return 0; > } >=20 > Here is what it returns :=20 > EAL: Detected CPU lcores: 6 > EAL: Detected NUMA nodes: 1 > EAL: Detected shared linkage of DPDK > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > EAL: Selected IOVA mode 'VA' > EAL: VFIO support initialized > EAL: Using IOMMU type 1 (Type 1) > Port 0 initialis=E9 avec succ=E8s > Capacit=E9s de la NIC (port 0): > - Groupes support=E9s : 232756 > - Actions support=E9es : 9a69f > R=E8gle de flux cr=E9=E9e avec succ=E8s pour IP 10.81.16.111 et port UDP = 1234 > Erreur cr=E9ation r=E8gle DROP: Not supported action. (Type: 16, Cause: 0= x7ffe87ef63e0) > EAL: Error - exiting with code: 1 > Erreur cr=E9ation r=E8gle drop-all >=20 > Le lun. 3 f=E9vr. 2025 =E0 16:00, Dmitry Kozlyuk a =E9crit : > 2025-02-03 14:51 (UTC+0100), Sid ali cherrati: > > [...] > > if (!rte_flow_validate(port_id, &attr, pattern, actions, &error)){ > > flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error); > > } > >=20 > > if(flow !=3D 0){ > > printf("Filed to create drop flow filter \n"); > > return -1; > > } > > [...]=20 > > The issue is that when I implement this, I get an error on the drop fil= ter: > > "Failed to create rule." Do you have any idea why this might be happeni= ng? >=20 > There is no this exact error text in your code or DPDK, > I assume we're talking about the quoted fragment. > `flow` is a pointer, the correct error condition is `if (flow =3D=3D NULL= )`, > so your code probably misinterprets success as error. > Also `flow` is not assigned if `rte_flow_validate()` returns non-0.