[1/4] net/i40e: fix buffer leak on Rx reconfiguration
Checks
Commit Message
When reconfiguring a single queue on a device, the mbuf initializer
value was not getting set, and remained at zero. This lead to mbuf leaks
as the refcount was incorrect (0), so on free it wrapped around to
UINT16_MAX. When setting up the mbuf initializer, also ensure that the
queue is explicitly marked as using a vector function by setting the
"rx_using_sse" flag.
Fixes: a3c83a2527e1 ("net/i40e: enable runtime queue setup")
Cc: qi.z.zhang@intel.com
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/i40e/i40e_rxtx.c | 6 ++++++
drivers/net/i40e/i40e_rxtx_vec_common.h | 1 +
2 files changed, 7 insertions(+)
@@ -1918,6 +1918,12 @@ i40e_dev_rx_queue_setup_runtime(struct rte_eth_dev *dev,
if (use_def_burst_func)
ad->rx_bulk_alloc_allowed = false;
i40e_set_rx_function(dev);
+
+ if (ad->rx_vec_allowed && i40e_rxq_vec_setup(rxq)) {
+ PMD_DRV_LOG(ERR, "Failed vector rx setup.");
+ return -EINVAL;
+ }
+
return 0;
} else if (ad->rx_vec_allowed && !rte_is_power_of_2(rxq->nb_rx_desc)) {
PMD_DRV_LOG(ERR, "Vector mode is allowed, but descriptor"
@@ -201,6 +201,7 @@ i40e_rxq_vec_setup_default(struct i40e_rx_queue *rxq)
rte_compiler_barrier();
p = (uintptr_t)&mb_def.rearm_data;
rxq->mbuf_initializer = *(uint64_t *)p;
+ rxq->rx_using_sse = 1;
return 0;
}