[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6511d06c64462_110e5208d1@john.notmuch>
Date: Mon, 25 Sep 2023 11:24:44 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Ferenc Fejes <fejes@....elte.hu>,
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
Ferenc Fejes wrote:
> 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.
Agree we should not wake up the application in this case. I currently
fixing the wake up for cases where SK_PASS is passed. I can add this
to the todo list if no one beats me to it. For reference with parser
program we have a series of similar issue I'll fix next.
> >
> > Sincerely,
> > Farbod
>
> Ferenc
>
Powered by blists - more mailing lists