From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 650995A6E for ; Wed, 3 May 2017 08:59:38 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id w50so98561877wrc.0 for ; Tue, 02 May 2017 23:59:38 -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=cS2+o5fXlmAszX2OtKdgx4YNfJ42w+v7iFli///8zg8=; b=kImPfttqbNjtwNwwEoYQcdbn1FYVmdKTUvFvWkkIspWzJSKKGmUFVqKRbQqpEEP14l eQrwOnkm+d6F/ZwMlhTeLdAGZtckZNxabNDGchKUm5hD3UWKpQ2s+Ynekf257PZB/i3j YkUBDEPSDq8Gg7x0+WV0Ib9F/nlOX76f9N4gGvD5hpG5VQYQKuq+wHqYUlQoyvuLjOwP 2aIIHJyc/6A7gs7rS4AHqd1Brjvh1h63TsMU4Q4nbBVYOr11npeDfbI+OoSSRStVWkIv Y8gFhGamaUuwO+BMYDsxHDi4ddJ2pKdQujI3ywu22S7cykrbwQjiPdv797VQ14LnYqHB Prfg== 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=cS2+o5fXlmAszX2OtKdgx4YNfJ42w+v7iFli///8zg8=; b=PTpaJVhTQQAjhErCmkaRslEvaJn29I01nR0N+bQPr/5MDy3KHss2YHg1RS07mEvdHs 317AtjvXyFtZslKj7ISMMefElLNSkbURyFfXJcrniBuCvod39yTY/Ovu62poDjKFFLo6 OB2qPqnBBlIZLb/U+ueZjJlPXk383ULz4FNF3RTtm40Bcj1oN5LtGZi3DzvDNq39J3Og 7sHIOUHJjJtK54MFXMfM6KMwkpstj1c8p/1ria+D0krVPCXoUW5T7rzLwk+w/EGlXdJd 0Ple6/+1YEeHOstZuxBUOI5eFXH2K3jnf3rmhLOU9ygwNpgEQPEIWCpnTzbKu3gItwLP PTqQ== X-Gm-Message-State: AN3rC/7Ag9oLzYnd/6IgagiauaBJieu3MSxoPQyHLXvJNtCOCHT25khN F0ELxIIctvetRhnA X-Received: by 10.223.172.105 with SMTP id v96mr25172724wrc.1.1493794778060; Tue, 02 May 2017 23:59:38 -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 y126sm2830991wmg.29.2017.05.02.23.59.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 23:59:37 -0700 (PDT) Date: Wed, 3 May 2017 08:59:31 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: adrien.mazarguil@6wind.com, dev@dpdk.org Message-ID: <20170503065931.GK31330@autoinstall.dev.6wind.com> References: <20170503065535.188899-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: <20170503065535.188899-1-shahafs@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix Tx max inline with TSO 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: Wed, 03 May 2017 06:59:38 -0000 On Wed, May 03, 2017 at 09:55:35AM +0300, Shahaf Shuler wrote: > When TSO is enabled, Verbs layer aggregates the TSO > inline size with the txq inline size for the Tx creation, > while the PMD takes the maximum among them. > > Fixing it by adjusting the max inline parameter before > passing to to Verbs. > > Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") > > Signed-off-by: Shahaf Shuler > Acked-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_txq.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c > index f80740a13..24bd8c615 100644 > --- a/drivers/net/mlx5/mlx5_txq.c > +++ b/drivers/net/mlx5/mlx5_txq.c > @@ -230,6 +230,9 @@ txq_ctrl_setup(struct rte_eth_dev *dev, struct txq_ctrl *txq_ctrl, > struct ibv_exp_cq_attr cq_attr; > } attr; > unsigned int cqe_n; > + const unsigned int max_tso_inline = ((MLX5_MAX_TSO_HEADER + > + (RTE_CACHE_LINE_SIZE - 1)) / > + RTE_CACHE_LINE_SIZE); > int ret = 0; > > if (mlx5_getenv_int("MLX5_ENABLE_CQE_COMPRESSION")) { > @@ -307,16 +310,22 @@ txq_ctrl_setup(struct rte_eth_dev *dev, struct txq_ctrl *txq_ctrl, > priv->inline_max_packet_sz) + > (RTE_CACHE_LINE_SIZE - 1)) / > RTE_CACHE_LINE_SIZE) * RTE_CACHE_LINE_SIZE; > + } else if (priv->tso) { > + int inline_diff = tmpl.txq.max_inline - max_tso_inline; > + > + /* Adjust inline value as Verbs aggregates > + * tso_inline and txq_inline fields. > + */ > + attr.init.cap.max_inline_data = inline_diff > 0 ? > + inline_diff * > + RTE_CACHE_LINE_SIZE : > + 0; > } else { > attr.init.cap.max_inline_data = > tmpl.txq.max_inline * RTE_CACHE_LINE_SIZE; > } > } > if (priv->tso) { > - uint16_t max_tso_inline = ((MLX5_MAX_TSO_HEADER + > - (RTE_CACHE_LINE_SIZE - 1)) / > - RTE_CACHE_LINE_SIZE); > - > attr.init.max_tso_header = > max_tso_inline * RTE_CACHE_LINE_SIZE; > attr.init.comp_mask |= IBV_EXP_QP_INIT_ATTR_MAX_TSO_HEADER; > -- > 2.12.0 > Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND