1. 18 Jun, 2016 23 commits
    • David S. Miller's avatar
      Merge branch 'vrf-next' · 8c0c07a3
      David S. Miller authored
      David Ahern says:
      
      ====================
      net: vrf: Fix ipv6 source address selection
      
      IPv6 address selection is currently messed up for several use cases such
      as unnumbered deployments with global addresses on the VRF device and none
      on the enslaved devices.
      
      Update the source address selection to consider the real output route as
      opposed to the VRF route that sends packets to the VRF device first (ie.,
      implement get_saddr6 similar to the IPv4 method) and update the IPv6
      address selection to consider L3 domains and preference for addresses on
      the VRF device).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c0c07a3
    • David Ahern's avatar
      net: ipv6: Address selection needs to consider L3 domains · afbac601
      David Ahern authored
      IPv6 version of 3f2fb9a8 ("net: l3mdev: address selection should only
      consider devices in L3 domain") and the follow up commit, a17b693cdd876
      ("net: l3mdev: prefer VRF master for source address selection").
      
      That is, if outbound device is given then the address preference order
      is an address from that device, an address from the master device if it
      is enslaved, and then an address from a device in the same L3 domain.
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afbac601
    • David Ahern's avatar
      net: vrf: Implement get_saddr for IPv6 · 0d240e78
      David Ahern authored
      IPv6 source address selection needs to consider the real egress route.
      Similar to IPv4 implement a get_saddr6 method which is called if
      source address has not been set.  The get_saddr6 method does a full
      lookup which means pulling a route from the VRF FIB table and properly
      considering linklocal/multicast destination addresses. Lookup failures
      (eg., unreachable) then cause the source address selection to fail
      which gets propagated back to the caller.
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d240e78
    • David Ahern's avatar
      net: ipv6: Move ip6_route_get_saddr to inline · a2e2ff56
      David Ahern authored
      VRF driver needs access to ip6_route_get_saddr code. Since it does
      little beyond ipv6_dev_get_saddr and ipv6_dev_get_saddr is already
      exported for modules move ip6_route_get_saddr to the header as an
      inline.
      
      Code move only; no functional change.
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2e2ff56
    • Sudip Mukherjee's avatar
      net: lantiq_etop: remove unused variable · 0023a061
      Sudip Mukherjee authored
      The variable i was declared but was never used and we were getting a
      build warning for that.
      Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0023a061
    • David S. Miller's avatar
      Merge branch 'tunnel-offload-future-proof' · 832dfd1f
      David S. Miller authored
      Alexander Duyck says:
      
      ====================
      Future-proof tunnel offload handlers
      
      These patches are meant to address two things.  First we are currently
      using the ndo_add/del_vxlan_port calls with VXLAN-GPE tunnels and we
      cannot really support that as it is likely to cause more harm than
      good since VXLAN-GPE can support tunnels without a MAC address on the
      inner header.
      
      As such we need to add a new offload to advertise this, but in doing so it
      would mean introducing 3 new functions for the driver to request the ports,
      and then for the tunnel to push the changes to add and delete the ports to
      the device.  However instead of taking that approach I think it would be
      much better if we just made one common function for fetching the ports, and
      provided a generic means to push the tunnels to the device.  So in order to
      make this work this patch set does several things.
      
      First it merges the existing VXLAN and GENEVE functionality into one set of
      functions and passes an enum in order to specify the type of tunnel we want
      to offload.  By doing this we only have to extend this enum in the future
      if we want to add additional types.
      
      Second it goes through the drivers replacing all of the tunnel specific
      offload calls with implementations that support the generic calls so that
      we can drop the VXLAN and GENEVE specific calls entirely.
      
      Finally I go through in the last patch and replace the VXLAN specific
      offload request that was being used for VXLAN-GPE with one that specifies
      if we want to offload VXLAN or VXLAN-GPE so that the hardware can decide if
      it can actually support it or not.
      
      I also ended up with some minor clean-up built into the driver patches for
      this.  Most of it is to either fix misuse of build flags, specifying a type
      to ignore instead of the type that should be used, or in the case of ixgbe
      I actually moved a rtnl_lock/unlock in order to avoid taking it unless it
      was actually needed.
      
      v2:
      I did my best to remove the word "offload" from any of the calls or
      notifiers as this isn't really an offload.  It
       is a workaround for the fact that the drivers don't provide basic features
      like CHECKSUM_COMPLETE.  I also added a disclaimer to the section defining
      the function prototypes explaining that these are essentially workarounds.
      
      I ended up going through and stripping all of the VXLAN and GENEVE build
      flags from the drivers.  There isn't much point in carrying them.  In
      addition I dropped the use of the vxlan.h or geneve.h header files in favor
      of udp_tunnel.h in the cases where a driver didn't need anything from
      either of those headers.
      
      I updated the tunnel add/del functions so that they pass a udp_tunnel_info
      structure instead of a list of arguments.  This way we should be able to
      add additional information in the future with little impact on the other
      drivers.
      
      I updated bnxt so that it doesn't use a hard-coded port number for GENEVE.
      
      I have been able to test mlx4e, mlx5e, and i40e and verified functionality
      on these drivers.  Though there are patches for the net tree I submitted
      due to unrelated bugs I found in the mlx4e and i40e/i40evf drivers.
      
      v3:
      Fixed a typo that caused us to add geneve port when we should have been
      deleting it.
      
      Ended up dropping geneve and vxlan wrappers for
      udp_tunnel_notify_rx_add/del_port and instead just called them directly.
      
      Updated comments for functions to call out RTNL instead of port lock.
      
      Updated patch description to remove changes that were moved into a second
      patch.
      
      Rebased on latest net-next to fix merge conflict on bnxt driver.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      832dfd1f
    • Alexander Duyck's avatar
      vxlan: Add new UDP encapsulation offload type for VXLAN-GPE · b9adcd69
      Alexander Duyck authored
      The fact is VXLAN with Generic Protocol Extensions cannot be supported by
      the same hardware parsers that support VXLAN.  The protocol extensions
      allow for things like a Next Protocol field which in turn allows for things
      other than Ethernet to be passed over the tunnel.  Most existing parsers
      will not know how to interpret this.
      
      To resolve this I am giving VXLAN-GPE its own UDP encapsulation offload
      type.  This way hardware that does support GPE can simply add this type to
      the switch statement for VXLAN, and if they don't support it then this will
      fix any issues where headers might be interpreted incorrectly.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9adcd69
    • Alexander Duyck's avatar
      net: Remove deprecated tunnel specific UDP offload functions · 1938ee1f
      Alexander Duyck authored
      Now that we have all the drivers using udp_tunnel_get_rx_ports,
      ndo_add_udp_enc_rx_port, and ndo_del_udp_enc_rx_port we can drop the
      function calls that were specific to VXLAN and GENEVE.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1938ee1f
    • Alexander Duyck's avatar
      qlcnic: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 5e44f8e2
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type is VXLAN we can maintain the same
      functionality.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e44f8e2
    • Alexander Duyck's avatar
      qede: Move all UDP port notifiers to single function · f9f082a9
      Alexander Duyck authored
      This patch goes through and combines the notifiers for VXLAN and GENEVE
      into a single function for each action.  So there is now one combined
      function for getting ports, one for adding the ports, and one for deleting
      the ports.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9f082a9
    • Alexander Duyck's avatar
      nfp: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 3ab68837
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type is VXLAN we can maintain the same
      functionality.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ab68837
    • Alexander Duyck's avatar
      mlx5_en: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 974c3f30
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type is VXLAN we can maintain the same
      functionality.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      974c3f30
    • Alexander Duyck's avatar
      mlx4_en: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · a831274a
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type is VXLAN we can maintain the same
      functionality.
      
      In addition I updated the socket address family check so that instead of
      excluding IPv6 we instead abort of type is not IPv4.  This makes much more
      sense as we should only be supporting IPv4 outer addresses on this
      hardware.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a831274a
    • Alexander Duyck's avatar
      ixgbe: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · b3a49557
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type is VXLAN we can maintain the same
      functionality.
      
      In addition I updated the socket address family check so that instead of
      excluding IPv6 we instead abort of type is not IPv4.  This makes much more
      sense as we should only be supporting IPv4 outer addresses on this
      hardware.
      
      The last change is that I pulled the rtnl_lock/unlock into the conditional
      statement for IXGBE_FLAG2_VXLAN_REREG_NEEDED.  The motivation behind this
      is to avoid unneeded bouncing of the mutex which will just slow down the
      handling of this call anyway.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3a49557
    • Alexander Duyck's avatar
      i40e: Move all UDP port notifiers to single function · 06a5f7f1
      Alexander Duyck authored
      This patch goes through and combines the notifiers for VXLAN and GENEVE
      into a single function for each action.  So there is now one combined
      function for getting ports, one for adding the ports, and one for deleting
      the ports.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06a5f7f1
    • Alexander Duyck's avatar
      fm10k: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · f174cdbe
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type if VXLAN we can maintain the same
      functionality.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f174cdbe
    • Alexander Duyck's avatar
      benet: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · bde6b7cd
      Alexander Duyck authored
      This change replaces the network device operations for adding or removing a
      VXLAN port with operations that are more generically defined to be used for
      any UDP offload port but provide a type.  As such by just adding a line to
      verify that the offload type if VXLAN we can maintain the same
      functionality.
      
      I have also gone though and removed the BE2NET_VXLAN config option since it
      no longer relies on the VXLAN code anyway.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bde6b7cd
    • Alexander Duyck's avatar
      bnxt: Move GENEVE support from hard-coded port to using port notifier · 7cdd5fc3
      Alexander Duyck authored
      The port number for GENEVE is hard coded into the bnxt driver.  This is the
      kind of thing we want to avoid going forward.  For now I will integrate
      this back into the port notifier so that we can change the GENEVE port
      number if we need to in the future.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7cdd5fc3
    • Alexander Duyck's avatar
      bnxt: Update drivers to support unified UDP encapsulation offload functions · ad51b8e9
      Alexander Duyck authored
      This patch ends up doing several things.  First it updates the driver to
      make use of the new unified UDP tunnel offload notifier functions.  In
      addition I updated the code so that we can work around the bits that were
      checking for if VXLAN was enabled since we are now using a notifier based
      setup.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad51b8e9
    • Alexander Duyck's avatar
      bnx2x: Move all UDP port notifiers to single function · 6b352912
      Alexander Duyck authored
      This patch goes through and combines the notifiers for VXLAN and GENEVE
      into a single function for each action.  So there is now one combined
      function for getting ports, one for adding the ports, and one for deleting
      the ports.
      
      I also went through and dropped the BNX2X VXLAN and GENEVE specific build
      flags.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b352912
    • Alexander Duyck's avatar
      net: Merge VXLAN and GENEVE push notifiers into a single notifier · 7c46a640
      Alexander Duyck authored
      This patch merges the notifiers for VXLAN and GENEVE into a single UDP
      tunnel notifier.  The idea is that we will want to only have to make one
      notifier call to receive the list of ports for VXLAN and GENEVE tunnels
      that need to be offloaded.
      
      In addition we add a new set of ndo functions named ndo_udp_tunnel_add and
      ndo_udp_tunnel_del that are meant to allow us to track the tunnel meta-data
      such as port and address family as tunnels are added and removed.  The
      tunnel meta-data is now transported in a structure named udp_tunnel_info
      which for now carries the type, address family, and port number.  In the
      future this could be updated so that we can include a tuple of values
      including things such as the destination IP address and other fields.
      
      I also ended up going with a naming scheme that consisted of using the
      prefix udp_tunnel on function names.  I applied this to the notifier and
      ndo ops as well so that it hopefully points to the fact that these are
      primarily used in the udp_tunnel functions.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c46a640
    • Alexander Duyck's avatar
      net: Combine GENEVE and VXLAN port notifiers into single functions · e7b3db5e
      Alexander Duyck authored
      This patch merges the GENEVE and VXLAN code so that both functions pass
      through a shared code path.  This way we can start the effort of using a
      single function on the network device drivers to handle both of these
      tunnel types.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7b3db5e
    • Alexander Duyck's avatar
      vxlan/geneve: Include udp_tunnel.h in vxlan/geneve.h and fixup includes · 86a98057
      Alexander Duyck authored
      This patch makes it so that we add udp_tunnel.h to vxlan.h and geneve.h
      header files.  This is useful as I plan to move the generic handlers for
      the port offloads into the udp_tunnel header file and leave the vxlan and
      geneve headers to be a bit more protocol specific.
      
      I also went through and cleaned out a number of redundant includes that
      where in the .h and .c files for these drivers.
      Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86a98057
  2. 17 Jun, 2016 17 commits
    • Daniel Borkmann's avatar
      net, cls: also reject deleting all filters when TCA_KIND present · 9f6ed032
      Daniel Borkmann authored
      When we check for RTM_DELTFILTER, we should also reject the request
      for deleting all filters under a given parent when TCA_KIND attribute
      is present. If present, it's currently just ignored but there's also
      no point to let it pass in the first place either since this doesn't
      have any meaning with wild-card removal.
      
      Fixes: ea7f8277 ("net, cls: allow for deleting all filters for given parent")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f6ed032
    • David S. Miller's avatar
      Merge branch 'vmxnet3-upgrade-to-version3' · 5b706e5c
      David S. Miller authored
      Shrikrishna Khare says:
      
      ====================
      vmxnet3: upgrade to version 3
      
      vmxnet3 emulation has recently added several new features which includes
      support for new commands the driver can issue to emulation, change in
      descriptor fields etc. This patch series extends the vmxnet3 driver to
      leverage these new features.
      
      Compatibility is maintained using existing vmxnet3 versioning mechanism as
      follows:
       - new features added to vmxnet3 emulation are associated with new vmxnet3
         version viz. vmxnet3 version 3.
       - emulation advertises all the versions it supports to the driver.
       - during initialization, vmxnet3 driver picks the highest version number
       supported by both the emulation and the driver and configures emulation
       to run at that version.
      
      In particular, following changes are introduced:
      
      Patch 1:
        Some command definitions from previous vmxnet3 versions are
        missing. This patch adds those definitions before moving to vmxnet3
        version 3. It also fixes copyright info and maintained by.
      
      Patch 2:
        This patch introduces generalized command interface which allows
        for easily adding new commands that vmxnet3 driver can issue to the
        emulation. Further patches in this series make use of this facility.
      
      Patch 3:
        Transmit data ring buffer is used to copy packet headers or small
        packets. It is a fixed size buffer. This patch extends the driver to
        allow variable sized transmit data ring buffer.
      
      Patch 4:
        This patch introduces receive data ring buffer - a set of small sized
        buffers that are always mapped by the emulation. This avoids memory
        mapping/unmapping overhead for small packets.
      
      Patch 5:
        The vmxnet3 emulation supports a variety of coalescing modes. This patch
        extends vmxnet3 driver to allow querying and configuring these modes.
      
      Patch 6:
        In vmxnet3 version 3, the emulation added support for the vmxnet3 driver
        to communicate information about the memory regions the driver will use
        for rx/tx buffers. This patch exposes related commands to the driver.
      
      Patch 7:
        With all vmxnet3 version 3 changes incorporated in the vmxnet3 driver,
        with this patch, the driver can configure emulation to run at vmxnet3
        version 3.
      
      Changes in v2:
       - v1 patch used special values of rx-usecs to differentiate between
       coalescing modes. v2 uses relevant fields in struct ethtool_coalesce
       to choose modes. Also, a new command VMXNET3_CMD_GET_COALESCE
       is introduced which allows driver to query the device for default
       coalescing configuration.
      
      Changes in v3:
       - fix subject line to use vmxnet3: instead of Driver:Vmxnet3
       - resubmit when net-next is open
      
      Changes in v4:
       - Address code review comments by Ben Hutchings: remove unnecessary memset
         from vmxnet3_get_coalesce.
      
      Changes in v5:
       - Updated all the patches to add detailed commit messages.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b706e5c
    • Shrikrishna Khare's avatar
      vmxnet3: update to version 3 · 6af9d787
      Shrikrishna Khare authored
      With all vmxnet3 version 3 changes incorporated in the vmxnet3 driver,
      the driver can configure emulation to run at vmxnet3 version 3, provided
      the emulation advertises support for version 3.
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6af9d787
    • Shrikrishna Khare's avatar
      vmxnet3: introduce command to register memory region · 47443222
      Shrikrishna Khare authored
      In vmxnet3 version 3, the emulation added support for the vmxnet3 driver
      to communicate information about the memory regions the driver will use
      for rx/tx buffers. The driver can also indicate which rx/tx queue the
      memory region is applicable for. If this information is communicated
      to the emulation, the emulation will always keep these memory regions
      mapped, thereby avoiding the mapping/unmapping overhead for every packet.
      
      Currently, Linux vmxnet3 driver does not leverage this capability. The
      feasibility of using this approach for the Linux vmxnet3 driver will be
      investigated independently and if possible, will be part of a different
      patch. This patch only exposes the emulation capability to the driver
      (vmxnet3_defs.h is identical between the driver and the emulation).
      Signed-off-by: default avatarGuolin Yang <gyang@vmware.com>
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47443222
    • Shrikrishna Khare's avatar
      vmxnet3: add support for get_coalesce, set_coalesce ethtool operations · 4edef40e
      Shrikrishna Khare authored
      The emulation supports a variety of coalescing modes viz. disabled
      (no coalescing), adaptive, static (number of packets to batch before
      raising an interrupt), rate based (number of interrupts per second).
      
      This patch implements get_coalesce and set_coalesce methods to allow
      querying and configuring different coalescing modes.
      Signed-off-by: default avatarKeyong Sun <sunk@vmware.com>
      Signed-off-by: default avatarManoj Tammali <tammalim@vmware.com>
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4edef40e
    • Shrikrishna Khare's avatar
      vmxnet3: add receive data ring support · 50a5ce3e
      Shrikrishna Khare authored
      vmxnet3 driver preallocates buffers for receiving packets and posts the
      buffers to the emulation. In order to deliver a received packet to the
      guest, the emulation must map buffer(s) and copy the packet into it.
      
      To avoid this memory mapping overhead, this patch introduces the receive
      data ring - a set of small sized buffers that are always mapped by
      the emulation. If a packet fits into the receive data ring buffer, the
      emulation delivers the packet via the receive data ring (which must be
      copied by the guest driver), or else the usual receive path is used.
      
      Receive Data Ring buffer length is configurable via ethtool -G ethX rx-mini
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50a5ce3e
    • Shrikrishna Khare's avatar
      vmxnet3: allow variable length transmit data ring buffer · 3c8b3efc
      Shrikrishna Khare authored
      vmxnet3 driver supports transmit data ring viz. a set of fixed size
      buffers used by the driver to copy packet headers. Small packets that
      fit these buffers are copied into these buffers entirely.
      
      Currently this buffer size of fixed at 128 bytes. This patch extends
      transmit data ring implementation to allow variable length transmit
      data ring buffers. The length of the buffer is read from the emulation
      during initialization.
      Signed-off-by: default avatarSriram Rangarajan <rangarajans@vmware.com>
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c8b3efc
    • Shrikrishna Khare's avatar
      vmxnet3: introduce generalized command interface to configure the device · f35c7480
      Shrikrishna Khare authored
      Shared memory is used to exchange information between the vmxnet3 driver
      and the emulation. In order to request emulation to perform a task, the
      driver first populates specific fields in this shared memory and then
      issues corresponding command by writing to the command register(CMD). The
      layout of the shared memory was defined by vmxnet3 version 1 and cannot
      be extended for every new command without breaking backward compatibility.
      
      To address this problem, in vmxnet3 version 3, the emulation repurposed
      a reserved field in the shared memory to represent command information
      instead. For new commands, the driver first populates the command
      information field in the shared memory and then issues the command. The
      emulation interprets the data written to the command information depending
      on the type of the command. This patch exposes this capability to the driver.
      Signed-off-by: default avatarGuolin Yang <gyang@vmware.com>
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f35c7480
    • Shrikrishna Khare's avatar
      vmxnet3: prepare for version 3 changes · 190af10f
      Shrikrishna Khare authored
      vmxnet3 is currently at version 2, but some command definitions from
      previous vmxnet3 versions are missing. Add those definitions before
      moving to version 3.
      
      Also, introduce utility macros for vmxnet3 version comparison and update
      Copyright information and Maintained by.
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      190af10f
    • David S. Miller's avatar
      Merge branch 'qeth-next' · a264d830
      David S. Miller authored
      Ursula Braun says:
      
      ====================
      s390: qeth patches
      
      here are patches for the s390 qeth driver for net-next:
      
      Patch 01 is a minor improvement for the bridgeport code in qeth.
      
      Patches 02-07 take care about scatter/gather handling in qeth.
      
      Patch 08 improves handling of multicast IP addresses in the qeth layer3
      discipline.
      
      Patches 09-11 improve netdev features related functions in qeth.
      
      Patch 12 implements an outbound queue restriction for HiperSockets.
      
      Patch 13 fixes a wrong indentation in qeth_l3_main.c causing a warning
      with gcc-6.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a264d830
    • Sebastian Ott's avatar
      s390/qeth: fix indentation in qeth_l3_arp_query · 77a83ed1
      Sebastian Ott authored
      gcc-6 warns about obviously wrong indentation:
      drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_arp_query':
      drivers/s390/net/qeth_l3_main.c:2315:3: warning: this 'if' clause does not
      guard... [-Wmisleading-indentation]
         if (copy_to_user(udata, qinfo.udata, 4))
         ^~
      drivers/s390/net/qeth_l3_main.c:2317:4: note: ...this statement, but the
      latter is misleadingly indented as if it is guarded by the 'if'
          goto free_and_out;
          ^~~~
      
      Although this particular case is harmless, fix the indentation to get rid
      of that warning and improve readability.
      Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77a83ed1
    • Hans Wippel's avatar
      qeth: omit outbound queue 3 for unicast packets in Priority Queuing on HiperSockets · 70deb016
      Hans Wippel authored
      On HiperSockets only outbound queues 0 to 2 are available for unicast
      packets. Current Priority Queuing implementation in the qeth driver puts
      outgoing packets in outbound queues 0 to 3.
      
      This puts outgoing unicast packets into outbound queue 2 instead of
      outbound queue 3 when using Priority Queuing on a HiperSocket.
      Additionally, the default outbound queue cannot be set to outbound queue 3
      on HiperSockets.
      Signed-off-by: default avatarHans Wippel <hwippel@linux.vnet.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70deb016
    • Hans Wippel's avatar
      qeth: improve set_features error handling · 6c7cd712
      Hans Wippel authored
      The function set_features is called to configure network device features
      on the hardware. If errors occur, the network device features should
      reflect the changed hardware state and the function should return an
      error in order to notify the user.
      
      In case of an error, the current implementation does not necessarily
      save the changed hardware state in the network device features before an
      error is returned.
      
      This patch improves error handling by saving features, that could be
      changed, to the network device features before returning an error. If
      the device is not running, an additional check in fix_features removes
      features, that require hardware changes, before they are passed to
      set_features. Thus, the corresponding check was removed in set_features.
      Signed-off-by: default avatarHans Wippel <hwippel@linux.vnet.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c7cd712
    • Hans Wippel's avatar
      qeth: add network device features for VLAN devices · 9bdc4411
      Hans Wippel authored
      Network device features indicate the capabilities of network devices (e.g.,
      TX checksum offloading and TSO) and their configuration state. Additional
      network device features (vlan_features) indicate for each network device,
      which capabilities can be used on VLAN devices, that are configured on the
      respective base network device.
      
      In the current qeth implementation, network device features are only set
      for the base network devices and not for the VLAN devices. Thus, features
      like TX checksum offloading cannot be used on VLAN devices.
      
      This patch adds network device features to vlan_features, so they can be
      used by VLAN devices.
      Signed-off-by: default avatarHans Wippel <hwippel@linux.vnet.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9bdc4411
    • Thomas Richter's avatar
      qeth layer 2 and layer 3 common feature handling · 8f43fb00
      Thomas Richter authored
      This patch introduces a common set of fix_features and set_features
      functions for layer 2 and layer 3. The RX, TX and TSO offload
      functionality on the OSA card is enabled using ethtool at user's
      request and not at device initialization as done before.
      
      For layer 3 the RX checksum offloading is disabled at device
      initialization time.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f43fb00
    • Lakhvich Dmitriy's avatar
      qeth: optimize IP handling in rx_mode callback · 5f78e29c
      Lakhvich Dmitriy authored
      In layer3 mode of the qeth driver, multicast IP addresses
      from struct net_device and other type of IP addresses
      from other sources require mapping to the OSA-card.
      This patch simplifies the IP address mapping logic, and changes imple-
      mentation of ndo_set_rx_mode callback and ip notifier events.
      Addresses are stored in private hashtables instead of lists now.
      It allows hardware registration/removal for new/deleted multicast
      addresses only.
      Signed-off-by: default avatarLakhvich Dmitriy <ldmitriy@ru.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Reviewed-by: default avatarEvgeny Cherkashin <Eugene.Crosser@ru.ibm.com>
      Reviewed-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f78e29c
    • Eugene Crosser's avatar
      qeth: introduce linearization fail count to stats · 6059c905
      Eugene Crosser authored
      When skb data touches too many pages, skb_linearize() is called
      opportunistically in the hope that less pages will be required
      for a big linear buffer than for multiple fragments. This patch
      intoduces a separate counter in ethtool statistics structure
      representing _failed_ linearization attempts.
      Signed-off-by: default avatarEugene Crosser <Eugene.Crosser@ru.ibm.com>
      Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Reviewed-by: default avatarLakhvich Dmitriy <ldmitriy@ru.ibm.com>
      Reviewed-by: default avatarThomas Richter <tmricht@de.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6059c905