iavf: Log info when VF is entering and leaving Allmulti mode
authorGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
Fri, 4 Jun 2021 16:53:32 +0000 (09:53 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 30 Nov 2021 16:56:06 +0000 (08:56 -0800)
Add log when VF is entering and leaving Allmulti mode.
The change of VF state is visible in dmesg now.
Without this commit, entering and leaving Allmulti mode
is not logged in dmesg.

Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

index d60bf7c..5c64f06 100644 (file)
@@ -762,15 +762,23 @@ void iavf_set_promiscuous(struct iavf_adapter *adapter, int flags)
        if (flags & FLAG_VF_MULTICAST_PROMISC) {
                adapter->flags |= IAVF_FLAG_ALLMULTI_ON;
                adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_ALLMULTI;
-               dev_info(&adapter->pdev->dev, "Entering multicast promiscuous mode\n");
+               dev_info(&adapter->pdev->dev, "%s is entering multicast promiscuous mode\n",
+                        adapter->netdev->name);
        }
 
        if (!flags) {
-               adapter->flags &= ~(IAVF_FLAG_PROMISC_ON |
-                                   IAVF_FLAG_ALLMULTI_ON);
-               adapter->aq_required &= ~(IAVF_FLAG_AQ_RELEASE_PROMISC |
-                                         IAVF_FLAG_AQ_RELEASE_ALLMULTI);
-               dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n");
+               if (adapter->flags & IAVF_FLAG_PROMISC_ON) {
+                       adapter->flags &= ~IAVF_FLAG_PROMISC_ON;
+                       adapter->aq_required &= ~IAVF_FLAG_AQ_RELEASE_PROMISC;
+                       dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n");
+               }
+
+               if (adapter->flags & IAVF_FLAG_ALLMULTI_ON) {
+                       adapter->flags &= ~IAVF_FLAG_ALLMULTI_ON;
+                       adapter->aq_required &= ~IAVF_FLAG_AQ_RELEASE_ALLMULTI;
+                       dev_info(&adapter->pdev->dev, "%s is leaving multicast promiscuous mode\n",
+                                adapter->netdev->name);
+               }
        }
 
        adapter->current_op = VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE;