diff mbox series

[DPDK_KMODS,v5] linux/igb_uio: add Makefile to build the kernel module

Message ID 1603999017-43206-1-git-send-email-hariprasad.govindharajan@intel.com (mailing list archive)
State Superseded, archived
Headers show
Series [DPDK_KMODS,v5] linux/igb_uio: add Makefile to build the kernel module | expand

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch warning coding style issues

Commit Message

Hariprasad Govindharajan Oct. 29, 2020, 7:16 p.m. UTC
With DPDK 20.11 release, the igb_uio module is no more part of DPDK.
There are use cases where this module is required, for example while
testing the virtual ports in OvS, the virtual ports are bound to
igb_uio module inside a VM. So, this patch provides a Makefile
which can be used to build this module and use as needed.

Since there is no more dependency on DPDK headers, this module can be
built simply by running make in the source dir

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
---
This patch will be part of dpdk-kmods repo
https://git.dpdk.org/dpdk-kmods/
---
v5:
Removed the DPDK dependency
v4:
Corrected the indentation
v3:
Edited the commit message and corrected the mistakes in the variable
definition
v2:
Added more information to the commit message
---
 linux/igb_uio/Makefile  |  7 +++++++
 linux/igb_uio/igb_uio.c | 20 +++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 linux/igb_uio/Makefile

Comments

Ferruh Yigit Oct. 29, 2020, 7:31 p.m. UTC | #1
On 10/29/2020 7:16 PM, Hariprasad Govindharajan wrote:
> With DPDK 20.11 release, the igb_uio module is no more part of DPDK.
> There are use cases where this module is required, for example while
> testing the virtual ports in OvS, the virtual ports are bound to
> igb_uio module inside a VM. So, this patch provides a Makefile
> which can be used to build this module and use as needed.
> 
> Since there is no more dependency on DPDK headers, this module can be
> built simply by running make in the source dir
> 
> Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>

Hi Hariprasad,

Can you please make this two patches, first one to move the enum/macro from DPDK 
to igb_uio.c to remove the dependency.

Second on is the Makefile.

<...>

> @@ -15,7 +15,25 @@
>   #include <linux/version.h>
>   #include <linux/slab.h>
>   
> -#include <rte_pci_dev_features.h>
> +/**
> + * These enums and MACRO definitions are copied from the
> + * file rte_pci_dev_features.h
> + */
> +
> +/* interrupt mode */
> +
> +enum rte_intr_mode {
> +    RTE_INTR_MODE_NONE = 0,
> +	RTE_INTR_MODE_LEGACY,
> +	RTE_INTR_MODE_MSI,
> +	RTE_INTR_MODE_MSIX
> +};

Can you please fix the indentation?

> +
> +#define RTE_INTR_MODE_NONE_NAME "none"
> +#define RTE_INTR_MODE_LEGACY_NAME "legacy"
> +#define RTE_INTR_MODE_MSI_NAME "msi"
> +#define RTE_INTR_MODE_MSIX_NAME "msix"
> +
>   
>   #include "compat.h"
>   
>
Thomas Monjalon Oct. 29, 2020, 9:11 p.m. UTC | #2
29/10/2020 20:16, Hariprasad Govindharajan:
> With DPDK 20.11 release, the igb_uio module is no more part of DPDK.
> There are use cases where this module is required, for example while
> testing the virtual ports in OvS, the virtual ports are bound to
> igb_uio module inside a VM. So, this patch provides a Makefile
> which can be used to build this module and use as needed.
> 
> Since there is no more dependency on DPDK headers, this module can be
> built simply by running make in the source dir
> 
> Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
> ---
> This patch will be part of dpdk-kmods repo
> https://git.dpdk.org/dpdk-kmods/
> ---
> v5:
> Removed the DPDK dependency

I prefer this approach, thanks.

[...]
> -#include <rte_pci_dev_features.h>
> +/**
> + * These enums and MACRO definitions are copied from the
> + * file rte_pci_dev_features.h
> + */
> +
> +/* interrupt mode */
> +
> +enum rte_intr_mode {
> +    RTE_INTR_MODE_NONE = 0,
> +	RTE_INTR_MODE_LEGACY,
> +	RTE_INTR_MODE_MSI,
> +	RTE_INTR_MODE_MSIX
> +};
> +
> +#define RTE_INTR_MODE_NONE_NAME "none"
> +#define RTE_INTR_MODE_LEGACY_NAME "legacy"
> +#define RTE_INTR_MODE_MSI_NAME "msi"
> +#define RTE_INTR_MODE_MSIX_NAME "msix"
diff mbox series

Patch

diff --git a/linux/igb_uio/Makefile b/linux/igb_uio/Makefile
new file mode 100644
index 0000000..09ae5d9
--- /dev/null
+++ b/linux/igb_uio/Makefile
@@ -0,0 +1,7 @@ 
+KSRC ?= /lib/modules/`uname -r`/build
+
+all:
+	make -C $(KSRC)/ M=$(PWD)
+
+clean:
+	make -C $(KSRC)/ M=$(PWD) clean
diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index 039f5a5..34a605b 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -15,7 +15,25 @@ 
 #include <linux/version.h>
 #include <linux/slab.h>
 
-#include <rte_pci_dev_features.h>
+/**
+ * These enums and MACRO definitions are copied from the
+ * file rte_pci_dev_features.h
+ */
+
+/* interrupt mode */
+
+enum rte_intr_mode {
+    RTE_INTR_MODE_NONE = 0,
+	RTE_INTR_MODE_LEGACY,
+	RTE_INTR_MODE_MSI,
+	RTE_INTR_MODE_MSIX
+};
+
+#define RTE_INTR_MODE_NONE_NAME "none"
+#define RTE_INTR_MODE_LEGACY_NAME "legacy"
+#define RTE_INTR_MODE_MSI_NAME "msi"
+#define RTE_INTR_MODE_MSIX_NAME "msix"
+
 
 #include "compat.h"