Skip to contentSkip to conversation

net/af_packet: initialize link interrupt callback queue

PATCH In review Chas Williams 3 participants 7 messages Dec 17, 2016 – Dec 21, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/af_packet: initialize link interrupt callback queue

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")
---
 drivers/net/af_packet/rte_eth_af_packet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/af_packet/rte_eth_af_packet.c +1 -0
index a1e13ff..ea5070a 100644
@@ -708,6 +708,7 @@ rte_pmd_init_internals(const char *name,
 	(*eth_dev)->data->drv_name = pmd_af_packet_drv.driver.name;
 	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
 	(*eth_dev)->data->numa_node = numa_node;
+	TAILQ_INIT(&((*eth_dev)->link_intr_cbs));
 
 	return 0;
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 15 lines · On Sat, 17 Dec 2016 13:03:55 -0500 Chas Williams <[email protected]> wrote:

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")
---
 drivers/net/af_packet/rte_eth_af_packet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/af_packet/rte_eth_af_packet.c +0 -0
index a1e13ff..ea5070a 100644

drivers/net/af_packet/rte_eth_af_packet.c rte_pmd_init_internals(const char *name, · line 711

Quoted 4 lines
drivers/net/af_packet/rte_eth_af_packet.c +1 -0
@@ -708,6 +708,7 @@ rte_pmd_init_internals(const char *name,
 	(*eth_dev)->data->drv_name = pmd_af_packet_drv.driver.name;
 	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
 	(*eth_dev)->data->numa_node = numa_node;
+	TAILQ_INIT(&((*eth_dev)->link_intr_cbs));

This code really needs to have a local variable for eth_dev and not deref a pointer in every statement.

#2 lore raw
In reply to Chas Williams
Quoted 2 lines · Chas Williams

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Why do you want to register callback to af_packet PMD, it won't be calling them?

Quoted 4 lines
Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")

Please cc the maintainers...

CC John W. Linville <[email protected]>
Quoted 17 lines
---
 drivers/net/af_packet/rte_eth_af_packet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/af_packet/rte_eth_af_packet.c +1 -0
index a1e13ff..ea5070a 100644
@@ -708,6 +708,7 @@ rte_pmd_init_internals(const char *name,
 	(*eth_dev)->data->drv_name = pmd_af_packet_drv.driver.name;
 	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
 	(*eth_dev)->data->numa_node = numa_node;
+	TAILQ_INIT(&((*eth_dev)->link_intr_cbs));
 
 	return 0;
 
#3 lore raw
Quoted 6 lines · Ferruh Yigit
Quoted 2 lines · Chas Williams

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Why do you want to register callback to af_packet PMD, it won't be calling them?

Because I have a some other code that basically treats all the PMD's the same way.  Do I really need to write an exception for that code that says "if this is driver such and such don't call this API routine?"

Quoted 6 lines
Quoted 4 lines
Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")

Please cc the maintainers...

OK

Quoted 22 lines
CC John W. Linville <[email protected]>
Quoted 17 lines
---
 drivers/net/af_packet/rte_eth_af_packet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/af_packet/rte_eth_af_packet.c +1 -0
index a1e13ff..ea5070a 100644
@@ -708,6 +708,7 @@ rte_pmd_init_internals(const char *name,
 	(*eth_dev)->data->drv_name = pmd_af_packet_drv.driver.name;
 	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
 	(*eth_dev)->data->numa_node = numa_node;
+	TAILQ_INIT(&((*eth_dev)->link_intr_cbs));
 
 	return 0;
 
#4 lore raw
Quoted 11 lines · Chas Williams
Quoted 6 lines · Ferruh Yigit
Quoted 2 lines · Chas Williams

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Why do you want to register callback to af_packet PMD, it won't be calling them?

Because I have a some other code that basically treats all the PMD's the same way. Do I really need to write an exception for that code that says "if this is driver such and such don't call this API routine?"

No, you shouldn't.
Thanks for the clarification.

Quoted 32 lines
Quoted 7 lines
Quoted 5 lines
Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")

Please cc the maintainers...

OK

Quoted 22 lines
CC John W. Linville <[email protected]>
Quoted 17 lines
---
 drivers/net/af_packet/rte_eth_af_packet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/af_packet/rte_eth_af_packet.c +1 -0
index a1e13ff..ea5070a 100644
@@ -708,6 +708,7 @@ rte_pmd_init_internals(const char *name,
 	(*eth_dev)->data->drv_name = pmd_af_packet_drv.driver.name;
 	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
 	(*eth_dev)->data->numa_node = numa_node;
+	TAILQ_INIT(&((*eth_dev)->link_intr_cbs));
 
 	return 0;
 
#6 lore raw
Quoted 10 lines · Ferruh Yigit
Quoted 6 lines · Chas Williams

This patch initializes the eth_dev->link_intr_cbs queue which is used when af_packet is passed into rte_eth_ev_callback_register().

Fixes 4dc294158cac ("ethdev: support optional Rx and Tx callbacks")

The commit that just applied solves the issue that this patch targets:

http://dpdk.org/browse/dpdk/commit/?id=75aca7997e57b017

I am updating this patch as rejected.

Thanks,
ferruh