Thread (20 messages) 20 messages, 2 authors, 2018-01-15

Re: [PATCH bpf-next v2 07/15] bpf: offload: add map offload infrastructure

flat view

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-01-14 23:37:23

Hi Jakub,

Series looks fine, just stumbled over one small thing here below.

On 01/12/2018 05:29 AM, Jakub Kicinski wrote:
[...]
quoted hunk ↗ jump to hunk
+bool bpf_offload_dev_match(struct bpf_prog *prog, struct bpf_map *map)
+{
+	struct bpf_offloaded_map *offmap;
+	struct bpf_prog_offload *offload;
+	bool ret;
+
+	if (!!bpf_prog_is_dev_bound(prog->aux) != !!bpf_map_is_dev_bound(map))
+		return false;
+	if (!bpf_prog_is_dev_bound(prog->aux))
+		return true;
Should this not say 'false' if the prog has no offload_requested ...
quoted hunk ↗ jump to hunk
+	down_read(&bpf_devs_lock);
+	offload = prog->aux->offload;
+	offmap = map_to_offmap(map);
+
+	ret = offload && offload->netdev == offmap->netdev;
... meaning we return true from bpf_offload_dev_match() only in the
case when netdevs match?
quoted hunk ↗ jump to hunk
+	up_read(&bpf_devs_lock);
+
+	return ret;
+}
Thanks,
Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help