[dpdk-dev] [PATCH v4] net/pcap: support snaplen option to truncate packet

Stephen Hemminger stephen at networkplumber.org
Tue Jul 14 19:39:26 CEST 2020


On Tue, 14 Jul 2020 11:46:00 +0000
"Pattan, Reshma" <reshma.pattan at intel.com> wrote:

> > -----Original Message-----
> > From: wangzk320 at 163.com <wangzk320 at 163.com> On Behalf Of Zhike Wang
> > +			"[snaplen=<snap length>default:0, meaning no
> > truncation]'\n",  
> 
> From pdump changes, below are couple of comments.
> 
> Bit more descriptive would be nice,  how about, disables truncation of captured packets.?
> 
> > +	if (cnt1 == 1) {
> > +		v.min = 1;  
> 
> Min should be 0. User still can pass 0 value.
> 
> > +		v.max = UINT16_MAX;  
> 
> Instead of  allowing big max number, isn't it good to have some restricted max value?
> 
> Thanks,
> Reshma

An easier way to do the same thing. Just set the mbuf pool for the copied packets
to be sized to the snaplen, then modify pdump to only copy the truncated header.


More information about the dev mailing list