From owner-freebsd-net@FreeBSD.ORG Tue Sep 4 09:34:52 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2262016A418 for ; Tue, 4 Sep 2007 09:34:52 +0000 (UTC) (envelope-from ivo.vachkov@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by mx1.freebsd.org (Postfix) with ESMTP id D7DF713C459 for ; Tue, 4 Sep 2007 09:34:51 +0000 (UTC) (envelope-from ivo.vachkov@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so677894wra for ; Tue, 04 Sep 2007 02:34:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=WcNt+SfPMW31Ti+pXpGau9D6gJgDi05gudawt30+7mV3l6prhk0/Y7mtCK3Lq8ca4yidzHAvrK5kJsztdIByX45+0KYMiFeELmwqE+aEeKLFvw1mEQnsn5oq3HKtX6fcB5EMklTsgBKdhhgmwS1PZ5dHD66PSaN8ok5gkCp5l0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=D8Pc5gAdcfUCVuC6przP6/uY7utOM7DlV+ZIK5mtpKE6gJ9ssRrAEheefuUB+uItnMECkt0v6KWuiXW9lI1oBhYU1Z7/7bLhkBupfws5YXfC4giSrv0fnL4/rnvAhlkWZBjiLbCqTP181QxOFUDgZ9GkKBb6JROaQnE0Ap254VU= Received: by 10.90.66.9 with SMTP id o9mr4932801aga.1188898489458; Tue, 04 Sep 2007 02:34:49 -0700 (PDT) Received: by 10.90.114.13 with HTTP; Tue, 4 Sep 2007 02:34:48 -0700 (PDT) Message-ID: Date: Tue, 4 Sep 2007 12:34:49 +0300 From: "Ivo Vachkov" To: freebsd-net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Network stack locking question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2007 09:34:52 -0000 Hello all, I'm currently working on some ipv6 related code. At some point I have to do a routing lookup and I meet following problem: panic: mtx_lock() of spin mutex 'some_strange_chars' ../../../net/route.c:114 cpuid = 0 KDB: enter: panic [thread pid 17 tid 100021 ] Stopped at kdb_enter+0x31: leave According to the debugger the events happen in the following order: ether_demux() at ether_demux+ my_func() at my_func+ rtalloc_ign() at rtalloc_ign+ _mtx_lock_flags() at _mtx_lock_flags+ panic() at panic+ I do not include GIANT_REQUIRED in my code. Can you propose a solution or a pointer to information where I can make myself familiar with the networking code locking ... besides 'man 9 locking' and related. Thank you very much in advance. Ivo