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 B28EB46184 for ; Mon, 3 Feb 2025 18:12:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 832DB40265; Mon, 3 Feb 2025 18:12:17 +0100 (CET) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by mails.dpdk.org (Postfix) with ESMTP id EE61940264 for ; Mon, 3 Feb 2025 18:12:15 +0100 (CET) Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-e455bf1f4d3so4360463276.2 for ; Mon, 03 Feb 2025 09:12:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738602735; x=1739207535; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xg4cTvhv78VWuhiEakz94dN+FglYtdzv1G2ku0I+jS0=; b=Ke82uKDsJ2t0/HLgcTlYxC8+2ydgcr6rW/16qb3lgjss/BHBlvMNrz42188xTjvIpm N5PGHSkgizjI0guroF3ogtNOqK3ZX2Bdawgsx5P5oYx0rWiK8JE2TCCCCyOaNIG3QoJm aAaIP29qVrksKkKprozNp0wE9VKX80JLpKTV+Ht9eeYKmyosW8jcGZNctfCvhQNRjoMe NZK4j42wmwW2tP4/jRU0iOOZWGP8c1wSaKQP44HqRCCSFLwY+yN9Tc0SrNedvU8m4FXt pmndxF+aCDBaDuDegAed9OVmnSyqXLVHOhuOyoCPeQF/EUrzvjnB5gYkHLJGBCIOPF5E E/wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738602735; x=1739207535; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xg4cTvhv78VWuhiEakz94dN+FglYtdzv1G2ku0I+jS0=; b=p48wY8cOTSBe8i+CUjNRBTUNKJ0JBaPsG6nQxnH8kPfHSa8Pv0Ps8ljBRucmv6cb8l YmmOlyjb91oPNiJFqTPavyN+genzOA7Sd5K/bGV+CIZWbMawczU6HWbLBRbdYr0xCthf AIAo6iQhATLcWf010OKFJQYIQRnwYc5j7WEJCfkmuDNzMw6dTf4mzqbuW0Yd8FeA4ov/ 0XtuIwwqKwpqmOrKt64gFN4Wod9Ogq6UTF3fN8nxKfO8kMOPqveDXDFuvhZQEWXDk/BX pVVoTMUsli1iX7+pqvkCuHEwjs8x7Jz6xe1S+23ju64gfTd+9y9N7iPbE/6XUcVoq7HF BIOA== X-Gm-Message-State: AOJu0YzWkQTOnVxTOrK37clwEB7eufJek2hU5Hr6GAppZPmBPwMyTOsF lLZjKnHn2UnI0gUlOkuU5yy9c9m1pyEW5kBhk1OJ78E1O33A1poWNUyXVXMgzVl1QmkT6zEBXHO b+h0ceAFeShdOxp8ruZ+9JrQGHlk= X-Gm-Gg: ASbGncuaM2Piy9iVf0MZ/w8KFiMsrhjabvmU3dNgimxLcigPKrvC5YuQlWqfJQKJL4U CVdi1yLHWalzmHUcd3paVIZvvmH9vYV0qBU/5IsPIB/aTYGdjSRU1u2v1/fBf+unS+kt/Tck= X-Google-Smtp-Source: AGHT+IGPD31xeI+tlpSR/Bvn6cA+nl8R7aQQyRdo3mG2k12LqXddH80AghE7T6wQ3+EPc/IWwS0mNiuNJ5cpkoq0Rxs= X-Received: by 2002:a05:690c:317:b0:6f9:45de:408f with SMTP id 00721157ae682-6f945de4938mr75545407b3.35.1738602735045; Mon, 03 Feb 2025 09:12:15 -0800 (PST) MIME-Version: 1.0 References: <20250128214616.3f9324de@sovereign> <20250203180007.2c5e0607@sovereign> In-Reply-To: From: Sid ali cherrati Date: Mon, 3 Feb 2025 18:12:03 +0100 X-Gm-Features: AWEUYZk1C8sjm1hdLCgs68rPbTspVx4v6N1O30hxjy2DnJLSUrO_iI3eRir_mOE Message-ID: Subject: Re: DPDK Flow Filtering Not Working as Expected To: Dmitry Kozlyuk Cc: users@dpdk.org Content-Type: multipart/alternative; boundary="0000000000006d96d7062d3ffedd" 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 --0000000000006d96d7062d3ffedd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here is a better version of the code : #include "../include/flow.h" #include #include 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; // D=C3=A9finir le motif Ethernet memset(pattern, 0, sizeof(pattern)); pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; // D=C3=A9finir le motif IPv4 struct rte_flow_item_ipv4 ipv4_spec =3D { .hdr.dst_addr =3D RTE_BE32(ip_add= r) }; struct rte_flow_item_ipv4 ipv4_mask =3D { .hdr.dst_addr =3D RTE_BE32(0xFFFF= FFFF) }; pattern[1].type =3D RTE_FLOW_ITEM_TYPE_IPV4; pattern[1].spec =3D &ipv4_spec; pattern[1].mask =3D &ipv4_mask; // D=C3=A9finir le motif UDP struct rte_flow_item_udp udp_spec =3D { .hdr.dst_port =3D RTE_BE16(udp_port= ) }; 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; // Terminer le motif pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END; // D=C3=A9finir 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; // Cr=C3=A9er la r=C3=A8gle de flux flow =3D rte_flow_create(port_id, &attr, pattern, action, &error); if (flow =3D=3D NULL) { printf("Erreur lors de la cr=C3=A9ation de la r=C3=A8gle de flux : %s\n", e= rror. message); return -1; } printf("R=C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP %u.%u.%= u.%u et port UDP %u\n ", (ip_addr >> 24) & 0xFF, (ip_addr >> 16) & 0xFF, (ip_addr >> 8) & 0xFF, ip_addr & 0xFF, udp_port); return 0; } 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 =3D NULL; struct rte_flow_error error; pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; pattern[1].type =3D RTE_FLOW_ITEM_TYPE_END; // Actions actions[0].type =3D RTE_FLOW_ACTION_TYPE_DROP; actions[0].conf =3D NULL; actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; // Validation & Cr=C3=A9ation if (rte_flow_validate(port_id, &attr, pattern, actions, &error) !=3D 0) { printf("=C3=89chec validation: %s\n", error.message); return -1; } flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error); if (flow =3D=3D NULL) { printf("=C3=89chec cr=C3=A9ation: %s\n", error.message); return -1; } printf("R=C3=A8gle DROP cr=C3=A9=C3=A9e.\n"); return 0; } Le lun. 3 f=C3=A9vr. 2025 =C3=A0 16:05, Sid ali cherrati a =C3=A9crit : > I pointed where the error is occurring on the code below : > > #include "../include/flow.h" > #include > #include > > 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; > > // D=C3=A9finir le motif Ethernet > memset(pattern, 0, sizeof(pattern)); > pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; > > // D=C3=A9finir 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( > 0xFFFFFFFF) }; > pattern[1].type =3D RTE_FLOW_ITEM_TYPE_IPV4; > pattern[1].spec =3D &ipv4_spec; > pattern[1].mask =3D &ipv4_mask; > > // D=C3=A9finir 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; > > // Terminer le motif > pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END; > > // D=C3=A9finir 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; > > // Cr=C3=A9er la r=C3=A8gle de flux > flow =3D rte_flow_create(port_id, &attr, pattern, action, &error); > if (!flow) { > printf("Erreur lors de la cr=C3=A9ation de la r=C3=A8gle de flux : %s\n",= error. > message); > return -1; > } > > printf("R=C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP %u.%u= .%u.%u et port UDP %u > \n", > (ip_addr >> 24) & 0xFF, (ip_addr >> 16) & 0xFF, > (ip_addr >> 8) & 0xFF, ip_addr & 0xFF, udp_port); > > return 0; > } > > 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; > > pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH; > pattern[1].type =3D RTE_FLOW_ITEM_TYPE_END; > > actions[0].type =3D RTE_FLOW_ACTION_TYPE_DROP; > actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; > > if (!rte_flow_validate(port_id, &attr, pattern, actions, &error)){ > flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error); > } > > if (flow !=3D 0) { // Its happening Here <--- !!! ---> > printf("Erreur cr=C3=A9ation r=C3=A8gle DROP: %s (Type: %d, Cause: %p)\n"= , > error.message, error.type, error.cause); > return -1; > } > > printf("Default drop rule created successfully.\n"); > return 0; > } > > Here is what it returns : > >> 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=C3=A9 avec succ=C3=A8s >> Capacit=C3=A9s de la NIC (port 0): >> - Groupes support=C3=A9s : 232756 >> - Actions support=C3=A9es : 9a69f >> R=C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP 10.81.16.111= et port UDP 1234 >> Erreur cr=C3=A9ation r=C3=A8gle DROP: Not supported action. (Type: 16, C= ause: >> 0x7ffe87ef63e0) >> EAL: Error - exiting with code: 1 >> Erreur cr=C3=A9ation r=C3=A8gle drop-all >> > > Le lun. 3 f=C3=A9vr. 2025 =C3=A0 16:00, Dmitry Kozlyuk a > =C3=A9crit : > >> 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); >> > } >> > >> > if(flow !=3D 0){ >> > printf("Filed to create drop flow filter \n"); >> > return -1; >> > } >> > [...] >> > The issue is that when I implement this, I get an error on the drop >> filter: >> > "Failed to create rule." Do you have any idea why this might be >> happening? >> >> 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 NUL= L)`, >> so your code probably misinterprets success as error. >> Also `flow` is not assigned if `rte_flow_validate()` returns non-0. >> > --0000000000006d96d7062d3ffedd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here is a better version of the code :
#include "../include/flow.h"
#include &= lt;stdio.h>
#inc= lude <string.h>

