From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 0/8] vhost rxtx refactor and fixes Date: Tue, 15 Mar 2016 00:09:34 +0100 Message-ID: <11391281.sayWs830Ni@xps13> References: <1455803352-5518-1-git-send-email-yuanhan.liu@linux.intel.com> <1457584366-3036-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, huawei.xie@intel.com, Rich Lane To: Yuanhan Liu Return-path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 63BD52C62 for ; Tue, 15 Mar 2016 00:10:59 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id l68so122013358wml.0 for ; Mon, 14 Mar 2016 16:10:59 -0700 (PDT) In-Reply-To: <1457584366-3036-1-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-03-10 12:32, Yuanhan Liu: > v3: - quite few minor changes, including using likely/unlikely > when possible. > > - Added a new patch 8 to avoid desc dead loop chain > > The first 3 patches refactor 3 major functions at vhost_rxtx.c. > It simplifies the code logic, making it more readable. OTOH, it > reduces binary code size, due to a lot of duplicate code are > removed, as well as some huge inline functions are diminished. > > Patch 4 gets rid of the rte_memcpy for virtio_hdr copy, which > nearly saves 12K bytes of binary code size! > > Patch 5 removes "unlikely" for VIRTIO_NET_F_MRG_RXBUF detection. > > Patch 6, 7 and 8 do some sanity check for two desc fields, to make > vhost robust and be protected from malicious guest or abnormal use > cases. > > --- > Yuanhan Liu (8): > vhost: refactor rte_vhost_dequeue_burst > vhost: refactor virtio_dev_rx > vhost: refactor virtio_dev_merge_rx > vhost: do not use rte_memcpy for virtio_hdr copy > vhost: don't use unlikely for VIRTIO_NET_F_MRG_RXBUF detection > vhost: do sanity check for desc->len > vhost: do sanity check for desc->next against with vq->size > vhost: avoid dead loop chain. Applied with 3/8 v4, thanks.