DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wangxiaoyun (Cloud)" <cloud.wangxiaoyun@huawei.com>
To: Qingqing Li <liqingqing3@huawei.com>, <dev@dpdk.org>,
	<zhouguoyang@huawei.com>, <ferruh.yigit@intel.com>
Cc: Hushiyuan <hushiyuan@huawei.com>, <yin.yinshi@huawei.com>,
	<xuanziyang2@huawei.com>
Subject: Re: [dpdk-dev] [v4]net/hinic: fix coredump when the scondary process using the hinic port.
Date: Thu, 12 Nov 2020 10:11:08 +0800	[thread overview]
Message-ID: <0a7d71fa-86f3-d8d0-3e77-1edfa6d5faf5@huawei.com> (raw)
In-Reply-To: <ad3c9e64-5817-731d-1426-8239980d668f@huawei.com>

Hi Ferruh,

Align with Qingqing Li, this path will not apply to dpdk master now, some dev_ops may
casue fail when run in secondary proc, so need to modify it later and add tests for other
dev_ops.

Thanks

在 2020/10/31 18:10, Qingqing Li 写道:
> fix coredump when secondary process using the hinic port. the
> reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".
> 
> Signed-off-by: Qingqing Li <liqingqing3@huawei.com>
> ---
> v4: adapt to the latest version.
> ---
> v3: update the signed-off information.
> ---
> v2:  solve the coding style issue.
> Signed-off-by: liqingqing <liqingqing3@huawei.com>
> ---
>   drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------
>   1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
> index b694fd83c..526dafdad 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)
> 
>       pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> 
> -    /* EAL is SECONDARY and eth_dev is already created */
> -    if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> -        PMD_DRV_LOG(INFO, "Initialize %s in secondary process",
> -                eth_dev->data->name);
> -
> -        return 0;
> -    }
> -
>       eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
> 
>       nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
> @@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev)
>       eth_dev->rx_pkt_burst = hinic_recv_pkts;
>       eth_dev->tx_pkt_burst = hinic_xmit_pkts;
> 
> +    /* EAL is SECONDARY and eth_dev is already created */
> +    if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> +        PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name);
> +
> +        struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
> +        if (HINIC_IS_VF(nic_dev->hwdev))
> +            eth_dev->dev_ops = &hinic_pmd_vf_ops;
> +        else
> +            eth_dev->dev_ops = &hinic_pmd_ops;
> +        return 0;
> +    }
> +
>       return hinic_func_init(eth_dev);
>   }
> 

  reply	other threads:[~2020-11-12  2:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  9:38 [dpdk-dev] [v3]net/hinic: " Qingqing Li
2020-10-31 10:01 ` [dpdk-dev] [v4]net/hinic: " Qingqing Li
2020-10-31 10:10   ` Qingqing Li
2020-11-12  2:11     ` Wangxiaoyun (Cloud) [this message]
2020-11-12  9:26       ` Ferruh Yigit
2020-11-12 12:30         ` Wangxiaoyun (Cloud)
2020-11-12 12:39           ` Ferruh Yigit
2021-03-18  6:12           ` Wangxiaoyun (Cloud)
2021-03-22  9:04             ` Ferruh Yigit
2020-10-31 10:23   ` Qingqing Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a7d71fa-86f3-d8d0-3e77-1edfa6d5faf5@huawei.com \
    --to=cloud.wangxiaoyun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hushiyuan@huawei.com \
    --cc=liqingqing3@huawei.com \
    --cc=xuanziyang2@huawei.com \
    --cc=yin.yinshi@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).