[PATCH] net/ice: fix incorrect mbuf cleanup function

Burakov, Anatoly anatoly.burakov at intel.com
Mon Feb 24 14:43:07 CET 2025


On 21/02/2025 17:04, Bruce Richardson wrote:
> The mbuf cleanup function is not being called correctly on close of the
> driver, due to the vector_tx flag not being set correctly on each Tx
> queue. Normally, this causes no visible problems, because the default is
> to have the vector flag unset, which means that, if vector Tx path is
> chosen, we only free every second mbuf in the descriptor vector ring - a
> subtle memory leak.
> 
> The reverse case - where we initially configure a port to use a vector
> driver, and then later reconfigure it for scalar - causes a segfault on
> close, as the vector cleanup is used on a scalar SW ring, and that
> vector path treats the extra metadata in the SW ring as mbufs to be
> freed.
> 
> This is due to an inconsistency across drivers on port start: in e.g.
> the i40e driver, the Rx and Tx functions are chosen before the
> individual queues are started, while in ice driver the order is
> reversed.  Because the Tx function selection is done after the queues
> are initialized, the initialized queues use an old value of the overall
> flag indicating if a vector Tx path is being used.
> 
> Fix the issue by moving the Rx and Tx path selection before queue start.
> 
> Fixes: 552979dfb1c9 ("net/intel: create common Tx queue mbuf cleanup")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly


More information about the dev mailing list