Lines Matching +full:event +full:- +full:tap

1 // SPDX-License-Identifier: GPL-2.0-only
35 const struct net_device *dev = to_net_dev(d->parent); in ipvtap_net_namespace()
47 struct tap_dev tap; member
50 static void ipvtap_count_tx_dropped(struct tap_dev *tap) in ipvtap_count_tx_dropped() argument
52 struct ipvtap_dev *vlantap = container_of(tap, struct ipvtap_dev, tap); in ipvtap_count_tx_dropped()
53 struct ipvl_dev *vlan = &vlantap->vlan; in ipvtap_count_tx_dropped()
55 this_cpu_inc(vlan->pcpu_stats->tx_drps); in ipvtap_count_tx_dropped()
58 static void ipvtap_count_rx_dropped(struct tap_dev *tap) in ipvtap_count_rx_dropped() argument
60 struct ipvtap_dev *vlantap = container_of(tap, struct ipvtap_dev, tap); in ipvtap_count_rx_dropped()
61 struct ipvl_dev *vlan = &vlantap->vlan; in ipvtap_count_rx_dropped()
66 static void ipvtap_update_features(struct tap_dev *tap, in ipvtap_update_features() argument
69 struct ipvtap_dev *vlantap = container_of(tap, struct ipvtap_dev, tap); in ipvtap_update_features()
70 struct ipvl_dev *vlan = &vlantap->vlan; in ipvtap_update_features()
72 vlan->sfeatures = features; in ipvtap_update_features()
73 netdev_update_features(vlan->dev); in ipvtap_update_features()
83 INIT_LIST_HEAD(&vlantap->tap.queue_list); in ipvtap_newlink()
86 * tap support all offloads also. in ipvtap_newlink()
88 vlantap->tap.tap_features = TUN_OFFLOADS; in ipvtap_newlink()
89 vlantap->tap.count_tx_dropped = ipvtap_count_tx_dropped; in ipvtap_newlink()
90 vlantap->tap.update_features = ipvtap_update_features; in ipvtap_newlink()
91 vlantap->tap.count_rx_dropped = ipvtap_count_rx_dropped; in ipvtap_newlink()
93 err = netdev_rx_handler_register(dev, tap_handle_frame, &vlantap->tap); in ipvtap_newlink()
106 vlantap->tap.dev = vlantap->vlan.dev; in ipvtap_newlink()
117 tap_del_queues(&vlan->tap); in ipvtap_dellink()
124 dev->tx_queue_len = TUN_READQ_SIZE; in ipvtap_setup()
125 dev->priv_flags &= ~IFF_NO_QUEUE; in ipvtap_setup()
137 unsigned long event, void *ptr) in ipvtap_device_event() argument
146 if (dev->rtnl_link_ops != &ipvtap_link_ops) in ipvtap_device_event()
149 snprintf(tap_name, IFNAMSIZ, "tap%d", dev->ifindex); in ipvtap_device_event()
152 switch (event) { in ipvtap_device_event()
158 err = tap_get_minor(ipvtap_major, &vlantap->tap); in ipvtap_device_event()
162 devt = MKDEV(MAJOR(ipvtap_major), vlantap->tap.minor); in ipvtap_device_event()
163 classdev = device_create(&ipvtap_class, &dev->dev, devt, in ipvtap_device_event()
166 tap_free_minor(ipvtap_major, &vlantap->tap); in ipvtap_device_event()
169 err = sysfs_create_link(&dev->dev.kobj, &classdev->kobj, in ipvtap_device_event()
175 /* vlan->minor == 0 if NETDEV_REGISTER above failed */ in ipvtap_device_event()
176 if (vlantap->tap.minor == 0) in ipvtap_device_event()
178 sysfs_remove_link(&dev->dev.kobj, tap_name); in ipvtap_device_event()
179 devt = MKDEV(MAJOR(ipvtap_major), vlantap->tap.minor); in ipvtap_device_event()
181 tap_free_minor(ipvtap_major, &vlantap->tap); in ipvtap_device_event()
184 if (tap_queue_resize(&vlantap->tap)) in ipvtap_device_event()
240 MODULE_DESCRIPTION("IP-VLAN based tap driver");