diff mbox series

[DPDK_KMODS,v7,1/2] linux/igb_uio: remove DPDK dependency for building igb_uio

Message ID 1604013442-44841-1-git-send-email-hariprasad.govindharajan@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series [DPDK_KMODS,v7,1/2] linux/igb_uio: remove DPDK dependency for building igb_uio | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Hariprasad Govindharajan Oct. 29, 2020, 11:17 p.m. UTC
The igb_uio source code requires interrupt modes defined as
MACROS and enums in the header file rte_pci_dev_features.h.
Now, the definitions are moved to the igb_uio.c file so that
this module can be built without building DPDK

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
---
 linux/igb_uio/igb_uio.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

Comments

Ferruh Yigit Oct. 30, 2020, 10:04 a.m. UTC | #1
On 10/29/2020 11:17 PM, Hariprasad Govindharajan wrote:
> The igb_uio source code requires interrupt modes defined as
> MACROS and enums in the header file rte_pci_dev_features.h.
> Now, the definitions are moved to the igb_uio.c file so that
> this module can be built without building DPDK
> 
> Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
> ---
>   linux/igb_uio/igb_uio.c | 22 ++++++++++++++++++----
>   1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
> index 3cf394b..7ef8170 100644
> --- a/linux/igb_uio/igb_uio.c
> +++ b/linux/igb_uio/igb_uio.c
> @@ -15,7 +15,21 @@
>   #include <linux/version.h>
>   #include <linux/slab.h>
>   
> -#include <rte_pci_dev_features.h>
> +/**
> + * This enums and macro definitions are copied from the
> + * file rte_pci_dev_features.h
> + */
> +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"
>   
> @@ -236,7 +250,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
>   		}
>   #endif
>   
> -	/* fall back to MSI */
> +	/* falls through - to MSI */

Patch looks good, but above change is unrelated, let's not mix them, can you 
make a new version without these corrections?
diff mbox series

Patch

diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index 3cf394b..7ef8170 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -15,7 +15,21 @@ 
 #include <linux/version.h>
 #include <linux/slab.h>
 
-#include <rte_pci_dev_features.h>
+/**
+ * This enums and macro definitions are copied from the
+ * file rte_pci_dev_features.h
+ */
+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"
 
@@ -236,7 +250,7 @@  igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 		}
 #endif
 
-	/* fall back to MSI */
+	/* falls through - to MSI */
 	case RTE_INTR_MODE_MSI:
 #ifndef HAVE_ALLOC_IRQ_VECTORS
 		if (pci_enable_msi(udev->pdev) == 0) {
@@ -255,7 +269,7 @@  igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 #endif
-	/* fall back to INTX */
+	/* falls through - to INTX */
 	case RTE_INTR_MODE_LEGACY:
 		if (pci_intx_mask_supported(udev->pdev)) {
 			dev_dbg(&udev->pdev->dev, "using INTX");
@@ -265,7 +279,7 @@  igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 		dev_notice(&udev->pdev->dev, "PCI INTX mask not supported\n");
-	/* fall back to no IRQ */
+	/* falls through - to no IRQ */
 	case RTE_INTR_MODE_NONE:
 		udev->mode = RTE_INTR_MODE_NONE;
 		udev->info.irq = UIO_IRQ_NONE;