>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(-) -- 2.33.0