From patchwork Fri Mar 6 01:05: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: 11422873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19D9C138D for ; Fri, 6 Mar 2020 01:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E50432073D for ; Fri, 6 Mar 2020 01:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456828; bh=MnSx+bRM3bH2XiO0Bs9afQghY0J5GNchXPkSWXLLq9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SxQWyauoZqrhnOXfCADUaYNrU1ybeyDeZ3dy0ZtLpZUW2IpL3qrX9iuZlZtukIS6B g2c69Mz2dp9FcROEVgPIsUFmVPl4iurYKb+pY2UsHPusGCk+fpgLWBs9LI4GQmr/+I eSPkpFPkv5qQy1vNpdrBe8Oo5UX4wQZvElV/xQ30= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgCFBGt (ORCPT ); Thu, 5 Mar 2020 20:06:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:59296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgCFBGt (ORCPT ); Thu, 5 Mar 2020 20:06:49 -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 AFC6120848; Fri, 6 Mar 2020 01:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456808; bh=MnSx+bRM3bH2XiO0Bs9afQghY0J5GNchXPkSWXLLq9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4gn3Onzd39vjbS4WUY4DHugnMU8BK/REwM4+XVaV2bhs81F9FpAFTN4iLyHcS4hg 3CtL1IEuhYU/zfQ5Plb1Mmdwh1OQfd3aSAgc2/nc8pkE7WCmm/sAk+mfxirK6eCQnA EEF4o4/w1/CFEEEMlSmgL5cfdZbYh5MHI+sGC4IM= 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 1/7] um: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:05:56 -0800 Message-Id: <20200306010602.1620354-2-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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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 Acked-by: Anton Ivanov --- arch/um/drivers/vector_kern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 0ff86391f77d..e98304d0219e 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -1508,6 +1508,7 @@ static int vector_set_coalesce(struct net_device *netdev, } static const struct ethtool_ops vector_net_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_TX_USECS, .get_drvinfo = vector_net_get_drvinfo, .get_link = ethtool_op_get_link, .get_ts_info = ethtool_op_get_ts_info, 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: 11422853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24F79138D for ; Fri, 6 Mar 2020 01:06:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F07D621741 for ; 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=BFAz6k8N2AgaW0pXpCjlxC1XrQ/2bd8PY1PxlDWovR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CN+tk9TtM6OT9iJRk7ulm04gglrVPj/ldqQ1HCeyn5WO51ytdlPOARVCMj2FZfnI7 dqFPQSw62O2nYkbAJqpGiFCSf/fiJK6hb3l2aYZhUkyFl1kv197xdmEirzP0I7Fvn0 60FaOUiryucsIfGo1rmtosgXmDOkbvGE41Kz/IVY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbgCFBGv (ORCPT ); Thu, 5 Mar 2020 20:06:51 -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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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 Reviewed-by: Leon Romanovsky --- 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:05: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: 11422877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFE4314E3 for ; Fri, 6 Mar 2020 01:07:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6CCE2073D for ; Fri, 6 Mar 2020 01:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456829; bh=JMpmxwJdUlOqRtaQwoDet8FowHZ56PTcFV4cVJtkGOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NQQOoa8qZKjXQna+2InNnnZGKfoUvS27DWJhzPF5XkRI35Gmpbd2fE7ri/d6B+Q73 AC+1jEoruCMLtLOYEJhQE+bHjsX92gMSTzr1FCfMARz78Keh3kVseC+FiWEd4ArrOW 1ae6yr6QtRE9ZYHTmJqTgiaFpRIIj9+WKy1v7Q24= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbgCFBHH (ORCPT ); Thu, 5 Mar 2020 20:07:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:59410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgCFBGv (ORCPT ); Thu, 5 Mar 2020 20:06:51 -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 E54E3207FD; Fri, 6 Mar 2020 01:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456810; bh=JMpmxwJdUlOqRtaQwoDet8FowHZ56PTcFV4cVJtkGOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVhxekQRZCVenUOrQTlnnNNa+rkp4xQ0U00iB1fJ08/7lJJyy79tmX3IYK151JCmJ y3b4lABh4rvmEJnLaJQJ8jpnia2I+2uwC2LTQXjgc3hOAh6p4DUXFqRsn2JVEPqfbL eKovMfGDEXjbry8wIJi1rABjvXeRmvo5uZsEkG4k= 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 3/7] tun: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:05:58 -0800 Message-Id: <20200306010602.1620354-4-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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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 Acked-by: Jason Wang --- drivers/net/tun.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 79f248cb282d..9e8f23519e82 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -3597,6 +3597,7 @@ static int tun_set_coalesce(struct net_device *dev, } static const struct ethtool_ops tun_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_RX_MAX_FRAMES, .get_drvinfo = tun_get_drvinfo, .get_msglevel = tun_get_msglevel, .set_msglevel = tun_set_msglevel, From patchwork Fri Mar 6 01:05:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 11422865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDCAF1395 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 A521D2073D 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=t6+kueVIWNtLUqViCk3MdqFhB51exWacT2hvYbn4hoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rfghkH07ynNYmmxn69NN9C+KZHEc/oB9B7nL6SbEilVCf+mElfE/i7ZVvbMbOlA0l DMnBUB+Kz+sCKbbdlRX0C+SuHDNgqGwA9XWcrukOQGyjh15BB/ts2czKuvnhbZPxUP fjFDMQT3ZDaS7ZowGFyKrI2o+AFwQVtwXFQ8C6as= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgCFBG4 (ORCPT ); Thu, 5 Mar 2020 20:06:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:59474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbgCFBGw (ORCPT ); Thu, 5 Mar 2020 20:06:52 -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 080BE21556; Fri, 6 Mar 2020 01:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456811; bh=t6+kueVIWNtLUqViCk3MdqFhB51exWacT2hvYbn4hoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xdk2QAQZ24xQ+XNnceK3ptrcg2bWbXOcr9edHCgW/cXLqloNOsBzFBFHkh9fZ17u/ UTSOplONajI9FemA3ollW3gpdBxDi42uXizDTyOzUnVChUfYu9ictQzzt1NcQhxxKi mlXYnjjf8vCnK3wYVfT27cEmWiwwbI1lNXUchhlQ= 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 4/7] r8152: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:05:59 -0800 Message-Id: <20200306010602.1620354-5-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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index b8d2722a1b33..f27fdd6ab86f 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -6345,6 +6345,7 @@ static int rtl8152_set_ringparam(struct net_device *netdev, } static const struct ethtool_ops ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, .get_drvinfo = rtl8152_get_drvinfo, .get_link = ethtool_op_get_link, .nway_reset = rtl8152_nway_reset, 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: 11422857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3F21138D for ; Fri, 6 Mar 2020 01:06:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95D332073D for ; Fri, 6 Mar 2020 01:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456816; bh=T6cn0wHytPI/i5tO/aLymuIVcVVaOSY4AMgguxIiZ6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rzcjhvZkjkOCFcY5uhKxq1tapDtmuJbZOleEoyatoWrLEI0uDcx8muYE2Iehblhyd AwZxKqZMT3EzyizK6fgAZh0p1AA8IsHPg86sQR/sbx+zjuczBkzdAH8DlsNlQlCeED FtzrKcYLXuKFW+nAHq5vdOQkpBAyGdJfRe62BmJ4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgCFBGz (ORCPT ); Thu, 5 Mar 2020 20:06:55 -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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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: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: 11422871 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5A5E1395 for ; Fri, 6 Mar 2020 01:07:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CB68207FD for ; Fri, 6 Mar 2020 01:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456826; bh=RM7eXOLghBAxQOombdSNP2dy3sQBpkjdvLa0D3I5Dyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=L9xi0jIUFQMJlCOtqGUz5xbxWzWc/f1IoMKt7NQBWjEywRRg4EvEDDmG+ojWE76kv eKEybfncXizegCnrDUNJ8aR9RFodQwAIK8VFWjOqzGBQGf/+2FTF8X8ygsYsABLQ/K sWE67LGRofWhu+0uNXcDBgMYm2win/dyIWzP4u3o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbgCFBG4 (ORCPT ); Thu, 5 Mar 2020 20:06:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:59554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgCFBGy (ORCPT ); Thu, 5 Mar 2020 20:06:54 -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 35ED52166E; 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=1583456814; bh=RM7eXOLghBAxQOombdSNP2dy3sQBpkjdvLa0D3I5Dyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bcn4aEmn6bdLy0jeeEaeMUpU/remFlYp2vgolj4RincgisqfFU4CEObnwDDWJfkXF I9FhD5DBaK11ROE+9WHsVbpX/6YaAwm8hgayvhrcPeuwu+7s57NsL0vip2x5TultwU jsVJO4cG3fiOZD4dHEPaEI3jSr7o7OfEOHtq63Kw= 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 6/7] staging: qlge: reject unsupported coalescing params Date: Thu, 5 Mar 2020 17:06:01 -0800 Message-Id: <20200306010602.1620354-7-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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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/staging/qlge/qlge_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlge_ethtool.c index 790997aff995..050c0da23c6f 100644 --- a/drivers/staging/qlge/qlge_ethtool.c +++ b/drivers/staging/qlge/qlge_ethtool.c @@ -714,6 +714,8 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) } const struct ethtool_ops qlge_ethtool_ops = { + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | + ETHTOOL_COALESCE_MAX_FRAMES, .get_drvinfo = ql_get_drvinfo, .get_wol = ql_get_wol, .set_wol = ql_set_wol, 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: 11422869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C131D1395 for ; Fri, 6 Mar 2020 01:07:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9794A2073D for ; Fri, 6 Mar 2020 01:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583456825; bh=OTtKcRFqA0dHpMGNL6+t5z24seiqfljjuZjgBBCPLfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tV5Zv1uyVxgH1gacvsLaDudBVbGOP0J9COqqmv35NQeLDBc6o82mkeNEyonQQ4qa3 jipHz0Cs+JSzJkJ+cHMNiTIypR6iy6eyvM12yQ6YnyAetOci7WvcTkBFAarmvXqh8a TtJ5TI9DFk23Dc8QG4+xSArUFtdYhsEwXrkQdLAU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbgCFBG4 (ORCPT ); Thu, 5 Mar 2020 20:06:56 -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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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 Acked-by: Kalle Valo --- 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,