net/ice: fix link status recovery
This patch fixes a kernel driver link status issue by recovering
link status when device stops.
Fixes: e6161345d8
("net/ice: support link status change")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
This commit is contained in:
parent
db6730a809
commit
fdcf92ed66
@ -2358,6 +2358,9 @@ ice_dev_stop(struct rte_eth_dev *dev)
|
|||||||
/* Clear all queues and release mbufs */
|
/* Clear all queues and release mbufs */
|
||||||
ice_clear_queues(dev);
|
ice_clear_queues(dev);
|
||||||
|
|
||||||
|
if (pf->init_link_up)
|
||||||
|
ice_dev_set_link_up(dev);
|
||||||
|
else
|
||||||
ice_dev_set_link_down(dev);
|
ice_dev_set_link_down(dev);
|
||||||
|
|
||||||
/* Clean datapath event and queue/vec mapping */
|
/* Clean datapath event and queue/vec mapping */
|
||||||
@ -2732,6 +2735,27 @@ ice_rxq_intr_setup(struct rte_eth_dev *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ice_get_init_link_status(struct rte_eth_dev *dev)
|
||||||
|
{
|
||||||
|
struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||||
|
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
|
||||||
|
bool enable_lse = dev->data->dev_conf.intr_conf.lsc ? true : false;
|
||||||
|
struct ice_link_status link_status;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = ice_aq_get_link_info(hw->port_info, enable_lse,
|
||||||
|
&link_status, NULL);
|
||||||
|
if (ret != ICE_SUCCESS) {
|
||||||
|
PMD_DRV_LOG(ERR, "Failed to get link info");
|
||||||
|
pf->init_link_up = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (link_status.link_info & ICE_AQ_LINK_UP)
|
||||||
|
pf->init_link_up = true;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ice_dev_start(struct rte_eth_dev *dev)
|
ice_dev_start(struct rte_eth_dev *dev)
|
||||||
{
|
{
|
||||||
@ -2802,6 +2826,8 @@ ice_dev_start(struct rte_eth_dev *dev)
|
|||||||
if (ret != ICE_SUCCESS)
|
if (ret != ICE_SUCCESS)
|
||||||
PMD_DRV_LOG(WARNING, "Fail to set phy mask");
|
PMD_DRV_LOG(WARNING, "Fail to set phy mask");
|
||||||
|
|
||||||
|
ice_get_init_link_status(dev);
|
||||||
|
|
||||||
ice_dev_set_link_up(dev);
|
ice_dev_set_link_up(dev);
|
||||||
|
|
||||||
/* Call get_link_info aq commond to enable/disable LSE */
|
/* Call get_link_info aq commond to enable/disable LSE */
|
||||||
|
@ -378,6 +378,7 @@ struct ice_pf {
|
|||||||
struct ice_parser_list rss_parser_list;
|
struct ice_parser_list rss_parser_list;
|
||||||
struct ice_parser_list perm_parser_list;
|
struct ice_parser_list perm_parser_list;
|
||||||
struct ice_parser_list dist_parser_list;
|
struct ice_parser_list dist_parser_list;
|
||||||
|
bool init_link_up;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ICE_MAX_QUEUE_NUM 2048
|
#define ICE_MAX_QUEUE_NUM 2048
|
||||||
|
Loading…
Reference in New Issue
Block a user