From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by dpdk.org (Postfix) with ESMTP id 97E448E6F for ; Fri, 25 Sep 2015 19:45:21 +0200 (CEST) Received: by padhy16 with SMTP id hy16so111762887pad.1 for ; Fri, 25 Sep 2015 10:45:21 -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:in-reply-to; bh=1zy1khH3s2YW/ITpgL3Sy4BXkUXen1rsCp64BfQDd6I=; b=YB8o50aEjildhRlHiEN/T4exeULdxgj+s/QiZta+UF+fbTwBG1vsdK0ors+DGyjvhU AK38AusTC0w30zxbezgddh+/trLa6o6TjiUDmaghY/8hh1Q6DY3T/ognJXjEbZ7ju5an hn8eB2SaSC23UG09WAuBaJyLtD086+12t61BVZsC6mEPzE+mwQSw5i7Tfwy8AlZ6+tm1 QI9IpfZvbDKinqYu3V810bflIQOJvJ8T+3ZwnV23mlXLSGzgt11tYeltkAegkwG5nufk XQYn/r4+U7S4hdeZMeDVHOcMZqLawh8GqYEVgabFIHsdRUONe30yqdnE0eHmSdAkBrvr 9tAw== X-Gm-Message-State: ALoCoQmcdRnAwzvDoUQElBWeVlbUXAHchaDjXwAfhY83N94KnAz/939OM17WvkynS2hC3dUMAvGn X-Received: by 10.67.30.232 with SMTP id kh8mr8889620pad.36.1443203120864; Fri, 25 Sep 2015 10:45:20 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id pu5sm4994642pbc.58.2015.09.25.10.45.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Sep 2015 10:45:20 -0700 (PDT) From: Zoltan Kiss To: dev@dpdk.org Date: Fri, 25 Sep 2015 10:44:51 -0700 Message-Id: <1443203091-22306-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443140606-18241-1-git-send-email-zoltan.kiss@linaro.org> Subject: [dpdk-dev] [PATCH v2] 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 17:45:21 -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 --- v2: fixing tabs 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);