Changeset c04929c


Ignore:
Timestamp:
08/02/13 17:30:15 (7 years ago)
Author:
Richard Sanger <rjs51@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
3799f51
Parents:
212faa13
Message:

Added the new live trace format Intel DPDK - See the wiki for more documentation

Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    rb87c9e8 rc04929c  
    374374#DAG_VERSION_NUM=$dag_drv_v
    375375
     376# Check for DPDK
     377AC_ARG_WITH(dpdk,
     378            AS_HELP_STRING(--with-dpdk,include DPDK live capture support (Must set RTE_SDK/_TARGET enviroment variable)),
     379[
     380        if test "$withval" = no
     381        then
     382            want_dpdk=no
     383        else
     384            want_dpdk=ifpresent
     385        fi
     386],[
     387        # Default to building without DPDK format
     388        want_dpdk=ifpresent
     389])
     390
     391libtrace_dpdk=false
     392if test "$want_dpdk" != no; then
     393    saved_ldflags="$LDFLAGS"
     394    # Add to our libpath location
     395    LDFLAGS="$LDFLAGS -L$RTE_SDK/$RTE_TARGET/lib/"
     396    AC_CHECK_LIB(rte_eal, rte_eal_init, dpdk_found=1, dpdk_found=0, -lpthread -lrte_malloc -lethdev -lrte_mempool -lrte_ring)
     397    # Revert back
     398    LDFLAGS="$saved_ldflags"
     399    if test "$dpdk_found" = 1; then
     400        # Save these now so that they can be re-exported later
     401                AC_SUBST([RTE_TARGET])
     402        AC_SUBST([RTE_SDK])
     403        LIBTRACE_LIBS="$LIBTRACE_LIBS -lrte_eal -lrte_pmd_e1000 -lrte_pmd_ixgbe"
     404        LIBTRACE_LIBS="$LIBTRACE_LIBS -lethdev -lrte_mempool -lrte_ring -lrte_malloc"
     405        LIBTRACE_LIBS="$LIBTRACE_LIBS -lrte_mbuf"
     406                AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support])
     407                libtrace_dpdk=true
     408        fi
     409fi
    376410
    377411# Checks for various "optional" libraries
     
    389423# Check to see if we have libdl - *BSD has built-in libdl
    390424AC_SEARCH_LIBS(dlopen,dl, dlfound=1,dlfound=0 )
     425LIBS=
     426
     427# Check for clock_gettime
     428AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=1, have_clock_gettime=0)
    391429LIBS=
    392430
     
    417455                LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_getservent"
    418456        fi
     457fi
     458
     459if test "$have_get_clocktime" = 1; then
     460    LIBTRACE_LIBS="$LIBTRACE_LIBS -lrt"
    419461fi
    420462
     
    558600AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
    559601AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
     602AM_CONDITIONAL([HAVE_DPDK], [test "$libtrace_dpdk" = true])
    560603AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24])
    561604AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25])
     
    632675        AC_MSG_NOTICE([Compiled with DAG live capture support: No])
    633676fi
     677
     678if test x"$libtrace_dpdk" = xtrue; then
     679    AC_MSG_NOTICE([Compiled with DPDK live capture support: Yes])
     680else
     681    AC_MSG_NOTICE([Compiled with DPDK live capture support: No])
     682fi
    634683reportopt "Compiled with LLVM BPF JIT support" $JIT
    635684reportopt "Building man pages/documentation" $libtrace_doxygen
  • lib/Makefile.am

    rc909fad rc04929c  
    2626endif
    2727
     28if HAVE_DPDK
     29NATIVEFORMATS+= format_dpdk.c
     30# So we also make libtrace.mk in dpdk otherwise automake tries to expand
     31# it to early which I cannot seem to stop unless we use a path that
     32# doesn't exist currently
     33export RTE_SDK=@RTE_SDK@
     34export RTE_TARGET=@RTE_TARGET@
     35include $(RTE_SDK)/mk/rte.vars.mk
     36# We need to add -Wl before the linker otherwise this breaks our build
     37# This is added in with our make script patch to the DPDK library
     38include $(RTE_SDK)/mk/libtrace.mk
     39endif
    2840
    2941libtrace_la_SOURCES = trace.c common.h \
  • lib/libtrace.h.in

    r11041eb rc04929c  
    323323        TRACE_FORMAT_LINUX_RING   =15,  /**< Linux native interface capture PACKET_MMAP */
    324324        TRACE_FORMAT_RAWERF       =16,  /**< Special format for reading uncompressed ERF traces without checking for compression */
     325    TRACE_FORMAT_DPDK     =17, /**< The Intel Data Plane Development Kit format */
    325326};
    326327
     
    373374        /** RT is encapsulating a Linux native PACKET_MMAP capture record */
    374375        TRACE_RT_DATA_LINUX_RING=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_LINUX_RING,
     376    /** RT is encapsulating a Intel DPDK capture record */
     377        TRACE_RT_DATA_DPDK=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_DPDK,
    375378
    376379        /** As PCAP does not store the linktype with the packet, we need to
  • lib/libtrace_int.h

    rda46c9d rc04929c  
    929929 * @{
    930930 */
    931 #if __BYTE_ORDER == __BIG_ENDIAN
     931#if BYTE_ORDER == BIG_ENDIAN
    932932#define bswap_host_to_be64(num) ((uint64_t)(num))
    933933#define bswap_host_to_le64(num) byteswap64(num)
     
    947947 * attempt to optimise it
    948948 */
    949 #elif __BYTE_ORDER == __LITTLE_ENDIAN
     949#elif BYTE_ORDER == LITTLE_ENDIAN
    950950#define bswap_host_to_be64(num) (byteswap64(num))
    951951#define bswap_host_to_le64(num) ((uint64_t)(num))
     
    10211021void bpf_constructor(void);
    10221022#endif
     1023#if HAVE_DPDK
     1024/** Constructor for Intels DPDK format module */
     1025void dpdk_constructor(void);
     1026#endif
    10231027
    10241028/** Extracts the RadioTap flags from a wireless link header
  • lib/trace.c

    r212faa13 rc04929c  
    146146#ifdef HAVE_DAG
    147147                dag_constructor();
     148#endif
     149#ifdef HAVE_DPDK
     150        dpdk_constructor();
    148151#endif
    149152        }
Note: See TracChangeset for help on using the changeset viewer.