History

net/mlx5: Add support in RDMA RX steering

Add new flow steering namespace - MLX5_FLOW_NAMESPACE_RDMA_RX. Flow steering rules in this namespace are used to filter RDMA traffic.

Maor Gottlieb committed 7 years ago

Commit d83eb501 parent ae288a46 files · +38 −1Browse files

Unified · Split

6 files
  1. drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +1 −0
  2. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +27 −0
  3. drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +2 −0
  4. include/linux/mlx5/device.h +6 −0
  5. include/linux/mlx5/fs.h +1 −0
  6. include/linux/mlx5/mlx5_ifc.h +1 −1
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c+1−0
@@ -854,6 +854,7 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typ · 853 unmodified lines
854854 case FS_FT_SNIFFER_RX:
855855 case FS_FT_SNIFFER_TX:
856856 case FS_FT_NIC_TX:
857+ case FS_FT_RDMA_RX:
857858 return mlx5_fs_cmd_get_fw_cmds();
858859 default:
859860 return mlx5_fs_cmd_get_stub_cmds();
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+27−0
@@ -2054,6 +2054,10 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, · 2053 unmodified lines
20542054 if (steering->sniffer_tx_root_ns)
20552055 return &steering->sniffer_tx_root_ns->ns;
20562056 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;
20572061 default:
20582062 break;
20592063 }
@@ -2450,6 +2454,7 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev) · 390 unmodified lines
24502454 steering->fdb_sub_ns = NULL;
24512455 cleanup_root_ns(steering->sniffer_rx_root_ns);
24522456 cleanup_root_ns(steering->sniffer_tx_root_ns);
2457+ cleanup_root_ns(steering->rdma_rx_root_ns);
24532458 cleanup_root_ns(steering->egress_root_ns);
24542459 mlx5_cleanup_fc_stats(dev);
24552460 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
24912496 return 0;
24922497 }
24932498
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+}
24942515 static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
24952516 {
24962517 struct mlx5_flow_namespace *ns;
@@ -2727,6 +2748,12 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 230 unmodified lines
27272748 goto err;
27282749 }
27292750
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+
27302757 if (MLX5_IPSEC_DEV(dev) || MLX5_CAP_FLOWTABLE_NIC_TX(dev, ft_support)) {
27312758 err = init_egress_root_ns(steering);
27322759 if (err)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h+2−0
@@ -67,6 +67,7 @@ enum fs_flow_table_type { · 66 unmodified lines
6767 FS_FT_FDB = 0X4,
6868 FS_FT_SNIFFER_RX = 0X5,
6969 FS_FT_SNIFFER_TX = 0X6,
70+ FS_FT_RDMA_RX = 0X7,
7071 FS_FT_MAX_TYPE = FS_FT_SNIFFER_TX,
7172 };
7273
@@ -90,6 +91,7 @@ struct mlx5_flow_steering { · 17 unmodified lines
9091 struct mlx5_flow_root_namespace **esw_ingress_root_ns;
9192 struct mlx5_flow_root_namespace *sniffer_tx_root_ns;
9293 struct mlx5_flow_root_namespace *sniffer_rx_root_ns;
94+ struct mlx5_flow_root_namespace *rdma_rx_root_ns;
9395 struct mlx5_flow_root_namespace *egress_root_ns;
9496 };
9597
include/linux/mlx5/device.h+6−0
@@ -1166,6 +1166,12 @@ enum mlx5_qcam_feature_groups { · 1165 unmodified lines
11661166 #define MLX5_CAP_FLOWTABLE_SNIFFER_TX_MAX(mdev, cap) \
11671167 MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit_sniffer.cap)
11681168
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+
11691175 #define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \
11701176 MLX5_GET(flow_table_eswitch_cap, \
11711177 mdev->caps.hca_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap)
include/linux/mlx5/fs.h+1−0
@@ -73,6 +73,7 @@ enum mlx5_flow_namespace_type { · 72 unmodified lines
7373 MLX5_FLOW_NAMESPACE_SNIFFER_RX,
7474 MLX5_FLOW_NAMESPACE_SNIFFER_TX,
7575 MLX5_FLOW_NAMESPACE_EGRESS,
76+ MLX5_FLOW_NAMESPACE_RDMA_RX,
7677 };
7778
7879 enum {
include/linux/mlx5/mlx5_ifc.h+1−1
@@ -598,7 +598,7 @@ struct mlx5_ifc_flow_table_nic_cap_bits { · 597 unmodified lines
598598
599599 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive;
600600
601− u8 reserved_at_400[0x200];
601+ struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_rdma;
602602
603603 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_sniffer;
604604

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t