aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid3.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-12-06 09:28:13 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:41 -0500
commit34a9e7ea91bb4acb45ae5331e7403304029329b2 (patch)
tree196c60bbe79f4d480cefa9d141a6096f3450fa75 /net/dccp/ccids/ccid3.c
parente9c8b24a6ade50315f3c080799da45ddadf42269 (diff)
[TFRC]: Make the rx history slab be global
This is in preparation for merging the new rx history code written by Gerrit Renker. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r--net/dccp/ccids/ccid3.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 49338370eb04..2ba0a7c470d1 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -49,8 +49,6 @@ static int ccid3_debug;
49#define ccid3_pr_debug(format, a...) 49#define ccid3_pr_debug(format, a...)
50#endif 50#endif
51 51
52static struct dccp_rx_hist *ccid3_rx_hist;
53
54/* 52/*
55 * Transmitter Half-Connection Routines 53 * Transmitter Half-Connection Routines
56 */ 54 */
@@ -807,9 +805,9 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk,
807 } 805 }
808 806
809detect_out: 807detect_out:
810 dccp_rx_hist_add_packet(ccid3_rx_hist, &hcrx->ccid3hcrx_hist, 808 dccp_rx_hist_add_packet(&hcrx->ccid3hcrx_hist,
811 &hcrx->ccid3hcrx_li_hist, packet, 809 &hcrx->ccid3hcrx_li_hist, packet,
812 hcrx->ccid3hcrx_seqno_nonloss); 810 hcrx->ccid3hcrx_seqno_nonloss);
813 return loss; 811 return loss;
814} 812}
815 813
@@ -852,8 +850,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
852 return; 850 return;
853 } 851 }
854 852
855 packet = dccp_rx_hist_entry_new(ccid3_rx_hist, opt_recv->dccpor_ndp, 853 packet = dccp_rx_hist_entry_new(opt_recv->dccpor_ndp, skb, GFP_ATOMIC);
856 skb, GFP_ATOMIC);
857 if (unlikely(packet == NULL)) { 854 if (unlikely(packet == NULL)) {
858 DCCP_WARN("%s(%p), Not enough mem to add rx packet " 855 DCCP_WARN("%s(%p), Not enough mem to add rx packet "
859 "to history, consider it lost!\n", dccp_role(sk), sk); 856 "to history, consider it lost!\n", dccp_role(sk), sk);
@@ -936,7 +933,7 @@ static void ccid3_hc_rx_exit(struct sock *sk)
936 ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM); 933 ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM);
937 934
938 /* Empty packet history */ 935 /* Empty packet history */
939 dccp_rx_hist_purge(ccid3_rx_hist, &hcrx->ccid3hcrx_hist); 936 dccp_rx_hist_purge(&hcrx->ccid3hcrx_hist);
940 937
941 /* Empty loss interval history */ 938 /* Empty loss interval history */
942 dccp_li_hist_purge(&hcrx->ccid3hcrx_li_hist); 939 dccp_li_hist_purge(&hcrx->ccid3hcrx_li_hist);
@@ -1013,33 +1010,13 @@ MODULE_PARM_DESC(ccid3_debug, "Enable debug messages");
1013 1010
1014static __init int ccid3_module_init(void) 1011static __init int ccid3_module_init(void)
1015{ 1012{
1016 int rc = -ENOBUFS; 1013 return ccid_register(&ccid3);
1017
1018 ccid3_rx_hist = dccp_rx_hist_new("ccid3");
1019 if (ccid3_rx_hist == NULL)
1020 goto out;
1021
1022 rc = ccid_register(&ccid3);
1023 if (rc != 0)
1024 goto out_free_rx;
1025out:
1026 return rc;
1027
1028out_free_rx:
1029 dccp_rx_hist_delete(ccid3_rx_hist);
1030 ccid3_rx_hist = NULL;
1031 goto out;
1032} 1014}
1033module_init(ccid3_module_init); 1015module_init(ccid3_module_init);
1034 1016
1035static __exit void ccid3_module_exit(void) 1017static __exit void ccid3_module_exit(void)
1036{ 1018{
1037 ccid_unregister(&ccid3); 1019 ccid_unregister(&ccid3);
1038
1039 if (ccid3_rx_hist != NULL) {
1040 dccp_rx_hist_delete(ccid3_rx_hist);
1041 ccid3_rx_hist = NULL;
1042 }
1043} 1020}
1044module_exit(ccid3_module_exit); 1021module_exit(ccid3_module_exit);
1045 1022