]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'switchdev-cleanups'
authorDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2015 16:26:28 +0000 (12:26 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2015 16:26:28 +0000 (12:26 -0400)
Scott Feldman says:

====================
switchdev: more (minor) cleanups

Fix some sparse warnings and include some documentation review comments that
didn't get picked up in the switchdev Spring Cleanup series.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/switchdev.txt
drivers/net/ethernet/rocker/rocker.c
include/net/switchdev.h
net/switchdev/switchdev.c

index b3e18c8fd0408eb925bc3d35c3d9f99c5e82ef3a..616f89267d23e276f4f531fb7e1249fbd5c12537 100644 (file)
@@ -99,7 +99,7 @@ kernel pick the default netdev name, and let udev set the final name based on a
 port attribute.
 
 Using port PHYS name (ndo_get_phys_port_name) for the key is particularly
-useful for dynically-named ports where the device names it's ports based on
+useful for dynamically-named ports where the device names its ports based on
 external configuration.  For example, if a physical 40G port is split logically
 into 4 10G ports, resulting in 4 port netdevs, the device can give a unique
 name for each port using port PHYS name.  The udev rule would be:
@@ -131,7 +131,7 @@ NETIF_F_NETNS_LOCAL
 If the switchdev driver (and device) only supports offloading of the default
 network namespace (netns), the driver should set this feature flag to prevent
 the port netdev from being moved out of the default netns.  A netns-aware
-driver/device would not set this flag and be resposible for partitioning
+driver/device would not set this flag and be responsible for partitioning
 hardware to preserve netns containment.  This means hardware cannot forward
 traffic from a port in one namespace to another port in another namespace.
 
@@ -177,6 +177,9 @@ entries are installed, for example, using iproute2 bridge cmd:
 
        bridge fdb add ADDR dev DEV [vlan VID] [self]
 
+XXX: what should be done if offloading this rule to hardware fails (for
+example, due to full capacity in hardware tables) ?
+
 Note: by default, the bridge does not filter on VLAN and only bridges untagged
 traffic.  To enable VLAN support, turn on VLAN filtering:
 
index 1fc006b446c1a0d38cffdf63bff4196d9bbb3f24..ca533936658bf9b0eadf79f3f6d5f9e43fed75b4 100644 (file)
@@ -4471,7 +4471,7 @@ static int rocker_port_obj_add(struct net_device *dev,
        case SWITCHDEV_OBJ_IPV4_FIB:
                fib4 = &obj->ipv4_fib;
                err = rocker_port_fib_ipv4(rocker_port, obj->trans,
-                                          fib4->dst, fib4->dst_len,
+                                          htonl(fib4->dst), fib4->dst_len,
                                           fib4->fi, fib4->tb_id, 0);
                break;
        default:
@@ -4525,8 +4525,9 @@ static int rocker_port_obj_del(struct net_device *dev,
        case SWITCHDEV_OBJ_IPV4_FIB:
                fib4 = &obj->ipv4_fib;
                err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE,
-                                          fib4->dst, fib4->dst_len, fib4->fi,
-                                          fib4->tb_id, ROCKER_OP_FLAG_REMOVE);
+                                          htonl(fib4->dst), fib4->dst_len,
+                                          fib4->fi, fib4->tb_id,
+                                          ROCKER_OP_FLAG_REMOVE);
                break;
        default:
                err = -EOPNOTSUPP;
index 3b217b4cca277fdfc56c60b493f166826d19d2be..9f9a7cc573c35b638e10aeec224b5c0c2edf8224 100644 (file)
@@ -53,7 +53,7 @@ struct switchdev_obj {
        enum switchdev_obj_id id;
        enum switchdev_trans trans;
        union {
-               struct switchdev_obj_vlan {                     /* PORT_VLAN */
+               struct switchdev_obj_vlan {             /* PORT_VLAN */
                        u16 flags;
                        u16 vid_start;
                        u16 vid_end;
index 65d49d4477b912d4a2e3d3beb1ce24a59f77c4bc..77f1b6e3f78e7cccbebd0b10192c9bf619c1e9cb 100644 (file)
@@ -188,7 +188,8 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
 }
 EXPORT_SYMBOL_GPL(switchdev_port_attr_set);
 
-int __switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
+static int __switchdev_port_obj_add(struct net_device *dev,
+                                   struct switchdev_obj *obj)
 {
        const struct switchdev_ops *ops = dev->switchdev_ops;
        struct net_device *lower_dev;
@@ -644,7 +645,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
        struct switchdev_obj fib_obj = {
                .id = SWITCHDEV_OBJ_IPV4_FIB,
                .ipv4_fib = {
-                       .dst = htonl(dst),
+                       .dst = dst,
                        .dst_len = dst_len,
                        .fi = fi,
                        .tos = tos,
@@ -698,7 +699,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
        struct switchdev_obj fib_obj = {
                .id = SWITCHDEV_OBJ_IPV4_FIB,
                .ipv4_fib = {
-                       .dst = htonl(dst),
+                       .dst = dst,
                        .dst_len = dst_len,
                        .fi = fi,
                        .tos = tos,