From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B77BEC46CD2 for ; Wed, 24 Jan 2024 13:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gO1eI+ivR0lgKQApUd/XZCC5v2N4SdOKdVGzHdQ6uTM=; b=yxCiOeICqDbcqx j4uFV68mZz3M64P0QvKb6kWYYJHJYRhqHSUyF7ctVFs8r8537ZIMKf7yBq45uvtvsVZ0HRH5Jh0rO o8qhDnox4tUj/aZRMfYePC7W9uJEprV+0ozeT4kOuXjrbQ0Ce46OAAyw6JPswpla6TWNIecSN7AHb R8AwGm4cUIi2wA7LqlIaF9Y+G/mXjwo2W5uARsYKUuNGaMU2GN9qn9W4nUUHR8aDq4Xvyp8GzoDb0 KiREwcuLJ8RQZbiLQ6IMPrDTsK6OZk/qILFMPR/zqagvQKprRhtYaAQEqZf5EQvRcZ7l0hpH98/52 YKd4VMigJKakGsTNpJfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSdeP-003X6d-0P; Wed, 24 Jan 2024 13:50:45 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSdeM-003X4J-16 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 13:50:44 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4F0F91C0003; Wed, 24 Jan 2024 13:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706104236; 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=Aj6ZQfg/DQIXs3PgkhqXH6sZRgoGEcYx3M5juw4r4UA=; b=BEXRqT/FMI6b2tciHLBA1R9XyZWtEnOWl2cS45kZukK1HrYvVzy2FJ/dx8HjzXtGXyviVm mdMuItxi5TjLPLloMGqUV4Kif3QcnfsTbt/mXf+uvMoJ8lWW2y6s0HYUKAX9ixB7oRgxiS KAJ9cCI+cHZi+myA2AdFsgB8ldZZVQR+gPKhrLqFBn8iXV2gt9gNdLQ97u+Kc180/FexiN FSq95iZ9m+CGZ8PFOhpIVe5SRtIQ0IhlhserDqm+TnAGcLvvBiPJonqOro4TuROqyVWT5U XVBtHDxzbWKQkX4PdGRtMu6EqTXAQ62sNc7r5EKqZPRz25NyPaXzE1TVf5utHQ== Date: Wed, 24 Jan 2024 14:50:33 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: Jakub Kicinski , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Jonathan Corbet , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman Subject: Re: [PATCH net-next v5 07/13] net: ethtool: Introduce a command to list PHYs on an interface Message-ID: <20240124145033.1c711fd1@device-28.home> In-Reply-To: <2c955f94-7c95-4f66-b739-f0967ec9c171@lunn.ch> References: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> <20231221180047.1924733-8-maxime.chevallier@bootlin.com> <20240104153401.08ff9809@kernel.org> <20240105104311.03a35622@device-28.home> <2c955f94-7c95-4f66-b739-f0967ec9c171@lunn.ch> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.39; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_055042_825236_571FB1B7 X-CRM114-Status: GOOD ( 23.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Andrew, On Fri, 5 Jan 2024 14:17:10 +0100 Andrew Lunn wrote: > > > > +int ethnl_phy_dumpit(struct sk_buff *skb, struct netlink_callback *cb) > > > > +{ > > > > + struct ethnl_phy_dump_ctx *ctx = (void *)cb->ctx; > > > > + struct net *net = sock_net(skb->sk); > > > > + unsigned long ifindex = 1; > > > > > > This doesn't look right, if dump gets full you gotta pick up > > > when previous call left off. > > > > I wasn't aware that this was the expected DUMP behaviour. So I should > > keep track of the last dev and last phy_index dumped in the dump_ctx I > > guess ? I'm not sure how I'm going to test this though, I only have > > devices with at most 2 PHYs :( > > At a guess.... > > You are supposed to dump until you are out of space in the buffer. You > then return what you have, and expect another call so you can continue > with the rest. > > Rather than fill the buffer, just hack the code to only put in a > single PHY, and then return with the same condition of a full > buffer. Hopefully you should get a second call, and you can then test > your logic for picking up from where you left off. > > Another option might be to add PHY support to netdevsim. Add a debugfs > interface to allow you to create arbitrary PHY topologies? You can > then even add a test script. Sorry for the delayed answer, I just took a few hours to give it a try, and I was able to spin some very basic PHY support for the netdevsim, allowing to attach arbitrary instances of fixed_phy devices. I can therefore use that as a mean of testing the dump operation, I'll try to include that in the next iteration, that should pave the way for some testability of more PHY stuff hopefully. Thanks for the suggestion, Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel