[ewg] [PATCH] mlx4: remove limitation on LSO header size
rdreier at cisco.com
Wed Oct 7 15:45:16 PDT 2009
> + *blh = unlikely(halign > 64) ? 1 : 0;
This idiom of "(boolean condition) ? 1 : 0" looks odd to me... doesn't
(halign > 64) already evaluate to 1 or 0 anyway? Does the unlikely()
actually affect code generation here?
With that said, see below...
> + int blh = 0;
I assume this initialization is to avoid a compiler warning. But the
code is actually correct without initializing blh -- so I think that we
save a tiny bit of code by doing uninitialized_var() instead?
> + (blh ? cpu_to_be32(1 << 6) : 0);
...given that the only use of blh is as a flag to decide what constant
to use here, does it generate better code to make blh be __be32 and set
the value directly in build_lso_seg, ie do:
*blh = unlikely(halign > 64) ? cpu_to_be32(1 << 6) : 0;
and then use blh without ?: in mlx4_ib_post_send...
More information about the ewg