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 02DCCA00C3; Tue, 19 Apr 2022 09:48:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 951194113C; Tue, 19 Apr 2022 09:48:03 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0FFBD406A2 for ; Tue, 19 Apr 2022 09:48:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650354482; x=1681890482; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=soZEOlPaZDYWJK582B374G4S5rjpEAf/cO/hHvnfTro=; b=n9u+RVHRti1+6OK9o7eMRSS+cVBORhMfGxXGGDg3eqX/g8gHVSo3oWUV wWfzpenZ/H/KnkzcqmWXEfLLL3mZfwntNmow7HX+Rc8sPxgbFqJxqN358 KrVQBDs7AES+fATv8lpGqP8OnAtpHOS5mpr29y9UHF2vVm5veKmtb5wmd 6EEUEcK0pO9Tsc36XeytV/rzMPYKXqkYleVA/dUd5w9VaHinfnhXEdi5z lHs33AOGtp4Qwj0+rqHhflByTffmaSej7hXnDQF8qmIewBk1jGFiNuAAm WgqHPWf3ct2N5XxPhvMIq3WOUGVr0N+1leId9VkfT7kj0EPsTTM3EmQIx Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="244288643" X-IronPort-AV: E=Sophos;i="5.90,272,1643702400"; d="scan'208";a="244288643" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2022 00:48:01 -0700 X-IronPort-AV: E=Sophos;i="5.90,272,1643702400"; d="scan'208";a="575971773" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2022 00:47:58 -0700 From: Kevin Liu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Dapeng Yu , Kevin Liu Subject: [PATCH v4 10/23] net/ice: enable CVL DCF device reset API Date: Tue, 19 Apr 2022 15:46:01 +0000 Message-Id: <20220419154614.476154-11-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220419154614.476154-1-kevinx.liu@intel.com> References: <20220413171030.2231163-1-kevinx.liu@intel.com> <20220419154614.476154-1-kevinx.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Dapeng Yu Enable CVL DCF device reset API. Signed-off-by: Dapeng Yu Signed-off-by: Kevin Liu --- drivers/net/ice/ice_dcf.c | 24 ++++++++++++++++++++++++ drivers/net/ice/ice_dcf.h | 1 + 2 files changed, 25 insertions(+) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 885d58c0f4..9c2f13cf72 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -1163,3 +1163,27 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, rte_free(list); return err; } + +int +ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw) +{ + int ret; + + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + + ice_dcf_disable_irq0(hw); + rte_intr_disable(intr_handle); + rte_intr_callback_unregister(intr_handle, ice_dcf_dev_interrupt_handler, + hw); + ret = ice_dcf_mode_disable(hw); + if (ret) + goto err; + ret = ice_dcf_get_vf_resource(hw); +err: + rte_intr_callback_register(intr_handle, ice_dcf_dev_interrupt_handler, + hw); + rte_intr_enable(intr_handle); + ice_dcf_enable_irq0(hw); + return ret; +} diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h index 32e6031bd9..8cf17e7700 100644 --- a/drivers/net/ice/ice_dcf.h +++ b/drivers/net/ice/ice_dcf.h @@ -137,6 +137,7 @@ int ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, uint8_t type); int ice_dcf_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complete); +int ice_dcf_cap_reset(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw); void ice_dcf_tm_conf_init(struct rte_eth_dev *dev); void ice_dcf_tm_conf_uninit(struct rte_eth_dev *dev); int ice_dcf_replay_vf_bw(struct ice_dcf_hw *hw, uint16_t vf_id); -- 2.33.1