switchdev: rename SWITCHDEV_OBJ_* enum values to SWITCHDEV_OBJ_ID_*
authorJiri Pirko <jiri@mellanox.com>
Thu, 1 Oct 2015 09:03:41 +0000 (11:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Oct 2015 11:49:36 +0000 (04:49 -0700)
Suggested-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Scott Feldman <sfeldma@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/switchdev.txt
drivers/net/ethernet/rocker/rocker.c
include/net/switchdev.h
net/bridge/br_fdb.c
net/bridge/br_vlan.c
net/dsa/slave.c
net/switchdev/switchdev.c

index 9f9e2587b34790646bf06f7dedc996a5a78e04e1..c150a87c774b205feb35a1844db54d87fcb5e7f5 100644 (file)
@@ -178,7 +178,7 @@ entries are installed, for example, using iproute2 bridge cmd:
        bridge fdb add ADDR dev DEV [vlan VID] [self]
 
 The driver should use the helper switchdev_port_fdb_xxx ops for ndo_fdb_xxx
-ops, and handle add/delete/dump of SWITCHDEV_OBJ_PORT_FDB object using
+ops, and handle add/delete/dump of SWITCHDEV_OBJ_ID_PORT_FDB object using
 switchdev_port_obj_xxx ops.
 
 XXX: what should be done if offloading this rule to hardware fails (for
@@ -316,9 +316,9 @@ SWITCHDEV_OBJ_IPV[4|6]_FIB object using switchdev_port_obj_xxx ops.
 switchdev_port_obj_add is used for both adding a new FIB entry to the device,
 or modifying an existing entry on the device.
 
-XXX: Currently, only SWITCHDEV_OBJ_IPV4_FIB objects are supported.
+XXX: Currently, only SWITCHDEV_OBJ_ID_IPV4_FIB objects are supported.
 
-SWITCHDEV_OBJ_IPV4_FIB object passes:
+SWITCHDEV_OBJ_ID_IPV4_FIB object passes:
 
        struct switchdev_obj_ipv4_fib {         /* IPV4_FIB */
                u32 dst;
index 9773f5b6529693022670d85dd9864cd90b09a3af..9b2e8bed8f83769e75f1fabb94198a5ac95812ef 100644 (file)
@@ -4445,16 +4445,16 @@ static int rocker_port_obj_add(struct net_device *dev,
        int err = 0;
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = rocker_port_vlans_add(rocker_port, trans, obj);
                break;
-       case SWITCHDEV_OBJ_IPV4_FIB:
+       case SWITCHDEV_OBJ_ID_IPV4_FIB:
                fib4 = obj;
                err = rocker_port_fib_ipv4(rocker_port, trans,
                                           htonl(fib4->dst), fib4->dst_len,
                                           fib4->fi, fib4->tb_id, 0);
                break;
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = rocker_port_fdb_add(rocker_port, trans, obj);
                break;
        default:
@@ -4515,17 +4515,17 @@ static int rocker_port_obj_del(struct net_device *dev,
        int err = 0;
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = rocker_port_vlans_del(rocker_port, obj);
                break;
-       case SWITCHDEV_OBJ_IPV4_FIB:
+       case SWITCHDEV_OBJ_ID_IPV4_FIB:
                fib4 = obj;
                err = rocker_port_fib_ipv4(rocker_port, NULL,
                                           htonl(fib4->dst), fib4->dst_len,
                                           fib4->fi, fib4->tb_id,
                                           ROCKER_OP_FLAG_REMOVE);
                break;
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = rocker_port_fdb_del(rocker_port, NULL, obj);
                break;
        default:
@@ -4594,10 +4594,10 @@ static int rocker_port_obj_dump(struct net_device *dev,
        int err = 0;
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = rocker_port_fdb_dump(rocker_port, obj, cb);
                break;
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = rocker_port_vlan_dump(rocker_port, obj, cb);
                break;
        default:
index e11425eb0735382e66b3fdba674667b59d41862f..11f9c706cf5c714de0490843ea56ffa15c237932 100644 (file)
@@ -58,20 +58,20 @@ struct switchdev_attr {
 struct fib_info;
 
 enum switchdev_obj_id {
-       SWITCHDEV_OBJ_UNDEFINED,
-       SWITCHDEV_OBJ_PORT_VLAN,
-       SWITCHDEV_OBJ_IPV4_FIB,
-       SWITCHDEV_OBJ_PORT_FDB,
+       SWITCHDEV_OBJ_ID_UNDEFINED,
+       SWITCHDEV_OBJ_ID_PORT_VLAN,
+       SWITCHDEV_OBJ_ID_IPV4_FIB,
+       SWITCHDEV_OBJ_ID_PORT_FDB,
 };
 
-/* SWITCHDEV_OBJ_PORT_VLAN */
+/* SWITCHDEV_OBJ_ID_PORT_VLAN */
 struct switchdev_obj_vlan {
        u16 flags;
        u16 vid_begin;
        u16 vid_end;
 };
 
-/* SWITCHDEV_OBJ_IPV4_FIB */
+/* SWITCHDEV_OBJ_ID_IPV4_FIB */
 struct switchdev_obj_ipv4_fib {
        u32 dst;
        int dst_len;
@@ -82,7 +82,7 @@ struct switchdev_obj_ipv4_fib {
        u32 tb_id;
 };
 
-/* SWITCHDEV_OBJ_PORT_FDB */
+/* SWITCHDEV_OBJ_ID_PORT_FDB */
 struct switchdev_obj_fdb {
        const unsigned char *addr;
        u16 vid;
index 7826782d62ab6f396d06eefab3aaa98b7b2daf8e..6fc8e71277d44bfdfc8ad4c2be2dade60c320aed 100644 (file)
@@ -138,7 +138,7 @@ static void fdb_del_external_learn(struct net_bridge_fdb_entry *f)
                .vid = f->vlan_id,
        };
 
-       switchdev_port_obj_del(f->dst->dev, SWITCHDEV_OBJ_PORT_FDB, &fdb);
+       switchdev_port_obj_del(f->dst->dev, SWITCHDEV_OBJ_ID_PORT_FDB, &fdb);
 }
 
 static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f)
index 75214a51cf0e05582f8f3b556ae4f74343dc24ca..68b5a11256671eecb9220d7effbb417d1ae19610 100644 (file)
@@ -88,7 +88,8 @@ static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
                        .vid_end = vid,
                };
 
-               err = switchdev_port_obj_add(dev, SWITCHDEV_OBJ_PORT_VLAN, &v);
+               err = switchdev_port_obj_add(dev, SWITCHDEV_OBJ_ID_PORT_VLAN,
+                                            &v);
                if (err == -EOPNOTSUPP)
                        err = 0;
        }
@@ -136,7 +137,8 @@ static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
                        .vid_end = vid,
                };
 
-               err = switchdev_port_obj_del(dev, SWITCHDEV_OBJ_PORT_VLAN, &v);
+               err = switchdev_port_obj_del(dev, SWITCHDEV_OBJ_ID_PORT_VLAN,
+                                            &v);
                if (err == -EOPNOTSUPP)
                        err = 0;
        }
index 7b1d9ec74e09289eee75340d1638f595170a42cb..a7060298b8563d36c17e7dccf0204483288d7c38 100644 (file)
@@ -485,10 +485,10 @@ static int dsa_slave_port_obj_add(struct net_device *dev,
         */
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = dsa_slave_port_fdb_add(dev, obj, trans);
                break;
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = dsa_slave_port_vlan_add(dev, obj, trans);
                break;
        default:
@@ -505,10 +505,10 @@ static int dsa_slave_port_obj_del(struct net_device *dev,
        int err;
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = dsa_slave_port_fdb_del(dev, obj);
                break;
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = dsa_slave_port_vlan_del(dev, obj);
                break;
        default:
@@ -526,10 +526,10 @@ static int dsa_slave_port_obj_dump(struct net_device *dev,
        int err;
 
        switch (id) {
-       case SWITCHDEV_OBJ_PORT_FDB:
+       case SWITCHDEV_OBJ_ID_PORT_FDB:
                err = dsa_slave_port_fdb_dump(dev, obj, cb);
                break;
-       case SWITCHDEV_OBJ_PORT_VLAN:
+       case SWITCHDEV_OBJ_ID_PORT_VLAN:
                err = dsa_slave_port_vlan_dump(dev, obj, cb);
                break;
        default:
index fe82fab1d55c1600a29a81b83c1cd851eb82a609..5b1aa9f6f26156b5f1f413514cfbc6462a5d1466 100644 (file)
@@ -584,7 +584,7 @@ static int switchdev_port_vlan_fill(struct sk_buff *skb, struct net_device *dev,
 
        if ((filter_mask & RTEXT_FILTER_BRVLAN) ||
            (filter_mask & RTEXT_FILTER_BRVLAN_COMPRESSED)) {
-               err = switchdev_port_obj_dump(dev, SWITCHDEV_OBJ_PORT_VLAN,
+               err = switchdev_port_obj_dump(dev, SWITCHDEV_OBJ_ID_PORT_VLAN,
                                              &dump.vlan,
                                              switchdev_port_vlan_dump_cb);
                if (err)
@@ -725,7 +725,7 @@ static int switchdev_port_br_afspec(struct net_device *dev,
                        vlan.vid_end = vinfo->vid;
                        if (vlan.vid_end <= vlan.vid_begin)
                                return -EINVAL;
-                       err = f(dev, SWITCHDEV_OBJ_PORT_VLAN, &vlan);
+                       err = f(dev, SWITCHDEV_OBJ_ID_PORT_VLAN, &vlan);
                        if (err)
                                return err;
                        memset(&vlan, 0, sizeof(vlan));
@@ -734,7 +734,7 @@ static int switchdev_port_br_afspec(struct net_device *dev,
                                return -EINVAL;
                        vlan.vid_begin = vinfo->vid;
                        vlan.vid_end = vinfo->vid;
-                       err = f(dev, SWITCHDEV_OBJ_PORT_VLAN, &vlan);
+                       err = f(dev, SWITCHDEV_OBJ_ID_PORT_VLAN, &vlan);
                        if (err)
                                return err;
                        memset(&vlan, 0, sizeof(vlan));
@@ -824,7 +824,7 @@ int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
                .vid = vid,
        };
 
-       return switchdev_port_obj_add(dev, SWITCHDEV_OBJ_PORT_FDB, &fdb);
+       return switchdev_port_obj_add(dev, SWITCHDEV_OBJ_ID_PORT_FDB, &fdb);
 }
 EXPORT_SYMBOL_GPL(switchdev_port_fdb_add);
 
@@ -848,7 +848,7 @@ int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
                .vid = vid,
        };
 
-       return switchdev_port_obj_del(dev, SWITCHDEV_OBJ_PORT_FDB, &fdb);
+       return switchdev_port_obj_del(dev, SWITCHDEV_OBJ_ID_PORT_FDB, &fdb);
 }
 EXPORT_SYMBOL_GPL(switchdev_port_fdb_del);
 
@@ -926,7 +926,7 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
                .idx = idx,
        };
 
-       switchdev_port_obj_dump(dev, SWITCHDEV_OBJ_PORT_FDB, &dump.fdb,
+       switchdev_port_obj_dump(dev, SWITCHDEV_OBJ_ID_PORT_FDB, &dump.fdb,
                                switchdev_port_fdb_dump_cb);
        return dump.idx;
 }
@@ -1033,7 +1033,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
        if (!dev)
                return 0;
 
-       err = switchdev_port_obj_add(dev, SWITCHDEV_OBJ_IPV4_FIB, &ipv4_fib);
+       err = switchdev_port_obj_add(dev, SWITCHDEV_OBJ_ID_IPV4_FIB, &ipv4_fib);
        if (!err)
                fi->fib_flags |= RTNH_F_OFFLOAD;
 
@@ -1075,7 +1075,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
        if (!dev)
                return 0;
 
-       err = switchdev_port_obj_del(dev, SWITCHDEV_OBJ_IPV4_FIB, &ipv4_fib);
+       err = switchdev_port_obj_del(dev, SWITCHDEV_OBJ_ID_IPV4_FIB, &ipv4_fib);
        if (!err)
                fi->fib_flags &= ~RTNH_F_OFFLOAD;