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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 CC361C169C4 for ; Wed, 6 Feb 2019 10:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A67FB206C2 for ; Wed, 6 Feb 2019 10:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbfBFKdB (ORCPT ); Wed, 6 Feb 2019 05:33:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:56730 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726835AbfBFKdB (ORCPT ); Wed, 6 Feb 2019 05:33:01 -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 0E0D4B645; Wed, 6 Feb 2019 10:33:00 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 71B0FE0142; Wed, 6 Feb 2019 11:32:58 +0100 (CET) Date: Wed, 6 Feb 2019 11:32:58 +0100 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Jeff Kirsher , linville@tuxdriver.com, Nicholas Nunley , nhorman@redhat.com, sassmann@redhat.com Subject: Re: [PATCH v2 3/6] ethtool: introduce new ioctl for per-queue settings Message-ID: <20190206103258.GK21401@unicorn.suse.cz> References: <20190206000106.24364-1-jeffrey.t.kirsher@intel.com> <20190206000106.24364-3-jeffrey.t.kirsher@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190206000106.24364-3-jeffrey.t.kirsher@intel.com> 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 Tue, Feb 05, 2019 at 04:01:03PM -0800, Jeff Kirsher wrote: > +static int find_max_num_queues(struct cmd_context *ctx) > +{ > + struct ethtool_channels echannels; > + > + echannels.cmd = ETHTOOL_GCHANNELS; > + if (send_ioctl(ctx, &echannels)) > + return -1; > + > + return MAX(MAX(echannels.rx_count, echannels.tx_count), > + echannels.combined_count); > +} Is the outer MAX() correct here? From the documentation to -L option, it rather seems we might want return MAX(echannels.rx_count, echannels.tx_count) + echannels.combined_count; But I can't find any NIC around which would have non-zero rx_count or tx_count so that I cannot check. Michal Kubecek