01 Jun, 2016

5 commits


30 May, 2016

9 commits

  • l2tp_ip6 tunnel and session lookups were still using init_net, although
    the l2tp core infrastructure already supports lookups keyed by 'net'.

    As a result, l2tp_ip6_recv discarded packets for tunnels/sessions
    created in namespaces other than the init_net.

    Fix, by using dev_net(skb->dev) or sock_net(sk) where appropriate.

    Signed-off-by: Shmulik Ladkani
    Signed-off-by: David S. Miller

    Shmulik Ladkani
     
  • Clarify how secure_redirects works. Mention that RFC1122 always applies.

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

    Eric Garver
     
  • Signed-off-by: Edward Cree
    Signed-off-by: David S. Miller

    Edward Cree
     
  • Fix a logic error to avoid potential null pointer dereference.

    Signed-off-by: Baozeng Ding
    Reviewed-by: Stefan Schmidt
    Signed-off-by: David S. Miller

    Baozeng Ding
     
  • Since NAPI works by shutting down event interrupts when theres
    work and turning them on when theres none, the net driver must
    make sure that interrupts are disabled when it reschedules polling.
    By calling napi_reschedule, the driver switches to polling mode,
    therefor there should be no interrupt interference.
    Any received packets will be handled in nps_enet_poll by polling the HW
    indication of received packet until all packets are handled.

    Signed-off-by: Elad Kanfi
    Acked-by: Noam Camus
    Tested-by: Alexey Brodkin
    Signed-off-by: David S. Miller

    Elad Kanfi
     
  • Use %*ph specifier to dump small buffers in hex format instead doing this
    byte-by-byte.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Andy Shevchenko
     
  • If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.

    Fixes: 2ece068e1b1d ('ptp: use memdup_user().')
    Signed-off-by: Dan Carpenter
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • A previous patch added the fou6.ko module, but that failed to link
    in a couple of configurations:

    net/built-in.o: In function `ip6_tnl_encap_add_fou_ops':
    net/ipv6/fou6.c:88: undefined reference to `ip6_tnl_encap_add_ops'
    net/ipv6/fou6.c:94: undefined reference to `ip6_tnl_encap_add_ops'
    net/ipv6/fou6.c:97: undefined reference to `ip6_tnl_encap_del_ops'
    net/built-in.o: In function `ip6_tnl_encap_del_fou_ops':
    net/ipv6/fou6.c:106: undefined reference to `ip6_tnl_encap_del_ops'
    net/ipv6/fou6.c:107: undefined reference to `ip6_tnl_encap_del_ops'

    If CONFIG_IPV6=m, ip6_tnl_encap_add_ops/ip6_tnl_encap_del_ops
    are in a module, but fou6.c can still be built-in, and that
    obviously fails to link.

    Also, if CONFIG_IPV6=y, but CONFIG_IPV6_TUNNEL=m or
    CONFIG_IPV6_TUNNEL=n, the same problem happens for a different
    reason.

    This adds two new silent Kconfig symbols to work around both
    problems:

    - CONFIG_IPV6_FOU is now always set to 'm' if either CONFIG_NET_FOU=m
    or CONFIG_IPV6=m
    - CONFIG_IPV6_FOU_TUNNEL is set implicitly when IPV6_FOU is enabled
    and NET_FOU_IP_TUNNELS is also turned out, and it will ensure
    that CONFIG_IPV6_TUNNEL is also available.

    The options could be made user-visible as well, to give additional
    room for configuration, but it seems easier not to bother users
    with more choice here.

    Signed-off-by: Arnd Bergmann
    Fixes: aa3463d65e7b ("fou: Add encap ops for IPv6 tunnels")
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • A recent cleanup moved MAX_IPTUN_ENCAP_OPS along with some other
    definitions, but it is now invisible when CONFIG_INET is
    not defined, but still referenced from ip6_tunnel.h:

    In file included from net/xfrm/xfrm_input.c:17:0:
    include/net/ip6_tunnel.h:67:17: error: 'MAX_IPTUN_ENCAP_OPS' undeclared here (not in a function)
    ip6tun_encaps[MAX_IPTUN_ENCAP_OPS];
    ^~~~~~~~~~~~~~~~~~~

    This hides the ip6_encap_hlen and ip6_tnl_encap functions inside
    of CONFIG_INET so we don't run into the the problem.

    Alternatively we could move the macro out of the #ifdef again to
    restore the previous behavior

    Signed-off-by: Arnd Bergmann
    Fixes: 55c2bc143224 ("net: Cleanup encap items in ip_tunnels.h")
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

27 May, 2016

9 commits

  • Yuval Mintz says:

    ====================
    qed*: Bug fixes

    This series contain several small fixes, most of which deal with
    either 100g support, sriov or bandwidth configurations.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Currently 100g devices don't support minimum/maximum BW configurations,
    yet link flaps might cause the driver to attempt to do such a
    configuration. Prevent this just as we do for the maximum BW.

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     
  • Adapter can support 100g in both MSIx and INTa, but not in MSI.

    Signed-off-by: Sudarsana Reddy Kalluru
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Sudarsana Reddy Kalluru
     
  • Some of the HW configurations are currently missing for 100g devices.
    This can cause various classification issues, as well as prevent device
    from fully reaching line-rate.

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     
  • When DCBx re-negotiation is occurring, the PF's configurations for
    maximum and minimum bandwidth guarantees are currently lost.

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     
  • Commit 39651abd2814 ("qed: add support for dcbx") is re-configuring
    the QM hw-block as part of its sequence. This is done in attention
    handling context which is non-sleepable, yet memory is allocated in
    this flow using GFP_KERNEL.

    Signed-off-by: Sudarsana Reddy Kalluru
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Sudarsana Reddy Kalluru
     
  • PFs and VFs differ in their registered ethtool operations,
    but they're using a common function for get_sset_count().
    As a result, `ethtool -i' for a VF would indicate it supports
    selftest, although that's not the case.

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     
  • Since driver is using a FW-based GRO implementation, this has some
    effects on its ability to cope with GRO enablement/disablement.
    As a result, driver must perform an inner-reload as a result of a state
    change in the offload configuration of said feature.

    [Failure to do so means network stack would continue to receive
    aggregated packets even though user requested the feature to be disabled].

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     
  • VF is currently ignoring the minimum provided by the API,
    mistakenly using the maximum for minimum as well.

    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     

26 May, 2016

17 commits

  • Eric Dumazet says:

    ====================
    net/mlx4_en: fix stats

    mlx4 has various bugs in its ndo_get_stats() and related functions.
    This patch series address the obvious issues.
    Remaining ones will be discussed later.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We simply can use the standard net_device stats.

    We do not need to clear fields that are already 0.

    Signed-off-by: Eric Dumazet
    Cc: Willem de Bruijn
    Cc: Eugenia Emantayev
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • mlx4 uses a private struct net_device_stats in a vain attempt
    to avoid races.

    This is buggy because multiple cpus could call mlx4_en_get_stats()
    at the same time, so ret_stats can not guarantee stable results.

    To fix this, we need to switch to ndo_get_stats64() as this
    method provides per-thread storage.

    This allows to reduce mlx4_en_priv bloat.

    Signed-off-by: Eric Dumazet
    Cc: Willem de Bruijn
    Cc: Eugenia Emantayev
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • mlx4_en_clear_stats() clears about everything but few TX ring
    fields are missing :
    - queue_stopped, wake_queue, tso_packets, xmit_more

    Signed-off-by: Eric Dumazet
    Cc: Willem de Bruijn
    Cc: Eugenia Emantayev
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • 1) mlx4_en_xmit() can increment priv->stats.tx_dropped, but this variable
    is overwritten in mlx4_en_DUMP_ETH_STATS().

    2) This increment was not SMP safe, as a port might have many TX queues.

    Add a per TX ring tx_dropped to fix these issues.

    This is u32 as mlx4_en_DUMP_ETH_STATS() will add a 32bit field.

    So lets avoid bugs with SNMP agents having to cope with partial
    overwraps. (One of these agents being bond_fold_stats())

    Signed-off-by: Eric Dumazet
    Reported-by: Willem de Bruijn
    Cc: Eugenia Emantayev
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • We have this situation: that EP hash table, contains only the EPs
    that are listening, while the transports one, has the opposite.
    We have to traverse both to dump all.

    But when we traverse the transports one we will also get EPs that are
    in the EP hash if they are listening. In this case, the EP is dumped
    twice.

    We will fix it by checking if the endpoint that is in the endpoint
    hash table contains any ep->asoc in there, as it means we will also
    find it via transport hash, and thus we can/should skip it, depending
    on the filters used, like 'ss -l'.

    Still, we should NOT skip it if the user is listing only listening
    endpoints, because then we are not traversing the transport hash.
    so we have to check idiag_states there also.

    Signed-off-by: Xin Long
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Xin Long
     
  • Fix a typo in the driver, replace comma with a semicolon at the end
    of statement. While using comma is a legal C here and probably does
    not even generate compiler warning, it was unlikely the intention.

    Signed-off-by: Marek Vasut
    Cc: David S. Miller
    Cc: Caesar Wang
    Cc: Heiko Stuebner
    Signed-off-by: David S. Miller

    Marek Vasut
     
  • The memcpy() currently copies mdio_bus_data into new_bus->irq, which
    makes no sense, since the mdio_bus_data structure contains more than
    just irqs. The code was likely supposed to copy mdio_bus_data->irqs
    into the new_bus->irq instead, so fix this.

    Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")
    Signed-off-by: Marek Vasut
    Cc: David S. Miller
    Cc: Giuseppe Cavallaro
    Cc: Alexandre Torgue
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Marek Vasut
     
  • This patch follows Eric Dumazet's commit 7b70176421 for Atheros
    atl1c driver to fix one exactly same bug in alx driver, that the
    network link will be lost in 1-5 minutes after the device is up.

    My laptop Lenovo Y580 with Atheros AR8161 ethernet device hit the
    same problem with kernel 4.4, and it will be cured by Jarod Wilson's
    commit c406700c for alx driver which get merged in 4.5. But there
    are still some alx devices can't function well even with Jarod's
    patch, while this patch could make them work fine. More details on
    https://bugzilla.kernel.org/show_bug.cgi?id=70761

    The debug shows the issue is very likely to be related with the RX
    DMA address, specifically 0x...f80, if RX buffer get 0x...f80 several
    times, their will be RX overflow error and device will stop working.

    For kernel 4.5.0 with Jarod's patch which works fine with my
    AR8161/Lennov Y580, if I made some change to the
    __netdev_alloc_skb
    --> __alloc_page_frag()
    to make the allocated buffer can get an address with 0x...f80,
    then the same error happens. If I make it to 0x...f40 or 0x....fc0,
    everything will be still fine. So I tend to believe that the
    0x..f80 address cause the silicon to behave abnormally.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761
    Cc: Eric Dumazet
    Cc: Johannes Berg
    Cc: Jarod Wilson
    Signed-off-by: Feng Tang
    Tested-by: Ole Lukoie
    Signed-off-by: David S. Miller

    Feng Tang
     
  • The team_device_event() notifier calls team_compute_features() to fix
    vlan_features under team->lock to protect team->port_list. The problem is
    that subsequent __team_compute_features() calls netdev_change_features()
    to propagate vlan_features to upper vlan devices while team->lock is still
    taken. This can lead to deadlock when NETIF_F_LRO is modified on lower
    devices or team device itself.

    Example:
    The team0 as active backup with eth0 and eth1 NICs. Both eth0 & eth1 are
    LRO capable and LRO is enabled. Thus LRO is also enabled on team0.

    The command 'ethtool -K team0 lro off' now hangs due to this deadlock:

    dev_ethtool()
    -> ethtool_set_features()
    -> __netdev_update_features(team)
    -> netdev_sync_lower_features()
    -> netdev_update_features(lower_1)
    -> __netdev_update_features(lower_1)
    -> netdev_features_change(lower_1)
    -> call_netdevice_notifiers(...)
    -> team_device_event(lower_1)
    -> team_compute_features(team) [TAKES team->lock]
    -> netdev_change_features(team)
    -> __netdev_update_features(team)
    -> netdev_sync_lower_features()
    -> netdev_update_features(lower_2)
    -> __netdev_update_features(lower_2)
    -> netdev_features_change(lower_2)
    -> call_netdevice_notifiers(...)
    -> team_device_event(lower_2)
    -> team_compute_features(team) [DEADLOCK]

    The bug is present in team from the beginning but it appeared after the commit
    fd867d5 (net/core: generic support for disabling netdev features down stack)
    that adds synchronization of features with lower devices.

    Fixes: fd867d5 (net/core: generic support for disabling netdev features down stack)
    Cc: Jiri Pirko
    Signed-off-by: Ivan Vecera
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ivan Vecera
     
  • Florian Fainelli says:

    ====================
    Documentation: dsa: misc fixes

    Here are some miscelaneous documentation fixes for DSA, I targeted "net"
    because these are not functional code changes, but still documentation fixes
    per-se.

    Changes in v2:

    - reword what the port_vlan_filtering is about based on feedback from Vivien and Ido
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Described what the port_vlan_filtering function is supposed to
    accomplish.

    Fixes: fb2dabad69f0 ("net: dsa: support VLAN filtering switchdev attr")
    Signed-off-by: Florian Fainelli
    Reviewed-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Florian Fainelli
     
  • We no longer have a priv_size structure member since 5feebd0a8a79 ("net:
    dsa: Remove allocation of driver private memory")

    Reviewed-by: Vivien Didelot
    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     
  • This function has been removed in 4baee937b8d5 ("net: dsa: remove DSA
    link polling") in favor of using the PHYLIB polling mechanism.

    Reviewed-by: Vivien Didelot
    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     
  • Otherwise, if we fail to allocate new PIO buffers, our TXQs will try to
    use the old ones, which aren't there any more.

    Fixes: 183233bec810 "sfc: Allocate and link PIO buffers; map them with write-combining"
    Signed-off-by: Edward Cree
    Signed-off-by: David S. Miller

    Edward Cree
     
  • Gregory CLEMENT says:

    ====================
    Fix spinlock usage in HWBM

    these two patches fix spinlock related issues introduced in v4.6. They
    have been reported by Russell King and Jean-Jacques Hiblot.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • When hwbm_pool_add exited in error the spinlock was not released. This
    patch fixes this issue.

    Fixes: 8cb2d8bf57e6 ("net: add a hardware buffer management helper API")
    Reported-by: Jean-Jacques Hiblot
    Cc:
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: David S. Miller

    Gregory CLEMENT