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 AA1CE45BB6 for ; Wed, 23 Oct 2024 23:18:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A22A4432A4; Wed, 23 Oct 2024 23:18:33 +0200 (CEST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id B9CBF432A4 for ; Wed, 23 Oct 2024 23:18:32 +0200 (CEST) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-37d49ffaba6so117525f8f.0 for ; Wed, 23 Oct 2024 14:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729718312; x=1730323112; 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=5S1KyhHY/9sVnKGSHaLo2kZq8KdsNZWahUmZeiqOc34=; b=Idh5gQCjJK3ZuK0ptCMC7frUHskwdlANV/rBVxTE53I/YwyRzUoHJuC6oIwcCjl8Mf uepgyvRsmTHsIwb/PAW7QPpbtGhtJUJQr90mjn6XjJ9gVVHY0jNWANZGh2r6yEduJDvq h+D8z+QtidaSwG4XiE2v2Zq4i/uJb0HxNY9fQ1MqPX+7WLURt8tt1JIV4XCxYsoL9KtH NX2m7DogkD6DnarNvOYmTQbuBVn9GRFmhsXz99o2QRxcqK/lbdR8cbbHQtNFYTgUDAsK XXlshrOcdKNRGQuW1GlcT4Ve08xnxPaUtw94DXwu3PoxgMUTU52Jrl2BO/YY+Xvr4duy MH5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729718312; x=1730323112; 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=5S1KyhHY/9sVnKGSHaLo2kZq8KdsNZWahUmZeiqOc34=; b=QbYgt5hZtIRw9DuVB/xkRSLdBZRqxZXl89usTCWfm11UAwr/EeLXjv9qwjtxlwLwto TNPewEvhDJXFdyFlou4zwi8NLp3zI+IlSCGCTvQQYammi77kwck8ckdZ0WsbPAdK6BrY 3qt8NhDpkxVRPV2xdItkLJrYy4wFFOrVfNvXt68i6vqBL7CjsFvYF28naOP3H8J9l3on M4/3uAuHD7lbT0RZu5dYbH5kjuYQ+NYHp749BOvjSPyyGDy3fh33mFGcO0mpuL240BIP stK4KyxQgXXK/c31M0pMiub7mS9y8tf3RyvZ9d1jeneYCY2brFmgwIc7pcjSSN3efhHw 0IuQ== X-Gm-Message-State: AOJu0Yzra5437H8c0sDvWF3+ntmdQw7IT1psSDe9y4xrcMm1pIzR8nbJ OKyNLhrVCPTVKODxYXbjzwAWUEmGqPctxBKvxcvK+tjEaVIIYNgE X-Google-Smtp-Source: AGHT+IFrGZdE5oNT/LuNLxtdmsozJ5AhBQAaqwbdkhw3GGAhl7bu/W2d+Mi4weSVivzW5Khtd0X5Cg== X-Received: by 2002:a5d:4bc9:0:b0:37d:3735:8fe7 with SMTP id ffacd0b85a97d-37efcf34846mr2442872f8f.32.1729718312214; Wed, 23 Oct 2024 14:18:32 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a5b813sm9715788f8f.58.2024.10.23.14.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 14:18:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Rakesh Kudurumalla Cc: dpdk stable Subject: patch 'event/cnxk: fix Rx timestamp handling' has been queued to stable release 22.11.7 Date: Wed, 23 Oct 2024 22:16:05 +0100 Message-ID: <20241023211704.1216956-25-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/082cd77172416b39740151f61c0559ec1a482335 Thanks. Luca Boccassi --- >From 082cd77172416b39740151f61c0559ec1a482335 Mon Sep 17 00:00:00 2001 From: Rakesh Kudurumalla Date: Tue, 1 Oct 2024 11:30:42 +0530 Subject: [PATCH] event/cnxk: fix Rx timestamp handling [ upstream commit 697883bcb0a84f06b52064ecbf60c619edbf9083 ] Handle timestamp correctly for VF when PTP is enabled before running application in event mode by updating RX offload flags in link up notification. Fixes: f1cdb3c5b616 ("net/cnxk: enable PTP for event Rx adapter") Signed-off-by: Rakesh Kudurumalla --- drivers/event/cnxk/cn10k_eventdev.c | 32 ++++++++++++++++++++++++ drivers/event/cnxk/cn9k_eventdev.c | 31 +++++++++++++++++++++++ drivers/event/cnxk/cnxk_eventdev_adptr.c | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index d8e7c83462..a1ddf402f1 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -864,12 +864,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem, u } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn10k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn10k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cn10k_eth_rxq *rxq; uint64_t meta_aura; void *lookup_mem; @@ -883,6 +911,10 @@ cn10k_sso_rx_adapter_queue_add( queue_conf); if (rc) return -EINVAL; + + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn10k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; meta_aura = rxq->meta_aura; diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 803e7ddd07..88bce7e675 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -981,12 +981,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem, } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn9k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn9k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn9k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cn9k_eth_rxq *rxq; void *lookup_mem; int rc; @@ -1000,6 +1028,9 @@ cn9k_sso_rx_adapter_queue_add( if (rc) return -EINVAL; + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn9k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; cn9k_sso_set_priv_mem(event_dev, lookup_mem, 0); diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c index e78d215630..8fcbd085a9 100644 --- a/drivers/event/cnxk/cnxk_eventdev_adptr.c +++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c @@ -212,7 +212,7 @@ static void cnxk_sso_tstamp_cfg(uint16_t port_id, struct cnxk_eth_dev *cnxk_eth_dev, struct cnxk_sso_evdev *dev) { - if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) + if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || cnxk_eth_dev->ptp_en) dev->tstamp[port_id] = &cnxk_eth_dev->tstamp; } -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-10-23 22:16:41.482503400 +0100 +++ 0025-event-cnxk-fix-Rx-timestamp-handling.patch 2024-10-23 22:16:40.459941185 +0100 @@ -1 +1 @@ -From 697883bcb0a84f06b52064ecbf60c619edbf9083 Mon Sep 17 00:00:00 2001 +From 082cd77172416b39740151f61c0559ec1a482335 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 697883bcb0a84f06b52064ecbf60c619edbf9083 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 5bd779990e..c8767a1b2b 100644 +index d8e7c83462..a1ddf402f1 100644 @@ -24 +25 @@ -@@ -842,12 +842,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) +@@ -864,12 +864,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem, u @@ -62,2 +62,0 @@ - struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); - struct roc_sso_hwgrp_stash stash; @@ -65 +64,3 @@ -@@ -862,6 +890,10 @@ cn10k_sso_rx_adapter_queue_add( + uint64_t meta_aura; + void *lookup_mem; +@@ -883,6 +911,10 @@ cn10k_sso_rx_adapter_queue_add( @@ -75 +76 @@ - cn10k_sso_set_priv_mem(event_dev, lookup_mem); + meta_aura = rxq->meta_aura; @@ -77 +78 @@ -index 28350d1275..377e910837 100644 +index 803e7ddd07..88bce7e675 100644 @@ -80 +81 @@ -@@ -911,12 +911,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) +@@ -981,12 +981,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem, @@ -121 +122 @@ -@@ -930,6 +958,9 @@ cn9k_sso_rx_adapter_queue_add( +@@ -1000,6 +1028,9 @@ cn9k_sso_rx_adapter_queue_add( @@ -130 +131 @@ - cn9k_sso_set_priv_mem(event_dev, lookup_mem); + cn9k_sso_set_priv_mem(event_dev, lookup_mem, 0); @@ -132 +133 @@ -index 2c049e7041..3cac42111a 100644 +index e78d215630..8fcbd085a9 100644 @@ -135 +136 @@ -@@ -213,7 +213,7 @@ static void +@@ -212,7 +212,7 @@ static void