All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: dev@dpdk.org, magnus.karlsson@intel.com, bjorn.topel@intel.com
Subject: Re: [RFC v2 6/7] net/af_xdp: load BPF file
Date: Thu, 8 Mar 2018 15:15:00 -0800	[thread overview]
Message-ID: <20180308151500.2365b677@xeon-e3> (raw)
In-Reply-To: <20180308135249.28187-7-qi.z.zhang@intel.com>

On Thu,  8 Mar 2018 21:52:48 +0800
Qi Zhang <qi.z.zhang@intel.com> wrote:

> +struct bpf_insn prog[] = {
> +	{
> +		.code = 0x85, //call imm
> +		.dst_reg = 0,
> +		.src_reg = 0,
> +		.off = 0,
> +		.imm = BPF_FUNC_xdpsk_redirect,
> +	},
> +	{
> +		.code = 0x95, //exit
> +		.dst_reg = 0,
> +		.src_reg = 0,
> +		.off = 0,
> +		.imm = 0,
> +	},
> +};
> +
> +int load_bpf_file(void)
> +{
> +	int fd;
> +
> +	fd = bpf_load_program(BPF_PROG_TYPE_XDP, prog,
> +			      ARRAY_SIZE(prog),
> +			      "GPL", 0,
> +			      bpf_log_buf, BPF_LOG_BUF_SIZE);

Still have license conflict here. The short bpf program is in BSD code and therefore
is BSD, not GPL. But kernel won't let you load non-GPL programs.

Please check with Intel open source compliance to find a GPL solution.

A possible license safe solution is more complex. You need to provide original program
source for the BPF program under dual clause (GPL-2/BSD-3); then read in that object
file and load it.  A user wishing to exercise their GPL rights can then take your
source file and modify and create new file to load.

Doing this also creates additional GPL issues for appliance vendors using AF_XDP.
They need to make available the source of all these XDP BPF programs.

Complying with mixed licenses is hard.

  parent reply	other threads:[~2018-03-08 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 13:52 [RFC v2 0/7] PMD driver for AF_XDP Qi Zhang
2018-03-08 13:52 ` [RFC v2 1/7] net/af_xdp: new PMD driver Qi Zhang
2018-03-08 13:52 ` [RFC v2 2/7] lib/mbuf: enable parse flags when create mempool Qi Zhang
2018-03-08 13:52 ` [RFC v2 3/7] lib/mempool: allow page size aligned mempool Qi Zhang
2018-03-08 13:52 ` [RFC v2 4/7] net/af_xdp: use mbuf mempool for buffer management Qi Zhang
2018-03-08 13:52 ` [RFC v2 5/7] net/af_xdp: enable share mempool Qi Zhang
2018-03-08 13:52 ` [RFC v2 6/7] net/af_xdp: load BPF file Qi Zhang
2018-03-08 14:20   ` Zhang, Qi Z
2018-03-08 23:15   ` Stephen Hemminger [this message]
2018-05-09  7:02     ` Björn Töpel
2018-03-08 13:52 ` [RFC v2 7/7] app/testpmd: enable parameter for mempool flags Qi Zhang

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=20180308151500.2365b677@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bjorn.topel@intel.com \
    --cc=dev@dpdk.org \
    --cc=magnus.karlsson@intel.com \
    --cc=qi.z.zhang@intel.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 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.