Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2102626rdb; Mon, 20 Nov 2023 01:52:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEPgtTJ8vFDqOPdAY6IEAYymzmx9c8m1HTtxGdBTEbXvxQftMNQ0wqzRHdtTzMhLUqbmCe X-Received: by 2002:a05:6a20:5b23:b0:187:5a4d:7061 with SMTP id kl35-20020a056a205b2300b001875a4d7061mr6339614pzb.44.1700473935918; Mon, 20 Nov 2023 01:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700473935; cv=none; d=google.com; s=arc-20160816; b=thNlILqNAnQ5PbBUBJ9PURX6oCKjAJxBtEhSOk3T0TLjkXS8eiMeHW4f+vdzZBll9Q 81zTCwhfBMpK9nBHddo9Dq1cEM/KQHMy4uafoDbgFdF69eaIo1vwOboWJ7zj2BfrT6MJ +PtKCk0VhvAmauFvy59FfS9WSaCLJDor4MJ+Up+IdLD2uWseFxF4iq8WPJCQWSyV++1s 5jR4SLLuaoWmdnoG4XkRN9M+6B9iBNgl6nVbVNIigs6CeP7qQzJvKPKAXH1OLO82tuLy kRqtsx+eZeP8kYuFrzSKaMu7q++Q8EeDYqLHGpm30XKfn58jSxfOHxjr6dr7P2ixyNpy 5vxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8AiFzIrf7euPcBMjHvs7wplZ5KGWYZb5jRstHUODG/g=; fh=h9/yg3HyE0biNxTDmXG7RU4GKIRIx0OADAMsIoi8sE8=; b=I0uFHjMfX2vrpmPZdsvt5BWhY0eM7hmK2bZlWZZMNTfoCfwPRJMwiI0iPyaysNTMS2 UYxVRIuF5piYjZWIVJANgcaEvBHMS7GsJGsuFGDtaJvQKOJ1oVFMjLNOBQ7AgnkawBVk uSI90SEacbE4WBzHj/V0zHrLaqYu18FL93cYO/tqvlw1G4jhS6LPL5l6q+Zs5dX8KQrJ 54E+LqmUv7SL1VczCrEw/mWmxxmhvq2Bk+FmOjCpXcROAKnB1fi9420al43oOQUAjXfN JMz9fbZKWIIP5SqXbUY/7/i/P6pzNQejfYCe6pGYd2HBZsuTGLZIcejPCWgNsOYiEI0n BDCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=evn177yY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id d14-20020a056a00198e00b00690d25b1991si7922693pfl.41.2023.11.20.01.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 01:52:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=evn177yY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 38FC3804C6F5; Mon, 20 Nov 2023 01:52:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232495AbjKTJvz (ORCPT + 99 others); Mon, 20 Nov 2023 04:51:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbjKTJvx (ORCPT ); Mon, 20 Nov 2023 04:51:53 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFA638F for ; Mon, 20 Nov 2023 01:51:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCEC5C433C8; Mon, 20 Nov 2023 09:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700473909; bh=TV25DohQMrEGWPZRjX0RacFKMm4hRFAcqopvFP8hYwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=evn177yYwwW/a5I8QrF7Psp+mK6S0rqPvr2rd6lE/6InVnMuxg89YKyCaF5ZvDT0q OxUA2K2zBcrbVbGRqHk0C7XVjYfNty8q1TL1/6Kt5pMJG0CAKkCaOKQjcZ4OM057Mv Q3ybusUxms5RpNLJ6J7F/7GNUZkoKcWBRObnv7ke6Sm3yvjMp6+nbNe4MlGfivFaAJ gTJvP/F35uIgnCXBRW83XHAb7OI01kJHMfFmvB4Mo2pjdy5f2SRj+jZffENbwF7pCO 8gPCLKBWHS7tl4NNwFte3j7TUyD833np5aB0BFto8NUtBKPcfNyI/8/3i9NadEd6K8 48IMeKHj0VaKA== Date: Mon, 20 Nov 2023 10:51:45 +0100 From: Lorenzo Bianconi To: =?utf-8?B?6buE5p2w?= Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Toshiaki Makita , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [External] Re: [PATCH net] veth: fix ethtool statistical errors Message-ID: References: <20231116114150.48639-1-huangjie.albert@bytedance.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VZMxcV+xIR+W6tFj" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 01:52:13 -0800 (PST) --VZMxcV+xIR+W6tFj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Lorenzo Bianconi =E4=BA=8E2023=E5=B9=B411=E6=9C=8817= =E6=97=A5=E5=91=A8=E4=BA=94 17:26=E5=86=99=E9=81=93=EF=BC=9A > > > > > if peer->real_num_rx_queues > 1, the ethtool -s command for > > > veth network device will display some error statistical values. > > > The value of tx_idx is reset with each iteration, so even if > > > peer->real_num_rx_queues is greater than 1, the value of tx_idx > > > will remain constant. This results in incorrect statistical values. > > > To fix this issue, assign the value of pp_idx to tx_idx. > > > > > > Fixes: 5fe6e56776ba ("veth: rely on peer veth_rq for ndo_xdp_xmit acc= ounting") > > > Signed-off-by: Albert Huang > > > --- > > > drivers/net/veth.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/veth.c b/drivers/net/veth.c > > > index 0deefd1573cf..3a8e3fc5eeb5 100644 > > > --- a/drivers/net/veth.c > > > +++ b/drivers/net/veth.c > > > @@ -225,7 +225,7 @@ static void veth_get_ethtool_stats(struct net_dev= ice *dev, > > > for (i =3D 0; i < peer->real_num_rx_queues; i++) { > > > const struct veth_rq_stats *rq_stats =3D &rcv_priv->rq[= i].stats; > > > const void *base =3D (void *)&rq_stats->vs; > > > - unsigned int start, tx_idx =3D idx; > > > + unsigned int start, tx_idx =3D pp_idx; > > > size_t offset; > > > > > > tx_idx +=3D (i % dev->real_num_tx_queues) * VETH_TQ_STA= TS_LEN; > > > -- > > > 2.20.1 > > > > > > > Hi Albert, > > > > Can you please provide more details about the issue you are facing? > > In particular, what is the number of configured tx and rx queues for bo= th > > peers? >=20 > Hi, Lorenzo > I found this because I wanted to add more echo information in ethttool=EF= =BC=88for veth, > but I found that the information was incorrect. That's why I paid > attention here. ack. Could you please share the veth pair tx/rx queue configuration? Rergards, Lorenzo >=20 > > tx_idx is the index of the current (local) tx queue and it must restart= from > > idx in each iteration otherwise we will have an issue when > > peer->real_num_rx_queues is greater than dev->real_num_tx_queues. > > > OK. I don't know if this is a known issue. >=20 > BR > Albert >=20 >=20 > > Regards, > > Lorenzo --VZMxcV+xIR+W6tFj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZVssMQAKCRA6cBh0uS2t rOdWAPsG9iBF4iqCk1hj4Vo7HUDtpFulSUqaXmU6X6jFvBuxAAD7BTR4ocKKXDqC MJMd9CBLhHzJGZg0xMaedYS/Ie7spwg= =msjy -----END PGP SIGNATURE----- --VZMxcV+xIR+W6tFj--