Thread (11 messages) flat view 11 messages, 4 authors, 2014-01-20

Re: [PATCH net-next V4 1/3] net: Add GRO support for UDP encapsulating protocols

From: Eric Dumazet <hidden>
Date: 2014-01-15 00:50:32

On Tue, 2014-01-14 at 23:51 +0200, Or Gerlitz wrote:
quoted
quoted
+       rcu_read_lock();
+
+       uo_priv = rcu_dereference(udp_offload_base);
+       for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) {
+               if (uo_priv->offload->port == uh->dest &&
+                   uo_priv->offload->callbacks.gro_complete)
+                       goto found;
+       }
+
+       rcu_read_unlock();
+       return err;
+
+found:
+       atomic_inc(&uo_priv->refcount);
This is an expensive operation in the critical path.
I know, but I don't see how to get away without having the ref/unref
wrapping, ideas welcome
quoted
Can uo_priv be protected by rcu also?
uo_priv is the actual element which is rcu protected, not sure to
follow on your question.
Seems pretty easy : unlock rcu after calling gro_complete() as in :

found:
       err = uo_priv->offload->callbacks.gro_complete(skb, nhoff + sizeof(struct udphdr));
       rcu_read_unlock();
       return err;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help