From owner-freebsd-net@FreeBSD.ORG Mon May 7 15:04:53 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA04016A406 for ; Mon, 7 May 2007 15:04:53 +0000 (UTC) (envelope-from mehul_freebsd@yahoo.com) Received: from n7.bullet.re3.yahoo.com (n7.bullet.re3.yahoo.com [68.142.237.92]) by mx1.freebsd.org (Postfix) with SMTP id 87C3D13C487 for ; Mon, 7 May 2007 15:04:53 +0000 (UTC) (envelope-from mehul_freebsd@yahoo.com) Received: from [68.142.237.88] by n7.bullet.re3.yahoo.com with NNFMP; 07 May 2007 14:52:33 -0000 Received: from [66.196.101.131] by t4.bullet.re3.yahoo.com with NNFMP; 07 May 2007 14:52:33 -0000 Received: from [127.0.0.1] by rrr2.mail.re1.yahoo.com with NNFMP; 07 May 2007 14:52:33 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 200085.86722.bm@rrr2.mail.re1.yahoo.com Received: (qmail 30298 invoked by uid 60001); 7 May 2007 14:52:33 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=3oGJqhPQpygiDaMYjH+NlEe9SuF1iG81dma1xNI0e5h+cb6/crUig5+7Mt7cQUC6Ql7nU7MveyKFHA/VIqP2kSSpzpNUQeCi+Khk7ZFCK/4dVmMXwD232J2jWASc3UMetKVlep3R03ZlVexiks9lJVLlqMnKVs2CrcJByymeXaQ=; X-YMail-OSG: SoyYWiIVM1nZrtAhX12uKdZfIjVhytV53RgZzXISIip.XAt11ZKQXI2lTnBJeHJnjzq8cmbrIa.FFcKFtXIpRN0vI7yBbvqLAHFPKT86Xp_5Ly7aQlUVbC6mdV.gFUHS Received: from [203.92.57.132] by web63604.mail.re1.yahoo.com via HTTP; Mon, 07 May 2007 07:52:32 PDT Date: Mon, 7 May 2007 07:52:32 -0700 (PDT) From: Mehul Vora To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-15606975-1178549552=:30264" Content-Transfer-Encoding: 8bit Message-ID: <93263.30264.qm@web63604.mail.re1.yahoo.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Problem with "rt_check" routine. 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: Mon, 07 May 2007 15:04:53 -0000 --0-15606975-1178549552=:30264 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, Current implementation (Version 6.2) of rt_check() routine defined in route.c is not completely MPSAFE. I found an issue when i started routing with "directisr" enabled. For the first rcvd packet this function initializes rt_gateway of the passed rt_entry. This is done by calling "rtalloc1" routine. But "rt_check" function doesnt hold any lock while calling this function. So incase if we have multiple instances of "ip_input - netisr" running than more than one thread can call this routine which may lead to some corruption, in my case it leads to a dead lock. Problem doesn't happen if before sending heavy traffic a single packet of same kind is sent. But if initially itself heavy traffic is sent than this happens immediately. I have fixed this and it works well after it. Workaround patch for this issue is attached here with. Probably we need to define a macro in route.h for the hardcoded values in the patch. Can any one confirm this ? Thanks, Mehul. --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --0-15606975-1178549552=:30264 Content-Type: text/plain; name="rt_check.patch.txt" Content-Description: 206142780-rt_check.patch.txt Content-Disposition: inline; filename="rt_check.patch.txt" 1260a1261 > try_again: 1280a1282,1289 > > if(rt0->rt_flags & 0x80000000U){ > /*This rt is under process...*/ > RT_UNLOCK(rt); > RT_UNLOCK(rt0); > goto try_again; > } > 1281a1291 > rt0->rt_flags |= 0x80000000U; 1288a1299 > rt0->rt_flags &= (~0x80000000U); --0-15606975-1178549552=:30264--