1. 18 6月, 2016 18 次提交
    • D
      Merge branch 'tunnel-offload-future-proof' · 832dfd1f
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      832dfd1f
    • A
      vxlan: Add new UDP encapsulation offload type for VXLAN-GPE · b9adcd69
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9adcd69
    • A
      net: Remove deprecated tunnel specific UDP offload functions · 1938ee1f
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1938ee1f
    • A
      qlcnic: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 5e44f8e2
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e44f8e2
    • A
      qede: Move all UDP port notifiers to single function · f9f082a9
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9f082a9
    • A
      nfp: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 3ab68837
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ab68837
    • A
      mlx5_en: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · 974c3f30
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      974c3f30
    • A
      mlx4_en: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · a831274a
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a831274a
    • A
      ixgbe: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · b3a49557
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3a49557
    • A
      i40e: Move all UDP port notifiers to single function · 06a5f7f1
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06a5f7f1
    • A
      fm10k: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · f174cdbe
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f174cdbe
    • A
      benet: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port · bde6b7cd
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bde6b7cd
    • A
      bnxt: Move GENEVE support from hard-coded port to using port notifier · 7cdd5fc3
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cdd5fc3
    • A
      bnxt: Update drivers to support unified UDP encapsulation offload functions · ad51b8e9
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ad51b8e9
    • A
      bnx2x: Move all UDP port notifiers to single function · 6b352912
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b352912
    • A
      net: Merge VXLAN and GENEVE push notifiers into a single notifier · 7c46a640
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c46a640
    • A
      net: Combine GENEVE and VXLAN port notifiers into single functions · e7b3db5e
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7b3db5e
    • A
      vxlan/geneve: Include udp_tunnel.h in vxlan/geneve.h and fixup includes · 86a98057
      Alexander Duyck 提交于
      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: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86a98057
  2. 17 6月, 2016 22 次提交