From owner-svn-src-head@FreeBSD.ORG Thu Feb 3 20:34:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C85106564A; Thu, 3 Feb 2011 20:34:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 142FF8FC0C; Thu, 3 Feb 2011 20:34:17 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9A6B946B2C; Thu, 3 Feb 2011 15:34:16 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C01E18A009; Thu, 3 Feb 2011 15:34:15 -0500 (EST) From: John Baldwin To: Randall Stewart Date: Thu, 3 Feb 2011 15:29:24 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102031922.p13JML8i055697@svn.freebsd.org> In-Reply-To: <201102031922.p13JML8i055697@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102031529.25072.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 03 Feb 2011 15:34:15 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218232 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 20:34:17 -0000 On Thursday, February 03, 2011 2:22:21 pm Randall Stewart wrote: > Author: rrs > Date: Thu Feb 3 19:22:21 2011 > New Revision: 218232 > URL: http://svn.freebsd.org/changeset/base/218232 > > Log: > 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. Note that mp_maxid is the maxium valid ID, so you typically have to do things like: for (i = 0; i <= mp_maxid; i++) { if (CPU_ABSENT(i)) continue; ... } There is a CPU_FOREACH() macro that does the above (but assumes you want to skip over non-existent CPUs). > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Thu Feb 3 18:50:10 2011 (r218231) > +++ head/sys/netinet/sctp_input.c Thu Feb 3 19:22:21 2011 (r218232) > @@ -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: > @@ -2918,7 +2921,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)) && > @@ -5933,7 +5936,7 @@ sctp_input(struct mbuf *m, int off) > int offset; > int cpu_to_use; > > - if (mp_ncpus > 1) { > + if (mp_maxid > 1) { The old version of this is still correct. > ip = mtod(m, struct ip *); > offset = off + sizeof(*sh); > if (SCTP_BUF_LEN(m) < offset) { > @@ -5944,7 +5947,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; Hmmm, this is more complicated. Can sctp_queue_to_mcore() handle the fact that a cpu_to_use value might not be valid? If not you might want to maintain a separate "dense" virtual CPU ID table numbered 0 .. mp_ncpus - 1 that maps to "present" FreeBSD CPU IDs. I think Robert has done something similar to support RSS in TCP. Does that make sense? -- John Baldwin