DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@marvell.com>
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" <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH v2] examples/ptpclient: fix delay request message
Date: Thu, 25 Jul 2019 14:24:43 +0000	[thread overview]
Message-ID: <1564064668-28667-1-git-send-email-hkalra@marvell.com> (raw)

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

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 =
-- 
2.18.0


             reply	other threads:[~2019-07-25 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 14:24 Harman Kalra [this message]
2019-07-27 13:35 ` Jerin Jacob Kollanukkaran
2019-07-29 22:13   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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=1564064668-28667-1-git-send-email-hkalra@marvell.com \
    --to=hkalra@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaoyun.li@intel.com \
    /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).