* [dpdk-stable] [PATCH] net/i40e: fix link status update
@ 2018-05-29 16:23 Fan Zhang
2018-05-29 20:10 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2018-05-30 8:26 ` [dpdk-stable] [PATCH v2] " Fan Zhang
0 siblings, 2 replies; 8+ messages in thread
From: Fan Zhang @ 2018-05-29 16:23 UTC (permalink / raw)
To: dev; +Cc: helin.zhang, roy.fan.zhang, qi.z.zhang, stable
This patch fixes link status update problem in interrupt mode.
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7d4f1c9da..13c5d3296 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2522,7 +2522,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
}
static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
{
/* Link status registers and values*/
#define I40E_PRTMAC_LINKSTA 0x001E2420
@@ -2576,8 +2576,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
}
static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
- bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+ bool enable_lse, int wait_to_complete)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
@@ -2601,7 +2601,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
}
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (unlikely(link->link_status != 0))
+ if (!wait_to_complete || link->link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
@@ -2649,10 +2649,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
link.link_autoneg = !(dev->data->dev_conf.link_speeds &
ETH_LINK_SPEED_FIXED);
- if (!wait_to_complete)
- update_link_no_wait(hw, &link);
+ if (!wait_to_complete && !enable_lse)
+ update_link_reg(hw, &link);
else
- update_link_wait(hw, &link, enable_lse);
+ update_link_aq(hw, &link, enable_lse, wait_to_complete);
ret = rte_eth_linkstatus_set(dev, &link);
i40e_notify_all_vfs_link_status(dev);
--
2.13.6
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix link status update
2018-05-29 16:23 [dpdk-stable] [PATCH] net/i40e: fix link status update Fan Zhang
@ 2018-05-29 20:10 ` Thomas Monjalon
2018-05-30 8:26 ` [dpdk-stable] [PATCH v2] " Fan Zhang
1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-05-29 20:10 UTC (permalink / raw)
To: Fan Zhang
Cc: dev, helin.zhang, qi.z.zhang, stable, ferruh.yigit, john.mcnamara
29/05/2018 18:23, Fan Zhang:
> This patch fixes link status update problem in interrupt mode.
Please describe what is the "problem".
I think you need to insert the Bugzilla ID here.
> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> Cc: stable@dpdk.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-stable] [PATCH v2] net/i40e: fix link status update
2018-05-29 16:23 [dpdk-stable] [PATCH] net/i40e: fix link status update Fan Zhang
2018-05-29 20:10 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
@ 2018-05-30 8:26 ` Fan Zhang
2018-05-30 8:30 ` Fan Zhang
2018-05-30 8:30 ` [dpdk-stable] [PATCH v3] " Fan Zhang
1 sibling, 2 replies; 8+ messages in thread
From: Fan Zhang @ 2018-05-30 8:26 UTC (permalink / raw)
To: dev; +Cc: helin.zhang, roy.fan.zhang, qi.z.zhang, stable
This patch fixes link status update problem in interrupt mode.
Previously, directly reading link status register instead of
accessing via admin queue command may cause the link status
change interrupt callback inactive. This patch fixes the
problem by making the driver only read the register in
"no wait" and polling mode.
Bugzilla ID 54, link https://dpdk.org/tracker/show_bug.cgi?id=54
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7d4f1c9da..13c5d3296 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2522,7 +2522,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
}
static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
{
/* Link status registers and values*/
#define I40E_PRTMAC_LINKSTA 0x001E2420
@@ -2576,8 +2576,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
}
static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
- bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+ bool enable_lse, int wait_to_complete)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
@@ -2601,7 +2601,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
}
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (unlikely(link->link_status != 0))
+ if (!wait_to_complete || link->link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
@@ -2649,10 +2649,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
link.link_autoneg = !(dev->data->dev_conf.link_speeds &
ETH_LINK_SPEED_FIXED);
- if (!wait_to_complete)
- update_link_no_wait(hw, &link);
+ if (!wait_to_complete && !enable_lse)
+ update_link_reg(hw, &link);
else
- update_link_wait(hw, &link, enable_lse);
+ update_link_aq(hw, &link, enable_lse, wait_to_complete);
ret = rte_eth_linkstatus_set(dev, &link);
i40e_notify_all_vfs_link_status(dev);
--
2.13.6
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-stable] [PATCH v2] net/i40e: fix link status update
2018-05-30 8:26 ` [dpdk-stable] [PATCH v2] " Fan Zhang
@ 2018-05-30 8:30 ` Fan Zhang
2018-05-30 8:30 ` [dpdk-stable] [PATCH v3] " Fan Zhang
1 sibling, 0 replies; 8+ messages in thread
From: Fan Zhang @ 2018-05-30 8:30 UTC (permalink / raw)
To: dev; +Cc: helin.zhang, roy.fan.zhang, qi.z.zhang, stable
This patch fixes link status update problem in interrupt mode.
Previously, directly reading link status register instead of
accessing via admin queue command may cause the link status
change interrupt callback inactive. This patch fixes the
problem by making the driver only read the register in
"no wait" and polling mode.
Bugzilla ID 54, link https://dpdk.org/tracker/show_bug.cgi?id=54
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7d4f1c9da..13c5d3296 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2522,7 +2522,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
}
static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
{
/* Link status registers and values*/
#define I40E_PRTMAC_LINKSTA 0x001E2420
@@ -2576,8 +2576,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
}
static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
- bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+ bool enable_lse, int wait_to_complete)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
@@ -2601,7 +2601,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
}
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (unlikely(link->link_status != 0))
+ if (!wait_to_complete || link->link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
@@ -2649,10 +2649,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
link.link_autoneg = !(dev->data->dev_conf.link_speeds &
ETH_LINK_SPEED_FIXED);
- if (!wait_to_complete)
- update_link_no_wait(hw, &link);
+ if (!wait_to_complete && !enable_lse)
+ update_link_reg(hw, &link);
else
- update_link_wait(hw, &link, enable_lse);
+ update_link_aq(hw, &link, enable_lse, wait_to_complete);
ret = rte_eth_linkstatus_set(dev, &link);
i40e_notify_all_vfs_link_status(dev);
--
2.13.6
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-stable] [PATCH v3] net/i40e: fix link status update
2018-05-30 8:26 ` [dpdk-stable] [PATCH v2] " Fan Zhang
2018-05-30 8:30 ` Fan Zhang
@ 2018-05-30 8:30 ` Fan Zhang
2018-05-30 8:47 ` Zhang, Qi Z
2018-05-30 9:54 ` [dpdk-stable] [dpdk-dev] " De Lara Guarch, Pablo
1 sibling, 2 replies; 8+ messages in thread
From: Fan Zhang @ 2018-05-30 8:30 UTC (permalink / raw)
To: dev; +Cc: helin.zhang, roy.fan.zhang, qi.z.zhang, stable
This patch fixes link status update problem in interrupt mode.
Previously, directly reading link status register instead of
accessing via admin queue command may cause the link status
change interrupt callback inactive. This patch fixes the
problem by making the driver only read the register in
"no wait" and polling mode.
Bugzilla ID: 54
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7d4f1c9da..13c5d3296 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2522,7 +2522,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
}
static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
{
/* Link status registers and values*/
#define I40E_PRTMAC_LINKSTA 0x001E2420
@@ -2576,8 +2576,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
}
static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
- bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+ bool enable_lse, int wait_to_complete)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
@@ -2601,7 +2601,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
}
link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
- if (unlikely(link->link_status != 0))
+ if (!wait_to_complete || link->link_status)
break;
rte_delay_ms(CHECK_INTERVAL);
@@ -2649,10 +2649,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
link.link_autoneg = !(dev->data->dev_conf.link_speeds &
ETH_LINK_SPEED_FIXED);
- if (!wait_to_complete)
- update_link_no_wait(hw, &link);
+ if (!wait_to_complete && !enable_lse)
+ update_link_reg(hw, &link);
else
- update_link_wait(hw, &link, enable_lse);
+ update_link_aq(hw, &link, enable_lse, wait_to_complete);
ret = rte_eth_linkstatus_set(dev, &link);
i40e_notify_all_vfs_link_status(dev);
--
2.13.6
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-stable] [PATCH v3] net/i40e: fix link status update
2018-05-30 8:30 ` [dpdk-stable] [PATCH v3] " Fan Zhang
@ 2018-05-30 8:47 ` Zhang, Qi Z
2018-05-30 9:54 ` [dpdk-stable] [dpdk-dev] " De Lara Guarch, Pablo
1 sibling, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2018-05-30 8:47 UTC (permalink / raw)
To: Zhang, Roy Fan, dev; +Cc: Zhang, Helin, stable
> -----Original Message-----
> From: Zhang, Roy Fan
> Sent: Wednesday, May 30, 2018 4:31 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin <helin.zhang@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v3] net/i40e: fix link status update
>
> This patch fixes link status update problem in interrupt mode.
> Previously, directly reading link status register instead of accessing via admin
> queue command may cause the link status change interrupt callback inactive.
> This patch fixes the problem by making the driver only read the register in
> "no wait" and polling mode.
>
> Bugzilla ID: 54
> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> Cc: stable@dpdk.org
>
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v3] net/i40e: fix link status update
2018-05-30 8:30 ` [dpdk-stable] [PATCH v3] " Fan Zhang
2018-05-30 8:47 ` Zhang, Qi Z
@ 2018-05-30 9:54 ` De Lara Guarch, Pablo
2018-05-30 10:25 ` Thomas Monjalon
1 sibling, 1 reply; 8+ messages in thread
From: De Lara Guarch, Pablo @ 2018-05-30 9:54 UTC (permalink / raw)
To: dev, dev; +Cc: Zhang, Helin, Zhang, Roy Fan, Zhang, Qi Z, stable
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org]
> Sent: Wednesday, May 30, 2018 9:31 AM
> To: dev@dpdk.org
> Cc: Zhang, Helin <helin.zhang@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] net/i40e: fix link status update
>
> This patch fixes link status update problem in interrupt mode.
> Previously, directly reading link status register instead of accessing via admin
> queue command may cause the link status change interrupt callback inactive.
> This patch fixes the problem by making the driver only read the register in "no
> wait" and polling mode.
>
> Bugzilla ID: 54
> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> Cc: stable@dpdk.org
>
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v3] net/i40e: fix link status update
2018-05-30 9:54 ` [dpdk-stable] [dpdk-dev] " De Lara Guarch, Pablo
@ 2018-05-30 10:25 ` Thomas Monjalon
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-05-30 10:25 UTC (permalink / raw)
To: Zhang, Roy Fan
Cc: dev, De Lara Guarch, Pablo, Zhang, Helin, Zhang, Qi Z, stable
> > This patch fixes link status update problem in interrupt mode.
> > Previously, directly reading link status register instead of accessing via admin
> > queue command may cause the link status change interrupt callback inactive.
> > This patch fixes the problem by making the driver only read the register in "no
> > wait" and polling mode.
> >
> > Bugzilla ID: 54
> > Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
>
> Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-05-30 10:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 16:23 [dpdk-stable] [PATCH] net/i40e: fix link status update Fan Zhang
2018-05-29 20:10 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2018-05-30 8:26 ` [dpdk-stable] [PATCH v2] " Fan Zhang
2018-05-30 8:30 ` Fan Zhang
2018-05-30 8:30 ` [dpdk-stable] [PATCH v3] " Fan Zhang
2018-05-30 8:47 ` Zhang, Qi Z
2018-05-30 9:54 ` [dpdk-stable] [dpdk-dev] " De Lara Guarch, Pablo
2018-05-30 10:25 ` Thomas Monjalon
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).