From: Kieran Mansley Subject: Re: [PATCH 3/4] Support accelerated network plugin modules Date: Wed, 09 May 2007 12:58:06 +0100 Message-ID: <1178711887.4406.15.camel@moonstone.uk.level5networks.com> References: <1178618109.4147.35.camel@moonstone.uk.level5networks.com> <20070509112510.GO4313@rhun.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20070509112510.GO4313@rhun.haifa.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, 2007-05-09 at 14:25 +0300, Muli Ben-Yehuda wrote: > On Tue, May 08, 2007 at 10:55:09AM +0100, Kieran Mansley wrote: > > +#define NETFRONT_CALL_ACCELERATOR_HOOK(_np, _hook, _args...) \ > > + do { \ > > + if((_np)->accelerator && (_np)- >accel_vif_state.hooks) \ > > + (_np)->accel_vif_state.hooks->_hook(_args); \ > > + } while(0) > > + > > + > > +#define NETFRONT_LOCK_AND_CALL_ACCELERATOR_HOOK(_np, _hook, _args...) \ > > + do { \ > > + unsigned _flags; \ > > + spin_lock_irqsave(&(_np)->accelerator_lock, _flags); \ > > + if((_np)->accelerator && (_np)- >accel_vif_state.hooks) \ > > + (_np)->accel_vif_state.hooks->_hook(_args); \ > > + spin_unlock_irqrestore(&(_np)->accelerator_lock, _flags); \ > > + } while(0) > > Please get rid of these macros - it's not exactly a lot of code to > duplicate and it makes it obvious what's going on. The first macro I'm happy to get rid of - I noticed after Keir commented on the use of caps in the name that it's no longer used. The second I think is enough code that it would unnecessarily clutter the existing functions. For this reason I'd rather leave it in (with a lower-case name). > > I'll review the rest once you repost the patches. Thanks for taking the time to look. I'll integrate the rest of your suggestions into the patches and repost. Kieran O