aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShahar Klein <shahark@mellanox.com>2018-03-18 03:02:06 -0400
committerSaeed Mahameed <saeedm@mellanox.com>2018-05-17 17:17:34 -0400
commit3e99df87722874c669f6c24a79bd1b4ba5fec819 (patch)
tree8327d45dd55d900d72b7250d9d16f55d99738dcd
parent56e858df9f4b917cc49d78831a7f5692075bc78f (diff)
net/mlx5: Add source e-switch owner
The source e-switch owner allows a vport on one e-switch port be associated with a rule defined on the second port e-switch. The role of the source eswitch owner valid bit in the flow group is to allow the firmware fail driver attempts to wild card the source eswitch match field. If this bit is not set, the firmware ignores the source eswitch owner field totally. Signed-off-by: Shahar Klein <shahark@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c10
-rw-r--r--include/linux/mlx5/mlx5_ifc.h6
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 5a80279b052a..b1a2ca0ff320 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1372,6 +1372,8 @@ static int create_auto_flow_group(struct mlx5_flow_table *ft,
1372 struct mlx5_core_dev *dev = get_dev(&ft->node); 1372 struct mlx5_core_dev *dev = get_dev(&ft->node);
1373 int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); 1373 int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
1374 void *match_criteria_addr; 1374 void *match_criteria_addr;
1375 u8 src_esw_owner_mask_on;
1376 void *misc;
1375 int err; 1377 int err;
1376 u32 *in; 1378 u32 *in;
1377 1379
@@ -1384,6 +1386,14 @@ static int create_auto_flow_group(struct mlx5_flow_table *ft,
1384 MLX5_SET(create_flow_group_in, in, start_flow_index, fg->start_index); 1386 MLX5_SET(create_flow_group_in, in, start_flow_index, fg->start_index);
1385 MLX5_SET(create_flow_group_in, in, end_flow_index, fg->start_index + 1387 MLX5_SET(create_flow_group_in, in, end_flow_index, fg->start_index +
1386 fg->max_ftes - 1); 1388 fg->max_ftes - 1);
1389
1390 misc = MLX5_ADDR_OF(fte_match_param, fg->mask.match_criteria,
1391 misc_parameters);
1392 src_esw_owner_mask_on = !!MLX5_GET(fte_match_set_misc, misc,
1393 source_eswitch_owner_vhca_id);
1394 MLX5_SET(create_flow_group_in, in,
1395 source_eswitch_owner_vhca_id_valid, src_esw_owner_mask_on);
1396
1387 match_criteria_addr = MLX5_ADDR_OF(create_flow_group_in, 1397 match_criteria_addr = MLX5_ADDR_OF(create_flow_group_in,
1388 in, match_criteria); 1398 in, match_criteria);
1389 memcpy(match_criteria_addr, fg->mask.match_criteria, 1399 memcpy(match_criteria_addr, fg->mask.match_criteria,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 3d17709bc30c..9c3538f1b8b9 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -412,7 +412,7 @@ struct mlx5_ifc_fte_match_set_misc_bits {
412 u8 reserved_at_0[0x8]; 412 u8 reserved_at_0[0x8];
413 u8 source_sqn[0x18]; 413 u8 source_sqn[0x18];
414 414
415 u8 reserved_at_20[0x10]; 415 u8 source_eswitch_owner_vhca_id[0x10];
416 u8 source_port[0x10]; 416 u8 source_port[0x10];
417 417
418 u8 outer_second_prio[0x3]; 418 u8 outer_second_prio[0x3];
@@ -6995,7 +6995,9 @@ struct mlx5_ifc_create_flow_group_in_bits {
6995 u8 reserved_at_a0[0x8]; 6995 u8 reserved_at_a0[0x8];
6996 u8 table_id[0x18]; 6996 u8 table_id[0x18];
6997 6997
6998 u8 reserved_at_c0[0x20]; 6998 u8 source_eswitch_owner_vhca_id_valid[0x1];
6999
7000 u8 reserved_at_c1[0x1f];
6999 7001
7000 u8 start_flow_index[0x20]; 7002 u8 start_flow_index[0x20];
7001 7003