odp icon indicating copy to clipboard operation
odp copied to clipboard

[PATCH v1] api: pktio: introduce buffer sort capability

Open jerinjacobk opened this issue 3 years ago • 0 comments

Some of the HW has support for allocating the packet buffer based on the size.

This is often useful for saving the memory where the application can create a different pool to steer the specific size of the packet, thus enabling effective use of memory.

A similar use case can be achieved through the sub pool scheme, however, if the application needs finer control on the number of pools and to give the very same pool to different packet in sort entries then this capability will be handy.

Packet input buffer sorting entries define the sorting requirements. When sorting is enabled and packet received in given a packet io, the implementation shall scan the configured entries, if the packet size is less than or equal odp_pktin_sort_desc_t::len, it allocates the packets from odp_pktin_sort_desc_t::pool.

odp_pktin_sort_desc_t::len value in each entry must be unique and must be sorted in ascending order. Otherwise, the behavior is undefined.

Example sorting entry table configuration:

  • (0B <= packet_size <= 1500B), steer to pool a
  • (1500B < packet_size <= 4000B), steer to pool b
  • (4000B < packet_size <= 7000B), steer to pool c
  • (7000B < packet_size <= default_pool::param::max_len), steer to default pool configured for the pktio.

tbl[0].len = 1500; tbl[0].pool = pool_a; tbl[1].len = 4000; tbl[1].pool = pool_b; tbl[2].len = 7000; tbl[2].pool = pool_c;

Signed-off-by: Jerin Jacob [email protected] Signed-off-by: Ashwin Sekhar T K [email protected]

jerinjacobk avatar May 21 '21 12:05 jerinjacobk