From patchwork Tue Feb 2 18:25:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danielle Ratson X-Patchwork-Id: 12062599 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.1 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 14060C433E0 for ; Tue, 2 Feb 2021 18:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCE2764F68 for ; Tue, 2 Feb 2021 18:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238684AbhBBS2n (ORCPT ); Tue, 2 Feb 2021 13:28:43 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:11004 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238590AbhBBS01 (ORCPT ); Tue, 2 Feb 2021 13:26:27 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 02 Feb 2021 10:25:33 -0800 Received: from dev-r-vrt-156.mtr.labs.mlnx (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 2 Feb 2021 18:25:31 +0000 From: Danielle Ratson To: CC: , , , , , Danielle Ratson Subject: [PATCH ethtool v2 2/5] netlink: settings: Add netlink support for lanes parameter Date: Tue, 2 Feb 2021 20:25:10 +0200 Message-ID: <20210202182513.325864-3-danieller@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210202182513.325864-1-danieller@nvidia.com> References: <20210202182513.325864-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 HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612290333; bh=4yo+lPM3qtXm6SBubwf13EIprAXPgGk4BZQNGBP+YUM=; 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=HUBOCAbf4twbTxx/De35kuJ+tYh120gpgr3+ZajVaRQedr37CCRPgPEvzJyYnSAt1 TaEwEg/mJ3bLFvrc5b4V3dDl+oOFSsQVQnxOECkCgvA0sbNqxewyBnb2fdBeJIMsMn X7/9LpsGzUJ0pFD/k1t9LT0QVCnPi1qo1sdlFiuAE5q0qoOAlHXMOtUzdLF4kF8jVm WYfsWr8ogJhBTktJqhkZUqWE3VUOPQWI70fzetnVYBWhhqRNNeraUsmHm8DrNJ11Pg CaEUv8qYRFlqGj/6rSo+itj0bIa2QE21nHqd0gBUDevgHGb5jN2tp9gvs/ssjjkjnT 290XmJSV0Dvpg== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Add support for "ethtool -s lanes N ..." for setting a specific number of lanes. Signed-off-by: Danielle Ratson Reviewed-by: Jiri Pirko --- ethtool.c | 1 + netlink/settings.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ethtool.c b/ethtool.c index 585aafa..fcb09f7 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/settings.c b/netlink/settings.c index 90c28b1..6cb5d5b 100644 --- a/netlink/settings.c +++ b/netlink/settings.c @@ -20,6 +20,7 @@ struct link_mode_info { enum link_mode_class class; u32 speed; + u32 lanes; u8 duplex; }; @@ -1067,6 +1068,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,