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

Message ID 20231210012455.20229-4-ajit.khaparde@broadcom.com (mailing list archive)
State Changes Requested
Delegated to: Ajit Khaparde
Headers
Series support new 5760X P7 devices |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Dec. 10, 2023, 1:24 a.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(-)
  

Comments

Stephen Hemminger Dec. 10, 2023, 5:56 p.m. UTC | #1
On Sat,  9 Dec 2023 17:24:44 -0800
Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:

> +		PMD_DRV_LOG(INFO, "Number of Mcast MACs added (%d) exceeded Max supported (%d)\n",
> +			    nb_mc_addr, BNXT_MAX_MC_ADDRS);

Use %u for unsigned variables.

> +		PMD_DRV_LOG(INFO, "Turning on Mcast promiscuous mode\n");

Do you really need two log lines.
  
Ajit Khaparde Dec. 10, 2023, 10:58 p.m. UTC | #2
On Sun, Dec 10, 2023 at 9:56 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Sat,  9 Dec 2023 17:24:44 -0800
> Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:
>
> > +             PMD_DRV_LOG(INFO, "Number of Mcast MACs added (%d) exceeded Max supported (%d)\n",
> > +                         nb_mc_addr, BNXT_MAX_MC_ADDRS);
>
> Use %u for unsigned variables.
Ok. Sure. We will update it in v3.

>
>
> > +             PMD_DRV_LOG(INFO, "Turning on Mcast promiscuous mode\n");
>
> Do you really need two log lines.
For the dev team, even one is enough.
The field team thinks two is more clear.
  

Patch

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]);