Thread (34 messages) flat view 34 messages, 6 authors, 2014-01-09

Re: [PATCH net-next V2 3/3] net: Add GRO support for vxlan traffic

From: Eric Dumazet <hidden>
Date: 2014-01-07 20:02:35

On Tue, 2014-01-07 at 21:43 +0200, Or Gerlitz wrote:
On Tue, Jan 7, 2014 at 8:08 PM, Tom Herbert [off-list ref] wrote:
quoted
Why ^ instead of != ?
The XOR approach is very popular in the GRO stack, e.g see the IPv4 chain
of inet_gro_receive() && tcp_gro_receive(), I guess this might relates
to more efficient assembly code for ^ vs. != and/or the fast/elegant
transitive nature of that operator
This trick is only needed/used when many compares are folded into a
single conditional :

if (a->f1 != b->f1 || a->f2 != b->f2)

->

if (((a->f1 ^ b->f1) | (a->f2 ^ b->f2)) != 0)

Please do not use XOR for a single compare.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help