From 603724d3abed34351087e20b8cb363d8e02072c1 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sun, 17 Aug 2008 23:27:27 +0000 Subject: 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 --- sys/contrib/rdma/rdma_cma.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'sys/contrib/rdma/rdma_cma.c') 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 #include #include +#include #include #include @@ -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); -- cgit v1.2.3