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 <ma...@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarg...@6wind.com> -- Adrien Mazarguil 6WIND