dpaa2-switch: print an error when the vlan is already configured
authorIoana Ciornei <ioana.ciornei@nxp.com>
Tue, 19 Dec 2023 11:59:28 +0000 (13:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Dec 2023 01:18:59 +0000 (01:18 +0000)
Print a netdev error when we hit a case in which a specific VLAN is
already configured on the port. While at it, change the already existing
netdev_warn into an _err for consistency purposes.

Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

index a41d5c7428ab848557c932c76b3bb3e5b7030218..0f9103b1343870ff8f7b472f7563187f65500929 100644 (file)
@@ -289,7 +289,7 @@ static int dpaa2_switch_port_add_vlan(struct ethsw_port_priv *port_priv,
        int err;
 
        if (port_priv->vlans[vid]) {
-               netdev_warn(netdev, "VLAN %d already configured\n", vid);
+               netdev_err(netdev, "VLAN %d already configured\n", vid);
                return -EEXIST;
        }
 
@@ -1774,8 +1774,10 @@ int dpaa2_switch_port_vlans_add(struct net_device *netdev,
        /* Make sure that the VLAN is not already configured
         * on the switch port
         */
-       if (port_priv->vlans[vlan->vid] & ETHSW_VLAN_MEMBER)
+       if (port_priv->vlans[vlan->vid] & ETHSW_VLAN_MEMBER) {
+               netdev_err(netdev, "VLAN %d already configured\n", vlan->vid);
                return -EEXIST;
+       }
 
        /* Check if there is space for a new VLAN */
        err = dpsw_get_attributes(ethsw->mc_io, 0, ethsw->dpsw_handle,