From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E576442DEF; Fri, 7 Jul 2023 02:18:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DD0D406B5; Fri, 7 Jul 2023 02:18:05 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B9BA840685 for ; Fri, 7 Jul 2023 02:18:03 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id CB3FD20AECAD; Thu, 6 Jul 2023 17:18:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CB3FD20AECAD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1688689082; bh=d+yoOfhBTrZb5CXUlMUPZg2xsEKCdWJwGCcm+i4Bouw=; h=From:To:Cc:Subject:Date:From; b=JcPJCDkskWigm5UKlytWHbBseZgzvVVO9qAjAJ21HYByud1nfqG5qKCCABAuRTdeg qCQRTGHJQy6qnZCZ2Ez73Kv5uudmNd2X2jbh85Zh96KleuzhzguGNt7ThvR+0lLPIb KSRnfEkfuuT6Hr3jf4+U2hIAhdH2OzMMbpZWEX60= From: longli@linuxonhyperv.com To: Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Ajay Sharma , Long Li Subject: [PATCH] net/mana: fix wrong indexing on CQE error when coalescing is used Date: Thu, 6 Jul 2023 17:17:57 -0700 Message-Id: <1688689077-5557-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Li On a fatal CQE error when coalescing is used, update the correct index and allow proceeding to the next CQE. Fixes: 3409e0f172f6 ("net/mana: implement Rx CQE coalescing") Signed-off-by: Long Li --- drivers/net/mana/rx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c index cacfd9ae1b..220b372b15 100644 --- a/drivers/net/mana/rx.c +++ b/drivers/net/mana/rx.c @@ -416,23 +416,21 @@ mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) switch (oob->cqe_hdr.cqe_type) { case CQE_RX_OKAY: + case CQE_RX_COALESCED_4: /* Proceed to process mbuf */ break; case CQE_RX_TRUNCATED: - DP_LOG(DEBUG, "Drop a truncated packet"); + default: + DP_LOG(ERR, "RX CQE type %d client %d vendor %d", + oob->cqe_hdr.cqe_type, oob->cqe_hdr.client_type, + oob->cqe_hdr.vendor_err); + rxq->stats.errors++; rte_pktmbuf_free(mbuf); - goto drop; - - case CQE_RX_COALESCED_4: - /* Proceed to process mbuf */ - break; - default: - DP_LOG(ERR, "Unknown RX CQE type %d", - oob->cqe_hdr.cqe_type); - continue; + i++; + goto drop; } DP_LOG(DEBUG, "mana_rx_comp_oob type %d rxq %p", -- 2.34.1