From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BE43A46140
	for <public@inbox.dpdk.org>; Tue, 28 Jan 2025 17:54:52 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B32AD40615;
	Tue, 28 Jan 2025 17:54:52 +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 A9BAD40144
 for <users@dpdk.org>; Tue, 28 Jan 2025 17:54:51 +0100 (CET)
Received: by mail-yb1-f169.google.com with SMTP id
 3f1490d57ef6-e549be93d5eso10391526276.1
 for <users@dpdk.org>; Tue, 28 Jan 2025 08:54:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1738083291; x=1738688091; darn=dpdk.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=5UdPJW59Za4ZdSliU3UnNXeNZ6ZW/NHffc2J6KvWIe0=;
 b=Ajn5+81PjNcRrsG++XworpuzXbjpOnJEbuuLbF9hVYksSuiQPxC6o8AdgGhSXwLn48
 Jcx4+XNIqI4KsGiK7/R2VBPiPhh+ipHw4fUs1a5RClLLGU13L0MyfzHC5jg+S5kiokZ6
 m5YignAwLxsBR3qosJXQIwb8/nFY+QeS7fFNPjAufRwYRf0DHZmuPU6Dn4E7spIl0Gt5
 cGk2kEFkWX9UOQs1WNOclp06AoUJPtQdnVEUA9gBh8jd4yxx297rx2vF1czQNdBt1txt
 CTv9Pp6Suf/MGb0acSir0sD+8NMe3i3pNEH/bwpCrfnpCQuqtSt4dknU8QrsslU8kk9u
 e2OQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1738083291; x=1738688091;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=5UdPJW59Za4ZdSliU3UnNXeNZ6ZW/NHffc2J6KvWIe0=;
 b=H5u6PpDaJEaVlmFOUeLtb169hNRSijWJNiesjcYkIvX1YayXSd6RPzvN7NsSgtYZwo
 pK6Z8lqiU0J5jL9e0gKM0HLpetAy3MxuuDs9K6tDt3tpQW9ZOxquzS5L9qpF0ZohJzFk
 tBw/xcFKbKOZQXoHrH/t/cY53jul9MXLhUUEP3V0mnh8k5t43vfeh9BvhGpcD2W64jE+
 bB4PGrOi7B8nXeN1vGd7o1er4D0R6w5nwLT5LVXAQ+jKaJrR5hSpqRqjNenc6nt3FTpf
 eZHAdpGq2cX4wWntvSQk9A21zESnjsp0Fy0XfXxYuyoe15kZRj2QL3F6+uAKi7rHPslH
 v1jQ==
X-Gm-Message-State: AOJu0YyYVks7RPGaLCz5ovXkm8PtrGsFQALR8Vn2/7AUoJh8I02F6xCy
 X61Yowr8X1dnlZih7X6QoLjpg6xTAFdPdnPQpnPFom+bIusn5k3GdTNBNVF432kf+GtGzHq3Ate
 XnFpWLzu80dKv/mzmk4WfQ1yRuGVowYJk8gw=
X-Gm-Gg: ASbGncvO4yh4bgI31mja0Jg5Gda4JaNKrgpFs3rbXSc7BnBfXGPMPc/0aQ2W14jIM+u
 zlIZU4g3H9QPDSDx6QyORyh4D2+naJFFJMaSyYYnVamWdXlxIV0EgzOKzimwJKP3LNAvcPi4=
X-Google-Smtp-Source: AGHT+IFOk0FhgeqBRYph4ntJinOmFzaoNeep409g0iFELy5YBx9RR5NpjsRZpcJ5wDOFtKEI+ZjRrAKu5ZctCfKZG/s=
X-Received: by 2002:a05:6902:2312:b0:e57:48ae:147c with SMTP id
 3f1490d57ef6-e57b10638acmr34369967276.16.1738083290859; Tue, 28 Jan 2025
 08:54:50 -0800 (PST)
MIME-Version: 1.0
From: Sid ali cherrati <scherrati1@gmail.com>
Date: Tue, 28 Jan 2025 17:54:40 +0100
X-Gm-Features: AWEUYZlwLkEqHMwbZz3RZDICYj8E4XvReWDu8DKoSvE_9zS3CsxfAH_N_IwjIT4
Message-ID: <CALn3+CP3vKCjp8vR1Uwki3XaW8Nu04Et5PBdop78Cp48=DhOow@mail.gmail.com>
Subject: DPDK Flow Filtering Not Working as Expected
To: users@dpdk.org
Content-Type: multipart/alternative; boundary="000000000000244e11062cc70dbe"
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

