All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hou Tao <houtao1@huawei.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>
Subject: Question about the release of BPF_MAP_TYPE_STRUCT_OPS fd
Date: Tue, 28 Sep 2021 22:13:45 +0800	[thread overview]
Message-ID: <a6ba3289-accd-051a-b27c-d90df0eb7cd2@huawei.com> (raw)

Hi Martin,

During the testing of bpf_tcp_ca, I found that if the test program
aborts before calling bpf_link__detach_struct_ops(), the registered
bpf_dctcp will not be unregistered, and running bpf_tcp_ca test again
will fail with -EEXIST error as shown below:

test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec
test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -17

The root cause is that the release of BPF_MAP_TYPE_STRUCT_OPS fd
neither put struct_ops programs in maps nor unregister the struct_ops
from kernel. Was the implementation intentional, or was it an oversight ?
If it is an oversight, I will post a patch to fix it.

Regards,
Tao

             reply	other threads:[~2021-09-28 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 14:13 Hou Tao [this message]
2021-09-28 18:33 ` Question about the release of BPF_MAP_TYPE_STRUCT_OPS fd Martin KaFai Lau

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=a6ba3289-accd-051a-b27c-d90df0eb7cd2@huawei.com \
    --to=houtao1@huawei.com \
    --cc=bpf@vger.kernel.org \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.