From owner-freebsd-wireless@FreeBSD.ORG Wed Aug 15 17:00:27 2012 Return-Path: Delivered-To: freebsd-wireless@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CFE9106564A for ; Wed, 15 Aug 2012 17:00:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 08C458FC12 for ; Wed, 15 Aug 2012 17:00:27 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7FH0QFd068887 for ; Wed, 15 Aug 2012 17:00:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7FH0QBu068886; Wed, 15 Aug 2012 17:00:26 GMT (envelope-from gnats) Date: Wed, 15 Aug 2012 17:00:26 GMT Message-Id: <201208151700.q7FH0QBu068886@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org From: Adrian Chadd Cc: Subject: Re: conf/170098: virtual access points with Atheros ath driver X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Adrian Chadd List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2012 17:00:27 -0000 The following reply was made to PR kern/170098; it has been noted by GNATS. From: Adrian Chadd To: Kim Culhan , PseudoCylon Cc: bug-followup@freebsd.org Subject: Re: conf/170098: virtual access points with Atheros ath driver Date: Wed, 15 Aug 2012 09:50:53 -0700 Hi, I'm just testing out the patch(es) now. The basic spirit of them works, but there are some improvements to be made. * The node generation count doesn't have to be checked. We know the node table is locked; the reason the node generation is there is because in the older way of doing it, the node table lock is released each trip through the loop. * 'goto restart' on each successful addition to the node table turns an O(n) operation into an O(n^2) operation. That's just plain going to suck. * It's always good practice to alloc and free memory in the same function or module and doing it consistently. The patch allocates it in iterate_nodes() but frees it in iterate_nt() if there's an error. That kind of inconsistent handling could cause problems. * There's no need to decrement the node scan generation on error. It's fine the way it is. * .. which means if you don't decrement the scangen in each node, you can release the node table / node iteration table locks earlier, avoiding any LOR with ieee80211_node_free(). I have a replacement patch which I'm currently testing out. I'll push it into -HEAD today. Thanks again to Kim and PseudoCylon for finding and fixing the problem! Adrian