Skip to contentSkip to conversation

net/octeontx2: fix CQE ring prefetch on wrap around case

PATCH Applied [email protected] 2 participants 2 messages Sep 13, 2019 – Oct 4, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/octeontx2: fix CQE ring prefetch on wrap around case

From: Kommula Shiva Shankar <[email protected]>

When computing the head of CQE ring of prefetch, use qmask to point to the correct head index on wrap around case.

Fixes cc4d7693f2d9 ("net/octeontx2: support Rx")
---
 drivers/net/octeontx2/otx2_rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/octeontx2/otx2_rx.c +2 -1
index 701efc858..48565db03 100644
@@ -61,7 +61,8 @@ nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 	while (packets < nb_pkts) {
 		/* Prefetch N desc ahead */
-		rte_prefetch_non_temporal((void *)(desc + (CQE_SZ(head + 2))));
+		rte_prefetch_non_temporal((void *)(desc +
+					(CQE_SZ((head + 2) & qmask))));
 		cq = (struct nix_cqe_hdr_s *)(desc + CQE_SZ(head));
 
 		mbuf = nix_get_mbuf_from_cqe(cq, data_off);
Signature · 1 line
2.23.0
Applied
#1 lore raw
Quoted 11 lines · On Fri, Sep 13, 2019 at 9:01 PM <[email protected]> wrote:

From: Kommula Shiva Shankar <[email protected]>

When computing the head of CQE ring of prefetch, use qmask to point to the correct head index on wrap around case.

Fixes cc4d7693f2d9 ("net/octeontx2: support Rx")

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 21 lines
---
 drivers/net/octeontx2/otx2_rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/octeontx2/otx2_rx.c +2 -2
index 701efc858..48565db03 100644
@@ -61,7 +61,8 @@ nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
        while (packets < nb_pkts) {
                /* Prefetch N desc ahead */
-               rte_prefetch_non_temporal((void *)(desc + (CQE_SZ(head + 2))));
+               rte_prefetch_non_temporal((void *)(desc +
+                                       (CQE_SZ((head + 2) & qmask))));
                cq = (struct nix_cqe_hdr_s *)(desc + CQE_SZ(head));
 
                mbuf = nix_get_mbuf_from_cqe(cq, data_off);
--

2.23.0