netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jasowang@redhat.com,
	Willem de Bruijn <willemb@google.com>,
	Mark Hlady <mhlady@google.com>
Subject: Re: [PATCH net-next] virtio-net: per-queue RPS config
Date: Thu, 17 Jan 2019 20:43:36 -0500	[thread overview]
Message-ID: <20190117204248-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190118010853.47325-1-willemdebruijn.kernel@gmail.com>

On Thu, Jan 17, 2019 at 08:08:53PM -0500, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> On multiqueue network devices, RPS maps are configured independently
> for each receive queue through /sys/class/net/$DEV/queues/rx-*.
> 
> On virtio-net currently all packets use the map from rx-0, because the
> real rx queue is not known at time of map lookup by get_rps_cpu.
> 
> Call skb_record_rx_queue in the driver rx path to make lookup work.
> 
> Recording the receive queue has ramifications beyond RPS, such as in
> sticky load balancing decisions for sockets (skb_tx_hash) and XPS.
> 
> Reported-by: Mark Hlady <mhlady@google.com>
> Signed-off-by: Willem de Bruijn <willemb@google.com>

And any examples how to see the benefit of this?


> ---
>  drivers/net/virtio_net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 0237250860467..236ba5d5fb4bb 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1035,6 +1035,7 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
>  		goto frame_err;
>  	}
>  
> +	skb_record_rx_queue(skb, vq2rxq(rq->vq));
>  	skb->protocol = eth_type_trans(skb, dev);
>  	pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
>  		 ntohs(skb->protocol), skb->len, skb->pkt_type);
> -- 
> 2.20.1.321.g9e740568ce-goog

  reply	other threads:[~2019-01-18  1:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  1:08 [PATCH net-next] virtio-net: per-queue RPS config Willem de Bruijn
2019-01-18  1:43 ` Michael S. Tsirkin [this message]
2019-01-18  3:37   ` Willem de Bruijn
2019-01-18  3:59     ` Michael S. Tsirkin
2019-01-18  3:49 ` Jason Wang
2019-01-19 18:05 ` David Miller

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=20190117204248-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=mhlady@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.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).