DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Liu, Jijiang" <jijiang.liu@intel.com>
To: "Liu, Jijiang" <jijiang.liu@intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX offload
Date: Wed, 4 Nov 2015 13:15:00 +0000	[thread overview]
Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE90@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE6F@SHSMSX101.ccr.corp.intel.com>

The following structure  is defined in virtio standard,

struct virtio_net_hdr {
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1
u8 flags;
#define VIRTIO_NET_HDR_GSO_NONE 0
#define VIRTIO_NET_HDR_GSO_TCPV4 1
#define VIRTIO_NET_HDR_GSO_UDP 3
#define VIRTIO_NET_HDR_GSO_TCPV6 4
#define VIRTIO_NET_HDR_GSO_ECN 0x80
u8 gso_type;
le16 hdr_len;
le16 gso_size;
le16 csum_start;
le16 csum_offset;
le16 num_buffers;
};

For checksum. The 'flags', ' csum_start' and csum_offset filed need to be filled.

For TSO, the 'gso_type', 'hdr_len' and 'csum_offset' fileds need to be filled.


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Liu, Jijiang
> Sent: Wednesday, November 4, 2015 9:08 PM
> To: Thomas Monjalon
> Cc: dev@dpdk.org; Michael S. Tsirkin
> Subject: Re: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX
> offload
> 
> 
> 
> > -----Original Message-----
> > From: Liu, Jijiang
> > Sent: Wednesday, November 4, 2015 8:52 PM
> > To: 'Thomas Monjalon'
> > Cc: dev@dpdk.org; Michael S. Tsirkin
> > Subject: RE: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX
> > offload
> >
> > Hi Thomas,
> >
> >
> > > -----Original Message-----
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > Sent: Wednesday, November 4, 2015 7:18 PM
> > > To: Liu, Jijiang
> > > Cc: dev@dpdk.org; Michael S. Tsirkin
> > > Subject: Re: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost
> >
> >
> > The following code is not in the patch 6, please review the latest patch set.
> 
> Got it. You copy the codes from vhost side here for the comparison. The v3 is
> latest.
> 
> >
> > > > +	parse_ethernet(m, &l4_proto, &l4_hdr);
> > > > +	if (hdr->flags == VIRTIO_NET_HDR_F_NEEDS_CSUM) {
> > > > +		if ((hdr->csum_start == m->l2_len) &&
> > > > +			(hdr->csum_offset == offsetof(struct ipv4_hdr,
> > > > +						hdr_checksum)))
> > > > +			m->ol_flags |= PKT_TX_IP_CKSUM;
> > > > +		else if (hdr->csum_start == (m->l2_len + m->l3_len)) {
> > > > +			switch (hdr->csum_offset) {
> > > > +			case (offsetof(struct tcp_hdr, cksum)):
> > > > +				if (l4_proto == IPPROTO_TCP)
> > > > +					m->ol_flags |= PKT_TX_TCP_CKSUM;
> > > > +				break;
> > > > +			case (offsetof(struct udp_hdr, dgram_cksum)):
> > > > +				if (l4_proto == IPPROTO_UDP)
> > > > +					m->ol_flags |= PKT_TX_UDP_CKSUM;
> > > > +				break;
> > > > +			case (offsetof(struct sctp_hdr, cksum)):
> > > > +				if (l4_proto == IPPROTO_SCTP)
> > > > +					m->ol_flags |= PKT_TX_SCTP_CKSUM;
> > > > +				break;
> > > > +			default:
> > > > +				break;
> > > > +			}
> > > > +		}
> > >
> > > The kernel doesn't work this way.
> > > Please could you check that your virtio implementation works with a
> > vanilla
> > > Linux with or without vhost?
> > > Thanks
> >
> > This is vhost lib implementation, not virtio-net side.
> > We have already validated with a vanilla Linux with or without
> > virtio-net, and it passed.
> > Could you please review latest patch v3?
> >
> > Xu Qian can send the test report out.

  reply	other threads:[~2015-11-04 13:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 10:54 [dpdk-dev] [PATCH v3 0/8] add vhost TX offload support Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 1/8] driver/virtio:add virtual addr for virtio net header Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 2/8] driver/virtio: record virtual address of " Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 3/8] driver/virtio:add vhost TX checksum support capability in virtio-net Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 4/8] driver/virtio:fill virtio device info for TX offload Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 5/8] driver/virtio:enqueue vhost " Jijiang Liu
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 6/8] " Jijiang Liu
2015-11-04 11:17   ` Thomas Monjalon
2015-11-04 12:52     ` Liu, Jijiang
2015-11-04 13:18       ` Thomas Monjalon
2015-11-05  8:49         ` Xu, Qian Q
2015-11-05  9:02           ` Thomas Monjalon
2015-11-05 10:44             ` Xu, Qian Q
2015-11-06  8:24               ` Xu, Qian Q
2015-11-04 13:06     ` Liu, Jijiang
2015-11-04 13:08     ` Liu, Jijiang
2015-11-04 13:15       ` Liu, Jijiang [this message]
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 7/8] lib/librte_vhost:dequeue " Jijiang Liu
2015-11-09  4:00   ` Yuanhan Liu
2015-11-09  5:27     ` Liu, Jijiang
2015-11-04 10:54 ` [dpdk-dev] [PATCH v3 8/8] examples/vhost:support TX offload in vhost sample Jijiang Liu
2015-11-09  4:17   ` Yuanhan Liu
2015-11-09  8:17     ` Liu, Jijiang
2015-11-09  8:51       ` Yuanhan Liu
2015-11-09  8:18     ` Liu, Jijiang
2015-11-11  6:47     ` Liu, Jijiang
2015-11-04 11:14 ` [dpdk-dev] [PATCH v3 0/8] add vhost TX offload support Tan, Jianfeng
2015-11-05 14:24   ` Glynn, Michael J
  -- strict thread matches above, loose matches on Subject: below --
2015-11-04  8:35 Jijiang Liu
2015-11-04  8:35 ` [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX offload 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=1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE90@SHSMSX101.ccr.corp.intel.com \
    --to=jijiang.liu@intel.com \
    --cc=dev@dpdk.org \
    --cc=mst@redhat.com \
    --cc=thomas.monjalon@6wind.com \
    /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).