Hi again Harald, Harald Welte wrote: >>With this patch, if an expectation is not found for the conntrack, it >>will look for an helper and go out, this way we save three "if's". By >>other hand, if an expectation is found we save one "if". >> >> > >yes, thanks for the patch. It definitely makes the code more readable. >If it really makes a difference in performance - I don't know. > >The compiler will certainly not recompute the value of 'expected', and >since it also knows that expected is not written to, it could actually >optimize here. Whether gcc is smart enough to do so, I don't know.. one >would have to look at the generated assembly code. > > > well, I'm not a compiler geek so I don't know either. But it's true, it's more readable :-). So maybe "optimization" wasn't the correct subject. >>I consider that the general case is that an expectation is not found, >>isn't it? because most connection tracked by the system don't need a >>helper, so they not need to handle expectations. >> >> > >yes. Maybe it's even worth using 'if (unlikely(expected))' in that >case. > > > I didn't modify the patch, well I think it's ok anyway. >>BTW, can we consider that if there's no helper for a given tuple, it >>won't have expectations? because while writing the patch i had more >>ideas, maybe this could be optimized a bit more. Well, I'm not sure... >> >> > >No, this is an invalid assumption. > > ok, thanks! >>hope that i'm not missing anything! if so, please let me know. >> >> > >looks fine to me. would you mind submitting a patch syncing 2.4.x to >your changes? Thanks. > > I attached the patch for the 2.4.x tree. Pablo