From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH 2/2] net/mlx5: enforce Tx num of segments limitation Date: Thu, 24 Aug 2017 15:28:57 +0200 Message-ID: <20170824132857.GK4544@autoinstall.dev.6wind.com> References: <20170823073358.116786-1-shahafs@mellanox.com> <20170823073358.116786-2-shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: adrien.mazarguil@6wind.com, dev@dpdk.org, yskoh@mellanox.com, stable@dpdk.org To: Shahaf Shuler Return-path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 55E897D14 for ; Thu, 24 Aug 2017 15:29:07 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id a70so6926392wmd.1 for ; Thu, 24 Aug 2017 06:29:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170823073358.116786-2-shahafs@mellanox.com> 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, Aug 23, 2017 at 10:33:58AM +0300, Shahaf Shuler wrote: > Mellanox NICs has a limitation on the number of mbuf segments a multi > segment mbuf can have. The max number depends on the Tx offloads requested. > > The current code not enforce such limitation, which might cause > malformed WQEs to be written to the device. Avoid acronyms in the commit message (at least on first occurrence), not all people knows what a WQE is and getting such information is not easy. > This commit adds verification for the number of mbuf segments posted > to the device. In case of overflow the packet will not be sent. > Debug prints were added to help application identify the cause for such > case. > > 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_defs.h | 3 ++- > drivers/net/mlx5/mlx5_prm.h | 3 +++ > drivers/net/mlx5/mlx5_rxtx.c | 30 +++++++++++++++++++++++++++--- > drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 8 ++++++++ > drivers/net/mlx5/mlx5_txq.c | 27 +++++++++++++++++++++++++++ > 5 files changed, 67 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h > index 608072f7e..87244e7db 100644 > --- a/drivers/net/mlx5/mlx5_prm.h > +++ b/drivers/net/mlx5/mlx5_prm.h > @@ -154,6 +154,9 @@ > /* Default mark value used when none is provided. */ > #define MLX5_FLOW_MARK_DEFAULT 0xffffff > > +/* Maximum number of DS in WQE. */ > +#define MLX5_MAX_DS (63) > + Why the parenthesis? Thanks, -- Nélio Laranjeiro 6WIND