From owner-freebsd-current@FreeBSD.ORG Fri Aug 9 00:27:06 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 10D11802 for ; Fri, 9 Aug 2013 00:27:06 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm30-vm6.bullet.mail.gq1.yahoo.com (nm30-vm6.bullet.mail.gq1.yahoo.com [98.136.216.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDF2C2E39 for ; Fri, 9 Aug 2013 00:27:05 +0000 (UTC) Received: from [98.137.12.61] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 09 Aug 2013 00:20:14 -0000 Received: from [98.136.164.73] by tm6.bullet.mail.gq1.yahoo.com with NNFMP; 09 Aug 2013 00:20:14 -0000 Received: from [127.0.0.1] by smtp235.mail.gq1.yahoo.com with NNFMP; 09 Aug 2013 00:20:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1376007614; bh=zHiSK3cA2cIM0tWIXhDDYOiqAkerWT5Y2BByeVW57Rw=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=5r/hxZTQmPPt9qsgOAKNzTTkRiepNR/zNKY70/0olVC7ZK4zeVZvVJ5IJUILxpscbXR7oU2PmMUEtVfLPO16EC+lc34VjMO3rOq8I/3kehYNF4stUU95etrhfgbw9zzZL9Ec2y7CI7zPAM7JDVDRhsAjny6RjECK/5gtuy7XRbY= X-Yahoo-Newman-Id: 99189.72728.bm@smtp235.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: JAxQ.LcVM1m_YU5BLf2rywnEtJMnNWaYwjT6PEB5QfhPM.D PA.pSf56VX0g_vdYk8flQpJuVVAKPVQcGoBnWMSDAUvWLGUAtrdnkt_ld95N lraeWfUvS7hs_hr5nHw3mdWGiAp.KaDlhwwznEdoR5hcDIpCzCG1mdYQdxjt 2ybae_Vky.NxoXF.7zm50bLTe2NcLi_wdQX_aSxYqMwj8PFpJsk8RfG97Ev0 1ZVo0NWjPg.22G0O6eesLwBCPBbdMzxxge0pQ5UK6zKciL64khfMM5hN9duu wJJylcGNEpSk37sZOksMxE_oWp.4P1SZFgz7cTTJmUdZGpsmLSc0hg17jg42 sdN8QOeiMqxnuVMUBvmzW_qn_URWK_RNZCkVJ9bkTDscYgkSQu0DJmLnxkDS cA_ANpy.fKK3Vg9R7rdMqqyKlbGsO55yrLcqZKkdCeldAIAsf5teNFEpcB8U UT4HTOXB3YaQQvjHeK9vIr4fhG5BekY8qcye3PIqoGvzzRGGe5jlTeHq1doH Uno_Ncd1IHv_Rv7Y9sUWUUisiLMbm1m9OGJzZOV4Kczo03ql8H8gWTdxv X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from phobos.corp.netflix.com (scott4long@69.53.237.66 with ) by smtp235.mail.gq1.yahoo.com with SMTP; 09 Aug 2013 00:20:13 +0000 UTC Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: [net] protecting interfaces from races between control and data ? From: Scott Long In-Reply-To: Date: Thu, 8 Aug 2013 17:20:13 -0700 Content-Transfer-Encoding: 7bit Message-Id: <0068D32B-C900-47EB-8E82-C50506AB1F6D@yahoo.com> References: <20130805082307.GA35162@onelab2.iet.unipi.it> <2034715395.855.1375714772487.JavaMail.root@daemoninthecloset.org> <51FFDD1E.1000206@FreeBSD.org> <3BFB5B13-78C5-47E0-81B8-29A03A0136DF@yahoo.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1508) X-Mailman-Approved-At: Fri, 09 Aug 2013 00:53:36 +0000 Cc: current@freebsd.org, Bryan Venteicher , Navdeep Parhar , net@freebsd.org, Giuseppe Lettieri , Luigi Rizzo , Warner Losh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2013 00:27:06 -0000 Yup, it's an incredibly unsafe pattern. It also leads to the pattern where auxiliary processing is handed off to a taskqueue, which then interleaves the lock ownership with the ithread and produces out-of-order packet reception. Scott On Aug 8, 2013, at 5:18 PM, Adrian Chadd wrote: > .. and it's not just about "saturate the port" with traffic. > > It's also about "what happens if I shut down the MAC whilst I'm in the > process of programming in new RX/TX descriptors?" > > The ath(4) driver had a spectacular behaviour where if you mess things > up the wrong way it will quite happily DMA crap all over the memory of > your running system, leading to quite hilarious bugs. > > > > -adrian