From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D44ABCD4F4C for ; Thu, 5 Sep 2024 01:56:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7ED518121A; Thu, 5 Sep 2024 01:56:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id SZXl3UhP0cEo; Thu, 5 Sep 2024 01:56:12 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DD4E68112F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1725501372; bh=JBVxpL0eWfFvFKln2uh3M67prgVSKm8MUDseW0Y1pXQ=; h=Date:From:To:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ckxooL0NZiM+Vj2ooZowSpEc7NRIPjr2ZUj7z2K6wC4WLMyRMHpGwAk+dIjq9U3eu YY5lyGJre6cAIESb5J5J6knD/9KezFHu9J+DsNwbUGuM3CoMrEzKBBPtFqho0qU7Xr qjKSpMC3vcKrTPBK3G69jFXWNKmwt6FCOxpxA0Lo3rl81crid5ZULPOaKzFofKKbdv uHr4XgCk8abZhYOaStjt3s18UNmjrOlaI3e/i2tSu5peT51AB0XiZNHRWxnMF3fs6f MZFWjgiGOmDOPhVwn8OZy+3FSCn4p+otoebZl3yRnodFAGeHKaxdrtcT4uHrLRSgKm QdRtvsdRnCVRQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id DD4E68112F; Thu, 5 Sep 2024 01:56:11 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id DBAC51BF3C5 for ; Thu, 5 Sep 2024 01:56:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C895E40457 for ; Thu, 5 Sep 2024 01:56:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id b78atoLRARdn for ; Thu, 5 Sep 2024 01:56:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=kuba@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 7367A40025 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7367A40025 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by smtp2.osuosl.org (Postfix) with ESMTPS id 7367A40025 for ; Thu, 5 Sep 2024 01:56:09 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B8B365C5831; Thu, 5 Sep 2024 01:56:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA3FC4CEC2; Thu, 5 Sep 2024 01:56:07 +0000 (UTC) Date: Wed, 4 Sep 2024 18:56:06 -0700 From: Jakub Kicinski To: Paolo Abeni Message-ID: <20240904185606.366ef437@kernel.org> In-Reply-To: <70576ddc8b7323192c452ee1c66e7a228f7d8b68.1725457317.git.pabeni@redhat.com> References: <70576ddc8b7323192c452ee1c66e7a228f7d8b68.1725457317.git.pabeni@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725501367; bh=ER/YQRenfgFAaIh9sSTZF2sy46HPM/+nUbIjFGXd7kA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qFvMl4kd53tHu5iZPHxZB9LAADztpL/NyZPPpRKE2EDAJ6kE/i1TNhAbHoYeSYCvQ uF0a28+LEgRTOH4LRE2ke3yBcYL00dvHbamZ3i9N788K1onKMP9cwPRizDWPhM1mVn hykWggKdjg9lGDCziSyLAG/MHckczx81rah8d2l9lzEJg19JSXMtF9rLhFB7QLqGYJ poMk99Njyi2pYvAGWmZQP5biW8sm/V2XmjKX7Cnn1mP8aL5x1ttOvA4XMu7AX65CNo xTg6vMV5OhdURkHq7YSswja6ZlZIpgj1VREf9o3LXxwwVQ6fnizXrqWBkAxFpDdu5R 93Ew5fUtCPwrg== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qFvMl4kd Subject: Re: [Intel-wired-lan] [PATCH v6 net-next 10/15] net-shapers: implement cap validation in the core X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , netdev@vger.kernel.org, John Fastabend , Jamal Hadi Salim , edumazet@google.com, Madhu Chittim , anthony.l.nguyen@intel.com, Simon Horman , Sridhar Samudrala , Donald Hunter , intel-wired-lan@lists.osuosl.org, przemyslaw.kitszel@intel.com, Sunil Kovvuri Goutham Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, 4 Sep 2024 15:53:42 +0200 Paolo Abeni wrote: > Use the device capabilities to reject invalid attribute values before > pushing them to the H/W. > > Note that validating the metric explicitly avoids NL_SET_BAD_ATTR() > usage, to provide unambiguous error messages to the user. > > Validating the nesting requires the knowledge of the new parent for > the given shaper; as such is a chicken-egg problem: to validate the > leaf nesting we need to know the node scope, to validate the node > nesting we need to know the leafs parent scope. > > To break the circular dependency, place the leafs nesting validation > after the parsing. > > Suggested-by: Jakub Kicinski > Signed-off-by: Paolo Abeni Reviewed-by: Jakub Kicinski