DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dongdong Liu <liudongdong3@huawei.com>
To: <dev@dpdk.org>, <ferruh.yigit@xilinx.com>,
	<andrew.rybchenko@oktetlabs.ru>, <thomas@monjalon.net>
Cc: <stable@dpdk.org>, Huisong Li <lihuisong@huawei.com>,
	Dongdong Liu <liudongdong3@huawei.com>,
	Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Subject: [PATCH v2 1/3] examples/ptpclient: add the check for PTP capability
Date: Sat, 2 Jul 2022 16:17:28 +0800	[thread overview]
Message-ID: <20220702081730.1168-2-liudongdong3@huawei.com> (raw)
In-Reply-To: <20220702081730.1168-1-liudongdong3@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

If a port doesn't support PTP, there is no need to keep running
app. So this patch adds the check for PTP capability.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 examples/ptpclient/ptpclient.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 1f1c9c9c52..9689f42f86 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -195,6 +195,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;
+	}
 
 	if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
-- 
2.22.0


  reply	other threads:[~2022-07-02  8:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 13:39 [PATCH 0/3] some bugfixes for PTP Dongdong Liu
2022-06-28 13:39 ` [PATCH 1/3] examples/ptpclient: add the check for PTP capability Dongdong Liu
2022-06-28 13:39 ` [PATCH 2/3] net/hns3: fix fail to receive PTP packet Dongdong Liu
2022-06-28 13:39 ` [PATCH 3/3] ethdev: add the check for the valitity of timestamp offload Dongdong Liu
2022-07-02  8:17 ` [PATCH v2 0/3] some bugfixes for PTP Dongdong Liu
2022-07-02  8:17   ` Dongdong Liu [this message]
2022-07-02  8:17   ` [PATCH v2 2/3] net/hns3: fix fail to receive PTP packet Dongdong Liu
2022-07-02  8:17   ` [PATCH v2 3/3] ethdev: add the check for the valitity of timestamp offload Dongdong Liu
2022-07-06 14:57     ` Andrew Rybchenko
2022-07-07  2:05       ` lihuisong (C)
2023-08-17  8:42 ` [PATCH v3 0/2] ethdev: add the check for PTP capability Huisong Li
2023-08-17  8:42   ` [PATCH v3 1/2] examples/ptpclient: " Huisong Li
2023-09-15 17:29     ` Ferruh Yigit
2023-09-21  9:18       ` lihuisong (C)
2023-09-21 11:02         ` Ferruh Yigit
2023-09-21 11:22           ` Hemant Agrawal
2023-10-20  4:05             ` lihuisong (C)
2023-09-21 11:36           ` lihuisong (C)
2023-08-17  8:42   ` [PATCH v3 2/2] ethdev: add the check for the valitity of timestamp offload Huisong Li
2023-09-15 17:46   ` [PATCH v3 0/2] ethdev: add the check for PTP capability Ferruh Yigit
2023-09-21 10:02     ` lihuisong (C)
2023-09-21 11:06       ` Ferruh Yigit
2023-09-21 11:17         ` Hemant Agrawal
2023-10-20  3:58           ` lihuisong (C)
2023-11-01 23:39             ` Ferruh Yigit
2023-11-23 11:40               ` lihuisong (C)
2023-11-01 23:39           ` Ferruh Yigit
2023-09-21 11:59         ` lihuisong (C)
2023-11-01 23:39           ` Ferruh Yigit
2023-11-23 11:56             ` lihuisong (C)
2024-01-11  6:25               ` lihuisong (C)
2024-01-26 16:54                 ` Ferruh Yigit
2024-01-27  1:52                   ` lihuisong (C)
2024-01-29 11:16                     ` Ferruh Yigit
2024-01-29 13:58                       ` lihuisong (C)
2024-01-29 15:00                         ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220702081730.1168-2-liudongdong3@huawei.com \
    --to=liudongdong3@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=kirill.rybalchenko@intel.com \
    --cc=lihuisong@huawei.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).