From patchwork Wed Aug 28 15:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13781563 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 E0813C5B54A for ; Wed, 28 Aug 2024 15:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=HP9gBOgloyHUCtotR6aa5DRFGN171osS+fbsGuOzKLg=; b=DhkX14MKHcIea5jb/GReZgLbaN O7FA2ZiYQ7tjj2GgSPdCaW0X7Wmc8Hne4NXVbR+Fpo8gSnj+ujSCX+W4DXo0uhQ4Q9LPEWy54x7pS GSclLhJQAA7MbK+ytSah9IO2GEwJKwPmi46i/cHwN9D2yUCJu/epcbpekDALEUJSDGELtlaO5GA/w 2SKgydXxDuGWOW0bgHiI61Zbxmt7yhOabFi/gjSTtLOh8+HRErClVzZybtYirvMKkoaK481Y0c5vI Pb14m2kslwixb5+0FAKuD/TyilJ3ovrU9lu2odKgaCyUZJqW1kc4bEHDm0x9/j+fjLtv7YN1pn4E0 4Pi+VZWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjKqA-0000000G2dJ-0BEy; Wed, 28 Aug 2024 15:44:10 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjKXy-0000000FxZK-06Ht for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 15:25:24 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 02C75FF809; Wed, 28 Aug 2024 15:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1724858717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HP9gBOgloyHUCtotR6aa5DRFGN171osS+fbsGuOzKLg=; b=MKV1fib3Xd5628A0RZUR0cH3FcIpw+sUM8zfFfj8YGVh1GRnZ5Ddapz4iH73DVIYdrBRw1 4VkabVC6l4xaGuY5oZloH3Vw7sfP44gV+/pa2b4wVEVUd5g0NGrBZ8/9NZ8orFvl4k7c1a O+5CG9i9xnV9ZBNoe/tnUG44Gz/oFBMQ3Ho77teu4ivEKzlGmaCQ5qVkCT4x/umowAtCTj dp11+ECeTrMLajVkAWSpSK+zfbBUKFkMb7wm4zxx8mAEwUyAHxtkdiPmPEZsqv1P7LmRhK 0D5NgngE0U0AASRxs8kTrBQVP/VyZ7Lob181HMjmcwgdaq32Q6p/MRQMe6QLyw== From: Maxime Chevallier To: davem@davemloft.net, Michal Kubecek Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?utf-8?q?K=C3=B6ry_Maincent?= , Jonathan Corbet , =?utf-8?q?Marek_Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2_Veronese?= , Simon Horman Subject: [PATCH ethtool-next v2 0/3] Introduce PHY listing and targeting Date: Wed, 28 Aug 2024 17:25:07 +0200 Message-ID: <20240828152511.194453-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.45.2 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-20240828_082522_347981_2578F2BC X-CRM114-Status: GOOD ( 14.75 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, This series adds the ethtool-side support to list PHYs associated to a netdevice, as well as allowing to target PHYs for some commands : - PSE-PD commands - Cable testing commands - PLCA commands This V2 uses the uAPI that got applied on the associated kernel-side series [1], cleans a few lose-ends from the first version, and adds the manpage modifications that was missing from V1. The PHY-targetting commands look like this: ethtool --phy 1 --cable-test eth0 Note that the --phy parameter gets passed at the beginning of the command-line. This allows getting a generic command-line parsing code, easy to write, but at the expense of maybe being a bit counter intuitive. Another option could be to add a "phy" parameter to all the supported commands, let me know if you think this looks too bad. Patch 1 deals with the ability to pass a PHY index to the relevant commands. Patch 2 implements the --show-phys command. This command uses a netlink DUMP request to list the PHYs, and introduces the ability to perform filtered DUMP request, where the netdev index gets passed in the DUMP request header. Thanks, Maxime [1]: https://lore.kernel.org/netdev/20240821151009.1681151-1-maxime.chevallier@bootlin.com/ Link to V1: https://lore.kernel.org/netdev/20240103142950.235888-1-maxime.chevallier@bootlin.com/ Maxime Chevallier (3): update UAPI header copies ethtool: Allow passing a PHY index for phy-targetting commands ethtool: Introduce a command to list PHYs Makefile.am | 1 + ethtool.8.in | 56 +++++++++++++++++ ethtool.c | 30 ++++++++- internal.h | 1 + netlink/cable_test.c | 4 +- netlink/extapi.h | 1 + netlink/msgbuff.c | 52 ++++++++++++---- netlink/msgbuff.h | 3 + netlink/nlsock.c | 38 ++++++++++++ netlink/nlsock.h | 2 + netlink/phy.c | 116 +++++++++++++++++++++++++++++++++++ netlink/plca.c | 4 +- netlink/pse-pd.c | 4 +- uapi/linux/ethtool.h | 16 +++++ uapi/linux/ethtool_netlink.h | 25 ++++++++ 15 files changed, 334 insertions(+), 19 deletions(-) create mode 100644 netlink/phy.c