From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zoltan Kiss Subject: ixgbe: prefetch packet headers in vector PMD receive function Date: Tue, 1 Sep 2015 20:17:16 +0100 Message-ID: <1441135036-7491-1-git-send-email-zoltan.kiss@linaro.org> To: dev@dpdk.org Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id 6BE34E72 for ; Tue, 1 Sep 2015 21:17:33 +0200 (CEST) Received: by wicge5 with SMTP id ge5so17733703wic.0 for ; Tue, 01 Sep 2015 12:17:33 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The lack of this prefetch causes a significant performance drop in OVS-DPDK: 13.3 Mpps instead of 14 when forwarding 64 byte packets. Even though OVS prefetches the next packet's header before it starts processing the current one, it doesn't get there fast enough. This aligns with the behaviour of other receive functions. Signed-off-by: Zoltan Kiss --- diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index cf25a53..51299fa 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -502,6 +502,15 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, _mm_storeu_si128((void *)&rx_pkts[pos]->rx_descriptor_fields1, pkt_mb1); + rte_packet_prefetch((char*)(rx_pkts[pos]->buf_addr) + + RTE_PKTMBUF_HEADROOM); + rte_packet_prefetch((char*)(rx_pkts[pos + 1]->buf_addr) + + RTE_PKTMBUF_HEADROOM); + rte_packet_prefetch((char*)(rx_pkts[pos + 2]->buf_addr) + + RTE_PKTMBUF_HEADROOM); + rte_packet_prefetch((char*)(rx_pkts[pos + 3]->buf_addr) + + RTE_PKTMBUF_HEADROOM); + /* C.4 calc avaialbe number of desc */ var = __builtin_popcountll(_mm_cvtsi128_si64(staterr)); nb_pkts_recd += var;