net/i40e: fix link status update
PATCH 1/1 net/i40e: fix link status update
This patch fixes link status update problem in interrupt mode.
--- drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_ethdev.c +7 -7
@@ -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 Ð_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);
Signature · 1 line
2.13.6
29/05/2018 18:23, Fan Zhang:
Quoted 1 line
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.
Quoted 2 lines
Fixes eef2daf2e199 ("net/i40e: fix link update no wait")
PATCH v2 1/1 net/i40e: fix link status update
In reply to Fan ZhangThis 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
--- drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_ethdev.c +7 -7
@@ -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 Ð_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);
Signature · 1 line
2.13.6
PATCH v2 1/1 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, link https://dpdk.org/tracker/show_bug.cgi?id=54
--- drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_ethdev.c +7 -7
@@ -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 Ð_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);
Signature · 1 line
2.13.6
PATCH v3 1/1 net/i40e: fix link status update
In reply to Fan ZhangThis 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
--- drivers/net/i40e/i40e_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_ethdev.c +7 -7
@@ -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 Ð_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);
Signature · 1 line
2.13.6
Quoted 15 lines
-----Original Message-----
From: Zhang, Roy Fan
Sent: Wednesday, May 30, 2018 4:31 PM
To: [email protected]
Cc: Zhang, Helin <[email protected]>; Zhang, Roy Fan <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: [PATCH v3] net/i40e: fix link status updateThis 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.
Quoted 5 lines
Bugzilla ID: 54
Fixes eef2daf2e199 ("net/i40e: fix link update no wait")Signed-off-by Fan Zhang <[email protected]>
Quoted 17 lines
-----Original Message-----
From: dev [mailto:[email protected]]
Sent: Wednesday, May 30, 2018 9:31 AM
To: [email protected]
Cc: Zhang, Helin <[email protected]>; Zhang, Roy Fan <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/i40e: fix link status updateThis 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.
Quoted 5 lines
Bugzilla ID: 54
Fixes eef2daf2e199 ("net/i40e: fix link update no wait")Signed-off-by Fan Zhang <[email protected]>
Thomas Monjalon
AppliedQuoted 6 lines
Quoted 6 lines
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.
Quoted 7 lines
Quoted 5 lines
Bugzilla ID: 54
Fixes eef2daf2e199 ("net/i40e: fix link update no wait")Signed-off-by Fan Zhang <[email protected]>Tested-by Pablo de Lara <[email protected]>
Applied, thanks