bus/dpaa: save fq lookup table for secondary process
authorAkhil Goyal <akhil.goyal@nxp.com>
Tue, 26 Mar 2019 12:01:44 +0000 (12:01 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 29 Mar 2019 13:33:23 +0000 (14:33 +0100)
A reference to qman_fq_lookup_table need to be saved in each
fq, so that it is retrieved while in running secondary process.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/bus/dpaa/base/qbman/qman.c
drivers/bus/dpaa/include/fsl_qman.h
drivers/bus/dpaa/rte_bus_dpaa_version.map
drivers/net/dpaa/dpaa_ethdev.c

index dc64d08..c6f7d7b 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2017 NXP
+ * Copyright 2017,2019 NXP
  *
  */
 
@@ -167,6 +167,11 @@ int qman_setup_fq_lookup_table(size_t num_entries)
        return 0;
 }
 
+void qman_set_fq_lookup_table(void **fq_table)
+{
+       qman_fq_lookup_table = fq_table;
+}
+
 /* global structure that maintains fq object mapping */
 static DEFINE_SPINLOCK(fq_hash_table_lock);
 
@@ -1408,6 +1413,7 @@ int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq)
                pr_info("Find empty table entry failed\n");
                return -ENOMEM;
        }
+       fq->qman_fq_lookup_table = qman_fq_lookup_table;
 #endif
        if (!(flags & QMAN_FQ_FLAG_AS_IS) || (flags & QMAN_FQ_FLAG_NO_MODIFY))
                return 0;
index e438414..ef598cc 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
+ * Copyright 2019 NXP
  *
  */
 
@@ -1233,6 +1234,7 @@ struct qman_fq {
 
        struct rb_node node;
 #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+       void **qman_fq_lookup_table;
        u32 key;
 #endif
 };
@@ -1307,6 +1309,10 @@ struct qman_cgr {
 #define QMAN_CGR_FLAG_USE_INIT       0x00000001
 #define QMAN_CGR_MODE_FRAME          0x00000001
 
+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+void qman_set_fq_lookup_table(void **table);
+#endif
+
 /**
  * qman_get_portal_index - get portal configuration index
  */
index 70076c7..c88deaf 100644 (file)
@@ -116,3 +116,10 @@ DPDK_18.11 {
 
        local: *;
 } DPDK_18.08;
+
+DPDK_19.05 {
+       global:
+       qman_set_fq_lookup_table;
+
+       local: *;
+} DPDK_18.11;
index ba66aa2..d42ac62 100644 (file)
@@ -1225,11 +1225,17 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
 
        PMD_INIT_FUNC_TRACE();
 
+       dpaa_intf = eth_dev->data->dev_private;
        /* For secondary processes, the primary has done all the work */
        if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
                eth_dev->dev_ops = &dpaa_devops;
                /* Plugging of UCODE burst API not supported in Secondary */
                eth_dev->rx_pkt_burst = dpaa_eth_queue_rx;
+               eth_dev->tx_pkt_burst = dpaa_eth_queue_tx;
+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
+               qman_set_fq_lookup_table(
+                               dpaa_intf->rx_queues->qman_fq_lookup_table);
+#endif
                return 0;
        }