Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:53:35 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5rTqL013813 for ; Fri, 21 Jan 2005 21:53:29 -0800 Received: (qmail 9566 invoked by uid 0); 22 Jan 2005 05:51:18 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp5.knology.net with SMTP; 22 Jan 2005 05:51:18 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5raoJ006035; Sat, 22 Jan 2005 00:53:36 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5ra9P006034; Sat, 22 Jan 2005 00:53:36 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 7/22] xfrm: Allow device drivers to force recalculation of offloads From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121152358.5c60d0db.davem@davemloft.net> References: <20041230035000.15@ori.thedillows.org> <20041230035000.16@ori.thedillows.org> <20050121152358.5c60d0db.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:53:36 -0500 Message-Id: <1106373216.3691.43.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 639 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 15:23 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:35 -0500 > David Dillow wrote: > > > # This is a BitKeeper generated diff -Nru style patch. > > # > > # ChangeSet > > # 2004/12/30 00:37:44-05:00 dave@thedillows.org > > # Give device drivers a method to allow the use of crypto > > # offload features for existing xfrm_states and bundles, as > > # well as dynamically remove crypto offload capabilities. > > # > > # Signed-off-by: David Dillow > > This change looks fine, but it reminds me of something. > > We have to make sure there is no way for xfrm_offloads to > refer to a device when it is brought down. > > One way to ensure that, is to make each xfrm_offload attached > grab a reference to the device it is for. The refcounting will > help catch cases where stale xfrm_offload are around at > unregister_netdev() time. You're right, it would be a problem, and I have the oopsen to prove it. :) In patch 3 of the series, xfrm_offload_add() grabs a reference to the device, and xfrm_offload_release() releases it when the offload's own reference count hits zero. -- David Dillow