[dpdk-dev] [PATCH] vhost: flush shadow tx if there is no more	packets
    Eugenio Perez Martin 
    eperezma at redhat.com
       
    Wed Feb  5 16:45:48 CET 2020
    
    
  
Thanks!
On Wed, Feb 5, 2020 at 10:48 AM Maxime Coquelin <maxime.coquelin at redhat.com>
wrote:
>
>
> On 2/4/20 3:47 PM, Eugenio Pérez 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érez <eperezma at redhat.com>
> > ---
> >  lib/librte_vhost/virtio_net.c | 27 ++++++++++++++++++++++++++-
> >  1 file changed, 26 insertions(+), 1 deletion(-)
>
> Applied to dpdk-next-virtio tree.
>
> Thanks,
> Maxime
>
>
    
    
More information about the dev
mailing list