Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3668585pxb; Mon, 24 Jan 2022 14:56:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPgt1B9VjQIL+/RSrPFrgM6iidrXbreSn6PYkemSwIRI99BXllv6n4g4YQ3azZeKM1AtCf X-Received: by 2002:a17:90b:1bcf:: with SMTP id oa15mr81279pjb.67.1643064967177; Mon, 24 Jan 2022 14:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064967; cv=none; d=google.com; s=arc-20160816; b=0314egFBeWFYfgKxdjDxV/+WnJVeUoxQsJDWd2JTazyti1LkragpdNjyW0EI3or/ws u9hgcC+oTLZxjPfQ+D8OasL2trzzLU3IleI9DO01NdBvi90UZs/ufTNneF3W932eBOSS SgxJMLB7m8PkiTrw9yG0QYF5yGoX1zrrOrcALajXz0/Kjh8+5xS7bU7JMW3JYgb8TiIz XDD8axDAnkYj/aICeW5mFuS3HWObnvE63HC0r2xjoeDTsqhzfHlSatnbGXo61Fa5wlj9 VO9XMdHWgyDqyY+Q7DUGV7Aq1sZRM194CpoElDspl+HdX5du4pVrQsyREN7CYGZdSCK7 ZWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WT04DBJwgbQ/x0F142IVHRvTWBVdq7TjkDGz0DiUG5w=; b=dixDfLo8bC6+gY/pYpAOCsTmmlVb2nAf8jqH/Ia965Oo0VfNqENUYX8eBCvTfeihBr rzTFVi7BADZB0G5ySwrk1CyyNBu+v1ixIC2+lj1/ExAAxL0XdvOioK5bkKj9fhzxRwJa iefi92kVLU6jnhfLM8xEQK9AYFzTgDH8IsmoXNrKWgL7eBAhU5gcKpbtFLG2LAF8W8yr KA4DfIYsvIQgbuqtCwT3n52C749AujmULS56N9lxQjaw7G6G0D0EOoZ4f6vdIea5bwNF 0LL2MgC6BglXcYRcBG5Td51x2pg4I/XpQD/U38+vzmj/QHP6nqcMjaRg3dgwilA3EA76 FhVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=blaPTSwN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o4si12495181pls.567.2022.01.24.14.55.55; Mon, 24 Jan 2022 14:56:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=blaPTSwN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839732AbiAXWvs (ORCPT + 99 others); Mon, 24 Jan 2022 17:51:48 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:50594 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1458060AbiAXVmp (ORCPT ); Mon, 24 Jan 2022 16:42:45 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E869DB8123D; Mon, 24 Jan 2022 21:42:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21676C340E4; Mon, 24 Jan 2022 21:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060562; bh=zn1/vkIKSsHHShRtUDmM69UDuNQVHj7HCPJ6GFMa9Z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=blaPTSwNxyduXVjzx/ZF9rfpvfSo/NqqP9IQfGpuwyvrUrh6MWcPzrelwgtlLWjDJ mAEs4LQqGrIHnftydi7evgRPjq6MM4P9Rm2oWXt9Oy+pLQeL8f9SwhuJPqgEZReD7w fEumhSyAnLvlOdSQGaizXrcpX7fJ8oA+RTtzRW7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Si-Wei Liu , Jason Wang , Eli Cohen , "Michael S. Tsirkin" Subject: [PATCH 5.16 0990/1039] vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() Date: Mon, 24 Jan 2022 19:46:19 +0100 Message-Id: <20220124184158.565151475@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eli Cohen commit 37e07e705888e4c3502f204e9c6785c9c2d6d86a upstream. Restore ndev->cur_num_vqs to the original value in case change_num_qps() fails. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-10-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1552,9 +1552,11 @@ static int change_num_qps(struct mlx5_vd return 0; clean_added: - for (--i; i >= cur_qps; --i) + for (--i; i >= 2 * cur_qps; --i) teardown_vq(ndev, &ndev->vqs[i]); + ndev->cur_num_vqs = 2 * cur_qps; + return err; }