DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer
@ 2014-11-03 11:11 Bruce Richardson
  2014-11-03 12:31 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Bruce Richardson @ 2014-11-03 11:11 UTC (permalink / raw)
  To: dev

When using Intel C++ compiler(icc) 14.0.1.106 or the older icc 13.x
version, the mbuf initializer variable was not getting configured
correctly, as the mb_def variable was not set correctly. This is due
to an issue with icc (DPD200249565 which already been fixed in
icc 14.0.2 and newer compiler release) where it incorrectly calculates
the field offsets with initializers when zero-sized fields
are used in a structure.
To work around this, the code in ixgbe_rxq_vec_setup does not setup the
fields using an initializer, but instead assigns the values individually
in code
NOTE: There is no performance impact to this change as the queue
setup functions are not data-plane APIs, but are only used at app
initialization.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
index e813e43..b57c588 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
@@ -730,16 +730,15 @@ static struct ixgbe_txq_ops vec_txq_ops = {
 int
 ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
 {
-	struct rte_mbuf mb_def = {
-		.nb_segs = 1,
-		.data_off = RTE_PKTMBUF_HEADROOM,
-#ifdef RTE_MBUF_REFCNT
-		{ .refcnt = 1, }
-#endif
-	};
+	struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */
 
+	mb_def.nb_segs = 1;
+	mb_def.data_off = RTE_PKTMBUF_HEADROOM;
 	mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);
 	mb_def.port = rxq->port_id;
+#ifdef RTE_MBUF_REFCNT
+	mb_def.refcnt = 1;
+#endif
 	rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);
 	return 0;
 }
-- 
1.9.3

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

end of thread, other threads:[~2014-11-28  8:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03 11:11 [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer Bruce Richardson
2014-11-03 12:31 ` David Marchand
2014-11-03 12:47   ` Bruce Richardson
2014-11-03 12:59     ` Thomas Monjalon
2014-11-03 13:16       ` Bruce Richardson
2014-11-03 17:01 ` [dpdk-dev] [PATCH v2] " Bruce Richardson
2014-11-05 21:45   ` Thomas Monjalon
2014-11-28  8:52   ` Cao, Min
2014-11-28  8:52 ` [dpdk-dev] [PATCH] " Cao, Min

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