From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D62B1C43387 for ; Fri, 18 Jan 2019 01:43:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFD6D2086D for ; Fri, 18 Jan 2019 01:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbfARBni (ORCPT ); Thu, 17 Jan 2019 20:43:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfARBni (ORCPT ); Thu, 17 Jan 2019 20:43:38 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B7C6C0C77; Fri, 18 Jan 2019 01:43:38 +0000 (UTC) Received: from redhat.com (ovpn-120-92.rdu2.redhat.com [10.10.120.92]) by smtp.corp.redhat.com (Postfix) with SMTP id 2F62561B6A; Fri, 18 Jan 2019 01:43:37 +0000 (UTC) Date: Thu, 17 Jan 2019 20:43:36 -0500 From: "Michael S. Tsirkin" To: Willem de Bruijn Cc: netdev@vger.kernel.org, davem@davemloft.net, jasowang@redhat.com, Willem de Bruijn , Mark Hlady Subject: Re: [PATCH net-next] virtio-net: per-queue RPS config Message-ID: <20190117204248-mutt-send-email-mst@kernel.org> References: <20190118010853.47325-1-willemdebruijn.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190118010853.47325-1-willemdebruijn.kernel@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Jan 2019 01:43:38 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jan 17, 2019 at 08:08:53PM -0500, Willem de Bruijn wrote: > From: Willem de Bruijn > > 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 > Signed-off-by: Willem de Bruijn 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