12 Jan, 2020

2 commits

  • [ Upstream commit eb8ef2a3c50092bb018077c047b8dba1ce0e78e3 ]

    Both vlan_dev_change_flags() and vlan_dev_set_egress_priority()
    can return an error. vlan_changelink() should not ignore them.

    Fixes: 07b5b17e157b ("[VLAN]: Use rtnl_link API")
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • [ Upstream commit 9bbd917e0bec9aebdbd0c8dbc966caec15eb33e9 ]

    There are few cases where the ndo_uninit() handler might be not
    called if an error happens while device is initialized.

    Since vlan_newlink() calls vlan_changelink() before
    trying to register the netdevice, we need to make sure
    vlan_dev_uninit() has been called at least once,
    or we might leak allocated memory.

    BUG: memory leak
    unreferenced object 0xffff888122a206c0 (size 32):
    comm "syz-executor511", pid 7124, jiffies 4294950399 (age 32.240s)
    hex dump (first 32 bytes):
    00 00 00 00 00 00 61 73 00 00 00 00 00 00 00 00 ......as........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
    [] slab_post_alloc_hook mm/slab.h:586 [inline]
    [] slab_alloc mm/slab.c:3320 [inline]
    [] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3549
    [] kmalloc include/linux/slab.h:556 [inline]
    [] vlan_dev_set_egress_priority+0xcc/0x150 net/8021q/vlan_dev.c:194
    [] vlan_changelink+0xd6/0x140 net/8021q/vlan_netlink.c:126
    [] vlan_newlink+0x135/0x200 net/8021q/vlan_netlink.c:181
    [] __rtnl_newlink+0x89a/0xb80 net/core/rtnetlink.c:3305
    [] rtnl_newlink+0x4e/0x80 net/core/rtnetlink.c:3363
    [] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5424
    [] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2477
    [] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5442
    [] netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
    [] netlink_unicast+0x223/0x310 net/netlink/af_netlink.c:1328
    [] netlink_sendmsg+0x2c0/0x570 net/netlink/af_netlink.c:1917
    [] sock_sendmsg_nosec net/socket.c:639 [inline]
    [] sock_sendmsg+0x54/0x70 net/socket.c:659
    [] ____sys_sendmsg+0x2d0/0x300 net/socket.c:2330
    [] ___sys_sendmsg+0x8a/0xd0 net/socket.c:2384
    [] __sys_sendmsg+0x80/0xf0 net/socket.c:2417
    [] __do_sys_sendmsg net/socket.c:2426 [inline]
    [] __se_sys_sendmsg net/socket.c:2424 [inline]
    [] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2424

    Fixe: 07b5b17e157b ("[VLAN]: Use rtnl_link API")
    Signed-off-by: Eric Dumazet
    Reported-by: syzbot
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     

25 Oct, 2019

2 commits

  • This patch removes variables and callback these are related to the nested
    device structure.
    devices that can be nested have their own nest_level variable that
    represents the depth of nested devices.
    In the previous patch, new {lower/upper}_level variables are added and
    they replace old private nest_level variable.
    So, this patch removes all 'nest_level' variables.

    In order to avoid lockdep warning, ->ndo_get_lock_subclass() was added
    to get lockdep subclass value, which is actually lower nested depth value.
    But now, they use the dynamic lockdep key to avoid lockdep warning instead
    of the subclass.
    So, this patch removes ->ndo_get_lock_subclass() callback.

    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     
  • Some interface types could be nested.
    (VLAN, BONDING, TEAM, MACSEC, MACVLAN, IPVLAN, VIRT_WIFI, VXLAN, etc..)
    These interface types should set lockdep class because, without lockdep
    class key, lockdep always warn about unexisting circular locking.

    In the current code, these interfaces have their own lockdep class keys and
    these manage itself. So that there are so many duplicate code around the
    /driver/net and /net/.
    This patch adds new generic lockdep keys and some helper functions for it.

    This patch does below changes.
    a) Add lockdep class keys in struct net_device
    - qdisc_running, xmit, addr_list, qdisc_busylock
    - these keys are used as dynamic lockdep key.
    b) When net_device is being allocated, lockdep keys are registered.
    - alloc_netdev_mqs()
    c) When net_device is being free'd llockdep keys are unregistered.
    - free_netdev()
    d) Add generic lockdep key helper function
    - netdev_register_lockdep_key()
    - netdev_unregister_lockdep_key()
    - netdev_update_lockdep_key()
    e) Remove unnecessary generic lockdep macro and functions
    f) Remove unnecessary lockdep code of each interfaces.

    After this patch, each interface modules don't need to maintain
    their lockdep keys.

    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     

