Received: with ECARTIS (v1.0.0; list netdev); Fri, 31 Dec 2004 06:12:14 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iBVEBkIO027384 for ; Fri, 31 Dec 2004 06:12:07 -0800 Received: from eru.coreworks.de ([172.16.0.2] helo=trash.net) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CkNdK-0005jp-5q; Fri, 31 Dec 2004 15:20:02 +0100 Message-ID: <41D55FC9.6040605@trash.net> Date: Fri, 31 Dec 2004 15:18:49 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: jamal , "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/9] PKT_SCHED: tc filter extension API References: <20041230122652.GM32419@postel.suug.ch> <20041230123023.GO32419@postel.suug.ch> <1104467816.1049.181.camel@jzny.localdomain> <20041231131039.GI32419@postel.suug.ch> In-Reply-To: <20041231131039.GI32419@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13294 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Thomas Graf wrote: > * jamal <1104467816.1049.181.camel@jzny.localdomain> 2004-12-30 23:36 > > >>Patrick pointed this in other email: the xchg is sort of defeated by the >>else. Perhaps make the second one xchg as well. > > Agreed, I changed it to: > > struct tc_action *act; > act = xchg(&dst->action, src->action); > if (act) > tcf_action_destroy(act, TCA_ACT_UNBIND); > > Am I missing something? Yes, the xchg without locking is only right in case we don't have an existing action that needs to be destroyed. Someone might still be looking at the old action in a softirq. If you want to keep the "lockless" variant, you need to call synchronize_net() before tcf_action_destroy(). Regards Patrick