From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v3 5/5] net/mlx5: add vectorized Rx/Tx burst for SSE4.1 Date: Thu, 6 Jul 2017 09:16:09 +0200 Message-ID: <20170706071609.GL21379@autoinstall.dev.6wind.com> References: <20170628230403.10142-1-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: ferruh.yigit@intel.com, dev@dpdk.org, adrien.mazarguil@6wind.com To: Yongseok Koh Return-path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id 6A8872C8 for ; Thu, 6 Jul 2017 09:16:18 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id k67so15814253wrc.2 for ; Thu, 06 Jul 2017 00:16:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jul 05, 2017 at 11:12:28AM -0700, Yongseok Koh wrote: >[...] > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c > new file mode 100644 > index 000000000..4595f7a33 > --- /dev/null > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c > @@ -0,0 +1,1378 @@ >[...] > + > +#include > +#include > +#include > +#include > +#include > + > +/* Verbs header. */ > +#include > +#include > +#include Pragma on Verbs must remain, their headers are still not clear for pdentic compilation. >[...] > +/** > + * Replenish buffers for RX in bulk. > + * > + * @param rxq > + * Pointer to RX queue structure. > + * @param n > + * Number of buffers to be replenished. > + */ > +static inline void > +rxq_replenish_bulk_mbuf(struct rxq *rxq, uint16_t n) > +{ > + const uint16_t q_n = 1 << rxq->elts_n; > + const uint16_t q_mask = q_n - 1; > + const uint16_t elts_idx = rxq->rq_ci & q_mask; > + struct rte_mbuf **elts = &(*rxq->elts)[elts_idx]; > + volatile struct mlx5_wqe_data_seg *wq = &(*rxq->wqes)[elts_idx]; > + unsigned int i; > + > + assert(n >= MLX5_VPMD_RXQ_RPLNSH_THRESH); > + assert(n <= (uint16_t)(q_n - (rxq->rq_ci - rxq->rq_pi))); > + assert(MLX5_VPMD_RXQ_RPLNSH_THRESH > MLX5_VPMD_DESCS_PER_LOOP); Info: as the PMD is compiled in C11, you could use the static_assert which verifies at compilation time the constants are correct. (I am not asking to change it now, we can make a compain to change all this kind of assert at onces). Unless the pragma which must remain on Verbs header: Acked-by: Nelio Laranjeiro Great work. Thanks, -- Nélio Laranjeiro 6WIND