net/bnxt: remove useless prefetches
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 4 Nov 2020 17:03:10 +0000 (09:03 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 15:26:53 +0000 (16:26 +0100)
Prefetching only helps performance if it is done several 100
instructions before the actual use. The purpose of the prefetch
is to read ahead, it doesn't help if the next instruction
will block.

The code in the bnxt driver was doing these unnecessary prefetches.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_rxr.c

index e375b31..fdbe6f7 100644 (file)
@@ -306,7 +306,6 @@ static inline struct rte_mbuf *bnxt_tpa_end(
        mbuf = tpa_info->mbuf;
        RTE_ASSERT(mbuf != NULL);
 
-       rte_prefetch0(mbuf);
        if (agg_bufs) {
                bnxt_rx_pages(rxq, mbuf, raw_cp_cons, agg_bufs, tpa_info);
        }
@@ -734,8 +733,6 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
        if (mbuf == NULL)
                return -EBUSY;
 
-       rte_prefetch0(mbuf);
-
        mbuf->data_off = RTE_PKTMBUF_HEADROOM;
        mbuf->nb_segs = 1;
        mbuf->next = NULL;
@@ -867,7 +864,6 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
        /* Handle RX burst request */
        while (1) {
                cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
-               rte_prefetch0(&cpr->cp_desc_ring[cons]);
                rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
 
                if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct))