From nobody Mon Feb 9 12:01:16 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF76A4CE09; Wed, 13 Mar 2024 16:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347578; cv=none; b=kL8VyoCkn02YAjue+5lOK1k3IXRjDjmhiX+NOEOxeZRRieCSkZVXmUeSOqXECU8iqUkLRK4zNv7D0ZosNOjwRGyXdeIPEJ0rg3EqBk6tV8C2BGwXx3KlS2pHTtpREJXR3QJVy0kXbZp9OBS2+ymMP/M7QXZSRx8TX1p+8idH3FE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347578; c=relaxed/simple; bh=WrKmOiZB7xxVRnCnneu1fDs8CnTQYWSyPmlU31A6yd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b5dhIbm9JU6zxZWXlf/4WShtYPSyXWSRBWI1EPwwaXgWz5pslhQckjm88kWue5z+7mZu6+5sfkhigQp6TlQlPqaFhhkljfyoSVyKL7B7DXl7RIzM49Jb8utMPNXHOys0xpEUw7nqKQwTtyc6l766xH0v4DwWUjSTroae07RZ570= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UuJ/sdI7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UuJ/sdI7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 778AAC433C7; Wed, 13 Mar 2024 16:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347577; bh=WrKmOiZB7xxVRnCnneu1fDs8CnTQYWSyPmlU31A6yd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuJ/sdI7f68rf0oXfoAk8tlGPJt1GwG/QN0/BdDUao/w2hkTq0dlbsYG8UG803Vew jDPf1qpf7JnVqruu+oH+HvxDT4y/LeIqSfnXRj2/Leg8txaeMw3MC4c09tx3Y4QN66 rjMNRDIxBG8rh3Hwt0MBsdMNMTWGt2VzB/bIrDFFNKyLW0GGLPDTU3oR6wGmdB01jn zk58DdSqvptKkqDKPE0KjEJdOyM5WicZmtgad6jpKqlBnEN/BzS/OlMDFLKMhexwcR W4vmQacwSph9pRa+CvupNS0GcysxbCnrm2aI6o/4PqUoDFxBZhSC4nf39X6LphEcOw h31uUwutFBBjw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michal Swiatkowski , Jacob Keller , Simon Horman , Rafal Romanowski , Tony Nguyen , Sasha Levin Subject: [PATCH 6.7 15/61] ice: reconfig host after changing MSI-X on VF Date: Wed, 13 Mar 2024 12:31:50 -0400 Message-ID: <20240313163236.613880-16-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Michal Swiatkowski [ Upstream commit 4035c72dc1ba81a96f94de84dfd5409056c1d9c9 ] During VSI reconfiguration filters and VSI config which is set in ice_vf_init_host_cfg() are lost. Recall the host configuration function to restore them. Without this config VF on which MSI-X amount was changed might had a connection problems. Fixes: 4d38cb44bd32 ("ice: manage VFs MSI-X using resource tracking") Reviewed-by: Jacob Keller Signed-off-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_sriov.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ether= net/intel/ice/ice_sriov.c index c4caa9df473b5..cd61928700211 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -1074,6 +1074,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_d= ev, int msix_vec_count) struct ice_pf *pf =3D pci_get_drvdata(pdev); u16 prev_msix, prev_queues, queues; bool needs_rebuild =3D false; + struct ice_vsi *vsi; struct ice_vf *vf; int id; =20 @@ -1108,6 +1109,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_= dev, int msix_vec_count) if (!vf) return -ENOENT; =20 + vsi =3D ice_get_vf_vsi(vf); + if (!vsi) + return -ENOENT; + prev_msix =3D vf->num_msix; prev_queues =3D vf->num_vf_qs; =20 @@ -1128,7 +1133,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_d= ev, int msix_vec_count) if (vf->first_vector_idx < 0) goto unroll; =20 - if (ice_vf_reconfig_vsi(vf)) { + if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) { /* Try to rebuild with previous values */ needs_rebuild =3D true; goto unroll; @@ -1154,8 +1159,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_= dev, int msix_vec_count) if (vf->first_vector_idx < 0) return -EINVAL; =20 - if (needs_rebuild) + if (needs_rebuild) { ice_vf_reconfig_vsi(vf); + ice_vf_init_host_cfg(vf, vsi); + } =20 ice_ena_vf_mappings(vf); ice_put_vf(vf); --=20 2.43.0