Skip to contentSkip to conversation

mk: fix kernel modules build dependency

PATCH In review Thomas Monjalon 3 participants 14 messages Mar 29, 2018 – Mar 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: fix kernel modules build dependency

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

This error appeared recently after moving kernel modules in their own directory.

Fixes acaa9ee991b5 ("move kernel modules directories")

---

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

---
 mk/rte.sdkbuild.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.sdkbuild.mk +1 -0
index 53e0721e9..5dc43e429 100644
@@ -14,6 +14,7 @@ endif
 -include $(RTE_SDK)/mk/exec-env/$(RTE_EXEC_ENV)/rte.custom.mk
 
 buildtools: | lib
+kernel: | lib
 drivers: | lib buildtools
 app: | lib buildtools drivers
 test: | lib buildtools drivers
Signature · 1 line
2.16.2
#1 lore raw
Quoted 8 lines · Thomas Monjalon

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

#2 lore raw

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

#3 lore raw
Quoted 11 lines · Thomas Monjalon

29/03/2018 17:48, Ferruh Yigit:

Quoted 10 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory
Quoted 8 lines
Quoted 1 line

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

#4 lore raw

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

#5 lore raw
Quoted 26 lines · Thomas Monjalon

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 7 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it

should provide the header, this can be all subjective tough :)

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

#6 lore raw

29/03/2018 18:50, Ferruh Yigit:

Quoted 33 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

Quoted 8 lines

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:
- rte_pci_dev_features.h
\- rte_pci_dev_feature_defs.h
- rte_kni_common.h
\- rte_common.h

Are you sure?

#7 lore raw
Quoted 54 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, March 29, 2018 10:31 PM
To: Ferruh Yigit <[email protected]>
Cc: Hemant Agrawal <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] mk: fix kernel modules build dependency
Importance: High

29/03/2018 18:50, Ferruh Yigit:

Quoted 8 lines · Thomas Monjalon
Quoted 7 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 6 lines · Thomas Monjalon
Quoted 5 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 4 lines · Thomas Monjalon
Quoted 3 lines

Some kernel modules may need some header files to be "installed" in the build directory.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into

kernel?

Quoted 17 lines
Quoted 17 lines
Quoted 5 lines
Quoted 5 lines

It seems you missed my comment below:

On a related note, this header file

Quoted 7 lines
Quoted 3 lines

lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

Quoted 7 lines
Quoted 1 line

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be

functional.

Quoted 3 lines

But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

Quoted 9 lines

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:
- rte_pci_dev_features.h
\- rte_pci_dev_feature_defs.h
- rte_kni_common.h
\- rte_common.h

Are you sure?

I agree that ideologically the kernel modules shall be self sufficient.
However, given the dpdk structure, my original intention was to have userspace self sufficient. The kernel modules may depend on userspace.

However, no strong opinion either way.

#8 lore raw
Quoted 61 lines · Hemant Agrawal
Quoted 61 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, March 29, 2018 10:31 PM
To: Ferruh Yigit <[email protected]>
Cc: Hemant Agrawal <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] mk: fix kernel modules build dependency
Importance: High

29/03/2018 18:50, Ferruh Yigit:

Quoted 8 lines · Thomas Monjalon
Quoted 7 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 6 lines · Thomas Monjalon
Quoted 5 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 4 lines · Thomas Monjalon
Quoted 3 lines

Some kernel modules may need some header files to be "installed" in the build directory.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into

kernel?

Quoted 17 lines
Quoted 17 lines
Quoted 5 lines
Quoted 5 lines

It seems you missed my comment below:

On a related note, this header file

Quoted 7 lines
Quoted 3 lines

lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

Quoted 7 lines
Quoted 1 line

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be

functional.

Quoted 3 lines

But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:
- rte_pci_dev_features.h
\- rte_pci_dev_feature_defs.h
- rte_kni_common.h
\- rte_common.h

Quoted 4 lines
Quoted 2 lines

Are you sure?

I agree that ideologically the kernel modules shall be self sufficient.
However, given the dpdk structure, my original intention was to have userspace self sufficient. The kernel modules may depend on userspace.

Overall agree to make userspace self sufficient, it makes builds more stable.

Specific to librte_kni, it is kind wrapper to kni module, so functionally it is OK to make librte_kni dependent to kni module, but not sure from build point of view.

Quoted 3 lines

However, no strong opinion either way.

#9 lore raw
In reply to Thomas Monjalon
Quoted 37 lines · Thomas Monjalon

29/03/2018 18:50, Ferruh Yigit:

Quoted 36 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Quoted 8 lines
Quoted 5 lines

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:

No, not talking about moving headers to kernel/ folder. But we can "liberate" J the kernel modules.

For KNI, rte_kni_common.h is shared between kernel and userspace, can't escape from it. But why this common header needs to depend other dpdk headers at all? Indeed commenting out rte_common and rte_config worked fine, it seem there is already no dependency.

