From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B87C3168E1 for ; Thu, 30 Apr 2026 11:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777549555; cv=none; b=hW0Acrm+9tJ0oaE5M6GOJ4KcfAXFyaSbn+H/HQllyDzy++8WMC4++3m3u7R83EN6QtE7bho9+3RK4epjfaPE0o7gOWyqcCcgXuGEX9hpe0SUws/EmyjdoYWCoad23NzU7I5pj/ui/YvHEiG6gl05PIgrJYPSfPdacVF4ptSMYDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777549555; c=relaxed/simple; bh=pQsdsngi7xJbMC0DhlA4xDQB0AlSNkiEtvxDsUc3YJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sF9bzDAB0k7fFaVSaxUY2r+VZIanYSt8/NWClwL24hoNJvY/yMAYnW/M+7JUZYaON5QCa6UouyPt3tz56fTCWrlFGWFNaO+yvJmRhoVaTeKvu7PI0vcDgiw3qaRtP0DafDjEHeOBS6+EL34ST9HNEhz/B2shYDa5KHbh89PoUDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V4qFP17Y; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V4qFP17Y" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2ad9a9be502so4688715ad.0 for ; Thu, 30 Apr 2026 04:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777549554; x=1778154354; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DkGu6l8elNHejMOrOk+YYmlLgI6Oh4DCOBagI53T70E=; b=V4qFP17YV0GilGt9eSRWTNzO/HkDREpevWC1SYHrsSzZCwLobdvAz0pvO1g9DGE4CN bK7ClmUI4Ev6oqt548RjE6LAHzMkThJIxOFxrcPA4QrATHPVCbYj7CDtDjOQ139iLSsE j7WAKuciis+p1RD0ttxr9MkRQ+1fOcABKr2dIazeYfOESoR0QZDN7GeyMn23medybFyB KyVtjOHOXYl2RFQnG1rcoxvd5i3Xz7vaQhxopFjLC1hgH3bDCPrquzqUlfINUyCYVSZ/ rDkEdY5b6fbzcOzVoXDDMMSE9Kat8YOg2VXXbps/a6XsXQCgbY1WWE+oy6nVVKJz+YtO 67zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777549554; x=1778154354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DkGu6l8elNHejMOrOk+YYmlLgI6Oh4DCOBagI53T70E=; b=mLdebJK1nYvuNe3ZiqptIgiuhr6XvoqBV+OQU8OjPkz6tDkRgdPqeSHgAJKU4gD0z5 k3+sNORepavm+ggqR3dJNFgvEwqU8UVTzwlX1biODwoqpmjvWAsf8DP6JTwKacip1FKQ EqX7NEIna28hHjXxEytEqlUgtLRa9QQAz2X+jvMFaO9kRBlNg++EgkrI3UHtsYBeT1X2 AvCp7b78dxzj16k5a3KIgoaKLjjNUba2vjFmsc2VqSCa1ohQbDCfE12E5skl/PjuN0rT ICeUIKKgPpLSsq/bhT8BIVfk/Iz54kcO0wizHl8JHADLES8BttsYeG7DxW3bdN1Cca8e N4gw== X-Forwarded-Encrypted: i=1; AFNElJ8RlEqQkiDJvsmiO1QPT57XCNuJKyTN/zqNleG01sj/EWbhj9165grZot19ORx5+is0Xs+L8lMnj3Gyi8A=@vger.kernel.org X-Gm-Message-State: AOJu0Yxnw3xrBiQIAKos3jcmyrShkbXeO4J1XKoRdqKaZLj3xMolcGe8 irYZm2yisO24OSkfXW2A8DfY7xqZDcAWDegjLbuxYlUh9QyV4AsNHgiG X-Gm-Gg: AeBDiessw1Ox+EjJUAIzsFFJ4g71Ura/jv1TLqJuL+xe82ZlxCCsGyQzRk/grWqMFWj MAYfj5/vs4IgVPPFpb+9J1kv2B00CDv9/wOwJk/hSq7GueJJK9Q1TW2sRfg3iLQ0kh/SypqjyMI v/O5fTlUGCtfEczC7+4LfU6MqOxsZ7AxpIq9l9JoG15IBVf46jhEqOgoqZVVnM+aQqCw5Ixznsv UyrOtrsKHIpHkOEkok0eYNMU3J/jHJ0GykjKIM5smsJcsKJxA4ajneaZxNPcQWaPjRGSRbFM0d6 ywcewKcEhWi2cz+8rGegyx2hMQLPgLCDIiXkJLm98yCTwjJH9GYz00powxjx9rATnYmqadm9mHO mnhJUyHy13stzn8bcB/XYkynDy/GrgXyVm98rY2rpu5j6HivZ7VCRBnvuXc9sJBqh/i212wZczF jrSfWPBOXlu7wiZQB8FlfpKmXOo14ChhwGars5RiSwK/QrrU1RjdBupIZ6/m4e X-Received: by 2002:a17:903:3848:b0:2b9:a5be:d2f6 with SMTP id d9443c01a7336-2b9a5bed841mr24429085ad.0.1777549553973; Thu, 30 Apr 2026 04:45:53 -0700 (PDT) Received: from d.home.yangfl.dn42 ([2a09:bac5:6619:3046::4cf:90]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b98895afaesm69245665ad.57.2026.04.30.04.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 04:45:53 -0700 (PDT) From: David Yang To: netdev@vger.kernel.org Cc: David Yang , Andrew Lunn , Vladimir Oltean , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org Subject: [PATCH net-next v6 1/3] net: dsa: pass extack to dsa_switch_ops :: port_policer_add() Date: Thu, 30 Apr 2026 19:45:24 +0800 Message-ID: <20260430114529.3536911-2-mmyangfl@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260430114529.3536911-1-mmyangfl@gmail.com> References: <20260430114529.3536911-1-mmyangfl@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andrew Lunn --- drivers/net/dsa/ocelot/felix.c | 3 ++- drivers/net/dsa/sja1105/sja1105_main.c | 3 ++- include/net/dsa.h | 3 ++- net/dsa/user.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 84cf8e7fb17a..4272ea6e9ca8 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -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 = { diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index c72c2bfdcffb..dbfa45064747 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -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; diff --git a/include/net/dsa.h b/include/net/dsa.h index 8b6d34e8a6f0..4cc67469cf2e 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -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); diff --git a/net/dsa/user.c b/net/dsa/user.c index c4bd6fe90b45..8704c1a3a5b7 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -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; -- 2.53.0