[dpdk-dev] [PATCH v2 1/2] librte_net: add crc init and compute APIs

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Wed Mar 8 12:08:23 CET 2017



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Monday, March 06, 2017 3:28 PM
> To: Singh, Jasvinder
> Cc: dev at dpdk.org; Doherty, Declan; De Lara Guarch, Pablo
> Subject: Re: [dpdk-dev] [PATCH v2 1/2] librte_net: add crc init and compute
> APIs
> 
> 2017-03-02 13:03, Singh, Jasvinder:
> > Hi Thomas,
> >
> > > -----Original Message-----
> > > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > > Sent: Wednesday, March 1, 2017 6:46 PM
> > > To: Singh, Jasvinder <jasvinder.singh at intel.com>
> > > Cc: dev at dpdk.org; Doherty, Declan <declan.doherty at intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 1/2] librte_net: add crc init and
> compute
> > > APIs
> > >
> > > 2017-02-28 12:08, Jasvinder Singh:
> > > >  lib/librte_net/rte_net_crc.c       | 664
> > > +++++++++++++++++++++++++++++++++++++
> > > >  lib/librte_net/rte_net_crc.h       | 101 ++++++
> > >
> > > I think it should be in librte_hash.
> > >
> > > Please check lib/librte_hash/rte_hash_crc.h
> >
> > Is it good to include payload crc calculation in hash library as I see all hash
> related functionality there?
> 
> I think yes. Pablo?

I think this doesn't belong in the hash library. These new functions calculate CRC, but not as a hash function.
Yes, CRC can be used as hash function (in fact, it is used as such in the hash library,
the CRC32C version, and I assume that's why it is in there), but its use is much broader
(its main purpose is not to be a hash function, but for data error detection, for any data).

Therefore, I would suggest either creating a separate library for this, if we want to use this as a broader use,
or leave it in net library, if we want to focus on calculating CRC for Ethernet frames.

Regarding to the CRC that we have in the hash library, if we go for a separate library,
we could move that function there, but then it would have to follow the function prototype of a hash function,
defined in the hash library. 

Thanks,
Pablo


More information about the dev mailing list