NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60637: destroying a vlan interface with a configured parent interface hangs



The following reply was made to PR kern/60637; it has been noted by GNATS.

From: joe%ns1.eloisystems.com@localhost
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/60637: destroying a vlan interface with a configured parent
 interface hangs
Date: Tue, 25 Aug 2026 12:34:50 +0000

 On Mon, Aug 24, 2026 at 08:30:00PM +0000, gnats-admin%netbsd.org@localhost wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `kern/60637'.
 > The individual assigned to look at your
 > report is: kern-bug-people. 
 > 
 > >Category:       kern
 > >Responsible:    kern-bug-people
 > >Synopsis:       destroying a vlan interface with a configured parent interface hangs
 > >Arrival-Date:   Mon Aug 24 20:30:00 +0000 2026
 
 Hi,
 
 The attched patch fixes this issue.
 
 Index: sys/net/if.c
 ===================================================================
 RCS file: /cvsroot/src/sys/net/if.c,v
 retrieving revision 1.538
 diff -u -r1.538 if.c
 --- sys/net/if.c	14 May 2026 08:05:48 -0000	1.538
 +++ sys/net/if.c	25 Aug 2026 12:27:04 -0000
 @@ -1356,12 +1356,10 @@
  	 * from pserialize read sections.  Note that we can't do
  	 * psref_target_destroy here.  See below.
  	 */
 -	IFNET_GLOBAL_LOCK();
  	ifindex2ifnet[ifp->if_index] = NULL;
  	TAILQ_REMOVE(&ifnet_list, ifp, if_list);
  	IFNET_WRITER_REMOVE(ifp);
  	pserialize_perform(ifnet_psz);
 -	IFNET_GLOBAL_UNLOCK();
  
  	if (ifp->if_slowtimo != NULL) {
  		struct if_slowtimo_data *isd = ifp->if_slowtimo_data;
 
 
 
 However, I might not be fully convinced yet if that's the best solution
 but i tracked down the hang and realized the vlan thread running if_detach forever waits
 on the "BIG LOCK" IFNET_GLOBAL_LOCK() because another thread is using it.
 
 
 My guess is maybe this lock doesn't need to be held here as it is causes a deadlock on vlan interfaces
 when destroying. or some other thread needs to release hold unto the BIG lock
  
 



Home | Main Index | Thread Index | Old Index