int flow_filtering(u= int16_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, .prio= rity =3D 0 };
= struct r= te_flow_item pattern[4];
struct<= span style=3D"color:rgb(204,204,204)"> rte_flow_action action[2<= span style=3D"color:rgb(204,204,204)">];
stru= ct rte_flow <= /span>*flow;=

// D=C3=A9finir le motif Ethernet
<= div> memset(pattern, 0, sizeof(pattern));
= pattern[= 0].type =3D RTE_FLOW_ITEM= _TYPE_ETH;

// D=C3=A9finir le motif IPv4
struct rte_flow_item_ipv4 ipv4_spec =3D { .= hdr.dst_addr= =3D RTE_BE32(ip_addr) };
struc= t rte_flow_item_ipv4 ipv4_mask =3D { .hdr.dst_addr =3D RTE_BE32(0xFFFFFFFF) };
pattern[1].type =3D RTE_FLOW_ITEM_TYPE_IPV4;
pattern[1].spec =3D &ipv4_spec= ;
pattern[1].mask =3D = &ipv4_mask;

= // D=C3=A9finir le motif UDP
struct = rte_flow_item_udp udp_spec =3D { .hdr.dst_port =3D RTE_BE16(= udp_port) };
struct <= span style=3D"color:rgb(78,201,176)">rte_flow_item_udp udp= _mask =3D { = .hdr.dst_por= t =3D RTE_BE16(0xFFFF) };
pattern[2= ].type =3D RTE_FLOW_ITEM_TYPE_UDP;
pattern[2<= span style=3D"color:rgb(204,204,204)">].spec =3D &udp_spec;
pattern[2= ].mask =3D &udp_mask;

= // Terminer le motif
pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END;

// D=C3=A9f= inir l'action
= action[= 0].type =3D RTE_FLOW_ACTI= ON_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_EN= D;

// Cr=C3=A9er la r=C3=A8gle de flux
= flow =3D rte_flow_create(port_id, &attr, pattern, action, &error);
if<= span style=3D"color:rgb(204,204,204)"> (flow =3D=3D NULL) {
print= f("Erreur lors de la cr=C3=A9ation de la r=C3=A8gle d= e flux : %s\n", error.message);
return -1;
}

printf("R=C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP <= /span>%u.%u<= span style=3D"color:rgb(206,145,120)">.%u.%u et port UDP %u\n",
<= div> (ip_addr >> 24) & 0xFF, (ip_= addr >> 16) &<= /span> 0xFF,=
(ip_addr >> 8) & 0xFF, ip_addr & 0xFF, udp_port);

<= div> return 0;
}

int create_drop_all_rule(uint16_t port_id<= /span>) {
struct rte_flow_attr attr =3D { .ingress =3D = 1, .priority= =3D 1 };
s= truct rte_flow_item pattern[2];
struct rte_flow_action actions[2];
struct rte_flow *flow =3D NULL;
struct <= span style=3D"color:rgb(78,201,176)">rte_flow_error
error<= /span>;

pattern[0].type = =3D RTE_FLOW_ITEM_TYPE_ETH;
= pattern[1].type <= span style=3D"color:rgb(212,212,212)">=3D RTE_FLOW_ITEM_TYP= E_END;

<= span style=3D"color:rgb(204,204,204)"> // Actions
actions[0].type = =3D RTE_FLOW_= ACTION_TYPE_DROP;
actions[<= /span>0].conf =3D NULL;
actions[1].type =3D RTE_FLOW_ACTION_TYPE_EN= D;

// Validation & Cr=C3=A9ation
if= (rte_flow_validate(port_id, &attr, pattern, actions, &error) !=3D 0) {
printf(<= span style=3D"color:rgb(206,145,120)">"=C3=89chec validation: <= span style=3D"color:rgb(156,220,254)">%s\n", error.message);
= return -1;
= }

flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error);
if (flow =3D= =3D NULL) {
printf("=C3=89chec = cr=C3=A9ation: %s\n", error.message);
retu= rn -1= ;
}

