From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3971EA0567; Wed, 10 Mar 2021 09:31:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A61DE4068C; Wed, 10 Mar 2021 09:31:49 +0100 (CET) Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by mails.dpdk.org (Postfix) with ESMTP id 499B040687 for ; Wed, 10 Mar 2021 09:31:46 +0100 (CET) X-QQ-mid: bizesmtp10t1615365100t2pvk2b4 Received: from jiawenwu (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Wed, 10 Mar 2021 16:31:40 +0800 (CST) X-QQ-SSF: 01400000002000C0D000B00A0000000 X-QQ-FEAT: +zKhtBiG+ybSzA3HPqACAJCQRefqkSU10w+fVxw3IGnrw4kI7RQtcS8mgZgBl 6oqY4XvERaxSvbbsBG/RIQkpPqFn2eVllrRpQDdkpDqiFZ/v3QlzTp7SLRx1OdXmNVGQcje 1DKuLA2jw2obpsBCh/WoPcCZh45UrqbB+q2XoHDkDzUMw+LWph5KGLwM0/paNq2gxg8Z3ou c1Ss4E46bLZ16nXkXznnjNKAkqh1PkmWvzeBSa6dxFaBj/rZZA9l3qQezTjqXXfSMNhhcH+ pdKSuyrW0B2a3mBgNVs2+OuSBk2icOpIp50TWAgW7VhJoKOih3GaCvExroGs4ueXTvhqSWd VBo7OrEcJd3Z2Vx7Ghbu2rNk9FGhZOGwFyXvR+2 X-QQ-GoodBg: 2 From: "Jiawen Wu" To: "'Ferruh Yigit'" , References: <20210305112359.16716-1-jiawenwu@trustnetic.com> <20210305112359.16716-3-jiawenwu@trustnetic.com> <3aa32bfd-ed37-9a52-8c1e-e735f7d73d9f@intel.com> In-Reply-To: <3aa32bfd-ed37-9a52-8c1e-e735f7d73d9f@intel.com> Date: Wed, 10 Mar 2021 16:31:39 +0800 Message-ID: <008001d71587$cb478830$61d69890$@trustnetic.com>+C0FE4EC2F6F99420 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIBcY8WnTdg3TPuYVozK/16GM/ihwIKWegtAUzzEieqDWkuYA== Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Subject: Re: [dpdk-dev] [PATCH 2/5] net/txgbe: update link setup process of backplane NICs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tuesday, March 9, 2021 10:33 PM, Ferruh Yigit wrote: > On 3/5/2021 11:23 AM, Jiawen Wu wrote: > > Use some configuration to control the link setup flow, to adapt to > > different NIC's construction. Use firmware version to control the > > impact of firmware update. And fix some left bugs. > > > > Signed-off-by: Jiawen Wu > > --- > > config/rte_config.h | 7 ++ > > doc/guides/nics/txgbe.rst | 20 ++++ > > drivers/net/txgbe/base/txgbe_eeprom.h | 3 + > > drivers/net/txgbe/base/txgbe_hw.c | 85 +--------------- > > drivers/net/txgbe/base/txgbe_osdep.h | 1 + > > drivers/net/txgbe/base/txgbe_phy.c | 137 = +++++++++++++++----------- > > drivers/net/txgbe/base/txgbe_phy.h | 90 +++++++++++++++-- > > drivers/net/txgbe/base/txgbe_type.h | 24 ++++- > > drivers/net/txgbe/txgbe_ethdev.c | 6 ++ > > drivers/net/txgbe/txgbe_logs.h | 9 ++ > > 10 files changed, 239 insertions(+), 143 deletions(-) > > > > diff --git a/config/rte_config.h b/config/rte_config.h index > > 55a2fc50e..834b52245 100644 > > --- a/config/rte_config.h > > +++ b/config/rte_config.h > > @@ -131,6 +131,13 @@ > > #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4 > > #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4 > > > > +/* txgbe defines */ > > +#undef RTE_TXGBE_DEBUG_BP > > +#define RTE_TXGBE_BP_AUTO 1 > > +#undef RTE_TXGBE_KR_POLL > > +#define RTE_TXGBE_KR_PRESENT 1 > > +#undef RTE_TXGBE_KX_SGMII > > + >=20 > We should prevent adding more compile time options as much as = possible. >=20 > > /* Ring net PMD settings */ > > #define RTE_PMD_RING_MAX_RX_RINGS 16 > > #define RTE_PMD_RING_MAX_TX_RINGS 16 diff --git > > a/doc/guides/nics/txgbe.rst b/doc/guides/nics/txgbe.rst index > > e520f13f3..52e23942b 100644 > > --- a/doc/guides/nics/txgbe.rst > > +++ b/doc/guides/nics/txgbe.rst > > @@ -67,6 +67,26 @@ Please note that enabling debugging options may > affect system performance. > > > > Decide to enable or disable HW CRC in VF PMD. > > > > +- ``RTE_TXGBE_DEBUG_BP`` (undefined by default) > > + > > + Toggle display of auto-negtiation process for backplane NICs. > > + > > +- ``RTE_TXGBE_BP_AUTO`` (defined by default) > > + > > + Decide to use auto-negtiation mode or force mode to link up = backplane > NICs. > > + > > +- ``RTE_TXGBE_KR_POLL`` (undefined by default) > > + > > + Enable or disable polling mode to receive AN interrupt for = backplane NICs. > > + > > +- ``RTE_TXGBE_KR_PRESENT`` (defined by default) > > + > > + Decide to use present mode or init mode for backplane NICs. > > + > > +- ``RTE_TXGBE_KX_SGMII`` (undefined by default) > > + > > + Special treatment for KX SGMII cards. > > + >=20 > Why these compile time flags are added? >=20 > I see one of them is for the logging, which can be converted into the = dynamic > debug already. The existing compile time debug flags are only for the = datapath. >=20 > And for other compile time flags, can you please convert them to the = device > arguments, you can see multiple samples on other drivers, like > 'IXGBEVF_DEVARG_PFLINK_FULLCHK' in ixgbe. >=20 > There are multiple problem with the compile time flags, they are = harder to fully > tested, and easy to leave broken code. Also it is problematic for = distributing > software, since these options can't be modified on binary and not that = useful > for end users. Ok, I will convert them. These compile time flags are added because users who buy our chips to = produce their own backplane cards want to support some extended features by = changing parameters.