1. 05 Apr, 2016 17 commits
    • Eric Dumazet's avatar
      udp: no longer use SLAB_DESTROY_BY_RCU · ca065d0c
      Eric Dumazet authored
      Tom Herbert would like not touching UDP socket refcnt for encapsulated
      traffic. For this to happen, we need to use normal RCU rules, with a grace
      period before freeing a socket. UDP sockets are not short lived in the
      high usage case, so the added cost of call_rcu() should not be a concern.
      
      This actually removes a lot of complexity in UDP stack.
      
      Multicast receives no longer need to hold a bucket spinlock.
      
      Note that ip early demux still needs to take a reference on the socket.
      
      Same remark for functions used by xt_socket and xt_PROXY netfilter modules,
      but this might be changed later.
      
      Performance for a single UDP socket receiving flood traffic from
      many RX queues/cpus.
      
      Simple udp_rx using simple recvfrom() loop :
      438 kpps instead of 374 kpps : 17 % increase of the peak rate.
      
      v2: Addressed Willem de Bruijn feedback in multicast handling
       - keep early demux break in __udp4_lib_demux_lookup()
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Tested-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca065d0c
    • Eric Dumazet's avatar
      net: add SOCK_RCU_FREE socket flag · a4298e45
      Eric Dumazet authored
      We want a generic way to insert an RCU grace period before socket
      freeing for cases where RCU_SLAB_DESTROY_BY_RCU is adding too
      much overhead.
      
      SLAB_DESTROY_BY_RCU strict rules force us to take a reference
      on the socket sk_refcnt, and it is a performance problem for UDP
      encapsulation, or TCP synflood behavior, as many CPUs might
      attempt the atomic operations on a shared sk_refcnt
      
      UDP sockets and TCP listeners can set SOCK_RCU_FREE so that their
      lookup can use traditional RCU rules, without refcount changes.
      They can set the flag only once hashed and visible by other cpus.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Tested-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4298e45
    • David S. Miller's avatar
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 43e2dfb2
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      10GbE Intel Wired LAN Driver Updates 2016-04-04
      
      This series contains updates to ixgbe and ixgbevf.
      
      Pavel Tikhomirov fixes a typo where we were incrementing transmit stats
      instead of receive stats on the receive side.
      
      Emil updates the ixgbevf driver to use bit operations for setting and
      checking the adapter state.
      
      Chas Williams adds the new NDO trust feature check so that the VF guest
      has the ability to set the unicast address of the interface, if it is a
      trusted VF.
      
      Alex cleans up the driver to that the only time we add a PF entry to the
      VLVF is either for VLAN 0 or if the PF has requested a VLAN that a VF
      is already using.  Also adds support for generic transmit checksums,
      giving the added advantage is that we can support inner checksum offloads
      for tunnels and MPLS while still being able to transparently insert
      VLAN tags.  Lastly, changed ixgbe so that we can use the ethtool
      rx-vlan-filter flag to toggle receive VLAN filtering on and off.
      
      Mark cleans up the ixgbe driver by making all op structures that do not
      change constants.  Also fixed flow control for Xeon D KR backplanes, since
      we cannot use auto-negotiation to determine the mode, we have to use
      whatever the user configured.
      
      Sowmini Varadhan updates ixgbe to use eth_platform_get_mac_address()
      instead of the arch specific solution that was added by a previous
      commit.
      
      Don fixed an issue where it was possible that a system reset could occur
      when we were holding the SWFW semaphore lock, which the next time the
      driver loaded would see it incorrectly as locked.
      
      v2: updated patch 8 of the series to include a minor flags issue where
          we had lost NETIF_F_HW_TC and we were setting NETIF_F_SCTP_CRC in
          two different areas, when we only needed/wanted it in one spot.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43e2dfb2
    • David S. Miller's avatar
      Merge branch 'mv88e6131-hw-bridging-6185' · 6e338048
      David S. Miller authored
      Vivien Didelot says:
      
      ====================
      net: dsa: mv88e6131: HW bridging support for 6185
      
      All packets passing through a switch of the 6185 family are currently all
      directed to the CPU port. This means that port bridging is software driven.
      
      To enable hardware bridging for this switch family, we need to implement the
      port mapping operations, the FDB operations, and optionally the VLAN operations
      (for 802.1Q and VLAN filtering aware systems).
      
      However this family only has 256 FDBs indexed by 8-bit identifiers, opposed to
      4096 FDBs with 12-bit identifiers for other families such as 6352. It also
      doesn't have dedicated FID registers for ATU and VTU operations.
      
      This patchset fixes these differences, and enable hardware bridging for 6185.
      
      Changes v1 -> v2:
       - Describe the different numbers of databases and prefer a feature-based logic
         over the current ID/family-based logic.
      ====================
      Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e338048
    • Vivien Didelot's avatar
      net: dsa: mv88e6131: enable hardware bridging · 26892ffc
      Vivien Didelot authored
      By adding support for bridge operations, FDB operations, and optionally
      VLAN operations (for 802.1Q and VLAN filtering aware systems), the
      switch bridges ports correctly, the CPU is able to populate the hardware
      address databases, and thus hardware bridging becomes functional within
      the 88E6185 family of switches.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26892ffc
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: map destination addresses for 6185 · f93dd042
      Vivien Didelot authored
      The 88E6185 switch also has a MapDA bit in its Port Control 2 register.
      When this bit is cleared, all frames are sent out to the CPU port.
      
      Set this bit to rely on address databases (ATU) hits and direct frames
      out of the correct ports, and thus allow hardware bridging.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f93dd042
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: support 256 databases · 11ea809f
      Vivien Didelot authored
      The 6185 family of devices has only 256 address databases. Their 8-bit
      FID for ATU and VTU operations are split into ATU Control and ATU/VTU
      Operation registers.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11ea809f
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: variable number of databases · f74df0be
      Vivien Didelot authored
      Marvell switch chips have different number of address databases.
      
      The code currently only supports models with 4096 databases. Such switch
      has dedicated FID registers for ATU and VTU operations. Models with
      fewer databases have their FID split in several registers.
      
      List them all but only support models with 4096 databases at the moment.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f74df0be
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: protect FID registers access · b426e5f7
      Vivien Didelot authored
      Only switch families with 4096 address databases have dedicated FID
      registers for ATU and VTU operations.
      
      Factorize the access to the GLOBAL_ATU_FID register and introduce a
      mv88e6xxx_has_fid_reg() helper function to protect the access to
      GLOBAL_ATU_FID and GLOBAL_VTU_FID.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b426e5f7
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: protect SID register access · 2e7bd5ef
      Vivien Didelot authored
      Introduce a mv88e6xxx_has_stu() helper to protect the access to the
      GLOBAL_VTU_SID register, instead of checking switch families.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e7bd5ef
    • Alexander Duyck's avatar
      ixgbe: Add support for toggling VLAN filtering flag via ethtool · 0c5a6166
      Alexander Duyck authored
      This change makes it so that we can use the ethtool rx-vlan-filter flag to
      toggle Rx VLAN filtering on and off.  This is basically just an extension
      of the existing VLAN promisc work in that it just adds support for the
      additional ethtool flag.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0c5a6166
    • Amritha Nambiar's avatar
      ixgbe: Extend cls_u32 offload to support UDP headers · 4ae78342
      Amritha Nambiar authored
      Added support to match on UDP fields in the transport layer.
      Extended core logic to support multiple headers.
      
      Verified with the following filters :
      
      	handle 1: u32 divisor 1
      	u32 ht 800: order 1 link 1: \
      	offset at 0 mask 0f00 shift 6 plus 0 eat match ip protocol 6 ff
      	u32 ht 1: order 2 \
      	match tcp src 1024 ffff match tcp dst 23 ffff action drop
      	handle 2: u32 divisor 1
      	u32 ht 800: order 3 link 2: \
      	offset at 0 mask 0f00 shift 6 plus 0 eat match ip protocol 17 ff
      	u32 ht 2: order 4 \
      	match udp src 1025 ffff match udp dst 24 ffff action drop
      Signed-off-by: default avatarAmritha Nambiar <amritha.nambiar@intel.com>
      Acked-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Acked-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4ae78342
    • Don Skidmore's avatar
      ixgbe: Place SWFW semaphore in known valid state at probe · dbd15b8f
      Don Skidmore authored
      It is possible on some HW that a system reset could occur when we are
      holding the SWFW semaphore lock.  So next time the driver was loaded we
      would see it incorrectly as locked. This patch will recover from that state
      by: Attempting to acquire the semaphore and then regardless of whether or
      not it was acquire we immediately release it. This will force us into
      a known good state.
      Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      dbd15b8f
    • Rostislav Pehlivanov's avatar
      ixgbe: add a callback to set the maximum transmit bitrate · c04f90e5
      Rostislav Pehlivanov authored
      This commit adds a callback which allows to adjust the maximum transmit
      bitrate the card can output. This makes it possible to get a smooth
      traffic instead of the default burst-y behaviour when trying to output
      e.g. a video stream.
      
      Much of the logic needed to get a correct bcnrc_val was taken from the
      ixgbe_set_vf_rate_limit() function.
      Signed-off-by: default avatarRostislav Pehlivanov <atomnuker@gmail.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c04f90e5
    • Mark Rustad's avatar
      ixgbe: Fix flow control for Xeon D KR backplane · afdc71e4
      Mark Rustad authored
      Xeon D KR backplane is different from other backplanes,
      in that we can't use auto-negotiation to determine the
      mode. Instead, use whatever the user configured.
      Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
      Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      afdc71e4
    • Alexander Duyck's avatar
      ixgbevf: Add support for generic Tx checksums · cb2b3edb
      Alexander Duyck authored
      This patch adds support for generic Tx checksums to the ixgbevf driver.  It
      turns out this is actually pretty easy after going over the datasheet as we
      were doing a number of steps we didn't need to.
      
      In order to perform a Tx checksum for an L4 header we need to fill in the
      following fields in the Tx descriptor:
        MACLEN (maximum of 127), retrieved from:
      		skb_network_offset()
        IPLEN  (maximum of 511), retrieved from:
      		skb_checksum_start_offset() - skb_network_offset()
        TUCMD.L4T indicates offset and if checksum or crc32c, based on:
      		skb->csum_offset
      
      The added advantage to doing this is that we can support inner checksum
      offloads for tunnels and MPLS while still being able to transparently
      insert VLAN tags.
      
      I also took the opportunity to clean-up many of the feature flag
      configuration bits to make them a bit more consistent between drivers.  In
      the case of the VF drivers this meant adding support for SCTP CRCs, and
      inner checksum offloads for MPLS and various tunnel types.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      cb2b3edb
    • Alexander Duyck's avatar
      ixgbe: Add support for generic Tx checksums · 49763de0
      Alexander Duyck authored
      This patch adds support for generic Tx checksums to the ixgbe driver.  It
      turns out this is actually pretty easy after going over the datasheet as we
      were doing a number of steps we didn't need to.
      
      In order to perform a Tx checksum for an L4 header we need to fill in the
      following fields in the Tx descriptor:
        MACLEN (maximum of 127), retrieved from:
      		skb_network_offset()
        IPLEN  (maximum of 511), retrieved from:
      		skb_checksum_start_offset() - skb_network_offset()
        TUCMD.L4T indicates offset and if checksum or crc32c, based on:
      		skb->csum_offset
      
      The added advantage to doing this is that we can support inner checksum
      offloads for tunnels and MPLS while still being able to transparently
      insert VLAN tags.
      
      I also took the opportunity to clean-up many of the feature flag
      configuration bits to make them a bit more consistent between drivers.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      49763de0
  2. 04 Apr, 2016 23 commits