[dpdk-dev] [PATCH v3 0/4] Memory corruption due to HW rings allocation

Ferruh Yigit ferruh.yigit at intel.com
Wed May 13 17:22:22 CEST 2020


On 5/13/2020 2:14 PM, Renata Saiakhova wrote:
> igb and ixgbe and some other drivers allocate HW rings using rte_eth_dma_zone_reserve(),
> which checks first if the memzone exists for a given name, consisting of port
> id, queue_id, rx/tx direction, but not for the size, alignment, and socket_id.
> If the memzone with a given name exists it is returned, otherwise it is
> allocated.
> Disconnecting dpdk port from one type of interface (igb) and connecting it
> to another type of interface (ixgbe) for the same port id, potentially creates
> memory overlap and corruption, because it may require memzone of bigger size.
> That's what is happening from switching from igb to ixgbe having the same port
> id.
> 
> v2->v3: Remove #undef ETH_DMA_MZONE_NAME and minor changes in code standard
> v1->v2: Minor changes on code standard and additional fixes in i40e em and ice drivers
> 
> Renata Saiakhova (4):
>   librte_ethdev: Introduce a function to release HW rings
>   drivers/net: Fix in igb and ixgbe HW rings memory
>   drivers/net: Fix in i40e HW rings memory overlap
>   drivers/net: Fix in em and ice HW rings memory overlap

I think all driver patches can be squashed into single patch, overall they are
implementing same logic.

But as mentioned before, there are multiple other drivers allocating HW rings
with exact same name. At least I can see:
iavf
nfp
fm10k
axgbe

Or how can we know if a new PMD won't cause exact same behavior? What to you
think adding pmd name as prefix to queue memzone name for all PMDs? This can
help new PMDs using existing code as sample.

I don't know if it has been discussed before, but wouldn't update the
'rte_eth_dma_zone_reserve()' to check the size & alignment instead of just name
fix the issue for all drivers without needing to update them?


More information about the dev mailing list