X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fnetvsc%2Fhn_nvs.c;h=eeb82ab9eeeef436a6f760317647381ebb11cf42;hb=a3babbdd0fd64eda10f3967011a410faab8080a1;hp=f88854dafcdb3a1e50c63677c00109429af66da1;hpb=d43b8c710836db953fad1bb6449a827e19b5a87a;p=dpdk.git diff --git a/drivers/net/netvsc/hn_nvs.c b/drivers/net/netvsc/hn_nvs.c index f88854dafc..eeb82ab9ee 100644 --- a/drivers/net/netvsc/hn_nvs.c +++ b/drivers/net/netvsc/hn_nvs.c @@ -223,9 +223,15 @@ hn_nvs_conn_rxbuf(struct hn_data *hv) resp.nvs_sect[0].slotcnt); hv->rxbuf_section_cnt = resp.nvs_sect[0].slotcnt; - hv->rxbuf_info = rte_calloc("HN_RXBUF_INFO", hv->rxbuf_section_cnt, - sizeof(*hv->rxbuf_info), RTE_CACHE_LINE_SIZE); - if (!hv->rxbuf_info) { + /* + * Pimary queue's rxbuf_info is not allocated at creation time. + * Now we can allocate it after we figure out the slotcnt. + */ + hv->primary->rxbuf_info = rte_calloc("HN_RXBUF_INFO", + hv->rxbuf_section_cnt, + sizeof(*hv->primary->rxbuf_info), + RTE_CACHE_LINE_SIZE); + if (!hv->primary->rxbuf_info) { PMD_DRV_LOG(ERR, "could not allocate rxbuf info"); return -ENOMEM; @@ -255,7 +261,6 @@ hn_nvs_disconn_rxbuf(struct hn_data *hv) error); } - rte_free(hv->rxbuf_info); /* * Linger long enough for NVS to disconnect RXBUF. */