[dpdk-dev] [PATCH v2] ethdev: make struct rte_eth_dev cache aligned

Jerin Jacob jerin.jacob at caviumnetworks.com
Tue May 3 14:42:07 CEST 2016


Elements of struct rte_eth_dev used in the fast path.
Make struct rte_eth_dev cache aligned to avoid the cases where
rte_eth_dev elements share the same cache line with other structures.

Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---
v2:
Remove __rte_cache_aligned from rte_eth_devices and keep
it only at struct rte_eth_dev definition as suggested by Bruce
http://dpdk.org/dev/patchwork/patch/12328/
---
 lib/librte_ether/rte_ethdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2757510..48f14d5 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1615,7 +1615,7 @@ struct rte_eth_dev {
 	struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
 	uint8_t attached; /**< Flag indicating the port is attached */
 	enum rte_eth_dev_type dev_type; /**< Flag indicating the device type */
-};
+} __rte_cache_aligned;
 
 struct rte_eth_dev_sriov {
 	uint8_t active;               /**< SRIOV is active with 16, 32 or 64 pools */
-- 
2.1.0



More information about the dev mailing list