X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fiavf%2Fiavf_vchnl.c;h=fa4da3a6dbf34e0273164c16b7b77d169e0c767b;hb=55f003d8884c3a05937ef7ef113f698870d71a83;hp=6381fb63c1bd0f18b322d7db62ae9c4140f494f1;hpb=02d212ca3125444a70952aae79a1d679e2f83973;p=dpdk.git diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 6381fb63c1..fa4da3a6db 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -19,11 +19,6 @@ #include #include -#include "iavf_log.h" -#include "base/iavf_prototype.h" -#include "base/iavf_adminq_cmd.h" -#include "base/iavf_type.h" - #include "iavf.h" #include "iavf_rxtx.h" @@ -31,7 +26,7 @@ #define ASQ_DELAY_MS 10 /* Read data in admin queue to get msg from pf driver */ -static enum iavf_status_code +static enum iavf_status iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len, uint8_t *buf) { @@ -69,7 +64,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) { struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - enum iavf_status_code ret; + enum iavf_status ret; int err = 0; int i = 0; @@ -153,7 +148,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg, case VIRTCHNL_EVENT_LINK_CHANGE: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event"); vf->link_up = pf_msg->event_data.link_event.link_status; - vf->link_speed = pf_msg->event_data.link_event.link_speed; + vf->link_speed = pf_msg->event_data.link_event_adv.link_speed; iavf_dev_link_update(dev, 0); _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); @@ -175,7 +170,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) struct iavf_arq_event_info info; uint16_t pending, aq_opc; enum virtchnl_ops msg_opc; - enum iavf_status_code msg_ret; + enum iavf_status msg_ret; int ret; info.buf_len = IAVF_AQ_BUF_SZ; @@ -201,7 +196,7 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) */ msg_opc = (enum virtchnl_ops)rte_le_to_cpu_32( info.desc.cookie_high); - msg_ret = (enum iavf_status_code)rte_le_to_cpu_32( + msg_ret = (enum iavf_status)rte_le_to_cpu_32( info.desc.cookie_low); switch (aq_opc) { case iavf_aqc_opc_send_msg_to_vf: @@ -210,12 +205,9 @@ iavf_handle_virtchnl_msg(struct rte_eth_dev *dev) info.msg_len); } else { /* read message and it's expected one */ - if (msg_opc == vf->pend_cmd) { - vf->cmd_retval = msg_ret; - /* prevent compiler reordering */ - rte_compiler_barrier(); - _clear_cmd(vf); - } else + if (msg_opc == vf->pend_cmd) + _notify_cmd(vf, msg_ret); + else PMD_DRV_LOG(ERR, "command mismatch," "expect %u, get %u", vf->pend_cmd, msg_opc); @@ -344,7 +336,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) * add advanced/optional offload capabilities */ - caps = IAVF_BASIC_OFFLOAD_CAPS; + caps = IAVF_BASIC_OFFLOAD_CAPS | VIRTCHNL_VF_CAP_ADV_LINK_SPEED; args.in_args = (uint8_t *)∩︀ args.in_args_size = sizeof(caps); @@ -363,7 +355,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) rte_memcpy(vf->vf_res, args.out_buffer, RTE_MIN(args.out_size, len)); /* parse VF config message back from PF*/ - iavf_parse_hw_config(hw, vf->vf_res); + iavf_vf_parse_hw_config(hw, vf->vf_res); for (i = 0; i < vf->vf_res->num_vsis; i++) { if (vf->vf_res->vsi_res[i].vsi_type == VIRTCHNL_VSI_SRIOV) vf->vsi_res = &vf->vf_res->vsi_res[i]; @@ -636,7 +628,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) { struct virtchnl_ether_addr_list *list; struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct ether_addr *addr; + struct rte_ether_addr *addr; struct iavf_cmd_info args; int len, err, i, j; int next_begin = 0; @@ -647,7 +639,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) len = sizeof(struct virtchnl_ether_addr_list); for (i = begin; i < IAVF_NUM_MACADDR_MAX; i++, next_begin++) { addr = &adapter->eth_dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; len += sizeof(struct virtchnl_ether_addr); if (len >= IAVF_AQ_BUF_SZ) { @@ -664,7 +656,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) for (i = begin; i < next_begin; i++) { addr = &adapter->eth_dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); @@ -753,7 +745,7 @@ iavf_config_promisc(struct iavf_adapter *adapter, } int -iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct ether_addr *addr, +iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, bool add) { struct virtchnl_ether_addr_list *list;