[PATCH] mbuf: add mbuf physical address field to dynamic field

Ferruh Yigit ferruh.yigit at xilinx.com
Tue Aug 30 15:07:47 CEST 2022


On 7/1/2022 1:24 PM, Shijith Thotton wrote:
>>> If all devices are configured to run in IOVA mode as VA, physical
>>> address field of mbuf (buf_iova) won't be used. In such cases, buf_iova
>>> space is free to use as a dynamic field. So a new dynamic field member
>>> (dynfield2) is added in mbuf structure to make use of that space.
>>>
>>> A new mbuf flag RTE_MBUF_F_DYNFIELD2 is introduced to help identify the
>>> mbuf that can use dynfield2.
>>>
>>> Signed-off-by: Shijith Thotton <sthotton at marvell.com>
>>
>> This seems like a complex and potentially error prone way to do this.
>> What is the use case?
>>
> 
> PCI drivers with the flag RTE_PCI_DRV_NEED_IOVA_AS_VA only works in IOVA mode as
> VA. buf_iova field of mbuf is not used by those PMDs and can be used as a
> dynamic area to save space.
> 

'RTE_PCI_DRV_NEED_IOVA_AS_VA' means device can *only* work in 
RTE_IOVA_VA mode, right?

Although there are many devices that support RTE_IOVA_VA mode, only a 
few of them works *only* with RTE_IOVA_VA mode, rest can prefer to use 
RTE_IOVA_PA or RTE_IOVA_VA.
Also using KNI forces to use RTE_IOVA_PA mode.
And moving 'buf_iova' filed out of first cache will impact the 
performance for RTE_IOVA_PA mode.

Since KNI is going away and vfio is more preferred way, it can be OK to 
make 'buf_iova' dynamic filed in long term, but I think it is better to 
do this slowly, like should we wait for KNI to go away first?


>> How much of a performance gain?
> 
> No change in performance.



More information about the dev mailing list