[dpdk-stable] patch 'common/mlx5: fix queue doorbell record size' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:53:40 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/08/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 313e372f7d6892795cb3ee6db9d114f76c3e8ddd Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
Date: Tue, 21 Jul 2020 11:11:29 +0000
Subject: [PATCH] common/mlx5: fix queue doorbell record size

[ upstream commit 44c1b52bc6a659e01e8038e1f5c42d9fa98b728f ]

When Rx/Tx queue was being created with DevX the allocated
doorbell record size was only uint64_t. That was definitely
less than size of CPU cacheline and it might have happened the
doorbell records attached to different queues handled by
different cores were allocated within same cacheline. It might
have caused the contention on doorbell record writing.

This patch extends the allocated memory size for doorbell
record to cacheline size.

Fixes: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5.c |  2 +-
 drivers/net/mlx5/mlx5.h | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index c97e54251..ad1ff8dba 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2033,7 +2033,7 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page)
 	page->dbr_bitmap[i] |= (UINT64_C(1) << j);
 	page->dbr_count++;
 	*dbr_page = page;
-	return (((i * 64) + j) * sizeof(uint64_t));
+	return (i * CHAR_BIT * sizeof(uint64_t) + j) * MLX5_DBR_SIZE;
 }
 
 /**
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 130aed0e5..51f067b4b 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -610,10 +610,12 @@ struct mlx5_flow_tbl_resource {
 #define MLX5_MAX_TABLES_EXTERNAL (MLX5_MAX_TABLES - 3)
 #define MLX5_MAX_TABLES_FDB UINT16_MAX
 
-#define MLX5_DBR_PAGE_SIZE 4096 /* Must be >= 512. */
-#define MLX5_DBR_SIZE 8
-#define MLX5_DBR_PER_PAGE (MLX5_DBR_PAGE_SIZE / MLX5_DBR_SIZE)
-#define MLX5_DBR_BITMAP_SIZE (MLX5_DBR_PER_PAGE / 64)
+#define MLX5_DBR_SIZE RTE_CACHE_LINE_SIZE
+#define MLX5_DBR_PER_PAGE 64
+/* Must be >= CHAR_BIT * sizeof(uint64_t) */
+#define MLX5_DBR_PAGE_SIZE (MLX5_DBR_PER_PAGE * MLX5_DBR_SIZE)
+/* Page size must be >= 512. */
+#define MLX5_DBR_BITMAP_SIZE (MLX5_DBR_PER_PAGE / (CHAR_BIT * sizeof(uint64_t)))
 
 struct mlx5_devx_dbr_page {
 	/* Door-bell records, must be first member in structure. */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:16.258847393 +0100
+++ 0012-common-mlx5-fix-queue-doorbell-record-size.patch	2020-08-06 10:53:15.732596055 +0100
@@ -1,8 +1,10 @@
-From 44c1b52bc6a659e01e8038e1f5c42d9fa98b728f Mon Sep 17 00:00:00 2001
+From 313e372f7d6892795cb3ee6db9d114f76c3e8ddd Mon Sep 17 00:00:00 2001
 From: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
 Date: Tue, 21 Jul 2020 11:11:29 +0000
 Subject: [PATCH] common/mlx5: fix queue doorbell record size
 
+[ upstream commit 44c1b52bc6a659e01e8038e1f5c42d9fa98b728f ]
+
 When Rx/Tx queue was being created with DevX the allocated
 doorbell record size was only uint64_t. That was definitely
 less than size of CPU cacheline and it might have happened the
@@ -14,20 +16,19 @@
 record to cacheline size.
 
 Fixes: 21cae8580fd0 ("net/mlx5: allocate door-bells via DevX")
-Cc: stable at dpdk.org
 
 Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
 ---
- drivers/common/mlx5/mlx5_common.c |  2 +-
- drivers/common/mlx5/mlx5_common.h | 10 ++++++----
+ drivers/net/mlx5/mlx5.c |  2 +-
+ drivers/net/mlx5/mlx5.h | 10 ++++++----
  2 files changed, 7 insertions(+), 5 deletions(-)
 
-diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
-index 79357e2e2..06f0a6400 100644
---- a/drivers/common/mlx5/mlx5_common.c
-+++ b/drivers/common/mlx5/mlx5_common.c
-@@ -198,7 +198,7 @@ mlx5_get_dbr(void *ctx,  struct mlx5_dbr_page_list *head,
+diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
+index c97e54251..ad1ff8dba 100644
+--- a/drivers/net/mlx5/mlx5.c
++++ b/drivers/net/mlx5/mlx5.c
+@@ -2033,7 +2033,7 @@ mlx5_get_dbr(struct rte_eth_dev *dev, struct mlx5_devx_dbr_page **dbr_page)
  	page->dbr_bitmap[i] |= (UINT64_C(1) << j);
  	page->dbr_count++;
  	*dbr_page = page;
@@ -36,13 +37,13 @@
  }
  
  /**
-diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
-index 9154cbc6b..2cdb226f3 100644
---- a/drivers/common/mlx5/mlx5_common.h
-+++ b/drivers/common/mlx5/mlx5_common.h
-@@ -215,10 +215,12 @@ enum mlx5_class {
- 	MLX5_CLASS_REGEX = RTE_BIT64(2),
- };
+diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
+index 130aed0e5..51f067b4b 100644
+--- a/drivers/net/mlx5/mlx5.h
++++ b/drivers/net/mlx5/mlx5.h
+@@ -610,10 +610,12 @@ struct mlx5_flow_tbl_resource {
+ #define MLX5_MAX_TABLES_EXTERNAL (MLX5_MAX_TABLES - 3)
+ #define MLX5_MAX_TABLES_FDB UINT16_MAX
  
 -#define MLX5_DBR_PAGE_SIZE 4096 /* Must be >= 512. */
 -#define MLX5_DBR_SIZE 8


More information about the stable mailing list