diff mbox

[dpdk-dev,1/5] eal: make enum rte_kernel_driver non-PCI specific

Message ID 1472704915-13112-2-git-send-email-shreyansh.jain@nxp.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Shreyansh Jain Sept. 1, 2016, 4:41 a.m. UTC
From: Jan Viktorin <viktorin@rehivetech.com>

From: Jan Viktorin <viktorin@rehivetech.com>

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 lib/librte_eal/common/include/rte_dev.h | 12 ++++++++++++
 lib/librte_eal/common/include/rte_pci.h |  9 ---------
 2 files changed, 12 insertions(+), 9 deletions(-)

Comments

Yuanhan Liu Sept. 11, 2016, 12:15 p.m. UTC | #1
On Thu, Sep 01, 2016 at 10:11:51AM +0530, Shreyansh Jain wrote:
> From: Jan Viktorin <viktorin@rehivetech.com>
> 
> From: Jan Viktorin <viktorin@rehivetech.com>
> 
> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Hi,

FYI, my testrobot caught some errors when this patch is applied.

        --yliu

---
i686-native-linuxapp-gcc: config-all-yes
========================================
In file included from lib/librte_eal/linuxapp/eal/eal_pci.c:38:0:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
In file included from lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:52:0:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
In file included from lib/librte_eal/common/eal_private.h:38:0,
                 from lib/librte_eal/linuxapp/eal/eal_thread.c:55:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
make[7]: *** [eal_thread.o] Error 1
make[7]: *** Waiting for unfinished jobs....
In file included from lib/librte_eal/linuxapp/eal/eal.c:72:0:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
In file included from lib/librte_eal/common/eal_private.h:38:0,
                 from lib/librte_eal/linuxapp/eal/eal_memory.c:97:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
In file included from lib/librte_eal/common/eal_private.h:38:0,
                 from lib/librte_eal/linuxapp/eal/eal_log.c:50:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
make[7]: *** [eal_log.o] Error 1
make[7]: *** [eal_vfio_mp_sync.o] Error 1
In file included from lib/librte_eal/common/eal_private.h:38:0,
                 from lib/librte_eal/linuxapp/eal/eal_vfio.c:45:
i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
  enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
                         ^
make[7]: *** [eal.o] Error 1
make[7]: *** [eal_memory.o] Error 1
make[7]: *** [eal_vfio.o] Error 1
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_map_device':
lib/librte_eal/linuxapp/eal/eal_pci.c:133:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:133:7: note: each undeclared identifier is reported only once for each function it appears in
lib/librte_eal/linuxapp/eal/eal_pci.c:139:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:140:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_unmap_device':
lib/librte_eal/linuxapp/eal/eal_pci.c:160:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:163:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:164:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'pci_scan_one':
lib/librte_eal/linuxapp/eal/eal_pci.c:381:16: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
    dev->kdrv = RTE_KDRV_VFIO;
                ^
lib/librte_eal/linuxapp/eal/eal_pci.c:383:16: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
    dev->kdrv = RTE_KDRV_IGB_UIO;
                ^
lib/librte_eal/linuxapp/eal/eal_pci.c:385:16: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
    dev->kdrv = RTE_KDRV_UIO_GENERIC;
                ^
lib/librte_eal/linuxapp/eal/eal_pci.c:387:16: error: 'RTE_KDRV_UNKNOWN' undeclared (first use in this function)
    dev->kdrv = RTE_KDRV_UNKNOWN;
                ^
lib/librte_eal/linuxapp/eal/eal_pci.c:389:15: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
   dev->kdrv = RTE_KDRV_NONE;
               ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_map':
lib/librte_eal/linuxapp/eal/eal_pci.c:626:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:631:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:634:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:641:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
  case RTE_KDRV_NONE:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_read':
lib/librte_eal/linuxapp/eal/eal_pci.c:662:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:666:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:669:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:672:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
  case RTE_KDRV_NONE:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_write':
lib/librte_eal/linuxapp/eal/eal_pci.c:688:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:692:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:695:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:698:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
  case RTE_KDRV_NONE:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_unmap':
lib/librte_eal/linuxapp/eal/eal_pci.c:715:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
  case RTE_KDRV_VFIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:720:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
  case RTE_KDRV_IGB_UIO:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:723:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
  case RTE_KDRV_UIO_GENERIC:
       ^
lib/librte_eal/linuxapp/eal/eal_pci.c:730:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
  case RTE_KDRV_NONE:
       ^
make[7]: *** [eal_pci.o] Error 1
make[6]: *** [eal] Error 2
make[5]: *** [linuxapp] Error 2
make[4]: *** [librte_eal] Error 2
make[3]: *** [lib] Error 2
make[2]: *** [all] Error 2
make[1]: *** [pre_install] Error 2
make: *** [install] Error 2
error: build failed
Shreyansh Jain Sept. 12, 2016, 5:10 a.m. UTC | #2
Hi,

