From: Gur Stavi <gur.stavi@huawei.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
<linux-kselftest@vger.kernel.org>
Subject: RE: [PATCH net-next v03 1/3] af_packet: allow fanout_add when socket is not RUNNING
Date: Thu, 10 Oct 2024 13:38:47 +0300 [thread overview]
Message-ID: <002f01db1b00$9d09d9a0$d71d8ce0$@huawei.com> (raw)
In-Reply-To: <9e15c0c2cd19d94207a1791de0dc9051a5abb95a.1728555449.git.gur.stavi@huawei.com>
> Subject: [PATCH net-next v03 1/3] af_packet: allow fanout_add when socket
> is not RUNNING
>
> PACKET socket can retain its fanout membership through link down and up
> and leave a fanout while closed regardless of link state.
> However, socket was forbidden from joining a fanout while it was not
> RUNNING.
>
> This patch allows PACKET socket to join fanout while not RUNNING.
>
> The previous test for RUNNING also implicitly tested that the socket is
> bound to a device. An explicit test of ifindex was added instead.
I had some mess up with the send-email. I prepared the following more
complete git comment but sent the wrong patch. The code is still the same.
---
PACKET socket can retain its fanout membership through link down and up
and leave a fanout while closed regardless of link state.
However, socket was forbidden from joining a fanout while it was not
RUNNING.
This patch allows PACKET socket to join fanout while not RUNNING.
Socket can be RUNNING if it has a specified protocol. Either directly
from packet_create (being implicitly bound to any interface) or following
a successful bind. Socket RUNNING state is switched off if it is bound to
an interface that went down.
Instead of the test for RUNNING, this patch adds a test that socket can
receive packets before allowing it into a fanout group. Socket can
receive packets if it has a configured protocol and is bound to an
interface or bound to any interface.
The only difference between the previous test and the current test is
that the bound interface is allowed to have IFF_UP cleared.
---
next prev parent reply other threads:[~2024-10-10 10:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 10:25 [PATCH net-next v03 0/3] net: af_packet: allow joining a fanout when link is down Gur Stavi
2024-10-10 10:25 ` [PATCH net-next v03 1/3] af_packet: allow fanout_add when socket is not RUNNING Gur Stavi
2024-10-10 10:38 ` Gur Stavi [this message]
2024-10-10 13:23 ` Willem de Bruijn
2024-10-10 16:00 ` Gur Stavi
2024-10-10 10:25 ` [PATCH net-next v03 2/3] selftests: net/psock_fanout: socket joins fanout when link is down Gur Stavi
2024-10-10 10:25 ` [PATCH net-next v03 3/3] selftests: net/psock_fanout: unbound socket fanout Gur Stavi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002f01db1b00$9d09d9a0$d71d8ce0$@huawei.com' \
--to=gur.stavi@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).