<div dir="ltr"><div>Thanks  Dariusz Sosnowski.</div><div><br></div>BR<div>Narsimha</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 19, 2024 at 10:20 PM Dariusz Sosnowski <<a href="mailto:dsosnowski@nvidia.com">dsosnowski@nvidia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I apologize for the very late response.<br>
<br>
> From: narsimharaj pentam <<a href="mailto:pnarsimharaj@gmail.com" target="_blank">pnarsimharaj@gmail.com</a>> <br>
> Sent: Friday, August 18, 2023 05:34<br>
> To: <a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a><br>
> Subject: VLAN filtering in mlx5<br>
> <br>
> Hi <br>
> <br>
> We are using a mellanox mlx5 card (firmware version: 16.35.1012) with mlx5_pci driver.  Enabled multiple ports  DPDK port 0 (internally referred as slot 1 port 0: s1p0)  and DPDK port 1(slot 0 port 0 : s0p0). Multiple vlans are created on each of these interfaces , s0p0.100,<br>
> s0p0.101,s0p0.102  and s0p1.200,s0p1.201,s0p1.202.<br>
Are these kernel VLAN interfaces?<br>
<br>
> In our network we receive broadcast (ARP) and multicast(ICMPV6 for neighbour discovery) on port 0 and port 1. At the DPDK application we are observing the packets intended for interface s0p0.100 are  landing on other vlan interfaces s0p0.101,sop0.102.<br>
> The VLAN traffic is not segregated accordingly.<br>
> <br>
> Do we support VLAN filtering in mlx5 ?<br>
> <br>
> Came across VLAN filtering "vlan_filter_set" , will this help to drop unintended VLAN traffic ? or  Do we need to create any VLAN specific rte flows in addition to the vlan filter set ? <br>
VLAN filtering is supported by mlx5 PMD.<br>
<br>
It's important to note that:<br>
- VLAN configuration in the kernel is not inherited by the mlx5 PMD.<br>
- When DPDK application is started on mlx5 devices, application will intercept the traffic - unless flow isolation is enabled (<a href="https://doc.dpdk.org/guides/howto/flow_bifurcation.html" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/howto/flow_bifurcation.html</a>).<br>
- Which packets are intercepted by an application depends on:<br>
    - Promiscuous mode.<br>
    - All multicast mode:<br>
        - If enabled ALL multicast packets from ALL VLANs are received.<br>
        - If disabled, only broadcast and IPv6 multicast traffic from registered VLANs is received.<br>
    - Registered MAC Addresses - default one and additional registered through rte_eth_dev_mac_addr_add()<br>
    - Registered VLANs - registered through rte_eth_dev_vlan_filter()<br>
VLAN filtering itself does not require any additional flow rules.<br>
<br>
So, if I understand the requirement correctly, then in your case it would be required to:<br>
- Disable promiscuous mode on both ports<br>
- Disable all multicast mode on both ports<br>
- On s0p0 explicitly enable VLANs 100, 101 and 102 through rte_eth_dev_vlan_filter().<br>
- On s1p0 explicitly enable VLANs 200, 201 and 202 through rte_eth_dev_vlan_filter().<br>
<br>
Best regards,<br>
Dariusz Sosnowski<br>
</blockquote></div></div></div>