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 7EF4B45DC0 for ; Thu, 28 Nov 2024 12:51:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63EBC402CE; Thu, 28 Nov 2024 12:51:21 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mails.dpdk.org (Postfix) with ESMTP id 2A648402CE for ; Thu, 28 Nov 2024 12:51:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732794679; x=1764330679; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=v5lvsqx5vQmoiCxw1o6Um9ofh/YXW9Ba48DazksoG3o=; b=K8B0xpydHvfexca6/FiGViXAXP3PQe+QKMcfaWy1j+nAhUxmLB+jMbJ5 ohleSGl12rJxclU+YnXjolhzD4ki/1dB9ZFctVl+HFgBv394kGqPw5TbG MRdGTu0g2Z3COrurg73Y/60yyT0yd2oa6/IOozlYSLBNxPphKGZM4TV4S LyVoJqrsopRUXO8ZzKWc8oyUJ90Pb7OYzbFpQbnjNd1PCUbmnvJDEqJAs Su5+ty1Aerc8nNYlXqUuIiiZZZ2kT++xJC5mInkYO4sPsrxQfTMnyrVN3 0qRRbm1j7rC3+xRSD/75om4wZqIRTjxvRiYOvAwjqvrgHEeagsZlfUnCN g==; X-CSE-ConnectionGUID: Be0ab1V+Qo+CMJyUkp8t0g== X-CSE-MsgGUID: HxqzZT42SG6dTKZpR7WIyw== X-IronPort-AV: E=McAfee;i="6700,10204,11269"; a="32771016" X-IronPort-AV: E=Sophos;i="6.12,192,1728975600"; d="scan'208";a="32771016" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2024 03:51:18 -0800 X-CSE-ConnectionGUID: 4TvwbMH1SMGvbxF1sR+y7g== X-CSE-MsgGUID: 75a/8Z2+T8yPH0ryT4nSjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,192,1728975600"; d="scan'208";a="93056328" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by orviesa008.jf.intel.com with ESMTP; 28 Nov 2024 03:51:17 -0800 From: Bruce Richardson To: stable@dpdk.org Cc: ktraynor@redhat.com, Bruce Richardson Subject: [PATCH 21.11] net/iavf: fix VF reset when using DCF Date: Thu, 28 Nov 2024 11:51:02 +0000 Message-ID: <20241128115102.1287585-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 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 On the latest ice kernel driver, renegotiating VIRTCHNL_OP_GET_VF_RESOURCES will fail when using DCF (Device Config Function) if a hardware reset is not done. Fix this by sending VIRTCHNL_OP_RESET_VF to PF before DPDK resets VF. Fixes: e74e1bb6280d ("net/iavf: enable port reset") Signed-off-by: Bruce Richardson --- Note: This fix is effectively a merge of previous main tree patches: 0f9ec0cbd2a9 ("net/iavf: fix VF reset when using DCF") b34fe66ea893 ("net/iavf: delay VF reset command") The latter was tagged for possible backport to 21.11, but we are actually using commit log of former - with the commit body mostly the latter, since it reworked the original fix. --- drivers/common/iavf/iavf_prototype.h | 1 + drivers/common/iavf/version.map | 1 + drivers/net/iavf/iavf_ethdev.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/common/iavf/iavf_prototype.h b/drivers/common/iavf/iavf_prototype.h index 1c125d1d94..b32754938a 100644 --- a/drivers/common/iavf/iavf_prototype.h +++ b/drivers/common/iavf/iavf_prototype.h @@ -83,6 +83,7 @@ void iavf_destroy_spinlock(struct iavf_spinlock *sp); __rte_internal void iavf_vf_parse_hw_config(struct iavf_hw *hw, struct virtchnl_vf_resource *msg); +__rte_internal enum iavf_status iavf_vf_reset(struct iavf_hw *hw); __rte_internal enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, diff --git a/drivers/common/iavf/version.map b/drivers/common/iavf/version.map index e0f117197c..6c1427cca4 100644 --- a/drivers/common/iavf/version.map +++ b/drivers/common/iavf/version.map @@ -7,6 +7,7 @@ INTERNAL { iavf_set_mac_type; iavf_shutdown_adminq; iavf_vf_parse_hw_config; + iavf_vf_reset; local: *; }; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 4885a86ad3..fdfc9b1e4e 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2710,6 +2710,7 @@ iavf_dev_close(struct rte_eth_dev *dev) vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT; } + iavf_vf_reset(hw); iavf_shutdown_adminq(hw); if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* disable uio intr before callback unregister */ -- 2.43.0