From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E97CA0524 for ; Fri, 5 Feb 2021 12:31:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1206E18892B; Fri, 5 Feb 2021 12:31:04 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 87B084067B for ; Fri, 5 Feb 2021 12:31:02 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id f16so5725610wmq.5 for ; Fri, 05 Feb 2021 03:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aSDKdncCeJVf7pXDnv/tMhOuLhbiapi4oWC1YEEGhZo=; b=J/zEZQlv+si8vO7mR4TGEo+b3Id8lw778ohcCmCP1WrCPw6jledQqM8GtWoiBcgHFx RkSSw3p74Iu0T9yFA/la1H/I1H7duDNJ11d7gWxBEI4s9KFgSFCWBEBPSI+7CG72iIkq 5pS2sWXTl6YJ+zSeD5rnqX/u+UVrAxdUpkGPGvQMFI254OCaGEUcO9Lc6o+5PPz45sDU 8Bz++zV3r0ySt9vrhXHYUN3G/53yOrsu4DEKE3aNWW05XV2PxSx8q0YTAbXekt64cw3/ /SjiI9U1KxhZv94TvkFsMX1axylI4pMBDWvisN6gXPC3vmsbaf3sHdOnCDlV6npbwT/+ T5Lg== 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:mime-version:content-transfer-encoding; bh=aSDKdncCeJVf7pXDnv/tMhOuLhbiapi4oWC1YEEGhZo=; b=ejYmxjxEzCehthfxZ8OhHcAhAW9Bb1jiuWQntCffvvOMpRPIAb6Xzyy3ZM5TW0PcFR jnu+qu9Z/6kw8QDyJKrB8w1++KHfxpdu07ycj2uh0qbIrEXKFkYHI0i+2QTZHDgJJTSs 7c3rnUlkDypCDwf/ZljIuOE7mHhqPjClg5TWAW5qhqq/Cg5WI8bUsDQWpdnRkwK2uiP4 NA/syarpgDl5F9l2+r8IIrxRyG6yjbfYhZIFcjZ34fOxMuyA4a9dK0CPp3pjBwbS+x5D IKRvCuGud61uYFaN8x+cwTeomZ2uNAjV01L5wg6eE58JBBFdD5Z5idLJENInNgC4dx4i lY6w== X-Gm-Message-State: AOAM533a5BsWGwzXOeEm0IzCZVlDsQD4g6nrZVMDDUKhml7TraT/YUQe fMozCKPB+g0kdoEAhyOnSXG0s5OEZA+i4uiL X-Google-Smtp-Source: ABdhPJyijTY1O2ywA8odMsySKRu2LU81kluR+nNjPy7iTIKzZU08C9AxDSSF1i5snCe319Lkos4zaA== X-Received: by 2002:a05:600c:190c:: with SMTP id j12mr3293181wmq.16.1612524662266; Fri, 05 Feb 2021 03:31:02 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id k4sm12719322wrm.53.2021.02.05.03.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:31:01 -0800 (PST) From: luca.boccassi@gmail.com To: Michael Baum Cc: Matan Azrad , dpdk stable Date: Fri, 5 Feb 2021 11:16:37 +0000 Message-Id: <20210205111920.1272063-111-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'common/mlx5: fix completion queue entry size configuration' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.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 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c12ce55e812ace1afa69a82f73b1bbef7c0dba41 Thanks. Luca Boccassi --- >From c12ce55e812ace1afa69a82f73b1bbef7c0dba41 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 6 Jan 2021 08:19:23 +0000 Subject: [PATCH] common/mlx5: fix completion queue entry size configuration [ upstream commit a2521c8f983727449bb776133e98bd4ed7534a47 ] According to the current data-path implementation in the PMD the CQE size must follow the cache-line size. So, the configuration of the CQE size should be depended in RTE_CACHE_LINE_SIZE. Wrongly, part of the CQE creations didn't follow it exactly what caused an incompatibility between HW and SW in the data-path when working in 128B cache-line size systems. Adjust the rule for any CQE creation. Remove the cqe_size attribute from the DevX CQ creation command and set it inside the command translation according to the cache-line size. Fixes: 79a7e409a2f6 ("common/mlx5: prepare support of packet pacing") Fixes: 5cd0a83f413e ("common/mlx5: support more fields in DevX CQ create") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 4 ++-- drivers/common/mlx5/mlx5_devx_cmds.h | 1 - drivers/net/mlx5/mlx5_devx.c | 4 ---- drivers/net/mlx5/mlx5_txpp.c | 4 ---- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 9c1d1883ea..a0277b7cc0 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1558,7 +1558,8 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) } else { MLX5_SET64(cqc, cqctx, dbr_addr, attr->db_addr); } - MLX5_SET(cqc, cqctx, cqe_sz, attr->cqe_size); + MLX5_SET(cqc, cqctx, cqe_sz, (RTE_CACHE_LINE_SIZE == 128) ? + MLX5_CQE_SIZE_128B : MLX5_CQE_SIZE_64B); MLX5_SET(cqc, cqctx, cc, attr->use_first_only); MLX5_SET(cqc, cqctx, oi, attr->overrun_ignore); MLX5_SET(cqc, cqctx, log_cq_size, attr->log_cq_size); @@ -1571,7 +1572,6 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) attr->mini_cqe_res_format); MLX5_SET(cqc, cqctx, mini_cqe_res_format_ext, attr->mini_cqe_res_format_ext); - MLX5_SET(cqc, cqctx, cqe_sz, attr->cqe_size); if (attr->q_umem_valid) { MLX5_SET(create_cq_in, in, cq_umem_valid, attr->q_umem_valid); MLX5_SET(create_cq_in, in, cq_umem_id, attr->q_umem_id); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 726e9f5192..bddeabf0ea 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -267,7 +267,6 @@ struct mlx5_devx_cq_attr { uint32_t cqe_comp_en:1; uint32_t mini_cqe_res_format:2; uint32_t mini_cqe_res_format_ext:2; - uint32_t cqe_size:3; uint32_t log_cq_size:5; uint32_t log_page_size:5; uint32_t uar_page_id; diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index 33213a3df2..0ac403b980 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -486,8 +486,6 @@ mlx5_rxq_create_devx_cq_resources(struct rte_eth_dev *dev, uint16_t idx) "Port %u Rx CQE compression is disabled for LRO.", dev->data->port_id); } - if (priv->config.cqe_pad) - cq_attr.cqe_size = MLX5_CQE_SIZE_128B; log_cqe_n = log2above(cqe_n); cq_size = sizeof(struct mlx5_cqe) * (1 << log_cqe_n); buf = rte_calloc_socket(__func__, 1, cq_size, page_size, @@ -1262,8 +1260,6 @@ mlx5_txq_create_devx_cq_resources(struct rte_eth_dev *dev, uint16_t idx) DRV_LOG(ERR, "Failed to allocate CQ door-bell."); goto error; } - cq_attr.cqe_size = (sizeof(struct mlx5_cqe) == 128) ? - MLX5_CQE_SIZE_128B : MLX5_CQE_SIZE_64B; cq_attr.uar_page_id = mlx5_os_get_devx_uar_page_id(priv->sh->tx_uar); cq_attr.eqn = priv->sh->eqn; cq_attr.q_umem_valid = 1; diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c index 21675ab17a..28afda28cb 100644 --- a/drivers/net/mlx5/mlx5_txpp.c +++ b/drivers/net/mlx5/mlx5_txpp.c @@ -275,8 +275,6 @@ mlx5_txpp_create_rearm_queue(struct mlx5_dev_ctx_shared *sh) goto error; } /* Create completion queue object for Rearm Queue. */ - cq_attr.cqe_size = (sizeof(struct mlx5_cqe) == 128) ? - MLX5_CQE_SIZE_128B : MLX5_CQE_SIZE_64B; cq_attr.uar_page_id = mlx5_os_get_devx_uar_page_id(sh->tx_uar); cq_attr.eqn = sh->eqn; cq_attr.q_umem_valid = 1; @@ -513,8 +511,6 @@ mlx5_txpp_create_clock_queue(struct mlx5_dev_ctx_shared *sh) goto error; } /* Create completion queue object for Clock Queue. */ - cq_attr.cqe_size = (sizeof(struct mlx5_cqe) == 128) ? - MLX5_CQE_SIZE_128B : MLX5_CQE_SIZE_64B; cq_attr.use_first_only = 1; cq_attr.overrun_ignore = 1; cq_attr.uar_page_id = mlx5_os_get_devx_uar_page_id(sh->tx_uar); -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:34.203542683 +0000 +++ 0111-common-mlx5-fix-completion-queue-entry-size-configur.patch 2021-02-05 11:18:28.978694387 +0000 @@ -1 +1 @@ -From a2521c8f983727449bb776133e98bd4ed7534a47 Mon Sep 17 00:00:00 2001 +From c12ce55e812ace1afa69a82f73b1bbef7c0dba41 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a2521c8f983727449bb776133e98bd4ed7534a47 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -33 +34 @@ -index 3bf5279ff1..6a4d6ee7b2 100644 +index 9c1d1883ea..a0277b7cc0 100644 @@ -36 +37 @@ -@@ -1569,7 +1569,8 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) +@@ -1558,7 +1558,8 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) @@ -46 +47 @@ -@@ -1582,7 +1583,6 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) +@@ -1571,7 +1572,6 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) @@ -55 +56 @@ -index 94e9bbb906..8d993dfad7 100644 +index 726e9f5192..bddeabf0ea 100644 @@ -58 +59 @@ -@@ -277,7 +277,6 @@ struct mlx5_devx_cq_attr { +@@ -267,7 +267,6 @@ struct mlx5_devx_cq_attr { @@ -67 +68 @@ -index da3bb784be..5c5bea6fd8 100644 +index 33213a3df2..0ac403b980 100644 @@ -89 +90 @@ -index 726bdc6ae1..e998de34b2 100644 +index 21675ab17a..28afda28cb 100644 @@ -92 +93 @@ -@@ -278,8 +278,6 @@ mlx5_txpp_create_rearm_queue(struct mlx5_dev_ctx_shared *sh) +@@ -275,8 +275,6 @@ mlx5_txpp_create_rearm_queue(struct mlx5_dev_ctx_shared *sh) @@ -101 +102 @@ -@@ -516,8 +514,6 @@ mlx5_txpp_create_clock_queue(struct mlx5_dev_ctx_shared *sh) +@@ -513,8 +511,6 @@ mlx5_txpp_create_clock_queue(struct mlx5_dev_ctx_shared *sh)