]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: dsa: pass extack to dsa_switch_ops :: port_policer_add()
authorDavid Yang <mmyangfl@gmail.com>
Thu, 30 Apr 2026 11:45:24 +0000 (19:45 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 2 May 2026 17:38:57 +0000 (10:38 -0700)
Drivers might have error messages to propagate to user space. Propagate
the netlink extack so that they can inform user space in a verbal way of
their limitations.

Make the according transformations to the two users (sja1105 and felix).

Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260430114529.3536911-2-mmyangfl@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/sja1105/sja1105_main.c
include/net/dsa.h
net/dsa/user.c

index 84cf8e7fb17a50e0208681c8025b704a35df53a8..4272ea6e9ca84372afbf167bcbb167b73c97103a 100644 (file)
@@ -2001,7 +2001,8 @@ static int felix_cls_flower_stats(struct dsa_switch *ds, int port,
 }
 
 static int felix_port_policer_add(struct dsa_switch *ds, int port,
-                                 const struct flow_action_police *policer)
+                                 const struct flow_action_police *policer,
+                                 struct netlink_ext_ack *extack)
 {
        struct ocelot *ocelot = ds->priv;
        struct ocelot_policer pol = {
index c72c2bfdcffb2e6ff3d05fd951c457c6f0e06638..dbfa45064747cb1e60862a13ffe0b80755ca089e 100644 (file)
@@ -2847,7 +2847,8 @@ static void sja1105_mirror_del(struct dsa_switch *ds, int port,
 }
 
 static int sja1105_port_policer_add(struct dsa_switch *ds, int port,
-                                   const struct flow_action_police *policer)
+                                   const struct flow_action_police *policer,
+                                   struct netlink_ext_ack *extack)
 {
        struct sja1105_l2_policing_entry *policing;
        struct sja1105_private *priv = ds->priv;
index 8b6d34e8a6f0d3a229c9150ee6b8e28fd3560f91..4cc67469cf2ec5dea680a3d208e48a24b16e86e5 100644 (file)
@@ -1122,7 +1122,8 @@ struct dsa_switch_ops {
        void    (*port_mirror_del)(struct dsa_switch *ds, int port,
                                   struct dsa_mall_mirror_tc_entry *mirror);
        int     (*port_policer_add)(struct dsa_switch *ds, int port,
-                                   const struct flow_action_police *policer);
+                                   const struct flow_action_police *policer,
+                                   struct netlink_ext_ack *extack);
        void    (*port_policer_del)(struct dsa_switch *ds, int port);
        int     (*port_setup_tc)(struct dsa_switch *ds, int port,
                                 enum tc_setup_type type, void *type_data);
index c4bd6fe90b4558b4a16b7517bd8d136556b51372..8704c1a3a5b741a579b7697fa5c3bbd19ff376ae 100644 (file)
@@ -1499,7 +1499,7 @@ dsa_user_add_cls_matchall_police(struct net_device *dev,
        policer = &mall_tc_entry->policer;
        *policer = act->police;
 
-       err = ds->ops->port_policer_add(ds, dp->index, policer);
+       err = ds->ops->port_policer_add(ds, dp->index, policer, extack);
        if (err) {
                kfree(mall_tc_entry);
                return err;