1. 10 7月, 2018 2 次提交
  2. 29 6月, 2018 2 次提交
    • T
      net/mlx5e: Add TX completions statistics · 86155656
      Tariq Toukan 提交于
      Add per-ring and global ethtool counters for TX completions.
      This helps us monitor and analyze TX flow performance.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      86155656
    • B
      net/mlx5e: Add UDP GSO support · 689adf0d
      Boris Pismenny 提交于
      This patch enables UDP GSO support. We enable this by using two WQEs
      the first is a UDP LSO WQE for all segments with equal length, and the
      second is for the last segment in case it has different length.
      Due to HW limitation, before sending, we must adjust the packet length fields.
      
      We measure performance between two Intel(R) Xeon(R) CPU E5-2643 v2 @3.50GHz
      machines connected back-to-back with Connectx4-Lx (40Gbps) NICs.
      We compare single stream UDP, UDP GSO and UDP GSO with offload.
      Performance:
      		| MSS (bytes)	| Throughput (Gbps)	| CPU utilization (%)
      UDP GSO offload	| 1472		| 35.6			| 8%
      UDP GSO 	| 1472		| 25.5			| 17%
      UDP 		| 1472		| 10.2			| 17%
      UDP GSO offload	| 1024		| 35.6			| 8%
      UDP GSO		| 1024		| 19.2			| 17%
      UDP 		| 1024		| 5.7			| 17%
      UDP GSO offload	| 512		| 33.8			| 16%
      UDP GSO		| 512		| 10.4			| 17%
      UDP 		| 512		| 3.5			| 17%
      Signed-off-by: NBoris Pismenny <borisp@mellanox.com>
      Signed-off-by: NYossi Kuperman <yossiku@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      689adf0d
  3. 02 6月, 2018 3 次提交
  4. 26 5月, 2018 4 次提交
    • E
      net/mlx5e: Avoid reset netdev stats on configuration changes · 05909bab
      Eran Ben Elisha 提交于
      Move all RQ, SQ and channel counters from the channel objects into the
      priv structure.  With this change, counters will not be reset upon
      channel configuration changes.
      
      Channel's statistics for SQs which are associated with TCs higher than
      zero will be presented in ethtool -S, only for SQs which were opened at
      least once since the module was loaded (regardless of their open/close
      current status).  This is done in order to decrease the total amount of
      statistics presented and calculated for the common out of box use (no
      QoS).
      
      mlx5e_channel_stats is a compound of CH,RQ,SQs stats in order to
      create locality for the NAPI when handling TX and RX of the same
      channel.
      
      Align the new statistics struct per ring to avoid several channels
      update to the same cache line at the same time.
      Packet rate was tested, no degradation sensed.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      CC: Qing Huang <qing.huang@oracle.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      05909bab
    • T
      net/mlx5: Use order-0 allocations for all WQ types · 3a2f7033
      Tariq Toukan 提交于
      Complete the transition of all WQ types to use fragmented
      order-0 coherent memory instead of high-order allocations.
      
      CQ-WQ already uses order-0.
      Here we do the same for cyclic and linked-list WQs.
      
      This allows the driver to load cleanly on systems with a highly
      fragmented coherent memory.
      
      Performance tests:
      ConnectX-5 100Gbps, CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
      Packet rate of 64B packets, single transmit ring, size 8K.
      
      No degradation is sensed.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      3a2f7033
    • T
      net/mlx5e: TX, Use actual WQE size for SQ edge fill · 043dc78e
      Tariq Toukan 提交于
      We fill SQ edge with NOPs to avoid WQEs wrap.
      Here, instead of doing that in advance for the maximum possible
      WQE size, we do it on-demand using the actual WQE size.
      We re-order some parts in mlx5e_sq_xmit to finish the calculation
      of WQE size (ds_cnt) before doing any writes to the WQE buffer.
      
      When SQ work queue is fragmented (introduced in an downstream patch),
      dealing with WQE wraps becomes more frequent. This change would drastically
      reduce the overhead in this case.
      
      Performance tests:
      ConnectX-5 100Gbps, CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
      Packet rate of 64B packets, single transmit ring, size 8K.
      
      Before: 14.9 Mpps
      After:  15.8 Mpps
      
      Improvement of 6%.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      043dc78e
    • T
      net/mlx5e: Use WQ API functions instead of direct fields access · ddf385e3
      Tariq Toukan 提交于
      Use the WQ API to get the WQ size, and to map a counter
      into a WQ entry index.
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      ddf385e3
  5. 15 5月, 2018 1 次提交
  6. 01 5月, 2018 1 次提交
  7. 27 4月, 2018 1 次提交
  8. 28 3月, 2018 2 次提交
    • E
      net/mlx5e: Recover Send Queue (SQ) from error state · db75373c
      Eran Ben Elisha 提交于
      An error TX completion (CQE) which arrived on a specific SQ indicates
      that this SQ got moved by the hardware to error state, which means all
      pending and incoming TX requests are dropped or will be dropped and no
      further "Good" CQEs will be generated for that SQ.
      
      Before this patch TX completions (CQEs) were not monitored and were
      handled as a regular CQE. This caused the SQ to stay in an error state,
      making it useless for xmiting new packets.
      
      Mitigation plan:
      In case of an error completion, schedule a recovery work which would do
      the following:
      - Mark the TXQ as DRV_XOFF to disable new packets to arrive from the
        stack
      - NAPI to flush all pending SQ WQEs (via flush_in_error_en bit) to
        release SW and HW resources(SKB, DMA, etc) and have the SQ and CQ
        consumer/producer indices synced.
      - Modify the SQ state ERR -> RST -> RDY (restart the SQ).
      - Reactivate the SQ and reset SQ cc and pc
      
      If we identify two consecutive requests for SQ recover in less than
      500 msecs, drop the recover request to avoid CPU overload, as this
      scenario most likely happened due to a severe repeated bug.
      
      In addition, add SQ recover SW counter to monitor successful recoveries.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      db75373c
    • E
      net/mlx5e: Dump xmit error completions · 16cc14d8
      Eran Ben Elisha 提交于
      Monitor and dump xmit error completions. In addition, add err_cqe
      counter to track the number of error completion per send queue.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      16cc14d8
  9. 21 2月, 2018 1 次提交
    • E
      net/mlx5e: Verify inline header size do not exceed SKB linear size · f600c608
      Eran Ben Elisha 提交于
      Driver tries to copy at least MLX5E_MIN_INLINE bytes into the control
      segment of the WQE. It assumes that the linear part contains at least
      MLX5E_MIN_INLINE bytes, which can be wrong.
      
      Cited commit verified that driver will not copy more bytes into the
      inline header part that the actual size of the packet. Re-factor this
      check to make sure we do not exceed the linear part as well.
      
      This fix is aligned with the current driver's assumption that the entire
      L2 will be present in the linear part of the SKB.
      
      Fixes: 6aace17e ("net/mlx5e: Fix inline header size for small packets")
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      f600c608
  10. 09 11月, 2017 2 次提交
  11. 05 11月, 2017 1 次提交
    • H
      net/mlx5e: Support DSCP trust state to Ethernet's IP packet on SQ · fbcb127e
      Huy Nguyen 提交于
      If the port is in DSCP trust state, packets are placed in the right
      priority queue based on the dscp value. This is done by selecting
      the transmit queue based on the dscp of the skb.
      
      Until now select_queue honors priority only from the vlan header.
      However that is not sufficient in cases where port trust state is DSCP
      mode as packet might not even contain vlan header. Therefore if the port
      is in dscp trust state and vport's min inline mode is not NONE,
      copy the IP header to the eseg's inline header if the skb has it.
      This is done by changing the transmit queue sq's min inline mode to L3.
      Note that the min inline mode of sqs that belong to other features such
      as xdpsq, icosq are not modified.
      Signed-off-by: NHuy Nguyen <huyn@mellanox.com>
      Reviewed-by: NParav Pandit <parav@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      fbcb127e
  12. 15 10月, 2017 1 次提交
  13. 28 9月, 2017 1 次提交
    • G
      net/mlx5e: Fix calculated checksum offloads counters · 603e1f5b
      Gal Pressman 提交于
      Instead of calculating the offloads counters, count them explicitly.
      The calculations done for these counters would result in bugs in some
      cases, for example:
      When running TCP traffic over a VXLAN tunnel with TSO enabled the following
      counters would increase:
             tx_csum_partial: 1,333,284
             tx_csum_partial_inner: 29,286
             tx4_csum_partial_inner: 384
             tx7_csum_partial_inner: 8
             tx9_csum_partial_inner: 34
             tx10_csum_partial_inner: 26,807
             tx11_csum_partial_inner: 287
             tx12_csum_partial_inner: 27
             tx16_csum_partial_inner: 6
             tx25_csum_partial_inner: 1,733
      
      Seems like tx_csum_partial increased out of nowhere.
      The issue is in the following calculation in mlx5e_update_sw_counters:
      s->tx_csum_partial = s->tx_packets - tx_offload_none - s->tx_csum_partial_inner;
      
      While tx_packets increases by the number of GSO segments for each SKB,
      tx_csum_partial_inner will only increase by one, resulting in wrong
      tx_csum_partial counter.
      
      Fixes: bfe6d8d1 ("net/mlx5e: Reorganize ethtool statistics")
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      603e1f5b
  14. 03 9月, 2017 2 次提交
  15. 31 8月, 2017 1 次提交
  16. 27 6月, 2017 2 次提交
  17. 19 6月, 2017 2 次提交
  18. 16 6月, 2017 1 次提交
  19. 23 4月, 2017 1 次提交
  20. 17 4月, 2017 2 次提交
  21. 27 3月, 2017 2 次提交
    • S
      net/mlx5e: Isolate open_channels from priv->params · 6a9764ef
      Saeed Mahameed 提交于
      In order to have a clean separation between channels resources creation
      flows and current active mlx5e netdev parameters, make sure each
      resource creation function do not access priv->params, and only works
      with on a new fresh set of parameters.
      
      For this we add "new" mlx5e_params field to mlx5e_channels structure
      and use it down the road to mlx5e_open_{cq,rq,sq} and so on.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      6a9764ef
    • S
      net/mlx5e: Split open/close channels to stages · acc6c595
      Saeed Mahameed 提交于
      As a foundation for safe config flow, a simple clear API such as
      (Open then Activate) where the "Open" handles the heavy unsafe
      creation operation and the "activate" will be fast and fail safe,
      to enable the newly created channels.
      
      For this we split the RQs/TXQ SQs and channels open/close flows to
      open => activate, deactivate => close.
      
      This will simplify the ability to have fail safe configuration changes
      in downstream patches as follows:
      
      make_new_config(new_params)
      {
           old_channels = current_active_channels;
           new_channels = create_channels(new_params);
           if (!new_channels)
                    return "Failed, but current channels still active :)"
           deactivate_channels(old_channels); /* Can't fail */
           activate_channels(new_channels); /* Can't fail */
           close_channels(old_channels);
           current_active_channels = new_channels;
      
           return "SUCCESS";
      }
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      acc6c595
  22. 25 3月, 2017 4 次提交
  23. 23 3月, 2017 1 次提交
    • G
      net/mlx5e: Count GSO packets correctly · d3a4e4da
      Gal Pressman 提交于
      TX packets statistics ('tx_packets' counter) used to count GSO packets
      as one, even though it contains multiple segments.
      This patch will increment the counter by the number of segments, and
      align the driver with the behavior of other drivers in the stack.
      
      Note that no information is lost in this patch due to 'tx_tso_packets'
      counter existence.
      
      Before, ethtool showed:
      $ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
           tx_packets: 61340
           tx_tso_packets: 60954
           tx_packets_phy: 2451115
      
      Now, we will see the more logical statistics:
      $ ethtool -S ens6 | egrep "tx_packets|tx_tso_packets"
           tx_packets: 2451115
           tx_tso_packets: 60954
           tx_packets_phy: 2451115
      
      Fixes: e586b3b0 ("net/mlx5: Ethernet Datapath files")
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Cc: kernel-team@fb.com
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3a4e4da