> From: Hanumanth Pothula [mailto:hpoth...@marvell.com]
> Sent: Friday, 12 August 2022 12.47
> 
> Presently, the 'Buffer Split' feature supports sending multiple
> segments of the received packet to PMD, which programs the HW
> to receive the packet in segments from different pools.
> 
> This patch extends the feature to support the pool sort capability.
> Some of the HW has support for choosing memory pools based on the
> packet's size. The pool sort capability allows PMD to choose a
> memory pool based on the packet's length.
> 
> 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.
> 
> For example, let's say HW has a capability of three pools,
>  - pool-1 size is 2K
>  - pool-2 size is > 2K and < 4K
>  - pool-3 size is > 4K
> Here,
>         pool-1 can accommodate packets with sizes < 2K
>         pool-2 can accommodate packets with sizes > 2K and < 4K
>         pool-3 can accommodate packets with sizes > 4K
> 
> With pool sort capability enabled in SW, an application may create
> three pools of different sizes and send them to PMD. Allowing PMD
> to program HW based on packet lengths. So that packets with less
> than 2K are received on pool-1, packets with lengths between 2K
> and 4K are received on pool-2 and finally packets greater than 4K
> are received on pool-3.
> 
> The following two capabilities are added to the rte_eth_rxseg_capa
> structure,
> 1. pool_sort --> tells pool sort capability is supported by HW.
> 2. max_npool --> max number of pools supported by HW.
> 
> Defined new structure rte_eth_rxseg_sort, to be used only when pool
> sort capability is present. If required this may be extended further
> to support more configurations.
> 
> Signed-off-by: Hanumanth Pothula <hpoth...@marvell.com>
> Change-Id: I5a2485a7919616902c468c767b5c01834d4a2c27
> ---

I like the concept of a PMD being able to use different mbuf pools depending on 
packet size.

However, the "pool sort" feature is not an extension of the "buffer split" 
feature, but a separate feature. The API and documentation must reflect this.

Please also consider this, when you implement it in the drivers: If no buffers 
are available in one of the pools, the next (larger) pool should be used 
instead of dropping the packet.

Here's another example use case: Assuming that 25 % of internet traffic is tiny 
packets (e.g. empty TCP ACK packets), a separate pool for those could be used.

Reply via email to