Thread (16 messages) 16 messages, 4 authors, 2021-08-10

Re: [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap

flat view

From: John Fastabend <john.fastabend@gmail.com>
Date: 2021-08-10 17:04:36
Also in: bpf, linux-kselftest, lkml

Cong Wang wrote:
On Wed, Jul 28, 2021 at 11:44 AM John Fastabend
[off-list ref] wrote:
quoted
Cong Wang wrote:
quoted
On Tue, Jul 27, 2021 at 9:37 AM John Fastabend [off-list ref] wrote:
quoted
Do we really need an unhash hook for unix_stream? I'm doing some testing
now to pull it out of TCP side as well. It seems to be an artifact of old
code that is no longer necessary. On TCP side at least just using close()
looks to be enough now.
How do you handle the disconnection from remote without ->unhash()?
Would close() not work for stream/dgram sockets?
close() is called when the local closes the sockets, but when the remote
closes or disconnects it, unhash() is called. This is why TCP calls unhash()
to remove the socket from established socket hash table. unhash() itself
might not make much sense for AF_UNIX as it probably does not need a
hash table to track established ones, however, the idea is the same, that
is, we have to handle remote disconnections here.
Following up on this series. Leaving a socket in the sockmap until close()
happens is not paticularly problematic, but does consume space in the map
so unhash() is slightly better I guess. Thanks.
Thanks.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help