On Sunday 11 September 2016 05:45 PM, Yuanhan Liu wrote:
> On Thu, Sep 01, 2016 at 10:11:51AM +0530, Shreyansh Jain wrote:
>> From: Jan Viktorin <viktorin@rehivetech.com>
>>
>> From: Jan Viktorin <viktorin@rehivetech.com>
>>
>> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>
> Hi,
>
> FYI, my testrobot caught some errors when this patch is applied.
>
>         --yliu
>
> ---
> i686-native-linuxapp-gcc: config-all-yes
> ========================================
> In file included from lib/librte_eal/linuxapp/eal/eal_pci.c:38:0:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> In file included from lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:52:0:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> In file included from lib/librte_eal/common/eal_private.h:38:0,
>                  from lib/librte_eal/linuxapp/eal/eal_thread.c:55:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> make[7]: *** [eal_thread.o] Error 1
> make[7]: *** Waiting for unfinished jobs....
> In file included from lib/librte_eal/linuxapp/eal/eal.c:72:0:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> In file included from lib/librte_eal/common/eal_private.h:38:0,
>                  from lib/librte_eal/linuxapp/eal/eal_memory.c:97:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> In file included from lib/librte_eal/common/eal_private.h:38:0,
>                  from lib/librte_eal/linuxapp/eal/eal_log.c:50:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> make[7]: *** [eal_log.o] Error 1
> make[7]: *** [eal_vfio_mp_sync.o] Error 1
> In file included from lib/librte_eal/common/eal_private.h:38:0,
>                  from lib/librte_eal/linuxapp/eal/eal_vfio.c:45:
> i686-native-linuxapp-gcc/include/rte_pci.h:157:25: error: field 'kdrv' has incomplete type
>   enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>                          ^
> make[7]: *** [eal.o] Error 1
> make[7]: *** [eal_memory.o] Error 1
> make[7]: *** [eal_vfio.o] Error 1
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_map_device':
> lib/librte_eal/linuxapp/eal/eal_pci.c:133:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:133:7: note: each undeclared identifier is reported only once for each function it appears in
> lib/librte_eal/linuxapp/eal/eal_pci.c:139:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:140:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_unmap_device':
> lib/librte_eal/linuxapp/eal/eal_pci.c:160:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:163:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:164:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'pci_scan_one':
> lib/librte_eal/linuxapp/eal/eal_pci.c:381:16: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>     dev->kdrv = RTE_KDRV_VFIO;
>                 ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:383:16: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>     dev->kdrv = RTE_KDRV_IGB_UIO;
>                 ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:385:16: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>     dev->kdrv = RTE_KDRV_UIO_GENERIC;
>                 ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:387:16: error: 'RTE_KDRV_UNKNOWN' undeclared (first use in this function)
>     dev->kdrv = RTE_KDRV_UNKNOWN;
>                 ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:389:15: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
>    dev->kdrv = RTE_KDRV_NONE;
>                ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_map':
> lib/librte_eal/linuxapp/eal/eal_pci.c:626:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:631:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:634:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:641:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
>   case RTE_KDRV_NONE:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_read':
> lib/librte_eal/linuxapp/eal/eal_pci.c:662:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:666:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:669:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:672:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
>   case RTE_KDRV_NONE:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_write':
> lib/librte_eal/linuxapp/eal/eal_pci.c:688:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:692:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:695:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:698:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
>   case RTE_KDRV_NONE:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c: In function 'rte_eal_pci_ioport_unmap':
> lib/librte_eal/linuxapp/eal/eal_pci.c:715:7: error: 'RTE_KDRV_VFIO' undeclared (first use in this function)
>   case RTE_KDRV_VFIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:720:7: error: 'RTE_KDRV_IGB_UIO' undeclared (first use in this function)
>   case RTE_KDRV_IGB_UIO:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:723:7: error: 'RTE_KDRV_UIO_GENERIC' undeclared (first use in this function)
>   case RTE_KDRV_UIO_GENERIC:
>        ^
> lib/librte_eal/linuxapp/eal/eal_pci.c:730:7: error: 'RTE_KDRV_NONE' undeclared (first use in this function)
>   case RTE_KDRV_NONE:
>        ^
> make[7]: *** [eal_pci.o] Error 1
> make[6]: *** [eal] Error 2
> make[5]: *** [linuxapp] Error 2
> make[4]: *** [librte_eal] Error 2
> make[3]: *** [lib] Error 2
> make[2]: *** [all] Error 2
> make[1]: *** [pre_install] Error 2
> make: *** [install] Error 2
> error: build failed
>

Thanks for highlighting.
That is my mistake.
While sending the patch my intention was to highlight that these are 
more as a RFC than direct patches. I forgot to add that and didn't 
notice it after posting either.

Problem is that this patch moves 'enum rte_kernel_driver' to rte_dev.h 
from rte_pci.h. All the above errors are reported by files which still 
include rte_dev.h.

I was hoping that if these patches look fine to all, I will update all 
the headers and send again.

--
Shreyansh
diff mbox

Patch

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 95789f9..60bc91d 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -101,6 +101,18 @@  rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
 } while (0)
 
 
+/**
+ * Kernel driver passthrough type
+ */
+enum rte_kernel_driver {
+	RTE_KDRV_UNKNOWN = 0,
+	RTE_KDRV_IGB_UIO,
+	RTE_KDRV_VFIO,
+	RTE_KDRV_UIO_GENERIC,
+	RTE_KDRV_NIC_UIO,
+	RTE_KDRV_NONE,
+};
+
 /** Double linked list of device drivers. */
 TAILQ_HEAD(rte_driver_list, rte_driver);
 
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index fa74962..a4c8156 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -141,15 +141,6 @@  struct rte_pci_addr {
 
 struct rte_devargs;
 
-enum rte_kernel_driver {
-	RTE_KDRV_UNKNOWN = 0,
-	RTE_KDRV_IGB_UIO,
-	RTE_KDRV_VFIO,
-	RTE_KDRV_UIO_GENERIC,
-	RTE_KDRV_NIC_UIO,
-	RTE_KDRV_NONE,
-};
-
 /**
  * A structure describing a PCI device.
  */