History

net: switchdev: propagate extack to port attributes

When a struct switchdev_attr is notified through switchdev, there is no way to report informational messages, unlike for struct switchdev_obj.

Vladimir Oltean committed 5 years ago

Commit 4c08c581 parent b0aae0b8 files · +24 −11Browse files

Showing the changes to net/switchdev/switchdev.c (1 of 8 files). Show all

Unified · Split

net/switchdev/switchdev.c+8−3
@@ -488,14 +488,18 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev, · 487 unmodified lines
488 struct switchdev_notifier_port_attr_info *port_attr_info,488 struct switchdev_notifier_port_attr_info *port_attr_info,
489 bool (*check_cb)(const struct net_device *dev),489 bool (*check_cb)(const struct net_device *dev),
490 int (*set_cb)(struct net_device *dev,490 int (*set_cb)(struct net_device *dev,
491 const struct switchdev_attr *attr))491 const struct switchdev_attr *attr,
492 struct netlink_ext_ack *extack))
492{493{
494 struct netlink_ext_ack *extack;
493 struct net_device *lower_dev;495 struct net_device *lower_dev;
494 struct list_head *iter;496 struct list_head *iter;
495 int err = -EOPNOTSUPP;497 int err = -EOPNOTSUPP;
496 498
499 extack = switchdev_notifier_info_to_extack(&port_attr_info->info);
500
497 if (check_cb(dev)) {501 if (check_cb(dev)) {
498 err = set_cb(dev, port_attr_info->attr);502 err = set_cb(dev, port_attr_info->attr, extack);
499 if (err != -EOPNOTSUPP)503 if (err != -EOPNOTSUPP)
500 port_attr_info->handled = true;504 port_attr_info->handled = true;
501 return err;505 return err;
@@ -525,7 +529,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev, · 23 unmodified lines
525 struct switchdev_notifier_port_attr_info *port_attr_info,529 struct switchdev_notifier_port_attr_info *port_attr_info,
526 bool (*check_cb)(const struct net_device *dev),530 bool (*check_cb)(const struct net_device *dev),
527 int (*set_cb)(struct net_device *dev,531 int (*set_cb)(struct net_device *dev,
528 const struct switchdev_attr *attr))532 const struct switchdev_attr *attr,
533 struct netlink_ext_ack *extack))
529{534{
530 int err;535 int err;
531 536

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t