Skip to contentSkip to conversation

net/bnx2x: add support for secondary process

PATCH Applied Rasesh Mody 4 participants 9 messages Dec 21, 2019 – Jan 15, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnx2x: add support for secondary process

Skip the device re-initialization for secondary process.

---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +5 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 
 	eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops : &bnx2x_eth_dev_ops;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary process");
+		return 0;
+	}
+
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
 	sc->pcie_bus    = pci_dev->addr.bus;
Signature · 1 line
2.18.0
Applied
#1 lore raw
Quoted 4 lines · Rasesh Mody

Skip the device re-initialization for secondary process.

Correct Cc: to [email protected]

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 25 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +5 -1
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops : &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary process");
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
 
        sc->pcie_bus    = pci_dev->addr.bus;
--

2.18.0

#2 lore raw
Quoted 8 lines · Jerin Jacob
Quoted 4 lines · Rasesh Mody

Skip the device re-initialization for secondary process.

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Quoted 29 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 25 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +5 -1
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf)
 
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops : &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary process");
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
 
        sc->pcie_bus    = pci_dev->addr.bus;
--

2.18.0

#3 lore raw

Hi Kevin,

Quoted 9 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases. However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree. Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0

#4 lore raw
Quoted 13 lines · Rasesh Mody

Hi Kevin,

Quoted 11 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 5 lines · wrote:
Quoted 4 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases.

Thanks for confirming.

Quoted 1 line

However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree.

Cc Luca

Quoted 4 lines

Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")

Fixes tag won't be needed now as you've confirmed the code was doing what it was intending to do.

Quoted 38 lines

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0

#5 lore raw
Quoted 28 lines · Kevin Traynor
Quoted 13 lines · Rasesh Mody

Hi Kevin,

Quoted 11 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 5 lines · wrote:
Quoted 4 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases.

Thanks for confirming.

Quoted 1 line

However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree.

Cc Luca

Quoted 7 lines
Quoted 4 lines

Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")

Fixes tag won't be needed now as you've confirmed the code was doing what it was intending to do.

Since there is a request to backport this into 19.11, I was planning to add the fixes tag (stable tag is already there) but will it confuse the 18.11 because the commit in fixes line is older than 18.11?

Quoted 40 lines
Quoted 39 lines

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0

#6 lore raw
Quoted 34 lines · Ferruh Yigit
Quoted 33 lines · Kevin Traynor
Quoted 13 lines · Rasesh Mody

Hi Kevin,

Quoted 11 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 5 lines · wrote:
Quoted 4 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases.

Thanks for confirming.

Quoted 1 line

However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree.

Cc Luca

Quoted 4 lines

Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")
Quoted 7 lines
Quoted 2 lines

Fixes tag won't be needed now as you've confirmed the code was doing what it was intending to do.

Since there is a request to backport this into 19.11, I was planning to add the fixes tag (stable tag is already there) but will it confuse the 18.11 because the commit in fixes line is older than 18.11?

I think it should not have a Fixes tag. In this case there is nothing being fixed, just a new feature being added/supported. It will be picked up as a candidate for stable branches through the cc: stable, from there it can be discussed.

Quoted 41 lines
Quoted 40 lines
Quoted 39 lines

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0

#7 lore raw
Quoted 43 lines · Kevin Traynor
Quoted 34 lines · Ferruh Yigit
Quoted 33 lines · Kevin Traynor
Quoted 13 lines · Rasesh Mody

Hi Kevin,

Quoted 11 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 5 lines · wrote:
Quoted 4 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases.

Thanks for confirming.

Quoted 1 line

However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree.

Cc Luca

Quoted 4 lines

Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")
Quoted 7 lines
Quoted 2 lines

Fixes tag won't be needed now as you've confirmed the code was doing what it was intending to do.

Since there is a request to backport this into 19.11, I was planning to add the fixes tag (stable tag is already there) but will it confuse the 18.11 because the commit in fixes line is older than 18.11?

Quoted 4 lines

