Message ID | 20231204163528.1797565-4-ioana.ciornei@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | dpaa2-switch: small improvements | expand |
On Mon, 4 Dec 2023 18:35:23 +0200 Ioana Ciornei wrote: > Print a netdev error when we hit a case in which a specific VLAN is > already configured on the port. Would be nice to cover the "why" - I'm a bit curious what difference upgrading from warn to err makes. Is it just for consistency with the newly added case?
On Tue, Dec 05, 2023 at 07:59:33PM -0800, Jakub Kicinski wrote: > On Mon, 4 Dec 2023 18:35:23 +0200 Ioana Ciornei wrote: > > Print a netdev error when we hit a case in which a specific VLAN is > > already configured on the port. > > Would be nice to cover the "why" - I'm a bit curious what difference > upgrading from warn to err makes. Is it just for consistency with the > newly added case? Yes, it's more about consistency with the newly added print. I just chose the err instead of warn because we actually error out in that case, we don't just print a warning and continue.
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 5b0ab06b40a7..654dd10df307 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -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,
Print a netdev error when we hit a case in which a specific VLAN is already configured on the port. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> --- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)