[dpdk-dev,1/2] examples/vhost_scsi: add virtio-1.0 feature bit support

Message ID 1526599932-13083-1-git-send-email-changpeng.liu@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

Liu, Changpeng May 17, 2018, 11:32 p.m. UTC
  Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
---
 examples/vhost_scsi/vhost_scsi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Comments

Maxime Coquelin May 18, 2018, 12:35 p.m. UTC | #1
On 05/18/2018 01:32 AM, Changpeng Liu wrote:
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> ---
>   examples/vhost_scsi/vhost_scsi.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)

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

Thanks,
Maxime
  
Thomas Monjalon May 22, 2018, 5:51 p.m. UTC | #2
18/05/2018 14:35, Maxime Coquelin:
> 
> On 05/18/2018 01:32 AM, Changpeng Liu wrote:
> > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> > ---
> >   examples/vhost_scsi/vhost_scsi.c | 7 ++++---
> >   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Patch 1 applied alone, thanks
  
Thomas Monjalon May 22, 2018, 8:33 p.m. UTC | #3
22/05/2018 19:51, Thomas Monjalon:
> 18/05/2018 14:35, Maxime Coquelin:
> > 
> > On 05/18/2018 01:32 AM, Changpeng Liu wrote:
> > > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> > > ---
> > >   examples/vhost_scsi/vhost_scsi.c | 7 ++++---
> > >   1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Patch 1 applied alone, thanks

After compilation tests, the patch is not accepted in 18.05,
because VIRTIO_F_VERSION_1 seems not defined on some distributions,
despite the fallback implemented.
  
Liu, Changpeng May 22, 2018, 8:45 p.m. UTC | #4
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, May 22, 2018 1:33 PM
> To: Liu, Changpeng <changpeng.liu@intel.com>
> Cc: dev@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: Re: [dpdk-dev] [PATCH 1/2] examples/vhost_scsi: add virtio-1.0 feature
> bit support
> 
> 22/05/2018 19:51, Thomas Monjalon:
> > 18/05/2018 14:35, Maxime Coquelin:
> > >
> > > On 05/18/2018 01:32 AM, Changpeng Liu wrote:
> > > > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> > > > ---
> > > >   examples/vhost_scsi/vhost_scsi.c | 7 ++++---
> > > >   1 file changed, 4 insertions(+), 3 deletions(-)
> > >
> > > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> > Patch 1 applied alone, thanks
> 
> After compilation tests, the patch is not accepted in 18.05,
> because VIRTIO_F_VERSION_1 seems not defined on some distributions,
> despite the fallback implemented.

What a mess for vhost library. :).
lib/librte_vhost/vhost.h has the definition VIRTIO_F_VERSION_1 for some older kernel, 
but didn't include in the public API header <rte_vhost.h>, looks like we should move
this definition to rte_vhost.h for some old kernels.
>
  

Patch

diff --git a/examples/vhost_scsi/vhost_scsi.c b/examples/vhost_scsi/vhost_scsi.c
index 2908ff6..a1d542b 100644
--- a/examples/vhost_scsi/vhost_scsi.c
+++ b/examples/vhost_scsi/vhost_scsi.c
@@ -20,9 +20,10 @@ 
 #include "vhost_scsi.h"
 #include "scsi_spec.h"
 
-#define VIRTIO_SCSI_FEATURES ((1 << VIRTIO_F_NOTIFY_ON_EMPTY) |\
-			      (1 << VIRTIO_SCSI_F_INOUT) |\
-			      (1 << VIRTIO_SCSI_F_CHANGE))
+#define VIRTIO_SCSI_FEATURES ((1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |\
+			      (1ULL << VIRTIO_SCSI_F_INOUT) |\
+			      (1ULL << VIRTIO_SCSI_F_CHANGE) |\
+			      (1ULL << VIRTIO_F_VERSION_1))
 
 /* Path to folder where character device will be created. Can be set by user. */
 static char dev_pathname[PATH_MAX] = "";