From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CF7BA04D7; Thu, 3 Sep 2020 09:24:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 936131BEAF; Thu, 3 Sep 2020 09:24:06 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4CD44CF3 for ; Thu, 3 Sep 2020 09:24:04 +0200 (CEST) IronPort-SDR: /wyUS/z7o1O3ueYFDQwqejb4VedCdZ1v4d1PCneVNga6g9TDGqp0myTTsBOBPknX/lT7cdQKd0 lmUKGy8g9zVw== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="242350497" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="242350497" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2020 00:24:03 -0700 IronPort-SDR: f244QXoFvPQg/YUerWqxmHk4WzRjAWJDPOAFwIFIBLV9EPZdSwBH0xuPewRi5OiQaHpKrfQWrl 6/52xJe6Flfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315388559" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 03 Sep 2020 00:24:01 -0700 From: SteveX Yang To: dev@dpdk.org Cc: qi.z.zhang@intel.com, beilei.xing@intel.com, jia.guo@intel.com, qiming.yang@intel.com, SteveX Yang Date: Thu, 3 Sep 2020 07:19:12 +0000 Message-Id: <20200903071912.27695-1-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811091040.24602-1-stevex.yang@intel.com> References: <20200811091040.24602-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] net/i40e: i40evf exposes LSC flag to application X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When PF event VIRTCHNL_EVENT_LINK_CHANGE received, i40evf need update the link status and issue RTE_ETH_EVENT_INTR_LSC via rte ether device callback function. Signed-off-by: SteveX Yang --- v2: - add RTE_PCI_DRV_INTR_LSC in drv_flags - configure the intr_conf.lsc according to RTE_ETH_EVENT_INTR_LSC - update i40e_vf.ini --- doc/guides/nics/features/i40e_vf.ini | 1 + drivers/net/i40e/i40e_ethdev_vf.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/features/i40e_vf.ini b/doc/guides/nics/features/i40e_vf.ini index 9f95063d2..4984a6177 100644 --- a/doc/guides/nics/features/i40e_vf.ini +++ b/doc/guides/nics/features/i40e_vf.ini @@ -6,6 +6,7 @@ [Features] Rx interrupt = Y Link status = Y +Link status event = Y Fast mbuf free = P Queue start/stop = Y Jumbo frame = Y diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 69cab8e73..b4e42939e 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1381,13 +1381,16 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg, switch (pf_msg->event) { case VIRTCHNL_EVENT_RESET_IMPENDING: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event"); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, - NULL); + _rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_RESET, NULL); break; case VIRTCHNL_EVENT_LINK_CHANGE: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event"); vf->link_up = pf_msg->event_data.link_event.link_status; vf->link_speed = pf_msg->event_data.link_event.link_speed; + i40evf_dev_link_update(dev, 0); + _rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, NULL); break; case VIRTCHNL_EVENT_PF_DRIVER_CLOSE: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event"); @@ -1609,7 +1612,7 @@ static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) */ static struct rte_pci_driver rte_i40evf_pmd = { .id_table = pci_id_i40evf_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .probe = eth_i40evf_pci_probe, .remove = eth_i40evf_pci_remove, }; @@ -1635,6 +1638,9 @@ i40evf_dev_configure(struct rte_eth_dev *dev) ad->tx_simple_allowed = true; ad->tx_vec_allowed = true; + dev->data->dev_conf.intr_conf.lsc = + !!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC); + if (num_queue_pairs > vf->vsi_res->num_queue_pairs) { struct i40e_hw *hw; int ret; -- 2.17.1