summaryrefslogtreecommitdiffstats
path: root/net/switchdev
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-12-12 18:02:56 +0100
committerDavid S. Miller <davem@davemloft.net>2018-12-13 01:34:22 +0100
commit6921351359395a6c6ac72cd275a8393f399cecc7 (patch)
tree980ee7e316a654327c1824e914e541c2c9a69fc5 /net/switchdev
parentnet: switchdev: Add extack to struct switchdev_notifier_info (diff)
downloadlinux-6921351359395a6c6ac72cd275a8393f399cecc7.tar.xz
linux-6921351359395a6c6ac72cd275a8393f399cecc7.zip
net: switchdev: Add extack to switchdev_handle_port_obj_add() callback
Drivers use switchdev_handle_port_obj_add() to handle recursive descent through lower devices. Change this function prototype to take add_cb that itself takes an extack argument. Decode extack from switchdev_notifier_port_obj_info and pass it to add_cb. Update mlxsw and ocelot drivers which use this helper. Signed-off-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r--net/switchdev/switchdev.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index aa84acfb6632..5df9d1138ac9 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -616,16 +616,21 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev,
bool (*check_cb)(const struct net_device *dev),
int (*add_cb)(struct net_device *dev,
const struct switchdev_obj *obj,
- struct switchdev_trans *trans))
+ struct switchdev_trans *trans,
+ struct netlink_ext_ack *extack))
{
+ struct netlink_ext_ack *extack;
struct net_device *lower_dev;
struct list_head *iter;
int err = -EOPNOTSUPP;
+ extack = switchdev_notifier_info_to_extack(&port_obj_info->info);
+
if (check_cb(dev)) {
/* This flag is only checked if the return value is success. */
port_obj_info->handled = true;
- return add_cb(dev, port_obj_info->obj, port_obj_info->trans);
+ return add_cb(dev, port_obj_info->obj, port_obj_info->trans,
+ extack);
}
/* Switch ports might be stacked under e.g. a LAG. Ignore the
@@ -650,7 +655,8 @@ int switchdev_handle_port_obj_add(struct net_device *dev,
bool (*check_cb)(const struct net_device *dev),
int (*add_cb)(struct net_device *dev,
const struct switchdev_obj *obj,
- struct switchdev_trans *trans))
+ struct switchdev_trans *trans,
+ struct netlink_ext_ack *extack))
{
int err;