Some network interfaces must allocate additional hardware resources to
support XDP filters retransmitting packets with XDP_TX.

However not all XDP filters do use XDP_TX, and there may not be any
additional send queues available for use.

XDP filters can indicate that they will never transmit by setting the
XDP_FLAGS_NO_TX flag in the IFLA_XDP_FLAGS attribute. This flag is
only advisory - some network drivers may still allocate send queues.

Signed-off-by: Charlie Somerville <char...@charlie.bz>
---
 include/uapi/linux/if_link.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 874cc12a34d9..b4ba4427cd98 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -1168,11 +1168,14 @@ enum {
 #define XDP_FLAGS_DRV_MODE             (1U << 2)
 #define XDP_FLAGS_HW_MODE              (1U << 3)
 #define XDP_FLAGS_REPLACE              (1U << 4)
+#define XDP_FLAGS_NO_TX                        (1U << 5)
 #define XDP_FLAGS_MODES                        (XDP_FLAGS_SKB_MODE | \
                                         XDP_FLAGS_DRV_MODE | \
                                         XDP_FLAGS_HW_MODE)
 #define XDP_FLAGS_MASK                 (XDP_FLAGS_UPDATE_IF_NOEXIST | \
-                                        XDP_FLAGS_MODES | XDP_FLAGS_REPLACE)
+                                        XDP_FLAGS_MODES | \
+                                        XDP_FLAGS_REPLACE | \
+                                        XDP_FLAGS_NO_TX)
 
 /* These are stored into IFLA_XDP_ATTACHED on dump. */
 enum {
-- 
2.30.0

Reply via email to