From patchwork Thu Aug 17 08:42:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 68 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6234F4308C; Thu, 17 Aug 2023 10:45:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A0DA42D12; Thu, 17 Aug 2023 10:45:26 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id B246340ED9 for ; Thu, 17 Aug 2023 10:45:22 +0200 (CEST) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RRJR12lDYzFqZr; Thu, 17 Aug 2023 16:42:21 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 17 Aug 2023 16:45:19 +0800 From: Huisong Li To: CC: , , , , Subject: [PATCH v3 0/2] ethdev: add the check for PTP capability Date: Thu, 17 Aug 2023 16:42:24 +0800 Message-ID: <20230817084226.55327-1-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220628133959.21381-1-liudongdong3@huawei.com> References: <20220628133959.21381-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) 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 From the first version of ptpclient, it seems that this example assume that the PMDs support the PTP feature and enable PTP by default. Please see commit ab129e9065a5 ("examples/ptpclient: add minimal PTP client") which are introduced in 2015. And two years later, Rx HW timestamp offload was introduced to enable or disable PTP feature in HW via rte_eth_rxmode. Please see commit 42ffc45aa340 ("ethdev: add Rx HW timestamp capability"). And then about four years later, ptpclient enable Rx timestamp offload because some PMDs require this offload to enable. Please see commit 7a04a4f67dca ("examples/ptpclient: enable Rx timestamp offload"). By all the records, this is more like a process of perfecting PTP feature. Not all network adaptors support PTP feature. So adding the check for PTP capability in ethdev layer is necessary. --- v3: - patch [2/3] for hns3 has been applied and so remove it. - ops pointer check is closer to usage. Huisong Li (2): examples/ptpclient: add the check for PTP capability ethdev: add the check for the valitity of timestamp offload examples/ptpclient/ptpclient.c | 5 +++ lib/ethdev/rte_ethdev.c | 57 +++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-)