From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5424F3BFE33 for ; Mon, 13 Apr 2026 13:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776085520; cv=none; b=sD+/R2/ToEf+M15Ou7O4oul04ikQ9WQzWyTdT3D0wB8Xa0ljWsJVOQnDE6IC3UeZFDcRqivHwSmB2iBopM+yq/HtHFmWDFMb7Bkp+WIuvKrLx3NciH84NnOyQsKu08xzpCyjgHf6s85sTmOAVG7oFc70gKFbA1/apeks8JCD1R8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776085520; c=relaxed/simple; bh=8G0n+5N46kyHlC6zW0UIk+1mROJfOmueHkVVdUErsrc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Bfg3q0ijkB2E3Fq2D/pJxQ1R3+aIHcp+3SMkoEzkBm8aqbFHNXioJp4GRCP47GH3dEZyv/ItJs7feywgiMh7wBbvZiChLUeoUDWA4mJzfr8H4/3Yy5wi9KZ7xfDRwDgz3Hgr8NFRLXt5koMaObp+Xjw/56lwVpBq2CbKZPBWSL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KdpyMM7G; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=T+S7GKpT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KdpyMM7G"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="T+S7GKpT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776085518; 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=zd81MzorX7tMHzshw5o/gcRBDu2OrmNaB6rEAdDyIBo=; b=KdpyMM7G2qXnyqEQLZcqDVEZzhiCGkaju5oUR1EYCJbjJ+H3JAyzDHKgUrJ1NDXmpiZGp/ 6LaXP4adSE+/Ac35hIDcrjlSsMobPsoCY25P3vQggiiq+j/X3iTtfuxL8W7h/U8/EiTCvQ Kus36Tws6pNVh6XYciyaUhP16nqoYow= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-1fk8cbzjN9OkiHWdrXnXTg-1; Mon, 13 Apr 2026 09:05:15 -0400 X-MC-Unique: 1fk8cbzjN9OkiHWdrXnXTg-1 X-Mimecast-MFC-AGG-ID: 1fk8cbzjN9OkiHWdrXnXTg_1776085514 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-488d6ebe9cfso24813025e9.2 for ; Mon, 13 Apr 2026 06:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776085514; x=1776690314; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zd81MzorX7tMHzshw5o/gcRBDu2OrmNaB6rEAdDyIBo=; b=T+S7GKpTBSaPLqw3NI2UL77h0V9ySQMduOJ7cvh1wgdDesLkBAA2LrwtMK9DaWSkJX 2kgdfZn2ZuHqzRpZ/yIdx60bRhvfwbPPAgOhtK8yseErIVvn+VSEyLnA+N+pIBOXmFwN rdnuHZV2Diuj/znPfGKXuNIP9fsjDkv8M7uO/afXVbN3SQbO4sM8LgbbRb5uup/vOYIs Od/Mi4kd6HwQMFrglPs8WuIRqRy7dEi6uacIdvYoV/Pk5S2a0FIaJAYhNEmcQflwyJCQ AeZNlM+eAA0EvRxnY5d74VoaFDBYBPdoaQzdddPz0eVUeDaqChh4yXxFUbqM+SN2Y/k2 aXgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776085514; x=1776690314; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zd81MzorX7tMHzshw5o/gcRBDu2OrmNaB6rEAdDyIBo=; b=deEjsijSfSg0/TyAcyIHC+dT5M/fJ79plot0ZCmF240d16aM3lH/i5ehe/1V+5DdZi axnLeeCK60Ke6XEWYaFHsKkSkwjCidsjvr4SafBDYbuRDTjaXxb+c1AVAnqtwKSisdz0 M2GE9hEfJPV+rX0TBC3v0IX+2Mqd7a8mwJrtBs5C2du8PrRLCcbmwSl+b8ULqy6PkE+J IEoZc0vaZUaEi8YvBAP4XZV8HnFnnteguiIKk2DJtxSbqgK9aKXZSD5ea1r2MfdkRgLP 4yTs4Rgn6nN98galQIw55V4Mw+J82h9QNvhOzDSBoZy1yYp9SQgTU9ei/pk5TaVOTFyt sO6Q== X-Forwarded-Encrypted: i=1; AFNElJ/gKdAmG/SHb1eELyVxRw6zQXCJKUqTVMvYHxms7QbJUoGfJlrDBJe4m6jSyYVsJ5byr9xaR1ESCG2XBms=@vger.kernel.org X-Gm-Message-State: AOJu0Yyit0GI74IhyP1d1wSXM/lku+aqTHqr5gbj7dTco7msdM6GE48T 6jm6lLKimoRwDmueZy1v66WSWaYw0pDAjqQlOK4YHd5K/JwZPt3dVZSjuuSdilC9nRsNGSMh2yF iZqgyjiYcPA1Zm8DoB7tKn3TAwyeWpTOJi5q2axstW5Odv0vMZ3cPnCpeHYP3rrEeCg== X-Gm-Gg: AeBDiet2OMX7EKq1JRX7f+7PrQymcKbSI61OoDly8LEYkX6Yx/0UmdKFkK/+MijTfwD 8DfPUnGkP+LXnxVSCrMpUWc4NiS+5nDxDZnfe2pCHH1lwCyHdTeOQmNtNzVfJr76Dh1pU2jFbfc 7oAjjkoo/gu1xjsHB7E7xEjeczvVfxycjX4mjQPS04fLn0EKe6BsuMo7DwAncctVtoRz0tzJ3gM uUEyCjqetduqphTsF2Aw7yF2Y7iqbkCSOmOx+ZbQ2lnPeiblzwx85T59T0pRJ85weh2bQek6FW0 uwt1ReQ7cOo1eIWzpTkUhfTzGvBrDqlhMMWBoO3mj97vX+dJ7txDsrgM9IaYvz1y5mxwmoHr89i gDGbCgOseijx/fZCpmbPWyfU5tqbMR5vSgp2YAqkyKA01vj8CJKuefAdq X-Received: by 2002:a05:600c:681:b0:488:e192:6fbd with SMTP id 5b1f17b1804b1-488e192710cmr60961925e9.30.1776085513408; Mon, 13 Apr 2026 06:05:13 -0700 (PDT) X-Received: by 2002:a05:600c:681:b0:488:e192:6fbd with SMTP id 5b1f17b1804b1-488e192710cmr60960105e9.30.1776085512328; Mon, 13 Apr 2026 06:05:12 -0700 (PDT) Received: from [192.168.88.32] ([216.128.11.125]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488d67ce3e4sm209725325e9.5.2026.04.13.06.05.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2026 06:05:11 -0700 (PDT) Message-ID: Date: Mon, 13 Apr 2026 15:05:10 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v7 04/10] selftests: net: Add tests for failover of team-aggregated ports To: Marc Harvey , Jiri Pirko , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Shuah Khan , Simon Horman Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Kuniyuki Iwashima References: <20260409-teaming-driver-internal-v7-0-f47e7589685d@google.com> <20260409-teaming-driver-internal-v7-4-f47e7589685d@google.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20260409-teaming-driver-internal-v7-4-f47e7589685d@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/9/26 4:59 AM, Marc Harvey wrote: > There are currently no kernel tests that verify the effect of setting > the enabled team driver option. In a followup patch, there will be > changes to this option, so it will be important to make sure it still > behaves as it does now. > > The test verifies that tcp continues to work across two different team > devices in separate network namespaces, even when member links are > manually disabled. > > Signed-off-by: Marc Harvey > --- > Changes in v6: > - Use a tcp port with no associated service. > - Make tcpdump helper function not string-replace port numbers with > associated service names, even on Fedora, which has a tcpdump patch > that changes the required flag. > - Link to v5: https://lore.kernel.org/netdev/20260406-teaming-driver-internal-v5-4-e8a3f348a1c5@google.com/ > > Changes in v5: > - Use tcpdump for collecting traffic, rather than reading rx counters. > - Link to v4: https://lore.kernel.org/netdev/20260403-teaming-driver-internal-v4-4-d3032f33ca25@google.com/ > > Changes in v2: > - Fix shellcheck failures. > - Remove dependency on net forwarding lib and pipe viewer tools. > - Use iperf3 for tcp instead of netcat. > - Link to v1: https://lore.kernel.org/all/20260331053353.2504254-5-marcharvey@google.com/ > --- > tools/testing/selftests/drivers/net/team/Makefile | 2 + > tools/testing/selftests/drivers/net/team/config | 4 + > .../testing/selftests/drivers/net/team/team_lib.sh | 148 +++++++++++++++++++ > .../drivers/net/team/transmit_failover.sh | 158 +++++++++++++++++++++ > tools/testing/selftests/net/forwarding/lib.sh | 9 +- > 5 files changed, 319 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/drivers/net/team/Makefile b/tools/testing/selftests/drivers/net/team/Makefile > index 02d6f51d5a06..777da2e0429e 100644 > --- a/tools/testing/selftests/drivers/net/team/Makefile > +++ b/tools/testing/selftests/drivers/net/team/Makefile > @@ -7,9 +7,11 @@ TEST_PROGS := \ > options.sh \ > propagation.sh \ > refleak.sh \ > + transmit_failover.sh \ > # end of TEST_PROGS > > TEST_INCLUDES := \ > + team_lib.sh \ > ../bonding/lag_lib.sh \ > ../../../net/forwarding/lib.sh \ > ../../../net/in_netns.sh \ > diff --git a/tools/testing/selftests/drivers/net/team/config b/tools/testing/selftests/drivers/net/team/config > index 5d36a22ef080..8f04ae419c53 100644 > --- a/tools/testing/selftests/drivers/net/team/config > +++ b/tools/testing/selftests/drivers/net/team/config > @@ -6,4 +6,8 @@ CONFIG_NETDEVSIM=m > CONFIG_NET_IPGRE=y > CONFIG_NET_TEAM=y > CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y > +CONFIG_NET_TEAM_MODE_BROADCAST=y > CONFIG_NET_TEAM_MODE_LOADBALANCE=y > +CONFIG_NET_TEAM_MODE_RANDOM=y > +CONFIG_NET_TEAM_MODE_ROUNDROBIN=y > +CONFIG_VETH=y > diff --git a/tools/testing/selftests/drivers/net/team/team_lib.sh b/tools/testing/selftests/drivers/net/team/team_lib.sh > new file mode 100644 > index 000000000000..2057f5edee79 > --- /dev/null > +++ b/tools/testing/selftests/drivers/net/team/team_lib.sh > @@ -0,0 +1,148 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > + > +test_dir="$(dirname "$0")" > +export REQUIRE_MZ=no > +export NUM_NETIFS=0 > +# shellcheck disable=SC1091 > +source "${test_dir}/../../../net/forwarding/lib.sh" > + > +TCP_PORT="43434" > + > +# Create a team interface inside of a given network namespace with a given > +# mode, members, and IP address. > +# Arguments: > +# namespace - Network namespace to put the team interface into. > +# team - The name of the team interface to setup. > +# mode - The team mode of the interface. > +# ip_address - The IP address to assign to the team interface. > +# prefix_length - The prefix length for the IP address subnet. > +# $@ - members - The member interfaces of the aggregation. > +setup_team() > +{ > + local namespace=$1 > + local team=$2 > + local mode=$3 > + local ip_address=$4 > + local prefix_length=$5 > + shift 5 > + local members=("$@") > + > + # Prerequisite: team must have no members > + for member in "${members[@]}"; do > + ip -n "${namespace}" link set "${member}" nomaster > + done > + > + # Prerequisite: team must have no address in order to set it > + # shellcheck disable=SC2086 > + ip -n "${namespace}" addr del "${ip_address}/${prefix_length}" \ > + ${NODAD} dev "${team}" > + > + echo "Setting team in ${namespace} to mode ${mode}" > + > + if ! ip -n "${namespace}" link set "${team}" down; then > + echo "Failed to bring team device down" > + return 1 > + fi > + if ! ip netns exec "${namespace}" teamnl "${team}" setoption mode \ > + "${mode}"; then > + echo "Failed to set ${team} mode to '${mode}'" > + return 1 > + fi > + > + # Aggregate the members into teams. > + for member in "${members[@]}"; do > + ip -n "${namespace}" link set "${member}" master "${team}" > + done > + > + # Bring team devices up and give them addresses. > + if ! ip -n "${namespace}" link set "${team}" up; then > + echo "Failed to set ${team} up" > + return 1 > + fi > + > + # shellcheck disable=SC2086 > + if ! ip -n "${namespace}" addr add "${ip_address}/${prefix_length}" \ > + ${NODAD} dev "${team}"; then > + echo "Failed to give ${team} IP address in ${namespace}" > + return 1 > + fi > +} > + > +# This is global used to keep track of the sender's iperf3 process, so that it > +# can be terminated. > +declare sender_pid > + > +# Start sending and receiving TCP traffic with iperf3. > +# Globals: > +# sender_pid - The process ID of the iperf3 sender process. Used to kill it > +# later. > +start_listening_and_sending() > +{ > + ip netns exec "${NS2}" iperf3 -s -p "${TCP_PORT}" --logfile /dev/null & > + # Wait for server to become reachable before starting client. > + slowwait 5 ip netns exec "${NS1}" iperf3 -c "${NS2_IP}" -p \ > + "${TCP_PORT}" -t 1 --logfile /dev/null Note for a possible follow-up: the iperf3 server is apparently never stopped. You could used the wait_local_port_listen helper and the`--one-off` iperf3 command line argument to avoid that (or explicitly killing the server pid at cleanup time) /P