1
2
3
4#ifndef _ICE_TXRX_LIB_H_
5#define _ICE_TXRX_LIB_H_
6#include "ice.h"
7
8
9
10
11
12
13
14
15
16
17
18static inline bool
19ice_test_staterr(union ice_32b_rx_flex_desc *rx_desc, const u16 stat_err_bits)
20{
21 return !!(rx_desc->wb.status_error0 & cpu_to_le16(stat_err_bits));
22}
23
24static inline __le64
25ice_build_ctob(u64 td_cmd, u64 td_offset, unsigned int size, u64 td_tag)
26{
27 return cpu_to_le64(ICE_TX_DESC_DTYPE_DATA |
28 (td_cmd << ICE_TXD_QW1_CMD_S) |
29 (td_offset << ICE_TXD_QW1_OFFSET_S) |
30 ((u64)size << ICE_TXD_QW1_TX_BUF_SZ_S) |
31 (td_tag << ICE_TXD_QW1_L2TAG1_S));
32}
33
34
35
36
37
38
39
40static inline void ice_xdp_ring_update_tail(struct ice_ring *xdp_ring)
41{
42
43
44
45 wmb();
46 writel_relaxed(xdp_ring->next_to_use, xdp_ring->tail);
47}
48
49void ice_finalize_xdp_rx(struct ice_ring *rx_ring, unsigned int xdp_res);
50int ice_xmit_xdp_buff(struct xdp_buff *xdp, struct ice_ring *xdp_ring);
51int ice_xmit_xdp_ring(void *data, u16 size, struct ice_ring *xdp_ring);
52void ice_release_rx_desc(struct ice_ring *rx_ring, u16 val);
53void
54ice_process_skb_fields(struct ice_ring *rx_ring,
55 union ice_32b_rx_flex_desc *rx_desc,
56 struct sk_buff *skb, u16 ptype);
57void
58ice_receive_skb(struct ice_ring *rx_ring, struct sk_buff *skb, u16 vlan_tag);
59#endif
60