Skip to contentSkip to conversation

net/i40e: add promiscuous configure unsupported check

dpdk-dev Applied Xiao Zhang 3 participants 6 messages Feb 28, 2020 – Mar 3, 2020 Network drivers

lore
Share & tools
lore

Xiao Zhang

author
#0 lore raw

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Fixes ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF

interface")
Cc: [email protected]

---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +8 -0
index c34f520..244397e 100644
@@ -2191,6 +2191,8 @@ i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2206,6 +2208,8 @@ i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2221,6 +2225,8 @@ i40evf_dev_allmulticast_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2236,6 +2242,8 @@ i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
Signature · 1 line
2.7.4
Reviewed-by Applied
#1 lore raw
Quoted 6 lines · Xiao Zhang

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Fixes ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF

interface")

Please don't truncate the Fixes tag line, otherwise check-git-log.sh will complain.

Quoted 50 lines

---
drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++

1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +8 -0
index c34f520..244397e 100644
@@ -2191,6 +2191,8 @@ i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2206,6 +2208,8 @@ i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2221,6 +2225,8 @@ i40evf_dev_allmulticast_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2236,6 +2242,8 @@ i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
Signature · 1 line
2.7.4

For the rest,

Applied to dpdk-next-net-intel with the Fixes line fix, Thanks.

#2 lore raw
In reply to Xiao Zhang
Quoted 3 lines · Xiao Zhang

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Hi Xiao,

What is the cause of the hang, was the application keep trying because of the "-EAGAIN" error?

Quoted 51 lines
Fixes ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF

interface")
Cc: [email protected]

---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +8 -0
index c34f520..244397e 100644
@@ -2191,6 +2191,8 @@ i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2206,6 +2208,8 @@ i40evf_dev_promiscuous_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2221,6 +2225,8 @@ i40evf_dev_allmulticast_enable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2236,6 +2242,8 @@ i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
#3 lore raw

Hi Ferruh,

Quoted 9 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, March 2, 2020 5:09 PM
To: Zhang, Xiao <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check

On 2/28/2020 3:22 AM, Xiao Zhang wrote:

Quoted 8 lines
Quoted 3 lines

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Hi Xiao,

What is the cause of the hang, was the application keep trying because of the "- EAGAIN" error?

When starting port, rte_eth_dev_start will call rte_eth_dev_config_restore in which promisc configure will be called to enable/disable promiscuous mode. Since "-EAGAIN" was returned if platforms not supported to configure promisc mode, it would return error and stop port starting.

        /* replay promiscuous configuration */
        /*
         * use callbacks directly since we don't need port_id check and
         * would like to bypass the same value set
         */
        if (rte_eth_promiscuous_get(port_id) == 1 &&
            *dev->dev_ops->promiscuous_enable != NULL) {
                ret = eth_err(port_id,
                              (*dev->dev_ops->promiscuous_enable)(dev));
                if (ret != 0 && ret != -ENOTSUP) {
                        RTE_ETHDEV_LOG(ERR,
                                "Failed to enable promiscuous mode for device (port %u): %s\n",
                                port_id, rte_strerror(-ret));
                        return ret;
                }
        } else if (rte_eth_promiscuous_get(port_id) == 0 &&
                   *dev->dev_ops->promiscuous_disable != NULL) {
                ret = eth_err(port_id,
                              (*dev->dev_ops->promiscuous_disable)(dev));
                if (ret != 0 && ret != -ENOTSUP) {
                        RTE_ETHDEV_LOG(ERR,
                                "Failed to disable promiscuous mode for device (port %u): %s\n",
                                port_id, rte_strerror(-ret));
                        return ret;
                }
        }
Quoted 57 lines

drivers/net/i40e/i40e_ethdev_vf.c i40evf_dev_promiscuous_enable(struct rte_eth_dev

Quoted 17 lines
Fixes ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF

interface")
Cc: [email protected]

---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
index c34f520..244397e 100644
@@ -2191,6 +2191,8 @@ i40evf_dev_promiscuous_enable(struct rte_eth_dev

*dev)

drivers/net/i40e/i40e_ethdev_vf.c i40evf_dev_promiscuous_disable(struct

Quoted 9 lines
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
 	ret = i40evf_config_promisc(dev, 1, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2206,6 +2208,8 @@ i40evf_dev_promiscuous_disable(struct

rte_eth_dev *dev)

drivers/net/i40e/i40e_ethdev_vf.c i40evf_dev_allmulticast_enable(struct rte_eth_dev

Quoted 9 lines
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
 	ret = i40evf_config_promisc(dev, 0, vf->promisc_multicast_enabled);
 	if (ret == 0)
 		vf->promisc_unicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2221,6 +2225,8 @@ i40evf_dev_allmulticast_enable(struct rte_eth_dev

*dev)

drivers/net/i40e/i40e_ethdev_vf.c i40evf_dev_allmulticast_disable(struct rte_eth_dev

Quoted 9 lines
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 1);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = TRUE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -2236,6 +2242,8 @@ i40evf_dev_allmulticast_disable(struct rte_eth_dev

*dev)

Quoted 9 lines
drivers/net/i40e/i40e_ethdev_vf.c +2 -0
 	ret = i40evf_config_promisc(dev, vf->promisc_unicast_enabled, 0);
 	if (ret == 0)
 		vf->promisc_multicast_enabled = FALSE;
+	else if (ret == I40E_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
#4 lore raw
Quoted 15 lines · Xiao

Hi Ferruh,

Quoted 13 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, March 2, 2020 5:09 PM
To: Zhang, Xiao <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check

Quoted 3 lines · Xiao Zhang

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Quoted 7 lines
Quoted 4 lines

Hi Xiao,

What is the cause of the hang, was the application keep trying because of the "- EAGAIN" error?

When starting port, rte_eth_dev_start will call rte_eth_dev_config_restore in which promisc configure will be called to enable/disable promiscuous mode. Since "-EAGAIN" was returned if platforms not supported to configure promisc mode, it would return error and stop port starting.

So the real issue caused by this is "Fail to start port", not "hang", right? I can change the description in the commit log directly.

Thanks,
Xiaolong

#5 lore raw
Quoted 32 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Tuesday, March 3, 2020 10:53 AM
To: Zhang, Xiao <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; [email protected]; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check

Quoted 21 lines · Xiao

Hi Ferruh,

Quoted 18 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, March 2, 2020 5:09 PM
To: Zhang, Xiao <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check

Quoted 3 lines · Xiao Zhang

Return ENOTSUP error code when configuring i40evf promiscuous mode to fix port start hang issue on platforms which are unsupported to configure promiscuous mode.

Hi Xiao,

What is the cause of the hang, was the application keep trying because of the "- EAGAIN" error?

Quoted 7 lines
Quoted 1 line

When starting port, rte_eth_dev_start will call rte_eth_dev_config_restore in

which promisc configure will be called to enable/disable promiscuous mode.

Quoted 1 line

Since "-EAGAIN" was returned if platforms not supported to configure promisc

mode, it would return error and stop port starting.

So the real issue caused by this is "Fail to start port", not "hang", right? I can change the description in the commit log directly.

Yes, it's "Fail to start port". Thanks Xiaolong helping correct the commit log.

Quoted 3 lines

Thanks,
Xiaolong