From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=ULXlKSkbFuPi/xZc53xYlJ0MA/sm/m/G170w8/fkfs4=; b=GrLgZ9DJu6qfzicAWZOh5iZ84nYzcPyvgaI96+sUZSxAHVRRaaByam5H6pbIdJAff4 yHnwhZn5yhUc0GKHc2MRi74DfPBZVo0kybFU0nQ0buch+lFkPCy3dHt+tp0ltqBYLkPJ 5PzHXZolJm+A61aYelPm1gZ4gXKCgPgIEgaZl6xpmhaQXeHXtLVcPR1UQkZgaGAva1m3 5rF3KbllgC6hgES/+KRT9AGQPvFd/713usqbFJsT4qjUtRQhS020S8QOx+fy449oJGE/ ej2o121RSMvzCGra1Jjgmc+efFFFlnqk7alHjA9Zl3pD1hsS1lpZNtC+XiRbhygJArpE tOtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=ULXlKSkbFuPi/xZc53xYlJ0MA/sm/m/G170w8/fkfs4=; b=QyoBXgWBT0pAQJRT1iVUlui5W3ugK32YbSzCfGCuW+9cLVKBdOC0+JIbAot/8MSXnX F9ZYSpf6IJ/Y11orrwxMPLfTSQUzYaRZg/xxFRJZJk6EPtEJIixs/Zw16jevT73xup2W rke7aRdOEi2KW9SU7NAjQErwWBC65sF6pqx11C3HoMjO0cGvFa/C14eRh8f8n/BUZb0e 1WzZB0zUJAyVzojLlEWSLzVcLwYPtMRnVIOiq+bIv4CS080ZhA0EvDTMlWsKRwBtXmxT 8oH7+Y5r6ITI4upIMR38s24P7jHMqRytQwcS0gQU1ZpWGwVkV9Pb4uG7REe/P3+LpP3L l9Aw== X-Gm-Message-State: AD7BkJKkZtC0yHmxY+U2pam9KqCPCMpj7CBXAWmXJJKJHW5kr0mXX9+cLpa0HOI0OzDTtMgy X-Received: by 10.28.186.214 with SMTP id k205mr20834078wmf.23.1457997059245; Mon, 14 Mar 2016 16:10:59 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id ux5sm24196991wjc.17.2016.03.14.16.10.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2016 16:10:58 -0700 (PDT) From: Thomas Monjalon To: Yuanhan Liu Cc: dev@dpdk.org, huawei.xie@intel.com, Rich Lane Date: Tue, 15 Mar 2016 00:09:34 +0100 Message-ID: <11391281.sayWs830Ni@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1457584366-3036-1-git-send-email-yuanhan.liu@linux.intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 0/8] vhost rxtx refactor and fixes 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: Mon, 14 Mar 2016 23:10:59 -0000 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.