WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3/4] Support accelerated network plugin modules

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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel