Skip to content

Commit 9ad321b

Browse files
committed
Merge branch 'mlx5-flow-steering'
Saeed Mahameed says: ==================== mlx5 improved flow steering management First two patches fixes some minor issues in recently introduced SRIOV code. The other seven patches modifies the driver's code that manages flow steering rules with Connectx-4 devices. Basic introduction: The flow steering device specification model is composed of the following entities: Destination (either a TIR/Flow table/vport), where TIR is RSS end-point, vport is the VF eSwitch port in SRIOV. Flow table entry (FTE) - the values used by the flow specification Flow table group (FG) - the masks used by the flow specification Flow table (FT) - groups several FGs and can serve as destination The flow steering software entities: In addition to the device objects, the software have two more objects: Priorities - group several FTs. Handles order of packet matching. Namespaces - group several priorities. Namespace are used in order to isolate different usages of steering (for example, add two separate namespaces, one for the NIC driver and one for E-Switch FDB). The base data structure for the flow steering management is a tree and all the flow steering objects such as (Namespace/Flow table/Flow Group/FTE/etc.) are represented as a node in the tree, e.g.: Priority-0 -> FT1 -> FG -> FTE -> TIR (destination) Priority-1 -> FT2 -> FG-> FTE -> TIR (destination) Matching begins in FT1 flow rules and if there is a miss on all the FTEs then matching continues on the FTEs in FT2. The new implementation solves/improves the following issues in the current code: 1) The new impl. supports multiple destinations, the search for existing rule with the same matching value is performed by the flow steering management. In the current impl. the E-switch FDB management code needs to search for existing rules before calling to the add rule function. 2) The new impl. manages the flow table level, in the current implementation the consumer states the flow table level when new flow table is created without any knowledge about the levels of other flow tables. 3) In the current impl. the consumer can't create or destroy flow groups dynamically, the flow groups are passed as argument to the create flow table API. The new impl. exposes API for create/destroy flow group. The series is built as follows: Patch #1 add flow steering API firmware commands. Patch #2 add tree operation of the flow steering tree: add/remove node, initialize node and take reference count on a node. Patch #3 add essential algorithms for managing the flow steering. Patch #4 Initialize the flow steering tree, flow steering initialization is based on static tree which illustrates the flow steering tree when the driver is loaded. Patch #5 is the main patch of the series. It introduce the flow steering API. Patch torvalds#6 Expose the new flow steering API and remove the old one. The Ethernet flow steering follows the existing implementation, but uses the new steering API. Patch torvalds#7 Rename en_flow_table.c to en_fs.c in order to be aligned with the new flow steering files. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents f5f9649 + 7cb21b7 commit 9ad321b

File tree

17 files changed

+2185
-1051
lines changed

17 files changed

+2185
-1051
lines changed

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
22

33
mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
44
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
5-
mad.o transobj.o vport.o sriov.o
6-
mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o flow_table.o eswitch.o \
7-
en_main.o en_flow_table.o en_ethtool.o en_tx.o en_rx.o \
5+
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o
6+
mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o \
7+
en_main.o en_fs.o en_ethtool.o en_tx.o en_rx.o \
88
en_txrx.o

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
#define MLX5E_UPDATE_STATS_INTERVAL 200 /* msecs */
6565
#define MLX5E_SQ_BF_BUDGET 16
6666

67+
#define MLX5E_NUM_MAIN_GROUPS 9
68+
6769
static const char vport_strings[][ETH_GSTRING_LEN] = {
6870
/* vport statistics */
6971
"rx_packets",
@@ -442,7 +444,7 @@ enum mlx5e_rqt_ix {
442444
struct mlx5e_eth_addr_info {
443445
u8 addr[ETH_ALEN + 2];
444446
u32 tt_vec;
445-
u32 ft_ix[MLX5E_NUM_TT]; /* flow table index per traffic type */
447+
struct mlx5_flow_rule *ft_rule[MLX5E_NUM_TT];
446448
};
447449

448450
#define MLX5E_ETH_ADDR_HASH_SIZE (1 << BITS_PER_BYTE)
@@ -466,15 +468,22 @@ enum {
466468

467469
struct mlx5e_vlan_db {
468470
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
469-
u32 active_vlans_ft_ix[VLAN_N_VID];
470-
u32 untagged_rule_ft_ix;
471-
u32 any_vlan_rule_ft_ix;
471+
struct mlx5_flow_rule *active_vlans_rule[VLAN_N_VID];
472+
struct mlx5_flow_rule *untagged_rule;
473+
struct mlx5_flow_rule *any_vlan_rule;
472474
bool filter_disabled;
473475
};
474476

475477
struct mlx5e_flow_table {
476-
void *vlan;
477-
void *main;
478+
int num_groups;
479+
struct mlx5_flow_table *t;
480+
struct mlx5_flow_group **g;
481+
};
482+
483+
struct mlx5e_flow_tables {
484+
struct mlx5_flow_namespace *ns;
485+
struct mlx5e_flow_table vlan;
486+
struct mlx5e_flow_table main;
478487
};
479488

480489
struct mlx5e_priv {
@@ -497,7 +506,7 @@ struct mlx5e_priv {
497506
u32 rqtn[MLX5E_NUM_RQT];
498507
u32 tirn[MLX5E_NUM_TT];
499508

500-
struct mlx5e_flow_table ft;
509+
struct mlx5e_flow_tables fts;
501510
struct mlx5e_eth_addr_db eth_addr;
502511
struct mlx5e_vlan_db vlan;
503512

0 commit comments

Comments
 (0)