From: Charlie Somerville <charlie@charlie.bz>
To: davem@davemloft.net, kuba@kernel.org, mst@redhat.com,
jasowang@redhat.com
Cc: netdev@vger.kernel.org, Charlie Somerville <charlie@charlie.bz>
Subject: [PATCH net-next 1/2] xdp: Add XDP_FLAGS_NO_TX flag
Date: Sat, 9 Jan 2021 13:49:49 +1100 [thread overview]
Message-ID: <20210109024950.4043819-2-charlie@charlie.bz> (raw)
In-Reply-To: <20210109024950.4043819-1-charlie@charlie.bz>
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 <charlie@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
next prev parent reply other threads:[~2021-01-09 2:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 2:49 [PATCH net-next 0/2] Introduce XDP_FLAGS_NO_TX flag Charlie Somerville
2021-01-09 2:49 ` Charlie Somerville [this message]
2021-01-09 2:49 ` [PATCH net-next 2/2] virtio_net: Implement XDP_FLAGS_NO_TX support Charlie Somerville
2021-01-10 17:31 ` Shay Agroskin
2021-01-11 1:24 ` Charlie Somerville
2021-01-11 10:15 ` Shay Agroskin
2021-01-11 11:10 ` [PATCH net-next 0/2] Introduce XDP_FLAGS_NO_TX flag Toke Høiland-Jørgensen
2021-01-12 3:03 ` Jason Wang
2021-01-12 4:38 ` Charlie Somerville
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210109024950.4043819-2-charlie@charlie.bz \
--to=charlie@charlie.bz \
--cc=davem@davemloft.net \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).