1. 15 2月, 2019 3 次提交
    • B
      net/mlx5: Add host params change event · 7f0d11c7
      Bodong Wang 提交于
      In Embedded CPU (EC) configurations, the EC driver needs to know when
      the number of virtual functions change on the corresponding PF at the
      host side. This is required so the EC driver can create or destroy
      representor net devices that represent the VFs ports.
      
      Whenever a change in the number of VFs occurs, firmware will generate an
      event towards the EC which will trigger a work to complete the rest of
      the handling. The specifics of the handling will be introduced in a
      downstream patch.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      7f0d11c7
    • B
      net/mlx5: Introduce Mellanox SmartNIC and modify page management logic · 591905ba
      Bodong Wang 提交于
      Mellanox's SmartNIC combines embedded CPU(e.g, ARM) processing power
      with advanced network offloads to accelerate a multitude of security,
      networking and storage applications.
      
      With the introduction of the SmartNIC, there is a new PCI function
      called Embedded CPU Physical Function(ECPF). And it's possible for a
      PF to get its ICM pages from the ECPF PCI function. Driver shall
      identify if it is running on such a function by reading a bit in
      the initialization segment.
      
      When firmware asks for pages, it would issue a page request event
      specifying how many pages it requests and for which function. That
      driver responds with a manage_pages command providing the requested
      pages along with an indication for which function it is providing these
      pages.
      
      The encoding before this patch was as follows:
          function_id == 0: pages are requested for the function receiving
                            the EQE.
          function_id != 0: pages are requested for VF identified by the
                            function_id value
      
      A new one bit field in the EQE identifies that pages are requested for
      the ECPF.
      
      The notion of page_supplier can be introduced here and to support that,
      manage pages and query pages were modified so firmware can distinguish
      the following cases:
      
      1. Function provides pages for itself
      2. PF provides pages for its VF
      3. ECPF provides pages to itself
      4. ECPF provides pages for another function
      
      This distinction is possible through the introduction of the bit
      "embedded_cpu_function" in query_pages, manage_pages and page request
      EQE.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      591905ba
    • B
      net/mlx5: Use void pointer as the type in address_of macro · 20bbf22a
      Bodong Wang 提交于
      Better to use void * and avoid unnecessary casts.
      
      This patch doesn't change any functionality.
      Signed-off-by: NBodong Wang <bodong@mellanox.com>
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      20bbf22a
  2. 03 2月, 2019 1 次提交
  3. 21 12月, 2018 1 次提交
    • T
      net/mlx5e: XDP, Support Enhanced Multi-Packet TX WQE · 5e0d2eef
      Tariq Toukan 提交于
      Add support for the HW feature of multi-packet WQE in XDP
      xmit flow.
      
      The conventional TX descriptor (WQE, Work Queue Element) serves
      a single packet. Our HW has support for multi-packet WQE (MPWQE)
      in which a single descriptor serves multiple TX packets.
      
      This reduces both the PCI overhead and the CPU cycles wasted on
      writing them.
      
      In this patch we add support for the HW feature, which is supported
      starting from ConnectX-5.
      
      Performance:
      Tested packet rate for UDP 64Byte multi-stream over ConnectX-5 NICs.
      CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
      
      XDP_TX:
      We see a huge gain on single port ConnectX-5, and reach the 100 Mpps
      milestone.
      * Single-port HCA:
      	Before:   70 Mpps
      	After:   100 Mpps (+42.8%)
      
      * Dual-port HCA:
      	Before: 51.7 Mpps
      	After:  57.3 Mpps (+10.8%)
      
      * In both cases we tested traffic on one port and for now On Dual-port HCAs
        we see only small gain, we are working to overcome this bottleneck, but
        for the moment only with experimental firmware on dual port HCAs we can
        reach the wanted numbers as seen on Single-port HCAs.
      
      XDP_REDIRECT:
      Redirect from (A) ConnectX-5 to (B) ConnectX-5.
      Due to a setup limitation, (A) and (B) are on different NUMA nodes,
      so absolute performance numbers are not optimal.
      Note:
        Below is the transmit rate of (B), not the redirect rate of (A)
        which is in some cases higher.
      
      * (B) is single-port:
      	Before:   77 Mpps
      	After:    90 Mpps (+16.8%)
      
      * (B) is dual-port:
      	Before:  61 Mpps
      	After:   72 Mpps (+18%)
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      5e0d2eef
  4. 11 12月, 2018 1 次提交
  5. 10 12月, 2018 1 次提交
  6. 27 11月, 2018 1 次提交
    • S
      net/mlx5: EQ, Introduce atomic notifier chain subscription API · 0f597ed4
      Saeed Mahameed 提交于
      Use atomic_notifier_chain to fire firmware events at internal mlx5 core
      components such as eswitch/fpga/clock/FW tracer/etc.., this is to
      avoid explicit calls from low level mlx5_core to upper components and to
      simplify the mlx5_core API for future developments.
      
      Simply provide register/unregister notifiers API and call the notifier
      chain on firmware async events.
      
      Example: to subscribe to a FW event:
      struct mlx5_nb port_event;
      
      MLX5_NB_INIT(&port_event, port_event_handler, PORT_CHANGE);
      mlx5_eq_notifier_register(mdev, &port_event);
      
      where:
       - port_event_handler is the notifier block callback.
       - PORT_EVENT is the suffix of MLX5_EVENT_TYPE_PORT_CHANGE.
      
      The above will guarantee that port_event_handler will receive all FW
      events of the type MLX5_EVENT_TYPE_PORT_CHANGE.
      
      To receive all FW/HW events one can subscribe to
      MLX5_EVENT_TYPE_NOTIFY_ANY.
      
      The next few patches will start moving all mlx5 core components to use
      this new API and cleanup mlx5_eq_async_int misx handler from component
      explicit calls and specific logic.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      0f597ed4
  7. 13 11月, 2018 1 次提交
  8. 04 10月, 2018 1 次提交
    • F
      net/mlx5: Add Fast teardown support · fcd29ad1
      Feras Daoud 提交于
      Today mlx5 devices support two teardown modes:
      1- Regular teardown
      2- Force teardown
      
      This change introduces the enhanced version of the "Force teardown" that
      allows SW to perform teardown in a faster way without the need to reclaim
      all the pages.
      
      Fast teardown provides the following advantages:
      1- Fix a FW race condition that could cause command timeout
      2- Avoid moving to polling mode
      3- Close the vport to prevent PCI ACK to be sent without been scatter
      to memory
      Signed-off-by: NFeras Daoud <ferasda@mellanox.com>
      Reviewed-by: NMajd Dibbiny <majd@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      fcd29ad1
  9. 05 9月, 2018 1 次提交
  10. 09 8月, 2018 1 次提交
  11. 24 7月, 2018 1 次提交
    • F
      net/mlx5: FW tracer, events handling · c71ad41c
      Feras Daoud 提交于
      The tracer has one event, event 0x26, with two subtypes:
      - Subtype 0: Ownership change
      - Subtype 1: Traces available
      
      An ownership change occurs in the following cases:
      1- Owner releases his ownership, in this case, an event will be
      sent to inform others to reattempt acquire ownership.
      2- Ownership was taken by a higher priority tool, in this case
      the owner should understand that it lost ownership, and go through
      tear down flow.
      
      The second subtype indicates that there are traces in the trace buffer,
      in this case, the driver polls the tracer buffer for new traces, parse
      them and prepares the messages for printing.
      
      The HW starts tracing from the first address in the tracer buffer.
      Driver receives an event notifying that new trace block exists.
      HW posts a timestamp event at the last 8B of every 256B block.
      Comparing the timestamp to the last handled timestamp would indicate
      that this is a new trace block. Once the new timestamp is detected,
      the entire block is considered valid.
      
      Block validation and parsing, should be done after copying the current
      block to a different location, in order to avoid block overwritten
      during processing.
      Signed-off-by: NFeras Daoud <ferasda@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      c71ad41c
  12. 19 7月, 2018 1 次提交
  13. 20 6月, 2018 1 次提交
  14. 01 6月, 2018 2 次提交
  15. 25 5月, 2018 1 次提交
  16. 17 5月, 2018 2 次提交
  17. 06 4月, 2018 1 次提交
  18. 31 3月, 2018 1 次提交
    • T
      net/mlx5e: Use linear SKB in Striding RQ · 619a8f2a
      Tariq Toukan 提交于
      Current Striding RQ HW feature utilizes the RX buffers so that
      there is no wasted room between the strides. This maximises
      the memory utilization.
      This prevents the use of build_skb() (which requires headroom
      and tailroom), and demands to memcpy the packets headers into
      the skb linear part.
      
      In this patch, whenever a set of conditions holds, we apply
      an RQ configuration that allows combining the use of linear SKB
      on top of a Striding RQ.
      
      To use build_skb() with Striding RQ, the following must hold:
      1. packet does not cross a page boundary.
      2. there is enough headroom and tailroom surrounding the packet.
      
      We can satisfy 1 and 2 by configuring:
      	stride size = MTU + headroom + tailoom.
      
      This is possible only when:
      a. (MTU - headroom - tailoom) does not exceed PAGE_SIZE.
      b. HW LRO is turned off.
      
      Using linear SKB has many advantages:
      - Saves a memcpy of the headers.
      - No page-boundary checks in datapath.
      - No filler CQEs.
      - Significantly smaller CQ.
      - SKB data continuously resides in linear part, and not split to
        small amount (linear part) and large amount (fragment).
        This saves datapath cycles in driver and improves utilization
        of SKB fragments in GRO.
      - The fragments of a resulting GRO SKB follow the IP forwarding
        assumption of equal-size fragments.
      
      Some implementation details:
      HW writes the packets to the beginning of a stride,
      i.e. does not keep headroom. To overcome this we make sure we can
      extend backwards and use the last bytes of stride i-1.
      Extra care is needed for stride 0 as it has no preceding stride.
      We make sure headroom bytes are available by shifting the buffer
      pointer passed to HW by headroom bytes.
      
      This configuration now becomes default, whenever capable.
      Of course, this implies turning LRO off.
      
      Performance testing:
      ConnectX-5, single core, single RX ring, default MTU.
      
      UDP packet rate, early drop in TC layer:
      
      --------------------------------------------
      | pkt size | before    | after     | ratio |
      --------------------------------------------
      | 1500byte | 4.65 Mpps | 5.96 Mpps | 1.28x |
      |  500byte | 5.23 Mpps | 5.97 Mpps | 1.14x |
      |   64byte | 5.94 Mpps | 5.96 Mpps | 1.00x |
      --------------------------------------------
      
      TCP streams: ~20% gain
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      619a8f2a
  19. 27 3月, 2018 1 次提交
    • I
      net/mlx5e: Expose PFC stall prevention counters · 2fcb12df
      Inbar Karmy 提交于
      Add the needed capability bit and counters to device spec description.
      Expose the following two counters in ethtool:
      
      tx_pause_storm_warning_events: when the device is stalled for a period
      longer than a pre-configured watermark, the counter increase, allowing
      the debug utility an insight into current device status.
      
      tx_pause_storm_error_events: when the device is stalled for a period
      longer than a pre-configured timeout, the pause transmission is disabled,
      and the counter increase.
      Signed-off-by: NInbar Karmy <inbark@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      2fcb12df
  20. 15 3月, 2018 1 次提交
  21. 09 1月, 2018 2 次提交
  22. 29 12月, 2017 1 次提交
    • Y
      IB/mlx5: Extend UAR stuff to support dynamic allocation · 31a78a5a
      Yishai Hadas 提交于
      This patch extends the alloc context flow to be prepared for working
      with dynamic UAR allocations.
      
      Currently upon alloc context there is some fix size of UARs that are
      allocated (named 'static allocation') and there is no option to user
      application to ask for more or control which UAR will be used by which
      QP.
      
      In this patch the driver prepares its data structures to manage both the
      static and the dynamic allocations and let the user driver knows about
      the max value of dynamic blue-flame registers that are allowed.
      
      Downstream patches from this series will enable the dynamic allocation
      and the association as part of QP creation.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      31a78a5a
  23. 05 11月, 2017 2 次提交
  24. 28 9月, 2017 1 次提交
  25. 03 9月, 2017 1 次提交
  26. 24 8月, 2017 1 次提交
  27. 24 7月, 2017 2 次提交
  28. 27 6月, 2017 1 次提交
    • I
      net/mlx5: FPGA, Add SBU infrastructure · a9956d35
      Ilan Tayari 提交于
      Add interface to initialize and interact with Innova FPGA SBU
      connections.
      A client driver may use these functions to set up a high-speed DMA
      connection with its SBU hardware logic, and send/receive messages
      over this connection.
      
      A later patch in this patchset will make use of these functions for
      Innova IPSec offload in mlx5 Ethernet driver.
      
      Add commands to retrieve Innova FPGA SBU capabilities, and to
      read/write Innova FPGA configuration space registers and memory,
      over internal I2C.
      
      At high level, the FPGA configuration space is divided such:
       0x00000000 - 0x007fffff is reserved for the SBU
       0x00800000 - 0xffffffff is reserved for the Shell
      0x400000000 - ...        is DDR memory
      
      A later patchset will add support for accessing FPGA CrSpace and memory
      over a high-speed connection. This is the reason for the ACCESS_TYPE
      enumeration, which currently only supports I2C.
      Signed-off-by: NIlan Tayari <ilant@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      a9956d35
  29. 22 6月, 2017 1 次提交
  30. 23 5月, 2017 1 次提交
  31. 14 5月, 2017 1 次提交
    • I
      net/mlx5: FPGA, Add basic support for Innova · e29341fb
      Ilan Tayari 提交于
      Mellanox Innova is a NIC with ConnectX and an FPGA on the same
      board. The FPGA is a bump-on-the-wire and thus affects operation of
      the mlx5_core driver on the ConnectX ASIC.
      
      Add basic support for Innova in mlx5_core.
      
      This allows using the Innova card as a regular NIC, by detecting
      the FPGA capability bit, and verifying its load state before
      initializing ConnectX interfaces.
      
      Also detect FPGA fatal runtime failures and enter error state if
      they ever happen.
      
      All new FPGA-related logic is placed in its own subdirectory 'fpga',
      which may be built by selecting CONFIG_MLX5_FPGA.
      This prepares for further support of various Innova features in later
      patchsets.
      Additional details about hardware architecture will be provided as
      more features get submitted.
      Signed-off-by: NIlan Tayari <ilant@mellanox.com>
      Reviewed-by: NBoris Pismenny <borisp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      e29341fb
  32. 06 2月, 2017 1 次提交
  33. 20 1月, 2017 1 次提交