From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id BFEF9237 for ; Tue, 21 Nov 2017 14:21:39 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7407720CCF; Tue, 21 Nov 2017 08:21:39 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:21:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=8DCgiVG1RMMUcsYey OMrBh0m5dx/FB9N50D+sAkwRhA=; b=mOQxrmXEFv3HMm7xYBYRoFZiJq2BYdsX+ eaViFp2A6KorVzoHVTfwgqrT2DLGTFJ1gXnKXD9/qo4XyQiYfuLImMzy/62wnxPr d+M+sMM3WMgeHw/Eots4nMCnLybIPXOIASfHT6jbpiy5N8ri05TH8TB2vqvhA5Id xgkivzsaIvP9BPmz802If1AKCzpyyoxTcjM9X5gtCecJa8+3Z/UCXY/ampQaiuEp 2cqU9WaXijYgc60TybwN28p81Bes5TnzvW7NU7/V3noyUdaoTHIzKpXS36t2/6Kn InktzEhU9zGq45yT33Yygv93iv6A7hnh/Bkzqg4FEkiKtnxlm8XEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=8DCgiVG1RMMUcsYeyOMrBh0m5dx/FB9N50D+sAkwRhA=; b=qnYSxIPy Cx7nio0u48lTQ0zp5jsK804VWuQ8BrXuyU8k620ktNOniwofPWCNLfDe8zo4o4uv DacXeewUpzn07+V5j5XiXRx/6jAE31GIdQ/Di2jQTfFuQ9YASr8Tc5wsHqfAKTJ1 uKMHWBzAZBaU0RyV6Qo6O6zUwpKYSoo4dwin/5jgjQm2IsAOXj27Bjv51bsVa7wy wTrK8OovWu941ftsptXI5mT0RT2WtqsWFtuQLhOO0hCxUV9oqud2hJUtN+lBfAfQ m/VcV9K9O+mocT9ywGIIDgVNBFMnreruWJ80q1juHYEzyVMEQ2mYl5s99fUtQObA QDkSUMNFYskv2w== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 34E6824631; Tue, 21 Nov 2017 08:21:35 -0500 (EST) From: Yuanhan Liu To: Yongseok Koh Cc: Shahaf Shuler , Nelio Laranjeiro , dpdk stable Date: Tue, 21 Nov 2017 21:16:17 +0800 Message-Id: <1511270333-31002-35-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix calculating TSO inline size' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:21:40 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 15c22ea1360c895f949029c89d56ad0f73a6540d Mon Sep 17 00:00:00 2001 From: Yongseok Koh Date: Thu, 31 Aug 2017 09:27:06 -0700 Subject: [PATCH] net/mlx5: fix calculating TSO inline size [ upstream commit d829249790f08fd54ccc0d5e462b2a6512c9eae1 ] Tx descriptor for TSO embeds packet header to be replicated. If Tx inline is enabled, there could be additional packet data inlined with 4B inline header ahead. And between the header and additional inlined packet data, there may be padding to make the inline part aligned to MLX5_WQE_DWORD_SIZE. In calculating the total size of inlined data, the size of inline header and padding is missing. Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") Signed-off-by: Shahaf Shuler Signed-off-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index b07bcd1..d3d61c8 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -461,6 +461,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) length -= pkt_inline_sz; addr += pkt_inline_sz; } + raw += MLX5_WQE_DWORD_SIZE; if (txq->tso_en) { tso = buf->ol_flags & PKT_TX_TCP_SEG; if (tso) { @@ -493,7 +494,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) copy_b = tso_header_sz - pkt_inline_sz; /* First seg must contain all headers. */ assert(copy_b <= length); - raw += MLX5_WQE_DWORD_SIZE; if (copy_b && ((end - (uintptr_t)raw) > copy_b)) { uint16_t n = (MLX5_WQE_DS(copy_b) - @@ -506,14 +506,11 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) (void *)addr, copy_b); addr += copy_b; length -= copy_b; + /* Include padding for TSO header. */ + copy_b = MLX5_WQE_DS(copy_b) * + MLX5_WQE_DWORD_SIZE; pkt_inline_sz += copy_b; - /* - * Another DWORD will be added - * in the inline part. - */ - raw += MLX5_WQE_DS(copy_b) * - MLX5_WQE_DWORD_SIZE - - MLX5_WQE_DWORD_SIZE; + raw += copy_b; } else { /* NOP WQE. */ wqe->ctrl = (rte_v128u32_t){ @@ -531,19 +528,20 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) } /* Inline if enough room. */ if (inline_en || tso) { + uint32_t inl; uintptr_t end = (uintptr_t) (((uintptr_t)txq->wqes) + (1 << txq->wqe_n) * MLX5_WQE_SIZE); unsigned int inline_room = max_inline * RTE_CACHE_LINE_SIZE - - (pkt_inline_sz - 2); + (pkt_inline_sz - 2) - + !!tso * sizeof(inl); uintptr_t addr_end = (addr + inline_room) & ~(RTE_CACHE_LINE_SIZE - 1); unsigned int copy_b = (addr_end > addr) ? RTE_MIN((addr_end - addr), length) : 0; - raw += MLX5_WQE_DWORD_SIZE; if (copy_b && ((end - (uintptr_t)raw) > copy_b)) { /* * One Dseg remains in the current WQE. To @@ -556,12 +554,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) break; max_wqe -= n; if (tso) { - uint32_t inl = - htonl(copy_b | MLX5_INLINE_SEG); - - pkt_inline_sz = - MLX5_WQE_DS(tso_header_sz) * - MLX5_WQE_DWORD_SIZE; + inl = htonl(copy_b | MLX5_INLINE_SEG); rte_memcpy((void *)raw, (void *)&inl, sizeof(inl)); raw += sizeof(inl); -- 2.7.4