]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5e: Use multiple CQ doorbells
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 16 Sep 2025 14:11:42 +0000 (17:11 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Sep 2025 01:30:47 +0000 (18:30 -0700)
Channel doorbells are now also used by all channel CQs.

A new 'uar' parameter is added to 'struct mlx5e_create_cq_param',
which is then used in mlx5e_alloc_cq.

A single UAR page has two TX doorbells and a single CQ doorbell, so
every consecutive pair of 'struct mlx5_sq_bfreg' (TX doorbells)
uses the same underlying 'struct mlx5_uars_page' (CQ doorbell).
So by using c->bfreg->up, CQs from every consecutive channel pair will
share the same CQ doorbell.

Non-channel associated CQs keep using the global CQ doorbell.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/params.c
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
drivers/net/ethernet/mellanox/mlx5/core/en/trap.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 1cbe3f3037bb2c911fe9870c2c0381659d409436..f1aa2b2ce10b5d7879ec5d118bb82cf43fe595de 100644 (file)
@@ -1062,6 +1062,7 @@ struct mlx5e_create_cq_param {
        struct mlx5e_ch_stats *ch_stats;
        int node;
        int ix;
+       struct mlx5_uars_page *uar;
 };
 
 struct mlx5e_cq_param;
index b6b4ae7c59fa04c12058730d689ca48f4254f254..596440c8c3648207492e5a5459bc8c0a2dfd183b 100644 (file)
@@ -611,6 +611,7 @@ void mlx5e_build_create_cq_param(struct mlx5e_create_cq_param *ccp, struct mlx5e
                .ch_stats = c->stats,
                .node = cpu_to_node(c->cpu),
                .ix = c->vec_ix,
+               .uar = c->bfreg->up,
        };
 }
 
index a392578a063cc9834e8276349c38782040ff30f3..c93ee969ea647775f772a9f119d529244d19117f 100644 (file)
@@ -578,6 +578,7 @@ static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c,
        ccp.ch_stats = c->stats;
        ccp.napi     = &c->napi;
        ccp.ix       = MLX5E_PTP_CHANNEL_IX;
+       ccp.uar      = c->bfreg->up;
 
        cq_param = &cparams->txq_sq_param.cqp;
 
@@ -627,6 +628,7 @@ static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c,
        ccp.ch_stats = c->stats;
        ccp.napi     = &c->napi;
        ccp.ix       = MLX5E_PTP_CHANNEL_IX;
+       ccp.uar      = c->bfreg->up;
 
        cq_param = &cparams->rq_param.cqp;
 
index b5c19396e096cde264a7f2421b68c65bb286c926..996fcdb5a29d016910ee4578a571ebc0ccc66caa 100644 (file)
@@ -76,6 +76,7 @@ static int mlx5e_open_trap_rq(struct mlx5e_priv *priv, struct mlx5e_trap *t)
        ccp.ch_stats = t->stats;
        ccp.napi     = &t->napi;
        ccp.ix       = 0;
+       ccp.uar      = mdev->priv.bfreg.up;
        err = mlx5e_open_cq(priv->mdev, trap_moder, &rq_param->cqp, &ccp, &rq->cq);
        if (err)
                return err;
index 0700656b3c3eb54761d9e2163ec05465fe8afb9e..6aec5edc204ebb7fa6faffb9f5387cb99bfd0925 100644 (file)
@@ -2238,7 +2238,7 @@ static int mlx5e_alloc_cq(struct mlx5_core_dev *mdev,
        param->eq_ix            = ccp->ix;
 
        err = mlx5e_alloc_cq_common(mdev, ccp->netdev, ccp->wq,
-                                   mdev->priv.bfreg.up, param, cq);
+                                   ccp->uar, param, cq);
 
        cq->napi     = ccp->napi;
        cq->ch_stats = ccp->ch_stats;