refactor eal driver registration code
Subsystems (3)
cover refactor eal driver registration code
At present the eal driver registration code is more complicated than it needs to be.
This RFC proposes to simplify the eal driver registration code.
Remove the type field from the eal driver structure. Refactor the eal driver registration code to use the name field in the eal driver structure instead of the type field.
Modify all PMD's to use the modified eal driver structure. Initialise the name field in the eal driver structure in some PMD's where it is not initialised at present.
Bernard Iremonger (18):
librte_eal: remove type field from rte_driver structure.
af_packet: remove type field from rte_driver structure
bnx2x: remove type field and initialise name field in rte_driver
structure
bonding: remove type field from rte_driver structure
cxgbe: remove type field from rte_driver structure
e1000: remove type field and initialise name field in rte_driver
structures
enic: remove type field and initialise name field in rte_driver
structure
fm10k: remove type field and initialise name field in rte_driver
structure
i40e: remove type field and initialise name field in rte_driver
structures
ixgbe: remove type field and initialise name field in rte_driver
structure
mlx4: remove type field from rte_driver structure
mpipe: remove type field and update name in rte_driver structure
null: remove type field from rte_driver structure
pcap: remove type field from rte_driver structure
ring: remove type field from rte_driver structure
virtio_ethdev: remove type field and initialise name field in
rte_driver structure
vmxnet3: remove type field and initialise name field in rte_driver
structure
xenvirt: remove type field from rte_driver structure
drivers/net/af_packet/rte_eth_af_packet.c | 5 ++--- drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++-- drivers/net/bonding/rte_eth_bond_pmd.c | 3 +-- drivers/net/cxgbe/cxgbe_ethdev.c | 4 ++-- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 4 ++-- drivers/net/enic/enic_ethdev.c | 3 ++- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- drivers/net/mlx4/mlx4.c | 4 ++-- drivers/net/mpipe/mpipe_tilegx.c | 7 +++---- drivers/net/null/rte_eth_null.c | 3 +-- drivers/net/pcap/rte_eth_pcap.c | 3 +-- drivers/net/ring/rte_eth_ring.c | 3 +-- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/net/xenvirt/rte_eth_xenvirt.c | 5 ++--- lib/librte_eal/common/eal_common_dev.c | 22 +++++++++++++--------- lib/librte_eal/common/include/rte_dev.h | 11 +---------- 21 files changed, 44 insertions(+), 54 deletions(-)
Signature · 1 line
1.9.1
RFC PATCH 1/18 librte_eal: remove type field from rte_driver structure.
--- lib/librte_eal/common/eal_common_dev.c | 22 +++++++++++++--------- lib/librte_eal/common/include/rte_dev.h | 11 +---------- 2 files changed, 14 insertions(+), 19 deletions(-)
lib/librte_eal/common/eal_common_dev.c +13 -9
@@ -1,7 +1,7 @@/*- * BSD LICENSE * -* Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2015 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. *
@@ -72,8 +72,6 @@ rte_eal_vdev_init(const char *name, const char *args)return -EINVAL ; TAILQ_FOREACH(driver, &dev_driver_list, next) { -if (driver->type !=PMD_VDEV ) -continue ;/* * search a driver prefix in virtual device name.
@@ -117,10 +115,18 @@ rte_eal_dev_init(void)/* Once the vdevs are initalized, start calling all the pdev drivers */ TAILQ_FOREACH(driver, &dev_driver_list, next) { -if (driver->type !=PMD_PDEV ) -continue ; -/* PDEV drivers don't get passed any parameters */ - driver->init (NULL ,NULL ); + +/* PCI drivers don't get passed any parameters */ +/* +* Search a virtual driver prefix in device name. +* It should not be found for PCI devices. +* Use strncmp to compare. +*/ + +if ((driver->name) && + (strncmp (driver->name,"eth_" ,strlen ("eth_" )) !=0 )) { + driver->init (NULL ,NULL ); + } }return 0 ; }
@@ -134,8 +140,6 @@ rte_eal_vdev_uninit(const char *name)return -EINVAL ; TAILQ_FOREACH(driver, &dev_driver_list, next) { -if (driver->type !=PMD_VDEV ) -continue ;/* * search a driver prefix in virtual device name.
lib/librte_eal/common/include/rte_dev.h +1 -10
@@ -62,20 +62,11 @@ typedef int (rte_dev_init_t)(const char *name, const char *args);typedef int (rte_dev_uninit_t )(const char *name);/** -* Driver type enumeration -*/ -enum pmd_type { -PMD_VDEV =0 , -PMD_PDEV =1 , -}; - -/** * A structure describing a device driver. */ struct rte_driver {TAILQ_ENTRY (rte_driver) next;/**< Next in list. */ -enum pmd_type type;/**< PMD Driver type */ -const char *name;/**< Driver name. */ +const char *name;/**< Driver name. */ rte_dev_init_t *init;/**< Device init. function. */ rte_dev_uninit_t *uninit;/**< Device uninit. function. */ };
Signature · 1 line
1.9.1
Re: [RFC PATCH 01/18] librte_eal: remove type field from rte_driver structure.
2015-09-04 12:01, Bernard Iremonger:
Quoted 1 line
Signed-off-by Bernard Iremonger <[email protected]>
There is no explanation in this patch.
Quoted 6 lines
lib/librte_eal/common/eal_common_dev.c +2
-4-if (driver->type !=PMD_PDEV ) -continue ; -/* PDEV drivers don't get passed any parameters */ - driver->init (NULL ,NULL ); + +/* PCI drivers don't get passed any parameters */
lib/librte_eal/common/eal_common_dev.c rte_eal_dev_init(void) · line 129
Quoted 10 lines
lib/librte_eal/common/eal_common_dev.c +10
-0+/* +* Search a virtual driver prefix in device name. +* It should not be found for PCI devices. +* Use strncmp to compare. +*/ + +if ((driver->name) && + (strncmp (driver->name,"eth_" ,strlen ("eth_" )) !=0 )) { + driver->init (NULL ,NULL ); + }
You don't need to submit a full patchset with changes in every drivers for a RFC. Having just this patch is enough to have an opinion. Here it is a nack.
We need to have a common init path instead of the current VDEV/PDEV branches. And instead of "pmd_type", a bus information would be more meaningful. So just replacing a type by a magical string is worst.
Please don't try to fix wrong problems and focus on your goal. We had some discussions about possible PCI EAL refactoring but it probably needs to be done step by step with a clear cleaning motivation at each step. I think other people involved in EAL will have other ideas.
RFC PATCH 2/18 af_packet: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/af_packet/rte_eth_af_packet.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/af_packet/rte_eth_af_packet.c +2 -3
@@ -5,7 +5,7 @@* * Originally based upon librte_pmd_pcap code: * -* Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2015 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. *
@@ -839,8 +839,7 @@ exit: }static struct rte_driver pmd_af_packet_drv = { - .name ="eth_af_packet" , - .type =PMD_VDEV , + .name ="eth_af_packet" ,/* Virtual device */ .init = rte_pmd_af_packet_devinit, };
Signature · 1 line
1.9.1
RFC PATCH 3/18 bnx2x: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/bnx2x/bnx2x_ethdev.c +3 -2
@@ -1,5 +1,6 @@/* * Copyright (c) 2013-2015 Brocade Communications Systems, Inc. +* Copyright(c) 2015 Intel Corporation. * * All rights reserved. */
@@ -529,12 +530,12 @@ static int rte_bnx2xvf_pmd_init(const char *name __rte_unused, const char *param }static struct rte_driver rte_bnx2x_driver = { - .type =PMD_PDEV , + .name ="rte_bnx2x_driver" ,/* PCI device */ .init = rte_bnx2x_pmd_init, };static struct rte_driver rte_bnx2xvf_driver = { - .type =PMD_PDEV , + .name ="rte_bnx2xvf_driver" ,/* PCI device */ .init = rte_bnx2xvf_pmd_init, };
Signature · 1 line
1.9.1
Re: [RFC PATCH 03/18] bnx2x: remove type field and initialise name field in rte_driver structure
Quoted 34 lines
Signed-off-by Bernard Iremonger <[email protected]>---
drivers/net/bnx2x/bnx2x_ethdev.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/bnx2x/bnx2x_ethdev.c +1
-0@@ -1,5 +1,6 @@/* * Copyright (c) 2013-2015 Brocade Communications Systems, Inc. +* Copyright(c) 2015 Intel Corporation. * * All rights reserved. */ @@ -529,12 +530,12 @@ static int rte_bnx2xvf_pmd_init(const char *name
__rte_unused, const char *param
}static struct
rte_driverrte_bnx2x_driver= {drivers/net/bnx2x/bnx2x_ethdev.c +1
-1- .type = PMD_PDEV, + .name = "rte_bnx2x_driver", /* PCI device */ .init = rte_bnx2x_pmd_init,};
static struct
rte_driverrte_bnx2xvf_driver= {drivers/net/bnx2x/bnx2x_ethdev.c +1
-1- .type = PMD_PDEV, + .name = "rte_bnx2xvf_driver", /* PCI device */ .init = rte_bnx2xvf_pmd_init,};
Quoted 4 lines
--
1.9.1
Thanks,
Harish
________________________________
This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
RFC PATCH 4/18 bonding: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/bonding/rte_eth_bond_pmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/bonding/rte_eth_bond_pmd.c +1 -2
@@ -2302,8 +2302,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) }static struct rte_driver bond_drv = { - .name ="eth_bond" , - .type =PMD_VDEV , + .name ="eth_bond" ,/* Virtual device */ .init = bond_init, .uninit = bond_uninit, };
Signature · 1 line
1.9.1
RFC PATCH 5/18 cxgbe: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/cxgbe/cxgbe_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +2 -2
@@ -2,6 +2,7 @@* BSD LICENSE * * Copyright(c) 2014-2015 Chelsio Communications. +* Copyright(c) 2015 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -794,8 +795,7 @@ static int rte_cxgbe_pmd_init(const char *name __rte_unused, }static struct rte_driver rte_cxgbe_driver = { - .name ="cxgbe_driver" , - .type =PMD_PDEV , + .name ="cxgbe_driver" ,/* PCI device */ .init = rte_cxgbe_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 6/18 e1000: remove type field and initialise name field in rte_driver structures
In reply to Bernard Iremonger--- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/em_ethdev.c +1 -1
@@ -1586,7 +1586,7 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, }struct rte_driver em_pmd_drv = { - .type =PMD_PDEV , + .name ="em_pmd_drv" ,/* PCI device */ .init = rte_em_pmd_init, };
drivers/net/e1000/igb_ethdev.c +2 -2
@@ -4135,12 +4135,12 @@ eth_igb_set_eeprom(struct rte_eth_dev *dev, }static struct rte_driver pmd_igb_drv = { - .type =PMD_PDEV , + .name ="pmd_igb_drv" ,/* PCI device */ .init = rte_igb_pmd_init, };static struct rte_driver pmd_igbvf_drv = { - .type =PMD_PDEV , + .name ="pmd_igbvf_drv" ,/* PCI device */ .init = rte_igbvf_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 7/18 enic: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/enic/enic_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/enic/enic_ethdev.c +2 -1
@@ -3,6 +3,7 @@* Copyright 2007 Nuova Systems, Inc. All rights reserved. * * Copyright (c) 2014, Cisco Systems, Inc. +* Copyright(c) 2015 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -633,7 +634,7 @@ rte_enic_pmd_init(const char *name __rte_unused, }static struct rte_driver rte_enic_driver = { - .type =PMD_PDEV , + .name ="rte_enic_driver" ,/* PCI device */ .init = rte_enic_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 8/18 fm10k: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/fm10k/fm10k_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -2312,7 +2312,7 @@ rte_pmd_fm10k_init(__rte_unused const char *name, }static struct rte_driver rte_fm10k_driver = { - .type =PMD_PDEV , + .name ="rte_fm10k_driver" ,/* PCI device */ .init = rte_pmd_fm10k_init, };
Signature · 1 line
1.9.1
RFC PATCH 9/18 i40e: remove type field and initialise name field in rte_driver structures
In reply to Bernard Iremonger--- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -347,7 +347,7 @@ rte_i40e_pmd_init(const char *name __rte_unused, }static struct rte_driver rte_i40e_driver = { - .type =PMD_PDEV , + .name ="rte_i40e_driver" ,/* PCI device */ .init = rte_i40e_pmd_init, };
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -1268,7 +1268,7 @@ rte_i40evf_pmd_init(const char *name __rte_unused, }static struct rte_driver rte_i40evf_driver = { - .type =PMD_PDEV , + .name ="rte_i40evf_driver" ,/* PCI device */ .init = rte_i40evf_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 10/18 ixgbe: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
@@ -5514,12 +5514,12 @@ ixgbe_set_eeprom(struct rte_eth_dev *dev, }static struct rte_driver rte_ixgbe_driver = { - .type =PMD_PDEV , + .name ="rte_ixgbe_driver" ,/* PCI device */ .init = rte_ixgbe_pmd_init, };static struct rte_driver rte_ixgbevf_driver = { - .type =PMD_PDEV , + .name ="rte_ixgbevf_driver" ,/* PCI device */ .init = rte_ixgbevf_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 11/18 mlx4: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/mlx4/mlx4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx4/mlx4.c +2 -2
@@ -3,6 +3,7 @@* * Copyright 2012-2015 6WIND S.A. * Copyright 2012 Mellanox. +* Copyright 2015 Intel. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions
@@ -5107,8 +5108,7 @@ rte_mlx4_pmd_init(const char *name, const char *args) }static struct rte_driver rte_mlx4_driver = { - .type =PMD_PDEV , - .name =MLX4_DRIVER_NAME , + .name =MLX4_DRIVER_NAME ,/* PCI device */ .init = rte_mlx4_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 12/18 mpipe: remove type field and update name in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/mpipe/mpipe_tilegx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/mpipe/mpipe_tilegx.c +3 -4
@@ -2,6 +2,7 @@* BSD LICENSE * * Copyright(c) 2015 EZchip Semiconductor Ltd. All rights reserved. +* Copyright(c) 2015 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions
@@ -1602,14 +1603,12 @@ rte_pmd_mpipe_devinit(const char *ifname, }static struct rte_driver pmd_mpipe_xgbe_drv = { - .name ="xgbe" , - .type =PMD_VDEV , + .name ="eth_xgbe" ,/* Virtual device */ .init = rte_pmd_mpipe_devinit, };static struct rte_driver pmd_mpipe_gbe_drv = { - .name ="gbe" , - .type =PMD_VDEV , + .name ="eth_gbe" ,/* Virtual device */ .init = rte_pmd_mpipe_devinit, };
Signature · 1 line
1.9.1
RFC PATCH 13/18 null: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/null/rte_eth_null.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/null/rte_eth_null.c +1 -2
@@ -577,8 +577,7 @@ rte_pmd_null_devuninit(const char *name) }static struct rte_driver pmd_null_drv = { - .name ="eth_null" , - .type =PMD_VDEV , + .name ="eth_null" ,/* Virtual device */ .init = rte_pmd_null_devinit, .uninit = rte_pmd_null_devuninit, };
Signature · 1 line
1.9.1
RFC PATCH 14/18 pcap: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/pcap/rte_eth_pcap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/pcap/rte_eth_pcap.c +1 -2
@@ -1104,8 +1104,7 @@ rte_pmd_pcap_devuninit(const char *name) }static struct rte_driver pmd_pcap_drv = { - .name ="eth_pcap" , - .type =PMD_VDEV , + .name ="eth_pcap" ,/* Virtual device */ .init = rte_pmd_pcap_devinit, .uninit = rte_pmd_pcap_devuninit, };
Signature · 1 line
1.9.1
RFC PATCH 15/18 ring: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/ring/rte_eth_ring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ring/rte_eth_ring.c +1 -2
@@ -624,8 +624,7 @@ rte_pmd_ring_devuninit(const char *name) }static struct rte_driver pmd_ring_drv = { - .name ="eth_ring" , - .type =PMD_VDEV , + .name ="eth_ring" ,/* Virtual device */ .init = rte_pmd_ring_devinit, .uninit = rte_pmd_ring_devuninit, };
Signature · 1 line
1.9.1
RFC PATCH 16/18 virtio_ethdev: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/virtio/virtio_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -1570,7 +1570,7 @@ __rte_unused uint8_t is_rx) }static struct rte_driver rte_virtio_driver = { - .type =PMD_PDEV , + .name ="rte_virtio_driver" ,/* PCI device */ .init = rte_virtio_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 17/18 vmxnet3: remove type field and initialise name field in rte_driver structure
In reply to Bernard Iremonger--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -884,7 +884,7 @@ vmxnet3_process_events(struct vmxnet3_hw *hw)#endif static struct rte_driver rte_vmxnet3_driver = { - .type =PMD_PDEV , + .name ="rte_vmxnet3_driver" ,/* PCI device */ .init = rte_vmxnet3_pmd_init, };
Signature · 1 line
1.9.1
RFC PATCH 18/18 xenvirt: remove type field from rte_driver structure
In reply to Bernard Iremonger--- drivers/net/xenvirt/rte_eth_xenvirt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/xenvirt/rte_eth_xenvirt.c +2 -3
@@ -1,7 +1,7 @@/*- * BSD LICENSE * -* Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2015 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -706,8 +706,7 @@ rte_pmd_xenvirt_devinit(const char *name, const char *params) }static struct rte_driver pmd_xenvirt_drv = { - .name ="eth_xenvirt" , - .type =PMD_VDEV , + .name ="eth_xenvirt" ,/* Virtual device */ .init = rte_pmd_xenvirt_devinit, };
Signature · 1 line
1.9.1
Quoted 5 lines · Bernard Iremonger
At present the eal driver registration code is more complicated than it needs to be.
This RFC proposes to simplify the eal driver registration code.
Quoted 9 lines
Remove the type field from the eal driver structure. Refactor the eal driver registration code to use the name field in the eal driver structure instead of the type field.
Modify all PMD's to use the modified eal driver structure. Initialise the name field in the eal driver structure in some PMD's where it is not initialised at present.
Hi,
I don't think I like this approach very much. It seems very brittle to remove the explicit type field and starting to rely on the drivers putting a prefix in the name instead i.e. implicit typing.
What is the major concern with marking drivers as virtual or physical? My thinking is that we should keep the type field, just perhaps change PDEV to be more descriptive in identifying the type of physical device, e.g. DEV_PCI.
Regards,
/Bruce
Hi Bruce,
<snip>
Quoted 24 lines
Subject: Re: [dpdk-dev] [RFC PATCH 00/18] refactor eal driver registration code
Quoted 5 lines · Bernard Iremonger
At present the eal driver registration code is more complicated than it needs to be.
This RFC proposes to simplify the eal driver registration code.
Quoted 9 lines
Remove the type field from the eal driver structure. Refactor the eal driver registration code to use the name field in the eal driver structure instead of the type field.
Modify all PMD's to use the modified eal driver structure. Initialise the name field in the eal driver structure in some PMD's where it is not initialised at present.
Hi,
I don't think I like this approach very much. It seems very brittle to remove the explicit type field and starting to rely on the drivers putting a prefix in the name instead i.e. implicit typing.
Quoted 6 lines
What is the major concern with marking drivers as virtual or physical? My thinking is that we should keep the type field, just perhaps change PDEV to be more descriptive in identifying the type of physical device, e.g.
DEV_PCI.Regards,
/Bruce
The eth_ prefix is already required for vdev's for example:
testpmd -c f -n 4 --vdev='eth_pcap0,iface=eth0' testpmd -c f -n 4 --vdev=eth_ring0
The eth_ prefix should not be used for pdev's.
Keeping the type field and name field is duplicating information
Regards,
Bernard.
Quoted 37 lines · Bernard
Hi Bruce,
<snip>Quoted 24 lines
Subject: Re: [dpdk-dev] [RFC PATCH 00/18] refactor eal driver registration code
Quoted 5 lines · Bernard Iremonger
At present the eal driver registration code is more complicated than it needs to be.
This RFC proposes to simplify the eal driver registration code.
Quoted 9 lines
Remove the type field from the eal driver structure. Refactor the eal driver registration code to use the name field in the eal driver structure instead of the type field.
Modify all PMD's to use the modified eal driver structure. Initialise the name field in the eal driver structure in some PMD's where it is not initialised at present.
Hi,
I don't think I like this approach very much. It seems very brittle to remove the explicit type field and starting to rely on the drivers putting a prefix in the name instead i.e. implicit typing.
Quoted 6 lines
What is the major concern with marking drivers as virtual or physical? My thinking is that we should keep the type field, just perhaps change PDEV to be more descriptive in identifying the type of physical device, e.g.
DEV_PCI.Regards,
/BruceThe
eth_prefix is already required for vdev's for example:
testpmd -c f -n 4 --vdev='eth_pcap0,iface=eth0' testpmd -c f -n 4 --vdev=eth_ring0
Quoted 7 lines
The
eth_prefix should not be used for pdev's.Keeping the type field and name field is duplicating information
Regards,
Bernard.
Hi Bernard,
It's duplicating information until such a time as we decide to relax the restriction on having vdev's starting with "eth" or we want to have a driver for a physical nic starting with "eth". :-)
Overall, I'm not seeing the need for this particular patchset right now. I think your previous patchset - removing the need for a pci_dev structure on vdevs - as being the more important change for cleaning up our code.
Regards,
/Bruce
Quoted 17 lines · Bruce Richardson
Quoted 5 lines · Bernard Iremonger
At present the eal driver registration code is more complicated than it needs to be.
This RFC proposes to simplify the eal driver registration code.
Quoted 9 lines
Remove the type field from the eal driver structure. Refactor the eal driver registration code to use the name field in the eal driver structure instead of the type field.
Modify all PMD's to use the modified eal driver structure. Initialise the name field in the eal driver structure in some PMD's where it is not initialised at present.
Hi,
Quoted 8 lines
I don't think I like this approach very much. It seems very brittle to remove the explicit type field and starting to rely on the drivers putting a prefix in the name instead i.e. implicit typing.
What is the major concern with marking drivers as virtual or physical? My thinking is that we should keep the type field, just perhaps change PDEV to be more descriptive in identifying the type of physical device, e.g.
DEV_PCI.
The issue is largely philisophical. We shouldn't need to define the type of bus a driver is on in the init structure of a pmd. Instead we should register it dynamically during pmd initalization
As you note, ennumerating the bus type (ie. PCI/USB/etc) is a step in the right direction, but it would be better to register that dynamically than to encode it in the data structure
Neil
Quoted 3 lines
Regards,
/Bruce