summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Escobar <neescoba@cisco.com>2016-09-19 11:50:11 -0700
committerBruce Richardson <bruce.richardson@intel.com>2016-09-30 12:27:18 +0200
commit53fa8cc0d56d0f7e700fdcddfb4fa45c8d2b428d (patch)
tree831ae7da161340e6503e7b9e3a387a8e0d18c1e3
parentcf8d9826b7be31c93b306f588638318c8b39c177 (diff)
downloaddpdk-53fa8cc0d56d0f7e700fdcddfb4fa45c8d2b428d.zip
dpdk-53fa8cc0d56d0f7e700fdcddfb4fa45c8d2b428d.tar.gz
dpdk-53fa8cc0d56d0f7e700fdcddfb4fa45c8d2b428d.tar.xz
net/enic: enable link check interrupt
Signed-off-by: Nelson Escobar <neescoba@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
-rw-r--r--doc/guides/nics/enic.rst3
-rw-r--r--doc/guides/nics/features/enic.ini1
-rw-r--r--drivers/net/enic/enic_ethdev.c2
-rw-r--r--drivers/net/enic/enic_main.c19
4 files changed, 22 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/doc/guides/nics/features/enic.ini b/doc/guides/nics/features/enic.ini
index 7e0241f..7d3f801 100644
--- a/doc/guides/nics/features/enic.ini
+++ b/doc/guides/nics/features/enic.ini
@@ -5,6 +5,7 @@
;
[Features]
Link status = Y
+Link status event = Y
Queue start/stop = Y
MTU update = P
Jumbo frame = Y
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index da2abd9..82dc265 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -635,7 +635,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
static struct eth_driver rte_enic_pmd = {
.pci_drv = {
.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,
.probe = rte_eth_dev_pci_probe,
.remove = rte_eth_dev_pci_remove,
},
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index a0283ca..5d9bf4c 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);
}
@@ -446,6 +449,13 @@ int enic_enable(struct enic *enic)
eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev);
eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
+ /* 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");
@@ -837,6 +847,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);
for (i = 0; i < enic->wq_count; i++)