DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/enetc: add macro for BD ring alignment
@ 2019-10-21  6:29 Gagandeep Singh
  2019-10-21  6:29 ` [dpdk-dev] [PATCH 2/2] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
  2019-10-21  8:58 ` [dpdk-dev] [PATCH v2 0/2] enetc PMD specific changes Gagandeep Singh
  0 siblings, 2 replies; 28+ messages in thread
From: Gagandeep Singh @ 2019-10-21  6:29 UTC (permalink / raw)
  To: dev, ferruh.yigit; +Cc: Gagandeep Singh

enetc BD rings should be aligned to 128
instead of RTE_CACHE_LINE_SIZE.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/net/enetc/base/enetc_hw.h | 3 +++
 drivers/net/enetc/enetc_ethdev.c  | 8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h
index fd71155ee..2fe7ccb5b 100644
--- a/drivers/net/enetc/base/enetc_hw.h
+++ b/drivers/net/enetc/base/enetc_hw.h
@@ -12,6 +12,9 @@
 #define ENETC_DEV_ID_VF		0xef00
 #define ENETC_DEV_ID		0xe100
 
+/* BD RING ALIGNMENT */
+#define ENETC_BD_RING_ALIGN	128
+
 /* ENETC register block BAR */
 #define ENETC_BAR_REGS			0x0
 
diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c
index dc05c00ff..4e978348c 100644
--- a/drivers/net/enetc/enetc_ethdev.c
+++ b/drivers/net/enetc/enetc_ethdev.c
@@ -178,12 +178,12 @@ enetc_alloc_txbdr(struct enetc_bdr *txr, uint16_t nb_desc)
 	int size;
 
 	size = nb_desc * sizeof(struct enetc_swbd);
-	txr->q_swbd = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE);
+	txr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
 	if (txr->q_swbd == NULL)
 		return -ENOMEM;
 
 	size = nb_desc * sizeof(struct enetc_tx_bd);
-	txr->bd_base = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE);
+	txr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
 	if (txr->bd_base == NULL) {
 		rte_free(txr->q_swbd);
 		txr->q_swbd = NULL;
@@ -325,12 +325,12 @@ enetc_alloc_rxbdr(struct enetc_bdr *rxr,
 	int size;
 
 	size = nb_rx_desc * sizeof(struct enetc_swbd);
-	rxr->q_swbd = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE);
+	rxr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
 	if (rxr->q_swbd == NULL)
 		return -ENOMEM;
 
 	size = nb_rx_desc * sizeof(union enetc_rx_bd);
-	rxr->bd_base = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE);
+	rxr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN);
 	if (rxr->bd_base == NULL) {
 		rte_free(rxr->q_swbd);
 		rxr->q_swbd = NULL;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-10-23  6:22 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21  6:29 [dpdk-dev] [PATCH 1/2] net/enetc: add macro for BD ring alignment Gagandeep Singh
2019-10-21  6:29 ` [dpdk-dev] [PATCH 2/2] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
2019-10-21  8:58 ` [dpdk-dev] [PATCH v2 0/2] enetc PMD specific changes Gagandeep Singh
2019-10-21  8:58   ` [dpdk-dev] [PATCH v2 1/2] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
2019-10-21  8:58   ` [dpdk-dev] [PATCH v2 2/2] net/enetc: enable dpaax library Gagandeep Singh
2019-10-21  9:11   ` [dpdk-dev] [PATCH v3 0/3] enetc PMD specific changes Gagandeep Singh
2019-10-21  9:11     ` [dpdk-dev] [PATCH v3 1/3] net/enetc: add macro for BD ring alignment Gagandeep Singh
2019-10-21  9:11     ` [dpdk-dev] [PATCH v3 2/3] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
2019-10-21  9:11     ` [dpdk-dev] [PATCH v3 3/3] net/enetc: enable dpaax library Gagandeep Singh
2019-10-21 10:50     ` [dpdk-dev] [PATCH v4 0/3] enetc PMD specific changes Gagandeep Singh
2019-10-21 10:50       ` [dpdk-dev] [PATCH v4 1/3] net/enetc: add macro for BD ring alignment Gagandeep Singh
2019-10-21 15:54         ` Ferruh Yigit
2019-10-22  5:32           ` Gagandeep Singh
2019-10-21 10:50       ` [dpdk-dev] [PATCH v4 2/3] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
2019-10-21 16:04         ` Ferruh Yigit
2019-10-22  5:31           ` Gagandeep Singh
2019-10-22  8:59             ` Ferruh Yigit
2019-10-22 11:32               ` Gagandeep Singh
2019-10-21 10:50       ` [dpdk-dev] [PATCH v4 3/3] net/enetc: enable dpaax library Gagandeep Singh
2019-10-21 15:55         ` Ferruh Yigit
2019-10-22  5:31           ` Gagandeep Singh
2019-10-22  9:00             ` Ferruh Yigit
2019-10-22 11:30               ` Gagandeep Singh
2019-10-23  6:05       ` [dpdk-dev] [PATCH v5 0/4] enetc PMD specific changes Gagandeep Singh
2019-10-23  6:05         ` [dpdk-dev] [PATCH v5 1/4] net/enetc: fix BD ring alignment Gagandeep Singh
2019-10-23  6:06         ` [dpdk-dev] [PATCH v5 2/4] net/enetc: set random MAC in case no MAC for SI Gagandeep Singh
2019-10-23  6:06         ` [dpdk-dev] [PATCH v5 3/4] net/enetc: add log level notice Gagandeep Singh
2019-10-23  6:06         ` [dpdk-dev] [PATCH v5 4/4] net/enetc: enable dpaax library Gagandeep Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).