[dpdk-dev,v2] net/i40e: fix VF link status update

Message ID 1492025400-8724-1-git-send-email-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Qi Zhang April 12, 2017, 7:30 p.m. UTC
  VF link status rely on PF's notification, so when PF link status
be updated, it should notify VF to update link status also.
Current implementation only cover part of the situation when PF's link
status is updated, call i40e_notify_all_vfs_link_status in 
i4e_dev_link_update will cover all situationa.

Fixes: bb6722fb5c0e ("net/i40e: fix VF bonded device link down")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2

- this is a fix.
- remove redundant i40e_notify_all_vfs_link_status call.

 drivers/net/i40e/i40e_ethdev.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Comments

Ferruh Yigit April 13, 2017, 10:54 a.m. UTC | #1
On 4/12/2017 8:30 PM, Qi Zhang wrote:
> VF link status rely on PF's notification, so when PF link status
> be updated, it should notify VF to update link status also.
> Current implementation only cover part of the situation when PF's link
> status is updated, call i40e_notify_all_vfs_link_status in 
> i4e_dev_link_update will cover all situationa.
> 
> Fixes: bb6722fb5c0e ("net/i40e: fix VF bonded device link down")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

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

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 6927fde..083041e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -428,6 +428,7 @@  static int i40e_cloud_filter_qinq_create(struct i40e_pf *pf);
 static void i40e_ethertype_filter_restore(struct i40e_pf *pf);
 static void i40e_tunnel_filter_restore(struct i40e_pf *pf);
 static void i40e_filter_restore(struct i40e_pf *pf);
+static void i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev);
 
 int i40e_logtype_init;
 int i40e_logtype_driver;
@@ -2307,6 +2308,8 @@  i40e_dev_link_update(struct rte_eth_dev *dev,
 	if (link.link_status == old.link_status)
 		return -1;
 
+	i40e_notify_all_vfs_link_status(dev);
+
 	return 0;
 }
 
@@ -5787,11 +5790,9 @@  i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
 			break;
 		case i40e_aqc_opc_get_link_status:
 			ret = i40e_dev_link_update(dev, 0);
-			if (!ret) {
-				i40e_notify_all_vfs_link_status(dev);
+			if (!ret)
 				_rte_eth_dev_callback_process(dev,
 					RTE_ETH_EVENT_INTR_LSC, NULL);
-			}
 			break;
 		default:
 			PMD_DRV_LOG(ERR, "Request %u is not supported yet",