X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_dcf_parent.c;h=2f96dedcce1c4aa8cc5b239718283d212fd10a2e;hb=c3d31352bf8713c8860bf90078c956b0a3792658;hp=020f7646711b26b78c6f55dbe213371dc777a251;hpb=7f7cbf80bdb7b57f3f67fe244be4572efa69b374;p=dpdk.git diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c index 020f764671..2f96dedcce 100644 --- a/drivers/net/ice/ice_dcf_parent.c +++ b/drivers/net/ice/ice_dcf_parent.c @@ -119,7 +119,9 @@ ice_dcf_vsi_update_service_handler(void *param) { struct ice_dcf_reset_event_param *reset_param = param; struct ice_dcf_hw *hw = reset_param->dcf_hw; - struct ice_dcf_adapter *adapter; + struct ice_dcf_adapter *adapter = + container_of(hw, struct ice_dcf_adapter, real_hw); + struct ice_adapter *parent_adapter = &adapter->parent; pthread_detach(pthread_self()); @@ -127,11 +129,12 @@ ice_dcf_vsi_update_service_handler(void *param) rte_spinlock_lock(&vsi_update_lock); - adapter = container_of(hw, struct ice_dcf_adapter, real_hw); - - if (!ice_dcf_handle_vsi_update_event(hw)) + if (!ice_dcf_handle_vsi_update_event(hw)) { + __atomic_store_n(&parent_adapter->dcf_state_on, true, + __ATOMIC_RELAXED); ice_dcf_update_vf_vsi_map(&adapter->parent.hw, hw->num_vfs, hw->vf_vsi_map); + } if (reset_param->vfr && adapter->repr_infos) { struct rte_eth_dev *vf_rep_eth_dev = @@ -143,6 +146,9 @@ ice_dcf_vsi_update_service_handler(void *param) } } + if (hw->tm_conf.committed) + ice_dcf_replay_vf_bw(hw, reset_param->vf_id); + rte_spinlock_unlock(&vsi_update_lock); free(param); @@ -221,6 +227,9 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw, uint8_t *msg, uint16_t msglen) { struct virtchnl_pf_event *pf_msg = (struct virtchnl_pf_event *)msg; + struct ice_dcf_adapter *adapter = + container_of(dcf_hw, struct ice_dcf_adapter, real_hw); + struct ice_adapter *parent_adapter = &adapter->parent; if (msglen < sizeof(struct virtchnl_pf_event)) { PMD_DRV_LOG(DEBUG, "Invalid event message length : %u", msglen); @@ -230,7 +239,7 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw, switch (pf_msg->event) { case VIRTCHNL_EVENT_RESET_IMPENDING: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event"); - start_vsi_reset_thread(dcf_hw, false, 0); + dcf_hw->resetting = true; break; case VIRTCHNL_EVENT_LINK_CHANGE: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event"); @@ -255,6 +264,8 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw, PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE event : VF%u with VSI num %u", pf_msg->event_data.vf_vsi_map.vf_id, pf_msg->event_data.vf_vsi_map.vsi_id); + __atomic_store_n(&parent_adapter->dcf_state_on, false, + __ATOMIC_RELAXED); start_vsi_reset_thread(dcf_hw, true, pf_msg->event_data.vf_vsi_map.vf_id); break; @@ -329,7 +340,7 @@ ice_dcf_init_parent_hw(struct ice_hw *hw) goto err_unroll_alloc; /* Initialize port_info struct with link information */ - status = ice_aq_get_link_info(hw->port_info, false, NULL, NULL); + status = ice_aq_get_link_info(hw->port_info, true, NULL, NULL); if (status) goto err_unroll_alloc; @@ -354,6 +365,7 @@ err_unroll_fltr_mgmt_struct: err_unroll_alloc: ice_free(hw, hw->port_info); hw->port_info = NULL; + hw->switch_info = NULL; return status; } @@ -367,6 +379,7 @@ static void ice_dcf_uninit_parent_hw(struct ice_hw *hw) ice_free(hw, hw->port_info); hw->port_info = NULL; + hw->switch_info = NULL; ice_clear_all_vsi_ctx(hw); } @@ -482,6 +495,8 @@ ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev) struct ice_hw *parent_hw = &parent_adapter->hw; eth_dev->data->mac_addrs = NULL; + rte_free(parent_adapter->pf.main_vsi); + parent_adapter->pf.main_vsi = NULL; ice_flow_uninit(parent_adapter); ice_dcf_uninit_parent_hw(parent_hw);