* [Patch net v2] netdev-FAQ: clarify DaveM's position for stable backports
From: Cong Wang @ 2018-06-05 16:48 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, stable, Greg Kroah-Hartman
Per discussion with David at netconf 2018, let's clarify
DaveM's position of handling stable backports in netdev-FAQ.
This is important for people relying on upstream -stable
releases.
Cc: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
Documentation/networking/netdev-FAQ.txt | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Documentation/networking/netdev-FAQ.txt b/Documentation/networking/netdev-FAQ.txt
index 2a3278d5cf35..fa951b820b25 100644
--- a/Documentation/networking/netdev-FAQ.txt
+++ b/Documentation/networking/netdev-FAQ.txt
@@ -179,6 +179,15 @@ A: No. See above answer. In short, if you think it really belongs in
dash marker line as described in Documentation/process/submitting-patches.rst to
temporarily embed that information into the patch that you send.
+Q: Are all networking bug fixes backported to all stable releases?
+
+A: Due to capacity, Dave could only take care of the backports for the last
+ 2 stable releases. For earlier stable releases, each stable branch maintainer
+ is supposed to take care of them. If you find any patch is missing from an
+ earlier stable branch, please notify stable@vger.kernel.org with either a
+ commit ID or a formal patch backported, and CC Dave and other relevant
+ networking developers.
+
Q: Someone said that the comment style and coding convention is different
for the networking content. Is this true?
--
2.13.0
^ permalink raw reply related
* Re: [PATCH] r8169: Reinstate ALDPS and ASPM support
From: Florian Fainelli @ 2018-06-05 16:47 UTC (permalink / raw)
To: David Miller, andrew
Cc: kai.heng.feng, hayeswang, hkallweit1, romieu, netdev,
linux-kernel, ryankao, jiri
In-Reply-To: <20180605.101532.899235999013307302.davem@davemloft.net>
On 06/05/2018 07:15 AM, David Miller wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> Date: Tue, 5 Jun 2018 16:11:14 +0200
>
>> No module parameter please. Just turn it on by default. Assuming
>> testing shows works.
>
> Agreed.
devlink would be a good candidate to add such configuration attributes,
since you would be operating on the PCI function itself, thus allowing
this to be on a per-device instance basis as opposed to global, which is
what a module parameter is.
--
Florian
^ permalink raw reply
* Re: [PATCH net-next] rtnetlink: validate attributes in do_setlink()
From: David Miller @ 2018-06-05 16:46 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, dvyukov
In-Reply-To: <20180605162519.230428-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Tue, 5 Jun 2018 09:25:19 -0700
> It seems that rtnl_group_changelink() can call do_setlink
> while a prior call to validate_linkmsg(dev = NULL, ...) could
> not validate IFLA_ADDRESS / IFLA_BROADCAST
>
> Make sure do_setlink() calls validate_linkmsg() instead
> of letting its callers having this responsibility.
>
> With help from Dmitry Vyukov, thanks a lot !
...
> Fixes: e7ed828f10bd ("netlink: support setting devgroup parameters")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH net-next] rtnetlink: validate attributes in do_setlink()
From: David Miller @ 2018-06-05 16:45 UTC (permalink / raw)
To: eric.dumazet; +Cc: edumazet, netdev, dvyukov
In-Reply-To: <66acac36-a304-b743-8c6e-ef9cc87366d3@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 5 Jun 2018 09:42:54 -0700
> On 06/05/2018 09:41 AM, David Miller wrote:
>> From: Eric Dumazet <edumazet@google.com>
>> Date: Tue, 5 Jun 2018 09:25:19 -0700
>>
>>> It seems that rtnl_group_changelink() can call do_setlink
>>> while a prior call to validate_linkmsg(dev = NULL, ...) could
>>> not validate IFLA_ADDRESS / IFLA_BROADCAST
>>>
>>> Make sure do_setlink() calls validate_linkmsg() instead
>>> of letting its callers having this responsibility.
>>
>> But now rtnl_newlink() will validate_linkmsg() twice....
>>
>
> Yes, is it a problem ? That is hardly fast path :)
Not a problem, just making sure you were aware.
^ permalink raw reply
* Re: [PATCH v5 1/3] drivers core: refactor device_shutdown
From: Andy Shevchenko @ 2018-06-05 16:44 UTC (permalink / raw)
To: Pavel Tatashin
Cc: Steven Sistare, Daniel Jordan, Linux Kernel Mailing List,
Kirsher, Jeffrey T, intel-wired-lan, netdev, Greg Kroah-Hartman,
Alexander Duyck, tobin
In-Reply-To: <20180516024004.28977-2-pasha.tatashin@oracle.com>
On Wed, May 16, 2018 at 5:40 AM, Pavel Tatashin
<pasha.tatashin@oracle.com> wrote:
> device_shutdown() traverses through the list of devices, and calls
> dev->{bug/driver}->shutdown() for each entry in the list.
>
> Refactor the function by keeping device_shutdown() to do the logic of
> traversing the list of devices, and device_shutdown_one() to perform the
> actual shutdown operation on one device.
>
FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
> ---
> drivers/base/core.c | 50 +++++++++++++++++++++++++++------------------
> 1 file changed, 30 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index b610816eb887..ed189f6d1a2f 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2765,6 +2765,35 @@ int device_move(struct device *dev, struct device *new_parent,
> }
> EXPORT_SYMBOL_GPL(device_move);
>
> +/*
> + * device_shutdown_one - call ->shutdown() for the device passed as
> + * argument.
> + */
> +static void device_shutdown_one(struct device *dev)
> +{
> + /* Don't allow any more runtime suspends */
> + pm_runtime_get_noresume(dev);
> + pm_runtime_barrier(dev);
> +
> + if (dev->class && dev->class->shutdown_pre) {
> + if (initcall_debug)
> + dev_info(dev, "shutdown_pre\n");
> + dev->class->shutdown_pre(dev);
> + }
> + if (dev->bus && dev->bus->shutdown) {
> + if (initcall_debug)
> + dev_info(dev, "shutdown\n");
> + dev->bus->shutdown(dev);
> + } else if (dev->driver && dev->driver->shutdown) {
> + if (initcall_debug)
> + dev_info(dev, "shutdown\n");
> + dev->driver->shutdown(dev);
> + }
> +
> + /* decrement the reference counter */
> + put_device(dev);
> +}
> +
> /**
> * device_shutdown - call ->shutdown() on each device to shutdown.
> */
> @@ -2801,30 +2830,11 @@ void device_shutdown(void)
> device_lock(parent);
> device_lock(dev);
>
> - /* Don't allow any more runtime suspends */
> - pm_runtime_get_noresume(dev);
> - pm_runtime_barrier(dev);
> -
> - if (dev->class && dev->class->shutdown_pre) {
> - if (initcall_debug)
> - dev_info(dev, "shutdown_pre\n");
> - dev->class->shutdown_pre(dev);
> - }
> - if (dev->bus && dev->bus->shutdown) {
> - if (initcall_debug)
> - dev_info(dev, "shutdown\n");
> - dev->bus->shutdown(dev);
> - } else if (dev->driver && dev->driver->shutdown) {
> - if (initcall_debug)
> - dev_info(dev, "shutdown\n");
> - dev->driver->shutdown(dev);
> - }
> -
> + device_shutdown_one(dev);
> device_unlock(dev);
> if (parent)
> device_unlock(parent);
>
> - put_device(dev);
> put_device(parent);
>
> spin_lock(&devices_kset->list_lock);
> --
> 2.17.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [Patch net-next] netdev-FAQ: clarify DaveM's position for stable backports
From: Cong Wang @ 2018-06-05 16:44 UTC (permalink / raw)
To: David Miller; +Cc: Linux Kernel Network Developers, stable, Greg KH
In-Reply-To: <20180605.094347.1260769683352764390.davem@davemloft.net>
On Tue, Jun 5, 2018 at 6:43 AM, David Miller <davem@davemloft.net> wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Mon, 4 Jun 2018 11:07:19 -0700
>
>> +Q: Are all networking bug fixes backported to all stable releases?
>> +
>> +A: Due to capacity, Dave could only take care of the backports for the last
>> + 3 stable releases.
>
> As Greg stated, I only do 2 not 3.
Sure, will send v2.
We just need a number here. :)
Thanks!
^ permalink raw reply
* Re: [PATCH net-next] rtnetlink: validate attributes in do_setlink()
From: Eric Dumazet @ 2018-06-05 16:42 UTC (permalink / raw)
To: David Miller, edumazet; +Cc: netdev, eric.dumazet, dvyukov
In-Reply-To: <20180605.124103.1922429680259846762.davem@davemloft.net>
On 06/05/2018 09:41 AM, David Miller wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Tue, 5 Jun 2018 09:25:19 -0700
>
>> It seems that rtnl_group_changelink() can call do_setlink
>> while a prior call to validate_linkmsg(dev = NULL, ...) could
>> not validate IFLA_ADDRESS / IFLA_BROADCAST
>>
>> Make sure do_setlink() calls validate_linkmsg() instead
>> of letting its callers having this responsibility.
>
> But now rtnl_newlink() will validate_linkmsg() twice....
>
Yes, is it a problem ? That is hardly fast path :)
^ permalink raw reply
* Re: [PATCH net-next] rtnetlink: validate attributes in do_setlink()
From: David Miller @ 2018-06-05 16:41 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, dvyukov
In-Reply-To: <20180605162519.230428-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Tue, 5 Jun 2018 09:25:19 -0700
> It seems that rtnl_group_changelink() can call do_setlink
> while a prior call to validate_linkmsg(dev = NULL, ...) could
> not validate IFLA_ADDRESS / IFLA_BROADCAST
>
> Make sure do_setlink() calls validate_linkmsg() instead
> of letting its callers having this responsibility.
But now rtnl_newlink() will validate_linkmsg() twice....
^ permalink raw reply
* pull-request: bpf-next 2018-06-05
From: Daniel Borkmann @ 2018-06-05 16:39 UTC (permalink / raw)
To: davem; +Cc: daniel, ast, netdev
Hi David,
The following pull-request contains BPF updates for your *net-next* tree.
The main changes are:
1) Add a new BPF hook for sendmsg similar to existing hooks for bind and
connect: "This allows to override source IP (including the case when it's
set via cmsg(3)) and destination IP:port for unconnected UDP (slow path).
TCP and connected UDP (fast path) are not affected. This makes UDP support
complete, that is, connected UDP is handled by connect hooks, unconnected
by sendmsg ones.", from Andrey.
2) Rework of the AF_XDP API to allow extending it in future for type writer
model if necessary. In this mode a memory window is passed to hardware
and multiple frames might be filled into that window instead of just one
that is the case in the current fixed frame-size model. With the new
changes made this can be supported without having to add a new descriptor
format. Also, core bits for the zero-copy support for AF_XDP have been
merged as agreed upon, where i40e bits will be routed via Jeff later on.
Various improvements to documentation and sample programs included as
well, all from Björn and Magnus.
3) Given BPF's flexibility, a new program type has been added to implement
infrared decoders. Quote: "The kernel IR decoders support the most
widely used IR protocols, but there are many protocols which are not
supported. [...] There is a 'long tail' of unsupported IR protocols,
for which lircd is need to decode the IR. IR encoding is done in such
a way that some simple circuit can decode it; therefore, BPF is ideal.
[...] user-space can define a decoder in BPF, attach it to the rc
device through the lirc chardev.", from Sean.
4) Several improvements and fixes to BPF core, among others, dumping map
and prog IDs into fdinfo which is a straight forward way to correlate
BPF objects used by applications, removing an indirect call and therefore
retpoline in all map lookup/update/delete calls by invoking the callback
directly for 64 bit archs, adding a new bpf_skb_cgroup_id() BPF helper
for tc BPF programs to have an efficient way of looking up cgroup v2 id
for policy or other use cases. Fixes to make sure we zero tunnel/xfrm
state that hasn't been filled, to allow context access wrt pt_regs in
32 bit archs for tracing, and last but not least various test cases
for fixes that landed in bpf earlier, from Daniel.
5) Get rid of the ndo_xdp_flush API and extend the ndo_xdp_xmit with
a XDP_XMIT_FLUSH flag instead which allows to avoid one indirect
call as flushing is now merged directly into ndo_xdp_xmit(), from Jesper.
6) Add a new bpf_get_current_cgroup_id() helper that can be used in
tracing to retrieve the cgroup id from the current process in order
to allow for e.g. aggregation of container-level events, from Yonghong.
7) Two follow-up fixes for BTF to reject invalid input values and
related to that also two test cases for BPF kselftests, from Martin.
8) Various API improvements to the bpf_fib_lookup() helper, that is,
dropping MPLS bits which are not fully hashed out yet, rejecting
invalid helper flags, returning error for unsupported address
families as well as renaming flowlabel to flowinfo, from David.
9) Various fixes and improvements to sockmap BPF kselftests in particular
in proper error detection and data verification, from Prashant.
10) Two arm32 BPF JIT improvements. One is to fix imm range check with
regards to whether immediate fits into 24 bits, and a naming cleanup
to get functions related to rsh handling consistent to those handling
lsh, from Wang.
11) Two compile warning fixes in BPF, one for BTF and a false positive
to silent gcc in stack_map_get_build_id_offset(), from Arnd.
12) Add missing seg6.h header into tools include infrastructure in order
to fix compilation of BPF kselftests, from Mathieu.
13) Several formatting cleanups in the BPF UAPI helper description that
also fix an error during rst2man compilation, from Quentin.
14) Hide an unused variable in sk_msg_convert_ctx_access() when IPv6 is
not built into the kernel, from Yue.
15) Remove a useless double assignment in dev_map_enqueue(), from Colin.
Please consider pulling these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
Thanks a lot!
----------------------------------------------------------------
The following changes since commit 5b79c2af667c0e2684f2a6dbf6439074b78f490c:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2018-05-26 19:46:15 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
for you to fetch changes up to 9fa06104a235f64d6a2bf3012cc9966e8e4be5eb:
Merge branch 'bpf-af-xdp-zc-api' (2018-06-05 15:58:07 +0200)
----------------------------------------------------------------
Alexei Starovoitov (4):
Merge branch 'btf-fixes'
Merge branch 'misc-BPF-improvements'
Merge branch 'ndo_xdp_xmit-cleanup'
Merge branch 'bpf_get_current_cgroup_id'
Andrey Ignatov (8):
libbpf: Install btf.h with libbpf
bpf: Define cgroup_bpf_enabled for CONFIG_CGROUP_BPF=n
bpf: Hooks for sys_sendmsg
bpf: Sync bpf.h to tools/
libbpf: Support guessing sendmsg{4,6} progs
selftests/bpf: Prepare test_sock_addr for extension
selftests/bpf: Selftest for sys_sendmsg hooks
bpftool: Support sendmsg{4,6} attach types
Arnd Bergmann (2):
bpf: btf: avoid -Wreturn-type warning
bpf: avoid -Wmaybe-uninitialized warning
Björn Töpel (10):
xsk: proper fill queue descriptor validation
xsk: proper Rx drop statistics update
xsk: new descriptor addressing scheme
samples/bpf: adapted to new uapi
xsk: moved struct xdp_umem definition
xsk: introduce xdp_umem_page
net: xdp: added bpf_netdev_command XDP_{QUERY, SETUP}_XSK_UMEM
xdp: add MEM_TYPE_ZERO_COPY
xsk: add zero-copy support for Rx
samples/bpf: xdpsock: use skb Tx path for XDP_SKB
Colin Ian King (1):
bpf: devmap: remove redundant assignment of dev = dev
Daniel Borkmann (17):
Merge branch 'bpf-sendmsg-hook'
Merge branch 'bpf-ir-decoder'
Merge branch 'bpf-sockmap-test-fixes'
bpf: test case for map pointer poison with calls/branches
bpf: add also cbpf long jump test cases with heavy expansion
bpf: fixup error message from gpl helpers on license mismatch
bpf: show prog and map id in fdinfo
bpf: avoid retpoline for lookup/update/delete calls on maps
bpf: add bpf_skb_cgroup_id helper
bpf: make sure to clear unused fields in tunnel/xfrm state fetch
bpf: fix cbpf parser bug for octal numbers
bpf: fix context access in tracing progs on 32 bit archs
bpf: sync bpf uapi header with tools
bpf, doc: add missing patchwork url and libbpf to maintainers
Merge branch 'bpf-af-xdp-fixes'
Merge branch 'bpf-xdp-remove-xdp-flush'
Merge branch 'bpf-af-xdp-zc-api'
David Ahern (4):
bpf: Drop mpls from bpf_fib_lookup
bpf: Verify flags in bpf_fib_lookup
bpf: Change bpf_fib_lookup to return -EAFNOSUPPORT for unsupported address families
bpf: flowlabel in bpf_fib_lookup should be flowinfo
Jesper Dangaard Brouer (13):
xdp: add flags argument to ndo_xdp_xmit API
i40e: implement flush flag for ndo_xdp_xmit
ixgbe: implement flush flag for ndo_xdp_xmit
tun: implement flush flag for ndo_xdp_xmit
virtio_net: implement flush flag for ndo_xdp_xmit
xdp: done implementing ndo_xdp_xmit flush flag for all drivers
bpf/xdp: non-map redirect can avoid calling ndo_xdp_flush
bpf/xdp: devmap can avoid calling ndo_xdp_flush
i40e: remove ndo_xdp_flush call i40e_xdp_flush
ixgbe: remove ndo_xdp_flush call ixgbe_xdp_flush
virtio_net: remove ndo_xdp_flush call virtnet_xdp_flush
tun: remove ndo_xdp_flush call tun_xdp_flush
net: remove net_device operation ndo_xdp_flush
Magnus Karlsson (3):
samples/bpf: minor *_nb_free performance fix
net: added netdevice operation for Tx
xsk: wire upp Tx zero-copy functions
Martin KaFai Lau (2):
bpf: btf: Check array t->size
bpf: btf: Ensure t->type == 0 for BTF_KIND_FWD
Mathieu Xhonneux (1):
selftests/bpf: missing headers test_lwt_seg6local
Prashant Bhole (5):
selftests/bpf: test_sockmap, check test failure
selftests/bpf: test_sockmap, join cgroup in selftest mode
selftests/bpf: test_sockmap, timing improvements
selftests/bpf: test_sockmap, fix data verification
selftests/bpf: test_sockmap, print additional test options
Quentin Monnet (1):
bpf: clean up eBPF helpers documentation
Sean Young (3):
bpf: bpf_prog_array_copy() should return -ENOENT if exclude_prog not found
media: rc: introduce BPF_PROG_LIRC_MODE2
bpf: add selftest for lirc_mode2 type program
Wang YanQing (2):
bpf, arm32: correct check_imm24
bpf, arm32: fix inconsistent naming about emit_a32_lsr_{r64,i64}
Yonghong Song (4):
bpf: implement bpf_get_current_cgroup_id() helper
tools/bpf: sync uapi bpf.h for bpf_get_current_cgroup_id() helper
tools/bpf: add a selftest for bpf_get_current_cgroup_id() helper
bpf: guard bpf_get_current_cgroup_id() with CONFIG_CGROUPS
YueHaibing (1):
bpf: hide the unused 'off' variable
Documentation/networking/af_xdp.rst | 101 +-
MAINTAINERS | 2 +
arch/arm/net/bpf_jit_32.c | 16 +-
drivers/media/rc/Kconfig | 13 +
drivers/media/rc/Makefile | 1 +
drivers/media/rc/bpf-lirc.c | 313 ++++++
drivers/media/rc/lirc_dev.c | 30 +
drivers/media/rc/rc-core-priv.h | 21 +
drivers/media/rc/rc-ir-raw.c | 12 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 -
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 33 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 4 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 42 +-
drivers/net/tun.c | 44 +-
drivers/net/virtio_net.c | 22 +-
include/linux/bpf-cgroup.h | 24 +-
include/linux/bpf.h | 1 +
include/linux/bpf_lirc.h | 29 +
include/linux/bpf_types.h | 3 +
include/linux/filter.h | 44 +-
include/linux/netdevice.h | 21 +-
include/net/xdp.h | 14 +
include/net/xdp_sock.h | 44 +-
include/uapi/linux/bpf.h | 136 ++-
include/uapi/linux/if_xdp.h | 16 +-
kernel/bpf/btf.c | 28 +-
kernel/bpf/cgroup.c | 11 +-
kernel/bpf/core.c | 12 +-
kernel/bpf/devmap.c | 21 +-
kernel/bpf/hashtab.c | 12 +-
kernel/bpf/helpers.c | 15 +
kernel/bpf/stackmap.c | 7 +-
kernel/bpf/syscall.c | 27 +-
kernel/bpf/verifier.c | 73 +-
kernel/trace/bpf_trace.c | 16 +-
lib/test_bpf.c | 63 ++
net/core/filter.c | 91 +-
net/core/xdp.c | 19 +-
net/ipv4/udp.c | 20 +-
net/ipv6/udp.c | 24 +
net/xdp/xdp_umem.c | 151 ++-
net/xdp/xdp_umem.h | 45 +-
net/xdp/xdp_umem_props.h | 4 +-
net/xdp/xsk.c | 199 +++-
net/xdp/xsk_queue.c | 2 +-
net/xdp/xsk_queue.h | 98 +-
samples/bpf/xdp_fwd_kern.c | 2 +-
samples/bpf/xdpsock_user.c | 97 +-
tools/bpf/bpf_exp.l | 2 +-
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 9 +-
tools/bpf/bpftool/bash-completion/bpftool | 5 +-
tools/bpf/bpftool/cgroup.c | 4 +-
tools/bpf/bpftool/prog.c | 1 +
tools/include/linux/filter.h | 10 +
tools/include/uapi/linux/bpf.h | 134 ++-
tools/include/uapi/linux/lirc.h | 217 ++++
tools/include/uapi/linux/seg6.h | 55 +
tools/include/uapi/linux/seg6_local.h | 80 ++
tools/lib/bpf/Makefile | 1 +
tools/lib/bpf/libbpf.c | 3 +
tools/testing/selftests/bpf/.gitignore | 2 +
tools/testing/selftests/bpf/Makefile | 9 +-
tools/testing/selftests/bpf/bpf_helpers.h | 7 +
tools/testing/selftests/bpf/cgroup_helpers.c | 57 +
tools/testing/selftests/bpf/cgroup_helpers.h | 1 +
tools/testing/selftests/bpf/get_cgroup_id_kern.c | 28 +
tools/testing/selftests/bpf/get_cgroup_id_user.c | 141 +++
tools/testing/selftests/bpf/sendmsg4_prog.c | 49 +
tools/testing/selftests/bpf/sendmsg6_prog.c | 60 +
tools/testing/selftests/bpf/test_btf.c | 45 +
tools/testing/selftests/bpf/test_lirc_mode2.sh | 28 +
tools/testing/selftests/bpf/test_lirc_mode2_kern.c | 23 +
tools/testing/selftests/bpf/test_lirc_mode2_user.c | 149 +++
tools/testing/selftests/bpf/test_sock_addr.c | 1155 ++++++++++++++++----
tools/testing/selftests/bpf/test_sockmap.c | 87 +-
tools/testing/selftests/bpf/test_verifier.c | 185 +++-
76 files changed, 3841 insertions(+), 730 deletions(-)
create mode 100644 drivers/media/rc/bpf-lirc.c
create mode 100644 include/linux/bpf_lirc.h
create mode 100644 tools/include/uapi/linux/lirc.h
create mode 100644 tools/include/uapi/linux/seg6.h
create mode 100644 tools/include/uapi/linux/seg6_local.h
create mode 100644 tools/testing/selftests/bpf/get_cgroup_id_kern.c
create mode 100644 tools/testing/selftests/bpf/get_cgroup_id_user.c
create mode 100644 tools/testing/selftests/bpf/sendmsg4_prog.c
create mode 100644 tools/testing/selftests/bpf/sendmsg6_prog.c
create mode 100755 tools/testing/selftests/bpf/test_lirc_mode2.sh
create mode 100644 tools/testing/selftests/bpf/test_lirc_mode2_kern.c
create mode 100644 tools/testing/selftests/bpf/test_lirc_mode2_user.c
^ permalink raw reply
* Re: [PATCH net] l2tp: fix refcount leakage on PPPoL2TP sockets
From: Guillaume Nault @ 2018-06-05 16:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev, jchapman
In-Reply-To: <20180605.094124.1023096251110931871.davem@davemloft.net>
On Tue, Jun 05, 2018 at 09:41:24AM -0400, David Miller wrote:
> From: Guillaume Nault <g.nault@alphalink.fr>
> Date: Mon, 4 Jun 2018 18:52:19 +0200
>
> > Commit d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session
> > object destroy") tried to fix a race condition where a PPPoL2TP socket
> > would disappear while the L2TP session was still using it. However, it
> > missed the root issue which is that an L2TP session may accept to be
> > reconnected if its associated socket has entered the release process.
> >
> > The tentative fix makes the session hold the socket it is connected to.
> > That saves the kernel from crashing, but introduces refcount leakage,
> > preventing the socket from completing the release process. Once stalled,
> > everything the socket depends on can't be released anymore, including
> > the L2TP session and the l2tp_ppp module.
> ...
> > So it all boils down to pppol2tp_connect() failing to realise that the
> > session has already been connected. This patch drops the unneeded extra
> > reference counting (mostly reverting d02ba2a6110c) and checks that
> > neither ->sk nor ->__sk is set before allowing a session to be
> > connected.
> >
> > Fixes: d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session object destroy")
> > Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
>
> So much fidgeting around in this area over the past year or two :-)
>
Putting L2TP into production without adding custom workarounds has been
such a long journey, but we're almost there :-)
> Applied and queued up for -stable, thanks for fixing this.
>
I still have a handful of issues to fix, though.
^ permalink raw reply
* Re: [net-next PATCH v3 0/5] Symmetric queue selection using XPS for Rx queues
From: David Miller @ 2018-06-05 16:33 UTC (permalink / raw)
To: amritha.nambiar
Cc: netdev, alexander.h.duyck, willemdebruijn.kernel,
sridhar.samudrala, edumazet, hannes, tom
In-Reply-To: <152818727065.20862.10108275498797168689.stgit@anamdev.jf.intel.com>
From: Amritha Nambiar <amritha.nambiar@intel.com>
Date: Tue, 05 Jun 2018 01:37:45 -0700
> This patch series implements support for Tx queue selection based on
> Rx queue(s) map. This is done by configuring Rx queue(s) map per Tx-queue
> using sysfs attribute. If the user configuration for Rx queues does
> not apply, then the Tx queue selection falls back to XPS using CPUs and
> finally to hashing.
>
> XPS is refactored to support Tx queue selection based on either the
> CPUs map or the Rx-queues map. The config option CONFIG_XPS needs to be
> enabled. By default no receive queues are configured for the Tx queue.
>
> - /sys/class/net/<dev>/queues/tx-*/xps_rxqs
>
> A set of receive queues can be mapped to a set of transmit queues (many:many),
> although the common use case is a 1:1 mapping. This will enable sending
> packets on the same Tx-Rx queue pair as this is useful for busy polling
> multi-threaded workloads where it is not possible to pin the threads to
> a CPU. This is a rework of Sridhar's patch for symmetric queueing via
> socket option:
> https://www.spinics.net/lists/netdev/msg453106.html
...
Thanks for doing this work.
I think this needs more time to sit and get reviews, and therefore needs
to be deferred to the next merge window.
^ permalink raw reply
* Re: [PATCH v2 net-next 0/3] devlink: Add extack messages for reload and port split/unsplit
From: David Miller @ 2018-06-05 16:32 UTC (permalink / raw)
To: dsahern; +Cc: netdev, idosch, jiri, jakub.kicinski, dsahern
In-Reply-To: <20180605151411.20310-1-dsahern@kernel.org>
From: dsahern@kernel.org
Date: Tue, 5 Jun 2018 08:14:08 -0700
> From: David Ahern <dsahern@gmail.com>
>
> Patch 1 adds extack arg to reload, port_split and port_unsplit devlink
> operations.
>
> Patch 2 adds extack messages for reload operation in netdevsim.
>
> Patch 3 adds extack messages to port split/unsplit in mlxsw driver.
>
> v2
> - make the extack messages align with existing dev_err
Series applied, thanks David.
^ permalink raw reply
* Re: [PATCH v2 net-next] net: metrics: add proper netlink validation
From: David Miller @ 2018-06-05 16:30 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, dsahern
In-Reply-To: <20180605130619.150153-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Tue, 5 Jun 2018 06:06:19 -0700
> Before using nla_get_u32(), better make sure the attribute
> is of the proper size.
>
> Code recently was changed, but bug has been there from beginning
> of git.
...
> Fixes: a919525ad832 ("net: Move fib_convert_metrics to metrics file")
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Cc: David Ahern <dsahern@gmail.com>
> ---
> v2: fixed a typo.
Applied and queued up for -stable, thanks Eric.
^ permalink raw reply
* Re: [PATCH net v2 2/2] ipmr: fix error path when ipmr_new_table fails
From: David Miller @ 2018-06-05 16:31 UTC (permalink / raw)
To: sd; +Cc: netdev, edumazet, nikolay, yuvalm, ivecera
In-Reply-To: <572e1baf89c76fafb45a97a724c3e838e5dd4abf.1528194845.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 5 Jun 2018 15:02:00 +0200
> commit 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
> refactored ipmr_new_table, so that it now returns NULL when
> mr_table_alloc fails. Unfortunately, all callers of ipmr_new_table
> expect an ERR_PTR.
>
> This can result in NULL deref, for example when ipmr_rules_exit calls
> ipmr_free_table with NULL net->ipv4.mrt in the
> !CONFIG_IP_MROUTE_MULTIPLE_TABLES version.
>
> This patch makes mr_table_alloc return errors, and changes
> ip6mr_new_table and its callers to return/expect error pointers as
> well. It also removes the version of mr_table_alloc defined under
> !CONFIG_IP_MROUTE_COMMON, since it is never used.
>
> Fixes: 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> ---
> v2: - fixed brainfart that shadowed mrt variable in ip6_mroute_setsockopt
> - rebased on top of ip6_mroute_setsockopt fix
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH net v2 1/2] ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
From: David Miller @ 2018-06-05 16:30 UTC (permalink / raw)
To: sd; +Cc: netdev, edumazet, nikolay, yuvalm, ivecera
In-Reply-To: <604985fb55d51eef9130bff0640a62d5015f25bd.1528194845.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 5 Jun 2018 15:01:59 +0200
> Currently, raw6_sk(sk)->ip6mr_table is set unconditionally during
> ip6_mroute_setsockopt(MRT6_TABLE). A subsequent attempt at the same
> setsockopt will fail with -ENOENT, since we haven't actually created
> that table.
>
> A similar fix for ipv4 was included in commit 5e1859fbcc3c ("ipv4: ipmr:
> various fixes and cleanups").
>
> Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Applied and queued up for -stable.
^ permalink raw reply
* [PATCH net-next] rtnetlink: validate attributes in do_setlink()
From: Eric Dumazet @ 2018-06-05 16:25 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Dmitry Vyukov
It seems that rtnl_group_changelink() can call do_setlink
while a prior call to validate_linkmsg(dev = NULL, ...) could
not validate IFLA_ADDRESS / IFLA_BROADCAST
Make sure do_setlink() calls validate_linkmsg() instead
of letting its callers having this responsibility.
With help from Dmitry Vyukov, thanks a lot !
BUG: KMSAN: uninit-value in is_valid_ether_addr include/linux/etherdevice.h:199 [inline]
BUG: KMSAN: uninit-value in eth_prepare_mac_addr_change net/ethernet/eth.c:275 [inline]
BUG: KMSAN: uninit-value in eth_mac_addr+0x203/0x2b0 net/ethernet/eth.c:308
CPU: 1 PID: 8695 Comm: syz-executor3 Not tainted 4.17.0-rc5+ #103
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x185/0x1d0 lib/dump_stack.c:113
kmsan_report+0x149/0x260 mm/kmsan/kmsan.c:1084
__msan_warning_32+0x6e/0xc0 mm/kmsan/kmsan_instr.c:686
is_valid_ether_addr include/linux/etherdevice.h:199 [inline]
eth_prepare_mac_addr_change net/ethernet/eth.c:275 [inline]
eth_mac_addr+0x203/0x2b0 net/ethernet/eth.c:308
dev_set_mac_address+0x261/0x530 net/core/dev.c:7157
do_setlink+0xbc3/0x5fc0 net/core/rtnetlink.c:2317
rtnl_group_changelink net/core/rtnetlink.c:2824 [inline]
rtnl_newlink+0x1fe9/0x37a0 net/core/rtnetlink.c:2976
rtnetlink_rcv_msg+0xa32/0x1560 net/core/rtnetlink.c:4646
netlink_rcv_skb+0x378/0x600 net/netlink/af_netlink.c:2448
rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4664
netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
netlink_unicast+0x1678/0x1750 net/netlink/af_netlink.c:1336
netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x455a09
RSP: 002b:00007fc07480ec68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fc07480f6d4 RCX: 0000000000455a09
RDX: 0000000000000000 RSI: 00000000200003c0 RDI: 0000000000000014
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000005d0 R14: 00000000006fdc20 R15: 0000000000000000
Uninit was stored to memory at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline]
kmsan_save_stack mm/kmsan/kmsan.c:294 [inline]
kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:685
kmsan_memcpy_origins+0x11d/0x170 mm/kmsan/kmsan.c:527
__msan_memcpy+0x109/0x160 mm/kmsan/kmsan_instr.c:478
do_setlink+0xb84/0x5fc0 net/core/rtnetlink.c:2315
rtnl_group_changelink net/core/rtnetlink.c:2824 [inline]
rtnl_newlink+0x1fe9/0x37a0 net/core/rtnetlink.c:2976
rtnetlink_rcv_msg+0xa32/0x1560 net/core/rtnetlink.c:4646
netlink_rcv_skb+0x378/0x600 net/netlink/af_netlink.c:2448
rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4664
netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
netlink_unicast+0x1678/0x1750 net/netlink/af_netlink.c:1336
netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline]
kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:189
kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:315
kmsan_slab_alloc+0x10/0x20 mm/kmsan/kmsan.c:322
slab_post_alloc_hook mm/slab.h:446 [inline]
slab_alloc_node mm/slub.c:2753 [inline]
__kmalloc_node_track_caller+0xb32/0x11b0 mm/slub.c:4395
__kmalloc_reserve net/core/skbuff.c:138 [inline]
__alloc_skb+0x2cb/0x9e0 net/core/skbuff.c:206
alloc_skb include/linux/skbuff.h:988 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline]
netlink_sendmsg+0x76e/0x1350 net/netlink/af_netlink.c:1876
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: e7ed828f10bd ("netlink: support setting devgroup parameters")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
---
net/core/rtnetlink.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 9a1ba2015ad8901680cfc58f95cf6ec525413566..5ef61222fdef1f305909eeca6ac278bcac88e1b0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2266,6 +2266,10 @@ static int do_setlink(const struct sk_buff *skb,
const struct net_device_ops *ops = dev->netdev_ops;
int err;
+ err = validate_linkmsg(dev, tb);
+ if (err < 0)
+ return err;
+
if (tb[IFLA_NET_NS_PID] || tb[IFLA_NET_NS_FD] || tb[IFLA_IF_NETNSID]) {
struct net *net = rtnl_link_get_net_capable(skb, dev_net(dev),
tb, CAP_NET_ADMIN);
@@ -2629,10 +2633,6 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
goto errout;
}
- err = validate_linkmsg(dev, tb);
- if (err < 0)
- goto errout;
-
err = do_setlink(skb, dev, ifm, extack, tb, ifname, 0);
errout:
return err;
--
2.17.1.1185.g55be947832-goog
^ permalink raw reply related
* Re: suspicius csum initialization in vmxnet3_rx_csum
From: Paolo Abeni @ 2018-06-05 16:08 UTC (permalink / raw)
To: Ronak Doshi, Neil Horman; +Cc: Guolin Yang, Boon Ang, Louis Luo, netdev
In-Reply-To: <alpine.OSX.2.21.1806011100140.27872@doshir-m01.vmware.com>
Hi,
I'm sorry for the long delay in my answer, I've been travelling.
On Fri, 2018-06-01 at 11:10 -0700, Ronak Doshi wrote:
> On Thu, 31 May 2018, Neil Horman wrote:
> > What packet types will rcd.csum be set for?
> > Neil
>
> I looked thorugh the emulation code and found that rcd.csum is not set.
> For valid v4/v6, TCP/UDP packets the code block above the mentioend "if"
> block will be executed or else it will go through checksum none.
>
> That's why I wanted to know (in previous emails) which ESX build is being
> used while this was tested. The code block under "if (gdesc->rcd.csum)"
> block might seem incorrect but it shouldn't be hit as rcd.csum is not set.
I'm unsure if I read the above correctly. Do you mean that the relevant
code-path is never hit? If so, can we simply drop it, as we agreed that
such code is uncorrect? Elsewhere, could you plese specify under which
circumstances gdesc->rcd.csum is filled by the hypervisor?
> Hence, I asked did the fix provided by Paolo worked for the icmp test?
Unfortunatelly so far I've not been able to reproduce the issue outside
a production environment and I can't run test kernel there.
Thanks,
Paolo
^ permalink raw reply
* Re: [RFC PATCH] kcm: hold rx mux lock when updating the receive queue.
From: Paolo Abeni @ 2018-06-05 16:06 UTC (permalink / raw)
To: Tom Herbert, David Miller
Cc: Linux Kernel Network Developers, Tom Herbert, ktkhai
In-Reply-To: <CALx6S353uk_W8b4ic1NYNBS--z41PT6brkwzPvZZj6J2-yEieg@mail.gmail.com>
Hi,
On Tue, 2018-06-05 at 08:35 -0700, Tom Herbert wrote:
> On Tue, Jun 5, 2018 at 7:53 AM, David Miller <davem@davemloft.net> wrote:
> > From: Paolo Abeni <pabeni@redhat.com>
> > Date: Tue, 5 Jun 2018 12:32:33 +0200
> >
> >> @@ -1157,7 +1158,9 @@ static int kcm_recvmsg(struct socket *sock, struct msghdr *msg,
> >> /* Finished with message */
> >> msg->msg_flags |= MSG_EOR;
> >> KCM_STATS_INCR(kcm->stats.rx_msgs);
> >> + spin_lock_bh(&kcm->mux->rx_lock);
> >> skb_unlink(skb, &sk->sk_receive_queue);
> >> + spin_unlock_bh(&kcm->mux->rx_lock);
> >
> > Hmmm, maybe I don't understand the corruption.
> >
> > But, skb_unlink() takes the sk->sk_receive_queue.lock which should
> > prevent SKB list corruption.
>
> It looks like there is a case where the list is being manipulated
> without the queue lock. That is in requeue_rx_msgs where
> __skb_dequeue is being called instead of skb_dequeue which is in
> requeue_rx_msgs. requeue_rx_msgs holds the mux rx_lock which would
> explain why the suggested patch avoids the issue.
Yep, I belive this is the correct explanation. Sorry for the noise with
the previous patch, I underlooked the skb_queue lock already in place.
> Paolo, thanks for looking into this! Can you try replacing
> __skb_dequeue in requeue_rx_msgs with skb_dequeue to see if that is
> the fix.
Sure, I'll retrigger the test, and report the result here (or directly
a new patch, should the test be succesful)
Thanks,
Paolo
^ permalink raw reply
* Re: [PATCH v2 net-next 3/3] mlxsw: Add extack messages for port_{un,}split failures
From: Jiri Pirko @ 2018-06-05 15:15 UTC (permalink / raw)
To: dsahern; +Cc: netdev, idosch, jiri, jakub.kicinski, David Ahern
In-Reply-To: <20180605151411.20310-4-dsahern@kernel.org>
Tue, Jun 05, 2018 at 05:14:11PM CEST, dsahern@kernel.org wrote:
>From: David Ahern <dsahern@gmail.com>
>
>Return messages in extack for port split/unsplit errors. e.g.,
> $ devlink port split swp1s1 count 4
> Error: mlxsw_spectrum: Port cannot be split further.
> devlink answers: Invalid argument
>
> $ devlink port unsplit swp4
> Error: mlxsw_spectrum: Port was not split.
> devlink answers: Invalid argument
>
>Signed-off-by: David Ahern <dsahern@gmail.com>
>Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* [PATCH v2 net-next 2/3] netdevsim: Add extack error message for devlink reload
From: dsahern @ 2018-06-05 15:14 UTC (permalink / raw)
To: netdev; +Cc: idosch, jiri, jakub.kicinski, David Ahern
In-Reply-To: <20180605151411.20310-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
devlink reset command can fail if a FIB resource limit is set to a value
lower than the current occupancy. Return a proper message indicating the
reason for the failure.
$ devlink resource sh netdevsim/netdevsim0
netdevsim/netdevsim0:
name IPv4 size unlimited unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
resources:
name fib size unlimited occ 43 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
name fib-rules size unlimited occ 4 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
name IPv6 size unlimited unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
resources:
name fib size unlimited occ 54 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
name fib-rules size unlimited occ 3 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
$ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 40
$ devlink dev reload netdevsim/netdevsim0
Error: netdevsim: New size is less than current occupancy.
devlink answers: Invalid argument
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
drivers/net/netdevsim/devlink.c | 4 ++--
drivers/net/netdevsim/fib.c | 9 ++++++---
drivers/net/netdevsim/netdevsim.h | 3 ++-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/netdevsim/devlink.c b/drivers/net/netdevsim/devlink.c
index e8366cf372ff..ba663e5af168 100644
--- a/drivers/net/netdevsim/devlink.c
+++ b/drivers/net/netdevsim/devlink.c
@@ -163,7 +163,7 @@ static int nsim_devlink_reload(struct devlink *devlink,
err = devlink_resource_size_get(devlink, res_ids[i], &val);
if (!err) {
- err = nsim_fib_set_max(net, res_ids[i], val);
+ err = nsim_fib_set_max(net, res_ids[i], val, extack);
if (err)
return err;
}
@@ -181,7 +181,7 @@ static void nsim_devlink_net_reset(struct net *net)
int i;
for (i = 0; i < ARRAY_SIZE(res_ids); ++i) {
- if (nsim_fib_set_max(net, res_ids[i], (u64)-1)) {
+ if (nsim_fib_set_max(net, res_ids[i], (u64)-1, NULL)) {
pr_err("Failed to reset limit for resource %u\n",
res_ids[i]);
}
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 9bfe9e151e13..f61d094746c0 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -64,7 +64,8 @@ u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max)
return max ? entry->max : entry->num;
}
-int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val)
+int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val,
+ struct netlink_ext_ack *extack)
{
struct nsim_fib_data *fib_data = net_generic(net, nsim_fib_net_id);
struct nsim_fib_entry *entry;
@@ -90,10 +91,12 @@ int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val)
/* not allowing a new max to be less than curren occupancy
* --> no means of evicting entries
*/
- if (val < entry->num)
+ if (val < entry->num) {
+ NL_SET_ERR_MSG_MOD(extack, "New size is less than current occupancy");
err = -EINVAL;
- else
+ } else {
entry->max = val;
+ }
return err;
}
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 3a8581af3b85..8ca50b72c328 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -126,7 +126,8 @@ void nsim_devlink_exit(void);
int nsim_fib_init(void);
void nsim_fib_exit(void);
u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max);
-int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val);
+int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val,
+ struct netlink_ext_ack *extack);
#else
static inline int nsim_devlink_setup(struct netdevsim *ns)
{
--
2.11.0
^ permalink raw reply related
* [PATCH v2 net-next 3/3] mlxsw: Add extack messages for port_{un,}split failures
From: dsahern @ 2018-06-05 15:14 UTC (permalink / raw)
To: netdev; +Cc: idosch, jiri, jakub.kicinski, David Ahern
In-Reply-To: <20180605151411.20310-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Return messages in extack for port split/unsplit errors. e.g.,
$ devlink port split swp1s1 count 4
Error: mlxsw_spectrum: Port cannot be split further.
devlink answers: Invalid argument
$ devlink port unsplit swp4
Error: mlxsw_spectrum: Port was not split.
devlink answers: Invalid argument
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/core.c | 14 ++++++++++----
drivers/net/ethernet/mellanox/mlxsw/core.h | 5 +++--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 15 ++++++++++++---
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 7ed38d80bc08..f9c724752a32 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -775,11 +775,14 @@ static int mlxsw_devlink_port_split(struct devlink *devlink,
{
struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
- if (port_index >= mlxsw_core->max_ports)
+ if (port_index >= mlxsw_core->max_ports) {
+ NL_SET_ERR_MSG_MOD(extack, "Port index exceeds maximum number of ports");
return -EINVAL;
+ }
if (!mlxsw_core->driver->port_split)
return -EOPNOTSUPP;
- return mlxsw_core->driver->port_split(mlxsw_core, port_index, count);
+ return mlxsw_core->driver->port_split(mlxsw_core, port_index, count,
+ extack);
}
static int mlxsw_devlink_port_unsplit(struct devlink *devlink,
@@ -788,11 +791,14 @@ static int mlxsw_devlink_port_unsplit(struct devlink *devlink,
{
struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
- if (port_index >= mlxsw_core->max_ports)
+ if (port_index >= mlxsw_core->max_ports) {
+ NL_SET_ERR_MSG_MOD(extack, "Port index exceeds maximum number of ports");
return -EINVAL;
+ }
if (!mlxsw_core->driver->port_unsplit)
return -EOPNOTSUPP;
- return mlxsw_core->driver->port_unsplit(mlxsw_core, port_index);
+ return mlxsw_core->driver->port_unsplit(mlxsw_core, port_index,
+ extack);
}
static int
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 4a8d4c7f89d9..552cfa29c2f7 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -274,8 +274,9 @@ struct mlxsw_driver {
int (*port_type_set)(struct mlxsw_core *mlxsw_core, u8 local_port,
enum devlink_port_type new_type);
int (*port_split)(struct mlxsw_core *mlxsw_core, u8 local_port,
- unsigned int count);
- int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u8 local_port);
+ unsigned int count, struct netlink_ext_ack *extack);
+ int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u8 local_port,
+ struct netlink_ext_ack *extack);
int (*sb_pool_get)(struct mlxsw_core *mlxsw_core,
unsigned int sb_index, u16 pool_index,
struct devlink_sb_pool_info *pool_info);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index fc39f22e5c70..968b88af2ef5 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3092,7 +3092,8 @@ static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp,
}
static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
- unsigned int count)
+ unsigned int count,
+ struct netlink_ext_ack *extack)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
struct mlxsw_sp_port *mlxsw_sp_port;
@@ -3104,6 +3105,7 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
if (!mlxsw_sp_port) {
dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n",
local_port);
+ NL_SET_ERR_MSG_MOD(extack, "Port number does not exist");
return -EINVAL;
}
@@ -3112,11 +3114,13 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
if (count != 2 && count != 4) {
netdev_err(mlxsw_sp_port->dev, "Port can only be split into 2 or 4 ports\n");
+ NL_SET_ERR_MSG_MOD(extack, "Port can only be split into 2 or 4 ports");
return -EINVAL;
}
if (cur_width != MLXSW_PORT_MODULE_MAX_WIDTH) {
netdev_err(mlxsw_sp_port->dev, "Port cannot be split further\n");
+ NL_SET_ERR_MSG_MOD(extack, "Port cannot be split further");
return -EINVAL;
}
@@ -3125,6 +3129,7 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
base_port = local_port;
if (mlxsw_sp->ports[base_port + 1]) {
netdev_err(mlxsw_sp_port->dev, "Invalid split configuration\n");
+ NL_SET_ERR_MSG_MOD(extack, "Invalid split configuration");
return -EINVAL;
}
} else {
@@ -3132,6 +3137,7 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
if (mlxsw_sp->ports[base_port + 1] ||
mlxsw_sp->ports[base_port + 3]) {
netdev_err(mlxsw_sp_port->dev, "Invalid split configuration\n");
+ NL_SET_ERR_MSG_MOD(extack, "Invalid split configuration");
return -EINVAL;
}
}
@@ -3153,7 +3159,8 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
return err;
}
-static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port)
+static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port,
+ struct netlink_ext_ack *extack)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
struct mlxsw_sp_port *mlxsw_sp_port;
@@ -3165,11 +3172,13 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port)
if (!mlxsw_sp_port) {
dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n",
local_port);
+ NL_SET_ERR_MSG_MOD(extack, "Port number does not exist");
return -EINVAL;
}
if (!mlxsw_sp_port->split) {
- netdev_err(mlxsw_sp_port->dev, "Port wasn't split\n");
+ netdev_err(mlxsw_sp_port->dev, "Port was not split\n");
+ NL_SET_ERR_MSG_MOD(extack, "Port was not split");
return -EINVAL;
}
--
2.11.0
^ permalink raw reply related
* [PATCH v2 net-next 1/3] devlink: Add extack to reload and port_{un,}split operations
From: dsahern @ 2018-06-05 15:14 UTC (permalink / raw)
To: netdev; +Cc: idosch, jiri, jakub.kicinski, David Ahern
In-Reply-To: <20180605151411.20310-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
Add extack argument to reload, port_split and port_unsplit operations.
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/core.c | 9 ++++++---
drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 5 +++--
drivers/net/netdevsim/devlink.c | 3 ++-
include/net/devlink.h | 7 ++++---
net/core/devlink.c | 18 ++++++++++--------
5 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 8a766fe28fa0..7ed38d80bc08 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -770,7 +770,8 @@ static void mlxsw_core_driver_put(const char *kind)
static int mlxsw_devlink_port_split(struct devlink *devlink,
unsigned int port_index,
- unsigned int count)
+ unsigned int count,
+ struct netlink_ext_ack *extack)
{
struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
@@ -782,7 +783,8 @@ static int mlxsw_devlink_port_split(struct devlink *devlink,
}
static int mlxsw_devlink_port_unsplit(struct devlink *devlink,
- unsigned int port_index)
+ unsigned int port_index,
+ struct netlink_ext_ack *extack)
{
struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
@@ -963,7 +965,8 @@ mlxsw_devlink_sb_occ_tc_port_bind_get(struct devlink_port *devlink_port,
pool_type, p_cur, p_max);
}
-static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink)
+static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink,
+ struct netlink_ext_ack *extack)
{
struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
int err;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
index 71c2edd83031..db463e20a876 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
@@ -92,7 +92,7 @@ nfp_devlink_set_lanes(struct nfp_pf *pf, unsigned int idx, unsigned int lanes)
static int
nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
- unsigned int count)
+ unsigned int count, struct netlink_ext_ack *extack)
{
struct nfp_pf *pf = devlink_priv(devlink);
struct nfp_eth_table_port eth_port;
@@ -123,7 +123,8 @@ nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
}
static int
-nfp_devlink_port_unsplit(struct devlink *devlink, unsigned int port_index)
+nfp_devlink_port_unsplit(struct devlink *devlink, unsigned int port_index,
+ struct netlink_ext_ack *extack)
{
struct nfp_pf *pf = devlink_priv(devlink);
struct nfp_eth_table_port eth_port;
diff --git a/drivers/net/netdevsim/devlink.c b/drivers/net/netdevsim/devlink.c
index bef7db5d129a..e8366cf372ff 100644
--- a/drivers/net/netdevsim/devlink.c
+++ b/drivers/net/netdevsim/devlink.c
@@ -147,7 +147,8 @@ static int devlink_resources_register(struct devlink *devlink)
return err;
}
-static int nsim_devlink_reload(struct devlink *devlink)
+static int nsim_devlink_reload(struct devlink *devlink,
+ struct netlink_ext_ack *extack)
{
enum nsim_resource_id res_ids[] = {
NSIM_RESOURCE_IPV4_FIB, NSIM_RESOURCE_IPV4_FIB_RULES,
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 9686a1aa4ec9..e336ea9c73df 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -296,12 +296,13 @@ struct devlink_resource {
#define DEVLINK_RESOURCE_ID_PARENT_TOP 0
struct devlink_ops {
- int (*reload)(struct devlink *devlink);
+ int (*reload)(struct devlink *devlink, struct netlink_ext_ack *extack);
int (*port_type_set)(struct devlink_port *devlink_port,
enum devlink_port_type port_type);
int (*port_split)(struct devlink *devlink, unsigned int port_index,
- unsigned int count);
- int (*port_unsplit)(struct devlink *devlink, unsigned int port_index);
+ unsigned int count, struct netlink_ext_ack *extack);
+ int (*port_unsplit)(struct devlink *devlink, unsigned int port_index,
+ struct netlink_ext_ack *extack);
int (*sb_pool_get)(struct devlink *devlink, unsigned int sb_index,
u16 pool_index,
struct devlink_sb_pool_info *pool_info);
diff --git a/net/core/devlink.c b/net/core/devlink.c
index f75ee022e6b2..22099705cc41 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -702,12 +702,13 @@ static int devlink_nl_cmd_port_set_doit(struct sk_buff *skb,
return 0;
}
-static int devlink_port_split(struct devlink *devlink,
- u32 port_index, u32 count)
+static int devlink_port_split(struct devlink *devlink, u32 port_index,
+ u32 count, struct netlink_ext_ack *extack)
{
if (devlink->ops && devlink->ops->port_split)
- return devlink->ops->port_split(devlink, port_index, count);
+ return devlink->ops->port_split(devlink, port_index, count,
+ extack);
return -EOPNOTSUPP;
}
@@ -724,14 +725,15 @@ static int devlink_nl_cmd_port_split_doit(struct sk_buff *skb,
port_index = nla_get_u32(info->attrs[DEVLINK_ATTR_PORT_INDEX]);
count = nla_get_u32(info->attrs[DEVLINK_ATTR_PORT_SPLIT_COUNT]);
- return devlink_port_split(devlink, port_index, count);
+ return devlink_port_split(devlink, port_index, count, info->extack);
}
-static int devlink_port_unsplit(struct devlink *devlink, u32 port_index)
+static int devlink_port_unsplit(struct devlink *devlink, u32 port_index,
+ struct netlink_ext_ack *extack)
{
if (devlink->ops && devlink->ops->port_unsplit)
- return devlink->ops->port_unsplit(devlink, port_index);
+ return devlink->ops->port_unsplit(devlink, port_index, extack);
return -EOPNOTSUPP;
}
@@ -745,7 +747,7 @@ static int devlink_nl_cmd_port_unsplit_doit(struct sk_buff *skb,
return -EINVAL;
port_index = nla_get_u32(info->attrs[DEVLINK_ATTR_PORT_INDEX]);
- return devlink_port_unsplit(devlink, port_index);
+ return devlink_port_unsplit(devlink, port_index, info->extack);
}
static int devlink_nl_sb_fill(struct sk_buff *msg, struct devlink *devlink,
@@ -2599,7 +2601,7 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
NL_SET_ERR_MSG_MOD(info->extack, "resources size validation failed");
return err;
}
- return devlink->ops->reload(devlink);
+ return devlink->ops->reload(devlink, info->extack);
}
static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = {
--
2.11.0
^ permalink raw reply related
* [PATCH v2 net-next 0/3] devlink: Add extack messages for reload and port split/unsplit
From: dsahern @ 2018-06-05 15:14 UTC (permalink / raw)
To: netdev; +Cc: idosch, jiri, jakub.kicinski, David Ahern
From: David Ahern <dsahern@gmail.com>
Patch 1 adds extack arg to reload, port_split and port_unsplit devlink
operations.
Patch 2 adds extack messages for reload operation in netdevsim.
Patch 3 adds extack messages to port split/unsplit in mlxsw driver.
v2
- make the extack messages align with existing dev_err
David Ahern (3):
devlink: Add extack to reload and port_{un,}split operations
netdevsim: Add extack error message for devlink reload
mlxsw: Add extack messages for port_{un,}split failures
drivers/net/ethernet/mellanox/mlxsw/core.c | 23 ++++++++++++++++-------
drivers/net/ethernet/mellanox/mlxsw/core.h | 5 +++--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 15 ++++++++++++---
drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 5 +++--
drivers/net/netdevsim/devlink.c | 7 ++++---
drivers/net/netdevsim/fib.c | 9 ++++++---
drivers/net/netdevsim/netdevsim.h | 3 ++-
include/net/devlink.h | 7 ++++---
net/core/devlink.c | 18 ++++++++++--------
9 files changed, 60 insertions(+), 32 deletions(-)
--
2.11.0
^ permalink raw reply
* Re: [PATCH] netfilter: provide udp*_lib_lookup for nf_tproxy
From: Pablo Neira Ayuso @ 2018-06-05 15:12 UTC (permalink / raw)
To: David Miller
Cc: arnd, kuznet, yoshfuji, ecklm94, pabeni, willemb, edumazet,
dsahern, kafai, netdev, linux-kernel
In-Reply-To: <20180605.105453.339908802413146875.davem@davemloft.net>
On Tue, Jun 05, 2018 at 10:54:53AM -0400, David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Tue, 5 Jun 2018 13:40:34 +0200
>
> > It is now possible to enable the libified nf_tproxy modules without
> > also enabling NETFILTER_XT_TARGET_TPROXY, which throws off the
> > ifdef logic in the udp core code:
> >
> > net/ipv6/netfilter/nf_tproxy_ipv6.o: In function `nf_tproxy_get_sock_v6':
> > nf_tproxy_ipv6.c:(.text+0x1a8): undefined reference to `udp6_lib_lookup'
> > net/ipv4/netfilter/nf_tproxy_ipv4.o: In function `nf_tproxy_get_sock_v4':
> > nf_tproxy_ipv4.c:(.text+0x3d0): undefined reference to `udp4_lib_lookup'
> >
> > We can actually simplify the conditions now to provide the two functions
> > exactly when they are needed.
> >
> > Fixes: 45ca4e0cf273 ("netfilter: Libify xt_TPROXY")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Pablo, I'm going to apply this directly to fix the link failure.
>
> Thanks Arnd.
Thanks David.
^ permalink raw reply
* Re: [PATCH] net: hns3: remove unused hclgevf_cfg_func_mta_filter
From: David Miller @ 2018-06-05 15:10 UTC (permalink / raw)
To: arnd
Cc: yisen.zhuang, salil.mehta, lipeng321, liangfuyun1, linyunsheng,
shenjian15, wangxi11, netdev, linux-kernel
In-Reply-To: <20180605113904.1193671-1-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 5 Jun 2018 13:38:21 +0200
> The last patch apparently added a complete replacement for this
> function, but left the old one in place, which now causes a
> harmless warning:
>
> drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c:731:12: 'hclgevf_cfg_func_mta_filter' defined but not used
>
> I assume it can be removed.
>
> Fixes: 3a678b5806e6 ("net: hns3: Optimize the VF's process of updating multicast MAC")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks Arnd.
^ 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