mirror of https://github.com/xemu-project/xemu.git
tap: Remove tap_probe_vnet_hdr_len()
It was necessary since an Linux older than 2.6.35 may implement the virtio-net header but may not allow to change its length. Remove it since such an old Linux is no longer supported. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
3ab42e46ac
commit
52a7ff5269
|
@ -217,11 +217,6 @@ int tap_probe_has_uso(int fd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tap_probe_vnet_hdr_len(int fd, int len)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,26 +185,6 @@ int tap_probe_has_uso(int fd)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify that we can assign given length */
|
|
||||||
int tap_probe_vnet_hdr_len(int fd, int len)
|
|
||||||
{
|
|
||||||
int orig;
|
|
||||||
if (ioctl(fd, TUNGETVNETHDRSZ, &orig) == -1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* Restore original length: we can't handle failure. */
|
|
||||||
if (ioctl(fd, TUNSETVNETHDRSZ, &orig) == -1) {
|
|
||||||
fprintf(stderr, "TUNGETVNETHDRSZ ioctl() failed: %s. Exiting.\n",
|
|
||||||
strerror(errno));
|
|
||||||
abort();
|
|
||||||
return -errno;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||||
{
|
{
|
||||||
if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
|
if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
|
||||||
|
|
|
@ -221,11 +221,6 @@ int tap_probe_has_uso(int fd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tap_probe_vnet_hdr_len(int fd, int len)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,11 +52,6 @@ int tap_probe_has_uso(int fd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tap_probe_vnet_hdr_len(int fd, int len)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,11 +259,7 @@ static bool tap_has_vnet_hdr(NetClientState *nc)
|
||||||
|
|
||||||
static bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
|
static bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
|
||||||
{
|
{
|
||||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
return tap_has_vnet_hdr(nc);
|
||||||
|
|
||||||
assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
|
|
||||||
|
|
||||||
return !!tap_probe_vnet_hdr_len(s->fd, len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tap_get_vnet_hdr_len(NetClientState *nc)
|
static int tap_get_vnet_hdr_len(NetClientState *nc)
|
||||||
|
@ -432,7 +428,7 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
|
||||||
* Make sure host header length is set correctly in tap:
|
* Make sure host header length is set correctly in tap:
|
||||||
* it might have been modified by another instance of qemu.
|
* it might have been modified by another instance of qemu.
|
||||||
*/
|
*/
|
||||||
if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) {
|
if (vnet_hdr) {
|
||||||
tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
|
tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
|
||||||
}
|
}
|
||||||
tap_read_poll(s, true);
|
tap_read_poll(s, true);
|
||||||
|
|
|
@ -35,7 +35,6 @@ ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
|
||||||
|
|
||||||
void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
|
void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
|
||||||
int tap_probe_vnet_hdr(int fd, Error **errp);
|
int tap_probe_vnet_hdr(int fd, Error **errp);
|
||||||
int tap_probe_vnet_hdr_len(int fd, int len);
|
|
||||||
int tap_probe_has_ufo(int fd);
|
int tap_probe_has_ufo(int fd);
|
||||||
int tap_probe_has_uso(int fd);
|
int tap_probe_has_uso(int fd);
|
||||||
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo,
|
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo,
|
||||||
|
|
Loading…
Reference in New Issue