Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2012 19:15:05 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r231405 - stable/8/sys/netinet
Message-ID:  <201202101915.q1AJF5Cb089347@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri Feb 10 19:15:05 2012
New Revision: 231405
URL: http://svn.freebsd.org/changeset/base/231405

Log:
  MFC r218232:
  1) Move per John Baldwin to mp_maxid
  2) Some signed/unsigned errors found by Mac OS compiler (from Michael)
  3) a couple of copyright updates on the effected files.
  From rrs@.

Modified:
  stable/8/sys/netinet/sctp_asconf.c
  stable/8/sys/netinet/sctp_cc_functions.c
  stable/8/sys/netinet/sctp_constants.h
  stable/8/sys/netinet/sctp_input.c
  stable/8/sys/netinet/sctp_output.c
  stable/8/sys/netinet/sctp_pcb.c
  stable/8/sys/netinet/sctp_sysctl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/netinet/sctp_asconf.c
==============================================================================
--- stable/8/sys/netinet/sctp_asconf.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_asconf.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and
+ *                          Michael Tuexen, tuexen@fh-muenster.de
+ *                          All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -1348,7 +1351,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
 
 	TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next);
 #ifdef SCTP_DEBUG
-	if (SCTP_BASE_SYSCTL(sctp_debug_on) && SCTP_DEBUG_ASCONF2) {
+	if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) {
 		if (type == SCTP_ADD_IP_ADDRESS) {
 			SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: ");
 			SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa);

Modified: stable/8/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/8/sys/netinet/sctp_cc_functions.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_cc_functions.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and
+ *                          Michael Tuexen, tuexen@fh-muenster.de
+ *                          All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -375,8 +378,6 @@ sctp_cwnd_update_after_sack(struct sctp_
 				}
 			} else {
 				/* We are in congestion avoidance */
-				uint32_t incr;
-
 				/*
 				 * Add to pba
 				 */
@@ -514,7 +515,8 @@ sctp_cwnd_update_after_packet_dropped(st
     uint32_t * bottle_bw, uint32_t * on_queue)
 {
 	uint32_t bw_avail;
-	int rtt, incr;
+	int rtt;
+	unsigned int incr;
 	int old_cwnd = net->cwnd;
 
 	/* need real RTT for this calc */

Modified: stable/8/sys/netinet/sctp_constants.h
==============================================================================
--- stable/8/sys/netinet/sctp_constants.h	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_constants.h	Fri Feb 10 19:15:05 2012	(r231405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and
+ *                          Michael Tuexen, tuexen@fh-muenster.de
+ *                          All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -915,11 +918,11 @@ __FBSDID("$FreeBSD$");
 
 /* modular comparison */
 /* See RFC 1982 for details. */
-#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \
-                           ((a > b) && ((a - b) < (1<<15))))
+#define SCTP_SSN_GT(a, b) (((a < b) && ((uint16_t)(b - a) > (1U<<15))) || \
+                           ((a > b) && ((uint16_t)(a - b) < (1U<<15))))
 #define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b))
-#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \
-                           ((a > b) && ((a - b) < (1<<31))))
+#define SCTP_TSN_GT(a, b) (((a < b) && ((uint32_t)(b - a) > (1U<<31))) || \
+                           ((a > b) && ((uint32_t)(a - b) < (1U<<31))))
 #define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b))
 
 /* Mapping array manipulation routines */

Modified: stable/8/sys/netinet/sctp_input.c
==============================================================================
--- stable/8/sys/netinet/sctp_input.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_input.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and
+ *                          Michael Tuexen, tuexen@fh-muenster.de
+ *                          All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -2920,7 +2923,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch
 	uint8_t override_bit = 0;
 	uint32_t tsn, window_data_tsn;
 	int len;
