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]
Message-ID: <20171006174552.34b6b8ba@redhat.com>
Date:   Fri, 6 Oct 2017 17:45:52 +0200
From:   Jesper Dangaard Brouer <brouer@...hat.com>
To:     Daniel Borkmann <daniel@...earbox.net>
Cc:     netdev@...r.kernel.org, jakub.kicinski@...ronome.com,
        "Michael S. Tsirkin" <mst@...hat.com>, pavel.odintsov@...il.com,
        Jason Wang <jasowang@...hat.com>, mchan@...adcom.com,
        John Fastabend <john.fastabend@...il.com>,
        peter.waskiewicz.jr@...el.com,
        Daniel Borkmann <borkmann@...earbox.net>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>,
        Andy Gospodarek <andy@...yhouse.net>, brouer@...hat.com
Subject: Re: [net-next V4 PATCH 2/5] bpf: XDP_REDIRECT enable use of cpumap

On Fri, 6 Oct 2017 13:17:48 +0200
Jesper Dangaard Brouer <brouer@...hat.com> wrote:

> > > +static void *__xdp_map_lookup_elem(struct bpf_map *map, u32 index)
> > > +{
> > > +	switch (map->map_type) {
> > > +	case BPF_MAP_TYPE_DEVMAP:
> > > +		return __dev_map_lookup_elem(map, index);
> > > +	case BPF_MAP_TYPE_CPUMAP:
> > > +		return __cpu_map_lookup_elem(map, index);
> > > +	default:
> > > +		return NULL;
> > > +	}    
> > 
> > Should we just have a callback and instead of the above use
> > map->ptr_lookup_elem() (or however we name it) ... lot of it
> > is pretty much the same logic as with devmap.  
> 
> We could extend struct bpf_map *map with such a callback, I was just
> afraid that this would be too invasive.
> 
> Performance wise, I don't thinks will hurt too much.
> http://www.cipht.net/2017/10/03/are-jump-tables-always-fastest.html

Looking at the code, I would like to postpone this callback work until
after this patchset is merged.  As this work will also touch devmap +
sockmap.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