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 CFEB146364 for ; Fri, 7 Mar 2025 13:48:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C854040E30; Fri, 7 Mar 2025 13:48:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A87DC40E30 for ; Fri, 7 Mar 2025 13:48:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741351687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qKSDBYsNk5xzeHMZwYQqgVzP1ZhiLP5Vaz5FFXxB8+0=; b=QmRjKddE8vXQjwjupZcfmei7/dIWAwjzyk89VAVv0FLjRd9RAK52i7+jT0WuCTagmEPR45 hF+UGc+1q1O/RW4SD6g1ww4iHMi6mYQVsMMaKNMi+kO5A4k511K4F/y7boblAnvG7Rf22R CYrZoyp4oVZe8GsfAYjB8sQGDy7v9/o= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-SzQr9KWaPaWHlKIrhiPh3g-1; Fri, 07 Mar 2025 07:48:04 -0500 X-MC-Unique: SzQr9KWaPaWHlKIrhiPh3g-1 X-Mimecast-MFC-AGG-ID: SzQr9KWaPaWHlKIrhiPh3g_1741351683 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72F2F180035C; Fri, 7 Mar 2025 12:48:03 +0000 (UTC) Received: from rh.Home (unknown [10.45.226.25]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 489411956095; Fri, 7 Mar 2025 12:48:01 +0000 (UTC) From: Kevin Traynor To: Long Wu Cc: dpdk stable Subject: patch 'net/nfp: fix representor port statistics' has been queued to stable release 24.11.2 Date: Fri, 7 Mar 2025 12:46:47 +0000 Message-ID: <20250307124726.475001-14-ktraynor@redhat.com> In-Reply-To: <20250307124726.475001-1-ktraynor@redhat.com> References: <20250307124726.475001-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: K4yEaKBp7udOyiJfSBHjmEun1cszmENqyWEq0SI4F0k_1741351683 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/12/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/0b3b586e7535b9c2635dca1a65d60d158a41a039 Thanks. Kevin --- >From 0b3b586e7535b9c2635dca1a65d60d158a41a039 Mon Sep 17 00:00:00 2001 From: Long Wu Date: Tue, 25 Feb 2025 09:34:54 +0800 Subject: [PATCH] net/nfp: fix representor port statistics [ upstream commit 87a5cc7c3e829b8a14fe9cb6db7feb0161c10861 ] The 'ipackets'/'opackets' are used to record the number of packets on representor port received/sent. But the code does not consider concurrent calculation of 'ipackets'/'opackets'. If multiple queues are calculated 'ipackets'/'opackets' simultaneously, it will result in incorrect results. The previous logic has recorded the number of packets on each queue, therefore driver only needs to add the data of all queues to obtain the data of the representor port. Based on this, modify code to fix the issue. Fixes: 636e133ec891 ("net/nfp: update Tx and Rx for multiple PF") Fixes: 82a2c286f35a ("net/nfp: support xstats for flower firmware") Signed-off-by: Long Wu --- drivers/net/nfp/flower/nfp_flower.c | 2 -- .../net/nfp/flower/nfp_flower_representor.c | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index f087d0dfdc..804ad494d5 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -239,5 +239,4 @@ nfp_flower_multiple_pf_recv_pkts(void *rx_queue, data_len += rx_pkts[i]->data_len; - repr->repr_stats.ipackets += recv; repr->repr_stats.q_ipackets[rxq->qidx] += recv; repr->repr_stats.q_ibytes[rxq->qidx] += data_len; @@ -278,5 +277,4 @@ nfp_flower_multiple_pf_xmit_pkts(void *tx_queue, data_len += tx_pkts[i]->data_len; - repr->repr_stats.opackets += sent; repr->repr_stats.q_opackets[txq->qidx] += sent; repr->repr_stats.q_obytes[txq->qidx] += data_len; diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 9601aa5f96..e377d45e53 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -316,7 +316,23 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev, struct rte_eth_stats *stats) { + uint16_t i; struct nfp_flower_representor *repr; repr = ethdev->data->dev_private; + + repr->repr_stats.ipackets = 0; + repr->repr_stats.ibytes = 0; + for (i = 0; i < ethdev->data->nb_rx_queues; i++) { + repr->repr_stats.ipackets += repr->repr_stats.q_ipackets[i]; + repr->repr_stats.ibytes += repr->repr_stats.q_ibytes[i]; + } + + repr->repr_stats.opackets = 0; + repr->repr_stats.obytes = 0; + for (i = 0; i < ethdev->data->nb_tx_queues; i++) { + repr->repr_stats.opackets += repr->repr_stats.q_opackets[i]; + repr->repr_stats.obytes += repr->repr_stats.q_obytes[i]; + } + rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats)); @@ -386,5 +402,4 @@ nfp_flower_repr_rx_burst(void *rx_queue, data_len += rx_pkts[i]->data_len; - repr->repr_stats.ipackets += total_dequeue; repr->repr_stats.q_ipackets[rxq->qidx] += total_dequeue; repr->repr_stats.q_ibytes[rxq->qidx] += data_len; @@ -435,5 +450,4 @@ nfp_flower_repr_tx_burst(void *tx_queue, data_len += tx_pkts[i]->data_len; - repr->repr_stats.opackets += sent; repr->repr_stats.q_opackets[txq->qidx] += sent; repr->repr_stats.q_obytes[txq->qidx] += data_len; -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-03-07 11:02:57.425951706 +0000 +++ 0014-net-nfp-fix-representor-port-statistics.patch 2025-03-07 11:02:56.853335626 +0000 @@ -1 +1 @@ -From 87a5cc7c3e829b8a14fe9cb6db7feb0161c10861 Mon Sep 17 00:00:00 2001 +From 0b3b586e7535b9c2635dca1a65d60d158a41a039 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 87a5cc7c3e829b8a14fe9cb6db7feb0161c10861 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org