patch 'examples/ptpclient: fix delay request message' has been queued to stable release 20.11.4
Xueming Li
xuemingl at nvidia.com
Sun Nov 28 15:54:06 CET 2021
Hi,
FYI, your patch has been queued to stable release 20.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/21. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk
This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/eb7ddaede6f526881827f0f114fa11249f623b7b
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From eb7ddaede6f526881827f0f114fa11249f623b7b Mon Sep 17 00:00:00 2001
From: Vanshika Shukla <vanshika.shukla at nxp.com>
Date: Mon, 22 Nov 2021 13:01:22 +0530
Subject: [PATCH] examples/ptpclient: fix delay request message
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 ]
The size of delay request message sent out by the DPDK
ptpclient application was observed to have extra length
than expected. Due to this, bad messages were observed
on the master side and delay response was not received.
This patch fixes this bug.
Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")
Signed-off-by: Vanshika Shukla <vanshika.shukla at nxp.com>
Acked-by: Nipun Gupta <nipun.gupta at nxp.com>
---
examples/ptpclient/ptpclient.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index a8b1b85c6d..c8fdae9cce 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -382,6 +382,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
struct ptp_header *ptp_hdr;
struct clock_id *client_clkid;
struct ptp_message *ptp_msg;
+ struct delay_req_msg *req_msg;
struct rte_mbuf *created_pkt;
struct tstamp *origin_tstamp;
struct rte_ether_addr eth_multicast = ether_multicast;
@@ -419,7 +420,12 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
created_pkt = rte_pktmbuf_alloc(mbuf_pool);
pkt_size = sizeof(struct rte_ether_hdr) +
- sizeof(struct ptp_message);
+ sizeof(struct delay_req_msg);
+
+ if (rte_pktmbuf_append(created_pkt, pkt_size) == NULL) {
+ rte_pktmbuf_free(created_pkt);
+ return;
+ }
created_pkt->data_len = pkt_size;
created_pkt->pkt_len = pkt_size;
eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *);
@@ -429,22 +435,22 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
rte_ether_addr_copy(ð_multicast, ð_hdr->d_addr);
eth_hdr->ether_type = htons(PTP_PROTOCOL);
- ptp_msg = (struct ptp_message *)
- (rte_pktmbuf_mtod(created_pkt, char *) +
- sizeof(struct rte_ether_hdr));
-
- ptp_msg->delay_req.hdr.seq_id = htons(ptp_data->seqID_SYNC);
- ptp_msg->delay_req.hdr.msg_type = DELAY_REQ;
- 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 =
+ req_msg = rte_pktmbuf_mtod_offset(created_pkt,
+ struct delay_req_msg *, sizeof(struct
+ rte_ether_hdr));
+
+ req_msg->hdr.seq_id = htons(ptp_data->seqID_SYNC);
+ req_msg->hdr.msg_type = DELAY_REQ;
+ req_msg->hdr.ver = 2;
+ req_msg->hdr.control = 1;
+ req_msg->hdr.log_message_interval = 127;
+ req_msg->hdr.message_length =
htons(sizeof(struct delay_req_msg));
- ptp_msg->delay_req.hdr.domain_number = ptp_hdr->domain_number;
+ req_msg->hdr.domain_number = ptp_hdr->domain_number;
/* Set up clock id. */
client_clkid =
- &ptp_msg->delay_req.hdr.source_port_id.clock_id;
+ &req_msg->hdr.source_port_id.clock_id;
client_clkid->id[0] = eth_hdr->s_addr.addr_bytes[0];
client_clkid->id[1] = eth_hdr->s_addr.addr_bytes[1];
--
2.34.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-28 22:41:06.431460858 +0800
+++ 0062-examples-ptpclient-fix-delay-request-message.patch 2021-11-28 22:41:03.400206198 +0800
@@ -1 +1 @@
-From 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 Mon Sep 17 00:00:00 2001
+From eb7ddaede6f526881827f0f114fa11249f623b7b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 354c7b2c90..de799f698b 100644
+index a8b1b85c6d..c8fdae9cce 100644
@@ -25 +27 @@
-@@ -386,6 +386,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
+@@ -382,6 +382,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
@@ -33 +35 @@
-@@ -423,7 +424,12 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
+@@ -419,7 +420,12 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
@@ -47,2 +49,2 @@
-@@ -433,22 +439,22 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
- rte_ether_addr_copy(ð_multicast, ð_hdr->dst_addr);
+@@ -429,22 +435,22 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
+ rte_ether_addr_copy(ð_multicast, ð_hdr->d_addr);
@@ -80,2 +82,2 @@
- client_clkid->id[0] = eth_hdr->src_addr.addr_bytes[0];
- client_clkid->id[1] = eth_hdr->src_addr.addr_bytes[1];
+ client_clkid->id[0] = eth_hdr->s_addr.addr_bytes[0];
+ client_clkid->id[1] = eth_hdr->s_addr.addr_bytes[1];
More information about the stable
mailing list