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 AD8091B1B3 for ; Wed, 24 Jan 2018 16:43:00 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6132B226D8; Wed, 24 Jan 2018 10:43:00 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:43:00 -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=HmE19ooxh2e45Mozw ooSI7VIRZgbGERTHxTh96tyr0U=; b=itU2ZEhvQI287OwcxiVFc5EdeOUqSM/Xs LnrT37TaPtiARrRSjCadEu0+0OLK8k5CfbwI2epmi64znOWcQd532A5LdOSj5Kj6 D/NQbDRoJZwLsxx2iYl99VIbk5MFY/ByvT4ccxGBRzfeddmZD5M7LQQ0K4ijcJp9 ecyLYhP4Cf24mWD49IJ7+vpqNT3milzYvR8wHQI0HoGsK/9uKw8SzTRa8k51unF2 HdJgmkKXlYWWW1b0jV/20zvFy4lCCcplSlTfZm7ZMn+rRcFM3EjuLxVeH41mKzjF P6SMMhDKwNxKO53M/b74kYZXzWCIdP7js4kzqz7L/b0kXqZEjalxw== 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=HmE19ooxh2e45MozwooSI7VIRZgbGERTHxTh96tyr0U=; b=owL5FMhM qYdohbahi08wmrurTRwTwfEFL1J9XE5oNTxU/X7oUhEFUYTr8R/V7Dv4JGZ+dCEo 3flXR4Npy4zSXMHxeheXbr7ocA7TIPS5VswzMivKZ76j+AZqAX34XsvqIHzX8TRg FTVeAwZEXJvWdf0QvVHex0Ee9I877nvq+cnwIT+URyf4SUYNaIJuNya5M/zffA2l 5+YRBVQDIq7JYNYaM9iBKHTW2b6EUkVQtTCAFyzyhG0Fo+PFDJn4DGKb8WvZhrhv QH2H2McTCmnZNMuZ6weZq9ddMS/tLVmBi2WU7NRDHR9H2I20Dt1XDH1CqX2ftYTh XxlUnAH6NZS7XA== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 9B0527E1A2; Wed, 24 Jan 2018 10:42:57 -0500 (EST) From: Yuanhan Liu To: Yongseok Koh Cc: Xueming Li , Nelio Laranjeiro , dpdk stable Date: Wed, 24 Jan 2018 23:33:46 +0800 Message-Id: <1516808026-25523-158-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix memory region lookup' has been queued to LTS release 17.11.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: Wed, 24 Jan 2018 15:43:01 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.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 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From af08e1a32a95d9076f827f8f37eb35ffe957932f Mon Sep 17 00:00:00 2001 From: Yongseok Koh Date: Thu, 18 Jan 2018 23:52:55 -0800 Subject: [PATCH] net/mlx5: fix memory region lookup [ upstream commit f81ec748434bfef078be57fc880313e832765ad1 ] This patch reverts: commit 3a6f2eb8c5c5 ("net/mlx5: fix Memory Region registration") Although granularity of chunks in a mempool is a cacheline, addresses are extended to align to page boundary for performance reason in device when registering a MR (Memory Region). This could make some regions overlap, then can cause Tx completion error due to incorrect LKEY search. If the error occurs, the Tx queue will get stuck. It is because buffer address is compared against aligned addresses for Memory Region. Saving original addresses of mempool for comparison doesn't create any overlap. Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search") Fixes: 3a6f2eb8c5c5 ("net/mlx5: fix Memory Region registration") Reported-by: Xueming Li Signed-off-by: Xueming Li Signed-off-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_mr.c | 5 +++-- drivers/net/mlx5/mlx5_rxtx.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 6b29eed..2776dc7 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -291,6 +291,9 @@ priv_mr_new(struct priv *priv, struct rte_mempool *mp) DEBUG("mempool %p area start=%p end=%p size=%zu", (void *)mp, (void *)start, (void *)end, (size_t)(end - start)); + /* Save original addresses for exact MR lookup. */ + mr->start = start; + mr->end = end; /* Round start and end to page boundary if found in memory segments. */ for (i = 0; (i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL); ++i) { uintptr_t addr = (uintptr_t)ms[i].addr; @@ -309,8 +312,6 @@ priv_mr_new(struct priv *priv, struct rte_mempool *mp) IBV_ACCESS_LOCAL_WRITE); mr->mp = mp; mr->lkey = rte_cpu_to_be_32(mr->mr->lkey); - mr->start = start; - mr->end = (uintptr_t)mr->mr->addr + mr->mr->length; rte_atomic32_inc(&mr->refcnt); DEBUG("%p: new Memory Region %p refcnt: %d", (void *)priv, (void *)mr, rte_atomic32_read(&mr->refcnt)); diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 301cd75..05aec29 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -543,7 +543,7 @@ static __rte_always_inline uint32_t mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb) { uint16_t i = txq->mr_cache_idx; - uintptr_t addr = rte_pktmbuf_mtod_offset(mb, uintptr_t, DATA_LEN(mb)); + uintptr_t addr = rte_pktmbuf_mtod(mb, uintptr_t); struct mlx5_mr *mr; assert(i < RTE_DIM(txq->mp2mr)); -- 2.7.4