public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: "D. Wythe" <alibuda@linux.alibaba.com>
To: Kui-Feng Lee <sinquersw@gmail.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: Thu, 27 Apr 2023 11:30:42 +0800	[thread overview]
Message-ID: <a8555236-2bef-b0fb-d8a8-dde3058a2271@linux.alibaba.com> (raw)
In-Reply-To: <8e1694ec-9acf-a4bd-4dd2-28a258e1436b@gmail.com>


Hi Lee,


On 4/27/23 12:47 AM, Kui-Feng Lee wrote:
>
>
> 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 ...

Will fix it, Thanks.

>> +
>> +/* 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.

Yes. Logically those functions are not suitable for being placed in 
"bpf_smc.c".
However, since SMC is compiled as modules by default, and currently
struct ops needs to be built in, or specific symbols will not be found 
during linking.

Of course, I can separate those this function in another new file, which 
can also be built in.
I may have to introduce a new KConfig likes SMC_NEGOTIATOR. But this 
feature is  only effective
when eBPF exists, so from the perspective of SMC, it would also be kind 
of weird.

But whatever, if you do think it's necessary, I can split it into two files.

Besh wishes.
D. Wythe




  reply	other threads:[~2023-04-27  3:30 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
2023-04-27  3:30     ` D. Wythe [this message]
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=a8555236-2bef-b0fb-d8a8-dde3058a2271@linux.alibaba.com \
    --to=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=sinquersw@gmail.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