I think it should not have a Fixes tag. In this case there is nothing being fixed, just a new feature being added/supported. It will be picked up as a candidate for stable branches through the cc: stable, from there it can be discussed.

OK, I am not changing anything.
But when fixes tag is missing I am not clear how you decide if the fix should go into any specific LTS or not, it should be hard to figure it out without reference point.

Quoted 43 lines
Quoted 42 lines
Quoted 41 lines
Quoted 40 lines

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0

#8 lore raw
Quoted 49 lines · Ferruh Yigit
Quoted 43 lines · Kevin Traynor
Quoted 34 lines · Ferruh Yigit
Quoted 33 lines · Kevin Traynor
Quoted 13 lines · Rasesh Mody

Hi Kevin,

Quoted 11 lines

From: Kevin Traynor <[email protected]>
Sent: Tuesday, January 14, 2020 10:52 AM

Quoted 1 line · Jerin Jacob

On Sat, Dec 21, 2019 at 7:12 AM Rasesh Mody <[email protected]>

Quoted 5 lines · wrote:
Quoted 4 lines

Skip the device re-initialization for secondary process.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Correct Cc: to [email protected]

Is it a fix, or secondary process was not intended to be supported previously? If it is a fix, please provide the Fixed commit (will save Ferruh searching for it).

Secondary process was not intended to be supported previously. So it is ok to not backport the change to all ongoing stable releases.

Thanks for confirming.

Quoted 1 line

However, the change has been tested with DPDK 19.11, I am wondering if it can be pulled in that stable tree.

Cc Luca

Quoted 4 lines

Please see below the fixline tag.

Fixes 540a211084a7 ("bnx2x: driver core")
Quoted 7 lines
Quoted 2 lines

Fixes tag won't be needed now as you've confirmed the code was doing what it was intending to do.

Since there is a request to backport this into 19.11, I was planning to add the fixes tag (stable tag is already there) but will it confuse the 18.11 because the commit in fixes line is older than 18.11?

Quoted 4 lines

I think it should not have a Fixes tag. In this case there is nothing being fixed, just a new feature being added/supported. It will be picked up as a candidate for stable branches through the cc: stable, from there it can be discussed.

Quoted 5 lines

OK, I am not changing anything.
But when fixes tag is missing I am not clear how you decide if the fix should go into any specific LTS or not, it should be hard to figure it out without reference point.

Yes, you are correct, for bugfixes it is important because otherwise stable maintainer have to stop, try to figure it out and start email convo with authors to discuss etc. Whereas with Fixes tags, non-relevant ones for a branch can pruned out quickly and discussion is not needed.

In this case however, where it's not really a bugfix but more a request to add/support something new, it probably needs discussion anyway and not having the Fixes tag ensures that takes place and it doesn't automatically slip in unnoticed.

Quoted 44 lines
Quoted 43 lines
Quoted 42 lines
Quoted 41 lines
Quoted 40 lines

Thanks!
-Rasesh

Quoted 34 lines
Quoted 18 lines

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 14 lines
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnx2x/bnx2x_ethdev.c +0 -0
index 20b045ff87..7864b5b80a 100644
@@ -598,6 +598,11 @@ bnx2x_common_dev_init(struct rte_eth_dev
 *eth_dev, int is_vf)
 
Quoted 5 lines

drivers/net/bnx2x/bnx2x_ethdev.c bnx2x_common_dev_init(struct rte_eth_dev · line 604

Quoted 5 lines
drivers/net/bnx2x/bnx2x_ethdev.c +2 -0
        eth_dev->dev_ops = is_vf ? &bnx2xvf_eth_dev_ops :
 &bnx2x_eth_dev_ops;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               PMD_DRV_LOG(ERR, sc, "Skipping device init from secondary

process");

Quoted 10 lines
Quoted 9 lines
drivers/net/bnx2x/bnx2x_ethdev.c +3 -0
+               return 0;
+       }
+
        rte_eth_copy_pci_info(eth_dev, pci_dev);
        sc->pcie_bus    = pci_dev->addr.bus;

--
2.18.0