aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTariq Toukan2018-08-21 06:41:41 -0500
committerSaeed Mahameed2018-10-10 20:26:16 -0500
commit37fdffb217a45609edccbb8b407d031143f551c0 (patch)
tree3b2e6c76443aa839bb59443d770fb236d5097ca4 /include/linux
parenta48bc513159d4767f9988f0d857b2b0c38a4d614 (diff)
downloadremoteproc-37fdffb217a45609edccbb8b407d031143f551c0.tar.gz
remoteproc-37fdffb217a45609edccbb8b407d031143f551c0.tar.xz
remoteproc-37fdffb217a45609edccbb8b407d031143f551c0.zip
net/mlx5: WQ, fixes for fragmented WQ buffers API
mlx5e netdevice used to calculate fragment edges by a call to mlx5_wq_cyc_get_frag_size(). This calculation did not give the correct indication for queues smaller than a PAGE_SIZE, (broken by default on PowerPC, where PAGE_SIZE == 64KB). Here it is replaced by the correct new calls/API. Since (TX/RX) Work Queues buffers are fragmented, here we introduce changes to the API in core driver, so that it gets a stride index and returns the index of last stride on same fragment, and an additional wrapping function that returns the number of physically contiguous strides that can be written contiguously to the work queue. This obsoletes the following API functions, and their buggy usage in EN driver: * mlx5_wq_cyc_get_frag_size() * mlx5_wq_cyc_ctr2fragix() The new API improves modularity and hides the details of such calculation for mlx5e netdevice and mlx5_ib rdma drivers. New calculation is also more efficient, and improves performance as follows: Packet rate test: pktgen, UDP / IPv4, 64byte, single ring, 8K ring size. Before: 16,477,619 pps After: 17,085,793 pps 3.7% improvement Fixes: 3a2f70331226 ("net/mlx5: Use order-0 allocations for all WQ types") Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx5/driver.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 66d94b4557cf..88a041b73abf 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1032,6 +1032,14 @@ static inline void *mlx5_frag_buf_get_wqe(struct mlx5_frag_buf_ctrl *fbc,
1032 ((fbc->frag_sz_m1 & ix) << fbc->log_stride); 1032 ((fbc->frag_sz_m1 & ix) << fbc->log_stride);
1033} 1033}
1034 1034
1035static inline u32
1036mlx5_frag_buf_get_idx_last_contig_stride(struct mlx5_frag_buf_ctrl *fbc, u32 ix)
1037{
1038 u32 last_frag_stride_idx = (ix + fbc->strides_offset) | fbc->frag_sz_m1;
1039
1040 return min_t(u32, last_frag_stride_idx - fbc->strides_offset, fbc->sz_m1);
1041}
1042
1035int mlx5_cmd_init(struct mlx5_core_dev *dev); 1043int mlx5_cmd_init(struct mlx5_core_dev *dev);
1036void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); 1044void mlx5_cmd_cleanup(struct mlx5_core_dev *dev);
1037void mlx5_cmd_use_events(struct mlx5_core_dev *dev); 1045void mlx5_cmd_use_events(struct mlx5_core_dev *dev);