[dpdk-dev,2/4] bus/dpaa: fix registering dpaa mempool ops

Message ID 1517808117-28562-2-git-send-email-nipun.gupta@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nipun Gupta Feb. 5, 2018, 5:21 a.m. UTC
  Fixes: 2bd0d5b951a9 ("bus/dpaa: register platform HW mempool on runtime")

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Comments

Santosh Shukla Feb. 5, 2018, 5:36 a.m. UTC | #1
On Monday 05 February 2018 10:51 AM, Nipun Gupta wrote:
> Fixes: 2bd0d5b951a9 ("bus/dpaa: register platform HW mempool on runtime")
>
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
>  drivers/bus/dpaa/dpaa_bus.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
> index 1946bbe..290b967 100644
> --- a/drivers/bus/dpaa/dpaa_bus.c
> +++ b/drivers/bus/dpaa/dpaa_bus.c
> @@ -495,10 +495,16 @@ int rte_dpaa_portal_fq_close(struct qman_fq *fq)
>  			ret = drv->probe(drv, dev);
>  			if (ret)
>  				DPAA_BUS_ERR("Unable to probe.\n");
> +
>  			break;
>  		}
>  	}
> -	rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
> +
> +	/* Register DPAA mempool ops only if any DPAA device has
> +	 * been detected.
> +	 */
> +	if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
> +		rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
>  

change will fix octeontx regression introduced by eal mempool patch.
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
  
Shreyansh Jain Feb. 5, 2018, 6:31 a.m. UTC | #2
> -----Original Message-----
> From: Nipun Gupta
> Sent: Monday, February 5, 2018 10:52 AM
> To: thomas@monjalon.net; jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; santosh.shukla@caviumnetworks.com; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Shreyansh Jain <shreyansh.jain@nxp.com>;
> Sunil Kumar Kori <sunil.kori@nxp.com>; Nipun Gupta
> <nipun.gupta@nxp.com>
> Subject: [PATCH 2/4] bus/dpaa: fix registering dpaa mempool ops
> 
> Fixes: 2bd0d5b951a9 ("bus/dpaa: register platform HW mempool on
> runtime")
> 
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
>  drivers/bus/dpaa/dpaa_bus.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
> index 1946bbe..290b967 100644
> --- a/drivers/bus/dpaa/dpaa_bus.c
> +++ b/drivers/bus/dpaa/dpaa_bus.c
> @@ -495,10 +495,16 @@ int rte_dpaa_portal_fq_close(struct qman_fq *fq)
>                         ret = drv->probe(drv, dev);
>                         if (ret)
>                                 DPAA_BUS_ERR("Unable to probe.\n");
> +
>                         break;
>                 }
>         }
> -       rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
> +
> +       /* Register DPAA mempool ops only if any DPAA device has
> +        * been detected.
> +        */
> +       if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
> +
> rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
> 
>         svr_file = fopen(DPAA_SOC_ID_FILE, "r");
>         if (svr_file) {
> --
> 1.9.1
> 

Just a note: there is an extra line insertion in this patch which is not related to the patch fix. Though, I think that makes the code more readable as preceding if() for this new line is without {}.

Acked-by: Shreyansh Jain <Shreyansh.jain@nxp.com>
  

Patch

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 1946bbe..290b967 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -495,10 +495,16 @@  int rte_dpaa_portal_fq_close(struct qman_fq *fq)
 			ret = drv->probe(drv, dev);
 			if (ret)
 				DPAA_BUS_ERR("Unable to probe.\n");
+
 			break;
 		}
 	}
-	rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
+
+	/* Register DPAA mempool ops only if any DPAA device has
+	 * been detected.
+	 */
+	if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
+		rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
 	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
 	if (svr_file) {