--000000000000244e11062cc70dbe
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Dear DPDK Team,

I am attempting to use DPDK's rte_flow API to filter incoming packets at
the hardware level. My goal is to drop all packets except those with a
specific IP address and UDP port.

I have implemented the following flow filtering rule in my code:
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;
struct rte_flow_item pattern[4]; // 4 pour inclure END
struct rte_flow_action action[2];
struct rte_flow *flow;

// Remplir l'attribut de la r=C3=A8gle
memset(&attr, 0, sizeof(struct rte_flow_attr));
attr.ingress =3D 1; // R=C3=A8gle pour le trafic entrant
attr.priority =3D 1000; // Priorit=C3=A9 haute pour que cette r=C3=A8gle so=
it appliqu=C3=A9e
en premier

// D=C3=A9finir le motif de filtrage (IP + UDP)
memset(pattern, 0, sizeof(pattern));

pattern[0].type =3D RTE_FLOW_ITEM_TYPE_ETH;

// Motif IPv4
pattern[1].type =3D RTE_FLOW_ITEM_TYPE_IPV4;
pattern[1].spec =3D &(struct rte_flow_item_ipv4){
.hdr =3D {
.dst_addr =3D RTE_BE32(ip_addr), // Adresse IP de destination
}
};
pattern[1].mask =3D &(struct rte_flow_item_ipv4){
.hdr =3D {
.dst_addr =3D RTE_BE32(0xFFFFFFFF), // Masque pour l'adresse IP
}
};

// Motif UDP
pattern[2].type =3D RTE_FLOW_ITEM_TYPE_UDP;
pattern[2].spec =3D &(struct rte_flow_item_udp){
.hdr =3D {
.dst_port =3D RTE_BE16(udp_port), // Port de destination
}
};
pattern[2].mask =3D &(struct rte_flow_item_udp){
.hdr =3D {
.dst_port =3D RTE_BE16(0xFFFF), // Masque pour le port
}
};

// Fin du motif
pattern[3].type =3D RTE_FLOW_ITEM_TYPE_END;

// D=C3=A9finir l'action (accepter le paquet)
memset(action, 0, sizeof(action));

// Envoyer =C3=A0 la file RX_ID
action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE;
action[0].conf =3D &(struct rte_flow_action_queue){
.index =3D RX_ID, // Envoyer les paquets =C3=A0 la file RX_ID
};

// Fin de la liste d'actions
action[1].type =3D RTE_FLOW_ACTION_TYPE_END;

// Cr=C3=A9er la r=C3=A8gle de filtrage
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 filtrage : %s\n=
", error.
message);
return -1;
}

// Afficher un message de succ=C3=A8s
printf(
"R=C3=A8gle de filtrage cr=C3=A9ee avec succ=C3=A8s pour l'IP %u.%u.%u.%u e=
t le port %u\n",
(ip_addr >> 24) & 0xFF,
(ip_addr >> 16) & 0xFF,
(ip_addr >> 8) & 0xFF,
ip_addr & 0xFF,
udp_port
);

return 0;
}

However, despite this configuration, I continue to receive packets with
other IP addresses and ports that do not match the specified filter.

Could you provide any insights into why the filtering isn't working as
expected? Any advice on ensuring the rule is properly applied at the
hardware level would be greatly appreciated.

Thank you for your assistance.

Best regards,

Ali

--000000000000244e11062cc70dbe
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p>Dear DPDK Team,</p><p>I am attempting to use DPDK&#39;s=
 <code>rte_flow</code>
 API to filter incoming packets at the hardware level. My goal is to=20
