summaryrefslogtreecommitdiffstats
path: root/src/plugins/abf
AgeCommit message (Expand)AuthorFilesLines
2020-01-10docs: Edit FEATURE.yaml files so they can be publishedJohn DeNisco1-1/+1
2020-01-03abf: add feature.yamlNeale Ranns1-0/+20
2019-12-17ip: Protocol Independent IP NeighborsNeale Ranns1-1/+0
2019-12-06abf: use explicit types in apiOle Troan1-4/+5
2019-11-08tests: python3 use byte strings in raw()Ole Troan1-3/+3
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-09-27abf: remove api boilerplateOle Troan4-128/+6
2019-09-16api: autogenerate api trace print/endianOle Troan1-0/+5
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace1-0/+344
2019-08-20vppapigen: remove support for legacy typedefsPaul Vinciguerra1-2/+2
2019-07-31fib: fix calls to unformat_fib_pathNeale Ranns1-3/+3
2019-06-18fib: fib api updatesNeale Ranns4-8/+22
2019-05-16init / exit function orderingDave Barach1-1/+6
2019-05-03plugins: clean up plugin descriptionsDave Wallace1-1/+1
2019-04-11Adding check to ensure acl_id matches existing acl_id in abf_policy_updateParixit Gokhale3-9/+23
2019-04-10API: Fix shared memory only action handlers.Ole Troan1-27/+19
2019-03-01Fix API return code in case of error.Igor Mikhailov (imichail)1-1/+1
2019-01-30MPLS tunnel; fix crash when deleting non-existant pathNeale Ranns1-0/+2
2018-12-20FIB: encode the label stack in the FIB path during table dumpNeale Ranns1-1/+1
2018-10-25Use correct name to register ABF plugin with ACLsNeale Ranns1-1/+1
2018-10-23c11 safe string handling supportDave Barach1-2/+2
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra3-12/+12
2018-08-27cmake: Fix plugins .h includesMohsin Kazmi1-0/+4
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-2/+5
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+19
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-1/+1
2018-06-20acl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included i...Andrew Yourtchenko1-12/+29
2018-04-25ABF: remove the inclusion of version.h from abf_policy so it does not recompi...Neale Ranns2-8/+6
2018-04-17ACL based forwardingAndrew Yourtchenko9-0/+1965
> /**< cache line size */ u64 file_size_in_records; /**< file size in records */ u64 number_of_records; /**< number of records in entire log */ u64 number_of_files; /**< number of files in entire log */ u8 file_basename[256]; /**< file basename */ } clib_maplog_header_t; #define MAPLOG_MAJOR_VERSION 1 #define MAPLOG_MINOR_VERSION 1 #define MAPLOG_PATCH_VERSION 0 /** Process-private main data structure */ typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); /** rw cache line: atomic ticket-counter, file index */ volatile u64 next_record_index; /** file size in records, rounded to a power of two */ u64 file_size_in_records; u32 log2_file_size_in_records; /**< lg file size in records */ volatile u32 current_file_index; /**< current file index */ volatile u32 flags; /**< flags, currently just "init" or not */ /* read-mostly cache line: size parameters, file names, etc. */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline2); u32 record_size_in_cachelines; /**< record size in cache lines */ /* double-buffered mmap'ed logfiles */ volatile u8 *file_baseva[2]; /**< active segment base addresses */ u8 *filenames[2]; /**< active segment file names */ /* vector not c-string */ u8 *file_basename; /**< basename, e.g. "/tmp/mylog" */ u8 *header_filename; /**< log header file name */ } clib_maplog_main_t; /* flag bits */ #define CLIB_MAPLOG_FLAG_INIT (1<<0) #define CLIB_MAPLOG_FLAG_CIRCULAR (1<<1) #define CLIB_MAPLOG_FLAG_WRAPPED (1<<2) /** log initialization structure */ typedef struct { clib_maplog_main_t *mm; /**< pointer to the main structure */ char *file_basename; /**< file base name */ u64 file_size_in_bytes; /**< file size in bytes */ u32 record_size_in_bytes; /**< record size in bytes */ u32 application_id; /**< application identifier */ u8 application_major_version; /**< application major version number */ u8 application_minor_version; /**< application minor version number */ u8 application_patch_version; /**< application patch version number */ u8 maplog_is_circular; /**< single, circular log */ } clib_maplog_init_args_t; /* function prototypes */ int clib_maplog_init (clib_maplog_init_args_t * ap); void clib_maplog_update_header (clib_maplog_main_t * mm); void clib_maplog_close (clib_maplog_main_t * mm); int clib_maplog_process (char *file_basename, void *fp_arg); format_function_t format_maplog_header; u8 *_clib_maplog_get_entry_slowpath (clib_maplog_main_t * mm, u64 my_record_index); /** * @brief Obtain a log entry pointer * * Increments the atomic ticket counter, and returns a pointer to * the newly-allocated log entry. The slowpath function replaces * a full log segment with a new/fresh/empty log segment * * @param[in] mm maplog object pointer * @return pointer to the allocated log entry */ static inline void * clib_maplog_get_entry (clib_maplog_main_t * mm) { u64 my_record_index; u8 *rv; ASSERT (mm->flags & CLIB_MAPLOG_FLAG_INIT); my_record_index = clib_atomic_fetch_add (&mm->next_record_index, 1); /* Time to unmap and create a new logfile? */ if (PREDICT_FALSE ((my_record_index & (mm->file_size_in_records - 1)) == 0)) { /* Regular log? Switch file... */ if (!(mm->flags & CLIB_MAPLOG_FLAG_CIRCULAR)) { /* Yes, but not the very first time... (;-)... */ if (my_record_index) return _clib_maplog_get_entry_slowpath (mm, my_record_index); } else /* Circular log: set the wrap bit and move along */ mm->flags |= CLIB_MAPLOG_FLAG_WRAPPED; /* FALLTHROUGH */ } rv = (u8 *) mm->file_baseva[(my_record_index >> mm->log2_file_size_in_records) & 1] + (my_record_index & (mm->file_size_in_records - 1)) * mm->record_size_in_cachelines * CLIB_CACHE_LINE_BYTES; return rv; } #endif /* __included_maplog_h__ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */