/qemu/net/ |
H A D | net.c | 389 nc->info->cleanup(nc); in qemu_cleanup_net_client() 404 nc->destructor(nc); in qemu_free_net_client() 499 if (!nc || !nc->info->has_ufo) { in qemu_has_ufo() 503 return nc->info->has_ufo(nc); in qemu_has_ufo() 508 if (!nc || !nc->info->has_uso) { in qemu_has_uso() 512 return nc->info->has_uso(nc); in qemu_has_uso() 521 return nc->info->has_vnet_hdr(nc); in qemu_has_vnet_hdr() 536 if (!nc || !nc->info->set_offload) { in qemu_set_offload() 563 nc->info->set_vnet_hdr_len(nc, len); in qemu_set_vnet_hdr_len() 569 if (!nc || !nc->info->set_vnet_le) { in qemu_set_vnet_le() [all …]
|
H A D | hub.c | 33 NetClientState nc; member 96 NetHubPort *src_port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_port_can_receive() 115 NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_port_receive() 123 NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_port_receive_iov() 130 NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_port_cleanup() 159 port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_port_new() 193 return &port->nc; in net_hub_add_port() 228 port = DO_UPCAST(NetHubPort, nc, nc); in net_hub_id_for_client() 229 } else if (nc->peer != NULL && nc->peer->info->type == in net_hub_id_for_client() 231 port = DO_UPCAST(NetHubPort, nc, nc->peer); in net_hub_id_for_client() [all …]
|
H A D | vhost-user.c | 25 NetClientState nc; member 36 NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); in vhost_user_get_vhost_net() 43 NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); in vhost_user_get_acked_features() 52 s = DO_UPCAST(NetVhostUserState, nc, nc); in vhost_user_save_acked_features() 139 NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); in vhost_user_receive() 162 NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); in net_vhost_user_cleanup() 169 if (nc->queue_index == 0) { in net_vhost_user_cleanup() 350 nc->queue_index = i; in net_vhost_user_init() 352 nc0 = nc; in net_vhost_user_init() 353 s = DO_UPCAST(NetVhostUserState, nc, nc); in net_vhost_user_init() [all …]
|
H A D | tap.c | 119 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_receive_iov() 155 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_send_completed() 210 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_has_ufo() 219 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_has_uso() 228 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_has_vnet_hdr() 242 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_set_vnet_hdr_len() 253 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_set_vnet_le() 260 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_set_vnet_be() 268 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_set_offload() 291 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_cleanup() [all …]
|
H A D | netmap.c | 43 NetClientState nc; member 135 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_poll() 160 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_receive_iov() 243 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_send_completed() 301 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_cleanup() 305 netmap_poll(nc, false); in netmap_cleanup() 329 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_has_vnet_hdr_len() 356 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_set_vnet_hdr_len() 372 NetmapState *s = DO_UPCAST(NetmapState, nc, nc); in netmap_set_offload() 405 NetClientState *nc; in net_init_netmap() local [all …]
|
H A D | stream.c | 46 NetClientState nc; member 80 NetStreamState *s = DO_UPCAST(NetStreamState, nc, nc); in net_stream_receive() 122 NetStreamState *s = DO_UPCAST(NetStreamState, nc, nc); in net_stream_send_completed() 196 NetStreamState *s = DO_UPCAST(NetStreamState, nc, nc); in net_stream_cleanup() 251 s->nc.link_down = false; in net_stream_listen() 294 s->nc.link_down = true; in net_stream_server_listening() 309 NetClientState *nc; in net_stream_server_init() local 314 s = DO_UPCAST(NetStreamState, nc, nc); in net_stream_server_init() 404 NetClientState *nc; in net_stream_client_init() local 408 s = DO_UPCAST(NetStreamState, nc, nc); in net_stream_client_init() [all …]
|
H A D | vde.c | 35 NetClientState nc; member 47 qemu_send_packet(&s->nc, buf, size); in vde_to_qemu() 51 static ssize_t vde_receive(NetClientState *nc, const uint8_t *buf, size_t size) in vde_receive() argument 53 VDEState *s = DO_UPCAST(VDEState, nc, nc); in vde_receive() 63 static void vde_cleanup(NetClientState *nc) in vde_cleanup() argument 65 VDEState *s = DO_UPCAST(VDEState, nc, nc); in vde_cleanup() 81 NetClientState *nc; in net_vde_init() local 99 nc = qemu_new_net_client(&net_vde_info, peer, model, name); in net_vde_init() 101 qemu_set_info_str(nc, "sock=%s,fd=%d", sock, vde_datafd(vde)); in net_vde_init() 103 s = DO_UPCAST(VDEState, nc, nc); in net_vde_init()
|
H A D | socket.c | 37 NetClientState nc; member 82 NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_receive() 117 NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_receive_dgram() 137 NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_send_completed() 308 NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_cleanup() 338 NetClientState *nc; in net_socket_fd_init_dgram() local 377 s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_fd_init_dgram() 425 NetClientState *nc; in net_socket_fd_init_stream() local 432 s = DO_UPCAST(NetSocketState, nc, nc); in net_socket_fd_init_stream() 497 NetClientState *nc; in net_socket_listen_init() local [all …]
|
H A D | af-xdp.c | 33 NetClientState nc; member 91 AFXDPState *s = DO_UPCAST(AFXDPState, nc, nc); in af_xdp_poll() 145 AFXDPState *s = DO_UPCAST(AFXDPState, nc, nc); in af_xdp_receive() 190 AFXDPState *s = DO_UPCAST(AFXDPState, nc, nc); in af_xdp_send_completed() 263 AFXDPState *s = DO_UPCAST(AFXDPState, nc, nc); in af_xdp_cleanup() 265 qemu_purge_queued_packets(nc); in af_xdp_cleanup() 267 af_xdp_poll(nc, false); in af_xdp_cleanup() 357 queue_id = s->nc.queue_index; in af_xdp_socket_create() 483 nc->queue_index = i; in net_init_af_xdp() 486 nc0 = nc; in net_init_af_xdp() [all …]
|
H A D | dgram.c | 40 NetClientState nc; member 79 qemu_flush_queued_packets(&s->nc); in net_dgram_writable() 85 NetDgramState *s = DO_UPCAST(NetDgramState, nc, nc); in net_dgram_receive() 105 NetDgramState *s = DO_UPCAST(NetDgramState, nc, nc); in net_dgram_send_completed() 116 if (qemu_send_packet_async(&s->nc, rs->buf, in net_dgram_rs_finalize() 238 static void net_dgram_cleanup(NetClientState *nc) in net_dgram_cleanup() argument 240 NetDgramState *s = DO_UPCAST(NetDgramState, nc, nc); in net_dgram_cleanup() 265 NetClientState *nc; in net_dgram_fd_init() local 270 s = DO_UPCAST(NetDgramState, nc, nc); in net_dgram_fd_init() 396 qemu_set_info_str(&s->nc, "mcast=%s:%d", in net_dgram_mcast_init() [all …]
|
H A D | vhost-vdpa.c | 137 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_get_vhost_net() 225 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_cleanup() 265 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_has_ufo() 373 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_data_start() 395 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_data_load() 414 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_client_stop() 547 s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_cvq_start() 627 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_cvq_stop() 1238 VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); in vhost_vdpa_net_cvq_load() 1705 s = DO_UPCAST(VhostVDPAState, nc, nc); in net_vhost_vdpa_init() [all …]
|
H A D | l2tpv3.c | 61 NetClientState nc; member 171 NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); in l2tpv3_send_completed() 177 NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); in l2tpv3_poll() 220 NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); in net_l2tpv3_receive_dgram_iov() 266 NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); in net_l2tpv3_receive_dgram() 366 &s->nc, in net_l2tpv3_process_queue() 498 NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); in net_l2tpv3_cleanup() 499 qemu_purge_queued_packets(nc); in net_l2tpv3_cleanup() 526 NetClientState *nc; in net_init_l2tpv3() local 534 s = DO_UPCAST(NetL2TPV3State, nc, nc); in net_init_l2tpv3() [all …]
|
H A D | vmnet-common.m | 68 ssize_t vmnet_receive_common(NetClientState *nc, 72 VmnetState *s = DO_UPCAST(VmnetState, nc, nc); 151 ssize_t size = qemu_send_packet_async(&s->nc, 190 NetClientState *nc = (NetClientState *) opaque; 191 VmnetState *s = DO_UPCAST(VmnetState, nc, nc); 215 VmnetState *s = DO_UPCAST(VmnetState, nc, nc); 273 int vmnet_if_create(NetClientState *nc, 277 VmnetState *s = DO_UPCAST(VmnetState, nc, nc); 367 void vmnet_cleanup_common(NetClientState *nc) 369 VmnetState *s = DO_UPCAST(VmnetState, nc, nc); [all …]
|
H A D | tap-win32.c | 660 NetClientState nc; member 664 static void tap_cleanup(NetClientState *nc) in tap_cleanup() argument 666 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_cleanup() 677 TAPState *s = DO_UPCAST(TAPState, nc, nc); in tap_receive() 695 if (net_peer_needs_padding(&s->nc)) { in tap_win32_send() 702 qemu_send_packet(&s->nc, buf, size); in tap_win32_send() 707 struct vhost_net *tap_get_vhost_net(NetClientState *nc) in tap_get_vhost_net() argument 722 NetClientState *nc; in tap_win32_init() local 733 s = DO_UPCAST(TAPState, nc, nc); in tap_win32_init() 765 int tap_enable(NetClientState *nc) in tap_enable() argument [all …]
|
H A D | vmnet_int.h | 33 NetClientState nc; member 54 int vmnet_if_create(NetClientState *nc, 58 ssize_t vmnet_receive_common(NetClientState *nc, 62 void vmnet_cleanup_common(NetClientState *nc);
|
H A D | net-hmp-cmds.c | 32 NetClientState *nc, *peer; in hmp_info_network() local 37 QTAILQ_FOREACH(nc, &net_clients, next) { in hmp_info_network() 38 peer = nc->peer; in hmp_info_network() 39 type = nc->info->type; in hmp_info_network() 42 if (net_hub_id_for_client(nc, NULL) == 0) { in hmp_info_network() 47 print_net_client(mon, nc); in hmp_info_network()
|
/qemu/include/net/ |
H A D | net.h | 162 NICState *qemu_get_nic(NetClientState *nc); 163 void *qemu_get_nic_opaque(NetClientState *nc); 164 void qemu_del_net_client(NetClientState *nc); 167 int qemu_can_receive_packet(NetClientState *nc); 168 int qemu_can_send_packet(NetClientState *nc); 181 void qemu_set_info_str(NetClientState *nc, 184 bool qemu_has_ufo(NetClientState *nc); 185 bool qemu_has_uso(NetClientState *nc); 186 bool qemu_has_vnet_hdr(NetClientState *nc); 190 int qemu_get_vnet_hdr_len(NetClientState *nc); [all …]
|
H A D | tap.h | 31 int tap_enable(NetClientState *nc); 32 int tap_disable(NetClientState *nc); 34 int tap_get_fd(NetClientState *nc); 37 struct vhost_net *tap_get_vhost_net(NetClientState *nc);
|
H A D | vhost_net.h | 42 VHostNetState *get_vhost_net(NetClientState *nc); 44 int vhost_set_vring_enable(NetClientState * nc, int enable); 50 void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc, 52 int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, 55 void vhost_net_save_acked_features(NetClientState *nc);
|
/qemu/hw/net/ |
H A D | vhost_net.c | 398 r = net->nc->info->start(net->nc); in vhost_net_start_one() 409 if (net->nc->info->poll) { in vhost_net_start_one() 410 net->nc->info->poll(net->nc, false); in vhost_net_start_one() 430 if (net->nc->info->load) { in vhost_net_start_one() 431 r = net->nc->info->load(net->nc); in vhost_net_start_one() 450 if (net->nc->info->poll) { in vhost_net_start_one() 451 net->nc->info->poll(net->nc, true); in vhost_net_start_one() 470 net->nc->info->poll(net->nc, true); in vhost_net_stop_one() 474 net->nc->info->stop(net->nc); in vhost_net_stop_one() 643 if (!nc) { in get_vhost_net() [all …]
|
H A D | virtio-net.c | 129 if (!nc->peer) { in flush_or_purge_queued_packets() 168 if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) { in virtio_net_get_config() 211 if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) { in virtio_net_set_config() 565 if (!nc->peer) { in virtio_net_queue_reset() 607 if (!nc->peer) { in peer_test_vnet_hdr() 694 if (!nc->peer) { in peer_attach() 717 if (!nc->peer) { in peer_detach() 1240 if (nc == NULL || nc->info->set_steering_ebpf == NULL) { in virtio_net_attach_ebpf_to_backend() 1245 return nc->info->set_steering_ebpf(nc, prog_fd); in virtio_net_attach_ebpf_to_backend() 2170 seg->nc = nc; in virtio_net_rsc_cache_buf() [all …]
|
H A D | allwinner_emac.c | 101 NetClientState *nc; in RTL8201CP_mdio_write() local 107 nc = qemu_get_queue(s->nic); in RTL8201CP_mdio_write() 108 mii_reset(mii, !nc->link_down); in RTL8201CP_mdio_write() 183 AwEmacState *s = qemu_get_nic_opaque(nc); in aw_emac_can_receive() 195 AwEmacState *s = qemu_get_nic_opaque(nc); in aw_emac_receive() 244 mii_reset(&s->mii, !nc->link_down); in aw_emac_reset() 251 NetClientState *nc; in aw_emac_read() local 287 nc = qemu_get_queue(s->nic); in aw_emac_read() 329 if (aw_emac_can_receive(nc)) { in aw_emac_write() 330 qemu_flush_queued_packets(nc); in aw_emac_write() [all …]
|
H A D | vhost_net-stub.c | 99 VHostNetState *get_vhost_net(NetClientState *nc) in get_vhost_net() argument 104 int vhost_set_vring_enable(NetClientState *nc, int enable) in vhost_set_vring_enable() argument 114 void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc, in vhost_net_virtqueue_reset() argument 120 int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, in vhost_net_virtqueue_restart() argument 126 void vhost_net_save_acked_features(NetClientState *nc) in vhost_net_save_acked_features() argument
|
H A D | igb.c | 225 igb_nc_can_receive(NetClientState *nc) in igb_nc_can_receive() argument 227 IGBState *s = qemu_get_nic_opaque(nc); in igb_nc_can_receive() 234 IGBState *s = qemu_get_nic_opaque(nc); in igb_nc_receive_iov() 239 igb_nc_receive(NetClientState *nc, const uint8_t *buf, size_t size) in igb_nc_receive() argument 241 IGBState *s = qemu_get_nic_opaque(nc); in igb_nc_receive() 246 igb_set_link_status(NetClientState *nc) in igb_set_link_status() argument 248 IGBState *s = qemu_get_nic_opaque(nc); in igb_set_link_status() 324 NetClientState *nc; in igb_init_net_peer() local 339 nc = qemu_get_subqueue(s->nic, i); in igb_init_net_peer() 340 if (!nc->peer || !qemu_has_vnet_hdr(nc->peer)) { in igb_init_net_peer() [all …]
|
/qemu/hw/net/rocker/ |
H A D | rocker_fp.c | 122 NetClientState *nc = qemu_get_queue(port->nic); in fp_port_eg() local 125 qemu_sendv_packet(nc, iov, iovcnt); in fp_port_eg() 134 FpPort *port = qemu_get_nic_opaque(nc); in fp_port_receive_iov() 157 return fp_port_receive_iov(nc, &iov, 1); in fp_port_receive() 160 static void fp_port_cleanup(NetClientState *nc) in fp_port_cleanup() argument 164 static void fp_port_set_link_status(NetClientState *nc) in fp_port_set_link_status() argument 166 FpPort *port = qemu_get_nic_opaque(nc); in fp_port_set_link_status() 203 NetClientState *nc = qemu_get_queue(port->nic); in fp_port_set_link() local 205 if (up == nc->link_down) { in fp_port_set_link() 206 nc->link_down = !up; in fp_port_set_link() [all …]
|