Re: [PATCH v20 20/25] net/pcap: add snapshot length devarg

Bruce Richardson
2026-03-16T14:37:15Z

On Tue, Mar 10, 2026 at 09:09:58AM -0700, Stephen Hemminger wrote:
> Add a new devarg 'snaplen' to configure the pcap snapshot length,
> which controls the maximum packet size for capture and output.
>
> The snapshot length affects:
> - The pcap_set_snaplen() call when capturing from interfaces
> - The pcap_open_dead() snapshot parameter for output files
> - The reported max_rx_pktlen in device info
> - The reported max_mtu in device info (snaplen - ethernet header)
>
> The default value is 65535 bytes, preserving backward compatibility
> with previous driver behavior.
>
> The snaplen argument is parsed before interface and file arguments
> so that its value is available when pcap handles are opened during
> device creation.
>
> Example usage:
> --vdev 'net_pcap0,snaplen=1518,iface=eth0'
> --vdev 'net_pcap0,snaplen=9000,rx_pcap=in.pcap,tx_pcap=out.pcap'
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>