Add new flow steering namespace - MLX5_FLOW_NAMESPACE_RDMA_RX. Flow steering rules in this namespace are used to filter RDMA traffic.
Unified · Split
| @@ -854,6 +854,7 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typ · 853 unmodified lines | ||
| 854 | 854 | case FS_FT_SNIFFER_RX: |
| 855 | 855 | case FS_FT_SNIFFER_TX: |
| 856 | 856 | case FS_FT_NIC_TX: |
| 857 | + case FS_FT_RDMA_RX: | |
| 857 | 858 | return mlx5_fs_cmd_get_fw_cmds(); |
| 858 | 859 | default: |
| 859 | 860 | return mlx5_fs_cmd_get_stub_cmds(); |
| @@ -2054,6 +2054,10 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, · 2053 unmodified lines | ||
| 2054 | 2054 | if (steering->sniffer_tx_root_ns) |
| 2055 | 2055 | return &steering->sniffer_tx_root_ns->ns; |
| 2056 | 2056 | return NULL; |
| 2057 | + case MLX5_FLOW_NAMESPACE_RDMA_RX: | |
| 2058 | + if (steering->rdma_rx_root_ns) | |
| 2059 | + return &steering->rdma_rx_root_ns->ns; | |
| 2060 | + return NULL; | |
| 2057 | 2061 | default: |
| 2058 | 2062 | break; |
| 2059 | 2063 | } |
| @@ -2450,6 +2454,7 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev) · 390 unmodified lines | ||
| 2450 | 2454 | steering->fdb_sub_ns = NULL; |
| 2451 | 2455 | cleanup_root_ns(steering->sniffer_rx_root_ns); |
| 2452 | 2456 | cleanup_root_ns(steering->sniffer_tx_root_ns); |
| 2457 | + cleanup_root_ns(steering->rdma_rx_root_ns); | |
| 2453 | 2458 | cleanup_root_ns(steering->egress_root_ns); |
| 2454 | 2459 | mlx5_cleanup_fc_stats(dev); |
| 2455 | 2460 | kmem_cache_destroy(steering->ftes_cache); |
| @@ -2491,6 +2496,22 @@ static int init_sniffer_rx_root_ns(struct mlx5_flow_steering *steering) · 35 unmodified lines | ||
| 2491 | 2496 | return 0; |
| 2492 | 2497 | } |
| 2493 | 2498 | |
| 2499 | +static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering) | |
| 2500 | +{ | |
| 2501 | + struct fs_prio *prio; | |
| 2502 | + | |
| 2503 | + steering->rdma_rx_root_ns = create_root_ns(steering, FS_FT_RDMA_RX); | |
| 2504 | + if (!steering->rdma_rx_root_ns) | |
| 2505 | + return -ENOMEM; | |
| 2506 | + | |
| 2507 | + /* Create single prio */ | |
| 2508 | + prio = fs_create_prio(&steering->rdma_rx_root_ns->ns, 0, 1); | |
| 2509 | + if (IS_ERR(prio)) { | |
| 2510 | + cleanup_root_ns(steering->rdma_rx_root_ns); | |
| 2511 | + return PTR_ERR(prio); | |
| 2512 | + } | |
| 2513 | + return 0; | |
| 2514 | +} | |
| 2494 | 2515 | static int init_fdb_root_ns(struct mlx5_flow_steering *steering) |
| 2495 | 2516 | { |
| 2496 | 2517 | struct mlx5_flow_namespace *ns; |
| @@ -2727,6 +2748,12 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 230 unmodified lines | ||
| 2727 | 2748 | goto err; |
| 2728 | 2749 | } |
| 2729 | 2750 | |
| 2751 | + if (MLX5_CAP_FLOWTABLE_RDMA_RX(dev, ft_support)) { | |
| 2752 | + err = init_rdma_rx_root_ns(steering); | |
| 2753 | + if (err) | |
| 2754 | + goto err; | |
| 2755 | + } | |
| 2756 | + | |
| 2730 | 2757 | if (MLX5_IPSEC_DEV(dev) || MLX5_CAP_FLOWTABLE_NIC_TX(dev, ft_support)) { |
| 2731 | 2758 | err = init_egress_root_ns(steering); |
| 2732 | 2759 | if (err) |
| @@ -67,6 +67,7 @@ enum fs_flow_table_type { · 66 unmodified lines | ||
| 67 | 67 | FS_FT_FDB = 0X4, |
| 68 | 68 | FS_FT_SNIFFER_RX = 0X5, |
| 69 | 69 | FS_FT_SNIFFER_TX = 0X6, |
| 70 | + FS_FT_RDMA_RX = 0X7, | |
| 70 | 71 | FS_FT_MAX_TYPE = FS_FT_SNIFFER_TX, |
| 71 | 72 | }; |
| 72 | 73 | |
| @@ -90,6 +91,7 @@ struct mlx5_flow_steering { · 17 unmodified lines | ||
| 90 | 91 | struct mlx5_flow_root_namespace **esw_ingress_root_ns; |
| 91 | 92 | struct mlx5_flow_root_namespace *sniffer_tx_root_ns; |
| 92 | 93 | struct mlx5_flow_root_namespace *sniffer_rx_root_ns; |
| 94 | + struct mlx5_flow_root_namespace *rdma_rx_root_ns; | |
| 93 | 95 | struct mlx5_flow_root_namespace *egress_root_ns; |
| 94 | 96 | }; |
| 95 | 97 | |
| @@ -1166,6 +1166,12 @@ enum mlx5_qcam_feature_groups { · 1165 unmodified lines | ||
| 1166 | 1166 | #define MLX5_CAP_FLOWTABLE_SNIFFER_TX_MAX(mdev, cap) \ |
| 1167 | 1167 | MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit_sniffer.cap) |
| 1168 | 1168 | |
| 1169 | +#define MLX5_CAP_FLOWTABLE_RDMA_RX(mdev, cap) \ | |
| 1170 | + MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive_rdma.cap) | |
| 1171 | + | |
| 1172 | +#define MLX5_CAP_FLOWTABLE_RDMA_RX_MAX(mdev, cap) \ | |
| 1173 | + MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_receive_rdma.cap) | |
| 1174 | + | |
| 1169 | 1175 | #define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \ |
| 1170 | 1176 | MLX5_GET(flow_table_eswitch_cap, \ |
| 1171 | 1177 | mdev->caps.hca_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) |
| @@ -73,6 +73,7 @@ enum mlx5_flow_namespace_type { · 72 unmodified lines | ||
| 73 | 73 | MLX5_FLOW_NAMESPACE_SNIFFER_RX, |
| 74 | 74 | MLX5_FLOW_NAMESPACE_SNIFFER_TX, |
| 75 | 75 | MLX5_FLOW_NAMESPACE_EGRESS, |
| 76 | + MLX5_FLOW_NAMESPACE_RDMA_RX, | |
| 76 | 77 | }; |
| 77 | 78 | |
| 78 | 79 | enum { |
| @@ -598,7 +598,7 @@ struct mlx5_ifc_flow_table_nic_cap_bits { · 597 unmodified lines | ||
| 598 | 598 | |
| 599 | 599 | struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive; |
| 600 | 600 | |
| 601 | − u8 reserved_at_400[0x200]; | |
| 601 | + struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_rdma; | |
| 602 | 602 | |
| 603 | 603 | struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_sniffer; |
| 604 | 604 | |