netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeroen de Borst <jeroendb@google.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org,
	Catherine Sullivan <csully@google.com>,
	David Awogbemila <awogbemila@google.com>
Subject: [PATCH net-next v2 5/7] gve: Add netif_set_xps_queue call
Date: Mon, 11 Oct 2021 08:36:48 -0700	[thread overview]
Message-ID: <20211011153650.1982904-6-jeroendb@google.com> (raw)
In-Reply-To: <20211011153650.1982904-1-jeroendb@google.com>

From: Catherine Sullivan <csully@google.com>

Configure XPS when adding tx queues to the notification blocks.

Fixes: dbdaa67540512 ("gve: Move some static functions to a common file")
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
---
 drivers/net/ethernet/google/gve/gve_utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/google/gve/gve_utils.c b/drivers/net/ethernet/google/gve/gve_utils.c
index 93f3dcbeeea9..45ff7a9ab5f9 100644
--- a/drivers/net/ethernet/google/gve/gve_utils.c
+++ b/drivers/net/ethernet/google/gve/gve_utils.c
@@ -18,12 +18,16 @@ void gve_tx_remove_from_block(struct gve_priv *priv, int queue_idx)
 
 void gve_tx_add_to_block(struct gve_priv *priv, int queue_idx)
 {
+	unsigned int active_cpus = min_t(int, priv->num_ntfy_blks / 2,
+					 num_online_cpus());
 	int ntfy_idx = gve_tx_idx_to_ntfy(priv, queue_idx);
 	struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
 	struct gve_tx_ring *tx = &priv->tx[queue_idx];
 
 	block->tx = tx;
 	tx->ntfy_id = ntfy_idx;
+	netif_set_xps_queue(priv->dev, get_cpu_mask(ntfy_idx % active_cpus),
+			    queue_idx);
 }
 
 void gve_rx_remove_from_block(struct gve_priv *priv, int queue_idx)
-- 
2.33.0.882.g93a45727a2-goog

v2: Unchanged

  parent reply	other threads:[~2021-10-11 15:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 15:36 [PATCH net-next v2 0/7] gve: minor code and performance improvements Jeroen de Borst
2021-10-11 15:36 ` [PATCH net-next v2 1/7] gve: Switch to use napi_complete_done Jeroen de Borst
2021-10-11 15:36 ` [PATCH net-next v2 2/7] gve: Add rx buffer pagecnt bias Jeroen de Borst
2021-10-11 15:36 ` [PATCH net-next v2 3/7] gve: Do lazy cleanup in TX path Jeroen de Borst
2021-10-11 15:36 ` [PATCH net-next v2 4/7] gve: Recover from queue stall due to missed IRQ Jeroen de Borst
2021-10-11 15:36 ` Jeroen de Borst [this message]
2021-10-11 15:36 ` [PATCH net-next v2 6/7] gve: Allow pageflips on larger pages Jeroen de Borst
2021-10-11 15:36 ` [PATCH net-next v2 7/7] gve: Track RX buffer allocation failures Jeroen de Borst
2021-10-11 22:30 ` [PATCH net-next v2 0/7] gve: minor code and performance improvements patchwork-bot+netdevbpf

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=20211011153650.1982904-6-jeroendb@google.com \
    --to=jeroendb@google.com \
    --cc=awogbemila@google.com \
    --cc=csully@google.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).