Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4415761img; Tue, 26 Mar 2019 09:00:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeqLMlzbvLioTpu09dHSUz8S7vM7Ss0iqZyyKdS/YsHi9+hwhH8Kx8af4c0/ZNriBQAPfj X-Received: by 2002:a62:168a:: with SMTP id 132mr30073018pfw.155.1553616015757; Tue, 26 Mar 2019 09:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553616015; cv=none; d=google.com; s=arc-20160816; b=cB4JnWgxyy4dzHkmuC/JUZNWv9adE2CdMqLpbWKVGAOJl40l+JPlSO9Bz4buDu+j7f jtskhjRt3QawAkekbm+5t6Q82Ko25YVimcpcdwblVBrTLYXWlZSUXnQqAN2GEgk6Fprd jrXPNzv1SDdeVWiPX7jjkfr2OZVysAJMiRCiUK31ZjcqW/Dqm6D1ngQjH4fx4R6pE1m2 w8dJ7/6XHFeLtO9L+NNulhcB/XcqHwdfJYJJij12gm3w1nNKNq1vK5Fvq4Px+x5wIY1T ZgySYHHWO6s1DlZ4cP3XxQuZW68x3TgDU6nOQjVnk+NXVG5Q+8QJe7uRjkIqGXgI1E4A Pmjw== 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=KvLvYQ8To9vnE8+/chaGT7oUCER7SYfH+KoD75hlshE=; b=i6ecfh2ISJzY3JbgPMbMdm9OmYtkSmEONh7uu8hKnqU+/7qx6LRTI2e4vim/JeEsN1 iJXcYOMRHDbqe4xv0hhD3eGYeH3R4xwXkp8C1wrHZ+UcQbTAFi86gAPfFkwuOPI4d9hQ Clt6US+Qq+2+ieVID1LJtpIMt/C7qlcmpGp4h/p4wci2GGM5B3b5Y1Y8xF3Xf/WxM8xa 3XJE07sOwVHdXZQca+VbYz3zh3XpcIvp1n9tXPcN2q03r59x05VHtqyy4NEqcZF2iZGR iCod3ZmmI5VuIyyp/clytrqmv0Otexj6dJWDEXl+deJl9ZGxYWJetabNTUXFeIGZ2c/z eZlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=jeaL76ao; 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 j26si15718102pff.289.2019.03.26.09.00.00; Tue, 26 Mar 2019 09:00:15 -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=jeaL76ao; 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 S1732057AbfCZP7O (ORCPT + 99 others); Tue, 26 Mar 2019 11:59:14 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52523 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfCZP7N (ORCPT ); Tue, 26 Mar 2019 11:59:13 -0400 Received: by mail-wm1-f67.google.com with SMTP id a184so13210834wma.2 for ; Tue, 26 Mar 2019 08:59:12 -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=KvLvYQ8To9vnE8+/chaGT7oUCER7SYfH+KoD75hlshE=; b=jeaL76aojADDCFOSBXXt0XmST0oQR1XTZNIyNuFeG/4lsPEmF20iM2oSC9/C1yYwUQ ShJC7lUWkVwfaL6BN+A7Nt8zfM+eybDCCfRFpCC7qHX1pbgLhPpQNHjbNDh35NCkLP3Y URnXqNPjPP7pUqE3oh1o1Bpx9wzD5saGdjBvyFp7kxZyFTkiEuEeDCYmWxL/lfsRtwLJ whkRIycdMXSprftUznuWfMS19x6dA+JPV+btQAWbz0uvL/F7+QbHpkxM0bRVbHGAUuey L9QDdd0BPhzI1tEAtEiIedzAmZYMcYK1uoktiUI+mt+7cnPo+1eshAy/xbi29byM2P5F r5wQ== 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=KvLvYQ8To9vnE8+/chaGT7oUCER7SYfH+KoD75hlshE=; b=pzRJWpnqr7KrsxjBztBsHmRKrxVUPbC19FI7n/m5MvCEV36OGy5OGSkcW+wlbk0C+B uzpoXWa6sG0DgoMwruVEVephCYBMBberx7jEVX+K3VZ8xO+0fVHFoSmC9HQjswA5G056 +z4CWuIMrssYdLZf8FBzre9R7hAwwm1DE04Hq4uwqjLuSVJSRXpEZpiZnQsqJbbTldmO gwGKQDrm3HSLQh4S1uUIsUTiqMrurERTYRIxfqJgiQXvPn6j7a5EH6R7ZdEJWckwT9E1 OR1g2jU4xIakEPz2DJwEyO1KgeliojMaqIDB6LweeElwDH2J02YFa6wUETfsjDY3Hmrl R6eQ== X-Gm-Message-State: APjAAAUcPlTnME3nLvfb2o5gje1JjqwMKkXRv3JKxEH+HK/UTnSN8K4O p4LV8t8V/q/SODkBde6UihdBKg== X-Received: by 2002:a1c:ca06:: with SMTP id a6mr13965175wmg.14.1553615952187; Tue, 26 Mar 2019 08:59:12 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id x5sm21572993wrt.72.2019.03.26.08.59.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 08:59:11 -0700 (PDT) Date: Tue, 26 Mar 2019 16:59:11 +0100 From: Jiri Pirko To: Michal Kubecek Cc: 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 v5 07/22] ethtool: netlink bitset handling Message-ID: <20190326155911.GA4958@nanopsycho.orion> References: <9123f942b484ef4bbb684bb1f4aa2b70d673a259.1553532199.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9123f942b484ef4bbb684bb1f4aa2b70d673a259.1553532199.git.mkubecek@suse.cz> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, Mar 25, 2019 at 06:08:15PM CET, mkubecek@suse.cz wrote: >Declare attribute type constants and add helper functions to generate and >parse arbitrary length bit sets. Hmm, this looks like a lot of work. Two things: 1) This is generic. Not really related to ethtool in any way. Could this be done in netlink common code? 2) Did you think about leveraging NLA_BITFIELD32? What I mean is this: NEST_START NLA_BITFIELD32 index 0 (bit 0-31) NLA_BITFIELD32 index 1 (bit 32-63) NLA_BITFIELD32 index 2 (bit 64-95) NLA_BITFIELD32 index 3 (bit 96-127) .... NEST_END It is basically an array of NLA_BITFIELD32.