[Xorp-hackers] heavy CPU use for xorp_fea on startup

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Fri Mar 7 09:38:37 PST 2008

Ben Greear <greearb at candelatech.com> wrote:

> Pavlin Radoslavov wrote:
> > The ifname and the vifname cannot change, because they are the
> > unique ID of an interface/vif. If they change, this will be
> It may never actually happen in practice, but this code makes it look like it
> might be possible...  Either way, since I update the hash here, it shouldn't
> matter...
>      // From ifconfig_parse_netlink-socket.cc, with my patch applied.
>      //
>      // Set the physical interface index for the interface
>      //
>      if (is_newlink || (if_index != ifp->pif_index())) {
> 	ifp->set_pif_index(if_index);
> 	iftree.updateIfCache(if_index, if_name);
>      }

The interface cache should be internal to IfTree and we don't want
to manipulate it outside IfTree.

I started working on that, but it turned out to be more complicated
than I originally anticipated.
Hopefully very soon I will have it finished.

> I think I can simplify my code a bit, but I need to verify some things:
> 1)  Is there ever a case where a vif has a different pif_index than
>    the parent device?  If not, I can remove the _vifindexes hash entirely
>    and not worry about add/delete vif (only add_interface, delete_interface),
>    since the lookup methods use pif_index and not the vif_index as far as
>    I can tell.

Yes. The vlan vifs have their own pif_index. If they are attached to
the parent (physical) interface, then the pif_index of the interface
and the vif are different.

> 2)  How is the _vif_index used?

It is used by the MFEA to propagate its own indexing scheme to the
multicast protocols (IGMP/MLD and PIM-SM). The rest of the FEA
(outside MFEA) doesn't need to manipulate it in any way.

I will let you know when I am done with the patch and will ask you
to test it.


More information about the Xorp-hackers mailing list