[dpdk-dev] [dpdk-stable] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD

David Marchand david.marchand at redhat.com
Tue Apr 9 13:09:44 CEST 2019


On Tue, Apr 9, 2019 at 12:40 PM Luca Boccassi <bluca at debian.org> wrote:

> On Tue, 2019-04-09 at 12:34 +0200, David Marchand wrote:
> > On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <
> > bruce.richardson at intel.com
> > >
> > wrote:
> >
> > > On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> > > >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> > > >    <[1]
> > > > bruce.richardson at intel.com
> > > > > wrote:
> > > >
> > > >      The definition of CPU_AND differs from Linux to BSD, so we
> > > > need to
> > > >      use
> > > >      RTE_CPU_AND instead.
> > > >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
> > > > application for
> > > >      PQoS CAT and CDP")
> > > >      Cc: [2]
> > > > stable at dpdk.org
> > > >
> > > >
> > > >    This creates a dependency on backporting c3568ea37670 ("eal:
> > > > restrict
> > > >    control threads to startup CPU affinity") which introduced the
> > > >    RTE_CPU_AND macro.
> > > >    --
> > > >    David Marchand
> > > >
> > >
> > > Shall I drop the stable reference from the v2, then?
> > >
> >
> > We can backport in 18.11, as I would expect c3568ea37670 to be
> > backported.
> >
> > The question is more what we want to do with 17.11.
> > We could backport only the macro bits from this patch if needed.
>
> If c3568 is not destined for 17.11.x, if you are up for doing the extra
> work you can send the macro-only change as an individual patch to
> stable at dpdk.org (do not cc dev) and use --subject-prefix='PATCH 17.11'
> - alternatively, the 17.11 maintainer can simply opt to not pick up
> this patch.
>

Not hard to achieve from my pov, the relevant bits are just this, I can
send it if the patch is selected.

@@ -23,10 +23,18 @@
 #define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */

 #if defined(__linux__)
-       typedef cpu_set_t rte_cpuset_t;
+typedef        cpu_set_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
 #elif defined(__FreeBSD__)
 #include <pthread_np.h>
-       typedef cpuset_t rte_cpuset_t;
+typedef cpuset_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) do \
+{ \
+       cpuset_t tmp; \
+       CPU_COPY(src1, &tmp); \
+       CPU_AND(&tmp, src2); \
+       CPU_COPY(&tmp, dst); \
+} while (0)
 #endif

 /**


-- 
David Marchand


More information about the dev mailing list