DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix a regression due to cache alignment issue
@ 2018-02-10  9:42 Jerin Jacob
  2018-02-10 18:23 ` Matan Azrad
  2018-02-12  5:54 ` [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned Jerin Jacob
  0 siblings, 2 replies; 16+ messages in thread
From: Jerin Jacob @ 2018-02-10  9:42 UTC (permalink / raw)
  To: dev
  Cc: Jerin Jacob, Matan Azrad, Thomas Monjalon, Konstantin Ananyev,
	Pavan Nikhilesh

Prior to "ethdev: add port ownership" change, the fast
path structure struct rte_eth_dev->data was cache aligned
due to the fact that eth_dev_data was allocated from
rte_malloc with cache aligned attribute.
"ethdev: add port ownership" change set introduced a
rte_eth_dev_shared_data container for port ownership change,
This resulted in rte_eth_dev->data memory as cache unaligned.
Added a compiler alignment attribute to make sure
rte_eth_dev->data always cache aligned and hence compiler
can load/store the elements in struct rte_eth_dev_data
as naturally aligned.

Some platform like thunderx + l3fwd showed 1% regression in
the performance with the offending changeset.

Fixes: 5b7ba31148a8 ("ethdev: add port ownership")

Cc: Matan Azrad <matan@mellanox.com>
Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_ether/rte_ethdev_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
index 315b31723..e5681e466 100644
--- a/lib/librte_ether/rte_ethdev_core.h
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -601,7 +601,7 @@ struct rte_eth_dev_data {
 	struct rte_vlan_filter_conf vlan_filter_conf;
 	/**< VLAN filter configuration. */
 	struct rte_eth_dev_owner owner; /**< The port owner. */
-};
+} __rte_cache_aligned;
 
 /**
  * @internal
-- 
2.16.1

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

end of thread, other threads:[~2018-02-13 15:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-10  9:42 [dpdk-dev] [PATCH] ethdev: fix a regression due to cache alignment issue Jerin Jacob
2018-02-10 18:23 ` Matan Azrad
2018-02-12  5:33   ` Jerin Jacob
2018-02-12  5:54 ` [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned Jerin Jacob
2018-02-12  9:04   ` Matan Azrad
2018-02-12  9:25     ` Jerin Jacob
2018-02-12  9:49       ` Matan Azrad
2018-02-12 10:20         ` Jerin Jacob
2018-02-12 12:10           ` Matan Azrad
2018-02-12 13:13   ` [dpdk-dev] [PATCH v3] ethdev: fix ethdev data alignment Jerin Jacob
2018-02-12 13:44     ` Matan Azrad
2018-02-12 13:50       ` Jerin Jacob
2018-02-12 14:02         ` Matan Azrad
2018-02-12 14:11           ` Jerin Jacob
2018-02-13  9:42             ` Ferruh Yigit
2018-02-13 15:16     ` Thomas Monjalon

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).