Skip to content

Commit 354e1f9

Browse files
committed
Merge tag 'mlx5-updates-2021-08-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5-updates-2021-08-16 The following patchset provides two separate mlx5 updates 1) Ethtool RSS context and MQPRIO channel mode support: 1.1) enable mlx5e netdev driver to allow creating Transport Interface RX (TIRs) objects on the fly to be used for ethtool RSS contexts and TX MQPRIO channel mode 1.2) Introduce mlx5e_rss object to manage such TIRs. 1.3) Ethtool support for RSS context 1.4) Support MQPRIO channel mode 2) Bridge offloads Lag support: to allow adding bond net devices to mlx5 bridge 2.1) Address bridge port by (vport_num, esw_owner_vhca_id) pair since vport_num is only unique per eswitch and in lag mode we need to manage ports from both eswitches. 2.2) Allow connectivity between representors of different eswitch instances that are attached to same bridge 2.3) Bridge LAG, Require representors to be in shared FDB mode and introduce local and peer ports representors, match on paired eswitch metadata in peer FDB entries, And finally support addition/deletion and aging of peer flows. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e3faa49 + ff9b752 commit 354e1f9

File tree

19 files changed

+1696
-716
lines changed

19 files changed

+1696
-716
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
2222
#
2323
# Netdev basic
2424
#
25-
mlx5_core-$(CONFIG_MLX5_CORE_EN) += en_main.o en_common.o en_fs.o en_ethtool.o \
25+
mlx5_core-$(CONFIG_MLX5_CORE_EN) += en/rqt.o en/tir.o en/rss.o en/rx_res.o \
26+
en/channels.o en_main.o en_common.o en_fs.o en_ethtool.o \
2627
en_tx.o en_rx.o en_dim.o en_txrx.o en/xdp.o en_stats.o \
2728
en_selftest.o en/port.o en/monitor_stats.o en/health.o \
2829
en/reporter_tx.o en/reporter_rx.o en/params.o en/xsk/pool.o \
2930
en/xsk/setup.o en/xsk/rx.o en/xsk/tx.o en/devlink.o en/ptp.o \
30-
en/qos.o en/trap.o en/fs_tt_redirect.o en/rqt.o en/tir.o \
31-
en/rx_res.o en/channels.o
31+
en/qos.o en/trap.o en/fs_tt_redirect.o
3232

3333
#
3434
# Netdev extra

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct page_pool;
7272
#define MLX5E_SW2HW_MTU(params, swmtu) ((swmtu) + ((params)->hard_mtu))
7373

7474
#define MLX5E_MAX_NUM_TC 8
75+
#define MLX5E_MAX_NUM_MQPRIO_CH_TC TC_QOPT_MAX_QUEUE
7576

