[dpdk-dev] [PATCH] pmdinfogen: allow using stdin and stdout

Bruce Richardson bruce.richardson at intel.com
Fri Jan 26 10:19:18 CET 2018


On Thu, Jan 25, 2018 at 04:30:40PM -0500, Neil Horman wrote:
> On Thu, Jan 25, 2018 at 11:12:25AM +0000, Bruce Richardson wrote:
> > Rather than having to work off files all the time, allow stdin and
> > stdout to be used as the source and destination for pmdinfogen. This
> > will allow other possible usages from scripts, e.g. taking files
> > from ar archive and building a single .pmd.c file from all the .o
> > files in it.
> > 
> > 	for f in `ar t librte_pmd_xyz.a` ; do ar p librte_pmd_xyz.a $f |
> > 	pmdinfogen - - >> xyz_info.c done
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> I think this is a great idea.  FWIW, I think the ELF header at the
> front of the file should have something that tells you the overall
> disk file size in it.  The ELF header is pretty easy to parse and do
> some basic evaluation on, so you could accelerate that read a bit, by
> breaking it down into a read of the size of the header, followed by a
> parsing of it and a subsequent read of the overall size, but that
> probably just nice to have
> 
Yes, it's a good idea for future implementation. It would also allow
multiple .o files to be streamed together, since pmdinfogen could
recognise the end of one elf file and the start of another. That would
remove the need for the loop in the example above, since we could just
pipe the "ar p" output of the whole archive straight to pmdinfogen.

Not something for this release though. :-)

Thanks,
/Bruce

> Either way, this is a worthwhile feature to have
> Acked-by: Neil Horman <nhorman at tuxdriver.com>
> 


More information about the dev mailing list