[dpdk-dev] [RFC v3] /net: memory interface (memif)

Wiles, Keith keith.wiles at intel.com
Fri Dec 14 17:12:23 CET 2018



> On Dec 14, 2018, at 3:39 AM, Bruce Richardson <bruce.richardson at intel.com> wrote:
> 
> On Thu, Dec 13, 2018 at 10:07:09AM -0800, Stephen Hemminger wrote:
>> On Thu, 13 Dec 2018 14:30:51 +0100
>> Jakub Grajciar <jgrajcia at cisco.com> wrote:
>> 
>>> +
>>> +typedef uint16_t memif_region_index_t;
>>> +typedef uint32_t memif_region_offset_t;
>>> +typedef uint64_t memif_region_size_t;
>>> +typedef uint16_t memif_ring_index_t;
>>> +typedef uint32_t memif_interface_id_t;
>>> +typedef uint16_t memif_version_t;
>>> +typedef uint8_t memif_log2_ring_size_t;
>>> +
>> 
>> Seems very typedef heavy to me. Having more typedefs
>> does not improve the readability.
>> 
> 
> +1
> Our coding guidelines generally recommend against using typedefs, though
> they generally refer to structure typedefs rather than typedefs for basic
> types.

The guide lines do suggest not to use typedefs, but here is a PMD which is self contained in that the headers are not normally used outside of the PMD. This means to me that typedefs in this give case to reasonable. Plus it is a suggestion in the guide lines and the cases talked about in the guide seem to be all related to headers that are more globally used.

I suggest he can keep these typedefs in this case, as we have done a something much more wide scope with port id typedef.
> 
> /Bruce

Regards,
Keith



More information about the dev mailing list