Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp91970rwo; Tue, 1 Aug 2023 13:29:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlE6oYFouX7olnjS2gus48BqMhHwDA64rWVzwRMGUL4Lft40ZmrH212jl4I8W//K4zADZPrO X-Received: by 2002:a17:902:b598:b0:1b8:4607:c3d7 with SMTP id a24-20020a170902b59800b001b84607c3d7mr13095814pls.41.1690921789861; Tue, 01 Aug 2023 13:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690921789; cv=none; d=google.com; s=arc-20160816; b=XueJmUZ5yEHlHr+/wau2wk/+QO3SlxWyo4m5UKvOq0EEDA/iqf1Qm76X3pDLehPOac LeZAONdXjJtHmjAuCgSPhRja1Vmun2L10kP7pJDlhXeLbCe71xrBuj3HRsqA7ti8eL/A Ut9xJYP/QRcf+FFQU1jBakZe3Uty7JWlUcsnjuUooAZqY7avjqEiwPhpDHj2rjHgIOnk 1ziU15JDVvTIPtKgIALcLJQtHxCd9AoO5DKHphWQbTj7B+cs/izUbrKgUTQC29Er+9rF oh72C2zIXdUqSzA02gOLwUt6ArbftfGKab/N/l8eL5z3Ur1XuxdzOhwz7AMDY9MDyMIR pcZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6m8JDRwjerIQWkE0Plo8mi8Zwqp8GgHBNVOnxIxDF5s=; fh=g+zUEMhBxKGRZggiZwF+YEZXk7ojOyaXZdn5srI0CNw=; b=XVHlUIZaBVFUhhJ/I9NygmTP13y+q5b/tWPDOtFCoMcw+2CQE5+0gXnKdfXfCY+aLh mpGNLLp+/g+d7kkrdv2b2f/KQmu+VWrkWt5GgeiPyj5z+uVNPKUsFVfVLNZNs3mkXVDK Ds0v+ZmBjKrrC5Xz0MPrY0OOY3EYkfeEZsMPmPr0pfee0etZ6JCN21yT6fO3ueiHeAKN 59zUrSwsaXmExDzijduGOJucDJr/yFWsenQPetzVHy5l+kNiRaEit3IejI/JTXdGPjA8 lumC42eOOv1XhvIe6Ou568vRXsyjbIHBTzAx/NhJgFd73WXLWERTLkj3WFVC5pK9KFAo Ge3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNwin6nz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170902e80200b001b8698d619asi5864853plg.602.2023.08.01.13.29.36; Tue, 01 Aug 2023 13:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNwin6nz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbjHATuA (ORCPT + 99 others); Tue, 1 Aug 2023 15:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjHATt7 (ORCPT ); Tue, 1 Aug 2023 15:49:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E5C42139; Tue, 1 Aug 2023 12:49:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9836B616B7; Tue, 1 Aug 2023 19:49:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41A2EC433C8; Tue, 1 Aug 2023 19:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690919394; bh=jx8nkKfZnsZVXx8umqQAQuPAq5SYkh1NN4szn/H3sNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bNwin6nzcMICQLvRxBzXlbrrbYS5mevgyW4ev5/p1V2gMZk4sp1hxPE+mQJk1ZUSK cAd8sET0dOL93qMWtn93DVNJhGN2P+bPFtVQYFCT2YoWV8hneWNw2y+yFGMofZmZkB KWbWZWrDtS2I23Ciuad/sQK+v3f2OW4TKFCW7rkL1mbXwL3jdko7ymdyFsJbwb4wp0 NEwCnVpazNzcNLEhqUeDrn5sMa56oXfo79yHbZrpCdmiVt/Clsy/5UAzLN0ab+c3b3 ICWtz1I8dvpIEWfbQla+77y7RyDmhcdrIjIUZO4wIvLkcXIO1zD74WT6hNR75qZr/S LQjwhqdGtjuAw== Date: Tue, 1 Aug 2023 22:49:49 +0300 From: Leon Romanovsky To: Jakub Kicinski Cc: Lin Ma , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, fw@strlen.de, yang.lee@linux.alibaba.com, jgg@ziepe.ca, markzhang@nvidia.com, phaddad@nvidia.com, yuancan@huawei.com, ohartoov@nvidia.com, chenzhongjin@huawei.com, aharonl@nvidia.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH net v1 1/2] netlink: let len field used to parse type-not-care nested attrs Message-ID: <20230801194949.GC53714@unreal> References: <20230731121247.3972783-1-linma@zju.edu.cn> <20230731120326.6bdd5bf9@kernel.org> <20230801081117.GA53714@unreal> <20230801105726.1af6a7e1@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801105726.1af6a7e1@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2023 at 10:57:26AM -0700, Jakub Kicinski wrote: > On Tue, 1 Aug 2023 11:11:17 +0300 Leon Romanovsky wrote: > > IMHO, you are lowering too much the separation line between simple vs. > > advanced use cases. > > > > I had no idea that my use-case of passing nested netlink array is counted > > as advanced usage. > > Agreed, that's a fair point. I'm guessing it was inspired by the > ethtool stats? (Which in hindsight were a mistake on my part.) I don't remember which part of kernel can be blamed for it. :) > > For the longest time there was no docs or best practices for netlink. > We have the documentation and more infrastructure in place now. > I hope if you wrote the code today the distinction would have been > clearer. > > If we start adding APIs for various one-(two?)-offs from the past > we'll never dig ourselves out of the "no idea what's the normal use > of these APIs" hole.. I agree with this sentence, just afraid that it is unrealistic goal, due to extensive flexibility in netlink UAPI toward user-space, which allows you to shoot yourself in the foot without even noticing it. Thanks