From patchwork Tue Aug 2 08:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12934407 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 56924C00140 for ; Tue, 2 Aug 2022 08:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235967AbiHBI7k (ORCPT ); Tue, 2 Aug 2022 04:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233888AbiHBI7i (ORCPT ); Tue, 2 Aug 2022 04:59:38 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2123.outbound.protection.outlook.com [40.107.101.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF1554E622 for ; Tue, 2 Aug 2022 01:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VxrtOL0kbtyt9gvhDqXvbOVydPv7JKRwytGBQeih6bH37FR4BxyHa7DdnSE9ycfr1lvcikqm+F03gCWv0FDYETxxzpLi1nTsADofMCbo9jg/qCQrTa7IY0LPXaZ0Jqo5XPnHs47j9HizN5lBXP3XTFE4l9aWzmcf99TzSUWHiI/5R1HYh2jNi64itFexP2RvaisxYkHHXbKnHso2/ueIKwOTrBaxNg06WKXrytD/QZsRymQSUezuqOignyIFrxJ2tPHq7CbbBTwUsqiTW0i/Sqy9OyE6MPgBWkxabYq7Gl9o7DAK2RhcUnwidCIeH1aDWoMfJkpxBmINP0lDvlqqxw== 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=ZDMI7x1GfWAlj6RdX1HoV7LmAKtTUyXPBSNZ5hW1OHc=; b=HYWRZS2RarWjN0dvettqyGlxCHS3yXosZbEuSIEKX/eVdEKFwdLy7KCeEGKtk5WAGrji+mTgPzeqx6YMRL6n5MCkUz+QnId99KkyUhMSIigbZCyzj4ORVkbEexbH8ObkhAg5V7QYcllTfDz9Mu3Bzj0O0dFveLL8i8Bach9igeXdLKhV7mpUqeDHauf3ftpoueb0ojlu6jPOLnN1kDesuQBiNOYBE2H7jCumt04+gUUFw/cASnl4fGA9R0HqWgjKQjFocQxjMH84QfTdJZvIeyb1smKfkHKMKzZHJMocGSEHZG/HxihZzRRRJS9m2J48iLiJKsBLw9iKfJ+lc6iEqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZDMI7x1GfWAlj6RdX1HoV7LmAKtTUyXPBSNZ5hW1OHc=; b=Yc138voGmjTS30UVHCqmg6tYgYsnx5VaTVXS9T/l49sxNG/BEn7HMnVQ+Q9jFRzAy4/NwC7YLxmYVgeo2Gvp/7D1VCWW5OcIfTFkwhBIBySnfAXsoTieSMb5dDe0/CQtKb+d8DouYvJ7Jp9OGdRMtraEzIE0NXFYUtJG72q8mwA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by DM5PR13MB1323.namprd13.prod.outlook.com (2603:10b6:3:28::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Tue, 2 Aug 2022 08:59:34 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a1e6:3e37:b3f3:7576]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a1e6:3e37:b3f3:7576%9]) with mapi id 15.20.5504.014; Tue, 2 Aug 2022 08:59:34 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Date: Tue, 2 Aug 2022 09:59:16 +0100 Message-Id: <20220802085916.63988-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: LNXP265CA0075.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::15) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a50ee449-1b6b-4b0d-8f2d-08da746551e1 X-MS-TrafficTypeDiagnostic: DM5PR13MB1323:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uH6YqHc0FSEcljGeIfV6U5eU8rEQeo9tD6guC8rKdU3Nv5CA7X03BxOKPy+OfAz6mgXVVH6u3OW5TSLVDubtbUaw/zMaGr1y16xKq4n2rtds9jheQfHIJOxPPThQiGU3XmGKE0iqoqE3oiAQEI6im5d5HuhetdouN5BDz8l9t5hTnCTbUcm8rq9hp0UJr7i8jySxAhXQ4QJFDWnTGgMffQOGd/XVu0cmOADwDaopNogcyZJlIE84mNY1C6OibjHlPTTdoNszzabyRiFWlgwWMDLXLdrtEwqBi8Fvw8Ka75Po15p+CS+JzykBtMqXtkb3jotjuWW5onKJeaTA0FFSJagCtWuPv2QMSXGDd9iAhm+jFM6LoGCk7Zq86izG1Zib6eT+DnFzs4485kVrfvM+8xtN7XHKPibF0VsVNQ3mwf1pf1SX0Q6LGYLAfAgTMAStVk0p2fIbo/+sXyQy83Ou6qVKL7Ejei9moWtx0r+Ar4k3IAIWdJWztE4oKRI47+MY8kw0DMbkn1jNKQ6uAGKQ9lvp/1FoKAxCfw8IRiqAf7TO3MSw1XM4Cd21BMxRZxbfvzmXIP0Z2XPLL2LNOKlxgugEiGWA/7EtM8kunKKgWMwoka//o68BZ+dKTQqLyM2c/YP3dmIYCMQIMusi/IGYsC8Wih8/GuSYBK47Kbv4TfxEf48ASn+RvvPI62HwrEHcTHciG7LrKd/U2srzmP9WOFQ1XLAqlW5waPqTZ9NDZQmR+ag2/nYQYlGdi+7CIczZGIF0OPHP2ysHFCkmjzkki7SurrABueV9dv3Rf5wDBKwQbg5nPyKiKCkkSke3KcoPwcDy5dHjHoBjLAQAZJ1YWg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(136003)(376002)(346002)(366004)(39840400004)(186003)(83380400001)(36756003)(110136005)(316002)(2616005)(107886003)(1076003)(478600001)(6506007)(8936002)(5660300002)(6486002)(66946007)(44832011)(2906002)(66556008)(4326008)(86362001)(38350700002)(38100700002)(52116002)(6512007)(26005)(6666004)(8676002)(66476007)(41300700001)(81973001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZARwExqzVdLgL+d5ihqzBfrRDxYWwiCVwhdfgeA1LWRPNO0ApBuOLCWDCzWzPGe8eCHtMfEDE3vy8f9BsNi0DOke3K25O/lzTs5LeBief57k8lZX39+3wHPowhCTsT58f1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tK7QBkGalfI3KmuB+hPkbINdroT8ljg320M4iUOxRGpP0yz6HR755y3eR32KfXmEL1x6BCTSEQUNymv9hYuCgHZGHfGeLzeYmotiVUxgkXFTUDNYW57uOGwR0o8IXlr+U4w9404ytuJne1c/yt+th/uKFvOS9UqEuYZdgfonbTefgvrrWdCWNT3zHPUdJmPhWfoYQgYz9Rjb0CnVpRIeiuJmv77acep4tLtuV11jes0BZgH9t5uNfH1JdCNzV9VuXTKiQjn16xHkpTJrfIVIzn2TWDWMYRL/UFSYvxcD/xkseJdPgHG+6oTUHAKoMWBc63LW/70WRr3V+Q3quhcD7du6y7CoNvSdbpRIodbkkLhmrJVTE6ag5axSWZu/SHZKg1mlHIw1XUCWuHn6qxXoU0bOA== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a50ee449-1b6b-4b0d-8f2d-08da746551e1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2022 08:59:34.1383 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +kEanayTJ8ZbVMB4wjLtEuBaSCaLIGGd6Z2g5o4k8xyUdWO6Yc6J9hyMxty2+yv8xn6ZwJdcuqq6aAikO46ORESW+Pyus8xWHwTFZeDYe7Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR13MB1323 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yu Xiao The port flag isn't set to `NFP_PORT_CHANGED` when using `ethtool -m DEVNAME` before, so the port state (e.g. interface) cannot be updated. Therefore, it caused that `ethtool -m DEVNAME` sometimes cannot read the correct information. E.g. `ethtool -m DEVNAME` cannot work when load driver before plug in optical module, as the port interface is still NONE without port update. Now update the port state before sending info to NIC to ensure that port interface is correct (latest state). Fixes: 61f7c6f4 ("nfp: implement ethtool get module EEPROM") Reviewed-by: Louis Peens Signed-off-by: Yu Xiao Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c index df0afd271a21..e6ee45afd80c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -1230,6 +1230,8 @@ nfp_port_get_module_info(struct net_device *netdev, u8 data; port = nfp_port_from_netdev(netdev); + /* update port state to get latest interface */ + set_bit(NFP_PORT_CHANGED, &port->flags); eth_port = nfp_port_get_eth_port(port); if (!eth_port) return -EOPNOTSUPP;