X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fbnxt_vnic.c;h=aebfb1f1cf257fb385b4c16fdfcf5689dee00159;hb=061ee47cf53395a6453a97dfc6881ebfc9905743;hp=19d06af55bfb9e893785dc2e09aff44af98c2ed5;hpb=44cbeffe77651239cb4d425c61b9ee1cfde27152;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 19d06af55b..aebfb1f1cf 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -39,7 +39,7 @@ void bnxt_init_vnics(struct bnxt *bp) { struct bnxt_vnic_info *vnic; uint16_t max_vnics; - int i, j; + int i; max_vnics = bp->max_vnics; STAILQ_INIT(&bp->free_vnic_list); @@ -52,37 +52,11 @@ void bnxt_init_vnics(struct bnxt *bp) vnic->hash_mode = HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT; - for (j = 0; j < MAX_QUEUES_PER_VNIC; j++) - vnic->fw_grp_ids[j] = (uint16_t)HWRM_NA_SIGNATURE; - prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE); STAILQ_INIT(&vnic->filter); STAILQ_INIT(&vnic->flow_list); STAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, next); } - for (i = 0; i < MAX_FF_POOLS; i++) - STAILQ_INIT(&bp->ff_pool[i]); -} - -int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic, - int pool) -{ - struct bnxt_vnic_info *temp; - - temp = STAILQ_FIRST(&bp->ff_pool[pool]); - while (temp) { - if (temp == vnic) { - STAILQ_REMOVE(&bp->ff_pool[pool], vnic, - bnxt_vnic_info, next); - vnic->fw_vnic_id = (uint16_t)HWRM_NA_SIGNATURE; - STAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, - next); - return 0; - } - temp = STAILQ_NEXT(temp, next); - } - PMD_DRV_LOG(ERR, "VNIC %p is not found in pool[%d]\n", vnic, pool); - return -EINVAL; } struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp) @@ -101,26 +75,22 @@ struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp) void bnxt_free_all_vnics(struct bnxt *bp) { - struct bnxt_vnic_info *temp, *next; - int i; + struct bnxt_vnic_info *temp; + unsigned int i; - for (i = 0; i < MAX_FF_POOLS; i++) { - temp = STAILQ_FIRST(&bp->ff_pool[i]); - while (temp) { - next = STAILQ_NEXT(temp, next); - STAILQ_REMOVE(&bp->ff_pool[i], temp, bnxt_vnic_info, - next); - STAILQ_INSERT_TAIL(&bp->free_vnic_list, temp, next); - temp = next; - } + for (i = 0; i < bp->nr_vnics; i++) { + temp = &bp->vnic_info[i]; + STAILQ_INSERT_TAIL(&bp->free_vnic_list, temp, next); } } void bnxt_free_vnic_attributes(struct bnxt *bp) { struct bnxt_vnic_info *vnic; + unsigned int i; - STAILQ_FOREACH(vnic, &bp->free_vnic_list, next) { + for (i = 0; i < bp->max_vnics; i++) { + vnic = &bp->vnic_info[i]; if (vnic->rss_table) { /* 'Unreserve' the rss_table */ /* N/A */