updates from mlx5-next 2022-09-24
Subsystems (6)
From: Saeed Mahameed <[email protected]>
Please pull mlx5-next branch
Updates form mlx5-next including[1]:
1) HW definitions and support for NPPS clock settings.
2) various cleanups
3) Enable hash mode by default for all NICs
[1] https://lore.kernel.org/netdev/[email protected]/
Note: This PR will introduce a minor contextual conflict with net-next, to resolve, accept changes from both trees.
The following changes since commit 7e18e42e4b280c85b76967a9106a13ca61c16179:
Linux 6.0-rc4 (2022-09-04 13:10:01 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git mlx5-next
for you to fetch changes up to 5fb46ae4a43ea0b51e6b3d0d1824f83804699cf2:
net/mlx5: Remove from FPGA IFC file not-needed definitions (2022-09-24 13:51:55 -0700)
----------------------------------------------------------------
Aya Levin (2):
net/mlx5: Expose NPPS related registers net/mlx5: Add support for NPPS with real time mode
Chris Mi (1):
RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib
Gal Pressman (2):
net/mlx5: Remove unused functions
net/mlx5: Remove unused structs
Leon Romanovsky (1):
net/mlx5: Remove from FPGA IFC file not-needed definitions
Liu, Changcheng (5):
net/mlx5: add IFC bits for bypassing port select flow table RDMA/mlx5: Don't set tx affinity when lag is in hash mode net/mlx5: Lag, set active ports if support bypass port select flow table net/mlx5: Lag, enable hash mode by default for all NICs net/mlx5: detect and enable bypass port select flow table
Yishai Hadas (2):
net/mlx5: Introduce ifc bits for page tracker net/mlx5: Query ADV_VIRTUALIZATION capabilities
drivers/infiniband/hw/mlx5/mad.c | 25 +++- drivers/infiniband/hw/mlx5/mlx5_ib.h | 12 ++ .../mellanox/mlx5/core/en_accel/ipsec_rxtx.h | 5 - drivers/net/ethernet/mellanox/mlx5/core/fw.c | 6 + drivers/net/ethernet/mellanox/mlx5/core/health.c | 7 -- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 91 ++++++++++++-- .../net/ethernet/mellanox/mlx5/core/lib/clock.c | 139 ++++++++++++++++++--- drivers/net/ethernet/mellanox/mlx5/core/main.c | 35 ++++++ drivers/net/ethernet/mellanox/mlx5/core/port.c | 23 ---- .../mellanox/mlx5/core/steering/dr_types.h | 14 --- .../ethernet/mellanox/mlx5/core/steering/fs_dr.h | 4 - include/linux/mlx5/device.h | 20 ++- include/linux/mlx5/driver.h | 11 +- include/linux/mlx5/fs_helpers.h | 48 ------- include/linux/mlx5/mlx5_ifc.h | 126 +++++++++++++++++-- include/linux/mlx5/mlx5_ifc_fpga.h | 24 ---- 16 files changed, 406 insertions(+), 184 deletions(-)
drivers/infiniband/hw/mlx5/mad.c +23 -2
@@ -147,6 +147,28 @@ static void pma_cnt_assign(struct ib_pma_portcounters *pma_cnt, vl_15_dropped); } +static int query_ib_ppcnt (struct mlx5_core_dev *dev,u8 port_num,void *out, +size_t sz) +{ +u32 *in; +int err; + + in =kvzalloc (sz,GFP_KERNEL ); +if (!in) { + err = -ENOMEM ; +return err; + } + +MLX5_SET (ppcnt_reg, in, local_port, port_num); + +MLX5_SET (ppcnt_reg, in, grp,MLX5_INFINIBAND_PORT_COUNTERS_GROUP ); + err =mlx5_core_access_reg (dev, in, sz, out, + sz,MLX5_REG_PPCNT ,0 ,0 ); + +kvfree (in); +return err; +} +static int process_pma_cmd (struct mlx5_ib_dev *dev,u32 port_num,const struct ib_mad *in_mad,struct ib_mad *out_mad) {
@@ -202,8 +224,7 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num, goto done; } - err =mlx5_core_query_ib_ppcnt (mdev, mdev_port_num, - out_cnt, sz); + err =query_ib_ppcnt (mdev, mdev_port_num, out_cnt, sz);if (!err)pma_cnt_assign (pma_cnt, out_cnt); }
drivers/infiniband/hw/mlx5/mlx5_ib.h +12 -0
@@ -1540,6 +1540,18 @@ int mlx5_ib_test_wc(struct mlx5_ib_dev *dev);static inline bool mlx5_ib_lag_should_assign_affinity (struct mlx5_ib_dev *dev) { +/* +* If the driver is in hash mode and the port_select_flow_table_bypass cap +* is supported, it means that the driver no longer needs to assign the port +* affinity by default. If a user wants to set the port affinity explicitly, +* the user has a dedicated API to do that, so there is no need to assign +* the port affinity by default. +*/ +if (dev->lag_active && +mlx5_lag_mode_is_hash (dev->mdev) && +MLX5_CAP_PORT_SELECTION (dev->mdev, port_select_flow_table_bypass)) +return 0 ; +return dev->lag_active || (MLX5_CAP_GEN (dev->mdev, num_lag_ports) >1 &&MLX5_CAP_GEN (dev->mdev, lag_tx_port_affinity));
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h +0 -5
@@ -77,11 +77,6 @@ static inline bool mlx5_ipsec_is_rx_flow(struct mlx5_cqe64 *cqe)return MLX5_IPSEC_METADATA_MARKER (be32_to_cpu (cqe->ft_metadata)); } -static inline bool mlx5e_ipsec_is_tx_flow (struct mlx5e_accel_tx_ipsec_state *ipsec_st) -{ -return ipsec_st->x; -} -static inline bool mlx5e_ipsec_eseg_meta (struct mlx5_wqe_eth_seg *eseg) {return eseg->flow_table_metadata &cpu_to_be32 (MLX5_ETH_WQE_FT_META_IPSEC );
drivers/net/ethernet/mellanox/mlx5/core/fw.c +6 -0
@@ -273,6 +273,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)return err; } +if (MLX5_CAP_GEN (dev, adv_virtualization)) { + err =mlx5_core_get_caps (dev,MLX5_CAP_ADV_VIRTUALIZATION ); +if (err) +return err; + } +return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/health.c +0 -7
@@ -875,13 +875,6 @@ void mlx5_drain_health_wq(struct mlx5_core_dev *dev)cancel_work_sync (&health->fatal_report_work); } -void mlx5_health_flush (struct mlx5_core_dev *dev) -{ -struct mlx5_core_health *health = &dev->priv.health; - -flush_workqueue (health->wq); -} -void mlx5_health_cleanup (struct mlx5_core_dev *dev) {struct mlx5_core_health *health = &dev->priv.health;
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +80 -11
134 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +119 -20
202 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/main.c +35 -0
@@ -652,6 +652,33 @@ static int handle_hca_cap_roce(struct mlx5_core_dev *dev, void *set_ctx)return err; } +static int handle_hca_cap_port_selection (struct mlx5_core_dev *dev, +void *set_ctx) +{ +void *set_hca_cap; +int err; + +if (!MLX5_CAP_GEN (dev, port_selection_cap)) +return 0 ; + + err =mlx5_core_get_caps (dev,MLX5_CAP_PORT_SELECTION ); +if (err) +return err; + +if (MLX5_CAP_PORT_SELECTION (dev, port_select_flow_table_bypass) || + !MLX5_CAP_PORT_SELECTION_MAX (dev, port_select_flow_table_bypass)) +return 0 ; + + set_hca_cap =MLX5_ADDR_OF (set_hca_cap_in, set_ctx, capability); +memcpy (set_hca_cap, dev->caps.hca[MLX5_CAP_PORT_SELECTION ]->cur, +MLX5_ST_SZ_BYTES (port_selection_cap)); +MLX5_SET (port_selection_cap, set_hca_cap, port_select_flow_table_bypass,1 ); + + err =set_caps (dev, set_ctx,MLX5_SET_HCA_CAP_OP_MODE_PORT_SELECTION ); + +return err; +} +static int set_hca_cap (struct mlx5_core_dev *dev) {int set_sz =MLX5_ST_SZ_BYTES (set_hca_cap_in);
@@ -696,6 +723,13 @@ static int set_hca_cap(struct mlx5_core_dev *dev) goto out; } +memset (set_ctx,0 , set_sz); + err =handle_hca_cap_port_selection (dev, set_ctx); +if (err) { +mlx5_core_err (dev,"handle_hca_cap_port_selection failed\n" ); + goto out; + } + out:kfree (set_ctx);return err;
@@ -1488,6 +1522,7 @@ static const int types[] = {MLX5_CAP_IPSEC ,MLX5_CAP_PORT_SELECTION ,MLX5_CAP_DEV_SHAMPO , + MLX5_CAP_ADV_VIRTUALIZATION, };static void mlx5_hca_caps_free (struct mlx5_core_dev *dev)
drivers/net/ethernet/mellanox/mlx5/core/port.c +0 -23
@@ -493,29 +493,6 @@ int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev, }EXPORT_SYMBOL_GPL (mlx5_query_port_vl_hw_cap); -int mlx5_core_query_ib_ppcnt (struct mlx5_core_dev *dev, -u8 port_num,void *out,size_t sz) -{ -u32 *in; -int err; - - in =kvzalloc (sz,GFP_KERNEL ); -if (!in) { - err = -ENOMEM ; -return err; - } - -MLX5_SET (ppcnt_reg, in, local_port, port_num); - -MLX5_SET (ppcnt_reg, in, grp,MLX5_INFINIBAND_PORT_COUNTERS_GROUP ); - err =mlx5_core_access_reg (dev, in, sz, out, - sz,MLX5_REG_PPCNT ,0 ,0 ); - -kvfree (in); -return err; -} -EXPORT_SYMBOL_GPL (mlx5_core_query_ib_ppcnt); -static int mlx5_query_pfcc_reg (struct mlx5_core_dev *dev,u32 *out,u32 out_size) {
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +0 -14
@@ -1294,20 +1294,6 @@ struct mlx5dr_cmd_gid_attr {u32 roce_ver; }; -struct mlx5dr_cmd_qp_create_attr { -u32 page_id; -u32 pdn; -u32 cqn; -u32 pm_state; -u32 service_type; -u32 buff_umem_id; -u32 db_umem_id; -u32 sq_wqe_cnt; -u32 rq_wqe_cnt; -u32 rq_wqe_shift; -u8 isolate_vl_tc:1 ; -}; -int mlx5dr_cmd_query_gid (struct mlx5_core_dev *mdev,u8 vhca_port_num,u16 index,struct mlx5dr_cmd_gid_attr *attr);
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.h +0 -4
@@ -14,10 +14,6 @@ struct mlx5_fs_dr_action {struct mlx5dr_action *dr_action; }; -struct mlx5_fs_dr_ns { -struct mlx5_dr_ns *dr_ns; -}; -struct mlx5_fs_dr_rule {struct mlx5dr_rule *dr_rule;/* Only actions created by fs_dr */
include/linux/mlx5/device.h +9 -11
@@ -874,12 +874,6 @@ static inline u8 get_cqe_opcode(struct mlx5_cqe64 *cqe)return cqe->op_own >>4 ; } -static inline u8 get_cqe_enhanced_num_mini_cqes (struct mlx5_cqe64 *cqe) -{ -/* num_of_mini_cqes is zero based */ -return get_cqe_opcode (cqe) +1 ; -} -static inline u8 get_cqe_lro_tcppsh (struct mlx5_cqe64 *cqe) {return (cqe->lro.tcppsh_abort_dupack >>6 ) &1 ;
@@ -890,11 +884,6 @@ static inline u8 get_cqe_l4_hdr_type(struct mlx5_cqe64 *cqe)return (cqe->l4_l3_hdr_type >>4 ) &0x7 ; } -static inline u8 get_cqe_l3_hdr_type (struct mlx5_cqe64 *cqe) -{ -return (cqe->l4_l3_hdr_type >>2 ) &0x3 ; -} -static inline bool cqe_is_tunneled (struct mlx5_cqe64 *cqe) {return cqe->tls_outer_l3_tunneled &0x1 ;
@@ -1200,6 +1189,7 @@ enum mlx5_cap_type {MLX5_CAP_DEV_SHAMPO =0x1d ,MLX5_CAP_GENERAL_2 =0x20 ,MLX5_CAP_PORT_SELECTION =0x25 , +MLX5_CAP_ADV_VIRTUALIZATION =0x26 ,/* NUM OF CAP Types */ MLX5_CAP_NUM };
@@ -1365,6 +1355,14 @@ enum mlx5_qcam_feature_groups {MLX5_GET (port_selection_cap, \ mdev->caps.hca[MLX5_CAP_PORT_SELECTION]->max, cap) +#define MLX5_CAP_ADV_VIRTUALIZATION (mdev, cap) \ + MLX5_GET(adv_virtualization_cap, \ + mdev->caps.hca[MLX5_CAP_ADV_VIRTUALIZATION]->cur, cap) + +#define MLX5_CAP_ADV_VIRTUALIZATION_MAX (mdev, cap) \ + MLX5_GET(adv_virtualization_cap, \ + mdev->caps.hca[MLX5_CAP_ADV_VIRTUALIZATION]->max, cap) +#define MLX5_CAP_FLOWTABLE_PORT_SELECTION (mdev, cap) \ MLX5_CAP_PORT_SELECTION(mdev, flow_table_properties_port_selection.cap)
include/linux/mlx5/driver.h +3 -8
@@ -698,6 +698,8 @@ struct mlx5_pps {struct work_struct out_work;u64 start[MAX_PIN_NUM ];u8 enabled; +u64 min_npps_period; +u64 min_out_pulse_duration_ns; };struct mlx5_timer {
@@ -855,11 +857,6 @@ struct mlx5_cmd_work_ent {refcount_t refcnt; }; -struct mlx5_pas { -u64 pa; -u8 log_sz; -}; -enum phy_port_state {MLX5_AAA_111 };
@@ -1016,7 +1013,6 @@ int mlx5_cmd_exec_polling(struct mlx5_core_dev *dev, void *in, int in_size,bool mlx5_cmd_is_down (struct mlx5_core_dev *dev);int mlx5_core_get_caps (struct mlx5_core_dev *dev,enum mlx5_cap_type cap_type); -void mlx5_health_flush (struct mlx5_core_dev *dev);void mlx5_health_cleanup (struct mlx5_core_dev *dev);int mlx5_health_init (struct mlx5_core_dev *dev);void mlx5_start_health_poll (struct mlx5_core_dev *dev);
@@ -1085,8 +1081,6 @@ int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, int psv_num);void mlx5_core_put_rsc (struct mlx5_core_rsc_common *common);int mlx5_query_odp_caps (struct mlx5_core_dev *dev,struct mlx5_odp_caps *odp_caps); -int mlx5_core_query_ib_ppcnt (struct mlx5_core_dev *dev, -u8 port_num,void *out,size_t sz);int mlx5_init_rl_table (struct mlx5_core_dev *dev);void mlx5_cleanup_rl_table (struct mlx5_core_dev *dev);
@@ -1153,6 +1147,7 @@ int mlx5_cmd_destroy_vport_lag(struct mlx5_core_dev *dev);bool mlx5_lag_is_roce (struct mlx5_core_dev *dev);bool mlx5_lag_is_sriov (struct mlx5_core_dev *dev);bool mlx5_lag_is_active (struct mlx5_core_dev *dev); +bool mlx5_lag_mode_is_hash (struct mlx5_core_dev *dev);bool mlx5_lag_is_master (struct mlx5_core_dev *dev);bool mlx5_lag_is_shared_fdb (struct mlx5_core_dev *dev);struct net_device *mlx5_lag_get_roce_netdev (struct mlx5_core_dev *dev);
include/linux/mlx5/fs_helpers.h +0 -48
58 lines not on this page · raw message
include/linux/mlx5/mlx5_ifc.h +119 -7
190 lines not on this page · raw message
include/linux/mlx5/mlx5_ifc_fpga.h +0 -24
@@ -32,30 +32,6 @@ #ifndef MLX5_IFC_FPGA_H #define MLX5_IFC_FPGA_H -struct mlx5_ifc_ipv4_layout_bits { - u8 reserved_at_0[0x60]; - - u8 ipv4[0x20]; -}; - -struct mlx5_ifc_ipv6_layout_bits { - u8 ipv6[16][0x8]; -}; - -union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits { - struct mlx5_ifc_ipv6_layout_bits ipv6_layout; - struct mlx5_ifc_ipv4_layout_bits ipv4_layout; - u8 reserved_at_0[0x80]; -}; - -enum { - MLX5_FPGA_CAP_SANDBOX_VENDOR_ID_MLNX = 0x2c9, -}; - -enum { - MLX5_FPGA_CAP_SANDBOX_PRODUCT_ID_IPSEC = 0x2, -}; - struct mlx5_ifc_fpga_shell_caps_bits { u8 max_num_qps[0x10]; u8 reserved_at_10[0x8];
Quoted 3 lines · Saeed Mahameed
From: Saeed Mahameed <[email protected]>
Please pull mlx5-next branch
<...>
Quoted 2 lines
Chris Mi (1):
RDMA/mlx5: Move functionmlx5_core_query_ib_ppcnt()tomlx5_ib
Please don't.
I see the change in SHA-1 from already pulled to RDMA:8a2dd123f12f RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib
to something else:7b1dfbbb45d1 RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib
Please restore original commit.
Thanks