Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp986170ybi; Wed, 3 Jul 2019 07:38:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmV2GTrIpVMxyZ8mC56G4OtIap6VFLwW+uNFscCqGx3/S8pCpC5HNbhyp3a90+g3Wa7b78 X-Received: by 2002:a65:4087:: with SMTP id t7mr13870945pgp.10.1562164716539; Wed, 03 Jul 2019 07:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562164716; cv=none; d=google.com; s=arc-20160816; b=jbLtcxQs/aH/INIynIvpmSMDDAq0GA076glAU90JYdHNXyu5iANszA3HJm75Ze70g7 lXXnuZtRUxzwvt76clx9Sm5jDqBZtTza1naQhBUOYorqR9BOGeaDP6QRh9DHEo2x4Y09 yCyk8PVsMK2KjpIZO0cH+oDtiN24iACWgRxvboTsWpnuZ++sXx4J8s23yDq+cIhcOfUX WRQyJG2Z7OsWec7Rfqs1QFyEe2eVoLIwqUQzxqTER0ZJs/ojDwKEE8x2fr4UxtpWUdjB BhMHlYoglubIWFvJpbeBwwn4X2OCLKohQQY5D2EP7lZ4B6l413XBQFmhj98xmNbtvGK/ gMaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+w5Ekzo0SUahclNPS3vsY3fS0WmvuqOMIX4TEp2/zXU=; b=XjQcLh1YGcsnpfdNKtkuXEVPsQICLLjAyO1NA3OrCyYAhJ0Fr/pF4CUNUzSCk5Zop1 gJK7DP8fUhIk5Y04Af8KD+VpDreBFoxZbiS8KlNFblNofF+xiY30An+EtlMoIRFnm6nl SlrRqy7j3IzKAGLF892hUc7yU/RW+bpLhoHUoY1IDjyePdhX1fUtu7+qud/bFAlmJUOs MfBlZniEU7dsRIhlUxnpOpdCtbbfmQcT4YHJwJJGAOdx7BDgMvOwCEqdWTi+lYQVDKt1 YRcXwjaaQdm1jKJpUyt3YjZS1GYgaDzCHhG4F5KsJJFbn/N1P4U7mjRW1rUXv4YoGcLV isvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=07A6jNkE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y65si2365213pgd.487.2019.07.03.07.38.21; Wed, 03 Jul 2019 07:38:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=07A6jNkE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbfGCOha (ORCPT + 99 others); Wed, 3 Jul 2019 10:37:30 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40986 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfGCOh2 (ORCPT ); Wed, 3 Jul 2019 10:37:28 -0400 Received: by mail-wr1-f65.google.com with SMTP id c2so3093283wrm.8 for ; Wed, 03 Jul 2019 07:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+w5Ekzo0SUahclNPS3vsY3fS0WmvuqOMIX4TEp2/zXU=; b=07A6jNkE1oZ17E6pSSQcXrtw++E4AfOcl4aVpafT+DrXKVAMRhAsyZP5pr7j5EJK/P Qdbx+5zRTouOI/jAymN9T607NfuaU5yV24hb29bPSAUb16qiyuY07oK+fKNMiP8rlf/Z IMUAESTHosw5O6M8IHc36GM22RGTj401EyYn26G04VX3sr/bIt952ZCW0LTStV5DYj/2 WxE/NqDgYe17v6AdSmEl2ZSMgBsmYNOYoCRcQhNNSz/uH6ySyE+vXiLtYQA/H3HlKLlM ZGmaPXnp0hd7gXHXldUm+kTQxbJ97UQbdGd25jbTH+iqkG+sK3iYodSer/U6+7q6q2Ol 2fxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+w5Ekzo0SUahclNPS3vsY3fS0WmvuqOMIX4TEp2/zXU=; b=em2cIcE5VrnsY51EU633pMEXsQg+J0bdAPX76wCvsvVzFMV8/g3VoLVB1Ydqd4sokC YQULaRUIH1NC3PEd0cXdgbffNUQQKgTt0XpTrA5UcuNLjzguZaReYM8KXJ9RquEzEr7k TnI/OWPnkZLLMhQsRt+CqPXfhq3Tf/nhbloNJ4XEzwklj2mRIv6sAdTQyJ93Q0aTgZL8 3Ap+rVHfqvuvbRErRU8k5k+y5cOOoGsQqhXiveDlvyFoAOZajAErv30uOeRoA5EQZNFn wUi0TIeyutjlH9g5TBuxZgKmcdgUS8FaY8YpcT05V1cT6KPrhTvtuLownAVE4CwB51CJ Wk2A== X-Gm-Message-State: APjAAAXyF2bXGGG8g3Dji75tuYYmeb/31poiV350bQHzaU9Q8u1265Gu MxEXWe+aElJ4nGp0eH5EJ7G9FQ== X-Received: by 2002:a5d:60c5:: with SMTP id x5mr16038910wrt.253.1562164646037; Wed, 03 Jul 2019 07:37:26 -0700 (PDT) Received: from localhost (ip-213-220-235-213.net.upcbroadband.cz. [213.220.235.213]) by smtp.gmail.com with ESMTPSA id c15sm1256625wrx.65.2019.07.03.07.37.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 07:37:25 -0700 (PDT) Date: Wed, 3 Jul 2019 16:37:24 +0200 From: Jiri Pirko To: Johannes Berg Cc: Michal Kubecek , David Miller , netdev@vger.kernel.org, Jakub Kicinski , Andrew Lunn , Florian Fainelli , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v6 06/15] ethtool: netlink bitset handling Message-ID: <20190703143724.GD2250@nanopsycho> References: <20190703114933.GW2250@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Jul 03, 2019 at 03:44:57PM CEST, johannes@sipsolutions.net wrote: >On Wed, 2019-07-03 at 13:49 +0200, Jiri Pirko wrote: >> >> > +Value and mask must have length at least ETHTOOL_A_BITSET_SIZE bits rounded up >> > +to a multiple of 32 bits. They consist of 32-bit words in host byte order, >> >> Looks like the blocks are similar to NLA_BITFIELD32. Why don't you user >> nested array of NLA_BITFIELD32 instead? > >That would seem kind of awkward to use, IMHO. > >Perhaps better to make some kind of generic "arbitrary size bitfield" >attribute type? Yep, I believe I was trying to make this point during bitfield32 discussion, failed apparently. So if we have "NLA_BITFIELD" with arbitrary size, that sounds good to me. > >Not really sure we want the complexity with _LIST and _SIZE, since you >should always be able to express it as _VALUE and _MASK, right? > >Trying to think how we should express this best - bitfield32 is just a >mask/value struct, for arbitrary size I guess we *could* just make it >kind of a binary with arbitrary length that must be a multiple of 2 >bytes (or 2 u32-bit-words?) and then the first half is the value and the >second half is the mask? Some more validation would be nicer, but having >a generic attribute that actually is nested is awkward too. > >johannes > >