Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2566733lkm; Mon, 20 Sep 2021 18:53:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWyp5e//mt+YUjf+tFNGOgtcXHvNdWuSUTC5E3Z0GV+HNGYNy10qxOMUzXiycNmt5sSHVa X-Received: by 2002:a6b:3c16:: with SMTP id k22mr21355404iob.130.1632188866781; Mon, 20 Sep 2021 18:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188866; cv=none; d=google.com; s=arc-20160816; b=BGjPq5hTRVFsequAB0GdXZsUJNxnN8cUrR+Z7dI7ygFS0W7xcPRL1NO4YP+x0SdWn4 8+aJZd+QeIWAZsWAsYSfFUfhEQ15JitJAUECySkEHiLzzWxPMJJEo/XAIxITHwIGM0Cr gzGVaGU0Kuwz2uyq+cbWZszf6h8SybK1X4O38Esr4C2EaOb/RHxDeodWO00xTvhLY6w3 KoGkFX8hA2QzsckmcSjaMv21XWCFGzpeDzk7RADy5Wz2qiM0RQ3prU62CdSDHbnPRgBb 2hC+SXR+VEd/L8qAcdEKeA04ASXHSZlHgrzgNFm9rpMD90RXqHWmeZgoSQJjMa5JYVf+ 0s9Q== 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=LV8EtVSGnSqG7sCbz0WAHSG9Z/O5iOErgaAsbNVzrU4=; b=VftqbXr4eHYZT83hwPLS5D+77CwmVoFlFmiMpb+nlGT16uklpvNpAEij8bryeG8dZF BGj/YYn8CHvhlQjLSTS+s8/QqJkv/2dJUc2/5lEap+VBoVpFmI/bCOQlYL5i6wJkJ2bF 7ILiXtxG0zk3MU6KvsXBoMwFfvJ4qBlzpDpgoreGTPlaqr5HXTBbXqhhwnGoo6aTmjPQ RCfugJscMrVXpz5AmGODkFRKXgM6UQEodkqL+uso/TrhogoGIQkZhehmAF4tICnfkCSG HGYTb0t7a+nF4LNel0eDY3voDryC8WE6F0S+eBoZ+GDab4ny5KQd+8SJeFJtDWKUUh5g 19NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cHea5pXl; 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 p16si15348342iov.22.2021.09.20.18.47.32; Mon, 20 Sep 2021 18:47:46 -0700 (PDT) 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=cHea5pXl; 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 S1346502AbhITRfx (ORCPT + 99 others); Mon, 20 Sep 2021 13:35:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:35418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347438AbhITReD (ORCPT ); Mon, 20 Sep 2021 13:34:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D5C961506; Mon, 20 Sep 2021 17:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157531; bh=HBIRkgjNfE00HLI5pXB5VaR9RBqzHURHnstPnQz+qfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHea5pXlAHMMzazEGdgcWcU2AzJ6rJI/mGEa4ASF/4D3B0L++oRUZViCMde2R6tgh aI83632PRxMNLSrvH3MGtQw+f/YsMR29kkXMmIwVu88izIJZRoFDApmr0QZ3aXksNe ahJrunr4x4xM1QoLKwCSucSy/9NbtC3iRivXjywI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prabhakar Kushwaha , Ariel Elior , Shai Malin , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 004/293] qed: Fix the VF msix vectors flow Date: Mon, 20 Sep 2021 18:39:26 +0200 Message-Id: <20210920163933.406472873@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Shai Malin [ Upstream commit b0cd08537db8d2fbb227cdb2e5835209db295a24 ] For VFs we should return with an error in case we didn't get the exact number of msix vectors as we requested. Not doing that will lead to a crash when starting queues for this VF. Signed-off-by: Prabhakar Kushwaha Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 049a83b40e46..9d77f318d11e 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -439,7 +439,12 @@ static int qed_enable_msix(struct qed_dev *cdev, rc = cnt; } - if (rc > 0) { + /* For VFs, we should return with an error in case we didn't get the + * exact number of msix vectors as we requested. + * Not doing that will lead to a crash when starting queues for + * this VF. + */ + if ((IS_PF(cdev) && rc > 0) || (IS_VF(cdev) && rc == cnt)) { /* MSI-x configuration was achieved */ int_params->out.int_mode = QED_INT_MODE_MSIX; int_params->out.num_vectors = rc; -- 2.30.2