linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: Jiang Wang <jiang.wang@bytedance.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"Cong Wang ." <cong.wang@bytedance.com>,
	Xiongchun Duan <duanxiongchun@bytedance.com>,
	xieyongji@bytedance.com, chaiwen.cc@bytedance.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	Lorenz Bauer <lmb@cloudflare.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	Johan Almbladh <johan.almbladh@anyfinetworks.com>,
	LKML <linux-kernel@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap
Date: Thu, 29 Jul 2021 14:27:12 -0700	[thread overview]
Message-ID: <CAM_iQpXiqhfL9M04x1hvJ_6zCCUoDAv1_ywysu=O7wnCUuJaTw@mail.gmail.com> (raw)
In-Reply-To: <6101a56bf2a11_1e1ff620813@john-XPS-13-9370.notmuch>

On Wed, Jul 28, 2021 at 11:44 AM John Fastabend
<john.fastabend@gmail.com> wrote:
>
> Cong Wang wrote:
> > On Tue, Jul 27, 2021 at 9:37 AM John Fastabend <john.fastabend@gmail.com> wrote:
> > > 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.

Thanks.

  reply	other threads:[~2021-07-29 21:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  0:12 [PATCH bpf-next v1 0/5] sockmap: add sockmap support for unix stream socket Jiang Wang
2021-07-27  0:12 ` [PATCH bpf-next v1 1/5] af_unix: add read_sock for stream socket types Jiang Wang
2021-07-29  8:37   ` Jakub Sitnicki
2021-07-27  0:12 ` [PATCH bpf-next v1 2/5] af_unix: add unix_stream_proto for sockmap Jiang Wang
2021-07-27 16:37   ` John Fastabend
2021-07-28  2:07     ` Cong Wang
2021-07-28 18:43       ` John Fastabend
2021-07-29 21:27         ` Cong Wang [this message]
2021-08-10 17:04           ` John Fastabend
2021-07-27  0:12 ` [PATCH bpf-next v1 3/5] selftest/bpf: add tests for sockmap with unix stream type Jiang Wang
2021-07-27 16:38   ` John Fastabend
2021-07-27  0:12 ` [PATCH bpf-next v1 4/5] selftest/bpf: change udp to inet in some function names Jiang Wang
2021-07-27 16:40   ` John Fastabend
2021-07-27  0:12 ` [PATCH bpf-next v1 5/5] selftest/bpf: add new tests in sockmap for unix stream to tcp Jiang Wang
2021-07-27 16:42   ` John Fastabend
2021-07-27 16:44 ` [PATCH bpf-next v1 0/5] sockmap: add sockmap support for unix stream socket John Fastabend

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='CAM_iQpXiqhfL9M04x1hvJ_6zCCUoDAv1_ywysu=O7wnCUuJaTw@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chaiwen.cc@bytedance.com \
    --cc=cong.wang@bytedance.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=duanxiongchun@bytedance.com \
    --cc=jakub@cloudflare.com \
    --cc=jiang.wang@bytedance.com \
    --cc=johan.almbladh@anyfinetworks.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lmb@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=xieyongji@bytedance.com \
    --cc=yhs@fb.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).