1. 28 7月, 2018 13 次提交
    • S
      net/mlx5e: Vxlan, move vxlan logic to core driver · 358aa5ce
      Saeed Mahameed 提交于
      Move vxlan logic and objects to mlx5 core dirver.
      Since it going to be used from different mlx5 interfaces.
      e.g. mlx5e PF NIC netdev and mlx5e E-Switch representors.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      358aa5ce
    • S
      net/mlx5e: Vxlan, add sync lock for add/del vxlan port · aec4eab9
      Saeed Mahameed 提交于
      Vxlan API can and will be called from different mlx5 modules, we should
      not count on mlx5e private state lock only, hence we introduce a vxlan
      private mutex to sync between add/del vxlan port operations.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      aec4eab9
    • S
      net/mlx5e: Vxlan, return values for add/del port · 1b318a92
      Saeed Mahameed 提交于
      For a better API mlx5_vxlan_{add/del}_port can fail, make them return
      error values.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      1b318a92
    • S
      net/mlx5e: Vxlan, rename from mlx5e to mlx5 · a3c785d7
      Saeed Mahameed 提交于
      Rename vxlan functions from mlx5e_vxlan_* to mlx5_vxlan_*.
      Rename mlx5e_vxlan_db to mlx5_vxlan and move it from en.h to vxlan.c
      since it is not related to mlx5e anymore.
      
      Allocate mlx5_vxlan structure dynamically in order to make it easier to
      move later to core driver and to make it private in vxlan.c.
      
      This is in preparation to move vxlan API to mlx5 core.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      a3c785d7
    • S
      net/mlx5e: Vxlan, rename struct mlx5e_vxlan to mlx5_vxlan_port · 5006eb22
      Saeed Mahameed 提交于
      The name mlx5e_vxlan will be used in downstream patch to describe
      mlx5 vxlan structure that will replace mlx5e_vxlan_db.
      
      Hence we rename struct mlx5e_vxlan to mlx5_vxlan_port which describes a
      mlx5 vxlan port.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      5006eb22
    • S
      net/mlx5e: Vxlan, move netdev only logic to en_main.c · dccea6bf
      Saeed Mahameed 提交于
      Create a direct vxlan API to add and delete vxlan ports from HW.
      +void mlx5e_vxlan_add_port(struct mlx5e_priv *priv, u16 port);
      +void mlx5e_vxlan_del_port(struct mlx5e_priv *priv, u16 port);
      
      And move vxlan_add/del_work to en_main.c since they are netdev only
      logic.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      dccea6bf
    • S
      net/mlx5e: Vxlan, add direct delete function · 0f647bfc
      Saeed Mahameed 提交于
      Add direct vxlan delete function to be called from vxlan_delete_work.
      Needed in downstream patch.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      0f647bfc
    • G
      net/mlx5e: Vxlan, cleanup an unused member in vxlan work · 278d7f3d
      Gal Pressman 提交于
      Cleanup the sa_family member of the vxlan work, it is unused/needed
      anywhere in the code.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      278d7f3d
    • G
      net/mlx5e: Vxlan, replace ports radix-tree with hash table · d30d8cde
      Gal Pressman 提交于
      The VXLAN database is accessed in the data path for each VXLAN TX skb in
      order to check whether the UDP port is being offloaded or not.
      The number of elements in the database is relatively small, we can
      simplify the radix-tree to a hash table and speedup the lookup process.
      
      Measuring mlx5e_vxlan_lookup_port execution time:
      
                        Radix Tree   Hash Table
       --------------- ------------ ------------
        Single Stream   161 ns       79  ns (51% improvement)
        Multi Stream    259 ns       136 ns (47% improvement)
      
      Measuring UDP stream packet rate, single fully utilized TX core:
      Radix Tree: 498,300 PPS
      Hash Table: 555,468 PPS (11% improvement)
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      d30d8cde
    • G
      net/mlx5e: Vxlan, check maximum number of UDP ports · 22a65aa8
      Gal Pressman 提交于
      The NIC has a limited number of offloaded VXLAN UDP ports (usually 4).
      Instead of letting the firmware fail when trying to add more ports than
      it can handle, let the driver check it on its own.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      22a65aa8
    • G
      net/mlx5e: Vxlan, reflect 4789 UDP port default addition to software database · a082c4f4
      Gal Pressman 提交于
      The hardware offloads 4789 UDP port (default VXLAN port) automatically.
      Add it to the software database as well in order to reflect the hardware
      state appropriately.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      a082c4f4
    • J
      net: sched: don't dump chains only held by actions · 1f3ed383
      Jiri Pirko 提交于
      In case a chain is empty and not explicitly created by a user,
      such chain should not exist. The only exception is if there is
      an action "goto chain" pointing to it. In that case, don't show the
      chain in the dump. Track the chain references held by actions and
      use them to find out if a chain should or should not be shown
      in chain dump.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f3ed383
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next · 7a49d3d4
      David S. Miller 提交于
      Steffen Klassert says:
      
      ====================
      pull request (net-next): ipsec-next 2018-07-27
      
      1) Extend the output_mark to also support the input direction
         and masking the mark values before applying to the skb.
      
      2) Add a new lookup key for the upcomming xfrm interfaces.
      
      3) Extend the xfrm lookups to match xfrm interface IDs.
      
      4) Add virtual xfrm interfaces. The purpose of these interfaces
         is to overcome the design limitations that the existing
         VTI devices have.
      
        The main limitations that we see with the current VTI are the
        following:
      
        VTI interfaces are L3 tunnels with configurable endpoints.
        For xfrm, the tunnel endpoint are already determined by the SA.
        So the VTI tunnel endpoints must be either the same as on the
        SA or wildcards. In case VTI tunnel endpoints are same as on
        the SA, we get a one to one correlation between the SA and
        the tunnel. So each SA needs its own tunnel interface.
      
        On the other hand, we can have only one VTI tunnel with
        wildcard src/dst tunnel endpoints in the system because the
        lookup is based on the tunnel endpoints. The existing tunnel
        lookup won't work with multiple tunnels with wildcard
        tunnel endpoints. Some usecases require more than on
        VTI tunnel of this type, for example if somebody has multiple
        namespaces and every namespace requires such a VTI.
      
        VTI needs separate interfaces for IPv4 and IPv6 tunnels.
        So when routing to a VTI, we have to know to which address
        family this traffic class is going to be encapsulated.
        This is a lmitation because it makes routing more complex
        and it is not always possible to know what happens behind the
        VTI, e.g. when the VTI is move to some namespace.
      
        VTI works just with tunnel mode SAs. We need generic interfaces
        that ensures transfomation, regardless of the xfrm mode and
        the encapsulated address family.
      
        VTI is configured with a combination GRE keys and xfrm marks.
        With this we have to deal with some extra cases in the generic
        tunnel lookup because the GRE keys on the VTI are actually
        not GRE keys, the GRE keys were just reused for something else.
        All extensions to the VTI interfaces would require to add
        even more complexity to the generic tunnel lookup.
      
        So to overcome this, we developed xfrm interfaces with the
        following design goal:
      
        It should be possible to tunnel IPv4 and IPv6 through the same
        interface.
      
        No limitation on xfrm mode (tunnel, transport and beet).
      
        Should be a generic virtual interface that ensures IPsec
        transformation, no need to know what happens behind the
        interface.
      
        Interfaces should be configured with a new key that must match a
        new policy/SA lookup key.
      
        The lookup logic should stay in the xfrm codebase, no need to
        change or extend generic routing and tunnel lookups.
      
        Should be possible to use IPsec hardware offloads of the underlying
        interface.
      
      5) Remove xfrm pcpu policy cache. This was added after the flowcache
         removal, but it turned out to make things even worse.
         From Florian Westphal.
      
      6) Allow to update the set mark on SA updates.
         From Nathan Harold.
      
      7) Convert some timestamps to time64_t.
         From Arnd Bergmann.
      
      8) Don't check the offload_handle in xfrm code,
         it is an opaque data cookie for the driver.
         From Shannon Nelson.
      
      9) Remove xfrmi interface ID from flowi. After this pach
         no generic code is touched anymore to do xfrm interface
         lookups. From Benedict Wong.
      
      10) Allow to update the xfrm interface ID on SA updates.
          From Nathan Harold.
      
      11) Don't pass zero to ERR_PTR() in xfrm_resolve_and_create_bundle.
          From YueHaibing.
      
      12) Return more detailed errors on xfrm interface creation.
          From Benedict Wong.
      
      13) Use PTR_ERR_OR_ZERO instead of IS_ERR + PTR_ERR.
          From the kbuild test robot.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a49d3d4
  2. 27 7月, 2018 27 次提交