28 #define ENIC_MIN_WQ_DESCS 64
29 #define ENIC_MAX_WQ_DESCS 4096
30 #define ENIC_MIN_RQ_DESCS 64
31 #define ENIC_MAX_RQ_DESCS 4096
33 #define ENIC_MIN_MTU 68
34 #define ENIC_MAX_MTU 9000
36 #define ENIC_MULTICAST_PERFECT_FILTERS 32
37 #define ENIC_UNICAST_PERFECT_FILTERS 32
39 #define ENIC_NON_TSO_MAX_DESC 16
41 #define ENIC_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0)
43 static inline void enic_queue_wq_desc_ex(
struct vnic_wq *wq,
45 unsigned int mss_or_csum_offset,
unsigned int hdr_len,
46 int vlan_tag_insert,
unsigned int vlan_tag,
47 int offload_mode,
int cq_entry,
int sop,
int eop,
int loopback)
51 wq_enet_desc_enc(desc,
54 (
u16)mss_or_csum_offset,
55 (
u16)hdr_len, (
u8)offload_mode,
56 (
u8)eop, (
u8)cq_entry,
65 static inline void enic_queue_wq_desc_cont(
struct vnic_wq *wq,
69 enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len,
71 eop, 0 , eop, loopback);
74 static inline void enic_queue_wq_desc(
struct vnic_wq *wq,
void *os_buf,
78 enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len,
79 0, 0, vlan_tag_insert, vlan_tag,
81 eop, 1 , eop, loopback);
84 static inline void enic_queue_wq_desc_csum(
struct vnic_wq *wq,
86 int ip_csum,
int tcpudp_csum,
int vlan_tag_insert,
89 enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len,
90 (ip_csum ? 1 : 0) + (tcpudp_csum ? 2 : 0),
91 0, vlan_tag_insert, vlan_tag,
93 eop, 1 , eop, loopback);
96 static inline void enic_queue_wq_desc_csum_l4(
struct vnic_wq *wq,
97 void *os_buf,
dma_addr_t dma_addr,
unsigned int len,
98 unsigned int csum_offset,
unsigned int hdr_len,
99 int vlan_tag_insert,
unsigned int vlan_tag,
int eop,
int loopback)
101 enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len,
102 csum_offset, hdr_len, vlan_tag_insert, vlan_tag,
104 eop, 1 , eop, loopback);
107 static inline void enic_queue_wq_desc_tso(
struct vnic_wq *wq,
108 void *os_buf,
dma_addr_t dma_addr,
unsigned int len,
109 unsigned int mss,
unsigned int hdr_len,
int vlan_tag_insert,
110 unsigned int vlan_tag,
int eop,
int loopback)
112 enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len,
113 mss, hdr_len, vlan_tag_insert, vlan_tag,
115 eop, 1 , eop, loopback);
118 static inline void enic_queue_rq_desc(
struct vnic_rq *
rq,
119 void *os_buf,
unsigned int os_buf_index,
126 rq_enet_desc_enc(desc,
139 u8 rss_hash_bits,
u8 rss_base_cpu,
u8 rss_enable,
u8 tso_ipid_split_en,
140 u8 ig_vlan_strip_en);