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 068C0A0C41 for ; Sun, 28 Nov 2021 16:01:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0140042732; Sun, 28 Nov 2021 16:01:41 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id A3D1540FDF for ; Sun, 28 Nov 2021 16:01:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmhhljirnsbn60wbhPfm+VKUwkUNACfS59v8g2EPkZSw/rtdSMjAXov2ZlD5eDzrLVCqFzo82kYDPIPA6XL1IntYvBnK2VVDAUfYqGrETk7rTLsy293HHrUzBvxb0pMIg+Gg9W/hy+PQLJCrN9tO0ERmGtzbpuphR560z8sehw2wAmcHoKbU3+AHZJBEqa8xenPSjU279AwJfoO12hgY33cHL+PdmKtKnJODDw5N2K15E3PaKL1bvt386dN3kyew3P27S/loczgGA2fxiwZHZ9QSsFYVvMqCCcPYtkTat5ele3xO/NHv/JWhhBHa3/R9XriqZGzGa6aEvHDZYQ3S6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fUGJZ9x/VgVsB72OXK4f3QMaKK/O+nfK+TKzZHdVXnU=; b=eqbOni766CySqdJIMuVZUOD8SVqPJ+KSnFSkm6u0q6GZNzK/kYKtAmQjnml8mmZ0GNekTkB4+a/bhz3v0d8NFfZ1jxmvjVuFH7xcLXihM/isBusUWODjWCP2Ox0GLELkuJ9dc2qHOlH+H70g4aXQBSO+G16q6C6vTBYkf+jiIOcHeFaFKH2hkv93TMSuEGY1g+1lKVkWHvl0HBTf6zStyo/2YZI451mxMljmhXUazWYWyoIdc4gpv1AjympeZiy4d9YWK3eU/tXJVwWQUIH08npPtcM84vRQW8zcnkFnx87u7H7ySuSoVoYWb1oqUlbzSqxPxgHdXaarZu6amnHxHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=nxp.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fUGJZ9x/VgVsB72OXK4f3QMaKK/O+nfK+TKzZHdVXnU=; b=qGafki1uEIVo45D2BU3fZAG8WOitH721HAm2UVLGbUsbu1UJcQIO8yTMgp5eMBgFy7NiUM5bN3dg2JBluUXvWfE4rBs01v9E37XQ+Xp1L1fo7Q4mv8Lb+9t8mqUIwzSbwki57FKchi/2zDmclPPq/7K96HyYgIzHCETQvug4FnCCk0WaCJDb56ZHfodhQUhfPicoujm7JX8phGO1Sa2uP6aUb9WpoQ1IO4JgA2ryWgPDugzzrFr3UB0CCfOZeGh+rc/nP60sRzO/n+GXqn5JvgvuYG1Dh+MXjK8CR4QRGQ5iXwPhYW/vd0QYtFbFbMkMzF5Wcl8D5GXv3sZP5im3vQ== Received: from BN0PR02CA0043.namprd02.prod.outlook.com (2603:10b6:408:e5::18) by BN8PR12MB3282.namprd12.prod.outlook.com (2603:10b6:408:9e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sun, 28 Nov 2021 15:01:38 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::cb) by BN0PR02CA0043.outlook.office365.com (2603:10b6:408:e5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.20 via Frontend Transport; Sun, 28 Nov 2021 15:01:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 15:01:38 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 28 Nov 2021 15:01:36 +0000 From: Xueming Li To: Vanshika Shukla CC: Luca Boccassi , Nipun Gupta , dpdk stable Subject: patch 'examples/ptpclient: fix delay request message' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:54:06 +0800 Message-ID: <20211128145423.3974892-63-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 56930d43-9560-4fec-3d1c-08d9b27ffa8e X-MS-TrafficTypeDiagnostic: BN8PR12MB3282: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kEjrWmGYk0M6PifyDHHt3d5D18MqIbrr/SMvoOU/hTVEof/KSF1ZQ2IhRAsD24O7wHjIoc/DYMhjH0ovOSxGrlLJ+1U8zT0KtmqIR1qYA1GnuKUqeVt5ho4Ftd5lnnl+2/iaEZv/Zr5KEurR/ROtj9+e3BO5KzWOQYUdLHmucuodVtqgDQOwtqpTzqm4tMqrRhaEbqtCca71XKbCfyp/kdQbgJLkkDA8/VDu4dChwDfHjJJAKwYCkTumouiFzT1+ODBhWJokPw9eq7L3wmXplx2AlHzGl0nzo+VWFYZ6+B5noxM12qdZzo/hsRAPwaxYYxBENeVl7zfcYJMEaRPQXG6lHxssq938jBsKhlTdCcM5cKX+r9BIVLJ4RrmkK1GnBVDTTLU8mV2/VLfXsVZ7kow0kNY6xJ/VDvkkCCxt5RpCRXczRHOUfWXezU8CzVyDS41h5N7mS56WjijAxnamlE1Vl3ndBRGMNkVj44eCGSsvZATrSj/VoaB5UgXJOO3FFCm9KjZDpl+2GinraTuTBb0ZRzMB0iy9ES6YjEcU9tGY3vKBMT7Cu+pzpMc92YGnRX1KOYcen2nTqWuAUdScuY7AUk9wqtxPpKv4ggmkAYPrpitSvhGy0jbCcr8470yHLmE4b02MwL71BlwlFXZxlan/dcONqOnsjbAux5Lf2lTwGn4mjrfFSS3oln1mGmxONRTed2Fui7KVYJgfuw4CPHxK60S/fHnQ5nsp0GfVHHQJibKdPfEP60HePRc1ccIu2fEEiLUMVanEkiw9R1E548dPNd3tTrn1djEcdMCh3pFAlHQwlPPHm89PKiF7oQ76pCFu1R2dpiTqwCs1Aue5Rw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(26005)(86362001)(8676002)(186003)(16526019)(83380400001)(356005)(336012)(70206006)(426003)(2616005)(53546011)(7696005)(47076005)(70586007)(6286002)(8936002)(5660300002)(6916009)(316002)(508600001)(2906002)(55016003)(4001150100001)(36756003)(82310400004)(15650500001)(4326008)(7636003)(1076003)(966005)(36860700001)(54906003)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 15:01:38.2213 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56930d43-9560-4fec-3d1c-08d9b27ffa8e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3282 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 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 --- >From eb7ddaede6f526881827f0f114fa11249f623b7b 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 Cc: Xueming Li [ 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 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 + +[ upstream commit 21ba4d572a5cb404cd3d02a59aaf7997bb4e8a39 ] @@ -13 +15,0 @@ -Cc: stable@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];