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 5C0B3A034F; Wed, 31 Mar 2021 04:35:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41B51140DED; Wed, 31 Mar 2021 04:35:33 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 064BF40141 for ; Wed, 31 Mar 2021 04:35:31 +0200 (CEST) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F99Ml57wszPmtl; Wed, 31 Mar 2021 10:32:51 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Wed, 31 Mar 2021 10:35:28 +0800 To: Ferruh Yigit , CC: Andrew Rybchenko , Thomas Monjalon References: <1616748961-11239-1-git-send-email-humin29@huawei.com> <1616748961-11239-3-git-send-email-humin29@huawei.com> From: "Min Hu (Connor)" Message-ID: <751cf194-7de2-4f9b-3f1a-fd2ad9c941f2@huawei.com> Date: Wed, 31 Mar 2021 10:35:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected 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" 在 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) >> --- >>   doc/guides/nics/features/hns3.ini |   2 + >>   doc/guides/nics/hns3.rst          |   1 + >>   drivers/net/hns3/hns3_cmd.h       |  33 +++++ >>   drivers/net/hns3/hns3_ethdev.c    |  59 +++++++- >>   drivers/net/hns3/hns3_ethdev.h    |  25 ++++ >>   drivers/net/hns3/hns3_ptp.c       | 294 >> ++++++++++++++++++++++++++++++++++++++ >>   drivers/net/hns3/hns3_regs.h      |  25 ++++ >>   drivers/net/hns3/hns3_rxtx.c      |  56 +++++++- >>   drivers/net/hns3/hns3_rxtx.h      |  12 ++ >>   drivers/net/hns3/hns3_rxtx_vec.c  |  19 ++- >>   drivers/net/hns3/meson.build      |   3 +- >>   11 files changed, 516 insertions(+), 13 deletions(-) >>   create mode 100644 drivers/net/hns3/hns3_ptp.c >> >> diff --git a/doc/guides/nics/features/hns3.ini >> b/doc/guides/nics/features/hns3.ini >> index 3988be4..502bfe7 100644 >> --- a/doc/guides/nics/features/hns3.ini >> +++ b/doc/guides/nics/features/hns3.ini >> @@ -43,6 +43,8 @@ Stats per queue      = Y >>   FW version           = Y >>   Registers dump       = Y >>   Module EEPROM dump   = Y >> +Timesync             = Y >> +Timestamp offload    = Y >>   Multiprocess aware   = Y >>   Linux                = Y >>   ARMv8                = Y >> diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst >> index ccd2f6f..3366562 100644 >> --- a/doc/guides/nics/hns3.rst >> +++ b/doc/guides/nics/hns3.rst >> @@ -37,6 +37,7 @@ Features of the HNS3 PMD are: >>   - MTU update >>   - NUMA support >>   - Generic flow API >> +- IEEE1588/802.1AS timestamping >>   Prerequisites >>   ------------- >> diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h >> index e704d0c..abc853b 100644 >> --- 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.