[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1389219101.31367.21.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 08 Jan 2014 14:11:41 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Or Gerlitz <ogerlitz@...lanox.com>
Cc: hkchu@...gle.com, edumazet@...gle.com, herbert@...dor.apana.org.au,
netdev@...r.kernel.org, davem@...emloft.net, yanb@...lanox.com,
shlomop@...lanox.com
Subject: Re: [PATCH net-next V3 3/3] net: Add GRO support for vxlan traffic
On Wed, 2014-01-08 at 22:34 +0200, Or Gerlitz wrote:
> +
> /* Notify netdevs that UDP port started listening */
> -static void vxlan_notify_add_rx_port(struct sock *sk)
> +static void vxlan_notify_add_rx_port(struct vxlan_sock *vs)
> {
> struct net_device *dev;
> + struct sock *sk = vs->sock->sk;
> struct net *net = sock_net(sk);
> sa_family_t sa_family = sk->sk_family;
> __be16 port = inet_sk(sk)->inet_sport;
> @@ -569,12 +671,16 @@ static void vxlan_notify_add_rx_port(struct sock *sk)
> port);
> }
> rcu_read_unlock();
> +
> + if (sa_family == AF_INET)
> + call_rcu(&vs->rcu, vxlan_add_udp_offload);
Why waiting RCU grace period here ?
> }
>
> /* Notify netdevs that UDP port is no more listening */
> -static void vxlan_notify_del_rx_port(struct sock *sk)
> +static void vxlan_notify_del_rx_port(struct vxlan_sock *vs)
> {
> struct net_device *dev;
> + struct sock *sk = vs->sock->sk;
> struct net *net = sock_net(sk);
> sa_family_t sa_family = sk->sk_family;
> __be16 port = inet_sk(sk)->inet_sport;
> @@ -586,6 +692,9 @@ static void vxlan_notify_del_rx_port(struct sock *sk)
> port);
> }
> rcu_read_unlock();
> +
> + if (sa_family == AF_INET)
> + call_rcu(&vs->rcu, vxlan_del_udp_offload);
> }
This looks buggy.
You need to :
1) remove the offload structure from list
2) Then wait rcu grace period, and finally free the memory
--
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