DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/ptpclient: fix delay request message
@ 2019-07-25 14:21 Harman Kalra
  0 siblings, 0 replies; only message in thread
From: Harman Kalra @ 2019-07-25 14:21 UTC (permalink / raw)
  To: John McNamara, Pablo de Lara, Bruce Richardson, Harry van Haaren,
	Xiaoyun Li
  Cc: dev, Harman Kalra

Observed an issue with the length and domain number of the
delay request message sent out by the client. Due to which delay
response from master was not received.

Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")

Change-Id: I1031fa630e97709818c4b440e1e5fdc31205ab9c
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 examples/ptpclient/ptpclient.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 95b0c176e..be101d7ab 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -233,7 +233,11 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 		return retval;
 
 	/* Enable timesync timestamping for the Ethernet device */
-	rte_eth_timesync_enable(port);
+	retval = rte_eth_timesync_enable(port);
+	if (retval < 0) {
+		printf("timesync enable failed: %d\n", retval);
+		return retval;
+	}
 
 	/* Enable RX in promiscuous mode for the Ethernet device. */
 	rte_eth_promiscuous_enable(port);
@@ -413,6 +417,9 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
 		ptp_msg->delay_req.hdr.ver = 2;
 		ptp_msg->delay_req.hdr.control = 1;
 		ptp_msg->delay_req.hdr.log_message_interval = 127;
+		ptp_msg->delay_req.hdr.message_length =
+			htons(sizeof(struct delay_req_msg));
+		ptp_msg->delay_req.hdr.domain_number = ptp_hdr->domain_number;
 
 		/* Set up clock id. */
 		client_clkid =
-- 
2.18.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-25 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 14:21 [dpdk-dev] [PATCH] examples/ptpclient: fix delay request message Harman Kalra

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).