Subject: Re: [PATCH net-next v13 1/4] netdevsim: allow two netdevsim ports to be connected

From: Jakub Kicinski <[email-masked]>
Date: Mon, 26 Feb 2024 07:05:18 -0800

On Sat, 24 Feb 2024 09:33:02 -0800 David Wei wrote:
> >> +	err = 0;  
> > 
> > Why zero..   
> 
> Sorry left over from a previous iteration.
> 
> >   
> >> +	nsim_a = netdev_priv(dev_a);
> >> +	peer = rtnl_dereference(nsim_a->peer);
> >> +	if (peer) {
> >> +		pr_err("Netdevsim %d:%u is already linked\n", netnsfd_a, ifidx_a);
> >> +		goto out_err;  
> > 
> > I'd think if we hit this we should return -EBUSY?
> > Unless peer == dev_b, but that may be splitting hair.  
> 
> What would returning -EBUSY do?

This is continuation of the previous comment, you set err to zero,
so when device already has a peer user will get 0 (success)
They should get -EBUSY.