net/mlx5: Use flow steering infrastructure for mlx5_en
Expose the new flow steering API and remove the old one. Few changes are required: 1. The Ethernet flow steering follows the existing implementation, but uses the new steering API. The old flow steering implementation is removed. 2. Move the E-switch FDB management to use the new API. 3. When driver is loaded call to mlx5_init_fs which initialize the flow steering tree structure, open namespaces for NIC receive and for E-switch FDB. 4. Call to mlx5_cleanup_fs when the driver is unloaded. Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2530236303
commit
86d722ad2c
11 changed files with 628 additions and 1077 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#ifndef _MLX5_FS_
|
||||
#define _MLX5_FS_
|
||||
|
||||
#include <linux/mlx5/driver.h>
|
||||
#include <linux/mlx5/mlx5_ifc.h>
|
||||
|
||||
#define MLX5_FS_DEFAULT_FLOW_TAG 0x0
|
||||
|
|
@ -43,6 +44,9 @@ enum mlx5_flow_namespace_type {
|
|||
};
|
||||
|
||||
struct mlx5_flow_table;
|
||||
struct mlx5_flow_group;
|
||||
struct mlx5_flow_rule;
|
||||
struct mlx5_flow_namespace;
|
||||
|
||||
struct mlx5_flow_destination {
|
||||
enum mlx5_flow_destination_type type;
|
||||
|
|
@ -52,4 +56,38 @@ struct mlx5_flow_destination {
|
|||
u32 vport_num;
|
||||
};
|
||||
};
|
||||
|
||||
struct mlx5_flow_namespace *
|
||||
mlx5_get_flow_namespace(struct mlx5_core_dev *dev,
|
||||
enum mlx5_flow_namespace_type type);
|
||||
|
||||
struct mlx5_flow_table *
|
||||
mlx5_create_flow_table(struct mlx5_flow_namespace *ns,
|
||||
int prio,
|
||||
int num_flow_table_entries);
|
||||
int mlx5_destroy_flow_table(struct mlx5_flow_table *ft);
|
||||
|
||||
/* inbox should be set with the following values:
|
||||
* start_flow_index
|
||||
* end_flow_index
|
||||
* match_criteria_enable
|
||||
* match_criteria
|
||||
*/
|
||||
struct mlx5_flow_group *
|
||||
mlx5_create_flow_group(struct mlx5_flow_table *ft, u32 *in);
|
||||
void mlx5_destroy_flow_group(struct mlx5_flow_group *fg);
|
||||
|
||||
/* Single destination per rule.
|
||||
* Group ID is implied by the match criteria.
|
||||
*/
|
||||
struct mlx5_flow_rule *
|
||||
mlx5_add_flow_rule(struct mlx5_flow_table *ft,
|
||||
u8 match_criteria_enable,
|
||||
u32 *match_criteria,
|
||||
u32 *match_value,
|
||||
u32 action,
|
||||
u32 flow_tag,
|
||||
struct mlx5_flow_destination *dest);
|
||||
void mlx5_del_flow_rule(struct mlx5_flow_rule *fr);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue