This source file includes following definitions.
- vnic_set_nic_cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _VNIC_NIC_H_
19 #define _VNIC_NIC_H_
20
21
22
23
24
25 #define vnic_set_nic_cfg fnic_set_nic_cfg
26
27 #define NIC_CFG_RSS_DEFAULT_CPU_MASK_FIELD 0xffUL
28 #define NIC_CFG_RSS_DEFAULT_CPU_SHIFT 0
29 #define NIC_CFG_RSS_HASH_TYPE (0xffUL << 8)
30 #define NIC_CFG_RSS_HASH_TYPE_MASK_FIELD 0xffUL
31 #define NIC_CFG_RSS_HASH_TYPE_SHIFT 8
32 #define NIC_CFG_RSS_HASH_BITS (7UL << 16)
33 #define NIC_CFG_RSS_HASH_BITS_MASK_FIELD 7UL
34 #define NIC_CFG_RSS_HASH_BITS_SHIFT 16
35 #define NIC_CFG_RSS_BASE_CPU (7UL << 19)
36 #define NIC_CFG_RSS_BASE_CPU_MASK_FIELD 7UL
37 #define NIC_CFG_RSS_BASE_CPU_SHIFT 19
38 #define NIC_CFG_RSS_ENABLE (1UL << 22)
39 #define NIC_CFG_RSS_ENABLE_MASK_FIELD 1UL
40 #define NIC_CFG_RSS_ENABLE_SHIFT 22
41 #define NIC_CFG_TSO_IPID_SPLIT_EN (1UL << 23)
42 #define NIC_CFG_TSO_IPID_SPLIT_EN_MASK_FIELD 1UL
43 #define NIC_CFG_TSO_IPID_SPLIT_EN_SHIFT 23
44 #define NIC_CFG_IG_VLAN_STRIP_EN (1UL << 24)
45 #define NIC_CFG_IG_VLAN_STRIP_EN_MASK_FIELD 1UL
46 #define NIC_CFG_IG_VLAN_STRIP_EN_SHIFT 24
47
48 static inline void vnic_set_nic_cfg(u32 *nic_cfg,
49 u8 rss_default_cpu, u8 rss_hash_type,
50 u8 rss_hash_bits, u8 rss_base_cpu,
51 u8 rss_enable, u8 tso_ipid_split_en,
52 u8 ig_vlan_strip_en)
53 {
54 *nic_cfg = (rss_default_cpu & NIC_CFG_RSS_DEFAULT_CPU_MASK_FIELD) |
55 ((rss_hash_type & NIC_CFG_RSS_HASH_TYPE_MASK_FIELD)
56 << NIC_CFG_RSS_HASH_TYPE_SHIFT) |
57 ((rss_hash_bits & NIC_CFG_RSS_HASH_BITS_MASK_FIELD)
58 << NIC_CFG_RSS_HASH_BITS_SHIFT) |
59 ((rss_base_cpu & NIC_CFG_RSS_BASE_CPU_MASK_FIELD)
60 << NIC_CFG_RSS_BASE_CPU_SHIFT) |
61 ((rss_enable & NIC_CFG_RSS_ENABLE_MASK_FIELD)
62 << NIC_CFG_RSS_ENABLE_SHIFT) |
63 ((tso_ipid_split_en & NIC_CFG_TSO_IPID_SPLIT_EN_MASK_FIELD)
64 << NIC_CFG_TSO_IPID_SPLIT_EN_SHIFT) |
65 ((ig_vlan_strip_en & NIC_CFG_IG_VLAN_STRIP_EN_MASK_FIELD)
66 << NIC_CFG_IG_VLAN_STRIP_EN_SHIFT);
67 }
68
69 #endif