summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorVasu Dasari <vdasari@gmail.com>2021-06-29 16:43:39 -0400
committerIlya Maximets <i.maximets@ovn.org>2021-07-16 16:21:02 +0200
commitccc24fc88d590e1d89185ee5650c9c5f031c916d (patch)
tree6ea6b770f62ed8e163b392a253402edfa058eb05 /vswitchd
parentae2424696cff5a8a60db9a961bc366abced77e8d (diff)
downloadopenvswitch-ccc24fc88d590e1d89185ee5650c9c5f031c916d.tar.gz
ofproto-dpif: APIs and CLI option to add/delete static fdb entry.
Currently there is an option to add/flush/show ARP/ND neighbor. This covers L3 side. For L2 side, there is only fdb show command. This commit gives an option to add/del an fdb entry via ovs-appctl. CLI command looks like: To add: ovs-appctl fdb/add <bridge> <port> <vlan> <Mac> ovs-appctl fdb/add br0 p1 0 50:54:00:00:00:05 To del: ovs-appctl fdb/del <bridge> <vlan> <Mac> ovs-appctl fdb/del br0 0 50:54:00:00:00:05 Added two new APIs to provide convenient interface to add and delete static-macs. bool xlate_add_static_mac_entry(const struct ofproto_dpif *, ofp_port_t in_port, struct eth_addr dl_src, int vlan); bool xlate_delete_static_mac_entry(const struct ofproto_dpif *, struct eth_addr dl_src, int vlan); 1. Static entry should not age. To indicate that entry being programmed is a static entry, 'expires' field in 'struct mac_entry' will be set to a MAC_ENTRY_AGE_STATIC_ENTRY. A check for this value is made while deleting mac entry as part of regular aging process. 2. Another change to the mac-update logic, when a packet with same dl_src as that of a static-mac entry arrives on any port, the logic will not modify the expires field. 3. While flushing fdb entries, made sure static ones are not evicted. 4. Updated "ovs-appctl fdb/stats-show br0" to display number of static entries in switch Added following tests: ofproto-dpif - static-mac add/del/flush ofproto-dpif - static-mac mac moves Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2019-June/048894.html Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1597752 Signed-off-by: Vasu Dasari <vdasari@gmail.com> Tested-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/ovs-vswitchd.8.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/vswitchd/ovs-vswitchd.8.in b/vswitchd/ovs-vswitchd.8.in
index 50dad7208..ec0131a19 100644
--- a/vswitchd/ovs-vswitchd.8.in
+++ b/vswitchd/ovs-vswitchd.8.in
@@ -159,6 +159,12 @@ If \fIbridge\fR is not specified, then displays detailed information about all
bridges with RSTP enabled.
.SS "BRIDGE COMMANDS"
These commands manage bridges.
+.IP "\fBfdb/add\fR \fIbridge\fR \fIport\fR \fIvlan\fR \fImac\fR"
+Adds \fImac\fR address to a \fIport\fR and \fIvlan\fR on a \fIbridge\fR. This
+utility can be used to pre-populate fdb table without relying on dynamic
+mac learning.
+.IP "\fBfdb/del\fR \fIbridge\fR \fIvlan\fR \fImac\fR"
+Deletes \fImac\fR address from a \fIport\fR and \fIvlan\fR on a \fIbridge\fR.
.IP "\fBfdb/flush\fR [\fIbridge\fR]"
Flushes \fIbridge\fR MAC address learning table, or all learning tables
if no \fIbridge\fR is given.