drop all packets except those with a specific IP address and UDP port.</p><=
p>I have implemented the following flow filtering rule in my code:</p><div =
style=3D"color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:=
&quot;Droid Sans Mono&quot;,&quot;monospace&quot;,monospace;font-weight:nor=
mal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style=
=3D"color:rgb(86,156,214)">int</span><span style=3D"color:rgb(204,204,204)"=
> </span><span style=3D"color:rgb(220,220,170)">flow_filtering</span><span =
style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(78,201,17=
6)">uint16_t</span><span style=3D"color:rgb(204,204,204)"> </span><span sty=
le=3D"color:rgb(156,220,254)">port_id</span><span style=3D"color:rgb(204,20=
4,204)">, </span><span style=3D"color:rgb(78,201,176)">uint32_t</span><span=
 style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(156,220,=
254)">ip_addr</span><span style=3D"color:rgb(204,204,204)">, </span><span s=
tyle=3D"color:rgb(78,201,176)">uint16_t</span><span style=3D"color:rgb(204,=
204,204)"> </span><span style=3D"color:rgb(156,220,254)">udp_port</span><sp=
an style=3D"color:rgb(204,204,204)">) {</span></div><div><span style=3D"col=
or:rgb(204,204,204)">    </span><span style=3D"color:rgb(86,156,214)">struc=
t</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color=
:rgb(78,201,176)">rte_flow_error</span><span style=3D"color:rgb(204,204,204=
)"> </span><span style=3D"color:rgb(156,220,254)">error</span><span style=
=3D"color:rgb(204,204,204)">;</span></div><div><span style=3D"color:rgb(204=
,204,204)">    </span><span style=3D"color:rgb(86,156,214)">struct</span><s=
pan style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(78,20=
1,176)">rte_flow_attr</span><span style=3D"color:rgb(204,204,204)"> </span>=
<span style=3D"color:rgb(156,220,254)">attr</span><span style=3D"color:rgb(=
204,204,204)">;</span></div><div><span style=3D"color:rgb(204,204,204)">   =
 </span><span style=3D"color:rgb(86,156,214)">struct</span><span style=3D"c=
olor:rgb(204,204,204)"> </span><span style=3D"color:rgb(78,201,176)">rte_fl=
ow_item</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D=
"color:rgb(156,220,254)">pattern</span><span style=3D"color:rgb(204,204,204=
)">[</span><span style=3D"color:rgb(181,206,168)">4</span><span style=3D"co=
lor:rgb(204,204,204)">];</span><span style=3D"color:rgb(106,153,85)"> // 4 =
pour inclure END</span></div><div><span style=3D"color:rgb(204,204,204)">  =
  </span><span style=3D"color:rgb(86,156,214)">struct</span><span style=3D"=
color:rgb(204,204,204)"> </span><span style=3D"color:rgb(78,201,176)">rte_f=
low_action</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(156,220,254)">action</span><span style=3D"color:rgb(204,204,2=
04)">[</span><span style=3D"color:rgb(181,206,168)">2</span><span style=3D"=
color:rgb(204,204,204)">];</span></div><div><span style=3D"color:rgb(204,20=
4,204)">    </span><span style=3D"color:rgb(86,156,214)">struct</span><span=
 style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(78,201,1=
76)">rte_flow</span><span style=3D"color:rgb(204,204,204)"> </span><span st=
yle=3D"color:rgb(212,212,212)">*</span><span style=3D"color:rgb(156,220,254=
)">flow</span><span style=3D"color:rgb(204,204,204)">;</span></div><br><div=
><span style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb=
(106,153,85)">// Remplir l&#39;attribut de la r=C3=A8gle</span></div><div><=
span style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(2=
20,220,170)">memset</span><span style=3D"color:rgb(204,204,204)">(</span><s=
pan style=3D"color:rgb(212,212,212)">&amp;</span><span style=3D"color:rgb(1=
56,220,254)">attr</span><span style=3D"color:rgb(204,204,204)">, </span><sp=
an style=3D"color:rgb(181,206,168)">0</span><span style=3D"color:rgb(204,20=
4,204)">, </span><span style=3D"color:rgb(86,156,214)">sizeof</span><span s=
tyle=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(86,156,214=
)">struct</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(78,201,176)">rte_flow_attr</span><span style=3D"color:rgb(204=
,204,204)">));</span></div><div><span style=3D"color:rgb(204,204,204)">    =
</span><span style=3D"color:rgb(156,220,254)">attr</span><span style=3D"col=
or:rgb(204,204,204)">.</span><span style=3D"color:rgb(156,220,254)">ingress=
</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:=
rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,204,204)"> </span>=
<span style=3D"color:rgb(181,206,168)">1</span><span style=3D"color:rgb(204=
,204,204)">;</span><span style=3D"color:rgb(106,153,85)"> // R=C3=A8gle pou=
r le trafic entrant</span></div><div><span style=3D"color:rgb(204,204,204)"=
>    </span><span style=3D"color:rgb(156,220,254)">attr</span><span style=
=3D"color:rgb(204,204,204)">.</span><span style=3D"color:rgb(156,220,254)">=
priority</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,204,204)=
"> </span><span style=3D"color:rgb(181,206,168)">1000</span><span style=3D"=
color:rgb(204,204,204)">;</span><span style=3D"color:rgb(106,153,85)"> // P=
riorit=C3=A9 haute pour que cette r=C3=A8gle soit appliqu=C3=A9e en premier=
</span></div><br><div><span style=3D"color:rgb(204,204,204)">    </span><sp=
an style=3D"color:rgb(106,153,85)">// D=C3=A9finir le motif de filtrage (IP=
 + UDP)</span></div><div><span style=3D"color:rgb(204,204,204)">    </span>=
