[v2,02/25] net/nfp: make VF PMD using of NFP common module
Checks
Commit Message
Modify the logic of NFP VF PMD, make it using of the NFP common module
and link into the 'nfp_drivers_list'.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/meson.build | 6 +++++-
drivers/net/nfp/nfp_ethdev_vf.c | 14 ++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
Comments
On 10/24/2023 3:28 AM, Chaoyong He wrote:
> Modify the logic of NFP VF PMD, make it using of the NFP common module
> and link into the 'nfp_drivers_list'.
>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
> ---
> drivers/net/nfp/meson.build | 6 +++++-
> drivers/net/nfp/nfp_ethdev_vf.c | 14 ++++++++++----
> 2 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
> index 40e9ef8524..f8581403fa 100644
> --- a/drivers/net/nfp/meson.build
> +++ b/drivers/net/nfp/meson.build
> @@ -40,4 +40,8 @@ sources = files(
> 'nfp_rxtx.c',
> )
>
> -deps += ['hash', 'security']
> +deps += ['hash', 'security', 'common_nfp']
> +
> +if not dpdk_conf.has('RTE_COMMON_NFP')
> + error('Missing internal dependency "common/nfp"')
> +endif
>
This will break the build for the cases 'common/nfp' is disabled, above
'deps' updates should be sufficient, which should prevent to build the
driver when 'common/nfp' is missing, instead of failing.
So can you please drop above check.
> On 10/24/2023 3:28 AM, Chaoyong He wrote:
> > Modify the logic of NFP VF PMD, make it using of the NFP common module
> > and link into the 'nfp_drivers_list'.
> >
> > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> > Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
> > Reviewed-by: Long Wu <long.wu@corigine.com>
> > Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
> > ---
> > drivers/net/nfp/meson.build | 6 +++++-
> > drivers/net/nfp/nfp_ethdev_vf.c | 14 ++++++++++----
> > 2 files changed, 15 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
> > index 40e9ef8524..f8581403fa 100644
> > --- a/drivers/net/nfp/meson.build
> > +++ b/drivers/net/nfp/meson.build
> > @@ -40,4 +40,8 @@ sources = files(
> > 'nfp_rxtx.c',
> > )
> >
> > -deps += ['hash', 'security']
> > +deps += ['hash', 'security', 'common_nfp']
> > +
> > +if not dpdk_conf.has('RTE_COMMON_NFP')
> > + error('Missing internal dependency "common/nfp"') endif
> >
>
> This will break the build for the cases 'common/nfp' is disabled, above 'deps'
> updates should be sufficient, which should prevent to build the driver when
> 'common/nfp' is missing, instead of failing.
>
> So can you please drop above check.
Okay, will drop it in the next version, thanks.
@@ -40,4 +40,8 @@ sources = files(
'nfp_rxtx.c',
)
-deps += ['hash', 'security']
+deps += ['hash', 'security', 'common_nfp']
+
+if not dpdk_conf.has('RTE_COMMON_NFP')
+ error('Missing internal dependency "common/nfp"')
+endif
@@ -6,6 +6,7 @@
*/
#include <rte_alarm.h>
+#include <nfp_common_pci.h>
#include "nfd3/nfp_nfd3.h"
#include "nfdk/nfp_nfdk.h"
@@ -399,8 +400,7 @@ nfp_vf_pci_uninit(struct rte_eth_dev *eth_dev)
}
static int
-nfp_vf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
- struct rte_pci_device *pci_dev)
+nfp_vf_pci_probe(struct rte_pci_device *pci_dev)
{
return rte_eth_dev_pci_generic_probe(pci_dev,
sizeof(struct nfp_net_adapter), nfp_netvf_init);
@@ -412,13 +412,19 @@ nfp_vf_pci_remove(struct rte_pci_device *pci_dev)
return rte_eth_dev_pci_generic_remove(pci_dev, nfp_vf_pci_uninit);
}
-static struct rte_pci_driver rte_nfp_net_vf_pmd = {
+static struct nfp_class_driver rte_nfp_net_vf_pmd = {
+ .drv_class = NFP_CLASS_ETH,
+ .name = RTE_STR(net_nfp_vf),
.id_table = pci_id_nfp_vf_net_map,
.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
.probe = nfp_vf_pci_probe,
.remove = nfp_vf_pci_remove,
};
-RTE_PMD_REGISTER_PCI(net_nfp_vf, rte_nfp_net_vf_pmd);
+RTE_INIT(rte_nfp_vf_pmd_init)
+{
+ nfp_class_driver_register(&rte_nfp_net_vf_pmd);
+}
+
RTE_PMD_REGISTER_PCI_TABLE(net_nfp_vf, pci_id_nfp_vf_net_map);
RTE_PMD_REGISTER_KMOD_DEP(net_nfp_vf, "* igb_uio | uio_pci_generic | vfio");