[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1389747029.31367.297.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 14 Jan 2014 16:50:29 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Or Gerlitz <or.gerlitz@...il.com>
Cc: Tom Herbert <therbert@...gle.com>,
Or Gerlitz <ogerlitz@...lanox.com>,
David Miller <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>,
Jerry Chu <hkchu@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Yan Burman <yanb@...lanox.com>,
Shlomo Pongratz <shlomop@...lanox.com>
Subject: Re: [PATCH net-next V4 1/3] net: Add GRO support for UDP
encapsulating protocols
On Tue, 2014-01-14 at 23:51 +0200, Or Gerlitz wrote:
> >> + 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
>
> > 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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists