From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id 965427D24 for ; Thu, 24 Aug 2017 15:23:15 +0200 (CEST) Received: by mail-wr0-f181.google.com with SMTP id r6so2399419wrg.0 for ; Thu, 24 Aug 2017 06:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=oHQT08FfSaeNisP0tnwGymDxZY5+mef7j2Cd3ykhNsQ=; b=Dreq7rNGKrxG2m59WKXAVKF+9sMN321hPShlp0R82Kt1WKnTkwcrjRYmtdca4vhL/K K0VsrB6QYURKZYTp27QVEmjrhkKSGX0IXugKMtnjy0soaYuJElciz+tpSDFNd6CikXLB /9rYkSchXyw+gg59mOSxMqoZnarblLqqciA7ee80jSDNO+uuJ0+GCt4L7pe9qulAIL9M fGJ3oSBd5AVEy4QKgxLODY6eWZTQ0Vj6fd+A6hYkfl3Mvs4XEItD+Rvld0GNO4G4RzXM U1pJcN2NZuPTXR4l4FAZBqtt8eDCpIF8F2D1b+bEKuayHDrtFs3CoImRG52QEGp0QiGF wKyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=oHQT08FfSaeNisP0tnwGymDxZY5+mef7j2Cd3ykhNsQ=; b=UYJ3EOGz7kxY6Z2hT9i85tb1WNnOqQALs61sw5iIUHGRTTlzm7lYPu8KDq3KNaYPKg liETAkZ2/8izC3fnCYr9k17VA6aOrXiFcedDnOVlqxbN+eBkO6ZnKacfHxBrY8iQKJ4c kQGIplH7M/iFNy3CtLKYfd3tjKB5LvKSJ+fqNN3zJ2ptp91HWHz89LsYS56+ZOpP33s1 wvCs+LiWH9QeQGL09xg1kSlriKVbX/IlM4fTiqk3hKEEJFlgG6YkYc1xhAt8LSfsDrao 0fVWb5eE8PRartWyIIbSayWn0ZywZx/7VY2X9ckazeGjQgOe4ZerXUnIsYUtwDrOwzpv dUEw== X-Gm-Message-State: AHYfb5ibkMjB1llxULBwBd1Ttc1yWCHAaP/lsIUIQyDrUaki6f9bLilm BT+Vwu4Xzn0NB08y X-Received: by 10.223.199.134 with SMTP id l6mr1672233wrg.84.1503580995156; Thu, 24 Aug 2017 06:23:15 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s1sm3384308wra.75.2017.08.24.06.23.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Aug 2017 06:23:14 -0700 (PDT) Date: Thu, 24 Aug 2017 15:23:05 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: adrien.mazarguil@6wind.com, dev@dpdk.org, yskoh@mellanox.com, stable@dpdk.org Message-ID: <20170824132305.GJ4544@autoinstall.dev.6wind.com> References: <20170823073358.116786-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170823073358.116786-1-shahafs@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix num seg assumption on vPMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 13:23:15 -0000 On Wed, Aug 23, 2017 at 10:33:57AM +0300, Shahaf Shuler wrote: > vPMD Tx function assumes that after the scatter of the > multi-segment packets the next packet will be a single segment packet. > > This is not current as the function can return due to lack of resources > without sending all of the multi-segment mbufs sequence. > > Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86") > Cc: stable@dpdk.org > > Signed-off-by: Shahaf Shuler > --- > > This patch should be applied only after the series: > http://dpdk.org/dev/patchwork/patch/27367/ > > --- > drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c > index 8560f745a..30727e6dd 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c > @@ -119,8 +119,7 @@ txq_wr_dseg_v(struct txq *txq, __m128i *dseg, > } > > /** > - * Count the number of continuous single segment packets. The first packet must > - * be a single segment packet. > + * Count the number of continuous single segment packets. > * > * @param pkts > * Pointer to array of packets. > @@ -137,7 +136,8 @@ txq_check_multiseg(struct rte_mbuf **pkts, uint16_t pkts_n) > > if (!pkts_n) > return 0; > - assert(NB_SEGS(pkts[0]) == 1); > + if (NB_SEGS(pkts[0]) > 1) > + return 0; > /* Count the number of continuous single segment packets. */ > for (pos = 1; pos < pkts_n; ++pos) > if (NB_SEGS(pkts[pos]) > 1) > @@ -502,6 +502,8 @@ mlx5_tx_burst_vec(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) > n = RTE_MIN((uint16_t)(pkts_n - nb_tx), MLX5_VPMD_TX_MAX_BURST); > if (!(txq->flags & ETH_TXQ_FLAGS_NOMULTSEGS)) > n = txq_check_multiseg(&pkts[nb_tx], n); > + if (!n) > + break; > if (!(txq->flags & ETH_TXQ_FLAGS_NOOFFLOADS)) > n = txq_calc_offload(txq, &pkts[nb_tx], n, &cs_flags); > ret = txq_burst_v(txq, &pkts[nb_tx], n, cs_flags); > -- > 2.12.0 Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND