[ovs-dev] [PATCH v2] ofproto-dpif: APIs and CLI option to add/delete static fdb entry
Vasu Dasari
vdasari at gmail.com
Mon May 10 23:43:46 UTC 2021
1. Sure. Will add more documentation to the code.
2. In mac_entry_age(), added new code to protect the age of the static
entry being overwritten by a received packet.
int
mac_entry_age(const struct mac_learning *ml, const struct mac_entry *e)
{- time_t remaining = e->expires - time_now();- return
ml->idle_time - remaining;+ /* For static fdb entries, expires
would be initialized with INT_MAX */+ if (INT_MAX == e->expires) {+
return -1;+ } else {+ time_t remaining = e->expires -
time_now();+ return ml->idle_time - remaining;+ }
}
Hope this answers your question.
Thanks
-Vasu
*Vasu Dasari*
On Mon, May 10, 2021 at 2:57 PM Ben Pfaff <blp at ovn.org> wrote:
> On Sat, May 08, 2021 at 06:18:41PM -0400, Vasu Dasari wrote:
> > 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 patch gives an
> option
> > to add/del an fdb entry via CLI.
> >
> > 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> <port> <vlan> <Mac>
> > ovs-appctl fdb/del br0 p1 0 50:54:00:00:00:05
> >
> > 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 INT_MAX. A check
> for this value
> > is made while deleting mac entry as part of regular aging process.
> Another check as part
> > of mac-update process, when a packet with same source mac as this entry
> arrives on the
> > configured port will not modify the expires field
> >
> > Added two new APIs to provide convinient interfacde to add and delete
> static-macs
> > void xlate_add_static_mac_entry(const struct ofproto_dpif *, ofp_port_t
> in_port,
> > struct eth_addr dl_src, int vlan);
> > void xlate_delete_static_mac_entry(const struct ofproto_dpif *,
> > struct eth_addr dl_src, int vlan);
> >
> > Signed-off-by: Vasu Dasari <vdasari at gmail.com>
> > Reported-at:
> https://mail.openvswitch.org/pipermail/ovs-discuss/2019-June/048894.html
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1597752
>
> Needs documentation.
>
> I would expect a static entry to be one that couldn't be changed by
> receiving a packet that causes MAC learning, but I don't see anything
> that protects from that in here.
>
More information about the dev
mailing list