Ignore:
Timestamp:
03/18/15 16:31:49 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
963b13b
Parents:
6c84681
Message:

Remove HASHER_HARDWARE and doc/code tidies

We don't want to expose this option to the user as it was only used internally.
As it happens we can completely remove it if needed.

Remove error handling from start thread and fix gcc warning in start thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_parallel.h

    r6a6e6a8 r1407294  
    284284};
    285285
     286/** The hasher types avaliable to libtrace application.
     287 * These can be selected using trace_set_hasher().
     288 */
    286289enum hasher_types {
    287         /**
    288          * Balance load across CPUs best as possible, this is basically to say do
    289          * not care about hash. This might still might be implemented
    290          * using a hash or round robin etc. under the hood depending on the format
     290        /** Balance load across per-packet threads as best as possible, this is
     291         * basically to say I do not care about where packets are sent. This
     292         * might still might be implemented using a hash or round robin etc.
     293         * depending on the format and libtrace configuration.
    291294         */
    292295        HASHER_BALANCE,
    293296
    294         /** Use a hash which is bi-directional for TCP flows, that is packets with
    295          * the same hash are sent to the same thread. All non TCP packets will be
    296          * sent to the same thread. UDP may or may not be sent to separate
    297          * threads like TCP, this depends on the format support.
     297        /** Use a hash which is bi-directional for TCP and UDP flows, that is
     298         * packets with the same 5-tuple are sent to the same per-packet thread.
     299         * All non TCP/UDP packets will be sent to the same thread.
     300         *
     301         * @note it is possible that UDP packets may not be spread across
     302         * per-packet threads, depending upon the format support. In this case
     303         * they would be directed to a single per-packet thread.
    298304         */
    299305        HASHER_BIDIRECTIONAL,
    300306
    301         /**
    302          * Use a hash which is uni-directional across TCP flows, that means the
    303          * opposite directions of the same 5 tuple might end up on separate cores.
    304          * Otherwise is identical to HASHER_BIDIRECTIONAL
     307        /** Use a hash which is uni-directional across TCP and UDP flows, this
     308         * means the opposing directions of the same 5-tuple might end up on
     309         * different per-packet threads.
     310         * Otherwise this is identical to HASHER_BIDIRECTIONAL
    305311         */
    306312        HASHER_UNIDIRECTIONAL,
    307313
    308314        /**
    309          * Always use the user supplied hasher, this currently disables native
    310          * support and is likely significantly slower.
    311          */
    312         HASHER_CUSTOM,
    313 
    314         /**
    315          * This is not a valid option, used internally only!!! TODO remove
    316          * Set by the format if the hashing is going to be done in hardware
    317          */
    318         HASHER_HARDWARE
     315         * Always use the user supplied hasher, this disables native
     316         * support in and is likely significantly slower.
     317         */
     318        HASHER_CUSTOM
    319319};
    320320
     
    676676/// @}
    677677
    678 
    679 /** TODO DOXS
     678/** Set the hasher function for a parallel trace.
     679 *
     680 * @param[in] trace The parallel trace to apply the hasher to
     681 * @param[in] type The type of hashing to apply, see enum hasher_types
     682 * @param[in] hasher A hasher function to use [Optional]
     683 * @param[in] data Data passed to the hasher function [Optional]
     684 *
     685 * @return 0 if successful otherwise -1 on error
     686 *
     687 * The hasher function in a parallel trace can be used to control which
     688 * per-packet thread a packets is processed by.
     689 *
     690 * HASHER_BALANCE is the default and will dispatch packets as fast as possible
     691 * to all threads arbitrarily. As such when called the hasher and
     692 * data parameters must be set to NULL.
     693 *
     694 * HASHER_CUSTOM will force the libtrace to use the user defined function. As
     695 * such the hasher parameter must be supplied.
     696 *
     697 * With other defined hasher types we will try to push the hashing into the format
     698 * by default. In this case the hasher parameter is optional and will be
     699 * preferred over the default supplied by libtrace.
     700 *
     701 * @note When supplying a hasher function it should be thread-safe as it could
     702 * be run in parallel by libtrace. Ideally this should rely upon no state, other
     703 * than some form of seed value supplied in data.
    680704 */
    681705DLLEXPORT int trace_set_hasher(libtrace_t *trace, enum hasher_types type, fn_hasher hasher, void *data);
     
    685709 * as such making use of built-in types is important.
    686710 *
    687  * User specific results should be defined as values greater than RESULT_USER(1000)
     711 * Custom result types users should be defined as RESULT_USER(1000) or greater.
    688712 *
    689713 */
     
    731755                                    int type);
    732756
    733 /** Check if a dedicated hasher thread is being used
     757/** Check if a dedicated hasher thread is being used.
    734758 *
    735759 * @return True if the trace has dedicated hasher thread otherwise false.
     760 *
     761 * This is valid once the trace is running after calling trace_pstart().
    736762 */
    737763DLLEXPORT bool trace_has_dedicated_hasher(libtrace_t * libtrace);
Note: See TracChangeset for help on using the changeset viewer.