From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by dpdk.org (Postfix) with ESMTP id C28782C8 for ; Tue, 20 Jun 2017 13:37:03 +0200 (CEST) Received: by mail-io0-f193.google.com with SMTP id a96so14455528ioj.1 for ; Tue, 20 Jun 2017 04:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lgMxVyC+GV1xq84M6fcsHVwFwkri3XM/1EO8Sk+4dTk=; b=z2kRAm2veIkR5QnZSeMLmxYUthhjdGQhPkIWtPimcl5TRdJ5C65wZJe6uom/OtrxMK wlbWMbUB+DotJmyqyTHQKwIvLuYdpsaAFI8Z5G1nNzlvEKuxLJoyA0RmAkP6pXgRAYj6 NrK9Cg1r1/dKRrqxwSROFzOP38kki51M9enti4CBqUeTlCBClvDcQOJH40V7ip5FVA8N S7rGAcWYp0FErJJyKPul8utwE5I1lvcb2Jqmm39lTdkdVmSCZj3e+GXJCVwyiZDwO+/0 tcoC8ArZGAry0XgKpSKmV7ORNLE8dbw/NOrztPNZ81a2e8BWMkhbZ3QETHglFefM/vHW h/tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lgMxVyC+GV1xq84M6fcsHVwFwkri3XM/1EO8Sk+4dTk=; b=t0/XMuLzvyP0Z+WCSAwk5X044YTBQrtshqk5a/NJy4X+ZGb2MtqYYfn2wnFBd7ZAKp /Vq+f/Qgg6k0TiYt32O+FApvByzAXqCJl6TF1A+JeDKqmZtU6+ykxmXWKimeGkKl64+j vg3EacAEW1rwrp3iHAQKedQ/6ZlCUovcOMGhOuXJvFheNKtBvcXHXI47WbFstOIlpIiz onPjHKum6HO6f87Dr63oIAxHakbONs4moSBoJvbZ8IsZJpyduqJxkURlRcoc6QzDIMAH bnDbeJoljoPN/nwFX+2vevLfd9bVUQPZDPzvaix8MJ7Q13PMnQSSJSezSMafZ0mYfnZl 19Yg== X-Gm-Message-State: AKS2vOw4mYA4iQlRAXAmqHGPG7iyd0sQuczvFsvZhJ/kZr8J2c+MBsU/ oaSeGaPLxeSJEIoUEmPX0g== X-Received: by 10.84.169.4 with SMTP id g4mr35639638plb.272.1497958623177; Tue, 20 Jun 2017 04:37:03 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.36.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:37:02 -0700 (PDT) From: Yuanhan Liu To: Shahaf Shuler Cc: Yongseok Koh , Nelio Laranjeiro , dpdk stable Date: Tue, 20 Jun 2017 19:35:25 +0800 Message-Id: <1497958550-13600-13-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: fix completion buffer size' has been queued to stable release 17.05.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, 20 Jun 2017 11:37:04 -0000 Hi, FYI, your patch has been queued to stable release 17.05.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 06/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From bdd61d4ea7967c5360041d14667bc085e2cd56d7 Mon Sep 17 00:00:00 2001 From: Shahaf Shuler Date: Thu, 18 May 2017 13:44:45 +0300 Subject: [PATCH] net/mlx5: fix completion buffer size [ upstream commit 626e8bfb84d55a7234d9b79c35bd7005f076fd0d ] Completion buffer size was computed wrongly, causing completion polling to wraparound too early and miss entries. Fixing it by using Direct Verbs to query the CQ info. Fixes: 6218063b39a6 ("net/mlx5: refactor Rx data path") Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path") Signed-off-by: Shahaf Shuler Acked-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxq.c | 14 +++++++++----- drivers/net/mlx5/mlx5_txq.c | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 8b78233..2a26839 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -838,12 +838,16 @@ static inline int rxq_setup(struct rxq_ctrl *tmpl) { struct ibv_cq *ibcq = tmpl->cq; - struct mlx5_cq *cq = to_mxxx(cq, cq); + struct ibv_mlx5_cq_info cq_info; struct mlx5_rwq *rwq = container_of(tmpl->wq, struct mlx5_rwq, wq); struct rte_mbuf *(*elts)[1 << tmpl->rxq.elts_n] = rte_calloc_socket("RXQ", 1, sizeof(*elts), 0, tmpl->socket); - if (cq->cqe_sz != RTE_CACHE_LINE_SIZE) { + if (ibv_mlx5_exp_get_cq_info(ibcq, &cq_info)) { + ERROR("Unable to query CQ info. check your OFED."); + return ENOTSUP; + } + if (cq_info.cqe_size != RTE_CACHE_LINE_SIZE) { ERROR("Wrong MLX5_CQE_SIZE environment variable value: " "it should be set to %u", RTE_CACHE_LINE_SIZE); return EINVAL; @@ -851,16 +855,16 @@ rxq_setup(struct rxq_ctrl *tmpl) if (elts == NULL) return ENOMEM; tmpl->rxq.rq_db = rwq->rq.db; - tmpl->rxq.cqe_n = log2above(ibcq->cqe); + tmpl->rxq.cqe_n = log2above(cq_info.cqe_cnt); tmpl->rxq.cq_ci = 0; tmpl->rxq.rq_ci = 0; - tmpl->rxq.cq_db = cq->dbrec; + tmpl->rxq.cq_db = cq_info.dbrec; tmpl->rxq.wqes = (volatile struct mlx5_wqe_data_seg (*)[]) (uintptr_t)rwq->rq.buff; tmpl->rxq.cqes = (volatile struct mlx5_cqe (*)[]) - (uintptr_t)cq->active_buf->buf; + (uintptr_t)cq_info.buf; tmpl->rxq.elts = elts; return 0; } diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index de7e28b..6c1387e 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -173,23 +173,27 @@ txq_setup(struct txq_ctrl *tmpl, struct txq_ctrl *txq_ctrl) { struct mlx5_qp *qp = to_mqp(tmpl->qp); struct ibv_cq *ibcq = tmpl->cq; - struct mlx5_cq *cq = to_mxxx(cq, cq); + struct ibv_mlx5_cq_info cq_info; - if (cq->cqe_sz != RTE_CACHE_LINE_SIZE) { + if (ibv_mlx5_exp_get_cq_info(ibcq, &cq_info)) { + ERROR("Unable to query CQ info. check your OFED."); + return ENOTSUP; + } + if (cq_info.cqe_size != RTE_CACHE_LINE_SIZE) { ERROR("Wrong MLX5_CQE_SIZE environment variable value: " "it should be set to %u", RTE_CACHE_LINE_SIZE); return EINVAL; } - tmpl->txq.cqe_n = log2above(ibcq->cqe); + tmpl->txq.cqe_n = log2above(cq_info.cqe_cnt); tmpl->txq.qp_num_8s = qp->ctrl_seg.qp_num << 8; tmpl->txq.wqes = qp->gen_data.sqstart; tmpl->txq.wqe_n = log2above(qp->sq.wqe_cnt); tmpl->txq.qp_db = &qp->gen_data.db[MLX5_SND_DBR]; tmpl->txq.bf_reg = qp->gen_data.bf->reg; - tmpl->txq.cq_db = cq->dbrec; + tmpl->txq.cq_db = cq_info.dbrec; tmpl->txq.cqes = (volatile struct mlx5_cqe (*)[]) - (uintptr_t)cq->active_buf->buf; + (uintptr_t)cq_info.buf; tmpl->txq.elts = (struct rte_mbuf *(*)[1 << tmpl->txq.elts_n]) ((uintptr_t)txq_ctrl + sizeof(*txq_ctrl)); -- 2.7.4