12 May, 2016

1 commit

  • Replace 2 arguments (cnt and rtt) in the congestion control modules'
    pkts_acked() function with a struct. This will allow adding more
    information without having to modify existing congestion control
    modules (tcp_nv in particular needs bytes in flight when packet
    was sent).

    As proposed by Neal Cardwell in his comments to the tcp_nv patch.

    Signed-off-by: Lawrence Brakmo
    Acked-by: Yuchung Cheng
    Signed-off-by: David S. Miller

    Lawrence Brakmo
     

11 May, 2016

11 commits

  • Antonio Quartulli says:

    ====================
    Included changes:
    - remove useless skb size check in batadv_interface_rx
    - basic netns support introduced by Andrew Lunn:
    - prevent virtual interface from changing netns by setting
    NETIF_F_NETNS_LOCAL
    - create virtual interface within the netns of the first
    hard-interface
    - introduce detection of complex bridge loops and report event
    to the user (via udev) when the Bridge Loop Avoidance mechanism
    can't prevent them
    - minor reference counting bugfixes for the hard_iface object that
    couldn't make it via the net tree
    - use kref_get() instead of kref_get_unless_zero() to make reference
    counting bug more visible
    - use batadv_compare_eth() all over the code when possible instead of
    plain memcmp()
    - minor code cleanup and style adjustments
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • There are two instances of an unused variable, `doff' added by
    commit 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
    in pskb_carve_inside_header() and pskb_carve_inside_nonlinear().
    Remove these instances, they are not used.

    Reported by: Daniel Borkmann
    Signed-off-by: Sowmini Varadhan
    Signed-off-by: David S. Miller

    Sowmini Varadhan
     
  • The handler 'ila_fill_encap_info' adds two attributes: ILA_ATTR_LOCATOR
    and ILA_ATTR_CSUM_MODE.

    nla_total_size_64bit() must be use for ILA_ATTR_LOCATOR.

    Also, do nla_put_u8 instead of nla_put_u64 for ILA_ATTR_CSUM_MODE.

    Fixes: f13a82d87b21 ("ipv6: use nla_put_u64_64bit()")
    Fixes: 90bfe662db13 ("ila: add checksum neutral ILA translations")
    Reported-by: Nicolas Dichtel
    Signed-off-by: Tom Herbert
    Signed-off-by: Nicolas Dichtel
    Acked-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • The GTPv1 header flags indicate the presence of optional extensions
    after this header. Refresh the pointer to the GTPv1 header as skb->head
    might have be reallocated via pskb_may_pull().

    Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
    Reported-by: Eric Dumazet
    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Pablo Neira
     
  • The attribute 0 is never used in drbd, so let's use it as pad attribute
    in netlink messages. This minimizes the patch.

    Note that this patch is only compile-tested.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: Lars Ellenberg
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • Philippe Reynes says:

    ====================
    net: phy: add phy_ethtool_{get|set}_link_ksettings

    Ethtool callbacks {get|set}_link_ksettings may be the
    same for many drivers. So we add two generics callbacks
    phy_ethtool_{get|set}_link_ksettings.

    To use those generics callbacks, the ethernet driver must
    use the pointer phydev contained in struct net_device, and
    not use a private structure to store this pointer.

    Changelog:
    v3:
    - rename function to phy_ethtool_{get|set}_link_ksettings
    - move code to net/phy/phy.c
    This feedback were provided by David Decotigny
    v2:
    - use generic function instead of macro
    - ethernet driver use the pointer phydev provided by struct net_device
    Those idea were provided by Ben Hutchings,
    and Florian Fainelli acknowledge them.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • There are two generics functions phy_ethtool_{get|set}_link_ksettings,
    so we can use them instead of defining the same code in the driver.

    Signed-off-by: Philippe Reynes
    Signed-off-by: David S. Miller

    Philippe Reynes
     
  • The private structure contain a pointer to phydev, but the structure
    net_device already contain such pointer. So we can remove the pointer
    phydev in the private structure, and update the driver to use the one
    contained in struct net_device.

    Signed-off-by: Philippe Reynes
    Signed-off-by: David S. Miller

    Philippe Reynes
     
  • Ethtool callbacks {get|set}_link_ksettings are often the same, so
    we add two generics functions phy_ethtool_{get|set}_link_ksettings
    to avoid writing severals times the same function.

    Signed-off-by: Philippe Reynes
    Acked-By: David Decotigny
    Signed-off-by: David S. Miller

    Philippe Reynes
     
  • …x/kernel/git/mkl/linux-can-next

    Marc Kleine-Budde says:

    ====================
    pull-request: can-next 2016-05-09

    this is a pull request of 12 patches for net-next/master.

    Alexander Gerasiov and Nikita Edward Baruzdin each contribute a patch
    improving the sja1000 driver. Amitoj Kaur Chawla's patch converts the
    mcp251x driver to alloc_workqueue(). A patch by Oliver Hartkopp fixes
    the handling of CAN config options. Andreas Gröger improves the error
    handling in the janz-ican3 driver. The patch by Maximilian Schneider
    for the gs_usb improves probing of the USB driver. Finally there are 6
    improvement patches by Marek Vasut for the ifi CAN driver.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • This is an initial implementation of a netdev driver for GTP datapath
    (GTP-U) v0 and v1, according to the GSM TS 09.60 and 3GPP TS 29.060
    standards. This tunneling protocol is used to prevent subscribers from
    accessing mobile carrier core network infrastructure.

    This implementation requires a GGSN userspace daemon that implements the
    signaling protocol (GTP-C), such as OpenGGSN [1]. This userspace daemon
    updates the PDP context database that represents active subscriber
    sessions through a genetlink interface.

    For more context on this tunneling protocol, you can check the slides
    that were presented during the NetDev 1.1 [2].

    Only IPv4 is supported at this time.

    [1] http://git.osmocom.org/openggsn/
    [2] http://www.netdevconf.org/1.1/proceedings/slides/schultz-welte-osmocom-gtp.pdf

    Signed-off-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Pablo Neira
     

10 May, 2016

28 commits

  • When comparing Ethernet address it is better to use the more
    generic batadv_compare_eth. The latter is also optimised for
    architectures having a fast unaligned access.

    Signed-off-by: Antonio Quartulli
    [sven@narfation.org: fix conflicts with current version]
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • Signed-off-by: Marek Lindner
    Reviewed-by: Sven Eckelmann
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     
  • It is easier to understand that the returned value of a specific function
    doesn't have to be 0 when the functions was successful when the actual
    return type is bool. This is especially true when all surrounding functions
    with return type int use negative values to return the error code.

    Reported-by: Nicholas Krause
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • _batadv_update_route requires that the caller already has a valid reference
    for neigh_node. It is therefore not possible that it has an reference
    counter of 0 and was still given to this function

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • The callers of the functions using batadv_hard_iface objects already make
    sure that they hold a valid reference. The subfunctions don't have
    to check whether the reference counter is > 0 because this was checked by
    the callers.

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_gw_node_add requires that the caller already has a valid reference
    for orig_node. It is therefore not possible that it has an reference
    counter of 0 and was still given to this function

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_gw_select requires that the caller already has a valid reference for
    new_gw_node. It is therefore not possible that it has an reference counter
    of 0 and was still given to this function

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_nc_get_nc_node requires that the caller already has a valid
    reference for orig_neigh_node. It is therefore not possible that it has an
    reference counter of 0 and was still given to this function

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_tvlv_container_get requires that tvlv.container_list_lock is held by
    the caller. It is therefore not possible that an item in
    tvlv.container_list has an reference counter of 0 and is still in the list

    The kref_get function instead WARNs (with debug information) when the
    reference counter would still be 0. This makes a bug in batman-adv better
    visible because kref_get_unless_zero would have ignored this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • The hard_iface is referenced in the packet_type for batman-adv. Increase
    the refcounter of the hard_interface for it to have an explicit reference
    for it in case this functionality gets refactorted and the currently
    used implicit reference for it will be removed.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • The receive function may start processing an incoming packet while the
    hard_iface is shut down in a different context. All called functions called
    with the batadv_hard_iface object belonging to the incoming interface would
    have to check whether the reference counter is still > 0.

    This is rather error-prone because this check can be forgotten easily.
    Instead check the reference counter when receiving the object to make sure
    that all called functions have a valid reference.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • The batadv_hardif_list list is checked in many situations and the items
    in this list are given to specialized functions to modify the routing
    behavior. At the moment each of these called functions has to check
    itself whether the received batadv_hard_iface has a refcount > 0 before
    it can increase the reference counter and use it in other objects.

    This can easily lead to problems because it is not easily visible where
    all callers of a function got the batadv_hard_iface object from and
    whether they already hold a valid reference.

    Checking the reference counter directly before calling a subfunction
    with a pointer from the batadv_hardif_list avoids this problem.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • There are network setups where the current bridge loop avoidance can't
    detect bridge loops. The minimal setup affected would consist of two
    LANs and two separate meshes, connected in a ring like that:

    A...(mesh1)...B
    | |
    (LAN1) (LAN2)
    | |
    C...(mesh2)...D

    Since both the meshes and backbones are separate, the bridge loop
    avoidance has not enough information to detect and avoid the loop
    in this case. Even if these scenarios can't be fixed easily,
    these kind of loops can be detected.

    This patch implements a periodic check (running every 60 seconds for
    now) which sends a broadcast frame with a random MAC address on
    each backbone VLAN. If a broadcast frame with the same MAC address
    is received shortly after on the mesh, we know that there must be a
    loop and report that incident as well as throw an uevent to let others
    handle that problem.

    Signed-off-by: Simon Wunderlich
    [sven@narfation.org: fix conflicts with current version]
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • When creating a soft interface, create it in the same netns as the
    hard interface. Replace all references to init_net with the correct
    name space for the interface being manipulated.

    Suggested-by: Daniel Ehlers
    Signed-off-by: Andrew Lunn
    Acked-by: Antonio Quartulli
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Andrew Lunn
     
  • The batX soft interface should not be moved between network name
    spaces. This is similar to bridges, bonds, tunnels, which are not
    allowed to move between network namespaces.

    Suggested-by: Daniel Ehlers
    Signed-off-by: Andrew Lunn
    Acked-by: Antonio Quartulli
    Reviewed-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Andrew Lunn
     
  • The callers of batadv_interface_rx have to make sure that enough data can
    be pulled from the skb when they read the batman-adv header. The only two
    functions using it are either calling pskb_may_pull with hdr_size directly
    (batadv_recv_bcast_packet) or indirectly via batadv_check_unicast_packet
    (batadv_recv_unicast_packet).

    Reported-by: Marek Lindner
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • A recent commit introduced an unconditional use of an uninitialized
    variable, as reported in this gcc warning:

    net/netfilter/nf_conntrack_core.c: In function '__nf_conntrack_confirm':
    net/netfilter/nf_conntrack_core.c:632:33: error: 'ctinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    bytes = atomic64_read(&counter[CTINFO2DIR(ctinfo)].bytes);
    ^
    net/netfilter/nf_conntrack_core.c:628:26: note: 'ctinfo' was declared here
    enum ip_conntrack_info ctinfo;

    The problem is that a local variable shadows the function parameter.
    This removes the local variable, which looks like what Pablo originally
    intended.

    Signed-off-by: Arnd Bergmann
    Fixes: 71d8c47fc653 ("netfilter: conntrack: introduce clash resolution on insertion race")
    Acked-by: Pablo Neira Ayuso
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • Tom Herbert says:

    ====================
    ip6: Transmit tunneling fixes

    Several fixes suggested by Alexander.

    Tested: Running netperf TCP_STREAM with gretap and keyid configured.
    Visually verified that MTU is correctly being set. Did not test HW
    offload (Alexander plese try)
    ====================

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

    David S. Miller
     
  • Fix two spots where o_flags in a tunnel are being compared to GRE_SEQ
    instead of TUNNEL_SEQ.

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

    Tom Herbert
     
  • We only need to reset network header here.

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

    Tom Herbert
     
  • Need to use adjusted protocol value for setting inner protocol.

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

    Tom Herbert
     
  • GRE for IPv6 does not properly translate for GRE flags to tunnel
    flags and vice versa. This patch fixes that.

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

    Tom Herbert
     
  • In ip6gre_tnl_link_config set t->tun_len and t->hlen correctly for the
    configuration. For hard_header_len and mtu calculation include
    IPv6 header and encapsulation overhead.

    In ip6gre_tunnel_init_common set t->tun_len and t->hlen correctly for
    the configuration. Revert to setting hard_header_len instead of
    needed_headroom.

    Tested:

    ./ip link add name tun8 type ip6gretap remote \
    2401:db00:20:911a:face:0:27:0 local \
    2401:db00:20:911a:face:0:25:0 ttl 225

    Gives MTU of 1434. That is equal to 1500 - 40 - 14 - 4 - 8.

    ./ip link add name tun8 type ip6gretap remote \
    2401:db00:20:911a:face:0:27:0 local \
    2401:db00:20:911a:face:0:25:0 ttl 225 okey 123

    Gives MTU of 1430. That is equal to 1500 - 40 - 14 - 4 - 8 - 4.

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

    Tom Herbert
     
  • Fix the following sparse warning:
    drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:274:1: warning:
    symbol 'socfpga_dwmac_pm_ops' was not declared. Should it be static?

    Signed-off-by: Joachim Eastwood
    Signed-off-by: David S. Miller

    Joachim Eastwood
     
  • David Ahern says:

    ====================
    net: l3mdev: Allow send on enslaved interface

    First patch preps for the second. The second is required for several use
    cases such as ping on an interface and BFD that need to send packets on
    a specific interface, including ones enslaved to a VRF device.

    v2
    - fixed brackets on both patches per comment from DaveM
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Allow udp and raw sockets to send by oif that is an enslaved interface
    versus the l3mdev/VRF device. For example, this allows BFD to use ifindex
    from IP_PKTINFO on a receive to send a response without the need to
    convert to the VRF index. It also allows ping and ping6 to work when
    specifying an enslaved interface (e.g., ping -I swp1 ) which is
    a natural use case.

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

    David Ahern
     
  • Move l3mdev_rt6_dst_by_oif and l3mdev_get_saddr to l3mdev.c. Collapse
    l3mdev_get_rt6_dst into l3mdev_rt6_dst_by_oif since it is the only
    user and keep the l3mdev_get_rt6_dst name for consistency with other
    hooks.

    A follow-on patch adds more code to these functions making them long
    for inlined functions.

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

    David Ahern