Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp311602imp; Wed, 20 Feb 2019 00:17:27 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia0SgXG1sg5/+5aHVTzC9ISteFCBOns7xkkfAkgZqBgk8nCmjECHCpsIL+bJmVrE7uzMguV X-Received: by 2002:a63:e950:: with SMTP id q16mr28230907pgj.138.1550650647486; Wed, 20 Feb 2019 00:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550650647; cv=none; d=google.com; s=arc-20160816; b=eH4tz7HcwRLc3QHe6OrFqfQoLsKlfoFbNo+6DpZHOLqCbeRjZ3XKhS0czGdLPEvA9f jR2WBLw3+bp1WKHnheOX3irqwKgYg7FOzJ1R2Dl+8/nKt+5v15j0qZQMzvayvbJoHotD 6SbdxNSPjfF80VuFJHOx99AxSmQWP5XsViqtv2UVM4iq4E7qSZXdSLbceREnzEEQAjN9 1jEWkMIwUgQz5hF+qi5C/qNzpqcVnzhMNdHS3KbGbxB0ShpcTwwmMSqZNoN9LET7xj2X MPEnuTDBX6VTMP5v4eqCdN35C2vGZK1ih2pBcsvJKuMsxnG2DVxiYcsT5PlvO79FiXvD sa2g== 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; bh=6BH3j9a3m+IoNhp9M2nMpSVuVJKDFtDM2TBzILzglAs=; b=PieUw5w0phajlBMkkTYAmxpY/0VpGB9J1LCugtKmwXhcPbQ1K7Z/ytV3F9w8s8qA1o Z9HpqBlrrqXcQcRQOeKdfuvCOe7ibsKcd1Nfk5Ekyw683PqnnN2Ds73uxRtT+GDSP21d SK9YApH7BqnKIyyjlOUOvIWqktcXMpE2l2skL1iop4D+7IIqg8PI2tSbJtCptz6z7//q kA0gmm4swUfLxvmSW/IgMe4Q0Y6RdNu2hG/VE8BElzqgnSaiSJbVAJTtpn84HmZ9k9TW 5HmZZFtUcX9ZZ1CZqdl/AmryJonzE+Ttq2ZlaTCc3tCQWegyLfH6uTntx9xuNRZyrFvA UiWw== 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 127si10859951pgf.307.2019.02.20.00.17.12; Wed, 20 Feb 2019 00:17:27 -0800 (PST) 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 S1726395AbfBTIQe (ORCPT + 99 others); Wed, 20 Feb 2019 03:16:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:56284 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726210AbfBTIQc (ORCPT ); Wed, 20 Feb 2019 03:16:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D33A9AD72; Wed, 20 Feb 2019 08:16:30 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 00483E00A5; Wed, 20 Feb 2019 09:16:29 +0100 (CET) Date: Wed, 20 Feb 2019 09:16:29 +0100 From: Michal Kubecek To: Jakub Kicinski Cc: netdev@vger.kernel.org, David Miller , Andrew Lunn , Jiri Pirko , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next v3 05/21] ethtool: netlink bitset handling Message-ID: <20190220081629.GG23151@unicorn.suse.cz> References: <5f70eb8055a26f60f2282d7c1d193619a96c40a1.1550513384.git.mkubecek@suse.cz> <20190219182759.0abf08ae@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219182759.0abf08ae@cakuba.netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 19, 2019 at 06:27:59PM -0800, Jakub Kicinski wrote: > On Mon, 18 Feb 2019 19:21:49 +0100 (CET), Michal Kubecek wrote: > > + else if (is_u32) > > + bitmap_from_arr32(val, bitmap, nbits); > > + else > > + bitmap_copy(val, bitmap, nbits); > > + nla_for_each_nested(bit_attr, tb[ETHA_BITSET_BITS], rem) { > > + *err = ethnl_update_bit(val, mask, nbits, bit_attr, > > + is_list, names, legacy, info); > > + if (*err < 0) > > + goto out_free; > > + } > > + if (bitmask) > > + __bitmap_to_any(bitmask, mask, nbits, is_u32); > > + } else { > > + unsigned int change_words = DIV_ROUND_UP(change_bits, 32); > > + > > + *err = 0; > > + if (change_bits == 0 && tb[ETHA_BITSET_MASK]) > > + goto out_free; > > + *err = -EINVAL; > > + if (!tb[ETHA_BITSET_VALUE]) > > + goto out_free; > > !tb[ETHA_BITSET_BITS] && !tb[ETHA_BITSET_VALUE] is already rejected > above. Thank you. I'll drop this test. Michal