Message ID | 1447224046-1169-8-git-send-email-jijiang.liu@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1E0C08E92; Wed, 11 Nov 2015 07:41:11 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D48538E8B for <dev@dpdk.org>; Wed, 11 Nov 2015 07:41:08 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 10 Nov 2015 22:41:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,274,1444719600"; d="scan'208";a="682755882" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2015 22:41:08 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tAB6f52N027479; Wed, 11 Nov 2015 14:41:05 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tAB6f3bO001253; Wed, 11 Nov 2015 14:41:05 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tAB6f3gR001249; Wed, 11 Nov 2015 14:41:03 +0800 From: Jijiang Liu <jijiang.liu@intel.com> To: dev@dpdk.org Date: Wed, 11 Nov 2015 14:40:45 +0800 Message-Id: <1447224046-1169-8-git-send-email-jijiang.liu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1447224046-1169-1-git-send-email-jijiang.liu@intel.com> References: <1447224046-1169-1-git-send-email-jijiang.liu@intel.com> Subject: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload capabilities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Jijiang Liu
Nov. 11, 2015, 6:40 a.m. UTC
Add virtio guest offload capabilities.
Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
lib/librte_vhost/virtio-net.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
Comments
On Wed, Nov 11, 2015 at 02:40:45PM +0800, Jijiang Liu wrote: > Add virtio guest offload capabilities. > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > --- > lib/librte_vhost/virtio-net.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > index 81bd309..839a333 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; > (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \ > (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ > (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ > - (1ULL << VIRTIO_NET_F_CSUM)) > + (1ULL << VIRTIO_NET_F_CSUM) | \ > + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ > + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ > + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) I don't think we need that, and it might be wrong to set those fields at vhost. And, TBH, I am not 100% sure that I understand what those flags truely are and for. All I know is that they seem have something to do with QEMU/TAP device. Hopefully the virtio expert, Michael, could shine some lights on that. --yliu > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > -- > 1.7.7.6
> -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Wednesday, November 11, 2015 4:31 PM > To: Liu, Jijiang; Michael S. Tsirkin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload > capabilities > > On Wed, Nov 11, 2015 at 02:40:45PM +0800, Jijiang Liu wrote: > > Add virtio guest offload capabilities. > > > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > --- > > lib/librte_vhost/virtio-net.c | 5 ++++- > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > diff --git a/lib/librte_vhost/virtio-net.c > > b/lib/librte_vhost/virtio-net.c index 81bd309..839a333 100644 > > --- a/lib/librte_vhost/virtio-net.c > > +++ b/lib/librte_vhost/virtio-net.c > > @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; > > (1ULL << > VHOST_USER_F_PROTOCOL_FEATURES) | \ > > (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ > > (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ > > - (1ULL << VIRTIO_NET_F_CSUM)) > > + (1ULL << VIRTIO_NET_F_CSUM) | \ > > + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ > > + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ > > + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) > > I don't think we need that, and it might be wrong to set those fields at vhost. > > And, TBH, I am not 100% sure that I understand what those flags truely are > and for. All I know is that they seem have something to do with QEMU/TAP > device. According to virtio standard, those fileds should be set. Yes, I'd like to listen other guys comments. > Hopefully the virtio expert, Michael, could shine some lights on that. > > --yliu > > > > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > -- > > 1.7.7.6
On Wed, Nov 11, 2015 at 08:38:29AM +0000, Liu, Jijiang wrote: > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > Sent: Wednesday, November 11, 2015 4:31 PM > > To: Liu, Jijiang; Michael S. Tsirkin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload > > capabilities > > > > On Wed, Nov 11, 2015 at 02:40:45PM +0800, Jijiang Liu wrote: > > > Add virtio guest offload capabilities. > > > > > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > > --- > > > lib/librte_vhost/virtio-net.c | 5 ++++- > > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > > > diff --git a/lib/librte_vhost/virtio-net.c > > > b/lib/librte_vhost/virtio-net.c index 81bd309..839a333 100644 > > > --- a/lib/librte_vhost/virtio-net.c > > > +++ b/lib/librte_vhost/virtio-net.c > > > @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; > > > (1ULL << > > VHOST_USER_F_PROTOCOL_FEATURES) | \ > > > (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ > > > (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ > > > - (1ULL << VIRTIO_NET_F_CSUM)) > > > + (1ULL << VIRTIO_NET_F_CSUM) | \ > > > + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) > > > > I don't think we need that, and it might be wrong to set those fields at vhost. > > > > And, TBH, I am not 100% sure that I understand what those flags truely are > > and for. All I know is that they seem have something to do with QEMU/TAP > > device. > > According to virtio standard, those fileds should be set. If so, you'd better quote them here, or even to your patch commit. --yliu > Yes, I'd like to listen other guys comments. > > > Hopefully the virtio expert, Michael, could shine some lights on that. > > > > --yliu > > > > > > > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > > > -- > > > 1.7.7.6
> -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Wednesday, November 11, 2015 4:44 PM > To: Liu, Jijiang > Cc: Michael S. Tsirkin; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload > capabilities > > On Wed, Nov 11, 2015 at 08:38:29AM +0000, Liu, Jijiang wrote: > > > > > > > -----Original Message----- > > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > > Sent: Wednesday, November 11, 2015 4:31 PM > > > To: Liu, Jijiang; Michael S. Tsirkin > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest > > > offload capabilities > > > > > > On Wed, Nov 11, 2015 at 02:40:45PM +0800, Jijiang Liu wrote: > > > > Add virtio guest offload capabilities. > > > > > > > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > > > --- > > > > lib/librte_vhost/virtio-net.c | 5 ++++- > > > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > > > > > diff --git a/lib/librte_vhost/virtio-net.c > > > > b/lib/librte_vhost/virtio-net.c index 81bd309..839a333 100644 > > > > --- a/lib/librte_vhost/virtio-net.c > > > > +++ b/lib/librte_vhost/virtio-net.c > > > > @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; > > > > (1ULL << > > > VHOST_USER_F_PROTOCOL_FEATURES) | \ > > > > (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ > > > > (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ > > > > - (1ULL << VIRTIO_NET_F_CSUM)) > > > > + (1ULL << VIRTIO_NET_F_CSUM) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) > > > > > > I don't think we need that, and it might be wrong to set those fields at > vhost. > > > > > > And, TBH, I am not 100% sure that I understand what those flags > > > truely are and for. All I know is that they seem have something to > > > do with QEMU/TAP device. > > > > According to virtio standard, those fileds should be set. > > If so, you'd better quote them here, or even to your patch commit. In the Virtual I/O Device (VIRTIO) Version 1.0 Committee Specification 02, (1) VIRTIO_NET_F_GUEST_CSUM (1) Driver handles packets with partial checksum. (2) If the VIRTIO_NET_F_GUEST_CSUM feature was negotiated, the VIRTIO_NET_HDR_F_NEEDS_- CSUM bit in flags MAY be set: if so, the checksum on the packet is incomplete and csum_start and csum_offset indicate how to calculate it (see Packet Transmission point 1). (3) If the VIRTIO_NET_F_GUEST_TSO4, TSO6 or UFO options were negotiated, then gso_type MAY be something other than VIRTIO_NET_HDR_GSO_NONE, and gso_size field indicates the desired MSS (see Packet Transmission point 2). The information can be included in the next version of patch set. > --yliu > > > Yes, I'd like to listen other guys comments. > > > > > Hopefully the virtio expert, Michael, could shine some lights on that. > > > > > > --yliu > > > > > > > > > > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > > > > > -- > > > > 1.7.7.6
Frank, Thanks Qian -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Liu, Jijiang Sent: Wednesday, November 11, 2015 4:53 PM To: Yuanhan Liu Cc: dev@dpdk.org; Michael S. Tsirkin Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload capabilities > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Wednesday, November 11, 2015 4:44 PM > To: Liu, Jijiang > Cc: Michael S. Tsirkin; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest > offload capabilities > > On Wed, Nov 11, 2015 at 08:38:29AM +0000, Liu, Jijiang wrote: > > > > > > > -----Original Message----- > > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > > Sent: Wednesday, November 11, 2015 4:31 PM > > > To: Liu, Jijiang; Michael S. Tsirkin > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest > > > offload capabilities > > > > > > On Wed, Nov 11, 2015 at 02:40:45PM +0800, Jijiang Liu wrote: > > > > Add virtio guest offload capabilities. > > > > > > > > Signed-off-by: Jijiang Liu <jijiang.liu@intel.com> > > > > --- > > > > lib/librte_vhost/virtio-net.c | 5 ++++- > > > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > > > > > diff --git a/lib/librte_vhost/virtio-net.c > > > > b/lib/librte_vhost/virtio-net.c index 81bd309..839a333 100644 > > > > --- a/lib/librte_vhost/virtio-net.c > > > > +++ b/lib/librte_vhost/virtio-net.c > > > > @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; > > > > (1ULL << > > > VHOST_USER_F_PROTOCOL_FEATURES) | \ > > > > (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ > > > > (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ > > > > - (1ULL << VIRTIO_NET_F_CSUM)) > > > > + (1ULL << VIRTIO_NET_F_CSUM) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ > > > > + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) > > > > > > I don't think we need that, and it might be wrong to set those > > > fields at > vhost. > > > > > > And, TBH, I am not 100% sure that I understand what those flags > > > truely are and for. All I know is that they seem have something to > > > do with QEMU/TAP device. > > > > According to virtio standard, those fileds should be set. > > If so, you'd better quote them here, or even to your patch commit. In the Virtual I/O Device (VIRTIO) Version 1.0 Committee Specification 02, [QIAN] Do we support virtio 1.0 in the vhost offload case? Currently it's virtio 0.95 Spec that we are testing. (1) VIRTIO_NET_F_GUEST_CSUM (1) Driver handles packets with partial checksum. (2) If the VIRTIO_NET_F_GUEST_CSUM feature was negotiated, the VIRTIO_NET_HDR_F_NEEDS_- CSUM bit in flags MAY be set: if so, the checksum on the packet is incomplete and csum_start and csum_offset indicate how to calculate it (see Packet Transmission point 1). (3) If the VIRTIO_NET_F_GUEST_TSO4, TSO6 or UFO options were negotiated, then gso_type MAY be something other than VIRTIO_NET_HDR_GSO_NONE, and gso_size field indicates the desired MSS (see Packet Transmission point 2). The information can be included in the next version of patch set. > --yliu > > > Yes, I'd like to listen other guys comments. > > > > > Hopefully the virtio expert, Michael, could shine some lights on that. > > > > > > --yliu > > > > > > > > > > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > > > > > -- > > > > 1.7.7.6
2015-11-11 08:53, Liu, Jijiang: > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > On Wed, Nov 11, 2015 at 08:38:29AM +0000, Liu, Jijiang wrote: > > > According to virtio standard, those fileds should be set. > > > > If so, you'd better quote them here, or even to your patch commit. > > In the Virtual I/O Device (VIRTIO) Version 1.0 Committee Specification 02, > > (1) VIRTIO_NET_F_GUEST_CSUM (1) Driver handles packets with partial checksum. > > (2) If the VIRTIO_NET_F_GUEST_CSUM feature was negotiated, the VIRTIO_NET_HDR_F_NEEDS_- > CSUM bit in flags MAY be set: if so, the checksum on the packet is incomplete and csum_start > and csum_offset indicate how to calculate it (see Packet Transmission point 1). > > (3) If the VIRTIO_NET_F_GUEST_TSO4, TSO6 or UFO options were negotiated, then gso_type > MAY be something other than VIRTIO_NET_HDR_GSO_NONE, and gso_size field indicates > the desired MSS (see Packet Transmission point 2). > > The information can be included in the next version of patch set. Yes quoting specifications or datasheets in commit messages is a really good idea. Thanks for improving the quality of the git history.
Hi Qian, > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Liu, Jijiang > Sent: Wednesday, November 11, 2015 4:53 PM > To: Yuanhan Liu > Cc: dev@dpdk.org; Michael S. Tsirkin > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest offload > capabilities > > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > Sent: Wednesday, November 11, 2015 4:44 PM > > To: Liu, Jijiang > > Cc: Michael S. Tsirkin; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest > > offload capabilities > > > > On Wed, Nov 11, 2015 at 08:38:29AM +0000, Liu, Jijiang wrote: > > > > > > > > > > -----Original Message----- > > > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > > > Sent: Wednesday, November 11, 2015 4:31 PM > > > > To: Liu, Jijiang; Michael S. Tsirkin > > > > Cc: dev@dpdk.org > > > > Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio/lib:add virtio guest > > > > offload capabilities > > > > > > > > I don't think we need that, and it might be wrong to set those > > > > fields at > > vhost. > > > > > > > > And, TBH, I am not 100% sure that I understand what those flags > > > > truely are and for. All I know is that they seem have something to > > > > do with QEMU/TAP device. > > > > > > According to virtio standard, those fileds should be set. > > > > If so, you'd better quote them here, or even to your patch commit. > > In the Virtual I/O Device (VIRTIO) Version 1.0 Committee Specification 02, > > > [QIAN] Do we support virtio 1.0 in the vhost offload case? Currently it's virtio > 0.95 Spec that we are testing. > There are almost same description in 0.95 Spec, (1)VIRTIO_NET_F_GUEST_CSUM (1) Guest handles packets with partial checksum (2) If the VIRTIO_NET_F_GUEST_CSUM feature was negotiated, the VIRTIO_NET_HDR_F_NEEDS_CSUM bit in the ags eld may be set: if so, the checksum on the packet is incomplete and the csum_start and csum_oset elds indicate how to calculate it (see 1). (3) The converse features are also available: a driver can save the virtual device some work by negotiating these features.8 The VIRTIO_NET_F_GUEST_CSUM feature indicates that partially checksummed packets can be received, and if it can do that then the VIRTIO_NET_F_GUEST_TSO4, VIRTIO_ NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO and VIRTIO_NET_F_GUEST_ECN are the input equivalents of the features described above. See Receiving Packets below.
On Wed, Nov 11, 2015 at 08:53:08AM +0000, Liu, Jijiang wrote: ... > > If so, you'd better quote them here, or even to your patch commit. > > In the Virtual I/O Device (VIRTIO) Version 1.0 Committee Specification 02, > > (1) VIRTIO_NET_F_GUEST_CSUM (1) Driver handles packets with partial checksum. > > (2) If the VIRTIO_NET_F_GUEST_CSUM feature was negotiated, the VIRTIO_NET_HDR_F_NEEDS_- > CSUM bit in flags MAY be set: if so, the checksum on the packet is incomplete and csum_start > and csum_offset indicate how to calculate it (see Packet Transmission point 1). > > (3) If the VIRTIO_NET_F_GUEST_TSO4, TSO6 or UFO options were negotiated, then gso_type > MAY be something other than VIRTIO_NET_HDR_GSO_NONE, and gso_size field indicates > the desired MSS (see Packet Transmission point 2). Thanks. Yes, sound like we need set them. --yliu > > The information can be included in the next version of patch set. > > > --yliu > > > > > Yes, I'd like to listen other guys comments. > > > > > > > Hopefully the virtio expert, Michael, could shine some lights on that. > > > > > > > > --yliu > > > > > > > > > > > > > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > > > > > > > -- > > > > > 1.7.7.6
diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 81bd309..839a333 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -80,7 +80,10 @@ static struct virtio_net_config_ll *ll_root; (1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \ (1ULL << VIRTIO_NET_F_HOST_TSO4) | \ (1ULL << VIRTIO_NET_F_HOST_TSO6) | \ - (1ULL << VIRTIO_NET_F_CSUM)) + (1ULL << VIRTIO_NET_F_CSUM) | \ + (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \ + (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ + (1ULL << VIRTIO_NET_F_GUEST_TSO6)) static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES;