[dpdk-dev] vhost: fix ANY_LAYOUT definition for old kernels

Message ID 1517408457-17271-1-git-send-email-zhihong.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Zhihong Wang Jan. 31, 2018, 2:20 p.m. UTC
  This patch fixes compile failure with old kernels which have no
VIRTIO_F_ANY_LAYOUT defined.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
---
 lib/librte_vhost/vhost.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Maxime Coquelin Jan. 31, 2018, 8:07 a.m. UTC | #1
On 01/31/2018 03:20 PM, Zhihong Wang wrote:
> This patch fixes compile failure with old kernels which have no
> VIRTIO_F_ANY_LAYOUT defined.
> 
> Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> ---
>   lib/librte_vhost/vhost.h | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index ba80584..646aad3 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -130,6 +130,10 @@ struct vhost_virtqueue {
>    #define VIRTIO_NET_F_MTU 3
>   #endif
>   
> +#ifndef VIRTIO_F_ANY_LAYOUT
> + #define VIRTIO_F_ANY_LAYOUT		27
> +#endif
> +
>   /* Declare IOMMU related bits for older kernels */
>   #ifndef VIRTIO_F_IOMMU_PLATFORM
>   
>
  
Jerin Jacob Jan. 31, 2018, 9:32 a.m. UTC | #2
-----Original Message-----
> Date: Wed, 31 Jan 2018 09:07:49 +0100
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> To: Zhihong Wang <zhihong.wang@intel.com>, yliu@fridaylinux.org
> CC: dev@dpdk.org, jianfeng.tan@intel.com
> Subject: Re: [dpdk-dev] [PATCH] vhost: fix ANY_LAYOUT definition for old
>  kernels
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>  Thunderbird/52.5.2
> 
> 
> On 01/31/2018 03:20 PM, Zhihong Wang wrote:
> > This patch fixes compile failure with old kernels which have no
> > VIRTIO_F_ANY_LAYOUT defined.
> > 
> > Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> > ---
> >   lib/librte_vhost/vhost.h | 4 ++++
> >   1 file changed, 4 insertions(+)
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Cc: Thomas Monjalon <thomas@monjalon.net>

This fixes a cross compilation issue with arm64 too.

Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
  
Thomas Monjalon Jan. 31, 2018, 11:11 a.m. UTC | #3
> > > This patch fixes compile failure with old kernels which have no
> > > VIRTIO_F_ANY_LAYOUT defined.
> > > 
> > > Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
> > > ---
> > >   lib/librte_vhost/vhost.h | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > 
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Cc: Thomas Monjalon <thomas@monjalon.net>
> 
> This fixes a cross compilation issue with arm64 too.
> 
> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Fixes: 5a8bb6e9020f ("vhost: claim to support any layout feature")

Applied, thanks
  

Patch

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index ba80584..646aad3 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -130,6 +130,10 @@  struct vhost_virtqueue {
  #define VIRTIO_NET_F_MTU 3
 #endif
 
+#ifndef VIRTIO_F_ANY_LAYOUT
+ #define VIRTIO_F_ANY_LAYOUT		27
+#endif
+
 /* Declare IOMMU related bits for older kernels */
 #ifndef VIRTIO_F_IOMMU_PLATFORM