Lines Matching refs:vdpasim

55 static bool receive_filter(struct vdpasim *vdpasim, size_t len)  in receive_filter()  argument
57 bool modern = vdpasim->features & (1ULL << VIRTIO_F_VERSION_1); in receive_filter()
60 struct virtio_net_config *vio_config = vdpasim->config; in receive_filter()
65 if (!strncmp(vdpasim->buffer + hdr_len, vio_config->mac, ETH_ALEN)) in receive_filter()
71 static virtio_net_ctrl_ack vdpasim_handle_ctrl_mac(struct vdpasim *vdpasim, in vdpasim_handle_ctrl_mac() argument
74 struct virtio_net_config *vio_config = vdpasim->config; in vdpasim_handle_ctrl_mac()
75 struct vdpasim_virtqueue *cvq = &vdpasim->vqs[2]; in vdpasim_handle_ctrl_mac()
93 static void vdpasim_handle_cvq(struct vdpasim *vdpasim) in vdpasim_handle_cvq() argument
95 struct vdpasim_virtqueue *cvq = &vdpasim->vqs[2]; in vdpasim_handle_cvq()
101 if (!(vdpasim->features & (1ULL << VIRTIO_NET_F_CTRL_VQ))) in vdpasim_handle_cvq()
121 status = vdpasim_handle_ctrl_mac(vdpasim, ctrl.cmd); in vdpasim_handle_cvq()
148 struct vdpasim *vdpasim = container_of(work, struct vdpasim, work); in vdpasim_net_work() local
149 struct vdpasim_virtqueue *txq = &vdpasim->vqs[1]; in vdpasim_net_work()
150 struct vdpasim_virtqueue *rxq = &vdpasim->vqs[0]; in vdpasim_net_work()
155 spin_lock(&vdpasim->lock); in vdpasim_net_work()
157 if (!(vdpasim->status & VIRTIO_CONFIG_S_DRIVER_OK)) in vdpasim_net_work()
160 vdpasim_handle_cvq(vdpasim); in vdpasim_net_work()
172 vdpasim->buffer, in vdpasim_net_work()
175 if (!receive_filter(vdpasim, read)) { in vdpasim_net_work()
188 vdpasim->buffer, read); in vdpasim_net_work()
196 schedule_work(&vdpasim->work); in vdpasim_net_work()
202 spin_unlock(&vdpasim->lock); in vdpasim_net_work()
205 static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config) in vdpasim_net_get_config() argument
209 net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); in vdpasim_net_get_config()
212 static void vdpasim_net_setup_config(struct vdpasim *vdpasim, in vdpasim_net_setup_config() argument
215 struct virtio_net_config *vio_config = vdpasim->config; in vdpasim_net_setup_config()
220 vio_config->mtu = cpu_to_vdpasim16(vdpasim, config->net.mtu); in vdpasim_net_setup_config()
223 vio_config->mtu = cpu_to_vdpasim16(vdpasim, 1500); in vdpasim_net_setup_config()
239 struct vdpasim *simdev; in vdpasim_net_dev_add()
274 struct vdpasim *simdev = container_of(dev, struct vdpasim, vdpa); in vdpasim_net_dev_del()