[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3fd39981aba0e0aa8ced76398c2ea8ad85208f7d.camel@inf.elte.hu>
Date: Sat, 23 Sep 2023 11:36:21 +0200
From: Ferenc Fejes <fejes@....elte.hu>
To: Farbod Shahinfar <farbod.shahinfar@...imi.it>, john.fastabend@...il.com,
netdev@...r.kernel.org
Subject: Re: question about BPF sk_skb_stream_verdict redirect and
poll/epoll events
Hi!
On Fri, 2023-09-22 at 19:32 +0200, Farbod Shahinfar wrote:
> Hello,
>
> I am doing a simple experiment in which I send a message to a TCP
> server
> and the server echoes the message. I am attaching a BPF sk_skb
> stream_verdict program to the server socket to redirect the message
> back
> to the client (redirects the SKB on the same socket but to the TX
> queue). In my test, I noticed that the user-space server, which is
> using
> the poll system call, is woken up, and when it reads the socket,
> receives zero as the number of bytes read.
Do you poll for POLLIN events?
>
> I first want to ask if this is the intended behavior.
> In case this is the intended behavior, my second question is, what
> should I do to prevent the user program from waking up? I hope by not
> waking up the user program I could better use the available
> resources.
AFAIK sockets in sockmap are propagates every events to poll (fixme),
but with pollfd::events you can specify the ones makes sense to you
e.g.: POLLERR, POLLHUP, POLLRDHUP, etc.
>
> Sincerely,
> Farbod
Ferenc
Powered by blists - more mailing lists