22 Jun, 2019

1 commit


19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

08 Jun, 2019

1 commit


05 Jun, 2019

1 commit

  • During the creation of the VLAN interface net device,
    the various device features and offloads are being set based
    on the parent device's features.
    The code initiates the basic, vlan and encapsulation features
    but doesn't address the MPLS features set and they remain blank.
    As a result, all device offloads that have significant performance
    effect are disabled for MPLS traffic going via this VLAN device such
    as checksumming and TSO.

    This patch makes sure that MPLS features are also set for the
    VLAN device based on the parent which will allow HW offloads of
    checksumming and TSO to be performed on MPLS tagged packets.

    Signed-off-by: Ariel Levkovich
    Signed-off-by: David S. Miller

    Ariel Levkovich
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 May, 2019

1 commit

  • Pull networking fixes from David Miller:

    1) Clear up some recent tipc regressions because of registration
    ordering. Fix from Junwei Hu.

    2) tipc's TLV_SET() can read past the end of the supplied buffer during
    the copy. From Chris Packham.

    3) ptp example program doesn't match the kernel, from Richard Cochran.

    4) Outgoing message type fix in qrtr, from Bjorn Andersson.

    5) Flow control regression in stmmac, from Tan Tee Min.

    6) Fix inband autonegotiation in phylink, from Russell King.

    7) Fix sk_bound_dev_if handling in rawv6_bind(), from Mike Manning.

    8) Fix usbnet crash after disconnect, from Kloetzke Jan.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits)
    usbnet: fix kernel crash after disconnect
    selftests: fib_rule_tests: use pre-defined DEV_ADDR
    net-next: net: Fix typos in ip-sysctl.txt
    ipv6: Consider sk_bound_dev_if when binding a raw socket to an address
    net: phylink: ensure inband AN works correctly
    usbnet: ipheth: fix racing condition
    net: stmmac: dma channel control register need to be init first
    net: stmmac: fix ethtool flow control not able to get/set
    net: qrtr: Fix message type of outgoing packets
    networking: : fix typos in code comments
    ptp: Fix example program to match kernel.
    fddi: fix typos in code comments
    selftests: fib_rule_tests: enable forwarding before ipv4 from/iif test
    selftests: fib_rule_tests: fix local IPv4 address typo
    tipc: Avoid copying bytes beyond the supplied data
    2/2] net: xilinx_emaclite: use readx_poll_timeout() in mdio wait function
    1/2] net: axienet: use readx_poll_timeout() in mdio wait function
    vlan: Mark expected switch fall-through
    macvlan: Mark expected switch fall-through
    net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query
    ...

    Linus Torvalds
     

21 May, 2019

2 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.

    This patch fixes the following warning:

    net/8021q/vlan_dev.c: In function ‘vlan_dev_ioctl’:
    net/8021q/vlan_dev.c:374:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (!net_eq(dev_net(dev), &init_net))
    ^
    net/8021q/vlan_dev.c:376:2: note: here
    case SIOCGMIIPHY:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     

10 May, 2019

1 commit

  • With NET_ADMIN enabled in container, a normal user could be mapped to
    root and is able to change the real device's rx filter via ioctl on
    vlan, which would affect the other ptp process on host. Fix it by
    disabling SIOCSHWTSTAMP in container.

    Fixes: a6111d3c93d0 ("vlan: Pass SIOC[SG]HWTSTAMP ioctls to real device")
    Signed-off-by: Hangbin Liu
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Hangbin Liu
     

28 Apr, 2019

