diff mbox series

[v2,03/16] bus/fslmc: combine thread specific variables

Message ID 20200306095742.18080-4-hemant.agrawal@nxp.com
State Superseded
Headers show
Series NXP DPAAx fixes and enhancements | expand

Commit Message

Hemant Agrawal March 6, 2020, 9:57 a.m. UTC
From: Gagandeep Singh <g.singh@nxp.com>


This is to reduce the thread local storage.
Note that though these variables are part of *.map file
but they are internal to tbe fslmc and dpaa2 drivers and not exposed
outside.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>

---
 drivers/bus/fslmc/fslmc_bus.c            |  2 --
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h |  7 +++++++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h  |  8 ++++++++
 drivers/bus/fslmc/rte_fslmc.h            | 18 ------------------
 4 files changed, 15 insertions(+), 20 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index b3e964aa9..1f657822f 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -37,8 +37,6 @@  rte_fslmc_get_device_count(enum rte_dpaa2_dev_type device_type)
 	return rte_fslmc_bus.device_count[device_type];
 }
 
-RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_held_bufs);
-
 static void
 cleanup_fslmc_device_list(void)
 {
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
index 2829c9380..9da4af782 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
@@ -28,6 +28,13 @@  RTE_DECLARE_PER_LCORE(struct dpaa2_io_portal_t, _dpaa2_io);
 #define DPAA2_PER_LCORE_ETHRX_DPIO RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
 #define DPAA2_PER_LCORE_ETHRX_PORTAL DPAA2_PER_LCORE_ETHRX_DPIO->sw_portal
 
+#define DPAA2_PER_LCORE_DQRR_SIZE \
+	RTE_PER_LCORE(_dpaa2_io).dpio_dev->dpaa2_held_bufs.dqrr_size
+#define DPAA2_PER_LCORE_DQRR_HELD \
+	RTE_PER_LCORE(_dpaa2_io).dpio_dev->dpaa2_held_bufs.dqrr_held
+#define DPAA2_PER_LCORE_DQRR_MBUF(i) \
+	RTE_PER_LCORE(_dpaa2_io).dpio_dev->dpaa2_held_bufs.mbuf[i]
+
 /* Variable to store DPAA2 DQRR size */
 extern uint8_t dpaa2_dqrr_size;
 /* Variable to store DPAA2 EQCR size */
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index ab2b213f8..bde1441f4 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -87,6 +87,13 @@  struct eqresp_metadata {
 	struct rte_mempool *mp;
 };
 
+#define DPAA2_PORTAL_DEQUEUE_DEPTH	32
+struct dpaa2_portal_dqrr {
+	struct rte_mbuf *mbuf[DPAA2_PORTAL_DEQUEUE_DEPTH];
+	uint64_t dqrr_held;
+	uint8_t dqrr_size;
+};
+
 struct dpaa2_dpio_dev {
 	TAILQ_ENTRY(dpaa2_dpio_dev) next;
 		/**< Pointer to Next device instance */
@@ -112,6 +119,7 @@  struct dpaa2_dpio_dev {
 	struct rte_intr_handle intr_handle; /* Interrupt related info */
 	int32_t	epoll_fd; /**< File descriptor created for interrupt polling */
 	int32_t hw_id; /**< An unique ID of this DPIO device instance */
+	struct dpaa2_portal_dqrr dpaa2_held_bufs;
 };
 
 struct dpaa2_dpbp_dev {
diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h
index 96ba8dc25..a59f0077e 100644
--- a/drivers/bus/fslmc/rte_fslmc.h
+++ b/drivers/bus/fslmc/rte_fslmc.h
@@ -137,24 +137,6 @@  struct rte_fslmc_bus {
 				/**< Count of all devices scanned */
 };
 
-#define DPAA2_PORTAL_DEQUEUE_DEPTH	32
-
-/* Create storage for dqrr entries per lcore */
-struct dpaa2_portal_dqrr {
-	struct rte_mbuf *mbuf[DPAA2_PORTAL_DEQUEUE_DEPTH];
-	uint64_t dqrr_held;
-	uint8_t dqrr_size;
-};
-
-RTE_DECLARE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_held_bufs);
-
-#define DPAA2_PER_LCORE_DQRR_SIZE \
-	RTE_PER_LCORE(dpaa2_held_bufs).dqrr_size
-#define DPAA2_PER_LCORE_DQRR_HELD \
-	RTE_PER_LCORE(dpaa2_held_bufs).dqrr_held
-#define DPAA2_PER_LCORE_DQRR_MBUF(i) \
-	RTE_PER_LCORE(dpaa2_held_bufs).mbuf[i]
-
 /**
  * Register a DPAA2 driver.
  *