aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-04-28 16:00:45 +0900
committerJason Wang <jasowang@redhat.com>2024-06-04 15:14:25 +0800
commit4b52d63249a508dd927222ffac1a868d38681fc5 (patch)
tree5f19fc43f34d0b1029d1cee2aaa4a1b3bc28a051 /net/net.c
parent52a7ff526964e7810ec1ccc71efbdd60952dd20b (diff)
tap: Remove qemu_using_vnet_hdr()
Since qemu_set_vnet_hdr_len() is always called when qemu_using_vnet_hdr() is called, we can merge them and save some code. For consistency, express that the virtio-net header is not in use by returning 0 with qemu_get_vnet_hdr_len() instead of having a dedicated function, qemu_get_using_vnet_hdr(). Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/net/net.c b/net/net.c
index a2f0c828bb..bd51037ebf 100644
--- a/net/net.c
+++ b/net/net.c
@@ -529,24 +529,6 @@ bool qemu_has_vnet_hdr_len(NetClientState *nc, int len)
return nc->info->has_vnet_hdr_len(nc, len);
}
-bool qemu_get_using_vnet_hdr(NetClientState *nc)
-{
- if (!nc || !nc->info->get_using_vnet_hdr) {
- return false;
- }
-
- return nc->info->get_using_vnet_hdr(nc);
-}
-
-void qemu_using_vnet_hdr(NetClientState *nc, bool enable)
-{
- if (!nc || !nc->info->using_vnet_hdr) {
- return;
- }
-
- nc->info->using_vnet_hdr(nc, enable);
-}
-
void qemu_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
int ecn, int ufo, int uso4, int uso6)
{
@@ -559,11 +541,7 @@ void qemu_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
int qemu_get_vnet_hdr_len(NetClientState *nc)
{
- if (!nc || !nc->info->get_vnet_hdr_len) {
- return 0;
- }
-
- return nc->info->get_vnet_hdr_len(nc);
+ return nc->vnet_hdr_len;
}
void qemu_set_vnet_hdr_len(NetClientState *nc, int len)