2 commits

  • We currently have two levels of strict validation:

    1) liberal (default)
    - undefined (type >= max) & NLA_UNSPEC attributes accepted
    - attribute length >= expected accepted
    - garbage at end of message accepted
    2) strict (opt-in)
    - NLA_UNSPEC attributes accepted
    - attribute length >= expected accepted

    Split out parsing strictness into four different options:
    * TRAILING - check that there's no trailing data after parsing
    attributes (in message or nested)
    * MAXTYPE - reject attrs > max known type
    * UNSPEC - reject attributes with NLA_UNSPEC policy entries
    * STRICT_ATTRS - strictly validate attribute size

    The default for future things should be *everything*.
    The current *_strict() is a combination of TRAILING and MAXTYPE,
    and is renamed to _deprecated_strict().
    The current regular parsing has none of this, and is renamed to
    *_parse_deprecated().

    Additionally it allows us to selectively set one of the new flags
    even on old policies. Notably, the UNSPEC flag could be useful in
    this case, since it can be arranged (by filling in the policy) to
    not be an incompatible userspace ABI change, but would then going
    forward prevent forgetting attribute entries. Similar can apply
    to the POLICY flag.

    We end up with the following renames:
    * nla_parse -> nla_parse_deprecated
    * nla_parse_strict -> nla_parse_deprecated_strict
    * nlmsg_parse -> nlmsg_parse_deprecated
    * nlmsg_parse_strict -> nlmsg_parse_deprecated_strict
    * nla_parse_nested -> nla_parse_nested_deprecated
    * nla_validate_nested -> nla_validate_nested_deprecated

    Using spatch, of course:
    @@
    expression TB, MAX, HEAD, LEN, POL, EXT;
    @@
    -nla_parse(TB, MAX, HEAD, LEN, POL, EXT)
    +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT)

    @@
    expression NLH, HDRLEN, TB, MAX, POL, EXT;
    @@
    -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT)
    +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT)

    @@
    expression NLH, HDRLEN, TB, MAX, POL, EXT;
    @@
    -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
    +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT)

    @@
    expression TB, MAX, NLA, POL, EXT;
    @@
    -nla_parse_nested(TB, MAX, NLA, POL, EXT)
    +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT)

    @@
    expression START, MAX, POL, EXT;
    @@
    -nla_validate_nested(START, MAX, POL, EXT)
    +nla_validate_nested_deprecated(START, MAX, POL, EXT)

    @@
    expression NLH, HDRLEN, MAX, POL, EXT;
    @@
    -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT)
    +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT)

    For this patch, don't actually add the strict, non-renamed versions
    yet so that it breaks compile if I get it wrong.

    Also, while at it, make nla_validate and nla_parse go down to a
    common __nla_validate_parse() function to avoid code duplication.

    Ultimately, this allows us to have very strict validation for every
    new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the
    next patch, while existing things will continue to work as is.

    In effect then, this adds fully strict validation for any new command.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Even if the NLA_F_NESTED flag was introduced more than 11 years ago, most
    netlink based interfaces (including recently added ones) are still not
    setting it in kernel generated messages. Without the flag, message parsers
    not aware of attribute semantics (e.g. wireshark dissector or libmnl's
    mnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display
    the structure of their contents.

    Unfortunately we cannot just add the flag everywhere as there may be
    userspace applications which check nlattr::nla_type directly rather than
    through a helper masking out the flags. Therefore the patch renames
    nla_nest_start() to nla_nest_start_noflag() and introduces nla_nest_start()
    as a wrapper adding NLA_F_NESTED. The calls which add NLA_F_NESTED manually
    are rewritten to use nla_nest_start().

    Except for changes in include/net/netlink.h, the patch was generated using
    this semantic patch:

    @@ expression E1, E2; @@
    -nla_nest_start(E1, E2)
    +nla_nest_start_noflag(E1, E2)

    @@ expression E1, E2; @@
    -nla_nest_start_noflag(E1, E2 | NLA_F_NESTED)
    +nla_nest_start(E1, E2)

    Signed-off-by: Michal Kubecek
    Acked-by: Jiri Pirko
    Acked-by: David Ahern
    Signed-off-by: David S. Miller

    Michal Kubecek
     

20 Apr, 2019

2 commits

  • In vlan bridge binding mode, the link state is no longer transferred
    from the lower device. Instead it is set by the bridge module according
    to the state of bridge ports that are members of the vlan.

    Signed-off-by: Mike Manning
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Mike Manning
     
  • In the case of vlan filtering on bridges, the bridge may also have the
    corresponding vlan devices as upper devices. Currently the link state
    of vlan devices is transferred from the lower device. So this is up if
    the bridge is in admin up state and there is at least one bridge port
    that is up, regardless of the vlan that the port is a member of.

    The link state of the vlan device may need to track only the state of
    the subset of ports that are also members of the corresponding vlan,
    rather than that of all ports.

    Add a flag to specify a vlan bridge binding mode, by which the link
    state is no longer automatically transferred from the lower device,
    but is instead determined by the bridge ports that are members of the
    vlan.

    Signed-off-by: Mike Manning
    Acked-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Mike Manning
     

05 Apr, 2019

1 commit

  • Way back in 3c9c36bcedd426f2be2826da43e5163de61735f7 the
    ndo_fcoe_get_wwn pointer was switched from depending on CONFIG_FCOE to
    CONFIG_LIBFCOE in order to allow building FCoE support into the bnx2x
    driver and used by bnx2fc without including the generic software fcoe
    module.

    But, FCoE is generally used over an 802.1q VLAN, and the implementation
    of ndo_fcoe_get_wwn in the 8021q module was not similarly changed. The
    result is that if CONFIG_FCOE is disabled, then bnz2fc cannot make a
    call to ndo_fcoe_get_wwn through the 8021q interface to the underlying
    bnx2x interface. The bnx2fc driver then falls back to a potentially
    different mapping of Ethernet MAC to Fibre Channel WWN, creating an
    incompatibility with the fabric and target configurations when compared
    to the WWNs used by pre-boot firmware and differently-configured
    kernels.

    So make the conditional inclusion of FCoE code in 8021q match the
    conditional inclusion in netdevice.h

    Signed-off-by: Chris Leech
    Signed-off-by: David S. Miller

    Chris Leech
     

25 Feb, 2019

1 commit


07 Dec, 2018

1 commit

  • In order to pass extack together with NETDEV_PRE_UP notifications, it's
    necessary to route the extack to __dev_open() from diverse (possibly
    indirect) callers. One prominent API through which the notification is
    invoked is dev_change_flags().

    Therefore extend dev_change_flags() with and extra extack argument and
    update all users. Most of the calls end up just encoding NULL, but
    several sites (VLAN, ipvlan, VRF, rtnetlink) do have extack available.

    Since the function declaration line is changed anyway, name the other
    function arguments to placate checkpatch.

    Signed-off-by: Petr Machata
    Acked-by: Jiri Pirko
    Reviewed-by: Ido Schimmel
    Reviewed-by: David Ahern
    Signed-off-by: David S. Miller

    Petr Machata
     

17 Nov, 2018

1 commit

  • Currently, the vlan packet offloads are registered only upon 8021q module
    load. However, even without this module loaded, the offloads could be
    utilized, for example by openvswitch datapath. As reported by Michael,
    that causes 2x to 5x performance improvement, depending on a testcase.

    So move the vlan offload registrations into vlan_core and make this
    available even without 8021q module loaded.

    Reported-by: Michael Shteinbok
    Signed-off-by: Jiri Pirko
    Tested-by: Michael Shteinbok
    Reviewed-by: David Ahern
    Signed-off-by: David S. Miller

    Jiri Pirko
     

09 Nov, 2018

2 commits

  • Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     
  • It's redundancy for the drivers to hold the list of vlans when
    absolutely the same list exists in vlan core. In most cases it's
    needed only to traverse the vlan devices, their vids and sync some
    settings with h/w, so add API to simplify this.

    At least some of these drivers also can benefit:
    grep "for_each.*vid" -r drivers/net/ethernet/

    drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:
    drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:
    drivers/net/ethernet/qlogic/qlge/qlge_main.c:
    drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:
    drivers/net/ethernet/via/via-rhine.c:
    drivers/net/ethernet/via/via-velocity.c:
    drivers/net/ethernet/intel/igb/igb_main.c:
    drivers/net/ethernet/intel/ice/ice_main.c:
    drivers/net/ethernet/intel/e1000/e1000_main.c:
    drivers/net/ethernet/intel/i40e/i40e_main.c:
    drivers/net/ethernet/intel/e1000e/netdev.c:
    drivers/net/ethernet/intel/igbvf/netdev.c:
    drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:
    drivers/net/ethernet/intel/ixgb/ixgb_main.c:
    drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:
    drivers/net/ethernet/amd/xgbe/xgbe-dev.c:
    drivers/net/ethernet/emulex/benet/be_main.c:
    drivers/net/ethernet/neterion/vxge/vxge-main.c:
    drivers/net/ethernet/adaptec/starfire.c:
    drivers/net/ethernet/brocade/bna/bnad.c:

    Reviewed-by: Grygorii Strashko
    Signed-off-by: Ivan Khoronzhuk
    Signed-off-by: David S. Miller

    Ivan Khoronzhuk
     

08 Nov, 2018

1 commit

  • GSO tunneled packets are always segmented in software before they are
    transmitted by a VLAN, even when the lower device can offload tunnel
    encapsulation and VLAN together (i.e., some bits in NETIF_F_GSO_ENCAP_ALL
    mask are set in the lower device 'vlan_features'). If we let VLANs have
    the same tunnel offload capabilities as their lower device, throughput
    can improve significantly when CPU is limited on the transmitter side.

    - set NETIF_F_GSO_ENCAP_ALL bits in the VLAN 'hw_features', to ensure
    that 'features' will have those bits zeroed only when the lower device
    has no hardware support for tunnel encapsulation.
    - for the same reason, copy GSO-related bits of 'hw_enc_features' from
    lower device to VLAN, and ensure to update that value when the lower
    device changes its features.
    - set NETIF_F_HW_CSUM bit in the VLAN 'hw_enc_features' if 'real_dev'
    is able to compute checksums at least for a kind of packets, like done
    with commit 8403debeead8 ("vlan: Keep NETIF_F_HW_CSUM similar to other
    software devices"). This avoids software segmentation due to mismatching
    checksum capabilities between VLAN's 'features' and 'hw_enc_features'.

    Reported-by: Flavio Leitner
    Signed-off-by: Davide Caratti
    Signed-off-by: David S. Miller

    Davide Caratti
     

20 Oct, 2018

1 commit

  • This fixes a problem introduced by:
    commit 2cde6acd49da ("netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock")

    When using netconsole on a bond, __netpoll_cleanup can asynchronously
    recurse multiple times, each __netpoll_free_async call can result in
    more __netpoll_free_async's. This means there is now a race between
    cleanup_work queues on multiple netpoll_info's on multiple devices and
    the configuration of a new netpoll. For example if a netconsole is set
    to enable 0, reconfigured, and enable 1 immediately, this netconsole
    will likely not work.

    Given the reason for __netpoll_free_async is it can be called when rtnl
    is not locked, if it is locked, we should be able to execute
    synchronously. It appears to be locked everywhere it's called from.

    Generalize the design pattern from the teaming driver for current
    callers of __netpoll_free_async.

    CC: Neil Horman
    CC: "David S. Miller"
    Signed-off-by: Debabrata Banerjee
    Signed-off-by: David S. Miller

    Debabrata Banerjee
     

25 Jul, 2018

1 commit


03 Jul, 2018

1 commit


02 Jul, 2018

1 commit

  • Since the addition of GRO for ESP, gro_receive can consume the skb and
    return -EINPROGRESS. In that case, the lower layer GRO handler cannot
    touch the skb anymore.

    Commit 5f114163f2f5 ("net: Add a skb_gro_flush_final helper.") converted
    some of the gro_receive handlers that can lead to ESP's gro_receive so
    that they wouldn't access the skb when -EINPROGRESS is returned, but
    missed other spots, mainly in tunneling protocols.

    This patch finishes the conversion to using skb_gro_flush_final(), and
    adds a new helper, skb_gro_flush_final_remcsum(), used in VXLAN and
    GUE.

    Fixes: 5f114163f2f5 ("net: Add a skb_gro_flush_final helper.")
    Signed-off-by: Sabrina Dubroca
    Reviewed-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Sabrina Dubroca
     

26 Jun, 2018

1 commit

  • Manage pending per-NAPI GRO packets via list_head.

    Return an SKB pointer from the GRO receive handlers. When GRO receive
    handlers return non-NULL, it means that this SKB needs to be completed
    at this time and removed from the NAPI queue.

    Several operations are greatly simplified by this transformation,
    especially timing out the oldest SKB in the list when gro_count
    exceeds MAX_GRO_SKBS, and napi_gro_flush() which walks the queue
    in reverse order.

    Signed-off-by: David S. Miller

    David Miller
     

07 Jun, 2018

1 commit

  • Pull networking updates from David Miller:

    1) Add Maglev hashing scheduler to IPVS, from Inju Song.

    2) Lots of new TC subsystem tests from Roman Mashak.

    3) Add TCP zero copy receive and fix delayed acks and autotuning with
    SO_RCVLOWAT, from Eric Dumazet.

    4) Add XDP_REDIRECT support to mlx5 driver, from Jesper Dangaard
    Brouer.

    5) Add ttl inherit support to vxlan, from Hangbin Liu.

    6) Properly separate ipv6 routes into their logically independant
    components. fib6_info for the routing table, and fib6_nh for sets of
    nexthops, which thus can be shared. From David Ahern.

    7) Add bpf_xdp_adjust_tail helper, which can be used to generate ICMP
    messages from XDP programs. From Nikita V. Shirokov.

    8) Lots of long overdue cleanups to the r8169 driver, from Heiner
    Kallweit.

    9) Add BTF ("BPF Type Format"), from Martin KaFai Lau.

    10) Add traffic condition monitoring to iwlwifi, from Luca Coelho.

    11) Plumb extack down into fib_rules, from Roopa Prabhu.

    12) Add Flower classifier offload support to igb, from Vinicius Costa
    Gomes.

    13) Add UDP GSO support, from Willem de Bruijn.

    14) Add documentation for eBPF helpers, from Quentin Monnet.

    15) Add TLS tx offload to mlx5, from Ilya Lesokhin.

    16) Allow applications to be given the number of bytes available to read
    on a socket via a control message returned from recvmsg(), from
    Soheil Hassas Yeganeh.

    17) Add x86_32 eBPF JIT compiler, from Wang YanQing.

    18) Add AF_XDP sockets, with zerocopy support infrastructure as well.
    From Björn Töpel.

    19) Remove indirect load support from all of the BPF JITs and handle
    these operations in the verifier by translating them into native BPF
    instead. From Daniel Borkmann.

    20) Add GRO support to ipv6 gre tunnels, from Eran Ben Elisha.

    21) Allow XDP programs to do lookups in the main kernel routing tables
    for forwarding. From David Ahern.

    22) Allow drivers to store hardware state into an ELF section of kernel
    dump vmcore files, and use it in cxgb4. From Rahul Lakkireddy.

    23) Various RACK and loss detection improvements in TCP, from Yuchung
    Cheng.

    24) Add TCP SACK compression, from Eric Dumazet.

    25) Add User Mode Helper support and basic bpfilter infrastructure, from
    Alexei Starovoitov.

    26) Support ports and protocol values in RTM_GETROUTE, from Roopa
    Prabhu.

    27) Support bulking in ->ndo_xdp_xmit() API, from Jesper Dangaard
    Brouer.

    28) Add lots of forwarding selftests, from Petr Machata.

    29) Add generic network device failover driver, from Sridhar Samudrala.

    * ra.kernel.org:/pub/scm/linux/kernel/git/davem/net-next: (1959 commits)
    strparser: Add __strp_unpause and use it in ktls.
    rxrpc: Fix terminal retransmission connection ID to include the channel
    net: hns3: Optimize PF CMDQ interrupt switching process
    net: hns3: Fix for VF mailbox receiving unknown message
    net: hns3: Fix for VF mailbox cannot receiving PF response
    bnx2x: use the right constant
    Revert "net: sched: cls: Fix offloading when ingress dev is vxlan"
    net: dsa: b53: Fix for brcm tag issue in Cygnus SoC
    enic: fix UDP rss bits
    netdev-FAQ: clarify DaveM's position for stable backports
    rtnetlink: validate attributes in do_setlink()
    mlxsw: Add extack messages for port_{un, }split failures
    netdevsim: Add extack error message for devlink reload
    devlink: Add extack to reload and port_{un, }split operations
    net: metrics: add proper netlink validation
    ipmr: fix error path when ipmr_new_table fails
    ip6mr: only set ip6mr_table from setsockopt when ip6mr_new_table succeeds
    net: hns3: remove unused hclgevf_cfg_func_mta_filter
    netfilter: provide udp*_lib_lookup for nf_tproxy
    qed*: Utilize FW 8.37.2.0
    ...

    Linus Torvalds
     