-	int pkt_cnt;
+	unsigned int pkt_cnt;
 
 	len = ntohs(cp->ch.chunk_length);
 	if ((len != sizeof(struct sctp_ecne_chunk)) &&
@@ -5935,7 +5938,7 @@ sctp_input(struct mbuf *m, int off)
 	int offset;
 	int cpu_to_use;
 
-	if (mp_ncpus > 1) {
+	if (mp_maxid > 1) {
 		ip = mtod(m, struct ip *);
 		offset = off + sizeof(*sh);
 		if (SCTP_BUF_LEN(m) < offset) {
@@ -5946,7 +5949,7 @@ sctp_input(struct mbuf *m, int off)
 			ip = mtod(m, struct ip *);
 		}
 		sh = (struct sctphdr *)((caddr_t)ip + off);
-		cpu_to_use = ntohl(sh->v_tag) % mp_ncpus;
+		cpu_to_use = ntohl(sh->v_tag) % mp_maxid;
 		sctp_queue_to_mcore(m, off, cpu_to_use);
 		return;
 	}

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_output.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and
+ *                          Michael Tuexen, tuexen@fh-muenster.de
+ *                          All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -9311,14 +9314,15 @@ sctp_chunk_output(struct sctp_inpcb *inp
 	 */
 	struct sctp_association *asoc;
 	struct sctp_nets *net;
-	int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0,
-	    burst_cnt = 0;
+	int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0;
+	unsigned int burst_cnt = 0;
 	struct timeval now;
 	int now_filled = 0;
 	int nagle_on = 0;
 	int frag_point = sctp_get_frag_point(stcb, &stcb->asoc);
 	int un_sent = 0;
-	int fr_done, tot_frs = 0;
+	int fr_done;
+	unsigned int tot_frs = 0;
 
 	asoc = &stcb->asoc;
 	if (from_where == SCTP_OUTPUT_FROM_USR_SEND) {

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_pcb.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -5549,27 +5549,27 @@ sctp_startup_mcore_threads(void)
 {
 	int i;
 
-	if (mp_ncpus == 1)
+	if (mp_maxid == 1)
 		return;
 
 	SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *,
-	    (mp_ncpus * sizeof(struct sctp_mcore_ctrl)),
+	    (mp_maxid * sizeof(struct sctp_mcore_ctrl)),
 	    SCTP_M_MCORE);
 	if (sctp_mcore_workers == NULL) {
 		/* TSNH I hope */
 		return;
 	}
-	memset(sctp_mcore_workers, 0, (mp_ncpus *
+	memset(sctp_mcore_workers, 0, (mp_maxid *
 	    sizeof(struct sctp_mcore_ctrl)));
 	/* Init the structures */
-	for (i = 0; i < mp_ncpus; i++) {
+	for (i = 0; i < mp_maxid; i++) {
 		TAILQ_INIT(&sctp_mcore_workers[i].que);
 		SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]);
 		SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]);
 		sctp_mcore_workers[i].cpuid = i;
 	}
 	/* Now start them all */
-	for (i = 0; i < mp_ncpus; i++) {
+	for (i = 0; i < mp_maxid; i++) {
 		(void)kproc_create(sctp_mcore_thread,
 		    (void *)&sctp_mcore_workers[i],
 		    &sctp_mcore_workers[i].thread_proc,
@@ -5604,12 +5604,12 @@ sctp_pcb_init()
 #endif
 #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
 	SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *,
-	    (mp_ncpus * sizeof(struct sctpstat)),
+	    (mp_maxid * sizeof(struct sctpstat)),
 	    SCTP_M_MCORE);
 #endif
 	(void)SCTP_GETTIME_TIMEVAL(&tv);
 #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
-	bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_ncpus));
+	bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_maxid));
 	SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec;
 	SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec;
 #else

Modified: stable/8/sys/netinet/sctp_sysctl.c
==============================================================================
--- stable/8/sys/netinet/sctp_sysctl.c	Fri Feb 10 19:12:23 2012	(r231404)
+++ stable/8/sys/netinet/sctp_sysctl.c	Fri Feb 10 19:15:05 2012	(r231405)
@@ -664,7 +664,7 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS)
 		return (EINVAL);
 	}
 	memset(&sb, 0, sizeof(sb));
-	for (cpu = 0; cpu < mp_ncpus; cpu++) {
+	for (cpu = 0; cpu < mp_maxid; cpu++) {
 		sarry = &SCTP_BASE_STATS[cpu];
 		if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) {
 			sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202101915.q1AJF5Cb089347>