All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Mauricio Vasquez B <mauricio.vasquez@polito.it>,
	Alexei Starovoitov <ast@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/3] bpf: add bpf queue map
Date: Tue, 7 Aug 2018 15:52:51 +0200	[thread overview]
Message-ID: <7e8662a7-dc0d-a27e-921b-11d98c3ba1aa@iogearbox.net> (raw)
In-Reply-To: <153356390770.6981.4228793745105954649.stgit@kernel>

On 08/06/2018 03:58 PM, Mauricio Vasquez B wrote:
> Bpf queue implements a LIFO/FIFO data containers for ebpf programs.
> 
> It allows to push an element to the queue by using the update operation
> and to pop an element from the queue by using the lookup operation.
> 
> A use case for this is to keep track of a pool of elements, like
> network ports in a SNAT.
> 
> Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
[...]
> +static int prealloc_init(struct bpf_queue *queue)
> +{
> +	u32 node_size = sizeof(struct queue_node) +
> +			round_up(queue->map.value_size, 8);
> +	u32 num_entries = queue->map.max_entries;
> +	int err;
> +
> +	queue->nodes = bpf_map_area_alloc(node_size * num_entries,
> +					  queue->map.numa_node);

That doesn't work either. If you don't set numa node, then here in
your case you'll always use numa node 0, which is unintentional.
You need to get the node via bpf_map_attr_numa_node(attr) helper.
Same issue in queue_map_update_elem().

  parent reply	other threads:[~2018-08-07 16:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 13:58 [PATCH bpf-next 0/3] Implement bpf map queue Mauricio Vasquez B
2018-08-06 13:58 ` [PATCH bpf-next 1/3] bpf: add bpf queue map Mauricio Vasquez B
2018-08-07 13:40   ` Daniel Borkmann
2018-08-09  2:50     ` Mauricio Vasquez
2018-08-07 13:52   ` Daniel Borkmann [this message]
2018-08-09  2:55     ` Mauricio Vasquez
2018-08-07 14:42   ` Alexei Starovoitov
2018-08-09  3:08     ` Mauricio Vasquez
2018-08-09  4:48       ` Alexei Starovoitov
2018-08-09  9:02         ` Daniel Borkmann
2018-08-09 14:51           ` Mauricio Vasquez
2018-08-09 16:23             ` Alexei Starovoitov
2018-08-09 23:41               ` Mauricio Vasquez
2018-08-10  3:09                 ` Alexei Starovoitov
2018-08-06 13:58 ` [PATCH bpf-next 2/3] selftests/bpf: add test cases for BPF_MAP_TYPE_QUEUE Mauricio Vasquez B
2018-08-07 13:42   ` Daniel Borkmann
2018-08-06 13:58 ` [PATCH bpf-next 3/3] bpf: add sample " Mauricio Vasquez B
2018-08-07 13:44   ` Daniel Borkmann
2018-08-09  2:52     ` Mauricio Vasquez
2018-08-07 20:31   ` Jakub Kicinski

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=7e8662a7-dc0d-a27e-921b-11d98c3ba1aa@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=mauricio.vasquez@polito.it \
    --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.