> -----Original Message-----
> From: Suanming Mou <suanmi...@nvidia.com>
> Sent: Thursday, October 20, 2022 18:42
> To: Matan Azrad <ma...@nvidia.com>; Slava Ovsiienko <viachesl...@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasl...@nvidia.com>; Ori Kam
> <or...@nvidia.com>; Dariusz Sosnowski <dsosnow...@nvidia.com>
> Subject: [PATCH v6 17/18] net/mlx5: support device control of representor
> matching
> 
> From: Dariusz Sosnowski <dsosnow...@nvidia.com>
> 
> In some E-Switch use cases applications want to receive all traffic
> on a single port. Since currently flow API does not provide a way to
> match traffic forwarded to any port representor, this patch adds
> support for controlling representor matching on ingress flow rules.
> 
> Representor matching is controlled through new device argument
> repr_matching_en.
> 
> - If representor matching is enabled (default setting),
>   then each ingress pattern template has an implicit REPRESENTED_PORT
>   item added. Flow rules based on this pattern template will match
>   the vport associated with port on which rule is created.
> - If representor matching is disabled, then there will be no implicit
>   item added. As a result ingress flow rules will match traffic
>   coming to any port, not only the port on which flow rule is created.
> 
> Representor matching is enabled by default, to provide an expected
> default behavior.
> 
> This patch enables egress flow rules on representors when E-Switch is
> enabled in the following configurations:
> 
> - repr_matching_en=1 and dv_xmeta_en=4
> - repr_matching_en=1 and dv_xmeta_en=0
> - repr_matching_en=0 and dv_xmeta_en=0
> 
> When representor matching is enabled, the following logic is
> implemented:
> 
> 1. Creating an egress template table in group 0 for each port. These
>    tables will hold default flow rules defined as follows:
> 
>       pattern SQ
>       actions MODIFY_FIELD (set available bits in REG_C_0 to
>                             vport_meta_tag)
>               MODIFY_FIELD (copy REG_A to REG_C_1, only when
>                             dv_xmeta_en == 4)
>               JUMP (group 1)
> 
> 2. Egress pattern templates created by an application have an implicit
>    MLX5_RTE_FLOW_ITEM_TYPE_TAG item prepended to pattern, which matches
>    available bits of REG_C_0.
> 
> 3. Egress flow rules created by an application have an implicit
>    MLX5_RTE_FLOW_ITEM_TYPE_TAG item prepended to pattern, which matches
>    vport_meta_tag placed in available bits of REG_C_0.
> 
> 4. Egress template tables created by an application, which are in
>    group n, are placed in group n + 1.
> 
> 5. Items and actions related to META are operating on REG_A when
>    dv_xmeta_en == 0 or REG_C_1 when dv_xmeta_en == 4.
> 
> When representor matching is disabled and extended metadata is disabled,
> no changes to current logic are required.
> 
> Signed-off-by: Dariusz Sosnowski <dsosnow...@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viachesl...@nvidia.com>

Reply via email to