18 May, 2018

1 commit


16 May, 2018

2 commits


08 May, 2018

1 commit


02 Apr, 2018

1 commit


01 Apr, 2018

1 commit


30 Mar, 2018

1 commit

  • NETIF_F_HW_VLAN_[CS]TAG_FILTER features require more than just a bit
    flip in dev->features in order to keep the driver in a consistent state.
    These features notify the driver of each added/removed vlan, but toggling
    of vlan-filter does not notify the driver accordingly for each of the
    existing vlans.

    This patch implements a similar solution to NETIF_F_RX_UDP_TUNNEL_PORT
    behavior (which notifies the driver about UDP ports in the same manner
    that vids are reported).

    Each toggling of the features propagates to the 8021q module, which
    iterates over the vlans and call add/kill ndo accordingly.

    Signed-off-by: Gal Pressman
    Reviewed-by: Tariq Toukan
    Signed-off-by: David S. Miller

    Gal Pressman
     

28 Mar, 2018

1 commit


27 Mar, 2018

1 commit

  • Prefer the direct use of octal for permissions.

    Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace
    and some typing.

    Miscellanea:

    o Whitespace neatening around these conversions.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

23 Mar, 2018

1 commit

  • Fun set of conflict resolutions here...

    For the mac80211 stuff, these were fortunately just parallel
    adds. Trivially resolved.

    In drivers/net/phy/phy.c we had a bug fix in 'net' that moved the
    function phy_disable_interrupts() earlier in the file, whilst in
    'net-next' the phy_error() call from this function was removed.

    In net/ipv4/xfrm4_policy.c, David Ahern's changes to remove the
    'rt_table_id' member of rtable collided with a bug fix in 'net' that
    added a new struct member "rt_mtu_locked" which needs to be copied
    over here.

    The mlxsw driver conflict consisted of net-next separating
    the span code and definitions into separate files, whilst
    a 'net' bug fix made some changes to that moved code.

    The mlx5 infiniband conflict resolution was quite non-trivial,
    the RDMA tree's merge commit was used as a guide here, and
    here are their notes:

    ====================

    Due to bug fixes found by the syzkaller bot and taken into the for-rc
    branch after development for the 4.17 merge window had already started
    being taken into the for-next branch, there were fairly non-trivial
    merge issues that would need to be resolved between the for-rc branch
    and the for-next branch. This merge resolves those conflicts and
    provides a unified base upon which ongoing development for 4.17 can
    be based.

    Conflicts:
    drivers/infiniband/hw/mlx5/main.c - Commit 42cea83f9524
    (IB/mlx5: Fix cleanup order on unload) added to for-rc and
    commit b5ca15ad7e61 (IB/mlx5: Add proper representors support)
    add as part of the devel cycle both needed to modify the
    init/de-init functions used by mlx5. To support the new
    representors, the new functions added by the cleanup patch
    needed to be made non-static, and the init/de-init list
    added by the representors patch needed to be modified to
    match the init/de-init list changes made by the cleanup
    patch.
    Updates:
    drivers/infiniband/hw/mlx5/mlx5_ib.h - Update function
    prototypes added by representors patch to reflect new function
    names as changed by cleanup patch
    drivers/infiniband/hw/mlx5/ib_rep.c - Update init/de-init
    stage list to match new order from cleanup patch
    ====================

    Signed-off-by: David S. Miller

    David S. Miller