Add flow steering actions: modify header and packet reformat to the fs_cmd shim layer. This allows each namespace to define possibly different functionality for alloc/dealloc action commands.
Showing the changes to include/linux (1 of 13 files). Show all
Unified · Split
| @@ -84,6 +84,8 @@ enum { · 83 unmodified lines | ||
| 84 | 84 | FDB_SLOW_PATH, |
| 85 | 85 | }; |
| 86 | 86 | |
| 87 | +struct mlx5_pkt_reformat; | |
| 88 | +struct mlx5_modify_hdr; | |
| 87 | 89 | struct mlx5_flow_table; |
| 88 | 90 | struct mlx5_flow_group; |
| 89 | 91 | struct mlx5_flow_namespace; |
| @@ -121,7 +123,7 @@ struct mlx5_flow_destination { · 31 unmodified lines | ||
| 121 | 123 | struct { |
| 122 | 124 | u16 num; |
| 123 | 125 | u16 vhca_id; |
| 124 | − u32 reformat_id; | |
| 126 | + struct mlx5_pkt_reformat *pkt_reformat; | |
| 125 | 127 | u8 flags; |
| 126 | 128 | } vport; |
| 127 | 129 | }; |
| @@ -195,8 +197,8 @@ enum { · 67 unmodified lines | ||
| 195 | 197 | |
| 196 | 198 | struct mlx5_flow_act { |
| 197 | 199 | u32 action; |
| 198 | − u32 reformat_id; | |
| 199 | − u32 modify_id; | |
| 200 | + struct mlx5_modify_hdr *modify_hdr; | |
| 201 | + struct mlx5_pkt_reformat *pkt_reformat; | |
| 200 | 202 | uintptr_t esp_id; |
| 201 | 203 | u32 flags; |
| 202 | 204 | struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH]; |
| @@ -205,8 +207,6 @@ struct mlx5_flow_act { · 2 unmodified lines | ||
| 205 | 207 | |
| 206 | 208 | #define MLX5_DECLARE_FLOW_ACT(name) \ |
| 207 | 209 | struct mlx5_flow_act name = { .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\ |
| 208 | − .reformat_id = 0, \ | |
| 209 | − .modify_id = 0, \ | |
| 210 | 210 | .flags = 0, } |
| 211 | 211 | |
| 212 | 212 | /* Single destination per rule. |
| @@ -236,19 +236,18 @@ u32 mlx5_fc_id(struct mlx5_fc *counter); · 23 unmodified lines | ||
| 236 | 236 | int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); |
| 237 | 237 | int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); |
| 238 | 238 | |
| 239 | −int mlx5_modify_header_alloc(struct mlx5_core_dev *dev, | |
| 240 | − u8 namespace, u8 num_actions, | |
| 241 | − void *modify_actions, u32 *modify_header_id); | |
| 239 | +struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev, | |
| 240 | + u8 ns_type, u8 num_actions, | |
| 241 | + void *modify_actions); | |
| 242 | 242 | void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev, |
| 243 | − u32 modify_header_id); | |
| 244 | − | |
| 245 | −int mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev, | |
| 246 | − int reformat_type, | |
| 247 | − size_t size, | |
| 248 | − void *reformat_data, | |
| 249 | − enum mlx5_flow_namespace_type namespace, | |
| 250 | − u32 *packet_reformat_id); | |
| 243 | + struct mlx5_modify_hdr *modify_hdr); | |
| 244 | + | |
| 245 | +struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev, | |
| 246 | + int reformat_type, | |
| 247 | + size_t size, | |
| 248 | + void *reformat_data, | |
| 249 | + enum mlx5_flow_namespace_type ns_type); | |
| 251 | 250 | void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev, |
| 252 | − u32 packet_reformat_id); | |
| 251 | + struct mlx5_pkt_reformat *reformat); | |
| 253 | 252 | |
| 254 | 253 | #endif |