DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Liu, Jijiang" <jijiang.liu@intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC PATCH 5/8] lib/librte_vhost:dequeue vhost TSO	offload
Date: Mon, 7 Sep 2015 06:16:06 +0000	[thread overview]
Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC057D9881@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F962511CEF004@shsmsx102.ccr.corp.intel.com>



> -----Original Message-----
> From: Ouyang, Changchun
> Sent: Monday, August 31, 2015 8:40 PM
> To: Liu, Jijiang; dev@dpdk.org
> Cc: Ouyang, Changchun
> Subject: RE: [dpdk-dev] [RFC PATCH 5/8] lib/librte_vhost:dequeue vhost TSO
> offload
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jijiang Liu
> > Sent: Monday, August 31, 2015 5:42 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [RFC PATCH 5/8] lib/librte_vhost:dequeue vhost TSO
> > offload
> >
> > Dequeue vhost TSO offload
> >
> > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
> > ---
> >  lib/librte_vhost/vhost_rxtx.c |   29 ++++++++++++++++++++++++++++-
> >  1 files changed, 28 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/librte_vhost/vhost_rxtx.c
> > b/lib/librte_vhost/vhost_rxtx.c index 0d07338..9adfdb1 100644
> > --- a/lib/librte_vhost/vhost_rxtx.c
> > +++ b/lib/librte_vhost/vhost_rxtx.c
> > @@ -545,6 +545,30 @@ rte_vhost_enqueue_burst(struct virtio_net *dev,
> > uint16_t queue_id,
> >  		return virtio_dev_rx(dev, queue_id, pkts, count);  }
> >
> > +static inline void __attribute__((always_inline))
> > +vhost_dequeue_offload(uint64_t addr, struct rte_mbuf *m) {
> > +	struct virtio_net_hdr *hdr =
> > +		(struct virtio_net_hdr *)((uintptr_t)addr);
> > +
> > +	if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
> > +		switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
> > +		case VIRTIO_NET_HDR_GSO_TCPV4:
> > +			m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_TCP_SEG);
> > +			m->tso_segsz = hdr->gso_size;
> > +			break;
> > +		case VIRTIO_NET_HDR_GSO_TCPV6:
> > +			m->ol_flags |= (PKT_TX_IPV6 | PKT_TX_TCP_SEG);
> > +			m->tso_segsz = hdr->gso_size;
> > +			break;
> > +		default:
> > +			RTE_LOG(ERR, VHOST_DATA,
> > +				"bad gso type %u.\n", hdr->gso_type);
> > +			break;
> 
> Do we need special handling for the bad gso type?
Yes, we need return error, and log it and break this operation.

I will change it in next version.

> 
> > +		}
> > +	}
> > +}
> > +
> >  uint16_t
> >  rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id,
> >  	struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t
> > count) @@ -553,6 +577,7 @@ rte_vhost_dequeue_burst(struct virtio_net
> > *dev, uint16_t queue_id,
> >  	struct vhost_virtqueue *vq;
> >  	struct vring_desc *desc;
> >  	uint64_t vb_addr = 0;
> > +	uint64_t vb_net_hdr_addr = 0;
> >  	uint32_t head[MAX_PKT_BURST];
> >  	uint32_t used_idx;
> >  	uint32_t i;
> > @@ -604,6 +629,8 @@ rte_vhost_dequeue_burst(struct virtio_net *dev,
> > uint16_t queue_id,
> >
> >  		desc = &vq->desc[head[entry_success]];
> >
> > +		vb_net_hdr_addr = gpa_to_vva(dev, desc->addr);
> > +
> >  		/* Discard first buffer as it is the virtio header */
> >  		if (desc->flags & VRING_DESC_F_NEXT) {
> >  			desc = &vq->desc[desc->next];
> > @@ -742,7 +769,7 @@ rte_vhost_dequeue_burst(struct virtio_net *dev,
> > uint16_t queue_id,
> >  			break;
> >
> >  		m->nb_segs = seg_num;
> > -
> > +		vhost_dequeue_offload(vb_net_hdr_addr, m);
> >  		pkts[entry_success] = m;
> >  		vq->last_used_idx++;
> >  		entry_success++;
> > --
> > 1.7.7.6

  reply	other threads:[~2015-09-07  6:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31  9:41 [dpdk-dev] [RFC PATCH 0/8] Add vhost TSO capability Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 1/8] driver/virtio:add vhost TSO support capability Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 2/8] driver/virtio: add virtual addr for virtio net header Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 3/8] driver/virtio: record virtual address of " Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 4/8] driver/virtio:enqueue TSO offload Jijiang Liu
2015-09-01  3:28   ` Ouyang, Changchun
2015-09-07  6:11     ` Liu, Jijiang
2015-09-09  1:17       ` Ouyang, Changchun
2015-09-09 17:21         ` Liu, Jijiang
2015-09-09 23:03           ` Ouyang, Changchun
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 5/8] lib/librte_vhost:dequeue vhost " Jijiang Liu
2015-09-01  3:40   ` Ouyang, Changchun
2015-09-07  6:16     ` Liu, Jijiang [this message]
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 6/8] lib/librte_vhost:extend supported vhost features Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 7/8] examples/vhost:support tso in vhost sample Jijiang Liu
2015-08-31  9:41 ` [dpdk-dev] [RFC PATCH 8/8] app/testpmd: modify the mac of csum forwarding Jijiang Liu

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=1ED644BD7E0A5F4091CF203DAFB8E4CC057D9881@SHSMSX101.ccr.corp.intel.com \
    --to=jijiang.liu@intel.com \
    --cc=changchun.ouyang@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).