On Thu, Mar 08, 2012 at 07:26:49AM -0800, Pravin B Shelar wrote:
> Signed-off-by: Pravin B Shelar <[email protected]>

I think that we need to be a little bit careful here, because people
do make changes such that the ifindex associated with a particular
network device name changes.  One case is renaming network devices,
e.g. some distros actually swap around device names at system startup
in some cases.  Another case is VM startup on XenServer; I know that
I've seen e.g. vif1.0 appear and then disappear and then reappear as a
new device (with a new ifindex) that just happens to have the same
name.

So, if we want to cache this mapping, then I'd suggest:

        - Update the ifindex from rtnetlink notifications (it's
          already in struct rtnetlink_link_change as ifi_index).

        - Drop the cached ifindexes if netdev_linux_cache_cb() gets a
          NULL 'change' parameter.

As a minor point of style, in netdev_dev_linux_changed() you can drop
the parentheses here:
> +    /* Always cache driver-info and ifindex. */
> +    dev->cache_valid &= (VALID_DRVINFO | VALID_IFINDEX);

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to