Hi Jiri,

Apologies for possibly newbie questions here, but:

> +bool swdev_dev_check(const struct net_device *dev)
> +{
> +     return dev->priv_flags & IFF_SWITCH;
> +}
> +EXPORT_SYMBOL(swdev_dev_check);
[...]
> +     BUG_ON(!swdev_dev_check(dev));
[...]
> +int __swdev_register(struct net_device *dev)
> +{
> +     if (dev->priv_flags & IFF_SWITCH) {
> +             netdev_err(dev, "Device is already registered as a switch
> device\n");
> +             return -EBUSY;
> +     }
[...]

1. What's the benefit of requiring and policing the IFF_SWITCH flag, and 
requiring a switch netdev to call swdev_register, as opposed to just checking 
whether the netdev provides the relevant ops?

> +int swdev_register(struct net_device *dev)
> +{
> +     int err;
> +
> +     rtnl_lock();
> +     err = __swdev_register(dev);
> +     rtnl_unlock();
> +     return err;
> +}
> +EXPORT_SYMBOL(swdev_register);

2. Why grab and release the rtnl lock, given that there appears to be nothing 
rtnl-related in between?

Regards,
        Neil

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to