From patchwork Fri May 22 17:49:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fujinaka, Todd" X-Patchwork-Id: 475735 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 27789140E33 for ; Sat, 23 May 2015 03:51:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CAB0893D30; Fri, 22 May 2015 17:51:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YxowtEMqNs2p; Fri, 22 May 2015 17:51:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5D3CD93192; Fri, 22 May 2015 17:51:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id DABA11C0C9B for ; Fri, 22 May 2015 17:51:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DD5DD8BF6D for ; Fri, 22 May 2015 17:51:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XpNbm9e3VQ1P for ; Fri, 22 May 2015 17:51:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by whitealder.osuosl.org (Postfix) with ESMTP id 4281B8BF67 for ; Fri, 22 May 2015 17:51:28 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 22 May 2015 10:51:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,477,1427785200"; d="scan'208";a="733864197" Received: from htfujina-fc.jf.intel.com ([134.134.145.52]) by orsmga002.jf.intel.com with ESMTP; 22 May 2015 10:51:26 -0700 From: Todd Fujinaka To: intel-wired-lan@lists.osuosl.org Date: Fri, 22 May 2015 10:49:50 -0700 Message-ID: <20150522174950.16145.78447.stgit@htfujina-fc.jf.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH] igb: report unsupported ethtool settings in set_coalesce X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" There are many settings possible using ethtool -C/--coalesce, but not all of them are supported. Report failure when an unsupported option is set. Signed-off-by: Todd Fujinaka --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 109cad9..13560fe 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2159,6 +2159,27 @@ static int igb_set_coalesce(struct net_device *netdev, struct igb_adapter *adapter = netdev_priv(netdev); int i; + if ((ec->rx_max_coalesced_frames != -1) || + (ec->rx_coalesce_usecs_irq != -1) || + (ec->rx_max_coalesced_frames_irq != -1) || + (ec->tx_max_coalesced_frames != -1) || + (ec->tx_coalesce_usecs_irq != -1) || + (ec->stats_block_coalesce_usecs != -1) || + (ec->use_adaptive_rx_coalesce != -1) || + (ec->use_adaptive_tx_coalesce != -1) || + (ec->pkt_rate_low != -1) || + (ec->rx_coalesce_usecs_low != -1) || + (ec->rx_max_coalesced_frames_low != -1) || + (ec->tx_coalesce_usecs_low != -1) || + (ec->tx_max_coalesced_frames_low != -1) || + (ec->pkt_rate_high != -1) || + (ec->rx_coalesce_usecs_high != -1) || + (ec->rx_max_coalesced_frames_high != -1) || + (ec->tx_coalesce_usecs_high != -1) || + (ec->tx_max_coalesced_frames_high != -1) || + (ec->rate_sample_interval != -1)) + return -ENOTSUPP; + if ((ec->rx_coalesce_usecs > IGB_MAX_ITR_USECS) || ((ec->rx_coalesce_usecs > 3) && (ec->rx_coalesce_usecs < IGB_MIN_ITR_USECS)) ||