> -----Original Message-----
> From: Maxim Uvarov [mailto:[email protected]]
> Sent: Friday, November 11, 2016 3:01 PM
> To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia-bell-
> labs.com>; [email protected]
> Subject: Re: [lng-odp] [API-NEXT PATCH v3 17/19] api: packet: added limits
> for packet len on alloc
> 
> On 11/11/16 13:50, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> >>> +                 /** Maximum packet length that will be allocated from
> >>> +                     the pool. The maximum value is defined by pool
> >>> +                     capability pkt.max_len. Use 0 for default (the
> >>> +                     pool maximum). */
> >>> +                 uint32_t max_len;
> >>> +
> >> This max_len is not not used in 2 patches bellow.
> >>
> >> Do not see difference between this new max_len and old len:
> >
> > Max_len is additional information that implementation may use to
> optimize memory usage. Currently, linux-gen implementation choose not to
> use that (max_len here must be always up to max_len of capability).
> >
> > Len and max_len are different things. 'Len' is used with 'num' to
> specify how many packet there are in the pool (up to 'len' size). Max_len
> tells what is the maximum packet len allocated (even if it's a single
> packet). E.g. application may specify that pool must have 8k packets that
> are at least 1.5k in length, but specify max_len to 9k for jumbo packets
> (alloc calls are never requested more than 9k). Today application does not
> tell the max, but assumes that every pool provide the max_len of
> capability, which may be e.g. 64k or "infinite" (== limited only by system
> memory).
> >
> > -Petri
> >
> len - is maximum packet,
> seg_len - is maximum segment size

No. Len is paired with num. A pool has 'num' packets of up to 'len' length. 
When allocations are done with lengths 'len + 1' ... capa.max_len, the number 
of packets available may be less than 'num'.

Seg_len is the minimum length of the first segment (where packet headers are).

> 
> in your case seg_len=1.5, len=9k
> allocation of more then len will fail.

No. Allocations up to capa.max_len are OK.

-Petri


> 
> max_len is not needed.
> 
> Maxim.
> 

Reply via email to