[PATCH] net/af_packet: allow disabling packet fanout
    Stephen Hemminger 
    stephen at networkplumber.org
       
    Thu Dec 12 18:11:02 CET 2024
    
    
  
On Thu, 12 Dec 2024 10:04:42 +0200
Tudor Cornea <tudor.cornea at gmail.com> wrote:
> This allows us to control whether the PMD will attempt to use
> the PACKET_FANOUT socket option, and allows the binary compiled
> against newer kernel headers to run on an older kernel, which
> lacks support for it.
> 
> Signed-off-by: Tudor Cornea <tudor.cornea at gmail.com>
Controlling fanout more is a good idea but not sure what this patch
is trying to do with it.
- DPDK minimum kernel version is now 4.19 so no point in worrying about
   backward compatibility. According to man page for packet, fanout
   was added in 3.1 kernel.
- It would be useful to allow application to control fanout in more detail.
  According to man page:
         •  The  load-balance  mode  PACKET_FANOUT_LB  implements a round-
            robin algorithm.
         •  PACKET_FANOUT_CPU selects the socket based on the CPU that the
            packet arrived on.
          •  PACKET_FANOUT_ROLLOVER processes all data on a single  socket,
             moving to the next when one becomes backlogged.
          •  PACKET_FANOUT_RND  selects  the  socket  using a pseudo-random
             number generator.
          •  PACKET_FANOUT_QM (available  since  Linux  3.14)  selects  the
             socket using the recorded queue_mapping of the received skb.
The default should be for packet to behave like a hardware NIC if RSS is
enabled. And use a single queue if RSS is not enabled. The PMD kind of does
this now but not the same.
    
    
More information about the dev
mailing list