All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Cc: ast@kernel.org, davem@davemloft.net, brouer@redhat.com,
	daniel@iogearbox.net, lorenzo.bianconi@redhat.com,
	dsahern@kernel.org
Subject: Re: [RFC bpf-next 1/2] bpf: cpumap: add the possibility to attach a eBPF program to cpumap
Date: Sun, 24 May 2020 11:22:14 -0600	[thread overview]
Message-ID: <21c30a1c-cebc-b2f2-be94-9db430610578@gmail.com> (raw)
In-Reply-To: <6685dc56730e109758bd3affb1680114c3064da1.1590162098.git.lorenzo@kernel.org>

On 5/22/20 10:11 AM, Lorenzo Bianconi wrote:
> @@ -307,8 +354,23 @@ static int cpu_map_kthread_run(void *data)
>  	return 0;
>  }
>  
> -static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu,
> -						       int map_id)
> +static int __cpu_map_load_bpf_program(struct bpf_cpu_map_entry *rcpu,
> +				      u32 prog_id)
> +{
> +	struct bpf_prog *prog;
> +
> +	/* TODO attach type */
> +	prog = bpf_prog_by_id(prog_id);
> +	if (IS_ERR(prog) || prog->type != BPF_PROG_TYPE_XDP)
> +		return -EINVAL;

Add check that expected_attach_type is NOT set since it uses existing
xdp programs which should not have it set.


  parent reply	other threads:[~2020-05-24 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 16:11 [RFC bpf-next 0/2] introduce support for XDP programs in cpumaps Lorenzo Bianconi
2020-05-22 16:11 ` [RFC bpf-next 1/2] bpf: cpumap: add the possibility to attach a eBPF program to cpumap Lorenzo Bianconi
2020-05-22 17:44   ` David Ahern
2020-05-22 17:54     ` Jesper Dangaard Brouer
2020-05-24 17:22   ` David Ahern [this message]
2020-05-22 16:11 ` [RFC bpf-next 2/2] samples/bpf: xdp_redirect_cpu: load a eBPF program on cpu_map Lorenzo Bianconi

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=21c30a1c-cebc-b2f2-be94-9db430610578@gmail.com \
    --to=dsahern@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --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.