From patchwork Mon Jan 29 13:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Choong Yong Liang X-Patchwork-Id: 193556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp657837dyb; Mon, 29 Jan 2024 07:55:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+FY4516Vw0rVXa5uKY2SxMuIEsr0Gcrq0zBg7U9k64ZdznnQqrti1YGy/B8Bj/9kFj1ym X-Received: by 2002:ad4:5ca3:0:b0:67f:ba74:ebca with SMTP id q3-20020ad45ca3000000b0067fba74ebcamr7795527qvh.76.1706543710460; Mon, 29 Jan 2024 07:55:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706543709; cv=pass; d=google.com; s=arc-20160816; b=CAJ2tVFVkyEBsxUDoePxeygap94jfNsnXdbJszcRgFpW1MhlMvFJCrekztuwZmmJ7B odhFuxTkHXqMRLWRt9Z317Xdt9UF7d6N+zdZ3HxHlnQp0np+UhdX0reiCszPuj22+TAo brqDbn/7K9fZWTfKiKnrgCFn6x+oCI7Z7Khns9q/ZgR3ATqjGDvMVQwifppNKJucdOJw jtKMUGFWI1s/6GeCiidLoAuOm6zZl9vWFSuzs20vRR6Iwlxbt2Yxc1YLimjphJTGswEo pi7qkctjMB0WYUXayshZOfNl8iSUsSV0teif/KxAf3M+NGbe1mO6hpVsZVa1snI6RXLV /j6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=r4q0hudwyGnkkHBCrwP24J4jFDvIB0P7PC7nQ4ks2u4=; fh=/YJd8cagnZyj8HxcDZG6YnlmNxAW8XcSWCpxhbbfMGA=; b=IwMtFk1GQGvDQ5ixGzY7r7mCrWfaY09XgvDN3Cqev4aQL4MYF+oC2DyZS9Fb284Fpy va4djKipGQ/QrzqOyTp8Rjx9655W52Auf9JmGfGV3DDpVc0gnpInG3TCDErTmLHIqHyN xsrvAgMRu4QA2ZGwpkV2ZVYjUMa8LTI8+xe3Plh3ucc6SW3H5Tsdp78YHKVUuZmq3F5k Z8GdgZPdENaxOcYmsMXEOMb/c+QRYcLm4FhGtzBOgvsoUOJ9KWe8YOSXOOpvaQzKGzgu cKwE+5v7+0Wq7HYRtP69gAYTvIdfcor3sJRxKhDA3cWUWhFCuoD7DTDQtObhxzJ5uh1j tlHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U3gq8D+w; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gy13-20020a056214242d00b0068c51f4271asi1519202qvb.485.2024.01.29.07.55.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 07:55:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U3gq8D+w; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8B8831C231FE for ; Mon, 29 Jan 2024 13:05:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 329A963132; Mon, 29 Jan 2024 13:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U3gq8D+w" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3AEA61673; Mon, 29 Jan 2024 13:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533518; cv=none; b=idu00dDRKRmJfF7HxQZu1Vd5z/tuYxYXCYxc6JU+DVf6EVZCz5uCAuyhE6IxkUQ496DI5WnghfxcQkgHWFYb8Lrbxve6vopUMFjTmjC3dEQu9FinD+oe8z+/v5IKNX6egQq7freYWf/zvZBpyveDEhzK2SC6IV+I+7CMVryIfto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533518; c=relaxed/simple; bh=hWDEomf8s1NSZ88LHI2h/eMgx2/+Wu9+L2VlrPLQc6g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QanZExPnY38aZRqKZE03o63/XesxzfrPB69SkTpuqQNbHEyYZcSYyJiKh/TCJY+cdz/P39ABVVLOGZgRMujj6uwVVNQq+diGE6DDRbwV8qm6R467ga0pBZ4T5IUrye9SQat86Bqwfc8TZgnt5aqdzfRXDoqWlbU+Ad96kM9zptQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U3gq8D+w; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706533517; x=1738069517; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hWDEomf8s1NSZ88LHI2h/eMgx2/+Wu9+L2VlrPLQc6g=; b=U3gq8D+w5UUddwBeltLUyJk3yRe4ES3MaAjXn/h1n2dzw0sM0kJvPNYe MHFv7Dx5Y+HWICz6BJl6jPNnB+R7a02rWhWMDwTlvxdHuLlNPg5wTTPMp ZaCrg848mCmNk2VeVSJJXIJnAT/8qbWFxc4aLnR1DVZ68UeQC7XGSqPAl 4bkkIyZGkTZyCFKrZHA3rUensNrMiTQlkpCoGwYQ04DXM78Sg6kdbAmke GQUrJe0SC1WmbJTJmUwvPXJpnBdkGpTNX0aqBRP/HG1+79QswqElqKgV1 k7ODhgKSC5hZY3F1FEb+iupsjcq8wE7Biyexp1PRyyCvMAbvSPSdIBIjz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="21473237" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="21473237" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 05:05:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="907106707" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="907106707" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2024 05:05:08 -0800 From: Choong Yong Liang To: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrew Lunn , Heiner Kallweit , Philipp Zabel Cc: Andrew Halaney , Simon Horman , Serge Semin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Michael Sit Wei Hong , Lai Peter Jun Ann , Abdul Rahim Faizal Subject: [PATCH net-next v4 01/11] net: phylink: publish ethtool link modes that supported and advertised Date: Mon, 29 Jan 2024 21:02:43 +0800 Message-Id: <20240129130253.1400707-2-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129130253.1400707-1-yong.liang.choong@linux.intel.com> References: <20240129130253.1400707-1-yong.liang.choong@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789440777386832538 X-GMAIL-MSGID: 1789440777386832538 Adding the allow_switch_interface flag to publish all the ethtool link modes that can be supported and advertised. This will allow the interface switching based on different ethtool link modes. Signed-off-by: Choong Yong Liang --- drivers/net/phy/phylink.c | 9 +++++---- include/linux/phylink.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index ed0b4ccaa6a6..38ee2624169c 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1839,10 +1839,11 @@ static int phylink_validate_phy(struct phylink *pl, struct phy_device *phy, * against all interface modes, which may lead to more ethtool link * modes being advertised than are actually supported. */ - if (phy->is_c45 && state->rate_matching == RATE_MATCH_NONE && - state->interface != PHY_INTERFACE_MODE_RXAUI && - state->interface != PHY_INTERFACE_MODE_XAUI && - state->interface != PHY_INTERFACE_MODE_USXGMII) + if ((phy->is_c45 && state->rate_matching == RATE_MATCH_NONE && + state->interface != PHY_INTERFACE_MODE_RXAUI && + state->interface != PHY_INTERFACE_MODE_XAUI && + state->interface != PHY_INTERFACE_MODE_USXGMII) || + pl->config->allow_switch_interface) state->interface = PHY_INTERFACE_MODE_NA; return phylink_validate(pl, supported, state); diff --git a/include/linux/phylink.h b/include/linux/phylink.h index d589f89c612c..b362d3231aa4 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -151,6 +151,7 @@ struct phylink_config { bool poll_fixed_state; bool mac_managed_pm; bool ovr_an_inband; + bool allow_switch_interface; void (*get_fixed_state)(struct phylink_config *config, struct phylink_link_state *state); DECLARE_PHY_INTERFACE_MASK(supported_interfaces);