24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

29 Jun, 2020

1 commit

  • lockdep_set_class_and_subclass() is meant to reduce
    the _nested() annotations by assigning a default subclass.
    For addr_list_lock, we have to compute the subclass at
    run-time as the netdevice topology changes after creation.

    So, we should just get rid of these
    lockdep_set_class_and_subclass() and stick with our _nested()
    annotations.

    Fixes: 845e0ebb4408 ("net: change addr_list_lock back to static key")
    Suggested-by: Taehee Yoo
    Cc: Dmitry Vyukov
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

10 Jun, 2020

1 commit

  • The dynamic key update for addr_list_lock still causes troubles,
    for example the following race condition still exists:

    CPU 0: CPU 1:
    (RCU read lock) (RTNL lock)
    dev_mc_seq_show() netdev_update_lockdep_key()
    -> lockdep_unregister_key()
    -> netif_addr_lock_bh()

    because lockdep doesn't provide an API to update it atomically.
    Therefore, we have to move it back to static keys and use subclass
    for nest locking like before.

    In commit 1a33e10e4a95 ("net: partially revert dynamic lockdep key
    changes"), I already reverted most parts of commit ab92d68fc22f
    ("net: core: add generic lockdep keys").

    This patch reverts the rest and also part of commit f3b0a18bb6cb
    ("net: remove unnecessary variables and callback"). After this
    patch, addr_list_lock changes back to using static keys and
    subclasses to satisfy lockdep. Thanks to dev->lower_level, we do
    not have to change back to ->ndo_get_lock_subclass().

    And hopefully this reduces some syzbot lockdep noises too.

    Reported-by: syzbot+f3a0e80c34b3fc28ac5e@syzkaller.appspotmail.com
    Cc: Taehee Yoo
    Cc: Dmitry Vyukov
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

08 May, 2020

1 commit


05 May, 2020

1 commit

  • This patch reverts the folowing commits:

    commit 064ff66e2bef84f1153087612032b5b9eab005bd
    "bonding: add missing netdev_update_lockdep_key()"

    commit 53d374979ef147ab51f5d632dfe20b14aebeccd0
    "net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()"

    commit 1f26c0d3d24125992ab0026b0dab16c08df947c7
    "net: fix kernel-doc warning in "

    commit ab92d68fc22f9afab480153bd82a20f6e2533769
    "net: core: add generic lockdep keys"

    but keeps the addr_list_lock_key because we still lock
    addr_list_lock nestedly on stack devices, unlikely xmit_lock
    this is safe because we don't take addr_list_lock on any fast
    path.

    Reported-and-tested-by: syzbot+aaa6fa4949cc5d9b7b25@syzkaller.appspotmail.com
    Cc: Dmitry Vyukov
    Cc: Taehee Yoo
    Signed-off-by: Cong Wang
    Acked-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Cong Wang
     

10 Jan, 2020

1 commit


08 Jan, 2020

1 commit

  • 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

    Eric Dumazet
     

26 Dec, 2019

1 commit

  • The vlan layer tests fields of the phy_device in order to determine
    whether to invoke the PHY's tsinfo ethtool callback. This patch
    replaces the open coded logic with an invocation of the proper
    methods.

    Signed-off-by: Richard Cochran
    Reviewed-by: Andrew Lunn
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Richard Cochran
     

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
     

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
     

21 May, 2019

1 commit

  • 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
     

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


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
     

08 May, 2018

1 commit


02 Apr, 2018

1 commit


16 Jun, 2017

1 commit

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

    Note that the last part there converts from push(...)[0] to the
    more idiomatic *(u8 *)push(...).

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

    Johannes Berg
     

15 Jun, 2017

1 commit


09 Jun, 2017

1 commit

  • Remove support for bridge bypass ndos from stacked devices. At this point
    no driver which supports stack device behavior offload supports operation
    with SELF flag. The case for upper device is already taken care of in both
    of the following cases:

    1. FDB add/del - driver should check at the notification cb if the
    stacked device contains his ports.

    2. Port attribute - calls switchdev code directly which checks
    for case of stack device.

    Signed-off-by: Arkadi Sharshevsky
    Reviewed-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Arkadi Sharshevsky
     

08 Jun, 2017

1 commit

  • Network devices can allocate reasources and private memory using
    netdev_ops->ndo_init(). However, the release of these resources
    can occur in one of two different places.

    Either netdev_ops->ndo_uninit() or netdev->destructor().

    The decision of which operation frees the resources depends upon
    whether it is necessary for all netdev refs to be released before it
    is safe to perform the freeing.

    netdev_ops->ndo_uninit() presumably can occur right after the
    NETDEV_UNREGISTER notifier completes and the unicast and multicast
    address lists are flushed.

    netdev->destructor(), on the other hand, does not run until the
    netdev references all go away.

    Further complicating the situation is that netdev->destructor()
    almost universally does also a free_netdev().

    This creates a problem for the logic in register_netdevice().
    Because all callers of register_netdevice() manage the freeing
    of the netdev, and invoke free_netdev(dev) if register_netdevice()
    fails.

    If netdev_ops->ndo_init() succeeds, but something else fails inside
    of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
    it is not able to invoke netdev->destructor().

    This is because netdev->destructor() will do a free_netdev() and
    then the caller of register_netdevice() will do the same.

    However, this means that the resources that would normally be released
    by netdev->destructor() will not be.

    Over the years drivers have added local hacks to deal with this, by
    invoking their destructor parts by hand when register_netdevice()
    fails.

    Many drivers do not try to deal with this, and instead we have leaks.

    Let's close this hole by formalizing the distinction between what
    private things need to be freed up by netdev->destructor() and whether
    the driver needs unregister_netdevice() to perform the free_netdev().

    netdev->priv_destructor() performs all actions to free up the private
    resources that used to be freed by netdev->destructor(), except for
    free_netdev().

    netdev->needs_free_netdev is a boolean that indicates whether
    free_netdev() should be done at the end of unregister_netdevice().

    Now, register_netdevice() can sanely release all resources after
    ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
    and netdev->priv_destructor().

    And at the end of unregister_netdevice(), we invoke
    netdev->priv_destructor() and optionally call free_netdev().

    Signed-off-by: David S. Miller

    David S. Miller
     

09 May, 2017

1 commit

  • Vlan devices, like all other software devices, enable
    NETIF_F_HW_CSUM feature. However, unlike all the othe other
    software devices, vlans will switch to using IP|IPV6_CSUM
    features, if the underlying devices uses them. In these situations,
    checksum offload features on the vlan device can't be controlled
    via ethtool.

    This patch makes vlans keep HW_CSUM feature if the underlying
    device supports checksum offloading. This makes vlan devices
    behave like other software devices, and restores control to the
    user.

    A side-effect is that some offload settings (typically UFO)
    may be enabled on the vlan device while being disabled on the HW.
    However, the GSO code will correctly process the packets. This
    actually results in slightly better raw throughput.

    Signed-off-by: Vladislav Yasevich
    Acked-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Vlad Yasevich
     

22 Mar, 2017

1 commit

  • wanted_features is a set of features which have to be enabled if a
    hardware allows that.

    Currently when a vlan device is created, its wanted_features is set to
    current features of its base device.

    The problem is that the base device can get new features and they are
    not propagated to vlan-s of this device.

    If we look at bonding devices, they doesn't have this problem and this
    patch suggests to fix this issue by the same way how it works for bonding
    devices.

    We meet this problem, when we try to create a vlan device over a bonding
    device. When a system are booting, real devices require time to be
    initialized, so bonding devices created without slaves, then vlan
    devices are created and only then ethernet devices are added to the
    bonding device. As a result we have vlan devices with disabled
    scatter-gather.

    * create a bonding device
    $ ip link add bond0 type bond
    $ ethtool -k bond0 | grep scatter
    scatter-gather: off
    tx-scatter-gather: off [requested on]
    tx-scatter-gather-fraglist: off [requested on]

    * create a vlan device
    $ ip link add link bond0 name bond0.10 type vlan id 10
    $ ethtool -k bond0.10 | grep scatter
    scatter-gather: off
    tx-scatter-gather: off
    tx-scatter-gather-fraglist: off

    * Add a slave device to bond0
    $ ip link set dev eth0 master bond0

    And now we can see that the bond0 device has got the scatter-gather
    feature, but the bond0.10 hasn't got it.
    [root@laptop linux-task-diag]# ethtool -k bond0 | grep scatter
    scatter-gather: on
    tx-scatter-gather: on
    tx-scatter-gather-fraglist: on
    [root@laptop linux-task-diag]# ethtool -k bond0.10 | grep scatter
    scatter-gather: off
    tx-scatter-gather: off
    tx-scatter-gather-fraglist: off

    With this patch the vlan device will get all new features from the
    bonding device.

    Here is a call trace how features which are set in this patch reach
    dev->wanted_features.

    register_netdevice
    vlan_dev_init
    ...
    dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG |
    NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE |
    NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC |
    NETIF_F_ALL_FCOE;

    dev->features |= dev->hw_features;
    ...
    dev->wanted_features = dev->features & dev->hw_features;
    __netdev_update_features(dev);
    vlan_dev_fix_features
    ...

    Cc: Alexey Kuznetsov
    Cc: Patrick McHardy
    Cc: "David S. Miller"
    Signed-off-by: Andrei Vagin
    Signed-off-by: David S. Miller

    Andrey Vagin
     

07 Feb, 2017

1 commit

  • In commit 18bfb924f000 ("net: introduce default neigh_construct/destroy
    ndo calls for L2 upper devices") we added these ndos to stacked devices
    such as team and bond, so that calls will be propagated to mlxsw.

    However, previous commit removed the reliance on these ndos and no new
    users of these ndos have appeared since above mentioned commit. We can
    therefore safely remove this dead code.

    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     

09 Jan, 2017

1 commit

  • The network device operation for reading statistics is only called
    in one place, and it ignores the return value. Having a structure
    return value is potentially confusing because some future driver could
    incorrectly assume that the return value was used.

    Fix all drivers with ndo_get_stats64 to have a void function.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

21 Oct, 2016

1 commit

  • geneve:
    - Merge __geneve_change_mtu back into geneve_change_mtu, set max_mtu
    - This one isn't quite as straight-forward as others, could use some
    closer inspection and testing

    macvlan:
    - set min/max_mtu

    tun:
    - set min/max_mtu, remove tun_net_change_mtu

    vxlan:
    - Merge __vxlan_change_mtu back into vxlan_change_mtu
    - Set max_mtu to IP_MAX_MTU and retain dynamic MTU range checks in
    change_mtu function
    - This one is also not as straight-forward and could use closer inspection
    and testing from vxlan folks

    bridge:
    - set max_mtu of IP_MAX_MTU and retain dynamic MTU range checks in
    change_mtu function

    openvswitch:
    - set min/max_mtu, remove internal_dev_change_mtu
    - note: max_mtu wasn't checked previously, it's been set to 65535, which
    is the largest possible size supported

    sch_teql:
    - set min/max_mtu (note: max_mtu previously unchecked, used max of 65535)

    macsec:
    - min_mtu = 0, max_mtu = 65535

    macvlan:
    - min_mtu = 0, max_mtu = 65535

    ntb_netdev:
    - min_mtu = 0, max_mtu = 65535

    veth:
    - min_mtu = 68, max_mtu = 65535

    8021q:
    - min_mtu = 0, max_mtu = 65535

    CC: netdev@vger.kernel.org
    CC: Nicolas Dichtel
    CC: Hannes Frederic Sowa
    CC: Tom Herbert
    CC: Daniel Borkmann
    CC: Alexander Duyck
    CC: Paolo Abeni
    CC: Jiri Benc
    CC: WANG Cong
    CC: Roopa Prabhu
    CC: Pravin B Shelar
    CC: Sabrina Dubroca
    CC: Patrick McHardy
    CC: Stephen Hemminger
    CC: Pravin Shelar
    CC: Maxim Krasnyansky
    Signed-off-by: Jarod Wilson
    Signed-off-by: David S. Miller

    Jarod Wilson
     

24 Jul, 2016

1 commit


17 Jul, 2016

1 commit

  • macsec can't cope with mtu frames which need vlan tag insertion, and
    vlan device set the default mtu equal to the underlying dev's one.
    By default vlan over macsec devices use invalid mtu, dropping
    all the large packets.
    This patch adds a netif helper to check if an upper vlan device
    needs mtu reduction. The helper is used during vlan devices
    initialization to set a valid default and during mtu updating to
    forbid invalid, too bit, mtu values.
    The helper currently only check if the lower dev is a macsec device,
    if we get more users, we need to update only the helper (possibly
    reserving an additional IFF bit).

    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller

    Paolo Abeni
     

06 Jul, 2016

1 commit


01 Jun, 2016

1 commit

  • The MAC address of the physical interface is only copied to the VLAN
    when it is first created, resulting in an inconsistency after MAC
    address changes of only newly created VLANs having an up-to-date MAC.

    The VLANs should continue inheriting the MAC address of the physical
    interface until the VLAN MAC address is explicitly set to any value.
    This allows IPv6 EUI64 addresses for the VLAN to reflect any changes
    to the MAC of the physical interface and thus for DAD to behave as
    expected.

    Signed-off-by: Mike Manning
    Signed-off-by: David S. Miller

    Mike Manning
     

18 Mar, 2016

1 commit


26 Feb, 2016

1 commit


22 Feb, 2016

1 commit

  • Currently vlan device inherits unicast filtering flag from underlying
    device. If underlying device doesn't support unicast filter, this will
    put vlan device into promiscuous mode when it's stacked.

    Tun on IFF_UNICAST_FLT on the vlan device in any case so that it does
    not go into promiscuous mode needlessly. If underlying device does not
    support unicast filtering, that device will enter promiscuous mode.

    Signed-off-by: Zhang Shengju
    Signed-off-by: David S. Miller

    Zhang Shengju
     

16 Dec, 2015

1 commit

  • The name NETIF_F_ALL_CSUM is a misnomer. This does not correspond to the
    set of features for offloading all checksums. This is a mask of the
    checksum offload related features bits. It is incorrect to set both
    NETIF_F_HW_CSUM and NETIF_F_IP_CSUM or NETIF_F_IPV6 at the same time for
    features of a device.

    This patch:
    - Changes instances of NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK (where
    NETIF_F_ALL_CSUM is being used as a mask).
    - Changes bonding, sfc/efx, ipvlan, macvlan, vlan, and team drivers to
    use NEITF_F_HW_CSUM in features list instead of NETIF_F_ALL_CSUM.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert