[PATCH net] net: octeon: mgmt: fix xmit hang as busy

2021-04-02 Thread Ivan Khoronzhuk
89503fc0ab Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c index ecffebd513be..be1c353b9

Re: [PATCH] mips: kernel: setup: fix crash kernel resource allocation

2021-02-08 Thread Ivan Khoronzhuk
On Sun, Feb 07, 2021 at 11:18:42AM +0200, Mike Rapoport wrote: On Sat, Feb 06, 2021 at 12:59:40PM +, Ivan Khoronzhuk wrote: In order to avoid crash kernel corruption, its memory is reserved early in memblock and as result, in time when resources are inited it's not present

Re: [PATCH] mips: kernel: setup: fix crash kernel resource allocation

2021-02-08 Thread Ivan Khoronzhuk
On Sun, Feb 07, 2021 at 11:19:03AM +0800, Jinyang He wrote: On 02/06/2021 08:59 PM, Ivan Khoronzhuk wrote: In order to avoid crash kernel corruption, its memory is reserved early in memblock and as result, in time when resources are inited it's not present in memblock.memory, so crash kernel

[PATCH] mips: kernel: setup: fix crash kernel resource allocation

2021-02-06 Thread Ivan Khoronzhuk
it out of loop by inserting it in iomem_resource. Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Ivan Khoronzhuk --- Based on linux-next/master arch/mips/kernel/setup.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/mips/kernel

[PATCH] net: ethernet: cavium: octeon_mgmt: use phy_start and phy_stop

2020-09-25 Thread Ivan Khoronzhuk
ch, so add it as a fix. Fixes: 74a992b3598a ("net: phy: add phy_check_link_status") Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/

Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

2019-10-12 Thread Ivan Khoronzhuk
On Fri, Oct 11, 2019 at 02:16:05PM +0300, Sergei Shtylyov wrote: On 10/11/2019 12:57 PM, Ivan Khoronzhuk wrote: While compiling natively, the host's cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own, used for target arch. While

Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

2019-10-11 Thread Ivan Khoronzhuk
On Fri, Oct 11, 2019 at 11:49:38AM +0300, Sergei Shtylyov wrote: More grammar nitpicking... On 11.10.2019 3:28, Ivan Khoronzhuk wrote: While compiling natively, the host's cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own

Re: [PATCH v5 bpf-next 05/15] samples/bpf: use __LINUX_ARM_ARCH__ selector for arm

2019-10-11 Thread Ivan Khoronzhuk
On Fri, Oct 11, 2019 at 11:46:54AM +0300, Sergei Shtylyov wrote: Hello! Sorry, didn't comment on v4... On 11.10.2019 3:27, Ivan Khoronzhuk wrote: For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction set selector and is absolutely required while parsing some parts of headers

[PATCH v5 bpf-next 03/15] samples/bpf: use --target from cross-compile

2019-10-10 Thread Ivan Khoronzhuk
For cross compiling the target triple can be inherited from cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile. So copy-paste this decision from kernel Makefile. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1

[PATCH v5 bpf-next 00/15] samples: bpf: improve/fix cross-compilation

2019-10-10 Thread Ivan Khoronzhuk
ile: fix cookie_uid_helper_example obj build" - limited -D option filter only for arm - improved comments - added couple instructions to verify cross compilation for arm and arm64 arches based on TI am57xx and am65xx sdks. - corrected include a little order Ivan Khoronzhuk (15): samples/bpf: fix

[PATCH v5 bpf-next 06/15] samples/bpf: drop unnecessarily inclusion for bpf_load

2019-10-10 Thread Ivan Khoronzhuk
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v5 bpf-next 08/15] samples/bpf: base target programs rules on Makefile.target

2019-10-10 Thread Ivan Khoronzhuk
compilation (CC) with host build (HOSTCC), lets base samples on Makefile.target. It allows to cross-compile samples/bpf programs with CC while auxialry tools running on host built with HOSTCC. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 135 ++- 1

[PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

2019-10-10 Thread Ivan Khoronzhuk
-Wmissing-prototypes -Wstrict-prototypes So, add them as they were verified and used before adding Makefile.target and lets omit "-fomit-frame-pointer" as were proposed while review, as no sense in such optimization for samples. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 6

[PATCH v5 bpf-next 12/15] libbpf: add C/LDFLAGS to libbpf.so and test_libpf targets

2019-10-10 Thread Ivan Khoronzhuk
In case of C/LDFLAGS there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like -lelf, wich can be absent in toolchain. This can be used for samples/bpf cross-compiling allowing to get elf lib from sysroot. Signed-off-by: Ivan

[PATCH v5 bpf-next 07/15] samples/bpf: add makefile.target for separate CC target build

2019-10-10 Thread Ivan Khoronzhuk
pf cross compilation. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile.target | 75 + 1 file changed, 75 insertions(+) create mode 100644 samples/bpf/Makefile.target diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target new fi

[PATCH v5 bpf-next 10/15] samples/bpf: use target CC environment for HDR_PROBE

2019-10-10 Thread Ivan Khoronzhuk
No need in hacking HOSTCC to be cross-compiler any more, so drop this trick and use target CC for HDR_PROBE. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/bpf/Makefile b/samples

[PATCH v5 bpf-next 14/15] samples/bpf: add sysroot support

2019-10-10 Thread Ivan Khoronzhuk
clean configure and install headers: make ARCH=arm defconfig make ARCH=arm headers_install build samples/bpf: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \ SYSROOT="path/to/sysroot" Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 +++

Re: [PATCH v4 bpf-next 00/15] samples: bpf: improve/fix cross-compilation

2019-10-10 Thread Ivan Khoronzhuk
On Fri, Oct 11, 2019 at 02:00:56AM +0200, Daniel Borkmann wrote: On Wed, Oct 09, 2019 at 11:41:19PM +0300, Ivan Khoronzhuk wrote: This series contains mainly fixes/improvements for cross-compilation but not only, tested for arm, arm64, and intended for any arch. Also verified on native build

[PATCH v5 bpf-next 11/15] libbpf: don't use cxx to test_libpf target

2019-10-10 Thread Ivan Khoronzhuk
lso remove spaces at start of the lines to keep same style and avoid warns while apply. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/Makefile | 18 +- .../lib/bpf/{test_libbpf.cpp => test_libbpf.c} | 14 -- 2 file

[PATCH v5 bpf-next 05/15] samples/bpf: use __LINUX_ARM_ARCH__ selector for arm

2019-10-10 Thread Ivan Khoronzhuk
t;SMP is not supported" for armv7 and bunch of other errors are issued resulting to incorrect final object. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 1 file changed, 8 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index cf882e43648a..9b33e7395

[PATCH v5 bpf-next 13/15] samples/bpf: provide C/LDFLAGS to libbpf

2019-10-10 Thread Ivan Khoronzhuk
In order to build lib using C/LD flags of target arch, provide them to libbpf make. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a6c33496e8ca..6b161326ac67 100644

[PATCH v5 bpf-next 02/15] samples/bpf: fix cookie_uid_helper_example obj build

2019-10-10 Thread Ivan Khoronzhuk
ve `always += cookie_uid_helper_example.o`, which avoids breaking cross compilation due to mismatched includes. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 4f

[PATCH v5 bpf-next 01/15] samples/bpf: fix HDR_PROBE "echo"

2019-10-10 Thread Ivan Khoronzhuk
echo should be replaced with echo -e to handle '\n' correctly, but instead, replace it with printf as some systems can't handle echo -e. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples

[PATCH v5 bpf-next 15/15] samples/bpf: add preparation steps and sysroot info to readme

2019-10-10 Thread Ivan Khoronzhuk
Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/README.rst | 41 - 1 file changed, 36 insertions(+), 5 deletions(-) diff --git

[PATCH v5 bpf-next 04/15] samples/bpf: use own EXTRA_CFLAGS for clang commands

2019-10-10 Thread Ivan Khoronzhuk
It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/samples

[PATCH v4 bpf-next 02/15] samples/bpf: fix cookie_uid_helper_example obj build

2019-10-09 Thread Ivan Khoronzhuk
ve `always += cookie_uid_helper_example.o`, which avoids breaking cross compilation due to mismatched includes. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 4f

[PATCH v4 bpf-next 01/15] samples/bpf: fix HDR_PROBE "echo"

2019-10-09 Thread Ivan Khoronzhuk
echo should be replaced with echo -e to handle '\n' correctly, but instead, replace it with printf as some systems can't handle echo -e. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf

[PATCH v4 bpf-next 08/15] samples/bpf: base target programs rules on Makefile.target

2019-10-09 Thread Ivan Khoronzhuk
compilation (CC) with host build (HOSTCC), lets base samples on Makefile.target. It allows to cross-compile samples/bpf programs with CC while auxialry tools running on host built with HOSTCC. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 135 ++- 1

[PATCH v4 bpf-next 05/15] samples/bpf: use __LINUX_ARM_ARCH__ selector for arm

2019-10-09 Thread Ivan Khoronzhuk
For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction set selector and is absolutely required while parsing some parts of headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's retrieve it from and add to programs cflags. In another case errors like "SMP is not

[PATCH v4 bpf-next 06/15] samples/bpf: drop unnecessarily inclusion for bpf_load

2019-10-09 Thread Ivan Khoronzhuk
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v4 bpf-next 07/15] samples/bpf: add makefile.target for separate CC target build

