baseband/la12xx: fix issue with secondary process

Message ID 20240702060921.3660623-1-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series baseband/la12xx: fix issue with secondary process |

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-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Hemant Agrawal July 2, 2024, 6:09 a.m. UTC
The la12xx driver do not have any checks for secondary process
and it causes the system to try to initialize the driver, causing
segmentation faults.
LA12xx driver do not support multi-processing.
Return when not called from Primary process.

Fixes: f218a1f92017 ("baseband/la12xx: introduce NXP LA12xx driver")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/baseband/la12xx/bbdev_la12xx.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Maxime Coquelin July 2, 2024, 7:38 a.m. UTC | #1
On 7/2/24 08:09, Hemant Agrawal wrote:
> The la12xx driver do not have any checks for secondary process
> and it causes the system to try to initialize the driver, causing
> segmentation faults.
> LA12xx driver do not support multi-processing.
> Return when not called from Primary process.
> 
> Fixes: f218a1f92017 ("baseband/la12xx: introduce NXP LA12xx driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>   drivers/baseband/la12xx/bbdev_la12xx.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
> index bb754a5395..1a56e73abd 100644
> --- a/drivers/baseband/la12xx/bbdev_la12xx.c
> +++ b/drivers/baseband/la12xx/bbdev_la12xx.c
> @@ -1084,6 +1084,9 @@ la12xx_bbdev_remove(struct rte_vdev_device *vdev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return 0;
> +
>   	if (vdev == NULL)
>   		return -EINVAL;
>   

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin July 5, 2024, 7:48 a.m. UTC | #2
On 7/2/24 08:09, Hemant Agrawal wrote:
> The la12xx driver do not have any checks for secondary process
> and it causes the system to try to initialize the driver, causing
> segmentation faults.
> LA12xx driver do not support multi-processing.
> Return when not called from Primary process.
> 
> Fixes: f218a1f92017 ("baseband/la12xx: introduce NXP LA12xx driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>   drivers/baseband/la12xx/bbdev_la12xx.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
> index bb754a5395..1a56e73abd 100644
> --- a/drivers/baseband/la12xx/bbdev_la12xx.c
> +++ b/drivers/baseband/la12xx/bbdev_la12xx.c
> @@ -1084,6 +1084,9 @@ la12xx_bbdev_remove(struct rte_vdev_device *vdev)
>   
>   	PMD_INIT_FUNC_TRACE();
>   
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return 0;
> +
>   	if (vdev == NULL)
>   		return -EINVAL;
>   

Applied to next-baseband/for-main.

Thanks,
Maxime
  

Patch

diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
index bb754a5395..1a56e73abd 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx.c
+++ b/drivers/baseband/la12xx/bbdev_la12xx.c
@@ -1084,6 +1084,9 @@  la12xx_bbdev_remove(struct rte_vdev_device *vdev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return 0;
+
 	if (vdev == NULL)
 		return -EINVAL;