30 Sep, 2015

40 commits

  • Similar to the notifier_call callback of a notifier_block, change the
    function signature of switchdev add and del operations to:

    int switchdev_port_obj_add/del(struct net_device *dev,
    enum switchdev_obj_id id, void *obj);

    This allows the caller to pass a specific switchdev_obj_* structure
    instead of the generic switchdev_obj one.

    Drivers implementation of these operations and switchdev have been
    changed accordingly.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • Similar to the notifier_call callback of a notifier_block, change the
    function signature of switchdev dump operation to:

    int switchdev_port_obj_dump(struct net_device *dev,
    enum switchdev_obj_id id, void *obj,
    int (*cb)(void *obj));

    This allows the caller to pass and expect back a specific
    switchdev_obj_* structure instead of the generic switchdev_obj one.

    Drivers implementation of dump operation can now expect this specific
    structure and call the callback with it. Drivers have been changed
    accordingly.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The net_device associated to a dump operation does not have to be passed
    to the callback. switchdev stores it in a superset struct, if needed.

    Also some drivers (such as DSA drivers) may not have easy access to it.

    This will simplify pushing the callback function down to the drivers.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The FDB dump callback requires the related net_device so move it to the
    struct switchdev_fdb_dump superset instead of using a callback param.

    With this done, it'll be simpler to change the dump function signature.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The static switchdev_port_vlan_dump_put function does not need the
    net_device parameter, so remove it.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • Geert Uytterhoeven says:

    ====================
    net: m68k: Allow modular build

    This patch series makes the remaining m68k Ethernet drivers modular.
    It's an alternative to the last 3 patches of Paul Gortmaker's series
    "[PATCH net-next 0/6] make non-modular code explicitly non-modular".

    Note that "[PATCH 5/5] net: macmace: Allow modular build" depends on
    "[PATCH 4/5] m68k/mac: Export Peripheral System Controller (PSC) base
    address to modules". Feel free to take the dependency through the netdev
    tree to avoid modular build breakage.

    This was compile-tested only (mac_defconfig + allmodconfig) due to lack
    of hardware.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • If CONFIG_MACMACE=m:

    ERROR: psc [drivers/net/ethernet/apple/macmace.ko] undefined!

    Add the missing export to fix this.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • If CONFIG_HPLANCE=m and CONFIG_NET_POLL_CONTROLLER=y:

    ERROR: "lance_poll" [drivers/net/ethernet/amd/hplance.ko] undefined!

    Add the missing export to fix this.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • The modular driver supports only one card, just like the built-in
    driver.

    Note that this limitation is a problem which affects all Nubus card
    drivers, because they have to do all their own bus matching, because
    Nubus still lacks the necessary driver model support.

    Suggested-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: David S. Miller

    Geert Uytterhoeven
     
  • commit dea870242a9c ("dsa: mv88e6xxx: Allow speed/duplex of port to be
    configured") leads to the following static checker warning:

    drivers/net/dsa/mv88e6xxx.c:585 mv88e6xxx_adjust_link()
    warn: unsigned 'ret' is never less than zero.

    drivers/net/dsa/mv88e6xxx.c
    573 void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port,
    574 struct phy_device *phydev)
    575 {
    576 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
    577 u32 ret, reg;
    578
    579 if (!phy_is_pseudo_fixed_link(phydev))
    580 return;
    581
    582 mutex_lock(&ps->smi_mutex);
    583
    584 ret = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_PCS_CTRL);
    585 if (ret < 0)

    Make ret an int, which is the return type for _mv88e6xxx_reg_read()

    Reported-by: Dan Carpenter
    Signed-off-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Andrew Lunn
     
  • David Ahern says:

    ====================
    net: L3 master device

    The VRF device is essentially a Layer 3 master device used to associate
    netdevices with a specific routing table and to influence FIB lookups
    via 'ip rules' and controlling the oif/iif used for the lookup.

    This series generalizes the VRF into L3 master device, l3mdev. Similar
    to switchdev it has a Kconfig option and separate set of operations
    in net_device allowing it to be completely compiled out if not wanted.
    The l3mdev methods rely on the 'master' aspect and use of
    netdev_master_upper_dev_get_rcu to retrieve the master device from a
    given netdevice if it is enslaved to an L3_MASTER.

    The VRF device is converted to use the l3mdev operations. At the end the
    vrf_ptr is no longer and removed, as are all direct references to VRF.
    The end result is a much simpler implementation for VRF.

    Thanks to Nikolay for suggestions (eg., use of the master linkage which
    is the key to making this work) and to Roopa, Andy and Shrijeet for
    early reviews.

    v3
    - added license header to l3mdev.c

    - export symbols in l3mdev.c for use with GPL modules

    - removed netdevice header from l3mdev.h (not needed) and fixed
    typo in comment

    v2
    - rebased to top of net-next
    - addressed Niks comments (checking master, removing extra lines, and
    flipping the order of patches 1 and 2)
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Change CONFIG dependency to CONFIG_NET_L3_MASTER_DEV as well.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Move remaining structs to VRF driver and delete the vrf header file.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Replace calls to vrf_dev_get_rth with l3mdev_get_rtable.
    The check on the flow flags is handled in the l3mdev operation.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Replace calls to vrf_dev_table and friends with l3mdev_fib_table
    and kin.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Replace calls to vrf_master_ifindex_rcu and vrf_master_ifindex with either
    l3mdev_master_ifindex_rcu or l3mdev_master_ifindex.

    The pattern:
    oif = vrf_master_ifindex(dev) ? : dev->ifindex;
    is replaced with
    oif = l3mdev_fib_oif(dev);

    And remove the now unused vrf macros.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • L3 master devices allow users of the abstraction to influence FIB lookups
    for enslaved devices. Current API provides a means for the master device
    to return a specific FIB table for an enslaved device, to return an
    rtable/custom dst and influence the OIF used for fib lookups.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Rename IFF_VRF_MASTER to IFF_L3MDEV_MASTER and update the name of the
    netif_is_vrf and netif_index_is_vrf macros.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     
  • Eric Dumazet says:

    ====================
    tcp: listener refactoring preparations

    This patch series makes changes to TCP/DCCP stacks so that
    we can switch listener code to lockless mode.

    This is done by marking const the listener socket in all
    appropriate paths.

    FastOpen code had to be changed to not dynamically allocate
    a very small structure to make code simpler for following changes.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • While auditing TCP stack for upcoming 'lockless' listener changes,
    I found I had to change fastopen_init_queue() to properly init the object
    before publishing it.

    Otherwise an other cpu could try to lock the spinlock before it gets
    properly initialized.

    Instead of adding appropriate barriers, just remove dynamic memory
    allocations :
    - Structure is 28 bytes on 64bit arches. Using additional 8 bytes
    for holding a pointer seems overkill.
    - Two listeners can share same cache line and performance would suffer.

    If we really want to save few bytes, we would instead dynamically allocate
    whole struct request_sock_queue in the future.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • tcp_syn_flood_action() will soon be called with unlocked socket.
    In order to avoid SYN flood warning being emitted multiple times,
    use xchg().
    Extend max_qlen_log and synflood_warned fields in struct listen_sock
    to u32

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • These functions do not change the listener socket.
    Goal is to make sure tcp_conn_request() is not messing with
    listener in a racy way.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Some common IPv4/IPv6 code can be factorized.
    Also constify cookie_init_sequence() socket argument.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • We'll soon no longer hold listener socket lock, these
    functions do not modify the socket in any way.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This method does not touch the listener socket.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • socket no longer needs to be read/write

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • socket is not touched, make it const.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • The socket points to the (shared) listener.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Before changing dccp_v6_request_recv_sock() sock argument
    to const, we need to get rid of security_sk_classify_flow(),
    and it seems doable by reusing inet6_csk_route_req() helper.

    We need to add a proto parameter to inet6_csk_route_req(),
    not assume it is TCP.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Factorize code to get tcp header from skb. It makes no sense
    to duplicate code in callers.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Once we realize tcp_rcv_synsent_state_process() does not use
    its 'len' argument and we get rid of it, then it becomes clear
    this argument is no longer used in tcp_rcv_state_process()

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • None of these functions need to change the socket, make it
    const.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Alexander Duyck says:

    ====================
    Minor IPv4 routing cleanups

    These patches just contain some minor cleanups to address a few minor
    issues. The first and the third mostly just improve readability. The
    second patch should improve the performance for multicast destination
    addresses that do not have a localhost source IP address by avoiding some
    unnecessary dereferences.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • err is initialized to -EINVAL when it is declared. It is not reset until
    fib_lookup which is well after the 3 users of the martian_source jump. So
    resetting err to -EINVAL at martian_source label is not needed.

    Removing that line obviates the need for the martian_source_keep_err label
    so delete it.

    Signed-off-by: David Ahern
    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    David Ahern
     
  • This patch just swaps the ordering of one of the conditional tests in
    ip_route_input_mc. Specifically it swaps the testing for the source
    address to see if it is loopback, and the test to see if we allow a
    loopback source address.

    The reason for swapping these two tests is because it is much faster to
    test if an address is loopback than it is to dereference several pointers
    to get at the net structure to see if the use of loopback is allowed.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck