From patchwork Wed Feb 10 13:48:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danielle Ratson X-Patchwork-Id: 12080883 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz 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=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 8BF7FC433DB for ; Wed, 10 Feb 2021 13:50:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53B4664E77 for ; Wed, 10 Feb 2021 13:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbhBJNuV (ORCPT ); Wed, 10 Feb 2021 08:50:21 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:15462 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhBJNuB (ORCPT ); Wed, 10 Feb 2021 08:50:01 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 10 Feb 2021 05:49:20 -0800 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 10 Feb 2021 13:49:19 +0000 Received: from dev-r-vrt-156.mtr.labs.mlnx (172.20.145.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 10 Feb 2021 13:49:17 +0000 From: Danielle Ratson To: CC: , , , , , Danielle Ratson Subject: [PATCH ethtool v3 2/5] netlink: settings: Add netlink support for lanes parameter Date: Wed, 10 Feb 2021 15:48:37 +0200 Message-ID: <20210210134840.2187696-3-danieller@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210210134840.2187696-1-danieller@nvidia.com> References: <20210210134840.2187696-1-danieller@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612964960; bh=o3097n6D5EINUTBOgkzGiaYjcMwEHJdZnEKSiAyDcMM=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=cQqm7JX94aPXmuuDLkXhbkvf5yvkIx8v4J0hrW1bXlKUDAJL9UrijMyFp7DPGtKZz zoDNaSctubVAVaXQrgnTvwh6+FSOi1KwoZI9alW6xW5nK5IMZm1yWJMRUCCEBGyut8 UTrsYcTugGx4DRvSoaj7IB6YPm0nC592zSoqcktT5U2lpNdEPtDgYWLKUeBkTogLPC Z+Gi2/zeZ7ZRA+sokwhbB9cGW27pkndZO0bUzXCICRh6bLIFYs1D/RZSVB2RB4vkN7 KbSYeok8wfOpuC12LLMAju0oEyTfOUOJuhZcLJ0hkdbgJI8mdub9+sYPJryBlFNc2E 9jfjr/PigONng== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Danielle Ratson Add support for "ethtool -s lanes N ..." for setting a specific number of lanes. Signed-off-by: Danielle Ratson --- Notes: v3: * Remove a leftover. * After adding a seperated patch for uapi headers, squash rest of the first patch. ethtool.c | 1 + netlink/desc-ethtool.c | 1 + netlink/settings.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/ethtool.c b/ethtool.c index fb90e9e..a8339c8 100644 --- a/ethtool.c +++ b/ethtool.c @@ -5620,6 +5620,7 @@ static const struct option args[] = { .nlfunc = nl_sset, .help = "Change generic options", .xhelp = " [ speed %d ]\n" + " [ lanes %d ]\n" " [ duplex half|full ]\n" " [ port tp|aui|bnc|mii|fibre|da ]\n" " [ mdix auto|on|off ]\n" diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c index 96291b9..fe5d7ba 100644 --- a/netlink/desc-ethtool.c +++ b/netlink/desc-ethtool.c @@ -87,6 +87,7 @@ static const struct pretty_nla_desc __linkmodes_desc[] = { NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_DUPLEX), NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG), NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE), + NLATTR_DESC_U32(ETHTOOL_A_LINKMODES_LANES), }; static const struct pretty_nla_desc __linkstate_desc[] = { diff --git a/netlink/settings.c b/netlink/settings.c index 90c28b1..c54fe56 100644 --- a/netlink/settings.c +++ b/netlink/settings.c @@ -1067,6 +1067,13 @@ static const struct param_parser sset_params[] = { .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "lanes", + .group = ETHTOOL_MSG_LINKMODES_SET, + .type = ETHTOOL_A_LINKMODES_LANES, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, { .arg = "duplex", .group = ETHTOOL_MSG_LINKMODES_SET,