aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport-internal_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/vport-internal_dev.c')
-rw-r--r--net/openvswitch/vport-internal_dev.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 84516126e5f3..10dc07e1678b 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -36,6 +36,8 @@ struct internal_dev {
36 struct vport *vport; 36 struct vport *vport;
37}; 37};
38 38
39static struct vport_ops ovs_internal_vport_ops;
40
39static struct internal_dev *internal_dev_priv(struct net_device *netdev) 41static struct internal_dev *internal_dev_priv(struct net_device *netdev)
40{ 42{
41 return netdev_priv(netdev); 43 return netdev_priv(netdev);
@@ -238,7 +240,7 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
238 return len; 240 return len;
239} 241}
240 242
241const struct vport_ops ovs_internal_vport_ops = { 243static struct vport_ops ovs_internal_vport_ops = {
242 .type = OVS_VPORT_TYPE_INTERNAL, 244 .type = OVS_VPORT_TYPE_INTERNAL,
243 .create = internal_dev_create, 245 .create = internal_dev_create,
244 .destroy = internal_dev_destroy, 246 .destroy = internal_dev_destroy,
@@ -261,10 +263,21 @@ struct vport *ovs_internal_dev_get_vport(struct net_device *netdev)
261 263
262int ovs_internal_dev_rtnl_link_register(void) 264int ovs_internal_dev_rtnl_link_register(void)
263{ 265{
264 return rtnl_link_register(&internal_dev_link_ops); 266 int err;
267
268 err = rtnl_link_register(&internal_dev_link_ops);
269 if (err < 0)
270 return err;
271
272 err = ovs_vport_ops_register(&ovs_internal_vport_ops);
273 if (err < 0)
274 rtnl_link_unregister(&internal_dev_link_ops);
275
276 return err;
265} 277}
266 278
267void ovs_internal_dev_rtnl_link_unregister(void) 279void ovs_internal_dev_rtnl_link_unregister(void)
268{ 280{
281 ovs_vport_ops_unregister(&ovs_internal_vport_ops);
269 rtnl_link_unregister(&internal_dev_link_ops); 282 rtnl_link_unregister(&internal_dev_link_ops);
270} 283}