From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 AF0483CBE7E for ; Tue, 28 Apr 2026 11:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777375600; cv=none; b=RrtJd2BRS+MiHB4mYlBu8RNdgkIAj8R0K0cIkI2P36RQ/15sHYcxBOOhOmmqbUTBEYxnSJQlOrPukofsYVZUAV4ECHDs7AcrLfaoVkykFq/AR5B7QRndUfwWwNxRbP4hOQlTH4BZavoAHzuoNUwuI424VTwV0aTGIGVRHYa7WJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777375600; c=relaxed/simple; bh=pQsdsngi7xJbMC0DhlA4xDQB0AlSNkiEtvxDsUc3YJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V1tG3sxeTKBtbgUtf9OUIiV5YYgvcDcTF0B/rDd60Nf5V6TpK4KL2YgbgfxxWiHoGQPtqTEXsemHDCZ04EzHZsw7Qi+f7C0vaBCEFtyhbxb6ETsX2kGiZ89hUPqrIgViabAgK8A+Kpd0xInPM0KRfKPg7ejnPfNWLDgxmMRFHmQ= 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=FU3BWDfB; arc=none smtp.client-ip=209.85.210.179 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="FU3BWDfB" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8296dabef74so9391665b3a.1 for ; Tue, 28 Apr 2026 04:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777375599; x=1777980399; 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=FU3BWDfBxKKzHCQ6BNaVWx7wS1vGpzDuw5DSktQ58aMz7bcxWvSF1t59uRQyiI1k+s ijSYQGt50Mqsll0HwixNol4FjvSGuvVWH7nOF8sVxaa0c4D2PpryAx1k4s1QStDbG+Oo 8c3KDxdlzMeh0MQUgf3Tr2JABWwWFF+iFwNtJimmG8aNNa2z6SkmgITAVrSVREi+yr2d DP3LFGTcFyf5R5HqMHF+HhQJdTiwwtHbOQ3LynqrDasC0SpvZKr7UpCsaa3CEegYSckX NMa/xsd67b/X7NnDuletw/ybLw/FbVUE1KGMBB5iK9XHCWdaX39DUtt7AjvlIBI7kjY/ LExA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777375599; x=1777980399; 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=UepLYxE4RXtEGZjjekZK0TYxoroK+sYU1+cvB/qH+Jp9NGt0mn4NZ4zlRruIiK7rvr Y80JryEE6fIw3/ZjTpgxNTbA9pwqL1j35maoyZWSWKPRUOHwu9hzjGfO4P1igp/or0k7 Cqq6IMxITn+zlyjlN7XT2mKXbiepTy4PAl4pJWQT5+oGo3fMohfvKUdcQxMM2s8QMpuZ FHuhsbBBlgFeio/+tGBlSmGTI1VhEfNg9tW006kWZs3ISESpyvib8gnOAAFUzEPsO6uY BwF7RRn6FjB5wCDQXs05DcNk44veBfY/ZmfmqeRPDQB91LBwWtOBX3o84om1J8hm8wqS VjVQ== X-Forwarded-Encrypted: i=1; AFNElJ+vOUuYka4Att2boZTixpow8mQv1kzmPEoGBZ6zctVQ1OnpVprsWAduNKv6a3ZzuSlAEOvhlGWDbAsCbpY=@vger.kernel.org X-Gm-Message-State: AOJu0YxySr9CeV6w+Id337IzBDcAJj+Ls/msNOqm6eR91Hd5bL3FGzCt CFqemqCWTH4KyyiUa3zci7wPSVCVdiV9UUz+KHnMrPkbiXGx7C0W4OZ6 X-Gm-Gg: AeBDiesoQZB25nlkv0C812L3iGVTJgBgktdGMao/PcLczLFK4SWquvMtmkAq9L8qsG+ flTMU2Rt8pwDOwqZHbyA4pSXTXeKKCHrvx5v2pvlXhOQi18kzAoJtugGqTEnJ+yIXVzG13SIjyh OEURPjdgP98zEfA26WpXhIpYvLKegH8H1dJ4cpY102CKhnGbBvelIkU8TCyW6MfE6d9wY9/DQCK j9G9WPqAoCQbIucQijzqOCGwUcPGGrrjuIXSfXT/U6Jrcn3yeHVQBAvH7xeFAOyXZZtmD7AGXZU VLJDq/oe+VtZofC36cJ0HaKseJPaUFUvOGnN0NoY1wD0HfWNADiwyaAvRpopvEdxzL2xelNK/0Y ehKnoh2LiJcUe9h6NNGdV2AOLQurLBtqByMZT//QI1wdQoH7ecTdNVSMkYKaJX1Eb6lbO6TFo8r 9DS1bobzXR4z3f1aFKffhJPySsEnnoan0OyMm3IPECmcPwaPmmzz0C6yHesh/+ X-Received: by 2002:a05:6a00:12c1:b0:82f:3828:a00a with SMTP id d2e1a72fcca58-834ddc581cbmr2642074b3a.41.1777375598994; Tue, 28 Apr 2026 04:26:38 -0700 (PDT) Received: from d.home.yangfl.dn42 ([2a09:bac5:6619:3046::4cf:90]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-834dae36b4bsm2284327b3a.27.2026.04.28.04.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2026 04:26:38 -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 v5 1/3] net: dsa: pass extack to dsa_switch_ops :: port_policer_add() Date: Tue, 28 Apr 2026 19:26:01 +0800 Message-ID: <20260428112606.1917230-2-mmyangfl@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260428112606.1917230-1-mmyangfl@gmail.com> References: <20260428112606.1917230-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