DPDK patches and discussions
 help / color / mirror / Atom feed
From: Huawei Xie <huawei.xie@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v5 05/11] lib/librte_vhost: merge Oliver's mbuf change
Date: Fri, 26 Sep 2014 17:45:52 +0800	[thread overview]
Message-ID: <1411724758-27488-6-git-send-email-huawei.xie@intel.com> (raw)
In-Reply-To: <1411724758-27488-1-git-send-email-huawei.xie@intel.com>

There is no rte_pktmbuf structure in mbuf now. Its fields are merged to
rte_mbuf structure.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
 lib/librte_vhost/vhost_rxtx.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index 81368e6..688e661 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -145,7 +145,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, struct rte_mbuf **pkts,
 		/* Copy mbuf data to buffer */
 		/* TODO fixme for sg mbuf and the case that desc couldn't hold the mbuf data */
 		rte_memcpy((void *)(uintptr_t)buff_addr,
-			(const void *)buff->pkt.data,
+			rte_pktmbuf_mtod(buff, const void *),
 			rte_pktmbuf_data_len(buff));
 		VHOST_PRINT_PACKET(dev, (uintptr_t)buff_addr,
 			rte_pktmbuf_data_len(buff), 0);
@@ -307,7 +307,7 @@ copy_from_mbuf_to_vring(struct virtio_net *dev, uint16_t res_base_idx,
 			 * This current segment complete, need continue to
 			 * check if the whole packet complete or not.
 			 */
-			pkt = pkt->pkt.next;
+			pkt = pkt->next;
 			if (pkt != NULL) {
 				/*
 				 * There are more segments.
@@ -411,7 +411,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, struct rte_mbuf *
 		uint32_t secure_len = 0;
 		uint16_t need_cnt;
 		uint32_t vec_idx = 0;
-		uint32_t pkt_len = pkts[pkt_idx]->pkt.pkt_len + vq->vhost_hlen;
+		uint32_t pkt_len = pkts[pkt_idx]->pkt_len + vq->vhost_hlen;
 		uint16_t i, id;
 
 		do {
@@ -631,8 +631,8 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 				 * while the virtio buffer in TX vring has
 				 * more data to be copied.
 				 */
-				cur->pkt.data_len = seg_offset;
-				m->pkt.pkt_len += seg_offset;
+				cur->data_len = seg_offset;
+				m->pkt_len += seg_offset;
 				/* Allocate mbuf and populate the structure. */
 				cur = rte_pktmbuf_alloc(mbuf_pool);
 				if (unlikely(cur == NULL)) {
@@ -644,7 +644,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 				}
 
 				seg_num++;
-				prev->pkt.next = cur;
+				prev->next = cur;
 				prev = cur;
 				seg_offset = 0;
 				seg_avail = cur->buf_len - RTE_PKTMBUF_HEADROOM;
@@ -660,8 +660,8 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 						 * room to accomodate more
 						 * data.
 						 */
-						cur->pkt.data_len = seg_offset;
-						m->pkt.pkt_len += seg_offset;
+						cur->data_len = seg_offset;
+						m->pkt_len += seg_offset;
 						/*
 						 * Allocate an mbuf and
 						 * populate the structure.
@@ -678,7 +678,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 							break;
 						}
 						seg_num++;
-						prev->pkt.next = cur;
+						prev->next = cur;
 						prev = cur;
 						seg_offset = 0;
 						seg_avail = cur->buf_len - RTE_PKTMBUF_HEADROOM;
@@ -697,8 +697,8 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 						desc->len, 0);
 				} else {
 					/* The whole packet completes. */
-					cur->pkt.data_len = seg_offset;
-					m->pkt.pkt_len += seg_offset;
+					cur->data_len = seg_offset;
+					m->pkt_len += seg_offset;
 					vb_avail = 0;
 				}
 			}
@@ -709,7 +709,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, struct rte_me
 		if (unlikely(alloc_err == 1))
 			break;
 
-		m->pkt.nb_segs = seg_num;
+		m->nb_segs = seg_num;
 
 		pkts[entry_success] = m;
 		vq->last_used_idx++;
-- 
1.8.1.4

  parent reply	other threads:[~2014-09-26  9:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26  9:45 [dpdk-dev] [PATCH v5 00/11] user space vhost library and vhost example Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 01/11] lib/librte_vhost: move src files in vhost example to vhost lib directory Huawei Xie
2014-09-29 19:41   ` Thomas Monjalon
2014-09-30  2:07     ` Xie, Huawei
2014-09-30  4:35       ` Thomas Monjalon
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 02/11] lib/librte_vhost: refactor vhost lib for subsequent transform Huawei Xie
2014-09-29 19:55   ` Thomas Monjalon
2014-09-29 20:00     ` Thomas Monjalon
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 03/11] lib/librte_vhost: vhost lib transform Huawei Xie
2014-09-29 19:51   ` Thomas Monjalon
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 04/11] lib/librte_vhost: merge vhost merge-able rx. merge vhost tx fix Huawei Xie
2014-09-26  9:45 ` Huawei Xie [this message]
2014-09-29 19:44   ` [dpdk-dev] [PATCH v5 05/11] lib/librte_vhost: merge Oliver's mbuf change Thomas Monjalon
     [not found]     ` <C37D651A908B024F974696C65296B57B0F2AF2C0@SHSMSX101.ccr.corp.intel.com>
2014-09-30  3:41       ` Ouyang, Changchun
2014-09-30  4:46       ` Thomas Monjalon
2014-09-30  6:43         ` Xie, Huawei
2014-09-30  8:06           ` Thomas Monjalon
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 06/11] lib/librte_vhost: fixes serious coding style issues Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 07/11] lib/librte_vhost: add vhost support in DPDK makefile Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 08/11] examples/vhost: copy old vhost example src file Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 09/11] examples/vhost: vhost example based on vhost lib API Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 10/11] examples/vhost: merge oliver's mbuf changes to vhost example Huawei Xie
2014-09-26  9:45 ` [dpdk-dev] [PATCH v5 11/11] examples/vhost: add vhost example Makefile Huawei Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411724758-27488-6-git-send-email-huawei.xie@intel.com \
    --to=huawei.xie@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).