diff options
-rw-r--r-- | Documentation/networking/ip-sysctl.txt | 4 | ||||
-rw-r--r-- | include/net/inet_frag.h | 20 | ||||
-rw-r--r-- | net/ieee802154/6lowpan/reassembly.c | 10 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 10 | ||||
-rw-r--r-- | net/ipv4/proc.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 10 | ||||
-rw-r--r-- | net/ipv6/proc.c | 2 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 6 |
8 files changed, 32 insertions, 32 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 6f2a3670e44b..5dc1a040a2f1 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -133,10 +133,10 @@ min_adv_mss - INTEGER | |||
133 | 133 | ||
134 | IP Fragmentation: | 134 | IP Fragmentation: |
135 | 135 | ||
136 | ipfrag_high_thresh - INTEGER | 136 | ipfrag_high_thresh - LONG INTEGER |
137 | Maximum memory used to reassemble IP fragments. | 137 | Maximum memory used to reassemble IP fragments. |
138 | 138 | ||
139 | ipfrag_low_thresh - INTEGER | 139 | ipfrag_low_thresh - LONG INTEGER |
140 | (Obsolete since linux-4.17) | 140 | (Obsolete since linux-4.17) |
141 | Maximum memory used to reassemble IP fragments before the kernel | 141 | Maximum memory used to reassemble IP fragments before the kernel |
142 | begins to remove incomplete fragment queues to free up resources. | 142 | begins to remove incomplete fragment queues to free up resources. |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 95e353e3305b..a52e7273e7a5 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -8,11 +8,11 @@ struct netns_frags { | |||
8 | struct rhashtable rhashtable ____cacheline_aligned_in_smp; | 8 | struct rhashtable rhashtable ____cacheline_aligned_in_smp; |
9 | 9 | ||
10 | /* Keep atomic mem on separate cachelines in structs that include it */ | 10 | /* Keep atomic mem on separate cachelines in structs that include it */ |
11 | atomic_t mem ____cacheline_aligned_in_smp; | 11 | atomic_long_t mem ____cacheline_aligned_in_smp; |
12 | /* sysctls */ | 12 | /* sysctls */ |
13 | long high_thresh; | ||
14 | long low_thresh; | ||
13 | int timeout; | 15 | int timeout; |
14 | int high_thresh; | ||
15 | int low_thresh; | ||
16 | int max_dist; | 16 | int max_dist; |
17 | struct inet_frags *f; | 17 | struct inet_frags *f; |
18 | }; | 18 | }; |
@@ -102,7 +102,7 @@ void inet_frags_fini(struct inet_frags *); | |||
102 | 102 | ||
103 | static inline int inet_frags_init_net(struct netns_frags *nf) | 103 | static inline int inet_frags_init_net(struct netns_frags *nf) |
104 | { | 104 | { |
105 | atomic_set(&nf->mem, 0); | 105 | atomic_long_set(&nf->mem, 0); |
106 | return rhashtable_init(&nf->rhashtable, &nf->f->rhash_params); | 106 | return rhashtable_init(&nf->rhashtable, &nf->f->rhash_params); |
107 | } | 107 | } |
108 | void inet_frags_exit_net(struct netns_frags *nf); | 108 | void inet_frags_exit_net(struct netns_frags *nf); |
@@ -119,19 +119,19 @@ static inline void inet_frag_put(struct inet_frag_queue *q) | |||
119 | 119 | ||
120 | /* Memory Tracking Functions. */ | 120 | /* Memory Tracking Functions. */ |
121 | 121 | ||
122 | static inline int frag_mem_limit(struct netns_frags *nf) | 122 | static inline long frag_mem_limit(const struct netns_frags *nf) |
123 | { | 123 | { |
124 | return atomic_read(&nf->mem); | 124 | return atomic_long_read(&nf->mem); |
125 | } | 125 | } |
126 | 126 | ||
127 | static inline void sub_frag_mem_limit(struct netns_frags *nf, int i) | 127 | static inline void sub_frag_mem_limit(struct netns_frags *nf, long val) |
128 | { | 128 | { |
129 | atomic_sub(i, &nf->mem); | 129 | atomic_long_sub(val, &nf->mem); |
130 | } | 130 | } |
131 | 131 | ||
132 | static inline void add_frag_mem_limit(struct netns_frags *nf, int i) | 132 | static inline void add_frag_mem_limit(struct netns_frags *nf, long val) |
133 | { | 133 | { |
134 | atomic_add(i, &nf->mem); | 134 | atomic_long_add(val, &nf->mem); |
135 | } | 135 | } |
136 | 136 | ||
137 | /* RFC 3168 support : | 137 | /* RFC 3168 support : |
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c index 1aec71a3f904..44f148a6bb57 100644 --- a/net/ieee802154/6lowpan/reassembly.c +++ b/net/ieee802154/6lowpan/reassembly.c | |||
@@ -411,23 +411,23 @@ err: | |||
411 | } | 411 | } |
412 | 412 | ||
413 | #ifdef CONFIG_SYSCTL | 413 | #ifdef CONFIG_SYSCTL |
414 | static int zero; | 414 | static long zero; |
415 | 415 | ||
416 | static struct ctl_table lowpan_frags_ns_ctl_table[] = { | 416 | static struct ctl_table lowpan_frags_ns_ctl_table[] = { |
417 | { | 417 | { |
418 | .procname = "6lowpanfrag_high_thresh", | 418 | .procname = "6lowpanfrag_high_thresh", |
419 | .data = &init_net.ieee802154_lowpan.frags.high_thresh, | 419 | .data = &init_net.ieee802154_lowpan.frags.high_thresh, |
420 | .maxlen = sizeof(int), | 420 | .maxlen = sizeof(unsigned long), |
421 | .mode = 0644, | 421 | .mode = 0644, |
422 | .proc_handler = proc_dointvec_minmax, | 422 | .proc_handler = proc_doulongvec_minmax, |
423 | .extra1 = &init_net.ieee802154_lowpan.frags.low_thresh | 423 | .extra1 = &init_net.ieee802154_lowpan.frags.low_thresh |
424 | }, | 424 | }, |
425 | { | 425 | { |
426 | .procname = "6lowpanfrag_low_thresh", | 426 | .procname = "6lowpanfrag_low_thresh", |
427 | .data = &init_net.ieee802154_lowpan.frags.low_thresh, | 427 | .data = &init_net.ieee802154_lowpan.frags.low_thresh, |
428 | .maxlen = sizeof(int), | 428 | .maxlen = sizeof(unsigned long), |
429 | .mode = 0644, | 429 | .mode = 0644, |
430 | .proc_handler = proc_dointvec_minmax, | 430 | .proc_handler = proc_doulongvec_minmax, |
431 | .extra1 = &zero, | 431 | .extra1 = &zero, |
432 | .extra2 = &init_net.ieee802154_lowpan.frags.high_thresh | 432 | .extra2 = &init_net.ieee802154_lowpan.frags.high_thresh |
433 | }, | 433 | }, |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index b0366224f314..053869f2c49b 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -678,23 +678,23 @@ struct sk_buff *ip_check_defrag(struct net *net, struct sk_buff *skb, u32 user) | |||
678 | EXPORT_SYMBOL(ip_check_defrag); | 678 | EXPORT_SYMBOL(ip_check_defrag); |
679 | 679 | ||
680 | #ifdef CONFIG_SYSCTL | 680 | #ifdef CONFIG_SYSCTL |
681 | static int zero; | 681 | static long zero; |
682 | 682 | ||
683 | static struct ctl_table ip4_frags_ns_ctl_table[] = { | 683 | static struct ctl_table ip4_frags_ns_ctl_table[] = { |
684 | { | 684 | { |
685 | .procname = "ipfrag_high_thresh", | 685 | .procname = "ipfrag_high_thresh", |
686 | .data = &init_net.ipv4.frags.high_thresh, | 686 | .data = &init_net.ipv4.frags.high_thresh, |
687 | .maxlen = sizeof(int), | 687 | .maxlen = sizeof(unsigned long), |
688 | .mode = 0644, | 688 | .mode = 0644, |
689 | .proc_handler = proc_dointvec_minmax, | 689 | .proc_handler = proc_doulongvec_minmax, |
690 | .extra1 = &init_net.ipv4.frags.low_thresh | 690 | .extra1 = &init_net.ipv4.frags.low_thresh |
691 | }, | 691 | }, |
692 | { | 692 | { |
693 | .procname = "ipfrag_low_thresh", | 693 | .procname = "ipfrag_low_thresh", |
694 | .data = &init_net.ipv4.frags.low_thresh, | 694 | .data = &init_net.ipv4.frags.low_thresh, |
695 | .maxlen = sizeof(int), | 695 | .maxlen = sizeof(unsigned long), |
696 | .mode = 0644, | 696 | .mode = 0644, |
697 | .proc_handler = proc_dointvec_minmax, | 697 | .proc_handler = proc_doulongvec_minmax, |
698 | .extra1 = &zero, | 698 | .extra1 = &zero, |
699 | .extra2 = &init_net.ipv4.frags.high_thresh | 699 | .extra2 = &init_net.ipv4.frags.high_thresh |
700 | }, | 700 | }, |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index aacfce0d7d82..a058de677e94 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -71,7 +71,7 @@ static int sockstat_seq_show(struct seq_file *seq, void *v) | |||
71 | sock_prot_inuse_get(net, &udplite_prot)); | 71 | sock_prot_inuse_get(net, &udplite_prot)); |
72 | seq_printf(seq, "RAW: inuse %d\n", | 72 | seq_printf(seq, "RAW: inuse %d\n", |
73 | sock_prot_inuse_get(net, &raw_prot)); | 73 | sock_prot_inuse_get(net, &raw_prot)); |
74 | seq_printf(seq, "FRAG: inuse %u memory %u\n", | 74 | seq_printf(seq, "FRAG: inuse %u memory %lu\n", |
75 | atomic_read(&net->ipv4.frags.rhashtable.nelems), | 75 | atomic_read(&net->ipv4.frags.rhashtable.nelems), |
76 | frag_mem_limit(&net->ipv4.frags)); | 76 | frag_mem_limit(&net->ipv4.frags)); |
77 | return 0; | 77 | return 0; |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index d866412b8f6c..603a39592859 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -63,7 +63,7 @@ struct nf_ct_frag6_skb_cb | |||
63 | static struct inet_frags nf_frags; | 63 | static struct inet_frags nf_frags; |
64 | 64 | ||
65 | #ifdef CONFIG_SYSCTL | 65 | #ifdef CONFIG_SYSCTL |
66 | static int zero; | 66 | static long zero; |
67 | 67 | ||
68 | static struct ctl_table nf_ct_frag6_sysctl_table[] = { | 68 | static struct ctl_table nf_ct_frag6_sysctl_table[] = { |
69 | { | 69 | { |
@@ -76,18 +76,18 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = { | |||
76 | { | 76 | { |
77 | .procname = "nf_conntrack_frag6_low_thresh", | 77 | .procname = "nf_conntrack_frag6_low_thresh", |
78 | .data = &init_net.nf_frag.frags.low_thresh, | 78 | .data = &init_net.nf_frag.frags.low_thresh, |
79 | .maxlen = sizeof(unsigned int), | 79 | .maxlen = sizeof(unsigned long), |
80 | .mode = 0644, | 80 | .mode = 0644, |
81 | .proc_handler = proc_dointvec_minmax, | 81 | .proc_handler = proc_doulongvec_minmax, |
82 | .extra1 = &zero, | 82 | .extra1 = &zero, |
83 | .extra2 = &init_net.nf_frag.frags.high_thresh | 83 | .extra2 = &init_net.nf_frag.frags.high_thresh |
84 | }, | 84 | }, |
85 | { | 85 | { |
86 | .procname = "nf_conntrack_frag6_high_thresh", | 86 | .procname = "nf_conntrack_frag6_high_thresh", |
87 | .data = &init_net.nf_frag.frags.high_thresh, | 87 | .data = &init_net.nf_frag.frags.high_thresh, |
88 | .maxlen = sizeof(unsigned int), | 88 | .maxlen = sizeof(unsigned long), |
89 | .mode = 0644, | 89 | .mode = 0644, |
90 | .proc_handler = proc_dointvec_minmax, | 90 | .proc_handler = proc_doulongvec_minmax, |
91 | .extra1 = &init_net.nf_frag.frags.low_thresh | 91 | .extra1 = &init_net.nf_frag.frags.low_thresh |
92 | }, | 92 | }, |
93 | { } | 93 | { } |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 8befeb91e071..a85f7e0b14b1 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -47,7 +47,7 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v) | |||
47 | sock_prot_inuse_get(net, &udplitev6_prot)); | 47 | sock_prot_inuse_get(net, &udplitev6_prot)); |
48 | seq_printf(seq, "RAW6: inuse %d\n", | 48 | seq_printf(seq, "RAW6: inuse %d\n", |
49 | sock_prot_inuse_get(net, &rawv6_prot)); | 49 | sock_prot_inuse_get(net, &rawv6_prot)); |
50 | seq_printf(seq, "FRAG6: inuse %u memory %u\n", | 50 | seq_printf(seq, "FRAG6: inuse %u memory %lu\n", |
51 | atomic_read(&net->ipv6.frags.rhashtable.nelems), | 51 | atomic_read(&net->ipv6.frags.rhashtable.nelems), |
52 | frag_mem_limit(&net->ipv6.frags)); | 52 | frag_mem_limit(&net->ipv6.frags)); |
53 | return 0; | 53 | return 0; |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 2a77fda5e3bc..905a8aee2671 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -552,15 +552,15 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = { | |||
552 | { | 552 | { |
553 | .procname = "ip6frag_high_thresh", | 553 | .procname = "ip6frag_high_thresh", |
554 | .data = &init_net.ipv6.frags.high_thresh, | 554 | .data = &init_net.ipv6.frags.high_thresh, |
555 | .maxlen = sizeof(int), | 555 | .maxlen = sizeof(unsigned long), |
556 | .mode = 0644, | 556 | .mode = 0644, |
557 | .proc_handler = proc_dointvec_minmax, | 557 | .proc_handler = proc_doulongvec_minmax, |
558 | .extra1 = &init_net.ipv6.frags.low_thresh | 558 | .extra1 = &init_net.ipv6.frags.low_thresh |
559 | }, | 559 | }, |
560 | { | 560 | { |
561 | .procname = "ip6frag_low_thresh", | 561 | .procname = "ip6frag_low_thresh", |
562 | .data = &init_net.ipv6.frags.low_thresh, | 562 | .data = &init_net.ipv6.frags.low_thresh, |
563 | .maxlen = sizeof(int), | 563 | .maxlen = sizeof(unsigned long), |
564 | .mode = 0644, | 564 | .mode = 0644, |
565 | .proc_handler = proc_dointvec_minmax, | 565 | .proc_handler = proc_dointvec_minmax, |
566 | .extra1 = &zero, | 566 | .extra1 = &zero, |