<span style=3D"color:rgb(220,220,170)">memset</span><span style=3D"color:rg=
b(204,204,204)">(</span><span style=3D"color:rgb(156,220,254)">pattern</spa=
n><span style=3D"color:rgb(204,204,204)">, </span><span style=3D"color:rgb(=
181,206,168)">0</span><span style=3D"color:rgb(204,204,204)">, </span><span=
 style=3D"color:rgb(86,156,214)">sizeof</span><span style=3D"color:rgb(204,=
204,204)">(</span><span style=3D"color:rgb(156,220,254)">pattern</span><spa=
n style=3D"color:rgb(204,204,204)">));</span></div><br><div><span style=3D"=
color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,220,254)">p=
attern</span><span style=3D"color:rgb(204,204,204)">[</span><span style=3D"=
color:rgb(181,206,168)">0</span><span style=3D"color:rgb(204,204,204)">].</=
span><span style=3D"color:rgb(156,220,254)">type</span><span style=3D"color=
:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">=3D</span=
><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(79=
,193,255)">RTE_FLOW_ITEM_TYPE_ETH</span><span style=3D"color:rgb(204,204,20=
4)">;</span></div><br><div><span style=3D"color:rgb(204,204,204)">    </spa=
n><span style=3D"color:rgb(106,153,85)">// Motif IPv4</span></div><div><spa=
n style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,=
220,254)">pattern</span><span style=3D"color:rgb(204,204,204)">[</span><spa=
n style=3D"color:rgb(181,206,168)">1</span><span style=3D"color:rgb(204,204=
,204)">].</span><span style=3D"color:rgb(156,220,254)">type</span><span sty=
le=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)=
">=3D</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"c=
olor:rgb(79,193,255)">RTE_FLOW_ITEM_TYPE_IPV4</span><span style=3D"color:rg=
b(204,204,204)">;</span></div><div><span style=3D"color:rgb(204,204,204)"> =
   </span><span style=3D"color:rgb(156,220,254)">pattern</span><span style=
