Skip to contentSkip to conversation

net/enic: re-enable link status change interrupt

PATCH Superseded Hyong Youb Kim 2 participants 4 messages Nov 2, 2019 – Nov 7, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/enic: re-enable link status change interrupt

When INTx is used, the interrupt handler needs to explicitly re-enable interrupt in order to receive another one in future. The LSC interrupt handler currently does not, and the link state never gets updated when INTx is used (e.g. uio_pci_generic). Call rte_intr_ack() at the end of the handler, to re-enable INTx.

Fixes fefed3d1e62c ("enic: new driver")
---
 drivers/net/enic/Makefile    | 1 +
 drivers/net/enic/enic_main.c | 2 ++
 drivers/net/enic/meson.build | 1 +
 3 files changed, 4 insertions(+)
drivers/net/enic/Makefile +1 -0
index 10736a567..686efa5af 100644
@@ -13,6 +13,7 @@ EXPORT_MAP := rte_pmd_enic_version.map
 
 LIBABIVER := 1
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -I$(SRCDIR)/base/
 CFLAGS += -I$(SRCDIR)
 CFLAGS += -O3
drivers/net/enic/enic_main.c +2 -0
index f5b9b0dcb..57574a5f7 100644
@@ -448,6 +448,8 @@ enic_intr_handler(void *arg)
 	enic_link_update(dev);
 	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	enic_log_q_error(enic);
+	/* Re-enable irq in case of INTx */
+	rte_intr_ack(&enic->pdev->intr_handle);
 }
 
 static int enic_rxq_intr_init(struct enic *enic)
drivers/net/enic/meson.build +1 -0
index 1bd7cc7e1..204c97fa0 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cisco Systems, Inc.
 
+cflags += ['-DALLOW_EXPERIMENTAL_API']
 sources = files(
 	'base/vnic_cq.c',
 	'base/vnic_dev.c',
Signature · 1 line
2.22.0
#1 lore raw
Quoted 22 lines · Hyong Youb Kim

When INTx is used, the interrupt handler needs to explicitly re-enable interrupt in order to receive another one in future. The LSC interrupt handler currently does not, and the link state never gets updated when INTx is used (e.g. uio_pci_generic). Call rte_intr_ack() at the end of the handler, to re-enable INTx.

Fixes fefed3d1e62c ("enic: new driver")
---
 drivers/net/enic/Makefile    | 1 +
 drivers/net/enic/enic_main.c | 2 ++
 drivers/net/enic/meson.build | 1 +
 3 files changed, 4 insertions(+)
drivers/net/enic/Makefile +0 -0
index 10736a567..686efa5af 100644

drivers/net/enic/Makefile EXPORT_MAP := rte_pmd_enic_version.map · line 16

Quoted 4 lines
drivers/net/enic/Makefile +1 -0
@@ -13,6 +13,7 @@ EXPORT_MAP := rte_pmd_enic_version.map
 
 LIBABIVER := 1
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API

Can you please add which function(s) requires this flag, as comment, both for make and meson?
This can help figuring out when to remove this flag.

Quoted 29 lines
drivers/net/enic/Makefile +0 -0
 CFLAGS += -I$(SRCDIR)/base/
 CFLAGS += -I$(SRCDIR)
 CFLAGS += -O3
drivers/net/enic/enic_main.c +2 -0
index f5b9b0dcb..57574a5f7 100644
@@ -448,6 +448,8 @@ enic_intr_handler(void *arg)
 	enic_link_update(dev);
 	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	enic_log_q_error(enic);
+	/* Re-enable irq in case of INTx */
+	rte_intr_ack(&enic->pdev->intr_handle);
 }
 
 static int enic_rxq_intr_init(struct enic *enic)
drivers/net/enic/meson.build +1 -0
index 1bd7cc7e1..204c97fa0 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cisco Systems, Inc.
 
+cflags += ['-DALLOW_EXPERIMENTAL_API']
 sources = files(
 	'base/vnic_cq.c',
 	'base/vnic_dev.c',
#2 lore raw

PATCH v2 1/1 net/enic: re-enable link status change interrupt

In reply to Hyong Youb Kim

When INTx is used, the interrupt handler needs to explicitly re-enable interrupt in order to receive another one in future. The LSC interrupt handler currently does not, and the link state never gets updated when INTx is used (e.g. uio_pci_generic). Call rte_intr_ack() at the end of the handler, to re-enable INTx.

Fixes fefed3d1e62c ("enic: new driver")

---
v2: spell out experimental APIs used

 drivers/net/enic/Makefile    | 2 ++
 drivers/net/enic/enic_main.c | 2 ++
 drivers/net/enic/meson.build | 2 ++
 3 files changed, 6 insertions(+)
drivers/net/enic/Makefile +2 -0
index 10736a567..4e0c83da5 100644
@@ -13,6 +13,8 @@ EXPORT_MAP := rte_pmd_enic_version.map
 
 LIBABIVER := 1
 
+# Experimental APIs used: rte_intr_ack
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -I$(SRCDIR)/base/
 CFLAGS += -I$(SRCDIR)
 CFLAGS += -O3
drivers/net/enic/enic_main.c +2 -0
index f5b9b0dcb..57574a5f7 100644
@@ -448,6 +448,8 @@ enic_intr_handler(void *arg)
 	enic_link_update(dev);
 	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	enic_log_q_error(enic);
+	/* Re-enable irq in case of INTx */
+	rte_intr_ack(&enic->pdev->intr_handle);
 }
 
 static int enic_rxq_intr_init(struct enic *enic)
drivers/net/enic/meson.build +2 -0
index 1bd7cc7e1..e5eeb5667 100644
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cisco Systems, Inc.
 
+# Experimental APIs used: rte_intr_ack
+cflags += ['-DALLOW_EXPERIMENTAL_API']
 sources = files(
 	'base/vnic_cq.c',
 	'base/vnic_dev.c',
Signature · 1 line
2.22.0
Applied
#3 lore raw
Quoted 11 lines · Hyong Youb Kim

When INTx is used, the interrupt handler needs to explicitly re-enable interrupt in order to receive another one in future. The LSC interrupt handler currently does not, and the link state never gets updated when INTx is used (e.g. uio_pci_generic). Call rte_intr_ack() at the end of the handler, to re-enable INTx.

Fixes fefed3d1e62c ("enic: new driver")

Applied to dpdk-next-net/master, thanks.