On Thu, 12 Jan 2023 09:57:50 +0000 Amit Prakash Shukla <amitpraka...@marvell.com> wrote:
> Hi Stephen, > > > -----Original Message----- > > From: Stephen Hemminger <step...@networkplumber.org> > > Sent: Wednesday, January 11, 2023 9:37 PM > > To: Amit Prakash Shukla <amitpraka...@marvell.com> > > Cc: Jerin Jacob Kollanukkaran <jer...@marvell.com>; Kiran Kumar > > Kokkilagadda <kirankum...@marvell.com>; Nithin Kumar Dabilpuram > > <ndabilpu...@marvell.com>; dev@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 <amitpraka...@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