From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH] virtio: make udp more efficient by avoiding indirect desc Date: Thu, 13 Feb 2014 13:27:44 +1030 Message-ID: <87a9dvg1nb.fsf@rustcorp.com.au> References: <52FA3AAC.2050003@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael S. Tsirkin" , jasowang@redhat.com, KVM list To: Qin Chuanyu Return-path: Received: from ozlabs.org ([203.10.76.45]:48310 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbaBMEk6 (ORCPT ); Wed, 12 Feb 2014 23:40:58 -0500 In-Reply-To: <52FA3AAC.2050003@huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: Qin Chuanyu writes: > udp packet use 2 buffers at least, one for vnet_hdr and > one for skb->data. > we could change the threshold from 2 to 3, so the udp packet > which data buff only using single desc will gain from this. > the guest would avoid from allocating memory dynamically. > the host would avoid from translating indirect desc. > > Signed-off-by: Chuanyu Qin We should really adapt the threshold depending on how full the ring is. If it's gotten cramped recently, prefer indirect. See linux/average.h. Such a change would have to be benchmarked carefully though! Cheers, Rusty.