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

26 Commits

Author SHA1 Message Date
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
18e8912987 mac-learning: Speed up mac_table_hash().
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-18 20:37:43 -07:00
Ben Pfaff
e764773ccb vswitchd: Make the MAC entry aging time configurable.
NICS-11.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-01 15:04:51 -08:00
Ethan Jackson
d004060472 mac-learning: Only revalidate relevant flows upon flush.
Most callers of mac_learning_flush() need to revalidate all flows
anyway, but this update forces new callers of mac_learning_flush()
to think about whether or not they need to explicitly handle
revalidation.  Also, it's theoretically more efficient when there
are lots of flows but the learning table is empty, (e.g. bridges
that don't use the NORMAL action).

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-25 13:11:07 -08:00
Ben Pfaff
82062a2047 mac-learning: Fix inverted logic in is_learning_vlan().
When a bit is set in flood_vlans, that VLAN must be flooded, but the logic
here was reversed in the case where there were any flooded VLANs at all.
Thus, if a single VLAN was configured to be flooded, all VLANs except that
one were actually flooded.

The common case where no VLANs were to be flooded was handled correctly.

Reported-by: David Tsai <dtsai@nicira.com>
2011-07-26 17:09:07 -07:00
Ethan Jackson
16a5d1e472 mac-learning: Simplify memory management.
The mac-learning implementation used a free list to keep track of
statically allocated table entries.  This made the code slightly
more difficult to understand than the more straightforward heap
based strategy implemented by this patch.
2011-07-22 19:04:14 -07:00
Ethan Jackson
8e8d596694 mac-learning: Use random secret in hash function.
The mac-learning 'secret' parameter is intended to prevent an
attacker from turning the mac learning table into a linked list by
using a known hash function to choose perfectly bad mac entries.
However, this parameter was not taken into account in most cases.

Found by inspection.
2011-07-22 19:04:13 -07:00
Ethan Jackson
8ea45fdc0f mac-learning: Convert to hmap.
The mac-learning code predates the hmap data structure in OVS.  For
this reason, it rolled it's own hmap-like bucket concept.  This
patch converts it to use an hmap which makes the code slightly
simpler and easier to understand.
2011-07-22 11:31:30 -07:00
Ethan Jackson
7bbe0453f5 mac-learning: Fix serious performance bug in the learning table.
Due to a typo, the mac-learning hash table had dissolved into a
linked list.  This caused a significant reduction in performance.
2011-07-21 18:01:27 -07:00
Ben Pfaff
8e2e7a5d54 mac-learning: Avoid unnecessary call to free(). 2011-04-25 17:11:29 -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
0fb7b9156a vlan-bitmap: New data structure. 2011-04-25 17:11:29 -07:00
Ben Pfaff
356180a825 mac-learning: Expose function for expiring a single MAC learning entry.
The bridge will soon use this for expiring only the MAC learning entries
associated with a given port at port deletion time.
2011-03-22 09:57:25 -07:00
Ben Pfaff
db8077c315 mac-learning: Refactor to increase generality.
In an upcoming commit I want to store a pointer in MAC learning entries
in the bridge, instead of an integer port number.  The MAC learning library
has other clients, and the others do not gracefully fit this new model, so
in fact the data will have to become a union.  However, this does not fit
well with the current mac_learning API, since mac_learning_learn()
currently initializes and compares the data.  It seems better to break up
the API so that only the client has to know the data's format and how to
initialize it or compare it.  This commit makes this possible.

This commit doesn't change the type of the data stored in a MAC learning
entry yet.

As a side effect this commit has the benefit that clients that don't need
gratuitous ARP locking don't have to specify any policy for it at all.
2011-03-22 09:47:02 -07:00
Ben Pfaff
d76f09ea77 coverage: Make the coverage counters catalog program-specific.
Until now, the collection of coverage counters supported by a given OVS
program was not specific to that program.  That means that, for example,
even though ovs-dpctl does not have anything to do with mac_learning, it
still has a coverage counter for it.  This is confusing, at best.

This commit fixes the problem on some systems, in particular on ones that
use GCC and the GNU linker.  It uses the feature of the GNU linker
described in its manual as:

    If an orphaned section's name is representable as a C identifier then
    the linker will automatically see PROVIDE two symbols: __start_SECNAME
    and __end_SECNAME, where SECNAME is the name of the section.  These
    indicate the start address and end address of the orphaned section
    respectively.

Systems that don't support these features retain the earlier behavior.

This commit also fixes the annoyance that files that include coverage
counters must be listed on COVERAGE_FILES in lib/automake.mk.

This commit also fixes the annoyance that modifying any source file that
includes a coverage counter caused all programs that link against
libopenvswitch.a to relink, even programs that the source file was not
linked into.  For example, modifying ofproto/ofproto.c (which includes
coverage counters) caused tests/test-aes128 to relink, even though
test-aes128 does not link again ofproto.o.
2010-11-30 10:30:30 -08:00
Ben Pfaff
d98e600755 vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.
2010-10-29 09:48:47 -07:00
Ben Pfaff
4e8e4213a8 Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code
that uses them shorter and more readable.
2010-10-01 10:25:29 -07:00
Ben Pfaff
5136ce492c vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.
Adding a macro to define the vlog module in use adds a level of
indirection, which makes it easier to change how the vlog module must be
defined.  A followup commit needs to do that, so getting these widespread
changes out of the way first should make that commit easier to review.
2010-07-21 15:47:09 -07:00
Jesse Gross
7febb9100b bridge: Filter some gratuitous ARPs on bond slaves.
Normally we filter out packets received on a bond if we have
learned the source MAC as belonging to another port to avoid packets
sent on one slave and reflected back on another.  The exception to
this is gratuitous ARPs because they indicate that the host
has moved to another port.  However, this can result in an additional
problem on the switch that the host moved to if the gratuitous ARP is
reflected back on a bond slave.  In this case, we incorrectly relearn
the slave as the source of the MAC address.  To solve this, we lock the
learning entry for 5 seconds after receiving a gratuitous ARP against
further updates caused by gratuitous ARPs on bond slaves.

Bug #2516

Reported-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-03 19:46:44 -07:00
Ben Pfaff
7cf8b2660f poll-loop: New function poll_timer_wait_until().
Many of poll_timer_wait()'s callers actually want to wait until a specific
time, so it's convenient for them to offer a function that does this.
2010-05-26 11:46:59 -07:00
Ben Pfaff
8f30d09ab0 mac-learning: Rename "non-learning VLANs" to "flood VLANs".
Usually positive names are better than negative ones.
2010-01-19 10:41:46 -08:00
Jesse Gross
f2d7fd66cf mirroring: Allow learning to be disabled on a VLAN.
RSPAN does not work properly unless MAC learning for the VLAN is
disabled on all switches between the origin and monitoring point.
This allows learning to be disabled on a given VLAN so vSwitch can
acts as an intermediate switch.

Feature #2136
2009-11-10 13:37:08 -08:00
Ben Pfaff
321943f790 mac-learning: New function mac_entry_age().
This function will be used as part of printing the MAC learning table at
user request.
2009-07-16 09:17:06 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
962ff3d674 mac-learning: Make data structures public.
The vswitchd bonding code needs to iterate through the table entries to
be able to send out gratuitous learning packets when bond slaves go down.
It might be best to create an abstract interface to the MAC learning table,
but this commit does the simpler thing and exposes the data structures in
the header file.
2009-06-08 12:26:11 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00