printf("R=C3=A8gle DROP cr=C3=A9=C3=A9e.\n"= );
return 0;
}


Le=C2=A0lun. 3 f=C3=A9vr. 2025 =C3=A0=C2= =A016:05, Sid ali cherrati <sche= rrati1@gmail.com> a =C3=A9crit=C2=A0:
I pointed where the error is = occurring on the code below :

= #include "../include/flow.h"
#include <stdio.h>= ;
#include <string.h>

int flow_filtering(uint16_t port_id, <= span style=3D"color:rgb(78,201,176)">uint32_t ip_addr, uint16_t = udp_port) {
struct = rte_flow_error error;
struct rte_flow_att= r attr =3D { .ingress =3D 1, .priority =3D 0 };
struct rte_flow_item pattern[= 4];
<= /span>struct rte_flow= _action action[2];
struct rte_flow *= flow;

// D=C3=A9finir le motif Ethernet
memset(pattern, 0, = sizeof(pattern));
pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH;

// D=C3=A9finir le motif IPv4
struct rte_flow_item_ipv4= ipv4_spec = =3D { .hdr.<= /span>dst_addr =3D<= /span> RTE_BE32(ip_addr) };
struct rte_flow_item_ipv4 = ipv4_mask =3D { .hdr.dst_addr =3D RTE_BE32(0xFFFFFFFF) };
= pattern[= 1].type =3D RTE_FLOW_ITEM= _TYPE_IPV4;
= pattern[= 1].spec =3D &ipv4_spec;
pattern[1].mask =3D &ipv4_mask;
=
// D=C3=A9finir le motif UDP
struct rte_flow_item_udp udp_spec =3D { .= hdr.dst_port= =3D RTE_BE16(udp_port) };
stru= ct rte_flow_item_udp udp_mask =3D { .hdr.dst_port =3D RTE_BE16= (0xFFFF) };
pattern<= span style=3D"color:rgb(204,204,204)">[2].type =3D R= TE_FLOW_ITEM_TYPE_UDP;=
pattern[2].spec<= /span> =3D <= span style=3D"color:rgb(212,212,212)">&udp_spec;
pattern[2].ma= sk =3D &udp_mask;

// Terminer le motif
pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END;

// D=C3=A9finir l'act= ion
action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE<= /span>;
struct rte_flow_action_queue queue_act= ion =3D { .<= /span>index =3D 0 };
action[<= /span>0].conf =3D &queue_action;=
action[1].type =3D RTE_FLOW_ACTION_TYPE_END;

// Cr=C3= =A9er la r=C3=A8gle de flux
flow =3D rte_flow_create(port_id= , &attr<= span style=3D"color:rgb(204,204,204)">, pattern, action, &<= span style=3D"color:rgb(156,220,254)">error);
= if (!flow) {
printf("Erreur lors de la cr=C3=A9ation de la r=C3=A8gle de flux : %s\n"<= span style=3D"color:rgb(204,204,204)">, error.message);
= return = -1;
}

printf("R= =C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP %u.%u.%u.%u et port UDP= %u\n"<= /span>,
(ip_addr >> 24) & 0xFF, (ip_addr >> 16) & = 0xFF,
(ip_addr >> 8= ) & 0xFF, ip_addr & 0xFF, udp_port);

retu= rn 0;=
}

int create_drop_all_ru= le(uint16_t <= /span>port_id) {
struct rte_flow_attr attr =3D { .ingress =3D 1, .p= riority =3D = 1};
struct r= te_flow_item pattern[2];
struct<= span style=3D"color:rgb(204,204,204)"> rte_flow_action actions[2= ];
str= uct rte_flow = *flow;
struct rte_flow_error error;
pattern[<= /span>0].type =3D RTE_FLOW_ITEM_TYPE_ETH;
pattern[1].type =3D RTE_F= LOW_ITEM_TYPE_END;
actions[0].type<= /span> =3D <= span style=3D"color:rgb(79,193,255)">RTE_FLOW_ACTION_TYPE_DROP;
actions[1].type =3D RTE_FLOW_ACTION_TYPE_END;<= /span>

if (!rte_flow_validate(port_id, &attr, pattern, = actions, &error)){
flow =3D rte_flow_create(port_id, &attr, pattern, actions, &error);
}=

if (flow !=3D 0= ) { // Its happening Here <= --- !!! --->
= printf(= "Erreur cr=C3=A9ation r=C3=A8gle DROP: %s (Type: %d, Cause: %p)\n",
error.message, error.type, error.cause);
return -1;
}

printf("Default drop rule created successfully.\n&quo= t;);
return 0;
}
=

Here is what it returns :
EAL: Detected CPU lcores: 6
EAL: De= tected 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=C3=A9 avec succ=C3=A8s
Capacit=C3=A9s de la NIC (p= ort 0):
- Groupes support=C3=A9s : 232756
- Actions support=C3=A9es := 9a69f
R=C3=A8gle de flux cr=C3=A9=C3=A9e avec succ=C3=A8s pour IP 10.81= .16.111 et port UDP 1234
Erreur cr=C3=A9ation r=C3=A8gle DROP: Not suppo= rted action. (Type: 16, Cause: 0x7ffe87ef63e0)
EAL: Error - exiting with= code: 1
Erreur cr=C3=A9ation r=C3=A8gle drop-all
=

= Le=C2=A0lun. 3 f=C3=A9vr. 2025 =C3=A0=C2=A016:00, Dmitry Kozlyuk <dmitry.kozliuk@gmai= l.com> a =C3=A9crit=C2=A0:
2025-02-03 14:51 (UTC+0100), Sid ali cherrati:
> [...]
> if (!rte_flow_validate(port_id, &attr, pattern, actions, &erro= r)){
> flow =3D rte_flow_create(port_id, &attr, pattern, actions, &er= ror);
> }
>
> if(flow !=3D 0){
> printf("Filed to create drop flow filter \n");
> return -1;
> }
> [...]
> The issue is that when I implement this, I get an error on the drop fi= lter:
> "Failed to create rule." Do you have any idea why this might= be happening?

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.
--0000000000006d96d7062d3ffedd--