lkml.org 
[lkml]   [2022]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC bpf-next 39/52] net, xdp: make &xdp_attachment_info a bit more useful in drivers
Date
Add a new field which will store an arbitrary 'driver cookie', the
closest usage is to store enum there corresponding to the metadata
types supported by a driver to shortcut them on hotpath.
In fact, it's just reusing the 4-byte padding at the end.
Also, make it possible to store BTF ID in LE rather than CPU
byteorder, so that drivers could save some cycles on [potential]
byteswapping on hotpath.

Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
---
include/net/xdp.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/net/xdp.h b/include/net/xdp.h
index d1fd809655be..5762ce18885f 100644
--- a/include/net/xdp.h
+++ b/include/net/xdp.h
@@ -380,8 +380,12 @@ void xdp_unreg_mem_model(struct xdp_mem_info *mem);

struct xdp_attachment_info {
struct bpf_prog *prog;
- u64 btf_id;
+ union {
+ __le64 btf_id_le;
+ u64 btf_id;
+ };
u32 meta_thresh;
+ u32 drv_cookie;
};

struct netdev_bpf;
--
2.36.1
\
 
 \ /
  Last update: 2022-06-28 21:55    [W:1.013 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site