2019-10-09 Thread Ivan Khoronzhuk
pf cross compilation. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile.target | 75 + 1 file changed, 75 insertions(+) create mode 100644 samples/bpf/Makefile.target diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target new fi

[PATCH v4 bpf-next 15/15] samples/bpf: add preparation steps and sysroot info to readme

2019-10-09 Thread Ivan Khoronzhuk
Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. --- samples/bpf/README.rst | 41 - 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/samples/bpf/README.rst

[PATCH v4 bpf-next 14/15] samples/bpf: add sysroot support

2019-10-09 Thread Ivan Khoronzhuk
clean configure and install headers: make ARCH=arm defconfig make ARCH=arm headers_install build samples/bpf: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \ SYSROOT="path/to/sysroot" Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 +++

[PATCH v4 bpf-next 12/15] libbpf: add C/LDFLAGS to libbpf.so and test_libpf targets

2019-10-09 Thread Ivan Khoronzhuk
In case of C/LDFLAGS there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like -lelf, wich can be absent in toolchain. This can be used for samples/bpf cross-compiling allowing to get elf lib from sysroot. Signed-off-by: Ivan

[PATCH v4 bpf-next 13/15] samples/bpf: provide C/LDFLAGS to libbpf

2019-10-09 Thread Ivan Khoronzhuk
In order to build lib using C/LD flags of target arch, provide them to libbpf make. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index a6c33496e8ca..6b161326ac67 100644

[PATCH v4 bpf-next 10/15] samples/bpf: use target CC environment for HDR_PROBE

2019-10-09 Thread Ivan Khoronzhuk
No need in hacking HOSTCC to be cross-compiler any more, so drop this trick and use target CC for HDR_PROBE. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/bpf/Makefile b/samples

[PATCH v4 bpf-next 11/15] libbpf: don't use cxx to test_libpf target

2019-10-09 Thread Ivan Khoronzhuk
lso remove spaces at start of the lines to keep same style and avoid warns while apply. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/Makefile | 18 +- .../lib/bpf/{test_libbpf.cpp => test_libbpf.c} | 14 -- 2 files changed, 13 insertions(+),

