Skip to contentSkip to conversation

net/mlx5: fix the E-Switch mirror flow rule validation

PATCH In review Jiawei Wang 3 participants 3 messages Oct 11, 2023 – Oct 31, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix the E-Switch mirror flow rule validation

The port action and jump to flow table action are not supported in the mirror flows (RTE_FLOW_ACTION_TYPE_SAMPLE with sample ratio=1) in E-Switch domain (transfer attribute set) without presented encap action.

The encap action is supported for uplink port only. So, if flow with mirroring contains encap action application should provide encap and uplink port actions in the mirror action list and PMD validates this condition (to make sure we cover the hardware limitation).

This patch adds the validation for E-Switch mirror flow rule checking and rejects as invalid.

Fixes 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one flow")
---
 doc/guides/nics/mlx5.rst        |  5 ++
 drivers/net/mlx5/mlx5_flow_dv.c | 93 +++++++++++++++++++++++++--------
 2 files changed, 76 insertions(+), 22 deletions(-)
doc/guides/nics/mlx5.rst +5 -0
index 7bee57d9dd..16c322578a 100644
@@ -545,6 +545,11 @@ Limitations
     sample actions list.
   - For E-Switch mirroring flow, supports ``RAW ENCAP``, ``Port ID``,
     ``VXLAN ENCAP``, ``NVGRE ENCAP`` in the sample actions list.
+  - For E-Switch mirroring flow with sample ratio = 1, the ``ENCAP`` action
+    support for uplink port only.
+  - For E-Switch mirroring flow with sample ratio = 1, the ``PORT`` action and
+    ``JUMP`` action are not supported without presented ``ENCAP`` action in the
+    sample actions list.
   - For ConnectX-5 trusted device, the application metadata with SET_TAG index 0
     is not supported before ``RTE_FLOW_ACTION_TYPE_SAMPLE`` action.
 
drivers/net/mlx5/mlx5_flow_dv.c +71 -22

243 lines not on this page · raw message

Signature · 1 line
2.18.1
Acked-by on v1 1/1
#1 lore raw

Hi Jiawei,

Quoted 17 lines

-----Original Message-----
From: Jiawei Wang <[email protected]>
Sent: Wednesday, October 11, 2023 9:43 AM

The port action and jump to flow table action are not supported in the mirror flows (RTE_FLOW_ACTION_TYPE_SAMPLE with sample ratio=1) in E-Switch domain (transfer attribute set) without presented encap action.

The encap action is supported for uplink port only. So, if flow with mirroring contains encap action application should provide encap and uplink port actions in the mirror action list and PMD validates this condition (to make sure we cover the hardware limitation).

This patch adds the validation for E-Switch mirror flow rule checking and rejects as invalid.

Quoted 6 lines
Fixes 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one

flow")
Cc: [email protected]

---

Best,
Ori

#2 lore raw
In reply to Jiawei Wang

Hi,

Quoted 18 lines

-----Original Message-----
From: Jiawei(Jonny) Wang <[email protected]>
Sent: Wednesday, October 11, 2023 9:43 AM
To: Suanming Mou <[email protected]>; Slava Ovsiienko <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix the E-Switch mirror flow rule validation

The port action and jump to flow table action are not supported in the mirror flows (RTE_FLOW_ACTION_TYPE_SAMPLE with sample ratio=1) in E-Switch domain (transfer attribute set) without presented encap action.

The encap action is supported for uplink port only. So, if flow with mirroring contains encap action application should provide encap and uplink port actions in the mirror action list and PMD validates this condition (to make sure we cover the hardware limitation).

Quoted 8 lines

This patch adds the validation for E-Switch mirror flow rule checking and rejects as invalid.

Fixes 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one

flow")
Cc: [email protected]

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh