Skip to content
  1. Jun 01, 2016
  2. May 30, 2016
  3. May 27, 2016
  4. May 26, 2016
    • David S. Miller's avatar
      Merge branch 'mlx4-stats-fixes' · 61248720
      David S. Miller authored
      
      
      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: default avatarDavid S. Miller <davem@davemloft.net>
      61248720
    • Eric Dumazet's avatar
      net/mlx4_en: get rid of private net_device_stats · f73a6f43
      Eric Dumazet authored
      
      
      We simply can use the standard net_device stats.
      
      We do not need to clear fields that are already 0.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f73a6f43
    • Eric Dumazet's avatar
      net/mlx4_en: get rid of ret_stats · 9ed17db1
      Eric Dumazet authored
      
      
      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: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9ed17db1
    • Eric Dumazet's avatar
      net/mlx4_en: clear some TX ring stats in mlx4_en_clear_stats() · 45acbac6
      Eric Dumazet authored
      
      
      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: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      45acbac6
    • Eric Dumazet's avatar
      net/mlx4_en: fix tx_dropped bug · 63a664b7
      Eric Dumazet authored
      
      
      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: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarWillem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63a664b7
    • Xin Long's avatar
      sctp: fix double EPs display in sctp_diag · bed187b5
      Xin Long authored
      
      
      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: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bed187b5
    • Marek Vasut's avatar
      net: arc: trivial: Replace comma with a semicolon · 3424d9be
      Marek Vasut authored
      
      
      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: default avatarMarek Vasut <marex@denx.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Caesar Wang <wxt@rock-chips.com>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3424d9be
    • Marek Vasut's avatar
      net: stmmac: Fix incorrect memcpy source memory · 643d60bf
      Marek Vasut authored
      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: e7f4dc35
      
       ("mdio: Move allocation of interrupts into core")
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      643d60bf
    • Feng Tang's avatar
      net: alx: use custom skb allocator · 26c5f03b
      Feng Tang authored
      This patch follows Eric Dumazet's commit 7b701764 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 <edumazet@google.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Jarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Tested-by: default avatarOle Lukoie <olelukoie@mail.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26c5f03b
    • Ivan Vecera's avatar
      team: don't call netdev_change_features under team->lock · f6988cb6
      Ivan Vecera authored
      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
      fd867d51 (net/core: generic support for disabling netdev features down stack)
      that adds synchronization of features with lower devices.
      
      Fixes: fd867d51
      
       (net/core: generic support for disabling netdev features down stack)
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6988cb6
    • David S. Miller's avatar
      Merge branch 'dsa-doc-fixes' · f58fb330
      David S. Miller authored
      
      
      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: default avatarDavid S. Miller <davem@davemloft.net>
      f58fb330
    • Florian Fainelli's avatar
      Documentation: networking: dsa: Describe port_vlan_filtering · f05e2db1
      Florian Fainelli authored
      Described what the port_vlan_filtering function is supposed to
      accomplish.
      
      Fixes: fb2dabad
      
       ("net: dsa: support VLAN filtering switchdev attr")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f05e2db1