Lines Matching defs:mdev

134 	struct mpls_dev *mdev;
137 mdev = mpls_dev_get(dev);
138 if (mdev)
139 MPLS_INC_STATS_LEN(mdev, skb->len,
351 struct mpls_dev *mdev;
359 mdev = mpls_dev_get(dev);
360 if (!mdev)
363 MPLS_INC_STATS_LEN(mdev, skb->len, rx_packets,
366 if (!mdev->input_enabled) {
367 MPLS_INC_STATS(mdev, rx_dropped);
386 MPLS_INC_STATS(mdev, rx_noroute);
471 MPLS_INC_STATS(mdev, rx_errors);
1067 static void mpls_get_stats(struct mpls_dev *mdev,
1079 p = per_cpu_ptr(mdev->stats, i);
1101 struct mpls_dev *mdev;
1104 mdev = mpls_dev_get(dev);
1105 if (!mdev)
1115 mpls_get_stats(mdev, stats);
1122 struct mpls_dev *mdev;
1124 mdev = mpls_dev_get(dev);
1125 if (!mdev)
1131 static int mpls_netconf_fill_devconf(struct sk_buff *skb, struct mpls_dev *mdev,
1150 if (nla_put_s32(skb, NETCONFA_IFINDEX, mdev->dev->ifindex) < 0)
1155 mdev->input_enabled) < 0)
1182 int type, struct mpls_dev *mdev)
1191 err = mpls_netconf_fill_devconf(skb, mdev, 0, 0, event, 0, type);
1257 struct mpls_dev *mdev;
1275 mdev = mpls_dev_get(dev);
1276 if (!mdev)
1284 err = mpls_netconf_fill_devconf(skb, mdev,
1306 struct mpls_dev *mdev;
1336 mdev = mpls_dev_get(dev);
1337 if (!mdev)
1339 if (mpls_netconf_fill_devconf(skb, mdev,
1371 struct mpls_dev *mdev = ctl->extra1;
1372 int i = (int *)ctl->data - (int *)mdev;
1379 NETCONFA_INPUT, mdev);
1398 struct mpls_dev *mdev)
1410 * the mdev at this point, so make them absolute.
1413 table[i].data = (char *)mdev + (uintptr_t)table[i].data;
1414 table[i].extra1 = mdev;
1420 mdev->sysctl = register_net_sysctl(net, path, table);
1421 if (!mdev->sysctl)
1424 mpls_netconf_notify_devconf(net, RTM_NEWNETCONF, NETCONFA_ALL, mdev);
1430 mdev->sysctl = NULL;
1435 struct mpls_dev *mdev)
1440 if (!mdev->sysctl)
1443 table = mdev->sysctl->ctl_table_arg;
1444 unregister_net_sysctl_table(mdev->sysctl);
1447 mpls_netconf_notify_devconf(net, RTM_DELNETCONF, 0, mdev);
1452 struct mpls_dev *mdev;
1458 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
1459 if (!mdev)
1462 mdev->stats = alloc_percpu(struct mpls_pcpu_stats);
1463 if (!mdev->stats)
1469 mpls_stats = per_cpu_ptr(mdev->stats, i);
1473 mdev->dev = dev;
1475 err = mpls_dev_sysctl_register(dev, mdev);
1479 rcu_assign_pointer(dev->mpls_ptr, mdev);
1481 return mdev;
1484 free_percpu(mdev->stats);
1485 kfree(mdev);
1491 struct mpls_dev *mdev = container_of(head, struct mpls_dev, rcu);
1493 free_percpu(mdev->stats);
1494 kfree(mdev);
1616 struct mpls_dev *mdev;
1620 mdev = mpls_add_dev(dev);
1621 if (IS_ERR(mdev))
1622 return notifier_from_errno(PTR_ERR(mdev));
1627 mdev = mpls_dev_get(dev);
1628 if (!mdev)
1660 mdev = mpls_dev_get(dev);
1661 if (mdev) {
1662 mpls_dev_sysctl_unregister(dev, mdev);
1664 call_rcu(&mdev->rcu, mpls_dev_destroy_rcu);
1668 mdev = mpls_dev_get(dev);
1669 if (mdev) {
1670 mpls_dev_sysctl_unregister(dev, mdev);
1671 err = mpls_dev_sysctl_register(dev, mdev);
2695 * the mdev at this point, so make them absolute.