From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v5 4/4] net/mlx5: enforce Tx num of segments limitation Date: Fri, 15 Sep 2017 10:11:27 +0200 Message-ID: <20170915081127.GC2160@autoinstall.dev.6wind.com> References: <5046c30c96938a590412ce03dcad1434824cd952.1505385989.git.shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: yskoh@mellanox.com, adrien.mazarguil@6wind.com, dev@dpdk.org, stable@dpdk.org To: Shahaf Shuler 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 2A2793238 for ; Fri, 15 Sep 2017 10:11:39 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id l22so1158471wrc.10 for ; Fri, 15 Sep 2017 01:11:39 -0700 (PDT) Content-Disposition: inline In-Reply-To: <5046c30c96938a590412ce03dcad1434824cd952.1505385989.git.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 Thu, Sep 14, 2017 at 01:50:39PM +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 work requests to be written to the device. > > This commit adds verification for the number of mbuf segments posted > to the device. In case of overflow the packet will not be sent. > > In addition update the nic documentation with the limitation. > Considering device limitation is 63 data segments in a work request, the > maximum number of segment in mbuf was calculated taking TSO as the worst > case: > > max_nb_segs = 63 - (control_segment + ethernet segment + > TSO headers inline + inline segment + > extra inline to align to cacheline) > > Cc: stable@dpdk.org > > Signed-off-by: Shahaf Shuler Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND