[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ya5jG4DaiDTq7AvL@lore-desk>
Date: Mon, 6 Dec 2021 20:23:07 +0100
From: Lorenzo Bianconi <lorenzo.bianconi@...hat.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Lorenzo Bianconi <lorenzo@...nel.org>, bpf@...r.kernel.org,
netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
ast@...nel.org, daniel@...earbox.net, shayagr@...zon.com,
dsahern@...nel.org, brouer@...hat.com, echaudro@...hat.com,
jasowang@...hat.com, alexander.duyck@...il.com, saeed@...nel.org,
maciej.fijalkowski@...el.com, magnus.karlsson@...el.com,
tirthendu.sarkar@...el.com, toke@...hat.com
Subject: Re: [PATCH v19 bpf-next 19/23] bpf: generalise tail call map
compatibility check
> > From: Toke Hoiland-Jorgensen <toke@...hat.com>
> >
> > The check for tail call map compatibility ensures that tail calls only
> > happen between maps of the same type. To ensure backwards compatibility for
> > XDP multi-buffer we need a similar type of check for cpumap and devmap
> > programs, so move the state from bpf_array_aux into bpf_map, add xdp_mb to
> > the check, and apply the same check to cpumap and devmap.
> >
> > Co-developed-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > Signed-off-by: Toke Hoiland-Jorgensen <toke@...hat.com>
> > ---
>
> ...
>
> > -bool bpf_prog_array_compatible(struct bpf_array *array, const struct bpf_prog *fp);
> > +static inline bool map_type_contains_progs(struct bpf_map *map)
>
> Maybe map_type_check_needed()? Just noticing that devmap doesn't contain
> progs.
ack, I am fine with it. Toke?
>
> > +{
> > + return map->map_type == BPF_MAP_TYPE_PROG_ARRAY ||
> > + map->map_type == BPF_MAP_TYPE_DEVMAP ||
> > + map->map_type == BPF_MAP_TYPE_CPUMAP;
> > +}
> > +
> > +bool bpf_prog_map_compatible(struct bpf_map *map, const struct bpf_prog *fp);
> > int bpf_prog_calc_tag(struct bpf_prog *fp);
>
> Otherwise LGTM.
>
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists