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

Message ID 20190913153112.19852-1-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/octeontx2: fix CQE ring prefetch on wrap around case |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance success Performance Testing PASS

Commit Message

Jerin Jacob Kollanukkaran Sept. 13, 2019, 3:31 p.m. UTC
  From: Kommula Shiva Shankar <kshankar@marvell.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/octeontx2/otx2_rx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob Oct. 4, 2019, 12:24 p.m. UTC | #1
On Fri, Sep 13, 2019 at 9:01 PM <jerinj@marvell.com> wrote:
>
> From: Kommula Shiva Shankar <kshankar@marvell.com>
>
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>

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



> ---
>  drivers/net/octeontx2/otx2_rx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/octeontx2/otx2_rx.c b/drivers/net/octeontx2/otx2_rx.c
> index 701efc858..48565db03 100644
> --- a/drivers/net/octeontx2/otx2_rx.c
> +++ b/drivers/net/octeontx2/otx2_rx.c
> @@ -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
>
  

Patch

diff --git a/drivers/net/octeontx2/otx2_rx.c b/drivers/net/octeontx2/otx2_rx.c
index 701efc858..48565db03 100644
--- a/drivers/net/octeontx2/otx2_rx.c
+++ b/drivers/net/octeontx2/otx2_rx.c
@@ -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);