X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_dcf.c;h=d72a6f357e86ccb2496fd91f7d77c2bd22297af5;hb=ddbc8c16a97fd6662ecccf7e8431a9a3c7f43366;hp=fbeb58ee1fcbd2496a65af0d30f295a21fc68e40;hpb=c9f889e9961681f035e188fbd492b81b0e171cb1;p=dpdk.git diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index fbeb58ee1f..d72a6f357e 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -17,8 +17,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -234,6 +234,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw) caps = VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | VIRTCHNL_VF_OFFLOAD_RX_POLLING | VIRTCHNL_VF_CAP_ADV_LINK_SPEED | VIRTCHNL_VF_CAP_DCF | + VIRTCHNL_VF_OFFLOAD_VLAN_V2 | VF_BASE_MODE_OFFLOADS | VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC; err = ice_dcf_send_cmd_req_no_irq(hw, VIRTCHNL_OP_GET_VF_RESOURCES, @@ -318,6 +319,7 @@ ice_dcf_get_vf_vsi_map(struct ice_dcf_hw *hw) } hw->num_vfs = vsi_map->num_vfs; + hw->pf_vsi_id = vsi_map->pf_vsi; } if (!memcmp(hw->vf_vsi_map, vsi_map->vf_vsi, len)) { @@ -503,9 +505,7 @@ ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc, } do { - if ((!desc_cmd.pending && !buff_cmd.pending) || - (!desc_cmd.pending && desc_cmd.v_ret != IAVF_SUCCESS) || - (!buff_cmd.pending && buff_cmd.v_ret != IAVF_SUCCESS)) + if (!desc_cmd.pending && !buff_cmd.pending) break; rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME); @@ -827,6 +827,7 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) return 0; } +#define IAVF_RXDID_LEGACY_0 0 #define IAVF_RXDID_LEGACY_1 1 #define IAVF_RXDID_COMMS_GENERIC 16 @@ -872,6 +873,7 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw) vc_qp->rxq.dma_ring_addr = rxq[i]->rx_ring_dma; vc_qp->rxq.databuffer_size = rxq[i]->rx_buf_len; +#ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC if (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && hw->supported_rxdid & @@ -883,6 +885,20 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw) PMD_DRV_LOG(ERR, "RXDID 16 is not supported"); return -EINVAL; } +#else + if (hw->vf_res->vf_cap_flags & + VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC && + hw->supported_rxdid & + BIT(IAVF_RXDID_LEGACY_0)) { + vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_0; + PMD_DRV_LOG(NOTICE, "request RXDID == %d in " + "Queue[%d]", vc_qp->rxq.rxdid, i); + } else { + PMD_DRV_LOG(ERR, "RXDID == 0 is not supported"); + return -EINVAL; + } +#endif + ice_select_rxd_to_pkt_fields_handler(rxq[i], vc_qp->rxq.rxdid); } memset(&args, 0, sizeof(args)); @@ -1020,3 +1036,45 @@ ice_dcf_query_stats(struct ice_dcf_hw *hw, return 0; } + +int +ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw, bool add) +{ + struct virtchnl_ether_addr_list *list; + struct rte_ether_addr *addr; + struct dcf_virtchnl_cmd args; + int len, err = 0; + + len = sizeof(struct virtchnl_ether_addr_list); + addr = hw->eth_dev->data->mac_addrs; + len += sizeof(struct virtchnl_ether_addr); + + list = rte_zmalloc(NULL, len, 0); + if (!list) { + PMD_DRV_LOG(ERR, "fail to allocate memory"); + return -ENOMEM; + } + + rte_memcpy(list->list[0].addr, addr->addr_bytes, + sizeof(addr->addr_bytes)); + PMD_DRV_LOG(DEBUG, "add/rm mac:%x:%x:%x:%x:%x:%x", + addr->addr_bytes[0], addr->addr_bytes[1], + addr->addr_bytes[2], addr->addr_bytes[3], + addr->addr_bytes[4], addr->addr_bytes[5]); + + list->vsi_id = hw->vsi_res->vsi_id; + list->num_elements = 1; + + memset(&args, 0, sizeof(args)); + args.v_op = add ? VIRTCHNL_OP_ADD_ETH_ADDR : + VIRTCHNL_OP_DEL_ETH_ADDR; + args.req_msg = (uint8_t *)list; + args.req_msglen = len; + err = ice_dcf_execute_virtchnl_cmd(hw, &args); + if (err) + PMD_DRV_LOG(ERR, "fail to execute command %s", + add ? "OP_ADD_ETHER_ADDRESS" : + "OP_DEL_ETHER_ADDRESS"); + rte_free(list); + return err; +}