Folks,

I have a Makefile that defines multiple targets, including these two (for 
building OVS with DPDK support):

        config-ovs:
                cd $(OVS_DIR) && ./boot.sh && ./configure 
--with-dpdk=$(DPDK_BUILD) \
                --disable-ssl --enable-silent-rules && cd $(ROOT_DIR)

        ovs:
                $(MAKE) -C $(OVS_DIR) -j $(NUMPROC)

If I use these targets as is I get roughly the performance I'd expect. However, 
if I modify this slightly (to hide compile-time warnings) like so:

        export OVS_CFLAGS := -Wno-bad-function-cast -Wno-cast-align

        ovs:
                $(MAKE) -C $(OVS_DIR) CFLAGS="$(OVS_CFLAGS)" -j $(NUMPROC)

then performance takes ~3x hit (12,751,368 pps -> 4,480,900 pps). I've tried 
the following combinations and all cause the same issue:

        $(MAKE) -C $(OVS_DIR) CFLAGS="$(OVS_CFLAGS)" -j $(NUMPROC)
        $(MAKE) -C $(OVS_DIR) CFLAGS+="$(OVS_CFLAGS)" -j $(NUMPROC)
        $(MAKE) -C $(OVS_DIR) CFLAGS="" -j $(NUMPROC)
        $(MAKE) -C $(OVS_DIR) CFLAGS+="" -j $(NUMPROC)

Just in case, I also tried passing CFLAGS to the 'configure' step instead. 
However, once again I saw performance issues:

        config-ovs:
                cd $(OVS_DIR) && ./boot.sh && ./configure 
--with-dpdk=$(DPDK_BUILD) \
                --disable-ssl --enable-silent-rules CFLAGS="$(OVS_CFLAGS)" && \
                cd $(ROOT_DIR)

Combined, these results add to the theory that it's not the specific CFLAGS but 
rather the use of the 'CFLAGS' argument that is problematic. Based on this 
patch I would have expected this to work:

        http://openvswitch.org/pipermail/dev/2014-September/045494.html

To confirm this theory, I modified the '--with-dpdk' rule in 'acinclude.m4' to 
add these flags (thus skipping CFLAGS altogether). There is no performance 
penalty here. This, however, does not look like something people would like 
included otherwise it would be have been done already? :)

        diff --git a/acinclude.m4 b/acinclude.m4
        index c2f45ce..3b95db8 100644
        --- a/acinclude.m4
        +++ b/acinclude.m4
        @@ -204,7 +204,7 @@ AC_DEFUN([OVS_CHECK_DPDK], [
             CFLAGS="$ovs_save_CFLAGS"
             LDFLAGS="$ovs_save_LDFLAGS"
             OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR"
        -    OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE"
        +    OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE -Wno-bad-function-cast 
-Wno-cast-align"

             # DPDK 1.7 pmd drivers are not linked unless --whole-archive is 
used.
             #

Has anyone any suggestions for why performance is affected like this? To me, it 
looks like optimizations aren't being applied and perhaps CFLAGS is being 
overridden, but I don't know how to prevent this from happening. This issue 
would likely affect performance in Travis (assuming it matters there), seeing 
as a similar approach is adopted in '.travis/build.sh'.

Cheers,
Stephen
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to