From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDC2DA0A02; Thu, 14 Jan 2021 17:14:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1059141398; Thu, 14 Jan 2021 17:14:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 736CA141397 for ; Thu, 14 Jan 2021 17:14:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610640887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hrI5Nj/AY7jhIJCPssRggV/F8mA02QA4S98CKUw1yrg=; b=OvXPQJwyMNLk2qQheREUkoNyXv6MwnesQ+Fr8xHiTpoSHgvwhutP01XsrGUo1eNCS/7NXv c5ixnACezxOB/MVA+embvutr6gcdGyi98j0cmTc6Jp9uAQAsstxj3Oo+HOsPwCwS3S0rGX AQiPxT5GVuRtXmV+377Pa7WaX1vu6E0= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-aGGYVaAqPBmxBBVEto6nXA-1; Thu, 14 Jan 2021 11:14:44 -0500 X-MC-Unique: aGGYVaAqPBmxBBVEto6nXA-1 Received: by mail-vs1-f70.google.com with SMTP id d1so943250vsp.20 for ; Thu, 14 Jan 2021 08:14:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hrI5Nj/AY7jhIJCPssRggV/F8mA02QA4S98CKUw1yrg=; b=Y0d7yTH9GMjQlB6f8YsDDg1wfpet1MWX/lc4ny1KsZ+igl6vwjeDrbMVV5WaOEagsw CDgGYLsMcHYyXfdkuTY6J4No+c/YeV9ZWsCUYQ7vmpu12raEywXrzrgULraDuP/G6Epy vdvFp2mzpaW3B4pIRCfpgz6tgnGcY90dG/AiO3CEaaFtJQ7O0j1pKf9pfEbueu1wuRl4 Skeal8+cmljyTqFE6+x9QOfjLd7/aS5JETal4S9Npi0TI4RW9ETprthVr1llIX1a7jHq GS6g2QCS7TJK0BZObd9SAlJ0BGkNMYFbA5nN4N5z1Z7Uh881fg7u9QMkBjM4cU8vo6cj 2JMw== X-Gm-Message-State: AOAM531L44QfCDHU11F0mro6FoSADqLu6QZ+6DyGl+QxoUs+nZ8u7TZP /bTrp2q7xlY6jyawTULjYpXYtM4Gnx4ZY3XFM4CJNzYEp+J3qgS/KNK55udsCtABnFNGHgQt+4t z8f35A8RNjeCk7T/uyWE= X-Received: by 2002:ab0:43a1:: with SMTP id l30mr6287948ual.126.1610640884125; Thu, 14 Jan 2021 08:14:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvt6Yq/8UVVD73NQwohOQtz/2leeVOPSfK7tD13TzSaUZrsAe2hBhoFXqDlQ6MJAoqxIgJH26Zl5HmsHmC6lk= X-Received: by 2002:ab0:43a1:: with SMTP id l30mr6287920ual.126.1610640883924; Thu, 14 Jan 2021 08:14:43 -0800 (PST) MIME-Version: 1.0 References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-6-maxime.coquelin@redhat.com> <774eb1f0-585e-f114-fe91-546673e7375e@redhat.com> In-Reply-To: <774eb1f0-585e-f114-fe91-546673e7375e@redhat.com> From: David Marchand Date: Thu, 14 Jan 2021 17:14:32 +0100 Message-ID: To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Olivier Matz , Adrian Moreno Zapata Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 05/40] net/virtio: move PCI device init in dedicated file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jan 14, 2021 at 5:04 PM Maxime Coquelin wrote: > On 1/5/21 10:19 PM, David Marchand wrote: > >> static bool > >> rx_offload_enabled(struct virtio_hw *hw) > >> @@ -2521,7 +2419,7 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev) > >> /* > >> * Stop device: disable interrupt and mark link down > >> */ > >> -static int > >> +int > >> virtio_dev_stop(struct rte_eth_dev *dev) > >> { > >> struct virtio_hw *hw = dev->data->dev_private; > >> @@ -2673,7 +2571,5 @@ __rte_unused uint8_t is_rx) > >> } > >> > >> RTE_PMD_EXPORT_NAME(net_virtio, __COUNTER__); > > > > This belongs with the rest of the pci driver declarations. > > > > $ ./usertools/dpdk-pmdinfo.py > > $HOME/builds/build-gcc-shared/drivers/librte_net_virtio.so > > PMD NAME: net_virtio_user > > PMD PARAMETERS: path= mac= cq= queue_size= > > queues= iface= server=<0|1> mrg_rxbuf=<0|1> > > in_order=<0|1> packed_vq=<0|1> speed= vectorized=<0|1> > > > > PMD NAME: net_virtio > > > > ^^^ > > Here, I would expect the pci table and the kmod dependencies. > > > > > > This makes me realise that the net_virtio_user driver is not exported > > (but it seems to work without it.. interesting). > > As discussed offlist, I have moved RTE_PMD_EXPORT_NAME to > virtio_pci_ethdev.c, and I now get expected output: Some details, if someone is interested: In the pci driver case, we can't rely on the pci bus register macro because of the custom constructor, hence the manual call to RTE_PMD_EXPORT_NAME. For the virtio_user driver, the vdev bus register macro actually exports the driver and this is why it works fine. > > $ ./usertools/dpdk-pmdinfo.py build/drivers/librte_net_virtio.so > PMD NAME: net_virtio_user > PMD PARAMETERS: path= mac= cq= queue_size= > queues= iface= server=<0|1> mrg_rxbuf=<0|1> in_order=<0|1> > packed_vq=<0|1> speed= vectorized=<0|1> > > PMD NAME: net_virtio > PMD KMOD DEPENDENCIES: * igb_uio | uio_pci_generic | vfio-pci > PMD HW SUPPORT: > Red Hat, Inc. (1af4) : Virtio network device (1000) (All Subdevices) > Red Hat, Inc. (1af4) : Virtio network device (1041) (All Subdevices) [snip] > >> +static int eth_virtio_pci_remove(struct rte_pci_device *pci_dev) > >> +{ > >> + int ret; > >> + > >> + ret = rte_eth_dev_pci_generic_remove(pci_dev, eth_virtio_pci_uninit); > >> + /* Port has already been released by close. */ > >> + if (ret == -ENODEV) > >> + ret = 0; > >> + return ret; > >> +} > >> + > >> +static struct rte_pci_driver rte_virtio_pmd = { > > > > This seems too generic. > > > > virtio_pci_pmd ? > > virtio_net_pci_pmd is even better. > > > > >> + .driver = { > >> + .name = "net_virtio", > > I keept it as is here not to break tools relying on driver name. > Makes sense? Yes. > > >> + }, > >> + .id_table = pci_id_virtio_map, > >> + .drv_flags = 0, > >> + .probe = eth_virtio_pci_probe, > >> + .remove = eth_virtio_pci_remove, > >> +}; > >> + > >> +RTE_INIT(rte_virtio_pmd_init) > > > > virtio_pci_pmd_init ? > > > > rte_virtio_net_pci_pmd_init Ok for me. Thanks Maxime. -- David Marchand