=3D"color:rgb(204,204,204)">[</span><span style=3D"color:rgb(181,206,168)">=
1</span><span style=3D"color:rgb(204,204,204)">].</span><span style=3D"colo=
r:rgb(156,220,254)">spec</span><span style=3D"color:rgb(204,204,204)"> </sp=
an><span style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rg=
b(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">&amp;</span>=
<span style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(86,=
156,214)">struct</span><span style=3D"color:rgb(204,204,204)"> </span><span=
 style=3D"color:rgb(78,201,176)">rte_flow_item_ipv4</span><span style=3D"co=
lor:rgb(204,204,204)">){</span></div><div><span style=3D"color:rgb(204,204,=
204)">        .</span><span style=3D"color:rgb(156,220,254)">hdr</span><spa=
n style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212=
,212)">=3D</span><span style=3D"color:rgb(204,204,204)"> {</span></div><div=
><span style=3D"color:rgb(204,204,204)">            .</span><span style=3D"=
color:rgb(156,220,254)">dst_addr</span><span style=3D"color:rgb(204,204,204=
)"> </span><span style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"=
color:rgb(204,204,204)"> </span><span style=3D"color:rgb(86,156,214)">RTE_B=
E32</span><span style=3D"color:rgb(204,204,204)">(</span><span style=3D"col=
or:rgb(156,220,254)">ip_addr</span><span style=3D"color:rgb(204,204,204)">)=
,</span><span style=3D"color:rgb(106,153,85)"> // Adresse IP de destination=
</span></div><div><span style=3D"color:rgb(204,204,204)">        }</span></=
div><div><span style=3D"color:rgb(204,204,204)">    };</span></div><div><sp=
an style=3D"color:rgb(204,204,204)">    </span></div><div><span style=3D"co=
lor:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,220,254)">pat=
tern</span><span style=3D"color:rgb(204,204,204)">[</span><span style=3D"co=
lor:rgb(181,206,168)">1</span><span style=3D"color:rgb(204,204,204)">].</sp=
an><span style=3D"color:rgb(156,220,254)">mask</span><span style=3D"color:r=
gb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">=3D</span><=
span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,=
212,212)">&amp;</span><span style=3D"color:rgb(204,204,204)">(</span><span =
style=3D"color:rgb(86,156,214)">struct</span><span style=3D"color:rgb(204,2=
04,204)"> </span><span style=3D"color:rgb(78,201,176)">rte_flow_item_ipv4</=
span><span style=3D"color:rgb(204,204,204)">){</span></div><div><span style=
=3D"color:rgb(204,204,204)">        .</span><span style=3D"color:rgb(156,22=
0,254)">hdr</span><span style=3D"color:rgb(204,204,204)"> </span><span styl=
e=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,204,204=
)"> {</span></div><div><span style=3D"color:rgb(204,204,204)">            .=
</span><span style=3D"color:rgb(156,220,254)">dst_addr</span><span style=3D=
"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">=3D=
</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:=
rgb(86,156,214)">RTE_BE32</span><span style=3D"color:rgb(204,204,204)">(</s=
pan><span style=3D"color:rgb(181,206,168)">0xFFFFFFFF</span><span style=3D"=
color:rgb(204,204,204)">),</span><span style=3D"color:rgb(106,153,85)"> // =
Masque pour l&#39;adresse IP</span></div><div><span style=3D"color:rgb(204,=
204,204)">        }</span></div><div><span style=3D"color:rgb(204,204,204)"=
>    };</span></div><br><div><span style=3D"color:rgb(204,204,204)">    </s=
pan><span style=3D"color:rgb(106,153,85)">// Motif UDP</span></div><div><sp=
an style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156=
,220,254)">pattern</span><span style=3D"color:rgb(204,204,204)">[</span><sp=
an style=3D"color:rgb(181,206,168)">2</span><span style=3D"color:rgb(204,20=
4,204)">].</span><span style=3D"color:rgb(156,220,254)">type</span><span st=
yle=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212=
)">=3D</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"=
color:rgb(79,193,255)">RTE_FLOW_ITEM_TYPE_UDP</span><span style=3D"color:rg=
b(204,204,204)">;</span></div><div><span style=3D"color:rgb(204,204,204)"> =
   </span><span style=3D"color:rgb(156,220,254)">pattern</span><span style=
=3D"color:rgb(204,204,204)">[</span><span style=3D"color:rgb(181,206,168)">=
2</span><span style=3D"color:rgb(204,204,204)">].</span><span style=3D"colo=
r:rgb(156,220,254)">spec</span><span style=3D"color:rgb(204,204,204)"> </sp=
an><span style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rg=
b(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">&amp;</span>=
<span style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(86,=
156,214)">struct</span><span style=3D"color:rgb(204,204,204)"> </span><span=
 style=3D"color:rgb(78,201,176)">rte_flow_item_udp</span><span style=3D"col=
or:rgb(204,204,204)">){</span></div><div><span style=3D"color:rgb(204,204,2=
04)">        .</span><span style=3D"color:rgb(156,220,254)">hdr</span><span=
 style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,=
212)">=3D</span><span style=3D"color:rgb(204,204,204)"> {</span></div><div>=
<span style=3D"color:rgb(204,204,204)">            .</span><span style=3D"c=
olor:rgb(156,220,254)">dst_port</span><span style=3D"color:rgb(204,204,204)=
"> </span><span style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"c=
olor:rgb(204,204,204)"> </span><span style=3D"color:rgb(86,156,214)">RTE_BE=
16</span><span style=3D"color:rgb(204,204,204)">(</span><span style=3D"colo=
r:rgb(156,220,254)">udp_port</span><span style=3D"color:rgb(204,204,204)">)=
,</span><span style=3D"color:rgb(106,153,85)"> // Port de destination</span=
></div><div><span style=3D"color:rgb(204,204,204)">        }</span></div><d=
iv><span style=3D"color:rgb(204,204,204)">    };</span></div><div><span sty=
le=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,220,2=
54)">pattern</span><span style=3D"color:rgb(204,204,204)">[</span><span sty=
le=3D"color:rgb(181,206,168)">2</span><span style=3D"color:rgb(204,204,204)=
">].</span><span style=3D"color:rgb(156,220,254)">mask</span><span style=3D=
"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">=3D=
</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:=
rgb(212,212,212)">&amp;</span><span style=3D"color:rgb(204,204,204)">(</spa=
n><span style=3D"color:rgb(86,156,214)">struct</span><span style=3D"color:r=
gb(204,204,204)"> </span><span style=3D"color:rgb(78,201,176)">rte_flow_ite=
m_udp</span><span style=3D"color:rgb(204,204,204)">){</span></div><div><spa=
n style=3D"color:rgb(204,204,204)">        .</span><span style=3D"color:rgb=
(156,220,254)">hdr</span><span style=3D"color:rgb(204,204,204)"> </span><sp=
an style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,=
204,204)"> {</span></div><div><span style=3D"color:rgb(204,204,204)">      =
      .</span><span style=3D"color:rgb(156,220,254)">dst_port</span><span s=
