Skip to contentSkip to conversation

mlx4_core: fix wrong comment about the reason of subtract one from the max_cqes

PATCH Applied Yuval Shaia 3 participants 3 messages Nov 3, 2019 – Nov 6, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx4_core: fix wrong comment about the reason of subtract one from the max_cqes

From: Dotan Barak <[email protected]>

The reason for the pre-allocation of one CQE is to enable resizing of the CQ.
Fix comment accordingly.

---
v0 -> v1:
* Add . at EOL
* Add commit message

---
 drivers/net/ethernet/mellanox/mlx4/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +1 -2
index fce9b3a24347..69bb6bb06e76 100644
@@ -514,8 +514,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
 	dev->caps.max_rq_desc_sz     = dev_cap->max_rq_desc_sz;
 	/*
 	 * Subtract 1 from the limit because we need to allocate a
-	 * spare CQE so the HCA HW can tell the difference between an
-	 * empty CQ and a full CQ.
+	 * spare CQE to enable resizing the CQ.
 	 */
 	dev->caps.max_cqes	     = dev_cap->max_cq_sz - 1;
 	dev->caps.reserved_cqs	     = dev_cap->reserved_cqs;
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Yuval Shaia

From: Dotan Barak <[email protected]>

The reason for the pre-allocation of one CQE is to enable resizing of the CQ.
Fix comment accordingly.

---
v0 -> v1:
* Add . at EOL
* Add commit message

---
  drivers/net/ethernet/mellanox/mlx4/main.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +0 -0
index fce9b3a24347..69bb6bb06e76 100644

drivers/net/ethernet/mellanox/mlx4/main.c static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) · line 520

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx4/main.c +1 -2
@@ -514,8 +514,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
  	dev->caps.max_rq_desc_sz     = dev_cap->max_rq_desc_sz;
  	/*
  	 * Subtract 1 from the limit because we need to allocate a
-	 * spare CQE so the HCA HW can tell the difference between an
-	 * empty CQ and a full CQ.
+	 * spare CQE to enable resizing the CQ.
  	 */
  	dev->caps.max_cqes	     = dev_cap->max_cq_sz - 1;
  	dev->caps.reserved_cqs	     = dev_cap->reserved_cqs;

Thanks.

maintainer Applied
#2 lore raw
In reply to Yuval Shaia

From: Yuval Shaia <[email protected]>
Date: Sun, 3 Nov 2019 11:11:35 +0200

Quoted 10 lines

From: Dotan Barak <[email protected]>

The reason for the pre-allocation of one CQE is to enable resizing of the CQ.
Fix comment accordingly.

Applied.