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 DC10FA0508; Wed, 13 Apr 2022 10:11:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6766642805; Wed, 13 Apr 2022 10:11:12 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 9770242805 for ; Wed, 13 Apr 2022 10:11:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649837470; x=1681373470; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=soZEOlPaZDYWJK582B374G4S5rjpEAf/cO/hHvnfTro=; b=ZRmEiH5r4ApScxRduXgxq0CLCvM83Hx46PiT8XzXrL5qRjW4PZbEscGW fqj7DhrWKUnvfbZxZYtFitMbPRWLPrM2Hm1Xew39rjz3wzmv2hibOaDnm imGjRoKqv7wRajmvRLLcRsVEKLCvszY/aGzl+X1QFiA/tYpBa0+NB0gx5 GqgG2UG/sayJZK9z7RcLDQIgmyzC522PGhQDo7dkf6vP5USGcEqX9fOYM liIRvq+eRPmNk5fWl681dUFHKHyy6jbq+gtx1zCxwTDOC18kitlAa93FJ KpbjZQMyGpvtgLHNy0pt9DEE0vDTxin3Rsbiy5dUxYPFXh9LF9Q8k4t33 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="243189118" X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="243189118" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 01:11:06 -0700 X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="526847611" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 01:11:04 -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 v2 10/33] net/ice: enable CVL DCF device reset API Date: Wed, 13 Apr 2022 16:09:09 +0000 Message-Id: <20220413160932.2074781-11-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220413160932.2074781-1-kevinx.liu@intel.com> References: <20220407105706.18889-1-kevinx.liu@intel.com> <20220413160932.2074781-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