From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7BC4B24EAB2 for ; Tue, 29 Apr 2025 16:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745945891; cv=none; b=M/9sxv4iKuqxe5Wcyx5yCwD5dx+LRBr2lkB5wZSQ3vPaTsrnX30/2BFZGNpMbXcuOurAyitjH6kpTAMdgIr6PJwikwjybJSvkjnsnM/UJoqNQloXaMA8t1N5pTcKXoormvLrEcGh1SgI7Gz/lM5sXeSO/5CxcgzUxHQfRUfo0JY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745945891; c=relaxed/simple; bh=CXeuuacRQiUPgfGn9X2aS8wImkw75hTDe3VXsb8Myj8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hyqmtO/wBNRikPzhUWXqS1aPxPTQOmhwyK9sAdybhP5xgGGApjdFp247SVvLAJE4+fMR8cKKh7iE7HZMHYqV/N8e91qwnazKNpz+AzHcy/QmgYf766QdevJg2amSVPbswTrvZUek5pkmQVaHl7rlXm+lWZTepBQEQ7jDP7fqw7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nvQ0eYrH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nvQ0eYrH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA705C4CEF0; Tue, 29 Apr 2025 16:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745945891; bh=CXeuuacRQiUPgfGn9X2aS8wImkw75hTDe3VXsb8Myj8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nvQ0eYrHWezaM1eJIGRWGli/n3nD7urFiIN2S2A5grk160A3LEbiyx25UQ8maguUy s6rF3xZnZ73Xv5v9S0k/dvyAJlmxjKFJyUY5deCC6GAXgt6jJyKnhGSArE5e2w5zU8 1E11mMbPT9RkDtuTMx8DZ8CYf9FHk0BzHAgG60E6kiSaoBgoR4/B0hX/kozGYG5Jh3 pdSMEz+8mOMje9VjP2m1RdStAAY4HF05ZkEnQVwVCX9k6q+UlNtdYKFW4HmeCggdzI imI5SwwAVZTIf1kvNScykRYasGMqXzB99qDA+ko2wESTbspW5kQEwS2wEi4YjE7d/9 fX4hW7QhLwGkg== Date: Tue, 29 Apr 2025 09:58:09 -0700 From: Jakub Kicinski To: Jiri Pirko Cc: Saeed Mahameed , "David S. Miller" , Paolo Abeni , Eric Dumazet , Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Gal Pressman , Leon Romanovsky , Jiri Pirko Subject: Re: [PATCH net-next V3 14/15] devlink: Implement devlink param multi attribute nested data values Message-ID: <20250429095809.1cbabba4@kernel.org> In-Reply-To: References: <20250425214808.507732-1-saeed@kernel.org> <20250425214808.507732-15-saeed@kernel.org> <20250428161732.43472b2a@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 29 Apr 2025 13:34:57 +0200 Jiri Pirko wrote: > >I'd really rather not build any more complexity into this funny > >indirect attribute construct. Do you have many more arrays to expose? > > How else do you imagine to expose arrays in params? > Btw, why is it "funny"? I mean, if you would be designing it from > scratch, how would you do that (params with multiple types) differently? > From netlink perspective there's nothing wrong with it, is it? The attribute type (nla_type) should define the nested type. Having the nested type carried as a value in another attribute makes writing generic parsers so much harder. I made a similar mistake in one the the ethtool commands. We should have basically have separate attr types for each of the value sizes: DEVLINK_ATTR_PARAM_VALUE_DATA_U32 DEVLINK_ATTR_PARAM_VALUE_DATA_BOOL etc. They should be in a separate attr space, not the main devlink_attr one, but every type should have its own value_data attr type.