udp: rename udp_sock_handler() to udp_buf_sock_handler()

We are going to introduce a variant of the function to use
vhost-user buffers rather than passt internal buffers.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
This commit is contained in:
Laurent Vivier 2024-01-12 15:41:18 +01:00
parent 72cadf34ad
commit 0938100596
3 changed files with 5 additions and 5 deletions

View file

@ -380,7 +380,7 @@ loop:
tcp_timer_handler(&c, ref); tcp_timer_handler(&c, ref);
break; break;
case EPOLL_TYPE_UDP: case EPOLL_TYPE_UDP:
udp_sock_handler(&c, ref, eventmask, &now); udp_buf_sock_handler(&c, ref, eventmask, &now);
break; break;
case EPOLL_TYPE_ICMP: case EPOLL_TYPE_ICMP:
icmp_sock_handler(&c, AF_INET, ref); icmp_sock_handler(&c, AF_INET, ref);

4
udp.c
View file

@ -744,7 +744,7 @@ static void udp_tap_send(const struct ctx *c,
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
/** /**
* udp_sock_handler() - Handle new data from socket * udp_buf_sock_handler() - Handle new data from socket
* @c: Execution context * @c: Execution context
* @ref: epoll reference * @ref: epoll reference
* @events: epoll events bitmap * @events: epoll events bitmap
@ -752,7 +752,7 @@ static void udp_tap_send(const struct ctx *c,
* *
* #syscalls recvmmsg * #syscalls recvmmsg
*/ */
void udp_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events, void udp_buf_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events,
const struct timespec *now) const struct timespec *now)
{ {
/* For not entirely clear reasons (data locality?) pasta gets /* For not entirely clear reasons (data locality?) pasta gets

2
udp.h
View file

@ -9,7 +9,7 @@
#define UDP_TIMER_INTERVAL 1000 /* ms */ #define UDP_TIMER_INTERVAL 1000 /* ms */
void udp_portmap_clear(void); void udp_portmap_clear(void);
void udp_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events, void udp_buf_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events,
const struct timespec *now); const struct timespec *now);
int udp_tap_handler(struct ctx *c, uint8_t pif, sa_family_t af, int udp_tap_handler(struct ctx *c, uint8_t pif, sa_family_t af,
const void *saddr, const void *daddr, const void *saddr, const void *daddr,