Same thing for igb_uio, why in needs to depend other dpdk headers? Following seems fixing the issue, yes it is duplication but I think that is OK:
-#include <rte_pci_dev_features.h>
+/*#include <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"

Quoted 8 lines

- rte_pci_dev_features.h
\- rte_pci_dev_feature_defs.h
- rte_kni_common.h
\- rte_common.h

Are you sure?

#10 lore raw
Quoted 47 lines · Ferruh Yigit
Quoted 37 lines · Thomas Monjalon

29/03/2018 18:50, Ferruh Yigit:

Quoted 36 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Quoted 8 lines
Quoted 5 lines

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:

Quoted 7 lines

No, not talking about moving headers to kernel/ folder. But we can "liberate" J the kernel modules.

For KNI, rte_kni_common.h is shared between kernel and userspace, can't escape from it. But why this common header needs to depend other dpdk headers at all? Indeed commenting out rte_common and rte_config worked fine, it seem there is already no dependency.

Hemant is right, putting rte_kni_common makes build dependent to module build, and module is more fragile.

I agree to move header to userspace library.

Quoted 25 lines

Same thing for igb_uio, why in needs to depend other dpdk headers? Following seems fixing the issue, yes it is duplication but I think that is OK:
-#include <rte_pci_dev_features.h>
+/*#include <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"

Quoted 8 lines

- rte_pci_dev_features.h
\- rte_pci_dev_feature_defs.h
- rte_kni_common.h
\- rte_common.h

Are you sure?

#11 lore raw

29/03/2018 20:43, Ferruh Yigit:

Quoted 56 lines · Ferruh Yigit
Quoted 47 lines · Thomas Monjalon
Quoted 37 lines

29/03/2018 18:50, Ferruh Yigit:

Quoted 36 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Quoted 8 lines
Quoted 5 lines

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:

Quoted 7 lines

No, not talking about moving headers to kernel/ folder. But we can "liberate" J the kernel modules.

For KNI, rte_kni_common.h is shared between kernel and userspace, can't escape from it. But why this common header needs to depend other dpdk headers at all? Indeed commenting out rte_common and rte_config worked fine, it seem there is already no dependency.

Quoted 4 lines

Hemant is right, putting rte_kni_common makes build dependent to module build, and module is more fragile.

I agree to move header to userspace library.

Does it mean you ack this patch?

Do you want to make a patch to move the header from EAL to librte_kni?

Acked-by
#12 lore raw
Quoted 57 lines · Thomas Monjalon

29/03/2018 20:43, Ferruh Yigit:

Quoted 56 lines · Ferruh Yigit
Quoted 54 lines · Thomas Monjalon
Quoted 37 lines

29/03/2018 18:50, Ferruh Yigit:

Quoted 36 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Quoted 8 lines
Quoted 5 lines

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:

No, not talking about moving headers to kernel/ folder. But we can "liberate" J the kernel modules.

For KNI, rte_kni_common.h is shared between kernel and userspace, can't escape from it. But why this common header needs to depend other dpdk headers at all? Indeed commenting out rte_common and rte_config worked fine, it seem there is already no dependency.

Quoted 6 lines
Quoted 4 lines

Hemant is right, putting rte_kni_common makes build dependent to module build, and module is more fragile.

I agree to move header to userspace library.

Does it mean you ack this patch?

yep,

Quoted 5 lines

Do you want to make a patch to move the header from EAL to librte_kni?

author Applied
#13 lore raw

30/03/2018 12:15, Ferruh Yigit:

Quoted 61 lines · Thomas Monjalon
Quoted 60 lines

29/03/2018 20:43, Ferruh Yigit:

Quoted 59 lines · Ferruh Yigit
Quoted 47 lines · Thomas Monjalon
Quoted 37 lines

29/03/2018 18:50, Ferruh Yigit:

Quoted 36 lines · Thomas Monjalon
Quoted 26 lines

29/03/2018 18:38, Ferruh Yigit:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

29/03/2018 17:48, Ferruh Yigit:

Quoted 11 lines · Thomas Monjalon
Quoted 8 lines

Some kernel modules may need some header files to be "installed" in the build directory.

When running multiple threads of make, kernel modules can try to be compiled before the lib headers are ready:

	make -j3
	kernel/linux/kni/kni_misc.c:19:37: fatal error:
		exec-env/rte_kni_common.h: No such file or directory

Is there a reason to keep header in eal when module itself moved into kernel?

It seems you missed my comment below:

Quoted 8 lines
Quoted 4 lines

On a related note, this header file
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
could be moved to lib/librte_kni/
Opinion?

Ahh, yes we are saying same thing.
But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? I lean to kernel/linux/kni/.

Quoted 5 lines

Why in kernel/?

Logically, kernel/ depends on lib/ but not the reverse.

And regarding the licensing, we avoid BSD files in Linux modules.

From functionality point of view, module provides the functionality and it should provide the header, this can be all subjective tough :)

Quoted 8 lines
Quoted 5 lines

Or in other words, if you have the kernel module, you can write another piece of userspace application (without using librte_kni) and it will be functional. But if you have the librte_kni only, it won't be functional on its own.

Providing header with kernel enables other userspace app to user KNI.

So you are saying we should reverse the dependency?
It would mean moving all headers used by kernel modules in kernel/ directory:

Quoted 7 lines

No, not talking about moving headers to kernel/ folder. But we can "liberate" J the kernel modules.

For KNI, rte_kni_common.h is shared between kernel and userspace, can't escape from it. But why this common header needs to depend other dpdk headers at all? Indeed commenting out rte_common and rte_config worked fine, it seem there is already no dependency.

Hemant is right, putting rte_kni_common makes build dependent to module build, and module is more fragile.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I agree to move header to userspace library.

Does it mean you ack this patch?

yep,

Applied, thanks