lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Oct 2019 16:27:58 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Magnus Karlsson <magnus.karlsson@...el.com>
Cc:     bjorn.topel@...el.com, ast@...nel.org, daniel@...earbox.net,
        netdev@...r.kernel.org, jonathan.lemon@...il.com,
        linux-doc@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH bpf v2] xsk: improve documentation for AF_XDP

On Fri, Oct 18, 2019 at 11:33:40AM +0200, Magnus Karlsson wrote:
> +
> +   #include <linux/bpf.h>
> +   #include "bpf_helpers.h"
> +
> +   #define MAX_SOCKS 16
> +
> +   struct {
> +        __uint(type, BPF_MAP_TYPE_XSKMAP);
> +        __uint(max_entries, MAX_SOCKS);
> +        __uint(key_size, sizeof(int));
> +        __uint(value_size, sizeof(int));
> +   } xsks_map SEC(".maps");
> +
> +   struct {
> +        __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
> +        __uint(max_entries, 1);
> +        __type(key, int);
> +        __type(value, unsigned int);
> +   } rr_map SEC(".maps");

hmm. does xsks_map compile?

> +
> +   SEC("xdp_sock") int xdp_sock_prog(struct xdp_md *ctx)
> +   {
> +	int key = 0, idx;
> +	unsigned int *rr;
> +
> +	rr = bpf_map_lookup_elem(&rr_map, &key);
> +	if (!rr)
> +	   return XDP_ABORTED;

could you please use global data and avoid lookup?
The run-time will be much faster.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