[PATCH v4 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

2019-10-09 Thread Ivan Khoronzhuk
-Wmissing-prototypes -Wstrict-prototypes So, add them as they were verified and used before adding Makefile.target and lets omit "-fomit-frame-pointer" as were proposed while review, as no sense in such optimization for samples. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 6

[PATCH v4 bpf-next 03/15] samples/bpf: use --target from cross-compile

2019-10-09 Thread Ivan Khoronzhuk
For cross compiling the target triple can be inherited from cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile. So copy-paste this decision from kernel Makefile. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1

[PATCH v4 bpf-next 00/15] samples: bpf: improve/fix cross-compilation

2019-10-09 Thread Ivan Khoronzhuk
ited -D option filter only for arm - improved comments - added couple instructions to verify cross compilation for arm and arm64 arches based on TI am57xx and am65xx sdks. - corrected include a little order Ivan Khoronzhuk (15): samples/bpf: fix HDR_PROBE "echo" samples/bpf: fi

[PATCH v4 bpf-next 04/15] samples/bpf: use own EXTRA_CFLAGS for clang commands

2019-10-09 Thread Ivan Khoronzhuk
It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/samples

[PATCH bpf-next 0/2] selftest/bpf: remove warns for enable_all_controllers

2019-10-02 Thread Ivan Khoronzhuk
This micro series fixes annoying warn described in patches while samples/bpf build. Second patch fixes new warn that comes after fixing warn of first patch, that was masked. Ivan Khoronzhuk (2): selftests/bpf: add static to enable_all_controllers() selftests/bpf: correct path to include msg

[PATCH bpf-next 2/2] selftests/bpf: correct path to include msg + path

2019-10-02 Thread Ivan Khoronzhuk
th); " In order to avoid warns, lets decrease buf size for cgroup workdir on 24 bytes with assumption to include also "/cgroup.subtree_control" to the address. The cut will never happen anyway. Signed-off-by: Ivan Khoronzhuk --- tools/testing/selftests/bpf/cgroup_helpers.c | 2

[PATCH bpf-next 1/2] selftests/bpf: add static to enable_all_controllers()

2019-10-02 Thread Ivan Khoronzhuk
. Signed-off-by: Ivan Khoronzhuk --- tools/testing/selftests/bpf/cgroup_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/cgroup_helpers.c b/tools/testing/selftests/bpf/cgroup_helpers.c index e95c33e333a4..4d74f3c4619b 100644 --- a/tools

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-20 Thread Ivan Khoronzhuk
On Fri, Sep 20, 2019 at 02:51:14PM -0700, Andrii Nakryiko wrote: On Fri, Sep 20, 2019 at 12:19 PM Ivan Khoronzhuk wrote: On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote: >On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote: >>On Fri, Sep 20, 2019 at 1:2

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-20 Thread Ivan Khoronzhuk
On Fri, Sep 20, 2019 at 10:19:43PM +0300, Ivan Khoronzhuk wrote: On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote: On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote: On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk wrote: On Thu, Sep 19, 2019 at 01:02:40PM -0700

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-20 Thread Ivan Khoronzhuk
On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote: On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote: On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk wrote: On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote: On Thu, Sep 19, 2019 at 11:22 AM Ivan

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-20 Thread Ivan Khoronzhuk
On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote: On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk wrote: On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote: >On Thu, Sep 19, 2019 at 11:22 AM Ivan Khoronzhuk > wrote: >> >> It's very often fo

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-20 Thread Ivan Khoronzhuk
On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote: On Thu, Sep 19, 2019 at 11:22 AM Ivan Khoronzhuk wrote: It's very often for embedded to have stripped version of sort in busybox, when no -V option present. It breaks build natively on target board causing recursive loop

Re: [PATCH bpf] libbpf: fix version identification on busybox

2019-09-19 Thread Ivan Khoronzhuk
On Thu, Sep 19, 2019 at 07:05:18PM +0300, Ivan Khoronzhuk wrote: It's very often for embedded to have stripped version of sort in busybox, when no -V option present. It breaks build natively on target board causing recursive loop. BusyBox v1.24.1 (2019-04-06 04:09:16 UTC) multi-call binary

[PATCH bpf] libbpf: fix version identification on busybox

2019-09-19 Thread Ivan Khoronzhuk
][opts][,end[.offset][opts]] [-t CHAR] [FILE]... Lets modify command a little to avoid -V option. Fixes: dadb81d0afe732 ("libbpf: make libbpf.map source of truth for libbpf version") Signed-off-by: Ivan Khoronzhuk --- Based on bpf/master tools/lib/bpf/Makefile | 2 +- 1 file changed, 1

Re: [PATCH v3 bpf-next 09/14] samples: bpf: makefile: use own flags but not host when cross compile

