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 90EA1A034F; Wed, 31 Mar 2021 11:26:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 266004069E; Wed, 31 Mar 2021 11:26:57 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 9F5E840141 for ; Wed, 31 Mar 2021 11:26:55 +0200 (CEST) IronPort-SDR: DCgTGFK3uve+Iq3/4gtzb39GRFW8xaabvUIZDl9zkE0bEAZ1FPMGziH7/GNxoldOJI8wzJi4JS 53enjpI+FHeg== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="191444732" X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="191444732" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:26:54 -0700 IronPort-SDR: C1xPOXwzkz7g5yYv8MlX80ojM28lKd+0v6MaSacINqSqrbhJZjI/JI4MP4CbTx5hhfe46m45Zc IDUExMTr/xhA== X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="445596500" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.249.9]) ([10.213.249.9]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:26:53 -0700 To: Thomas Monjalon , "Min Hu (Connor)" Cc: dev@dpdk.org, Andrew Rybchenko References: <1616748961-11239-1-git-send-email-humin29@huawei.com> <751cf194-7de2-4f9b-3f1a-fd2ad9c941f2@huawei.com> <26287890.AfWHT1PW0D@thomas> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 31 Mar 2021 10:26:50 +0100 MIME-Version: 1.0 In-Reply-To: <26287890.AfWHT1PW0D@thomas> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] net/hns3: support IEEE 1588 PTP 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/31/2021 8:28 AM, Thomas Monjalon wrote: > 31/03/2021 04:35, Min Hu (Connor): >> 在 2021/3/30 21:59, Ferruh Yigit 写道: >>> On 3/26/2021 8:56 AM, Min Hu (Connor) wrote: >>>> Add hns3 support for new ethdev APIs to enable and read IEEE1588/ >>>> 802.1AS PTP timestamps. >>>> >>>> Signed-off-by: Min Hu (Connor) >>>> --- a/drivers/net/hns3/hns3_cmd.h >>>> +++ b/drivers/net/hns3/hns3_cmd.h >>>> @@ -123,6 +123,12 @@ enum hns3_opcode_type { >>>> HNS3_OPC_CLEAR_MAC_TNL_INT = 0x0312, >>>> HNS3_OPC_CONFIG_FEC_MODE = 0x031A, >>>> +#ifdef RTE_LIBRTE_IEEE1588 >>>> + /* PTP command */ >>>> + HNS3_OPC_PTP_INT_EN = 0x0501, >>>> + HNS3_OPC_CFG_PTP_MODE = 0x0507, >>>> +#endif >>>> + >>> >>> Hi Connor, >>> >>> Does it needs to be a compile time configuration? What happens if it is >>> always enabled, or controlled by device argument? >>> . >> Hi Ferruh, >> Firstly the "RTE_LIBRTE_IEEE1588" origins from the config file in DPDK. >> Almost every nic driver use this macro in compile time. >> For me, I think using this macro give one option for users to >> decide if his APPs contains this module. For example, in loT field, >> some microprocessor has small memory or small disk, So the APPs should >> be as small as possible. So, if user does not need "PTP", the APPs no >> need to contain it. >> Well, another top, if is always enabled, for HNS3 PMD, it will >> work well for our nic. If user want to use "PTP", just call API. If user >> does not use it, it also doesn't matter. But we advise that if user >> don't need this function, just turn it off. >> Thanks. > > Disabling at compile-time does not reduce the footprint significantly. > RTE_LIBRTE_IEEE1588 should disappear, so I advise not using it > in new code. Instead, you could enable/disable at runtime if needed. > I am aware that 'RTE_LIBRTE_IEEE1588' already exists and used by some drivers, but as you said they are from times we had a config option for it, for the new support I believe it is better to have runtime configuration. And I agree with Thomas that it shouldn't increase the footprint much to always compile the support in, if you have numbers please share.