[Click] FromDump generates unneeded expensive_uniqueify's

Eddie Kohler kohler at cs.ucla.edu
Mon Dec 1 11:41:26 EST 2008


Hi Bart,

This is not actually a problem or error.  The deal here is this.  FromDump, 
via FromFile, reads dump data from a memory mapped file (when it can).  The 
file is mapped read-only.  FromFile then emits packets that are partial clones 
of the memory mapped buffer.  This makes efficient use of the file, especially 
when packets from the dump aren't modified.  However, if a packet *is* 
modified, it must be uniqueified, since it is a partial clone of a buffer 
containing more than just the one packet.  This uniqueification shouldn't be 
more expensive than creating a fresh packet in the first place.

Eddie


Bart Braem wrote:
> Hi,
> 
> The following script:
> 
> FromDump("http.cap", TIMING false, ACTIVE true, STOP true)
>          -> Strip(14)
>          -> MarkIPHeader
>          -> SetIPChecksum
>          -> Discard;
> 
> Will generate an expensive_uniqueify for each packet that is pulled  
> from the dump file (test it with e.g. <http://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=view&target=http.cap 
>  >). That does not seem a good idea.
> Problem tested in Click-1.6.0 and git HEAD.
> It seems as though the code in FromFile::get_packet contains an error  
> but we are not sure about the meaning of all fields there.
> 
> Regards,
> Bart and Peter


More information about the click mailing list