[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 05/21] tap: Remove tap_receive()
From: |
Akihiko Odaki |
Subject: |
[PATCH v5 05/21] tap: Remove tap_receive() |
Date: |
Tue, 17 Oct 2023 13:09:11 +0900 |
The receive member of NetClientInfo is only for legacy clients and the
receive_iov member is always used when it is set.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
net/tap.c | 36 ------------------------------------
1 file changed, 36 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index 087b2d3bc6..668d69c0de 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -131,41 +131,6 @@ static ssize_t tap_receive_iov(NetClientState *nc, const
struct iovec *iov,
return tap_write_packet(s, iovp, iovcnt);
}
-static ssize_t tap_receive_raw(NetClientState *nc, const uint8_t *buf, size_t
size)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
- struct iovec iov[2];
- int iovcnt = 0;
- struct virtio_net_hdr_mrg_rxbuf hdr = { };
-
- if (s->host_vnet_hdr_len) {
- iov[iovcnt].iov_base = &hdr;
- iov[iovcnt].iov_len = s->host_vnet_hdr_len;
- iovcnt++;
- }
-
- iov[iovcnt].iov_base = (char *)buf;
- iov[iovcnt].iov_len = size;
- iovcnt++;
-
- return tap_write_packet(s, iov, iovcnt);
-}
-
-static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
-{
- TAPState *s = DO_UPCAST(TAPState, nc, nc);
- struct iovec iov[1];
-
- if (s->host_vnet_hdr_len && !s->using_vnet_hdr) {
- return tap_receive_raw(nc, buf, size);
- }
-
- iov[0].iov_base = (char *)buf;
- iov[0].iov_len = size;
-
- return tap_write_packet(s, iov, 1);
-}
-
#ifndef __sun__
ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen)
{
@@ -355,7 +320,6 @@ int tap_get_fd(NetClientState *nc)
static NetClientInfo net_tap_info = {
.type = NET_CLIENT_DRIVER_TAP,
.size = sizeof(TAPState),
- .receive = tap_receive,
.receive_iov = tap_receive_iov,
.poll = tap_poll,
.cleanup = tap_cleanup,
--
2.42.0
- [PATCH v5 00/21] virtio-net RSS/hash report fixes and improvements, Akihiko Odaki, 2023/10/17
- [PATCH v5 06/21] net: Remove flag propagation, Akihiko Odaki, 2023/10/17
- [PATCH v5 05/21] tap: Remove tap_receive(),
Akihiko Odaki <=
- [PATCH v5 07/21] tap: Shrink zeroed virtio-net header, Akihiko Odaki, 2023/10/17
- [PATCH v5 08/21] virtio-net: Copy header only when necessary, Akihiko Odaki, 2023/10/17
- [PATCH v5 09/21] virtio-net: Disable RSS on reset, Akihiko Odaki, 2023/10/17
- [PATCH v5 10/21] virtio-net: Unify the logic to update NIC state for RSS, Akihiko Odaki, 2023/10/17
- [PATCH v5 11/21] virtio-net: Return an error when vhost cannot enable RSS, Akihiko Odaki, 2023/10/17
- Re: [PATCH v5 11/21] virtio-net: Return an error when vhost cannot enable RSS, Yuri Benditovich, 2023/10/29
[PATCH v5 12/21] virtio-net: Always set populate_hash, Akihiko Odaki, 2023/10/17