Skip to contentSkip to conversation

net: add generic PF_BRIDGE:RTM_ FDB hooks

PATCH John Fastabend 1 participant 1 message Mar 21, 2012 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CB8E57D1.494C3%[email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 36 lines · John Fastabend
Quoted 11 lines · Roopa Prabhu
Quoted 10 lines · John Fastabend
Quoted 8 lines

This adds two new flags NTF_MASTER and NTF_LOWERDEV that can now be used to specify where PF_BRIDGE netlink commands should be sent. NTF_MASTER sends 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 implements ndo_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