From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40054.outbound.protection.outlook.com [40.107.4.54]) by dpdk.org (Postfix) with ESMTP id 2C0275A6A for ; Wed, 3 May 2017 08:55:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ci9yDiwXwEtFuwUkPxdOhUU2dGXXiOLZsF62tuY3ndo=; b=wO3rx+M4NDk2r5gKwBoKf3IHlA1PMfznp2doWyuFxiAz68G8OOTr54rdU5kGq29ixYsGUn9cyFsc67KaEgVQfsyV02+vV6jLw0KYrJZUIVK4+o/cnMJuJvMRDLExhlYvU7M5AjD7ZfMb0z07/7DlGFTfhpvtkc5mYq+JCg44CUQ= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB1517.eurprd05.prod.outlook.com (2a01:111:e400:596d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Wed, 3 May 2017 06:55:40 +0000 From: Shahaf Shuler To: , CC: Date: Wed, 3 May 2017 09:55:35 +0300 Message-ID: <20170503065535.188899-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P18901CA0022.EURP189.PROD.OUTLOOK.COM (2603:10a6:3:8b::32) To VI1PR05MB1517.eurprd05.prod.outlook.com (2a01:111:e400:596d::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1100fca7-80a0-4efc-b7ac-08d491f169fa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:VI1PR05MB1517; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1517; 3:nccC+ufLgbxfahvJoVx9GGoWsBms4yWAZPnMSBwLOUfjGVNdi+T3LB9rhKVC1ReHYqKs5ZpP81DPoiE2PiK4VKq7qMSougibRn/TCoCsG0kY4FL2rhs9mkr/9yV/2rB87oGMOlWRpOvWiHIRNyLX5CKg0yu4GX2bUdHxVm4wWqEAKjQZHy0fDyPSEdnvfB/XG0iHKteXoxbMgY/T5pZhZfwaVKW/Mj0idXOrTqt8dP4La3M0Ui0tA5IPmlldheUTe6NaR8Vj5d7mzpAzsnsgzJtC6LK7EpeMcgmtBe69MAVLnA+myoPtydl9WGWSKXprisSxjIJ0s7JpreBzQjQyP8bpfEDgo8JP2S5UgGA0MG0=; 25:t/M1Vs0Ijw7Wad72JPK81qCkOQgtuotO2gKdpbO1haUeXZKS8AGYev/hgOIqp4EOilyht1U36Q3pjnwaHa4fybsOxfLjM97aUjuC36pJ9b6kLlMuwwdEDvx6MfHfnd62/dn0t0utV8peZ5aOxlhH/7ewzCh36nznfskLQHA5x8TcScV6LS1S6nDe+3QFsxDrvoLTn5M0vKUtuqapIdqMIPguu7dAhG15cEnZC6v+YRhrI4aN5Xj9Wd/PlQCCEtQK39e/fpfUsQm5M7URIlHxo9MCRuUFlQNYNDt4EoKt8JjtnssycXuCGZbElbJ8NnZgo2Nw3tkCORUdO3kFk8FsYU6wqR4XoASO1BsAs1sIy+E17og+q88zTy7Ie2jxBUZ5G0et0H0VHj8qH0jCPvZJFQcEUyEq/w0iaozqm+kmKvGB7wqcOskXS3ekdBp7LY8zOE21lY6tJzBmi/zgwBRSzlXg2w7W+6eO3URozVaQBfs= X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1517; 31:SlRyU1BUAk/D2ITuNO+rGYbuzoGIjpmlkf8RlUUYHq4spOM4KZABO44qHg7ZGliFwqfG50NAFul6GIRZg4ZU2LNsDIeIuIxNRC8MNRRr7Pl70ukGCdf+Ebujhn8Uea69WrsQBltiZzzbdpSANpsQs03EpD4LrQRnZJvLHXGaR0SxKSVRe/w+KKbB+ty0dqXE8nF1prWHXFOIQcGDGRAbyPGZdL3/VNMqXS7jRiu0IlQxZdzrmX/MIKQZQEM7+u5P; 20:okPWhaDFBfTUrpSVUrcNunYSTPr6PW5jFfrTGRoa9ynuiwXSYFDQQMWBpgZbr8gqLRZGkiiGdClSUDQsx75tt5UR69Fkd3jUZROk+7p5ksizpx2UIMXpvW7oHLBizrKbe9FtTYA12u4NKd8jNMh+FJvaxVz2MQ9oz/deCYoXWyB+fB4QwD7WZiiS0ML7yUrN27TviA5TztpAmLwQK0wnM++XvTrA9WuEC6seyPzno62UyIY79P7LqvsjOz1LXTnjwiDUuhXMbMODj8NzreR6C1emRisXQo1zE/bDo550D0uyF5Ovt6v+T0s0As+h4EPU+rxtWU4M6iS3pQaVmd8GtWUPMW1tDh4n6Z3obvWjDHfkamvo2o5O1y6qrMBq60siBVPpwfLyRFjTbbjP0Eo7sUBE+hYKwZKhhu+ZRH6jXXMU5UI2Wy7L1iWCFExd5reV3A4+CluyhX/c0PXl781RSxPFor2IuZCDJNBxyYTdnhih4vxDBuZK4rpSd8n9B4Tu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(20161123564025)(6072148); SRVR:VI1PR05MB1517; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1517; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1517; 4:EdYxVKjN+52UZLUioh4SneKSluP2URsH6dXKxAwtsuLiLq9wzcTRaFWxh401XZs1YI5xzjutZ4toVZ4rJaJdp5DT+7KIXWWD9E+KKaqdmVm6/VkIFborixAuA7NTkbtEFlzFisanwvdDBvyxoERDm/kLI2S13BiEBSHLXvcxLI13q2lkbgHbxttzHpRpOxN0b7OmykU53HFlvwyhFO8ityFLIfqWzrgNO8j40ADfptPKQSuvPDqJSCFWhZULNvngDpIUlrsjweYuVu2cbC3BEJ+ahFsR0FU/+HmV+gkdrmiptBu1GF/ibDphjOKUavpizr21SrcJPi2RQtsq7l9Ca5Zn1xqvpwTv67lHYEzIQrIEwOweVGMpi+9JHOUshzxj21s7Io/xAIfI0KjvxxF77q4mSB+OCtPHeZmQ6SAmTuZny+GudbqCVr5smfiiDAAw3guRykGn+2u6UvYjPUHb3c6pvP9Mh7mkaWMtUePeNQ6iJcG7fHPPe2tuiwoyLm3sYMmx03gpUt/iXkpCYRqQbH82yWBPJuAFu6rMbhwdD4+37qO6S/7YoxYLfKPyVt135DW0XXoFwiks9YXrzeOophEsXQMHJ4mFARJn0XnzO9fCkAeSui81/KDXEI1bfYv5Z9qWZpj5Ipuv5mM3dOElJwKdgFf66iurRc7cqu5CRldFXCz/Yudu3uirob8u2qVIVCbGFzsKZ2fB6zm7k3kEbrX9esqDgTennEhTb/TDHnj46Zg+3ZlSsiOaQYYt6NKiN7eDll73pMD7U+x2G9YVYVqmJmsN8cAWqQyR81XDjp5dO9TvyaoUazEn6GLpwbUS X-Forefront-PRVS: 029651C7A1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39450400003)(39840400002)(39860400002)(39400400002)(6666003)(305945005)(7736002)(478600001)(50986999)(33026002)(42186005)(66066001)(1076002)(3846002)(6116002)(189998001)(47776003)(53936002)(38730400002)(50466002)(48376002)(5003940100001)(81166006)(5660300001)(33646002)(25786009)(55016002)(86362001)(36756003)(8676002)(4326008)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1517; H:mellanox.com; FPR:; SPF:None; MLV:sfv; L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4dpZv3M017SzqSq14eoiBl9SgqEIt90p6/Cy+HSmChMxxrMglPUzz9x2vCCrUElVfKSZPEREu2VBPApgS2a9yY5rx2zcOvAmmmLlfd7dXFDjyeg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2017 06:55:40.8673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1517 Subject: [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:55:43 -0000 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