mlx5 updates 2023-12-13
Subsystems (5)
From: Saeed Mahameed <[email protected]>
This series is in preparation for mlx5 netdev Socket Direct feature. For more information please see tag log below.
Please pull and let me know if there is any problem.
Thanks,
Saeed.
The following changes since commit 604ca8ee7bdc62488af1da1231026d3b71f17725:
Merge branch 'virtio-net-dynamic-coalescing-moderation' (2023-12-13 12:49:05 +0000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2023-12-13
for you to fetch changes up to 952f9a5f4b0904255ef3dfa58f325fa3e5f045fb:
net/mlx5: DR, Use swap() instead of open coding it (2023-12-13 18:03:32 -0800)
----------------------------------------------------------------
mlx5-updates-2023-12-13
Preparation for mlx5e socket direct feature.
Socket direct will allow multiple PF devices attached to different NUMA nodes but sharing the same physical port.
The following series is a small refactoring series in preparation to support socket direct in the following submission.
Highlights:
- Define required device registers and bits related to socket direct
- Flow steering re-arrangements
- Generalize TX objects (TISs) and store them in a common object, will be useful in the next series for per function object management.
- Decouple raw CQ objects from their parent netdev priv
- Prepare devcom for Socket Direct device group discovery.
Please see the individual patches for more information.
----------------------------------------------------------------
Jiapeng Chong (1):
net/mlx5: DR, Use swap() instead of open coding it
Tariq Toukan (10):
net/mlx5: Add mlx5_ifc bits used for supporting single netdev Socket-Direct net/mlx5: Expose Management PCIe Index Register (MPIR) net/mlx5: fs, Command to control L2TABLE entry silent mode net/mlx5: fs, Command to control TX flow table root
net/mlx5e: Remove TLS-specific logic in generic create TIS API net/mlx5: Move TISes from priv to mdev HW resources
net/mlx5e: Statify function mlx5e_monitor_counter_arm net/mlx5e: Add wrapping for auxiliary_driver ops and remove unused args net/mlx5e: Decouple CQ from priv
net/mlx5: devcom, Add component size getter
drivers/net/ethernet/mellanox/mlx5/core/en.h | 25 ++-- .../ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +- .../ethernet/mellanox/mlx5/core/en/monitor_stats.h | 1 - .../net/ethernet/mellanox/mlx5/core/en/params.c | 2 + drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 16 ++- drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 9 +- drivers/net/ethernet/mellanox/mlx5/core/en/trap.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en_common.c | 74 ++++++++++ drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 159 +++++++-------------- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 10 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 34 +++++ drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h | 2 + .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 19 ++- .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 + .../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 7 +- .../net/ethernet/mellanox/mlx5/core/lib/devcom.c | 7 + .../net/ethernet/mellanox/mlx5/core/lib/devcom.h | 1 + .../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/port.c | 10 ++ .../mellanox/mlx5/core/steering/dr_action.c | 8 +- include/linux/mlx5/driver.h | 3 + include/linux/mlx5/mlx5_ifc.h | 45 +++++- 26 files changed, 290 insertions(+), 161 deletions(-)
PATCH 1/11 net/mlx5: Add mlx5_ifc bits used for supporting single netdev Socket-Direct
From: Tariq Toukan <[email protected]>
Multiple device caps and features are required to support single netdev Socket-Direct.
Add them here in preparation for the feature implementation.
--- include/linux/mlx5/mlx5_ifc.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-)
include/linux/mlx5/mlx5_ifc.h +25 -6
@@ -435,7 +435,7 @@ struct mlx5_ifc_flow_table_prop_layout_bits {u8 flow_table_modify[0x1 ];u8 reformat[0x1 ];u8 decap[0x1 ]; -u8 reserved_at_9[0x1 ]; +u8 reset_root_to_default[0x1 ];u8 pop_vlan[0x1 ];u8 push_vlan[0x1 ];u8 reserved_at_c[0x1 ];
@@ -1801,7 +1801,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 disable_local_lb_uc[0x1 ];u8 disable_local_lb_mc[0x1 ];u8 log_min_hairpin_wq_data_sz[0x5 ]; -u8 reserved_at_3e8[0x2 ]; +u8 reserved_at_3e8[0x1 ]; +u8 silent_mode[0x1 ];u8 vhca_state[0x1 ];u8 log_max_vlan_list[0x5 ];u8 reserved_at_3f0[0x3 ];
@@ -1818,7 +1819,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 reserved_at_460[0x1 ];u8 ats[0x1 ]; -u8 reserved_at_462[0x1 ]; +u8 cross_vhca_rqt[0x1 ];u8 log_max_uctx[0x5 ];u8 reserved_at_468[0x1 ];u8 crypto[0x1 ];
@@ -1943,6 +1944,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {enum {MLX5_CROSS_VHCA_OBJ_TO_OBJ_SUPPORTED_LOCAL_FLOW_TABLE_TO_REMOTE_FLOW_TABLE_MISS =0x80000 , +MLX5_CROSS_VHCA_OBJ_TO_OBJ_SUPPORTED_LOCAL_FLOW_TABLE_ROOT_TO_REMOTE_FLOW_TABLE = (1ULL <<20 ), };enum {
@@ -1992,7 +1994,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {u8 reserved_at_260[0x120 ];u8 reserved_at_380[0x10 ];u8 ec_vf_vport_base[0x10 ]; -u8 reserved_at_3a0[0x460 ]; + +u8 reserved_at_3a0[0x10 ]; +u8 max_rqt_vhca_id[0x10 ]; + +u8 reserved_at_3c0[0x440 ]; };enum mlx5_ifc_flow_destination_type {
@@ -2151,6 +2157,13 @@ struct mlx5_ifc_rq_num_bits {u8 rq_num[0x18 ]; }; +struct mlx5_ifc_rq_vhca_bits { +u8 reserved_at_0[0x8 ]; +u8 rq_num[0x18 ]; +u8 reserved_at_20[0x10 ]; +u8 rq_vhca_id[0x10 ]; +}; +struct mlx5_ifc_mac_address_layout_bits {u8 reserved_at_0[0x10 ];u8 mac_addr_47_32[0x10 ];
@@ -3901,7 +3914,10 @@ struct mlx5_ifc_rqtc_bits {u8 reserved_at_e0[0x6a0 ]; -struct mlx5_ifc_rq_num_bits rq_num[]; +union { + DECLARE_FLEX_ARRAY(struct mlx5_ifc_rq_num_bits, rq_num); + DECLARE_FLEX_ARRAY(struct mlx5_ifc_rq_vhca_bits, rq_vhca); + }; };enum {
@@ -4744,7 +4760,10 @@ struct mlx5_ifc_set_l2_table_entry_in_bits {u8 reserved_at_c0[0x20 ]; -u8 reserved_at_e0[0x13 ]; +u8 reserved_at_e0[0x10 ]; +u8 silent_mode_valid[0x1 ]; +u8 silent_mode[0x1 ]; +u8 reserved_at_f2[0x1 ];u8 vlan_valid[0x1 ];u8 vlan[0xc ];
Signature · 1 line
2.43.0
PATCH 2/11 net/mlx5: Expose Management PCIe Index Register (MPIR)
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
MPIR register allows to query the PCIe indexes and Socket-Direct related parameters.
--- .../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/port.c | 10 ++++++++++ include/linux/mlx5/driver.h | 1 + include/linux/mlx5/mlx5_ifc.h | 14 ++++++++++++++ 4 files changed, 26 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +1 -0
@@ -243,6 +243,7 @@ int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcap, u8 feature_group, u8 access_reg_group);int mlx5_query_qcam_reg (struct mlx5_core_dev *mdev,u32 *qcam,u8 feature_group,u8 access_reg_group); +int mlx5_query_mpir_reg (struct mlx5_core_dev *dev,u32 *mpir);void mlx5_lag_add_netdev (struct mlx5_core_dev *dev,struct net_device *netdev);void mlx5_lag_remove_netdev (struct mlx5_core_dev *dev,struct net_device *netdev);
drivers/net/ethernet/mellanox/mlx5/core/port.c +10 -0
@@ -1206,3 +1206,13 @@ int mlx5_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) *speed = max_speed;return 0 ; } + +int mlx5_query_mpir_reg (struct mlx5_core_dev *dev,u32 *mpir) +{ +u32 in[MLX5_ST_SZ_DW (mpir_reg)] = {}; +int sz =MLX5_ST_SZ_BYTES (mpir_reg); + +MLX5_SET (mpir_reg, in, local_port,1 ); + +return mlx5_core_access_reg (dev, in, sz, mpir, sz,MLX5_REG_MPIR ,0 ,0 ); +}
include/linux/mlx5/driver.h +1 -0
@@ -150,6 +150,7 @@ enum {MLX5_REG_MTPPSE =0x9054 ,MLX5_REG_MTUTC =0x9055 ,MLX5_REG_MPEGC =0x9056 , +MLX5_REG_MPIR =0x9059 ,MLX5_REG_MCQS =0x9060 ,MLX5_REG_MCQI =0x9061 , MLX5_REG_MCC = 0x9062,
include/linux/mlx5/mlx5_ifc.h +14 -0
@@ -10108,6 +10108,20 @@ struct mlx5_ifc_mpegc_reg_bits {u8 reserved_at_60[0x100 ]; }; +struct mlx5_ifc_mpir_reg_bits { +u8 sdm[0x1 ]; +u8 reserved_at_1[0x1b ]; +u8 host_buses[0x4 ]; + +u8 reserved_at_20[0x20 ]; + +u8 local_port[0x8 ]; +u8 reserved_at_28[0x15 ]; +u8 sd_group[0x3 ]; + +u8 reserved_at_60[0x20 ]; +}; +enum {MLX5_MTUTC_FREQ_ADJ_UNITS_PPB =0x0 ,MLX5_MTUTC_FREQ_ADJ_UNITS_SCALED_PPM =0x1 ,
Signature · 1 line
2.43.0
PATCH 3/11 net/mlx5: fs, Command to control L2TABLE entry silent mode
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Introduce an API to set/unset the L2TABLE entry silent mode for a device. If silent, no north/south traffic is allowed, the device won't be able to communicate with the port directly to send/receive traffic by its own.
--- drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 14 ++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h | 1 + 2 files changed, 15 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +14 -0
@@ -1144,3 +1144,17 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typreturn mlx5_fs_cmd_get_stub_cmds (); } } + +int mlx5_fs_cmd_set_l2table_entry_silent (struct mlx5_core_dev *dev,u8 silent_mode) +{ +u32 in[MLX5_ST_SZ_DW (set_l2_table_entry_in)] = {}; + +if (silent_mode && !MLX5_CAP_GEN (dev, silent_mode)) +return -EOPNOTSUPP ; + +MLX5_SET (set_l2_table_entry_in, in, opcode,MLX5_CMD_OP_SET_L2_TABLE_ENTRY ); +MLX5_SET (set_l2_table_entry_in, in, silent_mode_valid,1 ); +MLX5_SET (set_l2_table_entry_in, in, silent_mode, silent_mode); + +return mlx5_cmd_exec_in (dev, set_l2_table_entry, in); +}
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h +1 -0
@@ -122,4 +122,5 @@ int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len,const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default (enum fs_flow_table_type type);const struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds (void ); +int mlx5_fs_cmd_set_l2table_entry_silent (struct mlx5_core_dev *dev,u8 silent_mode);#endif
Signature · 1 line
2.43.0
PATCH 4/11 net/mlx5: fs, Command to control TX flow table root
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Introduce an API to set/unset the TX flow table root for a device.
--- .../net/ethernet/mellanox/mlx5/core/fs_cmd.c | 20 +++++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/fs_cmd.h | 1 + 2 files changed, 21 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +20 -0
@@ -1158,3 +1158,23 @@ int mlx5_fs_cmd_set_l2table_entry_silent(struct mlx5_core_dev *dev, u8 silent_moreturn mlx5_cmd_exec_in (dev, set_l2_table_entry, in); } + +int mlx5_fs_cmd_set_tx_flow_table_root (struct mlx5_core_dev *dev,u32 ft_id,bool disconnect) +{ +u32 out[MLX5_ST_SZ_DW (set_flow_table_root_out)] = {}; +u32 in[MLX5_ST_SZ_DW (set_flow_table_root_in)] = {}; + +if (disconnect &&MLX5_CAP_FLOWTABLE_NIC_TX (dev, reset_root_to_default)) +return -EOPNOTSUPP ; + +MLX5_SET (set_flow_table_root_in, in, opcode, +MLX5_CMD_OP_SET_FLOW_TABLE_ROOT ); +MLX5_SET (set_flow_table_root_in, in, table_type, +FS_FT_NIC_TX ); +if (disconnect) +MLX5_SET (set_flow_table_root_in, in, op_mod,1 ); +else +MLX5_SET (set_flow_table_root_in, in, table_id, ft_id); + +return mlx5_cmd_exec (dev, in,sizeof (in), out,sizeof (out)); +}
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h +1 -0
@@ -123,4 +123,5 @@ const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type typconst struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds (void );int mlx5_fs_cmd_set_l2table_entry_silent (struct mlx5_core_dev *dev,u8 silent_mode); +int mlx5_fs_cmd_set_tx_flow_table_root (struct mlx5_core_dev *dev,u32 ft_id,bool disconnect);#endif
Signature · 1 line
2.43.0
PATCH 5/11 net/mlx5e: Remove TLS-specific logic in generic create TIS API
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
TLS TISes are created using their own dedicated functions, don't honor their specific logic here.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -3
@@ -3357,9 +3357,6 @@ int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn)MLX5_SET (tisc, tisc, transport_domain, mdev->mlx5e_res.hw_objs.td.tdn); -if (MLX5_GET (tisc, tisc, tls_en)) -MLX5_SET (tisc, tisc, pd, mdev->mlx5e_res.hw_objs.pdn); -if (mlx5_lag_is_lacp_owner (mdev))MLX5_SET (tisc, tisc, strict_lag_tx_port_affinity,1 );
Signature · 1 line
2.43.0
PATCH 6/11 net/mlx5: Move TISes from priv to mdev HW resources
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
The transport interface send (TIS) object is responsible for performing all transport related operations of the transmit side. Messages from Send Queues get segmented and transmitted by the TIS including all transport required implications, e.g. in the case of large send offload, the TIS is responsible for the segmentation.
These are stateless objects and can be used by multiple netdevs (e.g. representors) who share the same core device.
Providing the TISes as a service from the core layer to the netdev layer reduces the number of replecated TIS objects (in case of multiple netdevs), and will ease the transition to netdev with multiple mdevs.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 19 ++-- .../net/ethernet/mellanox/mlx5/core/en/ptp.c | 6 +- .../net/ethernet/mellanox/mlx5/core/en/ptp.h | 2 +- .../net/ethernet/mellanox/mlx5/core/en/qos.c | 7 +- .../ethernet/mellanox/mlx5/core/en_common.c | 74 +++++++++++++ .../net/ethernet/mellanox/mlx5/core/en_main.c | 102 ++++-------------- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 10 +- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 19 +++- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 + .../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 7 +- include/linux/mlx5/driver.h | 2 + 11 files changed, 140 insertions(+), 110 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +11 -8
@@ -72,7 +72,6 @@ struct page_pool;#define MLX5E_HW2SW_MTU (params, hwmtu) ((hwmtu) - ((params)->hard_mtu))#define MLX5E_SW2HW_MTU (params, swmtu) ((swmtu) + ((params)->hard_mtu)) -#define MLX5E_MAX_NUM_TC 8#define MLX5E_MAX_NUM_MQPRIO_CH_TC TC_QOPT_MAX_QUEUE#define MLX5_RX_HEADROOM NET_SKB_PAD
@@ -758,7 +757,7 @@ struct mlx5e_channel {/* data path */ struct mlx5e_rq rq;struct mlx5e_xdpsq rq_xdpsq; -struct mlx5e_txqsq sq[MLX5E_MAX_NUM_TC ]; +struct mlx5e_txqsq sq[MLX5_MAX_NUM_TC ];struct mlx5e_icosq icosq;/* internal control operations */ struct mlx5e_txqsq __rcu *__rcu *qos_sqs;bool xdp;
@@ -808,7 +807,7 @@ struct mlx5e_channels {struct mlx5e_channel_stats {struct mlx5e_ch_stats ch; -struct mlx5e_sq_stats sq[MLX5E_MAX_NUM_TC ]; +struct mlx5e_sq_stats sq[MLX5_MAX_NUM_TC ];struct mlx5e_rq_stats rq;struct mlx5e_rq_stats xskrq;struct mlx5e_xdpsq_stats rq_xdpsq;
@@ -818,8 +817,8 @@ struct mlx5e_channel_stats {struct mlx5e_ptp_stats {struct mlx5e_ch_stats ch; -struct mlx5e_sq_stats sq[MLX5E_MAX_NUM_TC ]; -struct mlx5e_ptp_cq_stats cq[MLX5E_MAX_NUM_TC ]; +struct mlx5e_sq_stats sq[MLX5_MAX_NUM_TC ]; +struct mlx5e_ptp_cq_stats cq[MLX5_MAX_NUM_TC ];struct mlx5e_rq_stats rq; }____cacheline_aligned_in_smp ;
@@ -886,7 +885,6 @@ struct mlx5e_priv {struct mlx5e_rq drop_rq;struct mlx5e_channels channels; -u32 tisn[MLX5_MAX_PORTS ][MLX5E_MAX_NUM_TC ];struct mlx5e_rx_res *rx_res;u32 *tx_rates;
@@ -984,6 +982,8 @@ struct mlx5e_profile {void (*update_stats)(struct mlx5e_priv *priv);void (*update_carrier)(struct mlx5e_priv *priv);int (*max_nch_limit)(struct mlx5_core_dev *mdev); +u32 (*get_tisn)(struct mlx5_core_dev *mdev,struct mlx5e_priv *priv, +u8 lag_port,u8 tc);unsigned int (*stats_grps_num)(struct mlx5e_priv *priv);mlx5e_stats_grp_t *stats_grps;const struct mlx5e_rx_handlers *rx_handlers;
@@ -991,6 +991,11 @@ struct mlx5e_profile {u32 features; }; +u32 mlx5e_profile_get_tisn (struct mlx5_core_dev *mdev, +struct mlx5e_priv *priv, +const struct mlx5e_profile *profile, +u8 lag_port,u8 tc); +#define mlx5e_profile_feature_cap (profile, feature) \ ((profile)->features & BIT(MLX5E_PROFILE_FEATURE_##feature))
@@ -1132,8 +1137,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);int mlx5e_create_tis (struct mlx5_core_dev *mdev,void *in,u32 *tisn);void mlx5e_destroy_tis (struct mlx5_core_dev *mdev,u32 tisn); -int mlx5e_create_tises (struct mlx5e_priv *priv); -void mlx5e_destroy_tises (struct mlx5e_priv *priv);int mlx5e_update_nic_rx (struct mlx5e_priv *priv);void mlx5e_update_carrier (struct mlx5e_priv *priv);int mlx5e_close (struct net_device *netdev);
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +4 -2
@@ -518,9 +518,11 @@ static int mlx5e_ptp_open_txqsqs(struct mlx5e_ptp *c,for (tc =0 ; tc < num_tc; tc++) {int txq_ix = ix_base + tc; +u32 tisn; - err =mlx5e_ptp_open_txqsq (c, c->priv->tisn[c->lag_port][tc], txq_ix, - cparams, tc, &c->ptpsq[tc]); + tisn =mlx5e_profile_get_tisn (c->mdev, c->priv, c->priv->profile, + c->lag_port, tc); + err =mlx5e_ptp_open_txqsq (c, tisn, txq_ix, cparams, tc, &c->ptpsq[tc]);if (err) goto close_txqsq; }
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +1 -1
@@ -49,7 +49,7 @@ enum {struct mlx5e_ptp {/* data path */ -struct mlx5e_ptpsq ptpsq[MLX5E_MAX_NUM_TC ]; +struct mlx5e_ptpsq ptpsq[MLX5_MAX_NUM_TC ];struct mlx5e_rq rq;struct napi_struct napi;struct device *pdev;
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +5 -2
@@ -77,6 +77,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs,struct mlx5e_params *params;struct mlx5e_channel *c;struct mlx5e_txqsq *sq; +u32 tisn; params = &chs->params;
@@ -126,8 +127,10 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, err =mlx5e_open_cq (priv, params->tx_cq_moderation, ¶m_cq, &ccp, &sq->cq);if (err) goto err_free_sq; - err =mlx5e_open_txqsq (c, priv->tisn[c->lag_port][0 ], txq_ix, params, - ¶m_sq, sq,0 , hw_id, + + tisn =mlx5e_profile_get_tisn (c->mdev, c->priv, c->priv->profile, + c->lag_port,0 ); + err =mlx5e_open_txqsq (c, tisn, txq_ix, params, ¶m_sq, sq,0 , hw_id, priv->htb_qos_sq_stats[node_qid]);if (err) goto err_close_cq;
drivers/net/ethernet/mellanox/mlx5/core/en_common.c +74 -0
98 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +20 -82
161 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 -9
@@ -1180,12 +1180,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)struct mlx5e_rep_priv *rpriv = priv->ppriv;int err; - err =mlx5e_create_tises (priv); -if (err) { -mlx5_core_warn (priv->mdev,"create tises failed, %d\n" , err); -return err; - } - err =mlx5e_rep_neigh_init (rpriv);if (err) goto err_neigh_init;
@@ -1208,7 +1202,6 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv) err_init_tx:mlx5e_rep_neigh_cleanup (rpriv); err_neigh_init: -mlx5e_destroy_tises (priv);return err; }
@@ -1222,7 +1215,6 @@ static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)mlx5e_cleanup_uplink_rep_tx (rpriv);mlx5e_rep_neigh_cleanup (rpriv); -mlx5e_destroy_tises (priv); }static void mlx5e_rep_enable (struct mlx5e_priv *priv)
@@ -1452,7 +1444,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { .update_stats = mlx5e_stats_update_ndo_stats, .update_carrier = mlx5e_update_carrier, .rx_handlers = &mlx5e_rx_handlers_rep, - .max_tc = MLX5E_MAX_NUM_TC, + .max_tc = MLX5_MAX_NUM_TC, .stats_grps = mlx5e_ul_rep_stats_grps, .stats_grps_num = mlx5e_ul_rep_stats_grps_num, };
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +16 -3
@@ -339,7 +339,7 @@ static int mlx5i_init_tx(struct mlx5e_priv *priv)return err; } - err =mlx5i_create_tis (priv->mdev, ipriv->qpn, &priv->tisn[0 ][0 ]); + err =mlx5i_create_tis (priv->mdev, ipriv->qpn, &ipriv->tisn);if (err) {mlx5_core_warn (priv->mdev,"create tis failed, %d\n" , err); goto err_destroy_underlay_qp;
@@ -356,7 +356,7 @@ static void mlx5i_cleanup_tx(struct mlx5e_priv *priv) {struct mlx5i_priv *ipriv = priv->ppriv; -mlx5e_destroy_tis (priv->mdev, priv->tisn[0 ][0 ]); +mlx5e_destroy_tis (priv->mdev, ipriv->tisn);mlx5i_destroy_underlay_qp (priv->mdev, ipriv->qpn); }
@@ -483,6 +483,18 @@ static unsigned int mlx5i_stats_grps_num(struct mlx5e_priv *priv)return ARRAY_SIZE (mlx5i_stats_grps); } +u32 mlx5i_get_tisn (struct mlx5_core_dev *mdev,struct mlx5e_priv *priv,u8 lag_port,u8 tc) +{ +struct mlx5i_priv *ipriv = priv->ppriv; + +if (WARN (lag_port || tc, +"IPoIB unexpected non-zero value: lag_port (%u), tc (%u)\n" , + lag_port, tc)) +return 0 ; + +return ipriv->tisn; +} +static const struct mlx5e_profile mlx5i_nic_profile = { .init = mlx5i_init, .cleanup = mlx5i_cleanup,
@@ -499,6 +511,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = { .max_tc = MLX5I_MAX_NUM_TC, .stats_grps = mlx5i_stats_grps, .stats_grps_num = mlx5i_stats_grps_num, + .get_tisn = mlx5i_get_tisn, };/* mlx5i netdev NDos */
@@ -829,7 +842,7 @@ int mlx5_rdma_rn_get_params(struct mlx5_core_dev *mdev, *params = (struct rdma_netdev_alloc_params ){ .sizeof_priv =sizeof (struct mlx5i_priv ) +sizeof (struct mlx5e_priv ), - .txqs = nch *MLX5E_MAX_NUM_TC , + .txqs = nch *MLX5_MAX_NUM_TC , .rxqs = nch, .param = mdev, .initialize_rdma_netdev = mlx5_rdma_setup_rn,
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h +2 -0
@@ -53,6 +53,7 @@ extern const struct mlx5e_rx_handlers mlx5i_rx_handlers;struct mlx5i_priv {struct rdma_netdev rn;/* keep this first */ u32 qpn; +u32 tisn;bool sub_interface;u32 num_sub_interfaces;u32 qkey;
@@ -63,6 +64,7 @@ struct mlx5i_priv { };int mlx5i_create_tis (struct mlx5_core_dev *mdev,u32 underlay_qpn,u32 *tisn); +u32 mlx5i_get_tisn (struct mlx5_core_dev *mdev,struct mlx5e_priv *priv,u8 lag_port,u8 tc);/* Underlay QP create/destroy functions */ int mlx5i_create_underlay_qp (struct mlx5e_priv *priv);
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +4 -3
@@ -218,7 +218,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) goto err_unint_underlay_qp; } - err =mlx5i_create_tis (mdev, ipriv->qpn, &epriv->tisn[0 ][0 ]); + err =mlx5i_create_tis (mdev, ipriv->qpn, &ipriv->tisn);if (err) {mlx5_core_warn (mdev,"create child tis failed, %d\n" , err); goto err_remove_rx_uderlay_qp;
@@ -240,7 +240,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) err_close_channels:mlx5e_close_channels (&epriv->channels); err_clear_state_opened_flag: -mlx5e_destroy_tis (mdev, epriv->tisn[0 ][0 ]); +mlx5e_destroy_tis (mdev, ipriv->tisn); err_remove_rx_uderlay_qp:mlx5_fs_remove_rx_underlay_qpn (mdev, ipriv->qpn); err_unint_underlay_qp:
@@ -269,7 +269,7 @@ static int mlx5i_pkey_close(struct net_device *netdev)mlx5i_uninit_underlay_qp (priv);mlx5e_deactivate_priv_channels (priv);mlx5e_close_channels (&priv->channels); -mlx5e_destroy_tis (mdev, priv->tisn[0 ][0 ]); +mlx5e_destroy_tis (mdev, ipriv->tisn); unlock:mutex_unlock (&priv->state_lock);return 0 ;
@@ -361,6 +361,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = { .update_stats = NULL, .rx_handlers = &mlx5i_rx_handlers, .max_tc = MLX5I_MAX_NUM_TC, + .get_tisn = mlx5i_get_tisn, };const struct mlx5e_profile *mlx5i_pkey_get_profile (void )
include/linux/mlx5/driver.h +2 -0
@@ -679,6 +679,8 @@ struct mlx5e_resources {struct mlx5_td td;u32 mkey;struct mlx5_sq_bfreg bfreg; +#define MLX5_MAX_NUM_TC 8 +u32 tisn[MLX5_MAX_PORTS ][MLX5_MAX_NUM_TC ]; } hw_objs;struct net_device *uplink_netdev;struct mutex uplink_netdev_lock;
Signature · 1 line
2.43.0
PATCH 7/11 net/mlx5e: Statify function mlx5e_monitor_counter_arm
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Function usage is limited to the monitor_stats.c file, do not expose it.
--- drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c +1 -1
@@ -36,7 +36,7 @@ int mlx5e_monitor_counter_supported(struct mlx5e_priv *priv)return true; } -void mlx5e_monitor_counter_arm (struct mlx5e_priv *priv) +static void mlx5e_monitor_counter_arm (struct mlx5e_priv *priv) {u32 in[MLX5_ST_SZ_DW (arm_monitor_counter_in)] = {};
drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.h +0 -1
@@ -7,6 +7,5 @@int mlx5e_monitor_counter_supported (struct mlx5e_priv *priv);void mlx5e_monitor_counter_init (struct mlx5e_priv *priv);void mlx5e_monitor_counter_cleanup (struct mlx5e_priv *priv); -void mlx5e_monitor_counter_arm (struct mlx5e_priv *priv);#endif /* __MLX5_MONITOR_H__ */
Signature · 1 line
2.43.0
PATCH 8/11 net/mlx5e: Add wrapping for auxiliary_driver ops and remove unused args
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Turn some of the struct auxiliary_driver ops into wrappers to stop having dummy local vars passed as unused arguments.
--- .../net/ethernet/mellanox/mlx5/core/en_main.c | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +15 -7
@@ -5984,7 +5984,7 @@ static int mlx5e_resume(struct auxiliary_device *adev)return 0 ; } -static int mlx5e_suspend (struct auxiliary_device *adev,pm_message_t state) +static int _mlx5e_suspend (struct auxiliary_device *adev) {struct mlx5e_dev *mlx5e_dev =auxiliary_get_drvdata (adev);struct mlx5e_priv *priv = mlx5e_dev->priv;
@@ -6002,15 +6002,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)return 0 ; } -static int mlx5e_probe (struct auxiliary_device *adev, -const struct auxiliary_device_id *id) +static int mlx5e_suspend (struct auxiliary_device *adev,pm_message_t state) +{ +return _mlx5e_suspend (adev); +} + +static int _mlx5e_probe (struct auxiliary_device *adev) { struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev);const struct mlx5e_profile *profile = &mlx5e_nic_profile;struct mlx5_core_dev *mdev = edev->mdev;struct mlx5e_dev *mlx5e_dev;struct net_device *netdev; -pm_message_t state = {};struct mlx5e_priv *priv;int err;
@@ -6065,7 +6068,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,return 0 ; err_resume: -mlx5e_suspend (adev, state); +_mlx5e_suspend (adev); err_profile_cleanup: profile->cleanup (priv); err_destroy_netdev:
@@ -6077,16 +6080,21 @@ static int mlx5e_probe(struct auxiliary_device *adev,return err; } +static int mlx5e_probe (struct auxiliary_device *adev, +const struct auxiliary_device_id *id) +{ +return _mlx5e_probe (adev); +} +static void mlx5e_remove (struct auxiliary_device *adev) {struct mlx5e_dev *mlx5e_dev =auxiliary_get_drvdata (adev);struct mlx5e_priv *priv = mlx5e_dev->priv; -pm_message_t state = {};mlx5_core_uplink_netdev_set (priv->mdev,NULL );mlx5e_dcbnl_delete_app (priv);unregister_netdev (priv->netdev); -mlx5e_suspend (adev, state); +_mlx5e_suspend (adev); priv->profile->cleanup (priv);mlx5e_destroy_netdev (priv);mlx5e_devlink_port_unregister (mlx5e_dev);
Signature · 1 line
2.43.0
PATCH 9/11 net/mlx5e: Decouple CQ from priv
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Make CQ struct and methods independent of "priv", use more basic arguments instead.
This will ease the transition to netdev with multiple mdevs.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 6 ++-- .../ethernet/mellanox/mlx5/core/en/params.c | 2 ++ .../net/ethernet/mellanox/mlx5/core/en/ptp.c | 10 ++++-- .../net/ethernet/mellanox/mlx5/core/en/qos.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en/trap.c | 4 ++- .../mellanox/mlx5/core/en/xsk/setup.c | 4 +-- .../net/ethernet/mellanox/mlx5/core/en_main.c | 32 +++++++++---------- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_tx.c | 2 +- 9 files changed, 37 insertions(+), 27 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +4 -2
@@ -363,7 +363,7 @@ struct mlx5e_cq {/* control */ struct net_device *netdev;struct mlx5_core_dev *mdev; -struct mlx5e_priv *priv; +struct workqueue_struct *workqueue;struct mlx5_wq_ctrl wq_ctrl; }____cacheline_aligned_in_smp ;
@@ -1043,6 +1043,8 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,void mlx5e_close_xdpsq (struct mlx5e_xdpsq *sq);struct mlx5e_create_cq_param { +struct net_device *netdev; +struct workqueue_struct *wq;struct napi_struct *napi;struct mlx5e_ch_stats *ch_stats;int node;
@@ -1050,7 +1052,7 @@ struct mlx5e_create_cq_param { };struct mlx5e_cq_param ; -int mlx5e_open_cq (struct mlx5e_priv *priv,struct dim_cq_moder moder, +int mlx5e_open_cq (struct mlx5_core_dev *mdev,struct dim_cq_moder moder,struct mlx5e_cq_param *param,struct mlx5e_create_cq_param *ccp,struct mlx5e_cq *cq);void mlx5e_close_cq (struct mlx5e_cq *cq);
drivers/net/ethernet/mellanox/mlx5/core/en/params.c +2 -0
@@ -669,6 +669,8 @@ void mlx5e_build_rq_params(struct mlx5_core_dev *mdev,void mlx5e_build_create_cq_param (struct mlx5e_create_cq_param *ccp,struct mlx5e_channel *c) { *ccp = (struct mlx5e_create_cq_param ) { + .netdev = c->netdev, + .wq = c->priv->wq, .napi = &c->napi, .ch_stats = c->stats, .node =cpu_to_node (c->cpu),
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +7 -3
@@ -557,6 +557,8 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c, num_tc =mlx5e_get_dcb_num_tc (params); + ccp.netdev = c->netdev; + ccp.wq = c->priv->wq; ccp.node =dev_to_node (mlx5_core_dma_dev (c->mdev)); ccp.ch_stats = c->stats; ccp.napi = &c->napi;
@@ -567,7 +569,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,for (tc =0 ; tc < num_tc; tc++) {struct mlx5e_cq *cq = &c->ptpsq[tc].txqsq.cq; - err =mlx5e_open_cq (c->priv, ptp_moder, cq_param, &ccp, cq); + err =mlx5e_open_cq (c->mdev, ptp_moder, cq_param, &ccp, cq);if (err) goto out_err_txqsq_cq; }
@@ -576,7 +578,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,struct mlx5e_cq *cq = &c->ptpsq[tc].ts_cq;struct mlx5e_ptpsq *ptpsq = &c->ptpsq[tc]; - err =mlx5e_open_cq (c->priv, ptp_moder, cq_param, &ccp, cq); + err =mlx5e_open_cq (c->mdev, ptp_moder, cq_param, &ccp, cq);if (err) goto out_err_ts_cq;
@@ -604,6 +606,8 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c,struct mlx5e_cq_param *cq_param;struct mlx5e_cq *cq = &c->rq.cq; + ccp.netdev = c->netdev; + ccp.wq = c->priv->wq; ccp.node =dev_to_node (mlx5_core_dma_dev (c->mdev)); ccp.ch_stats = c->stats; ccp.napi = &c->napi;
@@ -611,7 +615,7 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c, cq_param = &cparams->rq_param.cqp; -return mlx5e_open_cq (c->priv, ptp_moder, cq_param, &ccp, cq); +return mlx5e_open_cq (c->mdev, ptp_moder, cq_param, &ccp, cq); }static void mlx5e_ptp_close_tx_cqs (struct mlx5e_ptp *c)
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +1 -1
@@ -124,7 +124,7 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs,memset (¶m_cq,0 ,sizeof (param_cq));mlx5e_build_sq_param (priv->mdev, params, ¶m_sq);mlx5e_build_tx_cq_param (priv->mdev, params, ¶m_cq); - err =mlx5e_open_cq (priv, params->tx_cq_moderation, ¶m_cq, &ccp, &sq->cq); + err =mlx5e_open_cq (c->mdev, params->tx_cq_moderation, ¶m_cq, &ccp, &sq->cq);if (err) goto err_free_sq;
drivers/net/ethernet/mellanox/mlx5/core/en/trap.c +3 -1
@@ -68,11 +68,13 @@ static int mlx5e_open_trap_rq(struct mlx5e_priv *priv, struct mlx5e_trap *t) node =dev_to_node (mdev->device); + ccp.netdev = priv->netdev; + ccp.wq = priv->wq; ccp.node = node; ccp.ch_stats = t->stats; ccp.napi = &t->napi; ccp.ix =0 ; - err =mlx5e_open_cq (priv, trap_moder, &rq_param->cqp, &ccp, &rq->cq); + err =mlx5e_open_cq (priv->mdev, trap_moder, &rq_param->cqp, &ccp, &rq->cq);if (err)return err;
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +2 -2
@@ -127,7 +127,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,mlx5e_build_xsk_cparam (priv->mdev, params, xsk, priv->q_counter, cparam); - err =mlx5e_open_cq (c->priv, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, &c->xskrq.cq);if (unlikely (err)) goto err_free_cparam;
@@ -136,7 +136,7 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,if (unlikely (err)) goto err_close_rx_cq; - err =mlx5e_open_cq (c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, &c->xsksq.cq);if (unlikely (err)) goto err_close_rq;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +16 -16
@@ -1994,11 +1994,12 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq)mlx5e_free_xdpsq (sq); } -static int mlx5e_alloc_cq_common (struct mlx5e_priv *priv, +static int mlx5e_alloc_cq_common (struct mlx5_core_dev *mdev, +struct net_device *netdev, +struct workqueue_struct *workqueue,struct mlx5e_cq_param *param,struct mlx5e_cq *cq) { -struct mlx5_core_dev *mdev = priv->mdev;struct mlx5_core_cq *mcq = &cq->mcq;int err;u32 i;
@@ -2025,13 +2026,13 @@ static int mlx5e_alloc_cq_common(struct mlx5e_priv *priv, } cq->mdev = mdev; - cq->netdev = priv->netdev; - cq->priv = priv; + cq->netdev = netdev; + cq->workqueue = workqueue;return 0 ; } -static int mlx5e_alloc_cq (struct mlx5e_priv *priv, +static int mlx5e_alloc_cq (struct mlx5_core_dev *mdev,struct mlx5e_cq_param *param,struct mlx5e_create_cq_param *ccp,struct mlx5e_cq *cq)
@@ -2042,7 +2043,7 @@ static int mlx5e_alloc_cq(struct mlx5e_priv *priv, param->wq.db_numa_node = ccp->node; param->eq_ix = ccp->ix; - err =mlx5e_alloc_cq_common (priv, param, cq); + err =mlx5e_alloc_cq_common (mdev, ccp->netdev, ccp->wq, param, cq); cq->napi = ccp->napi; cq->ch_stats = ccp->ch_stats;
@@ -2108,14 +2109,13 @@ static void mlx5e_destroy_cq(struct mlx5e_cq *cq)mlx5_core_destroy_cq (cq->mdev, &cq->mcq); } -int mlx5e_open_cq (struct mlx5e_priv *priv,struct dim_cq_moder moder, +int mlx5e_open_cq (struct mlx5_core_dev *mdev,struct dim_cq_moder moder,struct mlx5e_cq_param *param,struct mlx5e_create_cq_param *ccp,struct mlx5e_cq *cq) { -struct mlx5_core_dev *mdev = priv->mdev;int err; - err =mlx5e_alloc_cq (priv, param, ccp, cq); + err =mlx5e_alloc_cq (mdev, param, ccp, cq);if (err)return err;
@@ -2148,7 +2148,7 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c,int tc;for (tc =0 ; tc < c->num_tc; tc++) { - err =mlx5e_open_cq (c->priv, params->tx_cq_moderation, &cparam->txq_sq.cqp, + err =mlx5e_open_cq (c->mdev, params->tx_cq_moderation, &cparam->txq_sq.cqp, ccp, &c->sq[tc].cq);if (err) goto err_close_tx_cqs;
@@ -2352,12 +2352,12 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,mlx5e_build_create_cq_param (&ccp, c); - err =mlx5e_open_cq (c->priv, icocq_moder, &cparam->async_icosq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, icocq_moder, &cparam->async_icosq.cqp, &ccp, &c->async_icosq.cq);if (err)return err; - err =mlx5e_open_cq (c->priv, icocq_moder, &cparam->icosq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, icocq_moder, &cparam->icosq.cqp, &ccp, &c->icosq.cq);if (err) goto err_close_async_icosq_cq;
@@ -2366,17 +2366,17 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,if (err) goto err_close_icosq_cq; - err =mlx5e_open_cq (c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, &c->xdpsq.cq);if (err) goto err_close_tx_cqs; - err =mlx5e_open_cq (c->priv, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, + err =mlx5e_open_cq (c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, &c->rq.cq);if (err) goto err_close_xdp_tx_cqs; - err = c->xdp ?mlx5e_open_cq (c->priv, params->tx_cq_moderation, &cparam->xdp_sq.cqp, + err = c->xdp ?mlx5e_open_cq (c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, &c->rq_xdpsq.cq) :0 ;if (err) goto err_close_rx_cq;
@@ -3310,7 +3310,7 @@ static int mlx5e_alloc_drop_cq(struct mlx5e_priv *priv, param->wq.buf_numa_node =dev_to_node (mlx5_core_dma_dev (mdev)); param->wq.db_numa_node =dev_to_node (mlx5_core_dma_dev (mdev)); -return mlx5e_alloc_cq_common (priv, param, cq); +return mlx5e_alloc_cq_common (priv->mdev, priv->netdev, priv->wq, param, cq); } int mlx5e_open_drop_rq(struct mlx5e_priv *priv,
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +1 -1
@@ -1039,7 +1039,7 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) (struct mlx5_err_cqe *)cqe);mlx5_wq_cyc_wqe_dump (&sq->wq, ci, wi->num_wqebbs);if (!test_and_set_bit (MLX5E_SQ_STATE_RECOVERING , &sq->state)) -queue_work (cq->priv->wq, &sq->recover_work); +queue_work (cq->workqueue, &sq->recover_work);break ; }
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +1 -1
@@ -861,7 +861,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)mlx5e_dump_error_cqe (&sq->cq, sq->sqn, (struct mlx5_err_cqe *)cqe);mlx5_wq_cyc_wqe_dump (&sq->wq, ci, wi->num_wqebbs); -queue_work (cq->priv->wq, &sq->recover_work); +queue_work (cq->workqueue, &sq->recover_work); } stats->cqe_err++; }
Signature · 1 line
2.43.0
PATCH 10/11 net/mlx5: devcom, Add component size getter
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Add a getter for the number of participants in a devcom component (those who share the same component id and key).
--- drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c | 7 +++++++ drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.h | 1 + 2 files changed, 8 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c +7 -0
@@ -256,6 +256,13 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom)devcom_free_comp_dev (devcom); } +int mlx5_devcom_comp_get_size (struct mlx5_devcom_comp_dev *devcom) +{ +struct mlx5_devcom_comp *comp = devcom->comp; + +return kref_read (&comp->ref); +} +int mlx5_devcom_send_event (struct mlx5_devcom_comp_dev *devcom,int event,int rollback_event,void *event_data)
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.h +1 -0
@@ -31,6 +31,7 @@ void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom);int mlx5_devcom_send_event (struct mlx5_devcom_comp_dev *devcom,int event,int rollback_event,void *event_data); +int mlx5_devcom_comp_get_size (struct mlx5_devcom_comp_dev *devcom);void mlx5_devcom_comp_set_ready (struct mlx5_devcom_comp_dev *devcom,bool ready);bool mlx5_devcom_comp_is_ready (struct mlx5_devcom_comp_dev *devcom);
Signature · 1 line
2.43.0
PATCH 11/11 net/mlx5: DR, Use swap() instead of open coding it
In reply to Saeed MahameedFrom: Jiapeng Chong <[email protected]>
Swap is a function interface that provides exchange function. To avoid code duplication, we can use swap function.
./drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1254:50-51: WARNING opportunity for swap().
--- .../net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +2 -6
@@ -1170,7 +1170,6 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, bool ignore_flow_level, u32 flow_source) { -struct mlx5dr_cmd_flow_destination_hw_info tmp_hw_dest;struct mlx5dr_cmd_flow_destination_hw_info *hw_dests;struct mlx5dr_action **ref_actions;struct mlx5dr_action *action;
@@ -1249,11 +1248,8 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn,* one that done in the TX. * So, if one of the ft target is wire, put it at the end of the dest list. */ -if (is_ft_wire && num_dst_ft >1 ) { - tmp_hw_dest = hw_dests[last_dest]; - hw_dests[last_dest] = hw_dests[num_of_dests -1 ]; - hw_dests[num_of_dests -1 ] = tmp_hw_dest; - } +if (is_ft_wire && num_dst_ft >1 ) +swap (hw_dests[last_dest], hw_dests[num_of_dests -1 ]); action =dr_action_create_generic (DR_ACTION_TYP_FT );if (!action)
Signature · 1 line
2.43.0
Quoted 2 lines · On Wed, 13 Dec 2023 18:08:21 -0800 Saeed Mahameed wrote:
This series is in preparation for mlx5 netdev Socket Direct feature. For more information please see tag log below.
Applied, thanks! (on Friday night, apparently)