Process EPOLLOUT events. For now this is just a stub, and needs to be extended to call into the various protocols to actually do something useful. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tap.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tap.c b/tap.c index d7d3fc19..3754fffe 100644 --- a/tap.c +++ b/tap.c @@ -932,6 +932,18 @@ void tap_handler(struct ctx *c, const struct timespec *now) tap6_handler(c, pool_tap6, now); } +/** + * tap_ready() - Notify the rest of passt that the tap device is ready for more data + * @c: Execution context + * @now: Current timestamp + */ +static void tap_ready(struct ctx *c, const struct timespec *now) +{ + (void)c; + (void)now; + /* TODO: notify protocols */ +} + /** * tap_add_packet() - Queue/capture packet, update notion of guest MAC address * @c: Execution context @@ -1068,6 +1080,9 @@ void tap_handler_passt(struct ctx *c, uint32_t events, if (events & EPOLLIN) while (tap_passt_input(c, now)) ; + + if (events & EPOLLOUT) + tap_ready(c, now); } /** @@ -1127,6 +1142,9 @@ void tap_handler_pasta(struct ctx *c, uint32_t events, if (events & EPOLLIN) while (tap_pasta_input(c, now)) ; + + if (events & EPOLLOUT) + tap_ready(c, now); } /** -- 2.46.0