From: "Wang, YuanX" <yuanx.wang@intel.com>
To: "Xia, Chenbo" <chenbo.xia@intel.com>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Hu, Jiayu" <jiayu.hu@intel.com>,
"He, Xingguang" <xingguang.he@intel.com>
Subject: RE: [PATCH] net/virtio: unmap PCI device in secondary process
Date: Mon, 30 May 2022 10:03:22 +0000 [thread overview]
Message-ID: <CO1PR11MB48975EC2C5F8498F9A9048C185DD9@CO1PR11MB4897.namprd11.prod.outlook.com> (raw)
In-Reply-To: <SN6PR11MB3504D9E1E19F31A00C6569B59CDD9@SN6PR11MB3504.namprd11.prod.outlook.com>
Hi Chenbo,
> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Monday, May 30, 2022 10:49 AM
> To: Wang, YuanX <yuanx.wang@intel.com>; maxime.coquelin@redhat.com
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; He, Xingguang
> <xingguang.he@intel.com>
> Subject: RE: [PATCH] net/virtio: unmap PCI device in secondary process
>
> > -----Original Message-----
> > From: Wang, YuanX <yuanx.wang@intel.com>
> > Sent: Thursday, April 21, 2022 7:16 PM
> > To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> > Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; He, Xingguang
> > <xingguang.he@intel.com>; Wang, YuanX <yuanx.wang@intel.com>
> > Subject: [PATCH] net/virtio: unmap PCI device in secondary process
> >
> > In multi-process, the secondary process will remap PCI during
> > initialization, but the mapping is not removed in the uninit path, the
> > device is not closed, and the device busy error will be reported when
> > the device is hotplugged.
> >
> > This patch unmap PCI device at secondary process uninitialization
>
> unmaps
>
> > based on virtio_rempa_pci().
>
> Virtio_remap_pci
>
> >
> > Fixes: 36a7a2e7a53 ("net/virtio: move PCI device init in dedicated
> > file")
>
> Miss cc-stable tag. Patch LGTM
Thanks, will fix it in next version.
Regards,
Yuan
>
> Thanks,
> Chenbo
>
> >
> > Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> > ---
> > drivers/net/virtio/virtio_pci_ethdev.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/virtio/virtio_pci_ethdev.c
> > b/drivers/net/virtio/virtio_pci_ethdev.c
> > index 54645dc62e..1f6bdeddda 100644
> > --- a/drivers/net/virtio/virtio_pci_ethdev.c
> > +++ b/drivers/net/virtio/virtio_pci_ethdev.c
> > @@ -122,10 +122,20 @@ static int
> > eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev) {
> > int ret;
> > + struct virtio_pci_dev *dev;
> > + struct virtio_hw *hw;
> > PMD_INIT_FUNC_TRACE();
> >
> > - if (rte_eal_process_type() == RTE_PROC_SECONDARY)
> > + if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
> > + dev = eth_dev->data->dev_private;
> > + hw = &dev->hw;
> > +
> > + if (dev->modern)
> > +
> rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev));
> > + else
> > + vtpci_legacy_ioport_unmap(hw);
> > return 0;
> > + }
> >
> > ret = virtio_dev_stop(eth_dev);
> > virtio_dev_close(eth_dev);
> > --
> > 2.25.1
next prev parent reply other threads:[~2022-05-30 10:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 11:15 Yuan Wang
2022-04-22 9:25 ` Ling, WeiX
2022-05-30 2:49 ` Xia, Chenbo
2022-05-30 10:03 ` Wang, YuanX [this message]
2022-06-06 15:55 ` [PATCH v2] " Yuan Wang
2022-06-06 9:24 ` Ling, WeiX
2022-06-20 3:37 ` Xia, Chenbo
2022-06-20 9:53 ` Wang, YuanX
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=CO1PR11MB48975EC2C5F8498F9A9048C185DD9@CO1PR11MB4897.namprd11.prod.outlook.com \
--to=yuanx.wang@intel.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=xingguang.he@intel.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).