Thread (1 message) 1 message, 1 author, 2021-07-05

Re: [dpdk-dev] [PATCH v6 10/19] net/ngbe: support link update

From: Andrew Rybchenko <hidden>
Date: 2021-07-05 08:58:22

On 7/5/21 10:10 AM, Jiawen Wu wrote:
On July 3, 2021 12:24 AM, Andrew Rybchenko wrote:
quoted
On 6/17/21 1:59 PM, Jiawen Wu wrote:
quoted
Register to handle device interrupt.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
[snip]
quoted
diff --git a/doc/guides/nics/ngbe.rst b/doc/guides/nics/ngbe.rst index
54d0665db9..0918cc2918 100644
--- a/doc/guides/nics/ngbe.rst
+++ b/doc/guides/nics/ngbe.rst
@@ -8,6 +8,11 @@ The NGBE PMD (librte_pmd_ngbe) provides poll mode
driver support  for Wangxun 1 Gigabit Ethernet NICs.


+Features
+--------
+
+- Link state information
+
Two empty lines before the section.
quoted
 Prerequisites
 -------------
[snip]
quoted
diff --git a/drivers/net/ngbe/ngbe_ethdev.c
b/drivers/net/ngbe/ngbe_ethdev.c index deca64137d..c952023e8b 100644
--- a/drivers/net/ngbe/ngbe_ethdev.c
+++ b/drivers/net/ngbe/ngbe_ethdev.c
@@ -141,6 +175,23 @@ eth_ngbe_dev_init(struct rte_eth_dev *eth_dev,
void *init_params __rte_unused)
quoted
 		return -ENOMEM;
 	}

+	ctrl_ext = rd32(hw, NGBE_PORTCTL);
+	/* let hardware know driver is loaded */
+	ctrl_ext |= NGBE_PORTCTL_DRVLOAD;
+	/* Set PF Reset Done bit so PF/VF Mail Ops can work */
+	ctrl_ext |= NGBE_PORTCTL_RSTDONE;
+	wr32(hw, NGBE_PORTCTL, ctrl_ext);
+	ngbe_flush(hw);
+
+	rte_intr_callback_register(intr_handle,
+				   ngbe_dev_interrupt_handler, eth_dev);
+
+	/* enable uio/vfio intr/eventfd mapping */
+	rte_intr_enable(intr_handle);
+
+	/* enable support intr */
+	ngbe_enable_intr(eth_dev);
+
I don't understand why it is done unconditionally regardless of the
corresponding bit in dev_conf.
Sorry...I don't quite understand what you mean.
May be it is OK and it is specific to your HW, but typically
interrupts are only enabled and used if requested via either
dev_conf->intr_conf.lsc for link status change OR
dev_conf->intr_conf.rxq for Rx queues.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help