aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r--net/decnet/dn_route.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 80a3de4906d3..586302e557ad 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -122,7 +122,7 @@ static int dn_route_input(struct sk_buff *);
122static void dn_run_flush(unsigned long dummy); 122static void dn_run_flush(unsigned long dummy);
123 123
124static struct dn_rt_hash_bucket *dn_rt_hash_table; 124static struct dn_rt_hash_bucket *dn_rt_hash_table;
125static unsigned dn_rt_hash_mask; 125static unsigned int dn_rt_hash_mask;
126 126
127static struct timer_list dn_route_timer; 127static struct timer_list dn_route_timer;
128static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0); 128static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0);
@@ -149,13 +149,13 @@ static void dn_dst_destroy(struct dst_entry *dst)
149 dst_destroy_metrics_generic(dst); 149 dst_destroy_metrics_generic(dst);
150} 150}
151 151
152static __inline__ unsigned dn_hash(__le16 src, __le16 dst) 152static __inline__ unsigned int dn_hash(__le16 src, __le16 dst)
153{ 153{
154 __u16 tmp = (__u16 __force)(src ^ dst); 154 __u16 tmp = (__u16 __force)(src ^ dst);
155 tmp ^= (tmp >> 3); 155 tmp ^= (tmp >> 3);
156 tmp ^= (tmp >> 5); 156 tmp ^= (tmp >> 5);
157 tmp ^= (tmp >> 10); 157 tmp ^= (tmp >> 10);
158 return dn_rt_hash_mask & (unsigned)tmp; 158 return dn_rt_hash_mask & (unsigned int)tmp;
159} 159}
160 160
161static inline void dnrt_free(struct dn_route *rt) 161static inline void dnrt_free(struct dn_route *rt)
@@ -297,7 +297,7 @@ static inline int compare_keys(struct flowidn *fl1, struct flowidn *fl2)
297 (fl1->flowidn_iif ^ fl2->flowidn_iif)) == 0; 297 (fl1->flowidn_iif ^ fl2->flowidn_iif)) == 0;
298} 298}
299 299
300static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route **rp) 300static int dn_insert_route(struct dn_route *rt, unsigned int hash, struct dn_route **rp)
301{ 301{
302 struct dn_route *rth; 302 struct dn_route *rth;
303 struct dn_route __rcu **rthp; 303 struct dn_route __rcu **rthp;
@@ -748,8 +748,7 @@ static int dn_output(struct sk_buff *skb)
748 dn_to_neigh_output); 748 dn_to_neigh_output);
749 749
750error: 750error:
751 if (net_ratelimit()) 751 net_dbg_ratelimited("dn_output: This should not happen\n");
752 printk(KERN_DEBUG "dn_output: This should not happen\n");
753 752
754 kfree_skb(skb); 753 kfree_skb(skb);
755 754
@@ -807,12 +806,10 @@ drop:
807 */ 806 */
808static int dn_rt_bug(struct sk_buff *skb) 807static int dn_rt_bug(struct sk_buff *skb)
809{ 808{
810 if (net_ratelimit()) { 809 struct dn_skb_cb *cb = DN_SKB_CB(skb);
811 struct dn_skb_cb *cb = DN_SKB_CB(skb);
812 810
813 printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n", 811 net_dbg_ratelimited("dn_rt_bug: skb from:%04x to:%04x\n",
814 le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); 812 le16_to_cpu(cb->src), le16_to_cpu(cb->dst));
815 }
816 813
817 kfree_skb(skb); 814 kfree_skb(skb);
818 815
@@ -934,8 +931,8 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowidn *o
934 struct dn_route *rt = NULL; 931 struct dn_route *rt = NULL;
935 struct net_device *dev_out = NULL, *dev; 932 struct net_device *dev_out = NULL, *dev;
936 struct neighbour *neigh = NULL; 933 struct neighbour *neigh = NULL;
937 unsigned hash; 934 unsigned int hash;
938 unsigned flags = 0; 935 unsigned int flags = 0;
939 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNICAST }; 936 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNICAST };
940 int err; 937 int err;
941 int free_res = 0; 938 int free_res = 0;
@@ -1209,7 +1206,7 @@ e_neighbour:
1209 */ 1206 */
1210static int __dn_route_output_key(struct dst_entry **pprt, const struct flowidn *flp, int flags) 1207static int __dn_route_output_key(struct dst_entry **pprt, const struct flowidn *flp, int flags)
1211{ 1208{
1212 unsigned hash = dn_hash(flp->saddr, flp->daddr); 1209 unsigned int hash = dn_hash(flp->saddr, flp->daddr);
1213 struct dn_route *rt = NULL; 1210 struct dn_route *rt = NULL;
1214 1211
1215 if (!(flags & MSG_TRYHARD)) { 1212 if (!(flags & MSG_TRYHARD)) {
@@ -1275,7 +1272,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1275 struct net_device *out_dev = NULL; 1272 struct net_device *out_dev = NULL;
1276 struct dn_dev *dn_db; 1273 struct dn_dev *dn_db;
1277 struct neighbour *neigh = NULL; 1274 struct neighbour *neigh = NULL;
1278 unsigned hash; 1275 unsigned int hash;
1279 int flags = 0; 1276 int flags = 0;
1280 __le16 gateway = 0; 1277 __le16 gateway = 0;
1281 __le16 local_src = 0; 1278 __le16 local_src = 0;
@@ -1327,9 +1324,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1327 1324
1328 out_dev = DN_FIB_RES_DEV(res); 1325 out_dev = DN_FIB_RES_DEV(res);
1329 if (out_dev == NULL) { 1326 if (out_dev == NULL) {
1330 if (net_ratelimit()) 1327 net_crit_ratelimited("Bug in dn_route_input_slow() No output device\n");
1331 printk(KERN_CRIT "Bug in dn_route_input_slow() "
1332 "No output device\n");
1333 goto e_inval; 1328 goto e_inval;
1334 } 1329 }
1335 dev_hold(out_dev); 1330 dev_hold(out_dev);
@@ -1490,7 +1485,7 @@ static int dn_route_input(struct sk_buff *skb)
1490{ 1485{
1491 struct dn_route *rt; 1486 struct dn_route *rt;
1492 struct dn_skb_cb *cb = DN_SKB_CB(skb); 1487 struct dn_skb_cb *cb = DN_SKB_CB(skb);
1493 unsigned hash = dn_hash(cb->src, cb->dst); 1488 unsigned int hash = dn_hash(cb->src, cb->dst);
1494 1489
1495 if (skb_dst(skb)) 1490 if (skb_dst(skb))
1496 return 0; 1491 return 0;