2019-09-19 Thread Ivan Khoronzhuk
On Wed, Sep 18, 2019 at 02:29:53PM -0700, Andrii Nakryiko wrote: On Wed, Sep 18, 2019 at 3:35 AM Ivan Khoronzhuk wrote: On Tue, Sep 17, 2019 at 04:42:07PM -0700, Andrii Nakryiko wrote: >On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk > wrote: >> >> While compile natively

Re: [PATCH v3 bpf-next 13/14] samples: bpf: makefile: add sysroot support

2019-09-18 Thread Ivan Khoronzhuk
On Tue, Sep 17, 2019 at 10:23:57PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 4:00 AM Ivan Khoronzhuk wrote: Basically it only enables that was added by previous couple fixes. Sysroot contains correct libs installed and its headers ofc. Useful Please, let's not use unnecessary

Re: [PATCH v3 bpf-next 11/14] libbpf: makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets

2019-09-18 Thread Ivan Khoronzhuk
On Tue, Sep 17, 2019 at 10:19:22PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 4:00 AM Ivan Khoronzhuk wrote: In case of LDFLAGS and EXTRA_CC/CXX flags there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like

Re: [PATCH v3 bpf-next 09/14] samples: bpf: makefile: use own flags but not host when cross compile

2019-09-18 Thread Ivan Khoronzhuk
On Tue, Sep 17, 2019 at 04:42:07PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk wrote: While compile natively, the hosts cflags and ldflags are equal to ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it should have own, used for target arch

Re: [PATCH v3 bpf-next 08/14] samples: bpf: makefile: base target programs rules on Makefile.target

2019-09-18 Thread Ivan Khoronzhuk
On Tue, Sep 17, 2019 at 04:28:01PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 3:58 AM Ivan Khoronzhuk wrote: Please don't prepend "samples: bpf: makefile:" to patches, "samples/bpf: " is a typical we've used for BPF samples changes. Ok. The main reas

Re: [PATCH v3 bpf-next 07/14] samples: bpf: add makefile.target for separate CC target build

2019-09-18 Thread Ivan Khoronzhuk
On Tue, Sep 17, 2019 at 04:19:40PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 3:58 AM Ivan Khoronzhuk wrote: The makefile.target is added only and will be used in typo: Makefile sample/bpf/Makefile later in order to switch cross-compiling on CC on -> to from HOS

Re: [PATCH v3 bpf-next 05/14] samples: bpf: makefile: use __LINUX_ARM_ARCH__ selector for arm

2019-09-16 Thread Ivan Khoronzhuk
On Mon, Sep 16, 2019 at 01:44:23PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk wrote: For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction set selector and is absolutely required while parsing some parts of headers. It's present in KBUILD_CFLAGS

Re: [PATCH v3 bpf-next 04/14] samples: bpf: use own EXTRA_CFLAGS for clang commands

2019-09-16 Thread Ivan Khoronzhuk
On Mon, Sep 16, 2019 at 01:35:21PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 4:01 AM Ivan Khoronzhuk wrote: It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk --- With GCC

Re: [PATCH v3 bpf-next 01/14] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-16 Thread Ivan Khoronzhuk
On Mon, Sep 16, 2019 at 01:13:23PM -0700, Andrii Nakryiko wrote: On Mon, Sep 16, 2019 at 3:59 AM Ivan Khoronzhuk wrote: echo should be replaced with echo -e to handle '\n' correctly, but instead, replace it with printf as some systems can't handle echo -e. Signed-off-by: Ivan Khoronzhuk

[PATCH v3 bpf-next 03/14] samples: bpf: makefile: use --target from cross-compile

2019-09-16 Thread Ivan Khoronzhuk
For cross compiling the target triple can be inherited from cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile. So copy-paste this decision from kernel Makefile. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v3 bpf-next 00/14] samples: bpf: improve/fix cross-compilation

2019-09-16 Thread Ivan Khoronzhuk
uild" - added fix: "samples: bpf: makefile: fix cookie_uid_helper_example obj build" - limited -D option filter only for arm - improved comments - added couple instructions to verify cross compilation for arm and arm64 arches based on TI am57xx and am65xx sdks. - corrected i

