netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: mkubecek@suse.cz, netdev@vger.kernel.org,
	simon.horman@netronome.com, kernel-team@fb.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 3/3] ethtool: don't call set_channels in drivers if config didn't change
Date: Fri, 15 May 2020 12:49:02 -0700	[thread overview]
Message-ID: <20200515194902.3103469-4-kuba@kernel.org> (raw)
In-Reply-To: <20200515194902.3103469-1-kuba@kernel.org>

Don't call drivers if nothing changed. Netlink code already
contains this logic.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/ethtool/ioctl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index a574d60111fa..eeb1137a3f23 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1669,6 +1669,12 @@ static noinline_for_stack int ethtool_set_channels(struct net_device *dev,
 
 	dev->ethtool_ops->get_channels(dev, &curr);
 
+	if (channels.rx_count == curr.rx_count &&
+	    channels.tx_count == curr.tx_count &&
+	    channels.combined_count == curr.combined_count &&
+	    channels.other_count == curr.other_count)
+		return 0;
+
 	/* ensure new counts are within the maximums */
 	if (channels.rx_count > curr.max_rx ||
 	    channels.tx_count > curr.max_tx ||
-- 
2.25.4


  parent reply	other threads:[~2020-05-15 19:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 19:48 [PATCH net-next 0/3] ethtool: set_channels: add a few more checks Jakub Kicinski
2020-05-15 19:49 ` [PATCH net-next 1/3] ethtool: check if there is at least one channel for TX/RX in the core Jakub Kicinski
2020-05-15 20:56   ` Michal Kubecek
2020-05-15 22:26     ` Jakub Kicinski
2020-05-15 19:49 ` [PATCH net-next 2/3] nfp: don't check lack of RX/TX channels Jakub Kicinski
2020-05-15 20:59   ` Michal Kubecek
2020-05-18 11:44   ` Simon Horman
2020-05-15 19:49 ` Jakub Kicinski [this message]
2020-05-15 21:01   ` [PATCH net-next 3/3] ethtool: don't call set_channels in drivers if config didn't change Michal Kubecek
2020-05-16 20:56 ` [PATCH net-next 0/3] ethtool: set_channels: add a few more checks David Miller
2020-05-16 21:13   ` Michal Kubecek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200515194902.3103469-4-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).