| @@ -87,6 +87,15 @@ · 86 unmodified lines |
| 87 | 87 | .identified_miss_table_mode), \ |
| 88 | 88 | FS_CAP(flow_table_properties_nic_transmit.flow_table_modify)) |
| 89 | 89 | |
| 90 | +#define FS_CHAINING_CAPS_RDMA_TX \ |
| 91 | + FS_REQUIRED_CAPS( \ |
| 92 | + FS_CAP(flow_table_properties_nic_transmit_rdma.flow_modify_en), \ |
| 93 | + FS_CAP(flow_table_properties_nic_transmit_rdma.modify_root), \ |
| 94 | + FS_CAP(flow_table_properties_nic_transmit_rdma \ |
| 95 | + .identified_miss_table_mode), \ |
| 96 | + FS_CAP(flow_table_properties_nic_transmit_rdma \ |
| 97 | + .flow_table_modify)) |
| 98 | + |
| 90 | 99 | #define LEFTOVERS_NUM_LEVELS 1 |
| 91 | 100 | #define LEFTOVERS_NUM_PRIOS 1 |
| 92 | 101 | |
| @@ -202,6 +211,18 @@ static struct init_tree_node rdma_rx_root_fs = { · 109 unmodified lines |
| 202 | 211 | } |
| 203 | 212 | }; |
| 204 | 213 | |
| 214 | +static struct init_tree_node rdma_tx_root_fs = { |
| 215 | + .type = FS_TYPE_NAMESPACE, |
| 216 | + .ar_size = 1, |
| 217 | + .children = (struct init_tree_node[]) { |
| 218 | + ADD_PRIO(0, MLX5_BY_PASS_NUM_PRIOS, 0, |
| 219 | + FS_CHAINING_CAPS_RDMA_TX, |
| 220 | + ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF, |
| 221 | + ADD_MULTIPLE_PRIO(MLX5_BY_PASS_NUM_PRIOS, |
| 222 | + BY_PASS_PRIO_NUM_LEVELS))), |
| 223 | + } |
| 224 | +}; |
| 225 | + |
| 205 | 226 | enum fs_i_lock_class { |
| 206 | 227 | FS_LOCK_GRANDPARENT, |
| 207 | 228 | FS_LOCK_PARENT, |
| @@ -2132,6 +2153,8 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, · 1924 unmodified lines |
| 2132 | 2153 | } else if (type == MLX5_FLOW_NAMESPACE_RDMA_RX_KERNEL) { |
| 2133 | 2154 | root_ns = steering->rdma_rx_root_ns; |
| 2134 | 2155 | prio = RDMA_RX_KERNEL_PRIO; |
| 2156 | + } else if (type == MLX5_FLOW_NAMESPACE_RDMA_TX) { |
| 2157 | + root_ns = steering->rdma_tx_root_ns; |
| 2135 | 2158 | } else { /* Must be NIC RX */ |
| 2136 | 2159 | root_ns = steering->root_ns; |
| 2137 | 2160 | prio = type; |
| @@ -2535,6 +2558,7 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev) · 397 unmodified lines |
| 2535 | 2558 | cleanup_root_ns(steering->sniffer_rx_root_ns); |
| 2536 | 2559 | cleanup_root_ns(steering->sniffer_tx_root_ns); |
| 2537 | 2560 | cleanup_root_ns(steering->rdma_rx_root_ns); |
| 2561 | + cleanup_root_ns(steering->rdma_tx_root_ns); |
| 2538 | 2562 | cleanup_root_ns(steering->egress_root_ns); |
| 2539 | 2563 | mlx5_cleanup_fc_stats(dev); |
| 2540 | 2564 | kmem_cache_destroy(steering->ftes_cache); |
| @@ -2591,6 +2615,29 @@ out_err: · 50 unmodified lines |
| 2591 | 2615 | return err; |
| 2592 | 2616 | } |
| 2593 | 2617 | |
| 2618 | +static int init_rdma_tx_root_ns(struct mlx5_flow_steering *steering) |
| 2619 | +{ |
| 2620 | + int err; |
| 2621 | + |
| 2622 | + steering->rdma_tx_root_ns = create_root_ns(steering, FS_FT_RDMA_TX); |
| 2623 | + if (!steering->rdma_tx_root_ns) |
| 2624 | + return -ENOMEM; |
| 2625 | + |
| 2626 | + err = init_root_tree(steering, &rdma_tx_root_fs, |
| 2627 | + &steering->rdma_tx_root_ns->ns.node); |
| 2628 | + if (err) |
| 2629 | + goto out_err; |
| 2630 | + |
| 2631 | + set_prio_attrs(steering->rdma_tx_root_ns); |
| 2632 | + |
| 2633 | + return 0; |
| 2634 | + |
| 2635 | +out_err: |
| 2636 | + cleanup_root_ns(steering->rdma_tx_root_ns); |
| 2637 | + steering->rdma_tx_root_ns = NULL; |
| 2638 | + return err; |
| 2639 | +} |
| 2640 | + |
| 2594 | 2641 | /* FT and tc chains are stored in the same array so we can re-use the |
| 2595 | 2642 | * mlx5_get_fdb_sub_ns() and tc api for FT chains. |
| 2596 | 2643 | * When creating a new ns for each chain store it in the first available slot. |
| @@ -2890,6 +2937,12 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 293 unmodified lines |
| 2890 | 2937 | goto err; |
| 2891 | 2938 | } |
| 2892 | 2939 | |
| 2940 | + if (MLX5_CAP_FLOWTABLE_RDMA_TX(dev, ft_support)) { |
| 2941 | + err = init_rdma_tx_root_ns(steering); |
| 2942 | + if (err) |
| 2943 | + goto err; |
| 2944 | + } |
| 2945 | + |
| 2893 | 2946 | if (MLX5_IPSEC_DEV(dev) || MLX5_CAP_FLOWTABLE_NIC_TX(dev, ft_support)) { |
| 2894 | 2947 | err = init_egress_root_ns(steering); |
| 2895 | 2948 | if (err) |