Drivers may not be able to implement a VLAN addition or reconfiguration.
In those cases it's desirable to explain to the user that it was
rejected (and why).
To that end, add extack argument to ndo_bridge_setlink. Adapt all users
to that change.
Following patches will use the new argument in the bridge driver.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
 }
 
 static int bnxt_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
-                              u16 flags)
+                              u16 flags, struct netlink_ext_ack *extack)
 {
        struct bnxt *bp = netdev_priv(dev);
        struct nlattr *attr, *br_spec;
 
 }
 
 static int be_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
-                                u16 flags)
+                                u16 flags, struct netlink_ext_ack *extack)
 {
        struct be_adapter *adapter = netdev_priv(dev);
        struct nlattr *attr, *br_spec;
 
  * @dev: the netdev being configured
  * @nlh: RTNL message
  * @flags: bridge flags
+ * @extack: netlink extended ack
  *
  * Inserts a new hardware bridge if not already created and
  * enables the bridging mode requested (VEB or VEPA). If the
  **/
 static int i40e_ndo_bridge_setlink(struct net_device *dev,
                                   struct nlmsghdr *nlh,
-                                  u16 flags)
+                                  u16 flags,
+                                  struct netlink_ext_ack *extack)
 {
        struct i40e_netdev_priv *np = netdev_priv(dev);
        struct i40e_vsi *vsi = np->vsi;
 
  * @dev: the netdev being configured
  * @nlh: RTNL message
  * @flags: bridge setlink flags
+ * @extack: netlink extended ack
  *
  * Sets the bridge mode (VEB/VEPA) of the switch to which the netdev (VSI) is
  * hooked up to. Iterates through the PF VSI list and sets the loopback mode (if
  */
 static int
 ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
-                  u16 __always_unused flags)
+                  u16 __always_unused flags, struct netlink_ext_ack *extack)
 {
        struct ice_netdev_priv *np = netdev_priv(dev);
        struct ice_pf *pf = np->vsi->back;
 
 }
 
 static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
-                                   struct nlmsghdr *nlh, u16 flags)
+                                   struct nlmsghdr *nlh, u16 flags,
+                                   struct netlink_ext_ack *extack)
 {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
        struct nlattr *attr, *br_spec;
 
  *     entries to skb and update idx with the number of entries.
  *
  * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh,
- *                          u16 flags)
+ *                          u16 flags, struct netlink_ext_ack *extack)
  * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
  *                          struct net_device *dev, u32 filter_mask,
  *                          int nlflags)
 
        int                     (*ndo_bridge_setlink)(struct net_device *dev,
                                                      struct nlmsghdr *nlh,
-                                                     u16 flags);
+                                                     u16 flags,
+                                                     struct netlink_ext_ack *extack);
        int                     (*ndo_bridge_getlink)(struct sk_buff *skb,
                                                      u32 pid, u32 seq,
                                                      struct net_device *dev,
 
 }
 
 /* Change state and parameters on port. */
-int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
+int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags,
+              struct netlink_ext_ack *extack)
 {
        struct net_bridge *br = (struct net_bridge *)netdev_priv(dev);
        struct nlattr *tb[IFLA_BRPORT_MAX + 1];
 
 void br_netlink_fini(void);
 void br_ifinfo_notify(int event, const struct net_bridge *br,
                      const struct net_bridge_port *port);
-int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags);
+int br_setlink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags,
+              struct netlink_ext_ack *extack);
 int br_dellink(struct net_device *dev, struct nlmsghdr *nlmsg, u16 flags);
 int br_getlink(struct sk_buff *skb, u32 pid, u32 seq, struct net_device *dev,
               u32 filter_mask, int nlflags);
 
                        goto out;
                }
 
-               err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh, flags);
+               err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh, flags,
+                                                            extack);
                if (err)
                        goto out;
 
                        err = -EOPNOTSUPP;
                else
                        err = dev->netdev_ops->ndo_bridge_setlink(dev, nlh,
-                                                                 flags);
+                                                                 flags,
+                                                                 extack);
                if (!err) {
                        flags &= ~BRIDGE_FLAGS_SELF;