Lines Matching refs:vif
27 struct xenvif *vif; member
46 static void xen_unregister_watchers(struct xenvif *vif);
119 dev_queue = netdev_get_tx_queue(queue->vif->dev, queue->id); in xenvif_read_io_ring()
188 static void xenvif_debugfs_addif(struct xenvif *vif) in xenvif_debugfs_addif() argument
196 vif->xenvif_dbg_root = debugfs_create_dir(vif->dev->name, in xenvif_debugfs_addif()
198 if (!IS_ERR_OR_NULL(vif->xenvif_dbg_root)) { in xenvif_debugfs_addif()
199 for (i = 0; i < vif->num_queues; ++i) { in xenvif_debugfs_addif()
205 vif->xenvif_dbg_root, in xenvif_debugfs_addif()
206 &vif->queues[i], in xenvif_debugfs_addif()
213 netdev_warn(vif->dev, in xenvif_debugfs_addif()
215 PTR_ERR(vif->xenvif_dbg_root)); in xenvif_debugfs_addif()
218 static void xenvif_debugfs_delif(struct xenvif *vif) in xenvif_debugfs_delif() argument
223 if (!IS_ERR_OR_NULL(vif->xenvif_dbg_root)) in xenvif_debugfs_delif()
224 debugfs_remove_recursive(vif->xenvif_dbg_root); in xenvif_debugfs_delif()
225 vif->xenvif_dbg_root = NULL; in xenvif_debugfs_delif()
236 if (be->vif) { in netback_remove()
238 xen_unregister_watchers(be->vif); in netback_remove()
240 xenvif_free(be->vif); in netback_remove()
241 be->vif = NULL; in netback_remove()
402 if (!be->vif) in netback_uevent()
405 return add_uevent_var(env, "vif=%s", be->vif->dev->name); in netback_uevent()
414 struct xenvif *vif; in backend_create_xenvif() local
416 if (be->vif != NULL) in backend_create_xenvif()
425 vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle); in backend_create_xenvif()
426 if (IS_ERR(vif)) { in backend_create_xenvif()
427 err = PTR_ERR(vif); in backend_create_xenvif()
431 be->vif = vif; in backend_create_xenvif()
439 if (be->vif) { in backend_disconnect()
440 xen_unregister_watchers(be->vif); in backend_disconnect()
442 xenvif_debugfs_delif(be->vif); in backend_disconnect()
444 xenvif_disconnect(be->vif); in backend_disconnect()
450 if (be->vif) in backend_connect()
659 struct xenvif *vif = container_of(watch, struct xenvif, credit_watch); in xen_net_rate_changed() local
660 struct xenbus_device *dev = xenvif_to_xenbus_device(vif); in xen_net_rate_changed()
666 for (queue_index = 0; queue_index < vif->num_queues; queue_index++) { in xen_net_rate_changed()
667 struct xenvif_queue *queue = &vif->queues[queue_index]; in xen_net_rate_changed()
678 static int xen_register_watchers(struct xenbus_device *dev, struct xenvif *vif) in xen_register_watchers() argument
684 if (vif->credit_watch.node) in xen_register_watchers()
691 vif->credit_watch.node = node; in xen_register_watchers()
692 vif->credit_watch.callback = xen_net_rate_changed; in xen_register_watchers()
693 err = register_xenbus_watch(&vif->credit_watch); in xen_register_watchers()
695 pr_err("Failed to set watcher %s\n", vif->credit_watch.node); in xen_register_watchers()
697 vif->credit_watch.node = NULL; in xen_register_watchers()
698 vif->credit_watch.callback = NULL; in xen_register_watchers()
703 static void xen_unregister_watchers(struct xenvif *vif) in xen_unregister_watchers() argument
705 if (vif->credit_watch.node) { in xen_unregister_watchers()
706 unregister_xenbus_watch(&vif->credit_watch); in xen_unregister_watchers()
707 kfree(vif->credit_watch.node); in xen_unregister_watchers()
708 vif->credit_watch.node = NULL; in xen_unregister_watchers()
769 err = xen_net_read_mac(dev, be->vif->fe_dev_addr); in connect()
776 xen_unregister_watchers(be->vif); in connect()
777 xen_register_watchers(dev, be->vif); in connect()
781 be->vif->queues = vzalloc(requested_num_queues * in connect()
783 be->vif->num_queues = requested_num_queues; in connect()
784 be->vif->stalled_queues = requested_num_queues; in connect()
787 queue = &be->vif->queues[queue_index]; in connect()
788 queue->vif = be->vif; in connect()
791 be->vif->dev->name, queue->id); in connect()
801 be->vif->num_queues = queue_index; in connect()
816 be->vif->num_queues = queue_index; in connect()
822 xenvif_debugfs_addif(be->vif); in connect()
829 netif_set_real_num_tx_queues(be->vif->dev, requested_num_queues); in connect()
830 netif_set_real_num_rx_queues(be->vif->dev, requested_num_queues); in connect()
833 xenvif_carrier_on(be->vif); in connect()
842 netif_tx_wake_all_queues(be->vif->dev); in connect()
847 if (be->vif->num_queues > 0) in connect()
848 xenvif_disconnect(be->vif); /* Clean up existing queues */ in connect()
849 vfree(be->vif->queues); in connect()
850 be->vif->queues = NULL; in connect()
851 be->vif->num_queues = 0; in connect()
859 unsigned int num_queues = queue->vif->num_queues; in connect_rings()
938 struct xenvif *vif = be->vif; in read_xenbus_vif_flags() local
965 be->vif->drain_timeout = msecs_to_jiffies(30); in read_xenbus_vif_flags()
966 be->vif->stall_timeout = 0; in read_xenbus_vif_flags()
972 vif->can_sg = !!val; in read_xenbus_vif_flags()
974 vif->gso_mask = 0; in read_xenbus_vif_flags()
975 vif->gso_prefix_mask = 0; in read_xenbus_vif_flags()
981 vif->gso_mask |= GSO_BIT(TCPV4); in read_xenbus_vif_flags()
987 vif->gso_prefix_mask |= GSO_BIT(TCPV4); in read_xenbus_vif_flags()
993 vif->gso_mask |= GSO_BIT(TCPV6); in read_xenbus_vif_flags()
999 vif->gso_prefix_mask |= GSO_BIT(TCPV6); in read_xenbus_vif_flags()
1001 if (vif->gso_mask & vif->gso_prefix_mask) { in read_xenbus_vif_flags()
1012 vif->ip_csum = !val; in read_xenbus_vif_flags()
1017 vif->ipv6_csum = !!val; in read_xenbus_vif_flags()