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 84AC7A0567; Tue, 9 Mar 2021 15:33:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F101B4069D; Tue, 9 Mar 2021 15:33:00 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B41FA4068A for ; Tue, 9 Mar 2021 15:32:59 +0100 (CET) IronPort-SDR: H9jCgRHF99VbJ5QVP4hwG2UHmuV+JloU2ehXveS6IrzhG0v9jD8wy7ZmXcGUcSKFtVPq/M/74M BJ3icOkf+KXA== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="249620068" X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="249620068" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 06:32:58 -0800 IronPort-SDR: etFBGv/egooah+3HBMQvcZzqsRNbVvz98+tSsdYs0rp1fNcSp4cMPzUAYrhDDdv2Gh1xBVeCUr DkaFyAPer4pQ== X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="409752712" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.196.3]) ([10.213.196.3]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 06:32:57 -0800 To: Jiawen Wu , dev@dpdk.org References: <20210305112359.16716-1-jiawenwu@trustnetic.com> <20210305112359.16716-3-jiawenwu@trustnetic.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <3aa32bfd-ed37-9a52-8c1e-e735f7d73d9f@intel.com> Date: Tue, 9 Mar 2021 14:32:53 +0000 MIME-Version: 1.0 In-Reply-To: <20210305112359.16716-3-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 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 > + We should prevent adding more compile time options as much as possible. > /* 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. > + Why these compile time flags are added? 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. 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. 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.