From owner-svn-src-projects@FreeBSD.ORG Wed May 27 22:23:17 2009 Return-Path: <owner-svn-src-projects@FreeBSD.ORG> Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42EF7106566C; Wed, 27 May 2009 22:23:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30F6F8FC1D; Wed, 27 May 2009 22:23:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4RMNH5H013928; Wed, 27 May 2009 22:23:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4RMNHJT013926; Wed, 27 May 2009 22:23:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200905272223.n4RMNHJT013926@svn.freebsd.org> From: Robert Watson <rwatson@FreeBSD.org> Date: Wed, 27 May 2009 22:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192936 - projects/pnet/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" <svn-src-projects.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects> List-Post: <mailto:svn-src-projects@freebsd.org> List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 27 May 2009 22:23:17 -0000 Author: rwatson Date: Wed May 27 22:23:16 2009 New Revision: 192936 URL: http://svn.freebsd.org/changeset/base/192936 Log: Be more specific about whether a 'cpu' is a CPU ID or not. Modified: projects/pnet/sys/net/netisr2.c projects/pnet/sys/net/netisr2.h Modified: projects/pnet/sys/net/netisr2.c ============================================================================== --- projects/pnet/sys/net/netisr2.c Wed May 27 22:15:54 2009 (r192935) +++ projects/pnet/sys/net/netisr2.c Wed May 27 22:23:16 2009 (r192936) @@ -181,7 +181,7 @@ struct netisr_proto { const char *np_name; /* Character string protocol name. */ netisr_t *np_handler; /* Protocol handler. */ netisr_m2flow_t *np_m2flow; /* Query flow for untagged packet. */ - netisr_m2cpu_t *np_m2cpu; /* Query CPU to process packet on. */ + netisr_m2cpuid_t *np_m2cpuid; /* Query CPU to process packet on. */ u_int np_qlimit; /* Maximum per-CPU queue depth. */ u_int np_policy; /* Work placement policy. */ }; @@ -358,11 +358,11 @@ netisr2_register(const struct netisr_han nhp->nh_m2flow == NULL, ("netisr2_register: nh_policy != FLOW but m2flow defined for %s", name)); - KASSERT(nhp->nh_policy == NETISR_POLICY_CPU || nhp->nh_m2cpu == NULL, - ("netisr2_register: nh_policy != CPU but m2cpu defined for %s", + KASSERT(nhp->nh_policy == NETISR_POLICY_CPU || nhp->nh_m2cpuid == NULL, + ("netisr2_register: nh_policy != CPU but m2cpuid defined for %s", name)); - KASSERT(nhp->nh_policy != NETISR_POLICY_CPU || nhp->nh_m2cpu != NULL, - ("netisr2_register: nh_policy == CPU but m2cpu not defined for " + KASSERT(nhp->nh_policy != NETISR_POLICY_CPU || nhp->nh_m2cpuid != NULL, + ("netisr2_register: nh_policy == CPU but m2cpuid not defined for " "%s", name)); KASSERT(nhp->nh_qlimit != 0, ("netisr2_register: nh_qlimit 0 for %s", name)); @@ -373,7 +373,7 @@ netisr2_register(const struct netisr_han np[proto].np_name = name; np[proto].np_handler = nhp->nh_handler; np[proto].np_m2flow = nhp->nh_m2flow; - np[proto].np_m2cpu = nhp->nh_m2cpu; + np[proto].np_m2cpuid = nhp->nh_m2cpuid; if (nhp->nh_qlimit > netisr_maxqlimit) { printf("netisr2_register: %s requested queue limit %u " "capped to net.isr2.maxqlimit %u\n", name, @@ -564,7 +564,7 @@ netisr2_unregister(const struct netisr_h np[proto].np_name = NULL; np[proto].np_handler = NULL; np[proto].np_m2flow = NULL; - np[proto].np_m2cpu = NULL; + np[proto].np_m2cpuid = NULL; np[proto].np_qlimit = 0; np[proto].np_policy = 0; for (i = 0; i < MAXCPU; i++) { @@ -581,8 +581,8 @@ netisr2_unregister(const struct netisr_h * for assistance if required. */ static struct mbuf * -netisr2_selectcpu(struct netisr_proto *npp, uintptr_t source, struct mbuf *m, - u_int *cpuidp) +netisr2_select_cpuid(struct netisr_proto *npp, uintptr_t source, + struct mbuf *m, u_int *cpuidp) { struct ifnet *ifp; @@ -604,7 +604,7 @@ netisr2_selectcpu(struct netisr_proto *n */ switch (npp->np_policy) { case NETISR_POLICY_CPU: - return (npp->np_m2cpu(m, source, cpuidp)); + return (npp->np_m2cpuid(m, source, cpuidp)); case NETISR_POLICY_FLOW: if (!(m->m_flags & M_FLOWID) && npp->np_m2flow != NULL) { @@ -629,7 +629,7 @@ netisr2_selectcpu(struct netisr_proto *n return (m); default: - panic("netisr2_selectcpu: invalid policy %u for %s", + panic("netisr2_select_cpuid: invalid policy %u for %s", npp->np_policy, npp->np_name); } } @@ -827,7 +827,7 @@ netisr2_queue_src(u_int proto, uintptr_t KASSERT(np[proto].np_handler != NULL, ("netisr2_queue_src: invalid proto %d", proto)); - m = netisr2_selectcpu(&np[proto], source, m, &cpuid); + m = netisr2_select_cpuid(&np[proto], source, m, &cpuid); if (m != NULL) error = netisr2_queue_internal(proto, m, cpuid); else @@ -897,7 +897,7 @@ netisr2_dispatch_src(u_int proto, uintpt * dispatch if we're on the right CPU and the netisr worker isn't * already running. */ - m = netisr2_selectcpu(&np[proto], source, m, &cpuid); + m = netisr2_select_cpuid(&np[proto], source, m, &cpuid); if (m == NULL) { NETISR_RUNLOCK(&tracker); return (ENOBUFS); Modified: projects/pnet/sys/net/netisr2.h ============================================================================== --- projects/pnet/sys/net/netisr2.h Wed May 27 22:15:54 2009 (r192935) +++ projects/pnet/sys/net/netisr2.h Wed May 27 22:23:16 2009 (r192936) @@ -35,7 +35,7 @@ /*- * Protocols express ordering constraints and affinity preferences by - * implementing one or neither of nh_m2flow and nh_m2cpu, which are used by + * implementing one or neither of nh_m2flow and nh_m2cpuid, which are used by * netisr2 to determine which per-CPU workstream to assign mbufs to. * * The following policies may be used by protocols: @@ -52,7 +52,7 @@ * flow ID, falling back on source ordering. * * NETISR_POLICY_CPU - netisr2 will delegate all work placement decisions to - * the protocol, querying nh_m2cpu for each packet. + * the protocol, querying nh_m2cpuid for each packet. * * Protocols might make decisions about work placement based on an existing * calculated flow ID on the mbuf, such as one provided in hardware, the @@ -65,7 +65,7 @@ * protocol handlers to notify them of CPU configuration changes so that they * can rebalance work. */ -typedef struct mbuf *netisr_m2cpu_t(struct mbuf *m, uintptr_t source, +typedef struct mbuf *netisr_m2cpuid_t(struct mbuf *m, uintptr_t source, u_int *cpuid); typedef struct mbuf *netisr_m2flow_t(struct mbuf *m, uintptr_t source); @@ -80,7 +80,7 @@ struct netisr_handler { const char *nh_name; /* Character string protocol name. */ netisr_t *nh_handler; /* Protocol handler. */ netisr_m2flow_t *nh_m2flow; /* Query flow for untagged packet. */ - netisr_m2cpu_t *nh_m2cpu; /* Query CPU to process packet on. */ + netisr_m2cpuid_t *nh_m2cpuid; /* Query CPU to process mbuf on. */ u_int nh_proto; /* Integer protocol ID. */ u_int nh_qlimit; /* Maximum per-CPU queue depth. */ u_int nh_policy; /* Work placement policy. */