From: Saeed Mahameed Date: Fri, 28 Jun 2019 22:49:59 +0000 (-0700) Subject: Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox... X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4f5d1beadc10b62e141338570b9c32d857814bb0;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'mlx5-next' of git://git./linux/kernel/git/mellanox/linux Misc updates from mlx5-next branch: 1) E-Switch vport metadata support for source vport matching 2) Convert mkey_table to XArray 3) Shared IRQs and to use single IRQ for all async EQs Signed-off-by: Saeed Mahameed --- 4f5d1beadc10b62e141338570b9c32d857814bb0 diff --cc drivers/net/ethernet/mellanox/mlx5/core/Makefile index 5fe2bf916c06,cf8d2b74a2fc..6aa0fe6de878 --- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile +++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile @@@ -13,10 -13,9 +13,10 @@@ obj-$(CONFIG_MLX5_CORE) += mlx5_core. # mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \ health.o mcg.o cq.o alloc.o qp.o port.o mr.o pd.o \ - transobj.o vport.o sriov.o fs_cmd.o fs_core.o \ + transobj.o vport.o sriov.o fs_cmd.o fs_core.o pci_irq.o \ fs_counters.o rl.o lag.o dev.o events.o wq.o lib/gid.o \ - lib/devcom.o diag/fs_tracepoint.o diag/fw_tracer.o + lib/devcom.o lib/pci_vsc.o diag/fs_tracepoint.o \ + diag/fw_tracer.o diag/crdump.o devlink.o # # Netdev basic diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index 849a628f6d17,335cbeee1b9e..b6472cf166ec --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@@ -269,27 -276,13 +278,32 @@@ int mlx5_eswitch_get_vport_stats(struc struct ifla_vf_stats *vf_stats); void mlx5_eswitch_del_send_to_vport_rule(struct mlx5_flow_handle *rule); + int mlx5_eswitch_modify_esw_vport_context(struct mlx5_eswitch *esw, u16 vport, + void *in, int inlen); + int mlx5_eswitch_query_esw_vport_context(struct mlx5_eswitch *esw, u16 vport, + void *out, int outlen); + struct mlx5_flow_spec; struct mlx5_esw_flow_attr; +struct mlx5_termtbl_handle; + +bool +mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw, + struct mlx5_flow_act *flow_act, + struct mlx5_flow_spec *spec); + +struct mlx5_flow_handle * +mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw, + struct mlx5_flow_table *ft, + struct mlx5_flow_spec *spec, + struct mlx5_esw_flow_attr *attr, + struct mlx5_flow_act *flow_act, + struct mlx5_flow_destination *dest, + int num_dest); + +void +mlx5_eswitch_termtbl_put(struct mlx5_eswitch *esw, + struct mlx5_termtbl_handle *tt); struct mlx5_flow_handle * mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 060de01f09b6,174b0ec4162f..af08e06f73ae --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@@ -255,25 -283,10 +287,11 @@@ mlx5_eswitch_add_fwd_rule(struct mlx5_e dest[i].ft = fwd_fdb, i++; - misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters); - MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport); - - if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) - MLX5_SET(fte_match_set_misc, misc, - source_eswitch_owner_vhca_id, - MLX5_CAP_GEN(attr->in_mdev, vhca_id)); + mlx5_eswitch_set_rule_source_port(esw, spec, attr); - misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters); - MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port); - if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) - MLX5_SET_TO_ONES(fte_match_set_misc, misc, - source_eswitch_owner_vhca_id); - - if (attr->match_level == MLX5_MATCH_NONE) - spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS; - else - spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS | - MLX5_MATCH_MISC_PARAMETERS; ++ spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS; + if (attr->match_level != MLX5_MATCH_NONE) + spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS; rule = mlx5_add_flow_rules(fast_fdb, spec, &flow_act, dest, i); @@@ -1747,10 -1971,11 +1985,12 @@@ static void esw_destroy_offloads_acl_ta esw_vport_disable_egress_acl(esw, vport); esw_vport_disable_ingress_acl(esw, vport); } + + esw->flags &= ~MLX5_ESWITCH_VPORT_MATCH_METADATA; } -static int esw_offloads_steering_init(struct mlx5_eswitch *esw, int nvports) +static int esw_offloads_steering_init(struct mlx5_eswitch *esw, int vf_nvports, + int nvports) { int err; diff --cc drivers/net/ethernet/mellanox/mlx5/core/main.c index 998eec938d3c,bfc8c6faedc2..072b56fda27e --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@@ -890,11 -901,10 +908,11 @@@ static void mlx5_cleanup_once(struct ml { mlx5_fw_tracer_destroy(dev->tracer); mlx5_fpga_cleanup(dev); - mlx5_sriov_cleanup(dev); mlx5_eswitch_cleanup(dev->priv.eswitch); + mlx5_sriov_cleanup(dev); mlx5_mpfs_cleanup(dev); mlx5_cleanup_rl_table(dev); + mlx5_geneve_destroy(dev->geneve); mlx5_vxlan_destroy(dev->vxlan); mlx5_cleanup_clock(dev); mlx5_cleanup_reserved_gids(dev); diff --cc include/linux/mlx5/eswitch.h index e9a55c0d50fd,aece3ae1902d..091e25881f52 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h @@@ -61,5 -62,33 +62,33 @@@ void *mlx5_eswitch_uplink_get_proto_dev u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw); struct mlx5_flow_handle * mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, - int vport, u32 sqn); + u16 vport_num, u32 sqn); + + #ifdef CONFIG_MLX5_ESWITCH + enum devlink_eswitch_encap_mode + mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); + + bool mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw); + u32 mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw, + u16 vport_num); + #else /* CONFIG_MLX5_ESWITCH */ + static inline enum devlink_eswitch_encap_mode + mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev) + { + return DEVLINK_ESWITCH_ENCAP_MODE_NONE; + } + + static inline bool + mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw) + { + return false; + }; + + static inline u32 + mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw, + int vport_num) + { + return 0; + }; + #endif /* CONFIG_MLX5_ESWITCH */ #endif