[v2,17/17] event/cnxk: handle inbound out of place processing

Message ID 20241001060055.3747591-17-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2,01/17] net/cnxk: added telemetry support do dump SA information |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Nithin Dabilpuram Oct. 1, 2024, 6 a.m. UTC
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>

update event device with NIX_RX_REAS_F to handle
out of place processing for boards that does not
support reassembly as cn10k driver process OOP
with NIX_RX_REAS_F enabled.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/event/cnxk/cn10k_eventdev.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
  

Comments

Jerin Jacob Oct. 3, 2024, 7:24 a.m. UTC | #1
On Tue, Oct 1, 2024 at 11:33 AM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>
> update event device with NIX_RX_REAS_F to handle
> out of place processing for boards that does not
> support reassembly as cn10k driver process OOP
> with NIX_RX_REAS_F enabled.
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

Updated the git commit with fixes, applied the following change and
applied series to dpdk-next-net-mrvl/for-main. Thanks

[for-main]dell[dpdk-next-net-mrvl] $ git diff
diff --git a/drivers/net/cnxk/rte_pmd_cnxk.h b/drivers/net/cnxk/rte_pmd_cnxk.h
index a20b4f277d..b186b529fa 100644
--- a/drivers/net/cnxk/rte_pmd_cnxk.h
+++ b/drivers/net/cnxk/rte_pmd_cnxk.h
@@ -56,7 +56,7 @@ enum rte_pmd_cnxk_cpt_q_stats_type {
         */
        RTE_PMD_CNXK_CPT_Q_STATS_KERNEL,
        /** Type to get CPT queue which is attached to ethdev statistics */
-       RTE_PMD_CNXK_CPT_Q_STATS_ETHDEV = 2,
+       RTE_PMD_CNXK_CPT_Q_STATS_ETHDEV,
 };

 /** CPT queue hardware statistics */
@@ -617,7 +617,7 @@ union rte_pmd_cnxk_ipsec_hw_sa
*rte_pmd_cnxk_hw_session_base_get(uint16_t portid
  *   Determines the type of SA to be flushed, Inbound or Outbound.
  *
  * @return
- *   0 upon success, a negative errno value otherwise.
+ *   0 Upon success, a negative errno value otherwise.
  */
 __rte_experimental
 int rte_pmd_cnxk_sa_flush(uint16_t portid, union
rte_pmd_cnxk_ipsec_hw_sa *sess, bool inb);
@@ -663,7 +663,7 @@ uint16_t rte_pmd_cnxk_inl_dev_submit(struct
rte_pmd_cnxk_inl_dev_q *qptr, void *
  *   The index of the queue of a given type.
  *
  * @return
- *   0 upon success, a negative errno value otherwise.
+ *   0 Upon success, a negative errno value otherwise.
  */
 __rte_experimental
 int rte_pmd_cnxk_cpt_q_stats_get(uint16_t portid, enum
rte_pmd_cnxk_cpt_q_stats_type type,
[for-main]dell[dpdk-next-net-mrvl] $
  

Patch

diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c
index 229d7a03fe..4e2968f91e 100644
--- a/drivers/event/cnxk/cn10k_eventdev.c
+++ b/drivers/event/cnxk/cn10k_eventdev.c
@@ -826,7 +826,7 @@  cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem)
 }
 
 static void
-eventdev_fops_tstamp_update(struct rte_eventdev *event_dev)
+eventdev_fops_update(struct rte_eventdev *event_dev)
 {
 	struct rte_event_fp_ops *fp_op =
 		rte_event_fp_ops + event_dev->data->dev_id;
@@ -849,7 +849,20 @@  cn10k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en)
 	else
 		evdev->tstamp[port_id] = NULL;
 	cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
-	eventdev_fops_tstamp_update(event_dev);
+	eventdev_fops_update(event_dev);
+}
+
+static void
+cn10k_sso_rx_offload_cb(uint16_t port_id, uint64_t flags)
+{
+	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;
+	cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
+	eventdev_fops_update(event_dev);
 }
 
 static int
@@ -1224,6 +1237,7 @@  cn10k_sso_init(struct rte_eventdev *event_dev)
 		return rc;
 	}
 
+	cnxk_ethdev_rx_offload_cb_register(cn10k_sso_rx_offload_cb);
 	event_dev->dev_ops = &cn10k_sso_dev_ops;
 	/* For secondary processes, the primary has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {