summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-08-03 19:11:34 +0300
committerDavid S. Miller <davem@davemloft.net>2020-08-04 04:06:46 +0300
commitc88e11e04716ab4ed51d5972ea04c7b70b6e9d8a (patch)
treec1706574e56c5f55265c9f6c4dc2a7f37269709b /net/core
parent08e335f6ad35a019f4cb1a74badc2f4bceb63bcf (diff)
downloadlinux-c88e11e04716ab4ed51d5972ea04c7b70b6e9d8a.tar.xz
devlink: Pass extack when setting trap's action and group's parameters
A later patch will refuse to set the action of certain traps in mlxsw and also to change the policer binding of certain groups. Pass extack so that failure could be communicated clearly to user space. Reviewed-by: Petr Machata <petrm@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/devlink.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index bde4c29a30bc..e674f0f46dc2 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6423,7 +6423,7 @@ static int __devlink_trap_action_set(struct devlink *devlink,
}
err = devlink->ops->trap_action_set(devlink, trap_item->trap,
- trap_action);
+ trap_action, extack);
if (err)
return err;
@@ -6713,7 +6713,8 @@ static int devlink_trap_group_set(struct devlink *devlink,
}
policer = policer_item ? policer_item->policer : NULL;
- err = devlink->ops->trap_group_set(devlink, group_item->group, policer);
+ err = devlink->ops->trap_group_set(devlink, group_item->group, policer,
+ extack);
if (err)
return err;
@@ -9051,7 +9052,8 @@ static void devlink_trap_disable(struct devlink *devlink,
if (WARN_ON_ONCE(!trap_item))
return;
- devlink->ops->trap_action_set(devlink, trap, DEVLINK_TRAP_ACTION_DROP);
+ devlink->ops->trap_action_set(devlink, trap, DEVLINK_TRAP_ACTION_DROP,
+ NULL);
trap_item->action = DEVLINK_TRAP_ACTION_DROP;
}