Thread (38 messages) 38 messages, 4 authors, 2021-11-11
STALE1675d
Revisions (7)
  1. v17 current
  2. v18 [diff vs current]
  3. v19 [diff vs current]
  4. v20 [diff vs current]
  5. v21 [diff vs current]
  6. v22 [diff vs current]
  7. v23 [diff vs current]

[PATCH v17 bpf-next 23/23] xdp: disable XDP_REDIRECT for xdp multi-buff

From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: 2021-11-04 17:37:50
Also in: bpf
Subsystem: bpf [general] (safe dynamic programs and tools), bpf [networking] (tcx & tc bpf, sock_addr), networking [general], the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

XDP_REDIRECT is not fully supported yet for xdp multi-buff since not
all XDP capable drivers can map non-linear xdp_frame in ndo_xdp_xmit
so disable it for the moment.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 net/core/filter.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index 534305037ad7..00e08bdeb5f2 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4183,6 +4183,13 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
 	struct bpf_map *map;
 	int err;
 
+	/* XDP_REDIRECT is not fully supported yet for xdp multi-buff since
+	 * not all XDP capable drivers can map non-linear xdp_frame in
+	 * ndo_xdp_xmit.
+	 */
+	if (unlikely(xdp_buff_is_mb(xdp)))
+		return -EOPNOTSUPP;
+
 	ri->map_id = 0; /* Valid map id idr range: [1,INT_MAX[ */
 	ri->map_type = BPF_MAP_TYPE_UNSPEC;
 
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help