From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com
 [209.85.192.169]) by dpdk.org (Postfix) with ESMTP id EAF635A51
 for <dev@dpdk.org>; Thu, 28 May 2015 16:50:27 +0200 (CEST)
Received: by pdfh10 with SMTP id h10so43381939pdf.3
 for <dev@dpdk.org>; Thu, 28 May 2015 07:50:27 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-type:content-transfer-encoding;
 bh=IAUCKorwtH+KlBRm5lRQZAJZl8IlgkxM2Smuk9NZluQ=;
 b=LRdpcOPTXwmep3wfBmzQyybXlmgFY6a1LneZHplKB89/XqjBHwOphSBWzIdjqo+gVY
 ZOMGIOqs+S574wIz8dVKDBiNbs0h3MaQ800mFiYpD7OoyH7HjBB+QFqgEbnF4phxo4m6
 F7mrMtT8Idc2O22iATlIO654/+jI0qArP36JGGaF7gNPAk4N6L+upxnzKLcMIB10TVUT
 rqVAUJJhmXoyD0Qi5OTt70BQqfkw4biUA63aNM/XWb1s0msvkGhYiXehlAIhn2pZQHBy
 x3s/LXSN8i8fMda78C5YAEP8t8nIIcUcb2AnLI7dv3jPMKbz2ghJUOfp18qX6cN0i6m1
 Zngg==
X-Gm-Message-State: ALoCoQk/Aecwd5YHxu6Gr/9kJ20RseFwczpIzyiqxpM1LV0A15m1LjDmGRHFu3avn10y9H9p2mbP
X-Received: by 10.68.136.101 with SMTP id pz5mr6099189pbb.15.1432824627213;
 Thu, 28 May 2015 07:50:27 -0700 (PDT)
Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net.
 [50.53.82.155])
 by mx.google.com with ESMTPSA id fh9sm2667202pdb.17.2015.05.28.07.50.26
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 28 May 2015 07:50:26 -0700 (PDT)
Date: Thu, 28 May 2015 07:50:30 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Wei li <liw@dtdream.com>
Message-ID: <20150528075030.7ad1a9d4@urahara>
In-Reply-To: <8975cbf4-0f4d-4da4-8e45-6b75629072e1@liw0310-PC.local>
References: <8975cbf4-0f4d-4da4-8e45-6b75629072e1@liw0310-PC.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost: tcp pkt with virtio header in one desc
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 28 May 2015 14:50:28 -0000

On Thu, 28 May 2015 16:19:44 +0800
Wei li <liw@dtdream.com> wrote:

> +		if (desc->flags & VRING_DESC_F_NEXT)
> +		{
> +			/* Discard first buffer as it is the virtio header */
> +			desc = &vq->desc[desc->next];
> +			vb_offset = 0;
> +			vb_avail = desc->len;
> +		}
> +		else /* virtio header in one desc with real pkt */
> +		{
> +			/* strip the virtio header */
> +			vb_offset = vq->vhost_hlen;
> +			vb_avail = desc->len - vq->vhost_hlen;
> +
This code looks correct, but please follow the same style as
other code in the driver. The virtio driver uses Linux/BSD
style:
	if () {
	} else {
	}