On 30/11/2021 12.53, Lorenzo Bianconi wrote:
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@xxxxxxxxxx>
---
net/core/filter.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index b70725313442..a87d835d1122 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4189,6 +4189,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;
+
This approach also exclude 'cpumap' use-case, which you AFAIK have added
MB support for in this patchset.
Generally this check is hopefully something we can remove again, once
drivers add MB ndo_xdp_xmit support.
ri->map_id = 0; /* Valid map id idr range: [1,INT_MAX[ */
ri->map_type = BPF_MAP_TYPE_UNSPEC;