[PATCH net-next 4/4] net: ethernet: mtk_eth_soc: optimize dma ring address/index calculation
Paolo Abeni
pabeni at redhat.com
Mon Oct 21 02:23:36 PDT 2024
On 10/15/24 15:07, Felix Fietkau wrote:
> On 15.10.24 14:54, Andrew Lunn wrote:
>> On Tue, Oct 15, 2024 at 01:09:38PM +0200, Felix Fietkau wrote:
>>> Since DMA descriptor sizes are all power of 2, we can avoid costly integer
>>> division in favor or simple shifts.
>>
>> Could a BUILD_BUG_ON() be added to validate this?
>
> Not sure if that would be useful. I can't put the BUILD_BUG_ON in the
> initializer macro, so I could only add it for the individual dma
> descriptor structs.
> Since the size of those structs will not be changed (otherwise it would
> immediately visibly break with existing hw), the remaining possibility
> would be adding new structs that violate this expectation. However,
> those would then not be covered by the BUILD_BUG_ON.
>
>> Do you have some benchmark data for this series? It would be good to
>> add to a patch 0/4.
>
> No, I just ran basic tests that everything still works well and looked
> at the assembly diff to ensure that the generated code seems sane.
Since this series is about performances, some related quick figures
would be really a plus.
At least we need a cover-letter to try to keep the git log history
clean. Otherwise cooking the net-next PR at the end of the cycle will be
a 10w worth task;)
Please re-send with a cover letter.
Thanks,
Paolo
More information about the Linux-mediatek
mailing list