From patchwork Fri Sep 13 15:31:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 59237 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A58F28FD; Fri, 13 Sep 2019 17:31:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 4E2BE2AB; Fri, 13 Sep 2019 17:31:08 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8DFTxOd025531; Fri, 13 Sep 2019 08:31:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=SxTUvlCuysLxLfi6kFC13W6u6s7C98cxVdDbqN578SQ=; b=fd0OMcmX//4tqlF+Z/0rhUl5L28LcKpsccWWR6+TIgxpox/hKZuEMdHcj9LEQAdmsXuS 4c9D2ns1LUoFbCTK+VatNdiQ4tRA/le8zOYx9RHlW+DKdLQX+ajoMmMjGwFxlBHGWDxj aF5ELRhlcJdiVfCp0cCyvYj2HkPw+fOIR2JrvQLGMi4lXnjLUEZVckJSJ7xNqiH2EPzn wl0brCWy3m8u/Rhyy8qyyRuO3AZsYplz3lwmJyp0ebnSNA3XHmbpXBvySWomyX3qYBuB fBU3H6Rlnu57WSlUiKkbJAyVto23VNOOCWk1OscPjVCu8fl9EiO0QUXdwUJivHWe327G cw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2uytdh4eqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 13 Sep 2019 08:31:07 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 13 Sep 2019 08:31:06 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 13 Sep 2019 08:31:06 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 24A303F7043; Fri, 13 Sep 2019 08:31:03 -0700 (PDT) From: To: , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: Kommula Shiva Shankar , Date: Fri, 13 Sep 2019 21:01:12 +0530 Message-ID: <20190913153112.19852-1-jerinj@marvell.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-13_07:2019-09-11,2019-09-13 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: fix CQE ring prefetch on wrap around case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kommula Shiva Shankar 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 Acked-by: Jerin Jacob --- 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);