* [PATCH] drivers/net: remove redundant callbacks cleanup
@ 2026-02-18 10:45 Thomas Monjalon
2026-02-18 17:10 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2026-02-18 10:45 UTC (permalink / raw)
To: dev
Cc: Feifei Wang, Andrew Boyer, Jiawen Wu, Zaiyu Wang, Vamsi Attunuru,
Andrew Rybchenko, Anatoly Burakov
Some callbacks are set to NULL in the release process.
It is not needed as it is already done in rte_eth_dev_release_port()
called by rte_eth_dev_close(), rte_eth_dev_destroy()
or rte_eth_dev_pci_generic_remove().
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/hinic3/hinic3_ethdev.c | 4 ----
drivers/net/ionic/ionic_ethdev.c | 5 -----
drivers/net/ngbe/ngbe_ethdev_vf.c | 3 ---
drivers/net/octeon_ep/otx_ep_ethdev.c | 10 +---------
drivers/net/sfc/sfc_repr.c | 4 ----
drivers/net/txgbe/txgbe_ethdev_vf.c | 3 ---
6 files changed, 1 insertion(+), 28 deletions(-)
diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c
index 0e25175ba1..0f72728a95 100644
--- a/drivers/net/hinic3/hinic3_ethdev.c
+++ b/drivers/net/hinic3/hinic3_ethdev.c
@@ -2044,10 +2044,6 @@ hinic3_dev_release(struct rte_eth_dev *eth_dev)
hinic3_free_nic_hwdev(nic_dev->hwdev);
hinic3_free_hwdev(nic_dev->hwdev);
- eth_dev->rx_pkt_burst = NULL;
- eth_dev->tx_pkt_burst = NULL;
- eth_dev->dev_ops = NULL;
-
rte_free(nic_dev->hwdev);
nic_dev->hwdev = NULL;
}
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 6e9cd5f7eb..d2888d9650 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -1112,11 +1112,6 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
if (eth_dev->state != RTE_ETH_DEV_UNUSED)
ionic_dev_close(eth_dev);
- eth_dev->dev_ops = NULL;
- eth_dev->rx_pkt_burst = NULL;
- eth_dev->tx_pkt_burst = NULL;
- eth_dev->tx_pkt_prepare = NULL;
-
return 0;
}
diff --git a/drivers/net/ngbe/ngbe_ethdev_vf.c b/drivers/net/ngbe/ngbe_ethdev_vf.c
index e575c47049..6406df40d0 100644
--- a/drivers/net/ngbe/ngbe_ethdev_vf.c
+++ b/drivers/net/ngbe/ngbe_ethdev_vf.c
@@ -746,9 +746,6 @@ ngbevf_dev_close(struct rte_eth_dev *dev)
**/
ngbevf_remove_mac_addr(dev, 0);
- dev->rx_pkt_burst = NULL;
- dev->tx_pkt_burst = NULL;
-
/* Disable the interrupts for VF */
ngbevf_intr_disable(dev);
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index f7f927a4e7..99be30523a 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -656,12 +656,8 @@ otx_ep_dev_close(struct rte_eth_dev *eth_dev)
struct otx_ep_device *otx_epvf;
uint32_t num_queues, q_no;
- if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- eth_dev->dev_ops = NULL;
- eth_dev->rx_pkt_burst = NULL;
- eth_dev->tx_pkt_burst = NULL;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- }
otx_epvf = OTX_EP_DEV(eth_dev);
otx_ep_mbox_send_dev_exit(eth_dev);
@@ -731,10 +727,6 @@ otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev)
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
otx_ep_mbox_uninit(eth_dev);
- eth_dev->dev_ops = NULL;
- eth_dev->rx_pkt_burst = NULL;
- eth_dev->tx_pkt_burst = NULL;
-
return 0;
}
diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index fbb5f58a8e..4ccdf8358b 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -820,10 +820,6 @@ sfc_repr_dev_close(struct rte_eth_dev *dev)
sfc_mae_clear_switch_port(srs->switch_domain_id, srs->switch_port_id);
- dev->rx_pkt_burst = NULL;
- dev->tx_pkt_burst = NULL;
- dev->dev_ops = NULL;
-
sfc_repr_unlock(sr);
sfc_repr_lock_fini(sr);
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index f6fd2b1557..39a5fff65c 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -862,9 +862,6 @@ txgbevf_dev_close(struct rte_eth_dev *dev)
**/
txgbevf_remove_mac_addr(dev, 0);
- dev->rx_pkt_burst = NULL;
- dev->tx_pkt_burst = NULL;
-
/* Disable the interrupts for VF */
txgbevf_intr_disable(dev);
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/net: remove redundant callbacks cleanup
2026-02-18 10:45 [PATCH] drivers/net: remove redundant callbacks cleanup Thomas Monjalon
@ 2026-02-18 17:10 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2026-02-18 17:10 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Feifei Wang, Andrew Boyer, Jiawen Wu, Zaiyu Wang,
Vamsi Attunuru, Andrew Rybchenko, Anatoly Burakov
On Wed, 18 Feb 2026 11:45:24 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> Some callbacks are set to NULL in the release process.
> It is not needed as it is already done in rte_eth_dev_release_port()
> called by rte_eth_dev_close(), rte_eth_dev_destroy()
> or rte_eth_dev_pci_generic_remove().
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-18 17:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 10:45 [PATCH] drivers/net: remove redundant callbacks cleanup Thomas Monjalon
2026-02-18 17:10 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox