net/hinic: fix coredump when the scondary process using the hinic port.
PATCH v3 1/1 net/hinic: fix coredump when the scondary process using the hinic port.
fix coredump when secondary process using the hinic port. the reason is that during the stage of
secondary process port initialization,
it lack the initialization of "eth_dev->dev_ops".
---
v3: update the signed-off information.
---
v2: solve the coding style issue.
--- drivers/net/hinic/hinic_pmd_ethdev.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/hinic/hinic_pmd_ethdev.c +12 -9
@@ -3060,15 +3060,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)int rc; pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); - -/* EAL is SECONDARY and eth_dev is already created */ -if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { -PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , - eth_dev->data->name); - -return 0 ; - } - nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev);memset (nic_dev,0 ,sizeof (*nic_dev));
@@ -3206,6 +3197,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; +/* EAL is SECONDARY and eth_dev is already created */ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { +PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , eth_dev->data->name); + +struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); +if (HINIC_IS_VF (nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; +else + eth_dev->dev_ops = &hinic_pmd_ops; +return 0 ; + } +return hinic_func_init (eth_dev); }
Signature · 1 line
2.19.1
PATCH v4 1/1 net/hinic: fix coredump when the scondary process using the hinic port.
From adb560f53b1a1585dc32adfb0e44e404e1198c96 Mon Sep 17 00:00:00 2001
From: liqingqing <[email protected]>
Date: Sat, 31 Oct 2020 06:02:57 -0400
Subject: [v4] net/hinic: fix coredump when the scondary process using the hinic port.
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port
initialization, it
lack the initialization of "eth_dev->dev_ops".
---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.
--- drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/hinic/hinic_pmd_ethdev.c +12 -8
@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -/* EAL is SECONDARY and eth_dev is already created */ -if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { -PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , - eth_dev->data->name); - -return 0 ; - } - eth_dev->data->dev_flags |=RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev);
@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; +/* EAL is SECONDARY and eth_dev is already created */ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { +PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , eth_dev->data->name); + +struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); +if (HINIC_IS_VF (nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; +else + eth_dev->dev_ops = &hinic_pmd_ops; +return 0 ; + } +return hinic_func_init (eth_dev); }
Signature · 1 line
2.19.1
PATCH v4 1/1 net/hinic: fix coredump when the scondary process using the hinic port.
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".
---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.
--- drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/hinic/hinic_pmd_ethdev.c +12 -8
@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -/* EAL is SECONDARY and eth_dev is already created */ -if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { -PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , - eth_dev->data->name); - -return 0 ; - } - eth_dev->data->dev_flags |=RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev);
@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; +/* EAL is SECONDARY and eth_dev is already created */ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { +PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , eth_dev->data->name); + +struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); +if (HINIC_IS_VF (nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; +else + eth_dev->dev_ops = &hinic_pmd_ops; +return 0 ; + } +return hinic_func_init (eth_dev); }
Signature · 1 line
2.19.1
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some dev_ops may casue fail when run in secondary proc, so need to modify it later and add tests for other dev_ops.
Thanks
Quoted 53 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>--- drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +12
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; + /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev); + if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; + else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev); }
Quoted 6 lines · Wangxiaoyun (Cloud)
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some
dev_opsmay casue fail when run in secondary proc, so need to modify it later and add tests for otherdev_ops.
So will there be a new version in next release?
Please feel free to put comments in the mail list, it helps recording the status and people looking for it later.
Quoted 58 lines
Thanks
Quoted 55 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>---
drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +12
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; + /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); + if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; + else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev);}
When we complete repair and testing, we will upstream the patch in next release, maybe not keep up with 20.11.
Quoted 71 lines · Ferruh Yigit
Quoted 6 lines · Wangxiaoyun (Cloud)
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some
dev_opsmay casue fail when run in secondary proc, so need to modify it later and add tests for otherdev_ops.So will there be a new version in next release?
Please feel free to put comments in the mail list, it helps recording the status and people looking for it later.
Quoted 41 lines
Thanks
Quoted 38 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>---
drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +0
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts;Quoted 15 lines
Quoted 5 lines
drivers/net/hinic/hinic_pmd_ethdev.c +5
-0+ /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);drivers/net/hinic/hinic_pmd_ethdev.c static int hinic_dev_init(struct rte_eth_dev *eth_dev) · line 3250
Quoted 10 lines
drivers/net/hinic/hinic_pmd_ethdev.c +7
-0+ if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; + else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev); }.
On 11/12/2020 12:30 PM, Wangxiaoyun (Cloud) wrote:
< copied the response down, please don't top post >
Quoted 9 lines · Ferruh Yigit
Quoted 8 lines · Wangxiaoyun (Cloud)
Quoted 6 lines
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some
dev_opsmay casue fail when run in secondary proc, so need to modify it later and add tests for otherdev_ops.
Quoted 7 lines
Quoted 4 lines
So will there be a new version in next release?
Please feel free to put comments in the mail list, it helps recording the status and people looking for it later.
When we complete repair and testing, we will upstream the patch in next release, maybe not keep up with 20.11.
OK, I am updating the patch status as deferred to follow it in next release.
Quoted 61 lines
Quoted 61 lines
Quoted 51 lines
Thanks
Quoted 47 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>---
drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +7
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; + /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); + if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops;Quoted 8 lines
Quoted 8 lines
drivers/net/hinic/hinic_pmd_ethdev.c +5
-0+ else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev);}
.
Hi Ferruh,
For secondary process fix,you can refer to this patch "net/hinic: fix coredump when PMD used by fstack".
Thanks
Quoted 75 lines · Wangxiaoyun (Cloud)
When we complete repair and testing, we will upstream the patch in next release, maybe not keep up with 20.11.
Quoted 71 lines · Ferruh Yigit
Quoted 6 lines · Wangxiaoyun (Cloud)
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some
dev_opsmay casue fail when run in secondary proc, so need to modify it later and add tests for otherdev_ops.So will there be a new version in next release?
Please feel free to put comments in the mail list, it helps recording the status and people looking for it later.
Quoted 41 lines
Thanks
Quoted 38 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>---
drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +0
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts;Quoted 15 lines
Quoted 5 lines
drivers/net/hinic/hinic_pmd_ethdev.c +5
-0+ /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);drivers/net/hinic/hinic_pmd_ethdev.c static int hinic_dev_init(struct rte_eth_dev *eth_dev) · line 3250
Quoted 10 lines
drivers/net/hinic/hinic_pmd_ethdev.c +7
-0+ if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; + else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev); }.
Quoted 4 lines · Wangxiaoyun (Cloud)
Hi Ferruh,
For secondary process fix,you can refer to this patch "net/hinic: fix
coredump when PMD used by fstack".
Thanks
Got it, thanks for new version. I am marking the old one as superseded.
For reference, the old one is:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
Quoted 79 lines · Wangxiaoyun (Cloud)
Quoted 77 lines
When we complete repair and testing, we will upstream the patch in next release, maybe not keep up with 20.11.
Quoted 73 lines · Ferruh Yigit
Quoted 6 lines · Wangxiaoyun (Cloud)
Hi Ferruh,
Align with Qingqing Li, this path will not apply to dpdk master now, some
dev_opsmay casue fail when run in secondary proc, so need to modify it later and add tests for otherdev_ops.So will there be a new version in next release?
Please feel free to put comments in the mail list, it helps recording the status and people looking for it later.
Quoted 50 lines
Thanks
Quoted 47 lines · Qingqing Li
fix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port initialization, it lack the initialization of "eth_dev->dev_ops".Signed-off-by Qingqing Li <[email protected]>---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.Signed-off-by liqingqing <[email protected]>---
drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)drivers/net/hinic/hinic_pmd_ethdev.c +7
-8@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* EAL is SECONDARY and eth_dev is already created */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - PMD_DRV_LOG(INFO, "Initialize %s in secondary process", - eth_dev->data->name); - - return 0; - } - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; + /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); + + struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); + if (HINIC_IS_VF(nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops;Quoted 8 lines
Quoted 8 lines
drivers/net/hinic/hinic_pmd_ethdev.c +5
-0+ else + eth_dev->dev_ops = &hinic_pmd_ops; + return 0; + } + return hinic_func_init(eth_dev);}
.
PATCH v4 1/1 net/hinic: fix coredump when the scondary process using the hinic port.
In reply to Qingqing Lifix coredump when secondary process using the hinic port. the
reason is that during the stage of secondary process port
initialization, it
lack the initialization of "eth_dev->dev_ops".
---
v4: adapt to the latest version.
---
v3: update the signed-off information.
---
v2: solve the coding style issue.
---
--- drivers/net/hinic/hinic_pmd_ethdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/hinic/hinic_pmd_ethdev.c +12 -8
@@ -3100,14 +3100,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -/* EAL is SECONDARY and eth_dev is already created */ -if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { -PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , - eth_dev->data->name); - -return 0 ; - } - eth_dev->data->dev_flags |=RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev);
@@ -3241,6 +3233,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = hinic_recv_pkts; eth_dev->tx_pkt_burst = hinic_xmit_pkts; +/* EAL is SECONDARY and eth_dev is already created */ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) { +PMD_DRV_LOG (INFO ,"Initialize %s in secondary process" , eth_dev->data->name); + +struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (eth_dev); +if (HINIC_IS_VF (nic_dev->hwdev)) + eth_dev->dev_ops = &hinic_pmd_vf_ops; +else + eth_dev->dev_ops = &hinic_pmd_ops; +return 0 ; + } +return hinic_func_init (eth_dev); }
Signature · 1 line
2.19.1