[PATCH v3] net/af_packet: cache align Rx/Tx structs

Stephen Hemminger stephen at networkplumber.org
Fri Apr 26 17:10:16 CEST 2024


On Fri, 26 Apr 2024 11:05:02 +0200
Mattias Rönnblom <mattias.ronnblom at ericsson.com> wrote:

> Cache align Rx and Tx queue struct to avoid false sharing.
> 
> The RX struct happens to be 64 bytes on x86_64 already, so cache
> alignment has no effect there, but it does on 32-bit ISAs.
> 
> The TX struct is 56 bytes on x86_64.
> 
> Both structs keep counters, and in the RX case they are updated even
> for empty polls.
> 
> v3: Move __rte_cache_aligned directive to a MSVC-compatible location.
> 
> Fixes: 364e08f2bbc0 ("af_packet: add PMD for AF_PACKET-based virtual devices")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>

Looks good.

Acked-by: Stephen Hemminger <stephen at networkplumber.org>

If you want to go further with this:
   - could rx and tx rings be next to each other so that any of the lookahead
     in cpu helps, not hurts?
   - what about secondary process support
   - would sendmmsg() and recvmmsg() help for bursting.


More information about the stable mailing list