From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12425A0C41 for ; Tue, 30 Nov 2021 17:44:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E21D41190; Tue, 30 Nov 2021 17:44:05 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 9F174410F7 for ; Tue, 30 Nov 2021 17:44:02 +0100 (CET) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 81C393FFE1 for ; Tue, 30 Nov 2021 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290642; bh=yCjiaeMnW/37RfyZvZoReDHsS6yIIdC4elBRsI/sIsY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Lq5+Xnw6UUxMhyFP5MUkxQcDK3lJfowJMvjeJ1GfjQwywrQh+iL/HQvz3USLx7KhN 4/wgY+VSbLqTy+Z2DhGNX+DlTWkI3QFQ/d4psIlgiuWDEVjltRI/sNMdJ+os7+dl9k oud6nbXmO893HMcBV+3ilpWM5+HxcmA0MTdCRRBaFbaxLszCOBf7bW7b/1TXfI/PgA tJz8D4830Lb1jDSk0NuRrYrGX6GQgEkhOYhmEdDWQKVrEShp7ARo5wDVHKWlQZqN/G dQ09n6tuDTUrFZLGz3tdgqFawvHRURl92AX1qyFGbIwKUGLYK/HvdYt+1j4TzN0rcF eW9sRabCjno/Q== Received: by mail-ed1-f71.google.com with SMTP id c1-20020aa7c741000000b003e7bf1da4bcso17392313eds.21 for ; Tue, 30 Nov 2021 08:44:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yCjiaeMnW/37RfyZvZoReDHsS6yIIdC4elBRsI/sIsY=; b=yvcxw8o26fwjz8AGHx8N9xUIFjAWwAu7humbHxS5acJlMNnN7R8rjUYcoTQXvRX81W iB6fwXsmDLwqFdwencvOydYSs1n1Zh0Aoma1VtVfPqXeMhh1Tn2bkaWHdfr3vA5qIBBw QXShU6HVI3HsAU6bVPXbA5EG62x/Bzkk/kFWXNyPkKFvm61n3IF+hGcI4o+R4Jefc4v6 1C7V5CdUM+2K8rBxeRHzlbL7PRDD1uszGO7X/ddmjPHKi0aH2Rsg0i2QEwUq8cIu1mYM gCpW9XJ1nhxkhf1czXSKQiyoXjGhaIlTeqqACRQdldJYyWPMydoFgnbgOptGF1nPfx9P z3aw== X-Gm-Message-State: AOAM5302d0372jmgAB6twvbuHbbBQ5gumN6N8VM2YltljFLe+v1JnZ7Z 4otMhC3KksCVPyDWRKtBJwpY/X8CG6g+jRfb+DkileDXW/ELkkILKs5IoB7JKnkjN016wNzoRux w9sbFCI+S1IhfY0d2CJ8PHzPz X-Received: by 2002:a17:907:6e9e:: with SMTP id sh30mr281732ejc.156.1638290641890; Tue, 30 Nov 2021 08:44:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyC6durMGLecpuZrH1X0zsUH+iBmVu2eh6SzIGbfDfDcOoST5cAvD8MyJt0pKfW3GFBdbzb/Q== X-Received: by 2002:a17:907:6e9e:: with SMTP id sh30mr281712ejc.156.1638290641723; Tue, 30 Nov 2021 08:44:01 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id f16sm12779083edd.37.2021.11.30.08.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:44:01 -0800 (PST) From: christian.ehrhardt@canonical.com To: Vanshika Shukla Cc: Nipun Gupta , dpdk stable Subject: patch 'examples/ptpclient: fix delay request message' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:35:59 +0100 Message-Id: <20211130163605.2460997-155-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/264243ffe3d2fcc856cc0583de3220571d6f718f Thanks. Christian Ehrhardt --- >From 264243ffe3d2fcc856cc0583de3220571d6f718f Mon Sep 17 00:00:00 2001 From: Vanshika Shukla Date: Mon, 22 Nov 2021 13:01:22 +0530 Subject: [PATCH] examples/ptpclient: fix delay request message [ 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 Acked-by: Nipun Gupta --- 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 e13a491c27..e29237d67c 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-30 16:50:14.848348866 +0100 +++ 0155-examples-ptpclient-fix-delay-request-message.patch 2021-11-30 16:50:06.130876025 +0100 @@ -1 +1 @@ -From 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 Mon Sep 17 00:00:00 2001 +From 264243ffe3d2fcc856cc0583de3220571d6f718f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 354c7b2c90..de799f698b 100644 +index e13a491c27..e29237d67c 100644 @@ -25 +26 @@ -@@ -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 +34 @@ -@@ -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 +48,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 +81,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];