net: add generic PF_BRIDGE:RTM_ FDB hooks
Subsystems (2)
Quoted 36 lines · John Fastabend
Quoted 11 lines · Roopa Prabhu
Quoted 10 lines · John Fastabend
Quoted 8 lines
This adds two new flags
NTF_MASTERandNTF_LOWERDEVthat can now be used to specify wherePF_BRIDGEnetlink commands should be sent.NTF_MASTERsends the commands to the 'dev->master' device for parsing. Typically this will be the linux net/bridge, macvlan, or open-vswitch devices. Also without any flags set the command will be handled by the master device as well so that current user space tools continue to work as expected.[...]
Quoted 17 lines
Sorry John for getting back on this very late.
Am trying to see how this will work for macvlan.Am wondering if the below is how you think might work,
- macvlan implementsndo_fdb_add, del, dump- macvlan_fdb_add { if (macvlan passthrough mode) { if (lowerdev->ndo_fdb_add) { lowerdev->ndo_fdb_add(addr) with NTF_LOWERDEV } else { /* This is because, we don't want all devices to have to implement ndo_fdb_add. Eg Devices without an embedded bridge */. dev_uc_add_excl(lowerdev, addr) }Quoted 4 lines
}
Let me see if I can write a sample patch.
Quoted 8 lines
Yes this is what I expect. I'll post the sample patch I've been working with here in just a second. The tricky part is dealing with the promisc mode. In your previous series you just removed doesn't seem correct to me because we already have a precedent set i.e. macvlan passthru comes up in promisc mode and doesn't require any filters.
.John
ah dang that msg won't hit netdev because I stupidly named the patch with three Xs.
but to follow up yes NTF_SELF seems like a better name. I'll change it when I submit again after net-next opens up and I also posted my RFC for macvlan feel free to use that as a starting point if it works for you.
Thanks,
.John