From owner-freebsd-net@FreeBSD.ORG Wed Mar 13 05:55:11 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B18B964; Wed, 13 Mar 2013 05:55:11 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx1.freebsd.org (Postfix) with ESMTP id B5436327; Wed, 13 Mar 2013 05:55:10 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id dq12so616688wgb.12 for ; Tue, 12 Mar 2013 22:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=KAHcTKgZaxqw2p8Kb3Ee1YTw1+Y+O7/p4/HTdBX3JLs=; b=QPPxoLOq0KTMMyAUPbYyc6acIbb4bCnrjaDTMWcxFtKdyl6gfJD0KqKmQAGxeOHLjc 4wLgxsR1S8N/0CLiWDIncAEbxQVBiJ3DuLFCX5ZblQ0Yr9C53/FV3kt30qPgTT2Ar/BK /hmiO5p2mbJgRuZcVuinR7R36tN5kTL0KXyyRSY5mfgvvtFuYbVBVBD/OByI/P3Hnws6 NwtZkIvrkSQpWw/O1BpvDaqp+vyC29T65s1JivGshE0OOzsaWFvOF8CRN1hqNQ9N3D1t vdkQFuvU15BFHcoceojFMEUkiSn2C8PAdo/dqfxbJ+ciLNrlpk29R0KsRhFlLTAIQbEi AVCQ== MIME-Version: 1.0 X-Received: by 10.194.92.65 with SMTP id ck1mr31526305wjb.54.1363154109531; Tue, 12 Mar 2013 22:55:09 -0700 (PDT) Received: by 10.194.37.167 with HTTP; Tue, 12 Mar 2013 22:55:09 -0700 (PDT) Date: Wed, 13 Mar 2013 11:25:09 +0530 Message-ID: Subject: NDP prefix list locking From: Dheeraj Kandula To: markj@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2013 05:55:11 -0000 Hi Mark, In the patch that you provided to freebsd-net, http://lists.freebsd.org/pipermail/freebsd-net/2013-February/034695.html, I have a question. nd6_timer() acquires the write lock using ND_DEFRTR_WLOCK. However, defrouter_select again tries to acquire a read lock using ND_DEFRTR_RLOCK. This will lead to a deadlock as the read lock can't be acquired as the write lock is already acquired. The solution is to check if the write lock is already acquired. If not the read lock can be acquired, else there is no need to acquire the read lock. Can you share your thoughts on the same. Dheeraj