[dpdk-dev] [PATCH] net/e1000: fix nic ops function was no initialized in secondary process

Tengfei Zhang zypscode at outlook.com
Fri Jun 18 19:26:36 CEST 2021


'e1000_setup_init_funcs' was not called in secondary process,
it initialize mac,phy,nvm ops.
when secondary process get link status,it will coredump.

Signed-off-by: Tengfei Zhang <zypscode at outlook.com>
---
 drivers/net/e1000/em_ethdev.c  | 1 +
 drivers/net/e1000/igb_ethdev.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index a0ca371b02..cd5faa4228 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -258,6 +258,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+		e1000_setup_init_funcs(hw, TRUE);
 		if (eth_dev->data->scattered_rx)
 			eth_dev->rx_pkt_burst =
 				(eth_rx_burst_t)&eth_em_recv_scattered_pkts;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 10ee0f3341..7d9d60497d 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -737,6 +737,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+		e1000_setup_init_funcs(hw, TRUE);
 		if (eth_dev->data->scattered_rx)
 			eth_dev->rx_pkt_burst = &eth_igb_recv_scattered_pkts;
 		return 0;
@@ -931,6 +932,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+		e1000_setup_init_funcs(hw, TRUE);
 		if (eth_dev->data->scattered_rx)
 			eth_dev->rx_pkt_burst = &eth_igb_recv_scattered_pkts;
 		return 0;
-- 
2.26.2



More information about the dev mailing list