From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C3E5A04FA; Wed, 5 Feb 2020 16:46:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02C1F1C121; Wed, 5 Feb 2020 16:46:33 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id AAC211BFAA for ; Wed, 5 Feb 2020 16:46:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580917591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oyYqiDOPIROG7Mr62jRkz+RthwYCo+r77MiwPspJ954=; b=CSzxhguGz34+etHHAnVEMbVgmXH+x+LbD732TiJyoXORbZyHzu8Kcg1wq+YQOtWeRzWhxL YWLzmEgUdpltOdLwPVMWG3VIgVBfUIOO8JrZfRp5Idc+uEhVt6EGG6O1S95J1c4J56Sm3F WBuXQ/RiJIay2t0iZQ4348pE1liWNhg= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-GyEZc5cVOwWHey4eJGpbcw-1; Wed, 05 Feb 2020 10:46:26 -0500 Received: by mail-qv1-f69.google.com with SMTP id g15so1703020qvq.20 for ; Wed, 05 Feb 2020 07:46:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oyYqiDOPIROG7Mr62jRkz+RthwYCo+r77MiwPspJ954=; b=ii0NiVGUf5FwcPBfs5Jc7Mh5TwY08d8rCvD1MxWhaLn1yMtwenDg3D4bwxJCYPI1Ep DzFDebXULEYwncRYQxjiSj5uUga/34FVtmE20zrkWTMY9WU0d+/CNDUoTcP2VfWhOGuP mf2XcoYZaxHDTqJbtWrT5VpJmNEhrxMGJYaKTw2nE975KCzcAszcIAvdK1Yutf9xBzDB Z/Kx1/OcotnFmKNlR+kYDi3GkRxMsd2xcYY0SwaWwDHlmyilJbQjdu1GMr0Q1G0XPkLJ 5GYgxMLQUsaz91lqqfVhnnST0ptmxGiY+WxBEndyVwCHwRT4ljwhparRkRGXYqz3mNR2 vPJQ== X-Gm-Message-State: APjAAAWbi5hk09nHAGqQccLssbHvRqaGTa78GjtFV5cxmCniGCre9pio RPgQUKZ//6Bzqr/1IGQ1qPGlFnIp7QLXeOBN1oBX8iaVkGbZ+LM7CG1xz6MQDBBm2RXIoMZIIWZ dEDRPT3s6lgwF2qAqZ3g= X-Received: by 2002:a05:620a:1324:: with SMTP id p4mr34148434qkj.497.1580917585582; Wed, 05 Feb 2020 07:46:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxyBCXRAt5TkNKx+vOIXBBMo5BFtd+zSdhMOUCdl+zcH6hxxQ4k/oa3sECIBMl2qjLy9qKdVxubcDp3SnkvAMw= X-Received: by 2002:a05:620a:1324:: with SMTP id p4mr34148417qkj.497.1580917585363; Wed, 05 Feb 2020 07:46:25 -0800 (PST) MIME-Version: 1.0 References: <20200129193310.9157-1-eperezma@redhat.com> In-Reply-To: From: Eugenio Perez Martin Date: Wed, 5 Feb 2020 16:45:48 +0100 Message-ID: To: Maxime Coquelin Cc: dev@dpdk.org, "Liu, Yong" , Maxime Coquelin , Adrian Moreno Zapata , Jason Wang , "Michael S. Tsirkin" X-MC-Unique: GyEZc5cVOwWHey4eJGpbcw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] vhost: flush shadow tx if there is no more packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thanks! On Wed, Feb 5, 2020 at 10:48 AM Maxime Coquelin wrote: > > > On 2/4/20 3:47 PM, Eugenio P=C3=A9rez wrote: > > The current implementation of vhost_net in packed vring tries to fill > > the shadow vector before send any actual changes to the guest. While > > this can be beneficial for the throughput, it conflicts with some > > bufferfloats methods like the linux kernel napi, that stops > > transmitting packets if there are too much bytes/buffers in the > > driver. > > > > To solve it, we flush the shadow packets at the end of > > virtio_dev_tx_packed if we have starved the vring, i.e., the next > > buffer is not available for the device. > > > > Since this last check can be expensive because of the atomic, we only > > check it if we have not obtained the expected (count) packets. If it > > happens to obtain "count" packets and there is no more available > > packets the caller needs to keep call virtio_dev_tx_packed again. > > > > Signed-off-by: Eugenio P=C3=A9rez > > --- > > lib/librte_vhost/virtio_net.c | 27 ++++++++++++++++++++++++++- > > 1 file changed, 26 insertions(+), 1 deletion(-) > > Applied to dpdk-next-virtio tree. > > Thanks, > Maxime > >