diff mbox series

[bpf-next] libbpf: relicense bpf_helpers.h and bpf_endian.h

Message ID 20190816054543.2215626-1-andriin@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] libbpf: relicense bpf_helpers.h and bpf_endian.h | expand

Commit Message

Andrii Nakryiko Aug. 16, 2019, 5:45 a.m. UTC
bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
definitions essential to almost every BPF program. Which makes them
useful not just for selftests. To be able to expose them as part of
libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
BSD-2-Clause. This patch updates licensing of those two files.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Hechao Li <hechaol@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Adam Barth <arb@fb.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: Josef Bacik <jbacik@fb.com>
Acked-by: Joe Stringer <joe@wand.net.nz>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Lorenz Bauer <lmb@cloudflare.com>
Acked-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Acked-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Petar Penkov <ppenkov@google.com>
Acked-by: Teng Qin <palmtenor@gmail.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Michal Rostecki <mrostecki@opensuse.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/testing/selftests/bpf/bpf_endian.h  | 2 +-
 tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jesper Dangaard Brouer Aug. 16, 2019, 12:10 p.m. UTC | #1
On Thu, 15 Aug 2019 22:45:43 -0700
Andrii Nakryiko <andriin@fb.com> wrote:

> bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
> definitions essential to almost every BPF program. Which makes them
> useful not just for selftests. To be able to expose them as part of
> libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
> BSD-2-Clause. This patch updates licensing of those two files.

I've already ACKed this, and is fine with (LGPL-2.1 OR BSD-2-Clause).

I just want to understand, why "BSD-2-Clause" and not "Apache-2.0" ?

The original argument was that this needed to be compatible with
"Apache-2.0", then why not simply add this in the "OR" ?

> Acked-by: Alexei Starovoitov <ast@kernel.org>
> Acked-by: Hechao Li <hechaol@fb.com>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
> Acked-by: Andrey Ignatov <rdna@fb.com>
> Acked-by: Yonghong Song <yhs@fb.com>
> Acked-by: Lawrence Brakmo <brakmo@fb.com>
> Acked-by: Adam Barth <arb@fb.com>
> Acked-by: Roman Gushchin <guro@fb.com>
> Acked-by: Josef Bacik <jbacik@fb.com>
> Acked-by: Joe Stringer <joe@wand.net.nz>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> Acked-by: David Ahern <dsahern@gmail.com>
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

Confirming I acked this.

> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
> Acked-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> Acked-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
> Acked-by: Willem de Bruijn <willemb@google.com>
> Acked-by: Petar Penkov <ppenkov@google.com>
> Acked-by: Teng Qin <palmtenor@gmail.com>
> Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Michal Rostecki <mrostecki@opensuse.org>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: Sargun Dhillon <sargun@sargun.me>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
>  tools/testing/selftests/bpf/bpf_endian.h  | 2 +-
>  tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/bpf_endian.h b/tools/testing/selftests/bpf/bpf_endian.h
> index 05f036df8a4c..ff3593b0ae03 100644
> --- a/tools/testing/selftests/bpf/bpf_endian.h
> +++ b/tools/testing/selftests/bpf/bpf_endian.h
> @@ -1,4 +1,4 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
>  #ifndef __BPF_ENDIAN__
>  #define __BPF_ENDIAN__
>  
> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
> index 8b503ea142f0..6c4930bc6e2e 100644
> --- a/tools/testing/selftests/bpf/bpf_helpers.h
> +++ b/tools/testing/selftests/bpf/bpf_helpers.h
> @@ -1,4 +1,4 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
>  #ifndef __BPF_HELPERS_H
>  #define __BPF_HELPERS_H
>
Daniel Borkmann Aug. 16, 2019, 3:29 p.m. UTC | #2
On 8/16/19 2:10 PM, Jesper Dangaard Brouer wrote:
> On Thu, 15 Aug 2019 22:45:43 -0700
> Andrii Nakryiko <andriin@fb.com> wrote:
> 
>> bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
>> definitions essential to almost every BPF program. Which makes them
>> useful not just for selftests. To be able to expose them as part of
>> libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
>> BSD-2-Clause. This patch updates licensing of those two files.
> 
> I've already ACKed this, and is fine with (LGPL-2.1 OR BSD-2-Clause).
> 
> I just want to understand, why "BSD-2-Clause" and not "Apache-2.0" ?
> 
> The original argument was that this needed to be compatible with
> "Apache-2.0", then why not simply add this in the "OR" ?

It's use is discouraged in the kernel tree, see also LICENSES/dual/Apache-2.0 (below) and
statement wrt compatibility from https://www.apache.org/licenses/GPL-compatibility.html:

   Valid-License-Identifier: Apache-2.0
   SPDX-URL: https://spdx.org/licenses/Apache-2.0.html
   Usage-Guide:
     Do NOT use. The Apache-2.0 is not GPL2 compatible. [...]

