From patchwork Fri Mar 6 01:05:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222963 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=unavailable 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 9CBA6C3F2D2 for ; Fri, 6 Mar 2020 01:06:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66F3D21739 for ; Fri, 6 Mar 2020 01:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456813; bh=BFAz6k8N2AgaW0pXpCjlxC1XrQ/2bd8PY1PxlDWovR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JokuwCwdF2l2Vacz98Bs7CLqYYQl5OTjQ9/OFnu913QFPt7SWew+qOg3wMCElpFUe z5h0+RUsPP2XiXTUxqev5FswoJaIDn9lsNZEeezn3EvhCD+U9JSEC0hi5g7nHpecq/ ZXo9IXl9fxzfOcTzOSxEjj9colnNGUdaBTCbEz6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726874AbgCFBGw (ORCPT ); Thu, 5 Mar 2020 20:06:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:59366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgCFBGu (ORCPT ); Thu, 5 Mar 2020 20:06:50 -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 CBE7E208C3; Fri, 6 Mar 2020 01:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456809; bh=BFAz6k8N2AgaW0pXpCjlxC1XrQ/2bd8PY1PxlDWovR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eDv4q92MORThFDshgMnFSWnN8110Mhqn0qrE54dC9E9Y+VvvVknnafFvOnuYH/ZKD gmYxPMTC8cTzqhFWwwQSMS+YQORfDP0IGiQRhC/0UBDTJpDSpQwDKTs4Q+Nzn/qODN a2RcZc51Zeqqp6AIeWQOrvJk1S0sJ8uHzQhK90BY= From: Jakub Kicinski To: davem@davemloft.net Cc: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org, dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, edumazet@google.com, jasowang@redhat.com, mkubecek@suse.cz, hayeswang@realtek.com, doshir@vmware.com, pv-drivers@vmware.com, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org, merez@codeaurora.org, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 2/7] RDMA/ipoib: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:05:57 -0800 Message-Id: <20200306010602.1620354-3-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306010602.1620354-1-kuba@kernel.org> References: <20200306010602.1620354-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/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c index 63e4f9d15fd9..a10a0c2ca2da 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c @@ -213,6 +213,8 @@ static int ipoib_get_link_ksettings(struct net_device *netdev, } static const struct ethtool_ops ipoib_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS | + ETHTOOL_COALESCE_RX_MAX_FRAMES, .get_link_ksettings = ipoib_get_link_ksettings, .get_drvinfo = ipoib_get_drvinfo, .get_coalesce = ipoib_get_coalesce, From patchwork Fri Mar 6 01:06:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222961 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=unavailable 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 3765FC3F2D1 for ; Fri, 6 Mar 2020 01:07:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1103E20726 for ; Fri, 6 Mar 2020 01:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456824; bh=T6cn0wHytPI/i5tO/aLymuIVcVVaOSY4AMgguxIiZ6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cIjQzwe+MN7YG536ZrLSOaMjvdtfQ9aSwSXJsV1mdbgIecT+AevNFqixbLaaCCiOi 605JOzRz/UjzU7jBomxJFlrH6KeR59PAjTAazItdFsdOne7LPUvpPGoeIlYWQhM2zo BLjv0RJHTDPkWs9hIMolCEmoY9Z3LSHGKW8+2tjI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbgCFBG4 (ORCPT ); Thu, 5 Mar 2020 20:06:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:59514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbgCFBGx (ORCPT ); Thu, 5 Mar 2020 20:06:53 -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 1EFC22146E; Fri, 6 Mar 2020 01:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456813; bh=T6cn0wHytPI/i5tO/aLymuIVcVVaOSY4AMgguxIiZ6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ss6+rX3vSW20OZ+dJk5Jy601slJGsh4cB8F5Jwqec3EJ+RxT9LNNHRZ4lZ9wbYFMN sjL/Gh1OS5xLhDggS0VzUabXakN8H5Xv97uoMglIbDdRe9/4nnhtDtu+BHkKX8tygj 39cfUWrpF0482oyY5S3yizG4DVsAlXJQuuj3VBiA= From: Jakub Kicinski To: davem@davemloft.net Cc: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org, dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, edumazet@google.com, jasowang@redhat.com, mkubecek@suse.cz, hayeswang@realtek.com, doshir@vmware.com, pv-drivers@vmware.com, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org, merez@codeaurora.org, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 5/7] vmxnet3: let core reject the unsupported coalescing parameters Date: Thu, 5 Mar 2020 17:06:00 -0800 Message-Id: <20200306010602.1620354-6-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306010602.1620354-1-kuba@kernel.org> References: <20200306010602.1620354-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 correctly rejects all unsupported parameters. As a side effect of these changes the error code for unsupported params changes from EINVAL to EOPNOTSUPP. Signed-off-by: Jakub Kicinski --- drivers/net/vmxnet3/vmxnet3_ethtool.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 1e4b9ba70983..6528940ce5f3 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -780,27 +780,6 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec) if (!VMXNET3_VERSION_GE_3(adapter)) return -EOPNOTSUPP; - if (ec->rx_coalesce_usecs_irq || - ec->rx_max_coalesced_frames_irq || - ec->tx_coalesce_usecs || - ec->tx_coalesce_usecs_irq || - ec->tx_max_coalesced_frames_irq || - ec->stats_block_coalesce_usecs || - ec->use_adaptive_tx_coalesce || - ec->pkt_rate_low || - ec->rx_coalesce_usecs_low || - ec->rx_max_coalesced_frames_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_coalesce_usecs_high || - ec->tx_max_coalesced_frames_high || - ec->rate_sample_interval) { - return -EINVAL; - } - if ((ec->rx_coalesce_usecs == 0) && (ec->use_adaptive_rx_coalesce == 0) && (ec->tx_max_coalesced_frames == 0) && @@ -891,6 +870,9 @@ vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec) } static const struct ethtool_ops vmxnet3_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS | + ETHTOOL_COALESCE_MAX_FRAMES | + ETHTOOL_COALESCE_USE_ADAPTIVE_RX, .get_drvinfo = vmxnet3_get_drvinfo, .get_regs_len = vmxnet3_get_regs_len, .get_regs = vmxnet3_get_regs, From patchwork Fri Mar 6 01:06:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222962 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 BFE39C3F2D7 for ; Fri, 6 Mar 2020 01:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F1A72073D for ; Fri, 6 Mar 2020 01:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456819; bh=OTtKcRFqA0dHpMGNL6+t5z24seiqfljjuZjgBBCPLfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sOr78Dm9k7HKGm06o3rx8AHZG3kRlMcRpHHdwRB9gcWtNmoKk5qtRwnQjjNE/s3zd J1kRlmukmhvEw3EQ5QzSFHln+hdK0I8h4bowwbKpRQjo8FXKOtL0MB2+thwV3ggjNU s5M6HKHtWeJRLb8JgR67X1e+Fir8kRZCngrEfzks= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgCFBG5 (ORCPT ); Thu, 5 Mar 2020 20:06:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:59594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbgCFBGz (ORCPT ); Thu, 5 Mar 2020 20:06:55 -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 4CF9021739; Fri, 6 Mar 2020 01:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456815; bh=OTtKcRFqA0dHpMGNL6+t5z24seiqfljjuZjgBBCPLfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o6Qjy9P01UiS3cRTUVa8SYuYa2qHdRq6ENqFXfERy7JrO+v0Vys+zs489/8ajnsxC I5LvmiqAv3c7weaJqnT614MpmnsuCGQMJu31+Fjek+tI9ZN9gIzZhH/5GvaQLIRR/p U1iHGRWr1Yw9Y2FZ5yV2ky8AL9hLDWygp4IJXWs4= From: Jakub Kicinski To: davem@davemloft.net Cc: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org, dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, edumazet@google.com, jasowang@redhat.com, mkubecek@suse.cz, hayeswang@realtek.com, doshir@vmware.com, pv-drivers@vmware.com, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, gregkh@linuxfoundation.org, merez@codeaurora.org, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 7/7] wil6210: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:06:02 -0800 Message-Id: <20200306010602.1620354-8-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306010602.1620354-1-kuba@kernel.org> References: <20200306010602.1620354-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/wireless/ath/wil6210/ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/wil6210/ethtool.c b/drivers/net/wireless/ath/wil6210/ethtool.c index fef10886ca4a..e481674485c2 100644 --- a/drivers/net/wireless/ath/wil6210/ethtool.c +++ b/drivers/net/wireless/ath/wil6210/ethtool.c @@ -95,6 +95,7 @@ static int wil_ethtoolops_set_coalesce(struct net_device *ndev, } static const struct ethtool_ops wil_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, .get_drvinfo = cfg80211_get_drvinfo, .get_coalesce = wil_ethtoolops_get_coalesce, .set_coalesce = wil_ethtoolops_set_coalesce,