Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp216670lqg; Wed, 10 Apr 2024 23:48:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUevfI6AbjEmnsiWnbsIY8HMsYZRwYl4soPn0vZKTrW+3jJ/N+TEXBGBTSEi9JYx/umUFWKrxl753k4zNQZquSwcrWB5+TusSVnJY5zpg== X-Google-Smtp-Source: AGHT+IHKN3DsQ6IGYve+sGUQRv250UvL8YRmyeY28VSAjecUpXYgCamqSlO+Zt3MPnAPONeo/0D1 X-Received: by 2002:a05:6830:1616:b0:6ea:1483:7978 with SMTP id g22-20020a056830161600b006ea14837978mr5473609otr.0.1712818131750; Wed, 10 Apr 2024 23:48:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712818131; cv=pass; d=google.com; s=arc-20160816; b=wQkmZFeeAeK+8LTn17JatHqOrYfxWib3soa2Jtp9PpVeuCFFRhamPR0Z+g0aczCc0z wU45k8paRyQ1cKSpseK2sBVrXkq1ZNSA1kFFOZXCwlWKRbAewwK2gXnNVMUv/x4fBovp rBYRlAyT82y7hLyvu21951AApQinpUyrFsbAsn9QfhQOVgzBBEXpcBrwyncFPdcLUrBI 8DsC2xX47MplAl1lAeCLu7EwX5hQVGj6DYHIdrT1Q/F39qfku7aTrIQMCnaI0SjB1SQq ybGvZvmsAJ7n9rkOS3KybJ9nyZ9PEdD/Q03Bh4hyZ48R/8hIrsOUNg0eSi6JFkH8Z/Ar RCDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=rW38w+vBHf7BFW0fOxbTkUFBo1Fvz8SCaDB1ej4DlUE=; fh=KVrO8pf8CI4u0PHvfNZEhF3lw+6eN+GnjRBrbBjOf9Q=; b=kJLy/EdJ/bwMvhNBc3nf0nUdWbgix8B2b0LzcIgwilbF37UEcAY5BKAaU3do40fWxo aVZMQs+VSfTrB3NUwET0TwDJejPxhKw+sVx7fSDw75yweIAi5zcLO+G7fpBvOYai3dpt RRcXOQfMjaZxGZGtRWmOQA5opR2HKgPUGiHZsJdAO4F1/ou3lYMTf4QBRkstAOrR7WC9 bda7hdcld7jhJTm9OgaPaBe6HDz75njv/WAUU5A/LAL4SFhnY1Sv3H1awcZom5av5q7t ioszyXF4KDwXsYdxu9dVtpvGd42A255fXCxWifwZ7ZOncYPCmu7wNJrfsdrbFxZ2y7zK G03Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-139876-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139876-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s184-20020a635ec1000000b005f3e0556e31si744908pgb.863.2024.04.10.23.48.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139876-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-139876-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139876-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6915E2868E2 for ; Thu, 11 Apr 2024 06:48:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 522C513D8AE; Thu, 11 Apr 2024 06:48:18 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF78A13D258 for ; Thu, 11 Apr 2024 06:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818097; cv=none; b=SY0O4MHxigmMAOQytUckA6N6U+7KJEv9+6nh16F/nah4gIjQqbcqkkjQdYdKB4YDsO9988lU1wkq4peZOLlN0ZpEqa41YZWfY0gFBmXQoYm4Ozc78lyXkQ8QG8ooC4LXtKXOyGYKBDpxSOe77xm2+jhWZSHv+s9SJD2WpBjjn2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818097; c=relaxed/simple; bh=SjfQmFCe8KGFg78GshUQPaGgkawI/DnASuuduYQmQ8M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IKvgn/aq08P72DF77A2Vo3nAdsueAAslIjNEfNHPMQ6RZrC2GSmr9HU2CTeoMRhlB+/S/C33Fkqv34VrlWHYi9UVS0x9764W5B2qSqRJylmtifnFUvGCeAyvjlWw3YrxHkpiNvPdyYpk+aIub/PdRfD6epAwF+5o7rsOJr7bnYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ruoEA-00074u-0x; Thu, 11 Apr 2024 08:48:06 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruoE8-00BdUI-5L; Thu, 11 Apr 2024 08:48:04 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1ruoE8-007cj5-0B; Thu, 11 Apr 2024 08:48:04 +0200 Date: Thu, 11 Apr 2024 08:48:04 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: Woojung Huh , Andrew Lunn , Arun Ramadoss , Florian Fainelli , Simon Horman , netdev@vger.kernel.org, David Ahern , linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Eric Dumazet , Willem de Bruijn , kernel@pengutronix.de, =?utf-8?B?U8O4cmVu?= Andersen , Jakub Kicinski , Paolo Abeni , "David S. Miller" Subject: Re: [PATCH net-next v6 5/9] net: dsa: microchip: add support for different DCB app configurations Message-ID: References: <20240410080556.1241048-1-o.rempel@pengutronix.de> <20240410080556.1241048-1-o.rempel@pengutronix.de> <20240410080556.1241048-6-o.rempel@pengutronix.de> <20240410080556.1241048-6-o.rempel@pengutronix.de> <20240410231251.macw4i46jfi57wtc@skbuf> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240410231251.macw4i46jfi57wtc@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hi Vladimir, On Thu, Apr 11, 2024 at 02:12:51AM +0300, Vladimir Oltean wrote: > > +/** > > + * ksz_dcb_init - Initializes the DCB configuration for a KSZ switch > > + * @dev: Pointer to the KSZ switch device structure > > + * > > + * This function initializes the DCB configuration for a KSZ switch. The global > > + * DSCP-to-priority mapping table is initialized. > > + * > > + * Return: 0 on success, or a negative error code on failure > > + */ > > +int ksz_dcb_init(struct ksz_device *dev) > > +{ > > + int ret; > > + > > + ret = ksz_init_global_dscp_map(dev); > > + if (ret) > > + return ret; > > + > > + return 0; > > +} > > Sorry for not responding to your previous question about this: > https://lore.kernel.org/netdev/ZfmJ-O8XMT8oO-TS@pengutronix.de/ > Simply put, I had a period with not a lot of free time, even for reading > emails. No problem. I'm in continues similar state permanently DoSed by my children, parents, etc... :) > I'm on the fence on whether your solution to the "global DSCP-to-prio > mapping rather than per-port" problem is the right one. > > We try to avoid baking policies into the kernel, no matter how well > intended the 802.1Q and IETF RFC8325 recommendations are. They are still > just recommendations and examples, and a particular use case may want to > configure things completely differently (or as hinted in the Wi-Fi specific > RFC8325: maybe the administrator doesn't want to assign the higher > traffic classes, for network control protocols, by using IP DSCP, and > doesn't want user flows to request DSCP values that would get access to > these traffic classes. It can indeed be seen as a security concern). > > I empathize with the incovenience of having to map the per-netdev dcbnl > application priority table API with a piece of hardware where that table > is shared across all ports. But yet, I don't think it is a strong enough > justification for us to make an exception and say: "yeah, ok, let's not > even implement .port_set_dscp_prio() to make the thing configurable, but > let's bake into the kernel a fixed policy that's good for everyone". > > No, I think we _need_ the thing to be configurable, and not try so hard > with the ieee8021q helpers to hardcode things just right in the kernel. Yes, I agree with you. ieee8021q helpers are not the attempt to avoid the work needed to implement global DSCP configuration. The interface is still needed and we need to agree on how it should be implemented. The problem which I try to address with ieee8021q helpers are initial defaults. KSZ8 and KSZ9 families of switches have different initial defaults. So, if i need to align defaults for this driver, why not to provide default which are reusable for every one? > Have you tried the obvious: "every time there is a change to the global > DSCP mapping table, push the change into the dcbnl app table of all user > netdevs, so that the user becomes aware of what happens"? Kernel drivers > can do that, through direct calls to dcb_ieee_setapp(). DSA does it too, > to probe the initial QoS configuration of the ports and push it to the > application priority tables. Hm... what interface should be used for the global DSCP mapping table? Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |