From patchwork Tue Aug 24 13:05:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 502175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EAA6C4338F for ; Tue, 24 Aug 2021 13:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD6C061184 for ; Tue, 24 Aug 2021 13:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237414AbhHXNGV (ORCPT ); Tue, 24 Aug 2021 09:06:21 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:58407 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237158AbhHXNGT (ORCPT ); Tue, 24 Aug 2021 09:06:19 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id E6FB9580B1E; Tue, 24 Aug 2021 09:05:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 24 Aug 2021 09:05:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=4ZTXSdqmI6SNWgKRs jS3QaMxl9cnr+43pp92411Vl9Q=; b=rbjQIkdbnqCo4NuiBgcIHzSB+0XiUKEmA p27FnIQKDyZtw7Q89BKPH4KvxqSl50jA8xdw3hB/qvxZHrIdikU6UPjp02XEkPZr 26VNOvdOpTnXeCR1I3lzILitgOw1Yd32loUhwJX3ruazbpwJOuni8nHKn0xeleRu DQZfjWNjbDhDe5+nntoks3+pNW5pZ6Hw2MRVHXH8HZsY3uNtBREJPBeM6jl1tDYX OjgMgkgUcL8m6wVLibYVvz7WS6v42EAHZvb8tBLH+/Skl91n+6NharzNgrUr3GvC RLTpDkbRL6Rdz9BkYUltngRR2ZnE0ZNTynPKJJ+Z9u240laKDap5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtjedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiughoshgt hhdrohhrgheqnecuggftrfgrthhtvghrnhepteevgefhvefggfffkeeuffeuvdfhueehhe etffeikeegheevfedvgeelvdffudfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Aug 2021 09:05:30 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch, mkubecek@suse.cz, pali@kernel.org, jacob.e.keller@intel.com, jiri@nvidia.com, vadimp@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [RFC PATCH ethtool-next v3 0/6] ethtool: Add ability to control transceiver modules' power mode Date: Tue, 24 Aug 2021 16:05:09 +0300 Message-Id: <20210824130515.1828270-1-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel Patch #1 updates the UAPI headers. Patch #2 adds the actual implementation that allows user space to control transceiver modules' power mode. See the commit message for example output. Patches #3-#5 parse more fields from SFF-8636 and CMIS EEPROMs to provide better observability regarding the power mode of the modules. Patch #6 adds support for two new extended link states in order to allow user space to troubleshoot link down issues related to transceiver modules. See the commit message for example output. Ido Schimmel (6): Update UAPI header copies ethtool: Add ability to control transceiver modules' power mode ethtool: Print CMIS Module State ethtool: Print CMIS Module-Level Controls ethtool: Print SFF-8636 Power set and Power override bits ethtool: Add transceiver module extended states Makefile.am | 2 +- cmis.c | 87 +++++++++++++++++ cmis.h | 20 ++++ ethtool.8.in | 25 +++++ ethtool.c | 11 +++ netlink/desc-ethtool.c | 11 +++ netlink/extapi.h | 4 + netlink/module.c | 179 ++++++++++++++++++++++++++++++++++ netlink/monitor.c | 4 + netlink/netlink.h | 1 + netlink/settings.c | 12 +++ qsfp.c | 6 ++ qsfp.h | 2 +- shell-completion/bash/ethtool | 23 +++++ uapi/linux/ethtool.h | 36 ++++++- uapi/linux/ethtool_netlink.h | 34 ++++++- uapi/linux/if_link.h | 21 ++++ uapi/linux/net_tstamp.h | 17 +++- uapi/linux/netlink.h | 5 +- 19 files changed, 491 insertions(+), 9 deletions(-) create mode 100644 netlink/module.c