From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f49.google.com (mail-vk0-f49.google.com [209.85.213.49]) by dpdk.org (Postfix) with ESMTP id A61A1C31E for ; Tue, 10 May 2016 23:49:43 +0200 (CEST) Received: by mail-vk0-f49.google.com with SMTP id f66so34155174vkh.2 for ; Tue, 10 May 2016 14:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bigswitch-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=0Nd3s05ydukWRuQvAIP6YkB57tych6D3WaYJJIsqOwQ=; b=P+PrzTnL/9NcRdbycwxQiPj9eCPn//KWPhPjhrWs3GGAt1UK6iZMQfBVJYRyP/HHSB WfdWoszVfWi+X2fXATtw3HgybdfohXdA69bqAVk/uoDZykvCGGeFma+4ITB49Oax6PZi vDLV6X9eUQEYljNMoxP0DmLgdV5blVnTIyuPQC6IJqGLXfB1WFtKxhP3IPIsbHXMfvaQ XxyZcmfSjKq5Z6FcGPj5T8h3bkd+5xLR0HGFwgU0QEV3MPqYKVIYrVJ+2rdbs0nvtFhA jwk88z0nedHaIMTFyyVKwpjgZxyi+bjha1lIiHbeDYSLaGeU9cMr29hHMPB2QB6QdH8t jo8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=0Nd3s05ydukWRuQvAIP6YkB57tych6D3WaYJJIsqOwQ=; b=NCMHKGi/v9Ltkfr+FXopBR6mKF9rCw8EMn4iCgROFXRYhFPGxZk5Z/tyo7NZ3RPsvr snKNOALhpjfN03futCcPmPjWEyLjXNqzGpEC7yvP6zkcypn7OUniY2CQ/szkSPusIUyK 1FKNS2LQDYQFTO5XWZSu02hRRwZmaoMzuEkbBXyQRNzfAHK0GrszoZgL5AbtS8NGzWpI 0gigKZslzHWh7fGLuPjI/yw2zLPnBoOo9naW6nVyX1XiGz+Fu1HqgNJDZA0mBopjrq0f 72V7TvqopjzlBS/qHvBoOjCE20MFKbFWwXdlqtNgosBVDuveehadXi/eRYrgOBrbA05g whjw== X-Gm-Message-State: AOPr4FVNhpwy0GEw3wEd10ot55ntMwRKDIrDXa2DfJRI4lCwg4f+1aiotu+qFxdlAaG45SOGx5P3O2pIgLCOVldv MIME-Version: 1.0 X-Received: by 10.176.7.10 with SMTP id h10mr25239227uah.40.1462916983101; Tue, 10 May 2016 14:49:43 -0700 (PDT) Received: by 10.31.190.14 with HTTP; Tue, 10 May 2016 14:49:43 -0700 (PDT) In-Reply-To: <1462236378-7604-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1462236378-7604-1-git-send-email-yuanhan.liu@linux.intel.com> Date: Tue, 10 May 2016 14:49:43 -0700 Message-ID: From: Rich Lane To: Yuanhan Liu Cc: dev@dpdk.org, "huawei.xie" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 0/3] [RFC] vhost: micro vhost optimization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 21:49:44 -0000 I see a significant performance improvement with these patches, around 5% at 64 bytes. The one patch that didn't give any performance boost for me was "vhost: arrange virtio_net fields for better cache sharing". Tested-by: Rich Lane On Mon, May 2, 2016 at 5:46 PM, Yuanhan Liu wrote: > Here is a small patch set does the micro optimization, which brings about > 10% performance boost in my 64B packet testing, with the following topo: > > pkt generator <----> NIC <-----> Virtio NIC > > Patch 1 pre updates the used ring and update them in batch. It should be > feasible from my understanding: there will be no issue, guest driver will > not start processing them as far as we haven't updated the "used->idx" > yet. I could miss something though. > > Patch 2 saves one check for small packets (that can be hold in one desc > buf and mbuf). > > Patch 3 moves several frequently used fields into one cache line, for > better cache sharing. > > Note that this patch set is based on my latest vhost ABI refactoring > patchset. > > > --- > Yuanhan Liu (3): > vhost: pre update used ring for Tx and Rx > vhost: optimize dequeue for small packets > vhost: arrange virtio_net fields for better cache sharing > > lib/librte_vhost/vhost-net.h | 8 +-- > lib/librte_vhost/vhost_rxtx.c | 110 > ++++++++++++++++++++++++------------------ > 2 files changed, 68 insertions(+), 50 deletions(-) > > -- > 1.9.0 > >