>> Acked-by: Alexei Starovoitov <ast@kernel.org>
>> Acked-by: Hechao Li <hechaol@fb.com>
>> Acked-by: Martin KaFai Lau <kafai@fb.com>
>> Acked-by: Andrey Ignatov <rdna@fb.com>
>> Acked-by: Yonghong Song <yhs@fb.com>
>> Acked-by: Lawrence Brakmo <brakmo@fb.com>
>> Acked-by: Adam Barth <arb@fb.com>
>> Acked-by: Roman Gushchin <guro@fb.com>
>> Acked-by: Josef Bacik <jbacik@fb.com>
>> Acked-by: Joe Stringer <joe@wand.net.nz>
>> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
>> Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>> Acked-by: David Ahern <dsahern@gmail.com>
>> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
> 
> Confirming I acked this.
> 
>> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
>> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
>> Acked-by: Adrian Ratiu <adrian.ratiu@collabora.com>
>> Acked-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
>> Acked-by: Willem de Bruijn <willemb@google.com>
>> Acked-by: Petar Penkov <ppenkov@google.com>
>> Acked-by: Teng Qin <palmtenor@gmail.com>
>> Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>> Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Michal Rostecki <mrostecki@opensuse.org>
>> Cc: John Fastabend <john.fastabend@gmail.com>
>> Cc: Sargun Dhillon <sargun@sargun.me>
>> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>> ---
>>   tools/testing/selftests/bpf/bpf_endian.h  | 2 +-
>>   tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/bpf/bpf_endian.h b/tools/testing/selftests/bpf/bpf_endian.h
>> index 05f036df8a4c..ff3593b0ae03 100644
>> --- a/tools/testing/selftests/bpf/bpf_endian.h
>> +++ b/tools/testing/selftests/bpf/bpf_endian.h
>> @@ -1,4 +1,4 @@
>> -/* SPDX-License-Identifier: GPL-2.0 */
>> +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
>>   #ifndef __BPF_ENDIAN__
>>   #define __BPF_ENDIAN__
>>   
>> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
>> index 8b503ea142f0..6c4930bc6e2e 100644
>> --- a/tools/testing/selftests/bpf/bpf_helpers.h
>> +++ b/tools/testing/selftests/bpf/bpf_helpers.h
>> @@ -1,4 +1,4 @@
>> -/* SPDX-License-Identifier: GPL-2.0 */
>> +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
>>   #ifndef __BPF_HELPERS_H
>>   #define __BPF_HELPERS_H
>>   
> 
> 
>
Greg Kroah-Hartman Aug. 16, 2019, 5:15 p.m. UTC | #3
On Fri, Aug 16, 2019 at 05:29:27PM +0200, Daniel Borkmann wrote:
> On 8/16/19 2:10 PM, Jesper Dangaard Brouer wrote:
> > On Thu, 15 Aug 2019 22:45:43 -0700
> > Andrii Nakryiko <andriin@fb.com> wrote:
> > 
> > > bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
> > > definitions essential to almost every BPF program. Which makes them
> > > useful not just for selftests. To be able to expose them as part of
> > > libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
> > > BSD-2-Clause. This patch updates licensing of those two files.
> > 
> > I've already ACKed this, and is fine with (LGPL-2.1 OR BSD-2-Clause).
> > 
> > I just want to understand, why "BSD-2-Clause" and not "Apache-2.0" ?
> > 
> > The original argument was that this needed to be compatible with
> > "Apache-2.0", then why not simply add this in the "OR" ?
> 
> It's use is discouraged in the kernel tree, see also LICENSES/dual/Apache-2.0 (below) and
> statement wrt compatibility from https://www.apache.org/licenses/GPL-compatibility.html:
> 
>   Valid-License-Identifier: Apache-2.0
>   SPDX-URL: https://spdx.org/licenses/Apache-2.0.html
>   Usage-Guide:
>     Do NOT use. The Apache-2.0 is not GPL2 compatible. [...]

That is correct, don't use Apache-2 code in the kernel please.  Even as
a dual-license, it's a total mess.

Having this be BSD-2 is actually better, as it should be fine to use
with Apache 2 code, right?

Jesper, do you know of any license that BSD-2 is not compatible with
that is needed?

thanks,

greg k-h
Jesper Dangaard Brouer Aug. 16, 2019, 8:10 p.m. UTC | #4
On Fri, 16 Aug 2019 19:15:29 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:

