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 9487F425FF; Thu, 21 Sep 2023 13:36:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66D5C402B5; Thu, 21 Sep 2023 13:36:39 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id AFED14028C for ; Thu, 21 Sep 2023 13:36:37 +0200 (CEST) Received: from kwepemm000004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RrtYX5zk5zNmcw; Thu, 21 Sep 2023 19:32:48 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm000004.china.huawei.com (7.193.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 21 Sep 2023 19:36:35 +0800 Message-ID: <1f28e692-5145-efb4-28ac-10725ef2fd64@huawei.com> Date: Thu, 21 Sep 2023 19:36:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3 1/2] examples/ptpclient: add the check for PTP capability To: Ferruh Yigit , , Gagandeep Singh , Hemant Agrawal CC: , , References: <20220628133959.21381-1-liudongdong3@huawei.com> <20230817084226.55327-1-lihuisong@huawei.com> <20230817084226.55327-2-lihuisong@huawei.com> <6ab973de-3194-6eb8-ea31-f9c1def4c276@huawei.com> <7be6fe83-173f-4905-9f3b-519cdefae34f@amd.com> From: "lihuisong (C)" In-Reply-To: <7be6fe83-173f-4905-9f3b-519cdefae34f@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000004.china.huawei.com (7.193.23.18) X-CFilter-Loop: Reflected 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 在 2023/9/21 19:02, Ferruh Yigit 写道: > On 9/21/2023 10:18 AM, lihuisong (C) wrote: >> 在 2023/9/16 1:29, Ferruh Yigit 写道: >>> On 8/17/2023 9:42 AM, Huisong Li wrote: >>>> If a port doesn't support PTP, there is no need to keep running >>>> app. So this patch adds the check for PTP capability. >>>> >>>> Fixes: 7a04a4f67dca ("examples/ptpclient: enable Rx timestamp offload") >>>> Cc: stable@dpdk.org >>>> >>>> Signed-off-by: Huisong Li >>>> Signed-off-by: Dongdong Liu >>>> --- >>>>   examples/ptpclient/ptpclient.c | 5 +++++ >>>>   1 file changed, 5 insertions(+) >>>> >>>> diff --git a/examples/ptpclient/ptpclient.c >>>> b/examples/ptpclient/ptpclient.c >>>> index cdf2da64df..181d8fb357 100644 >>>> --- a/examples/ptpclient/ptpclient.c >>>> +++ b/examples/ptpclient/ptpclient.c >>>> @@ -196,6 +196,11 @@ port_init(uint16_t port, struct rte_mempool >>>> *mbuf_pool) >>>>         if (dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_TIMESTAMP) >>>>           port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_TIMESTAMP; >>>> +    else { >>>> +        printf("port(%u) doesn't support PTP: %s\n", port, >>>> +               strerror(-retval)); >>>> +        return -ENOTSUP; >>>> +    } >>>> >>> I am not sure why TIMESTAMP offload is required for PTP, I think there >>> is a confusion. >> If TIMESTAMP offload is not required for PTP, there isn't PTP offload in >> ethdev lib. >> > What do you mean with "PTP offload"? Yes, I mean we need like a PTP offload. > > If you check the ptpclient sample app, it parses ptp packets in the > application. App did parse PTP packet already. What is the relationship between this and the verification in the app? > > >>> >>> Gagandeep, Hemant, >>> Can you please clarify why TIMESTAMP offload is enabled? >> looking forward to your reply. >>> . > .