Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2088148ybi; Thu, 4 Jul 2019 05:04:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2fdgm3vg7yn96IBPJeMnUuQms/Txj3MR+rMxyKx3lAzvB5rcvZTBbppx/Ttpr1eVmNLWP X-Received: by 2002:a63:b46:: with SMTP id a6mr17171945pgl.235.1562241848183; Thu, 04 Jul 2019 05:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562241848; cv=none; d=google.com; s=arc-20160816; b=dHKkAewuJUSVsyLKeAUqT5v3OrZjZRcZlZ7cvWzMRsfGJ0ZMiP3pThf+PdLvXa6J3k u+l+rQ29XAURn+ssaFvL9wCWJBkB5Q55svGOJLyZBRBS+zbYJPpqYOp8GeCxQHjdJEzO fiKlad1TV6vyynenkRbOOMdiYdcU2OZwm8/JwQOHpXSZYRa5Hrs+hbZ1J+srKe2PYy/y Qnzra2M/Btb1OF3MjHIWk23ARad+45ds+JG6y98zLRlpX4BT9YJFbKQSNY1gmzOPNRlP OgHH6Qo9PlFY32f2PbGEOLpTq2A3JdMFR13nTC6N/m3pi08YbEVTuor3Ps063WtAUwQ6 UFMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Qgp9Gm6AS2zcnt9B+RjSQpulxqq1G4oiS960VkmRQR0=; b=RbgH/zbOq+zQaaZ3JR+pX+L8VWQdy5w3PdR9RAmkWxJGZRgxd0n7lDcI+YIEGIi9ES C5b/5rLzvJ+TYKLdnrckdAbPU9Hp31oOhMovHUlsCZpbiY46lhp5qZh9nZ5aJUU9x4IB cOeZawUgTeY20mBAur1DY/PH0lHnvxuzFGG+FwhlOz5cdPKzFZaqBH24Tjfu7DS34BDa 6ZizM+kz5qN+cVu1/EEwYdRzt7UAaP5wGKA213Zg1Eez5mF5YjwRWjvcystoKPV/L3Uc PsLDEFTu6etFkIwuHJgAAl8QTYCR7pTWz1FwKNhaMHQ3IS77CwZFnY6luyciWBS+kcIK ljjg== ARC-Authentication-Results: i=1; mx.google.com; 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 m14si5244449pgj.377.2019.07.04.05.03.52; Thu, 04 Jul 2019 05:04:08 -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; 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 S1727670AbfGDMDP (ORCPT + 99 others); Thu, 4 Jul 2019 08:03:15 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:33118 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbfGDMDO (ORCPT ); Thu, 4 Jul 2019 08:03:14 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hj0S8-0005T8-3A; Thu, 04 Jul 2019 14:03:04 +0200 Message-ID: <6c070d62ffe342f5bc70556ef0f85740d04ae4a3.camel@sipsolutions.net> Subject: Re: [PATCH net-next v6 06/15] ethtool: netlink bitset handling From: Johannes Berg To: Michal Kubecek , netdev@vger.kernel.org Cc: Jiri Pirko , David Miller , Jakub Kicinski , Andrew Lunn , Florian Fainelli , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Date: Thu, 04 Jul 2019 14:03:02 +0200 In-Reply-To: <20190704115236.GR20101@unicorn.suse.cz> References: <20190703114933.GW2250@nanopsycho> <20190703181851.GP20101@unicorn.suse.cz> <20190704080435.GF2250@nanopsycho> <20190704115236.GR20101@unicorn.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-3.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-04 at 13:52 +0200, Michal Kubecek wrote: > > There is still the question if it it should be implemented as a nested > attribute which could look like the current compact form without the > "list" flag (if there is no mask, it's a list). Or an unstructured data > block consisting of u32 bit length You wouldn't really need the length, since the attribute has a length already :-) And then, if you just concatenate the value and mask, the existing NLA_BITFIELD32 becomes a special case. > and one or two bitmaps of > corresponding length. I would prefer the nested attribute, netlink was > designed to represent structured data, passing structures as binary goes > against the design (just looked at VFINFO in rtnetlink few days ago, > it's awful, IMHO). Yeah, I dunno. On the one hand I completely agree, on the other hand NLA_BITFIELD32 already goes the other way, and is there now... > Either way, I would still prefer to have bitmaps represented as an array > of 32-bit blocks in host byte order. This would be easy to handle in > kernel both in places where we have u32 based bitmaps and unsigned long > based ones. Other options seem less appealing: > > - u8 based: only complicates processing > - u64 based: have to care about alignment > - unsigned long based: alignment and also problems with 64-bit kernel > vs. 32-bit userspace Agree with this. johannes