]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: add limitation for E-Switch Manager match
authorShun Hao <shunh@nvidia.com>
Sun, 19 Jun 2022 03:21:27 +0000 (06:21 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 23 Jun 2022 15:25:06 +0000 (17:25 +0200)
For BF with old FW which doesn't expose the E-Switch Manager vport ID,
E-Switch Manager port matching works correctly only when BF is in
embedded CPU mode.

This patch adds the limitation description.

Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
doc/guides/nics/mlx5.rst
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_dv.c

index 4cd693ab4a441d91c8a01f18bc28477745582219..915467d58a9ba1fe7258499cd921e6b869a1c392 100644 (file)
@@ -358,6 +358,12 @@ Limitations
   - can be applied to VF ports only.
   - must specify PF port action (packet redirection from VF to PF).
 
+- E-Switch Manager matching:
+
+  - For Bluefield with old FW
+    which doesn't expose the E-Switch Manager vport ID in the capability,
+    matching E-Switch Manager should be used only in Bluefield embedded CPU mode.
+
 - Raw encapsulation:
 
   - The input buffer, used as outer header, is not validated.
index f00c033fc54b06ae10199eac00009edcb0610570..73003900702683267c08722040c712c9d7592a90 100644 (file)
@@ -2076,4 +2076,8 @@ int flow_dv_action_query(struct rte_eth_dev *dev,
 size_t flow_dv_get_item_hdr_len(const enum rte_flow_item_type item_type);
 int flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,
                           size_t *size, struct rte_flow_error *error);
+
+#define MLX5_PF_VPORT_ID 0
+#define MLX5_ECPF_VPORT_ID 0xFFFE
+
 #endif /* RTE_PMD_MLX5_FLOW_H_ */
index 65b02b20ce6e7cc4f352e685bfb65cf99250ff2e..09f662bdcf2dfe51d0cd820f77cf9b2865987208 100644 (file)
@@ -99,6 +99,7 @@ flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
        struct mlx5_priv *priv = dev->data->dev_private;
        struct mlx5_common_device *cdev = priv->sh->cdev;
 
+       /* New FW exposes E-Switch Manager vport ID, can use it directly. */
        if (cdev->config.hca_attr.esw_mgr_vport_id_valid)
                return (int16_t)cdev->config.hca_attr.esw_mgr_vport_id;
 
@@ -108,9 +109,14 @@ flow_dv_get_esw_manager_vport_id(struct rte_eth_dev *dev)
        case PCI_DEVICE_ID_MELLANOX_CONNECTX5BF:
        case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF:
        case PCI_DEVICE_ID_MELLANOX_CONNECTX7BF:
-               return (int16_t)0xfffe;
+       /*
+        * In old FW which doesn't expose the E-Switch Manager vport ID in the capability,
+        * only the BF embedded CPUs control the E-Switch Manager port. Hence,
+        * ECPF vport ID is selected and not the host port (0) in any BF case.
+        */
+               return (int16_t)MLX5_ECPF_VPORT_ID;
        default:
-               return 0;
+               return MLX5_PF_VPORT_ID;
        }
 }