From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by dpdk.org (Postfix) with ESMTP id D96088E56 for ; Fri, 25 Sep 2015 02:25:41 +0200 (CEST) Received: by padhy16 with SMTP id hy16so87642139pad.1 for ; Thu, 24 Sep 2015 17:25:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JOZLYpp34EaIHSGJKOKuXpHDwST8pb51WH488IhWg4o=; b=H+HzmNcA6+8msNhXZOCOoItBc3eoOXDg211Giok6butFK/VYHNgxXtITDBCTL5+nvy L3i5+cLwR7NF27OCeLXZa8BMn0GvPgLjBe8DAOUxbgwphY9fnMvF1rX8n2DXuys//D95 L4yLP1USz7GzVo0f8+4PSKAbTCz5bkeYp5SR+4MKK4UYSB554RFbeERfIxcvOlJSiwAj dIiATCrJdPKlC+W2cPUSh4nOPEUJpmfn8cvEfzFyWM41v8kUNKQlm0gkxLoMo9ky9IHh SgiMF9+FGE2tsEz6fur/3TuijCHfT7d7FKsOqchE5wjehlD6RNwQdzGT4OyPmkGRiS+k spXA== X-Gm-Message-State: ALoCoQlrm51w+Hx2bPSPkyc+IaKCtfO1Q05Zy2WDxFsyFLGrrFBDZS7KhfqYhP1Yuzg5rUkeqb7v X-Received: by 10.68.196.35 with SMTP id ij3mr3170772pbc.52.1443140741059; Thu, 24 Sep 2015 17:25:41 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id bc1sm581704pbb.66.2015.09.24.17.25.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Sep 2015 17:25:40 -0700 (PDT) From: Zoltan Kiss To: dev@dpdk.org Date: Thu, 24 Sep 2015 17:23:26 -0700 Message-Id: <1443140606-18241-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] ixgbe: prefetch cacheline after pointer becomes valid 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: Fri, 25 Sep 2015 00:25:42 -0000 At the original point the rx_pkts[pos( + n)] pointers are not initialized, so the code is prefetching random data. Signed-off-by: Zoltan Kiss diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index 3c6d8c5..ccd93c7 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -284,13 +284,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, __m128i zero, staterr, sterr_tmp1, sterr_tmp2; __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */ - if (split_packet) { - rte_prefetch0(&rx_pkts[pos]->cacheline1); - rte_prefetch0(&rx_pkts[pos + 1]->cacheline1); - rte_prefetch0(&rx_pkts[pos + 2]->cacheline1); - rte_prefetch0(&rx_pkts[pos + 3]->cacheline1); - } - /* B.1 load 1 mbuf point */ mbp1 = _mm_loadu_si128((__m128i *)&sw_ring[pos]); @@ -312,6 +305,13 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); + if (split_packet) { + rte_prefetch0(&rx_pkts[pos]->cacheline1); + rte_prefetch0(&rx_pkts[pos + 1]->cacheline1); + rte_prefetch0(&rx_pkts[pos + 2]->cacheline1); + rte_prefetch0(&rx_pkts[pos + 3]->cacheline1); + } + /* A* mask out 0~3 bits RSS type */ descs[3] = _mm_and_si128(descs0[3], desc_mask); descs[2] = _mm_and_si128(descs0[2], desc_mask);