> On Fri, Aug 16, 2019 at 05:29:27PM +0200, Daniel Borkmann wrote:
> > On 8/16/19 2:10 PM, Jesper Dangaard Brouer wrote:  
> > > On Thu, 15 Aug 2019 22:45:43 -0700
> > > Andrii Nakryiko <andriin@fb.com> wrote:
> > >   
> > > > bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
> > > > definitions essential to almost every BPF program. Which makes them
> > > > useful not just for selftests. To be able to expose them as part of
> > > > libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
> > > > BSD-2-Clause. This patch updates licensing of those two files.  
> > > 
> > > I've already ACKed this, and is fine with (LGPL-2.1 OR BSD-2-Clause).
> > > 
> > > I just want to understand, why "BSD-2-Clause" and not "Apache-2.0" ?
> > > 
> > > The original argument was that this needed to be compatible with
> > > "Apache-2.0", then why not simply add this in the "OR" ?  
> > 
> > It's use is discouraged in the kernel tree, see also LICENSES/dual/Apache-2.0 (below) and
> > statement wrt compatibility from https://www.apache.org/licenses/GPL-compatibility.html:
> > 
> >   Valid-License-Identifier: Apache-2.0
> >   SPDX-URL: https://spdx.org/licenses/Apache-2.0.html
> >   Usage-Guide:
> >     Do NOT use. The Apache-2.0 is not GPL2 compatible. [...]  

You didn't quote the continuation from LICENSES/dual/Apache-2.0

Usage-Guide:
  Do NOT use. The Apache-2.0 is not GPL2 compatible. It may only be used
  for dual-licensed files where the other license is GPL2 compatible.
  If you end up using this it MUST be used together with a GPL2 compatible
  license using "OR".

The way I read it, is that you can use it with "OR", like:
 SPDX-License-Identifier: GPL-2.0 OR Apache-2.0

> That is correct, don't use Apache-2 code in the kernel please.  Even as
> a dual-license, it's a total mess.

Good, I just wanted to understand why.  

> Having this be BSD-2 is actually better, as it should be fine to use
> with Apache 2 code, right?

Yes, that is also my understanding. And it better be as this is needed,
as we want libbpf to be used by https://github.com/iovisor/bcc/ which
is Apache-2.0.

> Jesper, do you know of any license that BSD-2 is not compatible with
> that is needed?

No.
Daniel Borkmann Aug. 17, 2019, 9:30 p.m. UTC | #5
On 8/16/19 7:45 AM, Andrii Nakryiko wrote:
> bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
> definitions essential to almost every BPF program. Which makes them
> useful not just for selftests. To be able to expose them as part of
> libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
> BSD-2-Clause. This patch updates licensing of those two files.
> 
> Acked-by: Alexei Starovoitov <ast@kernel.org>
> Acked-by: Hechao Li <hechaol@fb.com>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
> Acked-by: Andrey Ignatov <rdna@fb.com>
> Acked-by: Yonghong Song <yhs@fb.com>
> Acked-by: Lawrence Brakmo <brakmo@fb.com>
> Acked-by: Adam Barth <arb@fb.com>
> Acked-by: Roman Gushchin <guro@fb.com>
> Acked-by: Josef Bacik <jbacik@fb.com>
> Acked-by: Joe Stringer <joe@wand.net.nz>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> Acked-by: David Ahern <dsahern@gmail.com>
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Acked-by: Lorenz Bauer <lmb@cloudflare.com>
> Acked-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> Acked-by: Nikita V. Shirokov <tehnerd@tehnerd.com>
> Acked-by: Willem de Bruijn <willemb@google.com>
> Acked-by: Petar Penkov <ppenkov@google.com>
> Acked-by: Teng Qin <palmtenor@gmail.com>
> Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Michal Rostecki <mrostecki@opensuse.org>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: Sargun Dhillon <sargun@sargun.me>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!
Naveen N. Rao Aug. 19, 2019, 5:27 p.m. UTC | #6
Andrii Nakryiko wrote:
> bpf_helpers.h and bpf_endian.h contain useful macros and BPF helper
> definitions essential to almost every BPF program. Which makes them
> useful not just for selftests. To be able to expose them as part of
> libbpf, though, we need them to be dual-licensed as LGPL-2.1 OR
> BSD-2-Clause. This patch updates licensing of those two files.

Quite late, but FWIW:
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>


- Naveen
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/bpf_endian.h b/tools/testing/selftests/bpf/bpf_endian.h
index 05f036df8a4c..ff3593b0ae03 100644
--- a/tools/testing/selftests/bpf/bpf_endian.h
+++ b/tools/testing/selftests/bpf/bpf_endian.h
@@ -1,4 +1,4 @@ 
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
 #ifndef __BPF_ENDIAN__
 #define __BPF_ENDIAN__
 
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 8b503ea142f0..6c4930bc6e2e 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -1,4 +1,4 @@ 
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
 #ifndef __BPF_HELPERS_H
 #define __BPF_HELPERS_H