OSDN Git Service

ixgbevf: Add error messages on vlan error
authorJan Sokolowski <jan.sokolowski@intel.com>
Thu, 6 Oct 2022 12:44:08 +0000 (14:44 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 4 Nov 2022 18:09:57 +0000 (11:09 -0700)
ixgbevf did not provide an error in dmesg if VLAN addition failed.

Add two descriptive failure messages in the kernel log.

Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

index be73367..0aaf70c 100644 (file)
@@ -2044,12 +2044,16 @@ static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev,
 
        spin_unlock_bh(&adapter->mbx_lock);
 
-       /* translate error return types so error makes sense */
-       if (err == IXGBE_ERR_MBX)
-               return -EIO;
+       if (err) {
+               netdev_err(netdev, "VF could not set VLAN %d\n", vid);
+
+               /* translate error return types so error makes sense */
+               if (err == IXGBE_ERR_MBX)
+                       return -EIO;
 
-       if (err == IXGBE_ERR_INVALID_ARGUMENT)
-               return -EACCES;
+               if (err == IXGBE_ERR_INVALID_ARGUMENT)
+                       return -EACCES;
+       }
 
        set_bit(vid, adapter->active_vlans);
 
@@ -2070,6 +2074,9 @@ static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev,
 
        spin_unlock_bh(&adapter->mbx_lock);
 
+       if (err)
+               netdev_err(netdev, "Could not remove VLAN %d\n", vid);
+
        clear_bit(vid, adapter->active_vlans);
 
        return err;