[03/14] net/bnxt: log a message when multicast promisc mode changes

Message ID 20231204183710.86921-4-ajit.khaparde@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Series support new 5760X P7 devices |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Dec. 4, 2023, 6:36 p.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

When the user tries to add more number of Mcast MAC addresses than
supported by the port, driver puts port into Mcast promiscuous mode.
It may be useful to the user to know that Mcast promiscuous mode is
turned on.

Similarly added a log when Mcast promiscuous mode is turned off.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
 drivers/net/bnxt/bnxt_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index acf7e6e46e..999e4f1398 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2931,12 +2931,18 @@  bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev,
 	bp->nb_mc_addr = nb_mc_addr;
 	if (nb_mc_addr > BNXT_MAX_MC_ADDRS) {
+		PMD_DRV_LOG(INFO, "Number of Mcast MACs added (%d) exceeded Max supported (%d)\n",
+			    nb_mc_addr, BNXT_MAX_MC_ADDRS);
+		PMD_DRV_LOG(INFO, "Turning on Mcast promiscuous mode\n");
 		vnic->flags |= BNXT_VNIC_INFO_ALLMULTI;
 		goto allmulti;
 	/* TODO Check for Duplicate mcast addresses */
-	vnic->flags &= ~BNXT_VNIC_INFO_ALLMULTI;
+	if (vnic->flags & BNXT_VNIC_INFO_ALLMULTI) {
+		PMD_DRV_LOG(INFO, "Turning off Mcast promiscuous mode\n");
+		vnic->flags &= ~BNXT_VNIC_INFO_ALLMULTI;
+	}
 	for (i = 0; i < nb_mc_addr; i++)
 		rte_ether_addr_copy(&mc_addr_set[i], &bp->mcast_addr_list[i]);