1. 20 Apr, 2017 33 commits
  2. 17 Apr, 2017 7 commits
    • David S. Miller's avatar
      Merge branch 'mlx5-RDMA-netdevice' · 70d40b36
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      Mellanox, mlx5 RDMA net device support
      
      This series provides the lower level mlx5 support of RDMA netdevice
      creation API [1] suggested and introduced by Intel's HFI OPA VNIC
      netdevice driver [2], to enable IPoIB mlx5 RDMA netdevice creation.
      
      mlx5 IPoIB RDMA netdev will serve as an acceleration netdevice for the current
      IPoIB ULP generic netdevice, providing:
      	- mlx5 RSS support.
      	- mlx5 HW RX,TX offloads (checksum, TSO, LRO, etc ..).
      	- Full mlx5 HW features transparent to the ULP itself.
      
      The idea here is to reuse and benefit from the already implemented mlx5e netdevice
      management and channels API for both etherent and RDMA netdevices, since both IPoIB
      and Ethernet netdevices share same common mlx5 HW resources (with some small
      exceptions) and share most of the control/data path logic, it is more natural to
      have them share the same code.
      
      The differences between IPoIB and Ethernet netdevices can be summarized to:
      
      Steering:
      In mlx5, IPoIB traffic is sent and received from an underlay special QP, and in Ethernet
      the traffic is handled by vports and vport steering is managed by e-switch or FW.
      
      For IPoIB traffic to get steered correctly the only thing we need to do is to create RSS
      HW contexts for RX and TX HW contexts for TX (similar to mlx5e) with the underlay QP attached to
      them (underlay QP will be 0 in case of Ethernet).
      
      RX,TX:
      Since IPoIB traffic is different, slightly modified RX and TX handlers are required,
      still we do some code reuse in data path via common helper functions.
      
      All of the other generic netdevice and mlx5 aspects will be shared between mlx5 Ethernet
      and IPoIB netdevices, e.g.
      	- Channels creation and handling (RQs,SQs,CQs, NAPI, interrupt moderation, etc..)
      	- Offloads, checksum, GRO, LRO, TSO, and more.
              - netdevice logic and non Ethernet specific ndos (open/close, etc..)
      
      In order to achieve what we want:
      
      In patchet 1 to 3, Erez added the supported for underlay QP in mlx5_ifc and refactored
      the mlx5 steering code to accept the underlay QP as a parameter for creating steering
      objects and enabled flow steering for IB link.
      
      Then we are going to use the mlx5e netdevice profile, which is already used to separate between
      NIC and VF representors netdevices, to create new type of IPoIB netdevice profile.
      
      For that, one small refactoring is required to make mlx5e netdevice profile management
      more genetic and agnostic to link type which is done in patch #4.
      
      In patch #5, we introduce ipoib.c to host all of mlx5 IPoIB (mlx5i) specific logic and a
      skeleton for the IPoIB mlx5 netdevice profile, and we will start filling it in next patches,
      using mlx5e already existing APIs.
      
      Patch #6 and #7, Implement init/cleanup RX mlx5i netdev profile handlers to create mlx5 RSS
      resources, same as mlx5e but without vlan and L2 steering tables.
      
      Patch #8, Implement init/cleanup TX mlx5i netdev profile handlers, to create TX resources
      same as mlx5e but with one TC (tc = 0) support.
      
      Patch #9, Implement mlx5i open/close ndos, where we reuese the mlx5e channels API, to start/stop TX/RX channels.
      
      Patch #10, Create the underlay QP and attach it to mlx5i RSS and TX HW contexts.
      
      Patch #11 and #12, Break down the mlx5e xmit flow into smaller helper function and implement the
      mlx5i IPoIB xmit routine.
      
      Patch #13 and #14, Have an RX handler per netdevice profile. We already do this before this series
      in a non clean way to separate between NIC netdev and VF representor RX handlers, in patch 13 we make
      the RX handler generic and bound to a profile and in patch 14 we implement the IPoIB RX handlers.
      
      Patch #15, Small cleanup to avoid e-switch with IPoIB netdev.
      
      In order to enable mlx5 IPoIB, a merge between the IPoIB RDMA netdev offolad support [3]
      - which was alread submitted to the rdma mailing list - and this series is required
      plus an extra small patch [4] which will connect between both sides and actually enables the offload.
      
      Once both patch-sets are merged into linux we will have to submit the extra small patch [4], to enable
      the feature.
      
      Thanks,
      Saeed.
      
      [1] https://patchwork.kernel.org/patch/9676637/
      
      [2] https://lwn.net/Articles/715453/
          https://patchwork.kernel.org/patch/9587815/
      
      [3] https://patchwork.kernel.org/patch/9672069/
      [4] https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git/commit/?id=0141db6a686e32294dee015b7d07706162ba48d8
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70d40b36
    • Erez Shitrit's avatar
      hw/mlx5: Add New bit to check over QP creation · 93d576af
      Erez Shitrit authored
      Add check for bit IB_QP_CREATE_NETIF_QP while creating QP.
      Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93d576af
    • Saeed Mahameed's avatar
      net/mlx5e: E-switch vport manager is valid for ethernet only · 955bc480
      Saeed Mahameed authored
      Currently the driver support only ethernet eswitch, and we want to
      protect downstream IPoIB netdev from trying to access it in IB link.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      955bc480
    • Saeed Mahameed's avatar
      net/mlx5e: IPoIB, RX handler · 9d6bd752
      Saeed Mahameed authored
      Implement IPoIB RX SKB handler.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d6bd752
    • Saeed Mahameed's avatar
      net/mlx5e: RX handlers per netdev profile · 20fd0c19
      Saeed Mahameed authored
      In order to have different RX handler per profile, fix and refactor the
      current code to take the rx handler directly from the netdevice profile
      rather than computing it on runtime as it was done with the switchdev
      mode representor rx handler.
      
      This will also remove the current wrong assumption in mlx5e_alloc_rq
      code that mlx5e_priv->ppriv is of the type vport_rep.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20fd0c19
    • Saeed Mahameed's avatar
      net/mlx5e: IPoIB, Xmit flow · 25854544
      Saeed Mahameed authored
      Implement mlx5e's IPoIB SKB transmit using the helper functions provided
      by mlx5e ethernet tx flow, the only difference in the code between
      mlx5e_xmit and mlx5i_xmit is that IPoIB has some extra fields to fill
      (UD datagram segment) in the TX descriptor (WQE) and it doesn't need to
      have any vlan handling.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25854544
    • Saeed Mahameed's avatar
      net/mlx5e: Xmit flow break down · 77bdf895
      Saeed Mahameed authored
      Break current mlx5e xmit flow into smaller blocks (helper functions)
      in order to reuse them for IPoIB SKB transmission.
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77bdf895