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 0D0FE46211 for ; Thu, 13 Feb 2025 11:00:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFCB440287; Thu, 13 Feb 2025 11:00:22 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 8DDB040287 for ; Thu, 13 Feb 2025 11:00:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739440820; 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=V6z12yBwaCcw14/oBY//zg9DQFR/CHamiR4f/I9sRRk=; b=TGM9YJZedIyCmasCby5T08oShVH9LJyMZcbJzDcbZXxzmrYdpQMjNfyTfsiNE8cQGoRCb1 PpJcIUNxChR0OK9z3j3lHrfEweo7MAFrZAi2nU0nNHAgyzazQPY6hSr0kI9kTNtBwmq/Dy OuWf1+G+iOj8YtgMgRrrpqhSBTwRBKU= 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-178-dueGNYReNOGqWxgfjgaZqw-1; Thu, 13 Feb 2025 05:00:17 -0500 X-MC-Unique: dueGNYReNOGqWxgfjgaZqw-1 X-Mimecast-MFC-AGG-ID: dueGNYReNOGqWxgfjgaZqw_1739440816 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 7A01C18009B5; Thu, 13 Feb 2025 10:00:16 +0000 (UTC) Received: from rh.Home (unknown [10.45.224.21]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A6E831800570; Thu, 13 Feb 2025 10:00:14 +0000 (UTC) From: Kevin Traynor To: Stephen Hemminger Cc: Huisong Li , dpdk stable Subject: patch 'test/bonding: fix active backup receive test' has been queued to stable release 24.11.2 Date: Thu, 13 Feb 2025 09:57:40 +0000 Message-ID: <20250213095933.362078-13-ktraynor@redhat.com> In-Reply-To: <20250213095933.362078-1-ktraynor@redhat.com> References: <20250213095933.362078-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: bu9RgEnAn8KnIJaBYDKWd1Lfiag3B-_QUHCqFD3azDQ_1739440816 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 02/17/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/8ed4c26a454c42d24c0dcb27d8d7983f5237432a Thanks. Kevin --- >From 8ed4c26a454c42d24c0dcb27d8d7983f5237432a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 13 Dec 2024 09:17:14 -0800 Subject: [PATCH] test/bonding: fix active backup receive test [ upstream commit eb29e625ce41b50898efc8e2618b7eeb128460ed ] The test had incorrect assumptions about how active backup should work. When in active backup mode, the secondary (not primary) ports should be ignored. The test was always broken since initially written but earlier bug was masking the part of the test which tested non-primary ports. Bugzilla ID: 1589 Fixes: 112ce3917674 ("test/bonding: fix loop on members") Signed-off-by: Stephen Hemminger Acked-by: Huisong Li Tested-by: Huisong Li --- app/test/test_link_bonding.c | 69 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index b752a5ecbf..19b064771a 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -2247,47 +2247,46 @@ test_activebackup_rx_burst(void) &gen_pkt_burst[0], burst_size); + /* Expect burst if this was the active port, zero otherwise */ + unsigned int rx_expect + = (test_params->member_port_ids[i] == primary_port) ? burst_size : 0; + /* Call rx burst on bonding device */ - TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonding_port_id, 0, - &rx_pkt_burst[0], MAX_PKT_BURST), burst_size, - "rte_eth_rx_burst failed"); + unsigned int rx_count = rte_eth_rx_burst(test_params->bonding_port_id, 0, + &rx_pkt_burst[0], MAX_PKT_BURST); + TEST_ASSERT_EQUAL(rx_count, rx_expect, + "rte_eth_rx_burst (%u) not as expected (%u)", + rx_count, rx_expect); - if (test_params->member_port_ids[i] == primary_port) { - /* Verify bonding device rx count */ - rte_eth_stats_get(test_params->bonding_port_id, &port_stats); - TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); + TEST_ASSERT_EQUAL(port_stats.ipackets, rx_expect, + "Bonding Port (%d) ipackets value (%u) not as expected (%u)", test_params->bonding_port_id, - (unsigned int)port_stats.ipackets, burst_size); + (unsigned int)port_stats.ipackets, rx_expect); - /* Verify bonding member devices rx count */ - for (j = 0; j < test_params->bonding_member_count; j++) { - rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); - if (i == j) { - TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Member Port (%d) ipackets value (%u) not as " - "expected (%d)", - test_params->member_port_ids[i], - (unsigned int)port_stats.ipackets, - burst_size); - } else { - TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Member Port (%d) ipackets value (%u) not as " - "expected (%d)\n", - test_params->member_port_ids[i], - (unsigned int)port_stats.ipackets, 0); - } - } - } else { - for (j = 0; j < test_params->bonding_member_count; j++) { - rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); + for (j = 0; j < test_params->bonding_member_count; j++) { + rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); + if (i == j) { + TEST_ASSERT_EQUAL(port_stats.ipackets, rx_expect, + "Member Port (%d) ipackets (%u) not as expected (%d)", + test_params->member_port_ids[i], + (unsigned int)port_stats.ipackets, rx_expect); + + /* reset member device stats */ + rte_eth_stats_reset(test_params->member_port_ids[j]); + } else { TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Member Port (%d) ipackets value (%u) not as expected " - "(%d)", test_params->member_port_ids[i], - (unsigned int)port_stats.ipackets, 0); + "Member Port (%d) ipackets (%u) not as expected (%d)", + test_params->member_port_ids[i], + (unsigned int)port_stats.ipackets, 0); } } - /* free mbufs */ - rte_pktmbuf_free_bulk(rx_pkt_burst, burst_size); + /* extract packets queued to inactive member */ + if (rx_count == 0) + rx_count = rte_eth_rx_burst(test_params->member_port_ids[i], 0, + rx_pkt_burst, MAX_PKT_BURST); + if (rx_count > 0) + rte_pktmbuf_free_bulk(rx_pkt_burst, rx_count); /* reset bonding device stats */ -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-12 17:29:35.994134793 +0000 +++ 0013-test-bonding-fix-active-backup-receive-test.patch 2025-02-12 17:29:34.166944832 +0000 @@ -1 +1 @@ -From eb29e625ce41b50898efc8e2618b7eeb128460ed Mon Sep 17 00:00:00 2001 +From 8ed4c26a454c42d24c0dcb27d8d7983f5237432a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit eb29e625ce41b50898efc8e2618b7eeb128460ed ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org