tyle=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,21=
2)">=3D</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D=
"color:rgb(86,156,214)">RTE_BE16</span><span style=3D"color:rgb(204,204,204=
)">(</span><span style=3D"color:rgb(181,206,168)">0xFFFF</span><span style=
=3D"color:rgb(204,204,204)">),</span><span style=3D"color:rgb(106,153,85)">=
 // Masque pour le port</span></div><div><span style=3D"color:rgb(204,204,2=
04)">        }</span></div><div><span style=3D"color:rgb(204,204,204)">    =
};</span></div><br><div><span style=3D"color:rgb(204,204,204)">    </span><=
span style=3D"color:rgb(106,153,85)">// Fin du motif</span></div><div><span=
 style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,2=
20,254)">pattern</span><span style=3D"color:rgb(204,204,204)">[</span><span=
 style=3D"color:rgb(181,206,168)">3</span><span style=3D"color:rgb(204,204,=
204)">].</span><span style=3D"color:rgb(156,220,254)">type</span><span styl=
e=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)"=
>=3D</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"co=
lor:rgb(79,193,255)">RTE_FLOW_ITEM_TYPE_END</span><span style=3D"color:rgb(=
204,204,204)">;</span></div><br><div><span style=3D"color:rgb(204,204,204)"=
>    </span><span style=3D"color:rgb(106,153,85)">// D=C3=A9finir l&#39;act=
ion (accepter le paquet)</span></div><div><span style=3D"color:rgb(204,204,=
204)">    </span><span style=3D"color:rgb(220,220,170)">memset</span><span =
style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(156,220,2=
54)">action</span><span style=3D"color:rgb(204,204,204)">, </span><span sty=
le=3D"color:rgb(181,206,168)">0</span><span style=3D"color:rgb(204,204,204)=
">, </span><span style=3D"color:rgb(86,156,214)">sizeof</span><span style=
=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(156,220,254)">=
action</span><span style=3D"color:rgb(204,204,204)">));</span></div><br><di=
v><span style=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rg=
b(106,153,85)">// Envoyer =C3=A0 la file RX_ID</span></div><div><span style=
=3D"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,220,254=
)">action</span><span style=3D"color:rgb(204,204,204)">[</span><span style=
=3D"color:rgb(181,206,168)">0</span><span style=3D"color:rgb(204,204,204)">=
].</span><span style=3D"color:rgb(156,220,254)">type</span><span style=3D"c=
olor:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">=3D</=
span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rg=
b(79,193,255)">RTE_FLOW_ACTION_TYPE_QUEUE</span><span style=3D"color:rgb(20=
4,204,204)">;</span></div><div><span style=3D"color:rgb(204,204,204)">    <=
/span><span style=3D"color:rgb(156,220,254)">action</span><span style=3D"co=
lor:rgb(204,204,204)">[</span><span style=3D"color:rgb(181,206,168)">0</spa=
n><span style=3D"color:rgb(204,204,204)">].</span><span style=3D"color:rgb(=
156,220,254)">conf</span><span style=3D"color:rgb(204,204,204)"> </span><sp=
an style=3D"color:rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,=
204,204)"> </span><span style=3D"color:rgb(212,212,212)">&amp;</span><span =
style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rgb(86,156,21=
4)">struct</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(78,201,176)">rte_flow_action_queue</span><span style=3D"color=
:rgb(204,204,204)">){</span></div><div><span style=3D"color:rgb(204,204,204=
)">        .</span><span style=3D"color:rgb(156,220,254)">index</span><span=
 style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,=
