From: Kui-Feng Lee <sinquersw@gmail.com>
To: "D. Wythe" <alibuda@linux.alibaba.com>,
kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, pabeni@redhat.com, song@kernel.org,
sdf@google.com, haoluo@google.com, yhs@fb.com,
edumazet@google.com, john.fastabend@gmail.com,
kpsingh@kernel.org, jolsa@kernel.org, guwen@linux.alibaba.com
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 2/5] net/smc: allow smc to negotiate protocols on policies
Date: Wed, 26 Apr 2023 09:47:26 -0700 [thread overview]
Message-ID: <8e1694ec-9acf-a4bd-4dd2-28a258e1436b@gmail.com> (raw)
In-Reply-To: <1682501055-4736-3-git-send-email-alibuda@linux.alibaba.com>
On 4/26/23 02:24, D. Wythe wrote:
> From: "D. Wythe" <alibuda@linux.alibaba.com>
> diff --git a/net/smc/bpf_smc.c b/net/smc/bpf_smc.c
> new file mode 100644
> index 0000000..0c0ec05
> --- /dev/null
> +++ b/net/smc/bpf_smc.c
> @@ -0,0 +1,201 @@
> +// SPDX-License-Identifier: GPL-2.0-only
... cut ...
> +
> +/* register ops */
> +int smc_sock_register_negotiator_ops(struct smc_sock_negotiator_ops *ops)
> +{
> + int ret;
> +
> + ret = smc_sock_validate_negotiator_ops(ops);
> + if (ret)
> + return ret;
> +
> + /* calt key by name hash */
> + ops->key = jhash(ops->name, sizeof(ops->name), strlen(ops->name));
> +
> + spin_lock(&smc_sock_negotiator_list_lock);
> + if (smc_negotiator_ops_get_by_key(ops->key)) {
> + pr_notice("smc: %s negotiator already registered\n", ops->name);
> + ret = -EEXIST;
> + } else {
> + list_add_tail_rcu(&ops->list, &smc_sock_negotiator_list);
> + }
> + spin_unlock(&smc_sock_negotiator_list_lock);
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(smc_sock_register_negotiator_ops);
This and following functions are not specific to BPF, right?
I found you have more BPF specific code in this file in following
patches. But, I feel these function should not in this file since
they are not BPF specific because file name "bpf_smc.c" hints.
next prev parent reply other threads:[~2023-04-26 16:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 9:24 [PATCH bpf-next 0/5] net/smc: Introduce BPF injection capability D. Wythe
2023-04-26 9:24 ` [PATCH bpf-next 1/5] net/smc: move smc_sock related structure definition D. Wythe
2023-04-26 10:59 ` Wen Gu
2023-04-26 11:33 ` D. Wythe
2023-04-26 9:24 ` [PATCH bpf-next 2/5] net/smc: allow smc to negotiate protocols on policies D. Wythe
2023-04-26 16:47 ` Kui-Feng Lee [this message]
2023-04-27 3:30 ` D. Wythe
2023-04-27 17:40 ` Kui-Feng Lee
2023-04-26 9:24 ` [PATCH bpf-next 3/5] net/smc: allow set or get smc negotiator by sockopt D. Wythe
2023-04-26 9:24 ` [PATCH bpf-next 4/5] bpf: add smc negotiator support in BPF struct_ops D. Wythe
2023-04-26 9:24 ` [PATCH bpf-next 5/5] bpf/selftests: add selftest for SMC bpf capability D. Wythe
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=8e1694ec-9acf-a4bd-4dd2-28a258e1436b@gmail.com \
--to=sinquersw@gmail.com \
--cc=alibuda@linux.alibaba.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=haoluo@google.com \
--cc=jaka@linux.ibm.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kgraul@linux.ibm.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=wenjia@linux.ibm.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