From patchwork Thu Mar 30 16:56:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Roulin X-Patchwork-Id: 13194615 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EBE2C761A6 for ; Thu, 30 Mar 2023 16:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjC3Q5G (ORCPT ); Thu, 30 Mar 2023 12:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbjC3Q5F (ORCPT ); Thu, 30 Mar 2023 12:57:05 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF82196 for ; Thu, 30 Mar 2023 09:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ns2V6FDbOSuCj7wi3GOkn8l/n794xtFKrJOpCJtA0gXmXlIjU2os7K8HP/FMy+35d7N8ng5/wayVk3BHRJiljQ/ga6izbJ0u3kCXn5WsPD1+35rkdaWMfeznEGBrh1sTDQth0bn+wm4VCXV43Y8CXsx0SNjdtUMFJGTVpNYesKh8JMWwE9G3DWBgAvNMg7skAfOxxUO4dv5IcUmCjgEjlz6M6rYQ1Ht0g77NHQ6AHn//DgdWYnIKXo8lyM6MpQN4CrnyE8+mKzWkVxXQgSGA6rFipUjiLHDr4GFVmjOKT68wCesb1WwymDioTNw2uswguskmEMYsmYOEnLfG2SUNnQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SyVH1QBmP9LLaQVgemarr8zduIzdlY2exjL2N7i0zaw=; b=M5AZeJ+QqIB+DP1zhV8Xm3fOVpZVCIvkFjI5vO+vRLhVmb4babtkoaTLYlcvt/7iKUbNdwn6Ebq9ZxZkpYL7hPmrUP9KogwY/j9J1MmN0d7axIx9/B6Wzm2+xYOvyTqUWAYyxBosfkXWyi95BXqpuZpsp5tfMD6a+tHTDe9HaBgrBbI04IjpcIyMtsIxwAvlCm1E6PDXMTXp0r/4YbvcK4C4NfEh8jLVDEEqcNCo7kTQGplBDcP2Z1sui87CUgpUcmTbTGKaBdRHQoacG1I/P9ddP8iVnfo7W+26ererNdI64kHQlHnXhO31/3pME6rJgnaHlteR+ZPtAuxbGUmitA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SyVH1QBmP9LLaQVgemarr8zduIzdlY2exjL2N7i0zaw=; b=ISh5tSUsBwVg0hkLcxJJqo4qIcy3pgjC+Ik2hm8csepMjHJgQUH70IOpzP4V0us29niax4ZzD2xkxvf0bJEcNq3i8GG6/20KcW/cfv7UaV7QJqCXkzaEjR2SiKc8RyyIIU857ztLDr3TQnNS9AN0S3Zus/PjUncrnh+IGIN2oIxVv3ErDrW6ysQ++oE8Cx1Yn8y1GXfHnDoi9NSFgEcb5mqy/jg/exQULTmvD4OSfxqgIkm+5IcJVQHFoKPpDM9ftsQz31d568nXoa0s2dev0MkR8zKQkqTgk7uaGo9n1dZw017r8zFLZz9KeIttNCUqCHtINoUO8XhgakZEKMIUyQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB3127.namprd12.prod.outlook.com (2603:10b6:a03:d8::33) by SA1PR12MB7224.namprd12.prod.outlook.com (2603:10b6:806:2bb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Thu, 30 Mar 2023 16:57:00 +0000 Received: from BYAPR12MB3127.namprd12.prod.outlook.com ([fe80::ebc5:c372:d99a:fdb5]) by BYAPR12MB3127.namprd12.prod.outlook.com ([fe80::ebc5:c372:d99a:fdb5%4]) with mapi id 15.20.6222.033; Thu, 30 Mar 2023 16:57:00 +0000 Message-ID: <6e02aaab-18fe-692d-52cb-71212db44ade@nvidia.com> Date: Thu, 30 Mar 2023 09:56:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com, andrew@lunn.ch, f.fainelli@gmail.com, mkubecek@suse.cz, mlxsw@nvidia.com, idosch@nvidia.com, Danielle Ratson From: Andy Roulin Subject: [PATCH net-next] ethtool: reset #lanes when lanes is omitted X-ClientProxiedBy: SJ0PR03CA0103.namprd03.prod.outlook.com (2603:10b6:a03:333::18) To BYAPR12MB3127.namprd12.prod.outlook.com (2603:10b6:a03:d8::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3127:EE_|SA1PR12MB7224:EE_ X-MS-Office365-Filtering-Correlation-Id: 651cadf8-c3e8-4b14-59bb-08db313fc7a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t8/1HhD81VHdynfWEwYyrlwspmbKxPxWYc89pOPW69HPmAgpKKlsZTYiJZDALyv2fT/aGsILjAA6kCSE5yOxmABjqfBaqsm6/m7DUx1l1hoLfgCRemtqpaTIm05j9qzmo9beoM43Fg+40wuBvRhlg9X+WJDlsO3hbVQaWLj08S+Cs8ulpcvV9B5XijESiqDrGb1VejwEO3lvP8itMOV4AHTalYlQyDAkuQuMnCxhn+A/QM183/rv+gdxCBDPCCoy6qkCIFOqec9lt8niNavTpOnbiyGO8JIA7HZdjDK0mCSwaJCqdd4Tdm4LQXmL93YCxm+iYcs0qLmjAa5DkzMDn2SJbqi6zb5z7uE6p0PPSPvjPfKTfmHzcEk4lVVAdoyhz06bqw/WvXzEOESYYAj/b2bt/Aknpyre8qFoFx8muHp8GqMsX2GIjlRtpBifsA7Ap9ZOcMZ8gjN6D7zjqRFrlPtgFkIxI5it/ayEyzvVZdVHtPWdVA+5cUT14fVQu90eHD4tEoFtpY/EjIKVNLDguacVyMgZNTI9+vS/0LBXkqfYJlNg8B0n0mEH3VCwqiNUpGkKAlEnkW+CbgSaRCB11nJpnICNjzdvknkuaRY5NqQc7xVLS+SFSp7vSzmnSWBndieIblmIh2WHtlhP3qKx8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3127.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(39860400002)(396003)(346002)(136003)(451199021)(26005)(8676002)(6486002)(66556008)(4326008)(66476007)(41300700001)(2906002)(66946007)(6916009)(36756003)(478600001)(31696002)(8936002)(5660300002)(38100700002)(86362001)(316002)(31686004)(2616005)(107886003)(6512007)(186003)(6506007)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?wlYK+ILLhg7w5bsV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0JlxLNN5Px1t?= =?utf-8?q?Wa6BmlZQuzTd/tfZnr7jZYeuUq9iB+wrVLmEv8EmijgexemdFXCcxIAkYV7VqABU8?= =?utf-8?q?hH63TiVsQV/lKMXpGDbGKm5Ap9emJ7g4p1jagQoEfrncWGQvnu/mRu0gcS20svM1N?= =?utf-8?q?zWbHBG4wFv2ld9UWIbtFuFD35jm/T1u8KdEROxq5RsF+Zeje5qLwFxK5umQMrNQh2?= =?utf-8?q?1IrJzpPf9dtxUmvIPqfS1a/qxjF2vYB/iz/bqRphztyBSfHBKZMo8rDMqt4PEQPc9?= =?utf-8?q?oY4D0iloE1OaopJLP+A+b+8P5AQy0qQpsE8RMbJK8IXG+j/9AFnxKjt6cw1wb3Afb?= =?utf-8?q?F5Co+BWbBGJb6RRp7tUJRWorb7kd3cLQOOG/899fr/VHCeDH6k2R3SiZVK6hNm1vk?= =?utf-8?q?hUcv4qAwqGjbrg8EiJgeikL3woUZsJgAFq1KSqu/HA/JI61dGwvBPxL6594ejV807?= =?utf-8?q?MBqtMILXcnoBZYWlDrh+F2M/Zdnri70mpaRDIme7kWD6Wr9MFnyhBNU+MFdtueC4y?= =?utf-8?q?K0EQ3bu7Q+rWIQY7LJT4jDboFzrJNXur/teVug3N1+KNh3AYSVQuzaoB4tVAlp7ws?= =?utf-8?q?cJO2a02oJFsStj5/OA7QU66NCuuD9KcdYmtyBz1kibQR2mwAtir1GsnXD5PcKtux8?= =?utf-8?q?X8OvJyNsVxzR?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 651cadf8-c3e8-4b14-59bb-08db313fc7a5 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3127.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2023 16:57:00.6934 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8epS3mwo8oliOBhjKCzzY4GcRz68lqHle8nJVLoTFvOGsOD2I/aS2tsfr6q1/oWcVSiA4aYjfbzfrRtTgJ7eCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7224 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org If the number of lanes was forced and then subsequently the user omits this parameter, the ksettings->lanes is reset. The driver should then reset the number of lanes to the device's default for the specified speed. However, although the ksettings->lanes is set to 0, the mod variable is not set to true to indicate the driver and userspace should be notified of the changes. Fixes: 012ce4dd3102 ("ethtool: Extend link modes settings uAPI with lanes") Signed-off-by: Andy Roulin Reviewed-by: Danielle Ratson --- net/ethtool/linkmodes.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c index fab66c169b9f..20165e07ef90 100644 --- a/net/ethtool/linkmodes.c +++ b/net/ethtool/linkmodes.c @@ -270,11 +270,12 @@ static int ethnl_update_linkmodes(struct genl_info *info, struct nlattr **tb, "lanes configuration not supported by device"); return -EOPNOTSUPP; } - } else if (!lsettings->autoneg) { - /* If autoneg is off and lanes parameter is not passed from user, - * set the lanes parameter to 0. + } else if (!lsettings->autoneg && ksettings->lanes) { + /* If autoneg is off and lanes parameter is not passed from user but + * it was defined previously then set the lanes parameter to 0. */ ksettings->lanes = 0; + *mod = true; } ret = ethnl_update_bitset(ksettings->link_modes.advertising,