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

2019-09-16 Thread Ivan Khoronzhuk
le: remove target for native build" - 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

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:

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 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_C

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 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 mai

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 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 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 unnece

[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

[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 v4 bpf-next 00/15] samples: bpf: improve/fix cross-compilation

2019-10-09 Thread Ivan Khoronzhuk
elper_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 HDR_PROBE &qu

[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 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 chang

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

2019-10-09 Thread Ivan Khoronzhuk
inter -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 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 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 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 b/samples/bpf/

[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 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 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 supporte

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

2019-10-09 Thread Ivan Khoronzhuk
;t be in 'always'. Let us remove `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/

[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/Makefil

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, th

[PATCH bpf] libbpf: fix version identification on busybox

2019-09-19 Thread Ivan Khoronzhuk
ffset][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 chang

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 b

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

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 oft

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 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 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

[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

[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 a

[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 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
quot;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..9b33e

[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
;t be in 'always'. Let us remove `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/

[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
inter -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 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 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 00/15] samples: bpf: improve/fix cross-compilation

2019-10-10 Thread Ivan Khoronzhuk
ed 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 include a little order Ivan K

[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 chang

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 he

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 hav

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.

Re: [RFC PATCH net-next 2/5] net: 8021q: vlan_dev: add vid tag for uc and mc address lists

2019-02-14 Thread Ivan Khoronzhuk
On Wed, Feb 13, 2019 at 08:49:39PM -0800, Florian Fainelli wrote: On February 13, 2019 8:17:16 AM PST, Ivan Khoronzhuk wrote: On Tue, Jan 22, 2019 at 03:12:41PM +0200, Ivan Khoronzhuk wrote: On Mon, Jan 21, 2019 at 03:37:41PM -0800, Florian Fainelli wrote: On 12/4/18 3:42 PM, Ivan

Re: [RFC PATCH net-next 2/5] net: 8021q: vlan_dev: add vid tag for uc and mc address lists

2019-01-22 Thread Ivan Khoronzhuk
On Mon, Jan 21, 2019 at 03:37:41PM -0800, Florian Fainelli wrote: On 12/4/18 3:42 PM, Ivan Khoronzhuk wrote: On Tue, Dec 04, 2018 at 11:49:27AM -0800, Florian Fainelli wrote: [...] Ivan, based on the recent submission I copied you on [1], it sounds like we want to move ahead with your

Re: [RFC PATCH net-next 2/5] net: 8021q: vlan_dev: add vid tag for uc and mc address lists

2019-01-22 Thread Ivan Khoronzhuk
On Tue, Jan 08, 2019 at 10:21:25AM -0800, Florian Fainelli wrote: On 1/7/19 9:01 PM, Florian Fainelli wrote: Le 12/4/18 à 4:04 PM, Ivan Khoronzhuk a écrit : On Tue, Dec 04, 2018 at 11:49:27AM -0800, Florian Fainelli wrote: ... I was thinking also about pinned list of vlans to the address

[PATCH net-next 0/3] net: ethernet: ti: cpsw: Add XDP support

2019-05-23 Thread Ivan Khoronzhuk
/JSMT0iZ4 Based on net-next/master Ivan Khoronzhuk (3): net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: return handler status net: ethernet: ti: cpsw: add XDP support drivers/net/ethernet/ti/Kconfig | 1 + drivers/net/ethernet/ti/cpsw.c

[PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support

2019-05-23 Thread Ivan Khoronzhuk
infrastructure. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/Kconfig| 1 + drivers/net/ethernet/ti/cpsw.c | 555 ++--- drivers/net/ethernet/ti/cpsw_ethtool.c | 53 +++ drivers/net/ethernet/ti/cpsw_priv.h| 7 + 4 files changed, 554

[PATCH net-next 2/3] net: ethernet: ti: davinci_cpdma: return handler status

2019-05-23 Thread Ivan Khoronzhuk
This change is needed to return flush status of rx handler for flushing redirected xdp frames after processing channel packets. Do it as separate patch for simplicity. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 23 +++-- drivers/net/ethernet/ti

[PATCH net-next 1/3] net: ethernet: ti: davinci_cpdma: add dma mapped submit

2019-05-23 Thread Ivan Khoronzhuk
In case if dma mapped packet needs to be sent, like with XDP page pool, the "mapped" submit can be used. This patch adds dma mapped submit based on regular one. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/davinci_cpdma.c | 88 - drivers/net/e

Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support

2019-05-27 Thread Ivan Khoronzhuk
On Fri, May 24, 2019 at 01:54:18PM +0200, Jesper Dangaard Brouer wrote: On Thu, 23 May 2019 21:20:35 +0300 Ivan Khoronzhuk wrote: Add XDP support based on rx page_pool allocator, one frame per page. Page pool allocator is used with assumption that only one rx_handler is running simultaneously

Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support

2019-05-27 Thread Ivan Khoronzhuk
On Fri, May 24, 2019 at 02:05:11PM +0300, Ilias Apalodimas wrote: On Thu, May 23, 2019 at 09:20:35PM +0300, Ivan Khoronzhuk wrote: Add XDP support based on rx page_pool allocator, one frame per page. Page pool allocator is used with assumption that only one rx_handler is running simultaneously

Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support

2019-05-27 Thread Ivan Khoronzhuk
On Fri, May 24, 2019 at 08:49:38PM +0300, grygorii wrote: Hi Ivan, On 23/05/2019 21:20, Ivan Khoronzhuk wrote: Add XDP support based on rx page_pool allocator, one frame per page. Page pool allocator is used with assumption that only one rx_handler is running simultaneously. DMA map/unmap is

[PATCH v2 bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits

2019-08-12 Thread Ivan Khoronzhuk
maximum allowed file size verification. The offsets can be tuned ofc, but instead of changing existent interface - extend max allowed file size for sockets. Signed-off-by: Ivan Khoronzhuk --- Based on bpf-next/master v2..v1: removed not necessarily #ifdev as ULL and UL for 64 has same size

Re: [PATCH v2 bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits

2019-08-13 Thread Ivan Khoronzhuk
On Tue, Aug 13, 2019 at 10:02:54AM +0200, Magnus Karlsson wrote: On Mon, Aug 12, 2019 at 2:45 PM Ivan Khoronzhuk wrote: The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are established already and are

[PATCH bpf-next 3/3] samples: bpf: syscal_nrs: use mmap2 if defined

2019-08-13 Thread Ivan Khoronzhuk
For arm32 xdp sockets mmap2 is preferred, so use it if it's defined. Signed-off-by: Ivan Khoronzhuk --- samples/bpf/syscall_nrs.c | 5 + samples/bpf/tracex5_kern.c | 11 +++ 2 files changed, 16 insertions(+) diff --git a/samples/bpf/syscall_nrs.c b/samples/bpf/syscall_nrs.c

[PATCH bpf-next 2/3] xdp: xdp_umem: replace kmap on vmap for umem map

2019-08-13 Thread Ivan Khoronzhuk
block and should be used rather for dynamic mm. Signed-off-by: Ivan Khoronzhuk --- net/xdp/xdp_umem.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index a0607969f8c0..907c9019fe21 100644 --- a/net/xdp/xdp_umem.c +++ b

[PATCH bpf-next 0/3] xdpsock: allow mmap2 usage for 32bits

2019-08-13 Thread Ivan Khoronzhuk
uot; https://lkml.org/lkml/2019/8/12/549 Based on bpf-next/master Ivan Khoronzhuk (3): libbpf: add asm/unistd.h to xsk to get __NR_mmap2 xdp: xdp_umem: replace kmap on vmap for umem map samples: bpf: syscal_nrs: use mmap2 if defined net/xdp/xdp_umem.c | 16 s

[PATCH bpf-next 1/3] libbpf: add asm/unistd.h to xsk to get __NR_mmap2

2019-08-13 Thread Ivan Khoronzhuk
That's needed to get __NR_mmap2 when mmap2 syscall is used. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/xsk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 5007b5d4fd2c..f2fc40f9804c 100644 --- a/tools/lib/bpf/xsk.c +++ b/tools/li

Re: [PATCH bpf-next 2/3] xdp: xdp_umem: replace kmap on vmap for umem map

2019-08-13 Thread Ivan Khoronzhuk
On Tue, Aug 13, 2019 at 10:42:18AM -0700, Jonathan Lemon wrote: On 13 Aug 2019, at 3:23, Ivan Khoronzhuk wrote: For 64-bit there is no reason to use vmap/vunmap, so use page_address as it was initially. For 32 bits, in some apps, like in samples xdpsock_user.c when number of pgs in use is

Re: [PATCH bpf-next 3/3] samples: bpf: syscal_nrs: use mmap2 if defined

2019-08-13 Thread Ivan Khoronzhuk
On Tue, Aug 13, 2019 at 10:41:54AM -0700, Jonathan Lemon wrote: On 13 Aug 2019, at 3:23, Ivan Khoronzhuk wrote: For arm32 xdp sockets mmap2 is preferred, so use it if it's defined. Signed-off-by: Ivan Khoronzhuk Doesn't this change the application API? -- Jonathan From w

Re: [PATCH bpf-next 1/3] libbpf: add asm/unistd.h to xsk to get __NR_mmap2

2019-08-14 Thread Ivan Khoronzhuk
On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote: Hi, Andrii On Tue, Aug 13, 2019 at 3:24 AM Ivan Khoronzhuk wrote: That's needed to get __NR_mmap2 when mmap2 syscall is used. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/xsk.c | 1 + 1 file changed, 1 inse

Re: [PATCH bpf-next 1/3] libbpf: add asm/unistd.h to xsk to get __NR_mmap2

2019-08-14 Thread Ivan Khoronzhuk
On Wed, Aug 14, 2019 at 12:32:41AM +, Yonghong Song wrote: Hi, Yonghong Song On 8/13/19 3:23 AM, Ivan Khoronzhuk wrote: That's needed to get __NR_mmap2 when mmap2 syscall is used. It seems I did not have this issue on x64 machine e.g., Fedora 29. My glibc version is 2.28. gcc

Re: [PATCH bpf-next 1/3] libbpf: add asm/unistd.h to xsk to get __NR_mmap2

2019-08-14 Thread Ivan Khoronzhuk
On Wed, Aug 14, 2019 at 12:24:05PM +0300, Ivan Khoronzhuk wrote: On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote: Hi, Andrii On Tue, Aug 13, 2019 at 3:24 AM Ivan Khoronzhuk wrote: That's needed to get __NR_mmap2 when mmap2 syscall is used. Signed-off-by: Ivan Khoro

Re: [PATCH v2 bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits

2019-08-14 Thread Ivan Khoronzhuk
On Mon, Aug 12, 2019 at 02:19:24PM -0700, Andrew Morton wrote: Hi, Andrew On Mon, 12 Aug 2019 15:43:26 +0300 Ivan Khoronzhuk wrote: The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are established

[PATCH bpf-next] mm: mmap: increase sockets maximum memory size pgoff for 32bits

2019-08-12 Thread Ivan Khoronzhuk
maximum allowed file size verification. The offsets can be tuned ofc, but instead of changing existent interface - extend max allowed file size for sockets. The 64-bit systems seems like ok with this, so extend threshold only for 32-bits for now. Signed-off-by: Ivan Khoronzhuk --- Based on bpf-next

[PATCH] net: sched: sch_taprio: fix memleak in error path for sched list parse

2019-08-06 Thread Ivan Khoronzhuk
In case off error, all entries should be freed from the sched list before deleting it. For simplicity use rcu way. Fixes: 5a781ccbd19e46 ("tc: Add support for configuring the taprio scheduler") Signed-off-by: Ivan Khoronzhuk --- Based on net/master net/sched/sch_taprio.c | 3 +

Re: [PATCH] net: sched: sch_taprio: fix memleak in error path for sched list parse

2019-08-06 Thread Ivan Khoronzhuk
On Tue, Aug 06, 2019 at 11:41:14AM -0700, David Miller wrote: From: Ivan Khoronzhuk Date: Tue, 6 Aug 2019 13:04:25 +0300 Based on net/master I wonder about that because: Applies cleanly on net/master, but line num is not correct. I've sent v2. --- a/net/sched/sch_taprio.c +++

[PATCH v2] net: sched: sch_taprio: fix memleak in error path for sched list parse

2019-08-06 Thread Ivan Khoronzhuk
In error case, all entries should be freed from the sched list before deleting it. For simplicity use rcu way. Fixes: 5a781ccbd19e46 ("tc: Add support for configuring the taprio scheduler") Acked-by: Vinicius Costa Gomes Signed-off-by: Ivan Khoronzhuk --- net/sched/sch_taprio.c | 3 +

[PATCH v2 bpf-next] xdp: xdp_umem: fix umem pages mapping for 32bits systems

2019-08-08 Thread Ivan Khoronzhuk
Use kmap instead of page_address as it's not always in low memory. Acked-by: Björn Töpel Signed-off-by: Ivan Khoronzhuk --- Based on bpf-next/master v2..v1: included highmem.h v1: https://lkml.org/lkml/2019/6/26/693 net/xdp/xdp_umem.c | 12 +++- 1 file changed, 11 inser

Re: [PATCH] net: ethernet: ti: cpsw: Fix suspend/resume break

2019-06-23 Thread Ivan Khoronzhuk
i < cpsw->data.slaves; i++) + if (netif_running(cpsw->slaves[i].ndev)) + cpsw_ndo_open(cpsw->slaves[i].ndev); + same here rtnl_unlock(); return 0; -- 2.17.1 -- Regards, Ivan Khoronzhuk

[[PATCH net-next]] net: core: xdp: make __mem_id_disconnect to be static

2019-06-25 Thread Ivan Khoronzhuk
Add missed static for local __mem_id_disconnect(). Signed-off-by: Ivan Khoronzhuk --- net/core/xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/xdp.c b/net/core/xdp.c index b29d7b513a18..829377cc83db 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -85,7

[PATCH net-next] tools: lib: bpf: libbpf: fix max() type mistmatch for 32bit

2019-06-25 Thread Ivan Khoronzhuk
It fixes build error for 32bit coused by type mistmatch size_t/unsigned long. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index

[PATCH v4 net-next 4/4] net: ethernet: ti: cpsw: add XDP support

2019-06-25 Thread Ivan Khoronzhuk
prog is common for all channels till appropriate changes are added in XDP infrastructure. Also, once page_pool recycling becomes part of skb netstack some simplifications can be added, like removing marked with comments. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/Kconfig

[PATCH v4 net-next 0/4] net: ethernet: ti: cpsw: Add XDP support

2019-06-25 Thread Ivan Khoronzhuk
: ti: cpsw_ethtool: simplify slave loops Based on net-next/master Ivan Khoronzhuk (4): net: core: page_pool: add user cnt preventing pool deletion net: ethernet: ti: davinci_cpdma: add dma mapped submit net: ethernet: ti: davinci_cpdma: return handler status net: ethernet: ti: cpsw: add

[PATCH v4 net-next 2/4] net: ethernet: ti: davinci_cpdma: add dma mapped submit

2019-06-25 Thread Ivan Khoronzhuk
In case if dma mapped packet needs to be sent, like with XDP page pool, the "mapped" submit can be used. This patch adds dma mapped submit based on regular one. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/davinci_cpdma.c | 89 ++--- drivers/net/e

[PATCH v4 net-next 3/4] net: ethernet: ti: davinci_cpdma: return handler status

2019-06-25 Thread Ivan Khoronzhuk
This change is needed to return flush status of rx handler for flushing redirected xdp frames after processing channel packets. Do it as separate patch for simplicity. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 21 ++- drivers/net/ethernet/ti

[PATCH v4 net-next 1/4] net: core: page_pool: add user cnt preventing pool deletion

2019-06-25 Thread Ivan Khoronzhuk
kes to use page_pool_free() explicitly, not fully hidden in xdp unreg, which looks more correct after page pool "create" routine. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 +--- include/net/page_pool.h |

[PATCH bpf-next] libbpf: fix max() type mismatch for 32bit

2019-06-25 Thread Ivan Khoronzhuk
It fixes build error for 32bit caused by type mismatch size_t/unsigned long. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 68f45a96769f..5186b7710430 100644

Re: [RFC PATCH v4 net-next 10/11] ARM: dts: am57xx-idk: add dt nodes for new cpsw switch dev driver

2019-06-25 Thread Ivan Khoronzhuk
f7bd26458915..5c7663699efa 100644 --- a/arch/arm/boot/dts/am57xx-idk-common.dtsi +++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi @@ -367,7 +367,7 @@ }; &mac { - status = "okay"; +// status = "okay"; ? -- Regards, Ivan Khoronzhuk

Re: [RFC PATCH v4 net-next 06/11] net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac

2019-06-26 Thread Ivan Khoronzhuk
; +clean_cpts: + cpts_release(cpsw->cpts); + cpdma_ctlr_destroy(cpsw->dma); +clean_dt_ret: + cpsw_remove_dt(cpsw); + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + return ret; +} + +static int cpsw_remove(struct platform_device *pdev) +{ + struct net_device *ndev = platform_get_drvdata(pdev); now it's cpsw, as in probe? + struct cpsw_common *cpsw = ndev_to_cpsw(ndev); + int ret; + + ret = pm_runtime_get_sync(&pdev->dev); + if (ret < 0) { + pm_runtime_put_noidle(&pdev->dev); + return ret; + } + + cpsw_unregister_devlink(cpsw); + cpsw_unregister_ports(cpsw); + + cpts_release(cpsw->cpts); + cpdma_ctlr_destroy(cpsw->dma); + cpsw_remove_dt(cpsw); + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + return 0; +} + [...] -- Regards, Ivan Khoronzhuk

[PATCH v2 bpf-next] libbpf: fix max() type mismatch for 32bit

2019-06-26 Thread Ivan Khoronzhuk
It fixes build error for 32bit caused by type mismatch size_t/unsigned long. Fixes: bf82927125dd ("libbpf: refactor map initialization") Acked-by: Song Liu Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH v4 net-next 1/4] net: core: page_pool: add user cnt preventing pool deletion

2019-06-26 Thread Ivan Khoronzhuk
On Wed, Jun 26, 2019 at 12:42:16PM +0200, Jesper Dangaard Brouer wrote: On Tue, 25 Jun 2019 20:59:45 +0300 Ivan Khoronzhuk wrote: Add user counter allowing to delete pool only when no users. It doesn't prevent pool from flush, only prevents freeing the pool instance. Helps when no ne

Re: [PATCH v4 net-next 1/4] net: core: page_pool: add user cnt preventing pool deletion

2019-06-26 Thread Ivan Khoronzhuk
On Wed, Jun 26, 2019 at 01:51:28PM +0200, Jesper Dangaard Brouer wrote: On Wed, 26 Jun 2019 13:49:49 +0300 Ivan Khoronzhuk wrote: On Wed, Jun 26, 2019 at 12:42:16PM +0200, Jesper Dangaard Brouer wrote: >On Tue, 25 Jun 2019 20:59:45 +0300 >Ivan Khoronzhuk wrote: > >> Add user c

Re: [PATCH v4 net-next 1/4] net: core: page_pool: add user cnt preventing pool deletion

2019-06-26 Thread Ivan Khoronzhuk
On Tue, Jun 25, 2019 at 09:36:15PM -0400, Willem de Bruijn wrote: On Tue, Jun 25, 2019 at 2:00 PM Ivan Khoronzhuk wrote: Add user counter allowing to delete pool only when no users. It doesn't prevent pool from flush, only prevents freeing the pool instance. Helps when no need to delet

[PATCH net-next] xdp: xdp_umem: fix umem pages mapping for 32bits systems

2019-06-26 Thread Ivan Khoronzhuk
Use kmap instead of page_address as it's not always in low memory. Signed-off-by: Ivan Khoronzhuk --- net/xdp/xdp_umem.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 9c6de4f114f8..d3c1411420fd 100644 --- a/ne

[PATCH net-next] net: ethernet: ti: cpsw: use cpsw as drv data

2019-06-11 Thread Ivan Khoronzhuk
No need to set ndev for drvdata when mainly cpsw reference is needed, so correct this legacy decision. Reviewed-by: Grygorii Strashko Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions

<    1   2   3   4   5   6   7   8   >