From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Feifei Wang <wangfeifei40@huawei.com>,
Andrew Boyer <andrew.boyer@amd.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Zaiyu Wang <zaiyuwang@trustnetic.com>,
Vamsi Attunuru <vattunuru@marvell.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [PATCH] drivers/net: remove redundant callbacks cleanup
Date: Wed, 18 Feb 2026 11:45:24 +0100 [thread overview]
Message-ID: <20260218104524.2780167-1-thomas@monjalon.net> (raw)
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
next reply other threads:[~2026-02-18 10:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 10:45 Thomas Monjalon [this message]
2026-02-18 17:10 ` [PATCH] drivers/net: remove redundant callbacks cleanup Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260218104524.2780167-1-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=anatoly.burakov@intel.com \
--cc=andrew.boyer@amd.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=jiawenwu@trustnetic.com \
--cc=vattunuru@marvell.com \
--cc=wangfeifei40@huawei.com \
--cc=zaiyuwang@trustnetic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox