1. 21 Sep, 2016 27 commits
  2. 20 Sep, 2016 13 commits
    • Jesper Dangaard Brouer's avatar
      mlx4: add missed recycle opportunity for XDP_TX on TX failure · 5737f6c9
      Jesper Dangaard Brouer authored
      Correct drop handling for XDP_TX on TX failure, were recently added in
      commit 95357907 ("mlx4: fix XDP_TX is acting like XDP_PASS on TX
      ring full").
      
      The change missed an opportunity for recycling the RX page, instead of
      going through the page allocator, like the regular XDP_DROP action does.
      This patch cease the opportunity, by going through the XDP_DROP case.
      
      Fixes: 95357907 ("mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full")
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5737f6c9
    • David S. Miller's avatar
      Merge branch 'dsa-set_addr-optional' · 1860e688
      David S. Miller authored
      John Crispin says:
      
      ====================
      net-next: dsa: set_addr should be optional
      
      The Marvell driver is the only one that actually sets the switches HW
      address. All other drivers have an empty stub. fix this by making the
      callback optional.
      ====================
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1860e688
    • John Crispin's avatar
      net-next: dsa: qca8k: remove empty set_addr() stub · 8941ee36
      John Crispin authored
      The set_addr() callback is now optional. Remove the empty stub that qca8k
      has.
      Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8941ee36
    • John Crispin's avatar
      net-next: dsa: b53: remove empty set_addr() stub · 1f449736
      John Crispin authored
      The set_addr() callback is now optional. Remove the empty stub that b53
      has.
      Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f449736
    • John Crispin's avatar
      net-next: dsa: make the set_addr() operation optional · 092183df
      John Crispin authored
      Only 1 of the 3 drivers currently has a set_addr() operation. Make the
      set_addr() callback optional to reduce the amount of empty stubs inside
      the drivers.
      Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      092183df
    • John Crispin's avatar
      net-next: dsa: fix duplicate invocation of set_addr() · 06f8ec90
      John Crispin authored
      commit 83c0afae ("net: dsa: Add new binding implementation")
      has a duplicate invocation of the set_addr() operation callback. Remove one
      of them.
      Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06f8ec90
    • David S. Miller's avatar
      Merge branch 'rhashtable-dups' · f361bdde
      David S. Miller authored
      Herbert Xu says:
      
      ====================
      rhashtable: rhashtable with duplicate objects
      
      v3 fixes a bug in the remove path that causes the element count
      to decrease when it shouldn't, leading to a gigantic hash table
      when it underflows.
      
      v2 contains a reworked insertion slowpath to ensure that the
      spinlock for the table we're inserting into is taken.
      
      This series contains two patches.  The first adds the rhlist
      interface and the second converts mac80211 to use it.  If this
      works out I'll then proceed to convert the other insecure_elasticity
      users over to this.
      
      I've tested the rhlist code with test_rhashtable but I haven't
      tested the mac80211 conversion.  So please give it a go and see
      if it still works.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f361bdde
    • Herbert Xu's avatar
      mac80211: Use rhltable instead of rhashtable · 83e7e4ce
      Herbert Xu authored
      mac80211 currently uses rhashtable with insecure_elasticity set
      to true.  The latter is because of duplicate objects.  What's
      more, mac80211 walks the rhashtable chains by hand which is broken
      as rhashtable may contain multiple tables due to resizing or
      rehashing.
      
      This patch fixes it by converting it to the newly added rhltable
      interface which is designed for use with duplicate objects.
      
      With rhltable a lookup returns a list of objects instead of a
      single one.  This is then fed into the existing for_each_sta_info
      macro.
      
      This patch also deletes the sta_addr_hash function since rhashtable
      defaults to jhash.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83e7e4ce
    • Herbert Xu's avatar
      rhashtable: Add rhlist interface · ca26893f
      Herbert Xu authored
      The insecure_elasticity setting is an ugly wart brought out by
      users who need to insert duplicate objects (that is, distinct
      objects with identical keys) into the same table.
      
      In fact, those users have a much bigger problem.  Once those
      duplicate objects are inserted, they don't have an interface to
      find them (unless you count the walker interface which walks
      over the entire table).
      
      Some users have resorted to doing a manual walk over the hash
      table which is of course broken because they don't handle the
      potential existence of multiple hash tables.  The result is that
      they will break sporadically when they encounter a hash table
      resize/rehash.
      
      This patch provides a way out for those users, at the expense
      of an extra pointer per object.  Essentially each object is now
      a list of objects carrying the same key.  The hash table will
      only see the lists so nothing changes as far as rhashtable is
      concerned.
      
      To use this new interface, you need to insert a struct rhlist_head
      into your objects instead of struct rhash_head.  While the hash
      table is unchanged, for type-safety you'll need to use struct
      rhltable instead of struct rhashtable.  All the existing interfaces
      have been duplicated for rhlist, including the hash table walker.
      
      One missing feature is nulls marking because AFAIK the only potential
      user of it does not need duplicate objects.  Should anyone need
      this it shouldn't be too hard to add.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca26893f
    • Vitaly Kuznetsov's avatar
      xen-netfront: avoid packet loss when ethernet header crosses page boundary · fd07160b
      Vitaly Kuznetsov authored
      Small packet loss is reported on complex multi host network configurations
      including tunnels, NAT, ... My investigation led me to the following check
      in netback which drops packets:
      
              if (unlikely(txreq.size < ETH_HLEN)) {
                      netdev_err(queue->vif->dev,
                                 "Bad packet size: %d\n", txreq.size);
                      xenvif_tx_err(queue, &txreq, extra_count, idx);
                      break;
              }
      
      But this check itself is legitimate. SKBs consist of a linear part (which
      has to have the ethernet header) and (optionally) a number of frags.
      Netfront transmits the head of the linear part up to the page boundary
      as the first request and all the rest becomes frags so when we're
      reconstructing the SKB in netback we can't distinguish between original
      frags and the 'tail' of the linear part. The first SKB needs to be at
      least ETH_HLEN size. So in case we have an SKB with its linear part
      starting too close to the page boundary the packet is lost.
      
      I see two ways to fix the issue:
      - Change the 'wire' protocol between netfront and netback to start keeping
        the original SKB structure. We'll have to add a flag indicating the fact
        that the particular request is a part of the original linear part and not
        a frag. We'll need to know the length of the linear part to pre-allocate
        memory.
      - Avoid transmitting SKBs with linear parts starting too close to the page
        boundary. That seems preferable short-term and shouldn't bring
        significant performance degradation as such packets are rare. That's what
        this patch is trying to achieve with skb_copy().
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd07160b
    • Raju Lakkaraju's avatar
      net: phy: Add MAC-IF driver for Microsemi PHYs. · 1a21101d
      Raju Lakkaraju authored
      All the review comments updated and resending for review.
      
      This is MAC interface feature.
      Microsemi PHY can support RGMII, RMII or GMII/MII interface between MAC and PHY.
      MAC-IF function program the right value based on Device tree configuration.
      
      Tested on Beaglebone Black with VSC 8531 PHY.
      Signed-off-by: default avatarRaju Lakkaraju <Raju.Lakkaraju@microsemi.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a21101d
    • Ido Schimmel's avatar
      mlxsw: spectrum: Fix sparse warnings · 1a9234e6
      Ido Schimmel authored
      drivers/net/ethernet/mellanox/mlxsw//spectrum.c:251:28: warning: symbol
      'mlxsw_sp_span_entry_find' was not declared. Should it be static?
      drivers/net/ethernet/mellanox/mlxsw//spectrum.c:265:28: warning: symbol
      'mlxsw_sp_span_entry_get' was not declared. Should it be static?
      drivers/net/ethernet/mellanox/mlxsw//spectrum.c:367:56: warning: mixing
      different enum types
      drivers/net/ethernet/mellanox/mlxsw//spectrum.c:367:56:     int enum
      mlxsw_sp_span_type  versus
      drivers/net/ethernet/mellanox/mlxsw//spectrum.c:367:56:     int enum
      mlxsw_reg_mpar_i_e
      ...
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:598:32: warning:
      mixing different enum types
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:598:32:     int
      enum mlxsw_reg_sbxx_dir  versus
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:598:32:     int
      enum devlink_sb_pool_type
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:600:39: warning:
      mixing different enum types
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:600:39:     int
      enum mlxsw_reg_sbpr_mode  versus
      drivers/net/ethernet/mellanox/mlxsw//spectrum_buffers.c:600:39:     int
      enum devlink_sb_threshold_type
      ...
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:255:54: warning:
      mixing different enum types
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:255:54:     int
      enum mlxsw_sp_l3proto  versus
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:255:54:     int
      enum mlxsw_reg_ralxx_protocol
      ...
      drivers/net/ethernet/mellanox/mlxsw//spectrum_router.c:1749:6: warning:
      symbol 'mlxsw_sp_fib_entry_put' was not declared. Should it be static?
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a9234e6
    • Elad Raz's avatar
      mlxsw: Change the RX LAG hash function from XOR to CRC · 18c2d2c1
      Elad Raz authored
      Change the RX hash function from XOR to CRC in order to have better
      distribution of the traffic.
      Signed-off-by: default avatarElad Raz <eladr@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18c2d2c1