return 0;
}
+int tap_probe_has_ufo(int fd)
+{
+ return 0;
+}
+
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{
return 0;
}
+int tap_probe_has_ufo(int fd)
+{
+ return 0;
+}
+
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{
return ifr.ifr_flags & IFF_VNET_HDR;
}
+int tap_probe_has_ufo(int fd)
+{
+ unsigned offload;
+
+ offload = TUN_F_CSUM | TUN_F_UFO;
+
+ if (ioctl(fd, TUNSETOFFLOAD, offload) < 0)
+ return 0;
+
+ return 1;
+}
+
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{
return 0;
}
+int tap_probe_has_ufo(int fd)
+{
+ return 0;
+}
+
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{
int vnet_hdr)
{
TAPState *s;
- unsigned int offload;
s = qemu_mallocz(sizeof(TAPState));
s->fd = fd;
vlan, NULL, model, name, NULL,
tap_receive, tap_receive_raw,
tap_receive_iov, tap_cleanup, s);
- s->has_ufo = 0;
- /* Check if tap supports UFO */
- offload = TUN_F_CSUM | TUN_F_UFO;
- if (ioctl(s->fd, TUNSETOFFLOAD, offload) == 0)
- s->has_ufo = 1;
+ s->has_ufo = tap_probe_has_ufo(s->fd);
tap_set_offload(s->vc, 0, 0, 0, 0, 0);
tap_read_poll(s, 1);
return s;
int tap_set_sndbuf(int fd, QemuOpts *opts);
int tap_probe_vnet_hdr(int fd);
+int tap_probe_has_ufo(int fd);
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
#endif /* QEMU_NET_TAP_H */