From patchwork Mon Mar 16 20:47:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222446 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 93BA6C18E5B for ; Mon, 16 Mar 2020 20:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AE4220679 for ; Mon, 16 Mar 2020 20:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391643; bh=euIWzGNH9+S/ctmKpMSkTr1QPPfHc+OCzxezSmAGOrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=N7w9ormqeUjIfr+cXG7bFSdgnRwM213Wq7cA1ldFi1iB7UCA9mDv7C81rsVcpOyOi WQg+eW82mmPplSU4APTeS1kkMi4VQONtMkaUtYmJyqsMlgZGik9WtqRCf0GyO+AYDl sPJiEB/G8RlLmGt9yPoMPuZFNtqFYmkFAgHlCL1g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732582AbgCPUrW (ORCPT ); Mon, 16 Mar 2020 16:47:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:58350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732537AbgCPUrW (ORCPT ); Mon, 16 Mar 2020 16:47:22 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 2FD01206C0; Mon, 16 Mar 2020 20:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391642; bh=euIWzGNH9+S/ctmKpMSkTr1QPPfHc+OCzxezSmAGOrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eWlQMC6fjfJGA+6YIvXDSm5FVeU/DhHRzEesbtoBrrBqzljV3yEluyncqXWivpk2R ojOOefF1JbiqtSIJjWR/6y3Zidq/rVbdpwGospCQlQK0Ddd177kvWipR9q+MRXKBtV lzNu4AfiwgNUzMf1h8r5MjI85iriuNTd3i+ScQIA= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com, ecree@solarflare.com, mhabets@solarflare.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, Jose.Abreu@synopsys.com, andy@greyhouse.net, grygorii.strashko@ti.com, andrew@lunn.ch, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 1/9] net: sfc: reject unsupported coalescing params Date: Mon, 16 Mar 2020 13:47:04 -0700 Message-Id: <20200316204712.3098382-2-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org> References: <20200316204712.3098382-1-kuba@kernel.org> MIME-Version: 1.0 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 did not previously reject unsupported parameters. The check for use_adaptive_tx_coalesce will now be done by the core. Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/sfc/ethtool.c | 6 +++--- drivers/net/ethernet/sfc/falcon/ethtool.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 9a637cd67f43..04e88d05e8ff 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c @@ -232,9 +232,6 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev, bool adaptive, rx_may_override_tx; int rc; - if (coalesce->use_adaptive_tx_coalesce) - return -EINVAL; - efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive); if (coalesce->rx_coalesce_usecs != rx_usecs) @@ -1138,6 +1135,9 @@ static int efx_ethtool_set_fecparam(struct net_device *net_dev, } const struct ethtool_ops efx_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_USECS_IRQ | + ETHTOOL_COALESCE_USE_ADAPTIVE_RX, .get_drvinfo = efx_ethtool_get_drvinfo, .get_regs_len = efx_ethtool_get_regs_len, .get_regs = efx_ethtool_get_regs, diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c index 08bd6a321918..db90d94e24c9 100644 --- a/drivers/net/ethernet/sfc/falcon/ethtool.c +++ b/drivers/net/ethernet/sfc/falcon/ethtool.c @@ -603,9 +603,6 @@ static int ef4_ethtool_set_coalesce(struct net_device *net_dev, bool adaptive, rx_may_override_tx; int rc; - if (coalesce->use_adaptive_tx_coalesce) - return -EINVAL; - ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive); if (coalesce->rx_coalesce_usecs != rx_usecs) @@ -1311,6 +1308,9 @@ static int ef4_ethtool_get_module_info(struct net_device *net_dev, } const struct ethtool_ops ef4_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_USECS_IRQ | + ETHTOOL_COALESCE_USE_ADAPTIVE_RX, .get_drvinfo = ef4_ethtool_get_drvinfo, .get_regs_len = ef4_ethtool_get_regs_len, .get_regs = ef4_ethtool_get_regs, From patchwork Mon Mar 16 20:47:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222445 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 30FCDC0044D for ; Mon, 16 Mar 2020 20:47:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02F7020674 for ; Mon, 16 Mar 2020 20:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391648; bh=rQni17X/6KdO7YhjnzJvhjdjopyf0UZB/b5kVjSjs0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OLYcH2pSr1jPJQZCfhZ05I+KPilO3ZoMJqq0R/2hAiJj8cC+gDumV+JpxvRlTApbL 1rrppXnqBVuvFlE93IZ8SYH6FSChJVhpE/1IBoYoTZUnY5PxMp7u/tXd2pdCOVOdAM oXhIHItT0MB+yFWELxgwf18h8evNzvskTTVjN4CQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732605AbgCPUr1 (ORCPT ); Mon, 16 Mar 2020 16:47:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732588AbgCPUrZ (ORCPT ); Mon, 16 Mar 2020 16:47:25 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 8ED9D2073C; Mon, 16 Mar 2020 20:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391644; bh=rQni17X/6KdO7YhjnzJvhjdjopyf0UZB/b5kVjSjs0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TIGgNszuY+7+yo1GP8GuwkvjNhbXSlDg3EEBXPc8EeIY8J2FHwLN/aWtPWT19i/P9 X0JN5n2yrrlrImNbIExLiNNRj4m39CZQ4jkWvRXnoYxYlhYoeSBgBBRuwCEzNDIAy+ zHGyiIm2FkM9d2b+6osJJcrFU1twaJ6+4Wuu+mlo= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com, ecree@solarflare.com, mhabets@solarflare.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, Jose.Abreu@synopsys.com, andy@greyhouse.net, grygorii.strashko@ti.com, andrew@lunn.ch, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 3/9] net: dwc-xlgmac: let core reject the unsupported coalescing parameters Date: Mon, 16 Mar 2020 13:47:06 -0700 Message-Id: <20200316204712.3098382-4-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org> References: <20200316204712.3098382-1-kuba@kernel.org> MIME-Version: 1.0 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 already correctly rejected all unsupported parameters. While at it remove unnecessary zeroing on get. No functional changes. Signed-off-by: Jakub Kicinski --- .../net/ethernet/synopsys/dwc-xlgmac-ethtool.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c index fde722136869..bc198eadfcab 100644 --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c @@ -151,7 +151,6 @@ static int xlgmac_ethtool_get_coalesce(struct net_device *netdev, { struct xlgmac_pdata *pdata = netdev_priv(netdev); - memset(ec, 0, sizeof(struct ethtool_coalesce)); ec->rx_coalesce_usecs = pdata->rx_usecs; ec->rx_max_coalesced_frames = pdata->rx_frames; ec->tx_max_coalesced_frames = pdata->tx_frames; @@ -167,20 +166,6 @@ static int xlgmac_ethtool_set_coalesce(struct net_device *netdev, unsigned int rx_frames, rx_riwt, rx_usecs; unsigned int tx_frames; - /* Check for not supported parameters */ - if ((ec->rx_coalesce_usecs_irq) || (ec->rx_max_coalesced_frames_irq) || - (ec->tx_coalesce_usecs) || (ec->tx_coalesce_usecs_high) || - (ec->tx_max_coalesced_frames_irq) || (ec->tx_coalesce_usecs_irq) || - (ec->stats_block_coalesce_usecs) || (ec->pkt_rate_low) || - (ec->use_adaptive_rx_coalesce) || (ec->use_adaptive_tx_coalesce) || - (ec->rx_max_coalesced_frames_low) || (ec->rx_coalesce_usecs_low) || - (ec->tx_coalesce_usecs_low) || (ec->tx_max_coalesced_frames_low) || - (ec->pkt_rate_high) || (ec->rx_coalesce_usecs_high) || - (ec->rx_max_coalesced_frames_high) || - (ec->tx_max_coalesced_frames_high) || - (ec->rate_sample_interval)) - return -EOPNOTSUPP; - rx_usecs = ec->rx_coalesce_usecs; rx_riwt = hw_ops->usec_to_riwt(pdata, rx_usecs); rx_frames = ec->rx_max_coalesced_frames; @@ -257,6 +242,8 @@ static void xlgmac_ethtool_get_ethtool_stats(struct net_device *netdev, } static const struct ethtool_ops xlgmac_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = xlgmac_ethtool_get_drvinfo, .get_link = ethtool_op_get_link, .get_msglevel = xlgmac_ethtool_get_msglevel, From patchwork Mon Mar 16 20:47:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222442 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 6E392C0044D for ; Mon, 16 Mar 2020 20:47:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B0122087C for ; Mon, 16 Mar 2020 20:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391657; bh=5X7W6p75pe8eZkmudCnrya0wvM5uYOzxEjom2C2CMRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=L+bBuSZ4M1HlMsNqWN2vPHZswWWnoxuA0HJzpOUFh6A8WJADq4kLK1Y+lpqEet45D ID1XZMvagbeoLjlCdeIrUb8mfXaEvuyH39QLPbm07ADo0FHotm6OTWiYUbdwJvNWmY pQpkC6DrLUQhqXo6EN4+T8tgK5sDe3FpNonTDgtc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732599AbgCPUr0 (ORCPT ); Mon, 16 Mar 2020 16:47:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:58450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732537AbgCPUrZ (ORCPT ); Mon, 16 Mar 2020 16:47:25 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 A64CC20719; Mon, 16 Mar 2020 20:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391645; bh=5X7W6p75pe8eZkmudCnrya0wvM5uYOzxEjom2C2CMRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=clI8eblxcsPNOP4tRfSqf1RMWtpNX6dgd5zEtKq1JlHBkgWy/U+6lWcSRc41q+NhW jtUE2pKIfRkRhDfXOl7m3ZVTmzNFSjqNF2uTLYOCt9HLoO7a+3lGb4ebQ/QKQcw1Pd t3AylPU/ii7qO0z9wqs0lI9bafdjCz45GBdNYHwQ= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com, ecree@solarflare.com, mhabets@solarflare.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, Jose.Abreu@synopsys.com, andy@greyhouse.net, grygorii.strashko@ti.com, andrew@lunn.ch, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 4/9] net: tehuti: reject unsupported coalescing params Date: Mon, 16 Mar 2020 13:47:07 -0700 Message-Id: <20200316204712.3098382-5-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org> References: <20200316204712.3098382-1-kuba@kernel.org> MIME-Version: 1.0 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 did not previously reject unsupported parameters. Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/tehuti/tehuti.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index 0f8a924fc60c..40a2ce0ca808 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c @@ -2373,6 +2373,8 @@ static void bdx_get_ethtool_stats(struct net_device *netdev, static void bdx_set_ethtool_ops(struct net_device *netdev) { static const struct ethtool_ops bdx_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = bdx_get_drvinfo, .get_link = ethtool_op_get_link, .get_coalesce = bdx_get_coalesce, From patchwork Mon Mar 16 20:47:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222444 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 C134AC18E5B for ; Mon, 16 Mar 2020 20:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B0372076F for ; Mon, 16 Mar 2020 20:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391651; bh=fjHT+vXaGTkmgjflYBJF3oq9Wf1OCHxqOoCcMIvTVuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BzdXuzU7q7njB1nx+fNE16nIjp5vYhQqwKQnyr8M+BcHUFv33QVcBa9EMpdiEdafR DSY1spNU0knvMMGFllFpqyvkKm2CGO37sj8BgdD5J2cs6zZFzKHwJrkS0560YOt/7Z b+celCbKRSbr5+JYADgHsjNTOHDgbJWSCHxO2+jo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732618AbgCPUra (ORCPT ); Mon, 16 Mar 2020 16:47:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:58482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732606AbgCPUr1 (ORCPT ); Mon, 16 Mar 2020 16:47:27 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 BAF7C20738; Mon, 16 Mar 2020 20:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391647; bh=fjHT+vXaGTkmgjflYBJF3oq9Wf1OCHxqOoCcMIvTVuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gMyCe00HorkAkiTkqfcj7nUSVRiWiua0H7UuSBulNUTgQcTm5lF4mQEIqtyRN1TPo R9j3SNS89T7JqS9A5Xs1PHUtRn7kLvyBFNystTohvZoQloYxPdfzt9cAQkUsokHTAJ u5qxs/jj6Y5WsQwqk8emfaCWwmVT0AwjLtoIW7+A= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com, ecree@solarflare.com, mhabets@solarflare.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, Jose.Abreu@synopsys.com, andy@greyhouse.net, grygorii.strashko@ti.com, andrew@lunn.ch, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 6/9] net: davinci_emac: reject unsupported coalescing params Date: Mon, 16 Mar 2020 13:47:09 -0700 Message-Id: <20200316204712.3098382-7-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org> References: <20200316204712.3098382-1-kuba@kernel.org> MIME-Version: 1.0 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 did not previously reject unsupported parameters. Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/ti/davinci_emac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 75d4e16c692b..de282531f68b 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -481,6 +481,7 @@ static int emac_set_coalesce(struct net_device *ndev, * Ethtool support for EMAC adapter */ static const struct ethtool_ops ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS, .get_drvinfo = emac_get_drvinfo, .get_link = ethtool_op_get_link, .get_coalesce = emac_get_coalesce, From patchwork Mon Mar 16 20:47:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222443 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 2A44BC0044D for ; Mon, 16 Mar 2020 20:47:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0107720777 for ; Mon, 16 Mar 2020 20:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391655; bh=x7QquaWPZHr21v78IZRqMv5qYe3nQW2NGMORkBhObEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NvBU2fTrsD9XFqEGBf0RZDIDH7t6cThDlrXmOVxpcXF0qtjOliW3S5F0oqOK3zLkx yR8AXyKeMIX9xLUBjAr8IxU6nSDVlvpaRUFD6VrR7hrKjotoi90bCi6HiUj6ET1XfV bcgbp6zcFF8+dA+BxKrpEMtGPgP4mav17gKDsF9Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732626AbgCPUrc (ORCPT ); Mon, 16 Mar 2020 16:47:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:58544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732613AbgCPUr3 (ORCPT ); Mon, 16 Mar 2020 16:47:29 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 7FA6D20753; Mon, 16 Mar 2020 20:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584391649; bh=x7QquaWPZHr21v78IZRqMv5qYe3nQW2NGMORkBhObEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a/yPCuHi8uTwJs2o1vU3pE9fW1mJjPMluDr1XNCBFxxvr4N6R8F2KApWwcS238U3t EjUExu1NuInVvsK1i6Z4X5/VbO5gYvlNlqjUpqPToV7qhz3v5+Dpn+bou5ow3J5xNz BoPMMcaqIu2aBwO4Z7g68kER3YZAnRI236nGp9NM= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com, ecree@solarflare.com, mhabets@solarflare.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, Jose.Abreu@synopsys.com, andy@greyhouse.net, grygorii.strashko@ti.com, andrew@lunn.ch, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, mkubecek@suse.cz, Jakub Kicinski Subject: [PATCH net-next 8/9] net: axienet: let core reject the unsupported coalescing parameters Date: Mon, 16 Mar 2020 13:47:11 -0700 Message-Id: <20200316204712.3098382-9-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316204712.3098382-1-kuba@kernel.org> References: <20200316204712.3098382-1-kuba@kernel.org> MIME-Version: 1.0 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 already correctly rejected all unsupported parameters. No functional changes. Signed-off-by: Jakub Kicinski --- .../net/ethernet/xilinx/xilinx_axienet_main.c | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index c2f4c5ca2e80..e2f3e2b0cec7 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1309,27 +1309,6 @@ static int axienet_ethtools_set_coalesce(struct net_device *ndev, return -EFAULT; } - if ((ecoalesce->rx_coalesce_usecs) || - (ecoalesce->rx_coalesce_usecs_irq) || - (ecoalesce->rx_max_coalesced_frames_irq) || - (ecoalesce->tx_coalesce_usecs) || - (ecoalesce->tx_coalesce_usecs_irq) || - (ecoalesce->tx_max_coalesced_frames_irq) || - (ecoalesce->stats_block_coalesce_usecs) || - (ecoalesce->use_adaptive_rx_coalesce) || - (ecoalesce->use_adaptive_tx_coalesce) || - (ecoalesce->pkt_rate_low) || - (ecoalesce->rx_coalesce_usecs_low) || - (ecoalesce->rx_max_coalesced_frames_low) || - (ecoalesce->tx_coalesce_usecs_low) || - (ecoalesce->tx_max_coalesced_frames_low) || - (ecoalesce->pkt_rate_high) || - (ecoalesce->rx_coalesce_usecs_high) || - (ecoalesce->rx_max_coalesced_frames_high) || - (ecoalesce->tx_coalesce_usecs_high) || - (ecoalesce->tx_max_coalesced_frames_high) || - (ecoalesce->rate_sample_interval)) - return -EOPNOTSUPP; if (ecoalesce->rx_max_coalesced_frames) lp->coalesce_count_rx = ecoalesce->rx_max_coalesced_frames; if (ecoalesce->tx_max_coalesced_frames) @@ -1357,6 +1336,7 @@ axienet_ethtools_set_link_ksettings(struct net_device *ndev, } static const struct ethtool_ops axienet_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = axienet_ethtools_get_drvinfo, .get_regs_len = axienet_ethtools_get_regs_len, .get_regs = axienet_ethtools_get_regs,