1. 01 6月, 2016 12 次提交
  2. 30 5月, 2016 9 次提交
  3. 27 5月, 2016 9 次提交
  4. 26 5月, 2016 10 次提交
    • D
      Merge branch 'mlx4-stats-fixes' · 61248720
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      61248720
    • E
      net/mlx4_en: get rid of private net_device_stats · f73a6f43
      Eric Dumazet 提交于
      We simply can use the standard net_device stats.
      
      We do not need to clear fields that are already 0.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f73a6f43
    • E
      net/mlx4_en: get rid of ret_stats · 9ed17db1
      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: NEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ed17db1
    • E
      net/mlx4_en: clear some TX ring stats in mlx4_en_clear_stats() · 45acbac6
      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: NEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45acbac6
    • E
      net/mlx4_en: fix tx_dropped bug · 63a664b7
      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: NEric Dumazet <edumazet@google.com>
      Reported-by: NWillem de Bruijn <willemb@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63a664b7
    • X
      sctp: fix double EPs display in sctp_diag · bed187b5
      Xin Long 提交于
      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: NXin Long <lucien.xin@gmail.com>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bed187b5
    • M
      net: arc: trivial: Replace comma with a semicolon · 3424d9be
      Marek Vasut 提交于
      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: NMarek 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: NDavid S. Miller <davem@davemloft.net>
      3424d9be
    • M
      net: stmmac: Fix incorrect memcpy source memory · 643d60bf
      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: e7f4dc35 ("mdio: Move allocation of interrupts into core")
      Signed-off-by: NMarek 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: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      643d60bf
    • F
      net: alx: use custom skb allocator · 26c5f03b
      Feng Tang 提交于
      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: NFeng Tang <feng.tang@intel.com>
      Tested-by: NOle Lukoie <olelukoie@mail.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26c5f03b
    • I
      team: don't call netdev_change_features under team->lock · f6988cb6
      Ivan Vecera 提交于
      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: NIvan Vecera <ivecera@redhat.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6988cb6