[PATCH v3 bpf-next 06/14] samples: bpf: makefile: drop unnecessarily inclusion for bpf_load

2019-09-16 Thread Ivan Khoronzhuk
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf

[PATCH v3 bpf-next 04/14] samples: bpf: use own EXTRA_CFLAGS for clang commands

2019-09-16 Thread Ivan Khoronzhuk
It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf

[PATCH v3 bpf-next 09/14] samples: bpf: makefile: use own flags but not host when cross compile

2019-09-16 Thread Ivan Khoronzhuk
potential option mistmatches for existent environments. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 1579cc16a1c2..b5c87a8b8b51 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf

[PATCH v3 bpf-next 07/14] samples: bpf: add makefile.target for separate CC target build

2019-09-16 Thread Ivan Khoronzhuk
pf cross compilation. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile.target | 75 + 1 file changed, 75 insertions(+) create mode 100644 samples/bpf/Makefile.target diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target new fi

[PATCH v3 bpf-next 13/14] samples: bpf: makefile: add sysroot support

2019-09-16 Thread Ivan Khoronzhuk
clean configure and install headers: make ARCH=arm defconfig make ARCH=arm headers_install build samples/bpf: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \ SYSROOT="path/to/sysroot" Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 + 1 fi

[PATCH v3 bpf-next 14/14] samples: bpf: README: add preparation steps and sysroot info

2019-09-16 Thread Ivan Khoronzhuk
Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. --- samples/bpf/README.rst | 41 - 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/samples/bpf/README.rst

[PATCH v3 bpf-next 05/14] samples: bpf: makefile: use __LINUX_ARM_ARCH__ selector for arm

2019-09-16 Thread Ivan Khoronzhuk
For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction set selector and is absolutely required while parsing some parts of headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's retrieve it from and add to programs cflags. In another case errors like "SMP is not

[PATCH v3 bpf-next 12/14] samples: bpf: makefile: provide C/CXX/LD flags to libbpf

2019-09-16 Thread Ivan Khoronzhuk
In order to build libs using C/CXX/LD flags of target arch, provide them to libbpf make. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 18ec22e7b444

[PATCH v3 bpf-next 08/14] samples: bpf: makefile: base target programs rules on Makefile.target

2019-09-16 Thread Ivan Khoronzhuk
compilation (CC) with host build (HOSTCC), lets base samples on Makefile.target. It allows to cross-compile samples/bpf programs with CC while auxialry tools running on host built with HOSTCC. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 135 ++- 1

[PATCH v3 bpf-next 10/14] samples: bpf: makefile: use target CC environment for HDR_PROBE

2019-09-16 Thread Ivan Khoronzhuk
No need in hacking HOSTCC to be cross-compiler any more, so drop this trick and use target CC for HDR_PROBE. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index

[PATCH v3 bpf-next 11/14] libbpf: makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets

2019-09-16 Thread Ivan Khoronzhuk
. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/Makefile | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index c6f94cffe06e..bccfa556ef4e 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -94,6

[PATCH v3 bpf-next 01/14] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-16 Thread Ivan Khoronzhuk
echo should be replaced with echo -e to handle '\n' correctly, but instead, replace it with printf as some systems can't handle echo -e. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf

[PATCH v3 bpf-next 02/14] samples: bpf: makefile: fix cookie_uid_helper_example obj build

2019-09-16 Thread Ivan Khoronzhuk
ve `always += cookie_uid_helper_example.o`, which avoids breaking cross compilation due to mismatched includes. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index f50ca852c2a8..43dee90df

Re: [PATCH bpf-next 11/11] samples: bpf: makefile: add sysroot support

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 09:45:31PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: Basically it only enables that was added by previous couple fixes. For sure, just make tools/include to be included after sysroot headers. export ARCH=arm export CROSS_COMPILE=arm-linux

Re: [PATCH bpf-next 10/11] libbpf: makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 09:43:22PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: In case of LDFLAGS and EXTRA_CC/CXX flags there is no way to pass them correctly to build command, for instance when --sysroot is used or external libraries are used, like -lelf, wich

