netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Pravin B Shelar <pshelar@nicira.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v6 3/8] vxlan: Add vxlan recv demux.
Date: Sun, 4 Aug 2013 14:45:26 -0700	[thread overview]
Message-ID: <20130804144526.4b2e189c@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1375382689-3218-1-git-send-email-pshelar@nicira.com>

On Thu,  1 Aug 2013 11:44:49 -0700
Pravin B Shelar <pshelar@nicira.com> wrote:

> +static struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
> +					 vxlan_rcv_t *rcv)
>  {
>  	struct vxlan_net *vn = net_generic(net, vxlan_net_id);
>  	struct vxlan_sock *vs;
>  
> -	vxlan_socket_create(net, port);
> +	vxlan_socket_create(net, port, rcv);
>  
>  	spin_lock(&vn->sock_lock);
>  	vs = vxlan_find_sock(net, port);
> -	if (vs)
> -		atomic_inc(&vs->refcnt);
> -	else
> +	if (vs) {
> +		if (vs->rcv == rcv)
> +			atomic_inc(&vs->refcnt);
> +		else
> +			vs = ERR_PTR(-EBUSY);
> +	}
> +	spin_unlock(&vn->sock_lock);
> +

I think the ref counting needs to be the same for the
kernel and OVS handling of a VXLAN. 

  reply	other threads:[~2013-08-04 21:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 18:44 [PATCH net-next v6 3/8] vxlan: Add vxlan recv demux Pravin B Shelar
2013-08-04 21:45 ` Stephen Hemminger [this message]
2013-08-05 15:58   ` Pravin Shelar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130804144526.4b2e189c@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).