tcp: Remove remaining declaration of tcp_l2_mh

Use of tcp_l2_mh has been removed in commit 38fbfdbcb9,
but its declaration and initialization are always in the code.
Remove them as they are useless.

Fixes: 38fbfdbcb9 ("tcp: Get rid of iov with cached MSS, drop sendmmsg(), add deferred flush")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Laurent Vivier 2023-10-13 10:45:45 +02:00 committed by Stefano Brivio
parent 515db1ecc4
commit 0ad54e1043

6
tcp.c
View file

@ -514,8 +514,6 @@ static struct iovec tcp6_l2_iov [TCP_FRAMES_MEM];
static struct iovec tcp4_l2_flags_iov [TCP_FRAMES_MEM]; static struct iovec tcp4_l2_flags_iov [TCP_FRAMES_MEM];
static struct iovec tcp6_l2_flags_iov [TCP_FRAMES_MEM]; static struct iovec tcp6_l2_flags_iov [TCP_FRAMES_MEM];
static struct mmsghdr tcp_l2_mh [TCP_FRAMES_MEM];
/* sendmsg() to socket */ /* sendmsg() to socket */
static struct iovec tcp_iov [UIO_MAXIOV]; static struct iovec tcp_iov [UIO_MAXIOV];
@ -3147,7 +3145,6 @@ static void tcp_sock_refill_init(const struct ctx *c)
*/ */
int tcp_init(struct ctx *c) int tcp_init(struct ctx *c)
{ {
int i;
#ifndef HAS_GETRANDOM #ifndef HAS_GETRANDOM
int dev_random = open("/dev/random", O_RDONLY); int dev_random = open("/dev/random", O_RDONLY);
unsigned int random_read = 0; unsigned int random_read = 0;
@ -3176,9 +3173,6 @@ int tcp_init(struct ctx *c)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
for (i = 0; i < ARRAY_SIZE(tcp_l2_mh); i++)
tcp_l2_mh[i] = (struct mmsghdr) { .msg_hdr.msg_iovlen = 1 };
if (c->ifi4) if (c->ifi4)
tcp_sock4_iov_init(c); tcp_sock4_iov_init(c);