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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BC33C25B0F for ; Sun, 14 Aug 2022 12:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbiHNM1d (ORCPT ); Sun, 14 Aug 2022 08:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbiHNM1c (ORCPT ); Sun, 14 Aug 2022 08:27:32 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10BE71C92B; Sun, 14 Aug 2022 05:27:31 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9D8585C00A6; Sun, 14 Aug 2022 08:27:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 14 Aug 2022 08:27:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660480048; x=1660566448; bh=Hz0ZhyzIO3X/y1kG7So53cSJfTIn sJ3nYEy6fIrN1Mg=; b=B2+jX9BHCYo6YvCkh+pBofceaa5C3scLD5LMAexH/D7s ixH/KzBQL32cHqE9OgpJRcvUrq1FMIMLG6uqJJMnmOz/p1cm23g8sJB7NvYCN5DP dPqwzBkQcT2qR1+gFt6A0WMZZB4vip7hWwQG+KYGOSlzjGEkPbWXfpnC4KZdoHG2 GF4w4lNTgZov8WNR17qh/adIBYYJ1TlB2L8dT4424DMXLYAnVisBqFL76dW6sOpA ip1pUMq8DRFF9WNFz2LNqdNBsZlnRwIEutjhbz3iGWRynRTEffiBWrSTbNyQJHFX 4UM+JIpzB/SY47gfNz4MZHlpqWMdbVJ7d59cjUEIAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehtddgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihgu ohhstghhrdhorhhgqeenucggtffrrghtthgvrhhnpefhffejgefhjeehjeevheevhfetve evfefgueduueeivdeijeeihfegheeljefgueenucffohhmrghinhepghhithhhuhgsrdgt ohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Aug 2022 08:27:27 -0400 (EDT) Date: Sun, 14 Aug 2022 15:27:24 +0300 From: Ido Schimmel To: Jakub Kicinski Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, sdf@google.com, jacob.e.keller@intel.com, vadfed@fb.com, johannes@sipsolutions.net, jiri@resnulli.us, dsahern@kernel.org, stephen@networkplumber.org, fw@strlen.de, linux-doc@vger.kernel.org Subject: Re: [RFC net-next 4/4] ynl: add a sample user for ethtool Message-ID: References: <20220811022304.583300-1-kuba@kernel.org> <20220811022304.583300-5-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220811022304.583300-5-kuba@kernel.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Aug 10, 2022 at 07:23:04PM -0700, Jakub Kicinski wrote: > @@ -0,0 +1,115 @@ > +# SPDX-License-Identifier: BSD-3-Clause > + > +name: ethtool > + > +description: | > + Ethernet device configuration interface. > + > +attr-cnt-suffix: CNT > + > +attribute-spaces: > + - > + name: header > + name-prefix: ETHTOOL_A_HEADER_ > + attributes: > + - > + name: dev_index > + val: 1 > + type: u32 > + - > + name: dev_name > + type: nul-string > + len: ALTIFNAMSIZ - 1 > + - > + name: flags > + type: u32 > + - > + name: channels > + name-prefix: ETHTOOL_A_CHANNELS_ > + attributes: > + - > + name: header > + val: 1 > + type: nest > + nested-attributes: header > + - > + name: rx_max > + type: u32 > + - > + name: tx_max > + type: u32 > + - > + name: other_max > + type: u32 > + - > + name: combined_max > + type: u32 > + - > + name: rx_count > + type: u32 > + - > + name: tx_count > + type: u32 > + - > + name: other_count > + type: u32 > + - > + name: combined_count > + type: u32 Another interesting use case for the schema can be automatic generation of syzkaller descriptions. These are the corresponding descriptions for syzkaller: https://github.com/google/syzkaller/blob/master/sys/linux/socket_netlink_generic_ethtool.txt#L125 Last I checked, these descriptions had to be written by hand, which is why they are generally out of date, leading to sub-optimal fuzzing. If schemas are sent along with the kernel code and syzkaller/syzbot automatically derives descriptions from them, then we should be able to get meaningful fuzzing as soon as a feature lands in net-next. > + > +headers: > + user: linux/if.h > + uapi: linux/ethtool_netlink.h > + > +operations: > + name-prefix: ETHTOOL_MSG_ > + async-prefix: ETHTOOL_MSG_ > + list: > + - > + name: channels_get > + val: 17 > + description: Get current and max supported number of channels. > + attribute-space: channels > + do: > + request: > + attributes: > + - header > + reply: &channel_reply > + attributes: > + - header > + - rx_max > + - tx_max > + - other_max > + - combined_max > + - rx_count > + - tx_count > + - other_count > + - combined_count > + dump: > + reply: *channel_reply > + > + - > + name: channels_ntf > + description: Notification for device changing its number of channels. > + notify: channels_get > + mcgrp: monitor > + > + - > + name: channels_set > + description: Set number of channels. > + attribute-space: channels > + do: > + request: > + attributes: > + - header > + - rx_count > + - tx_count > + - other_count > + - combined_count > + > +mcast-groups: > + name-prefix: ETHTOOL_MCGRP_ > + name-suffix: _NAME > + list: > + - > + name: monitor