DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] net/i40e: add promiscuous configure unsupported check
@ 2020-02-28  3:22 Xiao Zhang
  2020-03-02  2:20 ` Ye Xiaolong
  2020-03-02  9:08 ` Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: Xiao Zhang @ 2020-02-28  3:22 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, qi.z.zhang, Xiao Zhang, stable

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: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index c34f520..244397e 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -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;
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
  2020-02-28  3:22 [dpdk-dev] net/i40e: add promiscuous configure unsupported check Xiao Zhang
@ 2020-03-02  2:20 ` Ye Xiaolong
  2020-03-02  9:08 ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2020-03-02  2:20 UTC (permalink / raw)
  To: Xiao Zhang; +Cc: dev, beilei.xing, qi.z.zhang, stable

On 02/28, Xiao Zhang wrote:
>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.

>Cc: stable@dpdk.org
>
>Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
>---
> drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
>index c34f520..244397e 100644
>--- a/drivers/net/i40e/i40e_ethdev_vf.c
>+++ b/drivers/net/i40e/i40e_ethdev_vf.c
>@@ -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;
> 
>-- 
>2.7.4
>

For the rest,

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
  2020-02-28  3:22 [dpdk-dev] net/i40e: add promiscuous configure unsupported check Xiao Zhang
  2020-03-02  2:20 ` Ye Xiaolong
@ 2020-03-02  9:08 ` Ferruh Yigit
  2020-03-03  2:01   ` Zhang, Xiao
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-02  9:08 UTC (permalink / raw)
  To: Xiao Zhang, dev; +Cc: beilei.xing, qi.z.zhang, stable

On 2/28/2020 3:22 AM, Xiao Zhang wrote:
> 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?

> 
> Fixes: ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF
> interface")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index c34f520..244397e 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -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;
>  
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
  2020-03-02  9:08 ` Ferruh Yigit
@ 2020-03-03  2:01   ` Zhang, Xiao
  2020-03-03  2:53     ` Ye Xiaolong
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Xiao @ 2020-03-03  2:01 UTC (permalink / raw)
  To: Yigit, Ferruh, dev; +Cc: Xing, Beilei, Zhang, Qi Z, stable

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, March 2, 2020 5:09 PM
> To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
> 
> On 2/28/2020 3:22 AM, Xiao Zhang wrote:
> > 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;
                }
        }

> 
> >
> > Fixes: ddc7cb0d9453 ("net/i40e: re-program promiscuous mode on VF
> > interface")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > b/drivers/net/i40e/i40e_ethdev_vf.c
> > index c34f520..244397e 100644
> > --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > @@ -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;
> >
> >


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
  2020-03-03  2:01   ` Zhang, Xiao
@ 2020-03-03  2:53     ` Ye Xiaolong
  2020-03-03  2:59       ` Zhang, Xiao
  0 siblings, 1 reply; 6+ messages in thread
From: Ye Xiaolong @ 2020-03-03  2:53 UTC (permalink / raw)
  To: Zhang, Xiao; +Cc: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, stable

On 03/03, Zhang, Xiao wrote:
>Hi Ferruh,
>
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Monday, March 2, 2020 5:09 PM
>> To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
>> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> stable@dpdk.org
>> Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
>> 
>> On 2/28/2020 3:22 AM, Xiao Zhang wrote:
>> > 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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
  2020-03-03  2:53     ` Ye Xiaolong
@ 2020-03-03  2:59       ` Zhang, Xiao
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Xiao @ 2020-03-03  2:59 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, stable



> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Tuesday, March 3, 2020 10:53 AM
> To: Zhang, Xiao <xiao.zhang@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; Xing, Beilei
> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure unsupported check
> 
> On 03/03, Zhang, Xiao wrote:
> >Hi Ferruh,
> >
> >> -----Original Message-----
> >> From: Yigit, Ferruh
> >> Sent: Monday, March 2, 2020 5:09 PM
> >> To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
> >> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>; stable@dpdk.org
> >> Subject: Re: [dpdk-dev] net/i40e: add promiscuous configure
> >> unsupported check
> >>
> >> On 2/28/2020 3:22 AM, Xiao Zhang wrote:
> >> > 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.
> 
> 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.

> 
> Thanks,
> Xiaolong

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-03  3:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28  3:22 [dpdk-dev] net/i40e: add promiscuous configure unsupported check Xiao Zhang
2020-03-02  2:20 ` Ye Xiaolong
2020-03-02  9:08 ` Ferruh Yigit
2020-03-03  2:01   ` Zhang, Xiao
2020-03-03  2:53     ` Ye Xiaolong
2020-03-03  2:59       ` Zhang, Xiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).