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 CDF0EA0C47 for ; Mon, 26 Jul 2021 15:54:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C788140DDA; Mon, 26 Jul 2021 15:54:56 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id CBBEB410F0 for ; Mon, 26 Jul 2021 15:54:53 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id j2so11156790wrx.9 for ; Mon, 26 Jul 2021 06:54:53 -0700 (PDT) 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=Py8tTiSFnJ+zhSQFAEKRMXqojSDFH+sAsBNFkM//9FA=; b=TjHI+/PfRvPDF8X3vsVykBf5ya96RyvEncjh8UJUu/QVQUTwuWdWi+jYO+2vUNAXFS AuJgQOOZ57t+6dQ3cQzAWjjDNBjPyTX6YxMxEb31KDMD2CheVKVTMzIklgqVNehJ1TOT BpuiXjoLlhdsxnRPAh1wiz9Sm4OyB5KN2Oup07dWds2JG4RvmG2ZDhzNc9/l7w+qEhqe Ne6NKeNGuFJ7BFn+VTs9waWFamu6pyl6f12s1Giwui/XKhDBhrrNJPi9ty0BdCNws6b+ DIvDIgJ0qTomD7r1avMAyGwr6RZhK4Ml5F/RZCcY3a0da0mL4A2wkL5KMDpAwUfYbCXe AFEQ== 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=Py8tTiSFnJ+zhSQFAEKRMXqojSDFH+sAsBNFkM//9FA=; b=pqemb+MC8wctp5FFAHXGHYbt1ZzLu/eU5EYnSGnvzQnPR5WqJa+hRvbAQG460kpZEJ l0ULRdOx0DtX5/UbexYQE3OJiMps8EIRFcRODUXED/wAvswhaPi9iOjS9502pUeMGyya slrGbyPlCtpsxUgPUnhel+aLW4IZixUrF/CcHEUdqkLSw+7fetM7LrhWM9t69GciOyqY x7ll5IglRIExUDsVHH58Kytgbi0nZxuMKARHWsD6vd7ctt5ce96PZbnD9Onm6ccG1pJk bHtFSJdKpuo93o5dYpI9TQhEhX5OS3pEJlCiNC9dBxLimb6deYBJdAClwGPDQZ23Sbpa 4eJQ== X-Gm-Message-State: AOAM533gw0uKRmkDXKRKa0hvOFMpNFFnViFBOjzteIdO0qL00JXO2v29 bZkDOOyly5CWZPNzidNYzp4= X-Google-Smtp-Source: ABdhPJzabQAs5j2I+VWWPKg4lZsmrbBbjAg2ImBXim9kii0DkG6+jYSHojgdAfRY/QmX/WDmCTDmuA== X-Received: by 2002:adf:ee45:: with SMTP id w5mr19406053wro.281.1627307692196; Mon, 26 Jul 2021 06:54:52 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id v5sm5173955wrd.74.2021.07.26.06.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:54:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Michael Baum Cc: Matan Azrad , dpdk stable Date: Mon, 26 Jul 2021 14:52:50 +0100 Message-Id: <20210726135322.149850-27-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vdpa/mlx5: fix overflow in queue attribute' has been queued to stable release 20.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/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/c571fde575c25bf56e3470bea9a539d635654009 Thanks. Luca Boccassi --- >From c571fde575c25bf56e3470bea9a539d635654009 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Thu, 1 Jul 2021 09:39:15 +0300 Subject: [PATCH] vdpa/mlx5: fix overflow in queue attribute [ upstream commit c6b552e4c0aaedf910ddae0345faee360394958b ] The mlx5_vdpa_event_qp_create function makes shifting to the numeric constant 1, then multiplies it by another constant and finally assigns it into a uint64_t variable. The numeric constant type is an int with a 32-bit sign. if after shifting , its MSB (bit of sign) will change, the uint64 variable will get into it a different value than what the function intended it to get. Set the numeric constant 1 to be uint64_t in the first place. Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 266cd8e57c..03c7f849ca 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -689,8 +689,8 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, uint16_t desc_n, attr.wq_umem_id = eqp->umem_obj->umem_id; attr.wq_umem_offset = 0; attr.dbr_umem_id = eqp->umem_obj->umem_id; - attr.dbr_address = (1 << log_desc_n) * MLX5_WSEG_SIZE; attr.ts_format = mlx5_ts_format_conv(priv->qp_ts_format); + attr.dbr_address = RTE_BIT64(log_desc_n) * MLX5_WSEG_SIZE; eqp->sw_qp = mlx5_devx_cmd_create_qp(priv->ctx, &attr); if (!eqp->sw_qp) { DRV_LOG(ERR, "Failed to create SW QP(%u).", rte_errno); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:17.233466982 +0100 +++ 0027-vdpa-mlx5-fix-overflow-in-queue-attribute.patch 2021-07-26 13:53:15.853292706 +0100 @@ -1 +1 @@ -From c6b552e4c0aaedf910ddae0345faee360394958b Mon Sep 17 00:00:00 2001 +From c571fde575c25bf56e3470bea9a539d635654009 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c6b552e4c0aaedf910ddae0345faee360394958b ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 88f6a4256d..3541c652ce 100644 +index 266cd8e57c..03c7f849ca 100644 @@ -29 +30 @@ -@@ -629,8 +629,8 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, uint16_t desc_n, +@@ -689,8 +689,8 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, uint16_t desc_n,