aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-03-18 01:46:46 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-18 01:46:46 -0400
commit0382b9c35469be273ed10fa374496a924055a3c8 (patch)
treea71ff964e57ab8308bca073505aacfd7a3b4a764
parente6f1cebf71c4e7aae7dfa43414ce2631291def9f (diff)
[PKT_SCHED]: annotate cls_u32
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/pkt_cls.h8
-rw-r--r--net/sched/cls_u32.c8
-rw-r--r--net/sched/em_u32.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 28dfc61cf79e..99efbed81fa2 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -201,8 +201,8 @@ enum
201 201
202struct tc_u32_key 202struct tc_u32_key
203{ 203{
204 __u32 mask; 204 __be32 mask;
205 __u32 val; 205 __be32 val;
206 int off; 206 int off;
207 int offmask; 207 int offmask;
208}; 208};
@@ -213,12 +213,12 @@ struct tc_u32_sel
213 unsigned char offshift; 213 unsigned char offshift;
214 unsigned char nkeys; 214 unsigned char nkeys;
215 215
216 __u16 offmask; 216 __be16 offmask;
217 __u16 off; 217 __u16 off;
218 short offoff; 218 short offoff;
219 219
220 short hoff; 220 short hoff;
221 __u32 hmask; 221 __be32 hmask;
222 struct tc_u32_key keys[0]; 222 struct tc_u32_key keys[0];
223}; 223};
224 224
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index b18fa95ef248..c5c16b4b6e98 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -89,7 +89,7 @@ static const struct tcf_ext_map u32_ext_map = {
89 89
90static struct tc_u_common *u32_list; 90static struct tc_u_common *u32_list;
91 91
92static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift) 92static __inline__ unsigned u32_hash_fold(__be32 key, struct tc_u32_sel *sel, u8 fshift)
93{ 93{
94 unsigned h = ntohl(key & sel->hmask)>>fshift; 94 unsigned h = ntohl(key & sel->hmask)>>fshift;
95 95
@@ -137,7 +137,7 @@ next_knode:
137 137
138 for (i = n->sel.nkeys; i>0; i--, key++) { 138 for (i = n->sel.nkeys; i>0; i--, key++) {
139 139
140 if ((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) { 140 if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
141 n = n->next; 141 n = n->next;
142 goto next_knode; 142 goto next_knode;
143 } 143 }
@@ -182,7 +182,7 @@ check_terminal:
182 ht = n->ht_down; 182 ht = n->ht_down;
183 sel = 0; 183 sel = 0;
184 if (ht->divisor) 184 if (ht->divisor)
185 sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift); 185 sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
186 186
187 if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) 187 if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
188 goto next_ht; 188 goto next_ht;
@@ -190,7 +190,7 @@ check_terminal:
190 if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { 190 if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
191 off2 = n->sel.off + 3; 191 off2 = n->sel.off + 3;
192 if (n->sel.flags&TC_U32_VAROFFSET) 192 if (n->sel.flags&TC_U32_VAROFFSET)
193 off2 += ntohs(n->sel.offmask & *(u16*)(ptr+n->sel.offoff)) >>n->sel.offshift; 193 off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
194 off2 &= ~3; 194 off2 &= ~3;
195 } 195 }
196 if (n->sel.flags&TC_U32_EAT) { 196 if (n->sel.flags&TC_U32_EAT) {
diff --git a/net/sched/em_u32.c b/net/sched/em_u32.c
index 112796e4a7c4..953f1479f7da 100644
--- a/net/sched/em_u32.c
+++ b/net/sched/em_u32.c
@@ -35,7 +35,7 @@ static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em,
35 if (!tcf_valid_offset(skb, ptr, sizeof(u32))) 35 if (!tcf_valid_offset(skb, ptr, sizeof(u32)))
36 return 0; 36 return 0;
37 37
38 return !(((*(u32*) ptr) ^ key->val) & key->mask); 38 return !(((*(__be32*) ptr) ^ key->val) & key->mask);
39} 39}
40 40
41static struct tcf_ematch_ops em_u32_ops = { 41static struct tcf_ematch_ops em_u32_ops = {