Skip to content

Commit

Permalink
net/mlx5: remove redundant operations in NEON Rx
Browse files Browse the repository at this point in the history
[ upstream commit ff6fcd4 ]

Mask of entries after the compressed CQE is covered by invalid mask of
non-compressed valid CQEs. Hence remove redundant calculation on mask.
The change showed slight performance uplift on N1SDP.

Fixes: 570acdb ("net/mlx5: add vectorized Rx/Tx burst for ARM")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
Ruifeng Wang authored and cpaelzer committed Aug 9, 2021
1 parent c9bf6d0 commit 7118e13
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/net/mlx5/mlx5_rxtx_vec_neon.h
Expand Up @@ -671,16 +671,15 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts, uint16_t pkts_n,
comp_idx = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16(
comp_mask), 0)) /
(sizeof(uint16_t) * 8);
/* D.6 mask out entries after the compressed CQE. */
mask = vcreate_u16(comp_idx < MLX5_VPMD_DESCS_PER_LOOP ?
-1UL >> (comp_idx * sizeof(uint16_t) * 8) :
0);
invalid_mask = vorr_u16(invalid_mask, mask);
invalid_mask = vorr_u16(invalid_mask, comp_mask);
/* D.7 count non-compressed valid CQEs. */
n = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16(
invalid_mask), 0)) / (sizeof(uint16_t) * 8);
nocmp_n += n;
/* D.2 get the final invalid mask. */
/*
* D.2 mask out entries after the compressed CQE.
* get the final invalid mask.
*/
mask = vcreate_u16(n < MLX5_VPMD_DESCS_PER_LOOP ?
-1UL >> (n * sizeof(uint16_t) * 8) : 0);
invalid_mask = vorr_u16(invalid_mask, mask);
Expand Down

0 comments on commit 7118e13

Please sign in to comment.