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 70D18C43387 for ; Fri, 18 Jan 2019 03:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3499D20850 for ; Fri, 18 Jan 2019 03:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbfARDtt (ORCPT ); Thu, 17 Jan 2019 22:49:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfARDts (ORCPT ); Thu, 17 Jan 2019 22:49:48 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A82A57AEA1; Fri, 18 Jan 2019 03:49:48 +0000 (UTC) Received: from [10.72.12.162] (ovpn-12-162.pek2.redhat.com [10.72.12.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6073D5D6AA; Fri, 18 Jan 2019 03:49:42 +0000 (UTC) Subject: Re: [PATCH net-next] virtio-net: per-queue RPS config To: Willem de Bruijn , netdev@vger.kernel.org Cc: davem@davemloft.net, mst@redhat.com, Willem de Bruijn , Mark Hlady References: <20190118010853.47325-1-willemdebruijn.kernel@gmail.com> From: Jason Wang Message-ID: Date: Fri, 18 Jan 2019 11:49:39 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190118010853.47325-1-willemdebruijn.kernel@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 18 Jan 2019 03:49:48 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019/1/18 上午9:08, 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 > --- > 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); Acked-by: Jason Wang