[v6,1/1] net/hinic: fix secondary process issue

Message ID b30aaa307cd37872cc1dc295591c14addc0ac84b.1574165403.git.cloud.wangxiaoyun@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Fix secondary process issue |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Wangxiaoyun (Cloud) Nov. 19, 2019, 12:31 p.m. UTC
  The secondary process does not need to register interrupt handle,
remove rte_intr_callback_register from secondary process branch.

Fixes: 06b6a81bbabf ("net/hinic: document missing features")
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
  

Comments

Ferruh Yigit Nov. 19, 2019, 3:21 p.m. UTC | #1
On 11/19/2019 12:31 PM, Xiaoyun wang wrote:
> The secondary process does not need to register interrupt handle,
> remove rte_intr_callback_register from secondary process branch.
> 
> Fixes: 06b6a81bbabf ("net/hinic: document missing features")

I can see above patch documents the "Multiprocess aware" feature, but not sure
if this patch is a fix for that commit.
Is there any commit that introduces/cause the defect in the code?

> Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
> ---
>  drivers/net/hinic/hinic_pmd_ethdev.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
> index ddfe082..803a39e 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -2964,14 +2964,10 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)
>  
>  	/* EAL is SECONDARY and eth_dev is already created */
>  	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> -		rc = rte_intr_callback_register(&pci_dev->intr_handle,
> -						hinic_dev_interrupt_handler,
> -						(void *)eth_dev);
> -		if (rc)
> -			PMD_DRV_LOG(ERR, "Initialize %s failed in secondary process",
> -				    eth_dev->data->name);
> +		PMD_DRV_LOG(INFO, "Initialize %s in secondary process",
> +			    eth_dev->data->name);
>  
> -		return rc;
> +		return 0;
>  	}
>  
>  	nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
>
  
Ferruh Yigit Nov. 20, 2019, 12:58 p.m. UTC | #2
On 11/19/2019 3:21 PM, Ferruh Yigit wrote:
> On 11/19/2019 12:31 PM, Xiaoyun wang wrote:
>> The secondary process does not need to register interrupt handle,
>> remove rte_intr_callback_register from secondary process branch.
>>
>> Fixes: 06b6a81bbabf ("net/hinic: document missing features")
> 
> I can see above patch documents the "Multiprocess aware" feature, but not sure
> if this patch is a fix for that commit.
> Is there any commit that introduces/cause the defect in the code?

Using following fixes line, to be able to proceed with patch for rc3:

Fixes: 64727024d2fd ("net/hinic: add device initialization")

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index ddfe082..803a39e 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -2964,14 +2964,10 @@  static int hinic_func_init(struct rte_eth_dev *eth_dev)
 
 	/* EAL is SECONDARY and eth_dev is already created */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
-		rc = rte_intr_callback_register(&pci_dev->intr_handle,
-						hinic_dev_interrupt_handler,
-						(void *)eth_dev);
-		if (rc)
-			PMD_DRV_LOG(ERR, "Initialize %s failed in secondary process",
-				    eth_dev->data->name);
+		PMD_DRV_LOG(INFO, "Initialize %s in secondary process",
+			    eth_dev->data->name);
 
-		return rc;
+		return 0;
 	}
 
 	nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);