212)">=3D</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(86,156,214)">RX_ID</span><span style=3D"color:rgb(204,204,204=
)">,</span><span style=3D"color:rgb(106,153,85)"> // Envoyer les paquets =
=C3=A0 la file RX_ID</span></div><div><span style=3D"color:rgb(204,204,204)=
">    };</span></div><br><div><span style=3D"color:rgb(204,204,204)">    </=
span><span style=3D"color:rgb(106,153,85)">// Fin de la liste d&#39;actions=
</span></div><div><span style=3D"color:rgb(204,204,204)">    </span><span s=
tyle=3D"color:rgb(156,220,254)">action</span><span style=3D"color:rgb(204,2=
04,204)">[</span><span style=3D"color:rgb(181,206,168)">1</span><span style=
=3D"color:rgb(204,204,204)">].</span><span style=3D"color:rgb(156,220,254)"=
>type</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"c=
olor:rgb(212,212,212)">=3D</span><span style=3D"color:rgb(204,204,204)"> </=
span><span style=3D"color:rgb(79,193,255)">RTE_FLOW_ACTION_TYPE_END</span><=
span style=3D"color:rgb(204,204,204)">;</span></div><br><div><span style=3D=
"color:rgb(204,204,204)">    </span><span style=3D"color:rgb(106,153,85)">/=
/ Cr=C3=A9er la r=C3=A8gle de filtrage</span></div><div><span style=3D"colo=
r:rgb(204,204,204)">    </span><span style=3D"color:rgb(156,220,254)">flow<=
/span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:r=
gb(212,212,212)">=3D</span><span style=3D"color:rgb(204,204,204)"> </span><=
span style=3D"color:rgb(220,220,170)">rte_flow_create</span><span style=3D"=
color:rgb(204,204,204)">(</span><span style=3D"color:rgb(156,220,254)">port=
_id</span><span style=3D"color:rgb(204,204,204)">, </span><span style=3D"co=
lor:rgb(212,212,212)">&amp;</span><span style=3D"color:rgb(156,220,254)">at=
tr</span><span style=3D"color:rgb(204,204,204)">, </span><span style=3D"col=
or:rgb(156,220,254)">pattern</span><span style=3D"color:rgb(204,204,204)">,=
 </span><span style=3D"color:rgb(156,220,254)">action</span><span style=3D"=
