[ovs-dev] [PATCHv17 1/2] ovs-thread: Add pthread spin lock support.

William Tu u9012063 at gmail.com
Thu Jul 18 19:17:44 UTC 2019


On Thu, Jul 18, 2019 at 11:08 AM Ben Pfaff <blp at ovn.org> wrote:
>
> On Thu, Jul 18, 2019 at 07:38:03PM +0300, Ilya Maximets wrote:
> > On 17.07.2019 23:23, William Tu wrote:
> > > The patch adds the basic spin lock functions:
> > > ovs_spin_{lock, try_lock, unlock, init, destroy}.
> > > OSX does not support pthread spin lock, so make it
> > > linux only.
> >
> > The last sentence seems redundant now and could be removed.
> >
> > The patch looks good to me. One thing I'd like to add is the additional
> > AC_SEARCH_LIBS([pthread_spin_lock], [pthread])
> > This way we'll be sure that '-lpthread' will be passed to the function
> > check if needed.
> >
> > So, I'm suggesting:
> >
> > diff --git a/configure.ac b/configure.ac
> > index c33935499..398a390a5 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -79,6 +79,8 @@ AC_SEARCH_LIBS([clock_gettime], [rt])
> >  AC_SEARCH_LIBS([timer_create], [rt])
> >  AC_SEARCH_LIBS([pthread_rwlock_tryrdlock], [pthread])
> >  AC_SEARCH_LIBS([pthread_rwlockattr_destroy], [pthread])
> > +AC_SEARCH_LIBS([pthread_spin_lock], [pthread])
> > +AC_CHECK_FUNCS([pthread_spin_lock])
> >  AC_FUNC_STRERROR_R
> >
> >  OVS_CHECK_WIN64
> > @@ -109,7 +111,6 @@ AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
> >  #include <sys/types.h>
> >  #include <netinet/in.h>]])
> >  AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg clock_gettime])
> > -AC_CHECK_FUNCS([pthread_spin_lock])
> >  AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h])
> >  AC_CHECK_HEADERS([linux/net_namespace.h stdatomic.h bits/floatn-common.h])
> >  AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
> > ---
> >
> > If above diff is OK, I could apply it myself right before merging the patch.
> > William, Ben, what do you think?
>
> Seems OK to me.

Thanks Ben and Ilya.

I will let Ilya apply this patch. So next v18 version I will skip this one and
only send out the netdev-afxdp patch, the second one.

--William


More information about the dev mailing list