From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by dpdk.org (Postfix) with ESMTP id 2205747D1 for ; Mon, 19 Sep 2016 20:50:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3109; q=dns/txt; s=iport; t=1474311020; x=1475520620; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=nRCU+7BFslAgDv0PIG6/BlOY3HvNB0au9oHYoT1wG7I=; b=ToSL/1iLU1a3Th/hkAFNKKl1IijBcUxmwRCs0kRkMph2/OqJ+pFu/4IP GLP/Bziz5myo2l6nvgEjDMsLjA3zpwaRz7MFZVoWD/eRjeQ5MsNOTuYRt Ely2H/WIJj5dkNvb1NOvChlLJqLFY0g7XD/1/asiRzIGWYMylX6OmXKku s=; X-IronPort-AV: E=Sophos;i="5.30,363,1470700800"; d="scan'208";a="153586079" Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Sep 2016 18:50:19 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id u8JIoIoU003026; Mon, 19 Sep 2016 18:50:19 GMT Received: by cisco.com (Postfix, from userid 412739) id D97CA3FAAE0F; Mon, 19 Sep 2016 11:50:18 -0700 (PDT) From: Nelson Escobar To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Mon, 19 Sep 2016 11:50:11 -0700 Message-Id: <1474311011-19978-3-git-send-email-neescoba@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1474311011-19978-1-git-send-email-neescoba@cisco.com> References: <1474311011-19978-1-git-send-email-neescoba@cisco.com> Subject: [dpdk-dev] [PATCH 3/3] net/enic: enable link check interrupts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2016 18:50:21 -0000 Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- doc/guides/nics/enic.rst | 3 ++- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/enic.rst b/doc/guides/nics/enic.rst index 42e781e..8170286 100644 --- a/doc/guides/nics/enic.rst +++ b/doc/guides/nics/enic.rst @@ -76,7 +76,8 @@ Configuration information Only one interrupt per vNIC interface should be configured in the UCS manager regardless of the number receive/transmit queues. The ENIC PMD - uses this interrupt to get information about errors in the fast path. + uses this interrupt to get information about link status and errors + in the fast path. Limitations ----------- diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index e10c824..44105d6 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -607,7 +607,7 @@ static struct eth_driver rte_enic_pmd = { .pci_drv = { .name = "rte_enic_pmd", .id_table = pci_id_enic_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, }, .eth_dev_init = eth_enicpmd_dev_init, .dev_private_size = sizeof(struct enic), diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index aaf47e6..55c7217 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -430,10 +430,13 @@ static void enic_intr_handler(__rte_unused struct rte_intr_handle *handle, void *arg) { - struct enic *enic = pmd_priv((struct rte_eth_dev *)arg); + struct rte_eth_dev *dev = (struct rte_eth_dev *)arg; + struct enic *enic = pmd_priv(dev); vnic_intr_return_all_credits(&enic->intr); + enic_link_update(enic); + _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC); enic_log_q_error(enic); } @@ -447,6 +450,13 @@ int enic_enable(struct enic *enic) eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */ + /* vnic notification of link status has already been turned on in + * enic_dev_init() which is called during probe time. Here we are + * just turning on interrupt vector 0 if needed. + */ + if (eth_dev->data->dev_conf.intr_conf.lsc) + vnic_dev_notify_set(enic->vdev, 0); + if (enic_clsf_init(enic)) dev_warning(enic, "Init of hash table for clsf failed."\ "Flow director feature will not work\n"); @@ -838,6 +848,13 @@ int enic_disable(struct enic *enic) } } + /* If we were using interrupts, set the interrupt vector to -1 + * to disable interrupts. We are not disabling link notifcations, + * though, as we want the polling of link status to continue working. + */ + if (enic->rte_dev->data->dev_conf.intr_conf.lsc) + vnic_dev_notify_set(enic->vdev, -1); + vnic_dev_set_reset_flag(enic->vdev, 1); vnic_dev_notify_unset(enic->vdev); -- 2.7.0