Commit 7f6334f7 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'Propagate-extack-for-switchdev-LANs-from-DSA'



Vladimir Oltean says:

====================
Propagate extack for switchdev VLANs from DSA

This series moves the restriction messages printed by the DSA core, and
by some individual device drivers, into the netlink extended ack
structure, to be communicated to user space where possible, or still
printed to the kernel log from the bridge layer.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c48f8607 89153ed6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1409,7 +1409,8 @@ void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
}
EXPORT_SYMBOL(b53_phylink_mac_link_up);

int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
		       struct netlink_ext_ack *extack)
{
	struct b53_device *dev = ds->priv;

@@ -1444,7 +1445,8 @@ static int b53_vlan_prepare(struct dsa_switch *ds, int port,
}

int b53_vlan_add(struct dsa_switch *ds, int port,
		 const struct switchdev_obj_port_vlan *vlan)
		 const struct switchdev_obj_port_vlan *vlan,
		 struct netlink_ext_ack *extack)
{
	struct b53_device *dev = ds->priv;
	bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
+4 −2
Original line number Diff line number Diff line
@@ -346,9 +346,11 @@ void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
			     struct phy_device *phydev,
			     int speed, int duplex,
			     bool tx_pause, bool rx_pause);
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
		       struct netlink_ext_ack *extack);
int b53_vlan_add(struct dsa_switch *ds, int port,
		 const struct switchdev_obj_port_vlan *vlan);
		 const struct switchdev_obj_port_vlan *vlan,
		 struct netlink_ext_ack *extack);
int b53_vlan_del(struct dsa_switch *ds, int port,
		 const struct switchdev_obj_port_vlan *vlan);
int b53_fdb_add(struct dsa_switch *ds, int port,
+1 −1
Original line number Diff line number Diff line
@@ -891,7 +891,7 @@ static int bcm_sf2_cfp_rule_insert(struct dsa_switch *ds, int port,
		else
			vlan.flags = 0;

		ret = ds->ops->port_vlan_add(ds, port_num, &vlan);
		ret = ds->ops->port_vlan_add(ds, port_num, &vlan, NULL);
		if (ret)
			return ret;
	}
+4 −2
Original line number Diff line number Diff line
@@ -190,7 +190,8 @@ static void dsa_loop_port_stp_state_set(struct dsa_switch *ds, int port,
}

static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
					bool vlan_filtering)
					bool vlan_filtering,
					struct netlink_ext_ack *extack)
{
	dev_dbg(ds->dev, "%s: port: %d, vlan_filtering: %d\n",
		__func__, port, vlan_filtering);
@@ -199,7 +200,8 @@ static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
}

static int dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
				  const struct switchdev_obj_port_vlan *vlan)
				  const struct switchdev_obj_port_vlan *vlan,
				  struct netlink_ext_ack *extack)
{
	bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
	bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
+10 −5
Original line number Diff line number Diff line
@@ -341,7 +341,8 @@ static u16 hellcreek_private_vid(int port)
}

static int hellcreek_vlan_prepare(struct dsa_switch *ds, int port,
				  const struct switchdev_obj_port_vlan *vlan)
				  const struct switchdev_obj_port_vlan *vlan,
				  struct netlink_ext_ack *extack)
{
	struct hellcreek *hellcreek = ds->priv;
	int i;
@@ -358,9 +359,11 @@ static int hellcreek_vlan_prepare(struct dsa_switch *ds, int port,
		if (!dsa_is_user_port(ds, i))
			continue;

		if (vlan->vid == restricted_vid)
		if (vlan->vid == restricted_vid) {
			NL_SET_ERR_MSG_MOD(extack, "VID restricted by driver");
			return -EBUSY;
		}
	}

	return 0;
}
@@ -445,14 +448,15 @@ static void hellcreek_unapply_vlan(struct hellcreek *hellcreek, int port,
}

static int hellcreek_vlan_add(struct dsa_switch *ds, int port,
			      const struct switchdev_obj_port_vlan *vlan)
			      const struct switchdev_obj_port_vlan *vlan,
			      struct netlink_ext_ack *extack)
{
	bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
	bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
	struct hellcreek *hellcreek = ds->priv;
	int err;

	err = hellcreek_vlan_prepare(ds, port, vlan);
	err = hellcreek_vlan_prepare(ds, port, vlan, extack);
	if (err)
		return err;

@@ -871,7 +875,8 @@ static int hellcreek_fdb_dump(struct dsa_switch *ds, int port,
}

static int hellcreek_vlan_filtering(struct dsa_switch *ds, int port,
				    bool vlan_filtering)
				    bool vlan_filtering,
				    struct netlink_ext_ack *extack)
{
	struct hellcreek *hellcreek = ds->priv;

Loading