[PATCH bpf v2 2/2] bpf: sync BPF_FIB_LOOKUP flag changes with BPF uapi

2019-06-12 Thread Martynas Pumputis
Sync the changes to the flags made in "bpf: simplify definition of BPF_FIB_LOOKUP related flags" with the BPF uapi headers. Doing in a separate commit to ease syncing of github/libbpf. Signed-off-by: Martynas Pumputis --- tools/include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2

[PATCH bpf v2 1/2] bpf: simplify definition of BPF_FIB_LOOKUP related flags

2019-06-12 Thread Martynas Pumputis
<< (nr)) to define BPF-related flags. Signed-off-by: Martynas Pumputis --- include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 63e0cf66f01a..a8f17bc86732 100644 --- a/include/uapi/linux

[PATCH bpf] bpf: Simplify definition of BPF_FIB_LOOKUP related flags

2019-06-12 Thread Martynas Pumputis
<< (nr)) to define BPF-related flags. Signed-off-by: Martynas Pumputis --- include/uapi/linux/bpf.h | 4 ++-- tools/include/uapi/linux/bpf.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 63e0cf

[PATCH v3 bpf] bpf: Try harder when allocating memory for large maps

2019-03-18 Thread Martynas Pumputis
ange has been tested with the workloads mentioned above and by observing oom_kill value from /proc/vmstat. [1]: https://lore.kernel.org/bpf/20190310071318.gw5...@dhcp22.suse.cz/ Acked-by: Yonghong Song Signed-off-by: Martynas Pumputis --- kernel/bpf/syscall.c | 22 +++---

[PATCH] bpf: Try harder when allocating memory for large maps

2019-03-11 Thread Martynas Pumputis
workloads mentioned above and by observing oom_kill value from /proc/vmstat. [1]: https://lore.kernel.org/bpf/20190310071318.gw5...@dhcp22.suse.cz/ Signed-off-by: Martynas Pumputis --- kernel/bpf/syscall.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ke

[PATCH v2 bpf-next] bpf: add optional memory accounting for maps

2019-01-31 Thread Martynas Pumputis
entries 65536 memlock 5771264B # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes 6221824 6078464 This time, the memory (including kmem) is accounted, as 450560B + 5771264B <= 6221824B Acked-by: Yonghong Song Signed-off-by: Martynas Pumputis --- include/linu

[PATCH v2 bpf] bpf: selftests: handle sparse CPU allocations

2019-01-31 Thread Martynas Pumputis
returned 1 instead of 3. This patch fixes the function by making it parse all CPU ranges and elements. Signed-off-by: Martynas Pumputis --- Testing of the patch: https://gist.github.com/brb/5369b5cfd08babb80cf2c4081dc19762 --- tools/testing/selftests/bpf/bpf_util.h | 31 +---

[PATCH bpf-next] bpf: add optional memory accounting for maps

2019-01-30 Thread Martynas Pumputis
entries 65536 memlock 5771264B # cat /sys/fs/cgroup/memory/test-map/memory{,.kmem}.usage_in_bytes 6221824 6078464 This time, the memory (including kmem) is accounted, as 450560B + 5771264B <= 6221824B Signed-off-by: Martynas Pumputis --- include/linux/bpf.h| 5

[PATCH] bpf: selftests: handle sparse CPU allocations

2019-01-30 Thread Martynas Pumputis
returned 1 instead of 3. This patch fixes the function by making it parse all CPU ranges and elements. Signed-off-by: Martynas Pumputis --- tools/testing/selftests/bpf/bpf_util.h | 29 +- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tools/testing/sel

[PATCH v2] bpf: fix check of allowed specifiers in bpf_trace_printk

2018-11-23 Thread Martynas Pumputis
A format string consisting of "%p" or "%s" followed by an invalid specifier (e.g. "%p%\n" or "%s%") could pass the check which would make format_decode (lib/vsprintf.c) to warn. Reported-by: syzbot+1ec5c5ec949c4adaa...@syzkaller.appspotmail.com Signed-off-

[PATCH] bpf: fix check of allowed specifiers in bpf_trace_printk

2018-11-22 Thread Martynas Pumputis
A format string consisting of "%p" or "%s" followed by an invalid specifier (e.g. "%p%\n" or "%s%") could pass the check which would make format_decode (lib/vsprintf.c) to warn. Reported-by: syzbot+1ec5c5ec949c4adaa...@syzkaller.appspotmail.com Signed-off-

[PATCH v2] vxlan: Set ports in flow key when doing route lookups

2017-01-11 Thread Martynas Pumputis
Otherwise, a xfrm policy with sport/dport being set cannot be matched. Signed-off-by: Martynas Pumputis --- Changes in v2: - Set the source port in the flow key. drivers/net/vxlan.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan.c b

[PATCH] vxlan: Set flow*_dport when doing route lookups

2017-01-10 Thread Martynas Pumputis
Otherwise, no xfrm policy with dport being set can be matched. Signed-off-by: Martynas Pumputis --- drivers/net/vxlan.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index bb70dd5..fcfe786 100644 --- a/drivers/net

[PATCH] openvswitch: do not ignore netdev errors when creating tunnel vports

2016-08-09 Thread Martynas Pumputis
n use), the error is currently ignored giving the appearance that the tunnel vport creation completed successfully. Signed-off-by: Martynas Pumputis --- net/openvswitch/vport-geneve.c | 9 - net/openvswitch/vport-gre.c| 11 +-- net/openvswitch/vport-vxlan.c | 9 -