Lines Matching refs:vif

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