[ofa-general] Re: [ewg] [PATCH] mlx4: remove limitation on LSO header size
Roland Dreier
rdreier at cisco.com
Mon Oct 12 10:03:03 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?
> True, (halign > 64) is the same and is cleaner. As for the unlikely()
> -- well it's already been there and besides, we're never sure if it
> will improve anything so the same question could be asked for other
> places in the code.
I was just wondering in this case where you are just assigning the
boolean value of the expression to a variable how unlikely affects
things. I can understand for conditional jumps how the compiler can
choose to make the likely case more efficient, but when there are no
jumps then I was just curious how the hint could help.
> > 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?
> We must initialize blh since it is used for any send request and not
> just LSO opcodes.
So then this patch was buggy because blh was not reinitialized as we
loop through multiple work requests? eg an LSO request followed by a
non-LSO request?
Anyway I'll look over the newer patch.
More information about the general
mailing list