All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/fm10k: initialize link status in device start
@ 2017-05-31 11:07 Xiao Wang
  2017-06-21  2:35 ` Chen, Jing D
  2017-06-22 11:20 ` [PATCH v2] " Xiao Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Xiao Wang @ 2017-05-31 11:07 UTC (permalink / raw)
  To: jing.d.chen; +Cc: dev, Xiao Wang, stable

If port LSC interrupt is configured, application will read link
status directly, so driver need to prepare that value in advance.

Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index a742eec..54bf10c 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -84,6 +84,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev *dev,
 static void fm10k_set_rx_function(struct rte_eth_dev *dev);
 static void fm10k_set_tx_function(struct rte_eth_dev *dev);
 static int fm10k_check_ftag(struct rte_devargs *devargs);
+static int fm10k_link_update(struct rte_eth_dev *dev,
+	__rte_unused int wait_to_complete);
 
 struct fm10k_xstats_name_off {
 	char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -1166,6 +1168,9 @@ static inline int fm10k_glort_valid(struct fm10k_hw *hw)
 	if (!(dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG))
 		fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
 
+	if (dev->data->dev_conf.intr_conf.lsc != 0)
+		fm10k_link_update(dev, 0);
+
 	return 0;
 }
 
-- 
1.8.3.1

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

* Re: [PATCH] net/fm10k: initialize link status in device start
  2017-05-31 11:07 [PATCH] net/fm10k: initialize link status in device start Xiao Wang
@ 2017-06-21  2:35 ` Chen, Jing D
  2017-06-22  2:31   ` Wang, Xiao W
  2017-06-22 11:20 ` [PATCH v2] " Xiao Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Chen, Jing D @ 2017-06-21  2:35 UTC (permalink / raw)
  To: Wang, Xiao W; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: Wang, Xiao W
> Sent: Wednesday, May 31, 2017 7:07 PM
> To: Chen, Jing D <jing.d.chen@intel.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/fm10k: initialize link status in device start
> 
> If port LSC interrupt is configured, application will read link status directly, so
> driver need to prepare that value in advance.

Fm10k host driver can't manage PHY directly and provide a fake link status, 
so it always provide a constant value, whatever lsc is set or not.
I think you need to reorganize the message. :)

> 
> Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
>  drivers/net/fm10k/fm10k_ethdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index a742eec..54bf10c 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -84,6 +84,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev
> *dev,  static void fm10k_set_rx_function(struct rte_eth_dev *dev);  static
> void fm10k_set_tx_function(struct rte_eth_dev *dev);  static int
> fm10k_check_ftag(struct rte_devargs *devargs);
> +static int fm10k_link_update(struct rte_eth_dev *dev,
> +	__rte_unused int wait_to_complete);
> 
>  struct fm10k_xstats_name_off {
>  	char name[RTE_ETH_XSTATS_NAME_SIZE];
> @@ -1166,6 +1168,9 @@ static inline int fm10k_glort_valid(struct fm10k_hw
> *hw)
>  	if (!(dev->data->dev_conf.rxmode.mq_mode &
> ETH_MQ_RX_VMDQ_FLAG))
>  		fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
> 
> +	if (dev->data->dev_conf.intr_conf.lsc != 0)
> +		fm10k_link_update(dev, 0);
> +

I'll recommend updating link status anyway when port starts, not considering
lsc set status.

>  	return 0;
>  }
> 
> --
> 1.8.3.1

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

* Re: [PATCH] net/fm10k: initialize link status in device start
  2017-06-21  2:35 ` Chen, Jing D
@ 2017-06-22  2:31   ` Wang, Xiao W
  0 siblings, 0 replies; 6+ messages in thread
From: Wang, Xiao W @ 2017-06-22  2:31 UTC (permalink / raw)
  To: Chen, Jing D; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: Chen, Jing D
> Sent: Wednesday, June 21, 2017 10:36 AM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [PATCH] net/fm10k: initialize link status in device start
> 
> Hi,
> 
> > -----Original Message-----
> > From: Wang, Xiao W
> > Sent: Wednesday, May 31, 2017 7:07 PM
> > To: Chen, Jing D <jing.d.chen@intel.com>
> > Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH] net/fm10k: initialize link status in device start
> >
> > If port LSC interrupt is configured, application will read link status directly,
> so
> > driver need to prepare that value in advance.
> 
> Fm10k host driver can't manage PHY directly and provide a fake link status,
> so it always provide a constant value, whatever lsc is set or not.
> I think you need to reorganize the message. :)

OK, thanks.
> 
> >
> > Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> > ---
> >  drivers/net/fm10k/fm10k_ethdev.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> > b/drivers/net/fm10k/fm10k_ethdev.c
> > index a742eec..54bf10c 100644
> > --- a/drivers/net/fm10k/fm10k_ethdev.c
> > +++ b/drivers/net/fm10k/fm10k_ethdev.c
> > @@ -84,6 +84,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev
> > *dev,  static void fm10k_set_rx_function(struct rte_eth_dev *dev);  static
> > void fm10k_set_tx_function(struct rte_eth_dev *dev);  static int
> > fm10k_check_ftag(struct rte_devargs *devargs);
> > +static int fm10k_link_update(struct rte_eth_dev *dev,
> > +	__rte_unused int wait_to_complete);
> >
> >  struct fm10k_xstats_name_off {
> >  	char name[RTE_ETH_XSTATS_NAME_SIZE];
> > @@ -1166,6 +1168,9 @@ static inline int fm10k_glort_valid(struct
> fm10k_hw
> > *hw)
> >  	if (!(dev->data->dev_conf.rxmode.mq_mode &
> > ETH_MQ_RX_VMDQ_FLAG))
> >  		fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
> >
> > +	if (dev->data->dev_conf.intr_conf.lsc != 0)
> > +		fm10k_link_update(dev, 0);
> > +
> 
> I'll recommend updating link status anyway when port starts, not considering
> lsc set status.

Agree, will send v2.

BRs,
Xiao

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

* Re: [PATCH v2] net/fm10k: initialize link status in device start
  2017-06-22 11:20 ` [PATCH v2] " Xiao Wang
