diff options
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r-- | net/sched/sch_sfq.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 239ec53a634d..54a36f43a1f1 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -92,8 +92,7 @@ typedef unsigned char sfq_index; | |||
92 | * while following values [SFQ_SLOTS ... SFQ_SLOTS + SFQ_DEPTH - 1] | 92 | * while following values [SFQ_SLOTS ... SFQ_SLOTS + SFQ_DEPTH - 1] |
93 | * are 'pointers' to dep[] array | 93 | * are 'pointers' to dep[] array |
94 | */ | 94 | */ |
95 | struct sfq_head | 95 | struct sfq_head { |
96 | { | ||
97 | sfq_index next; | 96 | sfq_index next; |
98 | sfq_index prev; | 97 | sfq_index prev; |
99 | }; | 98 | }; |
@@ -108,11 +107,10 @@ struct sfq_slot { | |||
108 | short allot; /* credit for this slot */ | 107 | short allot; /* credit for this slot */ |
109 | }; | 108 | }; |
110 | 109 | ||
111 | struct sfq_sched_data | 110 | struct sfq_sched_data { |
112 | { | ||
113 | /* Parameters */ | 111 | /* Parameters */ |
114 | int perturb_period; | 112 | int perturb_period; |
115 | unsigned quantum; /* Allotment per round: MUST BE >= MTU */ | 113 | unsigned int quantum; /* Allotment per round: MUST BE >= MTU */ |
116 | int limit; | 114 | int limit; |
117 | 115 | ||
118 | /* Variables */ | 116 | /* Variables */ |
@@ -137,12 +135,12 @@ static inline struct sfq_head *sfq_dep_head(struct sfq_sched_data *q, sfq_index | |||
137 | return &q->dep[val - SFQ_SLOTS]; | 135 | return &q->dep[val - SFQ_SLOTS]; |
138 | } | 136 | } |
139 | 137 | ||
140 | static __inline__ unsigned sfq_fold_hash(struct sfq_sched_data *q, u32 h, u32 h1) | 138 | static unsigned int sfq_fold_hash(struct sfq_sched_data *q, u32 h, u32 h1) |
141 | { | 139 | { |
142 | return jhash_2words(h, h1, q->perturbation) & (SFQ_HASH_DIVISOR - 1); | 140 | return jhash_2words(h, h1, q->perturbation) & (SFQ_HASH_DIVISOR - 1); |
143 | } | 141 | } |
144 | 142 | ||
145 | static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | 143 | static unsigned int sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) |
146 | { | 144 | { |
147 | u32 h, h2; | 145 | u32 h, h2; |
148 | 146 | ||
@@ -157,13 +155,13 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | |||
157 | iph = ip_hdr(skb); | 155 | iph = ip_hdr(skb); |
158 | h = (__force u32)iph->daddr; | 156 | h = (__force u32)iph->daddr; |
159 | h2 = (__force u32)iph->saddr ^ iph->protocol; | 157 | h2 = (__force u32)iph->saddr ^ iph->protocol; |
160 | if (iph->frag_off & htons(IP_MF|IP_OFFSET)) | 158 | if (iph->frag_off & htons(IP_MF | IP_OFFSET)) |
161 | break; | 159 | break; |
162 | poff = proto_ports_offset(iph->protocol); | 160 | poff = proto_ports_offset(iph->protocol); |
163 | if (poff >= 0 && | 161 | if (poff >= 0 && |
164 | pskb_network_may_pull(skb, iph->ihl * 4 + 4 + poff)) { | 162 | pskb_network_may_pull(skb, iph->ihl * 4 + 4 + poff)) { |
165 | iph = ip_hdr(skb); | 163 | iph = ip_hdr(skb); |
166 | h2 ^= *(u32*)((void *)iph + iph->ihl * 4 + poff); | 164 | h2 ^= *(u32 *)((void *)iph + iph->ihl * 4 + poff); |
167 | } | 165 | } |
168 | break; | 166 | break; |
169 | } | 167 | } |
@@ -181,7 +179,7 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | |||
181 | if (poff >= 0 && | 179 | if (poff >= 0 && |
182 | pskb_network_may_pull(skb, sizeof(*iph) + 4 + poff)) { | 180 | pskb_network_may_pull(skb, sizeof(*iph) + 4 + poff)) { |
183 | iph = ipv6_hdr(skb); | 181 | iph = ipv6_hdr(skb); |
184 | h2 ^= *(u32*)((void *)iph + sizeof(*iph) + poff); | 182 | h2 ^= *(u32 *)((void *)iph + sizeof(*iph) + poff); |
185 | } | 183 | } |
186 | break; | 184 | break; |
187 | } | 185 | } |