From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 1048E2A07 for ; Tue, 12 May 2015 12:01:41 +0200 (CEST) Received: by wgic8 with SMTP id c8so3048315wgi.1 for ; Tue, 12 May 2015 03:01:41 -0700 (PDT) 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:content-type; bh=Uan+AZoZEng9+DvIBos1nlz9J7Q+b83/G7Fhr8svcDg=; b=fWPx2TMWr42Kipj+Hoit4SliPMnuzRtdi5vHSkjzpNRatmsqUCqr6YfC8bkEXwTXy0 C1gXIFv7MRiPnDpfJAEdvR0L0w8xGmjhJapk5lzF6v7sdcBoi5h0IqiH8lUUrFDdANh0 aZRegMq0byvd1dITNiS2APiD22eRsWxn9albeTmLIlmjAbhaMIqZmE/dOatRDN+2HnUy 1ikuY8JaTtQmda53shcfORl+O2XzNNPGxFCOOpiWYuLddJFNKdltLTF1sLLt+FUGPvzA ORVFlN+ODmvashPtqFu8Ohd5hF+byPLRH9m5oxLtWn94sgqcBuR22f8lqzRms38/O1CA jvlA== X-Gm-Message-State: ALoCoQlTOX0WQkbhsFzJdvGLJgYzKJiE8P6rMAwJZpPYMKPxqFPl/nHAgIfvDO078TJ1YVmM07bC X-Received: by 10.194.86.101 with SMTP id o5mr29235388wjz.8.1431424900897; Tue, 12 May 2015 03:01:40 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id u3sm26917207wjq.36.2015.05.12.03.01.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 03:01:39 -0700 (PDT) From: Thomas Monjalon To: Ouyang Changchun Date: Tue, 12 May 2015 12:00:58 +0200 Message-ID: <29822220.6AADzARei5@xps13> Organization: 6WIND User-Agent: KMail/4.14.7 (Linux/4.0.1-1-ARCH; KDE/4.14.7; x86_64; ; ) In-Reply-To: <1430720780-27525-1-git-send-email-changchun.ouyang@intel.com> References: <1430720780-27525-1-git-send-email-changchun.ouyang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] virtio: Fix enqueue/dequeue can't handle chained vring descriptors. 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, 12 May 2015 10:01:41 -0000 Hi Changchun, Why the title begins with virtio for a patch on vhost? Could you rephrase it in a positive form? 2015-05-04 14:26, Ouyang Changchun: > Vring enqueue need consider the 2 cases: > 1. Vring descriptors chained together, the first one is for virtio header, the rest are for real data; > 2. Only one descriptor, virtio header and real data share one single descriptor; Please explain what was not working before. > So does vring dequeue. > > Signed-off-by: Changchun Ouyang > --- > lib/librte_vhost/vhost_rxtx.c | 60 +++++++++++++++++++++++++++++++------------ > 1 file changed, 44 insertions(+), 16 deletions(-) > > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c > index 510ffe8..3135883 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -59,7 +59,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, 0, 0, 0, 0, 0}, 0}; > uint64_t buff_addr = 0; > uint64_t buff_hdr_addr = 0; > - uint32_t head[MAX_PKT_BURST], packet_len = 0; > + uint32_t head[MAX_PKT_BURST]; > uint32_t head_idx, packet_success = 0; > uint16_t avail_idx, res_cur_idx; > uint16_t res_base_idx, res_end_idx; > @@ -113,6 +113,10 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > rte_prefetch0(&vq->desc[head[packet_success]]); > > while (res_cur_idx != res_end_idx) { > + uint32_t offset = 0; > + uint32_t data_len, len_to_cpy; > + uint8_t plus_hdr = 0; plus_hdr is not very meaningful to me I'm not a vhost expert so I won't review the rest. If nobody comments it in the coming days, it will be accepted.