From patchwork Fri May 15 19:48:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 219150 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=-4.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=no 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 59894C433E1 for ; Fri, 15 May 2020 19:49:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3428220709 for ; Fri, 15 May 2020 19:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589572150; bh=RZFO3RDxeq+k6RcP5Uk+u+NTu2qRyUvDt6Tftceva2g=; h=From:To:Cc:Subject:Date:List-ID:From; b=0PwH9+zP4h3Nnadg5H+6yVHfl6XcxtDQQRdcf7+mns9Qjvmko3+BMpI+YWRm4E2gs vEN2CdLE38lhBY0sAGwVVCYvNH3KH0z6y2/hannGwnLBDti00cXA6PfYTMuAqIM1hl BgnNjDkPILTPk4I39BQ+Td3Mxz72yclcd/SnSi+s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbgEOTtJ (ORCPT ); Fri, 15 May 2020 15:49:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgEOTtI (ORCPT ); Fri, 15 May 2020 15:49:08 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A52B520709; Fri, 15 May 2020 19:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589572147; bh=RZFO3RDxeq+k6RcP5Uk+u+NTu2qRyUvDt6Tftceva2g=; h=From:To:Cc:Subject:Date:From; b=CLWR1azuyoKsrb9fZwrB1u6a0n1Xm1+H9QaQ5ElUNtTJLFt4IIdfFGIXzreGA2KNN 3Wv7djpimynLr39wbHkXEKDsxRKHM2AcfCWl1tT+B0FMEC/ZDf5ZyY1CXmPIzLCeud boHDv225Z8CbYD+Znku/5npQ4dCq1CTjt+DyOmNQ= From: Jakub Kicinski To: davem@davemloft.net Cc: mkubecek@suse.cz, netdev@vger.kernel.org, simon.horman@netronome.com, kernel-team@fb.com, Jakub Kicinski Subject: [PATCH net-next 0/3] ethtool: set_channels: add a few more checks Date: Fri, 15 May 2020 12:48:59 -0700 Message-Id: <20200515194902.3103469-1-kuba@kernel.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There seems to be a few more things we can check in the core before we call drivers' ethtool_ops->set_channels. Adding the checks to the core simplifies the drivers. This set only includes changes to the NFP driver as an example. There is a small risk in the first patch that someone actually purposefully accepts a strange configuration without RX or TX channels, but I couldn't find such a driver in the tree. Jakub Kicinski (3): ethtool: check if there is at least one channel for TX/RX in the core nfp: don't check lack of RX/TX channels ethtool: don't call set_channels in drivers if config didn't change .../ethernet/netronome/nfp/nfp_net_ethtool.c | 3 +-- net/ethtool/channels.c | 20 +++++++++++++++++-- net/ethtool/ioctl.c | 11 ++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-)