[v2] examples/ptpclient: fix delay request message

Message ID 1564064668-28667-1-git-send-email-hkalra@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] examples/ptpclient: fix delay request message |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Harman Kalra July 25, 2019, 2:24 p.m. UTC
  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")
Cc: stable@dpdk.org

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

Comments

Jerin Jacob Kollanukkaran July 27, 2019, 1:35 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Harman Kalra
> Sent: Thursday, July 25, 2019 7:55 PM
> To: John McNamara <john.mcnamara@intel.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>; Bruce Richardson
> <bruce.richardson@intel.com>; Harry van Haaren
> <harry.van.haaren@intel.com>; Xiaoyun Li <xiaoyun.li@intel.com>
> Cc: dev@dpdk.org; Harman Kalra <hkalra@marvell.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] examples/ptpclient: fix delay request
> message
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Harman Kalra <hkalra@marvell.com>

Reviewed-by: Jerin Jacob <jerinj@marvell.com>
  
Thomas Monjalon July 29, 2019, 10:13 p.m. UTC | #2
> > 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")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Harman Kalra <hkalra@marvell.com>
> 
> Reviewed-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks
  

Patch

diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 95b0c176e..31778fd95 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 =