aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/outqueue.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-06 04:47:55 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:30:36 -0400
commitb01a24078fa3fc4f0f447d1306ce5adc495ead86 (patch)
tree6949f590c81e2c1ce193b1bdaec68a60e9842879 /net/sctp/outqueue.c
parentbb2db45b5495455ec7580315029184550709f4a2 (diff)
sctp: Make the mib per network namespace
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r--net/sctp/outqueue.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index e7aa177c9522..072bf6ae3c26 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -299,6 +299,7 @@ void sctp_outq_free(struct sctp_outq *q)
299/* Put a new chunk in an sctp_outq. */ 299/* Put a new chunk in an sctp_outq. */
300int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk) 300int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
301{ 301{
302 struct net *net = sock_net(q->asoc->base.sk);
302 int error = 0; 303 int error = 0;
303 304
304 SCTP_DEBUG_PRINTK("sctp_outq_tail(%p, %p[%s])\n", 305 SCTP_DEBUG_PRINTK("sctp_outq_tail(%p, %p[%s])\n",
@@ -337,15 +338,15 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
337 338
338 sctp_outq_tail_data(q, chunk); 339 sctp_outq_tail_data(q, chunk);
339 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) 340 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
340 SCTP_INC_STATS(SCTP_MIB_OUTUNORDERCHUNKS); 341 SCTP_INC_STATS(net, SCTP_MIB_OUTUNORDERCHUNKS);
341 else 342 else
342 SCTP_INC_STATS(SCTP_MIB_OUTORDERCHUNKS); 343 SCTP_INC_STATS(net, SCTP_MIB_OUTORDERCHUNKS);
343 q->empty = 0; 344 q->empty = 0;
344 break; 345 break;
345 } 346 }
346 } else { 347 } else {
347 list_add_tail(&chunk->list, &q->control_chunk_list); 348 list_add_tail(&chunk->list, &q->control_chunk_list);
348 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); 349 SCTP_INC_STATS(net, SCTP_MIB_OUTCTRLCHUNKS);
349 } 350 }
350 351
351 if (error < 0) 352 if (error < 0)
@@ -478,11 +479,12 @@ void sctp_retransmit_mark(struct sctp_outq *q,
478void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, 479void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
479 sctp_retransmit_reason_t reason) 480 sctp_retransmit_reason_t reason)
480{ 481{
482 struct net *net = sock_net(q->asoc->base.sk);
481 int error = 0; 483 int error = 0;
482 484
483 switch(reason) { 485 switch(reason) {
484 case SCTP_RTXR_T3_RTX: 486 case SCTP_RTXR_T3_RTX:
485 SCTP_INC_STATS(SCTP_MIB_T3_RETRANSMITS); 487 SCTP_INC_STATS(net, SCTP_MIB_T3_RETRANSMITS);
486 sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX); 488 sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX);
487 /* Update the retran path if the T3-rtx timer has expired for 489 /* Update the retran path if the T3-rtx timer has expired for
488 * the current retran path. 490 * the current retran path.
@@ -493,15 +495,15 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
493 transport->asoc->unack_data; 495 transport->asoc->unack_data;
494 break; 496 break;
495 case SCTP_RTXR_FAST_RTX: 497 case SCTP_RTXR_FAST_RTX:
496 SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS); 498 SCTP_INC_STATS(net, SCTP_MIB_FAST_RETRANSMITS);
497 sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX); 499 sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX);
498 q->fast_rtx = 1; 500 q->fast_rtx = 1;
499 break; 501 break;
500 case SCTP_RTXR_PMTUD: 502 case SCTP_RTXR_PMTUD:
501 SCTP_INC_STATS(SCTP_MIB_PMTUD_RETRANSMITS); 503 SCTP_INC_STATS(net, SCTP_MIB_PMTUD_RETRANSMITS);
502 break; 504 break;
503 case SCTP_RTXR_T1_RTX: 505 case SCTP_RTXR_T1_RTX:
504 SCTP_INC_STATS(SCTP_MIB_T1_RETRANSMITS); 506 SCTP_INC_STATS(net, SCTP_MIB_T1_RETRANSMITS);
505 transport->asoc->init_retries++; 507 transport->asoc->init_retries++;
506 break; 508 break;
507 default: 509 default:
@@ -1914,6 +1916,6 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
1914 1916
1915 if (ftsn_chunk) { 1917 if (ftsn_chunk) {
1916 list_add_tail(&ftsn_chunk->list, &q->control_chunk_list); 1918 list_add_tail(&ftsn_chunk->list, &q->control_chunk_list);
1917 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); 1919 SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_OUTCTRLCHUNKS);
1918 } 1920 }
1919} 1921}