aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-01-06 17:37:45 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-06 17:37:45 -0500
commit56a4342dfe3145cd66f766adccb28fd9b571606d (patch)
treed1593764488ff8cbb0b83cb9ae35fd968bf81760 /net/sctp
parent805c1f4aedaba1bc8d839e7c27b128083dd5c2f0 (diff)
parentfe0d692bbc645786bce1a98439e548ae619269f5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c net/ipv6/ip6_tunnel.c net/ipv6/ip6_vti.c ipv6 tunnel statistic bug fixes conflicting with consolidation into generic sw per-cpu net stats. qlogic conflict between queue counting bug fix and the addition of multiple MAC address support. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/outqueue.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 111516c3d34c..9c77947c0597 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -207,8 +207,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
207 INIT_LIST_HEAD(&q->retransmit); 207 INIT_LIST_HEAD(&q->retransmit);
208 INIT_LIST_HEAD(&q->sacked); 208 INIT_LIST_HEAD(&q->sacked);
209 INIT_LIST_HEAD(&q->abandoned); 209 INIT_LIST_HEAD(&q->abandoned);
210
211 q->empty = 1;
212} 210}
213 211
214/* Free the outqueue structure and any related pending chunks. 212/* Free the outqueue structure and any related pending chunks.
@@ -331,7 +329,6 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
331 SCTP_INC_STATS(net, SCTP_MIB_OUTUNORDERCHUNKS); 329 SCTP_INC_STATS(net, SCTP_MIB_OUTUNORDERCHUNKS);
332 else 330 else
333 SCTP_INC_STATS(net, SCTP_MIB_OUTORDERCHUNKS); 331 SCTP_INC_STATS(net, SCTP_MIB_OUTORDERCHUNKS);
334 q->empty = 0;
335 break; 332 break;
336 } 333 }
337 } else { 334 } else {
@@ -653,7 +650,6 @@ redo:
653 if (chunk->fast_retransmit == SCTP_NEED_FRTX) 650 if (chunk->fast_retransmit == SCTP_NEED_FRTX)
654 chunk->fast_retransmit = SCTP_DONT_FRTX; 651 chunk->fast_retransmit = SCTP_DONT_FRTX;
655 652
656 q->empty = 0;
657 q->asoc->stats.rtxchunks++; 653 q->asoc->stats.rtxchunks++;
658 break; 654 break;
659 } 655 }
@@ -1064,8 +1060,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
1064 1060
1065 sctp_transport_reset_timers(transport); 1061 sctp_transport_reset_timers(transport);
1066 1062
1067 q->empty = 0;
1068
1069 /* Only let one DATA chunk get bundled with a 1063 /* Only let one DATA chunk get bundled with a
1070 * COOKIE-ECHO chunk. 1064 * COOKIE-ECHO chunk.
1071 */ 1065 */
@@ -1274,29 +1268,17 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
1274 "advertised peer ack point:0x%x\n", __func__, asoc, ctsn, 1268 "advertised peer ack point:0x%x\n", __func__, asoc, ctsn,
1275 asoc->adv_peer_ack_point); 1269 asoc->adv_peer_ack_point);
1276 1270
1277 /* See if all chunks are acked. 1271 return sctp_outq_is_empty(q);
1278 * Make sure the empty queue handler will get run later.
1279 */
1280 q->empty = (list_empty(&q->out_chunk_list) &&
1281 list_empty(&q->retransmit));
1282 if (!q->empty)
1283 goto finish;
1284
1285 list_for_each_entry(transport, transport_list, transports) {
1286 q->empty = q->empty && list_empty(&transport->transmitted);
1287 if (!q->empty)
1288 goto finish;
1289 }
1290
1291 pr_debug("%s: sack queue is empty\n", __func__);
1292finish:
1293 return q->empty;
1294} 1272}
1295 1273
1296/* Is the outqueue empty? */ 1274/* Is the outqueue empty?
1275 * The queue is empty when we have not pending data, no in-flight data
1276 * and nothing pending retransmissions.
1277 */
1297int sctp_outq_is_empty(const struct sctp_outq *q) 1278int sctp_outq_is_empty(const struct sctp_outq *q)
1298{ 1279{
1299 return q->empty; 1280 return q->out_qlen == 0 && q->outstanding_bytes == 0 &&
1281 list_empty(&q->retransmit);
1300} 1282}
1301 1283
1302/******************************************************************** 1284/********************************************************************