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 C74DD43C60 for ; Thu, 7 Mar 2024 02:35:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB5B242EE3; Thu, 7 Mar 2024 02:35:02 +0100 (CET) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id 16A2A42ECF for ; Thu, 7 Mar 2024 02:34:59 +0100 (CET) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33d153254b7so166605f8f.0 for ; Wed, 06 Mar 2024 17:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775299; x=1710380099; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6xpcvmLbNl97yxewA06Gl7l14UmDkDp2GY7/qO6yEvU=; b=TxycOUc48+QTFwiO+Tv9UR1YT7cSv78/v8MYEZINUJ8tvDxAFtq0Fh6TqryHld8GyV 6vQve/xSXA0+dL/VcJzLCsGY1F+GdRLDSUrsndQRxCcOo40EX8UUG+x+DQ0I8tdVtMgx BhbA2VATc4NNW85nsbyca+Hd5YS46JSEwN9bl0R/K6Eq5LEcKFVUYtoGE6pM8dbStkcE k48rnM7YClW5Exii0UNZo8cGwC0+UsbItYuSV2LgpD/1RfCrbTmTgFJsgwJcEKXxEv8o nPD2q/TDUirx/fzUgHihAxTU29hZVD49XwHa2i9DCUJZ+SC15ZKJocoF0b6OjDJU8Un6 O+xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775299; x=1710380099; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6xpcvmLbNl97yxewA06Gl7l14UmDkDp2GY7/qO6yEvU=; b=nme9Nftw+w1jWKO80p+n3i4RnsKzTvanZlNId37N7XD/PGXf6HD2PAi9DYp/1d6AYO 6HPjDhHJncJFVqomhNizqU6xOFpS2yElgpUtVQLo6Dk5MC2trQfNO5ZC9CrKWPDekJt8 6MqjdDviL3p9SrLmeqzKEeWlANDPOv8hD76y662/AXyvNhkmE5JzI5LnY6UNGPRso+iZ ZIbABS7VM9qPXIB3q4Da0uD41TBxKUc+k/vxG1i7QIvO08piTH0HB5qJ+P5x84glVaHg wag9EF4/Ix5KZGCVHiE90q4ECBFjFbZbrKLDY7/MAAySss091VynQo5jSnQwHBEo9ABX y5KA== X-Forwarded-Encrypted: i=1; AJvYcCVjnF6VsXytEavyJt47rM1GyRt8WvdO5pK4jmoYUYoufw8EKk2+uPC0z3NHPRiDS4/gw3rgX88VwMT07acDqfA= X-Gm-Message-State: AOJu0YyPGVhNtZchqmWyFqaQBvnTpYCbOBE9yCoFz1tU1ytRjoxZFxkS PPvB6cRJE6q9H6tNDqkjXwIOe8/zrkylIpLmBG6UIwn2dnLes55X X-Google-Smtp-Source: AGHT+IFj1TwO+wNVBOpYY+vGUtRfF4ND0SkaApuN6LxqImN4X8Me7/BBHhJuKe0fGTiHigiFNzEr4A== X-Received: by 2002:a05:6000:2c5:b0:33d:14a7:c4b with SMTP id o5-20020a05600002c500b0033d14a70c4bmr14915082wry.40.1709775298721; Wed, 06 Mar 2024 17:34:58 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id bj25-20020a0560001e1900b0033e49aebafasm5886868wrb.3.2024.03.06.17.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:34:58 -0800 (PST) From: luca.boccassi@gmail.com To: Yajun Wu Cc: Matan Azrad , Maxime Coquelin , dpdk stable Subject: patch 'vdpa/mlx5: fix queue enable drain CQ' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:04 +0000 Message-Id: <20240307013159.1735343-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/24. 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/49dfcc6ae2ae7fe2e79edd686be6664281d1d677 Thanks. Luca Boccassi --- >From 49dfcc6ae2ae7fe2e79edd686be6664281d1d677 Mon Sep 17 00:00:00 2001 From: Yajun Wu Date: Thu, 25 Jan 2024 11:17:55 +0800 Subject: [PATCH] vdpa/mlx5: fix queue enable drain CQ [ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ] For the case: `ethtool -L eth0 combined xxx` in VM, VQ will disable and enable without calling device close. In such case, need add drain CQ before reuse/reset event QP. Fixes: 24969c7b6224 ("vdpa/mlx5: reuse event queues") Signed-off-by: Yajun Wu Acked-by: Matan Azrad Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 4d819763d8..b14174e02d 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -244,22 +244,30 @@ mlx5_vdpa_queues_complete(struct mlx5_vdpa_priv *priv) return max; } +static void +mlx5_vdpa_drain_cq_one(struct mlx5_vdpa_priv *priv, + struct mlx5_vdpa_virtq *virtq) +{ + struct mlx5_vdpa_cq *cq = &virtq->eqp.cq; + + mlx5_vdpa_queue_complete(cq); + if (cq->cq_obj.cq) { + cq->cq_obj.cqes[0].wqe_counter = rte_cpu_to_be_16(UINT16_MAX); + virtq->eqp.qp_pi = 0; + if (!cq->armed) + mlx5_vdpa_cq_arm(priv, cq); + } +} + void mlx5_vdpa_drain_cq(struct mlx5_vdpa_priv *priv) { + struct mlx5_vdpa_virtq *virtq; unsigned int i; for (i = 0; i < priv->caps.max_num_virtio_queues; i++) { - struct mlx5_vdpa_cq *cq = &priv->virtqs[i].eqp.cq; - - mlx5_vdpa_queue_complete(cq); - if (cq->cq_obj.cq) { - cq->cq_obj.cqes[0].wqe_counter = - rte_cpu_to_be_16(UINT16_MAX); - priv->virtqs[i].eqp.qp_pi = 0; - if (!cq->armed) - mlx5_vdpa_cq_arm(priv, cq); - } + virtq = &priv->virtqs[i]; + mlx5_vdpa_drain_cq_one(priv, virtq); } } @@ -658,6 +666,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n, if (eqp->cq.cq_obj.cq != NULL && log_desc_n == eqp->cq.log_desc_n) { /* Reuse existing resources. */ eqp->cq.callfd = callfd; + mlx5_vdpa_drain_cq_one(priv, virtq); /* FW will set event qp to error state in q destroy. */ if (reset && !mlx5_vdpa_qps2rst2rts(eqp)) rte_write32(rte_cpu_to_be_32(RTE_BIT32(log_desc_n)), -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:38.944703182 +0000 +++ 0047-vdpa-mlx5-fix-queue-enable-drain-CQ.patch 2024-03-07 01:05:34.786939762 +0000 @@ -1 +1 @@ -From 32fbcf3139fbff04651b3fe173e9f3457f105221 Mon Sep 17 00:00:00 2001 +From 49dfcc6ae2ae7fe2e79edd686be6664281d1d677 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 9557c1042e..32430614d5 100644 +index 4d819763d8..b14174e02d 100644 @@ -65 +66 @@ -@@ -632,6 +640,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n, +@@ -658,6 +666,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n,