Skip to content

Commit

Permalink
net: include xdp generic metadata definition
Browse files Browse the repository at this point in the history
Definition is only a proposal. There should be free place for 8B of tx
timestamp.

Signed-off-by: Michal Swiatkowski <[email protected]>
  • Loading branch information
mswiatko committed Aug 10, 2021
1 parent 7a1a7af commit fcd1d41
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/net/xdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ struct xdp_buff {
u32 frame_sz; /* frame size to deduce data_hard_end/reserved tailroom*/
};

struct xdp_meta_generic {
// Tx part
u32 flags;
u16 free_slot;
u16 csum_off;
u16 txcvid;

// Rx part
u16 rxcvid;
u32 csum;
u32 hash;
u64 tstamp;

// BTF ID
u32 btf_id;
} __packed __aligned(8);
static_assert(sizeof(struct xdp_meta_generic) == 32);

static __always_inline void
xdp_init_buff(struct xdp_buff *xdp, u32 frame_sz, struct xdp_rxq_info *rxq)
{
Expand Down

0 comments on commit fcd1d41

Please sign in to comment.