From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 42FABB391 for ; Mon, 11 Aug 2014 22:44:07 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Aug 2014 13:41:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,844,1400050800"; d="scan'208";a="586659696" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 11 Aug 2014 13:44:53 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s7BKiq8V020967; Mon, 11 Aug 2014 21:44:52 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s7BKiqE6017723; Mon, 11 Aug 2014 21:44:52 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s7BKiqh1017719; Mon, 11 Aug 2014 21:44:52 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Mon, 11 Aug 2014 21:44:48 +0100 Message-Id: <1407789890-17355-13-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1407789890-17355-1-git-send-email-bruce.richardson@intel.com> References: <1407789890-17355-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [RFC PATCH 12/14] ixgbe: Make vector stores unaligned X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 20:44:08 -0000 When writing to the mbuf array for receiving packets, do not assume 16-byte alignment by using aligned stores. If the pointers are only 8-byte aligned, the program will crash due to incorrect alignment. Changing "store" to "storeu" fixes this. Signed-off-by: Bruce Richardson --- lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c index 39c06e2..07314e9 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -246,7 +246,7 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); /* B.2 copy 2 mbuf point into rx_pkts */ - _mm_store_si128((__m128i *)&rx_pkts[pos], mbp1); + _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); /* B.1 load 1 mbuf point */ mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]); @@ -257,7 +257,7 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, descs[0] = _mm_loadu_si128((__m128i *)(rxdp)); /* B.2 copy 2 mbuf point into rx_pkts */ - _mm_store_si128((__m128i *)&rx_pkts[pos+2], mbp2); + _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); /* avoid compiler reorder optimization */ rte_compiler_barrier(); -- 1.9.3