summaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-02-13 04:08:05 +0300
committerDavid S. Miller <davem@davemloft.net>2021-02-13 04:08:05 +0300
commit4098ced4680a485c5953f60ac63dff19f3fb3d42 (patch)
tree9a5ee02c4090b3bdb06c3f69079d7a08e694eaba /net/switchdev/switchdev.c
parentb0aae0bde26f276401640e05e81a8a0ce3d8f70e (diff)
parent4d9423549501812dafe6551d4a78db079ea87648 (diff)
downloadlinux-4098ced4680a485c5953f60ac63dff19f3fb3d42.tar.xz
Merge branch 'brport-flags'
Vladimir Oltean says: ==================== Cleanup in brport flags switchdev offload for DSA The initial goal of this series was to have better support for standalone ports mode on the DSA drivers like ocelot/felix and sja1105. This turned out to require some API adjustments in both directions: to the information presented to and by the switchdev notifier, and to the API presented to the switch drivers by the DSA layer. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 94113ca29dcf..0b84f076591e 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -488,14 +488,18 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev,
struct switchdev_notifier_port_attr_info *port_attr_info,
bool (*check_cb)(const struct net_device *dev),
int (*set_cb)(struct net_device *dev,
- const struct switchdev_attr *attr))
+ const struct switchdev_attr *attr,
+ 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_attr_info->info);
+
if (check_cb(dev)) {
- err = set_cb(dev, port_attr_info->attr);
+ err = set_cb(dev, port_attr_info->attr, extack);
if (err != -EOPNOTSUPP)
port_attr_info->handled = true;
return err;
@@ -525,7 +529,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev,
struct switchdev_notifier_port_attr_info *port_attr_info,
bool (*check_cb)(const struct net_device *dev),
int (*set_cb)(struct net_device *dev,
- const struct switchdev_attr *attr))
+ const struct switchdev_attr *attr,
+ struct netlink_ext_ack *extack))
{
int err;