* [PATCH] net/cnxk: restore MAC address table during port reset
@ 2025-04-09 6:11 skori
0 siblings, 0 replies; only message in thread
From: skori @ 2025-04-09 6:11 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: dev, stable
From: Sunil Kumar Kori <skori@marvell.com>
When user requests to configure a device which is already in
configured state then first device gets resets to default and
then reconfigured with latest parameters.
While resetting the device, MAC address table is left stale which
causes entry update in later state.
Hence same is restoring during reset operation to avoid any error
due to further operation on MAC table.
Fixes: b75e0aca84b0 ("net/cnxk: add device configuration operation")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
drivers/net/cnxk/cnxk_ethdev.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 289ae96afa..7e77fcba45 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1209,6 +1209,26 @@ nix_lso_fmt_setup(struct cnxk_eth_dev *dev)
return nix_lso_tun_fmt_update(dev);
}
+static int
+nix_restore_mac_table(struct rte_eth_dev *eth_dev)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct rte_ether_addr *macs = NULL;
+ struct roc_nix *nix = &dev->nix;
+ int i, rc;
+
+ macs = eth_dev->data->mac_addrs;
+ for (i = 1; i < dev->dmac_filter_count; i++) {
+ rc = roc_nix_mac_addr_add(nix, macs[i].addr_bytes);
+ if (rc < 0) {
+ plt_err("Failed to restore mac addr table, rc=%d", rc);
+ return rc;
+ }
+ }
+
+ return 0;
+}
+
int
cnxk_nix_configure(struct rte_eth_dev *eth_dev)
{
@@ -1507,6 +1527,10 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
rc = nix_restore_queue_cfg(eth_dev);
if (rc)
goto sec_release;
+
+ rc = nix_restore_mac_table(eth_dev);
+ if (rc)
+ goto sec_release;
}
/* Update the mac address */
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-09 6:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09 6:11 [PATCH] net/cnxk: restore MAC address table during port reset skori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).