bus/dpaa: add accessor for qman portal ids
authorHemant Agrawal <hemant.agrawal@nxp.com>
Fri, 15 May 2020 09:47:48 +0000 (15:17 +0530)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 19 May 2020 13:49:53 +0000 (15:49 +0200)
qman caam and pool portal ids are only used in control
path. This patch changes their inter library access to
function call instead of direct shared variable.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
drivers/bus/dpaa/base/qbman/qman_driver.c
drivers/bus/dpaa/include/fsl_qman.h
drivers/bus/dpaa/rte_bus_dpaa_version.map
drivers/crypto/dpaa_sec/dpaa_sec.c

index 69244ef..1166d68 100644 (file)
@@ -30,6 +30,16 @@ static __thread struct dpaa_ioctl_portal_map map = {
        .type = dpaa_portal_qman
 };
 
+u16 dpaa_get_qm_channel_caam(void)
+{
+       return qm_channel_caam;
+}
+
+u16 dpaa_get_qm_channel_pool(void)
+{
+       return qm_channel_pool1;
+}
+
 static int fsl_qman_portal_init(uint32_t index, int is_shared)
 {
        struct qman_portal *portal;
index 4411bb0..78b698f 100644 (file)
@@ -44,6 +44,12 @@ enum qm_dc_portal {
        qm_dc_portal_pme = 3
 };
 
+__rte_internal
+u16 dpaa_get_qm_channel_caam(void);
+
+__rte_internal
+u16 dpaa_get_qm_channel_pool(void);
+
 /* Portal processing (interrupt) sources */
 #define QM_PIRQ_CCSCI  0x00200000      /* CEETM Congestion State Change */
 #define QM_PIRQ_CSCI   0x00100000      /* Congestion State Change */
@@ -65,7 +71,7 @@ enum qm_dc_portal {
 /* for conversion from n of qm_channel */
 static inline u32 QM_SDQCR_CHANNELS_POOL_CONV(u16 channel)
 {
-       return QM_SDQCR_CHANNELS_POOL(channel + 1 - qm_channel_pool1);
+       return QM_SDQCR_CHANNELS_POOL(channel + 1 - dpaa_get_qm_channel_pool());
 }
 
 /* For qman_volatile_dequeue(); Choose one PRECEDENCE. EXACT is optional. Use
index 5373228..8bb2757 100644 (file)
@@ -12,6 +12,8 @@ INTERNAL {
        bman_query_free_buffers;
        bman_release;
        bman_thread_irq;
+       dpaa_get_qm_channel_caam;
+       dpaa_get_qm_channel_pool;
        dpaa_logtype_eventdev;
        dpaa_logtype_mempool;
        dpaa_logtype_pmd;
@@ -50,8 +52,6 @@ INTERNAL {
        netcfg_release;
        per_lcore_dpaa_io;
        per_lcore_held_bufs;
-       qm_channel_caam;
-       qm_channel_pool1;
        qman_alloc_cgrid_range;
        qman_alloc_pool_range;
        qman_clear_irq;
index a9bfb86..66ee0ba 100644 (file)
@@ -121,7 +121,7 @@ dpaa_sec_init_rx(struct qman_fq *fq_in, rte_iova_t hwdesc,
 
        qm_fqd_context_a_set64(&fq_opts.fqd, hwdesc);
        fq_opts.fqd.context_b = fqid_out;
-       fq_opts.fqd.dest.channel = qm_channel_caam;
+       fq_opts.fqd.dest.channel = dpaa_get_qm_channel_caam();
        fq_opts.fqd.dest.wq = 0;
 
        fq_in->cb.ern  = ern_sec_fq_handler;