[ovs-git] [openvswitch/ovs] ccc24f: ofproto-dpif: APIs and CLI option to add/delete st...

Vasu Dasari noreply at github.com
Fri Jul 16 15:00:27 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: ccc24fc88d590e1d89185ee5650c9c5f031c916d
      https://github.com/openvswitch/ovs/commit/ccc24fc88d590e1d89185ee5650c9c5f031c916d
  Author: Vasu Dasari <vdasari at gmail.com>
  Date:   2021-07-16 (Fri, 16 Jul 2021)

  Changed paths:
    M NEWS
    M lib/mac-learning.c
    M lib/mac-learning.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif-xlate.h
    M ofproto/ofproto-dpif.c
    M tests/ofproto-dpif.at
    M vswitchd/ovs-vswitchd.8.in

  Log Message:
  -----------
  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 at gmail.com>
Tested-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list