From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id EFD3391B3 for ; Fri, 30 Oct 2015 20:00:29 +0100 (CET) Received: by wicll6 with SMTP id ll6so16644970wic.0 for ; Fri, 30 Oct 2015 12:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=VhH72qRgJKbyHskOi1ayGWFWcpNPp5YxVP2y9lxwbCg=; b=JPBsr2ZPn/k57hRcyc0YVJyCzIoCRHAwH1jnfNzIS00RiRcl1ZekzEunEpRYzHtGc/ Kf+7jQzoPZGaXX+v/YIPvQ46WzSr6HIoUu+8sPg57Epy+91IfvqNNraPo6a0smF0+KIo JwHyLAj+4mTOYxvmrW/kXn4sHt0XXc529PLNuhTPwtQhoWAVzMJguzKPTUYv7+B+jOeB j/RCvfYq4OpffBOZ+HDPBrQ0FQEdc+S5O0TKPsmZ6mz5j9uyPsajruKJ58DQh2BXn9nl YxDJ7tqjXflGS3ubRi43989P+LcmN8mu8OmbDy/5OGzd2WnXh2hDt1g6dQLLemV2lSy5 4A5g== 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=VhH72qRgJKbyHskOi1ayGWFWcpNPp5YxVP2y9lxwbCg=; b=AoM5UFiB3si/cuSxRYwaP9iCB8fw43gzn4ni8umLuhkEB8I4x/3EBOJz92Sbxoh+cK W+Jur3tPYQcPAl1r4ucKpZZW+zTdOqZbyIYlVmx5bofmjvxGPLF5bcKUMclqGXGy4HaL iJOQTTrTumntDTZ8fVlCUthIt+9K7P87J0A7sSnY69Ito31ihhMwjABZw1P2XyRaDX8s jR5Fy9PycqIPWHS4D6eJDsm1qPndql29Fh8kxsbyc8PO4Da3rtyAKUQjT1+viZ+SM7et IMGKXec/08LULwdBJLHKRT3xJnCKuUWuLGCVDOgjvh/61EUVhgRFcJoAimNxbZh3oEmJ ZONw== X-Gm-Message-State: ALoCoQmTt9EBjiVEZL/j/Lt0ZjG8DKZPc1yLt2VgV98Nj/nMEKFZooZII4b3y5p4Hg1+OqEjzfki X-Received: by 10.194.58.142 with SMTP id r14mr12074921wjq.37.1446231629864; Fri, 30 Oct 2015 12:00:29 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id v9sm8363754wjv.45.2015.10.30.12.00.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 30 Oct 2015 12:00:29 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 30 Oct 2015 20:00:07 +0100 Message-Id: <1446231609-8463-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 Subject: [dpdk-dev] [PATCH 1/3] mlx4: improve RX performance with better prefetching 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, 30 Oct 2015 19:00:30 -0000 From: Nelio Laranjeiro Prefetching initial bytes of mbuf structures earlier and in two cache lines instead of one improves performance of mlx4_rx_burst(), which accesses the mbuf->next field not present in the first 128 bytes. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx4/mlx4.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index cb08ee8..4cf2f7d 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -2824,6 +2824,12 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) assert(wr->num_sge == 1); assert(elts_head < rxq->elts_n); assert(rxq->elts_head < rxq->elts_n); + /* + * Fetch initial bytes of packet descriptor into a + * cacheline while allocating rep. + */ + rte_prefetch0(seg); + rte_prefetch0(&seg->cacheline1); ret = rxq->if_cq->poll_length_flags(rxq->cq, NULL, NULL, &flags); if (unlikely(ret < 0)) { @@ -2861,11 +2867,6 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) if (ret == 0) break; len = ret; - /* - * Fetch initial bytes of packet descriptor into a - * cacheline while allocating rep. - */ - rte_prefetch0(seg); rep = __rte_mbuf_raw_alloc(rxq->mp); if (unlikely(rep == NULL)) { /* -- 2.1.0