0001
0002
0003
0004 #ifndef XSK_H_
0005 #define XSK_H_
0006
0007
0008
0009
0010
0011 #define XSK_NEXT_PG_CONTIG_SHIFT 0
0012 #define XSK_NEXT_PG_CONTIG_MASK BIT_ULL(XSK_NEXT_PG_CONTIG_SHIFT)
0013
0014 struct xdp_ring_offset_v1 {
0015 __u64 producer;
0016 __u64 consumer;
0017 __u64 desc;
0018 };
0019
0020 struct xdp_mmap_offsets_v1 {
0021 struct xdp_ring_offset_v1 rx;
0022 struct xdp_ring_offset_v1 tx;
0023 struct xdp_ring_offset_v1 fr;
0024 struct xdp_ring_offset_v1 cr;
0025 };
0026
0027
0028
0029
0030
0031 struct xsk_map_node {
0032 struct list_head node;
0033 struct xsk_map *map;
0034 struct xdp_sock __rcu **map_entry;
0035 };
0036
0037 static inline struct xdp_sock *xdp_sk(struct sock *sk)
0038 {
0039 return (struct xdp_sock *)sk;
0040 }
0041
0042 void xsk_map_try_sock_delete(struct xsk_map *map, struct xdp_sock *xs,
0043 struct xdp_sock __rcu **map_entry);
0044 void xsk_clear_pool_at_qid(struct net_device *dev, u16 queue_id);
0045 int xsk_reg_pool_at_qid(struct net_device *dev, struct xsk_buff_pool *pool,
0046 u16 queue_id);
0047
0048 #endif