From patchwork Wed Jan 6 13:10:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danielle Ratson X-Patchwork-Id: 358021 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=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, 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 7FD57C433E0 for ; Wed, 6 Jan 2021 13:12:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4998A23100 for ; Wed, 6 Jan 2021 13:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726919AbhAFNLp (ORCPT ); Wed, 6 Jan 2021 08:11:45 -0500 Received: from mail-am6eur05on2048.outbound.protection.outlook.com ([40.107.22.48]:48736 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726884AbhAFNLm (ORCPT ); Wed, 6 Jan 2021 08:11:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vt3ZmF59XlkNsYZ9taYc75vLt0LuEBYRHPHtdKb3Fyk19ujFy42ZqRmkPYlef4lcP4aby2M5dOorGafnovDqNXWCCj/gO4mi/zF59nqhzDvSEpN4LbBTrnX7v2LaDdacXjBoGzziPgYjyr9+YjKjtddVb6EnjK3/fbUtdx1kHMXwTo4ImIDVeelADfk7iZYn7W5GQCSL1+04edo9M/rpwJYULrIpA63jvAVXpnEC2nB1vuq87p+wHUF+thP6vGaYptK8ZRWDk/bWy10V74k43n9CUv+hVxLHzQldCbwnBJ4KOMjthGrx+9wXunsqOjmB1x3V+a8vLnTF7fflYNFgYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R8mp9zlcJSBBOZIgKzvbZxmMVKS1zaSvOR1lh/ptF+A=; b=HCVpD6WZXg0ZNBeAd5X5QgDtULZdexLixzVfI3cdHZDlwpIgejm009VXMV2swtUU7Tp651ySPErC0VR3OITnMB7rMpu0OLskirZzVwiINteAFY5SQRrvvkuXoG5Qo1UROPR4gCLqaTbS7rqtKThUvMX0XvPSH158G0jcfrPiTbYvvJgQGVuBXu5cuJ0J9NIeP15vwJHCoLdtYaCEt1vUEgvjjBUecBW3hgzspCZIPd3B3oUnD/1XTqasBWYqCfNx1/ZdsZR2fjvwRrZylsgGIRW0qmcXhikesBGvDE/kakRTnA5GnrgYexXOZrqjYnbTDzBs33sB0CGhPB7U0Is7fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R8mp9zlcJSBBOZIgKzvbZxmMVKS1zaSvOR1lh/ptF+A=; b=KvVQRKXl/CZUPJrEkM2xcgjeG/br0+8LaQRb87mkjVKJo8UuO50gheGgcsz9yTAVW0OasMM5MiuCwKqMYtjKvzqhKdve87XNcttPU9/cgzu+9eO/dheZBJ7ctrAPVMO9S6obQg818iEZnaIyeUTPyDN0/jJTW+0+bczV6kHpZOc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB5010.eurprd05.prod.outlook.com (2603:10a6:208:cd::23) by AM0PR05MB6418.eurprd05.prod.outlook.com (2603:10a6:208:13e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Wed, 6 Jan 2021 13:10:23 +0000 Received: from AM0PR05MB5010.eurprd05.prod.outlook.com ([fe80::f463:9a6:abe8:afec]) by AM0PR05MB5010.eurprd05.prod.outlook.com ([fe80::f463:9a6:abe8:afec%5]) with mapi id 15.20.3742.006; Wed, 6 Jan 2021 13:10:23 +0000 From: Danielle Ratson To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, f.fainelli@gmail.com, kuba@kernel.org, andrew@lunn.ch, mlxsw@nvidia.com, Danielle Ratson Subject: [PATCH ethtool 1/5] ethtool: Extend ethtool link modes settings uAPI with lanes Date: Wed, 6 Jan 2021 15:10:02 +0200 Message-Id: <20210106131006.2110613-2-danieller@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210106131006.2110613-1-danieller@mellanox.com> References: <20210106131006.2110613-1-danieller@mellanox.com> X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR06CA0138.eurprd06.prod.outlook.com (2603:10a6:803:a0::31) To AM0PR05MB5010.eurprd05.prod.outlook.com (2603:10a6:208:cd::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dev-r-vrt-156.mtr.labs.mlnx (37.142.13.130) by VI1PR06CA0138.eurprd06.prod.outlook.com (2603:10a6:803:a0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Wed, 6 Jan 2021 13:10:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8b05839c-517a-4160-c854-08d8b2446d34 X-MS-TrafficTypeDiagnostic: AM0PR05MB6418: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:549; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mgBd1KrjPpMYsbfbJa363vT7jutDxKPOkpbEHY3+25LhfSDZ/p/WkqFnVUoXq+iQB0FQfmnZJZdKwCdDfoZfRMTY0jbOJsCICmchg+uAqpELfURTJY1JDSPtj6iIpzSraZrRn0Oez0Zq6jWSU0YsVVjPR3MA5Ck76w6gKRhRXAnxeLocTYWSZgpX7JM2swErJPVn0ggIUYmd8hSU2Hpl29Rjn4SXh/6HGLwdSbHKIIB4Z2d+ls/Cf5525Q48LxNXeq2FwrgvKCUE4IQINVqmNsfJLfarRPwdt8iY1t2iRHCAXYRXbjo6XZhNh5Az+6+Pu2zkbH37h6y1ybX5lfi5GFabCi9ZgZ0M1uY51cA2VLSCUVOOMhYVY2TZd05SHOHxSuYsi1QQ6V8lgv1B30W2ug== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB5010.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(366004)(26005)(8936002)(16526019)(186003)(107886003)(6486002)(6512007)(316002)(6916009)(5660300002)(6666004)(4326008)(2906002)(6506007)(956004)(2616005)(86362001)(1076003)(8676002)(66946007)(478600001)(66556008)(66476007)(36756003)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kAQgVe0aMkyhh7DX+fdtSH6cPrFJN6OHyDIzFHSfQBYp4ga+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ossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2021 13:10:23.2091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-Network-Message-Id: 8b05839c-517a-4160-c854-08d8b2446d34 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xeEROej8L/fR3eNDTI5o/HbPysrNA04HQbL2GWm6B0zI6Z/2EnnOioRRLfx5/6eKnADNixpwz3xYqf6uVLpYWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6418 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add ETHTOOL_A_LINKMODES_LANES, expand ethtool_link_settings with lanes attribute and define valid lanes in order to support a new lanes-selector. Signed-off-by: Danielle Ratson Reviewed-by: Jiri Pirko --- netlink/desc-ethtool.c | 1 + uapi/linux/ethtool.h | 8 ++++++++ uapi/linux/ethtool_netlink.h | 1 + 3 files changed, 10 insertions(+) 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/uapi/linux/ethtool.h b/uapi/linux/ethtool.h index 052689b..85ec9c8 100644 --- a/uapi/linux/ethtool.h +++ b/uapi/linux/ethtool.h @@ -1736,6 +1736,14 @@ static __inline__ int ethtool_validate_speed(__u32 speed) return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN; } +/* Lanes, 1, 2, 4 or 8. */ +#define ETHTOOL_LANES_1 1 +#define ETHTOOL_LANES_2 2 +#define ETHTOOL_LANES_4 4 +#define ETHTOOL_LANES_8 8 + +#define ETHTOOL_LANES_UNKNOWN 0 + /* Duplex, half or full. */ #define DUPLEX_HALF 0x00 #define DUPLEX_FULL 0x01 diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h index c022883..0cd6906 100644 --- a/uapi/linux/ethtool_netlink.h +++ b/uapi/linux/ethtool_netlink.h @@ -227,6 +227,7 @@ enum { ETHTOOL_A_LINKMODES_DUPLEX, /* u8 */ ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */ ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */ + ETHTOOL_A_LINKMODES_LANES, /* u32 */ /* add new constants above here */ __ETHTOOL_A_LINKMODES_CNT,