From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D55255A57 for ; Wed, 4 Nov 2015 14:15:13 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 04 Nov 2015 05:15:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,243,1444719600"; d="scan'208";a="678156551" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 04 Nov 2015 05:15:03 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 4 Nov 2015 05:15:03 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.57]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.160]) with mapi id 14.03.0248.002; Wed, 4 Nov 2015 21:15:01 +0800 From: "Liu, Jijiang" To: "Liu, Jijiang" , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX offload Thread-Index: AQHRFu89DSl6C3bBZkC4lqvvuDZDwp6LMNoAgACb7zCAAAia8IAAAWGw Date: Wed, 4 Nov 2015 13:15:00 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE90@SHSMSX101.ccr.corp.intel.com> References: <1446634456-413-1-git-send-email-jijiang.liu@intel.com> <1446634456-413-7-git-send-email-jijiang.liu@intel.com> <2611781.I9AKvK5K3K@xps13> <1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE6F@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BCFE6F@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" , "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH v3 6/8] driver/virtio:enqueue vhost TX offload 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: Wed, 04 Nov 2015 13:15:14 -0000 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 f= illed. For TSO, the 'gso_type', 'hdr_len' and 'csum_offset' fileds need to be fill= ed. > -----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 >=20 >=20 >=20 > > -----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 patc= h set. >=20 > Got it. You copy the codes from vhost side here for the comparison. The v= 3 is > latest. >=20 > > > > > > + parse_ethernet(m, &l4_proto, &l4_hdr); > > > > + if (hdr->flags =3D=3D VIRTIO_NET_HDR_F_NEEDS_CSUM) { > > > > + if ((hdr->csum_start =3D=3D m->l2_len) && > > > > + (hdr->csum_offset =3D=3D offsetof(struct ipv4_hdr, > > > > + hdr_checksum))) > > > > + m->ol_flags |=3D PKT_TX_IP_CKSUM; > > > > + else if (hdr->csum_start =3D=3D (m->l2_len + m->l3_len)) { > > > > + switch (hdr->csum_offset) { > > > > + case (offsetof(struct tcp_hdr, cksum)): > > > > + if (l4_proto =3D=3D IPPROTO_TCP) > > > > + m->ol_flags |=3D PKT_TX_TCP_CKSUM; > > > > + break; > > > > + case (offsetof(struct udp_hdr, dgram_cksum)): > > > > + if (l4_proto =3D=3D IPPROTO_UDP) > > > > + m->ol_flags |=3D PKT_TX_UDP_CKSUM; > > > > + break; > > > > + case (offsetof(struct sctp_hdr, cksum)): > > > > + if (l4_proto =3D=3D IPPROTO_SCTP) > > > > + m->ol_flags |=3D 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.