7677
#define MLX5_RX_HEADROOM NET_SKB_PAD
7778
#define MLX5_SKB_FRAG_SZ(len) (SKB_DATA_ALIGN(len) + \
@@ -248,7 +249,10 @@ struct mlx5e_params {
248249
u8 rq_wq_type;
249250
u8 log_rq_mtu_frames;
250251
u16 num_channels;
251-
u8 num_tc;
252+
struct {
253+
u16 mode;
254+
u8 num_tc;
255+
} mqprio;
252256
bool rx_cqe_compress_def;
253257
bool tunneled_offload_en;
254258
struct dim_cq_moder rx_cq_moderation;
@@ -268,6 +272,12 @@ struct mlx5e_params {
268272
bool ptp_rx;
269273
};
270274

275+
static inline u8 mlx5e_get_dcb_num_tc(struct mlx5e_params *params)
276+
{
277+
return params->mqprio.mode == TC_MQPRIO_MODE_DCB ?
278+
params->mqprio.num_tc : 1;
279+
}
280+
271281
enum {
272282
MLX5E_RQ_STATE_ENABLED,
273283
MLX5E_RQ_STATE_RECOVERING,

drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,14 @@ static int mlx5e_ptp_open_txqsqs(struct mlx5e_ptp *c,
326326
struct mlx5e_ptp_params *cparams)
327327
{
328328
struct mlx5e_params *params = &cparams->params;
329+
u8 num_tc = mlx5e_get_dcb_num_tc(params);
329330
int ix_base;
330331
int err;
331332
int tc;
332333

333-
ix_base = params->num_tc * params->num_channels;
334+
ix_base = num_tc * params->num_channels;
334335

335-
for (tc = 0; tc < params->num_tc; tc++) {
336+
for (tc = 0; tc < num_tc; tc++) {
336337
int txq_ix = ix_base + tc;
337338

338339
err = mlx5e_ptp_open_txqsq(c, c->priv->tisn[c->lag_port][tc], txq_ix,
@@ -365,25 +366,28 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
365366
struct mlx5e_create_cq_param ccp = {};
366367
struct dim_cq_moder ptp_moder = {};
367368
struct mlx5e_cq_param *cq_param;
369+
u8 num_tc;
368370
int err;
369371
int tc;
370372

373+
num_tc = mlx5e_get_dcb_num_tc(params);
374+
371375
ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev));
372376
ccp.ch_stats = c->stats;
373377
ccp.napi = &c->napi;
374378
ccp.ix = MLX5E_PTP_CHANNEL_IX;
375379

376380
cq_param = &cparams->txq_sq_param.cqp;
377381

378-
for (tc = 0; tc < params->num_tc; tc++) {
382+
for (tc = 0; tc < num_tc; tc++) {
379383
struct mlx5e_cq *cq = &c->ptpsq[tc].txqsq.cq;
380384

381385
err = mlx5e_open_cq(c->priv, ptp_moder, cq_param, &ccp, cq);
382386
if (err)
383387
goto out_err_txqsq_cq;
384388
}
385389

386-
for (tc = 0; tc < params->num_tc; tc++) {
390+
for (tc = 0; tc < num_tc; tc++) {
387391
struct mlx5e_cq *cq = &c->ptpsq[tc].ts_cq;
388392
struct mlx5e_ptpsq *ptpsq = &c->ptpsq[tc];
389393

@@ -399,7 +403,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
399403
out_err_ts_cq:
400404
for (--tc; tc >= 0; tc--)
401405
mlx5e_close_cq(&c->ptpsq[tc].ts_cq);
402-
tc = params->num_tc;
406+
tc = num_tc;
403407
out_err_txqsq_cq:
404408
for (--tc; tc >= 0; tc--)
405409
mlx5e_close_cq(&c->ptpsq[tc].txqsq.cq);
@@ -475,7 +479,7 @@ static void mlx5e_ptp_build_params(struct mlx5e_ptp *c,
475479
params->num_channels = orig->num_channels;
476480
params->hard_mtu = orig->hard_mtu;
477481
params->sw_mtu = orig->sw_mtu;
478-
params->num_tc = orig->num_tc;
482+
params->mqprio = orig->mqprio;
479483

480484
/* SQ */
481485
if (test_bit(MLX5E_PTP_STATE_TX, c->state)) {
@@ -680,7 +684,7 @@ int mlx5e_ptp_open(struct mlx5e_priv *priv, struct mlx5e_params *params,
680684
c->pdev = mlx5_core_dma_dev(priv->mdev);
681685
c->netdev = priv->netdev;
682686
c->mkey_be = cpu_to_be32(priv->mdev->mlx5e_res.hw_objs.mkey.key);
683-
c->num_tc = params->num_tc;
687+
c->num_tc = mlx5e_get_dcb_num_tc(params);
684688
c->stats = &priv->ptp_stats.ch;
685689
c->lag_port = lag_port;
686690

drivers/net/ethernet/mellanox/mlx5/core/en/qos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static u16 mlx5e_qid_from_qos(struct mlx5e_channels *chs, u16 qid)
132132
*/
133133
bool is_ptp = MLX5E_GET_PFLAG(&chs->params, MLX5E_PFLAG_TX_PORT_TS);
134134

135-
return (chs->params.num_channels + is_ptp) * chs->params.num_tc + qid;
135+
return (chs->params.num_channels + is_ptp) * mlx5e_get_dcb_num_tc(&chs->params) + qid;
136136
}
137137

138138
int mlx5e_get_txq_by_classid(struct mlx5e_priv *priv, u16 classid)

0 commit comments

Comments
 (0)