Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp64856rdh; Mon, 18 Dec 2023 04:39:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsQG/8iE9XUqfoe1ohVoSnAOwDCYEh7PCPxvaOpVH0sCs+J8g4pelYro5YJWEPYu3JfY/T X-Received: by 2002:a05:600c:b43:b0:40b:5e21:bdb5 with SMTP id k3-20020a05600c0b4300b0040b5e21bdb5mr8155876wmr.68.1702903161262; Mon, 18 Dec 2023 04:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702903161; cv=none; d=google.com; s=arc-20160816; b=xlw/BAa1pKorrEyNIZbHoXYm/7freu43ZbhIhTU71+djez+sR656ILvqlGrbLl6lEZ 3ZdxKBKqI3x381Ec/7G30pfqIjPnnn09PBHSunBa1J6Wkpk7UT5+YO7J85u2AJVhPMYd lp4rcH3vYQbhtyLzT2F7g+xzwE88x+yqXsjTnCaI95hDgfdUlXqTR/lh3O2vUtwKUdJZ sP6x8jMSURlt2Hcml9f1GkjwWudCW+j988JJ3ZDq4xMkm6qsFgTaSfcVk/wqfQC00ulv /4pvTveZv9qThanuthcjM8yQyrIb0E0JBrsx0W7pbgQEnTXGg/rnLejI+4WopZMabYxO cbiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=NfySNMDBM9Vi7BAUjQrq9kzTF/gpFPVRERkx1cxNO/Q=; fh=2qaMYwjkNmmwBZ0T/WnvqemXaHrBKbi8pUra1tTj36g=; b=NZz1E9qB1xL5F7w6GhFLrU91Y2/Rdy5NdYrQOfp8hN/2hVEIJNULwvRfs8iUTKOB8q LFTkPBgIHBV31phpz2aUxl4jfzg+WR3iO65yImQjEPw43DOqlWNm5nnjGOZljGiJNcwy vopr9DQRTv/OU2aCViRCIgvoXK0YlBKC9oN+0X5WotQRgcIsXysse4vKT/uh6kc3XEz0 QAdpJ6pDR2/fSyR63teTLj3ETeDnm4Dl+O7CZHmMH/NwGTMAPbeoru2zFgRrEfW2p4W5 ifMeFDr8D50tJfkJ7OnH/MGjx3BGFNk0ovfKMW1jGU+QHz7hX1vBhVuJJ7UYFW8QqPB1 QSww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HjTamBvt; spf=pass (google.com: domain of linux-kernel+bounces-3576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z2-20020a1709063ac200b00a22fb471e43si4933387ejd.88.2023.12.18.04.39.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 04:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HjTamBvt; spf=pass (google.com: domain of linux-kernel+bounces-3576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CB80F1F22AE8 for ; Mon, 18 Dec 2023 12:39:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 278EC7E572; Mon, 18 Dec 2023 12:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HjTamBvt" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 50C243A262; Mon, 18 Dec 2023 12:39:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A5B0C433C8; Mon, 18 Dec 2023 12:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702903149; bh=VI1TrtlceuEBz2etHmTIzW5gF+DnQL9zxLaBcO6AK8o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HjTamBvtbaoB+TEYe7ZAb2sCf8F8tlzBS3MiEBWx/ftoN3KkP5xS8696avO9+L6SB iOW+r1aWk8GAHPIW0FqE57qdtLfesRg1FPXi8LLmnPGECLer7jxJmvM+F8/MYsW2nA oChSp70N5TrxwXIAJ1PLCMy6vCABcND1uk8MZuq8PTuGfuNo5/FnanpIgh1J700qil j5KlfS6OL39/fM8m631TOPI18ST8MNsDPzAp9f+rYgrj4NcEkhLnao8hR5cnJEnUSN lb7xN+gxShV5DgDmosDUPNv3B0J5eoqO5LhknfU54Z0YtUzhCj8Ookt57e3IlVpK4+ jHJm9LE+3XPeQ== Message-ID: Date: Mon, 18 Dec 2023 14:39:03 +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 v9 02/10] selftests: forwarding: ethtool_mm: fall back to aggregate if device does not report pMAC stats Content-Language: en-US To: Vladimir Oltean Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20231215132048.43727-1-rogerq@kernel.org> <20231215132048.43727-3-rogerq@kernel.org> <20231215172710.v6gtreijeqzocmv4@skbuf> From: Roger Quadros In-Reply-To: <20231215172710.v6gtreijeqzocmv4@skbuf> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15/12/2023 19:27, Vladimir Oltean wrote: > On Fri, Dec 15, 2023 at 03:20:40PM +0200, Roger Quadros wrote: >> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh >> index 8f6ca458af9a..763c262a3453 100755 >> --- a/tools/testing/selftests/net/forwarding/lib.sh >> +++ b/tools/testing/selftests/net/forwarding/lib.sh >> @@ -146,6 +146,15 @@ check_ethtool_mm_support() >> fi >> } >> >> +check_ethtool_pmac_std_stats_support() >> +{ >> + local dev=$1; shift >> + local grp=$1; shift >> + >> + [ 0 -ne $(ethtool --json -S $dev --all-groups --src pmac 2>/dev/null \ >> + | jq '.[]."$grp" | length') ] > > This is broken. $grp inside single quotes will search for the plain-text > "$grp" string, not for the $grp bash variable. Use ".[].\"$grp\" | length". > Thanks for catching this. Will fix in next spin. > $ ./ethtool_mm.sh eno0 swp0 > eno0 does not report pMAC statistics, falling back to aggregate > swp0 does not report pMAC statistics, falling back to aggregate > $ ethtool -S swp0 --all-groups --src pmac > Standard stats for swp0: > eth-phy-SymbolErrorDuringCarrier: 0 > eth-mac-FramesTransmittedOK: 90017 > eth-mac-FramesReceivedOK: 90033 > eth-mac-FrameCheckSequenceErrors: 0 > eth-mac-AlignmentErrors: 0 > eth-mac-OctetsTransmittedOK: 9181138 > eth-mac-OctetsReceivedOK: 9182112 > eth-mac-MulticastFramesXmittedOK: 17 > eth-mac-BroadcastFramesXmittedOK: 90000 > eth-mac-MulticastFramesReceivedOK: 33 > eth-mac-BroadcastFramesReceivedOK: 90000 > eth-mac-FrameTooLongErrors: 0 > eth-ctrl-MACControlFramesReceived: 0 > rmon-etherStatsUndersizePkts: 0 > rmon-etherStatsOversizePkts: 0 > rmon-etherStatsFragments: 0 > rmon-etherStatsJabbers: 0 > rx-rmon-etherStatsPkts64to64Octets: 33 > rx-rmon-etherStatsPkts65to127Octets: 90000 > rx-rmon-etherStatsPkts128to255Octets: 0 > rx-rmon-etherStatsPkts256to511Octets: 0 > rx-rmon-etherStatsPkts512to1023Octets: 0 > rx-rmon-etherStatsPkts1024to1526Octets: 0 > rx-rmon-etherStatsPkts1527to65535Octets: 0 > tx-rmon-etherStatsPkts64to64Octets: 12 > tx-rmon-etherStatsPkts65to127Octets: 90005 > tx-rmon-etherStatsPkts128to255Octets: 0 > tx-rmon-etherStatsPkts256to511Octets: 0 > tx-rmon-etherStatsPkts512to1023Octets: 0 > tx-rmon-etherStatsPkts1024to1526Octets: 0 > tx-rmon-etherStatsPkts1527to65535Octets: 0 > >> +} >> + >> check_locked_port_support() >> { >> if ! bridge -d link show | grep -q " locked"; then >> -- >> 2.34.1 >> -- cheers, -roger