aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_sideeffect.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/sctp/sm_sideeffect.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'net/sctp/sm_sideeffect.c')
-rw-r--r--net/sctp/sm_sideeffect.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index f5e5e27cac5e..6e0f88295aaf 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -47,6 +47,8 @@
47 * be incorporated into the next SCTP release. 47 * be incorporated into the next SCTP release.
48 */ 48 */
49 49
50#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
51
50#include <linux/skbuff.h> 52#include <linux/skbuff.h>
51#include <linux/types.h> 53#include <linux/types.h>
52#include <linux/socket.h> 54#include <linux/socket.h>
@@ -480,7 +482,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
480 * If the timer was a heartbeat, we only increment error counts 482 * If the timer was a heartbeat, we only increment error counts
481 * when we already have an outstanding HEARTBEAT that has not 483 * when we already have an outstanding HEARTBEAT that has not
482 * been acknowledged. 484 * been acknowledged.
483 * Additionaly, some tranport states inhibit error increments. 485 * Additionally, some tranport states inhibit error increments.
484 */ 486 */
485 if (!is_hb) { 487 if (!is_hb) {
486 asoc->overall_error_count++; 488 asoc->overall_error_count++;
@@ -593,8 +595,7 @@ static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
593 * fail during INIT processing (due to malloc problems), 595 * fail during INIT processing (due to malloc problems),
594 * just return the error and stop processing the stack. 596 * just return the error and stop processing the stack.
595 */ 597 */
596 if (!sctp_process_init(asoc, chunk->chunk_hdr->type, 598 if (!sctp_process_init(asoc, chunk, sctp_source(chunk), peer_init, gfp))
597 sctp_source(chunk), peer_init, gfp))
598 error = -ENOMEM; 599 error = -ENOMEM;
599 else 600 else
600 error = 0; 601 error = 0;
@@ -669,10 +670,19 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
669 /* 8.3 Upon the receipt of the HEARTBEAT ACK, the sender of the 670 /* 8.3 Upon the receipt of the HEARTBEAT ACK, the sender of the
670 * HEARTBEAT should clear the error counter of the destination 671 * HEARTBEAT should clear the error counter of the destination
671 * transport address to which the HEARTBEAT was sent. 672 * transport address to which the HEARTBEAT was sent.
672 * The association's overall error count is also cleared.
673 */ 673 */
674 t->error_count = 0; 674 t->error_count = 0;
675 t->asoc->overall_error_count = 0; 675
676 /*
677 * Although RFC4960 specifies that the overall error count must
678 * be cleared when a HEARTBEAT ACK is received, we make an
679 * exception while in SHUTDOWN PENDING. If the peer keeps its
680 * window shut forever, we may never be able to transmit our
681 * outstanding data and rely on the retransmission limit be reached
682 * to shutdown the association.
683 */
684 if (t->asoc->state != SCTP_STATE_SHUTDOWN_PENDING)
685 t->asoc->overall_error_count = 0;
676 686
677 /* Clear the hb_sent flag to signal that we had a good 687 /* Clear the hb_sent flag to signal that we had a good
678 * acknowledgement. 688 * acknowledgement.
@@ -1146,26 +1156,23 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
1146 1156
1147 case SCTP_DISPOSITION_VIOLATION: 1157 case SCTP_DISPOSITION_VIOLATION:
1148 if (net_ratelimit()) 1158 if (net_ratelimit())
1149 printk(KERN_ERR "sctp protocol violation state %d " 1159 pr_err("protocol violation state %d chunkid %d\n",
1150 "chunkid %d\n", state, subtype.chunk); 1160 state, subtype.chunk);
1151 break; 1161 break;
1152 1162
1153 case SCTP_DISPOSITION_NOT_IMPL: 1163 case SCTP_DISPOSITION_NOT_IMPL:
1154 printk(KERN_WARNING "sctp unimplemented feature in state %d, " 1164 pr_warn("unimplemented feature in state %d, event_type %d, event_id %d\n",
1155 "event_type %d, event_id %d\n", 1165 state, event_type, subtype.chunk);
1156 state, event_type, subtype.chunk);
1157 break; 1166 break;
1158 1167
1159 case SCTP_DISPOSITION_BUG: 1168 case SCTP_DISPOSITION_BUG:
1160 printk(KERN_ERR "sctp bug in state %d, " 1169 pr_err("bug in state %d, event_type %d, event_id %d\n",
1161 "event_type %d, event_id %d\n",
1162 state, event_type, subtype.chunk); 1170 state, event_type, subtype.chunk);
1163 BUG(); 1171 BUG();
1164 break; 1172 break;
1165 1173
1166 default: 1174 default:
1167 printk(KERN_ERR "sctp impossible disposition %d " 1175 pr_err("impossible disposition %d in state %d, event_type %d, event_id %d\n",
1168 "in state %d, event_type %d, event_id %d\n",
1169 status, state, event_type, subtype.chunk); 1176 status, state, event_type, subtype.chunk);
1170 BUG(); 1177 BUG();
1171 break; 1178 break;
@@ -1416,12 +1423,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1416 SCTP_RTXR_T3_RTX); 1423 SCTP_RTXR_T3_RTX);
1417 break; 1424 break;
1418 1425
1419 case SCTP_CMD_TRANSMIT:
1420 /* Kick start transmission. */
1421 error = sctp_outq_uncork(&asoc->outqueue);
1422 local_cork = 0;
1423 break;
1424
1425 case SCTP_CMD_ECN_CE: 1426 case SCTP_CMD_ECN_CE:
1426 /* Do delayed CE processing. */ 1427 /* Do delayed CE processing. */
1427 sctp_do_ecn_ce_work(asoc, cmd->obj.u32); 1428 sctp_do_ecn_ce_work(asoc, cmd->obj.u32);
@@ -1445,6 +1446,13 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1445 sctp_cmd_setup_t2(commands, asoc, cmd->obj.ptr); 1446 sctp_cmd_setup_t2(commands, asoc, cmd->obj.ptr);
1446 break; 1447 break;
1447 1448
1449 case SCTP_CMD_TIMER_START_ONCE:
1450 timer = &asoc->timers[cmd->obj.to];
1451
1452 if (timer_pending(timer))
1453 break;
1454 /* fall through */
1455
1448 case SCTP_CMD_TIMER_START: 1456 case SCTP_CMD_TIMER_START:
1449 timer = &asoc->timers[cmd->obj.to]; 1457 timer = &asoc->timers[cmd->obj.to];
1450 timeout = asoc->timeouts[cmd->obj.to]; 1458 timeout = asoc->timeouts[cmd->obj.to];
@@ -1678,9 +1686,12 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1678 case SCTP_CMD_SEND_NEXT_ASCONF: 1686 case SCTP_CMD_SEND_NEXT_ASCONF:
1679 sctp_cmd_send_asconf(asoc); 1687 sctp_cmd_send_asconf(asoc);
1680 break; 1688 break;
1689 case SCTP_CMD_PURGE_ASCONF_QUEUE:
1690 sctp_asconf_queue_teardown(asoc);
1691 break;
1681 default: 1692 default:
1682 printk(KERN_WARNING "Impossible command: %u, %p\n", 1693 pr_warn("Impossible command: %u, %p\n",
1683 cmd->verb, cmd->obj.ptr); 1694 cmd->verb, cmd->obj.ptr);
1684 break; 1695 break;
1685 } 1696 }
1686 1697