* Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases
From: Tobin C. Harding @ 2018-05-15 5:21 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, Thomas.Winter, idosch, sharpd, roopa
In-Reply-To: <20180515025112.16647-1-dsahern@gmail.com>
Hi David,
On Mon, May 14, 2018 at 07:51:05PM -0700, David Ahern wrote:
> This patch set fixes a few append and replace uses cases for IPv6 and
> adds test cases that codifies the expectations of how append and replace
> are expected to work.
Nood question: what commit does this apply on top of please. I
attempted to apply the set on top of net-next
commit (961423f9fcbc Merge branch 'sctp-Introduce-sctp_flush_ctx')
patch 4 and 5 have merge conflicts (I stopped at 5).
thanks,
Tobin.
^ permalink raw reply
* Re: [PATCH v1 2/4] media: bpf: allow raw IR decoder bpf programs to be used
From: Y Song @ 2018-05-15 5:22 UTC (permalink / raw)
To: Sean Young
Cc: linux-media, linux-kernel, Alexei Starovoitov,
Mauro Carvalho Chehab, Daniel Borkmann, netdev, Matthias Reichl,
Devin Heitmueller
In-Reply-To: <cd3a5e27ef4122fab90daae2af6031982df77282.1526331777.git.sean@mess.org>
On Mon, May 14, 2018 at 2:10 PM, Sean Young <sean@mess.org> wrote:
> This implements attaching, detaching, querying and execution. The target
> fd has to be the /dev/lircN device.
>
> Signed-off-by: Sean Young <sean@mess.org>
> ---
> drivers/media/rc/ir-bpf-decoder.c | 191 ++++++++++++++++++++++++++++++
> drivers/media/rc/lirc_dev.c | 30 +++++
> drivers/media/rc/rc-core-priv.h | 15 +++
> drivers/media/rc/rc-ir-raw.c | 5 +
> include/uapi/linux/bpf.h | 1 +
> kernel/bpf/syscall.c | 7 ++
> 6 files changed, 249 insertions(+)
>
> diff --git a/drivers/media/rc/ir-bpf-decoder.c b/drivers/media/rc/ir-bpf-decoder.c
> index aaa5e208b1a5..651590a14772 100644
> --- a/drivers/media/rc/ir-bpf-decoder.c
> +++ b/drivers/media/rc/ir-bpf-decoder.c
> @@ -91,3 +91,194 @@ const struct bpf_verifier_ops ir_decoder_verifier_ops = {
> .get_func_proto = ir_decoder_func_proto,
> .is_valid_access = ir_decoder_is_valid_access
> };
> +
> +#define BPF_MAX_PROGS 64
> +
> +int rc_dev_bpf_attach(struct rc_dev *rcdev, struct bpf_prog *prog, u32 flags)
flags is not used in this function.
> +{
> + struct ir_raw_event_ctrl *raw;
> + struct bpf_prog_array __rcu *old_array;
> + struct bpf_prog_array *new_array;
> + int ret;
> +
> + if (rcdev->driver_type != RC_DRIVER_IR_RAW)
> + return -EINVAL;
> +
> + ret = mutex_lock_interruptible(&rcdev->lock);
> + if (ret)
> + return ret;
> +
> + raw = rcdev->raw;
> +
> + if (raw->progs && bpf_prog_array_length(raw->progs) >= BPF_MAX_PROGS) {
> + ret = -E2BIG;
> + goto out;
> + }
> +
> + old_array = raw->progs;
> + ret = bpf_prog_array_copy(old_array, NULL, prog, &new_array);
> + if (ret < 0)
> + goto out;
> +
> + rcu_assign_pointer(raw->progs, new_array);
> + bpf_prog_array_free(old_array);
> +out:
> + mutex_unlock(&rcdev->lock);
> + return ret;
> +}
> +
> +int rc_dev_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog, u32 flags)
flags is not used in this function.
> +{
> + struct ir_raw_event_ctrl *raw;
> + struct bpf_prog_array __rcu *old_array;
> + struct bpf_prog_array *new_array;
> + int ret;
> +
> + if (rcdev->driver_type != RC_DRIVER_IR_RAW)
> + return -EINVAL;
> +
> + ret = mutex_lock_interruptible(&rcdev->lock);
> + if (ret)
> + return ret;
> +
> + raw = rcdev->raw;
> +
> + old_array = raw->progs;
> + ret = bpf_prog_array_copy(old_array, prog, NULL, &new_array);
> + if (ret < 0) {
> + bpf_prog_array_delete_safe(old_array, prog);
> + } else {
> + rcu_assign_pointer(raw->progs, new_array);
> + bpf_prog_array_free(old_array);
> + }
> +
> + bpf_prog_put(prog);
> + mutex_unlock(&rcdev->lock);
> + return 0;
> +}
> +
> +void rc_dev_bpf_run(struct rc_dev *rcdev)
> +{
> + struct ir_raw_event_ctrl *raw = rcdev->raw;
> +
> + if (raw->progs)
> + BPF_PROG_RUN_ARRAY(raw->progs, &raw->prev_ev, BPF_PROG_RUN);
> +}
> +
> +void rc_dev_bpf_put(struct rc_dev *rcdev)
> +{
> + struct bpf_prog_array *progs = rcdev->raw->progs;
> + int i, size;
> +
> + if (!progs)
> + return;
> +
> + size = bpf_prog_array_length(progs);
> + for (i = 0; i < size; i++)
> + bpf_prog_put(progs->progs[i]);
> +
> + bpf_prog_array_free(rcdev->raw->progs);
> +}
> +
> +int rc_dev_prog_attach(const union bpf_attr *attr)
> +{
> + struct bpf_prog *prog;
> + struct rc_dev *rcdev;
> + int ret;
> +
> + if (attr->attach_flags & BPF_F_ALLOW_OVERRIDE)
> + return -EINVAL;
Looks like you really did not use flags except here.
BPF_F_ALLOW_OVERRIDE is originally used for
cgroup type of attachment and the comment explicits
saying so.
In the query below, the flags value "0" is copied to userspace.
In your case, I think you can just disallow any value, i.g.,
attr->attach_flags must be 0, and then you further down
check that if the prog is already in the array, you just return an error.
> +
> + prog = bpf_prog_get_type(attr->attach_bpf_fd,
> + BPF_PROG_TYPE_RAWIR_DECODER);
> + if (IS_ERR(prog))
> + return PTR_ERR(prog);
> +
> + rcdev = rc_dev_get_from_fd(attr->target_fd);
> + if (IS_ERR(rcdev)) {
> + bpf_prog_put(prog);
> + return PTR_ERR(rcdev);
> + }
> +
> + ret = rc_dev_bpf_attach(rcdev, prog, attr->attach_flags);
> + if (ret)
> + bpf_prog_put(prog);
> +
> + put_device(&rcdev->dev);
> +
> + return ret;
> +}
> +
> +int rc_dev_prog_detach(const union bpf_attr *attr)
> +{
> + struct bpf_prog *prog;
> + struct rc_dev *rcdev;
> + int ret;
> +
> + if (attr->attach_flags & BPF_F_ALLOW_OVERRIDE)
> + return -EINVAL;
> +
> + prog = bpf_prog_get_type(attr->attach_bpf_fd,
> + BPF_PROG_TYPE_RAWIR_DECODER);
> + if (IS_ERR(prog))
> + return PTR_ERR(prog);
> +
> + rcdev = rc_dev_get_from_fd(attr->target_fd);
> + if (IS_ERR(rcdev)) {
> + bpf_prog_put(prog);
> + return PTR_ERR(rcdev);
> + }
> +
> + ret = rc_dev_bpf_detach(rcdev, prog, attr->attach_flags);
> +
> + bpf_prog_put(prog);
> + put_device(&rcdev->dev);
> +
> + return ret;
> +}
> +
> +int rc_dev_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr)
> +{
> + __u32 __user *prog_ids = u64_to_user_ptr(attr->query.prog_ids);
> + struct bpf_prog_array *progs;
> + struct rc_dev *rcdev;
> + u32 cnt, flags = 0;
> + int ret;
> +
> + if (attr->query.query_flags)
> + return -EINVAL;
> +
> + rcdev = rc_dev_get_from_fd(attr->query.target_fd);
> + if (IS_ERR(rcdev))
> + return PTR_ERR(rcdev);
> +
> + if (rcdev->driver_type != RC_DRIVER_IR_RAW) {
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + ret = mutex_lock_interruptible(&rcdev->lock);
> + if (ret)
> + goto out;
> +
> + progs = rcdev->raw->progs;
> + cnt = progs ? bpf_prog_array_length(progs) : 0;
> +
> + if (copy_to_user(&uattr->query.prog_cnt, &cnt, sizeof(cnt))) {
> + ret = -EFAULT;
> + goto out;
> + }
> + if (copy_to_user(&uattr->query.attach_flags, &flags, sizeof(flags))) {
> + ret = -EFAULT;
> + goto out;
> + }
> +
> + if (attr->query.prog_cnt != 0 && prog_ids && cnt)
> + ret = bpf_prog_array_copy_to_user(progs, prog_ids, cnt);
> +
> +out:
> + mutex_unlock(&rcdev->lock);
> + put_device(&rcdev->dev);
> +
> + return ret;
> +}
> diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
> index 24e9fbb80e81..65319f2ccc13 100644
> --- a/drivers/media/rc/lirc_dev.c
> +++ b/drivers/media/rc/lirc_dev.c
> @@ -20,6 +20,7 @@
> #include <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/device.h>
> +#include <linux/file.h>
> #include <linux/idr.h>
> #include <linux/poll.h>
> #include <linux/sched.h>
> @@ -28,6 +29,8 @@
> #include "rc-core-priv.h"
> #include <uapi/linux/lirc.h>
>
> +#include <linux/bpf-rcdev.h>
> +
> #define LIRCBUF_SIZE 256
>
> static dev_t lirc_base_dev;
> @@ -816,4 +819,31 @@ void __exit lirc_dev_exit(void)
> unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX);
> }
>
> +struct rc_dev *rc_dev_get_from_fd(int fd)
> +{
> + struct rc_dev *dev;
> + struct file *f;
> +
> + f = fget_raw(fd);
> + if (!f)
> + return ERR_PTR(-EBADF);
> +
> + if (!S_ISCHR(f->f_inode->i_mode) ||
> + imajor(f->f_inode) != MAJOR(lirc_base_dev)) {
> + fput(f);
> + return ERR_PTR(-EBADF);
> + }
> +
> + dev = container_of(f->f_inode->i_cdev, struct rc_dev, lirc_cdev);
> + if (!dev->registered) {
> + fput(f);
> + return ERR_PTR(-ENODEV);
> + }
> +
> + get_device(&dev->dev);
> + fput(f);
> +
> + return dev;
> +}
> +
> MODULE_ALIAS("lirc_dev");
> diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
> index e0e6a17460f6..b6f24f369657 100644
> --- a/drivers/media/rc/rc-core-priv.h
> +++ b/drivers/media/rc/rc-core-priv.h
> @@ -57,6 +57,9 @@ struct ir_raw_event_ctrl {
> /* raw decoder state follows */
> struct ir_raw_event prev_ev;
> struct ir_raw_event this_ev;
> +#ifdef CONFIG_IR_BPF_DECODER
> + struct bpf_prog_array *progs;
> +#endif
> struct nec_dec {
> int state;
> unsigned count;
> @@ -288,6 +291,7 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev);
> void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc);
> int ir_lirc_register(struct rc_dev *dev);
> void ir_lirc_unregister(struct rc_dev *dev);
> +struct rc_dev *rc_dev_get_from_fd(int fd);
> #else
> static inline int lirc_dev_init(void) { return 0; }
> static inline void lirc_dev_exit(void) {}
> @@ -299,4 +303,15 @@ static inline int ir_lirc_register(struct rc_dev *dev) { return 0; }
> static inline void ir_lirc_unregister(struct rc_dev *dev) { }
> #endif
>
> +/*
> + * bpf interface
> + */
> +#ifdef CONFIG_IR_BPF_DECODER
> +void rc_dev_bpf_put(struct rc_dev *dev);
> +void rc_dev_bpf_run(struct rc_dev *dev);
> +#else
> +void rc_dev_bpf_put(struct rc_dev *dev) {}
> +void rc_dev_bpf_run(struct rc_dev *dev) {}
> +#endif
> +
> #endif /* _RC_CORE_PRIV */
> diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
> index 374f83105a23..efddd9c44466 100644
> --- a/drivers/media/rc/rc-ir-raw.c
> +++ b/drivers/media/rc/rc-ir-raw.c
> @@ -8,6 +8,8 @@
> #include <linux/mutex.h>
> #include <linux/kmod.h>
> #include <linux/sched.h>
> +#include <linux/filter.h>
> +#include <linux/bpf.h>
> #include "rc-core-priv.h"
>
> /* Used to keep track of IR raw clients, protected by ir_raw_handler_lock */
> @@ -33,6 +35,7 @@ static int ir_raw_event_thread(void *data)
> handler->decode(raw->dev, ev);
> ir_lirc_raw_event(raw->dev, ev);
> raw->prev_ev = ev;
> + rc_dev_bpf_run(raw->dev);
> }
> mutex_unlock(&ir_raw_handler_lock);
>
> @@ -623,6 +626,8 @@ void ir_raw_event_unregister(struct rc_dev *dev)
> handler->raw_unregister(dev);
> mutex_unlock(&ir_raw_handler_lock);
>
> + rc_dev_bpf_put(dev);
> +
> ir_raw_event_free(dev);
> }
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 6ad053e831c0..d9740599adf6 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -155,6 +155,7 @@ enum bpf_attach_type {
> BPF_CGROUP_INET6_CONNECT,
> BPF_CGROUP_INET4_POST_BIND,
> BPF_CGROUP_INET6_POST_BIND,
> + BPF_RAWIR_DECODER,
> __MAX_BPF_ATTACH_TYPE
> };
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 016ef9025827..63ecc1f2e1e3 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -27,6 +27,7 @@
> #include <linux/timekeeping.h>
> #include <linux/ctype.h>
> #include <linux/nospec.h>
> +#include <linux/bpf-rcdev.h>
>
> #define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PROG_ARRAY || \
> (map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \
> @@ -1556,6 +1557,8 @@ static int bpf_prog_attach(const union bpf_attr *attr)
> case BPF_SK_SKB_STREAM_PARSER:
> case BPF_SK_SKB_STREAM_VERDICT:
> return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, true);
> + case BPF_RAWIR_DECODER:
> + return rc_dev_prog_attach(attr);
> default:
> return -EINVAL;
> }
> @@ -1626,6 +1629,8 @@ static int bpf_prog_detach(const union bpf_attr *attr)
> case BPF_SK_SKB_STREAM_PARSER:
> case BPF_SK_SKB_STREAM_VERDICT:
> return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, false);
> + case BPF_RAWIR_DECODER:
> + return rc_dev_prog_detach(attr);
> default:
> return -EINVAL;
> }
> @@ -1673,6 +1678,8 @@ static int bpf_prog_query(const union bpf_attr *attr,
> case BPF_CGROUP_SOCK_OPS:
> case BPF_CGROUP_DEVICE:
> break;
> + case BPF_RAWIR_DECODER:
> + return rc_dev_prog_query(attr, uattr);
> default:
> return -EINVAL;
> }
> --
> 2.17.0
>
^ permalink raw reply
* Re: [PATCH v1 3/4] media: rc bpf: move ir_raw_event to uapi
From: Y Song @ 2018-05-15 5:26 UTC (permalink / raw)
To: Sean Young
Cc: linux-media, linux-kernel, Alexei Starovoitov,
Mauro Carvalho Chehab, Daniel Borkmann, netdev, Matthias Reichl,
Devin Heitmueller
In-Reply-To: <6ecdbd01b8c42c8784f2235c1e5109dac3dd86a5.1526331777.git.sean@mess.org>
On Mon, May 14, 2018 at 2:11 PM, Sean Young <sean@mess.org> wrote:
> The context provided to a BPF_PROG_RAWIR_DECODER is a struct ir_raw_event;
> ensure user space has a a definition.
>
> Signed-off-by: Sean Young <sean@mess.org>
> ---
> include/media/rc-core.h | 19 +------------------
> include/uapi/linux/bpf_rcdev.h | 24 ++++++++++++++++++++++++
Patch #2 already referenced this file. So if Patches #1 and #2
applied, there will be
a compilation error. Could you re-arrange your patchset so that after
sequentially
applying each patch, there is no compilation error?
> 2 files changed, 25 insertions(+), 18 deletions(-)
> create mode 100644 include/uapi/linux/bpf_rcdev.h
>
> diff --git a/include/media/rc-core.h b/include/media/rc-core.h
> index 6742fd86ff65..5d31e31d8ade 100644
> --- a/include/media/rc-core.h
> +++ b/include/media/rc-core.h
> @@ -21,6 +21,7 @@
> #include <linux/kfifo.h>
> #include <linux/time.h>
> #include <linux/timer.h>
> +#include <uapi/linux/bpf_rcdev.h>
> #include <media/rc-map.h>
>
> /**
> @@ -299,24 +300,6 @@ void rc_keydown_notimeout(struct rc_dev *dev, enum rc_proto protocol,
> void rc_keyup(struct rc_dev *dev);
> u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode);
>
> -/*
> - * From rc-raw.c
> - * The Raw interface is specific to InfraRed. It may be a good idea to
> - * split it later into a separate header.
> - */
> -struct ir_raw_event {
> - union {
> - u32 duration;
> - u32 carrier;
> - };
> - u8 duty_cycle;
> -
> - unsigned pulse:1;
> - unsigned reset:1;
> - unsigned timeout:1;
> - unsigned carrier_report:1;
> -};
> -
> #define DEFINE_IR_RAW_EVENT(event) struct ir_raw_event event = {}
>
> static inline void init_ir_raw_event(struct ir_raw_event *ev)
> diff --git a/include/uapi/linux/bpf_rcdev.h b/include/uapi/linux/bpf_rcdev.h
> new file mode 100644
> index 000000000000..d8629ff2b960
> --- /dev/null
> +++ b/include/uapi/linux/bpf_rcdev.h
> @@ -0,0 +1,24 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +/* Copyright (c) 2018 Sean Young <sean@mess.org>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of version 2 of the GNU General Public
> + * License as published by the Free Software Foundation.
> + */
> +#ifndef _UAPI__LINUX_BPF_RCDEV_H__
> +#define _UAPI__LINUX_BPF_RCDEV_H__
> +
> +struct ir_raw_event {
> + union {
> + __u32 duration;
> + __u32 carrier;
> + };
> + __u8 duty_cycle;
> +
> + unsigned pulse:1;
> + unsigned reset:1;
> + unsigned timeout:1;
> + unsigned carrier_report:1;
> +};
> +
> +#endif /* _UAPI__LINUX_BPF_RCDEV_H__ */
> --
> 2.17.0
>
^ permalink raw reply
* Re: [PATCH net-next] sched: cls: enable verbose logging
From: Cong Wang @ 2018-05-15 5:31 UTC (permalink / raw)
To: Marcelo Ricardo Leitner
Cc: Linux Kernel Network Developers, Jakub Kicinski, David Ahern,
Stephen Hemminger, Jiri Pirko, Alexander Aring, Jamal Hadi Salim
In-Reply-To: <20180514204725.GT4977@localhost.localdomain>
On Mon, May 14, 2018 at 1:47 PM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> On Mon, May 14, 2018 at 01:30:53PM -0700, Cong Wang wrote:
>> On Sun, May 13, 2018 at 1:44 PM, Marcelo Ricardo Leitner
>> <marcelo.leitner@gmail.com> wrote:
>> > Currently, when the rule is not to be exclusively executed by the
>> > hardware, extack is not passed along and offloading failures don't
>> > get logged. The idea was that hardware failures are okay because the
>> > rule will get executed in software then and this way it doesn't confuse
>> > unware users.
>> >
>> > But this is not helpful in case one needs to understand why a certain
>> > rule failed to get offloaded. Considering it may have been a temporary
>> > failure, like resources exceeded or so, reproducing it later and knowing
>> > that it is triggering the same reason may be challenging.
>>
>> I fail to understand why you need a flag here, IOW, why not just pass
>> extack unconditionally?
>
> Because (as discussed in the RFC[1], should have linked it here) it
> could confuse users that are not aware of offloading and, in other
> cases, it can be just noise (like it would be right now for ebpf,
> which is mostly used in sw-path).
>
> 1.https://www.mail-archive.com/netdev@vger.kernel.org/msg223016.html
My point is that a TC filter flag should be used for a filter attribute,
logging is apparently not a part of filter. At least, put it into HW offloading,
not in TC filter.
I know DaveM hates module parameters, but a module parameter here
is more suitable than a TC filter flag.
^ permalink raw reply
* Re: [PATCH net-next] erspan: set bso bit based on mirrored packet's len
From: Tobin C. Harding @ 2018-05-15 5:33 UTC (permalink / raw)
To: William Tu; +Cc: netdev
In-Reply-To: <1526342076-43714-1-git-send-email-u9012063@gmail.com>
On Mon, May 14, 2018 at 04:54:36PM -0700, William Tu wrote:
> Before the patch, the erspan BSO bit (Bad/Short/Oversized) is not
> handled. BSO has 4 possible values:
> 00 --> Good frame with no error, or unknown integrity
> 11 --> Payload is a Bad Frame with CRC or Alignment Error
> 01 --> Payload is a Short Frame
> 10 --> Payload is an Oversized Frame
>
> Based the short/oversized definitions in RFC1757, the patch sets
> the bso bit based on the mirrored packet's size.
>
> Reported-by: Xiaoyan Jin <xiaoyanj@vmware.com>
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
> include/net/erspan.h | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/include/net/erspan.h b/include/net/erspan.h
> index d044aa60cc76..5eb95f78ad45 100644
> --- a/include/net/erspan.h
> +++ b/include/net/erspan.h
> @@ -219,6 +219,30 @@ static inline __be32 erspan_get_timestamp(void)
> return htonl((u32)h_usecs);
> }
>
> +/* ERSPAN BSO (Bad/Short/Oversized)
> + * 00b --> Good frame with no error, or unknown integrity
> + * 01b --> Payload is a Short Frame
> + * 10b --> Payload is an Oversized Frame
> + * 11b --> Payload is a Bad Frame with CRC or Alignment Error
> + */
> +enum erspan_bso {
> + BSO_NOERROR,
> + BSO_SHORT,
> + BSO_OVERSIZED,
> + BSO_BAD,
> +};
If we are relying on the values perhaps this would be clearer
BSO_NOERROR = 0x00,
BSO_SHORT = 0x01,
BSO_OVERSIZED = 0x02,
BSO_BAD = 0x03,
> +
> +static inline u8 erspan_detect_bso(struct sk_buff *skb)
> +{
> + if (skb->len < ETH_ZLEN)
> + return BSO_SHORT;
> +
> + if (skb->len > ETH_FRAME_LEN)
> + return BSO_OVERSIZED;
> +
> + return BSO_NOERROR;
> +}
Without having much contextual knowledge around this patch; should we be
doing some check on CRC or alignment (at some stage)? Having BSO_BAD
seems to imply so?
Hope this helps,
Tobin.
^ permalink raw reply
* Re: [PATCH v1 4/4] samples/bpf: an example of a raw IR decoder
From: Y Song @ 2018-05-15 5:34 UTC (permalink / raw)
To: Sean Young
Cc: linux-media, linux-kernel, Alexei Starovoitov,
Mauro Carvalho Chehab, Daniel Borkmann, netdev, Matthias Reichl,
Devin Heitmueller
In-Reply-To: <1c8efa5dca5a8b97b81946b38044f826d12b8f50.1526331777.git.sean@mess.org>
On Mon, May 14, 2018 at 2:11 PM, Sean Young <sean@mess.org> wrote:
> This implements the grundig-16 IR protocol.
>
> Signed-off-by: Sean Young <sean@mess.org>
> ---
> samples/bpf/Makefile | 4 +
> samples/bpf/bpf_load.c | 9 +-
> samples/bpf/grundig_decoder_kern.c | 112 ++++++++++++++++++++++
> samples/bpf/grundig_decoder_user.c | 54 +++++++++++
> tools/bpf/bpftool/prog.c | 1 +
> tools/include/uapi/linux/bpf.h | 17 +++-
> tools/testing/selftests/bpf/bpf_helpers.h | 6 ++
> 7 files changed, 200 insertions(+), 3 deletions(-)
> create mode 100644 samples/bpf/grundig_decoder_kern.c
> create mode 100644 samples/bpf/grundig_decoder_user.c
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 4d6a6edd4bf6..c6fa111f103a 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -44,6 +44,7 @@ hostprogs-y += xdp_monitor
> hostprogs-y += xdp_rxq_info
> hostprogs-y += syscall_tp
> hostprogs-y += cpustat
> +hostprogs-y += grundig_decoder
>
> # Libbpf dependencies
> LIBBPF := ../../tools/lib/bpf/bpf.o ../../tools/lib/bpf/nlattr.o
> @@ -95,6 +96,7 @@ xdp_monitor-objs := bpf_load.o $(LIBBPF) xdp_monitor_user.o
> xdp_rxq_info-objs := bpf_load.o $(LIBBPF) xdp_rxq_info_user.o
> syscall_tp-objs := bpf_load.o $(LIBBPF) syscall_tp_user.o
> cpustat-objs := bpf_load.o $(LIBBPF) cpustat_user.o
> +grundig_decoder-objs := bpf_load.o $(LIBBPF) grundig_decoder_user.o
>
> # Tell kbuild to always build the programs
> always := $(hostprogs-y)
> @@ -148,6 +150,7 @@ always += xdp_rxq_info_kern.o
> always += xdp2skb_meta_kern.o
> always += syscall_tp_kern.o
> always += cpustat_kern.o
> +always += grundig_decoder_kern.o
>
> HOSTCFLAGS += -I$(objtree)/usr/include
> HOSTCFLAGS += -I$(srctree)/tools/lib/
> @@ -193,6 +196,7 @@ HOSTLOADLIBES_xdp_monitor += -lelf
> HOSTLOADLIBES_xdp_rxq_info += -lelf
> HOSTLOADLIBES_syscall_tp += -lelf
> HOSTLOADLIBES_cpustat += -lelf
> +HOSTLOADLIBES_grundig_decoder += -lelf
>
> # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline:
> # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
> diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
> index bebe4188b4b3..0fd389e95bb9 100644
> --- a/samples/bpf/bpf_load.c
> +++ b/samples/bpf/bpf_load.c
> @@ -69,6 +69,7 @@ static int load_and_attach(const char *event, struct bpf_insn *prog, int size)
> bool is_sockops = strncmp(event, "sockops", 7) == 0;
> bool is_sk_skb = strncmp(event, "sk_skb", 6) == 0;
> bool is_sk_msg = strncmp(event, "sk_msg", 6) == 0;
> + bool is_ir_decoder = strncmp(event, "ir_decoder", 10) == 0;
> size_t insns_cnt = size / sizeof(struct bpf_insn);
> enum bpf_prog_type prog_type;
> char buf[256];
> @@ -102,6 +103,8 @@ static int load_and_attach(const char *event, struct bpf_insn *prog, int size)
> prog_type = BPF_PROG_TYPE_SK_SKB;
> } else if (is_sk_msg) {
> prog_type = BPF_PROG_TYPE_SK_MSG;
> + } else if (is_ir_decoder) {
> + prog_type = BPF_PROG_TYPE_RAWIR_DECODER;
> } else {
> printf("Unknown event '%s'\n", event);
> return -1;
> @@ -116,7 +119,8 @@ static int load_and_attach(const char *event, struct bpf_insn *prog, int size)
>
> prog_fd[prog_cnt++] = fd;
>
> - if (is_xdp || is_perf_event || is_cgroup_skb || is_cgroup_sk)
> + if (is_xdp || is_perf_event || is_cgroup_skb || is_cgroup_sk ||
> + is_ir_decoder)
> return 0;
>
> if (is_socket || is_sockops || is_sk_skb || is_sk_msg) {
> @@ -607,7 +611,8 @@ static int do_load_bpf_file(const char *path, fixup_map_cb fixup_map)
> memcmp(shname, "cgroup/", 7) == 0 ||
> memcmp(shname, "sockops", 7) == 0 ||
> memcmp(shname, "sk_skb", 6) == 0 ||
> - memcmp(shname, "sk_msg", 6) == 0) {
> + memcmp(shname, "sk_msg", 6) == 0 ||
> + memcmp(shname, "ir_decoder", 10) == 0) {
> ret = load_and_attach(shname, data->d_buf,
> data->d_size);
> if (ret != 0)
> diff --git a/samples/bpf/grundig_decoder_kern.c b/samples/bpf/grundig_decoder_kern.c
> new file mode 100644
> index 000000000000..c80f2c9cc69a
> --- /dev/null
> +++ b/samples/bpf/grundig_decoder_kern.c
> @@ -0,0 +1,112 @@
> +
> +#include <uapi/linux/bpf.h>
> +#include <uapi/linux/bpf_rcdev.h>
> +#include "bpf_helpers.h"
> +#include <linux/version.h>
> +
> +enum grundig_state {
> + STATE_INACTIVE,
> + STATE_HEADER_SPACE,
> + STATE_LEADING_PULSE,
> + STATE_BITS_SPACE,
> + STATE_BITS_PULSE,
> +};
> +
> +struct decoder_state {
> + u32 bits;
> + enum grundig_state state;
> + u32 count;
> + u32 last_space;
> +};
> +
> +struct bpf_map_def SEC("maps") decoder_state_map = {
> + .type = BPF_MAP_TYPE_ARRAY,
> + .key_size = sizeof(u32),
> + .value_size = sizeof(struct decoder_state),
> + .max_entries = 1,
> +};
> +
> +#define US_TO_NS(t) 1000*(t)
> +static inline bool eq_margin(unsigned d1, unsigned d2, unsigned margin)
> +{
> + return ((d1 > (d2 - margin)) && (d1 < (d2 + margin)));
> +}
> +
> +SEC("ir_decoder/grundig_decoder")
> +int bpf_decoder(struct ir_raw_event *raw)
> +{
> + u32 key = 0;
> + struct decoder_state init = {};
> +
> + struct decoder_state *s = bpf_map_lookup_elem(&decoder_state_map, &key);
> +
> + if (!s)
> + s = &init;
> +
> + if (raw->carrier_report) {
> + // ignore
> + } else if (raw->reset) {
> + s->state = STATE_INACTIVE;
> + } else if (s->state == STATE_INACTIVE) {
> + if (raw->pulse && eq_margin(US_TO_NS(900), raw->duration, US_TO_NS(100))) {
> + s->bits = 0;
> + s->state = STATE_HEADER_SPACE;
> + s->count = 0;
> + }
> + } else if (s->state == STATE_HEADER_SPACE) {
> + if (!raw->pulse && eq_margin(US_TO_NS(2900), raw->duration, US_TO_NS(200)))
> + s->state = STATE_LEADING_PULSE;
> + else
> + s->state = STATE_INACTIVE;
> + } else if (s->state == STATE_LEADING_PULSE) {
> + if (raw->pulse && eq_margin(US_TO_NS(1300), raw->duration, US_TO_NS(100)))
> + s->state = STATE_BITS_SPACE;
> + else
> + s->state = STATE_INACTIVE;
> + } else if (s->state == STATE_BITS_SPACE) {
> + s->last_space = raw->duration;
> + s->state = STATE_BITS_PULSE;
> + } else if (s->state == STATE_BITS_PULSE) {
> + int t = -1;
> + if (eq_margin(s->last_space, US_TO_NS(472), US_TO_NS(150)) &&
> + eq_margin(raw->duration, US_TO_NS(583), US_TO_NS(150)))
> + t = 0;
> + if (eq_margin(s->last_space, US_TO_NS(1139), US_TO_NS(150)) &&
> + eq_margin(raw->duration, US_TO_NS(583), US_TO_NS(150)))
> + t = 1;
> + if (eq_margin(s->last_space, US_TO_NS(1806), US_TO_NS(150)) &&
> + eq_margin(raw->duration, US_TO_NS(583), US_TO_NS(150)))
> + t = 2;
> + if (eq_margin(s->last_space, US_TO_NS(2200), US_TO_NS(150)) &&
> + eq_margin(raw->duration, US_TO_NS(1139), US_TO_NS(150)))
> + t = 3;
> + if (t < 0) {
> + s->state = STATE_INACTIVE;
> + } else {
> + s->bits <<= 2;
> + switch (t) {
> + case 3: s->bits |= 0; break;
> + case 2: s->bits |= 3; break;
> + case 1: s->bits |= 2; break;
> + case 0: s->bits |= 1; break;
> + }
> + s->count += 2;
> + if (s->count == 16) {
> + bpf_rc_keydown(raw, 0x40, s->bits, 0);
> + s->state = STATE_INACTIVE;
> + } else {
> + s->state = STATE_BITS_SPACE;
> + }
> + }
> + }
> +
> + if (s == &init)
> + bpf_map_update_elem(&decoder_state_map, &key, s, BPF_NOEXIST);
> +
> + return 0;
> +}
> +
> +char _license[] SEC("license") = "GPL";
> +
> +u32 _version SEC("version") = LINUX_VERSION_CODE;
> +
> diff --git a/samples/bpf/grundig_decoder_user.c b/samples/bpf/grundig_decoder_user.c
> new file mode 100644
> index 000000000000..61e8ee5f73ee
> --- /dev/null
> +++ b/samples/bpf/grundig_decoder_user.c
> @@ -0,0 +1,54 @@
> +
> +#include <linux/bpf.h>
> +#include <assert.h>
> +#include <errno.h>
> +#include <signal.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <stdbool.h>
> +#include <string.h>
> +#include <unistd.h>
> +#include <libgen.h>
> +#include <sys/resource.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
> +
> +#include "bpf_load.h"
> +#include "bpf_util.h"
> +#include "libbpf.h"
> +
> +int main(int argc, char **argv)
> +{
> + char filename[256];
> + int ret, lircfd;
> +
> + if (argc != 2) {
> + printf("Usage: %s /dev/lircN\n", argv[0]);
Looks like the test requires /dev/lircN device. Is there any easy way
to test it?
Also, looks like the program does not depend on any kernel headers,
maybe it can be
moved to tools/testing/selftests/bpf/? There are testbot to run those
tests regularly.
> + return 2;
> + }
> +
> + snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
> +
> + if (load_bpf_file(filename)) {
> + printf("%s", bpf_log_buf);
> + return 1;
> + }
> +
> + lircfd = open(argv[1], O_RDWR);
> + if (lircfd == -1) {
> + printf("failed to open lirc device %s: %m\n", argv[1]);
> + return 1;
> + }
> +
> + ret = bpf_prog_attach(prog_fd[0], lircfd, BPF_RAWIR_DECODER, 0);
> + if (ret) {
> + printf("Failed to attach bpf to lirc device: %m\n");
> + return 1;
> + }
> +
> + printf("Grundig IR decoder loaded and attached. Hit any key to stop\n");
> + getchar();
> +
> + return 0;
> +}
> diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> index f7a810897eac..ae1c26df212d 100644
> --- a/tools/bpf/bpftool/prog.c
> +++ b/tools/bpf/bpftool/prog.c
> @@ -68,6 +68,7 @@ static const char * const prog_type_name[] = {
> [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops",
> [BPF_PROG_TYPE_SK_SKB] = "sk_skb",
> [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device",
> + [BPF_PROG_TYPE_RAWIR_DECODER] = "ir_decoder",
> };
>
> static void print_boot_time(__u64 nsecs, char *buf, unsigned int size)
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index c5ec89732a8d..d9740599adf6 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -137,6 +137,7 @@ enum bpf_prog_type {
> BPF_PROG_TYPE_SK_MSG,
> BPF_PROG_TYPE_RAW_TRACEPOINT,
> BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
> + BPF_PROG_TYPE_RAWIR_DECODER,
> };
>
> enum bpf_attach_type {
> @@ -154,6 +155,7 @@ enum bpf_attach_type {
> BPF_CGROUP_INET6_CONNECT,
> BPF_CGROUP_INET4_POST_BIND,
> BPF_CGROUP_INET6_POST_BIND,
> + BPF_RAWIR_DECODER,
> __MAX_BPF_ATTACH_TYPE
> };
>
> @@ -755,6 +757,17 @@ union bpf_attr {
> * @addr: pointer to struct sockaddr to bind socket to
> * @addr_len: length of sockaddr structure
> * Return: 0 on success or negative error code
> + *
> + * int bpf_rc_keydown(ctx, protocol, scancode, toggle)
> + * Report decoded scancode with toggle value
> + * @ctx: pointer to ctx
> + * @protocol: decoded protocol
> + * @scancode: decoded scancode
> + * @toggle: set to 1 if button was toggled, else 0
> + *
> + * int bpf_rc_repeat(ctx)
> + * Repeat the last decoded scancode
> + * @ctx: pointer to ctx
> */
> #define __BPF_FUNC_MAPPER(FN) \
> FN(unspec), \
> @@ -821,7 +834,9 @@ union bpf_attr {
> FN(msg_apply_bytes), \
> FN(msg_cork_bytes), \
> FN(msg_pull_data), \
> - FN(bind),
> + FN(bind), \
> + FN(rc_repeat), \
> + FN(rc_keydown),
>
> /* integer value in 'imm' field of BPF_CALL instruction selects which helper
> * function eBPF program intends to call
> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
> index d8223d99f96d..4bf23d3dfc33 100644
> --- a/tools/testing/selftests/bpf/bpf_helpers.h
> +++ b/tools/testing/selftests/bpf/bpf_helpers.h
> @@ -96,6 +96,12 @@ static int (*bpf_msg_pull_data)(void *ctx, int start, int end, int flags) =
> (void *) BPF_FUNC_msg_pull_data;
> static int (*bpf_bind)(void *ctx, void *addr, int addr_len) =
> (void *) BPF_FUNC_bind;
> +static int (*bpf_rc_repeat)(void *ctx) =
> + (void *) BPF_FUNC_rc_repeat;
> +static int (*bpf_rc_keydown)(void *ctx, unsigned protocol, unsigned scancode,
> + unsigned toggle) =
> + (void *) BPF_FUNC_rc_keydown;
> +
>
> /* llvm builtin functions that eBPF C program may use to
> * emit BPF_LD_ABS and BPF_LD_IND instructions
> --
> 2.17.0
>
^ permalink raw reply
* [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
Hi!
Following patches address build issues after recent move to libbpf.
For out-of-tree builds we would see the following error:
gcc: error: samples/bpf/../../tools/lib/bpf/libbpf.a: No such file or directory
libbpf build system is now always invoked explicitly rather than
relying on building single objects most of the time. We need to
resolve the friction between Kbuild and tools/ build system.
Mini-library called libbpf.h in samples is renamed to bpf_insn.h,
using linux/filter.h seems not completely trivial since some samples
get upset when order on include search path in changed. We do have
to rename libbpf.h, however, because otherwise it's hard to reliably
get to libbpf's header in out-of-tree builds.
v2:
- fix the build error harder (patch 3);
- add patch 5 (make clang less noisy).
Jakub Kicinski (5):
samples: bpf: include bpf/bpf.h instead of local libbpf.h
samples: bpf: rename libbpf.h to bpf_insn.h
samples: bpf: fix build after move to compiling full libbpf.a
samples: bpf: move libbpf from object dependencies to libs
samples: bpf: make the build less noisy
samples/bpf/Makefile | 165 +++++++-----------
samples/bpf/{libbpf.h => bpf_insn.h} | 8 +-
samples/bpf/bpf_load.c | 2 +-
samples/bpf/bpf_load.h | 2 +-
samples/bpf/cookie_uid_helper_example.c | 2 +-
samples/bpf/cpustat_user.c | 2 +-
samples/bpf/fds_example.c | 4 +-
samples/bpf/lathist_user.c | 2 +-
samples/bpf/load_sock_ops.c | 2 +-
samples/bpf/lwt_len_hist_user.c | 2 +-
samples/bpf/map_perf_test_user.c | 2 +-
samples/bpf/sock_example.c | 3 +-
samples/bpf/sock_example.h | 1 -
samples/bpf/sockex1_user.c | 2 +-
samples/bpf/sockex2_user.c | 2 +-
samples/bpf/sockex3_user.c | 2 +-
samples/bpf/syscall_tp_user.c | 2 +-
samples/bpf/tc_l2_redirect_user.c | 2 +-
samples/bpf/test_cgrp2_array_pin.c | 2 +-
samples/bpf/test_cgrp2_attach.c | 3 +-
samples/bpf/test_cgrp2_attach2.c | 3 +-
samples/bpf/test_cgrp2_sock.c | 3 +-
samples/bpf/test_cgrp2_sock2.c | 3 +-
.../bpf/test_current_task_under_cgroup_user.c | 2 +-
samples/bpf/test_lru_dist.c | 2 +-
samples/bpf/test_map_in_map_user.c | 2 +-
samples/bpf/test_overhead_user.c | 2 +-
samples/bpf/test_probe_write_user_user.c | 2 +-
samples/bpf/trace_output_user.c | 2 +-
samples/bpf/tracex1_user.c | 2 +-
samples/bpf/tracex2_user.c | 2 +-
samples/bpf/tracex3_user.c | 2 +-
samples/bpf/tracex4_user.c | 2 +-
samples/bpf/tracex5_user.c | 2 +-
samples/bpf/tracex6_user.c | 2 +-
samples/bpf/tracex7_user.c | 2 +-
samples/bpf/xdp_fwd_user.c | 2 +-
samples/bpf/xdp_monitor_user.c | 2 +-
samples/bpf/xdp_redirect_cpu_user.c | 2 +-
samples/bpf/xdp_redirect_map_user.c | 2 +-
samples/bpf/xdp_redirect_user.c | 2 +-
samples/bpf/xdp_router_ipv4_user.c | 2 +-
samples/bpf/xdp_tx_iptunnel_user.c | 2 +-
samples/bpf/xdpsock_user.c | 2 +-
44 files changed, 116 insertions(+), 147 deletions(-)
rename samples/bpf/{libbpf.h => bpf_insn.h} (98%)
--
2.17.0
^ permalink raw reply
* [PATCH bpf-next v2 1/5] samples: bpf: include bpf/bpf.h instead of local libbpf.h
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
There are two files in the tree called libbpf.h which is becoming
problematic. Most samples don't actually need the local libbpf.h
they simply include it to get to bpf/bpf.h. Include bpf/bpf.h
directly instead.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
samples/bpf/bpf_load.c | 2 +-
samples/bpf/bpf_load.h | 2 +-
samples/bpf/cpustat_user.c | 2 +-
samples/bpf/lathist_user.c | 2 +-
samples/bpf/load_sock_ops.c | 2 +-
samples/bpf/lwt_len_hist_user.c | 2 +-
samples/bpf/map_perf_test_user.c | 2 +-
samples/bpf/sock_example.h | 1 -
samples/bpf/sockex1_user.c | 2 +-
samples/bpf/sockex2_user.c | 2 +-
samples/bpf/sockex3_user.c | 2 +-
samples/bpf/syscall_tp_user.c | 2 +-
samples/bpf/tc_l2_redirect_user.c | 2 +-
samples/bpf/test_cgrp2_array_pin.c | 2 +-
samples/bpf/test_current_task_under_cgroup_user.c | 2 +-
samples/bpf/test_lru_dist.c | 2 +-
samples/bpf/test_map_in_map_user.c | 2 +-
samples/bpf/test_overhead_user.c | 2 +-
samples/bpf/test_probe_write_user_user.c | 2 +-
samples/bpf/trace_output_user.c | 2 +-
samples/bpf/tracex1_user.c | 2 +-
samples/bpf/tracex2_user.c | 2 +-
samples/bpf/tracex3_user.c | 2 +-
samples/bpf/tracex4_user.c | 2 +-
samples/bpf/tracex5_user.c | 2 +-
samples/bpf/tracex6_user.c | 2 +-
samples/bpf/tracex7_user.c | 2 +-
samples/bpf/xdp_fwd_user.c | 2 +-
samples/bpf/xdp_monitor_user.c | 2 +-
samples/bpf/xdp_redirect_cpu_user.c | 2 +-
samples/bpf/xdp_redirect_map_user.c | 2 +-
samples/bpf/xdp_redirect_user.c | 2 +-
samples/bpf/xdp_router_ipv4_user.c | 2 +-
samples/bpf/xdp_tx_iptunnel_user.c | 2 +-
samples/bpf/xdpsock_user.c | 2 +-
35 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index a6b290de5632..89161c9ed466 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -24,7 +24,7 @@
#include <poll.h>
#include <ctype.h>
#include <assert.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "perf-sys.h"
diff --git a/samples/bpf/bpf_load.h b/samples/bpf/bpf_load.h
index f9da59bca0cc..814894a12974 100644
--- a/samples/bpf/bpf_load.h
+++ b/samples/bpf/bpf_load.h
@@ -2,7 +2,7 @@
#ifndef __BPF_LOAD_H
#define __BPF_LOAD_H
-#include "libbpf.h"
+#include <bpf/bpf.h>
#define MAX_MAPS 32
#define MAX_PROGS 32
diff --git a/samples/bpf/cpustat_user.c b/samples/bpf/cpustat_user.c
index 2b4cd1ae57c5..869a99406dbf 100644
--- a/samples/bpf/cpustat_user.c
+++ b/samples/bpf/cpustat_user.c
@@ -17,7 +17,7 @@
#include <sys/resource.h>
#include <sys/wait.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#define MAX_CPU 8
diff --git a/samples/bpf/lathist_user.c b/samples/bpf/lathist_user.c
index 6477bad5b4e2..c8e88cc84e61 100644
--- a/samples/bpf/lathist_user.c
+++ b/samples/bpf/lathist_user.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <signal.h>
#include <linux/bpf.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#define MAX_ENTRIES 20
diff --git a/samples/bpf/load_sock_ops.c b/samples/bpf/load_sock_ops.c
index e5da6cf71a3e..8ecb41ea0c03 100644
--- a/samples/bpf/load_sock_ops.c
+++ b/samples/bpf/load_sock_ops.c
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string.h>
#include <linux/bpf.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include <unistd.h>
#include <errno.h>
diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
index 7fcb94c09112..587b68b1f8dd 100644
--- a/samples/bpf/lwt_len_hist_user.c
+++ b/samples/bpf/lwt_len_hist_user.c
@@ -9,7 +9,7 @@
#include <errno.h>
#include <arpa/inet.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_util.h"
#define MAX_INDEX 64
diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
index 519d9af4b04a..38b7b1a96cc2 100644
--- a/samples/bpf/map_perf_test_user.c
+++ b/samples/bpf/map_perf_test_user.c
@@ -21,7 +21,7 @@
#include <arpa/inet.h>
#include <errno.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#define TEST_BIT(t) (1U << (t))
diff --git a/samples/bpf/sock_example.h b/samples/bpf/sock_example.h
index 772d5dad8465..a27d7579bc73 100644
--- a/samples/bpf/sock_example.h
+++ b/samples/bpf/sock_example.h
@@ -9,7 +9,6 @@
#include <net/if.h>
#include <linux/if_packet.h>
#include <arpa/inet.h>
-#include "libbpf.h"
static inline int open_raw_sock(const char *name)
{
diff --git a/samples/bpf/sockex1_user.c b/samples/bpf/sockex1_user.c
index 2be935c2627d..93ec01c56104 100644
--- a/samples/bpf/sockex1_user.c
+++ b/samples/bpf/sockex1_user.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <assert.h>
#include <linux/bpf.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "sock_example.h"
#include <unistd.h>
diff --git a/samples/bpf/sockex2_user.c b/samples/bpf/sockex2_user.c
index 44fe0805b087..1d5c6e9a6d27 100644
--- a/samples/bpf/sockex2_user.c
+++ b/samples/bpf/sockex2_user.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <assert.h>
#include <linux/bpf.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "sock_example.h"
#include <unistd.h>
diff --git a/samples/bpf/sockex3_user.c b/samples/bpf/sockex3_user.c
index 495ee02e2fb7..5ba3ae9d180b 100644
--- a/samples/bpf/sockex3_user.c
+++ b/samples/bpf/sockex3_user.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <assert.h>
#include <linux/bpf.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "sock_example.h"
#include <unistd.h>
diff --git a/samples/bpf/syscall_tp_user.c b/samples/bpf/syscall_tp_user.c
index 9169d3207f18..1a1d0059a277 100644
--- a/samples/bpf/syscall_tp_user.c
+++ b/samples/bpf/syscall_tp_user.c
@@ -16,7 +16,7 @@
#include <assert.h>
#include <stdbool.h>
#include <sys/resource.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
/* This program verifies bpf attachment to tracepoint sys_enter_* and sys_exit_*.
diff --git a/samples/bpf/tc_l2_redirect_user.c b/samples/bpf/tc_l2_redirect_user.c
index 28995a776560..7ec45c3e8f56 100644
--- a/samples/bpf/tc_l2_redirect_user.c
+++ b/samples/bpf/tc_l2_redirect_user.c
@@ -13,7 +13,7 @@
#include <string.h>
#include <errno.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
static void usage(void)
{
diff --git a/samples/bpf/test_cgrp2_array_pin.c b/samples/bpf/test_cgrp2_array_pin.c
index 8a1b8b5d8def..242184292f59 100644
--- a/samples/bpf/test_cgrp2_array_pin.c
+++ b/samples/bpf/test_cgrp2_array_pin.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <fcntl.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
static void usage(void)
{
diff --git a/samples/bpf/test_current_task_under_cgroup_user.c b/samples/bpf/test_current_task_under_cgroup_user.c
index 65b5fb51c1db..4be4874ca2bc 100644
--- a/samples/bpf/test_current_task_under_cgroup_user.c
+++ b/samples/bpf/test_current_task_under_cgroup_user.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <linux/bpf.h>
#include <unistd.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include <linux/bpf.h>
#include "cgroup_helpers.h"
diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c
index 73c357142268..eec3e2509ce8 100644
--- a/samples/bpf/test_lru_dist.c
+++ b/samples/bpf/test_lru_dist.c
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <time.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_util.h"
#define min(a, b) ((a) < (b) ? (a) : (b))
diff --git a/samples/bpf/test_map_in_map_user.c b/samples/bpf/test_map_in_map_user.c
index 1aca18539d8d..e308858f7bcf 100644
--- a/samples/bpf/test_map_in_map_user.c
+++ b/samples/bpf/test_map_in_map_user.c
@@ -13,7 +13,7 @@
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#define PORT_A (map_fd[0])
diff --git a/samples/bpf/test_overhead_user.c b/samples/bpf/test_overhead_user.c
index e1d35e07a10e..6caf47afa635 100644
--- a/samples/bpf/test_overhead_user.c
+++ b/samples/bpf/test_overhead_user.c
@@ -19,7 +19,7 @@
#include <string.h>
#include <time.h>
#include <sys/resource.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#define MAX_CNT 1000000
diff --git a/samples/bpf/test_probe_write_user_user.c b/samples/bpf/test_probe_write_user_user.c
index bf8e3a9f3067..045eb5e30f54 100644
--- a/samples/bpf/test_probe_write_user_user.c
+++ b/samples/bpf/test_probe_write_user_user.c
@@ -3,7 +3,7 @@
#include <assert.h>
#include <linux/bpf.h>
#include <unistd.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include <sys/socket.h>
#include <string.h>
diff --git a/samples/bpf/trace_output_user.c b/samples/bpf/trace_output_user.c
index da98be721001..4837d73edefe 100644
--- a/samples/bpf/trace_output_user.c
+++ b/samples/bpf/trace_output_user.c
@@ -18,7 +18,7 @@
#include <sys/mman.h>
#include <time.h>
#include <signal.h>
-#include "libbpf.h"
+#include <libbpf.h>
#include "bpf_load.h"
#include "perf-sys.h"
#include "trace_helpers.h"
diff --git a/samples/bpf/tracex1_user.c b/samples/bpf/tracex1_user.c
index 3dcb475fb135..af8c20608ab5 100644
--- a/samples/bpf/tracex1_user.c
+++ b/samples/bpf/tracex1_user.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <linux/bpf.h>
#include <unistd.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
int main(int ac, char **argv)
diff --git a/samples/bpf/tracex2_user.c b/samples/bpf/tracex2_user.c
index efb5e61918df..1a81e6a5c2ea 100644
--- a/samples/bpf/tracex2_user.c
+++ b/samples/bpf/tracex2_user.c
@@ -7,7 +7,7 @@
#include <string.h>
#include <sys/resource.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "bpf_util.h"
diff --git a/samples/bpf/tracex3_user.c b/samples/bpf/tracex3_user.c
index fe372239d505..6c6b10f4c3ee 100644
--- a/samples/bpf/tracex3_user.c
+++ b/samples/bpf/tracex3_user.c
@@ -13,7 +13,7 @@
#include <linux/bpf.h>
#include <sys/resource.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "bpf_util.h"
diff --git a/samples/bpf/tracex4_user.c b/samples/bpf/tracex4_user.c
index 22c644f1f4c3..14625c898e43 100644
--- a/samples/bpf/tracex4_user.c
+++ b/samples/bpf/tracex4_user.c
@@ -14,7 +14,7 @@
#include <linux/bpf.h>
#include <sys/resource.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
struct pair {
diff --git a/samples/bpf/tracex5_user.c b/samples/bpf/tracex5_user.c
index 4e2774b731f0..c4ab91c89494 100644
--- a/samples/bpf/tracex5_user.c
+++ b/samples/bpf/tracex5_user.c
@@ -5,7 +5,7 @@
#include <linux/filter.h>
#include <linux/seccomp.h>
#include <sys/prctl.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include <sys/resource.h>
diff --git a/samples/bpf/tracex6_user.c b/samples/bpf/tracex6_user.c
index 89ab8d408474..4bb3c830adb2 100644
--- a/samples/bpf/tracex6_user.c
+++ b/samples/bpf/tracex6_user.c
@@ -16,7 +16,7 @@
#include <unistd.h>
#include "bpf_load.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "perf-sys.h"
#define SAMPLE_PERIOD 0x7fffffffffffffffULL
diff --git a/samples/bpf/tracex7_user.c b/samples/bpf/tracex7_user.c
index 8a52ac492e8b..ea6dae78f0df 100644
--- a/samples/bpf/tracex7_user.c
+++ b/samples/bpf/tracex7_user.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <linux/bpf.h>
#include <unistd.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
int main(int argc, char **argv)
diff --git a/samples/bpf/xdp_fwd_user.c b/samples/bpf/xdp_fwd_user.c
index 9c6606f57126..a87a2048ed32 100644
--- a/samples/bpf/xdp_fwd_user.c
+++ b/samples/bpf/xdp_fwd_user.c
@@ -26,7 +26,7 @@
#include "bpf_load.h"
#include "bpf_util.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
static int do_attach(int idx, int fd, const char *name)
diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c
index 05ad3f590c91..bf09b5188acd 100644
--- a/samples/bpf/xdp_monitor_user.c
+++ b/samples/bpf/xdp_monitor_user.c
@@ -26,7 +26,7 @@ static const char *__doc_err_only__=
#include <net/if.h>
#include <time.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "bpf_util.h"
diff --git a/samples/bpf/xdp_redirect_cpu_user.c b/samples/bpf/xdp_redirect_cpu_user.c
index 23744a8aaf21..f6efaefd485b 100644
--- a/samples/bpf/xdp_redirect_cpu_user.c
+++ b/samples/bpf/xdp_redirect_cpu_user.c
@@ -28,7 +28,7 @@ static const char *__doc__ =
* use bpf/libbpf.h), but cannot as (currently) needed for XDP
* attaching to a device via bpf_set_link_xdp_fd()
*/
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_load.h"
#include "bpf_util.h"
diff --git a/samples/bpf/xdp_redirect_map_user.c b/samples/bpf/xdp_redirect_map_user.c
index 7eae07d7293e..4445e76854b5 100644
--- a/samples/bpf/xdp_redirect_map_user.c
+++ b/samples/bpf/xdp_redirect_map_user.c
@@ -24,7 +24,7 @@
#include "bpf_load.h"
#include "bpf_util.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
static int ifindex_in;
static int ifindex_out;
diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_user.c
index b701b5c21342..81a69e36cb78 100644
--- a/samples/bpf/xdp_redirect_user.c
+++ b/samples/bpf/xdp_redirect_user.c
@@ -24,7 +24,7 @@
#include "bpf_load.h"
#include "bpf_util.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
static int ifindex_in;
static int ifindex_out;
diff --git a/samples/bpf/xdp_router_ipv4_user.c b/samples/bpf/xdp_router_ipv4_user.c
index 6296741c1fbd..b2b4dfa776c8 100644
--- a/samples/bpf/xdp_router_ipv4_user.c
+++ b/samples/bpf/xdp_router_ipv4_user.c
@@ -16,7 +16,7 @@
#include <sys/socket.h>
#include <unistd.h>
#include "bpf_load.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <poll.h>
diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunnel_user.c
index f0a787268a87..a4ccc33adac0 100644
--- a/samples/bpf/xdp_tx_iptunnel_user.c
+++ b/samples/bpf/xdp_tx_iptunnel_user.c
@@ -18,7 +18,7 @@
#include <unistd.h>
#include <time.h>
#include "bpf_load.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "bpf_util.h"
#include "xdp_tx_iptunnel_common.h"
diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
index 4b8a7cf3e63b..7fe60f6f7d53 100644
--- a/samples/bpf/xdpsock_user.c
+++ b/samples/bpf/xdpsock_user.c
@@ -38,7 +38,7 @@
#include "bpf_load.h"
#include "bpf_util.h"
-#include "libbpf.h"
+#include <bpf/bpf.h>
#include "xdpsock.h"
--
2.17.0
^ permalink raw reply related
* [PATCH bpf-next v2 2/5] samples: bpf: rename libbpf.h to bpf_insn.h
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
The libbpf.h file in samples is clashing with libbpf's header.
Since it only includes a subset of filter.h instruction helpers
rename it to bpf_insn.h. Drop the unnecessary include of bpf/bpf.h.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
samples/bpf/{libbpf.h => bpf_insn.h} | 8 +++-----
samples/bpf/cookie_uid_helper_example.c | 2 +-
samples/bpf/fds_example.c | 4 +++-
samples/bpf/sock_example.c | 3 ++-
samples/bpf/test_cgrp2_attach.c | 3 ++-
samples/bpf/test_cgrp2_attach2.c | 3 ++-
samples/bpf/test_cgrp2_sock.c | 3 ++-
samples/bpf/test_cgrp2_sock2.c | 3 ++-
8 files changed, 17 insertions(+), 12 deletions(-)
rename samples/bpf/{libbpf.h => bpf_insn.h} (98%)
diff --git a/samples/bpf/libbpf.h b/samples/bpf/bpf_insn.h
similarity index 98%
rename from samples/bpf/libbpf.h
rename to samples/bpf/bpf_insn.h
index 18bfee5aab6b..20dc5cefec84 100644
--- a/samples/bpf/libbpf.h
+++ b/samples/bpf/bpf_insn.h
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
-/* eBPF mini library */
-#ifndef __LIBBPF_H
-#define __LIBBPF_H
-
-#include <bpf/bpf.h>
+/* eBPF instruction mini library */
+#ifndef __BPF_INSN_H
+#define __BPF_INSN_H
struct bpf_insn;
diff --git a/samples/bpf/cookie_uid_helper_example.c b/samples/bpf/cookie_uid_helper_example.c
index 8eca27e595ae..deb0e3e0324d 100644
--- a/samples/bpf/cookie_uid_helper_example.c
+++ b/samples/bpf/cookie_uid_helper_example.c
@@ -51,7 +51,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <bpf/bpf.h>
-#include "libbpf.h"
+#include "bpf_insn.h"
#define PORT 8888
diff --git a/samples/bpf/fds_example.c b/samples/bpf/fds_example.c
index e29bd52ff9e8..9854854f05d1 100644
--- a/samples/bpf/fds_example.c
+++ b/samples/bpf/fds_example.c
@@ -12,8 +12,10 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <bpf/bpf.h>
+
+#include "bpf_insn.h"
#include "bpf_load.h"
-#include "libbpf.h"
#include "sock_example.h"
#define BPF_F_PIN (1 << 0)
diff --git a/samples/bpf/sock_example.c b/samples/bpf/sock_example.c
index 33a637507c00..60ec467c78ab 100644
--- a/samples/bpf/sock_example.c
+++ b/samples/bpf/sock_example.c
@@ -26,7 +26,8 @@
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <stddef.h>
-#include "libbpf.h"
+#include <bpf/bpf.h>
+#include "bpf_insn.h"
#include "sock_example.h"
char bpf_log_buf[BPF_LOG_BUF_SIZE];
diff --git a/samples/bpf/test_cgrp2_attach.c b/samples/bpf/test_cgrp2_attach.c
index 4bfcaf93fcf3..20fbd1241db3 100644
--- a/samples/bpf/test_cgrp2_attach.c
+++ b/samples/bpf/test_cgrp2_attach.c
@@ -28,8 +28,9 @@
#include <fcntl.h>
#include <linux/bpf.h>
+#include <bpf/bpf.h>
-#include "libbpf.h"
+#include "bpf_insn.h"
enum {
MAP_KEY_PACKETS,
diff --git a/samples/bpf/test_cgrp2_attach2.c b/samples/bpf/test_cgrp2_attach2.c
index 1af412ec6007..b453e6a161be 100644
--- a/samples/bpf/test_cgrp2_attach2.c
+++ b/samples/bpf/test_cgrp2_attach2.c
@@ -24,8 +24,9 @@
#include <unistd.h>
#include <linux/bpf.h>
+#include <bpf/bpf.h>
-#include "libbpf.h"
+#include "bpf_insn.h"
#include "cgroup_helpers.h"
#define FOO "/foo"
diff --git a/samples/bpf/test_cgrp2_sock.c b/samples/bpf/test_cgrp2_sock.c
index e79594dd629b..b0811da5a00f 100644
--- a/samples/bpf/test_cgrp2_sock.c
+++ b/samples/bpf/test_cgrp2_sock.c
@@ -21,8 +21,9 @@
#include <net/if.h>
#include <inttypes.h>
#include <linux/bpf.h>
+#include <bpf/bpf.h>
-#include "libbpf.h"
+#include "bpf_insn.h"
char bpf_log_buf[BPF_LOG_BUF_SIZE];
diff --git a/samples/bpf/test_cgrp2_sock2.c b/samples/bpf/test_cgrp2_sock2.c
index e53f1f6f0867..3b5be2364975 100644
--- a/samples/bpf/test_cgrp2_sock2.c
+++ b/samples/bpf/test_cgrp2_sock2.c
@@ -19,8 +19,9 @@
#include <fcntl.h>
#include <net/if.h>
#include <linux/bpf.h>
+#include <bpf/bpf.h>
-#include "libbpf.h"
+#include "bpf_insn.h"
#include "bpf_load.h"
static int usage(const char *argv0)
--
2.17.0
^ permalink raw reply related
* [PATCH bpf-next v2 3/5] samples: bpf: fix build after move to compiling full libbpf.a
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
There are many ways users may compile samples, some of them got
broken by commit 5f9380572b4b ("samples: bpf: compile and link
against full libbpf"). Improve path resolution and make libbpf
building a dependency of source files to force its build.
Samples should now again build with any of:
cd samples/bpf; make
make samples/bpf/
make -C samples/bpf
cd samples/bpf; make O=builddir
make samples/bpf/ O=builddir
make -C samples/bpf O=builddir
export KBUILD_OUTPUT=builddir
make samples/bpf/
make -C samples/bpf
Fixes: 5f9380572b4b ("samples: bpf: compile and link against full libbpf")
Reported-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
samples/bpf/Makefile | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 9e255ca4059a..0dae77c88d2e 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -1,4 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
+
+BPF_SAMPLES_PATH ?= $(abspath $(srctree)/$(src))
+TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools
+
# List of programs to build
hostprogs-y := test_lru_dist
hostprogs-y += sock_example
@@ -49,7 +53,8 @@ hostprogs-y += xdpsock
hostprogs-y += xdp_fwd
# Libbpf dependencies
-LIBBPF := ../../tools/lib/bpf/libbpf.a
+LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a
+
CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
@@ -233,15 +238,16 @@ CLANG_ARCH_ARGS = -target $(ARCH)
endif
# Trick to allow make to be run from this directory
-all: $(LIBBPF)
- $(MAKE) -C ../../ $(CURDIR)/
+all:
+ $(MAKE) -C ../../ $(CURDIR)/ BPF_SAMPLES_PATH=$(CURDIR)
clean:
$(MAKE) -C ../../ M=$(CURDIR) clean
@rm -f *~
$(LIBBPF): FORCE
- $(MAKE) -C $(dir $@)
+# Fix up variables inherited from Kbuild that tools/ build system won't like
+ $(MAKE) -C $(dir $@) RM='rm -rf' LDFLAGS= srctree=$(BPF_SAMPLES_PATH)/../../ O=
$(obj)/syscall_nrs.s: $(src)/syscall_nrs.c
$(call if_changed_dep,cc_s_c)
@@ -272,7 +278,8 @@ verify_target_bpf: verify_cmds
exit 2; \
else true; fi
-$(src)/*.c: verify_target_bpf
+$(BPF_SAMPLES_PATH)/*.c: verify_target_bpf $(LIBBPF)
+$(src)/*.c: verify_target_bpf $(LIBBPF)
$(obj)/tracex5_kern.o: $(obj)/syscall_nrs.h
--
2.17.0
^ permalink raw reply related
* [PATCH bpf-next v2 4/5] samples: bpf: move libbpf from object dependencies to libs
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
Make complains that it doesn't know how to make libbpf.a:
scripts/Makefile.host:106: target 'samples/bpf/../../tools/lib/bpf/libbpf.a' doesn't match the target pattern
Now that we have it as a dependency of the sources simply add libbpf.a
to libraries not objects.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
samples/bpf/Makefile | 145 +++++++++++++++----------------------------
1 file changed, 51 insertions(+), 94 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 0dae77c88d2e..0036a77c2d97 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -58,55 +58,53 @@ LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a
CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
-test_lru_dist-objs := test_lru_dist.o $(LIBBPF)
-sock_example-objs := sock_example.o $(LIBBPF)
-fds_example-objs := bpf_load.o $(LIBBPF) fds_example.o
-sockex1-objs := bpf_load.o $(LIBBPF) sockex1_user.o
-sockex2-objs := bpf_load.o $(LIBBPF) sockex2_user.o
-sockex3-objs := bpf_load.o $(LIBBPF) sockex3_user.o
-tracex1-objs := bpf_load.o $(LIBBPF) tracex1_user.o
-tracex2-objs := bpf_load.o $(LIBBPF) tracex2_user.o
-tracex3-objs := bpf_load.o $(LIBBPF) tracex3_user.o
-tracex4-objs := bpf_load.o $(LIBBPF) tracex4_user.o
-tracex5-objs := bpf_load.o $(LIBBPF) tracex5_user.o
-tracex6-objs := bpf_load.o $(LIBBPF) tracex6_user.o
-tracex7-objs := bpf_load.o $(LIBBPF) tracex7_user.o
-load_sock_ops-objs := bpf_load.o $(LIBBPF) load_sock_ops.o
-test_probe_write_user-objs := bpf_load.o $(LIBBPF) test_probe_write_user_user.o
-trace_output-objs := bpf_load.o $(LIBBPF) trace_output_user.o $(TRACE_HELPERS)
-lathist-objs := bpf_load.o $(LIBBPF) lathist_user.o
-offwaketime-objs := bpf_load.o $(LIBBPF) offwaketime_user.o $(TRACE_HELPERS)
-spintest-objs := bpf_load.o $(LIBBPF) spintest_user.o $(TRACE_HELPERS)
-map_perf_test-objs := bpf_load.o $(LIBBPF) map_perf_test_user.o
-test_overhead-objs := bpf_load.o $(LIBBPF) test_overhead_user.o
-test_cgrp2_array_pin-objs := test_cgrp2_array_pin.o $(LIBBPF)
-test_cgrp2_attach-objs := test_cgrp2_attach.o $(LIBBPF)
-test_cgrp2_attach2-objs := test_cgrp2_attach2.o $(LIBBPF) $(CGROUP_HELPERS)
-test_cgrp2_sock-objs := test_cgrp2_sock.o $(LIBBPF)
-test_cgrp2_sock2-objs := bpf_load.o $(LIBBPF) test_cgrp2_sock2.o
-xdp1-objs := xdp1_user.o $(LIBBPF)
+fds_example-objs := bpf_load.o fds_example.o
+sockex1-objs := bpf_load.o sockex1_user.o
+sockex2-objs := bpf_load.o sockex2_user.o
+sockex3-objs := bpf_load.o sockex3_user.o
+tracex1-objs := bpf_load.o tracex1_user.o
+tracex2-objs := bpf_load.o tracex2_user.o
+tracex3-objs := bpf_load.o tracex3_user.o
+tracex4-objs := bpf_load.o tracex4_user.o
+tracex5-objs := bpf_load.o tracex5_user.o
+tracex6-objs := bpf_load.o tracex6_user.o
+tracex7-objs := bpf_load.o tracex7_user.o
+load_sock_ops-objs := bpf_load.o load_sock_ops.o
+test_probe_write_user-objs := bpf_load.o test_probe_write_user_user.o
+trace_output-objs := bpf_load.o trace_output_user.o $(TRACE_HELPERS)
+lathist-objs := bpf_load.o lathist_user.o
+offwaketime-objs := bpf_load.o offwaketime_user.o $(TRACE_HELPERS)
+spintest-objs := bpf_load.o spintest_user.o $(TRACE_HELPERS)
+map_perf_test-objs := bpf_load.o map_perf_test_user.o
+test_overhead-objs := bpf_load.o test_overhead_user.o
+test_cgrp2_array_pin-objs := test_cgrp2_array_pin.o
+test_cgrp2_attach-objs := test_cgrp2_attach.o
+test_cgrp2_attach2-objs := test_cgrp2_attach2.o $(CGROUP_HELPERS)
+test_cgrp2_sock-objs := test_cgrp2_sock.o
+test_cgrp2_sock2-objs := bpf_load.o test_cgrp2_sock2.o
+xdp1-objs := xdp1_user.o
# reuse xdp1 source intentionally
-xdp2-objs := xdp1_user.o $(LIBBPF)
-xdp_router_ipv4-objs := bpf_load.o $(LIBBPF) xdp_router_ipv4_user.o
-test_current_task_under_cgroup-objs := bpf_load.o $(LIBBPF) $(CGROUP_HELPERS) \
+xdp2-objs := xdp1_user.o
+xdp_router_ipv4-objs := bpf_load.o xdp_router_ipv4_user.o
+test_current_task_under_cgroup-objs := bpf_load.o $(CGROUP_HELPERS) \
test_current_task_under_cgroup_user.o
-trace_event-objs := bpf_load.o $(LIBBPF) trace_event_user.o $(TRACE_HELPERS)
-sampleip-objs := bpf_load.o $(LIBBPF) sampleip_user.o $(TRACE_HELPERS)
-tc_l2_redirect-objs := bpf_load.o $(LIBBPF) tc_l2_redirect_user.o
-lwt_len_hist-objs := bpf_load.o $(LIBBPF) lwt_len_hist_user.o
-xdp_tx_iptunnel-objs := bpf_load.o $(LIBBPF) xdp_tx_iptunnel_user.o
-test_map_in_map-objs := bpf_load.o $(LIBBPF) test_map_in_map_user.o
-per_socket_stats_example-objs := cookie_uid_helper_example.o $(LIBBPF)
-xdp_redirect-objs := bpf_load.o $(LIBBPF) xdp_redirect_user.o
-xdp_redirect_map-objs := bpf_load.o $(LIBBPF) xdp_redirect_map_user.o
-xdp_redirect_cpu-objs := bpf_load.o $(LIBBPF) xdp_redirect_cpu_user.o
-xdp_monitor-objs := bpf_load.o $(LIBBPF) xdp_monitor_user.o
-xdp_rxq_info-objs := xdp_rxq_info_user.o $(LIBBPF)
-syscall_tp-objs := bpf_load.o $(LIBBPF) syscall_tp_user.o
-cpustat-objs := bpf_load.o $(LIBBPF) cpustat_user.o
-xdp_adjust_tail-objs := xdp_adjust_tail_user.o $(LIBBPF)
-xdpsock-objs := bpf_load.o $(LIBBPF) xdpsock_user.o
-xdp_fwd-objs := bpf_load.o $(LIBBPF) xdp_fwd_user.o
+trace_event-objs := bpf_load.o trace_event_user.o $(TRACE_HELPERS)
+sampleip-objs := bpf_load.o sampleip_user.o $(TRACE_HELPERS)
+tc_l2_redirect-objs := bpf_load.o tc_l2_redirect_user.o
+lwt_len_hist-objs := bpf_load.o lwt_len_hist_user.o
+xdp_tx_iptunnel-objs := bpf_load.o xdp_tx_iptunnel_user.o
+test_map_in_map-objs := bpf_load.o test_map_in_map_user.o
+per_socket_stats_example-objs := cookie_uid_helper_example.o
+xdp_redirect-objs := bpf_load.o xdp_redirect_user.o
+xdp_redirect_map-objs := bpf_load.o xdp_redirect_map_user.o
+xdp_redirect_cpu-objs := bpf_load.o xdp_redirect_cpu_user.o
+xdp_monitor-objs := bpf_load.o xdp_monitor_user.o
+xdp_rxq_info-objs := xdp_rxq_info_user.o
+syscall_tp-objs := bpf_load.o syscall_tp_user.o
+cpustat-objs := bpf_load.o cpustat_user.o
+xdp_adjust_tail-objs := xdp_adjust_tail_user.o
+xdpsock-objs := bpf_load.o xdpsock_user.o
+xdp_fwd-objs := bpf_load.o xdp_fwd_user.o
# Tell kbuild to always build the programs
always := $(hostprogs-y)
@@ -178,53 +176,12 @@ HOSTCFLAGS_spintest_user.o += -I$(srctree)/tools/lib/bpf/
HOSTCFLAGS_trace_event_user.o += -I$(srctree)/tools/lib/bpf/
HOSTCFLAGS_sampleip_user.o += -I$(srctree)/tools/lib/bpf/
-HOSTLOADLIBES_test_lru_dist += -lelf
-HOSTLOADLIBES_sock_example += -lelf
-HOSTLOADLIBES_fds_example += -lelf
-HOSTLOADLIBES_sockex1 += -lelf
-HOSTLOADLIBES_sockex2 += -lelf
-HOSTLOADLIBES_sockex3 += -lelf
-HOSTLOADLIBES_tracex1 += -lelf
-HOSTLOADLIBES_tracex2 += -lelf
-HOSTLOADLIBES_tracex3 += -lelf
-HOSTLOADLIBES_tracex4 += -lelf -lrt
-HOSTLOADLIBES_tracex5 += -lelf
-HOSTLOADLIBES_tracex6 += -lelf
-HOSTLOADLIBES_tracex7 += -lelf
-HOSTLOADLIBES_test_cgrp2_array_pin += -lelf
-HOSTLOADLIBES_test_cgrp2_attach += -lelf
-HOSTLOADLIBES_test_cgrp2_attach2 += -lelf
-HOSTLOADLIBES_test_cgrp2_sock += -lelf
-HOSTLOADLIBES_test_cgrp2_sock2 += -lelf
-HOSTLOADLIBES_load_sock_ops += -lelf
-HOSTLOADLIBES_test_probe_write_user += -lelf
-HOSTLOADLIBES_trace_output += -lelf -lrt
-HOSTLOADLIBES_lathist += -lelf
-HOSTLOADLIBES_offwaketime += -lelf
-HOSTLOADLIBES_spintest += -lelf
-HOSTLOADLIBES_map_perf_test += -lelf -lrt
-HOSTLOADLIBES_test_overhead += -lelf -lrt
-HOSTLOADLIBES_xdp1 += -lelf
-HOSTLOADLIBES_xdp2 += -lelf
-HOSTLOADLIBES_xdp_router_ipv4 += -lelf
-HOSTLOADLIBES_test_current_task_under_cgroup += -lelf
-HOSTLOADLIBES_trace_event += -lelf
-HOSTLOADLIBES_sampleip += -lelf
-HOSTLOADLIBES_tc_l2_redirect += -l elf
-HOSTLOADLIBES_lwt_len_hist += -l elf
-HOSTLOADLIBES_xdp_tx_iptunnel += -lelf
-HOSTLOADLIBES_test_map_in_map += -lelf
-HOSTLOADLIBES_per_socket_stats_example += -lelf
-HOSTLOADLIBES_xdp_redirect += -lelf
-HOSTLOADLIBES_xdp_redirect_map += -lelf
-HOSTLOADLIBES_xdp_redirect_cpu += -lelf
-HOSTLOADLIBES_xdp_monitor += -lelf
-HOSTLOADLIBES_xdp_rxq_info += -lelf
-HOSTLOADLIBES_syscall_tp += -lelf
-HOSTLOADLIBES_cpustat += -lelf
-HOSTLOADLIBES_xdp_adjust_tail += -lelf
-HOSTLOADLIBES_xdpsock += -lelf -pthread
-HOSTLOADLIBES_xdp_fwd += -lelf
+HOST_LOADLIBES += $(LIBBPF) -lelf
+HOSTLOADLIBES_tracex4 += -lrt
+HOSTLOADLIBES_trace_output += -lrt
+HOSTLOADLIBES_map_perf_test += -lrt
+HOSTLOADLIBES_test_overhead += -lrt
+HOSTLOADLIBES_xdpsock += -pthread
# Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline:
# make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
--
2.17.0
^ permalink raw reply related
* [PATCH bpf-next v2 5/5] samples: bpf: make the build less noisy
From: Jakub Kicinski @ 2018-05-15 5:35 UTC (permalink / raw)
To: alexei.starovoitov, daniel
Cc: oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer, Jakub Kicinski
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
Building samples with clang ignores the $(Q) setting, always
printing full command to the output. Make it less verbose.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
samples/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 0036a77c2d97..62d1aa1a4cf3 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -244,7 +244,8 @@ $(obj)/tracex5_kern.o: $(obj)/syscall_nrs.h
# But, there is no easy way to fix it, so just exclude it since it is
# useless for BPF samples.
$(obj)/%.o: $(src)/%.c
- $(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
+ @echo " CLANG-bpf " $@
+ $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
-I$(srctree)/tools/testing/selftests/bpf/ \
-D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \
-D__TARGET_ARCH_$(ARCH) -Wno-compare-distinct-pointer-types \
--
2.17.0
^ permalink raw reply related
* Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases
From: David Ahern @ 2018-05-15 5:54 UTC (permalink / raw)
To: Tobin C. Harding; +Cc: netdev, Thomas.Winter, idosch, sharpd, roopa
In-Reply-To: <20180515052104.GA10152@eros>
On 5/14/18 11:21 PM, Tobin C. Harding wrote:
> Hi David,
>
> On Mon, May 14, 2018 at 07:51:05PM -0700, David Ahern wrote:
>> This patch set fixes a few append and replace uses cases for IPv6 and
>> adds test cases that codifies the expectations of how append and replace
>> are expected to work.
>
> Nood question: what commit does this apply on top of please. I
> attempted to apply the set on top of net-next
>
> commit (961423f9fcbc Merge branch 'sctp-Introduce-sctp_flush_ctx')
>
> patch 4 and 5 have merge conflicts (I stopped at 5).
Base commit is:
commit 289e1f4e9e4a09c73a1c0152bb93855ea351ccda
Author: Anders Roxell <anders.roxell@linaro.org>
Date: Sun May 13 21:48:30 2018 +0200
net: ipv4: ipconfig: fix unused variable
I don't see 961423f9fcbc in any tree.
^ permalink raw reply
* Re: [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf
From: Alexei Starovoitov @ 2018-05-15 5:57 UTC (permalink / raw)
To: Jakub Kicinski
Cc: daniel, oss-drivers, netdev, Björn Töpel, Y Song,
Jesper Dangaard Brouer
In-Reply-To: <20180515053506.4345-1-jakub.kicinski@netronome.com>
On Mon, May 14, 2018 at 10:35:01PM -0700, Jakub Kicinski wrote:
> Hi!
>
> Following patches address build issues after recent move to libbpf.
> For out-of-tree builds we would see the following error:
>
> gcc: error: samples/bpf/../../tools/lib/bpf/libbpf.a: No such file or directory
>
> libbpf build system is now always invoked explicitly rather than
> relying on building single objects most of the time. We need to
> resolve the friction between Kbuild and tools/ build system.
>
> Mini-library called libbpf.h in samples is renamed to bpf_insn.h,
> using linux/filter.h seems not completely trivial since some samples
> get upset when order on include search path in changed. We do have
> to rename libbpf.h, however, because otherwise it's hard to reliably
> get to libbpf's header in out-of-tree builds.
>
> v2:
> - fix the build error harder (patch 3);
> - add patch 5 (make clang less noisy).
Applied, Thanks
^ permalink raw reply
* Re: [bpf-next PATCH 0/5] bpf, doc: convert Documentation/bpf to RST-formatting
From: Y Song @ 2018-05-15 5:57 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: Daniel Borkmann, Alexei Starovoitov, netdev, Quentin Monnet,
linux-man, linux-doc
In-Reply-To: <152630528901.29210.9018565600000101307.stgit@firesoul>
On Mon, May 14, 2018 at 6:42 AM, Jesper Dangaard Brouer
<brouer@redhat.com> wrote:
> The kernel is moving files under Documentation to use the RST
> (reStructuredText) format and Sphinx [1]. This patchset converts the
> files under Documentation/bpf/ into RST format. The Sphinx
> integration is left as followup work.
>
> [1] https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html
>
> This patchset have been uploaded as branch bpf_doc10 on github[2], so
> reviewers can see how GitHub renders this.
>
> [2] https://github.com/netoptimizer/linux/tree/bpf_doc10/Documentation/bpf
>
> ---
>
> Jesper Dangaard Brouer (5):
> bpf, doc: add basic README.rst file
> bpf, doc: rename txt files to rst files
> bpf, doc: convert bpf_design_QA.rst to use RST formatting
> bpf, doc: convert bpf_devel_QA.rst to use RST formatting
> bpf, doc: howto use/run the BPF selftests
This initial conversion from .txt to .rst files look good to me. Ack
for the whole series.
Acked-by: Yonghong Song <yhs@fb.com>
>
>
> Documentation/bpf/README.rst | 36 ++
> Documentation/bpf/bpf_design_QA.rst | 221 ++++++++++++
> Documentation/bpf/bpf_design_QA.txt | 156 ---------
> Documentation/bpf/bpf_devel_QA.rst | 640 +++++++++++++++++++++++++++++++++++
> Documentation/bpf/bpf_devel_QA.txt | 570 -------------------------------
> 5 files changed, 897 insertions(+), 726 deletions(-)
> create mode 100644 Documentation/bpf/README.rst
> create mode 100644 Documentation/bpf/bpf_design_QA.rst
> delete mode 100644 Documentation/bpf/bpf_design_QA.txt
> create mode 100644 Documentation/bpf/bpf_devel_QA.rst
> delete mode 100644 Documentation/bpf/bpf_devel_QA.txt
>
> --
^ permalink raw reply
* Re: [PATCH bpf-next v2 3/5] samples: bpf: fix build after move to compiling full libbpf.a
From: Björn Töpel @ 2018-05-15 6:05 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Alexei Starovoitov, Daniel Borkmann, oss-drivers, Netdev, Y Song,
Jesper Dangaard Brouer
In-Reply-To: <20180515053506.4345-4-jakub.kicinski@netronome.com>
2018-05-15 7:35 GMT+02:00 Jakub Kicinski <jakub.kicinski@netronome.com>:
> There are many ways users may compile samples, some of them got
> broken by commit 5f9380572b4b ("samples: bpf: compile and link
> against full libbpf"). Improve path resolution and make libbpf
> building a dependency of source files to force its build.
>
> Samples should now again build with any of:
> cd samples/bpf; make
> make samples/bpf/
> make -C samples/bpf
> cd samples/bpf; make O=builddir
> make samples/bpf/ O=builddir
> make -C samples/bpf O=builddir
> export KBUILD_OUTPUT=builddir
> make samples/bpf/
> make -C samples/bpf
>
> Fixes: 5f9380572b4b ("samples: bpf: compile and link against full libbpf")
> Reported-by: Björn Töpel <bjorn.topel@gmail.com>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
> samples/bpf/Makefile | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 9e255ca4059a..0dae77c88d2e 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -1,4 +1,8 @@
> # SPDX-License-Identifier: GPL-2.0
> +
> +BPF_SAMPLES_PATH ?= $(abspath $(srctree)/$(src))
> +TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools
> +
> # List of programs to build
> hostprogs-y := test_lru_dist
> hostprogs-y += sock_example
> @@ -49,7 +53,8 @@ hostprogs-y += xdpsock
> hostprogs-y += xdp_fwd
>
> # Libbpf dependencies
> -LIBBPF := ../../tools/lib/bpf/libbpf.a
> +LIBBPF = $(TOOLS_PATH)/lib/bpf/libbpf.a
> +
> CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
> TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
>
> @@ -233,15 +238,16 @@ CLANG_ARCH_ARGS = -target $(ARCH)
> endif
>
> # Trick to allow make to be run from this directory
> -all: $(LIBBPF)
> - $(MAKE) -C ../../ $(CURDIR)/
> +all:
> + $(MAKE) -C ../../ $(CURDIR)/ BPF_SAMPLES_PATH=$(CURDIR)
>
> clean:
> $(MAKE) -C ../../ M=$(CURDIR) clean
> @rm -f *~
>
> $(LIBBPF): FORCE
> - $(MAKE) -C $(dir $@)
> +# Fix up variables inherited from Kbuild that tools/ build system won't like
> + $(MAKE) -C $(dir $@) RM='rm -rf' LDFLAGS= srctree=$(BPF_SAMPLES_PATH)/../../ O=
>
> $(obj)/syscall_nrs.s: $(src)/syscall_nrs.c
> $(call if_changed_dep,cc_s_c)
> @@ -272,7 +278,8 @@ verify_target_bpf: verify_cmds
> exit 2; \
> else true; fi
>
> -$(src)/*.c: verify_target_bpf
> +$(BPF_SAMPLES_PATH)/*.c: verify_target_bpf $(LIBBPF)
> +$(src)/*.c: verify_target_bpf $(LIBBPF)
>
> $(obj)/tracex5_kern.o: $(obj)/syscall_nrs.h
>
> --
> 2.17.0
>
Thanks a bunch for this!
Tested-by: Björn Töpel <bjorn.topel@gmail.com>
^ permalink raw reply
* Re: [bpf-next PATCH 0/5] bpf, doc: convert Documentation/bpf to RST-formatting
From: Alexei Starovoitov @ 2018-05-15 6:05 UTC (permalink / raw)
To: Y Song
Cc: Jesper Dangaard Brouer, Daniel Borkmann, netdev, Quentin Monnet,
linux-man, linux-doc
In-Reply-To: <CAH3MdRV_f+gN+pHDQOviM9th6i1Evaa_Vh6dKSJcXE9ymqSd1Q@mail.gmail.com>
On Mon, May 14, 2018 at 10:57:25PM -0700, Y Song wrote:
> On Mon, May 14, 2018 at 6:42 AM, Jesper Dangaard Brouer
> <brouer@redhat.com> wrote:
> > The kernel is moving files under Documentation to use the RST
> > (reStructuredText) format and Sphinx [1]. This patchset converts the
> > files under Documentation/bpf/ into RST format. The Sphinx
> > integration is left as followup work.
> >
> > [1] https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html
> >
> > This patchset have been uploaded as branch bpf_doc10 on github[2], so
> > reviewers can see how GitHub renders this.
> >
> > [2] https://github.com/netoptimizer/linux/tree/bpf_doc10/Documentation/bpf
> >
> > ---
> >
> > Jesper Dangaard Brouer (5):
> > bpf, doc: add basic README.rst file
> > bpf, doc: rename txt files to rst files
> > bpf, doc: convert bpf_design_QA.rst to use RST formatting
> > bpf, doc: convert bpf_devel_QA.rst to use RST formatting
> > bpf, doc: howto use/run the BPF selftests
>
> This initial conversion from .txt to .rst files look good to me. Ack
> for the whole series.
> Acked-by: Yonghong Song <yhs@fb.com>
Applied, Thanks
^ permalink raw reply
* Re: [PATCH bpf-next v2 0/5] samples: bpf: fix build after move to full libbpf
From: Jesper Dangaard Brouer @ 2018-05-15 6:10 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Jakub Kicinski, daniel, oss-drivers, netdev,
Björn Töpel, Y Song, brouer
In-Reply-To: <20180515055751.yhr7wklhh2lshnzd@ast-mbp>
On Mon, 14 May 2018 22:57:53 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> On Mon, May 14, 2018 at 10:35:01PM -0700, Jakub Kicinski wrote:
> > Hi!
> >
> > Following patches address build issues after recent move to libbpf.
> > For out-of-tree builds we would see the following error:
> >
> > gcc: error: samples/bpf/../../tools/lib/bpf/libbpf.a: No such file or directory
> >
> > libbpf build system is now always invoked explicitly rather than
> > relying on building single objects most of the time. We need to
> > resolve the friction between Kbuild and tools/ build system.
> >
> > Mini-library called libbpf.h in samples is renamed to bpf_insn.h,
> > using linux/filter.h seems not completely trivial since some samples
> > get upset when order on include search path in changed. We do have
> > to rename libbpf.h, however, because otherwise it's hard to reliably
> > get to libbpf's header in out-of-tree builds.
> >
> > v2:
> > - fix the build error harder (patch 3);
> > - add patch 5 (make clang less noisy).
>
> Applied, Thanks
I just tried it out, but the build fails.
$ make samples/bpf/
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK scripts/mod/devicetable-offsets.h
make -C /home/jbrouer/git/kernel/bpf-next/samples/bpf/../../tools/lib/bpf/ RM='rm -rf' LDFLAGS= srctree=/home/jbrouer/git/kernel/bpf-next/samples/bpf/../../ O=
Auto-detecting system features:
... libelf: [ OFF ]
... bpf: [ OFF ]
No libelf found
make[2]: *** [Makefile:212: elfdep] Error 1
make[1]: *** [samples/bpf/Makefile:207: /home/jbrouer/git/kernel/bpf-next/samples/bpf/../../tools/lib/bpf/libbpf.a] Error 2
make: *** [Makefile:1743: samples/bpf/] Error 2
But it might not be related to this change, as the problem seems to the
with the "Auto-detecting system features". It is the build of libbpf
that is the problem.
$ cd tools/lib/bpf/
$ make
Auto-detecting system features:
... libelf: [ OFF ]
... bpf: [ OFF ]
No libelf found
make: *** [Makefile:212: elfdep] Error 1
And do have 'libelf' installed on this system... the same build/make
commands works on net-next.
On net-next I see:
$ cd tools/lib/bpf/
$ make
Auto-detecting system features:
... libelf: [ on ]
... bpf: [ on ]
Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
CC libbpf.o
CC bpf.o
CC nlattr.o
CC btf.o
LD libbpf-in.o
LINK libbpf.a
LINK libbpf.so
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases
From: Tobin C. Harding @ 2018-05-15 6:12 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, Thomas.Winter, idosch, sharpd, roopa
In-Reply-To: <458fe36b-355a-f11e-32b4-8a139c26a298@gmail.com>
On Mon, May 14, 2018 at 11:54:08PM -0600, David Ahern wrote:
> On 5/14/18 11:21 PM, Tobin C. Harding wrote:
> > Hi David,
> >
> > On Mon, May 14, 2018 at 07:51:05PM -0700, David Ahern wrote:
> >> This patch set fixes a few append and replace uses cases for IPv6 and
> >> adds test cases that codifies the expectations of how append and replace
> >> are expected to work.
> >
> > Nood question: what commit does this apply on top of please. I
> > attempted to apply the set on top of net-next
> >
> > commit (961423f9fcbc Merge branch 'sctp-Introduce-sctp_flush_ctx')
> >
> > patch 4 and 5 have merge conflicts (I stopped at 5).
>
> Base commit is:
>
> commit 289e1f4e9e4a09c73a1c0152bb93855ea351ccda
> Author: Anders Roxell <anders.roxell@linaro.org>
> Date: Sun May 13 21:48:30 2018 +0200
>
> net: ipv4: ipconfig: fix unused variable
>
>
>
> I don't see 961423f9fcbc in any tree.
Got it, thanks.
FTR
$ date
Tuesday 15 May 16:05:51 AEST 2018
$ git status
On branch net-next
Your branch is up-to-date with 'net-next/master'.
nothing to commit, working directory clean
$ git log -49 --pretty=oneline --abbrev-commit --reverse | grep 'ipv4: ipconfig: fix unused variable'
289e1f4e9e4a net: ipv4: ipconfig: fix unused variable
$ git log -48 --pretty=oneline --abbrev-commit --reverse | grep 'ipv4: ipconfig: fix unused variable'
Queue questions on how to run your selftests ;)
thanks,
Tobin.
^ permalink raw reply
* Re: possible deadlock in sk_diag_fill
From: Andrei Vagin @ 2018-05-15 6:18 UTC (permalink / raw)
To: Dmitry Vyukov; +Cc: syzbot, avagin, David Miller, LKML, netdev, syzkaller-bugs
In-Reply-To: <CACT4Y+a9v+38=DUpTGu0doaf3xWW02PUzoC7idgwOg+rV2eFTQ@mail.gmail.com>
On Tue, May 15, 2018 at 07:19:39AM +0200, Dmitry Vyukov wrote:
> On Mon, May 14, 2018 at 8:00 PM, Andrei Vagin <avagin@virtuozzo.com> wrote:
> >> >> Hello,
> >> >>
> >> >> syzbot found the following crash on:
> >> >>
> >> >> HEAD commit: c1c07416cdd4 Merge tag 'kbuild-fixes-v4.17' of git://git.k..
> >> >> git tree: upstream
> >> >> console output: https://syzkaller.appspot.com/x/log.txt?x=12164c97800000
> >> >> kernel config: https://syzkaller.appspot.com/x/.config?x=5a1dc06635c10d27
> >> >> dashboard link: https://syzkaller.appspot.com/bug?extid=c1872be62e587eae9669
> >> >> compiler: gcc (GCC) 8.0.1 20180413 (experimental)
> >> >> userspace arch: i386
> >> >>
> >> >> Unfortunately, I don't have any reproducer for this crash yet.
> >> >>
> >> >> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> >> >> Reported-by: syzbot+c1872be62e587eae9669@syzkaller.appspotmail.com
> >> >>
> >> >>
> >> >> ======================================================
> >> >> WARNING: possible circular locking dependency detected
> >> >> 4.17.0-rc3+ #59 Not tainted
> >> >> ------------------------------------------------------
> >> >> syz-executor1/25282 is trying to acquire lock:
> >> >> 000000004fddf743 (&(&u->lock)->rlock/1){+.+.}, at: sk_diag_dump_icons
> >> >> net/unix/diag.c:82 [inline]
> >> >> 000000004fddf743 (&(&u->lock)->rlock/1){+.+.}, at:
> >> >> sk_diag_fill.isra.5+0xa43/0x10d0 net/unix/diag.c:144
> >> >>
> >> >> but task is already holding lock:
> >> >> 00000000b6895645 (rlock-AF_UNIX){+.+.}, at: spin_lock
> >> >> include/linux/spinlock.h:310 [inline]
> >> >> 00000000b6895645 (rlock-AF_UNIX){+.+.}, at: sk_diag_dump_icons
> >> >> net/unix/diag.c:64 [inline]
> >> >> 00000000b6895645 (rlock-AF_UNIX){+.+.}, at: sk_diag_fill.isra.5+0x94e/0x10d0
> >> >> net/unix/diag.c:144
> >> >>
> >> >> which lock already depends on the new lock.
> >> >
> >> > In the code, we have a comment which explains why it is safe to take this lock
> >> >
> >> > /*
> >> > * The state lock is outer for the same sk's
> >> > * queue lock. With the other's queue locked it's
> >> > * OK to lock the state.
> >> > */
> >> > unix_state_lock_nested(req);
> >> >
> >> > It is a question how to explain this to lockdep.
> >>
> >> Do I understand it correctly that (&u->lock)->rlock associated with
> >> AF_UNIX is locked under rlock-AF_UNIX, and then rlock-AF_UNIX is
> >> locked under (&u->lock)->rlock associated with AF_NETLINK? If so, I
> >> think we need to split (&u->lock)->rlock by family too, so that we
> >> have u->lock-AF_UNIX and u->lock-AF_NETLINK.
> >
> > I think here is another problem. lockdep woried about
> > sk->sk_receive_queue vs unix_sk(s)->lock.
> >
> > sk_diag_dump_icons() takes sk->sk_receive_queue and then
> > unix_sk(s)->lock.
> >
> > unix_dgram_sendmsg takes unix_sk(sk)->lock and then sk->sk_receive_queue.
> >
> > sk_diag_dump_icons() takes locks for two different sockets, but
> > unix_dgram_sendmsg() takes locks for one socket.
> >
> > sk_diag_dump_icons
> > if (sk->sk_state == TCP_LISTEN) {
> > spin_lock(&sk->sk_receive_queue.lock);
> > skb_queue_walk(&sk->sk_receive_queue, skb) {
> > unix_state_lock_nested(req);
> > spin_lock_nested(&unix_sk(s)->lock,
> >
> >
> > unix_dgram_sendmsg
> > unix_state_lock(other)
> > spin_lock(&unix_sk(s)->lock)
> > skb_queue_tail(&other->sk_receive_queue, skb);
> > spin_lock_irqsave(&list->lock, flags);
>
>
> Do you mean the following?
> There is socket 1 with state lock (S1) and queue lock (Q2), and socket
> 2 with state lock (S2) and queue lock (Q2). unix_dgram_sendmsg lock
> S1->Q1. And sk_diag_dump_icons locks Q1->S2.
> If yes, then this looks pretty much as deadlock. Consider that 2
> unix_dgram_sendmsg in 2 different threads lock S1 and S2 respectively.
> Now 2 sk_diag_dump_icons in 2 different threads lock Q1 and Q2
> respectively. Now sk_diag_dump_icons want to lock S's, and
> unix_dgram_sendmsg want to lock Q's. Nobody can proceed.
Q1 and S1 belongs to a listen socket, so they can't be taken from
unix_dgram_sendmsg().
^ permalink raw reply
* Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases
From: David Ahern @ 2018-05-15 6:25 UTC (permalink / raw)
To: Tobin C. Harding; +Cc: netdev, Thomas.Winter, idosch, sharpd, roopa
In-Reply-To: <20180515061231.GC10152@eros>
On 5/15/18 12:12 AM, Tobin C. Harding wrote:
> Queue questions on how to run your selftests ;)
copy tools/testing/selftests/net/fib_tests.sh to test environment.
Run it with no options to run all tests or to run specific tests:
$ fib_tests.sh -t ipv4_rt
$ fib_tests.sh -t ipv6_rt
^ permalink raw reply
* Re: [PATCH net-next 2/3] gso: limit udp gso to egress-only virtual devices
From: kbuild test robot @ 2018-05-15 6:34 UTC (permalink / raw)
To: Willem de Bruijn
Cc: kbuild-all, netdev, davem, Willem de Bruijn, Alexander Duyck
In-Reply-To: <20180514230747.118875-3-willemdebruijn.kernel@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2893 bytes --]
Hi Willem,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Willem-de-Bruijn/udp-gso-fixes/20180515-120246
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa
All errors (new ones prefixed by >>):
drivers/net//team/team.c: In function '__team_compute_features':
>> drivers/net//team/team.c:1030:10: error: 'NETIF_GSO_UDP_L4' undeclared (first use in this function); did you mean 'NETIF_F_GSO_UDP_L4'?
NETIF_GSO_UDP_L4;
^~~~~~~~~~~~~~~~
NETIF_F_GSO_UDP_L4
drivers/net//team/team.c:1030:10: note: each undeclared identifier is reported only once for each function it appears in
vim +1030 drivers/net//team/team.c
996
997 #define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
998 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
999 NETIF_F_HIGHDMA | NETIF_F_LRO)
1000
1001 #define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
1002 NETIF_F_RXCSUM | NETIF_F_ALL_TSO)
1003
1004 static void __team_compute_features(struct team *team)
1005 {
1006 struct team_port *port;
1007 u32 vlan_features = TEAM_VLAN_FEATURES & NETIF_F_ALL_FOR_ALL;
1008 netdev_features_t enc_features = TEAM_ENC_FEATURES;
1009 unsigned short max_hard_header_len = ETH_HLEN;
1010 unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
1011 IFF_XMIT_DST_RELEASE_PERM;
1012
1013 list_for_each_entry(port, &team->port_list, list) {
1014 vlan_features = netdev_increment_features(vlan_features,
1015 port->dev->vlan_features,
1016 TEAM_VLAN_FEATURES);
1017 enc_features =
1018 netdev_increment_features(enc_features,
1019 port->dev->hw_enc_features,
1020 TEAM_ENC_FEATURES);
1021
1022
1023 dst_release_flag &= port->dev->priv_flags;
1024 if (port->dev->hard_header_len > max_hard_header_len)
1025 max_hard_header_len = port->dev->hard_header_len;
1026 }
1027
1028 team->dev->vlan_features = vlan_features;
1029 team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
> 1030 NETIF_GSO_UDP_L4;
1031 team->dev->hard_header_len = max_hard_header_len;
1032
1033 team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1034 if (dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
1035 team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
1036 }
1037
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52976 bytes --]
^ permalink raw reply
* Re: [PATCH RFC net-next 0/7] net/ipv6: Fix route append and replace use cases
From: Tobin C. Harding @ 2018-05-15 6:38 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, Thomas.Winter, idosch, sharpd, roopa
In-Reply-To: <34b6b5df-515f-62ed-7135-142b0895e7d1@gmail.com>
On Tue, May 15, 2018 at 12:25:03AM -0600, David Ahern wrote:
> On 5/15/18 12:12 AM, Tobin C. Harding wrote:
> > Queue questions on how to run your selftests ;)
>
> copy tools/testing/selftests/net/fib_tests.sh to test environment.
>
> Run it with no options to run all tests or to run specific tests:
>
> $ fib_tests.sh -t ipv4_rt
> $ fib_tests.sh -t ipv6_rt
I was joking but thanks!
Tobin
^ permalink raw reply
* Re: STMMAC driver with TSO enabled issue
From: Bhadram Varka @ 2018-05-15 6:44 UTC (permalink / raw)
To: Jose Abreu, netdev@vger.kernel.org, Joao Pinto
In-Reply-To: <77ff3baf-fec5-f0a2-9fdf-caa63d4944d0@synopsys.com>
Hi Jose,
On 5/10/2018 9:15 PM, Jose Abreu wrote:
>
>
> On 10-05-2018 16:08, Bhadram Varka wrote:
>> Hi Jose,
>>
>> On 5/10/2018 7:59 PM, Jose Abreu wrote:
>>> Hi Bhadram,
>>>
>>> On 10-05-2018 09:55, Jose Abreu wrote:
>>>> ++net-dev
>>>>
>>>> Hi Bhadram,
>>>>
>>>> On 09-05-2018 12:03, Bhadram Varka wrote:
>>>>> Hi,
>>>>>
>>>>> Thanks for responding.
>>>>>
>>>>> Tried below suggested way. Still observing the issue -
>>>> It seems stmmac has a bug in the RX side when using TSO which is
>>>> causing all the RX descriptors to be consumed. The stmmac_rx()
>>>> function will need to be refactored. I will send a fix ASAP.
>>>
>>> Are you using this patch [1] ? Because there is a problem with
>>> the patch. By adding the previously removed call to
>>> stmmac_init_rx_desc() TSO works okay in my setup.
>>>
>>
>> No. I don't have this change in my code base. I am using
>> net-next tree.
>>
>> Can you please post the change for which TSO works ? I can help
>> you with the testing.
>
> It should work with net-next because patch was not merged yet ...
> Please send me the output of "dmesg | grep -i stmmac", since boot
> and your full register values (from 0x0 to 0x12E4).
>
[root@alarm ~]# dmesg | grep -i dwc
[ 6.925005] dwc-eth-dwmac 2490000.ethernet: Cannot get CSR clock
[ 6.933657] dwc-eth-dwmac 2490000.ethernet: no reset control found
[ 6.955325] dwc-eth-dwmac 2490000.ethernet: User ID: 0x10, Synopsys
ID: 0x41
[ 6.962379] dwc-eth-dwmac 2490000.ethernet: DWMAC4/5
[ 6.967434] dwc-eth-dwmac 2490000.ethernet: DMA HW capability
register supported
[ 6.974827] dwc-eth-dwmac 2490000.ethernet: RX Checksum Offload
Engine supported
[ 6.982915] dwc-eth-dwmac 2490000.ethernet: TX Checksum insertion
supported
[ 6.991235] dwc-eth-dwmac 2490000.ethernet: Wake-Up On Lan supported
[ 6.998974] dwc-eth-dwmac 2490000.ethernet: TSO supported
[ 7.006422] dwc-eth-dwmac 2490000.ethernet: TSO feature enabled
[ 7.012581] dwc-eth-dwmac 2490000.ethernet: Enable RX Mitigation via
HW Watchdog Timer
[ 7.236391] dwc-eth-dwmac 2490000.ethernet eth0: device MAC address
4a:d1:e3:58:cb:7a
[ 7.333414] dwc-eth-dwmac 2490000.ethernet eth0: IEEE 1588-2008
Advanced Timestamp supported
[ 7.342441] dwc-eth-dwmac 2490000.ethernet eth0: registered PTP clock
[ 10.157066] dwc-eth-dwmac 2490000.ethernet eth0: Link is Up -
1Gbps/Full - flow control off
[root@alarm ~]# dmesg | grep -i stmma
[ 7.020567] libphy: stmmac: probed
[ 7.316295] Broadcom BCM89610 stmmac-0:00: attached PHY driver
[Broadcom BCM89610] (mii_bus:phy_addr=stmmac-0:00, irq=64)
I will get the register details -
FYI - TSO works fine with single channel. I see the issue only if multi
channel enabled (supports 4 Tx/Rx channels).
--
Thanks,
Bhadram.
^ permalink raw reply
* Re: Kernel panic on kernel-3.10.0-693.21.1.el7 in ndisc.h
From: Michal Kubecek @ 2018-05-15 6:55 UTC (permalink / raw)
To: Roman Makhov; +Cc: Stephen Hemminger, Alexander Aring, linux-wpan, netdev
In-Reply-To: <20180514140611.26eec64f@xeon-e3>
On Mon, May 14, 2018 at 02:06:11PM -0700, Stephen Hemminger wrote:
> On Mon, 14 May 2018 21:29:03 +0300 Roman Makhov <roman.makhov@gmail.com> wrote:
> > Thank you for the answer.
> > Unfortunately CentOS goes with these dinosaurs.
> > So we will try to debug the problem in the current one and try to
> > reproduce on the latest kernel.
>
> If you are stuck in old kernels, please bug the CentOs maintainers not
> upstream developers.
Actually, it's not even the dinosaur. Kernels from RHEL (and therefore
CentOS) or SLES differ from the original mainline version they are based
on quite a lot. It's possible that this bug didn't really exist in the
old 3.10 and is related to one of the backports added to CentOS (or
rather RHEL in this case) kernel. People outside of the distribution
have little idea what was backported and why so unless the issue can be
reproduced with mainline kernel they cannot be expected to help.
Michal Kubecek
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox