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

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

max_len is not needed.

Maxim.


              /** 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. */
              uint32_t len;


Is that really needed?

Maxim.

                        /** Minimum number of packet data bytes that are stored
                            in the first segment of a packet. The maximum value
                            is defined by pool capability pkt.max_seg_len.

Reply via email to