[dpdk-dev] [PATCH 1/8] lpm: Fix pointer aliasing issues

Thomas Monjalon thomas.monjalon at 6wind.com
Tue Mar 22 21:02:43 CET 2016


2016-02-25 21:30, Bruce Richardson:
> On Thu, Feb 25, 2016 at 01:48:34PM -0500, Aaron Conole wrote:
> >  /**
> > + * Convert from tbl_entry types to integer types
> > + */
> > +static inline uint16_t
> > +rte_lpm_tbl24_entry_to_uint16(const struct rte_lpm_tbl24_entry *entry)
> > +{
> > +	union {
> > +		uint16_t                   i;
> > +		struct rte_lpm_tbl24_entry s;
> > +	} tbl_entry_u;
> > +
> > +	tbl_entry_u.s = *entry;
> > +	return tbl_entry_u.i;
> > +}
> > +
> > +static inline uint16_t
> > +rte_lpm_tbl8_entry_to_uint16(const struct rte_lpm_tbl8_entry *entry)
> > +{
> > +	union {
> > +		uint16_t                  i;
> > +		struct rte_lpm_tbl8_entry s;
> > +	} tbl_entry_u;
> > +
> > +	tbl_entry_u.s = *entry;
> > +	return tbl_entry_u.i;
> > +}
> > +
> 
> These two new functions could be reduced to one with the help of patch:
> http://dpdk.org/dev/patchwork/patch/9087/

Aaron, any news about a rework of this patch?



More information about the dev mailing list