summaryrefslogtreecommitdiff
path: root/lib/bitfield.h
AgeCommit message (Collapse)Author
2025-03-07lib: use memcpy in bf_copyKarthikeya Venkat Muppalla
use memcpy in bf_copy() instead of copy word by word in for loop Signed-off-by: Karthikeya Venkat Muppalla <kmuppalla@nvidia.com>
2024-01-29lib: init new bitfield word after reallocMark Stapp
Realloc doesn't init - ensure a newly-allocated word is inited. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-08-09libs: use XREALLOC in bitfield lib moduleMark Stapp
Use FRR mem api instead of raw realloc() in bitfield module. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-09lib: add copy function for bitfield_tHiroki Shirokura
Add a function to copy a bitfield_t structure. Add a ‘void *’ to ‘word_t *’ converstion in bf_init() to avoid the following error: > ./lib/bitfield.h: In function ‘bf_copy’: > ./lib/bitfield.h:75:12: error: request for implicit conversion from ‘void *’ to ‘word_t *’ {aka ‘unsigned int *’} not permitted in C++ [-Werror=c++-compat] > (v).data = XCALLOC(MTYPE_BITFIELD, ((v).m * sizeof(word_t))); \ > ^ > ./lib/bitfield.h:278:2: note: in expansion of macro ‘bf_init’ > bf_init(dst, WORD_SIZE * (src.m - 1)); > ^~~~~~~ Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-08-31bgpd: improve labelpool performance at scaleG. Paul Ziemba
- double the size of each new chunk request from zebra - use bitfields to track label allocations in a chunk - When allocating: - skip chunks with no free labels - search biggest chunks first - start search in chunk where last search ended - Improve API documentation in comments (bgp_lp_get() and callback) - Tweak formatting of "show bgp labelpool chunks" - Add test features (compiled conditionally on BGP_LABELPOOL_ENABLE_TESTS) Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-06-18lib: add an MTYPE for bitfieldsPat Ruddy
it is handy to be able to see allocated bitfields in the show memory output. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-05lib: bitfield: new macros for bit processingAnuradha Karuppiah
New macros have been added for the following - 1. to efficiently iterate and execute functions on already set bits 2. to check if a bit is in use 3. to check if a bitfield has been initialized (this is to safetly handle cases where the bitfield is freed and re-allocated). 4. to check if two bitfields have the same bits set Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-04-17lib: dont null check bitfield pointer before freeQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17lib: clear data pointer in bf_freeMark Stapp
Help avoid double-free by clearing data pointer. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-02-11lib: add extern "C" {} blocks to all libfrr headersRenato Westphal
These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-25lib: Additional APIs in bitfield libraryvivek
Added APIs to: a) pre-assign 0th bit in the bitfield b) free 0th bit in the bitfield c) free the allocated bitfield data Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-19Merge remote-tracking branch 'cmaster-next' into cmaster-next-relengDavid Lamparter
2016-11-18*: Fix up licensing to be rightDonald Sharp
These files were submitted by Cumulus but did not properly setup the licensing of them. This fixes that issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-11-15build: fix -Wmaybe-uninitialized warningsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2015-05-19ospf6d: ospfv3-abr-ecmp-support.patchDonald Sharp
OSPFv3: Add ABR support and make ECMP > 4. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>