mk: make config enhancements
This patch series is a couple of small patches to make the 'make config' of the build a bit easier for users.
Users can now 'make defconfig' which will pick a sensible default based on some 'uname' queries of the system.
Users can also set RTE_TARGET on in their environment which will get picked users type 'make config' without T=template.
There's still some work to be done on non-x86 machines so I'd appreciate some suggestions of tweaks to make this patch function on those as well.
PATCH 1/2 mk: allow use of environment var for make config
Users can now set RTE_TARGET in their environment and use 'make config' without T=template.
If RTE_TARGET is set in the user's environment, and if T= is not used, 'make config' will use $RTE_TARGET.
--- mk/rte.sdkroot.mk | 2 ++ 1 file changed, 2 insertions(+)
mk/rte.sdkroot.mk +2 -0
@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else ifdef RTE_TARGET +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TARGET) endif export RTE_CONFIG_TEMPLATE
Signature · 1 line
2.7.4
PATCH 2/2 mk: add sensible default target with defconfig
In reply to David HuntUsers can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to use
--- mk/rte.sdkconfig.mk | 15 ++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-)
mk/rte.sdkconfig.mk +12 -3
@@ -60,16 +60,25 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell uname -m)-native-$(shell uname | \ + awk '{ if ($$0 == "Linux") {print "linuxapp"} else \ + {print "bsdapp"} }')-$(shell ${CC} -v 2>&1 \ + | grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):
mk/rte.sdkroot.mk +2 -2
@@ -90,8 +90,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Signature · 1 line
2.7.4
Re: [PATCH v1 2/2] mk: add sensible default target with defconfig
Hello David,
Quoted 23 lines · David Hunt
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>--- mk/rte.sdkconfig.mk | 15 ++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-)mk/rte.sdkconfig.mk +0
-0@@ -60,16 +60,25 @@ showconfigs: .PHONY: notemplate notemplate:
mk/rte.sdkconfig.mk showconfigs: · line 70
Quoted 10 lines
mk/rte.sdkconfig.mk +6
-2- @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell uname -m)-native-$(shell uname | \
The idea to have 'make defconfig' do the works looks great to me.
I am just worried about the above line - it wouldn't allow configurations like
arm64-dpaa2-linuxapp-gcc or arm64-armv8a-linuxapp-gcc
Basically, having the MACHINE default to 'native' would not be right in all cases.
But, I don't have a better idea about how to detect this automatically. Or, we might use RTE_MACHINE someway.
Quoted 21 lines
mk/rte.sdkconfig.mk +6
-1+ awk '{ if ($$0 == "Linux") {print "linuxapp"} else \ + {print "bsdapp"} }')-$(shell ${CC} -v 2>&1 \ + | grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):mk/rte.sdkroot.mk +0
-0
mk/rte.sdkroot.mk export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n · line 97
Quoted 10 lines
mk/rte.sdkroot.mk +2
-2@@ -90,8 +90,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Other than that, I tried this patch for x86 and it worked fine.
-
Shreyansh
Re: [PATCH v1 2/2] mk: add sensible default target with defconfig
Hi Shreyansh,
Thanks for your comments. More thoughts below.
Quoted 43 lines · Shreyansh Jain
Hello David,
Quoted 23 lines · David Hunt
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>--- mk/rte.sdkconfig.mk | 15 ++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-)mk/rte.sdkconfig.mk +0
-0@@ -60,16 +60,25 @@ showconfigs: .PHONY: notemplate notemplate:mk/rte.sdkconfig.mk showconfigs: · line 70
Quoted 10 lines
mk/rte.sdkconfig.mk +6
-2- @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell uname -m)-native-$(shell uname | \The idea to have 'make defconfig' do the works looks great to me.
I am just worried about the above line - it wouldn't allow configurations like
arm64-dpaa2-linuxapp-gcc or arm64-armv8a-linuxapp-gcc
Basically, having the MACHINE default to 'native' would not be right in all cases.
Quoted 3 lines
But, I don't have a better idea about how to detect this automatically. Or, we might use
RTE_MACHINEsomeway.
Might I suggest that we default to armv8a for the defconfig in this case? Would that be good enough? If you need something more specific, then use the normal make config T= Also, if you're using an unknown variant, you can always set your RTE_TARGET, as per the other changes in the patch.
A possible proposal for a v2 patch could be:
uname -m Output Target -------- ------------------ aarch64 arm64-armv8a-... armv7l arm-armv7a-... ppc64 ppc_64-power8-... (from wikipedia uname page, could ppc user confirm this for me?) x86_64 x86_64-native-... i686 i686-native-...
Something along the lines of:
.PHONY: defconfig
defconfig:
@$(MAKE) config T=$(shell \
uname -m | awk '{ \
if ($$0 == "aarch64") { \
print "arm64-armv8a"} \
else if ($$0 == "armv7l") { \
print "arm-armv7a"} \
else if ($$0 == "ppc64") { \
print "ppc_64-power8"} \
else { \
printf "%s-native", $$0} }')-$(shell \
uname | awk '{ \
if ($$0 == "Linux") { \
print "linuxapp"} \
else { \
print "bsdapp"} }')-$(shell \
${CC} -v 2>&1 | \
grep " version " | cut -d ' ' -f 1)That might make a reasonable start in the absence of a reliable method of detecting Xgene/ThunderX/DPAA2 variants.
Regards,
Dave.
Re: [PATCH v1 2/2] mk: add sensible default target with defconfig
Hi David,
Quoted 60 lines
-----Original Message-----
From: Hunt, David [mailto:[email protected]]
Sent: Thursday, May 25, 2017 6:34 PM
To: Shreyansh Jain <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v1 2/2] mk: add sensible default target with defconfigHi Shreyansh,
Thanks for your comments. More thoughts below.
Quoted 44 lines · Shreyansh Jain
Hello David,
Quoted 23 lines · David Hunt
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>--- mk/rte.sdkconfig.mk | 15 ++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-)mk/rte.sdkconfig.mk +0
-0@@ -60,16 +60,25 @@ showconfigs: .PHONY: notemplate notemplate:mk/rte.sdkconfig.mk showconfigs: · line 70
Quoted 10 lines
mk/rte.sdkconfig.mk +6
-2- @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell uname -m)-native-$(shell uname | \The idea to have 'make defconfig' do the works looks great to me. I am just worried about the above line - it wouldn't allow configurations like
arm64-dpaa2-linuxapp-gcc or arm64-armv8a-linuxapp-gcc Basically, having the MACHINE default to 'native' would not be right in all cases.Quoted 3 lines
But, I don't have a better idea about how to detect this automatically. Or, we might use
RTE_MACHINEsomeway.
Quoted 5 lines
Might I suggest that we default to armv8a for the defconfig in this case? Would that be good enough? If you need something more specific, then use the normal make config T=
Also, if you're using an unknown variant, you can always set yourRTE_TARGET, as per the other changes in the patch.
Yes. It is futile to find a way to accommodate all types of MACHINEs. This change is targeted for generalizing the config detection, and generic it should remain.
Quoted 34 lines
A possible proposal for a v2 patch could be:
uname -m Output Target -------- ------------------ aarch64 arm64-armv8a-... armv7l arm-armv7a-... ppc64 ppc_64-power8-... (from wikipedia uname page, could ppc userconfirm this for me?)
x86_64x86_64-native-...
i686 i686-native-...Something along the lines of:
.PHONY: defconfig
defconfig:@$(MAKE) config T=$(shell \ uname -m | awk '{ \ if ($$0 == "aarch64") { \ print "arm64-armv8a"} \ else if ($$0 == "armv7l") { \ print "arm-armv7a"} \ else if ($$0 == "ppc64") { \ print "ppc_64-power8"} \ else { \ printf "%s-native", $$0} }')-$(shell \ uname | awk '{ \ if ($$0 == "Linux") { \ print "linuxapp"} \ else { \ print "bsdapp"} }')-$(shell \ ${CC} -v 2>&1 | \ grep " version " | cut -d ' ' -f 1)
Quoted 2 lines
That might make a reasonable start in the absence of a reliable method of detecting Xgene/ThunderX/DPAA2 variants.
Sounds reasonable to me. We can probably improve the above check in future as and more definitive way of detecting machine are identified. I can ack the series if you can push the above change.
Quoted 6 lines
Regards,
Dave.
-
Shreyansh
v2 cover mk: make config enhancements
In reply to David HuntThis patch series is a couple of small patches to make the 'make config' of the build a bit easier for users.
Users can now 'make defconfig' which will pick a sensible default based on some 'uname' queries of the system.
Users can also set RTE_TARGET on in their environment which will get picked users type 'make config' without T=template.
v2 changes:
Added better handling for non-IA platforms. The list is now as follows:
uname -m Output Target -------- ------------------ aarch64 arm64-armv8a-... armv7l arm-armv7a-... ppc64 ppc_64-power8-... x86_64 x86_64-native-... i686 i686-native-...
[1/2] mk: allow use of environment var for make config [2/2] mk: add sensible default target with defconfig
PATCH v2 1/2 mk: allow use of environment var for make config
Users can now set RTE_TARGET in their environment and use 'make config' without T=template.
If RTE_TARGET is set in the user's environment, and if T= is not used, 'make config' will use $RTE_TARGET.
--- mk/rte.sdkroot.mk | 2 ++ 1 file changed, 2 insertions(+)
mk/rte.sdkroot.mk +2 -0
@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else ifdef RTE_TARGET +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TARGET) endif export RTE_CONFIG_TEMPLATE
Signature · 1 line
2.7.4
PATCH v2 2/2 mk: add sensible default target with defconfig
In reply to David HuntUsers can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to use
--- mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 27 insertions(+), 5 deletions(-)
mk/rte.sdkconfig.mk +25 -3
@@ -60,16 +60,38 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell \ + uname -m | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | awk '{ \ + if ($$0 == "Linux") { \ + print "linuxapp"} \ + else { \ + print "bsdapp"} }')-$(shell \ + ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):
mk/rte.sdkroot.mk +2 -2
@@ -90,8 +90,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Signature · 1 line
2.7.4
Quoted 19 lines · David Hunt
This patch series is a couple of small patches to make the 'make config' of the build a bit easier for users.
Users can now 'make defconfig' which will pick a sensible default based on some 'uname' queries of the system.
Users can also set
RTE_TARGETon in their environment which will get picked users type 'make config' without T=template.v2 changes:
Added better handling for non-IA platforms. The list is now as follows: uname -m Output Target -------- ------------------ aarch64 arm64-armv8a-... armv7l arm-armv7a-... ppc64 ppc_64-power8-... x86_64 x86_64-native-... i686 i686-native-...
Quoted 3 lines
[1/2] mk: allow use of environment var for make config [2/2] mk: add sensible default target with defconfig
Re: [PATCH v2 1/2] mk: allow use of environment var for make config
In reply to David HuntShreyansh,
I found an issue (or two) with this part of the patch, and have a
proposed solution.
1. RTE_TARGET originally had a different meaning. It was used for making examples, specifying the target directory of where the SDK was built. It's not good to re-purpose this for something else, as I'm doing in this patch. (even though I'm not sure that variable is suitably named in the first place, but that's a different issue).
2. If we set RTE_TARGET on the environment, we will break the 'make -C examples/<app>', unless we set RTE_TARGET to be something else (i.e. 'make -C examples/<app> RTE_TARGET=build'). One value for making DPDK, and another for building examples. It's confusing to the user.
An alternative patch would be as follows:
RTE_CONFIG_TEMPLATE :=
ifdef T
*-ifeq ("$(origin T)", "command line")*
RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T)
*-endif**
*endif
export RTE_CONFIG_TEMPLATE
So instead of setting 'RTE_TARGET' on in the environment, we set 'T' instead. This allows 'T' to come from the command line OR an environment variable. It resolves the 'make examples' issue, and everything else works as it did before, 'make install', etc. It seems to me to be a cleaner solution for this. What do you think? If it's OK with you, I'll submit a v3 (the 'make defconfig' part of the patchset will remain the same as v2).
Rgds,
Dave.
Quoted 24 lines · David Hunt
Users can now set
RTE_TARGETin their environment and use 'make config' without T=template.If
RTE_TARGETis set in the user's environment, and if T= is not used, 'make config' will use $RTE_TARGET.Signed-off-by David Hunt <[email protected]>--- mk/rte.sdkroot.mk | 2 ++ 1 file changed, 2 insertions(+)mk/rte.sdkroot.mk +2
-0@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else ifdef RTE_TARGET +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TARGET) endif export RTE_CONFIG_TEMPLATE
Re: [PATCH v2 1/2] mk: allow use of environment var for make config
Hello David,
Quoted 6 lines · David
Shreyansh,
I found an issue (or two) with this part of the patch, and have a
proposed solution.1.
RTE_TARGEToriginally had a different meaning. It was used for making examples, specifying the target directory of where the SDK was built. It's not good to re-purpose this for something else, as I'm doing in this patch. (even though I'm not sure that variable is suitably named in the first place, but that's a different issue).
Even I didn't realize this until you highlighted here.
Quoted 1 line
2. If we set
RTE_TARGETon the environment, we will break the 'make -C examples/<app>', unless we setRTE_TARGETto be something else (i.e. 'make -C examples/<app> RTE_TARGET=build'). One value for making DPDK, and another for building examples. It's confusing to the user.
Agree about re-using RTE_TARGET is breaking existing assumption about its use.
Quoted 10 lines
An alternative patch would be as follows:
RTE_CONFIG_TEMPLATE:=
ifdef T
*-ifeq ("$(origin T)", "command line")*
RTE_CONFIG_TEMPLATE:= $(RTE_SRCDIR)/config/defconfig_$(T)
*-endif**
*endif
exportRTE_CONFIG_TEMPLATE
So, that would mean, user would do either of the following:
make T=<template> config
or
export T=<template>
make config
Is that correct? (I tried it and it seems to be working fine) First method is same as today. For the second, I am just skeptical whether we should use such a small identifier ("T") or we have a new RTE_TEMPLATE.
Either way, I am OK. [export T=<template>] looks fine to me - in fact,
on a second though, IMO, if T=<template> is provided as command line, it should also be acceptable as env variable.
Quoted 34 lines
So instead of setting '
RTE_TARGET' on in the environment, we set 'T' instead. This allows 'T' to come from the command line OR an environment variable. It resolves the 'make examples' issue, and everything else works as it did before, 'make install', etc. It seems to me to be a cleaner solution for this. What do you think? If it's OK with you, I'll submit a v3 (the 'make defconfig' part of the patchset will remain the same as v2).Rgds,
Dave.Quoted 23 lines · David Hunt
Users can now set
RTE_TARGETin their environment and use 'make config' without T=template.If
RTE_TARGETis set in the user's environment, and if T= is not used, 'make config' will use $RTE_TARGET.Signed-off-by David Hunt <[email protected]>--- mk/rte.sdkroot.mk | 2 ++ 1 file changed, 2 insertions(+)mk/rte.sdkroot.mk +2
-0@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else ifdef RTE_TARGET +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TARGET) endif export RTE_CONFIG_TEMPLATE
Re: [PATCH v2 1/2] mk: allow use of environment var for make config
Hi Shreyansh,
Quoted 38 lines · Shreyansh Jain
Hello David,
Quoted 6 lines · David
Shreyansh,
I found an issue (or two) with this part of the patch, and have
a proposed solution.1.
RTE_TARGEToriginally had a different meaning. It was used for making examples, specifying the target directory of where the SDK was built. It's not good to re-purpose this for something else, as I'm doing in this patch. (even though I'm not sure that variable is suitably named in the first place, but that's a different issue).Even I didn't realize this until you highlighted here.
Quoted 3 lines
2. If we set
RTE_TARGETon the environment, we will break the 'make
-C examples/<app>', unless we setRTE_TARGETto be something else
(i.e. 'make -C examples/<app> RTE_TARGET=build'). One value for making DPDK, and another for building examples. It's confusing to the user.Agree about re-using
RTE_TARGETis breaking existing assumption about its use.Quoted 10 lines
An alternative patch would be as follows:
RTE_CONFIG_TEMPLATE:=
ifdef T
*-ifeq ("$(origin T)", "command line")*
RTE_CONFIG_TEMPLATE:= $(RTE_SRCDIR)/config/defconfig_$(T)
*-endif**
*endif
exportRTE_CONFIG_TEMPLATESo, that would mean, user would do either of the following:
make T=<template> config
or
export T=<template>
make config
Quoted 8 lines
Is that correct? (I tried it and it seems to be working fine) First method is same as today. For the second, I am just skeptical whether we should use such a small identifier ("T") or we have a new
RTE_TEMPLATE.Either way, I am OK. [export T=<template>] looks fine to me - in fact,
on a second though, IMO, if T=<template> is provided as command line, it should also be acceptable as env variable.
I did a quick poll here in the office and people feel that 'T' is too short for an environment variable. RTE_TEMPLATE would be preferred, and it's a sensible choice that does not conflict with RTE_TARGET.
So if we use RTE_TEMPLATE, we'd also have to put in a couple of lines for the "make install" case, but it's still a small enough patch:
mk/rte.sdkinstall.mk +0 -0
@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif
*+ifndef T**
**+T := $(RTE_TEMPLATE)**
**+endif**
* ifdef T # defaults with T= will install an almost flat staging tree export prefix ?=
kerneldir ?= $(prefix)/kmod
mk/rte.sdkroot.mk +0 -0
@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif
*+else**
**+RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)**
* endif
export RTE_CONFIG_TEMPLATE
So if T is provided on the command line, it takes priority. If that seems reasonable to you, I'll push up a v3. :)
Regards,
Dave.
Re: [PATCH v2 1/2] mk: allow use of environment var for make config
Quoted 84 lines · David
Hi Shreyansh,
Quoted 38 lines · Shreyansh Jain
Hello David,
Quoted 6 lines · David
Shreyansh,
I found an issue (or two) with this part of the patch, and have
a proposed solution.1.
RTE_TARGEToriginally had a different meaning. It was used for making examples, specifying the target directory of where the SDK was built. It's not good to re-purpose this for something else, as I'm doing in this patch. (even though I'm not sure that variable is suitably named in the first place, but that's a different issue).Even I didn't realize this until you highlighted here.
Quoted 3 lines
2. If we set
RTE_TARGETon the environment, we will break the 'make
-C examples/<app>', unless we setRTE_TARGETto be something else
(i.e. 'make -C examples/<app> RTE_TARGET=build'). One value for making DPDK, and another for building examples. It's confusing to the user.Agree about re-using
RTE_TARGETis breaking existing assumption about its use.Quoted 10 lines
An alternative patch would be as follows:
RTE_CONFIG_TEMPLATE:=
ifdef T
*-ifeq ("$(origin T)", "command line")*
RTE_CONFIG_TEMPLATE:= $(RTE_SRCDIR)/config/defconfig_$(T)
*-endif**
*endif
exportRTE_CONFIG_TEMPLATESo, that would mean, user would do either of the following:
make T=<template> config
or
export T=<template>
make configQuoted 8 lines
Is that correct? (I tried it and it seems to be working fine) First method is same as today. For the second, I am just skeptical whether we should use such a small identifier ("T") or we have a new
RTE_TEMPLATE.Either way, I am OK. [export T=<template>] looks fine to me - in fact,
on a second though, IMO, if T=<template> is provided as command line, it should also be acceptable as env variable.I did a quick poll here in the office and people feel that 'T' is too short for an environment variable.
RTE_TEMPLATEwould be preferred, and it's a sensible choice that does not conflict withRTE_TARGET.So if we use
RTE_TEMPLATE, we'd also have to put in a couple of lines for the "make install" case, but it's still a small enough patch:mk/rte.sdkinstall.mk +0
-0@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif *+ifndef T** **+T := $(RTE_TEMPLATE)** **+endif*** ifdef T # defaults with T= will install an almost flat staging tree export prefix ?=
kerneldir ?= $(prefix)/kmodmk/rte.sdkroot.mk +0
-0@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif *+else** **+RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)** * endif export RTE_CONFIG_TEMPLATE
Quoted 2 lines
So if T is provided on the command line, it takes priority. If that seems reasonable to you, I'll push up a v3. :)
Sounds good to me.
Feel free to add my signoff to v3.
Quoted 8 lines
Regards,
Dave.
Re: [PATCH v2 1/2] mk: allow use of environment var for make config
Quoted 96 lines · Shreyansh Jain
Quoted 95 lines · David
Hi Shreyansh,
Quoted 45 lines · Shreyansh Jain
Hello David,
Quoted 11 lines · David
Shreyansh,
I found an issue (or two) with this part of the patch, and
have a proposed solution.1.
RTE_TARGEToriginally had a different meaning. It was used for making examples, specifying the target directory of where the SDK was built. It's not good to re-purpose this for something else, as I'm doing in this patch. (even though I'm not sure that variable is suitably named in the first place, but that's a different issue).Even I didn't realize this until you highlighted here.
Quoted 5 lines
2. If we set
RTE_TARGETon the environment, we will break the 'make -C examples/<app>', unless we setRTE_TARGETto be something else (i.e. 'make -C examples/<app> RTE_TARGET=build'). One value for making DPDK, and another for building examples. It's confusing to the user.Agree about re-using
RTE_TARGETis breaking existing assumption about its use.Quoted 10 lines
An alternative patch would be as follows:
RTE_CONFIG_TEMPLATE:=
ifdef T
*-ifeq ("$(origin T)", "command line")*
RTE_CONFIG_TEMPLATE:= $(RTE_SRCDIR)/config/defconfig_$(T)
*-endif**
*endif
exportRTE_CONFIG_TEMPLATESo, that would mean, user would do either of the following:
make T=<template> config
or
export T=<template>
make configQuoted 9 lines
Is that correct? (I tried it and it seems to be working fine) First method is same as today. For the second, I am just skeptical whether we should use such a small identifier ("T") or we have a new
RTE_TEMPLATE.Either way, I am OK. [export T=<template>] looks fine to me - in fact, on a second though, IMO, if T=<template> is provided as command line, it should also be acceptable as env variable.
I did a quick poll here in the office and people feel that 'T' is too short for an environment variable.
RTE_TEMPLATEwould be preferred, and it's a sensible choice that does not conflict withRTE_TARGET.So if we use
RTE_TEMPLATE, we'd also have to put in a couple of lines for the "make install" case, but it's still a small enough patch:mk/rte.sdkinstall.mk +0
-0@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif *+ifndef T** **+T := $(RTE_TEMPLATE)** **+endif*** ifdef T # defaults with T= will install an almost flat staging tree export prefix ?=
kerneldir ?= $(prefix)/kmodmk/rte.sdkroot.mk +0
-0@@ -63,6 +63,8 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif *+else** **+RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE)** * endif export RTE_CONFIG_TEMPLATE
Quoted 7 lines
Quoted 2 lines
So if T is provided on the command line, it takes priority. If that seems reasonable to you, I'll push up a v3. :)
Sounds good to me.
Feel free to add my signoff to v3.Quoted 1 line
In another shameless plug, can you guys perhaps take a look at the RFC I've just posted[1], as an option to move away from this whole area of RTE_TARGET/RTE_SDK, and the complexity such as this that it brings. Let me know any thoughts or comments you have.
Thanks,
/Bruce
v3 cover mk: make config enhancements
In reply to David HuntThis patch series is a couple of small patches to make the 'make config' of the build a bit easier for users.
Users can now 'make defconfig' which will pick a sensible default based on some 'uname' queries of the system.
Users can also set RTE_TEMPLATE in their environment which will get picked users type 'make config' without T=template.
The changes are documented in docs/build-sdk-quick.txt.
v2 changes:
Added better handling for non-IA platforms. The list is now as follows:
uname -m Output Target -------- ------------------ aarch64 arm64-armv8a-... armv7l arm-armv7a-... ppc64 ppc_64-power8-... x86_64 x86_64-native-... i686 i686-native-...
v3 changes:
* Changed the use of RTE_TARGET back to it's original purpose and added new environmental variable RTE_TEMPLATE. Fully backward compatible if this is not set.
* Added documentation changes to build-sdk-quick.txt to describe additions.
[1/3] mk: add sensible default target with defconfig [2/3] mk: allow use of environment var for template [3/3] doc: update build-sdk-quick txt file
PATCH v3 1/3 mk: add sensible default target with defconfig
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to use
--- mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 27 insertions(+), 5 deletions(-)
mk/rte.sdkconfig.mk +25 -3
@@ -60,16 +60,38 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell \ + uname -m | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | awk '{ \ + if ($$0 == "Linux") { \ + print "linuxapp"} \ + else { \ + print "bsdapp"} }')-$(shell \ + ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):
mk/rte.sdkroot.mk +2 -2
@@ -88,8 +88,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Signature · 1 line
2.7.4
PATCH v3 2/3 mk: allow use of environment var for template
In reply to David HuntAdded new environment variable RTE_TEMPLATE which is an additional variable that can be set in the users environment. This maps on to the existing 'T' command line variable typically used when 'make config' or 'make install' is invoked.
So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by 'make config'. If the user instead chooses to 'make install', this will do the configure, build, and install in one step.
--- mk/rte.sdkinstall.mk | 4 ++++ mk/rte.sdkroot.mk | 4 ++++ 2 files changed, 8 insertions(+)
mk/rte.sdkinstall.mk +4 -0
@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif +ifndef T +T := $(RTE_TEMPLATE) +endif + ifdef T # defaults with T= will install an almost flat staging tree export prefix ?= kerneldir ?= $(prefix)/kmod
mk/rte.sdkroot.mk +4 -0
@@ -63,6 +63,10 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else +ifdef RTE_TEMPLATE +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE) +endif endif export RTE_CONFIG_TEMPLATE
Signature · 1 line
2.7.4
PATCH v3 3/3 doc: update build-sdk-quick txt file
In reply to David Hunt * Add in information about 'make defconfig'
* Add in information about RTE_TEMPLATE environment variable
* Explain the default directory for 'O=' a bit better
* Clean up text alignment
--- doc/build-sdk-quick.txt | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
doc/build-sdk-quick.txt +19 -9
@@ -1,7 +1,10 @@ Basic build + make defconfig && make + or make config T=x86_64-native-linuxapp-gcc && make Build commands config get configuration from target template (T=) + defconfig auto-select target template based on arch, OS, etc. all same as build (default rule) build build in a configured directory clean remove files but keep configuration
@@ -18,12 +21,19 @@ Build variables EXTRA_LDLIBS linker library options RTE_KERNELDIR linux headers path RTE_DEVEL_BUILD stricter options (default: y in git tree) - CROSS toolchain prefix - V verbose - D debug dependencies - O build directory (default: build/ - install T= default: ./) - DESTDIR staging install directory (default: empty) - prefix root install directory (default: /usr/local) - T target template - used with config or install - format: <arch-machine-execenv-toolchain> - templates in config/defconfig_* + CROSS toolchain prefix + V verbose + D debug dependencies + O build directory (default different depending on use): + make defconfig, default: build/ + make config T=xyz, default: build/ + make, default: build/ + make install T=xyz, default: xyz/ + DESTDIR staging install directory (default: empty) + prefix root install directory (default: /usr/local) + T target template - used with config or install + format: <arch-machine-execenv-toolchain> + templates in config/defconfig_* + RTE_TEMPLATE Set this as an environment variable to replace (T=) + Example: export RTE_TEMPLATE=x86_64-native-linuxapp-gcc + make config && make
Signature · 1 line
2.7.4
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
In reply to David Hunt-----Original Message-----
Quoted 12 lines
Date: Wed, 7 Jun 2017 15:37:55 +0100
From: David Hunt <[email protected]>
To: [email protected]
CC: [email protected], [email protected], David Hunt
<[email protected]>
Subject: [dpdk-dev] [PATCH v3 1/3] mk: add sensible default target with
defconfig
X-Mailer: git-send-email 2.7.4Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
Quoted 8 lines
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>
Tested on a arm64 target:
Quoted 69 lines
--- mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 2 files changed, 27 insertions(+), 5 deletions(-)mk/rte.sdkconfig.mk +25
-3@@ -60,16 +60,38 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell \ + uname -m | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | awk '{ \ + if ($$0 == "Linux") { \ + print "linuxapp"} \ + else { \ + print "bsdapp"} }')-$(shell \ + ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):mk/rte.sdkroot.mk +2
-2@@ -88,8 +88,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etagsSignature · 1 line
2.7.4
Re: [PATCH v3 2/3] mk: allow use of environment var for template
In reply to David Hunt-----Original Message-----
Quoted 14 lines
Date: Wed, 7 Jun 2017 15:37:56 +0100
From: David Hunt <[email protected]>
To: [email protected]
CC: [email protected], [email protected], David Hunt
<[email protected]>
Subject: [dpdk-dev] [PATCH v3 2/3] mk: allow use of environment var for
template
X-Mailer: git-send-email 2.7.4Added new environment variable
RTE_TEMPLATEwhich is an additional variable that can be set in the users environment. This maps on to the existing 'T' command line variable typically used when 'make config' or 'make install' is invoked.
Quoted 7 lines
So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by 'make config'. If the user instead chooses to 'make install', this will do the configure, build, and install in one step.
Signed-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>
Quoted 38 lines
--- mk/rte.sdkinstall.mk | 4 ++++ mk/rte.sdkroot.mk | 4 ++++ 2 files changed, 8 insertions(+)mk/rte.sdkinstall.mk +4
-0@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif +ifndef T +T := $(RTE_TEMPLATE) +endif + ifdef T # defaults with T= will install an almost flat staging tree export prefix ?= kerneldir ?= $(prefix)/kmodmk/rte.sdkroot.mk +4
-0@@ -63,6 +63,10 @@ ifdef T ifeq ("$(origin T)", "command line") RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(T) endif +else +ifdef RTE_TEMPLATE +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE) +endif endif export RTE_CONFIG_TEMPLATESignature · 1 line
2.7.4
Re: [PATCH v3 3/3] doc: update build-sdk-quick txt file
In reply to David HuntQuoted 10 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Wednesday, June 7, 2017 3:38 PM
To: [email protected]
Cc: [email protected]; [email protected]; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] doc: update build-sdk-quick txt file
Quoted 6 lines
* Add in information about 'make defconfig'
* Add in information aboutRTE_TEMPLATEenvironment variable
* Explain the default directory for 'O=' a bit better
* Clean up text alignmentSigned-off-by David Hunt <[email protected]>
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
In reply to David Hunt07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>
Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)
Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATE is not defined in this patch
(and I do not see the benefit in next patch).
Re: [PATCH v3 2/3] mk: allow use of environment var for template
In reply to David Hunt07/06/2017 16:37, David Hunt:
Quoted 9 lines
Added new environment variable
RTE_TEMPLATEwhich is an additional variable that can be set in the users environment. This maps on to the existing 'T' command line variable typically used when 'make config' or 'make install' is invoked.So, instead of typing 'make config T=x86_64-native-linuxapp-gcc', the user can now do 'export RTE_TEMPLATE=x86_64-native-linuxapp-gcc' followed by 'make config'. If the user instead chooses to 'make install', this will do the configure, build, and install in one step.
[...]
mk/rte.sdkinstall.mk ifneq ($(MAKECMDGOALS),pre_install) · line 52
Quoted 9 lines
mk/rte.sdkinstall.mk +3
-0@@ -47,6 +47,10 @@ ifneq ($(MAKECMDGOALS),pre_install) include $(RTE_SDK)/mk/rte.vars.mk endif +ifndef T +T := $(RTE_TEMPLATE) +endif
"make install T=" is an old syntax.
We should drop this non-standard syntax.
So I prefer we do not encourage it with this variable.
mk/rte.sdkroot.mk ifdef T · line 69
Quoted 5 lines
mk/rte.sdkroot.mk +3
-0+ifdef RTE_TEMPLATE +RTE_CONFIG_TEMPLATE := $(RTE_SRCDIR)/config/defconfig_$(RTE_TEMPLATE) +endif
What is the benefit of exporting RTE_TEMPLATE instead of T= ? I am afraid it get more confusion.
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
In reply to Thomas Monjalon-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, 3 August, 2017 11:40 PM
To: Hunt, David <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 1/3] mk: add sensible default target with defconfig
07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>
Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)
Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATE is not defined in this patch (and I do not see the benefit in next patch).
Thomas,
Does this mean that this patch is not going into this release? It has been acked for almost a month now, with no further comment. The one hour between your comment and the release of RC4 did not give me a reasonable amount of time to address your concerns. I also feel that the lack of comments in the last month should mean that the patch should be applied as is. If changes are required, I am happy to address in the next release.
Regards,
Dave.
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
04/08/2017 10:22, Hunt, David:
Quoted 22 lines
From: Thomas Monjalon [mailto:[email protected]] 07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
Quoted 8 lines
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATEis not defined in this patch (and I do not see the benefit in next patch).Thomas,
Does this mean that this patch is not going into this release? It has been acked for almost a month now, with no further comment. The one hour between your comment and the release of RC4 did not give me a reasonable amount of time to address your concerns. I also feel that the lack of comments in the last month should mean that the patch should be applied as is. If changes are required, I am happy to address in the next release.
You're right, I'm very sorry not taking time to review it before. I think only the first patch should be integrated, without the comment for RTE_CONFIG_TEMPLATE.
Opinion?
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
Quoted 26 lines · Thomas Monjalon
04/08/2017 10:22, Hunt, David:
Quoted 25 lines
From: Thomas Monjalon [mailto:[email protected]] 07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATEis not defined in this patch (and I do not see the benefit in next patch).
Quoted 6 lines
Quoted 2 lines
Thomas,
Does this mean that this patch is not going into this release? It has been acked for almost a month now, with no further comment. The one hour between your comment and the release of RC4 did not give me a reasonable amount of time to address your concerns. I also feel that the lack of comments in the last month should mean that the patch should be applied as is. If changes are required, I am happy to address in the next release.You're right, I'm very sorry not taking time to review it before. I think only the first patch should be integrated, without the comment for
RTE_CONFIG_TEMPLATE.
Opinion?
OK, I would be OK with the first patch. However, I think the RTE_CONFIG_TEMPLATE comment part of the patch is fine, we just tested it here. It's only RTE_TEMPLATE I'm introducing in the second patch, nor RTE_CONFIG_TEMPLATE. That existed before this patch set. So the echo command in the first patch works fine, and shows the user what template the script has used to configure itself.
I could upload another patch with just the first patch (and the relevant 2 lines from the docs patch) as a v4?
Regards,
Dave.
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
04/08/2017 11:53, Hunt, David:
Quoted 35 lines · Thomas Monjalon
Quoted 26 lines
04/08/2017 10:22, Hunt, David:
Quoted 25 lines
From: Thomas Monjalon [mailto:[email protected]] 07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATEis not defined in this patch (and I do not see the benefit in next patch).Quoted 6 lines
Quoted 2 lines
Thomas,
Does this mean that this patch is not going into this release? It has been acked for almost a month now, with no further comment. The one hour between your comment and the release of RC4 did not give me a reasonable amount of time to address your concerns. I also feel that the lack of comments in the last month should mean that the patch should be applied as is. If changes are required, I am happy to address in the next release.You're right, I'm very sorry not taking time to review it before. I think only the first patch should be integrated, without the comment for
RTE_CONFIG_TEMPLATE.
Opinion?
Quoted 6 lines
OK, I would be OK with the first patch. However, I think the
RTE_CONFIG_TEMPLATEcomment part of the patch is fine, we just tested it here. It's onlyRTE_TEMPLATEI'm introducing in the second patch, norRTE_CONFIG_TEMPLATE. That existed before this patch set. So the echo command in the first patch works fine, and shows the user what template the script has used to configure itself.
Ah OK I totally missed it :)
Quoted 2 lines
I could upload another patch with just the first patch (and the relevant 2 lines from the docs patch) as a v4?
Yes perfect
PATCH v4 1/1 mk: add sensible default target with defconfig
In reply to David HuntUsers can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to use
--- doc/build-sdk-quick.txt | 2 ++ mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-)
doc/build-sdk-quick.txt +2 -0
@@ -1,4 +1,6 @@ Basic build + make defconfig && make + or make config T=x86_64-native-linuxapp-gcc && make Build commands config get configuration from target template (T=)
mk/rte.sdkconfig.mk +25 -3
@@ -60,16 +60,38 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell \ + uname -m | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | awk '{ \ + if ($$0 == "Linux") { \ + print "linuxapp"} \ + else { \ + print "bsdapp"} }')-$(shell \ + ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):
mk/rte.sdkroot.mk +2 -2
@@ -88,8 +88,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Signature · 1 line
2.7.4
PATCH v5 1/1 mk: add sensible default target with defconfig
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to use
--- doc/build-sdk-quick.txt | 3 +++ mk/rte.sdkconfig.mk | 28 +++++++++++++++++++++++++--- mk/rte.sdkroot.mk | 4 ++-- 3 files changed, 30 insertions(+), 5 deletions(-)
doc/build-sdk-quick.txt +3 -0
@@ -1,7 +1,10 @@ Basic build + make defconfig && make + or make config T=x86_64-native-linuxapp-gcc && make Build commands config get configuration from target template (T=) + defconfig auto-select target template based on arch, OS, etc. all same as build (default rule) build build in a configured directory clean remove files but keep configuration
mk/rte.sdkconfig.mk +25 -3
@@ -60,16 +60,38 @@ showconfigs: .PHONY: notemplate notemplate: - @printf "No template specified. " - @echo "Use T=template among the following list:" + @printf "No template specified. Use 'make defconfig' or " + @echo "use T=template from the following list:" @$(MAKE) -rR showconfigs | sed 's,^, ,' + +.PHONY: defconfig +defconfig: + @$(MAKE) config T=$(shell \ + uname -m | awk '{ \ + if ($$0 == "aarch64") { \ + print "arm64-armv8a"} \ + else if ($$0 == "armv7l") { \ + print "arm-armv7a"} \ + else if ($$0 == "ppc64") { \ + print "ppc_64-power8"} \ + else { \ + printf "%s-native", $$0} }')-$(shell \ + uname | awk '{ \ + if ($$0 == "Linux") { \ + print "linuxapp"} \ + else { \ + print "bsdapp"} }')-$(shell \ + ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1) + .PHONY: config ifeq ($(RTE_CONFIG_TEMPLATE),) config: notemplate else config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile - @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g") endif $(RTE_OUTPUT):
mk/rte.sdkroot.mk +2 -2
@@ -88,8 +88,8 @@ export ROOTDIRS-y ROOTDIRS- ROOTDIRS-n .PHONY: default default: all -.PHONY: config showconfigs showversion showversionum -config showconfigs showversion showversionum: +.PHONY: defconfig config showconfigs showversion showversionum +defconfig config showconfigs showversion showversionum: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk $@ .PHONY: cscope gtags tags etags
Signature · 1 line
2.7.4
Re: [PATCH v3 1/3] mk: add sensible default target with defconfig
In reply to Thomas MonjalonQuoted 40 lines · Thomas Monjalon
04/08/2017 11:53, Hunt, David:
Quoted 33 lines · Thomas Monjalon
Quoted 26 lines
04/08/2017 10:22, Hunt, David:
Quoted 25 lines
From: Thomas Monjalon [mailto:[email protected]] 07/06/2017 16:37, David Hunt:
Quoted 11 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>Looks to be a good idea if it is really automatic.
mk/rte.sdkconfig.mk showconfigs: · line 86
Quoted 2 lines
mk/rte.sdkconfig.mk +2
-0+ ${CC} -v 2>&1 | \ + grep " version " | cut -d ' ' -f 1)Unfortunately, it depends on $CC which is not commonly exported. What about defaulting to gcc?
mk/rte.sdkconfig.mk showconfigs: · line 94
Quoted 3 lines
mk/rte.sdkconfig.mk +2
-1- @echo "Configuration done" + @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
RTE_CONFIG_TEMPLATEis not defined in this patch (and I do not see the benefit in next patch).Quoted 6 lines
Quoted 2 lines
Thomas,
Does this mean that this patch is not going into this release? It has been acked for almost a month now, with no further comment. The one hour between your comment and the release of RC4 did not give me a reasonable amount of time to address your concerns. I also feel that the lack of comments in the last month should mean that the patch should be applied as is. If changes are required, I am happy to address in the next release.You're right, I'm very sorry not taking time to review it before. I think only the first patch should be integrated, without the comment for
RTE_CONFIG_TEMPLATE.
Opinion?Quoted 6 lines
OK, I would be OK with the first patch. However, I think the
RTE_CONFIG_TEMPLATEcomment part of the patch is fine, we just tested it here. It's onlyRTE_TEMPLATEI'm introducing in the second patch, norRTE_CONFIG_TEMPLATE. That existed before this patch set. So the echo command in the first patch works fine, and shows the user what template the script has used to configure itself.
Quoted 6 lines
Ah OK I totally missed it :)
Quoted 2 lines
I could upload another patch with just the first patch (and the relevant 2 lines from the docs patch) as a v4?
Yes perfect
Thomas,
OK, V5 sent. (v4 had 1 line missing in docs). There's just the one patch in the set now. Thanks,
Dave.
Re: [PATCH v5] mk: add sensible default target with defconfig
In reply to David Hunt04/08/2017 12:39, David Hunt:
Quoted 13 lines
Users can now use 'make defconfig' to generate a configuration using the most appropriate defaults for the current machine.
<arch-machine-execenv-toolchain>
arch taken from uname -m
machine defaults to native
execenv is taken from uname, Linux=linuxapp, otherwise bsdapp toolchain is taken from $CC -v to see which compiler to useSigned-off-by David Hunt <[email protected]>Acked-by Shreyansh Jain <[email protected]>Tested-by Jerin Jacob <[email protected]>---
[...]
doc/build-sdk-quick.txt line 4
Quoted 7 lines
doc/build-sdk-quick.txt +2
-0@@ -1,7 +1,10 @@ Basic build + make defconfig && make + or make config T=x86_64-native-linuxapp-gcc && make
Nice :)
doc/build-sdk-quick.txt line 6
Quoted 2 lines
doc/build-sdk-quick.txt +2
-0+ @echo "Configuration done using "$(shell basename \ + $(RTE_CONFIG_TEMPLATE) | sed "s/defconfig_//g")
Excuse me for being pedantic with Makefile, I will avoid shell invocation:
+ @echo "Configuration done using" \
+ $(patsubst defconfig_%,%,$(notdir $(RTE_CONFIG_TEMPLATE)))
Applied with my pedantic change, thanks :)
Ferruh Yigit
Acked-byRe: [PATCH v3 3/3] doc: update build-sdk-quick txt file
In reply to Mcnamara, JohnQuoted 10 lines · John
Quoted 10 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Wednesday, June 7, 2017 3:38 PM
To: [email protected]
Cc: [email protected]; [email protected]; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] doc: update build-sdk-quick txt file
Quoted 8 lines
Quoted 6 lines
* Add in information about 'make defconfig'
* Add in information aboutRTE_TEMPLATEenvironment variable
* Explain the default directory for 'O=' a bit better
* Clean up text alignmentSigned-off-by David Hunt <[email protected]>Acked-by John McNamara <[email protected]>
Re: [PATCH v3 3/3] doc: update build-sdk-quick txt file
13/02/2018 13:18, Ferruh Yigit:
Quoted 14 lines · John
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Wednesday, June 7, 2017 3:38 PM
To: [email protected]
Cc: [email protected]; [email protected]; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] doc: update build-sdk-quick txt file* Add in information about 'make defconfig'
* Add in information aboutRTE_TEMPLATEenvironment variable
* Explain the default directory for 'O=' a bit better
* Clean up text alignment
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by David Hunt <[email protected]>Acked-by John McNamara <[email protected]>Acked-by Ferruh Yigit <[email protected]>
I made some comments in patch 2 about RTE_TEMPLATE and got no reply (in August).
This patch is dependent on RTE_TEMPLATE.
One more nit: the indent is broken for T variable explanation.
Re: [PATCH v3 3/3] doc: update build-sdk-quick txt file
Hi Thomas
Quoted 15 lines · Thomas Monjalon
13/02/2018 13:18, Ferruh Yigit:
Quoted 14 lines · John
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of David Hunt
Sent: Wednesday, June 7, 2017 3:38 PM
To: [email protected]
Cc: [email protected]; [email protected]; Hunt, David <[email protected]>
Subject: [dpdk-dev] [PATCH v3 3/3] doc: update build-sdk-quick txt file* Add in information about 'make defconfig'
* Add in information aboutRTE_TEMPLATEenvironment variable
* Explain the default directory for 'O=' a bit better
* Clean up text alignment
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line
Signed-off-by David Hunt <[email protected]>Acked-by John McNamara <[email protected]>Acked-by Ferruh Yigit <[email protected]>I made some comments in patch 2 about
RTE_TEMPLATEand got no reply (in August).
Since you correctly point out that "make install T=" is an old syntax, and this variable only encourages this, let's drop this patch altogether.
There are two patches in patchwork relevant to this cahange, one is the change, and the other is the docs update. There was a third part, which was for the "make defconfig" functionality, which has already been merged, including a portion of 25113, so both of the following can be closed off.
http://dpdk.org/dev/patchwork/patch/25112/
http://dpdk.org/dev/patchwork/patch/25113/
Quoted 3 lines
This patch is dependent on
RTE_TEMPLATE.One more nit: the indent is broken for T variable explanation.
Re: [PATCH v3 3/3] doc: update build-sdk-quick txt file
11/04/2018 10:44, Hunt, David:
Quoted 7 lines · Thomas Monjalon
Quoted 2 lines
I made some comments in patch 2 about
RTE_TEMPLATEand got no reply (in August).Since you correctly point out that "make install T=" is an old syntax, and this variable only encourages this, let's drop this patch altogether.
Quoted 8 lines
There are two patches in patchwork relevant to this cahange, one is the change, and the other is the docs update. There was a third part, which was for the "make defconfig" functionality, which has already been merged, including a portion of 25113, so both of the following can be closed off.
http://dpdk.org/dev/patchwork/patch/25112/
http://dpdk.org/dev/patchwork/patch/25113/
OK, thanks for the update.