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
30 Oct, 2015
3 commits
-
Fixes: 4d429c5dd ("switchdev: introduce possibility to defer obj_add/del")
Signed-off-by: Scott Feldman
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller -
When adding vlans with multiple IFLA_BRIDGE_VLAN_INFO attrs set in AFSPEC,
we would wipe the vlan obj struct after the first IFLA_BRIDGE_VLAN_INFO.
Fix this by only clearing what's necessary on each IFLA_BRIDGE_VLAN_INFO
iteration.Fixes: 9e8f4a54 ("switchdev: push object ID back to object structure")
Signed-off-by: Scott Feldman
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller -
Allow devices supporting this feature to control the flooding of unknown
unicast traffic, by making switchdev infrastructure propagate this setting
to the switch driver.Signed-off-by: Ido Schimmel
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller
20 Oct, 2015
1 commit
-
Conflicts:
drivers/net/usb/asix_common.c
net/ipv4/inet_connection_sock.c
net/switchdev/switchdev.cIn the inet_connection_sock.c case the request socket hashing scheme
is completely different in net-next.The other two conflicts were overlapping changes.
Signed-off-by: David S. Miller
15 Oct, 2015
6 commits
-
netdev_for_each_lower_dev has to be called with rtnl mutex held. So
better enforce it in switchdev functions.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Similar to the attr usecase, the caller knows if he is holding RTNL and is
in atomic section. So let the called to decide the correct call variant.This allows drivers to sleep inside their ops and wait for hw to get the
operation status. Then the status is propagated into switchdev core.
This avoids silent errors in drivers.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
When object is used in deferred work, we cannot use pointers in
switchdev object structures because the memory they point at may be already
used by someone else. So rather do local copy of the value.Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: John Fastabend
Signed-off-by: David S. Miller -
Caller should know if he can call attr_set directly (when holding RTNL)
or if he has to defer the att_set processing for later.This also allows drivers to sleep inside attr_set and report operation
status back to switchdev core. Switchdev core then warns if status is
not ok, instead of silent errors happening in drivers.Benefit from newly introduced switchdev deferred ops infrastructure.
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Signed-off-by: Jiri Pirko
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
Introduce infrastructure which will be used internally to defer ops.
Note that the deferred ops are queued up and either are processed by
scheduled work or explicitly by user calling deferred_process function.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller
13 Oct, 2015
2 commits
-
VLANs 0 and 4095 are reserved and shouldn't be used, add checks to
switchdev similar to the bridge. Also make sure ids above 4095 cannot
be passed either.Fixes: 47f8328bb1a4 ("switchdev: add new switchdev bridge setlink")
Signed-off-by: Nikolay Aleksandrov
Acked-by: Scott Feldman
Signed-off-by: David S. Miller -
We shouldn't allow BRIDGE_VLAN_INFO_PVID flag in VLAN ranges.
Signed-off-by: Nikolay Aleksandrov
Acked-by: Elad Raz
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller
12 Oct, 2015
1 commit
-
This allows us to recurse over all the ports, skipping over unsupporting
ports. Without the change, the recursion would stop at first unsupported
port.Signed-off-by: Scott Feldman
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller
03 Oct, 2015
6 commits
-
Suggested-by: Scott Feldman
Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
Replace "void *obj" with a generic structure. Introduce couple of
helpers along that.Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
Make the struct name in sync with object id name.
Suggested-by: Vivien Didelot
Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
Make the struct name in sync with object id name.
Suggested-by: Vivien Didelot
Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
To be aligned with obj.
Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller -
Suggested-by: Vivien Didelot
Signed-off-by: Jiri Pirko
Acked-by: Scott Feldman
Reviewed-by: Vivien Didelot
Signed-off-by: David S. Miller
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 -
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 -
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 -
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 -
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
25 Sep, 2015
5 commits
-
Now, since we have only 2 values for transaction phase, just use bool.
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
No longer used by drivers, as transaction queue with item destructors
takes care of abort phase internally in switchdev code. So kill it.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Before it disappears completely, move transaction phase enum under
transaction structure and make attr/obj structures a bit cleaner.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Now, the memory allocation in prepare/commit state is done separatelly
in each driver (rocker). Introduce the similar mechanism in generic
switchdev code, in form of queue. That can be used not only for memory
allocations, but also for different items. Abort item destruction
is handled as well.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
This is temporary, name "trans" will be used for something else and
"trans_ph" will eventually disappear.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller
06 Sep, 2015
1 commit
-
switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko
Acked-by: Sridhar Samudrala
Acked-by: Scott Feldman
Signed-off-by: David S. Miller
12 Aug, 2015
2 commits
-
This patch adds an ndm_state member to the switchdev_obj_fdb structure,
in order to support static FDB addresses.Set Rocker ndm_state to NUD_REACHABLE.
Signed-off-by: Vivien Didelot
Acked-by: Scott Feldman
Signed-off-by: David S. Miller -
This reverts commit f1d5ca434413b20cd3f8c18ff2b634b7782149a5, reversing
changes made to 4933d85c5173832ebd261756522095837583c458.I applied v2 instead of v3.
Signed-off-by: David S. Miller
10 Aug, 2015
2 commits
-
This patch adds a is_static boolean to the switchdev_obj_fdb structure,
in order to set the ndm_state to either NUD_NOARP or NUD_REACHABLE.Signed-off-by: Vivien Didelot
Signed-off-by: David S. Miller -
The address in the switchdev_obj_fdb structure is currently represented
as a pointer. Replacing it for a 6-byte array allows switchdev to carry
addresses directly read from hardware registers, not stored by the
switch chip driver (as in Rocker).Signed-off-by: Vivien Didelot
Signed-off-by: David S. Miller
21 Jul, 2015
2 commits
-
skb->offload_fwd_mark and dev->offload_fwd_mark are 32-bit and should be
unique for device and may even be unique for a sub-set of ports within
device, so add switchdev helper function to generate unique marks based on
port's switch ID and group_ifindex. group_ifindex would typically be the
container dev's ifindex, such as the bridge's ifindex.The generator uses a global hash table to store offload_fwd_marks hashed by
{switch ID, group_ifindex} key.Signed-off-by: Scott Feldman
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller -
Signed-off-by: Scott Feldman
Acked-by: Jiri Pirko
Signed-off-by: David S. Miller
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
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
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