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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 990E3C3F2D1 for ; Thu, 5 Mar 2020 05:16:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71CEF21556 for ; Thu, 5 Mar 2020 05:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583385396; bh=TIjrjAHgXew/njYYfamxg99cGapfmHRidsbvOCug9sQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JSvYCUoYSF50h/51+/qpwFVxmVjhf1qm8q1QsYI0syJzPz0x/Uq9k4Xq/LI5WpPbU 0n6DGty80nVBHdYvhP+U3zvdDwWWtowPk5fO1AkRImKPzDfVhc3iF2qWqE0G3wLeH/ o+mQYlvkTo3ocPkFmDrHlwUW6gGI8oEcE5rjyqnY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726004AbgCEFQg (ORCPT ); Thu, 5 Mar 2020 00:16:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:56642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgCEFQe (ORCPT ); Thu, 5 Mar 2020 00:16:34 -0500 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.128]) (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 C5D3F2187F; Thu, 5 Mar 2020 05:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583385393; bh=TIjrjAHgXew/njYYfamxg99cGapfmHRidsbvOCug9sQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbhO1hnTsg6D+B46lO1OiF0C3UySBqqlzm5QyiSnhnf9IbzqxFd+BDuiq5F6ANHpC 9eqwt/XqtrWPRie0M2lbSyphssG/TK6+qTrLGLSK373grKNdFdjafWIBqyPv/tGaai Q1lAnWiRxS2YnNX1KtuF3GYMy1ssge/OkGBcueoY= From: Jakub Kicinski To: davem@davemloft.net Cc: andrew@lunn.ch, ecree@solarflare.com, mkubecek@suse.cz, thomas.lendacky@amd.com, benve@cisco.com, _govind@gmx.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, snelson@pensando.io, yisen.zhuang@huawei.com, salil.mehta@huawei.com, jeffrey.t.kirsher@intel.com, jacob.e.keller@intel.com, alexander.h.duyck@linux.intel.com, michael.chan@broadcom.com, saeedm@mellanox.com, leon@kernel.org, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next v3 04/12] stmmac: let core reject the unsupported coalescing parameters Date: Wed, 4 Mar 2020 21:15:34 -0800 Message-Id: <20200305051542.991898-5-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200305051542.991898-1-kuba@kernel.org> References: <20200305051542.991898-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Set ethtool_ops->supported_coalesce_params to let the core reject unsupported coalescing parameters. This driver correctly rejects all unsupported parameters. No functional changes. v3: adjust commit message for new error code and member name Signed-off-by: Jakub Kicinski --- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index b29603ec744c..eae11c585025 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -732,20 +732,6 @@ static int stmmac_set_coalesce(struct net_device *dev, u32 rx_cnt = priv->plat->rx_queues_to_use; unsigned int rx_riwt; - /* Check not supported parameters */ - if ((ec->rx_coalesce_usecs_irq) || - (ec->rx_max_coalesced_frames_irq) || (ec->tx_coalesce_usecs_irq) || - (ec->use_adaptive_rx_coalesce) || (ec->use_adaptive_tx_coalesce) || - (ec->pkt_rate_low) || (ec->rx_coalesce_usecs_low) || - (ec->rx_max_coalesced_frames_low) || (ec->tx_coalesce_usecs_high) || - (ec->tx_max_coalesced_frames_low) || (ec->pkt_rate_high) || - (ec->tx_coalesce_usecs_low) || (ec->rx_coalesce_usecs_high) || - (ec->rx_max_coalesced_frames_high) || - (ec->tx_max_coalesced_frames_irq) || - (ec->stats_block_coalesce_usecs) || - (ec->tx_max_coalesced_frames_high) || (ec->rate_sample_interval)) - return -EOPNOTSUPP; - if (priv->use_riwt && (ec->rx_coalesce_usecs > 0)) { rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); @@ -914,6 +900,8 @@ static int stmmac_set_tunable(struct net_device *dev, } static const struct ethtool_ops stmmac_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .begin = stmmac_check_if_running, .get_drvinfo = stmmac_ethtool_getdrvinfo, .get_msglevel = stmmac_ethtool_getmsglevel, -- 2.24.1