From patchwork Fri Aug 12 02:52:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 114849 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 427D1A0540; Fri, 12 Aug 2022 05:03:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CF5F406A2; Fri, 12 Aug 2022 05:03:22 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 94C7D40697; Fri, 12 Aug 2022 05:03:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660273400; x=1691809400; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5WMDTEWmTubakA6Lc9mV0cP1o2y3FcU2rbFu4pZaJ9c=; b=cF2CSqsS8ocKM3zL3QJBc5P1czwG+rcXb21UdrTDS7DM2it9A1vvd74D QifmPcP+BweBm5sXc14I863iMAx8e5l/+CXNj5UD07D5pvMJgITGrQpQ4 IRDDrluNw+x+8n3aMl17inajbSyLCW5FTKwSYEs9mrk49xdSWj9xXphJ2 9aCJMpN/haz77bM0o9rGKkPB/vitvB6Aca6w3niFvExaNPCMwLDDgmoeb HpJC4eXqyB9b8VOdP4F5j4cG+AuQkJ9b7uWuO6Y/cdrwvuINXACIgXEBc PKq4HOnf88K4MjYwBFkul0+XqMLOYGAR8W/8TLtsj8m1GcQw0gDnHolds A==; X-IronPort-AV: E=McAfee;i="6400,9594,10436"; a="278459057" X-IronPort-AV: E=Sophos;i="5.93,231,1654585200"; d="scan'208";a="278459057" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 20:03:19 -0700 X-IronPort-AV: E=Sophos;i="5.93,231,1654585200"; d="scan'208";a="581929570" Received: from intel-cd-odc-steve.cd.intel.com ([10.240.178.188]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 20:03:17 -0700 From: Steve Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, Steve Yang , stable@dpdk.org Subject: [PATCH v1] net/ice/base: fix switch rules not cleared on warm reset Date: Fri, 12 Aug 2022 02:52:54 +0000 Message-Id: <20220812025254.145132-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When users killed app forcely (e.g.: kill -9 pid), the driver reset couldn't make all registers of NIC recovery to initial status. For example, the switch filter rules, which involved the vlan tag, couldn't be added. Tell the Firmware to shut down the AdminQ to avoid possible error when process was killed abnormally. Fixes: 453d087ccaff ("net/ice/base: add common functions") Cc: stable@dpdk.org Signed-off-by: Steve Yang --- drivers/net/ice/base/ice_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index db87bacd97..66b51be29d 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -926,6 +926,11 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_cqinit; + /* Tell the Firmware to shut down the AdminQ to avoid possible error + * when process was killed abnormally. + */ + ice_aq_q_shutdown(hw, true); + status = ice_init_nvm(hw); if (status) goto err_unroll_cqinit;