Blob Blame History Raw
Reverting the following patch:

From 8d7542cf03abbf25caa2be86fa9e99a3cecbc971 Mon Sep 17 00:00:00 2001
From: Jonathan Toppins <jtoppins@redhat.com>
Date: Tue, 28 Apr 2020 19:08:32 -0400
Subject: [PATCH] [netdrv] ionic: let core reject the unsupported coalescing
 parameters

Message-id: <c642a3d6a4808815176d7a6bef8f94bba2fce80d.1588100139.git.jtoppins@redhat.com>
Patchwork-id: 305678
Patchwork-instance: patchwork
O-Subject: [PATCH RHEL-8.3 48/84] ionic: let core reject the unsupported coalescing parameters
Bugzilla: 1780645
RH-Acked-by: John Linville <linville@redhat.com>
RH-Acked-by: Corinna Vinschen <vinschen@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>

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.

v3: adjust commit message for new error code and member name

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 987b191c16f9b7568a756b0745ee4a93611879ae)
Bugzilla: 1780645
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=28076826
Tested: partner and local testing show driver seems to work as expected
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
 .../net/ethernet/pensando/ionic/ionic_ethtool.c    | 23 +---------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

Index: src/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
===================================================================
--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c	2020-06-28 19:17:55.043944702 +0200
+++ src/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c	2020-06-28 19:18:06.838959767 +0200
@@ -416,6 +416,28 @@
 	unsigned int i;
 	u32 coal;
 
+	if (coalesce->rx_max_coalesced_frames ||
+	    coalesce->rx_coalesce_usecs_irq ||
+	    coalesce->rx_max_coalesced_frames_irq ||
+	    coalesce->tx_max_coalesced_frames ||
+	    coalesce->tx_coalesce_usecs_irq ||
+	    coalesce->tx_max_coalesced_frames_irq ||
+	    coalesce->stats_block_coalesce_usecs ||
+	    coalesce->use_adaptive_rx_coalesce ||
+	    coalesce->use_adaptive_tx_coalesce ||
+	    coalesce->pkt_rate_low ||
+	    coalesce->rx_coalesce_usecs_low ||
+	    coalesce->rx_max_coalesced_frames_low ||
+	    coalesce->tx_coalesce_usecs_low ||
+	    coalesce->tx_max_coalesced_frames_low ||
+	    coalesce->pkt_rate_high ||
+	    coalesce->rx_coalesce_usecs_high ||
+	    coalesce->rx_max_coalesced_frames_high ||
+	    coalesce->tx_coalesce_usecs_high ||
+	    coalesce->tx_max_coalesced_frames_high ||
+	    coalesce->rate_sample_interval)
+		return -EINVAL;
+
 	ident = &lif->ionic->ident;
 	if (ident->dev.intr_coal_div == 0) {
 		netdev_warn(netdev, "bad HW value in dev.intr_coal_div = %d\n",
@@ -766,7 +788,6 @@
 }
 
 static const struct ethtool_ops ionic_ethtool_ops = {
-	.supported_coalesce_params = ETHTOOL_COALESCE_USECS,
 	.get_drvinfo		= ionic_get_drvinfo,
 	.get_regs_len		= ionic_get_regs_len,
 	.get_regs		= ionic_get_regs,