Thread (219 messages) flat view 219 messages, 14 authors, 2021-02-05

Re: [PATCHv6 bpf-next 2/3] sample/bpf: add xdp_redirect_map_multicast test

From: Hangbin Liu <hidden>
Date: 2020-07-10 06:41:58
Also in: bpf

On Fri, Jul 10, 2020 at 12:40:11AM +0200, Daniel Borkmann wrote:
quoted
+SEC("xdp_redirect_map_multi")
+int xdp_redirect_map_multi_prog(struct xdp_md *ctx)
+{
+	long *value;
+	u32 key = 0;
+
+	/* count packet in global counter */
+	value = bpf_map_lookup_elem(&rxcnt, &key);
+	if (value)
+		*value += 1;
+
+	return bpf_redirect_map_multi(&forward_map, &null_map,
+				      BPF_F_EXCLUDE_INGRESS);
Why not extending to allow use-case like ...

  return bpf_redirect_map_multi(&fwd_map, NULL, BPF_F_EXCLUDE_INGRESS);

... instead of requiring a dummy/'null' map?
I planed to let user set NULL, but the arg2_type is ARG_CONST_MAP_PTR, which
not allow NULL pointer.

Thanks
Hangbin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help