On Tue, Oct 17, 2017 at 3:04 AM, Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia.com> wrote: >> typedef struct odp_pool_param_t { >> /** Pool type */ >> @@ -192,17 +193,34 @@ typedef struct odp_pool_param_t { >> >> /** Parameters for packet pools */ >> struct { >> - /** The number of packets that the pool must provide >> - that are packet length 'len' bytes or smaller. >> - The maximum value is defined by pool capability >> - pkt.max_num. */ >> + /** Minimum number of 'len' byte packets. >> + * >> + * The pool must contain at least this many packets >> + * that are 'len' bytes or smaller. An >> implementation >> + * may round up the value, as long as the 'max_num' >> + * parameter below is not violated. The maximum >> value >> + * for this field is defined by pool capability >> + * pkt.max_num. >> + */ >> uint32_t num; >> >> - /** Minimum packet length that the pool must provide >> - 'num' packets. The number of packets may be less >> - than 'num' when packets are larger than 'len'. >> - The maximum value is defined by pool capability >> - pkt.max_len. Use 0 for default. */ >> + /** Maximum number of packets. >> + * >> + * This is the maximum number of packets of any >> length >> + * that can be allocated from the pool. The maximum >> + * value is defined by pool capability pkt.max_num. >> + * Use 0 when there's no requirement for the maximum >> + * number of packets. The default value is 0. >> + */ >> + uint32_t max_num; > > I'd put max_num first so that num and len are adjacent parameters for > consistency with how the odp_pool_pkt_subparam_t is organized. > > > The logic is that num and max_num are close together, so are len and max_len > (which does not show here, but follows len below).
Then putting max_num and max_len together first would make sense since they are the primary controls on the configuration. The individual num / len pairs that follow are the optimization advisory information. > > -Petri > > >> + >> + /** Minimum length of 'num' packets. >> + * >> + * The pool must contain at least 'num' packets up >> to >> + * this packet length (1 ... 'len' bytes). The >> maximum >> + * value for this field is defined by pool >> capability >> + * pkt.max_len. Use 0 for default. >> + */ >> uint32_t len; >> >> /** Maximum packet length that will be allocated from >> >