From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 10 19:40:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0281065743; Fri, 10 Feb 2012 19:40:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBD68FC12; Fri, 10 Feb 2012 19:40:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AJeKBH090479; Fri, 10 Feb 2012 19:40:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJeJOh090476; Fri, 10 Feb 2012 19:40:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101940.q1AJeJOh090476@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231412 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:40:20 -0000 Author: tuexen Date: Fri Feb 10 19:40:19 2012 New Revision: 231412 URL: http://svn.freebsd.org/changeset/base/231412 Log: MFC r218371: 1) Use same scheme Michael and I discussed for a selected for a flowid 2) If flowid is not set, arrange so it is stored. 3) If flowid is set by lower layer, use it. From rrs@. Modified: stable/8/sys/netinet/sctp_input.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_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:37:23 2012 (r231411) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:40:19 2012 (r231412) @@ -5948,32 +5948,32 @@ sctp_input(struct mbuf *m, int off) struct sctphdr *sh; int offset; int cpu_to_use; - uint32_t tag; + uint32_t flowid, tag; if (mp_ncpus > 1) { - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); - if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { - SCTP_STAT_INCR(sctps_hdrops); - return; - } - ip = mtod(m, struct ip *); - } - sh = (struct sctphdr *)((caddr_t)ip + off); - if (sh->v_tag) { - tag = htonl(sh->v_tag); + if (m->m_flags & M_FLOWID) { + flowid = m->m_pkthdr.flowid; } else { /* - * Distribute new INIT's to all CPU's don't just - * pick on 0. + * No flow id built by lower layers fix it so we + * create one. */ - struct timeval tv; - - (void)SCTP_GETTIME_TIMEVAL(&tv); - tag = (uint32_t) tv.tv_usec; + ip = mtod(m, struct ip *); + offset = off + sizeof(*sh); + if (SCTP_BUF_LEN(m) < offset) { + if ((m = m_pullup(m, offset)) == 0) { + SCTP_STAT_INCR(sctps_hdrops); + return; + } + ip = mtod(m, struct ip *); + } + sh = (struct sctphdr *)((caddr_t)ip + off); + tag = htonl(sh->v_tag); + flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); + m->m_pkthdr.flowid = flowid; + m->m_flags |= M_FLOWID; } - cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; + cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); return; }