summaryrefslogtreecommitdiff
path: root/drivers/net/i40e/i40e_pf.c
diff options
context:
space:
mode:
authorQiming Yang <qiming.yang@intel.com>2016-11-04 17:10:51 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-11-07 17:50:25 +0100
commitbb6722fb5c0eae07ab3a6566298df2d6028e1cf9 (patch)
treec183662bd9d72d9ac0282ad42246cc937ed3186e /drivers/net/i40e/i40e_pf.c
parentf4668a33efe5311301e10bc6e3709a2eccb446ad (diff)
downloaddpdk-bb6722fb5c0eae07ab3a6566298df2d6028e1cf9.zip
dpdk-bb6722fb5c0eae07ab3a6566298df2d6028e1cf9.tar.gz
dpdk-bb6722fb5c0eae07ab3a6566298df2d6028e1cf9.tar.xz
net/i40e: fix VF bonded device link down
If VF device is used as slave of a bond device, it will be polled periodically through alarm. Interrupt is involved here. And then VF will send I40E_VIRTCHNL_OP_GET_LINK_STAT message to PF to query the status. The response is handled by interrupt callback. Interrupt is involved here again. That's why bond device cannot bring up. This patch removes I40E_VIRTCHNL_OP_GET_LINK_STAT message. Link status in VF driver will be updated when PF driver notify it, and VF stores this link status locally. VF driver just returns the local status when being required. Fixes: 4861cde46116 ("i40e: new poll mode driver") Signed-off-by: Qiming Yang <qiming.yang@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Diffstat (limited to 'drivers/net/i40e/i40e_pf.c')
-rw-r--r--drivers/net/i40e/i40e_pf.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index d5b2d45..ddfc140 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -250,7 +250,7 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
return ret;
}
-static int
+int
i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf,
uint32_t opcode,
uint32_t retval,
@@ -847,18 +847,6 @@ i40e_pf_host_process_cmd_get_stats(struct i40e_pf_vf *vf)
return I40E_SUCCESS;
}
-static void
-i40e_pf_host_process_cmd_get_link_status(struct i40e_pf_vf *vf)
-{
- struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vf->pf->main_vsi);
-
- /* Update link status first to acquire latest link change */
- i40e_dev_link_update(dev, 1);
- i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_LINK_STAT,
- I40E_SUCCESS, (uint8_t *)&dev->data->dev_link,
- sizeof(struct rte_eth_link));
-}
-
static int
i40e_pf_host_process_cmd_cfg_vlan_offload(
struct i40e_pf_vf *vf,
@@ -909,6 +897,20 @@ send_msg:
return ret;
}
+static void
+i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
+{
+ struct i40e_virtchnl_pf_event event;
+
+ event.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
+ event.event_data.link_event.link_status =
+ dev->data->dev_link.link_status;
+ event.event_data.link_event.link_speed =
+ (enum i40e_aq_link_speed)dev->data->dev_link.link_speed;
+ i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_EVENT,
+ I40E_SUCCESS, (uint8_t *)&event, sizeof(event));
+}
+
void
i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
uint16_t abs_vf_id, uint32_t opcode,
@@ -964,6 +966,7 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
case I40E_VIRTCHNL_OP_ENABLE_QUEUES:
PMD_DRV_LOG(INFO, "OP_ENABLE_QUEUES received");
i40e_pf_host_process_cmd_enable_queues(vf, msg, msglen);
+ i40e_notify_vf_link_status(dev, vf);
break;
case I40E_VIRTCHNL_OP_DISABLE_QUEUES:
PMD_DRV_LOG(INFO, "OP_DISABLE_QUEUE received");
@@ -993,10 +996,6 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
PMD_DRV_LOG(INFO, "OP_GET_STATS received");
i40e_pf_host_process_cmd_get_stats(vf);
break;
- case I40E_VIRTCHNL_OP_GET_LINK_STAT:
- PMD_DRV_LOG(INFO, "OP_GET_LINK_STAT received");
- i40e_pf_host_process_cmd_get_link_status(vf);
- break;
case I40E_VIRTCHNL_OP_CFG_VLAN_OFFLOAD:
PMD_DRV_LOG(INFO, "OP_CFG_VLAN_OFFLOAD received");
i40e_pf_host_process_cmd_cfg_vlan_offload(vf, msg, msglen);