[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b90891939e6a4c9a803cd1b5072bb971baa4fb69.1636044387.git.lorenzo@kernel.org>
Date: Thu, 4 Nov 2021 18:35:43 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: bpf@...r.kernel.org, netdev@...r.kernel.org
Cc: lorenzo.bianconi@...hat.com, davem@...emloft.net, kuba@...nel.org,
ast@...nel.org, daniel@...earbox.net, shayagr@...zon.com,
john.fastabend@...il.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: [PATCH v17 bpf-next 23/23] xdp: disable XDP_REDIRECT for xdp multi-buff
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@...nel.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
Powered by blists - more mailing lists