From nobody Fri Sep 5 20:20:13 2025 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 0692DC32772 for ; Tue, 23 Aug 2022 11:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358812AbiHWLyb (ORCPT ); Tue, 23 Aug 2022 07:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358953AbiHWLvX (ORCPT ); Tue, 23 Aug 2022 07:51:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36747D3997; Tue, 23 Aug 2022 02:32:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 65520613EF; Tue, 23 Aug 2022 09:32:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55514C433D6; Tue, 23 Aug 2022 09:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661247124; bh=Y+qlWdUnCH0Y1VPWF46YVC7tY1kSdFucqEmRWPIB3ck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iV2uKrEsawv0hZ1iNI9/2KSETpoyuQe8RpLkIykGHWLX0LnRbdQyaiKVc4F2N35a3 rg+e8rxw+bIN31etQ/fPx3JZyQFyh6ShQ2CAgJCvqtzoeP2JByUj0NMBEd91Vwy2jV IiXx6DVYCGL1mGsPNvAK2vUnjVkB5P3cdeqjPUeU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Louis Peens , Yu Xiao , Simon Horman , Jakub Kicinski Subject: [PATCH 5.4 324/389] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Date: Tue, 23 Aug 2022 10:26:42 +0200 Message-Id: <20220823080129.056893794@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yu Xiao commit 4ae97cae07e15d41e5c0ebabba64c6eefdeb0bbe upstream. 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: 61f7c6f44870 ("nfp: implement ethtool get module EEPROM") Reviewed-by: Louis Peens Signed-off-by: Yu Xiao Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220802093355.69065-1-simon.horman@corigin= e.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -1127,6 +1127,8 @@ nfp_port_get_module_info(struct net_devi u8 data; =20 port =3D nfp_port_from_netdev(netdev); + /* update port state to get latest interface */ + set_bit(NFP_PORT_CHANGED, &port->flags); eth_port =3D nfp_port_get_eth_port(port); if (!eth_port) return -EOPNOTSUPP;