[24/31] net/cnxk: move MAC address set from init to configure

Message ID 20230811085805.441256-24-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [01/31] common/cnxk: add aura ref count mechanism |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram Aug. 11, 2023, 8:57 a.m. UTC
  From: Srujana Challa <schalla@marvell.com>

Channel(rx_chan_base) is not available in the kernel at
the time of nix probe. Hence, move the mac address set
call from nix_device_init() to nix_device_configure().
This fixes the issue on cn10kb, where traffic was not
getting received when promisc is disabled.

Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index bd161ad375..3b2ad5ff7d 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1301,6 +1301,15 @@  cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 		goto fail_configure;
 	}
 
+	if (!roc_nix_is_vf_or_sdp(nix)) {
+		/* Sync same MAC address to CGX/RPM table */
+		rc = roc_nix_mac_addr_set(nix, dev->mac_addr);
+		if (rc) {
+			plt_err("Failed to set mac addr, rc=%d", rc);
+			goto fail_configure;
+		}
+	}
+
 	/* Check if ptp is enable in PF owning this VF*/
 	if (!roc_nix_is_pf(nix) && (!roc_nix_is_sdp(nix)))
 		dev->ptp_en = roc_nix_ptp_is_enable(nix);
@@ -1941,15 +1950,6 @@  cnxk_eth_dev_init(struct rte_eth_dev *eth_dev)
 	/* Update the mac address */
 	memcpy(eth_dev->data->mac_addrs, dev->mac_addr, RTE_ETHER_ADDR_LEN);
 
-	if (!roc_nix_is_vf_or_sdp(nix)) {
-		/* Sync same MAC address to CGX/RPM table */
-		rc = roc_nix_mac_addr_set(nix, dev->mac_addr);
-		if (rc) {
-			plt_err("Failed to set mac addr, rc=%d", rc);
-			goto free_mac_addrs;
-		}
-	}
-
 	/* Union of all capabilities supported by CNXK.
 	 * Platform specific capabilities will be
 	 * updated later.