Skip to content

Commit

Permalink
net/bnxt: remove useless prefetches
Browse files Browse the repository at this point in the history
[ upstream commit 1ef8c62 ]

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: 2eb53b1 ("net/bnxt: add initial Rx code")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
shemminger authored and bluca committed Nov 16, 2020
1 parent a382ea6 commit 59e5c31
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/bnxt/bnxt_rxr.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,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);
}
Expand Down Expand Up @@ -475,8 +474,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;
Expand Down Expand Up @@ -625,7 +622,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))
Expand Down

0 comments on commit 59e5c31

Please sign in to comment.