[EXT] Re: [PATCH v2 2/3] graph: pcap capture for graph nodes
Stephen Hemminger
stephen at networkplumber.org
Thu Jan 12 17:30:24 CET 2023
On Thu, 12 Jan 2023 09:57:50 +0000
Amit Prakash Shukla <amitprakashs at marvell.com> wrote:
> Hi Stephen,
>
> > -----Original Message-----
> > From: Stephen Hemminger <stephen at networkplumber.org>
> > Sent: Wednesday, January 11, 2023 9:37 PM
> > To: Amit Prakash Shukla <amitprakashs at marvell.com>
> > Cc: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Kiran Kumar
> > Kokkilagadda <kirankumark at marvell.com>; Nithin Kumar Dabilpuram
> > <ndabilpuram at marvell.com>; dev at dpdk.org
> > Subject: [EXT] Re: [PATCH v2 2/3] graph: pcap capture for graph nodes
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Wed, 11 Jan 2023 14:23:41 +0530
> > Amit Prakash Shukla <amitprakashs at marvell.com> wrote:
> >
> > > +
> > > +#define PCAP_DUMP_DATA(dbuf, buf_size, cur_len, sbuf, len) \
> > > +do { \
> > > + if ((cur_len + len) >= buf_size) \
> > > + break; \
> > > + rte_memcpy(dbuf + cur_len, sbuf, len); \
> > > + cur_len += len; \
> > > +} while (0)
> > > +
> >
> > Why do you need this to be a macro.
> > Macro's are evil, have side effects and hide code.
>
> I had added macro for future, if lot of custom data is to be added to pcapng. Anyways I will remove it
> in next version of patch.
One other option is to add a new custom block type or options in pcapng.
Keep comment as a string, since that is what wireshark etc no how to handle.
Also, packet id data might be useful for graph.
https://pcapng.github.io/pcapng/draft-tuexen-opsawg-pcapng.html
More information about the dev
mailing list