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
488488 struct switchdev_notifier_port_attr_info *port_attr_info,
489489 bool (*check_cb)(const struct net_device *dev),
490490 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))
492493 {
494+ struct netlink_ext_ack *extack;
493495 struct net_device *lower_dev;
494496 struct list_head *iter;
495497 int err = -EOPNOTSUPP;
496498
499+ extack = switchdev_notifier_info_to_extack(&port_attr_info->info);
500+
497501 if (check_cb(dev)) {
498− err = set_cb(dev, port_attr_info->attr);
502+ err = set_cb(dev, port_attr_info->attr, extack);
499503 if (err != -EOPNOTSUPP)
500504 port_attr_info->handled = true;
501505 return err;
@@ -525,7 +529,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev, · 23 unmodified lines
525529 struct switchdev_notifier_port_attr_info *port_attr_info,
526530 bool (*check_cb)(const struct net_device *dev),
527531 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))
529534 {
530535 int err;
531536

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