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

13 Commits

Author SHA1 Message Date
Ilya Maximets
7b838a24fc mcast-snooping: Remove typedef from mcast_group_proto.
Typedefs are confusing and the coding style generally advises to not
use them.  Removing typedef until others start using it.

This typedef already got me while testing an OVN update to use OVS 3.3
as a submodule, since the variable was declared in a switch statement
and it wasn't clearly visible that there is a variable definition in
one of the cases and braces should be used.  Strangely some versions
of compilers do not require braces in this case, so OVN change works
locally, but not in CI.

Fixes: 077d0bad0436 ("mcast-snooping: Store IGMP/MLD protocol version.")
Acked-by: Mohammad Heib <mheib@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2024-01-29 15:30:13 +01:00
Mohammad Heib
b222593bc6 mcast-snooping: Add group protocol to mdb/show output.
Expose the mcast group protocol via the mdb/show
command output.

Signed-off-by: Mohammad Heib <mheib@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2024-01-17 13:33:58 +01:00
Mohammad Heib
077d0bad04 mcast-snooping: Store IGMP/MLD protocol version.
Store igmp/mld protocol version into the
mcast_group internally, the multicast snooping feature
is used by many OVS consumers and those consumers heavily rely
on the OVS implementation to manage/deal with mcast groups,
some of those consumers also need to deal/expose the mcast protocol
to the end user for debuggability purposes.

OVN for example needs to expose the protocol version to the end user
to match between the protocol version used in the OVN logical switches
and the uplink ports

Therefore, instead of implementing this in each OVS consumer that needs
to deal mcast group protocol version which will be very complicated
implementation since it rely on the OVS code, saving the protocol to
the mdb inside OVS will give that consumer access to the protocol version
very easily.

Signed-off-by: Mohammad Heib <mheib@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2024-01-17 13:26:38 +01:00
nickcooper-zhangtonghao
4fbbf86248 mcast-snooping: Flush ports mdb when VLAN configuration changed.
If VLAN configuration(e.g. id, mode) change occurs, the IGMP
snooping-learned multicast groups from this port on the VLAN are
deleted. This avoids a MCAST_ENTRY_DEFAULT_IDLE_TIME delay before
mdb is updated again. Hardware switches (e.g. cisco) also do that.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-03-03 11:33:22 -08:00
Terry Wilson
ee89ea7b47 json: Move from lib to include/openvswitch.
To easily allow both in- and out-of-tree building of the Python
wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to
include/openvswitch. This also requires moving lib/{hmap,shash}.h.

Both hmap.h and shash.h were #include-ing "util.h" even though the
headers themselves did not use anything from there, but rather from
include/openvswitch/util.h. Fixing that required including util.h
in several C files mostly due to OVS_NOT_REACHED and things like
xmalloc.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-07-22 17:09:17 -07:00
Ben Warren
b19bab5b20 list: Remove lib/list.h completely.
All code is now in include/openvswitch/list.h.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-03-30 13:01:21 -07:00
Thadeu Lima de Souza Cascardo
06994f879c mcast-snooping: Add Multicast Listener Discovery support
Add support for MLDv1 and MLDv2. The behavior is not that different from
IGMP. Packets to all-hosts address and queries are always flooded,
reports go to routers, routers are added when a query is observed, and
all MLD packets go through slow path.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Cc: Flavio Leitner <fbl@redhat.com>
Cc: Ben Pfaff <blp@nicira.com>
[blp@nicira.com moved an assignment out of an 'if' statement]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-01 17:09:01 -07:00
Thadeu Lima de Souza Cascardo
964a4d5fd5 mcast-snooping: Use IPv6 address for MDB
Use IPv6 internally for storing multicast addresses. IPv4 addresses are
translated to their IPv4-mapped equivalent.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Cc: Flavio Leitner <fbl@redhat.com>
Cc: Ben Pfaff <blp@nicira.com>
[blp@nicira.com added a "sparse" implementation of IN6_IS_ADDR_V4MAPPED.]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-01 16:49:40 -07:00
Thadeu Lima de Souza Cascardo
e3102e42ef Add IGMPv3 support.
Support IGMPv3 messages with multiple records. Make sure all IGMPv3
messages go through slow path, since they may carry multiple multicast
addresses, unlike IGMPv2.

Tests done:

* multiple addresses in IGMPv3 report are inserted in mdb;
* address is removed from IGMPv3 if record is INCLUDE_MODE;
* reports sent on a burst with same flow all go to userspace;
* IGMPv3 reports go to mrouters, i.e., ports that have issued a query.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-17 11:09:33 -07:00
Flavio Leitner
8e04a33ffc mcast-snoop: Add support to control Reports forwarding
The RFC4541 section 2.1.1 item 1 allows the snooping switch
to provide an administrative control to allow Report messages
to be flooded to ports not connected to multicast routers.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-02-04 10:49:07 -08:00
Flavio Leitner
f4ae6e23c3 mcast_snoop: make mcast_fport_bundle generic
The struct mcast_fport_bundle will be used for ports
forwarding Reports too, so make it generic.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-02-04 09:59:25 -08:00
Thomas Graf
ca6ba70092 list: Rename struct list to struct ovs_list
struct list is a common name and can't be used in public headers.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:12 +01:00
Flavio Leitner
4a95091d1f lib: Add IGMP snooping library bits
This patch adds generic IGMP snooping library code
that is used in follow-up patches.

Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-06-24 11:17:07 -07:00