color:rgb(204,204,204)">, </span><span style=3D"color:rgb(212,212,212)">&am=
p;</span><span style=3D"color:rgb(156,220,254)">error</span><span style=3D"=
color:rgb(204,204,204)">);</span></div><div><span style=3D"color:rgb(204,20=
4,204)">    </span><span style=3D"color:rgb(197,134,192)">if</span><span st=
yle=3D"color:rgb(204,204,204)"> (</span><span style=3D"color:rgb(156,220,25=
4)">flow</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(212,212,212)">=3D=3D</span><span style=3D"color:rgb(204,204,2=
04)"> </span><span style=3D"color:rgb(86,156,214)">NULL</span><span style=
=3D"color:rgb(204,204,204)">) {</span></div><div><span style=3D"color:rgb(2=
04,204,204)">        </span><span style=3D"color:rgb(220,220,170)">printf</=
span><span style=3D"color:rgb(204,204,204)">(</span><span style=3D"color:rg=
b(206,145,120)">&quot;Erreur lors de la cr=C3=A9ation de la r=C3=A8gle de f=
iltrage : </span><span style=3D"color:rgb(156,220,254)">%s</span><span styl=
e=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)=
">&quot;</span><span style=3D"color:rgb(204,204,204)">, </span><span style=
=3D"color:rgb(156,220,254)">error</span><span style=3D"color:rgb(204,204,20=
4)">.</span><span style=3D"color:rgb(156,220,254)">message</span><span styl=
e=3D"color:rgb(204,204,204)">);</span></div><div><span style=3D"color:rgb(2=
04,204,204)">        </span><span style=3D"color:rgb(197,134,192)">return</=
span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rg=
b(212,212,212)">-</span><span style=3D"color:rgb(181,206,168)">1</span><spa=
n style=3D"color:rgb(204,204,204)">;</span></div><div><span style=3D"color:=
rgb(204,204,204)">    }</span></div><br><div><span style=3D"color:rgb(204,2=
04,204)">    </span><span style=3D"color:rgb(106,153,85)">// Afficher un me=
ssage de succ=C3=A8s</span></div><div><span style=3D"color:rgb(204,204,204)=
">    </span><span style=3D"color:rgb(220,220,170)">printf</span><span styl=
e=3D"color:rgb(204,204,204)">(</span></div><div><span style=3D"color:rgb(20=
4,204,204)">        </span><span style=3D"color:rgb(206,145,120)">&quot;R=
=C3=A8gle de filtrage cr=C3=A9ee avec succ=C3=A8s pour l&#39;IP </span><spa=
n style=3D"color:rgb(156,220,254)">%u</span><span style=3D"color:rgb(206,14=
5,120)">.</span><span style=3D"color:rgb(156,220,254)">%u</span><span style=
=3D"color:rgb(206,145,120)">.</span><span style=3D"color:rgb(156,220,254)">=
%u</span><span style=3D"color:rgb(206,145,120)">.</span><span style=3D"colo=
r:rgb(156,220,254)">%u</span><span style=3D"color:rgb(206,145,120)"> et le =
port </span><span style=3D"color:rgb(156,220,254)">%u</span><span style=3D"=
color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&qu=
ot;</span><span style=3D"color:rgb(204,204,204)">,</span></div><div><span s=
tyle=3D"color:rgb(204,204,204)">        (</span><span style=3D"color:rgb(15=
6,220,254)">ip_addr</span><span style=3D"color:rgb(204,204,204)"> </span><s=
pan style=3D"color:rgb(212,212,212)">&gt;&gt;</span><span style=3D"color:rg=
b(204,204,204)"> </span><span style=3D"color:rgb(181,206,168)">24</span><sp=
an style=3D"color:rgb(204,204,204)">) </span><span style=3D"color:rgb(212,2=
12,212)">&amp;</span><span style=3D"color:rgb(204,204,204)"> </span><span s=
tyle=3D"color:rgb(181,206,168)">0xFF</span><span style=3D"color:rgb(204,204=
,204)">,</span></div><div><span style=3D"color:rgb(204,204,204)">        (<=
/span><span style=3D"color:rgb(156,220,254)">ip_addr</span><span style=3D"c=
olor:rgb(204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">&gt;&=
gt;</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"col=
or:rgb(181,206,168)">16</span><span style=3D"color:rgb(204,204,204)">) </sp=
an><span style=3D"color:rgb(212,212,212)">&amp;</span><span style=3D"color:=
rgb(204,204,204)"> </span><span style=3D"color:rgb(181,206,168)">0xFF</span=
><span style=3D"color:rgb(204,204,204)">,</span></div><div><span style=3D"c=
olor:rgb(204,204,204)">        (</span><span style=3D"color:rgb(156,220,254=
)">ip_addr</span><span style=3D"color:rgb(204,204,204)"> </span><span style=
=3D"color:rgb(212,212,212)">&gt;&gt;</span><span style=3D"color:rgb(204,204=
,204)"> </span><span style=3D"color:rgb(181,206,168)">8</span><span style=
=3D"color:rgb(204,204,204)">) </span><span style=3D"color:rgb(212,212,212)"=
>&amp;</span><span style=3D"color:rgb(204,204,204)"> </span><span style=3D"=
color:rgb(181,206,168)">0xFF</span><span style=3D"color:rgb(204,204,204)">,=
</span></div><div><span style=3D"color:rgb(204,204,204)">        </span><sp=
an style=3D"color:rgb(156,220,254)">ip_addr</span><span style=3D"color:rgb(=
204,204,204)"> </span><span style=3D"color:rgb(212,212,212)">&amp;</span><s=
pan style=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(181,2=
06,168)">0xFF</span><span style=3D"color:rgb(204,204,204)">,</span></div><d=
iv><span style=3D"color:rgb(204,204,204)">        </span><span style=3D"col=
or:rgb(156,220,254)">udp_port</span></div><div><span style=3D"color:rgb(204=
,204,204)">    );</span></div><br><div><span style=3D"color:rgb(204,204,204=
)">    </span><span style=3D"color:rgb(197,134,192)">return</span><span sty=
le=3D"color:rgb(204,204,204)"> </span><span style=3D"color:rgb(181,206,168)=
">0</span><span style=3D"color:rgb(204,204,204)">;</span></div><div><span s=
tyle=3D"color:rgb(204,204,204)">}</span></div></div><p>However,
 despite this configuration, I continue to receive packets with other IP
 addresses and ports that do not match the specified filter.</p><p>Could
 you provide any insights into why the filtering isn&#39;t working as=20
expected? Any advice on ensuring the rule is properly applied at the=20
hardware level would be greatly appreciated.</p><p>Thank you for your assis=
tance.</p><p>Best regards,<br></p><p>Ali</p></div>

--000000000000244e11062cc70dbe--