2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 05:18:13 +00:00

11 Commits

Author SHA1 Message Date
Ben Pfaff
6ec6fa2551 bitmap: add bitmap_count1 function
Signed-off-by: Alexander Wu <alexander.wu@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-12-23 12:59:17 -08:00
Ben Pfaff
1af1ed8500 bitmap: New macro BITMAP_N_LONGS for use in constant expressions.
An upcoming commit will declare a bitmap on the stack, rather than heap
allocating it, which means that it is not possible to use a function call
in the declaration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-11-15 08:22:27 -08:00
Ben Pfaff
ebc56baa41 util: New macro CONST_CAST.
Casts are sometimes necessary.  One common reason that they are necessary
is for discarding a "const" qualifier.  However, this can impede
maintenance: if the type of the expression being cast changes, then the
presence of the cast can hide a necessary change in the code that does the
cast.  Using CONST_CAST, instead of a bare cast, makes these changes
visible.

Inspired by my own work elsewhere:
http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/cast.h#n80

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-03 13:33:13 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
77d895d686 bitmap: New function to allocate a bitmap initialized to all-1-bits. 2011-09-26 13:15:56 -07:00
Ben Pfaff
2a4ae6357e mac-learning: Change mac_learning_set_flood_vlans() to not take ownership.
These new semantics are less efficient in the case where the flood_vlans
actually changed, but that should be very rare.

There are no advantages to this change on its own, but upcoming commits
will add multiple layers between the code supplying the flood_vlans and
actually calling mac_learning_set_flood_vlans().  Consistency in this
multilayered interface seems valuable, and the rest of it does not transfer
ownership from the caller to the callee.
2011-04-25 17:11:29 -07:00
Ben Pfaff
17d18afbfd ovsdb: Check for changed columns only once per transaction commit.
Until now, each part of a transaction commit that is interested in whether
a column's value has changed has had to do a comparison of the old and new
values itself.  There can be several interested parties per commit
(generally one for file storage and one for each remove OVSDB connection),
so this seems like too much redundancy.  This commit adds a bitmap
to struct ovsdb_txn_row that tracks whether a column's value has actually
changed, to reduce this overhead.

As a convenient side effect of doing these checks up front, it then
becomes easily possible to drop txn_rows (and txn_tables and entire txns)
that become no-ops.  (This probably fixes bug #2400, which reported that
some no-ops actually report updates over monitors.)
2010-03-17 14:24:56 -07:00
Ben Pfaff
7cc48aed45 bitmap: New function bitmap_scan() and macro BITMAP_FOR_EACH_1.
bitmap_scan() can be optimized significantly for the case of a sparse
bitmap but it doesn't seem worth the additional overhead of writing a test
unless and until we show that it's a useful optimization in practice.
2009-12-07 17:10:27 -08:00
Ben Pfaff
bbb18ba723 bitmap: Don't allocate excessive memory.
ROUND_UP rounds up to a multiple of a given value.  That means that
bitmap_allocate() was allocating one byte for each bit in the bitmap,
which is clearly excessive.

Instead, just allocate one bit for every bit in the bitmap.
2009-09-17 14:45:18 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00