All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Habets <habetsm.xilinx@gmail.com>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	ecree.xilinx@gmail.com, ast@kernel.org, daniel@iogearbox.net,
	hawk@kernel.org, john.fastabend@gmail.com,
	habetsm.xilinx@gmail.com
Subject: Re: [PATCH net v2] net: sfc: add missing xdp queue reinitialization
Date: Fri, 1 Apr 2022 12:06:06 +0100	[thread overview]
Message-ID: <20220401110606.whyr5hnesb4ya67q@gmail.com> (raw)
In-Reply-To: <20220330163703.25086-1-ap420073@gmail.com>

Hi Taehee,

Thanks for looking into this. Unfortunately efx_realloc_channels()
has turned out to be quite fragile over the years, so I'm
keen to remove it in stead of patching it up all the time.

Could you try the patch below please?
If it works ok for you as well we'll be able to remove
efx_realloc_channels(). The added advantage of this approach
is that the netdev notifiers get informed of the change.

Regards,
Martin Habets <habetsm.xilinx@gmail.com>

---
 drivers/net/ethernet/sfc/ethtool.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 48506373721a..8cfbe61737bb 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -179,6 +179,7 @@ efx_ethtool_set_ringparam(struct net_device *net_dev,
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 	u32 txq_entries;
+	int rc = 0;
 
 	if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
 	    ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
@@ -198,7 +199,17 @@ efx_ethtool_set_ringparam(struct net_device *net_dev,
 			   "increasing TX queue size to minimum of %u\n",
 			   txq_entries);
 
-	return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
+	/* Apply the new settings */
+	efx->rxq_entries = ring->rx_pending;
+	efx->txq_entries = ring->tx_pending;
+
+	/* Update the datapath with the new settings if the interface is up */
+	if (!efx_check_disabled(efx) && netif_running(efx->net_dev)) {
+		dev_close(net_dev);
+		rc = dev_open(net_dev, NULL);
+	}
+
+	return rc;
 }
 
 static void efx_ethtool_get_wol(struct net_device *net_dev,

  parent reply	other threads:[~2022-04-01 11:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 16:37 [PATCH net v2] net: sfc: add missing xdp queue reinitialization Taehee Yoo
2022-04-01 11:00 ` patchwork-bot+netdevbpf
2022-04-01 11:06 ` Martin Habets [this message]
2022-04-01 18:48   ` Taehee Yoo
2022-04-04 10:36     ` Martin Habets
2022-04-05  3:16       ` Taehee Yoo

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=20220401110606.whyr5hnesb4ya67q@gmail.com \
    --to=habetsm.xilinx@gmail.com \
    --cc=ap420073@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.