switchdev: rename vlan vid_start to vid_begin
[deliverable/linux.git] / net / switchdev / switchdev.c
index ac853acbe21181eb3a80317faebd040e5f76b4a6..448d9199cea2718e0d4b57aa19debd93ae2ed684 100644 (file)
@@ -103,7 +103,9 @@ static void switchdev_port_attr_set_work(struct work_struct *work)
 
        rtnl_lock();
        err = switchdev_port_attr_set(asw->dev, &asw->attr);
-       BUG_ON(err);
+       if (err && err != -EOPNOTSUPP)
+               netdev_err(asw->dev, "failed (err=%d) to set attribute (id=%d)\n",
+                          err, asw->attr.id);
        rtnl_unlock();
 
        dev_put(asw->dev);
@@ -508,23 +510,23 @@ static int switchdev_port_br_afspec(struct net_device *dev,
                vinfo = nla_data(attr);
                vlan->flags = vinfo->flags;
                if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
-                       if (vlan->vid_start)
+                       if (vlan->vid_begin)
                                return -EINVAL;
-                       vlan->vid_start = vinfo->vid;
+                       vlan->vid_begin = vinfo->vid;
                } else if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_END) {
-                       if (!vlan->vid_start)
+                       if (!vlan->vid_begin)
                                return -EINVAL;
                        vlan->vid_end = vinfo->vid;
-                       if (vlan->vid_end <= vlan->vid_start)
+                       if (vlan->vid_end <= vlan->vid_begin)
                                return -EINVAL;
                        err = f(dev, &obj);
                        if (err)
                                return err;
                        memset(vlan, 0, sizeof(*vlan));
                } else {
-                       if (vlan->vid_start)
+                       if (vlan->vid_begin)
                                return -EINVAL;
-                       vlan->vid_start = vinfo->vid;
+                       vlan->vid_begin = vinfo->vid;
                        vlan->vid_end = vinfo->vid;
                        err = f(dev, &obj);
                        if (err)
@@ -654,7 +656,6 @@ struct switchdev_fdb_dump {
        struct switchdev_obj obj;
        struct sk_buff *skb;
        struct netlink_callback *cb;
-       struct net_device *filter_dev;
        int idx;
 };
 
@@ -667,14 +668,10 @@ static int switchdev_port_fdb_dump_cb(struct net_device *dev,
        u32 seq = dump->cb->nlh->nlmsg_seq;
        struct nlmsghdr *nlh;
        struct ndmsg *ndm;
-       struct net_device *master = netdev_master_upper_dev_get(dev);
 
        if (dump->idx < dump->cb->args[0])
                goto skip;
 
-       if (master && dump->filter_dev != master)
-               goto skip;
-
        nlh = nlmsg_put(dump->skb, portid, seq, RTM_NEWNEIGH,
                        sizeof(*ndm), NLM_F_MULTI);
        if (!nlh)
@@ -728,7 +725,6 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
                },
                .skb = skb,
                .cb = cb,
-               .filter_dev = filter_dev,
                .idx = idx,
        };
        int err;
@@ -803,7 +799,7 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
 }
 
 /**
- *     switchdev_fib_ipv4_add - Add IPv4 route entry to switch
+ *     switchdev_fib_ipv4_add - Add/modify switch IPv4 route entry
  *
  *     @dst: route's IPv4 destination address
  *     @dst_len: destination address length (prefix length)
@@ -813,7 +809,7 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
  *     @nlflags: netlink flags passed in (NLM_F_*)
  *     @tb_id: route table ID
  *
- *     Add IPv4 route entry to switch device.
+ *     Add/modify switch IPv4 route entry.
  */
 int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
                           u8 tos, u8 type, u32 nlflags, u32 tb_id)
@@ -853,7 +849,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
        if (!err)
                fi->fib_flags |= RTNH_F_OFFLOAD;
 
-       return err;
+       return err == -EOPNOTSUPP ? 0 : err;
 }
 EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_add);
 
@@ -898,7 +894,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
        if (!err)
                fi->fib_flags &= ~RTNH_F_OFFLOAD;
 
-       return err;
+       return err == -EOPNOTSUPP ? 0 : err;
 }
 EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_del);
 
This page took 0.027892 seconds and 5 git commands to generate.