Lines Matching full:vif
19 static void xen_unregister_watchers(struct xenvif *vif);
92 dev_queue = netdev_get_tx_queue(queue->vif->dev, queue->id); in xenvif_read_io_ring()
163 struct xenvif *vif = m->private; in xenvif_ctrl_show() local
165 xenvif_dump_hash_info(vif, m); in xenvif_ctrl_show()
171 static void xenvif_debugfs_addif(struct xenvif *vif) in xenvif_debugfs_addif() argument
175 vif->xenvif_dbg_root = debugfs_create_dir(vif->dev->name, in xenvif_debugfs_addif()
177 for (i = 0; i < vif->num_queues; ++i) { in xenvif_debugfs_addif()
181 debugfs_create_file(filename, 0600, vif->xenvif_dbg_root, in xenvif_debugfs_addif()
182 &vif->queues[i], in xenvif_debugfs_addif()
186 if (vif->ctrl_irq) in xenvif_debugfs_addif()
187 debugfs_create_file("ctrl", 0400, vif->xenvif_dbg_root, vif, in xenvif_debugfs_addif()
191 static void xenvif_debugfs_delif(struct xenvif *vif) in xenvif_debugfs_delif() argument
193 debugfs_remove_recursive(vif->xenvif_dbg_root); in xenvif_debugfs_delif()
194 vif->xenvif_dbg_root = NULL; in xenvif_debugfs_delif()
200 * and vif variables to the environment, for the benefit of the vif-* hotplug
214 if (!be->vif) in netback_uevent()
217 return add_uevent_var(env, "vif=%s", be->vif->dev->name); in netback_uevent()
226 struct xenvif *vif; in backend_create_xenvif() local
228 if (be->vif != NULL) in backend_create_xenvif()
237 vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle); in backend_create_xenvif()
238 if (IS_ERR(vif)) { in backend_create_xenvif()
239 err = PTR_ERR(vif); in backend_create_xenvif()
243 be->vif = vif; in backend_create_xenvif()
244 vif->be = be; in backend_create_xenvif()
252 struct xenvif *vif = be->vif; in backend_disconnect() local
254 if (vif) { in backend_disconnect()
255 unsigned int num_queues = vif->num_queues; in backend_disconnect()
258 xen_unregister_watchers(vif); in backend_disconnect()
260 xenvif_debugfs_delif(vif); in backend_disconnect()
262 xenvif_disconnect_data(vif); in backend_disconnect()
267 vif->num_queues = 0; in backend_disconnect()
271 xenvif_deinit_queue(&vif->queues[queue_index]); in backend_disconnect()
273 vfree(vif->queues); in backend_disconnect()
274 vif->queues = NULL; in backend_disconnect()
276 xenvif_disconnect_ctrl(vif); in backend_disconnect()
282 if (be->vif) in backend_connect()
399 struct xenvif *vif = be->vif; in read_xenbus_frontend_xdp() local
406 vif->xdp_headroom = 0; in read_xenbus_frontend_xdp()
411 vif->xdp_headroom = headroom; in read_xenbus_frontend_xdp()
526 struct xenvif *vif = container_of(watch, struct xenvif, credit_watch); in xen_net_rate_changed() local
527 struct xenbus_device *dev = xenvif_to_xenbus_device(vif); in xen_net_rate_changed()
533 for (queue_index = 0; queue_index < vif->num_queues; queue_index++) { in xen_net_rate_changed()
534 struct xenvif_queue *queue = &vif->queues[queue_index]; in xen_net_rate_changed()
546 struct xenvif *vif) in xen_register_credit_watch() argument
552 if (vif->credit_watch.node) in xen_register_credit_watch()
559 vif->credit_watch.node = node; in xen_register_credit_watch()
560 vif->credit_watch.will_handle = NULL; in xen_register_credit_watch()
561 vif->credit_watch.callback = xen_net_rate_changed; in xen_register_credit_watch()
562 err = register_xenbus_watch(&vif->credit_watch); in xen_register_credit_watch()
564 pr_err("Failed to set watcher %s\n", vif->credit_watch.node); in xen_register_credit_watch()
566 vif->credit_watch.node = NULL; in xen_register_credit_watch()
567 vif->credit_watch.will_handle = NULL; in xen_register_credit_watch()
568 vif->credit_watch.callback = NULL; in xen_register_credit_watch()
573 static void xen_unregister_credit_watch(struct xenvif *vif) in xen_unregister_credit_watch() argument
575 if (vif->credit_watch.node) { in xen_unregister_credit_watch()
576 unregister_xenbus_watch(&vif->credit_watch); in xen_unregister_credit_watch()
577 kfree(vif->credit_watch.node); in xen_unregister_credit_watch()
578 vif->credit_watch.node = NULL; in xen_unregister_credit_watch()
585 struct xenvif *vif = container_of(watch, struct xenvif, in xen_mcast_ctrl_changed() local
587 struct xenbus_device *dev = xenvif_to_xenbus_device(vif); in xen_mcast_ctrl_changed()
589 vif->multicast_control = !!xenbus_read_unsigned(dev->otherend, in xen_mcast_ctrl_changed()
594 struct xenvif *vif) in xen_register_mcast_ctrl_watch() argument
601 if (vif->mcast_ctrl_watch.node) { in xen_register_mcast_ctrl_watch()
613 vif->mcast_ctrl_watch.node = node; in xen_register_mcast_ctrl_watch()
614 vif->mcast_ctrl_watch.will_handle = NULL; in xen_register_mcast_ctrl_watch()
615 vif->mcast_ctrl_watch.callback = xen_mcast_ctrl_changed; in xen_register_mcast_ctrl_watch()
616 err = register_xenbus_watch(&vif->mcast_ctrl_watch); in xen_register_mcast_ctrl_watch()
619 vif->mcast_ctrl_watch.node); in xen_register_mcast_ctrl_watch()
621 vif->mcast_ctrl_watch.node = NULL; in xen_register_mcast_ctrl_watch()
622 vif->mcast_ctrl_watch.will_handle = NULL; in xen_register_mcast_ctrl_watch()
623 vif->mcast_ctrl_watch.callback = NULL; in xen_register_mcast_ctrl_watch()
628 static void xen_unregister_mcast_ctrl_watch(struct xenvif *vif) in xen_unregister_mcast_ctrl_watch() argument
630 if (vif->mcast_ctrl_watch.node) { in xen_unregister_mcast_ctrl_watch()
631 unregister_xenbus_watch(&vif->mcast_ctrl_watch); in xen_unregister_mcast_ctrl_watch()
632 kfree(vif->mcast_ctrl_watch.node); in xen_unregister_mcast_ctrl_watch()
633 vif->mcast_ctrl_watch.node = NULL; in xen_unregister_mcast_ctrl_watch()
638 struct xenvif *vif) in xen_register_watchers() argument
640 xen_register_credit_watch(dev, vif); in xen_register_watchers()
641 xen_register_mcast_ctrl_watch(dev, vif); in xen_register_watchers()
644 static void xen_unregister_watchers(struct xenvif *vif) in xen_unregister_watchers() argument
646 xen_unregister_mcast_ctrl_watch(vif); in xen_unregister_watchers()
647 xen_unregister_credit_watch(vif); in xen_unregister_watchers()
685 struct xenvif *vif = be->vif; in connect_ctrl_ring() local
709 err = xenvif_connect_ctrl(vif, ring_ref, evtchn); in connect_ctrl_ring()
746 err = xen_net_read_mac(dev, be->vif->fe_dev_addr); in connect()
753 xen_unregister_watchers(be->vif); in connect()
754 xen_register_watchers(dev, be->vif); in connect()
764 be->vif->queues = vzalloc(array_size(requested_num_queues, in connect()
766 if (!be->vif->queues) { in connect()
772 be->vif->num_queues = requested_num_queues; in connect()
773 be->vif->stalled_queues = requested_num_queues; in connect()
776 queue = &be->vif->queues[queue_index]; in connect()
777 queue->vif = be->vif; in connect()
780 be->vif->dev->name, queue->id); in connect()
790 be->vif->num_queues = queue_index; in connect()
806 be->vif->num_queues = queue_index; in connect()
812 xenvif_debugfs_addif(be->vif); in connect()
819 netif_set_real_num_tx_queues(be->vif->dev, requested_num_queues); in connect()
820 netif_set_real_num_rx_queues(be->vif->dev, requested_num_queues); in connect()
823 xenvif_carrier_on(be->vif); in connect()
832 netif_tx_wake_all_queues(be->vif->dev); in connect()
837 if (be->vif->num_queues > 0) in connect()
838 xenvif_disconnect_data(be->vif); /* Clean up existing queues */ in connect()
839 for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index) in connect()
840 xenvif_deinit_queue(&be->vif->queues[queue_index]); in connect()
841 vfree(be->vif->queues); in connect()
842 be->vif->queues = NULL; in connect()
843 be->vif->num_queues = 0; in connect()
844 xenvif_disconnect_ctrl(be->vif); in connect()
853 unsigned int num_queues = queue->vif->num_queues; in connect_data_rings()
931 struct xenvif *vif = be->vif; in read_xenbus_vif_flags() local
955 be->vif->drain_timeout = msecs_to_jiffies(30); in read_xenbus_vif_flags()
956 be->vif->stall_timeout = 0; in read_xenbus_vif_flags()
959 vif->can_sg = !!xenbus_read_unsigned(dev->otherend, "feature-sg", 0); in read_xenbus_vif_flags()
961 vif->gso_mask = 0; in read_xenbus_vif_flags()
964 vif->gso_mask |= GSO_BIT(TCPV4); in read_xenbus_vif_flags()
967 vif->gso_mask |= GSO_BIT(TCPV6); in read_xenbus_vif_flags()
969 vif->ip_csum = !xenbus_read_unsigned(dev->otherend, in read_xenbus_vif_flags()
972 vif->ipv6_csum = !!xenbus_read_unsigned(dev->otherend, in read_xenbus_vif_flags()
986 if (be->vif) { in netback_remove()
989 xenvif_free(be->vif); in netback_remove()
990 be->vif = NULL; in netback_remove()
1158 { "vif" },