Re: [PATCH bpf-next 08/11] samples: bpf: makefile: base progs build on makefile.progs

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 09:41:25PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: The main reason for that - HOSTCC and CC have different aims. It was tested for arm cross compilation, based on linaro toolchain, but should work for others. In order to split cross

Re: [PATCH bpf-next 07/11] samples: bpf: add makefile.prog for separate CC build

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 09:33:58PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: The makefile.prog is added only, will be used in sample/bpf/Makefile later in order to switch cross-compiling on CC from HOSTCC. The HOSTCC is supposed to build binaries and tools

Re: [PATCH bpf-next 02/11] samples: bpf: makefile: fix cookie_uid_helper_example obj build

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 08:48:37PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: Don't list userspace "cookie_uid_helper_example" object in list for bpf objects. per_socket_stats_example-opjs is used to list additional dependencies s/opjs/objs for

Re: [PATCH bpf-next 05/11] samples: bpf: makefile: use D vars from KBUILD_CFLAGS to handle headers

2019-09-13 Thread Ivan Khoronzhuk
On Fri, Sep 13, 2019 at 09:12:01PM +, Yonghong Song wrote: On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote: The kernel headers are reused from samples bpf, and autoconf.h is not enough to reflect complete arch configuration for clang. But CLANG-bpf cmds are sensitive for assembler part taken

Re: [PATCH bpf-next 01/11] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-13 Thread Ivan Khoronzhuk
On Wed, Sep 11, 2019 at 02:02:11PM +0300, Sergei Shtylyov wrote: On 10.09.2019 17:54, Ivan Khoronzhuk wrote: Hello! On 10.09.2019 13:38, Ivan Khoronzhuk wrote: echo should be replaced on echo -e to handle \n correctly, but instead,  s/on/with/? s/echo/printf/ instead of s/echo/echo -e

Re: [PATCH bpf-next 01/11] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-10 Thread Ivan Khoronzhuk
On Tue, Sep 10, 2019 at 01:46:48PM +0300, Sergei Shtylyov wrote: Hello! On 10.09.2019 13:38, Ivan Khoronzhuk wrote: echo should be replaced on echo -e to handle \n correctly, but instead, s/on/with/? s/echo/printf/ instead of s/echo/echo -e/ printf looks better. replace it on printf

[PATCH bpf-next 04/11] samples: bpf: use own EXTRA_CFLAGS for clang commands

2019-09-10 Thread Ivan Khoronzhuk
It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf

[PATCH bpf-next 02/11] samples: bpf: makefile: fix cookie_uid_helper_example obj build

2019-09-10 Thread Ivan Khoronzhuk
ect it, as it breaks cross-compiling at least. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index f50ca852c2a8..43dee90dffa4 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makef

[PATCH bpf-next 00/11] samples: bpf: improve/fix cross-compilation

2019-09-10 Thread Ivan Khoronzhuk
option filter only for arm - improved comments - added couple instructions to verify cross compilation for arm and arm64 arches based on TI am57xx and am65xx sdks. - corrected include a little order Ivan Khoronzhuk (11): samples: bpf: makefile: fix HDR_PROBE "echo" samples: bpf: makefil

[PATCH bpf-next 07/11] samples: bpf: add makefile.prog for separate CC build

2019-09-10 Thread Ivan Khoronzhuk
le.host. This allows later add cross-compilation to samples/bpf with minimum changes. Makefile.prog contains only stuff needed for samples/bpf, potentially can be reused and extended for other prog sets later and now needed only for unblocking tricky samples/bpf cross compilation. Signed-off

[PATCH bpf-next 08/11] samples: bpf: makefile: base progs build on makefile.progs

2019-09-10 Thread Ivan Khoronzhuk
samples/bpf progs with CC while auxialry tools running on host built with HOSTCC. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 138 +++ 1 file changed, 73 insertions(+), 65 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile

[PATCH bpf-next 05/11] samples: bpf: makefile: use D vars from KBUILD_CFLAGS to handle headers

2019-09-10 Thread Ivan Khoronzhuk
The kernel headers are reused from samples bpf, and autoconf.h is not enough to reflect complete arch configuration for clang. But CLANG-bpf cmds are sensitive for assembler part taken from linux headers and -D vars, usually used in CFLAGS, should be carefully added for each arch. For that, for

