Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp783271pxb; Thu, 19 Nov 2020 13:46:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUmQbxJxDtQnXflG4CUUEtzo/+m0QybGP3P70Wp5tSBBvjAx3C7FMWB7Dt1sXz7wlhu9K0 X-Received: by 2002:a17:906:e24d:: with SMTP id gq13mr13737324ejb.262.1605822380469; Thu, 19 Nov 2020 13:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605822380; cv=none; d=google.com; s=arc-20160816; b=OBTNom5pGx8QSCKsuJ7dRwPTAwUw+QM9GvnYflDuFCRauxGtinY2+iBa2K3DJW7fbV Q6h79Kx+f+FuE9Lx6uHl8Ox+hSPm9djn35dBSPmXUWzUeHUJ+el1ngfVqK9UMa80kmY0 CS5p8BBS2sfh6VOAZgBcS3s6fCCSvJTkdqyhsnxXIUjAgsvoBbVbOGNLf9dYM9qU6KgL PyjlRkSU1Kg6wWsJzptg64XJTaJ/MP4tIgKdiCDym8Xoq/KAcWandxfvoZl93g5fVN5d Go3n8dJOHxrIEEsS2td4/susPhXhCE33IotrNPPktkbu1mRMbzTjf5CvsBRLRtUMJyFU CNaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kB0FU+Jl+gXnwx8b8JSRrK0dKM8+hVHQAPmgqkuDpD0=; b=xPQTPCCv6fOWh+n2T/gyTNmCCxZyjc9o8XehFl0+Mgadp9wNz5981qimsgb+avZ+F7 mzws9xhkCkVyONsI72tzVItS/KiWxfLSuePLk/rfJwADmmXmBIobbaa45VoB9p9tnpoE uADklfEdKXeqEE/Y3sAsZL9pLs5+4HPF+dJBlUqBrWJuJjYXka1EnCP3UTKCQN6h67M3 u8TxcIubSfrdlyMslOJOxP/MbAGOjLvrcJAPFVMxjW5k6ccqi1dcC2glyRZEDBc1LO2S g1E1yDTpruUITA3QDJQtAySEWzg+2AJ712H1BAMSiiKYB7VHhoQDsV4atoxG59Jm1iIQ HKOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si690253edr.228.2020.11.19.13.45.57; Thu, 19 Nov 2020 13:46:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgKSVnI (ORCPT + 99 others); Thu, 19 Nov 2020 16:43:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:54980 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbgKSVnI (ORCPT ); Thu, 19 Nov 2020 16:43:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4D4E7AC41; Thu, 19 Nov 2020 21:43:06 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 6D3C1603F9; Thu, 19 Nov 2020 22:43:05 +0100 (CET) Date: Thu, 19 Nov 2020 22:43:05 +0100 From: Michal Kubecek To: Andrew Lunn Cc: Huazhong Tan , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, kuba@kernel.org Subject: Re: [RFC net-next 1/2] ethtool: add support for controling the type of adaptive coalescing Message-ID: <20201119214305.qjwlg7imqw46bltx@lion.mk-sys.cz> References: <1605758050-21061-1-git-send-email-tanhuazhong@huawei.com> <1605758050-21061-2-git-send-email-tanhuazhong@huawei.com> <20201119041557.GR1804098@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201119041557.GR1804098@lunn.ch> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 05:15:57AM +0100, Andrew Lunn wrote: > > diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h > > index e2bf36e..e3458d9 100644 > > --- a/include/uapi/linux/ethtool_netlink.h > > +++ b/include/uapi/linux/ethtool_netlink.h > > @@ -366,6 +366,7 @@ enum { > > ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */ > > ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */ > > ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */ > > + ETHTOOL_A_COALESCE_USE_DIM, /* u8 */ > > This appears to be a boolean? So /* flag */ would be better. Or do you > think there is scope for a few different algorithms, and an enum would > be better. If so, you should add the enum with the two current > options. NLA_FLAG would suffice for a read only bool attribute but if the attribute is expected to be set, we need to distinguish three cases: set to true, set to false and keep current value. That's why we use NLA_U8 for read write bool attributes (0 false, anything else true and attribute not present means leave untouched). Michal