Thread (37 messages) 37 messages, 5 authors, 2013-06-05

Re: [RFC] vxlan: convert remote list to list_rcu

From: David Stevens <hidden>
Date: 2013-06-04 12:48:14

Mike Rapoport [off-list ref] wrote on 06/04/2013 
05:18:08 AM:
quoted
But i don't think any of this fdb code relates to the default
destination directly, since the generic fdb code does not support
default, or any other aggregate matching. VXLAN can define the
netlink API for default destinations without affecting anything
else, because it is already a per-device feature.

                                                        +-DLS
The only relation is the 'struct vxlan_rdst' which I intended to use
for default destinations list. So, until there's a consensus about
remote destinations list in fdb, I cannot continue to work on multiple
default destinations.
Yes, I agree with that.

I'd expect we could just either add a lock for the default to do
deletes, or overload vxlan_dev->hash_lock and acquire it for deletes
of the default list. [overload probably simplest]

Actually, we could make it an fdb and also have "use" and "updated"
stats that way, and/or use the existing fdb code and add an entry
with MAC "00:00:00:00:00:00" [which is disallowed via the generic
fdb code, so can't be in the fdb table otherwise].

So something like:
        f = vxlan_find_mac(vxlan, mac);
        did_rsc = false;

        if (f && (f->flags & NTF_ROUTER ... {
                ...
        }

        if (f == NULL) {
                f = vxlan_find_mac(vxlan, ALL_ZEROS_MAC);
                if (f == NULL) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
do these two lines instead of checking "default_dst" for INADDR_ANY

                    if (vxlan->flags & VXLAN_F_L2MISS &&
                        ..
                                vxlan_fdb_miss(...);
                        dev->stats.tx_dropped++;
                        dev_kfree_skb(skb);
                        return NETDEV_TX_OK;
                }
        }

        rc = NETDEV_TX_OK;

and the default will then use the same code as the fdb; can
then remove the NULL dst check in vxlan_xmit_one(), and do
fdb_adds/fdb_append/fdb_del with ALL_ZEROS_MAC as in the fdb,
but get there with a device-specific netlink message. If there
is no default, delete the all-zeros MAC fdb entry, like any
other fdb entry.

Or even extend the generic rtnetlink fdb code to not check
for all-zeros and just treat the all-zeros mac, if there, as a
default destination and use all the same code as fdb to
manage the default.

                                                +-DLS
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help