From patchwork Fri Mar 13 04:07:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222586 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 896BFC2BAEE for ; Fri, 13 Mar 2020 04:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 613392074F for ; Fri, 13 Mar 2020 04:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072490; bh=1S7BggD83DfdIDiyl7AP5ZpDCpRAUb3It0ehgPYL5L8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ghglosuNBTWwSiYcZpOe9BUYCgP+TS3A1ShlfBuCdTdeiaSG3AjlMFYXxeDtagvJE bTnAtlRjPgTdw/BPtbhTqEHSiQnLen4gMvldR5BWnnyQdbBUHcDcLXIfnArYd9r97P LacmZ5lfL5fXPQ+KAYcFqed4FaMqSv5jBg+UvcH8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbgCMEII (ORCPT ); Fri, 13 Mar 2020 00:08:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgCMEIH (ORCPT ); Fri, 13 Mar 2020 00:08:07 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 4241A2073B; Fri, 13 Mar 2020 04:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072487; bh=1S7BggD83DfdIDiyl7AP5ZpDCpRAUb3It0ehgPYL5L8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mfhn8Cwh0U4K6AlQNVq5VXcYbTw2koqmAqlzJhOR1tqnkWWwb18isskn+unWCdKuw bmOmEhp8J+4h7fDkjIY7/L1PSpxlE/R/0I2NOzY9ZXQoG/al4d9jaLOMO7jdIswtCl bHqsBg5X6lF6OIC5KYXNimq38vbp6Fzwkpt2N4yw= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 02/15] net: mv643xx_eth: reject unsupported coalescing params Date: Thu, 12 Mar 2020 21:07:50 -0700 Message-Id: <20200313040803.2367590-3-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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/marvell/mv643xx_eth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 3c8125cbc84d..81d24481b22c 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -1737,6 +1737,7 @@ static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset) } static const struct ethtool_ops mv643xx_eth_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, .get_drvinfo = mv643xx_eth_get_drvinfo, .nway_reset = phy_ethtool_nway_reset, .get_link = ethtool_op_get_link, From patchwork Fri Mar 13 04:07:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222585 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 DBA0DC2BAEE for ; Fri, 13 Mar 2020 04:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B098820752 for ; Fri, 13 Mar 2020 04:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072493; bh=YvGbiYZe1CiL3jvPlYKr6izRPvPZIXuAV1bOFUxA8zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EeoK+BJdaIpLrIS7VVbIP4DVRQYzeSy1WAKLrad6FkPjMsLMPy1lT8cxQV/KeCj6t 6TGJHp6o+txJgEv6C/YsjSXqeTXMY3pm2eW8cAAwEcYjauNabs1UUQOrJD3METpS0J +jd13IZN+UXVpo3X+nC1V4PjOu9Nsjn+cQ0cnSbg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgCMEIK (ORCPT ); Fri, 13 Mar 2020 00:08:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:39022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgCMEIK (ORCPT ); Fri, 13 Mar 2020 00:08:10 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 87F4920746; Fri, 13 Mar 2020 04:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072489; bh=YvGbiYZe1CiL3jvPlYKr6izRPvPZIXuAV1bOFUxA8zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHHOtoLkmoE5HsBlsXcuB6V1LbdWCnMUD9aV6Ynw6AdhFrPEKySd353h4QRt2u7Bs XwxJAAjar4k1FJDxrOsoKDBAZy39hvOuATTQtoSBGgnje0tlOs9upQu0dbXoLD+q4v IQsGT5ZKOs5Gx0/QAjqZ/cPLpZzsEjbpqvK0meZM= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 04/15] net: mvpp2: reject unsupported coalescing params Date: Thu, 12 Mar 2020 21:07:52 -0700 Message-Id: <20200313040803.2367590-5-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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/marvell/mvpp2/mvpp2_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 6b9c7ed2547e..1fa60e985b43 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -4384,6 +4384,8 @@ static const struct net_device_ops mvpp2_netdev_ops = { }; static const struct ethtool_ops mvpp2_eth_tool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .nway_reset = mvpp2_ethtool_nway_reset, .get_link = ethtool_op_get_link, .set_coalesce = mvpp2_ethtool_set_coalesce, From patchwork Fri Mar 13 04:07:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222584 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 6813DC5ACBF for ; Fri, 13 Mar 2020 04:08:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D39820752 for ; Fri, 13 Mar 2020 04:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072495; bh=xmWw3hyDhsas59JXMdvsr35LodVu6+YY6+iNUhoyZJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FEj4c8dPQCd4BF/ZN2KWZ5A3neQSFQm5RVfpDwZKk87D3URCNLyX7CeoPlYDZPg3y 07DK/eTNGJqM/ny/jWLVVc/TfQjD9UW0hvbiAUSszbcCMh+qYluVGB3cIVeryztTzd uaU2ca3OqVkFpkZ5unKwtrWKJATUkUJlsbPui8oE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbgCMEIN (ORCPT ); Fri, 13 Mar 2020 00:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgCMEIM (ORCPT ); Fri, 13 Mar 2020 00:08:12 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 CDFFB2074F; Fri, 13 Mar 2020 04:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072491; bh=xmWw3hyDhsas59JXMdvsr35LodVu6+YY6+iNUhoyZJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zrBcWbUUQbgRBu5sNWKmji7TAZebmN5y7yJingN1sERDzXpLzJNLjhD2zksBQcbRX grvISIS/VunV52yrpZRwV0H4877Vtnmdf9dXyDIGt1JOknAeMJku/Jue+LtiuKeco3 Z+Wuk9ClmAGN3GzcL+t2E8RXmeumpyqdg9HD1T8U= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 06/15] net: skge: reject unsupported coalescing params Date: Thu, 12 Mar 2020 21:07:54 -0700 Message-Id: <20200313040803.2367590-7-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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/marvell/skge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 97f270d30cce..3c89206f18a7 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -876,6 +876,7 @@ static int skge_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom } static const struct ethtool_ops skge_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, .get_drvinfo = skge_get_drvinfo, .get_regs_len = skge_get_regs_len, .get_regs = skge_get_regs, From patchwork Fri Mar 13 04:07:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222583 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 D8714C10DCE for ; Fri, 13 Mar 2020 04:08:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A35222076E for ; Fri, 13 Mar 2020 04:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072500; bh=UrMKga/V8DEYfdyI8CU2OKFx4XZVeiokRyo8KuMXiiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=z1f+vjer9mKzBOMD90axREmnqwX4Yk8eTpHzsDO7wYs57bvjXI5aei0oHlX2bZl0F 5N8ZJfkQVo55rU+6nC6QHIAnUMzO5oGjdVbSCsRO1NRi9yQueroT7LpKLgnu4u1W15 5WJApVXY6a0TEq/dzHnuC6rU9XDowu55WRym1yz8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbgCMEIT (ORCPT ); Fri, 13 Mar 2020 00:08:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgCMEIO (ORCPT ); Fri, 13 Mar 2020 00:08:14 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 1D4B42073E; Fri, 13 Mar 2020 04:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072494; bh=UrMKga/V8DEYfdyI8CU2OKFx4XZVeiokRyo8KuMXiiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fPI2sapt0qQ4VKpqJbaKl29MfJG77DZetaNAIYerZGxiQva+WsG6Lq0ecI1Shc1iM nXxT8ITLqX/BwkLMgkLoegOMbq9R/ZaalMXwDBWoe9lD4wY37c8NhdMA3FVMrgWcYP YSXcOhJKaPwSn6/+pS+oS6r5xficCw25kyhN8ncI= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 08/15] net: myri10ge: reject unsupported coalescing params Date: Thu, 12 Mar 2020 21:07:56 -0700 Message-Id: <20200313040803.2367590-9-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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/myricom/myri10ge/myri10ge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index 2ee0d0be113a..2616fd735aab 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -1920,6 +1920,7 @@ myri10ge_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state) } static const struct ethtool_ops myri10ge_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS, .get_drvinfo = myri10ge_get_drvinfo, .get_coalesce = myri10ge_get_coalesce, .set_coalesce = myri10ge_set_coalesce, From patchwork Fri Mar 13 04:07:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222582 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 85678C2BB1D for ; Fri, 13 Mar 2020 04:08:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C60320771 for ; Fri, 13 Mar 2020 04:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072504; bh=P7nDgmfu0Mi1kzjATtYotef52CzNEI9Oajed06rlfew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GPo4MnvBmbTC/fUoIWyar1YNzoL2w0tH9qcF63Ck1s4ZC2gIilCaxH+xta2JlM6k6 R+R2pvDzvu77vx7uonY577cCfRE5Nw/JSOw92tFz05qD2emNCecxylI23Njq3jA2mD JWO40+z7uztFqaKHh1YOzOhpucDhtJl/q5EHGCOY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbgCMEIW (ORCPT ); Fri, 13 Mar 2020 00:08:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:39292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbgCMEIQ (ORCPT ); Fri, 13 Mar 2020 00:08:16 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 5D61D20767; Fri, 13 Mar 2020 04:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072496; bh=P7nDgmfu0Mi1kzjATtYotef52CzNEI9Oajed06rlfew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOAwt0LRGqk9fENOoVZo0hjJ2jGvWkCX6/xy/Ti9B4rTa2nEQN36lUHrGIwFtSKA3 uo5uXFbUuTLjwDUcRM7QVfPQfnFog4/HIjQT9PfqRPNSFhcfu1TN/PNwx58zrxhFrT 7lONlhz4HR17upSceJLS6nsT9KJw5+o+1WKNTUPA= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 10/15] net: netxen: let core reject the unsupported coalescing parameters Date: Thu, 12 Mar 2020 21:07:58 -0700 Message-Id: <20200313040803.2367590-11-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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. As a side effect of these changes the error code for unsupported params changes from EINVAL to EOPNOTSUPP. The driver was missing a check for rate_sample_interval. Signed-off-by: Jakub Kicinski --- .../qlogic/netxen/netxen_nic_ethtool.c | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c index 6a2d91d58968..66f45fce90fa 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c @@ -748,24 +748,7 @@ static int netxen_set_intr_coalesce(struct net_device *netdev, if (ethcoal->rx_coalesce_usecs > 0xffff || ethcoal->rx_max_coalesced_frames > 0xffff || ethcoal->tx_coalesce_usecs > 0xffff || - ethcoal->tx_max_coalesced_frames > 0xffff || - ethcoal->rx_coalesce_usecs_irq || - ethcoal->rx_max_coalesced_frames_irq || - ethcoal->tx_coalesce_usecs_irq || - ethcoal->tx_max_coalesced_frames_irq || - ethcoal->stats_block_coalesce_usecs || - ethcoal->use_adaptive_rx_coalesce || - ethcoal->use_adaptive_tx_coalesce || - ethcoal->pkt_rate_low || - ethcoal->rx_coalesce_usecs_low || - ethcoal->rx_max_coalesced_frames_low || - ethcoal->tx_coalesce_usecs_low || - ethcoal->tx_max_coalesced_frames_low || - ethcoal->pkt_rate_high || - ethcoal->rx_coalesce_usecs_high || - ethcoal->rx_max_coalesced_frames_high || - ethcoal->tx_coalesce_usecs_high || - ethcoal->tx_max_coalesced_frames_high) + ethcoal->tx_max_coalesced_frames > 0xffff) return -EINVAL; if (!ethcoal->rx_coalesce_usecs || @@ -923,6 +906,8 @@ netxen_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump, } const struct ethtool_ops netxen_nic_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = netxen_nic_get_drvinfo, .get_regs_len = netxen_nic_get_regs_len, .get_regs = netxen_nic_get_regs, From patchwork Fri Mar 13 04:08: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: 222580 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 C929FC2BAEE for ; Fri, 13 Mar 2020 04:08:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A20FD20772 for ; Fri, 13 Mar 2020 04:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072512; bh=0xI/uHXF1lhRINtJVBujQs9WaAJjHtytOZIL9WGBnYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sHhrjgruEITDvOUAsAsQOqO9C4ioeufQT0KYNSRzGWiYXRAUav42nlDeWx9Awx1H2 je12nfdVSusKs9AVn0heqHXCfCroA6pDzvuHycWYXK1UO87itNROJDWdDifBa/AEPL SUhl9q4z2cD8kBSB3wPs/vo/r9/spYG3/7yc0b2g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgCMEIb (ORCPT ); Fri, 13 Mar 2020 00:08:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:39354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgCMEIT (ORCPT ); Fri, 13 Mar 2020 00:08:19 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 E512520768; Fri, 13 Mar 2020 04:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072498; bh=0xI/uHXF1lhRINtJVBujQs9WaAJjHtytOZIL9WGBnYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xb9uL6dRY/lp2l62/iYgEmyDR4yDWN/rtmsoNZuDTIU1Ih02i5Lj62sVxB3+ljBQZ ZbPs+SC0s7uPKA7FLCDchV1urtg330FZeQbz4pAxs4Q3D1vE4Z7zdQ8TCVVj9EZ1Yr jlhooGNhH8ntpipY9FBwN39fmmJvuJaTPCwW3Q0g= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 12/15] net: qlnic: let core reject the unsupported coalescing parameters Date: Thu, 12 Mar 2020 21:08:00 -0700 Message-Id: <20200313040803.2367590-13-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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 almost all unsupported parameters (missing sample_rate_interval). As a side effect of these changes the error code for unsupported params changes from EINVAL to EOPNOTSUPP. Signed-off-by: Jakub Kicinski --- .../ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 75d83c3cbf27..5c2a3acf1e89 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c @@ -1542,24 +1542,7 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev, if (ethcoal->rx_coalesce_usecs > 0xffff || ethcoal->rx_max_coalesced_frames > 0xffff || ethcoal->tx_coalesce_usecs > 0xffff || - ethcoal->tx_max_coalesced_frames > 0xffff || - ethcoal->rx_coalesce_usecs_irq || - ethcoal->rx_max_coalesced_frames_irq || - ethcoal->tx_coalesce_usecs_irq || - ethcoal->tx_max_coalesced_frames_irq || - ethcoal->stats_block_coalesce_usecs || - ethcoal->use_adaptive_rx_coalesce || - ethcoal->use_adaptive_tx_coalesce || - ethcoal->pkt_rate_low || - ethcoal->rx_coalesce_usecs_low || - ethcoal->rx_max_coalesced_frames_low || - ethcoal->tx_coalesce_usecs_low || - ethcoal->tx_max_coalesced_frames_low || - ethcoal->pkt_rate_high || - ethcoal->rx_coalesce_usecs_high || - ethcoal->rx_max_coalesced_frames_high || - ethcoal->tx_coalesce_usecs_high || - ethcoal->tx_max_coalesced_frames_high) + ethcoal->tx_max_coalesced_frames > 0xffff) return -EINVAL; err = qlcnic_config_intr_coalesce(adapter, ethcoal); @@ -1834,6 +1817,8 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) } const struct ethtool_ops qlcnic_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = qlcnic_get_drvinfo, .get_regs_len = qlcnic_get_regs_len, .get_regs = qlcnic_get_regs, @@ -1865,6 +1850,8 @@ const struct ethtool_ops qlcnic_ethtool_ops = { }; const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = qlcnic_get_drvinfo, .get_regs_len = qlcnic_get_regs_len, .get_regs = qlcnic_get_regs, From patchwork Fri Mar 13 04:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 222581 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 27C72C2BAEE for ; Fri, 13 Mar 2020 04:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB0FF20773 for ; Fri, 13 Mar 2020 04:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072507; bh=dkZKIFK8OauPtRrJxJuomj+0UAlE1oiopGaNWm2pFT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A7dGqBesz5BtDgyHI1+1w0zVBWlmwN+bd2RLAR+PNlD4Fd3eLWW1FagDTMrawsxkv 2r9J6FLhBxOM9ngJ1b3EsU1QxotgvIi9G6koKZ0jfHAaUpwa3nolCo0ehxtNWDTl7K UbOuiut23lBAGNz4vcbxrDTOKMECMlokrua+K21k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbgCMEIZ (ORCPT ); Fri, 13 Mar 2020 00:08:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:39384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbgCMEIU (ORCPT ); Fri, 13 Mar 2020 00:08:20 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (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 05BD82076C; Fri, 13 Mar 2020 04:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584072499; bh=dkZKIFK8OauPtRrJxJuomj+0UAlE1oiopGaNWm2pFT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IISBR18hxoxls2EQ0irVBH+yTCdGvcGqbOhZ1CUk7SPshEHsA2Vp8m1ADUh1jCm4s Pk3e9KMFNKYV1Dgdq9aXrJl43gWPRtvTEyr4Kj8PEKwpoEyeALyDOu+XCFJz3WFsfG KBbPm+p2FBh3iaQqsEd6DziZIAcO0IlP+JYPmth0= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, kernel-team@fb.com, cooldavid@cooldavid.org, sebastian.hesselbarth@gmail.com, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, rmk+kernel@armlinux.org.uk, mcroce@redhat.com, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, mlindner@marvell.com, stephen@networkplumber.org, christopher.lee@cspi.com, manishc@marvell.com, rahulv@marvell.com, GR-Linux-NIC-Dev@marvell.com, aelior@marvell.com, GR-everest-linux-l2@marvell.com, shshaikh@marvell.com, nic_swsd@realtek.com, hkallweit1@gmail.com, bh74.an@samsung.com, romieu@fr.zoreil.com Subject: [PATCH net-next 13/15] net: r8169: reject unsupported coalescing params Date: Thu, 12 Mar 2020 21:08:01 -0700 Message-Id: <20200313040803.2367590-14-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313040803.2367590-1-kuba@kernel.org> References: <20200313040803.2367590-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/realtek/r8169_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index ce030e093485..d2eef3754b33 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2006,6 +2006,8 @@ static int rtl8169_set_eee(struct net_device *dev, struct ethtool_eee *data) } static const struct ethtool_ops rtl8169_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = rtl8169_get_drvinfo, .get_regs_len = rtl8169_get_regs_len, .get_link = ethtool_op_get_link,