[PATCH bpf-next 06/11] samples: bpf: makefile: drop unnecessarily inclusion for bpf_load

2019-09-10 Thread Ivan Khoronzhuk
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is included for all objects anyway, with above line: KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf

[PATCH bpf-next 09/11] samples: bpf: makefile: use CC environment for HDR_PROBE

2019-09-10 Thread Ivan Khoronzhuk
No need in hacking HOSTCC to be cross-compiler any more, so drop this trick and use CC for HDR_PROBE Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 625a71f2e9d2

[PATCH bpf-next 11/11] samples: bpf: makefile: add sysroot support

2019-09-10 Thread Ivan Khoronzhuk
ts headers ofc. Useful when working with NFC or virtual machine. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 5 + samples/bpf/README.rst | 10 ++ 2 files changed, 15 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 4edc5232cfc1..68ba78d1d

[PATCH bpf-next 10/11] libbpf: makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets

2019-09-10 Thread Ivan Khoronzhuk
. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 8 +++- tools/lib/bpf/Makefile | 11 --- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 79c9aa41832e..4edc5232cfc1 100644 --- a/samples/bpf/Makefile +++ b

[PATCH bpf-next 01/11] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-10 Thread Ivan Khoronzhuk
echo should be replaced on echo -e to handle \n correctly, but instead, replace it on printf as some systems can't handle echo -e. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf

[PATCH bpf-next 03/11] samples: bpf: makefile: use --target from cross-compile

2019-09-10 Thread Ivan Khoronzhuk
For cross compiling the target triple can be inherited from cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile. So copy-paste this decision from kernel Makefile. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH bpf-next 8/8] samples: bpf: Makefile: base progs build on Makefile.progs

2019-09-06 Thread Ivan Khoronzhuk
On Fri, Sep 06, 2019 at 04:34:31PM -0700, Alexei Starovoitov wrote: On Thu, Sep 05, 2019 at 12:22:12AM +0300, Ivan Khoronzhuk wrote: + +If need to use environment of target board, the SYSROOT also can be set, +pointing on FS of target board: + +make samples/bpf/ LLC=~/git/llvm/build/bin/llc

Re: [PATCH bpf-next 2/8] samples: bpf: Makefile: remove target for native build

2019-09-06 Thread Ivan Khoronzhuk
On Fri, Sep 06, 2019 at 05:04:08PM -0700, Alexei Starovoitov wrote: On Fri, Sep 6, 2019 at 4:52 PM Ivan Khoronzhuk wrote: On Fri, Sep 06, 2019 at 04:31:39PM -0700, Alexei Starovoitov wrote: >On Thu, Sep 05, 2019 at 12:22:06AM +0300, Ivan Khoronzhuk wrote: >> No need to set --target f

Re: [PATCH bpf-next 2/8] samples: bpf: Makefile: remove target for native build

2019-09-06 Thread Ivan Khoronzhuk
On Fri, Sep 06, 2019 at 04:31:39PM -0700, Alexei Starovoitov wrote: On Thu, Sep 05, 2019 at 12:22:06AM +0300, Ivan Khoronzhuk wrote: No need to set --target for native build, at least for arm, the default target will be used anyway. In case of arm, for at least clang 5 - 10 it causes error like

[PATCH bpf-next 0/8] samples: bpf: improve/fix cross-compilation

2019-09-04 Thread Ivan Khoronzhuk
, some warn options could be tuned also. Ivan Khoronzhuk (8): samples: bpf: Makefile: use --target from cross-compile samples: bpf: Makefile: remove target for native build libbpf: Makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf targets samples: bpf: use own EXTRA_CFLAGS

[PATCH bpf-next 6/8] samples: bpf: makefile: fix HDR_PROBE "echo"

2019-09-04 Thread Ivan Khoronzhuk
echo should be replaced on echo -e to handle \n correctly, but instead, replace it on printf as some systems can't handle echo -e. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf

  1   2   3   4   5   6   7   8   9   10   >