[dpdk-dev] [PATCH v2 4/8] net/mlx4: optimize Tx multi-segment case

Adrien Mazarguil adrien.mazarguil at 6wind.com
Wed Dec 6 17:22:14 CET 2017


On Wed, Dec 06, 2017 at 02:48:09PM +0000, Matan Azrad wrote:
> mlx4 Tx block can handle up to 4 data segments or control segment + up
> to 3 data segments. The first data segment in each not first Tx block
> must validate Tx queue wraparound and must use IO memory barrier before
> writing the byte count.
> 
> The previous multi-segment code used "for" loop to iterate over all
> packet segments and separated first Tx block data case by "if"
> statements.
> 
> Use switch case and unconditional branches instead of "for" loop can
> optimize the case and prevents the unnecessary checks for each data
> segment; This hints to compiler to create optimized jump table.
> 
> Optimize this case by switch case and unconditional branches usage.
> 
> Signed-off-by: Matan Azrad <matan at mellanox.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list