Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jerinjacobk
Copy link
Collaborator

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 jerinj@marvell.com
Signed-off-by: Ashwin Sekhar T K asekhar@marvell.com

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 <jerinj@marvell.com>
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
@odpbuild odpbuild changed the title api: pktio: introduce buffer sort capability [PATCH v1] api: pktio: introduce buffer sort capability May 21, 2021
@jerinjacobk jerinjacobk requested a review from psavol May 21, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant