diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
commit | 603724d3abed34351087e20b8cb363d8e02072c1 (patch) | |
tree | 1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/contrib/rdma/rdma_cma.c | |
parent | ac2dcb729fc5b54bc829c23d239dec65a057bf49 (diff) | |
download | src-603724d3abed34351087e20b8cb363d8e02072c1.tar.gz src-603724d3abed34351087e20b8cb363d8e02072c1.zip |
Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).
This is the first in a series of commits over the course
of the next few weeks.
Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.
We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.
Obtained from: //depot/projects/vimage-commit2/...
Reviewed by: brooks, des, ed, mav, julian,
jamie, kris, rwatson, zec, ...
(various people I forgot, different versions)
md5 (with a bit of help)
Sponsored by: NLnet Foundation, The FreeBSD Foundation
X-MFC after: never
V_Commit_Message_Reviewed_By: more people than the patch
Notes
Notes:
svn path=/head/; revision=181803
Diffstat (limited to 'sys/contrib/rdma/rdma_cma.c')
-rw-r--r-- | sys/contrib/rdma/rdma_cma.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/contrib/rdma/rdma_cma.c b/sys/contrib/rdma/rdma_cma.c index 8dddf6ce157d..fa93816f6bca 100644 --- a/sys/contrib/rdma/rdma_cma.c +++ b/sys/contrib/rdma/rdma_cma.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <sys/taskqueue.h> #include <sys/priv.h> #include <sys/syslog.h> +#include <sys/vimage.h> #include <netinet/in.h> #include <netinet/in_pcb.h> @@ -1962,18 +1963,18 @@ retry: if (ret) goto err1; - if (port > ipport_lastauto) { - if (next_port != ipport_firstauto) { + if (port > V_ipport_lastauto) { + if (next_port != V_ipport_firstauto) { kvl_delete(ps, port); - next_port = ipport_firstauto; + next_port = V_ipport_firstauto; goto retry; } ret = EADDRNOTAVAIL; goto err2; } - if (port == ipport_lastauto) - next_port = ipport_firstauto; + if (port == V_ipport_lastauto) + next_port = V_ipport_firstauto; else next_port = port + 1; @@ -1997,7 +1998,7 @@ static int cma_use_port(struct kvl *ps, struct rdma_id_private *id_priv) sin = (struct sockaddr_in *) &id_priv->id.route.addr.src_addr; snum = ntohs(sin->sin_port); - if (snum <= ipport_reservedhigh && snum >= ipport_reservedlow && + if (snum <= V_ipport_reservedhigh && snum >= V_ipport_reservedlow && priv_check(curthread, PRIV_NETINET_RESERVEDPORT)) return (EACCES); @@ -2917,8 +2918,8 @@ static int cma_init(void) arc4rand(&next_port, sizeof next_port, 0); next_port = ((unsigned int) next_port % - (ipport_lastauto - ipport_firstauto)) + - ipport_firstauto; + (V_ipport_lastauto - V_ipport_firstauto)) + + V_ipport_firstauto; cma_wq = taskqueue_create("rdma_cm", M_NOWAIT, taskqueue_thread_enqueue, &cma_wq); |