@ 2017-06-22  3:07   ` Chen, Jing D
  2017-06-22 11:33     ` [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Chen, Jing D @ 2017-06-22  3:07 UTC (permalink / raw)
  To: Wang, Xiao W; +Cc: dev, stable



> -----Original Message-----
> From: Wang, Xiao W
> Sent: Thursday, June 22, 2017 7:20 PM
> To: Chen, Jing D <jing.d.chen@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
> Subject: [PATCH v2] net/fm10k: initialize link status in device start
> 
> Fm10k host driver can't manage PHY directly and provides a fake link status by
> always reporting LINK_UP. We should initialize link status in device start,
> otherwise application will get LINK_DOWN status when LSC configured.
> 
> Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
> v2:
> * Rewrite commit message, add information about fm10k PHY.
> * Always do link_update in dev_start.
> ---
>  drivers/net/fm10k/fm10k_ethdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index 7172a0f..c5c4712 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -84,6 +84,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev
> *dev,  static void fm10k_set_rx_function(struct rte_eth_dev *dev);  static void
> fm10k_set_tx_function(struct rte_eth_dev *dev);  static int
> fm10k_check_ftag(struct rte_devargs *devargs);
> +static int fm10k_link_update(struct rte_eth_dev *dev,
> +	__rte_unused int wait_to_complete);
> 
>  struct fm10k_xstats_name_off {
>  	char name[RTE_ETH_XSTATS_NAME_SIZE];
> @@ -1166,6 +1168,8 @@ static inline int fm10k_glort_valid(struct fm10k_hw
> *hw)
>  	if (!(dev->data->dev_conf.rxmode.mq_mode &
> ETH_MQ_RX_VMDQ_FLAG))
>  		fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
> 
> +	fm10k_link_update(dev, 0);
> +
>  	return 0;
>  }
> 

Acked-by : Jing Chen <jing.d.chen@intel.com>

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

* [PATCH v2] net/fm10k: initialize link status in device start
  2017-05-31 11:07 [PATCH] net/fm10k: initialize link status in device start Xiao Wang
  2017-06-21  2:35 ` Chen, Jing D
@ 2017-06-22 11:20 ` Xiao Wang
  2017-06-22  3:07   ` Chen, Jing D
  1 sibling, 1 reply; 6+ messages in thread
From: Xiao Wang @ 2017-06-22 11:20 UTC (permalink / raw)
  To: jing.d.chen; +Cc: dev, stable, Xiao Wang

Fm10k host driver can't manage PHY directly and provides a fake link
status by always reporting LINK_UP. We should initialize link status
in device start, otherwise application will get LINK_DOWN status
when LSC configured.

Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
v2:
* Rewrite commit message, add information about fm10k PHY.
* Always do link_update in dev_start.
---
 drivers/net/fm10k/fm10k_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 7172a0f..c5c4712 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -84,6 +84,8 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev *dev,
 static void fm10k_set_rx_function(struct rte_eth_dev *dev);
 static void fm10k_set_tx_function(struct rte_eth_dev *dev);
 static int fm10k_check_ftag(struct rte_devargs *devargs);
+static int fm10k_link_update(struct rte_eth_dev *dev,
+	__rte_unused int wait_to_complete);
 
 struct fm10k_xstats_name_off {
 	char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -1166,6 +1168,8 @@ static inline int fm10k_glort_valid(struct fm10k_hw *hw)
 	if (!(dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG))
 		fm10k_vlan_filter_set(dev, hw->mac.default_vid, true);
 
+	fm10k_link_update(dev, 0);
+
 	return 0;
 }
 
-- 
1.8.3.1

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

* Re: [dpdk-stable] [PATCH v2] net/fm10k: initialize link status in device start
  2017-06-22  3:07   ` Chen, Jing D
@ 2017-06-22 11:33     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2017-06-22 11:33 UTC (permalink / raw)
  To: Chen, Jing D, Wang, Xiao W; +Cc: dev, stable

On 6/22/2017 4:07 AM, Chen, Jing D wrote:
> 
> 
>> -----Original Message-----
>> From: Wang, Xiao W
>> Sent: Thursday, June 22, 2017 7:20 PM
>> To: Chen, Jing D <jing.d.chen@intel.com>
>> Cc: dev@dpdk.org; stable@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>
>> Subject: [PATCH v2] net/fm10k: initialize link status in device start
>>
>> Fm10k host driver can't manage PHY directly and provides a fake link status by
>> always reporting LINK_UP. We should initialize link status in device start,
>> otherwise application will get LINK_DOWN status when LSC configured.
>>
>> Fixes: 9ae6068c86da ("fm10k: add dev start/stop")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> Acked-by : Jing Chen <jing.d.chen@intel.com>

Applied to dpdk-next-net/master, thanks.

("__rte_unused" dropped from function prototype while applying)

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

end of thread, other threads:[~2017-06-22 11:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 11:07 [PATCH] net/fm10k: initialize link status in device start Xiao Wang
2017-06-21  2:35 ` Chen, Jing D
2017-06-22  2:31   ` Wang, Xiao W
2017-06-22 11:20 ` [PATCH v2] " Xiao Wang
2017-06-22  3:07   ` Chen, Jing D
2017-06-22 11:33     ` [dpdk-stable] " Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.