From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99C28C433E0 for ; Fri, 15 May 2020 20:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BFBC205CB for ; Fri, 15 May 2020 20:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgEOU47 (ORCPT ); Fri, 15 May 2020 16:56:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:34754 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbgEOU46 (ORCPT ); Fri, 15 May 2020 16:56:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 04DB9ACAE; Fri, 15 May 2020 20:56:59 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 49A51602F2; Fri, 15 May 2020 22:56:56 +0200 (CEST) Date: Fri, 15 May 2020 22:56:56 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Jakub Kicinski , davem@davemloft.net, simon.horman@netronome.com, kernel-team@fb.com Subject: Re: [PATCH net-next 1/3] ethtool: check if there is at least one channel for TX/RX in the core Message-ID: <20200515205656.GF21714@lion.mk-sys.cz> References: <20200515194902.3103469-1-kuba@kernel.org> <20200515194902.3103469-2-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515194902.3103469-2-kuba@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, May 15, 2020 at 12:49:00PM -0700, Jakub Kicinski wrote: > Having a channel config with no ability to RX or TX traffic is > clearly wrong. Check for this in the core so the drivers don't > have to. > > Signed-off-by: Jakub Kicinski Reviewed-by: Michal Kubecek Only one formal problem: > @@ -170,7 +170,8 @@ int ethnl_set_channels(struct sk_buff *skb, struct genl_info *info) > ethnl_update_u32(&channels.other_count, > tb[ETHTOOL_A_CHANNELS_OTHER_COUNT], &mod); > ethnl_update_u32(&channels.combined_count, > - tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT], &mod); > + tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT], &mod_combined); > + mod |= mod_combined; > ret = 0; > if (!mod) > goto out_ops; Bitwise or should do the right thing but using "|=" on bool variables looks strange. Michal