diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-25 05:37:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-25 05:37:07 -0400 |
commit | 0e2f65ee30eee2db054f7fd73f462c5da33ec963 (patch) | |
tree | 26c61eb7745da0c0d9135e9d12088f570cb8530d /net/sctp/outqueue.c | |
parent | da7878d75b8520c9ae00d27dfbbce546a7bfdfbb (diff) | |
parent | fb2e405fc1fc8b20d9c78eaa1c7fd5a297efde43 (diff) |
Merge branch 'linus' into x86/pebs
Conflicts:
arch/x86/Kconfig.cpu
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/setup_64.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r-- | net/sctp/outqueue.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index ace6770e9048..4328ad5439c9 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -71,6 +71,8 @@ static void sctp_mark_missing(struct sctp_outq *q, | |||
71 | 71 | ||
72 | static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn); | 72 | static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn); |
73 | 73 | ||
74 | static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout); | ||
75 | |||
74 | /* Add data to the front of the queue. */ | 76 | /* Add data to the front of the queue. */ |
75 | static inline void sctp_outq_head_data(struct sctp_outq *q, | 77 | static inline void sctp_outq_head_data(struct sctp_outq *q, |
76 | struct sctp_chunk *ch) | 78 | struct sctp_chunk *ch) |
@@ -702,6 +704,7 @@ int sctp_outq_uncork(struct sctp_outq *q) | |||
702 | return error; | 704 | return error; |
703 | } | 705 | } |
704 | 706 | ||
707 | |||
705 | /* | 708 | /* |
706 | * Try to flush an outqueue. | 709 | * Try to flush an outqueue. |
707 | * | 710 | * |
@@ -711,7 +714,7 @@ int sctp_outq_uncork(struct sctp_outq *q) | |||
711 | * locking concerns must be made. Today we use the sock lock to protect | 714 | * locking concerns must be made. Today we use the sock lock to protect |
712 | * this function. | 715 | * this function. |
713 | */ | 716 | */ |
714 | int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | 717 | static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) |
715 | { | 718 | { |
716 | struct sctp_packet *packet; | 719 | struct sctp_packet *packet; |
717 | struct sctp_packet singleton; | 720 | struct sctp_packet singleton; |
@@ -725,6 +728,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
725 | sctp_xmit_t status; | 728 | sctp_xmit_t status; |
726 | int error = 0; | 729 | int error = 0; |
727 | int start_timer = 0; | 730 | int start_timer = 0; |
731 | int one_packet = 0; | ||
728 | 732 | ||
729 | /* These transports have chunks to send. */ | 733 | /* These transports have chunks to send. */ |
730 | struct list_head transport_list; | 734 | struct list_head transport_list; |
@@ -830,20 +834,33 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
830 | if (sctp_test_T_bit(chunk)) { | 834 | if (sctp_test_T_bit(chunk)) { |
831 | packet->vtag = asoc->c.my_vtag; | 835 | packet->vtag = asoc->c.my_vtag; |
832 | } | 836 | } |
833 | case SCTP_CID_SACK: | 837 | /* The following chunks are "response" chunks, i.e. |
834 | case SCTP_CID_HEARTBEAT: | 838 | * they are generated in response to something we |
839 | * received. If we are sending these, then we can | ||
840 | * send only 1 packet containing these chunks. | ||
841 | */ | ||
835 | case SCTP_CID_HEARTBEAT_ACK: | 842 | case SCTP_CID_HEARTBEAT_ACK: |
836 | case SCTP_CID_SHUTDOWN: | ||
837 | case SCTP_CID_SHUTDOWN_ACK: | 843 | case SCTP_CID_SHUTDOWN_ACK: |
838 | case SCTP_CID_ERROR: | ||
839 | case SCTP_CID_COOKIE_ECHO: | ||
840 | case SCTP_CID_COOKIE_ACK: | 844 | case SCTP_CID_COOKIE_ACK: |
841 | case SCTP_CID_ECN_ECNE: | 845 | case SCTP_CID_COOKIE_ECHO: |
846 | case SCTP_CID_ERROR: | ||
842 | case SCTP_CID_ECN_CWR: | 847 | case SCTP_CID_ECN_CWR: |
843 | case SCTP_CID_ASCONF: | ||
844 | case SCTP_CID_ASCONF_ACK: | 848 | case SCTP_CID_ASCONF_ACK: |
849 | one_packet = 1; | ||
850 | /* Fall throught */ | ||
851 | |||
852 | case SCTP_CID_SACK: | ||
853 | case SCTP_CID_HEARTBEAT: | ||
854 | case SCTP_CID_SHUTDOWN: | ||
855 | case SCTP_CID_ECN_ECNE: | ||
856 | case SCTP_CID_ASCONF: | ||
845 | case SCTP_CID_FWD_TSN: | 857 | case SCTP_CID_FWD_TSN: |
846 | sctp_packet_transmit_chunk(packet, chunk); | 858 | status = sctp_packet_transmit_chunk(packet, chunk, |
859 | one_packet); | ||
860 | if (status != SCTP_XMIT_OK) { | ||
861 | /* put the chunk back */ | ||
862 | list_add(&chunk->list, &q->control_chunk_list); | ||
863 | } | ||
847 | break; | 864 | break; |
848 | 865 | ||
849 | default: | 866 | default: |
@@ -974,7 +991,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
974 | atomic_read(&chunk->skb->users) : -1); | 991 | atomic_read(&chunk->skb->users) : -1); |
975 | 992 | ||
976 | /* Add the chunk to the packet. */ | 993 | /* Add the chunk to the packet. */ |
977 | status = sctp_packet_transmit_chunk(packet, chunk); | 994 | status = sctp_packet_transmit_chunk(packet, chunk, 0); |
978 | 995 | ||
979 | switch (status) { | 996 | switch (status) { |
980 | case SCTP_XMIT_PMTU_FULL: | 997 | case SCTP_XMIT_PMTU_FULL: |
@@ -1239,7 +1256,6 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack) | |||
1239 | * Make sure the empty queue handler will get run later. | 1256 | * Make sure the empty queue handler will get run later. |
1240 | */ | 1257 | */ |
1241 | q->empty = (list_empty(&q->out_chunk_list) && | 1258 | q->empty = (list_empty(&q->out_chunk_list) && |
1242 | list_empty(&q->control_chunk_list) && | ||
1243 | list_empty(&q->retransmit)); | 1259 | list_empty(&q->retransmit)); |
1244 | if (!q->empty) | 1260 | if (!q->empty) |
1245 | goto finish; | 1261 | goto finish; |