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 663B545BB6 for ; Wed, 23 Oct 2024 23:18:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6044140261; Wed, 23 Oct 2024 23:18:30 +0200 (CEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id B009C4329C for ; Wed, 23 Oct 2024 23:18:28 +0200 (CEST) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4315e9e9642so2151435e9.0 for ; Wed, 23 Oct 2024 14:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718308; x=1730323108; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rT8oQRUlSEQrknQHkfitPioo/ifMMrGK+6CjpuB1/5g=; b=VCo5txUPVQvD7cacGibhLPjeutc7sQ8t7nAcaRtqbLbmZLkyFgUOpIa+Pgay/busuB phSZ2ShwWVtFlIQyJkpQfsbj9p7TNTB2itRx6K3PBaW7k/QnMoSunqYV/5ikUJ/zkFMV ab42xZEb5LAFYEU/ke9cWKFWSg+vm1NH2868lZQsdM0DNO6Ja3mxJZ7C7nUD/EgqjBNj dtxNmKqEC5K7AX3dGjJGQpw36rqJiEPGqbu4Vw3tFI37PipPJ5RoZG8YpN5/z7WRsQyj PZzyflvBix7Au1p2PUB6jaetBbmoyBHMkQEvtqfcZptYpr+pBll1ErjfMGvClGGsXApd dzIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718308; x=1730323108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rT8oQRUlSEQrknQHkfitPioo/ifMMrGK+6CjpuB1/5g=; b=ssYq5AobMZKEi42HxH6HAmqVS4gMxufv0a7gmIKVUoNeIKgOqutcxyCbxuHR4JQm6C 5oUnVkoYApGtszm4lS45zXA0oNEgqxShtl5JVju00qpVZT0BaHOagu1nYvBjoI8oB6G3 ymvcBMQSEPjUW1uHHUP78HvOZWOzEvxrro/QeanDt87oKa2QpzRZmygM5mAhkWRxP36h r7uT+kfNQpcQoML0HXNLgEypN+upSEnQJ984BvDudVZQuVFOOh/PiFvj81kLeDblXFue 4SQOys+7iYO6fTloN5Lvu/s1qfAwj2/yn8Gok7GfiDvkWwZtKpGNV2uCs3xEglW9uZUs Vn5w== X-Gm-Message-State: AOJu0Yw/Qycn1K03xgduWcb6/ucaBWIKYSzz6x7lVMMj/Kpu79CsZIy1 welYXpF28nn8vuw6L+dbsR+YaZlFHMsSpCnc57r3iT4HRrVVp9EF X-Google-Smtp-Source: AGHT+IF0eN6x7H7p/IDlsh/Gaf0n0F4vD7SRB5QNZg5GcBTjRxIWU8SfyZC/7eHySn47Syj0+zkJ0g== X-Received: by 2002:a05:600c:510a:b0:42c:bb96:340e with SMTP id 5b1f17b1804b1-431841a2ebbmr31563825e9.31.1729718308160; Wed, 23 Oct 2024 14:18:28 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43186bde1b5sm26730315e9.12.2024.10.23.14.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:18:26 -0700 (PDT) From: luca.boccassi@gmail.com To: Rakesh Kudurumalla Cc: dpdk stable Subject: patch 'net/cnxk: fix Rx timestamp handling for VF' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:03 +0100 Message-ID: <20241023211704.1216956-23-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241023211704.1216956-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-1-luca.boccassi@gmail.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 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/25/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/8d056353d1a1c9000f7375825c3d4bad457ef8b1 Thanks. Luca Boccassi --- >From 8d056353d1a1c9000f7375825c3d4bad457ef8b1 Mon Sep 17 00:00:00 2001 From: Rakesh Kudurumalla Date: Tue, 1 Oct 2024 11:30:40 +0530 Subject: [PATCH] net/cnxk: fix Rx timestamp handling for VF [ upstream commit 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 ] When timestamp is enabled on PF in kernel and respective VF is attached to application in DPDK then mbuf_addr is getting corrupted in cnxk_nix_timestamp_dynfield() as "tstamp_dynfield_offset" is zero for PTP enabled PF This patch fixes the same. Fixes: 76dff63874e3 ("net/cnxk: support base PTP timesync") Signed-off-by: Rakesh Kudurumalla --- drivers/net/cnxk/cn10k_ethdev.c | 12 +++++++++++- drivers/net/cnxk/cn9k_ethdev.c | 12 +++++++++++- drivers/net/cnxk/cnxk_ethdev.c | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c index 4658713591..ed979d42af 100644 --- a/drivers/net/cnxk/cn10k_ethdev.c +++ b/drivers/net/cnxk/cn10k_ethdev.c @@ -381,7 +381,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn10k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -404,7 +404,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); } diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c index 3b702d9696..3243c9f82c 100644 --- a/drivers/net/cnxk/cn9k_ethdev.c +++ b/drivers/net/cnxk/cn9k_ethdev.c @@ -362,7 +362,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn9k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -385,7 +385,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); } diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 56b26a9650..73f59dede1 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1684,7 +1684,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) else cnxk_eth_dev_ops.timesync_disable(eth_dev); - if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || dev->ptp_en) { rc = rte_mbuf_dyn_rx_timestamp_register (&dev->tstamp.tstamp_dynfield_offset, &dev->tstamp.rx_tstamp_dynflag); -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:41.411028371 +0100 +++ 0023-net-cnxk-fix-Rx-timestamp-handling-for-VF.patch 2024-10-23 22:16:40.455941029 +0100 @@ -1 +1 @@ -From 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 Mon Sep 17 00:00:00 2001 +From 8d056353d1a1c9000f7375825c3d4bad457ef8b1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index ad6bc1ec21..46476e386a 100644 +index 4658713591..ed979d42af 100644 @@ -26 +27 @@ -@@ -473,7 +473,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -381,7 +381,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -35 +36 @@ -@@ -496,7 +496,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -404,7 +404,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -54 +55 @@ -index 84c88655f8..5417628368 100644 +index 3b702d9696..3243c9f82c 100644 @@ -57 +58 @@ -@@ -432,7 +432,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -362,7 +362,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -66 +67 @@ -@@ -455,7 +455,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -385,7 +385,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -85 +86 @@ -index 33bac55704..74b266ad58 100644 +index 56b26a9650..73f59dede1 100644 @@ -88 +89 @@ -@@ -1751,7 +1751,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) +@@ -1684,7 +1684,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev)