redundant rte_vdev_driver declarations
cover redundant rte_vdev_driver declarations
Many drivers declare the local rte_vdev_driver structure multiple times. This is unnecessary.
Surprised it is so common, I guess everyone copies the same code.
Stephen Hemminger (9):
net/tap: remove redundant declarations
net/af_packet: remove redundant rte_vdev_driver declaration net/vhost: remove redundant rte_vdev_driver declaration net/null: remove redundant rte_vdev_driver declaration net/pcap: remove redundant rte_vdev_driver declaration net/ring: remove redundant rte_vdev_drive declaration net/virtio_user: remove redundant rte_vdev_driver declaration raw/skeleton_rawdev: remove redundant rte_vdev_driver declaration raw/dpaa2_cmif: remove redundant rte_vdev_driver declaration
drivers/net/af_packet/rte_eth_af_packet.c | 2 -- drivers/net/null/rte_eth_null.c | 2 -- drivers/net/pcap/rte_eth_pcap.c | 2 -- drivers/net/ring/rte_eth_ring.c | 2 -- drivers/net/tap/rte_eth_tap.c | 2 -- drivers/net/vhost/rte_eth_vhost.c | 2 -- drivers/net/virtio/virtio_user_ethdev.c | 2 -- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 3 --- drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 3 --- 9 files changed, 20 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/9 net/tap: remove redundant declarations
The rte_vdev_drivers are declared twice.
The first one is not necessary.
--- drivers/net/tap/rte_eth_tap.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/tap/rte_eth_tap.c +0 -2
@@ -71,8 +71,6 @@#define TAP_IOV_DEFAULT_MAX 1024static int tap_devices_count; -static struct rte_vdev_driver pmd_tap_drv; -static struct rte_vdev_driver pmd_tun_drv;static const char *valid_arguments[] = {ETH_TAP_IFACE_ARG ,
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 1/9] net/tap: remove redundant declarations
Quoted 28 lines · Stephen Hemminger
The
rte_vdev_driversare declared twice.
The first one is not necessary.Signed-off-by Stephen Hemminger <[email protected]>---
drivers/net/tap/rte_eth_tap.c| 2 --1 file changed, 2 deletions(-)drivers/net/tap/rte_eth_tap.c +0
-2@@ -71,8 +71,6 @@#define TAP_IOV_DEFAULT_MAX 1024static int tap_devices_count; -static struct rte_vdev_driver pmd_tap_drv; -static struct rte_vdev_driver pmd_tun_drv;static const char *valid_arguments[] = {ETH_TAP_IFACE_ARG ,Signature · 1 line
2.20.1
Regards,
Keith
PATCH 2/9 net/af_packet: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/af_packet/rte_eth_af_packet.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/af_packet/rte_eth_af_packet.c +0 -2
@@ -526,8 +526,6 @@ open_packet_iface(const char *key __rte_unused,return 0 ; } -static struct rte_vdev_driver pmd_af_packet_drv; - static int rte_pmd_init_internals(struct rte_vdev_device *dev, const int sockfd,
Signature · 1 line
2.20.1
PATCH 3/9 net/vhost: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/vhost/rte_eth_vhost.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/vhost/rte_eth_vhost.c +0 -2
@@ -1199,8 +1199,6 @@ static const struct eth_dev_ops ops = { .rx_queue_intr_disable = eth_rxq_intr_disable, }; -static struct rte_vdev_driver pmd_vhost_drv; -static int eth_dev_vhost_create (struct rte_vdev_device *dev,char *iface_name,int16_t queues,const unsigned int numa_node,uint64_t flags)
Signature · 1 line
2.20.1
PATCH 4/9 net/null: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/null/rte_eth_null.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/null/rte_eth_null.c +0 -2
@@ -490,8 +490,6 @@ static const struct eth_dev_ops ops = { .rss_hash_conf_get = eth_rss_hash_conf_get }; -static struct rte_vdev_driver pmd_null_drv; - static int eth_dev_null_create(struct rte_vdev_device *dev, unsigned packet_size,
Signature · 1 line
2.20.1
PATCH 5/9 net/pcap: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/pcap/rte_eth_pcap.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/pcap/rte_eth_pcap.c +0 -2
@@ -1085,8 +1085,6 @@ get_infinite_rx_arg(const char *key __rte_unused,return 0 ; } -static struct rte_vdev_driver pmd_pcap_drv; - static int pmd_init_internals(struct rte_vdev_device *vdev, const unsigned int nb_rx_queues,
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 5/9] net/pcap: remove redundant rte_vdev_driver declaration
Quoted 4 lines · Stephen Hemminger
The
rte_vdev_driveris declared twice.
The first one is not necessary.Signed-off-by Stephen Hemminger <[email protected]>
PATCH 6/9 net/ring: remove redundant rte_vdev_drive declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/ring/rte_eth_ring.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ring/rte_eth_ring.c +0 -2
@@ -248,8 +248,6 @@ static const struct eth_dev_ops ops = { .mac_addr_add = eth_mac_addr_add, }; -static struct rte_vdev_driver pmd_ring_drv; - static int do_eth_dev_ring_create(const char *name, struct rte_ring * const rx_queues[],
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 6/9] net/ring: remove redundant rte_vdev_drive declaration
Quoted 14 lines · Stephen Hemminger
The
rte_vdev_driveris declared twice.
The first one is not necessary.Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 2 -- 1 file changed, 2 deletions(-)drivers/net/ring/rte_eth_ring.c +0
-0
drivers/net/ring/rte_eth_ring.c static const struct eth_dev_ops ops = { · line 253
Quoted 8 lines
drivers/net/ring/rte_eth_ring.c +0
-2@@ -248,8 +248,6 @@ static const struct eth_dev_ops ops = { .mac_addr_add = eth_mac_addr_add, }; -static struct rte_vdev_driver pmd_ring_drv; - static int do_eth_dev_ring_create(const char *name, struct rte_ring * const rx_queues[],
PATCH 7/9 net/virtio_user: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/net/virtio/virtio_user_ethdev.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/virtio/virtio_user_ethdev.c +0 -2
@@ -441,8 +441,6 @@ get_integer_arg(const char *key __rte_unused,return 0 ; } -static struct rte_vdev_driver virtio_user_driver; -static struct rte_eth_dev *virtio_user_eth_dev_alloc (struct rte_vdev_device *vdev) {
Signature · 1 line
2.20.1
PATCH 8/9 raw/skeleton_rawdev: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 3 --- 1 file changed, 3 deletions(-)
drivers/raw/skeleton_rawdev/skeleton_rawdev.c +0 -3
@@ -37,9 +37,6 @@ static uint16_t skeldev_init_once;/**< Rawdev Skeleton dummy driver name */ #define SKELETON_PMD_RAWDEV_NAME rawdev_skeleton -/**< Skeleton rawdev driver object */ -static struct rte_vdev_driver skeleton_pmd_drv; -struct queue_buffers {void *bufs[SKELETON_QUEUE_MAX_DEPTH ]; };
Signature · 1 line
2.20.1
PATCH 9/9 raw/dpaa2_cmif: remove redundant rte_vdev_driver declaration
In reply to Stephen HemmingerThe rte_vdev_driver is declared twice.
The first one is not necessary.
--- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 3 --- 1 file changed, 3 deletions(-)
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +0 -3
@@ -26,9 +26,6 @@ int dpaa2_cmdif_logtype;/* CMDIF driver name */ #define DPAA2_CMDIF_PMD_NAME dpaa2_dpci -/* CMDIF driver object */ -static struct rte_vdev_driver dpaa2_cmdif_drv; -/* * This API provides the DPCI device ID in 'attr_value'. * The device ID shall be passed by GPP to the AIOP using CMDIF commands.
Signature · 1 line
2.20.1
Quoted 5 lines · Stephen Hemminger
Many drivers declare the local
rte_vdev_driverstructure multiple times. This is unnecessary.Surprised it is so common, I guess everyone copies the same code.
Quoted 10 lines
Stephen Hemminger (9):
net/tap: remove redundant declarations
net/af_packet: remove redundantrte_vdev_driverdeclaration net/vhost: remove redundantrte_vdev_driverdeclaration net/null: remove redundantrte_vdev_driverdeclaration net/pcap: remove redundantrte_vdev_driverdeclaration net/ring: remove redundantrte_vdev_drivedeclarationnet/virtio_user: remove redundantrte_vdev_driverdeclaration raw/skeleton_rawdev: remove redundantrte_vdev_driverdeclaration raw/dpaa2_cmif: remove redundantrte_vdev_driverdeclaration
For series,
Series applied to dpdk-next-net/master, thanks.
Quoted 5 lines · Ferruh Yigit
Quoted 4 lines · Stephen Hemminger
Many drivers declare the local
rte_vdev_driverstructure multiple times. This is unnecessary.Surprised it is so common, I guess everyone copies the same code.
It seems it is common because a patchset explicitly added them [1] to set driver name consistently, but later when another patch removed the related code [2] the forward declarations seems forgotten to be removed.
I have updated commits to include the fixes lines so that they can be backported (so that they don't cause additional conflicts for more serious patches in the future.)
[1]: Fixes: 73db5badb042 ("net: align ethdev and eal driver names") [2]: Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Quoted 17 lines
Quoted 11 lines
Stephen Hemminger (9):
net/tap: remove redundant declarations
net/af_packet: remove redundantrte_vdev_driverdeclaration net/vhost: remove redundantrte_vdev_driverdeclaration net/null: remove redundantrte_vdev_driverdeclaration net/pcap: remove redundantrte_vdev_driverdeclaration net/ring: remove redundantrte_vdev_drivedeclarationnet/virtio_user: remove redundantrte_vdev_driverdeclaration raw/skeleton_rawdev: remove redundantrte_vdev_driverdeclaration raw/dpaa2_cmif: remove redundantrte_vdev_driverdeclarationFor series,
Reviewed-by Ferruh Yigit <[email protected]>Series applied to dpdk-next-net/master, thanks.