04 Nov, 2015

1 commit

  • Caller passing down the SKIP_EOPNOTSUPP switchdev flag expects that
    -EOPNOTSUPP cannot be returned. But in case of direct op call without
    recurtion, this may happen. So fix this by checking it always on the
    end of __switchdev_port_attr_set function.

    Fixes: 464314ea6c11 ("switchdev: skip over ports returning -EOPNOTSUPP when recursing ports")
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

30 Oct, 2015

3 commits


20 Oct, 2015

1 commit


15 Oct, 2015

6 commits


13 Oct, 2015

2 commits


12 Oct, 2015

1 commit


03 Oct, 2015

6 commits


30 Sep, 2015

5 commits

  • Similar to the notifier_call callback of a notifier_block, change the
    function signature of switchdev add and del operations to:

    int switchdev_port_obj_add/del(struct net_device *dev,
    enum switchdev_obj_id id, void *obj);

    This allows the caller to pass a specific switchdev_obj_* structure
    instead of the generic switchdev_obj one.

    Drivers implementation of these operations and switchdev have been
    changed accordingly.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • Similar to the notifier_call callback of a notifier_block, change the
    function signature of switchdev dump operation to:

    int switchdev_port_obj_dump(struct net_device *dev,
    enum switchdev_obj_id id, void *obj,
    int (*cb)(void *obj));

    This allows the caller to pass and expect back a specific
    switchdev_obj_* structure instead of the generic switchdev_obj one.

    Drivers implementation of dump operation can now expect this specific
    structure and call the callback with it. Drivers have been changed
    accordingly.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The net_device associated to a dump operation does not have to be passed
    to the callback. switchdev stores it in a superset struct, if needed.

    Also some drivers (such as DSA drivers) may not have easy access to it.

    This will simplify pushing the callback function down to the drivers.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The FDB dump callback requires the related net_device so move it to the
    struct switchdev_fdb_dump superset instead of using a callback param.

    With this done, it'll be simpler to change the dump function signature.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The static switchdev_port_vlan_dump_put function does not need the
    net_device parameter, so remove it.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     

25 Sep, 2015

5 commits


06 Sep, 2015

1 commit


12 Aug, 2015

2 commits


10 Aug, 2015

2 commits


21 Jul, 2015

2 commits


12 Jul, 2015

1 commit

  • There is no need to abort attribute setting or object addition, if the
    prepare phase returned operation not supported.

    Thus, abort these two transactions only if the error is not -EOPNOTSUPP.

    Signed-off-by: Vivien Didelot
    Acked-by: Jiri Pirko
    Acked-by: Scott Feldman
    Signed-off-by: David S. Miller

    Vivien Didelot
     

24 Jun, 2015

1 commit

  • switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
    attributes, but a driver doesn't need to implement this in order to get
    bridge link information.

    So error out only on errors different than -EOPNOTSUPP.

    (This is a follow-up patch for 7d4f8d8.)

    Fixes: 8793d0a664a8 ("switchdev: add new switchdev_port_bridge_getlink")
    Signed-off-by: Vivien Didelot
    Acked-by: Jiri Pirko
    Acked-by: Scott Feldman
    Signed-off-by: David S. Miller

    Vivien Didelot
     

23 Jun, 2015

1 commit

  • This particular BUG_ON condition was checking for attr set err in the
    COMMIT phase, which isn't expected (it's a driver bug if PREPARE phase is
    OK but COMMIT fails). But BUG_ON() is too strong for this case, so change
    to WARN(). BUG_ON() would be warranted if the system was corrupted beyond
    repair, but this is not the case here.

    Signed-off-by: Scott Feldman
    Signed-off-by: David S. Miller

    Scott Feldman