When a struct switchdev_attr is notified through switchdev, there is no way to report informational messages, unlike for struct switchdev_obj.
Unified · Split
| @@ -695,7 +695,8 @@ err_port_stp_set: · 694 unmodified lines | |||
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | static int prestera_port_obj_attr_set(struct net_device *dev, | 697 | static int prestera_port_obj_attr_set(struct net_device *dev, |
| 698 | const struct switchdev_attr *attr) | 698 | const struct switchdev_attr *attr, |
| 699 | struct netlink_ext_ack *extack) | ||
| 699 | { | 700 | { |
| 700 | struct prestera_port *port = netdev_priv(dev); | 701 | struct prestera_port *port = netdev_priv(dev); |
| 701 | int err = 0; | 702 | int err = 0; |
| @@ -887,7 +887,8 @@ mlxsw_sp_port_attr_br_mrouter_set(struct mlxsw_sp_port *mlxsw_sp_port, · 886 unmodified lines | |||
| 887 | } | 887 | } |
| 888 | 888 | ||
| 889 | static int mlxsw_sp_port_attr_set(struct net_device *dev, | 889 | static int mlxsw_sp_port_attr_set(struct net_device *dev, |
| 890 | const struct switchdev_attr *attr) | 890 | const struct switchdev_attr *attr, |
| 891 | struct netlink_ext_ack *extack) | ||
| 891 | { | 892 | { |
| 892 | struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); | 893 | struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); |
| 893 | int err; | 894 | int err; |
| @@ -1005,7 +1005,8 @@ static void ocelot_port_attr_mc_set(struct ocelot *ocelot, int port, bool mc) · 1004 unmodified lines | |||
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| 1007 | static int ocelot_port_attr_set(struct net_device *dev, | 1007 | static int ocelot_port_attr_set(struct net_device *dev, |
| 1008 | const struct switchdev_attr *attr) | 1008 | const struct switchdev_attr *attr, |
| 1009 | struct netlink_ext_ack *extack) | ||
| 1009 | { | 1010 | { |
| 1010 | struct ocelot_port_private *priv = netdev_priv(dev); | 1011 | struct ocelot_port_private *priv = netdev_priv(dev); |
| 1011 | struct ocelot *ocelot = priv->port.ocelot; | 1012 | struct ocelot *ocelot = priv->port.ocelot; |
| @@ -81,7 +81,8 @@ static int am65_cpsw_port_attr_br_flags_pre_set(struct net_device *netdev, · 80 unmodified lines | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static int am65_cpsw_port_attr_set(struct net_device *ndev, | 83 | static int am65_cpsw_port_attr_set(struct net_device *ndev, |
| 84 | const struct switchdev_attr *attr) | 84 | const struct switchdev_attr *attr, |
| 85 | struct netlink_ext_ack *extack) | ||
| 85 | { | 86 | { |
| 86 | struct am65_cpsw_port *port = am65_ndev_to_port(ndev); | 87 | struct am65_cpsw_port *port = am65_ndev_to_port(ndev); |
| 87 | int ret; | 88 | int ret; |
| @@ -83,7 +83,8 @@ static int cpsw_port_attr_br_flags_pre_set(struct net_device *netdev, · 82 unmodified lines | |||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | static int cpsw_port_attr_set(struct net_device *ndev, | 85 | static int cpsw_port_attr_set(struct net_device *ndev, |
| 86 | const struct switchdev_attr *attr) | 86 | const struct switchdev_attr *attr, |
| 87 | struct netlink_ext_ack *extack) | ||
| 87 | { | 88 | { |
| 88 | struct cpsw_priv *priv = netdev_priv(ndev); | 89 | struct cpsw_priv *priv = netdev_priv(ndev); |
| 89 | int ret; | 90 | int ret; |
| @@ -281,7 +281,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev, · 280 unmodified lines | |||
| 281 | struct switchdev_notifier_port_attr_info *port_attr_info, | 281 | struct switchdev_notifier_port_attr_info *port_attr_info, |
| 282 | bool (*check_cb)(const struct net_device *dev), | 282 | bool (*check_cb)(const struct net_device *dev), |
| 283 | int (*set_cb)(struct net_device *dev, | 283 | int (*set_cb)(struct net_device *dev, |
| 284 | const struct switchdev_attr *attr)); | 284 | const struct switchdev_attr *attr, |
| 285 | struct netlink_ext_ack *extack)); | ||
| 285 | #else | 286 | #else |
| 286 | 287 | ||
| 287 | static inline void switchdev_deferred_process(void) | 288 | static inline void switchdev_deferred_process(void) |
| @@ -372,7 +373,8 @@ switchdev_handle_port_attr_set(struct net_device *dev, · 84 unmodified lines | |||
| 372 | struct switchdev_notifier_port_attr_info *port_attr_info, | 373 | struct switchdev_notifier_port_attr_info *port_attr_info, |
| 373 | bool (*check_cb)(const struct net_device *dev), | 374 | bool (*check_cb)(const struct net_device *dev), |
| 374 | int (*set_cb)(struct net_device *dev, | 375 | int (*set_cb)(struct net_device *dev, |
| 375 | const struct switchdev_attr *attr)) | 376 | const struct switchdev_attr *attr, |
| 377 | struct netlink_ext_ack *extack)) | ||
| 376 | { | 378 | { |
| 377 | return 0; | 379 | return 0; |
| 378 | } | 380 | } |
| @@ -272,7 +272,8 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 271 unmodified lines | |||
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | static int dsa_slave_port_attr_set(struct net_device *dev, | 274 | static int dsa_slave_port_attr_set(struct net_device *dev, |
| 275 | const struct switchdev_attr *attr) | 275 | const struct switchdev_attr *attr, |
| 276 | struct netlink_ext_ack *extack) | ||
| 276 | { | 277 | { |
| 277 | struct dsa_port *dp = dsa_slave_to_port(dev); | 278 | struct dsa_port *dp = dsa_slave_to_port(dev); |
| 278 | int ret; | 279 | int ret; |
| @@ -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 | ||