From owner-freebsd-net@FreeBSD.ORG Sun May 1 05:09:14 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A828106746E for ; Sun, 1 May 2011 05:08:55 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (ns1.bitblocks.com [173.228.5.8]) by mx1.freebsd.org (Postfix) with ESMTP id 649A08FC1A for ; Sun, 1 May 2011 05:08:55 +0000 (UTC) Received: from silver.bitblocks.com (silver.bitblocks.com [192.168.125.2]) by mail.bitblocks.com (Postfix) with ESMTP id 08802B827 for ; Sat, 30 Apr 2011 22:08:55 -0700 (PDT) From: Bakul Shah Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Sat, 30 Apr 2011 22:08:54 -0700 Message-Id: <466DA43B-EFF4-45DB-83C7-D6DD2B86CB35@bitblocks.com> To: freebsd-net@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Strange DNS problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 05:09:14 -0000 I am running a local dns server (bind9). It works ok for the most part but a number of domains do not resolve and I have not been able to detect any pattern. For instance $ host weather.com=20 Host weather.com not found: 3(NXDOMAIN) Here is the tcpdump output (on the internal side): 21:45:14.662220 IP 192.168.125.253.20204 > 192.168.125.9.53: 16136+ A? = weather.com. (29) 21:45:14.662696 IP 192.168.125.9.53 > 192.168.125.253.20204: 16136 = ServFail 0/0/0 (29) 21:45:14.663090 IP 192.168.125.253.59705 > 192.168.125.9.53: 4383+ A? = weather.com.bitblocks.com. (43) 21:45:14.663193 IP 192.168.125.9.53 > 192.168.125.253.59705: 4383 = NXDomain* 0/1/0 (94) What is strange is *nothing* goes out of my network when such a failure occurs! [My gateway machine does NAT on the internal side but the symptom is the same on the gateway machine] I ignored the problem for a while but recently I noticed a few more domains do not resolve! May be nothing has changed since I didn't try these domains before. This is on 8.2-release (but the symptom was the same with 8.1 and may be earlier). I checked named.conf and AFAIK it seems ok -- it has not changed substantially since 2006 (I moved to a different IP block and had to change my ISP's dns server address -- it is my secondary). I'd appreciate any hints on how to diagnose this. Thansks! From owner-freebsd-net@FreeBSD.ORG Sun May 1 05:50:15 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4F0E106566B for ; Sun, 1 May 2011 05:50:15 +0000 (UTC) (envelope-from bsd@xerq.net) Received: from cartman.xerq.net (cartman.xerq.net [67.52.126.46]) by mx1.freebsd.org (Postfix) with ESMTP id 79A718FC1F for ; Sun, 1 May 2011 05:50:15 +0000 (UTC) Received: from cartman.xerq.net (unknown [127.52.126.46]) by cartman.xerq.net (Postfix) with ESMTP id EA6185F640 for ; Sat, 30 Apr 2011 22:50:14 -0700 (PDT) Received: from cartman.xerq.net ([127.52.126.46]) by cartman.xerq.net (cartman.xerq.net [127.52.126.46]) (amavisd-new, port 10024) with ESMTP id h3lwdA9YSb6A for ; Sat, 30 Apr 2011 22:50:11 -0700 (PDT) Received: from www1.xerq.net (localhost [127.52.126.46]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cartman.xerq.net (Postfix) with ESMTPSA id 30E9A5F617 for ; Sat, 30 Apr 2011 22:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=xerq.net; s=dkimlol; t=1304229011; bh=Y418aqSv2HQ0Yjn5UQL2TKl+XZo3+rAGjWpWdAO/3FM=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Subject:In-Reply-To:References:Message-ID; b=nK26D1PIqHU+Qx6WEA7aGYxQXi/kFdX5hqq39fLwogSogah2IL36ZHgcr2whwZVBu 3YEwzm30/dPltrGW49cLNAbt4j8XKMMQ/SFExEW+JQ4kGC5d3llIe/LB6V2RNN1S2o /28SlAvFshG+Z+k14Pu4kw+zAFkMtJk76tjcVag8= DomainKey-Signature: a=rsa-sha1; s=default; d=xerq.net; c=nofws; q=dns; h=mime-version:content-type: content-transfer-encoding:date:from:to:subject:in-reply-to:references:message-id: x-sender:user-agent; b=VrlZKZR+lUF8GBTi3aQzcSu2F+YW/POEf0hDriergA2VITkJqwzar9vgJCwOUOH+V F7VxpvyalQbD39mH6YCSg== MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 30 Apr 2011 22:50:10 -0700 From: Matt Connor To: In-Reply-To: <466DA43B-EFF4-45DB-83C7-D6DD2B86CB35@bitblocks.com> References: <466DA43B-EFF4-45DB-83C7-D6DD2B86CB35@bitblocks.com> Message-ID: <4b30e77b7ee1ccea3f4271802b172bd3@www1.xerq.net> X-Sender: bsd@xerq.net User-Agent: XERQ Webmail/0.5.2 Subject: Re: Strange DNS problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 05:50:15 -0000 > 21:45:14.662220 IP 192.168.125.253.20204 > 192.168.125.9.53: 16136+ > A? weather.com. (29) > 21:45:14.662696 IP 192.168.125.9.53 > 192.168.125.253.20204: 16136 > ServFail 0/0/0 (29) ServFail means the authoritative DNS servers for that domain aren't responding. > 21:45:14.663090 IP 192.168.125.253.59705 > 192.168.125.9.53: 4383+ A? > weather.com.bitblocks.com. (43) > 21:45:14.663193 IP 192.168.125.9.53 > 192.168.125.253.59705: 4383 > NXDomain* 0/1/0 (94) NXDomain means that the root servers aren't providing any authoritative name servers for this domain (because it's appending your domain). Did you set your local DNS server to use forwarders? Also, are all your DNS records properly appended with a period (for instance 1.1.1.1 A bitblocks.com.)? Can you provide the output (on a UNIX machine) of: dig @192.168.125.9 weather.com +trace -Matt From owner-freebsd-net@FreeBSD.ORG Sun May 1 06:09:17 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6772F1065670 for ; Sun, 1 May 2011 06:09:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1C5BE8FC12 for ; Sun, 1 May 2011 06:09:16 +0000 (UTC) Received: by vxc34 with SMTP id 34so4847201vxc.13 for ; Sat, 30 Apr 2011 23:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=36nDk6FZZAjSjKLVnicinxxniTBKrNLxxYLUDEswURo=; b=PXXGcIKAiXX8AMfbAItm9SU8HBTmCjqzYZroWdb7Lw34nmfAmjzqqzz9vWQEWyIVnB A0HBm/Z7i7XU+h8G/lRukb7qG4bPcHh+XZTzQTVWtspjsReSxHNHvDqJa5SQWZTudayh 7qv6yYGju6rYgN05jl1ArLH4iUyA9MkkC8P+8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=RgTA+rfUfF20Vo0NINvrhBV+oxTMdSxCDu8PcwWVBO9enH5DA2FQH0HRwGZnxz0lAg M7nMlQnLPXFganreboY/R23jK1M/pcEKupYVaLJsBCtSRESjohuOPxjmZG/u7C9+Kezq bUUevpipAK9B+MUPjLHoTFDiXMb05rO0xmR+o= MIME-Version: 1.0 Received: by 10.52.96.8 with SMTP id do8mr2748916vdb.142.1304230156398; Sat, 30 Apr 2011 23:09:16 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.157.202 with HTTP; Sat, 30 Apr 2011 23:09:16 -0700 (PDT) In-Reply-To: <20110430204339.GA25769@michelle.cdnetworks.com> References: <201104290001.p3T01EvQ082443@artema.vpn.ibs> <20110429095231.GA17786@relay.ibs.dn.ua> <20110429182807.GA21084@michelle.cdnetworks.com> <20110429184634.GA34176@relay.ibs.dn.ua> <20110429185605.GB21084@michelle.cdnetworks.com> <20110430204339.GA25769@michelle.cdnetworks.com> Date: Sun, 1 May 2011 14:09:16 +0800 X-Google-Sender-Auth: EJH_z8M05NsxwmOthbzjCWLfUHU Message-ID: From: Adrian Chadd To: pyunyh@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org Subject: Re: collisions on tun interfaces ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 06:09:17 -0000 On 1 May 2011 04:43, YongHyeon PYUN wrote: > It's tunable. Set net.link.ifqmaxlen. I know it's tunable at boot time; I mean why is it that low by default? Adrian From owner-freebsd-net@FreeBSD.ORG Sun May 1 11:10:52 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28AD61065670 for ; Sun, 1 May 2011 11:10:52 +0000 (UTC) (envelope-from e0326715@student.tuwien.ac.at) Received: from mr.tuwien.ac.at (mr2-n.kom.tuwien.ac.at [128.130.2.110]) by mx1.freebsd.org (Postfix) with ESMTP id BF4548FC18 for ; Sun, 1 May 2011 11:10:51 +0000 (UTC) Received: from webmail1.zserv.tuwien.ac.at (webmail1.zserv.tuwien.ac.at [128.130.35.11]) by mr.tuwien.ac.at (8.13.7/8.13.7) with ESMTP id p41BAmCk024566; Sun, 1 May 2011 13:10:49 +0200 (MEST) Received: from webmail1.zserv.tuwien.ac.at (localhost.localdomain [127.0.0.1]) by webmail1.zserv.tuwien.ac.at (8.13.8/8.13.8) with ESMTP id p41BAmiY017785; Sun, 1 May 2011 13:10:48 +0200 Received: (from apache@localhost) by webmail1.zserv.tuwien.ac.at (8.13.8/8.13.8/Submit) id p41BAmFM017784; Sun, 1 May 2011 13:10:48 +0200 Received: from vie-lim-ge-1-2.onenet.at (vie-lim-ge-1-2.onenet.at [194.24.158.1]) by webmail.tuwien.ac.at (Horde Framework) with HTTP; Sun, 01 May 2011 13:10:48 +0200 Message-ID: <20110501131048.22413db5jyxywss8@webmail.tuwien.ac.at> Date: Sun, 01 May 2011 13:10:48 +0200 From: Schoch Christian To: Michael =?iso-8859-1?b?VPx4ZW4=?= References: <20110430091148.31393q3py4j4bg38@webmail.tuwien.ac.at> <20110430121518.25761cpmtrp0jtpy@webmail.tuwien.ac.at> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.9) X-Virus-Scanned: by amavisd-new Cc: freebsd-net@freebsd.org Subject: Re: [SCTP] ICMP unreachable message reenables data transmit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 11:10:52 -0000 > On Apr 30, 2011, at 12:15 PM, Schoch Christian wrote: >> >>> On Apr 30, 2011, at 9:11 AM, Schoch Christian wrote: >>> >>>> During a measurement with CMT-SCTP and PF i figured out, that >>>> sometimes a ICMP Destination unreachable message triggers a >>>> message transmission on an inactive data path that has been >>>> primary before. >>>> >>>> It looks as the ICMP message is reseting the inactive state back >>>> to active without reseting RTO. >>>> >>>> This behavior is triggered by a returning heartbeat message when >>>> no ICMP unreachable by data is sent quite before. >>>> >>>> Test system are two multi-homed hosts with FreeBSD8.1 and a WANem >>>> host between. >>>> >>>> A wireshark log can be provided on demand (quite large). >>> Hi Christian, >>> >>> any chance to upgrade the FreeBSD machines to head or to use newer >>> SCTP sources, which I could provide? It would require a recompilation >>> of the kernel... >> >> It is possible, but the results could be provided not until next week >> if a reboot is necessary. >> I can use any sources you could provide me since nothing else is >> done at this systems. > OK, but maybe I can try to understand what is going on. > > How many paths do you have? One is inactive, but was primary, so it > is confirmed. On another one, you get an ICMP (which one? Port unreachable, > host unreachable, ...). Do you have more than two paths? Setup looks like this: -------- ----cut--- Host A WANem Host B -------- ---------- Transfer is running on both path from A to B till the primary link is cut between WANem and the receiver and the whole transfer switches to the second path. The ICMP message (Host not reachable with a Heartbeat as attachment) is received on the primary interface from WANem host. As I tested this morning, the primary path is switching to unreachable due to the ICMP message but should be in this state quite before by exceeding path.max_retrans. So this ICMP message does two things: - Set the primary path to unreachable - Triggers something to retry data transfer on the primary path. > The ICMP message would not reset the RTO, since you need an ACKed TSN > or a HB-ACK to to that. Since it is inactive, it is missing these. > > Sending on an inactive path is OK, as soon as you enter the dormant > state, which means all your paths are inactive. > Transfer is still running on second link which is active. > Are you using the PF support for CMT? Yes, but without NR-SACK and DAC. I uploaded the pcap file to: http://37116.vs.webtropia.com/cmt_2.pcap Best regards, Christian > > Best regards > Michael >> >>> >>> Are you using IPv4 or IPv6? >>> >> >> IPv4 >> >> >>> Best regards >>> Michael >>>> >>>> Regards, >>>> Schoch Christian >>>> _______________________________________________ >>>> freebsd-net@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >>>> >>> >>> _______________________________________________ >>> freebsd-net@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >>> >> >> > > From owner-freebsd-net@FreeBSD.ORG Sun May 1 11:19:27 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B42C1065673; Sun, 1 May 2011 11:19:27 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 856B18FC0A; Sun, 1 May 2011 11:19:26 +0000 (UTC) Received: by fxm11 with SMTP id 11so4742791fxm.13 for ; Sun, 01 May 2011 04:19:25 -0700 (PDT) Received: by 10.223.6.11 with SMTP id 11mr740153fax.103.1304248765416; Sun, 01 May 2011 04:19:25 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-067-204-093.pools.arcor-ip.net [88.67.204.93]) by mx.google.com with ESMTPS id n7sm1439819fam.11.2011.05.01.04.19.20 (version=SSLv3 cipher=OTHER); Sun, 01 May 2011 04:19:24 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: freebsd-wireless@freebsd.org Date: Sun, 1 May 2011 13:19:30 +0200 User-Agent: KMail/1.13.7 (FreeBSD/8.2-STABLE; KDE/4.6.2; amd64; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_CHUvNNJ7ZQlWu6H" Message-Id: <201105011319.30649.bschmidt@freebsd.org> Cc: freebsd-net@freebsd.org Subject: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 11:19:27 -0000 --Boundary-00=_CHUvNNJ7ZQlWu6H Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I finally managed to get the 11n bits for iwn(4) sorted out. Well, there is still an issue somewhere with HT40 frame protection or TX chain setup on 5000 adapters, resulting in throughput not being that stable. But overall it seems to work pretty decently This is for HEAD only right now, net80211 in stable/8 does not yet contain the latest 11n related fixes. So, if you run HEAD and have some iwn(4) hardware, I'd appreciate feedback. Some statistically irrelevant numbers on a 4965 adapter: UDP RX on 5GHz/HT40: [ 3] 0.0-30.0 sec 866 MBytes 242 Mbits/sec 0.130 ms UDP TX on 5GHz/HT40: [ 3] 0.0-30.3 sec 846 MBytes 235 Mbits/sec 15.081 ms TCP RX on 5GHz/HT40: [ 3] 0.0-30.0 sec 554 MBytes 155 Mbits/sec TCP TX on 5GHz/HT40: [ 4] 0.0-30.0 sec 585 MBytes 164 Mbits/sec UDP RX on 2GHz/HT20 (4965 has no HT40 support on 2GHz): [ 3] 0.0-30.1 sec 383 MBytes 107 Mbits/sec 0.201 ms UDP TX on 2GHz/HT20: [ 3] 0.0-30.3 sec 350 MBytes 97.0 Mbits/sec 11.965 ms -- Bernhard --Boundary-00=_CHUvNNJ7ZQlWu6H Content-Type: text/x-patch; charset="ISO-8859-1"; name="iwn_ht.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iwn_ht.diff" diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 7d6ec68..e2cf4be 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -152,9 +152,7 @@ static void iwn4965_print_power_group(struct iwn_softc *, int); static void iwn5000_read_eeprom(struct iwn_softc *); static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); static void iwn_read_eeprom_band(struct iwn_softc *, int); -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *, int); -#endif static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); static struct iwn_eeprom_chan *iwn_find_eeprom_channel(struct iwn_softc *, struct ieee80211_channel *); @@ -172,10 +170,8 @@ static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#endif static void iwn5000_rx_calib_results(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, @@ -186,6 +182,7 @@ static void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, uint8_t); +static void iwn_ampdu_tx_done(struct iwn_softc *, int, int, int, void *); static void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_notif_intr(struct iwn_softc *); static void iwn_wakeup_intr(struct iwn_softc *); @@ -199,7 +196,6 @@ static void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, #ifdef notyet static void iwn5000_reset_sched(struct iwn_softc *, int, int); #endif -static uint8_t iwn_plcp_signal(int); static int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *); static int iwn_tx_data_raw(struct iwn_softc *, struct mbuf *, @@ -252,24 +248,26 @@ static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); static int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); -#if 0 /* HT */ -static int iwn_ampdu_rx_start(struct ieee80211com *, - struct ieee80211_node *, uint8_t); -static void iwn_ampdu_rx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); +static int iwn_ampdu_rx_start(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); +static void iwn_ampdu_rx_stop(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); +static int iwn_addba_request(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); +static int iwn_addba_response(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); static int iwn_ampdu_tx_start(struct ieee80211com *, struct ieee80211_node *, uint8_t); -static void iwn_ampdu_tx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); +static void iwn_ampdu_tx_stop(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); static void iwn4965_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn4965_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn4965_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); static void iwn5000_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn5000_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn5000_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); -#endif static int iwn5000_query_calibration(struct iwn_softc *); static int iwn5000_send_calibration(struct iwn_softc *); static int iwn5000_send_wimax_coex(struct iwn_softc *); @@ -550,21 +548,6 @@ iwn_attach(device_t dev) /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); - /* Count the number of available chains. */ - sc->ntxchains = - ((sc->txchainmask >> 2) & 1) + - ((sc->txchainmask >> 1) & 1) + - ((sc->txchainmask >> 0) & 1); - sc->nrxchains = - ((sc->rxchainmask >> 2) & 1) + - ((sc->rxchainmask >> 1) & 1) + - ((sc->rxchainmask >> 0) & 1); - if (bootverbose) { - device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", - sc->ntxchains, sc->nrxchains, sc->eeprom_domain, - macaddr, ":"); - } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not allocate ifnet structure\n"); @@ -584,42 +567,13 @@ iwn_attach(device_t dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA | IEEE80211_C_SHPREAMBLE /* short preamble supported */ - | IEEE80211_C_BGSCAN /* background scanning */ #if 0 | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ ; -#if 0 /* HT */ - /* XXX disable until HT channel setup works */ - ic->ic_htcaps = - IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ - | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width */ - | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ - | IEEE80211_HTCAP_RXSTBC_2STREAM/* 1-2 spatial streams */ - | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ - /* s/w capabilities */ - | IEEE80211_HTC_HT /* HT operation */ - | IEEE80211_HTC_AMPDU /* tx A-MPDU */ - | IEEE80211_HTC_AMSDU /* tx A-MSDU */ - ; - - /* Set HT capabilities. */ - ic->ic_htcaps = -#if IWN_RBUF_SIZE == 8192 - IEEE80211_HTCAP_AMSDU7935 | -#endif - IEEE80211_HTCAP_CBW20_40 | - IEEE80211_HTCAP_SGI20 | - IEEE80211_HTCAP_SGI40; if (sc->hw_type != IWN_HW_REV_TYPE_4965) - ic->ic_htcaps |= IEEE80211_HTCAP_GF; - if (sc->hw_type == IWN_HW_REV_TYPE_6050) - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DYN; - else - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DIS; -#endif + ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */ /* Read MAC address, channels, etc from EEPROM. */ if ((error = iwn_read_eeprom(sc, macaddr)) != 0) { @@ -628,14 +582,49 @@ iwn_attach(device_t dev) goto fail; } -#if 0 /* HT */ - /* Set supported HT rates. */ - ic->ic_sup_mcs[0] = 0xff; - if (sc->nrxchains > 1) - ic->ic_sup_mcs[1] = 0xff; - if (sc->nrxchains > 2) - ic->ic_sup_mcs[2] = 0xff; + /* Count the number of available chains. */ + sc->ntxchains = + ((sc->txchainmask >> 2) & 1) + + ((sc->txchainmask >> 1) & 1) + + ((sc->txchainmask >> 0) & 1); + sc->nrxchains = + ((sc->rxchainmask >> 2) & 1) + + ((sc->rxchainmask >> 1) & 1) + + ((sc->rxchainmask >> 0) & 1); + if (bootverbose) { + device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", + sc->ntxchains, sc->nrxchains, sc->eeprom_domain, + macaddr, ":"); + } + + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + ic->ic_rxstream = sc->nrxchains; + ic->ic_txstream = sc->ntxchains; + ic->ic_htcaps = + IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ + | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width*/ + | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ + | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ +#if IWN_RBUF_SIZE == 8192 + | IEEE80211_HTCAP_MAXAMSDU_7935 /* max A-MSDU length */ +#else + | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ +#endif +#ifdef notyet + | IEEE80211_HTCAP_GREENFIELD +#endif + /* s/w capabilities */ + | IEEE80211_HTC_HT /* HT operation */ + | IEEE80211_HTC_AMPDU /* tx A-MPDU */ +#ifdef notyet + | IEEE80211_HTC_AMSDU /* tx A-MSDU */ #endif + ; + if (sc->hw_type == IWN_HW_REV_TYPE_6050) + ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DYNAMIC; + else + ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_OFF; + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; @@ -652,12 +641,16 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; -#if 0 /* HT */ + sc->sc_ampdu_rx_start = ic->ic_ampdu_rx_start; ic->ic_ampdu_rx_start = iwn_ampdu_rx_start; + sc->sc_ampdu_rx_stop = ic->ic_ampdu_rx_stop; ic->ic_ampdu_rx_stop = iwn_ampdu_rx_stop; - ic->ic_ampdu_tx_start = iwn_ampdu_tx_start; - ic->ic_ampdu_tx_stop = iwn_ampdu_tx_stop; -#endif + sc->sc_addba_request = ic->ic_addba_request; + ic->ic_addba_request = iwn_addba_request; + sc->sc_addba_response = ic->ic_addba_response; + ic->ic_addba_response = iwn_addba_response; + sc->sc_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = iwn_ampdu_tx_stop; ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_updateedca; ic->ic_update_mcast = iwn_update_mcast; @@ -714,11 +707,10 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) ops->set_gains = iwn4965_set_gains; ops->add_node = iwn4965_add_node; ops->tx_done = iwn4965_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn4965_ampdu_tx_start; ops->ampdu_tx_stop = iwn4965_ampdu_tx_stop; -#endif sc->ntxqs = IWN4965_NTXQUEUES; + sc->firstaggqueue = IWN4965_FIRSTAGGQUEUE; sc->ndmachnls = IWN4965_NDMACHNLS; sc->broadcast_id = IWN4965_ID_BROADCAST; sc->rxonsz = IWN4965_RXONSZ; @@ -753,11 +745,10 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) ops->set_gains = iwn5000_set_gains; ops->add_node = iwn5000_add_node; ops->tx_done = iwn5000_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn5000_ampdu_tx_start; ops->ampdu_tx_stop = iwn5000_ampdu_tx_stop; -#endif sc->ntxqs = IWN5000_NTXQUEUES; + sc->firstaggqueue = IWN5000_FIRSTAGGQUEUE; sc->ndmachnls = IWN5000_NDMACHNLS; sc->broadcast_id = IWN5000_ID_BROADCAST; sc->rxonsz = IWN5000_RXONSZ; @@ -1489,13 +1480,6 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) __func__, error); goto fail; } - /* - * We only use rings 0 through 4 (4 EDCA + cmd) so there is no need - * to allocate commands space for other rings. - * XXX Do we really need to allocate descriptors for other rings? - */ - if (qid > 4) - return 0; size = IWN_TX_RING_COUNT * sizeof (struct iwn_tx_cmd); error = iwn_dma_contig_alloc(sc, &ring->cmd_dma, (void **)&ring->cmd, @@ -1694,7 +1678,7 @@ iwn4965_read_eeprom(struct iwn_softc *sc) iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 7; i++) { addr = iwn4965_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } @@ -1781,8 +1765,11 @@ iwn5000_read_eeprom(struct iwn_softc *sc) sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { - addr = base + iwn5000_regulatory_bands[i]; + for (i = 0; i < 7; i++) { + if (sc->hw_type >= IWN_HW_REV_TYPE_6000) + addr = base + iwn6000_regulatory_bands[i]; + else + addr = base + iwn5000_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } @@ -1884,18 +1871,15 @@ iwn_read_eeprom_band(struct iwn_softc *sc, int n) "add chan %d flags 0x%x maxpwr %d\n", chan, channels[i].flags, channels[i].maxpwr); -#if 0 /* HT */ - /* XXX no constraints on using HT20 */ - /* add HT20, HT40 added separately */ - c = &ic->ic_channels[ic->ic_nchans++]; - c[0] = c[-1]; - c->ic_flags |= IEEE80211_CHAN_HT20; - /* XXX NARROW =>'s 1/2 and 1/4 width? */ -#endif + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + /* add HT20, HT40 added separately */ + c = &ic->ic_channels[ic->ic_nchans++]; + c[0] = c[-1]; + c->ic_flags |= IEEE80211_CHAN_HT20; + } } } -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) { @@ -1904,55 +1888,59 @@ iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; struct ieee80211_channel *c, *cent, *extc; - int i; + uint8_t chan; + int i, nflags; + + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) + return; for (i = 0; i < band->nchan; i++) { - if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID) || - !(channels[i].flags & IWN_EEPROM_CHAN_WIDE)) { + if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, "skip chan %d flags 0x%x maxpwr %d\n", band->chan[i], channels[i].flags, channels[i].maxpwr); continue; } + chan = band->chan[i]; + nflags = iwn_eeprom_channel_flags(&channels[i]); + /* * Each entry defines an HT40 channel pair; find the * center channel, then the extension channel above. */ - cent = ieee80211_find_channel_byieee(ic, band->chan[i], - band->flags & ~IEEE80211_CHAN_HT); + cent = ieee80211_find_channel_byieee(ic, chan, + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (cent == NULL) { /* XXX shouldn't happen */ device_printf(sc->sc_dev, - "%s: no entry for channel %d\n", - __func__, band->chan[i]); + "%s: no entry for channel %d\n", __func__, chan); continue; } extc = ieee80211_find_channel(ic, cent->ic_freq+20, - band->flags & ~IEEE80211_CHAN_HT); + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (extc == NULL) { DPRINTF(sc, IWN_DEBUG_RESET, - "skip chan %d, extension channel not found\n", - band->chan[i]); + "%s: skip chan %d, extension channel not found\n", + __func__, chan); continue; } DPRINTF(sc, IWN_DEBUG_RESET, "add ht40 chan %d flags 0x%x maxpwr %d\n", - band->chan[i], channels[i].flags, channels[i].maxpwr); + chan, channels[i].flags, channels[i].maxpwr); c = &ic->ic_channels[ic->ic_nchans++]; c[0] = cent[0]; c->ic_extieee = extc->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40U; + c->ic_flags |= IEEE80211_CHAN_HT40U | nflags; c = &ic->ic_channels[ic->ic_nchans++]; c[0] = extc[0]; c->ic_extieee = cent->ic_ieee; - c->ic_flags &= ~IEEE80211_CHAN_HT; + c->ic_flags &= ~IEEE80211_CHAN_HT | nflags; c->ic_flags |= IEEE80211_CHAN_HT40D; } } -#endif static void iwn_read_eeprom_channels(struct iwn_softc *sc, int n, uint32_t addr) @@ -1965,25 +1953,34 @@ iwn_read_eeprom_channels(struct iwn_softc *sc, int n, uint32_t addr) if (n < 5) iwn_read_eeprom_band(sc, n); -#if 0 /* HT */ else iwn_read_eeprom_ht40(sc, n); -#endif ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); } static struct iwn_eeprom_chan * iwn_find_eeprom_channel(struct iwn_softc *sc, struct ieee80211_channel *c) { - int i, j; + int band, chan, i, j; - for (j = 0; j < 7; j++) { - for (i = 0; i < iwn_bands[j].nchan; i++) { - if (iwn_bands[j].chan[i] == c->ic_ieee) - return &sc->eeprom_channels[j][i]; + if (IEEE80211_IS_CHAN_HT40(c)) { + band = IEEE80211_IS_CHAN_5GHZ(c) ? 6 : 5; + if (IEEE80211_IS_CHAN_HT40D(c)) + chan = c->ic_extieee; + else + chan = c->ic_ieee; + for (i = 0; i < iwn_bands[band].nchan; i++) { + if (iwn_bands[band].chan[i] == chan) + return &sc->eeprom_channels[band][i]; + } + } else { + for (j = 0; j < 5; j++) { + for (i = 0; i < iwn_bands[j].nchan; i++) { + if (iwn_bands[j].chan[i] == c->ic_ieee) + return &sc->eeprom_channels[j][i]; + } } } - return NULL; } @@ -2020,18 +2017,22 @@ static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { struct iwn_eeprom_enhinfo enhinfo[35]; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_channel *c; uint16_t val, base; int8_t maxpwr; - int i; + uint8_t flags; + int i, j; iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); iwn_read_prom_data(sc, base + IWN6000_EEPROM_ENHINFO, enhinfo, sizeof enhinfo); - memset(sc->enh_maxpwr, 0, sizeof sc->enh_maxpwr); for (i = 0; i < nitems(enhinfo); i++) { - if (enhinfo[i].chan == 0 || enhinfo[i].reserved != 0) + flags = enhinfo[i].flags; + if (!(flags & IWN_ENHINFO_VALID)) continue; /* Skip invalid entries. */ maxpwr = 0; @@ -2045,11 +2046,34 @@ iwn_read_eeprom_enhinfo(struct iwn_softc *sc) maxpwr = MAX(maxpwr, enhinfo[i].mimo2); else if (sc->ntxchains == 3) maxpwr = MAX(maxpwr, enhinfo[i].mimo3); - maxpwr /= 2; /* Convert half-dBm to dBm. */ - DPRINTF(sc, IWN_DEBUG_RESET, "enhinfo %d, maxpwr=%d\n", i, - maxpwr); - sc->enh_maxpwr[i] = maxpwr; + for (j = 0; j < ic->ic_nchans; j++) { + c = &ic->ic_channels[j]; + if ((flags & IWN_ENHINFO_5GHZ)) { + if (!IEEE80211_IS_CHAN_A(c)) + continue; + } else if ((flags & IWN_ENHINFO_OFDM)) { + if (!IEEE80211_IS_CHAN_G(c)) + continue; + } else if (!IEEE80211_IS_CHAN_B(c)) + continue; + if ((flags & IWN_ENHINFO_HT40)) { + if (!IEEE80211_IS_CHAN_HT40(c)) + continue; + } else { + if (IEEE80211_IS_CHAN_HT40(c)) + continue; + } + if (enhinfo[i].chan != 0 && + enhinfo[i].chan != c->ic_ieee) + continue; + + DPRINTF(sc, IWN_DEBUG_RESET, + "channel %d(%x), maxpwr %d\n", c->ic_ieee, + c->ic_flags, maxpwr / 2); + c->ic_maxregpower = maxpwr / 2; + c->ic_maxpower = maxpwr; + } } } @@ -2059,15 +2083,73 @@ iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } +static __inline int +rate2plcp(int rate) +{ + switch (rate & 0xff) { + case 12: return 0xd; + case 18: return 0xf; + case 24: return 0x5; + case 36: return 0x7; + case 48: return 0x9; + case 72: return 0xb; + case 96: return 0x1; + case 108: return 0x3; + case 2: return 10; + case 4: return 20; + case 11: return 55; + case 22: return 110; + } + return 0; +} + static void iwn_newassoc(struct ieee80211_node *ni, int isnew) { + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_node *wn = (void *)ni; - int ridx, i; + uint8_t txant1, txant2; + int i, plcp, rate, ridx; + + /* Use the first valid TX antenna. */ + txant1 = IWN_LSB(sc->txchainmask); + txant2 = IWN_LSB(sc->txchainmask & ~txant1); - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - ridx = iwn_plcp_signal(ni->ni_rates.rs_rates[i]); - wn->ridx[i] = ridx; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + ridx = ni->ni_rates.rs_nrates - 1; + for (i = ni->ni_htrates.rs_nrates - 1; i >= 0; i--) { + plcp = ni->ni_htrates.rs_rates[i] | IWN_RFLAG_MCS; + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + plcp |= IWN_RFLAG_HT40; + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + plcp |= IWN_RFLAG_SGI; + } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + plcp |= IWN_RFLAG_SGI; + if (i > 7) + plcp |= IWN_RFLAG_ANT(txant1 | txant2); + else + plcp |= IWN_RFLAG_ANT(txant1); + if (ridx >= 0) { + rate = ni->ni_rates.rs_rates[ridx]; + rate &= IEEE80211_RATE_VAL; + wn->ridx[rate] = plcp; + } + wn->ridx[0x80 | i] = plcp; + ridx--; + } + } else { + for (i = 0; i < ni->ni_rates.rs_nrates; i++) { + rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL; + + plcp = rate2plcp(rate); + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + plcp |= IWN_RFLAG_CCK; + plcp |= IWN_RFLAG_ANT(txant1); + wn->ridx[rate] = htole32(plcp); + } } } @@ -2220,7 +2302,6 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, "%s: missing RX_PHY\n", __func__); return; } - sc->last_rx_valid = 0; stat = &sc->last_rx_stat; } else stat = (struct iwn_rx_stat *)(desc + 1); @@ -2343,6 +2424,8 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, /* Send the frame to the 802.11 layer. */ if (ni != NULL) { + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; (void)ieee80211_input(ni, m, rssi - nf, nf); /* Node is no longer needed. */ ieee80211_free_node(ni); @@ -2352,21 +2435,53 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, IWN_LOCK(sc); } -#if 0 /* HT */ /* Process an incoming Compressed BlockAck. */ static void iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { + struct ifnet *ifp = sc->sc_ifp; + struct iwn_node *wn; + struct ieee80211_node *ni; struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); struct iwn_tx_ring *txq; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint8_t tid; + int ackfailcnt = 0, i, shift; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - txq = &sc->txq[letoh16(ba->qid)]; - /* XXX TBD */ + txq = &sc->txq[le16toh(ba->qid)]; + tap = sc->qid2tap[le16toh(ba->qid)]; + tid = WME_AC_TO_TID(tap->txa_ac); + ni = tap->txa_ni; + wn = (void *)ni; + + if (wn->agg[tid].bitmap == 0) + return; + + shift = wn->agg[tid].startidx - ((le16toh(ba->seq) >> 4) & 0xff); + if (shift < 0) + shift += 0x100; + + if (wn->agg[tid].nframes > (64 - shift)) + return; + + bitmap = (le64toh(ba->bitmap) >> shift) & wn->agg[tid].bitmap; + for (i = 0; bitmap; i++) { + if ((bitmap & 1) == 0) { + ifp->if_oerrors++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); + } else { + ifp->if_opackets++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); + } + bitmap >>= 1; + } } -#endif /* * Process a CALIBRATION_RESULT notification sent by the initialization @@ -2495,7 +2610,11 @@ iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { struct iwn4965_tx_stat *stat = (struct iwn4965_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2504,7 +2623,13 @@ iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, le32toh(stat->status)); bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le32toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le32toh(stat->status) & 0xff); + } } static void @@ -2512,7 +2637,11 @@ iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { struct iwn5000_tx_stat *stat = (struct iwn5000_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2526,7 +2655,13 @@ iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, #endif bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le16toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le16toh(stat->status) & 0xff); + } } /* @@ -2627,6 +2762,96 @@ iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc) wakeup(&ring->desc[desc->idx]); } +static void +iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, + void *stat) +{ + struct ifnet *ifp = sc->sc_ifp; + struct iwn_tx_ring *ring = &sc->txq[qid]; + struct iwn_tx_data *data; + struct mbuf *m; + struct iwn_node *wn; + struct ieee80211_node *ni; + struct ieee80211vap *vap; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint32_t *status = stat; + uint16_t *aggstatus = stat; + uint8_t tid; + int bit, i, lastidx, seqno, shift, start; + +#ifdef NOT_YET + if (nframes == 1) { + if ((*status & 0xff) != 1 && (*status & 0xff) != 2) + printf("ieee80211_send_bar()\n"); + } +#endif + + bitmap = 0; + start = idx; + for (i = 0; i < nframes; i++) { + if (le16toh(aggstatus[i * 2]) & 0xc) + continue; + + idx = le16toh(aggstatus[2*i + 1]) & 0xff; + bit = idx - start; + shift = 0; + if (bit >= 64) { + shift = 0x100 - idx + start; + bit = 0; + start = idx; + } else if (bit <= -64) + bit = 0x100 - start + idx; + else if (bit < 0) { + shift = start - idx; + start = idx; + bit = 0; + } + bitmap = bitmap << shift; + bitmap |= 1ULL << bit; + } + tap = sc->qid2tap[qid]; + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + + seqno = le32toh(*(status + nframes)) & 0xfff; + for (lastidx = (seqno & 0xff); ring->read != lastidx;) { + data = &ring->data[ring->read]; + + KASSERT(data->ni != NULL, ("no node")); + + /* Unmap and free mbuf. */ + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + m = data->m, data->m = NULL; + ni = data->ni, data->ni = NULL; + vap = ni->ni_vap; + + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); + + m_freem(m); + ieee80211_free_node(ni); + + ring->queued--; + ring->read = (ring->read + 1) % IWN_TX_RING_COUNT; + } + + sc->sc_tx_timer = 0; + if (ring->queued < IWN_TX_RING_LOMARK) { + sc->qfullmsk &= ~(1 << ring->qid); + if (sc->qfullmsk == 0 && + (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + iwn_start_locked(ifp); + } + } +} + /* * Process an INT_FH_RX or INT_SW_RX interrupt. */ @@ -2671,12 +2896,10 @@ iwn_notif_intr(struct iwn_softc *sc) iwn_rx_done(sc, desc, data); break; -#if 0 /* HT */ case IWN_RX_COMPRESSED_BA: /* A Compressed BlockAck has been received. */ iwn_rx_compressed_ba(sc, desc, data); break; -#endif case IWN_TX_DONE: /* An 802.11 frame has been transmitted. */ @@ -3053,21 +3276,10 @@ iwn5000_reset_sched(struct iwn_softc *sc, int qid, int idx) } #endif -static uint8_t -iwn_plcp_signal(int rate) { - int i; - - for (i = 0; i < IWN_RIDX_MAX + 1; i++) { - if ((rate & IEEE80211_RATE_VAL) == iwn_rates[i].rate) - return i; - } - - return 0; -} - static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { + struct iwn_ops *ops = &sc->ops; const struct ieee80211_txparam *tp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; @@ -3077,7 +3289,6 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) struct iwn_tx_data *data; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; - const struct iwn_rate *rinfo; struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct mbuf *m1; @@ -3104,7 +3315,16 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) } ac = M_WME_GETAC(m); - ring = &sc->txq[ac]; + if (IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) { + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; + + ring = &sc->txq[*(int *)tap->txa_private]; + *(uint16_t *)wh->i_seq = + htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); + ni->ni_txseqs[tid]++; + } else { + ring = &sc->txq[ac]; + } desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -3121,8 +3341,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; + ridx = ic->ic_rt->rateCodeToIndex[rate]; /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -3141,7 +3360,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) struct iwn_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; - tap->wt_rate = rinfo->rate; + tap->wt_rate = rate; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; @@ -3228,14 +3447,13 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) tx->rts_ntries = 60; tx->data_ntries = 15; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = wn->ridx[rate]; if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; /* XXX Alternate between antenna A and B? */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); } else { tx->linkq = ni->ni_rates.rs_nrates - ridx - 1; flags |= IWN_TX_LINKQ; /* enable MRR */ @@ -3310,10 +3528,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3330,7 +3546,7 @@ static int iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { - const struct iwn_rate *rinfo; + struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ifp->if_l2com; @@ -3361,13 +3577,12 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, /* Choose a TX rate index. */ rate = params->ibp_rate0; - if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx == (uint8_t)-1) { /* XXX fall back to mcast/mgmt rate? */ m_freem(m); return EINVAL; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; totlen = m->m_pkthdr.len; @@ -3438,12 +3653,14 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = htole32(rate2plcp(rate)); + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + tx->rate |= htole32(IWN_RFLAG_CCK); /* Group or management frame. */ tx->linkq = 0; txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); @@ -3514,10 +3731,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3681,6 +3896,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) static int iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) { + struct iwn_ops *ops = &sc->ops; struct iwn_tx_ring *ring = &sc->txq[4]; struct iwn_tx_desc *desc; struct iwn_tx_data *data; @@ -3739,10 +3955,8 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, 0, 0); -#endif /* Kick command ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3783,9 +3997,8 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) struct iwn_node *wn = (void *)ni; struct ieee80211_rateset *rs = &ni->ni_rates; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; - int i, txrate; + int i, rate, txrate; /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); @@ -3794,17 +4007,26 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) linkq.id = wn->id; linkq.antmsk_1stream = txant; linkq.antmsk_2stream = IWN_ANT_AB; - linkq.ampdu_max = 31; + linkq.ampdu_max = 64; linkq.ampdu_threshold = 3; linkq.ampdu_limit = htole16(4000); /* 4ms */ /* Start at highest available bit-rate. */ - txrate = rs->rs_nrates - 1; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + txrate = ni->ni_htrates.rs_nrates - 1; + else + txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { - rinfo = &iwn_rates[wn->ridx[txrate]]; - linkq.retry[i].plcp = rinfo->plcp; - linkq.retry[i].rflags = rinfo->flags; - linkq.retry[i].rflags |= IWN_RFLAG_ANT(txant); + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + rate = 0x80 | txrate; + else + rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL; + linkq.retry[i] = wn->ridx[rate]; + + if ((le32toh(wn->ridx[rate]) & IWN_RFLAG_MCS) && + (le32toh(wn->ridx[rate]) & 0xff) > 7) + linkq.mimo = i + 1; + /* Next retry at immediate lower bit-rate. */ if (txrate > 0) txrate--; @@ -3823,7 +4045,6 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) struct ieee80211com *ic = ifp->if_l2com; struct iwn_node_info node; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; int i, error; @@ -3847,16 +4068,13 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) /* Use lowest mandatory bit-rate. */ if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) - rinfo = &iwn_rates[IWN_RIDX_OFDM6]; + linkq.retry[0] = htole32(0xd); else - rinfo = &iwn_rates[IWN_RIDX_CCK1]; - linkq.retry[0].plcp = rinfo->plcp; - linkq.retry[0].rflags = rinfo->flags; - linkq.retry[0].rflags |= IWN_RFLAG_ANT(txant); + linkq.retry[0] = htole32(10 | IWN_RFLAG_CCK); + linkq.retry[0] |= htole32(IWN_RFLAG_ANT(txant)); /* Use same bit-rate for all TX retries. */ for (i = 1; i < IWN_MAX_TX_RETRIES; i++) { - linkq.retry[i].plcp = linkq.retry[0].plcp; - linkq.retry[i].rflags = linkq.retry[0].rflags; + linkq.retry[i] = linkq.retry[0]; } return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async); } @@ -4908,6 +5126,7 @@ iwn_scan(struct iwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_scan_state *ss = ic->ic_scan; /*XXX*/ + struct ieee80211_node *ni = ss->ss_vap->iv_bss; struct iwn_scan_hdr *hdr; struct iwn_cmd_data *tx; struct iwn_scan_essid *essid; @@ -4956,18 +5175,17 @@ iwn_scan(struct iwn_softc *sc) if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) { /* Send probe requests at 6Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_OFDM6].plcp; + tx->rate = htole32(0xd); rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; } else { hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO); /* Send probe requests at 1Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_CCK1].plcp; - tx->rflags = IWN_RFLAG_CCK; + tx->rate = htole32(10 | IWN_RFLAG_CCK); rs = &ic->ic_sup_rates[IEEE80211_MODE_11G]; } /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); essid = (struct iwn_scan_essid *)(tx + 1); if (ss->ss_ssid[0].len != 0) { @@ -4994,10 +5212,8 @@ iwn_scan(struct iwn_softc *sc) frm = ieee80211_add_rates(frm, rs); if (rs->rs_nrates > IEEE80211_RATE_SIZE) frm = ieee80211_add_xrates(frm, rs); -#if 0 /* HT */ - if (ic->ic_flags & IEEE80211_F_HTON) - frm = ieee80211_add_htcaps(frm, ic); -#endif + if (ic->ic_htcaps & IEEE80211_HTC_HT) + frm = ieee80211_add_htcap(frm, ni); /* Set length of probe request. */ tx->len = htole16(frm - (uint8_t *)wh); @@ -5124,6 +5340,7 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni = vap->iv_bss; struct iwn_node_info node; + uint32_t htflags = 0; int error; if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -5159,26 +5376,22 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) sc->rxon.cck_mask = 0x0f; sc->rxon.ofdm_mask = 0x15; } -#if 0 /* HT */ if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - sc->rxon.flags &= ~htole32(IWN_RXON_HT); - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40U); - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40D); - else - sc->rxon.flags |= htole32(IWN_RXON_HT20); - sc->rxon.rxchain = htole16( - IWN_RXCHAIN_VALID(3) - | IWN_RXCHAIN_MIMO_COUNT(3) - | IWN_RXCHAIN_IDLE_COUNT(1) - | IWN_RXCHAIN_MIMO_FORCE); - - maxrxampdu = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); - ampdudensity = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); - } else - maxrxampdu = ampdudensity = 0; -#endif + htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode); + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + switch (ic->ic_curhtprotmode) { + case IEEE80211_HTINFO_OPMODE_HT20PR: + htflags |= IWN_RXON_HT_MODEPURE40; + break; + default: + htflags |= IWN_RXON_HT_MODEMIXED; + break; + } + } + if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) + htflags |= IWN_RXON_HT_HT40MINUS; + } + sc->rxon.flags |= htole32(htflags); sc->rxon.filter |= htole32(IWN_FILTER_BSS); DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n", sc->rxon.chan, sc->rxon.flags); @@ -5205,10 +5418,20 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) memset(&node, 0, sizeof node); IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.id = IWN_ID_BSS; -#ifdef notyet - node.htflags = htole32(IWN_AMDPU_SIZE_FACTOR(3) | - IWN_AMDPU_DENSITY(5)); /* 2us */ -#endif + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) { + case IEEE80211_HTCAP_SMPS_ENA: + node.htflags |= htole32(IWN_SMPS_MIMO_DIS); + break; + case IEEE80211_HTCAP_SMPS_DYNAMIC: + node.htflags |= htole32(IWN_SMPS_MIMO_PROT); + break; + } + node.htflags |= htole32(IWN_AMDPU_SIZE_FACTOR(3) | + IWN_AMDPU_DENSITY(5)); /* 4us */ + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) + node.htflags |= htole32(IWN_NODE_HT40); + } DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node\n", __func__); error = ops->add_node(sc, &node, 1); if (error != 0) { @@ -5243,30 +5466,36 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) #undef MS } -#if 0 /* HT */ /* * This function is called by upper layer when an ADDBA request is received * from another STA and before the ADDBA response is sent. */ static int -iwn_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, + int baparamset, int batimeout, int baseqctl) { - struct ieee80211_rx_ba *ba = &ni->ni_rx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; +#define MS(_v, _f) (((_v) & _f) >> _f##_S) + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint8_t tid; + int error; + tid = MS(baparamset, IEEE80211_BAPS_TID); memset(&node, 0, sizeof node); node.id = wn->id; node.control = IWN_NODE_UPDATE; node.flags = IWN_FLAG_SET_ADDBA; node.addba_tid = tid; - node.addba_ssn = htole16(ba->ba_winstart); + node.addba_ssn = htole16(MS(baseqctl, IEEE80211_BASEQ_START)); DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n", - wn->id, tid, ba->ba_winstart); - return ops->add_node(sc, &node, 1); + wn->id, tid, MS(baseqctl, IEEE80211_BASEQ_START)); + error = ops->add_node(sc, &node, 1); + if (error != 0) + return error; + return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); +#undef MS } /* @@ -5274,13 +5503,20 @@ iwn_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, * Block Ack agreement (eg. uppon receipt of a DELBA frame). */ static void -iwn_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) { - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint8_t tid; + + /* XXX: tid as an argument */ + for (tid = 0; tid < WME_NUM_TID; tid++) { + if (&ni->ni_rx_ampdu[tid] == rap) + break; + } memset(&node, 0, sizeof node); node.id = wn->id; @@ -5289,6 +5525,57 @@ iwn_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, node.delba_tid = tid; DPRINTF(sc, IWN_DEBUG_RECV, "DELBA RA=%d TID=%d\n", wn->id, tid); (void)ops->add_node(sc, &node, 1); + sc->sc_ampdu_rx_stop(ni, rap); +} + +static int +iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int dialogtoken, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid; + + for (qid = sc->firstaggqueue; qid < sc->ntxqs; qid++) { + if (sc->qid2tap[qid] == NULL) + break; + } + if (qid == sc->ntxqs) { + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: not free aggregation queue\n", + __func__); + return 0; + } + tap->txa_private = malloc(sizeof(int), M_DEVBUF, M_NOWAIT); + if (tap->txa_private == NULL) { + device_printf(sc->sc_dev, + "%s: failed to alloc TX aggregation structure\n", __func__); + return 0; + } + sc->qid2tap[qid] = tap; + *(int *)tap->txa_private = qid; + return sc->sc_addba_request(ni, tap, dialogtoken, baparamset, + batimeout); +} + +static int +iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int code, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid = *(int *)tap->txa_private; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int ret; + + if (code == IEEE80211_STATUS_SUCCESS) { + ni->ni_txseqs[tid] = tap->txa_start & 0xfff; + ret = iwn_ampdu_tx_start(ni->ni_ic, ni, tid); + if (ret != 1) + return ret; + } else { + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; + } + return sc->sc_addba_response(ni, tap, code, baparamset, batimeout); } /* @@ -5299,12 +5586,12 @@ static int iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, uint8_t tid) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)]; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; - int error; + int error, qid; /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); @@ -5315,35 +5602,40 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, node.disable_tid = htole16(wn->disable_tid); error = ops->add_node(sc, &node, 1); if (error != 0) - return error; + return 0; if ((error = iwn_nic_lock(sc)) != 0) - return error; - ops->ampdu_tx_start(sc, ni, tid, ba->ba_winstart); + return 0; + qid = *(int *)tap->txa_private; + ops->ampdu_tx_start(sc, ni, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); - return 0; + + iwn_set_link_quality(sc, ni); + return 1; } static void -iwn_ampdu_tx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int qid = *(int *)tap->txa_private; if (iwn_nic_lock(sc) != 0) return; - ops->ampdu_tx_stop(sc, tid, ba->ba_winstart); + ops->ampdu_tx_stop(sc, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; } static void iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 7 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), @@ -5357,6 +5649,7 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, iwn_prph_setbits(sc, IWN4965_SCHED_QCHAIN_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN4965_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5377,10 +5670,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, } static void -iwn4965_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn4965_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 7 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5399,10 +5690,9 @@ iwn4965_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) static void iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 10 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), @@ -5419,6 +5709,7 @@ iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, iwn_prph_setbits(sc, IWN5000_SCHED_AGGR_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN5000_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5435,10 +5726,8 @@ iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, } static void -iwn5000_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn5000_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 10 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_CHGACT); @@ -5457,7 +5746,6 @@ iwn5000_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_INACTIVE | iwn_tid2fifo[tid]); } -#endif /* * Query calibration tables from the initialization firmware. We do this diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index be70b49..4cbf652 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -27,6 +27,9 @@ #define IWN4965_NTXQUEUES 16 #define IWN5000_NTXQUEUES 20 +#define IWN4965_FIRSTAGGQUEUE 7 +#define IWN5000_FIRSTAGGQUEUE 10 + #define IWN4965_NDMACHNLS 7 #define IWN5000_NDMACHNLS 8 @@ -489,6 +492,10 @@ struct iwn_rxon { #define IWN_RXON_ANTENNA_A (1 << 8) #define IWN_RXON_ANTENNA_B (1 << 9) #define IWN_RXON_TSF (1 << 15) +#define IWN_RXON_HT_HT40MINUS (1 << 22) +#define IWN_RXON_HT_PROTMODE(x) (x << 23) +#define IWN_RXON_HT_MODEPURE40 (1 << 25) +#define IWN_RXON_HT_MODEMIXED (2 << 25) #define IWN_RXON_CTS_TO_SELF (1 << 30) uint32_t filter; @@ -588,7 +595,10 @@ struct iwn_node_info { uint8_t txmic[8]; uint32_t htflags; +#define IWN_SMPS_MIMO_PROT (1 << 17) #define IWN_AMDPU_SIZE_FACTOR(x) ((x) << 19) +#define IWN_NODE_HT40 (1 << 21) +#define IWN_SMPS_MIMO_DIS (1 << 22) #define IWN_AMDPU_DENSITY(x) ((x) << 23) uint32_t mask; @@ -625,8 +635,13 @@ struct iwn4965_node_info { uint32_t reserved7; } __packed; -#define IWN_RFLAG_CCK (1 << 1) -#define IWN_RFLAG_ANT(x) ((x) << 6) +#define IWN_RFLAG_MCS (1 << 8) +#define IWN_RFLAG_CCK (1 << 9) +#define IWN_RFLAG_GREENFIELD (1 << 10) +#define IWN_RFLAG_HT40 (1 << 11) +#define IWN_RFLAG_DUPLICATE (1 << 12) +#define IWN_RFLAG_SGI (1 << 13) +#define IWN_RFLAG_ANT(x) ((x) << 14) /* Structure for command IWN_CMD_TX_DATA. */ struct iwn_cmd_data { @@ -647,9 +662,7 @@ struct iwn_cmd_data { #define IWN_TX_NEED_PADDING (1 << 20) uint32_t scratch; - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint8_t id; uint8_t security; @@ -690,11 +703,7 @@ struct iwn_cmd_link_quality { uint8_t ampdu_threshold; uint8_t ampdu_max; uint32_t reserved2; - struct { - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; - } __packed retry[IWN_MAX_TX_RETRIES]; + uint32_t retry[IWN_MAX_TX_RETRIES]; uint32_t reserved3; } __packed; @@ -1065,9 +1074,7 @@ struct iwn4965_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1079,9 +1086,7 @@ struct iwn5000_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1136,9 +1141,7 @@ struct iwn_rx_stat { uint16_t chan; uint8_t phybuf[32]; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t len; uint16_t reserve3; } __packed; @@ -1403,6 +1406,7 @@ struct iwn_fw_tlv { #define IWN5000_EEPROM_BAND4 0x02e #define IWN5000_EEPROM_BAND5 0x03a #define IWN5000_EEPROM_BAND6 0x041 +#define IWN6000_EEPROM_BAND6 0x040 #define IWN5000_EEPROM_BAND7 0x049 #define IWN6000_EEPROM_ENHINFO 0x054 #define IWN5000_EEPROM_CRYSTAL 0x128 @@ -1432,7 +1436,17 @@ struct iwn_eeprom_chan { } __packed; struct iwn_eeprom_enhinfo { - uint16_t chan; + uint8_t flags; +#define IWN_ENHINFO_VALID 0x01 +#define IWN_ENHINFO_5GHZ 0x02 +#define IWN_ENHINFO_OFDM 0x04 +#define IWN_ENHINFO_HT40 0x08 +#define IWN_ENHINFO_HTAP 0x10 +#define IWN_ENHINFO_RES1 0x20 +#define IWN_ENHINFO_RES2 0x40 +#define IWN_ENHINFO_COMMON 0x80 + + uint8_t chan; int8_t chain[3]; /* max power in half-dBm */ uint8_t reserved; int8_t mimo2; /* max power in half-dBm */ @@ -1486,6 +1500,16 @@ static const uint32_t iwn5000_regulatory_bands[IWN_NBANDS] = { IWN5000_EEPROM_BAND7 }; +static const uint32_t iwn6000_regulatory_bands[IWN_NBANDS] = { + IWN5000_EEPROM_BAND1, + IWN5000_EEPROM_BAND2, + IWN5000_EEPROM_BAND3, + IWN5000_EEPROM_BAND4, + IWN5000_EEPROM_BAND5, + IWN6000_EEPROM_BAND6, + IWN5000_EEPROM_BAND7 +}; + #define IWN_CHAN_BANDS_COUNT 7 #define IWN_MAX_CHAN_PER_BAND 14 static const struct iwn_chan_band { @@ -1513,26 +1537,6 @@ static const struct iwn_chan_band { #define IWN_RIDX_CCK1 0 #define IWN_RIDX_OFDM6 4 -static const struct iwn_rate { - uint8_t rate; - uint8_t plcp; - uint8_t flags; -} iwn_rates[IWN_RIDX_MAX + 1] = { - { 2, 10, IWN_RFLAG_CCK }, - { 4, 20, IWN_RFLAG_CCK }, - { 11, 55, IWN_RFLAG_CCK }, - { 22, 110, IWN_RFLAG_CCK }, - { 12, 0xd, 0 }, - { 18, 0xf, 0 }, - { 24, 0x5, 0 }, - { 36, 0x7, 0 }, - { 48, 0x9, 0 }, - { 72, 0xb, 0 }, - { 96, 0x1, 0 }, - { 108, 0x3, 0 }, - { 120, 0x3, 0 } -}; - #define IWN4965_MAX_PWR_INDEX 107 /* diff --git a/sys/dev/iwn/if_iwnvar.h b/sys/dev/iwn/if_iwnvar.h index a61b3b5..5f46a36 100644 --- a/sys/dev/iwn/if_iwnvar.h +++ b/sys/dev/iwn/if_iwnvar.h @@ -78,6 +78,7 @@ struct iwn_tx_ring { int qid; int queued; int cur; + int read; }; struct iwn_softc; @@ -101,7 +102,12 @@ struct iwn_node { struct ieee80211_node ni; /* must be the first */ uint16_t disable_tid; uint8_t id; - uint8_t ridx[IEEE80211_RATE_MAXSIZE]; + uint32_t ridx[256]; + struct { + uint64_t bitmap; + int startidx; + int nframes; + } agg[IEEE80211_TID_SIZE]; }; struct iwn_calib_state { @@ -174,12 +180,10 @@ struct iwn_ops { int); void (*tx_done)(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ void (*ampdu_tx_start)(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); - void (*ampdu_tx_stop)(struct iwn_softc *, uint8_t, + struct ieee80211_node *, int, uint8_t, uint16_t); + void (*ampdu_tx_stop)(struct iwn_softc *, int, uint8_t, uint16_t); -#endif }; struct iwn_vap { @@ -215,6 +219,7 @@ struct iwn_softc { const struct iwn_sensitivity_limits *limits; int ntxqs; + int firstaggqueue; int ndmachnls; uint8_t broadcast_id; int rxonsz; @@ -295,7 +300,6 @@ struct iwn_softc { int8_t maxpwr2GHz; int8_t maxpwr5GHz; int8_t maxpwr[IEEE80211_CHAN_MAX]; - int8_t enh_maxpwr[35]; int32_t temp_off; uint32_t int_mask; @@ -307,6 +311,20 @@ struct iwn_softc { int sc_tx_timer; + struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES]; + + int (*sc_ampdu_rx_start)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); + void (*sc_ampdu_rx_stop)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); + int (*sc_addba_request)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + int (*sc_addba_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + void (*sc_addba_stop)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + + struct iwn_rx_radiotap_header sc_rxtap; struct iwn_tx_radiotap_header sc_txtap; }; --Boundary-00=_CHUvNNJ7ZQlWu6H-- From owner-freebsd-net@FreeBSD.ORG Sun May 1 13:24:22 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76A5106566B; Sun, 1 May 2011 13:24:22 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D5A7E8FC0A; Sun, 1 May 2011 13:24:21 +0000 (UTC) Received: by fxm11 with SMTP id 11so4786903fxm.13 for ; Sun, 01 May 2011 06:24:20 -0700 (PDT) Received: by 10.223.58.72 with SMTP id f8mr1506947fah.137.1304256260817; Sun, 01 May 2011 06:24:20 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-067-204-093.pools.arcor-ip.net [88.67.204.93]) by mx.google.com with ESMTPS id j12sm1464517fax.33.2011.05.01.06.24.04 (version=SSLv3 cipher=OTHER); Sun, 01 May 2011 06:24:19 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: freebsd-wireless@freebsd.org Date: Sun, 1 May 2011 15:24:09 +0200 User-Agent: KMail/1.13.7 (FreeBSD/8.2-STABLE; KDE/4.6.2; amd64; ; ) References: <201105011319.30649.bschmidt@freebsd.org> In-Reply-To: <201105011319.30649.bschmidt@freebsd.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_57VvNvUbwvnkjXW" Message-Id: <201105011524.09613.bschmidt@freebsd.org> Cc: freebsd-net@freebsd.org Subject: Re: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 13:24:22 -0000 --Boundary-00=_57VvNvUbwvnkjXW Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Sunday 01 May 2011 13:19:30 Bernhard Schmidt wrote: > Hi, > > I finally managed to get the 11n bits for iwn(4) sorted out. Well, > there is still an issue somewhere with HT40 frame protection or > TX chain setup on 5000 adapters, resulting in throughput not being > that stable. But overall it seems to work pretty decently > > This is for HEAD only right now, net80211 in stable/8 does not yet > contain the latest 11n related fixes. So, if you run HEAD and have > some iwn(4) hardware, I'd appreciate feedback. > .. Updated version, I've missed a locking issue. -- Bernhard --Boundary-00=_57VvNvUbwvnkjXW Content-Type: text/x-patch; charset="ISO-8859-1"; name="iwn_ht2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iwn_ht2.diff" diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 7d6ec68..e2cf4be 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -152,9 +152,7 @@ static void iwn4965_print_power_group(struct iwn_softc *, int); static void iwn5000_read_eeprom(struct iwn_softc *); static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); static void iwn_read_eeprom_band(struct iwn_softc *, int); -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *, int); -#endif static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); static struct iwn_eeprom_chan *iwn_find_eeprom_channel(struct iwn_softc *, struct ieee80211_channel *); @@ -172,10 +170,8 @@ static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#endif static void iwn5000_rx_calib_results(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, @@ -186,6 +182,7 @@ static void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, uint8_t); +static void iwn_ampdu_tx_done(struct iwn_softc *, int, int, int, void *); static void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_notif_intr(struct iwn_softc *); static void iwn_wakeup_intr(struct iwn_softc *); @@ -199,7 +196,6 @@ static void iwn5000_update_sched(struct iwn_softc *, int, int, uint8_t, #ifdef notyet static void iwn5000_reset_sched(struct iwn_softc *, int, int); #endif -static uint8_t iwn_plcp_signal(int); static int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *); static int iwn_tx_data_raw(struct iwn_softc *, struct mbuf *, @@ -252,24 +248,26 @@ static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); static int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); -#if 0 /* HT */ -static int iwn_ampdu_rx_start(struct ieee80211com *, - struct ieee80211_node *, uint8_t); -static void iwn_ampdu_rx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); +static int iwn_ampdu_rx_start(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); +static void iwn_ampdu_rx_stop(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); +static int iwn_addba_request(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); +static int iwn_addba_response(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); static int iwn_ampdu_tx_start(struct ieee80211com *, struct ieee80211_node *, uint8_t); -static void iwn_ampdu_tx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); +static void iwn_ampdu_tx_stop(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); static void iwn4965_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn4965_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn4965_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); static void iwn5000_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn5000_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn5000_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); -#endif static int iwn5000_query_calibration(struct iwn_softc *); static int iwn5000_send_calibration(struct iwn_softc *); static int iwn5000_send_wimax_coex(struct iwn_softc *); @@ -550,21 +548,6 @@ iwn_attach(device_t dev) /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); - /* Count the number of available chains. */ - sc->ntxchains = - ((sc->txchainmask >> 2) & 1) + - ((sc->txchainmask >> 1) & 1) + - ((sc->txchainmask >> 0) & 1); - sc->nrxchains = - ((sc->rxchainmask >> 2) & 1) + - ((sc->rxchainmask >> 1) & 1) + - ((sc->rxchainmask >> 0) & 1); - if (bootverbose) { - device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", - sc->ntxchains, sc->nrxchains, sc->eeprom_domain, - macaddr, ":"); - } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not allocate ifnet structure\n"); @@ -584,42 +567,13 @@ iwn_attach(device_t dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA | IEEE80211_C_SHPREAMBLE /* short preamble supported */ - | IEEE80211_C_BGSCAN /* background scanning */ #if 0 | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ ; -#if 0 /* HT */ - /* XXX disable until HT channel setup works */ - ic->ic_htcaps = - IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ - | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width */ - | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ - | IEEE80211_HTCAP_RXSTBC_2STREAM/* 1-2 spatial streams */ - | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ - /* s/w capabilities */ - | IEEE80211_HTC_HT /* HT operation */ - | IEEE80211_HTC_AMPDU /* tx A-MPDU */ - | IEEE80211_HTC_AMSDU /* tx A-MSDU */ - ; - - /* Set HT capabilities. */ - ic->ic_htcaps = -#if IWN_RBUF_SIZE == 8192 - IEEE80211_HTCAP_AMSDU7935 | -#endif - IEEE80211_HTCAP_CBW20_40 | - IEEE80211_HTCAP_SGI20 | - IEEE80211_HTCAP_SGI40; if (sc->hw_type != IWN_HW_REV_TYPE_4965) - ic->ic_htcaps |= IEEE80211_HTCAP_GF; - if (sc->hw_type == IWN_HW_REV_TYPE_6050) - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DYN; - else - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DIS; -#endif + ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */ /* Read MAC address, channels, etc from EEPROM. */ if ((error = iwn_read_eeprom(sc, macaddr)) != 0) { @@ -628,14 +582,49 @@ iwn_attach(device_t dev) goto fail; } -#if 0 /* HT */ - /* Set supported HT rates. */ - ic->ic_sup_mcs[0] = 0xff; - if (sc->nrxchains > 1) - ic->ic_sup_mcs[1] = 0xff; - if (sc->nrxchains > 2) - ic->ic_sup_mcs[2] = 0xff; + /* Count the number of available chains. */ + sc->ntxchains = + ((sc->txchainmask >> 2) & 1) + + ((sc->txchainmask >> 1) & 1) + + ((sc->txchainmask >> 0) & 1); + sc->nrxchains = + ((sc->rxchainmask >> 2) & 1) + + ((sc->rxchainmask >> 1) & 1) + + ((sc->rxchainmask >> 0) & 1); + if (bootverbose) { + device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", + sc->ntxchains, sc->nrxchains, sc->eeprom_domain, + macaddr, ":"); + } + + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + ic->ic_rxstream = sc->nrxchains; + ic->ic_txstream = sc->ntxchains; + ic->ic_htcaps = + IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ + | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width*/ + | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ + | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ +#if IWN_RBUF_SIZE == 8192 + | IEEE80211_HTCAP_MAXAMSDU_7935 /* max A-MSDU length */ +#else + | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ +#endif +#ifdef notyet + | IEEE80211_HTCAP_GREENFIELD +#endif + /* s/w capabilities */ + | IEEE80211_HTC_HT /* HT operation */ + | IEEE80211_HTC_AMPDU /* tx A-MPDU */ +#ifdef notyet + | IEEE80211_HTC_AMSDU /* tx A-MSDU */ #endif + ; + if (sc->hw_type == IWN_HW_REV_TYPE_6050) + ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DYNAMIC; + else + ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_OFF; + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; @@ -652,12 +641,16 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; -#if 0 /* HT */ + sc->sc_ampdu_rx_start = ic->ic_ampdu_rx_start; ic->ic_ampdu_rx_start = iwn_ampdu_rx_start; + sc->sc_ampdu_rx_stop = ic->ic_ampdu_rx_stop; ic->ic_ampdu_rx_stop = iwn_ampdu_rx_stop; - ic->ic_ampdu_tx_start = iwn_ampdu_tx_start; - ic->ic_ampdu_tx_stop = iwn_ampdu_tx_stop; -#endif + sc->sc_addba_request = ic->ic_addba_request; + ic->ic_addba_request = iwn_addba_request; + sc->sc_addba_response = ic->ic_addba_response; + ic->ic_addba_response = iwn_addba_response; + sc->sc_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = iwn_ampdu_tx_stop; ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_updateedca; ic->ic_update_mcast = iwn_update_mcast; @@ -714,11 +707,10 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) ops->set_gains = iwn4965_set_gains; ops->add_node = iwn4965_add_node; ops->tx_done = iwn4965_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn4965_ampdu_tx_start; ops->ampdu_tx_stop = iwn4965_ampdu_tx_stop; -#endif sc->ntxqs = IWN4965_NTXQUEUES; + sc->firstaggqueue = IWN4965_FIRSTAGGQUEUE; sc->ndmachnls = IWN4965_NDMACHNLS; sc->broadcast_id = IWN4965_ID_BROADCAST; sc->rxonsz = IWN4965_RXONSZ; @@ -753,11 +745,10 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) ops->set_gains = iwn5000_set_gains; ops->add_node = iwn5000_add_node; ops->tx_done = iwn5000_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn5000_ampdu_tx_start; ops->ampdu_tx_stop = iwn5000_ampdu_tx_stop; -#endif sc->ntxqs = IWN5000_NTXQUEUES; + sc->firstaggqueue = IWN5000_FIRSTAGGQUEUE; sc->ndmachnls = IWN5000_NDMACHNLS; sc->broadcast_id = IWN5000_ID_BROADCAST; sc->rxonsz = IWN5000_RXONSZ; @@ -1489,13 +1480,6 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) __func__, error); goto fail; } - /* - * We only use rings 0 through 4 (4 EDCA + cmd) so there is no need - * to allocate commands space for other rings. - * XXX Do we really need to allocate descriptors for other rings? - */ - if (qid > 4) - return 0; size = IWN_TX_RING_COUNT * sizeof (struct iwn_tx_cmd); error = iwn_dma_contig_alloc(sc, &ring->cmd_dma, (void **)&ring->cmd, @@ -1694,7 +1678,7 @@ iwn4965_read_eeprom(struct iwn_softc *sc) iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 7; i++) { addr = iwn4965_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } @@ -1781,8 +1765,11 @@ iwn5000_read_eeprom(struct iwn_softc *sc) sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { - addr = base + iwn5000_regulatory_bands[i]; + for (i = 0; i < 7; i++) { + if (sc->hw_type >= IWN_HW_REV_TYPE_6000) + addr = base + iwn6000_regulatory_bands[i]; + else + addr = base + iwn5000_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } @@ -1884,18 +1871,15 @@ iwn_read_eeprom_band(struct iwn_softc *sc, int n) "add chan %d flags 0x%x maxpwr %d\n", chan, channels[i].flags, channels[i].maxpwr); -#if 0 /* HT */ - /* XXX no constraints on using HT20 */ - /* add HT20, HT40 added separately */ - c = &ic->ic_channels[ic->ic_nchans++]; - c[0] = c[-1]; - c->ic_flags |= IEEE80211_CHAN_HT20; - /* XXX NARROW =>'s 1/2 and 1/4 width? */ -#endif + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + /* add HT20, HT40 added separately */ + c = &ic->ic_channels[ic->ic_nchans++]; + c[0] = c[-1]; + c->ic_flags |= IEEE80211_CHAN_HT20; + } } } -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) { @@ -1904,55 +1888,59 @@ iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; struct ieee80211_channel *c, *cent, *extc; - int i; + uint8_t chan; + int i, nflags; + + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) + return; for (i = 0; i < band->nchan; i++) { - if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID) || - !(channels[i].flags & IWN_EEPROM_CHAN_WIDE)) { + if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, "skip chan %d flags 0x%x maxpwr %d\n", band->chan[i], channels[i].flags, channels[i].maxpwr); continue; } + chan = band->chan[i]; + nflags = iwn_eeprom_channel_flags(&channels[i]); + /* * Each entry defines an HT40 channel pair; find the * center channel, then the extension channel above. */ - cent = ieee80211_find_channel_byieee(ic, band->chan[i], - band->flags & ~IEEE80211_CHAN_HT); + cent = ieee80211_find_channel_byieee(ic, chan, + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (cent == NULL) { /* XXX shouldn't happen */ device_printf(sc->sc_dev, - "%s: no entry for channel %d\n", - __func__, band->chan[i]); + "%s: no entry for channel %d\n", __func__, chan); continue; } extc = ieee80211_find_channel(ic, cent->ic_freq+20, - band->flags & ~IEEE80211_CHAN_HT); + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (extc == NULL) { DPRINTF(sc, IWN_DEBUG_RESET, - "skip chan %d, extension channel not found\n", - band->chan[i]); + "%s: skip chan %d, extension channel not found\n", + __func__, chan); continue; } DPRINTF(sc, IWN_DEBUG_RESET, "add ht40 chan %d flags 0x%x maxpwr %d\n", - band->chan[i], channels[i].flags, channels[i].maxpwr); + chan, channels[i].flags, channels[i].maxpwr); c = &ic->ic_channels[ic->ic_nchans++]; c[0] = cent[0]; c->ic_extieee = extc->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40U; + c->ic_flags |= IEEE80211_CHAN_HT40U | nflags; c = &ic->ic_channels[ic->ic_nchans++]; c[0] = extc[0]; c->ic_extieee = cent->ic_ieee; - c->ic_flags &= ~IEEE80211_CHAN_HT; + c->ic_flags &= ~IEEE80211_CHAN_HT | nflags; c->ic_flags |= IEEE80211_CHAN_HT40D; } } -#endif static void iwn_read_eeprom_channels(struct iwn_softc *sc, int n, uint32_t addr) @@ -1965,25 +1953,34 @@ iwn_read_eeprom_channels(struct iwn_softc *sc, int n, uint32_t addr) if (n < 5) iwn_read_eeprom_band(sc, n); -#if 0 /* HT */ else iwn_read_eeprom_ht40(sc, n); -#endif ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); } static struct iwn_eeprom_chan * iwn_find_eeprom_channel(struct iwn_softc *sc, struct ieee80211_channel *c) { - int i, j; + int band, chan, i, j; - for (j = 0; j < 7; j++) { - for (i = 0; i < iwn_bands[j].nchan; i++) { - if (iwn_bands[j].chan[i] == c->ic_ieee) - return &sc->eeprom_channels[j][i]; + if (IEEE80211_IS_CHAN_HT40(c)) { + band = IEEE80211_IS_CHAN_5GHZ(c) ? 6 : 5; + if (IEEE80211_IS_CHAN_HT40D(c)) + chan = c->ic_extieee; + else + chan = c->ic_ieee; + for (i = 0; i < iwn_bands[band].nchan; i++) { + if (iwn_bands[band].chan[i] == chan) + return &sc->eeprom_channels[band][i]; + } + } else { + for (j = 0; j < 5; j++) { + for (i = 0; i < iwn_bands[j].nchan; i++) { + if (iwn_bands[j].chan[i] == c->ic_ieee) + return &sc->eeprom_channels[j][i]; + } } } - return NULL; } @@ -2020,18 +2017,22 @@ static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { struct iwn_eeprom_enhinfo enhinfo[35]; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_channel *c; uint16_t val, base; int8_t maxpwr; - int i; + uint8_t flags; + int i, j; iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); iwn_read_prom_data(sc, base + IWN6000_EEPROM_ENHINFO, enhinfo, sizeof enhinfo); - memset(sc->enh_maxpwr, 0, sizeof sc->enh_maxpwr); for (i = 0; i < nitems(enhinfo); i++) { - if (enhinfo[i].chan == 0 || enhinfo[i].reserved != 0) + flags = enhinfo[i].flags; + if (!(flags & IWN_ENHINFO_VALID)) continue; /* Skip invalid entries. */ maxpwr = 0; @@ -2045,11 +2046,34 @@ iwn_read_eeprom_enhinfo(struct iwn_softc *sc) maxpwr = MAX(maxpwr, enhinfo[i].mimo2); else if (sc->ntxchains == 3) maxpwr = MAX(maxpwr, enhinfo[i].mimo3); - maxpwr /= 2; /* Convert half-dBm to dBm. */ - DPRINTF(sc, IWN_DEBUG_RESET, "enhinfo %d, maxpwr=%d\n", i, - maxpwr); - sc->enh_maxpwr[i] = maxpwr; + for (j = 0; j < ic->ic_nchans; j++) { + c = &ic->ic_channels[j]; + if ((flags & IWN_ENHINFO_5GHZ)) { + if (!IEEE80211_IS_CHAN_A(c)) + continue; + } else if ((flags & IWN_ENHINFO_OFDM)) { + if (!IEEE80211_IS_CHAN_G(c)) + continue; + } else if (!IEEE80211_IS_CHAN_B(c)) + continue; + if ((flags & IWN_ENHINFO_HT40)) { + if (!IEEE80211_IS_CHAN_HT40(c)) + continue; + } else { + if (IEEE80211_IS_CHAN_HT40(c)) + continue; + } + if (enhinfo[i].chan != 0 && + enhinfo[i].chan != c->ic_ieee) + continue; + + DPRINTF(sc, IWN_DEBUG_RESET, + "channel %d(%x), maxpwr %d\n", c->ic_ieee, + c->ic_flags, maxpwr / 2); + c->ic_maxregpower = maxpwr / 2; + c->ic_maxpower = maxpwr; + } } } @@ -2059,15 +2083,73 @@ iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } +static __inline int +rate2plcp(int rate) +{ + switch (rate & 0xff) { + case 12: return 0xd; + case 18: return 0xf; + case 24: return 0x5; + case 36: return 0x7; + case 48: return 0x9; + case 72: return 0xb; + case 96: return 0x1; + case 108: return 0x3; + case 2: return 10; + case 4: return 20; + case 11: return 55; + case 22: return 110; + } + return 0; +} + static void iwn_newassoc(struct ieee80211_node *ni, int isnew) { + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_node *wn = (void *)ni; - int ridx, i; + uint8_t txant1, txant2; + int i, plcp, rate, ridx; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - ridx = iwn_plcp_signal(ni->ni_rates.rs_rates[i]); - wn->ridx[i] = ridx; + /* Use the first valid TX antenna. */ + txant1 = IWN_LSB(sc->txchainmask); + txant2 = IWN_LSB(sc->txchainmask & ~txant1); + + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + ridx = ni->ni_rates.rs_nrates - 1; + for (i = ni->ni_htrates.rs_nrates - 1; i >= 0; i--) { + plcp = ni->ni_htrates.rs_rates[i] | IWN_RFLAG_MCS; + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + plcp |= IWN_RFLAG_HT40; + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + plcp |= IWN_RFLAG_SGI; + } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + plcp |= IWN_RFLAG_SGI; + if (i > 7) + plcp |= IWN_RFLAG_ANT(txant1 | txant2); + else + plcp |= IWN_RFLAG_ANT(txant1); + if (ridx >= 0) { + rate = ni->ni_rates.rs_rates[ridx]; + rate &= IEEE80211_RATE_VAL; + wn->ridx[rate] = plcp; + } + wn->ridx[0x80 | i] = plcp; + ridx--; + } + } else { + for (i = 0; i < ni->ni_rates.rs_nrates; i++) { + rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL; + + plcp = rate2plcp(rate); + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + plcp |= IWN_RFLAG_CCK; + plcp |= IWN_RFLAG_ANT(txant1); + wn->ridx[rate] = htole32(plcp); + } } } @@ -2220,7 +2302,6 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, "%s: missing RX_PHY\n", __func__); return; } - sc->last_rx_valid = 0; stat = &sc->last_rx_stat; } else stat = (struct iwn_rx_stat *)(desc + 1); @@ -2343,6 +2424,8 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, /* Send the frame to the 802.11 layer. */ if (ni != NULL) { + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; (void)ieee80211_input(ni, m, rssi - nf, nf); /* Node is no longer needed. */ ieee80211_free_node(ni); @@ -2352,21 +2435,53 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, IWN_LOCK(sc); } -#if 0 /* HT */ /* Process an incoming Compressed BlockAck. */ static void iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { + struct ifnet *ifp = sc->sc_ifp; + struct iwn_node *wn; + struct ieee80211_node *ni; struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); struct iwn_tx_ring *txq; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint8_t tid; + int ackfailcnt = 0, i, shift; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - txq = &sc->txq[letoh16(ba->qid)]; - /* XXX TBD */ + txq = &sc->txq[le16toh(ba->qid)]; + tap = sc->qid2tap[le16toh(ba->qid)]; + tid = WME_AC_TO_TID(tap->txa_ac); + ni = tap->txa_ni; + wn = (void *)ni; + + if (wn->agg[tid].bitmap == 0) + return; + + shift = wn->agg[tid].startidx - ((le16toh(ba->seq) >> 4) & 0xff); + if (shift < 0) + shift += 0x100; + + if (wn->agg[tid].nframes > (64 - shift)) + return; + + bitmap = (le64toh(ba->bitmap) >> shift) & wn->agg[tid].bitmap; + for (i = 0; bitmap; i++) { + if ((bitmap & 1) == 0) { + ifp->if_oerrors++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); + } else { + ifp->if_opackets++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); + } + bitmap >>= 1; + } } -#endif /* * Process a CALIBRATION_RESULT notification sent by the initialization @@ -2495,7 +2610,11 @@ iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { struct iwn4965_tx_stat *stat = (struct iwn4965_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2504,7 +2623,13 @@ iwn4965_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, le32toh(stat->status)); bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le32toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le32toh(stat->status) & 0xff); + } } static void @@ -2512,7 +2637,11 @@ iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { struct iwn5000_tx_stat *stat = (struct iwn5000_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2526,7 +2655,13 @@ iwn5000_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, #endif bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le16toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le16toh(stat->status) & 0xff); + } } /* @@ -2627,6 +2762,96 @@ iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc) wakeup(&ring->desc[desc->idx]); } +static void +iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, + void *stat) +{ + struct ifnet *ifp = sc->sc_ifp; + struct iwn_tx_ring *ring = &sc->txq[qid]; + struct iwn_tx_data *data; + struct mbuf *m; + struct iwn_node *wn; + struct ieee80211_node *ni; + struct ieee80211vap *vap; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint32_t *status = stat; + uint16_t *aggstatus = stat; + uint8_t tid; + int bit, i, lastidx, seqno, shift, start; + +#ifdef NOT_YET + if (nframes == 1) { + if ((*status & 0xff) != 1 && (*status & 0xff) != 2) + printf("ieee80211_send_bar()\n"); + } +#endif + + bitmap = 0; + start = idx; + for (i = 0; i < nframes; i++) { + if (le16toh(aggstatus[i * 2]) & 0xc) + continue; + + idx = le16toh(aggstatus[2*i + 1]) & 0xff; + bit = idx - start; + shift = 0; + if (bit >= 64) { + shift = 0x100 - idx + start; + bit = 0; + start = idx; + } else if (bit <= -64) + bit = 0x100 - start + idx; + else if (bit < 0) { + shift = start - idx; + start = idx; + bit = 0; + } + bitmap = bitmap << shift; + bitmap |= 1ULL << bit; + } + tap = sc->qid2tap[qid]; + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + + seqno = le32toh(*(status + nframes)) & 0xfff; + for (lastidx = (seqno & 0xff); ring->read != lastidx;) { + data = &ring->data[ring->read]; + + KASSERT(data->ni != NULL, ("no node")); + + /* Unmap and free mbuf. */ + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + m = data->m, data->m = NULL; + ni = data->ni, data->ni = NULL; + vap = ni->ni_vap; + + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); + + m_freem(m); + ieee80211_free_node(ni); + + ring->queued--; + ring->read = (ring->read + 1) % IWN_TX_RING_COUNT; + } + + sc->sc_tx_timer = 0; + if (ring->queued < IWN_TX_RING_LOMARK) { + sc->qfullmsk &= ~(1 << ring->qid); + if (sc->qfullmsk == 0 && + (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + iwn_start_locked(ifp); + } + } +} + /* * Process an INT_FH_RX or INT_SW_RX interrupt. */ @@ -2671,12 +2896,10 @@ iwn_notif_intr(struct iwn_softc *sc) iwn_rx_done(sc, desc, data); break; -#if 0 /* HT */ case IWN_RX_COMPRESSED_BA: /* A Compressed BlockAck has been received. */ iwn_rx_compressed_ba(sc, desc, data); break; -#endif case IWN_TX_DONE: /* An 802.11 frame has been transmitted. */ @@ -3053,21 +3276,10 @@ iwn5000_reset_sched(struct iwn_softc *sc, int qid, int idx) } #endif -static uint8_t -iwn_plcp_signal(int rate) { - int i; - - for (i = 0; i < IWN_RIDX_MAX + 1; i++) { - if ((rate & IEEE80211_RATE_VAL) == iwn_rates[i].rate) - return i; - } - - return 0; -} - static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { + struct iwn_ops *ops = &sc->ops; const struct ieee80211_txparam *tp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; @@ -3077,7 +3289,6 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) struct iwn_tx_data *data; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; - const struct iwn_rate *rinfo; struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct mbuf *m1; @@ -3104,7 +3315,16 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) } ac = M_WME_GETAC(m); - ring = &sc->txq[ac]; + if (IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) { + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; + + ring = &sc->txq[*(int *)tap->txa_private]; + *(uint16_t *)wh->i_seq = + htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); + ni->ni_txseqs[tid]++; + } else { + ring = &sc->txq[ac]; + } desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -3121,8 +3341,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; + ridx = ic->ic_rt->rateCodeToIndex[rate]; /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -3141,7 +3360,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) struct iwn_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; - tap->wt_rate = rinfo->rate; + tap->wt_rate = rate; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; @@ -3228,14 +3447,13 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) tx->rts_ntries = 60; tx->data_ntries = 15; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = wn->ridx[rate]; if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; /* XXX Alternate between antenna A and B? */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); } else { tx->linkq = ni->ni_rates.rs_nrates - ridx - 1; flags |= IWN_TX_LINKQ; /* enable MRR */ @@ -3310,10 +3528,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3330,7 +3546,7 @@ static int iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { - const struct iwn_rate *rinfo; + struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ifp->if_l2com; @@ -3361,13 +3577,12 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, /* Choose a TX rate index. */ rate = params->ibp_rate0; - if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx == (uint8_t)-1) { /* XXX fall back to mcast/mgmt rate? */ m_freem(m); return EINVAL; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; totlen = m->m_pkthdr.len; @@ -3438,12 +3653,14 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = htole32(rate2plcp(rate)); + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + tx->rate |= htole32(IWN_RFLAG_CCK); /* Group or management frame. */ tx->linkq = 0; txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); @@ -3514,10 +3731,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3681,6 +3896,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) static int iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) { + struct iwn_ops *ops = &sc->ops; struct iwn_tx_ring *ring = &sc->txq[4]; struct iwn_tx_desc *desc; struct iwn_tx_data *data; @@ -3689,7 +3905,8 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) bus_addr_t paddr; int totlen, error; - IWN_LOCK_ASSERT(sc); + if (async == 0) + IWN_LOCK_ASSERT(sc); desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -3739,10 +3956,8 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, 0, 0); -#endif /* Kick command ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3783,9 +3998,8 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) struct iwn_node *wn = (void *)ni; struct ieee80211_rateset *rs = &ni->ni_rates; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; - int i, txrate; + int i, rate, txrate; /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); @@ -3794,17 +4008,26 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) linkq.id = wn->id; linkq.antmsk_1stream = txant; linkq.antmsk_2stream = IWN_ANT_AB; - linkq.ampdu_max = 31; + linkq.ampdu_max = 64; linkq.ampdu_threshold = 3; linkq.ampdu_limit = htole16(4000); /* 4ms */ /* Start at highest available bit-rate. */ - txrate = rs->rs_nrates - 1; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + txrate = ni->ni_htrates.rs_nrates - 1; + else + txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { - rinfo = &iwn_rates[wn->ridx[txrate]]; - linkq.retry[i].plcp = rinfo->plcp; - linkq.retry[i].rflags = rinfo->flags; - linkq.retry[i].rflags |= IWN_RFLAG_ANT(txant); + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + rate = 0x80 | txrate; + else + rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL; + linkq.retry[i] = wn->ridx[rate]; + + if ((le32toh(wn->ridx[rate]) & IWN_RFLAG_MCS) && + (le32toh(wn->ridx[rate]) & 0xff) > 7) + linkq.mimo = i + 1; + /* Next retry at immediate lower bit-rate. */ if (txrate > 0) txrate--; @@ -3823,7 +4046,6 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) struct ieee80211com *ic = ifp->if_l2com; struct iwn_node_info node; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; int i, error; @@ -3847,16 +4069,13 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) /* Use lowest mandatory bit-rate. */ if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) - rinfo = &iwn_rates[IWN_RIDX_OFDM6]; + linkq.retry[0] = htole32(0xd); else - rinfo = &iwn_rates[IWN_RIDX_CCK1]; - linkq.retry[0].plcp = rinfo->plcp; - linkq.retry[0].rflags = rinfo->flags; - linkq.retry[0].rflags |= IWN_RFLAG_ANT(txant); + linkq.retry[0] = htole32(10 | IWN_RFLAG_CCK); + linkq.retry[0] |= htole32(IWN_RFLAG_ANT(txant)); /* Use same bit-rate for all TX retries. */ for (i = 1; i < IWN_MAX_TX_RETRIES; i++) { - linkq.retry[i].plcp = linkq.retry[0].plcp; - linkq.retry[i].rflags = linkq.retry[0].rflags; + linkq.retry[i] = linkq.retry[0]; } return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async); } @@ -4908,6 +5127,7 @@ iwn_scan(struct iwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_scan_state *ss = ic->ic_scan; /*XXX*/ + struct ieee80211_node *ni = ss->ss_vap->iv_bss; struct iwn_scan_hdr *hdr; struct iwn_cmd_data *tx; struct iwn_scan_essid *essid; @@ -4956,18 +5176,17 @@ iwn_scan(struct iwn_softc *sc) if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) { /* Send probe requests at 6Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_OFDM6].plcp; + tx->rate = htole32(0xd); rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; } else { hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO); /* Send probe requests at 1Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_CCK1].plcp; - tx->rflags = IWN_RFLAG_CCK; + tx->rate = htole32(10 | IWN_RFLAG_CCK); rs = &ic->ic_sup_rates[IEEE80211_MODE_11G]; } /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); essid = (struct iwn_scan_essid *)(tx + 1); if (ss->ss_ssid[0].len != 0) { @@ -4994,10 +5213,8 @@ iwn_scan(struct iwn_softc *sc) frm = ieee80211_add_rates(frm, rs); if (rs->rs_nrates > IEEE80211_RATE_SIZE) frm = ieee80211_add_xrates(frm, rs); -#if 0 /* HT */ - if (ic->ic_flags & IEEE80211_F_HTON) - frm = ieee80211_add_htcaps(frm, ic); -#endif + if (ic->ic_htcaps & IEEE80211_HTC_HT) + frm = ieee80211_add_htcap(frm, ni); /* Set length of probe request. */ tx->len = htole16(frm - (uint8_t *)wh); @@ -5124,6 +5341,7 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni = vap->iv_bss; struct iwn_node_info node; + uint32_t htflags = 0; int error; if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -5159,26 +5377,22 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) sc->rxon.cck_mask = 0x0f; sc->rxon.ofdm_mask = 0x15; } -#if 0 /* HT */ if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - sc->rxon.flags &= ~htole32(IWN_RXON_HT); - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40U); - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40D); - else - sc->rxon.flags |= htole32(IWN_RXON_HT20); - sc->rxon.rxchain = htole16( - IWN_RXCHAIN_VALID(3) - | IWN_RXCHAIN_MIMO_COUNT(3) - | IWN_RXCHAIN_IDLE_COUNT(1) - | IWN_RXCHAIN_MIMO_FORCE); - - maxrxampdu = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); - ampdudensity = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); - } else - maxrxampdu = ampdudensity = 0; -#endif + htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode); + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + switch (ic->ic_curhtprotmode) { + case IEEE80211_HTINFO_OPMODE_HT20PR: + htflags |= IWN_RXON_HT_MODEPURE40; + break; + default: + htflags |= IWN_RXON_HT_MODEMIXED; + break; + } + } + if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) + htflags |= IWN_RXON_HT_HT40MINUS; + } + sc->rxon.flags |= htole32(htflags); sc->rxon.filter |= htole32(IWN_FILTER_BSS); DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n", sc->rxon.chan, sc->rxon.flags); @@ -5205,10 +5419,20 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) memset(&node, 0, sizeof node); IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.id = IWN_ID_BSS; -#ifdef notyet - node.htflags = htole32(IWN_AMDPU_SIZE_FACTOR(3) | - IWN_AMDPU_DENSITY(5)); /* 2us */ -#endif + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) { + case IEEE80211_HTCAP_SMPS_ENA: + node.htflags |= htole32(IWN_SMPS_MIMO_DIS); + break; + case IEEE80211_HTCAP_SMPS_DYNAMIC: + node.htflags |= htole32(IWN_SMPS_MIMO_PROT); + break; + } + node.htflags |= htole32(IWN_AMDPU_SIZE_FACTOR(3) | + IWN_AMDPU_DENSITY(5)); /* 4us */ + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) + node.htflags |= htole32(IWN_NODE_HT40); + } DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node\n", __func__); error = ops->add_node(sc, &node, 1); if (error != 0) { @@ -5243,30 +5467,36 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) #undef MS } -#if 0 /* HT */ /* * This function is called by upper layer when an ADDBA request is received * from another STA and before the ADDBA response is sent. */ static int -iwn_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, + int baparamset, int batimeout, int baseqctl) { - struct ieee80211_rx_ba *ba = &ni->ni_rx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; +#define MS(_v, _f) (((_v) & _f) >> _f##_S) + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint8_t tid; + int error; + tid = MS(baparamset, IEEE80211_BAPS_TID); memset(&node, 0, sizeof node); node.id = wn->id; node.control = IWN_NODE_UPDATE; node.flags = IWN_FLAG_SET_ADDBA; node.addba_tid = tid; - node.addba_ssn = htole16(ba->ba_winstart); + node.addba_ssn = htole16(MS(baseqctl, IEEE80211_BASEQ_START)); DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n", - wn->id, tid, ba->ba_winstart); - return ops->add_node(sc, &node, 1); + wn->id, tid, MS(baseqctl, IEEE80211_BASEQ_START)); + error = ops->add_node(sc, &node, 1); + if (error != 0) + return error; + return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); +#undef MS } /* @@ -5274,13 +5504,20 @@ iwn_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, * Block Ack agreement (eg. uppon receipt of a DELBA frame). */ static void -iwn_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) { - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint8_t tid; + + /* XXX: tid as an argument */ + for (tid = 0; tid < WME_NUM_TID; tid++) { + if (&ni->ni_rx_ampdu[tid] == rap) + break; + } memset(&node, 0, sizeof node); node.id = wn->id; @@ -5289,6 +5526,57 @@ iwn_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, node.delba_tid = tid; DPRINTF(sc, IWN_DEBUG_RECV, "DELBA RA=%d TID=%d\n", wn->id, tid); (void)ops->add_node(sc, &node, 1); + sc->sc_ampdu_rx_stop(ni, rap); +} + +static int +iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int dialogtoken, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid; + + for (qid = sc->firstaggqueue; qid < sc->ntxqs; qid++) { + if (sc->qid2tap[qid] == NULL) + break; + } + if (qid == sc->ntxqs) { + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: not free aggregation queue\n", + __func__); + return 0; + } + tap->txa_private = malloc(sizeof(int), M_DEVBUF, M_NOWAIT); + if (tap->txa_private == NULL) { + device_printf(sc->sc_dev, + "%s: failed to alloc TX aggregation structure\n", __func__); + return 0; + } + sc->qid2tap[qid] = tap; + *(int *)tap->txa_private = qid; + return sc->sc_addba_request(ni, tap, dialogtoken, baparamset, + batimeout); +} + +static int +iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int code, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid = *(int *)tap->txa_private; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int ret; + + if (code == IEEE80211_STATUS_SUCCESS) { + ni->ni_txseqs[tid] = tap->txa_start & 0xfff; + ret = iwn_ampdu_tx_start(ni->ni_ic, ni, tid); + if (ret != 1) + return ret; + } else { + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; + } + return sc->sc_addba_response(ni, tap, code, baparamset, batimeout); } /* @@ -5299,12 +5587,12 @@ static int iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, uint8_t tid) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)]; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; - int error; + int error, qid; /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); @@ -5315,35 +5603,40 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, node.disable_tid = htole16(wn->disable_tid); error = ops->add_node(sc, &node, 1); if (error != 0) - return error; + return 0; if ((error = iwn_nic_lock(sc)) != 0) - return error; - ops->ampdu_tx_start(sc, ni, tid, ba->ba_winstart); + return 0; + qid = *(int *)tap->txa_private; + ops->ampdu_tx_start(sc, ni, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); - return 0; + + iwn_set_link_quality(sc, ni); + return 1; } static void -iwn_ampdu_tx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int qid = *(int *)tap->txa_private; if (iwn_nic_lock(sc) != 0) return; - ops->ampdu_tx_stop(sc, tid, ba->ba_winstart); + ops->ampdu_tx_stop(sc, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; } static void iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 7 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), @@ -5357,6 +5650,7 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, iwn_prph_setbits(sc, IWN4965_SCHED_QCHAIN_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN4965_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5377,10 +5671,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, } static void -iwn4965_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn4965_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 7 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5399,10 +5691,9 @@ iwn4965_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) static void iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 10 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), @@ -5419,6 +5710,7 @@ iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, iwn_prph_setbits(sc, IWN5000_SCHED_AGGR_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN5000_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5435,10 +5727,8 @@ iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, } static void -iwn5000_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn5000_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 10 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_CHGACT); @@ -5457,7 +5747,6 @@ iwn5000_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_INACTIVE | iwn_tid2fifo[tid]); } -#endif /* * Query calibration tables from the initialization firmware. We do this diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index be70b49..4cbf652 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -27,6 +27,9 @@ #define IWN4965_NTXQUEUES 16 #define IWN5000_NTXQUEUES 20 +#define IWN4965_FIRSTAGGQUEUE 7 +#define IWN5000_FIRSTAGGQUEUE 10 + #define IWN4965_NDMACHNLS 7 #define IWN5000_NDMACHNLS 8 @@ -489,6 +492,10 @@ struct iwn_rxon { #define IWN_RXON_ANTENNA_A (1 << 8) #define IWN_RXON_ANTENNA_B (1 << 9) #define IWN_RXON_TSF (1 << 15) +#define IWN_RXON_HT_HT40MINUS (1 << 22) +#define IWN_RXON_HT_PROTMODE(x) (x << 23) +#define IWN_RXON_HT_MODEPURE40 (1 << 25) +#define IWN_RXON_HT_MODEMIXED (2 << 25) #define IWN_RXON_CTS_TO_SELF (1 << 30) uint32_t filter; @@ -588,7 +595,10 @@ struct iwn_node_info { uint8_t txmic[8]; uint32_t htflags; +#define IWN_SMPS_MIMO_PROT (1 << 17) #define IWN_AMDPU_SIZE_FACTOR(x) ((x) << 19) +#define IWN_NODE_HT40 (1 << 21) +#define IWN_SMPS_MIMO_DIS (1 << 22) #define IWN_AMDPU_DENSITY(x) ((x) << 23) uint32_t mask; @@ -625,8 +635,13 @@ struct iwn4965_node_info { uint32_t reserved7; } __packed; -#define IWN_RFLAG_CCK (1 << 1) -#define IWN_RFLAG_ANT(x) ((x) << 6) +#define IWN_RFLAG_MCS (1 << 8) +#define IWN_RFLAG_CCK (1 << 9) +#define IWN_RFLAG_GREENFIELD (1 << 10) +#define IWN_RFLAG_HT40 (1 << 11) +#define IWN_RFLAG_DUPLICATE (1 << 12) +#define IWN_RFLAG_SGI (1 << 13) +#define IWN_RFLAG_ANT(x) ((x) << 14) /* Structure for command IWN_CMD_TX_DATA. */ struct iwn_cmd_data { @@ -647,9 +662,7 @@ struct iwn_cmd_data { #define IWN_TX_NEED_PADDING (1 << 20) uint32_t scratch; - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint8_t id; uint8_t security; @@ -690,11 +703,7 @@ struct iwn_cmd_link_quality { uint8_t ampdu_threshold; uint8_t ampdu_max; uint32_t reserved2; - struct { - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; - } __packed retry[IWN_MAX_TX_RETRIES]; + uint32_t retry[IWN_MAX_TX_RETRIES]; uint32_t reserved3; } __packed; @@ -1065,9 +1074,7 @@ struct iwn4965_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1079,9 +1086,7 @@ struct iwn5000_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1136,9 +1141,7 @@ struct iwn_rx_stat { uint16_t chan; uint8_t phybuf[32]; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t len; uint16_t reserve3; } __packed; @@ -1403,6 +1406,7 @@ struct iwn_fw_tlv { #define IWN5000_EEPROM_BAND4 0x02e #define IWN5000_EEPROM_BAND5 0x03a #define IWN5000_EEPROM_BAND6 0x041 +#define IWN6000_EEPROM_BAND6 0x040 #define IWN5000_EEPROM_BAND7 0x049 #define IWN6000_EEPROM_ENHINFO 0x054 #define IWN5000_EEPROM_CRYSTAL 0x128 @@ -1432,7 +1436,17 @@ struct iwn_eeprom_chan { } __packed; struct iwn_eeprom_enhinfo { - uint16_t chan; + uint8_t flags; +#define IWN_ENHINFO_VALID 0x01 +#define IWN_ENHINFO_5GHZ 0x02 +#define IWN_ENHINFO_OFDM 0x04 +#define IWN_ENHINFO_HT40 0x08 +#define IWN_ENHINFO_HTAP 0x10 +#define IWN_ENHINFO_RES1 0x20 +#define IWN_ENHINFO_RES2 0x40 +#define IWN_ENHINFO_COMMON 0x80 + + uint8_t chan; int8_t chain[3]; /* max power in half-dBm */ uint8_t reserved; int8_t mimo2; /* max power in half-dBm */ @@ -1486,6 +1500,16 @@ static const uint32_t iwn5000_regulatory_bands[IWN_NBANDS] = { IWN5000_EEPROM_BAND7 }; +static const uint32_t iwn6000_regulatory_bands[IWN_NBANDS] = { + IWN5000_EEPROM_BAND1, + IWN5000_EEPROM_BAND2, + IWN5000_EEPROM_BAND3, + IWN5000_EEPROM_BAND4, + IWN5000_EEPROM_BAND5, + IWN6000_EEPROM_BAND6, + IWN5000_EEPROM_BAND7 +}; + #define IWN_CHAN_BANDS_COUNT 7 #define IWN_MAX_CHAN_PER_BAND 14 static const struct iwn_chan_band { @@ -1513,26 +1537,6 @@ static const struct iwn_chan_band { #define IWN_RIDX_CCK1 0 #define IWN_RIDX_OFDM6 4 -static const struct iwn_rate { - uint8_t rate; - uint8_t plcp; - uint8_t flags; -} iwn_rates[IWN_RIDX_MAX + 1] = { - { 2, 10, IWN_RFLAG_CCK }, - { 4, 20, IWN_RFLAG_CCK }, - { 11, 55, IWN_RFLAG_CCK }, - { 22, 110, IWN_RFLAG_CCK }, - { 12, 0xd, 0 }, - { 18, 0xf, 0 }, - { 24, 0x5, 0 }, - { 36, 0x7, 0 }, - { 48, 0x9, 0 }, - { 72, 0xb, 0 }, - { 96, 0x1, 0 }, - { 108, 0x3, 0 }, - { 120, 0x3, 0 } -}; - #define IWN4965_MAX_PWR_INDEX 107 /* diff --git a/sys/dev/iwn/if_iwnvar.h b/sys/dev/iwn/if_iwnvar.h index a61b3b5..5f46a36 100644 --- a/sys/dev/iwn/if_iwnvar.h +++ b/sys/dev/iwn/if_iwnvar.h @@ -78,6 +78,7 @@ struct iwn_tx_ring { int qid; int queued; int cur; + int read; }; struct iwn_softc; @@ -101,7 +102,12 @@ struct iwn_node { struct ieee80211_node ni; /* must be the first */ uint16_t disable_tid; uint8_t id; - uint8_t ridx[IEEE80211_RATE_MAXSIZE]; + uint32_t ridx[256]; + struct { + uint64_t bitmap; + int startidx; + int nframes; + } agg[IEEE80211_TID_SIZE]; }; struct iwn_calib_state { @@ -174,12 +180,10 @@ struct iwn_ops { int); void (*tx_done)(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ void (*ampdu_tx_start)(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); - void (*ampdu_tx_stop)(struct iwn_softc *, uint8_t, + struct ieee80211_node *, int, uint8_t, uint16_t); + void (*ampdu_tx_stop)(struct iwn_softc *, int, uint8_t, uint16_t); -#endif }; struct iwn_vap { @@ -215,6 +219,7 @@ struct iwn_softc { const struct iwn_sensitivity_limits *limits; int ntxqs; + int firstaggqueue; int ndmachnls; uint8_t broadcast_id; int rxonsz; @@ -295,7 +300,6 @@ struct iwn_softc { int8_t maxpwr2GHz; int8_t maxpwr5GHz; int8_t maxpwr[IEEE80211_CHAN_MAX]; - int8_t enh_maxpwr[35]; int32_t temp_off; uint32_t int_mask; @@ -307,6 +311,20 @@ struct iwn_softc { int sc_tx_timer; + struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES]; + + int (*sc_ampdu_rx_start)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); + void (*sc_ampdu_rx_stop)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); + int (*sc_addba_request)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + int (*sc_addba_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + void (*sc_addba_stop)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + + struct iwn_rx_radiotap_header sc_rxtap; struct iwn_tx_radiotap_header sc_txtap; }; --Boundary-00=_57VvNvUbwvnkjXW-- From owner-freebsd-net@FreeBSD.ORG Sun May 1 14:33:48 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54825106566B for ; Sun, 1 May 2011 14:33:48 +0000 (UTC) (envelope-from Michael.Tuexen@lurchi.franken.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id E2DC58FC0A for ; Sun, 1 May 2011 14:33:46 +0000 (UTC) Received: from [192.168.1.192] (p508FA5B3.dip.t-dialin.net [80.143.165.179]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 8F5061C0C0BCC; Sun, 1 May 2011 16:33:44 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: =?iso-8859-1?Q?Michael_T=FCxen?= In-Reply-To: <20110501131048.22413db5jyxywss8@webmail.tuwien.ac.at> Date: Sun, 1 May 2011 16:33:32 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <13E5D4BB-5B2C-42B3-A43E-0F260317DE6B@lurchi.franken.de> References: <20110430091148.31393q3py4j4bg38@webmail.tuwien.ac.at> <20110430121518.25761cpmtrp0jtpy@webmail.tuwien.ac.at> <20110501131048.22413db5jyxywss8@webmail.tuwien.ac.at> To: Schoch Christian X-Mailer: Apple Mail (2.1084) Cc: freebsd-net@freebsd.org Subject: Re: [SCTP] ICMP unreachable message reenables data transmit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 14:33:48 -0000 On May 1, 2011, at 1:10 PM, Schoch Christian wrote: >> On Apr 30, 2011, at 12:15 PM, Schoch Christian wrote: >>>=20 >>>> On Apr 30, 2011, at 9:11 AM, Schoch Christian wrote: >>>>=20 >>>>> During a measurement with CMT-SCTP and PF i figured out, that = sometimes a ICMP Destination unreachable message triggers a message = transmission on an inactive data path that has been primary before. >>>>>=20 >>>>> It looks as the ICMP message is reseting the inactive state back = to active without reseting RTO. >>>>>=20 >>>>> This behavior is triggered by a returning heartbeat message when = no ICMP unreachable by data is sent quite before. >>>>>=20 >>>>> Test system are two multi-homed hosts with FreeBSD8.1 and a WANem = host between. >>>>>=20 >>>>> A wireshark log can be provided on demand (quite large). >>>> Hi Christian, >>>>=20 >>>> any chance to upgrade the FreeBSD machines to head or to use newer >>>> SCTP sources, which I could provide? It would require a = recompilation >>>> of the kernel... >>>=20 >>> It is possible, but the results could be provided not until next = week >>> if a reboot is necessary. >>> I can use any sources you could provide me since nothing else is = done at this systems. >> OK, but maybe I can try to understand what is going on. >>=20 >> How many paths do you have? One is inactive, but was primary, so it >> is confirmed. On another one, you get an ICMP (which one? Port = unreachable, >> host unreachable, ...). Do you have more than two paths? >=20 > Setup looks like this: >=20 > -------- ----cut--- > Host A WANem Host B > -------- ---------- >=20 > Transfer is running on both path from A to B till the primary link is = cut between WANem and the receiver and the whole transfer switches to = the second path. The ICMP message (Host not reachable with a Heartbeat = as attachment) is received on the primary interface from WANem host. OK, understood. >=20 > As I tested this morning, the primary path is switching to unreachable = due to the ICMP message but should be in this state quite before by = exceeding path.max_retrans. > So this ICMP message does two things: > - Set the primary path to unreachable > - Triggers something to retry data transfer on the primary path. After looking at the tracefile, I somewhat agree. * Do you see something like ICMP (thresh ??/??) takes interface ?? down on the console? This would be printed if the ICMP takes the path to unreachable? (It should also be in /var/log/messages) * If the path is already unreachable, nothing should happen in response to the ICMP message. So the question is: Is the path unreachable before the ICMP message is received? Is your application monitoring the SCTP notification? What about the above printout from the kernel? Best regards Michael >=20 >> The ICMP message would not reset the RTO, since you need an ACKed TSN >> or a HB-ACK to to that. Since it is inactive, it is missing these. >>=20 >> Sending on an inactive path is OK, as soon as you enter the dormant >> state, which means all your paths are inactive. >>=20 > Transfer is still running on second link which is active. That sounds good. >=20 >> Are you using the PF support for CMT? >=20 > Yes, but without NR-SACK and DAC. OK. >=20 > I uploaded the pcap file to: > http://37116.vs.webtropia.com/cmt_2.pcap That was helpful! >=20 > Best regards, > Christian >=20 >>=20 >> Best regards >> Michael >>>=20 >>>>=20 >>>> Are you using IPv4 or IPv6? >>>>=20 >>>=20 >>> IPv4 >>>=20 >>>=20 >>>> Best regards >>>> Michael >>>>>=20 >>>>> Regards, >>>>> Schoch Christian >>>>> _______________________________________________ >>>>> freebsd-net@freebsd.org mailing list >>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >>>>>=20 >>>>=20 >>>> _______________________________________________ >>>> freebsd-net@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >>>>=20 >>>=20 >>>=20 >>=20 >>=20 >=20 >=20 >=20 From owner-freebsd-net@FreeBSD.ORG Sun May 1 15:49:50 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 948071065674 for ; Sun, 1 May 2011 15:49:50 +0000 (UTC) (envelope-from zeus@relay.ibs.dn.ua) Received: from relay.ibs.dn.ua (relay.ibs.dn.ua [91.216.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id B14F78FC1B for ; Sun, 1 May 2011 15:49:48 +0000 (UTC) Received: from relay.ibs.dn.ua (localhost [127.0.0.1]) by relay.ibs.dn.ua with ESMTP id p41Fnlra053733 for ; Sun, 1 May 2011 18:49:47 +0300 (EEST) Received: (from zeus@localhost) by relay.ibs.dn.ua (8.14.4/8.14.4/Submit) id p41FnlMk053732 for freebsd-net@freebsd.org; Sun, 1 May 2011 18:49:47 +0300 (EEST) Date: Sun, 1 May 2011 18:49:47 +0300 From: Zeus V Panchenko To: freebsd-net@freebsd.org Message-ID: <20110501154947.GC70166@relay.ibs.dn.ua> Mail-Followup-To: freebsd-net@freebsd.org References: <201104290001.p3T01EvQ082443@artema.vpn.ibs> <20110429095231.GA17786@relay.ibs.dn.ua> <20110429182807.GA21084@michelle.cdnetworks.com> <20110429184634.GA34176@relay.ibs.dn.ua> <20110429185605.GB21084@michelle.cdnetworks.com> <20110430204339.GA25769@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 8.1-RELEASE X-Editor: GNU Emacs 23.2.1 X-Face: iVBORw0KGgoAAAANSUhEUgAAACoAAAAqBAMAAAA37dRoAAAAFVBMVEWjjoiZhHDWzcZuW1U wOT+RcGxziJxEN0lIAAABrklEQVQokV2STXLbMAyFQaraE3a5dzSTfR1IF7CQrM3QuECn9z9DH0 gxzgSyFvr88PBD0uJxoR6BE+e8LtRgohE5ZB50sODP/REbfUnte/z12+llCekLUSKenFIMke6Be WinE8H0RJHSN71rUQp64gFDmtDDhRk0zam3FzpNVFprhwPGaFo6oY9wDBJQ9Qz6EuKyROJjDGa+ uza4VOTa8iHlN58Yv5BF9+4BGl0LA5pUD5xKXg4aQlVZm0co3NKxCGxQpu3aC352Gv3DZONmwQd tkrlaylV3YSew7bWtwAZF/zi9jblmprPoL7ktzeFSxmarVNmWRi+Bmxg7Y7tbGtR8XZUxLTo86G thANsssetjp3POuBvMBRlw6jRa5pKN7yVlP+F2lyiZGSMf5hnSU6eAVupmtfjRcxy0momwpxDnz 06hwnOWvBnUdR8U2/KX7cq26u1Jy5xFZMPOVONRbRUrwey8Qar6cWgf12xSymQuVX0DfYd4R8kN Hg0qCtLeaYZcj8B90M2N0cEX1P0vKSxw7NLy/3X8Qeriusu66jNA37P4Mn5QRTG2hz4d9D/6E3a EX852nwAAAABJRU5ErkJggg== Subject: Re: collisions on tun interfaces ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: zeus@ibs.dn.ua List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 15:49:50 -0000 Adrian Chadd (adrian@freebsd.org) [11.05.01 09:09] wrote: > On 1 May 2011 04:43, YongHyeon PYUN wrote: > > > It's tunable. Set net.link.ifqmaxlen. > > I know it's tunable at boot time; I mean why is it that low by default? > and what will be acceptable value for ASDL connections 8 and more MBit/s? -- Zeus V. Panchenko IT Dpt., IBS ltd GMT+2 (EET) From owner-freebsd-net@FreeBSD.ORG Sun May 1 17:00:13 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B34D106564A for ; Sun, 1 May 2011 17:00:12 +0000 (UTC) (envelope-from e0326715@student.tuwien.ac.at) Received: from mr.tuwien.ac.at (mr2-n.kom.tuwien.ac.at [128.130.2.110]) by mx1.freebsd.org (Postfix) with ESMTP id D47528FC0A for ; Sun, 1 May 2011 17:00:11 +0000 (UTC) Received: from webmail1.zserv.tuwien.ac.at (webmail1.zserv.tuwien.ac.at [128.130.35.11]) by mr.tuwien.ac.at (8.13.7/8.13.7) with ESMTP id p41H09IB010112; Sun, 1 May 2011 19:00:09 +0200 (MEST) Received: from webmail1.zserv.tuwien.ac.at (localhost.localdomain [127.0.0.1]) by webmail1.zserv.tuwien.ac.at (8.13.8/8.13.8) with ESMTP id p41H09JZ012779; Sun, 1 May 2011 19:00:09 +0200 Received: (from apache@localhost) by webmail1.zserv.tuwien.ac.at (8.13.8/8.13.8/Submit) id p41H08x0012778; Sun, 1 May 2011 19:00:08 +0200 Received: from 091-141-114-014.dyn.orange.at (091-141-114-014.dyn.orange.at [91.141.114.14]) by webmail.tuwien.ac.at (Horde Framework) with HTTP; Sun, 01 May 2011 19:00:08 +0200 Message-ID: <20110501190008.179970yneogqya3c@webmail.tuwien.ac.at> Date: Sun, 01 May 2011 19:00:08 +0200 From: Schoch Christian To: Michael =?utf-8?b?VMO8eGVu?= References: <20110430091148.31393q3py4j4bg38@webmail.tuwien.ac.at> <20110430121518.25761cpmtrp0jtpy@webmail.tuwien.ac.at> <20110501131048.22413db5jyxywss8@webmail.tuwien.ac.at> <13E5D4BB-5B2C-42B3-A43E-0F260317DE6B@lurchi.franken.de> In-Reply-To: <13E5D4BB-5B2C-42B3-A43E-0F260317DE6B@lurchi.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.3.9) X-Virus-Scanned: by amavisd-new Cc: freebsd-net@freebsd.org Subject: Re: [SCTP] ICMP unreachable message reenables data transmit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 17:00:13 -0000 Zitat von Michael T=C3=BCxen: > On May 1, 2011, at 1:10 PM, Schoch Christian wrote: > >>> On Apr 30, 2011, at 12:15 PM, Schoch Christian wrote: >>>> >>>>> On Apr 30, 2011, at 9:11 AM, Schoch Christian wrote: >>>>> >>>>>> During a measurement with CMT-SCTP and PF i figured out, that =20 >>>>>> sometimes a ICMP Destination unreachable message triggers a =20 >>>>>> message transmission on an inactive data path that has been =20 >>>>>> primary before. >>>>>> >>>>>> It looks as the ICMP message is reseting the inactive state =20 >>>>>> back to active without reseting RTO. >>>>>> >>>>>> This behavior is triggered by a returning heartbeat message =20 >>>>>> when no ICMP unreachable by data is sent quite before. >>>>>> >>>>>> Test system are two multi-homed hosts with FreeBSD8.1 and a =20 >>>>>> WANem host between. >>>>>> >>>>>> A wireshark log can be provided on demand (quite large). >>>>> Hi Christian, >>>>> >>>>> any chance to upgrade the FreeBSD machines to head or to use newer >>>>> SCTP sources, which I could provide? It would require a recompilation >>>>> of the kernel... >>>> >>>> It is possible, but the results could be provided not until next week >>>> if a reboot is necessary. >>>> I can use any sources you could provide me since nothing else is =20 >>>> done at this systems. >>> OK, but maybe I can try to understand what is going on. >>> >>> How many paths do you have? One is inactive, but was primary, so it >>> is confirmed. On another one, you get an ICMP (which one? Port unreacha= ble, >>> host unreachable, ...). Do you have more than two paths? >> >> Setup looks like this: >> >> -------- ----cut--- >> Host A WANem Host B >> -------- ---------- >> >> Transfer is running on both path from A to B till the primary link =20 >> is cut between WANem and the receiver and the whole transfer =20 >> switches to the second path. The ICMP message (Host not reachable =20 >> with a Heartbeat as attachment) is received on the primary =20 >> interface from WANem host. > OK, understood. >> >> As I tested this morning, the primary path is switching to =20 >> unreachable due to the ICMP message but should be in this state =20 >> quite before by exceeding path.max_retrans. >> So this ICMP message does two things: >> - Set the primary path to unreachable >> - Triggers something to retry data transfer on the primary path. > After looking at the tracefile, I somewhat agree. > * Do you see something like > ICMP (thresh ??/??) takes interface ?? down > on the console? This would be printed if the ICMP takes the > path to unreachable? (It should also be in /var/log/messages) > * If the path is already unreachable, nothing should happen > in response to the ICMP message. > 08:04:18 kernel: ICMP (thresh 2/3) takes interface 0xc4e20510 down Same timestamp as the faulty start in the tracefile. > So the question is: Is the path unreachable before the ICMP message > is received? Due to the timely difference between first retransmission and ICMP =20 message it should be in unavailable state. But it seams that too many =20 retransmission occur and the ICMP message is moving the path to =20 unavailable state. I picked my eyes to the RTO of primary path and could figure out the =20 following: inital state: rto.min =3D 100ms RTO =3D 100ms after cutting the link: RTO rises to 200ms and 400ms as expected but not higher (rto.max=3D60000) Another test with path_rxt_max =3D 1 worked as expected. So I assume some problems with the retransmission counter when larger =20 than 1 (something like count =3D 1 instead of count >=3D 1) > Is your application monitoring the SCTP notification? > What about the above printout from the kernel? Yes, the notifications are monitored and logged (sctp_menu) - the =20 notification for SCTP_PEER_ADDR_CHANGE comes right after ICMP. Best regards, Christian > Best regards > Michael >> >>> The ICMP message would not reset the RTO, since you need an ACKed TSN >>> or a HB-ACK to to that. Since it is inactive, it is missing these. >>> >>> Sending on an inactive path is OK, as soon as you enter the dormant >>> state, which means all your paths are inactive. >>> >> Transfer is still running on second link which is active. > That sounds good. >> >>> Are you using the PF support for CMT? >> >> Yes, but without NR-SACK and DAC. > OK. >> >> I uploaded the pcap file to: >> http://37116.vs.webtropia.com/cmt_2.pcap > That was helpful! >> >> Best regards, >> Christian >> >>> >>> Best regards >>> Michael >>>> >>>>> >>>>> Are you using IPv4 or IPv6? >>>>> >>>> >>>> IPv4 >>>> >>>> >>>>> Best regards >>>>> Michael >>>>>> >>>>>> Regards, >>>>>> Schoch Christian >>>>>> _______________________________________________ >>>>>> freebsd-net@freebsd.org mailing list >>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.or= g" >>>>>> >>>>> >>>>> _______________________________________________ >>>>> freebsd-net@freebsd.org mailing list >>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org= " >>>>> >>>> >>>> >>> >>> >> >> >> > > From owner-freebsd-net@FreeBSD.ORG Sun May 1 19:49:34 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 485EE1065673; Sun, 1 May 2011 19:49:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 219128FC1D; Sun, 1 May 2011 19:49:34 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41JnXd8094660; Sun, 1 May 2011 19:49:34 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41JnXH9094656; Sun, 1 May 2011 19:49:33 GMT (envelope-from eadler) Date: Sun, 1 May 2011 19:49:33 GMT Message-Id: <201105011949.p41JnXH9094656@freefall.freebsd.org> To: eadler@FreeBSD.org, freebsd-net@FreeBSD.org, freebsd-wireless@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: bin/137484: [patch] Integer overflow in wpa_supplicant(8) base64 encoder X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 19:49:34 -0000 Synopsis: [patch] Integer overflow in wpa_supplicant(8) base64 encoder Responsible-Changed-From-To: freebsd-net->freebsd-wireless Responsible-Changed-By: eadler Responsible-Changed-When: Sun May 1 19:49:12 UTC 2011 Responsible-Changed-Why: New mailing list owns this one http://www.freebsd.org/cgi/query-pr.cgi?pr=137484 From owner-freebsd-net@FreeBSD.ORG Sun May 1 19:51:55 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5A7106564A; Sun, 1 May 2011 19:51:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 029928FC12; Sun, 1 May 2011 19:51:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41Jpscl000592; Sun, 1 May 2011 19:51:54 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41Jpsns000583; Sun, 1 May 2011 19:51:54 GMT (envelope-from eadler) Date: Sun, 1 May 2011 19:51:54 GMT Message-Id: <201105011951.p41Jpsns000583@freefall.freebsd.org> To: eadler@FreeBSD.org, freebsd-net@FreeBSD.org, freebsd-wireless@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/154284: [ath] Modern ath wifi cards (such as AR9285) have missed LED indication X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 19:51:55 -0000 Synopsis: [ath] Modern ath wifi cards (such as AR9285) have missed LED indication Responsible-Changed-From-To: freebsd-net->freebsd-wireless Responsible-Changed-By: eadler Responsible-Changed-When: Sun May 1 19:51:54 UTC 2011 Responsible-Changed-Why: new mailing list owns this one http://www.freebsd.org/cgi/query-pr.cgi?pr=154284 From owner-freebsd-net@FreeBSD.ORG Sun May 1 19:52:16 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EA11065674; Sun, 1 May 2011 19:52:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8E58FC08; Sun, 1 May 2011 19:52:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41JqGax002393; Sun, 1 May 2011 19:52:16 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41JqGik002383; Sun, 1 May 2011 19:52:16 GMT (envelope-from eadler) Date: Sun, 1 May 2011 19:52:16 GMT Message-Id: <201105011952.p41JqGik002383@freefall.freebsd.org> To: eadler@FreeBSD.org, freebsd-net@FreeBSD.org, freebsd-wireless@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/154567: [ath] ath(4) lot of bad series(0) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 19:52:16 -0000 Synopsis: [ath] ath(4) lot of bad series(0) Responsible-Changed-From-To: freebsd-net->freebsd-wireless Responsible-Changed-By: eadler Responsible-Changed-When: Sun May 1 19:52:15 UTC 2011 Responsible-Changed-Why: new mailing list owns this one http://www.freebsd.org/cgi/query-pr.cgi?pr=154567 From owner-freebsd-net@FreeBSD.ORG Sun May 1 19:54:14 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537431065673; Sun, 1 May 2011 19:54:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0A08FC16; Sun, 1 May 2011 19:54:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41JsEfK003483; Sun, 1 May 2011 19:54:14 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41JsE4q003479; Sun, 1 May 2011 19:54:14 GMT (envelope-from eadler) Date: Sun, 1 May 2011 19:54:14 GMT Message-Id: <201105011954.p41JsE4q003479@freefall.freebsd.org> To: eadler@FreeBSD.org, freebsd-net@FreeBSD.org, freebsd-wireless@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/145826: [panic] [ath] Unable to configure adhoc mode on ath0/wlan0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 19:54:14 -0000 Old Synopsis: [ath] Unable to configure adhoc mode on ath0/wlan0 New Synopsis: [panic] [ath] Unable to configure adhoc mode on ath0/wlan0 Responsible-Changed-From-To: freebsd-net->freebsd-wireless Responsible-Changed-By: eadler Responsible-Changed-When: Sun May 1 19:53:47 UTC 2011 Responsible-Changed-Why: add panic tag & move to new mailing list http://www.freebsd.org/cgi/query-pr.cgi?pr=145826 From owner-freebsd-net@FreeBSD.ORG Sun May 1 19:56:14 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6B41065679; Sun, 1 May 2011 19:56:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 46BFC8FC13; Sun, 1 May 2011 19:56:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41JuE2u003773; Sun, 1 May 2011 19:56:14 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41JuEt1003769; Sun, 1 May 2011 19:56:14 GMT (envelope-from eadler) Date: Sun, 1 May 2011 19:56:14 GMT Message-Id: <201105011956.p41JuEt1003769@freefall.freebsd.org> To: zzerver@gmail.com, eadler@FreeBSD.org, freebsd-net@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/129750: [ath] Atheros AR5006 exits on "cannot map register space" & "ath0 attach returned 6" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 19:56:14 -0000 Synopsis: [ath] Atheros AR5006 exits on "cannot map register space" & "ath0 attach returned 6" State-Changed-From-To: feedback->closed State-Changed-By: eadler State-Changed-When: Sun May 1 19:56:13 UTC 2011 State-Changed-Why: feedback timeout http://www.freebsd.org/cgi/query-pr.cgi?pr=129750 From owner-freebsd-net@FreeBSD.ORG Sun May 1 20:09:29 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F35A1065672; Sun, 1 May 2011 20:09:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 15DD38FC0A; Sun, 1 May 2011 20:09:29 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41K9SLD012847; Sun, 1 May 2011 20:09:28 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41K9QTo012843; Sun, 1 May 2011 20:09:26 GMT (envelope-from eadler) Date: Sun, 1 May 2011 20:09:26 GMT Message-Id: <201105012009.p41K9QTo012843@freefall.freebsd.org> To: andrea+freebsd@webcom.it, eadler@FreeBSD.org, freebsd-net@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/107279: [ath] [panic] ath_start: attempted use of a free mbuf! X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 20:09:29 -0000 Synopsis: [ath] [panic] ath_start: attempted use of a free mbuf! State-Changed-From-To: feedback->closed State-Changed-By: eadler State-Changed-When: Sun May 1 20:09:26 UTC 2011 State-Changed-Why: feedback timeout http://www.freebsd.org/cgi/query-pr.cgi?pr=107279 From owner-freebsd-net@FreeBSD.ORG Sun May 1 20:20:06 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5246106566B; Sun, 1 May 2011 20:20:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A567F8FC14; Sun, 1 May 2011 20:20:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41KK627023315; Sun, 1 May 2011 20:20:06 GMT (envelope-from eadler@freefall.freebsd.org) Received: (from eadler@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41KK5KC023310; Sun, 1 May 2011 20:20:05 GMT (envelope-from eadler) Date: Sun, 1 May 2011 20:20:05 GMT Message-Id: <201105012020.p41KK5KC023310@freefall.freebsd.org> To: kilian@mathi.uni-heidelberg.de, eadler@FreeBSD.org, freebsd-net@FreeBSD.org, eadler@FreeBSD.org From: eadler@FreeBSD.org Cc: Subject: Re: kern/122697: [ath] Atheros card is not well supported X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 20:20:07 -0000 Synopsis: [ath] Atheros card is not well supported State-Changed-From-To: open->feedback State-Changed-By: eadler State-Changed-When: Sun May 1 20:20:03 UTC 2011 State-Changed-Why: To submitter: The code in question has changed a lot since you submitted the bug. Has the problem been fixed or is it still an issue? Responsible-Changed-From-To: freebsd-net->eadler Responsible-Changed-By: eadler Responsible-Changed-When: Sun May 1 20:20:03 UTC 2011 Responsible-Changed-Why: To submitter: The code in question has changed a lot since you submitted the bug. Has the problem been fixed or is it still an issue? http://www.freebsd.org/cgi/query-pr.cgi?pr=122697 From owner-freebsd-net@FreeBSD.ORG Sun May 1 21:36:59 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657B5106564A for ; Sun, 1 May 2011 21:36:59 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 26F8D8FC13 for ; Sun, 1 May 2011 21:36:57 +0000 (UTC) Received: by wwc33 with SMTP id 33so5253559wwc.31 for ; Sun, 01 May 2011 14:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/HET1IgllqbtSlFrnWZab7rgx0Q668SPWDuHCKfznr8=; b=JQOO8NQor9/uzj8Uy+87vO75s+THDBudPpu6em1w3oNo6g9x4o4RHxxhFVyn9qgX2L bnGj2xaX0+OTxqlM+aV6gDRB/eYboPqCkUCM4IWhkTyOooUXsISLOJjk3JJ4xKxcEwao Yx5CWqpNqf5hELD3/yBhZTJrW0EM0E5PZjI1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=I/mQKORXb6NW5vsWC2M2B/pzyimn3T6BQQkXmeuizYUWx5LSfUNAZPctnpwP3F9b3j 9SjK7kxMcTQTpCUA1nnHOmXWE17PkvjLkZayRMV3RpJLP4FD1wjbkhIXETuKYaUb5L+M 9VqFgEf4EgJikXkZlK/pDpjZKGN4ayR3TbPek= MIME-Version: 1.0 Received: by 10.216.242.134 with SMTP id i6mr1861173wer.81.1304285816824; Sun, 01 May 2011 14:36:56 -0700 (PDT) Received: by 10.216.17.213 with HTTP; Sun, 1 May 2011 14:36:56 -0700 (PDT) In-Reply-To: <201105011524.09613.bschmidt@freebsd.org> References: <201105011319.30649.bschmidt@freebsd.org> <201105011524.09613.bschmidt@freebsd.org> Date: Sun, 1 May 2011 16:36:56 -0500 Message-ID: From: Brandon Gooch To: Bernhard Schmidt Content-Type: multipart/mixed; boundary=e0cb4e43d2abcc258304a23db4e6 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org, freebsd-wireless@freebsd.org Subject: Re: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 21:36:59 -0000 --e0cb4e43d2abcc258304a23db4e6 Content-Type: text/plain; charset=ISO-8859-1 On Sun, May 1, 2011 at 8:24 AM, Bernhard Schmidt wrote: > On Sunday 01 May 2011 13:19:30 Bernhard Schmidt wrote: >> Hi, >> >> I finally managed to get the 11n bits for iwn(4) sorted out. Well, >> there is still an issue somewhere with HT40 frame protection or >> TX chain setup on 5000 adapters, resulting in throughput not being >> that stable. But overall it seems to work pretty decently >> >> This is for HEAD only right now, net80211 in stable/8 does not yet >> contain the latest 11n related fixes. So, if you run HEAD and have >> some iwn(4) hardware, I'd appreciate feedback. >> .. > > Updated version, I've missed a locking issue. > > -- > Bernhard Thanks for working on this Bernhard! Unfortunately, I'm having trouble achieving HT rates. After 'wlandebug 0xffffffff', lots of: ... May 1 14:38:15 x300 kernel: wlan0: received beacon from 00:1d:0f:d3:fb:cc rssi 47 May 1 14:38:15 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard beacon frame, ie too short, got 26, expected 30 ... I've attached relevant debugging information, but let me know if there may be anything else that could help. I need to work on DTracing net80211, any tips on relevant function traces? -Brandon --e0cb4e43d2abcc258304a23db4e6-- From owner-freebsd-net@FreeBSD.ORG Sun May 1 23:50:58 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99823106566B for ; Sun, 1 May 2011 23:50:58 +0000 (UTC) (envelope-from if@xip.at) Received: from chile.gbit.at (ns1.xip.at [193.239.188.99]) by mx1.freebsd.org (Postfix) with ESMTP id E024E8FC14 for ; Sun, 1 May 2011 23:50:57 +0000 (UTC) Received: (qmail 22373 invoked from network); 2 May 2011 01:50:55 +0200 Received: from unknown (HELO filebunker.xip.at) (89.207.145.147) by chile.gbit.at with (DHE-RSA-AES256-SHA encrypted) SMTP; 2 May 2011 01:50:55 +0200 Date: Mon, 2 May 2011 01:50:55 +0200 (CEST) From: Ingo Flaschberger To: freebsd-net@freebsd.org In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 23:50:58 -0000 > is it expected behaviour that the static, permanent arp entry of the > interface ip disappear after ifdown/ifup at 8.x release? > > ifconfig em0 10.20.20.1/24 > arp -an | grep 10.20.20.1 > ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet] > ifconfig em0 down > ifconfig em0 up > arp -an | grep 10.20.20.1 > nothing resend this "question" - as there was no respone. Kind regards, Ingo Flaschberger From owner-freebsd-net@FreeBSD.ORG Sun May 1 23:54:36 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0962106564A for ; Sun, 1 May 2011 23:54:36 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id A585F8FC08 for ; Sun, 1 May 2011 23:54:36 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p41NsZ1P018320 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 1 May 2011 16:54:36 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0255.000; Sun, 1 May 2011 16:54:30 -0700 From: "Li, Qing" To: Ingo Flaschberger Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8 Date: Sun, 1 May 2011 23:54:30 +0000 Message-ID: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 23:54:36 -0000 That's not the expected behavior, probably a bug, I will take a look ... -- Qing On May 1, 2011, at 4:51 PM, "Ingo Flaschberger" wrote: >> is it expected behaviour that the static, permanent arp entry of the int= erface ip disappear after ifdown/ifup at 8.x release? >>=20 >> ifconfig em0 10.20.20.1/24 >> arp -an | grep 10.20.20.1 >> ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet] >> ifconfig em0 down >> ifconfig em0 up >> arp -an | grep 10.20.20.1 >> nothing >=20 > resend this "question" - as there was no respone. >=20 > Kind regards, > Ingo Flaschberger >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Mon May 2 01:05:49 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FEA106566C for ; Mon, 2 May 2011 01:05:49 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C0BBC8FC0A for ; Mon, 2 May 2011 01:05:48 +0000 (UTC) Received: by iwn33 with SMTP id 33so6068953iwn.13 for ; Sun, 01 May 2011 18:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U/sJKh7i66bYYjlqeKfFpUf3L+R6nRzoAH87DHcQpos=; b=Q3Azu0omfFYIo7BhQk00Qp/Xl2l8HKH+6whGTPfMhreL5JrK5dysaolrW2sCPSFhgw tmn8j05pFByuLukGnK0X8+pdtBoMOQ6iW5m/S0HQ/tHqszPXOIiqhK2gatmXoxPTpgxJ Kwi39Ahq0tVIJjs3fKMXyQS77EZ1zN1SBD5gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=WrGGxz88j3jMPnSm0WNVXOY1NsrjAP/cPB9+wDBccNenuvgqw/4muLxNW4+Pv1/mZs zB8TQtOHSZipgIczDG7XHz/7lBnfm1n2OHHyNlQ7mYwd4PHuTNMjqVmkWb44sCnImUZ4 1pmPM6tu4FIk0mkpLv1MyeF3qBSLqTKDCYwzU= MIME-Version: 1.0 Received: by 10.42.150.8 with SMTP id y8mr9635746icv.471.1304298347766; Sun, 01 May 2011 18:05:47 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Sun, 1 May 2011 18:05:47 -0700 (PDT) In-Reply-To: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Sun, 1 May 2011 21:05:47 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 01:05:49 -0000 Hi, On Sun, May 1, 2011 at 7:54 PM, Li, Qing wrote: > That's not the expected behavior, probably a bug, I will take a look ... > I just check on several version. HEAD has the same behavior, 4.9-RELEASE and a custom 7.1 keep the permanent ARP entry. In case that matter, HEAD was tested on top of em(4) and vr(4) interfaces, same behavior in all cases. - Arnaud > -- Qing > > > > > On May 1, 2011, at 4:51 PM, "Ingo Flaschberger" wrote: > >>> is it expected behaviour that the static, permanent arp entry of the in= terface ip disappear after ifdown/ifup at 8.x release? >>> >>> ifconfig em0 10.20.20.1/24 >>> arp -an | grep 10.20.20.1 >>> ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet] >>> ifconfig em0 down >>> ifconfig em0 up >>> arp -an | grep 10.20.20.1 >>> nothing >> >> resend this "question" - as there was no respone. >> >> Kind regards, >> =A0 =A0Ingo Flaschberger >> >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Mon May 2 02:50:57 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D00106564A for ; Mon, 2 May 2011 02:50:57 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id D481E8FC12 for ; Mon, 2 May 2011 02:50:56 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p422otTx005491 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 1 May 2011 19:50:56 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0255.000; Sun, 1 May 2011 19:50:50 -0700 From: "Li, Qing" To: Ingo Flaschberger Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8gAAxBUg= Date: Mon, 2 May 2011 02:50:49 +0000 Message-ID: References: , , <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> In-Reply-To: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" Subject: RE: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 02:50:57 -0000 jeez, this bug has been around for quite a while ...=0A= =0A= Please try patch at http://people.freebsd.org/~qingli/arp.patch=0A= =0A= -- Qing=0A= =0A= ________________________________________=0A= From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on beha= lf of Li, Qing=0A= Sent: Sunday, May 01, 2011 4:54 PM=0A= To: Ingo Flaschberger=0A= Cc: freebsd-net@freebsd.org=0A= Subject: Re: interface ip arp=0A= =0A= That's not the expected behavior, probably a bug, I will take a look ...=0A= =0A= -- Qing=0A= =0A= =0A= =0A= =0A= On May 1, 2011, at 4:51 PM, "Ingo Flaschberger" wrote:=0A= =0A= >> is it expected behaviour that the static, permanent arp entry of the int= erface ip disappear after ifdown/ifup at 8.x release?=0A= >>=0A= >> ifconfig em0 10.20.20.1/24=0A= >> arp -an | grep 10.20.20.1=0A= >> ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet]=0A= >> ifconfig em0 down=0A= >> ifconfig em0 up=0A= >> arp -an | grep 10.20.20.1=0A= >> nothing=0A= >=0A= > resend this "question" - as there was no respone.=0A= >=0A= > Kind regards,=0A= > Ingo Flaschberger=0A= >=0A= > _______________________________________________=0A= > freebsd-net@freebsd.org mailing list=0A= > http://lists.freebsd.org/mailman/listinfo/freebsd-net=0A= > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A= _______________________________________________=0A= freebsd-net@freebsd.org mailing list=0A= http://lists.freebsd.org/mailman/listinfo/freebsd-net=0A= To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A= From owner-freebsd-net@FreeBSD.ORG Mon May 2 03:32:58 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5113D106566B for ; Mon, 2 May 2011 03:32:58 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 15FDB8FC15 for ; Mon, 2 May 2011 03:32:57 +0000 (UTC) Received: by iwn33 with SMTP id 33so6144490iwn.13 for ; Sun, 01 May 2011 20:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fK3Je42Gc7x7S46pFgzg7youJRwcXxsDcSjTJFlMhE0=; b=bbgvzDzupcHozcJX5zJN7SQ0LpW0DK2z33W8TcOCowR6UfIFK8R5bnWRuYolCBbFaj 2UrTMm0pFacVc17dOxQ8s9kdl3TUWXDYXDgPndh2bT90td0pRgygB1n3CxfCZ8doDycM z1EcBDS7aHjVrQ5Dw2yz53WH1kkeioi+qBRGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=DuRiG0dOp+4hVacnED505oRQs8efuxhpcDs4cDXOFkPJuQttx3a+PkkyK06rlRvg6G EGEct6kE/iksff8lvHfNAq5/QGQfjE3+Ykw/UZNs15ZgeGoTTg1q0NGm5cOWvHKvf3hX B0jKD6Dl0o0oMQVON3HNYrhqq+An3ff5IT9KY= MIME-Version: 1.0 Received: by 10.43.44.6 with SMTP id ue6mr9692231icb.69.1304307177272; Sun, 01 May 2011 20:32:57 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Sun, 1 May 2011 20:32:57 -0700 (PDT) In-Reply-To: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Sun, 1 May 2011 23:32:57 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 03:32:58 -0000 Hi, On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote: > jeez, this bug has been around for quite a while ... > > Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch > Do not help: # sh -x test.sh + ifconfig vr2 up 192.168.24.1 + arp -s 192.168.24.2 0:0:0:0:0:1 + arp -a ? (192.168.24.1) at 00:00:24:cb:f4:92 on vr2 permanent [ethernet] ? (192.168.24.2) at 00:00:00:00:00:01 on vr2 permanent [ethernet] + ifconfig vr2 down + arp -a + ifconfig vr2 up + arp -a ? (192.168.24.1) at 00:00:24:cb:f4:92 on vr2 permanent [ethernet] As you can see, the address is lost when the interface is brought down. - Arnaud > -- Qing > > ________________________________________ > From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on be= half of Li, Qing > Sent: Sunday, May 01, 2011 4:54 PM > To: Ingo Flaschberger > Cc: freebsd-net@freebsd.org > Subject: Re: interface ip arp > > That's not the expected behavior, probably a bug, I will take a look ... > > -- Qing > > > > > On May 1, 2011, at 4:51 PM, "Ingo Flaschberger" wrote: > >>> is it expected behaviour that the static, permanent arp entry of the in= terface ip disappear after ifdown/ifup at 8.x release? >>> >>> ifconfig em0 10.20.20.1/24 >>> arp -an | grep 10.20.20.1 >>> ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet] >>> ifconfig em0 down >>> ifconfig em0 up >>> arp -an | grep 10.20.20.1 >>> nothing >> >> resend this "question" - as there was no respone. >> >> Kind regards, >> =A0 =A0Ingo Flaschberger >> >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Mon May 2 03:40:15 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A7B7106566C for ; Mon, 2 May 2011 03:40:15 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id E21958FC13 for ; Mon, 2 May 2011 03:40:14 +0000 (UTC) Received: by iyj12 with SMTP id 12so6195018iyj.13 for ; Sun, 01 May 2011 20:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FaxNN3gfetEzBrxHYEPpM7IiHKDm75xU67GijhPfTZM=; b=TrNgoRr+qwGFMgsEZimFivPi6bfMJjtxtw49NaexML1JNIfGo6QlOxhgfb4pRIgpAp IMmfEaIm7WTTnIjJvSiRO5/7Dj6ymKK6Hmr1eYj6l2BkAvHrPAPKrYXZkZ98V/tt7Y1n yEXcqIIXmRDUJCUVgXXrs4KkbC2WnWjpGZoS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lEVID9wwagX3nl8TcKKPxLKIv4a0T6Ggc2xAxJ34yD4ln2KElhyvhbqq+pp53/87Zc fBiDkdW5/EPPFoaTR2bjIo/oFDEMURnwhWC9MPCCOXWCx0FO6JNS5BrLmkr7G7cJ4+Jv BOE+WLxflYl4U6IwGsjO8+cDWCxGV2bCEKtTw= MIME-Version: 1.0 Received: by 10.43.44.6 with SMTP id ue6mr9698569icb.69.1304307614161; Sun, 01 May 2011 20:40:14 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Sun, 1 May 2011 20:40:14 -0700 (PDT) In-Reply-To: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Sun, 1 May 2011 23:40:14 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 03:40:15 -0000 Hi, On Sun, May 1, 2011 at 11:32 PM, Arnaud Lacombe wrote: > Hi, > > On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote: >> jeez, this bug has been around for quite a while ... >> >> Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch >> > Do not help: > > # sh -x test.sh > + ifconfig vr2 up 192.168.24.1 > + arp -s 192.168.24.2 0:0:0:0:0:1 > + arp -a > ? (192.168.24.1) at 00:00:24:cb:f4:92 on vr2 permanent [ethernet] > ? (192.168.24.2) at 00:00:00:00:00:01 on vr2 permanent [ethernet] > + ifconfig vr2 down > + arp -a > + ifconfig vr2 up > + arp -a > ? (192.168.24.1) at 00:00:24:cb:f4:92 on vr2 permanent [ethernet] > > As you can see, the address is lost when the interface is brought down. > There is no reference to LLE_STATIC in the 7.x tree, so I guess that the new code introduced in 8.x always behaved in such a way. - Arnaud > =A0- Arnaud > >> -- Qing >> >> ________________________________________ >> From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on b= ehalf of Li, Qing >> Sent: Sunday, May 01, 2011 4:54 PM >> To: Ingo Flaschberger >> Cc: freebsd-net@freebsd.org >> Subject: Re: interface ip arp >> >> That's not the expected behavior, probably a bug, I will take a look ... >> >> -- Qing >> >> >> >> >> On May 1, 2011, at 4:51 PM, "Ingo Flaschberger" wrote: >> >>>> is it expected behaviour that the static, permanent arp entry of the i= nterface ip disappear after ifdown/ifup at 8.x release? >>>> >>>> ifconfig em0 10.20.20.1/24 >>>> arp -an | grep 10.20.20.1 >>>> ? (10.20.20.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet] >>>> ifconfig em0 down >>>> ifconfig em0 up >>>> arp -an | grep 10.20.20.1 >>>> nothing >>> >>> resend this "question" - as there was no respone. >>> >>> Kind regards, >>> =A0 =A0Ingo Flaschberger >>> >>> _______________________________________________ >>> freebsd-net@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> > From owner-freebsd-net@FreeBSD.ORG Mon May 2 06:14:43 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D4B1106566C for ; Mon, 2 May 2011 06:14:43 +0000 (UTC) (envelope-from Michael.Tuexen@lurchi.franken.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 72F938FC08 for ; Mon, 2 May 2011 06:14:42 +0000 (UTC) Received: from [192.168.1.192] (p508FA5B3.dip.t-dialin.net [80.143.165.179]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 5D7651C0B4617; Mon, 2 May 2011 08:14:40 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: =?iso-8859-1?Q?Michael_T=FCxen?= In-Reply-To: <20110501190008.179970yneogqya3c@webmail.tuwien.ac.at> Date: Mon, 2 May 2011 08:14:39 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <43E1F000-4772-45B5-B2B1-43E1A09D9FDD@lurchi.franken.de> References: <20110430091148.31393q3py4j4bg38@webmail.tuwien.ac.at> <20110430121518.25761cpmtrp0jtpy@webmail.tuwien.ac.at> <20110501131048.22413db5jyxywss8@webmail.tuwien.ac.at> <13E5D4BB-5B2C-42B3-A43E-0F260317DE6B@lurchi.franken.de> <20110501190008.179970yneogqya3c@webmail.tuwien.ac.at> To: Schoch Christian X-Mailer: Apple Mail (2.1084) Cc: freebsd-net@freebsd.org Subject: Re: [SCTP] ICMP unreachable message reenables data transmit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 06:14:43 -0000 On May 1, 2011, at 7:00 PM, Schoch Christian wrote: > Zitat von Michael T=FCxen: >=20 >> On May 1, 2011, at 1:10 PM, Schoch Christian wrote: >>=20 >>>> On Apr 30, 2011, at 12:15 PM, Schoch Christian wrote: >>>>>=20 >>>>>> On Apr 30, 2011, at 9:11 AM, Schoch Christian wrote: >>>>>>=20 >>>>>>> During a measurement with CMT-SCTP and PF i figured out, that = sometimes a ICMP Destination unreachable message triggers a message = transmission on an inactive data path that has been primary before. >>>>>>>=20 >>>>>>> It looks as the ICMP message is reseting the inactive state back = to active without reseting RTO. >>>>>>>=20 >>>>>>> This behavior is triggered by a returning heartbeat message when = no ICMP unreachable by data is sent quite before. >>>>>>>=20 >>>>>>> Test system are two multi-homed hosts with FreeBSD8.1 and a = WANem host between. >>>>>>>=20 >>>>>>> A wireshark log can be provided on demand (quite large). >>>>>> Hi Christian, >>>>>>=20 >>>>>> any chance to upgrade the FreeBSD machines to head or to use = newer >>>>>> SCTP sources, which I could provide? It would require a = recompilation >>>>>> of the kernel... >>>>>=20 >>>>> It is possible, but the results could be provided not until next = week >>>>> if a reboot is necessary. >>>>> I can use any sources you could provide me since nothing else is = done at this systems. >>>> OK, but maybe I can try to understand what is going on. >>>>=20 >>>> How many paths do you have? One is inactive, but was primary, so it >>>> is confirmed. On another one, you get an ICMP (which one? Port = unreachable, >>>> host unreachable, ...). Do you have more than two paths? >>>=20 >>> Setup looks like this: >>>=20 >>> -------- ----cut--- >>> Host A WANem Host B >>> -------- ---------- >>>=20 >>> Transfer is running on both path from A to B till the primary link = is cut between WANem and the receiver and the whole transfer switches to = the second path. The ICMP message (Host not reachable with a Heartbeat = as attachment) is received on the primary interface from WANem host. >> OK, understood. >>>=20 >>> As I tested this morning, the primary path is switching to = unreachable due to the ICMP message but should be in this state quite = before by exceeding path.max_retrans. >>> So this ICMP message does two things: >>> - Set the primary path to unreachable >>> - Triggers something to retry data transfer on the primary path. >> After looking at the tracefile, I somewhat agree. >> * Do you see something like >> ICMP (thresh ??/??) takes interface ?? down >> on the console? This would be printed if the ICMP takes the >> path to unreachable? (It should also be in /var/log/messages) >> * If the path is already unreachable, nothing should happen >> in response to the ICMP message. >>=20 > 08:04:18 kernel: ICMP (thresh 2/3) takes interface 0xc4e20510 down > Same timestamp as the faulty start in the tracefile. >=20 >> So the question is: Is the path unreachable before the ICMP message >> is received? > Due to the timely difference between first retransmission and ICMP = message it should be in unavailable state. But it seams that too many = retransmission occur and the ICMP message is moving the path to = unavailable state. >=20 > I picked my eyes to the RTO of primary path and could figure out the = following: >=20 > inital state: rto.min =3D 100ms > RTO =3D 100ms >=20 > after cutting the link: > RTO rises to 200ms and 400ms as expected but not higher = (rto.max=3D60000) >=20 > Another test with path_rxt_max =3D 1 worked as expected. >=20 > So I assume some problems with the retransmission counter when larger = than 1 (something like count =3D 1 instead of count >=3D 1) >=20 >> Is your application monitoring the SCTP notification? >> What about the above printout from the kernel? >=20 > Yes, the notifications are monitored and logged (sctp_menu) - the = notification for SCTP_PEER_ADDR_CHANGE comes right after ICMP. OK, it all makes sense using this information after looking at the 8.1 source code. They problem should also be in HEAD. What is going on: 1. You plug the cable. 2. After the first RTO, the timer fires, (it gets doubled), some but not all outstanding chunks are retransmitted. Now the path it potentially failed and not DATA chunks are transmitted anymore. 3. Another timeout for the rest of the outstanding chunks. Now the error counter goes to two and the RTO is doubled. 4. An ICMP message is received. 5. The error counter is set to 4, the path becomes unreachable and the potentially flag is cleared. An indication to the upper layer is given. This is the processing of the received ICMP message. 6. Here comes the problem: The send routine, when using CMT and PF, only skips path which are potentially failed, not unreachable ones. So the path is used again. You are sending out 6 packets, then the CWND is used and eventually the path becomes potentially failed again. What is the problem: 1. The error counter is not increased when a HB times out. Therefore the path does not become unreachable, even though it is. I'm not sure why this is a good thing, but comments in the code indicate that it was chosen on purpose.=20 2. The CMT code should also skip paths which are unreachable. I think this is just a bug. Since the potentially failed stuff will change anyway (when integrating support for http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-02 I will put the fix for 1 on my ToDo list. A fix for two should be changing the file = /use/src/sys/netinet/sctp_output.c. Change around line 7990: /* JRI: if dest is in PF state, do not send data to it = */ if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf) && (net->dest_state & SCTP_ADDR_PF)) { goto no_data_fill; } if (net->flight_size >=3D net->cwnd) { goto no_data_fill; } to /* JRI: if dest is in PF state, do not send data to it = */ if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf) && (net->dest_state & SCTP_ADDR_PF)) { goto no_data_fill; } if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) || (net->dest_state & SCTP_ADDR_UNCONFIRMED))) { goto no_data_fill; } =09 if (net->flight_size >=3D net->cwnd) { goto no_data_fill; } Then you need to recompile the kernel, install it and reboot. Please report if this fixes your issue. The I will commit a corresponding fix to HEAD. Best regards Michael >=20 > Best regards, > Christian >=20 >> Best regards >> Michael >>>=20 >>>> The ICMP message would not reset the RTO, since you need an ACKed = TSN >>>> or a HB-ACK to to that. Since it is inactive, it is missing these. >>>>=20 >>>> Sending on an inactive path is OK, as soon as you enter the dormant >>>> state, which means all your paths are inactive. >>>>=20 >>> Transfer is still running on second link which is active. >> That sounds good. >>>=20 >>>> Are you using the PF support for CMT? >>>=20 >>> Yes, but without NR-SACK and DAC. >> OK. >>>=20 >>> I uploaded the pcap file to: >>> http://37116.vs.webtropia.com/cmt_2.pcap >> That was helpful! >>>=20 >>> Best regards, >>> Christian >>>=20 >>>>=20 >>>> Best regards >>>> Michael >>>>>=20 >>>>>>=20 >>>>>> Are you using IPv4 or IPv6? >>>>>>=20 >>>>>=20 >>>>> IPv4 >>>>>=20 >>>>>=20 >>>>>> Best regards >>>>>> Michael >>>>>>>=20 >>>>>>> Regards, >>>>>>> Schoch Christian >>>>>>> _______________________________________________ >>>>>>> freebsd-net@freebsd.org mailing list >>>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>>>> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >>>>>>>=20 >>>>>>=20 >>>>>> _______________________________________________ >>>>>> freebsd-net@freebsd.org mailing list >>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>>>>> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >>>>>>=20 >>>>>=20 >>>>>=20 >>>>=20 >>>>=20 >>>=20 >>>=20 >>>=20 >>=20 >>=20 >=20 >=20 From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:09:26 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E696F106564A; Mon, 2 May 2011 07:09:26 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9358FC14; Mon, 2 May 2011 07:09:25 +0000 (UTC) Received: by bwz12 with SMTP id 12so6311829bwz.13 for ; Mon, 02 May 2011 00:09:25 -0700 (PDT) Received: by 10.204.57.135 with SMTP id c7mr6842095bkh.88.1304320164785; Mon, 02 May 2011 00:09:24 -0700 (PDT) Received: from jessie.localnet (p5B2ED3B8.dip0.t-ipconnect.de [91.46.211.184]) by mx.google.com with ESMTPS id d11sm3089998bka.19.2011.05.02.00.09.22 (version=SSLv3 cipher=OTHER); Mon, 02 May 2011 00:09:23 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Brandon Gooch Date: Mon, 2 May 2011 09:08:27 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-31-generic; KDE/4.4.5; i686; ; ) References: <201105011319.30649.bschmidt@freebsd.org> <201105011524.09613.bschmidt@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201105020908.27740.bschmidt@freebsd.org> Cc: freebsd-net@freebsd.org, freebsd-wireless@freebsd.org Subject: Re: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bschmidt@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:09:27 -0000 On Sunday, May 01, 2011 23:36:56 Brandon Gooch wrote: > On Sun, May 1, 2011 at 8:24 AM, Bernhard Schmidt wrote: > > On Sunday 01 May 2011 13:19:30 Bernhard Schmidt wrote: > >> Hi, > >> > >> I finally managed to get the 11n bits for iwn(4) sorted out. Well, > >> there is still an issue somewhere with HT40 frame protection or > >> TX chain setup on 5000 adapters, resulting in throughput not being > >> that stable. But overall it seems to work pretty decently > >> > >> This is for HEAD only right now, net80211 in stable/8 does not yet > >> contain the latest 11n related fixes. So, if you run HEAD and have > >> some iwn(4) hardware, I'd appreciate feedback. > >> .. > > > > Updated version, I've missed a locking issue. > > > > -- > > Bernhard > > Thanks for working on this Bernhard! > > Unfortunately, I'm having trouble achieving HT rates. > > After 'wlandebug 0xffffffff', lots of: > ... > May 1 14:38:15 x300 kernel: wlan0: received beacon from > 00:1d:0f:d3:fb:cc rssi 47 > May 1 14:38:15 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard beacon > frame, ie too short, got 26, expected 30 > ... > > I've attached relevant debugging information, but let me know if there > may be anything else that could help. I need to work on DTracing > net80211, any tips on relevant function traces? Attachment seems to be missing? I'd start of with enabling bootverbose to figure out if your adapter supports 11n at all. There are some where the 11n bits have been disabled. Next thing would be to check with % ifconfig -v wlan0 list chan if the HT channel setup works, if so it should list several HT20/HT40 channels. With % wlanconfig +11n you should at least see something like "Switching channel to HT20" right before moving into RUN state. Also, does % ifconfig wlan0 list scan show HTCAP for the AP you're associating too? -- Bernhard From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:34:33 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0A2106566B; Mon, 2 May 2011 07:34:33 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id E011D8FC0A; Mon, 2 May 2011 07:34:32 +0000 (UTC) Received: by wwk4 with SMTP id 4so2082713wwk.1 for ; Mon, 02 May 2011 00:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U7V1XKwxuyRW4EJiHLzpnceFZnNj3MU9m09Ian1SsdQ=; b=JzuIycjlxKZFc6E8qWrqsc4caMNTKKroOeMsNrEmNwqZDhR6PX3q21UPy9btBrkzrB 7uqJh5Piw5tzkAnrY/LgiBHLJvC6Bdo6NZhVcCGhAlW8bG8tHhzMPIakz2vF92wBn5Dw gFaaNvzkSGs15bBli/7qFO9wKxleA/09+CrVU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=BmD13G+bd8FE9ix3u+SNXiI9J/TbBAr/FJ3rsyeOvyqRNdVvgaUCuWWulcxiHV5kIV XLfuFcigtRvqItjT+mE72WCAIobwn3mdLSrC5Yq1H2LcwMkVQlBBLc74Qnbim0XoAx83 nhCoD+vd/A4z7vbSvNZHZxX6DE8+El1u6k8/I= MIME-Version: 1.0 Received: by 10.216.242.134 with SMTP id i6mr2244207wer.81.1304321671656; Mon, 02 May 2011 00:34:31 -0700 (PDT) Received: by 10.216.17.213 with HTTP; Mon, 2 May 2011 00:34:31 -0700 (PDT) In-Reply-To: <201105020908.27740.bschmidt@freebsd.org> References: <201105011319.30649.bschmidt@freebsd.org> <201105011524.09613.bschmidt@freebsd.org> <201105020908.27740.bschmidt@freebsd.org> Date: Mon, 2 May 2011 02:34:31 -0500 Message-ID: From: Brandon Gooch To: bschmidt@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, freebsd-wireless@freebsd.org Subject: Re: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:34:33 -0000 2011/5/2 Bernhard Schmidt : > On Sunday, May 01, 2011 23:36:56 Brandon Gooch wrote: >> On Sun, May 1, 2011 at 8:24 AM, Bernhard Schmidt = wrote: >> > On Sunday 01 May 2011 13:19:30 Bernhard Schmidt wrote: >> >> Hi, >> >> >> >> I finally managed to get the 11n bits for iwn(4) sorted out. Well, >> >> there is still an issue somewhere with HT40 frame protection or >> >> TX chain setup on 5000 adapters, resulting in throughput not being >> >> that stable. But overall it seems to work pretty decently >> >> >> >> This is for HEAD only right now, net80211 in stable/8 does not yet >> >> contain the latest 11n related fixes. So, if you run HEAD and have >> >> some iwn(4) hardware, I'd appreciate feedback. >> >> .. >> > >> > Updated version, I've missed a locking issue. >> > >> > -- >> > Bernhard >> >> Thanks for working on this Bernhard! >> >> Unfortunately, I'm having trouble achieving HT rates. >> >> After 'wlandebug 0xffffffff', lots of: >> ... >> May =A01 14:38:15 x300 kernel: wlan0: received beacon from >> 00:1d:0f:d3:fb:cc rssi 47 >> May =A01 14:38:15 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard beacon >> frame, ie too short, got 26, expected 30 >> ... >> >> I've attached relevant debugging information, but let me know if there >> may be anything else that could help. I need to work on DTracing >> net80211, any tips on relevant function traces? > > Attachment seems to be missing? I'll send the attachment again, directly to you, bypassing the list... > I'd start of with enabling bootverbose to figure out if your adapter > supports 11n at all. iwn0: mem 0xf9f00000-0xf9f01fff irq 17 at device 0.0 on pci3 iwn0: attempting to allocate 1 MSI vectors (1 supported) msi: routing MSI IRQ 259 to local APIC 0 vector 55 iwn0: using IRQ 259 for MSI iwn0: MIMO 2T3R, MoW1, address 00:1f:3b:28:30:c5 iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps iwn0: 2T3R iwn0: 11na MCS 20MHz iwn0: MCS 0-7: 6.5Mbps - 65Mbps iwn0: MCS 8-15: 13Mbps - 130Mbps iwn0: 11na MCS 20MHz SGI iwn0: MCS 0-7: 7Mbps - 72Mbps iwn0: MCS 8-15: 14.5Mbps - 144.5Mbps iwn0: 11na MCS 40MHz: iwn0: MCS 0-7: 13.5Mbps - 135Mbps iwn0: MCS 8-15: 27Mbps - 270Mbps iwn0: 11na MCS 40MHz SGI: iwn0: MCS 0-7: 15Mbps - 150Mbps iwn0: MCS 8-15: 30Mbps - 300Mbps iwn0: 11ng MCS 20MHz iwn0: MCS 0-7: 6.5Mbps - 65Mbps iwn0: MCS 8-15: 13Mbps - 130Mbps iwn0: 11ng MCS 20MHz SGI iwn0: MCS 0-7: 7Mbps - 72Mbps iwn0: MCS 8-15: 14.5Mbps - 144.5Mbps iwn0: 11ng MCS 40MHz: iwn0: MCS 0-7: 13.5Mbps - 135Mbps iwn0: MCS 8-15: 27Mbps - 270Mbps iwn0: 11ng MCS 40MHz SGI: iwn0: MCS 0-7: 15Mbps - 150Mbps iwn0: MCS 8-15: 30Mbps - 300Mbps >There are some where the 11n bits have been > disabled. Next thing would be to check with > % ifconfig -v wlan0 list chan I think you may be right about this, despite the dmesg output, as I see no 11n listed in the output: # ifconfig -v wlan0 list chan Channel 1 : 2412 MHz 11b Channel 40 : 5200* MHz 11a Channel 1 : 2412 MHz 11g Channel 40 : 5200* MHz 11a ht/20 Channel 1 : 2412 MHz 11g ht/20 Channel 40 : 5200* MHz 11a ht/40- Channel 2 : 2417 MHz 11b Channel 44 : 5220* MHz 11a Channel 2 : 2417 MHz 11g Channel 44 : 5220* MHz 11a ht/20 Channel 2 : 2417 MHz 11g ht/20 Channel 44 : 5220* MHz 11a ht/40+ Channel 3 : 2422 MHz 11b Channel 48 : 5240* MHz 11a Channel 3 : 2422 MHz 11g Channel 48 : 5240* MHz 11a ht/20 Channel 3 : 2422 MHz 11g ht/20 Channel 48 : 5240* MHz 11a ht/40- Channel 4 : 2427 MHz 11b Channel 52 : 5260* MHz 11a Channel 4 : 2427 MHz 11g Channel 52 : 5260* MHz 11a ht/20 Channel 4 : 2427 MHz 11g ht/20 Channel 52 : 5260* MHz 11a ht/40+ Channel 5 : 2432 MHz 11b Channel 56 : 5280* MHz 11a Channel 5 : 2432 MHz 11g Channel 56 : 5280* MHz 11a ht/20 Channel 5 : 2432 MHz 11g ht/20 Channel 56 : 5280* MHz 11a ht/40- Channel 6 : 2437 MHz 11b Channel 60 : 5300* MHz 11a Channel 6 : 2437 MHz 11g Channel 60 : 5300* MHz 11a ht/20 Channel 6 : 2437 MHz 11g ht/20 Channel 60 : 5300* MHz 11a ht/40+ Channel 7 : 2442 MHz 11b Channel 64 : 5320* MHz 11a Channel 7 : 2442 MHz 11g Channel 64 : 5320* MHz 11a ht/20 Channel 7 : 2442 MHz 11g ht/20 Channel 64 : 5320* MHz 11a ht/40- Channel 8 : 2447 MHz 11b Channel 149 : 5745* MHz 11a Channel 8 : 2447 MHz 11g Channel 149 : 5745* MHz 11a ht/20 Channel 8 : 2447 MHz 11g ht/20 Channel 149 : 5745* MHz 11a ht/40+ Channel 9 : 2452 MHz 11b Channel 153 : 5765* MHz 11a Channel 9 : 2452 MHz 11g Channel 153 : 5765* MHz 11a ht/20 Channel 9 : 2452 MHz 11g ht/20 Channel 153 : 5765* MHz 11a ht/40- Channel 10 : 2457 MHz 11b Channel 157 : 5785* MHz 11a Channel 10 : 2457 MHz 11g Channel 157 : 5785* MHz 11a ht/20 Channel 10 : 2457 MHz 11g ht/20 Channel 157 : 5785* MHz 11a ht/40+ Channel 11 : 2462 MHz 11b Channel 161 : 5805* MHz 11a Channel 11 : 2462 MHz 11g Channel 161 : 5805* MHz 11a ht/20 Channel 11 : 2462 MHz 11g ht/20 Channel 161 : 5805* MHz 11a ht/40- Channel 36 : 5180* MHz 11a Channel 165 : 5825* MHz 11a Channel 36 : 5180* MHz 11a ht/20 Channel 165 : 5825* MHz 11a ht/20 Channel 36 : 5180* MHz 11a ht/40+ > if the HT channel setup works, if so it should list several HT20/HT40 > channels. With > % wlanconfig +11n # wlandebug +11n May 2 02:22:24 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU frame, BA win <268:331> (0 frames) rxseq 267 tid 0 (retransmit) May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU frame, BA win <336:399> (0 frames) rxseq 335 tid 0 (retransmit) May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU frame, BA win <393:456> (0 frames) rxseq 392 tid 0 (retransmit) May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU frame, BA win <406:469> (0 frames) rxseq 405 tid 0 (retransmit) > you should at least see something like "Switching channel to HT20" > right before moving into RUN state. Also, does > % ifconfig wlan0 list scan > show HTCAP for the AP you're associating too? # ifconfig -v wlan0 list scan bingo 00:1d:0f:d3:fb:cc 11 54M -71:-95 100 EPS SSID RATES DSPARMS<11> RSN WPA ERP<0x0> XRATES<48,72,96,108> WME VEN HTCAP VEN HTINFO ATH<0x7fff> VEN -Brandon From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:41:36 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980281065670 for ; Mon, 2 May 2011 07:41:36 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5D22E8FC1B for ; Mon, 2 May 2011 07:41:36 +0000 (UTC) Received: by iyj12 with SMTP id 12so6314747iyj.13 for ; Mon, 02 May 2011 00:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U/kAESPXehPewGb7oPCXZVjwM99zZBkxO+5RzTxeKAY=; b=D3Btq+NjgvBmEU1vjl8x4jKwy0fUr7lIsY6z98YEAaIiGVqNLHC/kKKhwBhD/uIge/ hZYVwIUgtI9MOQHE/3a/cFdGuHvEzqKeH/7MhPMCja9OIDBTVKVIs/cOcfrGvad+mtHP p6Fgt2OqYn8j5bqJrQ7R4dCkwLmVaU7grpfcA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KOJHT44oMnbAyTlxjzkLFfvGFijclJ+kc1GUsBdPsFrzzr/RWIvivgfTJXvKi3eAd8 rOYm5LcZYduPRtjKW3PAZF8hX/3fVhg2XztE08sBE9bA1J0SMwYBVx1gNa1QCpDRdjY8 4s47piZs7AizI4ZBUI4lRd0N3Dk/b6HekZvV4= MIME-Version: 1.0 Received: by 10.42.150.8 with SMTP id y8mr10013217icv.471.1304322095704; Mon, 02 May 2011 00:41:35 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Mon, 2 May 2011 00:41:35 -0700 (PDT) In-Reply-To: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Mon, 2 May 2011 03:41:35 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:41:36 -0000 Hi, On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote: > jeez, this bug has been around for quite a while ... > > Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch > d'oh!... Concerning Ingo's bug, your patch do the job, my report was bad, 4.9-RELEASE and 7.x show the same behavior: # uname -a FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13 # ifconfig em0 up 192.168.45.200/24 # arp -n 192.168.45.200 ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet] # ifconfig em0 down # arp -n 192.168.45.200 192.168.45.200 (192.168.45.200) -- no entry # ifconfig em0 up # arp -n 192.168.45.200 192.168.45.200 (192.168.45.200) -- no entry The behavioral change I noticed is that permanent address (manually added) in the ARP table are flushed along with all other addresses on >8.x (cf. the script output of my previous mail) while they are kept in the cache on <7.x during a down/up transition. The following patch: diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 1012012..27e44a2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt, for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { + if (lle->la_flags & LLE_STATIC) + continue; if (IN_ARE_MASKED_ADDR_EQUAL((struct sockaddr_in *)L3_ADDR(lle), pfx, msk)) { partially restores the old behavior. Only partially as before 8.x, interface addresses were not marked as 'permanent'. You could manually add a 'permanent' entry for this address in such a way it would survive the down/up transition. In 8.x, the interface address is marked as 'permanent', but is removed explicitly by arp_ifscrub(). So even the above change would not work for the interface address. Shouldn't this address be removed later when "removing all L2 entries on the given prefix", in which case it would not have to be re-added again, if marking it 'permanent' is deliberate ? Thanks, - Arnaud From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:45:27 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416AD106566B for ; Mon, 2 May 2011 07:45:27 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id 2310E8FC13 for ; Mon, 2 May 2011 07:45:26 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p427jQLm027236 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 2 May 2011 00:45:26 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0255.000; Mon, 2 May 2011 00:45:20 -0700 From: "Li, Qing" To: Arnaud Lacombe Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8gAAxBUiAAMbUgP//ivAO Date: Mon, 2 May 2011 07:45:20 +0000 Message-ID: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: RE: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:45:27 -0000 Your patch doesn't work because the in_lltable_prefix_free() is a generic = function. =0A= =0A= The static entries are kept only when issuing if-down command, however, if = the interface =0A= address is being removed, permanent static entries are gone and have to be = reinstalled.=0A= =0A= I already have a working patch for IPv4, just going over the IPv6 code.=0A= =0A= I will post the patch in a few minutes.=0A= =0A= -- Qing=0A= =0A= ________________________________________=0A= From: Arnaud Lacombe [lacombar@gmail.com]=0A= Sent: Monday, May 02, 2011 12:41 AM=0A= To: Li, Qing=0A= Cc: Ingo Flaschberger; freebsd-net@freebsd.org=0A= Subject: Re: interface ip arp=0A= =0A= Hi,=0A= =0A= On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote:=0A= > jeez, this bug has been around for quite a while ...=0A= >=0A= > Please try patch at http://people.freebsd.org/~qingli/arp.patch=0A= >=0A= d'oh!... Concerning Ingo's bug, your patch do the job, my report was=0A= bad, 4.9-RELEASE and 7.x show the same behavior:=0A= =0A= # uname -a=0A= FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13=0A= # ifconfig em0 up 192.168.45.200/24=0A= # arp -n 192.168.45.200=0A= ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet]=0A= # ifconfig em0 down=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= # ifconfig em0 up=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= =0A= The behavioral change I noticed is that permanent address (manually=0A= added) in the ARP table are flushed along with all other addresses on=0A= >8.x (cf. the script output of my previous mail) while they are kept=0A= in the cache on <7.x during a down/up transition. The following patch:=0A= =0A= diff --git a/sys/netinet/in.c b/sys/netinet/in.c=0A= index 1012012..27e44a2 100644=0A= --- a/sys/netinet/in.c=0A= +++ b/sys/netinet/in.c=0A= @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt,=0A= =0A= for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) {=0A= LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {= =0A= + if (lle->la_flags & LLE_STATIC)=0A= + continue;=0A= if (IN_ARE_MASKED_ADDR_EQUAL((struct=0A= sockaddr_in *)L3_ADDR(lle),=0A= pfx, msk)) {=0A= =0A= partially restores the old behavior. Only partially as before 8.x,=0A= interface addresses were not marked as 'permanent'. You could manually=0A= add a 'permanent' entry for this address in such a way it would=0A= survive the down/up transition. In 8.x, the interface address is=0A= marked as 'permanent', but is removed explicitly by arp_ifscrub(). So=0A= even the above change would not work for the interface address.=0A= =0A= Shouldn't this address be removed later when "removing all L2 entries=0A= on the given prefix", in which case it would not have to be re-added=0A= again, if marking it 'permanent' is deliberate ?=0A= =0A= Thanks,=0A= - Arnaud=0A= From owner-freebsd-net@FreeBSD.ORG Mon May 2 07:54:17 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9734C106566C; Mon, 2 May 2011 07:54:17 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F3E1E8FC1F; Mon, 2 May 2011 07:54:16 +0000 (UTC) Received: by bwz12 with SMTP id 12so6338240bwz.13 for ; Mon, 02 May 2011 00:54:15 -0700 (PDT) Received: by 10.204.18.193 with SMTP id x1mr2297234bka.79.1304322855231; Mon, 02 May 2011 00:54:15 -0700 (PDT) Received: from jessie.localnet (p5B2ED3B8.dip0.t-ipconnect.de [91.46.211.184]) by mx.google.com with ESMTPS id q24sm3112977bks.21.2011.05.02.00.54.13 (version=SSLv3 cipher=OTHER); Mon, 02 May 2011 00:54:14 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Brandon Gooch Date: Mon, 2 May 2011 09:53:18 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32-31-generic; KDE/4.4.5; i686; ; ) References: <201105011319.30649.bschmidt@freebsd.org> <201105020908.27740.bschmidt@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105020953.19003.bschmidt@freebsd.org> Cc: freebsd-net@freebsd.org, freebsd-wireless@freebsd.org Subject: Re: CFT: 11n support for iwn(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bschmidt@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 07:54:17 -0000 On Monday, May 02, 2011 09:34:31 Brandon Gooch wrote: > 2011/5/2 Bernhard Schmidt : > > On Sunday, May 01, 2011 23:36:56 Brandon Gooch wrote: > >> On Sun, May 1, 2011 at 8:24 AM, Bernhard Schmidt wrote: > >> > On Sunday 01 May 2011 13:19:30 Bernhard Schmidt wrote: > >> >> Hi, > >> >> > >> >> I finally managed to get the 11n bits for iwn(4) sorted out. Well, > >> >> there is still an issue somewhere with HT40 frame protection or > >> >> TX chain setup on 5000 adapters, resulting in throughput not being > >> >> that stable. But overall it seems to work pretty decently > >> >> > >> >> This is for HEAD only right now, net80211 in stable/8 does not yet > >> >> contain the latest 11n related fixes. So, if you run HEAD and have > >> >> some iwn(4) hardware, I'd appreciate feedback. > >> >> .. > >> > > >> > Updated version, I've missed a locking issue. > >> > > >> > -- > >> > Bernhard > >> > >> Thanks for working on this Bernhard! > >> > >> Unfortunately, I'm having trouble achieving HT rates. > >> > >> After 'wlandebug 0xffffffff', lots of: > >> ... > >> May 1 14:38:15 x300 kernel: wlan0: received beacon from > >> 00:1d:0f:d3:fb:cc rssi 47 > >> May 1 14:38:15 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard beacon > >> frame, ie too short, got 26, expected 30 > >> ... > >> > >> I've attached relevant debugging information, but let me know if there > >> may be anything else that could help. I need to work on DTracing > >> net80211, any tips on relevant function traces? > > > > Attachment seems to be missing? > > I'll send the attachment again, directly to you, bypassing the list... > > > I'd start of with enabling bootverbose to figure out if your adapter > > supports 11n at all. > > .. > iwn0: 11na MCS 20MHz > iwn0: MCS 0-7: 6.5Mbps - 65Mbps > iwn0: MCS 8-15: 13Mbps - 130Mbps > .. That indicates 11n support. > >There are some where the 11n bits have been > > disabled. Next thing would be to check with > > % ifconfig -v wlan0 list chan > > I think you may be right about this, despite the dmesg output, as I > see no 11n listed in the output: > > # ifconfig -v wlan0 list chan > > Channel 1 : 2412 MHz 11g ht/20 Channel 40 : 5200* MHz 11a ht/40- HT channels are available. > > if the HT channel setup works, if so it should list several HT20/HT40 > > channels. With > > % wlanconfig +11n > > # wlandebug +11n > > May 2 02:22:24 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU > frame, BA win <268:331> (0 frames) rxseq 267 tid 0 (retransmit) > May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU > frame, BA win <336:399> (0 frames) rxseq 335 tid 0 (retransmit) > May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU > frame, BA win <393:456> (0 frames) rxseq 392 tid 0 (retransmit) > May 2 02:22:28 x300 kernel: wlan0: [00:1d:0f:d3:fb:cc] discard MPDU > frame, BA win <406:469> (0 frames) rxseq 405 tid 0 (retransmit) That is probably the reason why you're seeing low performance. I remember seeing this with ath9k but didn't dig any deeper. Well, time to do so now. > > you should at least see something like "Switching channel to HT20" > > right before moving into RUN state. Also, does > > % ifconfig wlan0 list scan > > show HTCAP for the AP you're associating too? > > # ifconfig -v wlan0 list scan > > bingo 00:1d:0f:d3:fb:cc 11 54M -71:-95 > .. > txop 47]> VEN HTCAP Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05435106564A for ; Mon, 2 May 2011 08:04:04 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id D95508FC12 for ; Mon, 2 May 2011 08:04:03 +0000 (UTC) Received: from PWSVL-EXCHTS-02.internal.cacheflow.com (sai-rp.bluecoat.com [10.2.2.126] (may be forged)) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p4284291002306 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 2 May 2011 01:04:02 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-02.internal.cacheflow.com ([fe80::4910:317f:407:6ecc%14]) with mapi id 14.01.0255.000; Mon, 2 May 2011 01:03:57 -0700 From: "Li, Qing" To: Arnaud Lacombe Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8gAAxBUiAAMbUgP//ivAOgAAFxbA= Date: Mon, 2 May 2011 08:03:57 +0000 Message-ID: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> , , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: RE: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 08:04:04 -0000 Please give this patch a try for IPv4 ARP=0A= =0A= http://people.freebsd.org/~qingli/arp2.patch=0A= =0A= --Qing=0A= =0A= ________________________________________=0A= From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on beha= lf of Li, Qing=0A= Sent: Monday, May 02, 2011 12:45 AM=0A= To: Arnaud Lacombe=0A= Cc: freebsd-net@freebsd.org; Ingo Flaschberger=0A= Subject: RE: interface ip arp=0A= =0A= Your patch doesn't work because the in_lltable_prefix_free() is a generic = function.=0A= =0A= The static entries are kept only when issuing if-down command, however, if = the interface=0A= address is being removed, permanent static entries are gone and have to be = reinstalled.=0A= =0A= I already have a working patch for IPv4, just going over the IPv6 code.=0A= =0A= I will post the patch in a few minutes.=0A= =0A= -- Qing=0A= =0A= ________________________________________=0A= From: Arnaud Lacombe [lacombar@gmail.com]=0A= Sent: Monday, May 02, 2011 12:41 AM=0A= To: Li, Qing=0A= Cc: Ingo Flaschberger; freebsd-net@freebsd.org=0A= Subject: Re: interface ip arp=0A= =0A= Hi,=0A= =0A= On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote:=0A= > jeez, this bug has been around for quite a while ...=0A= >=0A= > Please try patch at http://people.freebsd.org/~qingli/arp.patch=0A= >=0A= d'oh!... Concerning Ingo's bug, your patch do the job, my report was=0A= bad, 4.9-RELEASE and 7.x show the same behavior:=0A= =0A= # uname -a=0A= FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13=0A= # ifconfig em0 up 192.168.45.200/24=0A= # arp -n 192.168.45.200=0A= ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet]=0A= # ifconfig em0 down=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= # ifconfig em0 up=0A= # arp -n 192.168.45.200=0A= 192.168.45.200 (192.168.45.200) -- no entry=0A= =0A= The behavioral change I noticed is that permanent address (manually=0A= added) in the ARP table are flushed along with all other addresses on=0A= >8.x (cf. the script output of my previous mail) while they are kept=0A= in the cache on <7.x during a down/up transition. The following patch:=0A= =0A= diff --git a/sys/netinet/in.c b/sys/netinet/in.c=0A= index 1012012..27e44a2 100644=0A= --- a/sys/netinet/in.c=0A= +++ b/sys/netinet/in.c=0A= @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt,=0A= =0A= for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) {=0A= LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) {= =0A= + if (lle->la_flags & LLE_STATIC)=0A= + continue;=0A= if (IN_ARE_MASKED_ADDR_EQUAL((struct=0A= sockaddr_in *)L3_ADDR(lle),=0A= pfx, msk)) {=0A= =0A= partially restores the old behavior. Only partially as before 8.x,=0A= interface addresses were not marked as 'permanent'. You could manually=0A= add a 'permanent' entry for this address in such a way it would=0A= survive the down/up transition. In 8.x, the interface address is=0A= marked as 'permanent', but is removed explicitly by arp_ifscrub(). So=0A= even the above change would not work for the interface address.=0A= =0A= Shouldn't this address be removed later when "removing all L2 entries=0A= on the given prefix", in which case it would not have to be re-added=0A= again, if marking it 'permanent' is deliberate ?=0A= =0A= Thanks,=0A= - Arnaud=0A= _______________________________________________=0A= freebsd-net@freebsd.org mailing list=0A= http://lists.freebsd.org/mailman/listinfo/freebsd-net=0A= To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A= From owner-freebsd-net@FreeBSD.ORG Mon May 2 09:03:58 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E33C9106564A for ; Mon, 2 May 2011 09:03:58 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3C28FC0A for ; Mon, 2 May 2011 09:03:58 +0000 (UTC) Received: by bwz12 with SMTP id 12so6380991bwz.13 for ; Mon, 02 May 2011 02:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :date:subject:to:message-id:mime-version:x-mailer; bh=P/fOcmU+H6g5NEXo/z5OCUoEz3n+Ppgq+JfRCFu04pw=; b=Q7zaNCITPQcbX2/qQCPX6tD7rlHs2llgPVrPA6pa2wURyU/CwJc0dRdp4m78XFvW3B 4xQGXoBEhVMGTZ0sevrsBNB2vnswYHCo4lN6PKMfkNlBLSrGgSym+nKKA/rTD7AsfACf BEhG02hDrQEwlxJTV5obt6lEW2xIZOvCDZhms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:date:subject:to :message-id:mime-version:x-mailer; b=QOgaGYgD58aJoNACNklHMkRyPI3mp4nAz1mZTrGmL1kXVUKL73NiV+mSrP3KweDCzc SmxyIPtHlu9XmYO1p/446s9ghlX21/1krc2Cg8aNFf//yX27VBF7DIQ7sh/mkxJpBSys Z94DyAQ8RQ7SPeq11k/B1GnVjctT6w3aPBgV8= Received: by 10.204.76.83 with SMTP id b19mr3418570bkk.126.1304327037162; Mon, 02 May 2011 02:03:57 -0700 (PDT) Received: from imba-brutale.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id q25sm3147647bkk.22.2011.05.02.02.03.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2011 02:03:56 -0700 (PDT) From: Nikolay Denev Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Mon, 2 May 2011 12:03:54 +0300 To: freebsd-net@freebsd.org Message-Id: <39B0B4EC-A41E-41FC-A03A-8B630CE167E3@gmail.com> Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Radix sorting bug affecting IPSec performance. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 09:03:59 -0000 This line from the OpenBSD 4.9 release notes attracted my attention :=20 "A radix tree sorting bug was fixed, which results in significant = improvements to IPsec performance under certain conditions.| And this seems to be the relevant commit : = http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/radix.c?rev=3D1.28;sortb= y=3Ddate Looking at the FreeBSD code it seems that is also affected, maybe it's a = good idea to add their fix in FreeBSD :) Regards, Nikolay= From owner-freebsd-net@FreeBSD.ORG Mon May 2 11:07:03 2011 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BC1106567C for ; Mon, 2 May 2011 11:07:03 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B761B8FC19 for ; Mon, 2 May 2011 11:07:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p42B735R064156 for ; Mon, 2 May 2011 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p42B738H064154 for freebsd-net@FreeBSD.org; Mon, 2 May 2011 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 2 May 2011 11:07:03 GMT Message-Id: <201105021107.p42B738H064154@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-net@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-net@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 11:07:03 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/156493 net [msk] Marvell Yukon 2 device works only few seconds o kern/156408 net [vlan] Routing failure when using VLANs vs. Physical e o kern/156328 net [icmp]: host can ping other subnet but no have IP from o kern/156317 net [ip6] Wrong order of IPv6 NS DAD/MLD Report o kern/156283 net [ip6] [patch] nd6_ns_input - rtalloc_mpath does not re o kern/156279 net [if_bridge][divert][ipfw] unable to correctly re-injec o kern/156226 net [lagg]: failover does not announce the failover to swi o kern/156030 net [ip6] [panic] Crash in nd6_dad_start() due to null ptr o kern/155772 net ifconfig(8): ioctl (SIOCAIFADDR): File exists on direc o kern/155680 net [multicast] problems with multicast s kern/155642 net [request] Add driver for Realtek RTL8191SE/RTL8192SE W o kern/155636 net [msk] msk driver locks marvel yukon 88E8057 NIC o kern/155604 net [flowtable] Flowtable excessively caches dest MAC addr o kern/155597 net [panic] Kernel panics with "sbdrop" message o kern/155585 net [tcp] [panic] tcp_output tcp_mtudisc loop until kernel o kern/155498 net [ral] ral(4) needs to be resynced with OpenBSD's to ga o kern/155420 net [vlan] adding vlan break existent vlan o bin/155365 net [patch] routed(8): if.c in routed fails to compile if o kern/155177 net [route] [panic] Panic when inject routes in kernel o kern/155030 net [igb] igb(4) DEVICE_POLLING does not work with carp(4) o kern/155010 net [msk] ntfs-3g via iscsi using msk driver cause kernel o kern/155004 net [bce] [panic] kernel panic in bce0 driver o kern/154943 net [gif] ifconfig gifX create on existing gifX clears IP s kern/154851 net [request]: Port brcm80211 driver from Linux to FreeBSD o kern/154850 net [netgraph] [patch] ng_ether fails to name nodes when t o kern/154831 net [arp] [patch] arp sysctl setting log_arp_permanent_mod o kern/154679 net [em] Fatal trap 12: "em1 taskq" only at startup (8.1-R o kern/154600 net [tcp] [panic] Random kernel panics on tcp_output o kern/154557 net [tcp] Freeze tcp-session of the clients, if in the gat o kern/154443 net [if_bridge] Kernel module bridgestp.ko missing after u o kern/154286 net [netgraph] [panic] 8.2-PRERELEASE panic in netgraph o kern/154255 net [nfs] NFS not responding o kern/154214 net [stf] [panic] Panic when creating stf interface o kern/154185 net race condition in mb_dupcl o kern/154169 net [multicast] [ip6] Node Information Query multicast add o kern/154134 net [ip6] stuck kernel state in LISTEN on ipv6 daemon whic o kern/154091 net [netgraph] [panic] netgraph, unaligned mbuf? o conf/154062 net [vlan] [patch] change to way of auto-generatation of v o kern/153937 net [ral] ralink panics the system (amd64 freeBSDD 8.X) wh o kern/153936 net [ixgbe] [patch] MPRC workaround incorrectly applied to o kern/153816 net [ixgbe] ixgbe doesn't work properly with the Intel 10g o kern/153772 net [ixgbe] [patch] sysctls reference wrong XON/XOFF varia o kern/153497 net [netgraph] netgraph panic due to race conditions o kern/153454 net [patch] [wlan] [urtw] Support ad-hoc and hostap modes o kern/153308 net [em] em interface use 100% cpu o kern/153244 net [em] em(4) fails to send UDP to port 0xffff o kern/152893 net [netgraph] [panic] 8.2-PRERELEASE panic in netgraph o kern/152853 net [em] tftpd (and likely other udp traffic) fails over e o kern/152828 net [em] poor performance on 8.1, 8.2-PRE o kern/152569 net [net]: Multiple ppp connections and routing table prob o kern/152360 net [dummynet] [panic] Crash related to dummynet. o kern/152235 net [arp] Permanent local ARP entries are not properly upd o kern/152141 net [vlan] [patch] encapsulate vlan in ng_ether before out o kern/151690 net [ep] network connectivity won't work until dhclient is o kern/151681 net [nfs] NFS mount via IPv6 leads to hang on client with o kern/151593 net [igb] [panic] Kernel panic when bringing up igb networ o kern/150920 net [ixgbe][igb] Panic when packets are dropped with heade o bin/150642 net netstat(1) doesn't print anything for SCTP sockets o kern/150557 net [igb] igb0: Watchdog timeout -- resetting o kern/150251 net [patch] [ixgbe] Late cable insertion broken o kern/150249 net [ixgbe] Media type detection broken o bin/150224 net ppp(8) does not reassign static IP after kill -KILL co f kern/149969 net [wlan] [ral] ralink rt2661 fails to maintain connectio o kern/149937 net [ipfilter] [patch] kernel panic in ipfilter IP fragmen o kern/149643 net [rum] device not sending proper beacon frames in ap mo o kern/149609 net [panic] reboot after adding second default route o kern/149306 net [alc] Doesn't work Atheros AR8131 PCIe Gigabit Etherne o kern/149117 net [inet] [patch] in_pcbbind: redundant test o kern/149086 net [multicast] Generic multicast join failure in 8.1 o kern/148018 net [flowtable] flowtable crashes on ia64 o kern/147912 net [boot] FreeBSD 8 Beta won't boot on Thinkpad i1300 11 o kern/147894 net [ipsec] IPv6-in-IPv4 does not work inside an ESP-only o kern/147155 net [ip6] setfb not work with ipv6 o kern/146845 net [libc] close(2) returns error 54 (connection reset by f kern/146792 net [flowtable] flowcleaner 100% cpu's core load o kern/146719 net [pf] [panic] PF or dumynet kernel panic o kern/146534 net [icmp6] wrong source address in echo reply o kern/146427 net [mwl] Additional virtual access points don't work on m o kern/146426 net [mwl] 802.11n rates not possible on mwl o kern/146425 net [mwl] mwl dropping all packets during and after high u f kern/146394 net [vlan] IP source address for outgoing connections o bin/146377 net [ppp] [tun] Interface doesn't clear addresses when PPP o kern/146358 net [vlan] wrong destination MAC address o kern/146165 net [wlan] [panic] Setting bssid in adhoc mode causes pani o kern/146082 net [ng_l2tp] a false invaliant check was performed in ng_ o kern/146037 net [panic] mpd + CoA = kernel panic o bin/145934 net [patch] add count option to netstat(1) o kern/145825 net [panic] panic: soabort: so_count o kern/145728 net [lagg] Stops working lagg between two servers. f kern/144917 net [flowtable] [panic] flowtable crashes system [regressi o kern/144882 net MacBookPro =>4.1 does not connect to BSD in hostap wit o kern/144874 net [if_bridge] [patch] if_bridge frees mbuf after pfil ho o conf/144700 net [rc.d] async dhclient breaks stuff for too many people o kern/144616 net [nat] [panic] ip_nat panic FreeBSD 7.2 o kern/144572 net [carp] CARP preemption mode traffic partially goes to f kern/144315 net [ipfw] [panic] freebsd 8-stable reboot after add ipfw o kern/144231 net bind/connect/sendto too strict about sockaddr length o kern/143939 net [ipfw] [em] ipfw nat and em interface rxcsum problem o kern/143846 net [gif] bringing gif3 tunnel down causes gif0 tunnel to s kern/143673 net [stf] [request] there should be a way to support multi s kern/143666 net [ip6] [request] PMTU black hole detection not implemen o kern/143622 net [pfil] [patch] unlock pfil lock while calling firewall o kern/143593 net [ipsec] When using IPSec, tcpdump doesn't show outgoin o kern/143591 net [ral] RT2561C-based DLink card (DWL-510) fails to work o kern/143208 net [ipsec] [gif] IPSec over gif interface not working o kern/143034 net [panic] system reboots itself in tcp code [regression] o kern/142877 net [hang] network-related repeatable 8.0-STABLE hard hang o kern/142774 net Problem with outgoing connections on interface with mu o kern/142772 net [libc] lla_lookup: new lle malloc failed o kern/142018 net [iwi] [patch] Possibly wrong interpretation of beacon- o kern/141861 net [wi] data garbled with WEP and wi(4) with Prism 2.5 f kern/141741 net Etherlink III NIC won't work after upgrade to FBSD 8, o kern/141023 net [carp] CARP arp replays with wrong src mac o kern/140796 net [ath] [panic] Cannot attach (unable to attach hardware o kern/140742 net rum(4) Two asus-WL167G adapters cannot talk to each ot o kern/140682 net [netgraph] [panic] random panic in netgraph o kern/140634 net [vlan] destroying if_lagg interface with if_vlan membe o kern/140619 net [ifnet] [patch] refine obsolete if_var.h comments desc o kern/140346 net [wlan] High bandwidth use causes loss of wlan connecti o kern/140142 net [ip6] [panic] FreeBSD 7.2-amd64 panic w/IPv6 o kern/140066 net [bwi] install report for 8.0 RC 2 (multiple problems) o kern/139565 net [ipfilter] ipfilter ioctl SIOCDELST broken o kern/139387 net [ipsec] Wrong lenth of PF_KEY messages in promiscuous o bin/139346 net [patch] arp(8) add option to remove static entries lis o kern/139268 net [if_bridge] [patch] allow if_bridge to forward just VL p kern/139204 net [arp] DHCP server replies rejected, ARP entry lost bef o kern/139117 net [lagg] + wlan boot timing (EBUSY) o kern/139058 net [ipfilter] mbuf cluster leak on FreeBSD 7.2 o kern/138850 net [dummynet] dummynet doesn't work correctly on a bridge o kern/138782 net [panic] sbflush_internal: cc 0 || mb 0xffffff004127b00 o kern/138688 net [rum] possibly broken on 8 Beta 4 amd64: able to wpa a o kern/138678 net [lo] FreeBSD does not assign linklocal address to loop o kern/138620 net [lagg] [patch] lagg port bpf-writes blocked o kern/138407 net [gre] gre(4) interface does not come up after reboot o kern/138332 net [tun] [lor] ifconfig tun0 destroy causes LOR if_adata/ o kern/138266 net [panic] kernel panic when udp benchmark test used as r o kern/138177 net [ipfilter] FreeBSD crashing repeatedly in ip_nat.c:257 o kern/137881 net [netgraph] [panic] ng_pppoe fatal trap 12 o bin/137841 net [patch] wpa_supplicant(8) cannot verify SHA256 signed p kern/137776 net [rum] panic in rum(4) driver on 8.0-BETA2 o bin/137641 net ifconfig(8): various problems with "vlan_device.vlan_i o kern/137392 net [ip] [panic] crash in ip_nat.c line 2577 o kern/137372 net [ral] FreeBSD doesn't support wireless interface from o kern/137089 net [lagg] lagg falsely triggers IPv6 duplicate address de o bin/136994 net [patch] ifconfig(8) print carp mac address o kern/136911 net [netgraph] [panic] system panic on kldload ng_bpf.ko t o bin/136661 net [patch] ndp(8) ignores -f option o kern/136618 net [pf][stf] panic on cloning interface without unit numb o kern/136426 net [panic] spawning several dhclients in parallel panics o kern/135502 net [periodic] Warning message raised by rtfree function i o kern/134931 net [route] Route messages sent to all socket listeners re o kern/134583 net [hang] Machine with jail freezes after random amount o o kern/134531 net [route] [panic] kernel crash related to routes/zebra o kern/134157 net [dummynet] dummynet loads cpu for 100% and make a syst o kern/133969 net [dummynet] [panic] Fatal trap 12: page fault while in o kern/133968 net [dummynet] [panic] dummynet kernel panic o kern/133736 net [udp] ip_id not protected ... o kern/133595 net [panic] Kernel Panic at pcpu.h:195 o kern/133572 net [ppp] [hang] incoming PPTP connection hangs the system o kern/133490 net [bpf] [panic] 'kmem_map too small' panic on Dell r900 o kern/133235 net [netinet] [patch] Process SIOCDLIFADDR command incorre o kern/133218 net [carp] [hang] use of carp(4) causes system to freeze f kern/133213 net arp and sshd errors on 7.1-PRERELEASE o kern/133060 net [ipsec] [pfsync] [panic] Kernel panic with ipsec + pfs o kern/132889 net [ndis] [panic] NDIS kernel crash on load BCM4321 AGN d o conf/132851 net [patch] rc.conf(5): allow to setfib(1) for service run o kern/132734 net [ifmib] [panic] panic in net/if_mib.c o kern/132705 net [libwrap] [patch] libwrap - infinite loop if hosts.all o kern/132672 net [ndis] [panic] ndis with rt2860.sys causes kernel pani o kern/132554 net [ipl] There is no ippool start script/ipfilter magic t o kern/132354 net [nat] Getting some packages to ipnat(8) causes crash o kern/132285 net [carp] alias gives incorrect hash in dmesg o kern/132277 net [crypto] [ipsec] poor performance using cryptodevice f o kern/132107 net [carp] carp(4) advskew setting ignored when carp IP us o kern/131781 net [ndis] ndis keeps dropping the link o kern/131776 net [wi] driver fails to init o kern/131753 net [altq] [panic] kernel panic in hfsc_dequeue o bin/131567 net [socket] [patch] Update for regression/sockets/unix_cm o bin/131365 net route(8): route add changes interpretation of network f kern/130820 net [ndis] wpa_supplicant(8) returns 'no space on device' o kern/130628 net [nfs] NFS / rpc.lockd deadlock on 7.1-R o conf/130555 net [rc.d] [patch] No good way to set ipfilter variables a o kern/130525 net [ndis] [panic] 64 bit ar5008 ndisgen-erated driver cau o kern/130311 net [wlan_xauth] [panic] hostapd restart causing kernel pa o kern/130109 net [ipfw] Can not set fib for packets originated from loc f kern/130059 net [panic] Leaking 50k mbufs/hour f kern/129719 net [nfs] [panic] Panic during shutdown, tcp_ctloutput: in o kern/129517 net [ipsec] [panic] double fault / stack overflow o kern/129508 net [carp] [panic] Kernel panic with EtherIP (may be relat o kern/129219 net [ppp] Kernel panic when using kernel mode ppp o kern/129197 net [panic] 7.0 IP stack related panic o bin/128954 net ifconfig(8) deletes valid routes o bin/128602 net [an] wpa_supplicant(8) crashes with an(4) o kern/128448 net [nfs] 6.4-RC1 Boot Fails if NFS Hostname cannot be res o conf/128334 net [request] use wpa_cli in the "WPA DHCP" situation o bin/128295 net [patch] ifconfig(8) does not print TOE4 or TOE6 capabi o bin/128001 net wpa_supplicant(8), wlan(4), and wi(4) issues o kern/127826 net [iwi] iwi0 driver has reduced performance and connecti o kern/127815 net [gif] [patch] if_gif does not set vlan attributes from o kern/127724 net [rtalloc] rtfree: 0xc5a8f870 has 1 refs f bin/127719 net [arp] arp: Segmentation fault (core dumped) f kern/127528 net [icmp]: icmp socket receives icmp replies not owned by o bin/127192 net routed(8) removes the secondary alias IP of interface f kern/127145 net [wi]: prism (wi) driver crash at bigger traffic o kern/127057 net [udp] Unable to send UDP packet via IPv6 socket to IPv o kern/127050 net [carp] ipv6 does not work on carp interfaces [regressi o kern/126945 net [carp] CARP interface destruction with ifconfig destro o kern/126895 net [patch] [ral] Add antenna selection (marked as TBD) o kern/126874 net [vlan]: Zebra problem if ifconfig vlanX destroy o kern/126714 net [carp] CARP interface renaming makes system no longer o kern/126695 net rtfree messages and network disruption upon use of if_ o kern/126339 net [ipw] ipw driver drops the connection o kern/126075 net [inet] [patch] internet control accesses beyond end of o bin/125922 net [patch] Deadlock in arp(8) o kern/125920 net [arp] Kernel Routing Table loses Ethernet Link status o kern/125845 net [netinet] [patch] tcp_lro_rx() should make use of hard o kern/125816 net [carp] [if_bridge] carp stuck in init when using bridg o kern/125617 net [ath] [panic] ath(4) related panic o kern/125501 net [ath] atheros cardbus driver hangs f kern/125442 net [carp] [lagg] CARP combined with LAGG causes system pa o kern/125258 net [socket] socket's SO_REUSEADDR option does not work o kern/125239 net [gre] kernel crash when using gre o kern/124341 net [ral] promiscuous mode for wireless device ral0 looses o kern/124225 net [ndis] [patch] ndis network driver sometimes loses net o kern/124160 net [libc] connect(2) function loops indefinitely o kern/124021 net [ip6] [panic] page fault in nd6_output() o kern/123968 net [rum] [panic] rum driver causes kernel panic with WPA. o kern/123892 net [tap] [patch] No buffer space available o kern/123890 net [ppp] [panic] crash & reboot on work with PPP low-spee o kern/123858 net [stf] [patch] stf not usable behind a NAT o kern/123796 net [ipf] FreeBSD 6.1+VPN+ipnat+ipf: port mapping does not o kern/123758 net [panic] panic while restarting net/freenet6 o bin/123633 net ifconfig(8) doesn't set inet and ether address in one o kern/123559 net [iwi] iwi periodically disassociates/associates [regre o bin/123465 net [ip6] route(8): route add -inet6 -interfac o kern/123463 net [ipsec] [panic] repeatable crash related to ipsec-tool o conf/123330 net [nsswitch.conf] Enabling samba wins in nsswitch.conf c o kern/123160 net [ip] Panic and reboot at sysctl kern.polling.enable=0 f kern/123045 net [ng_mppc] ng_mppc_decompress - disabling node o kern/122989 net [swi] [panic] 6.3 kernel panic in swi1: net o kern/122954 net [lagg] IPv6 EUI64 incorrectly chosen for lagg devices f kern/122780 net [lagg] tcpdump on lagg interface during high pps wedge o kern/122685 net It is not visible passing packets in tcpdump(1) o kern/122319 net [wi] imposible to enable ad-hoc demo mode with Orinoco o kern/122290 net [netgraph] [panic] Netgraph related "kmem_map too smal o kern/122033 net [ral] [lor] Lock order reversal in ral0 at bootup ieee o bin/121895 net [patch] rtsol(8)/rtsold(8) doesn't handle managed netw s kern/121774 net [swi] [panic] 6.3 kernel panic in swi1: net o kern/121555 net [panic] Fatal trap 12: current process = 12 (swi1: net o kern/121443 net [gif] [lor] icmp6_input/nd6_lookup o kern/121437 net [vlan] Routing to layer-2 address does not work on VLA o bin/121359 net [patch] [security] ppp(8): fix local stack overflow in o kern/121257 net [tcp] TSO + natd -> slow outgoing tcp traffic o kern/121181 net [panic] Fatal trap 3: breakpoint instruction fault whi o kern/120966 net [rum] kernel panic with if_rum and WPA encryption p docs/120945 net [patch] ip6(4) man page lacks documentation for TCLASS o kern/120566 net [request]: ifconfig(8) make order of arguments more fr o kern/120304 net [netgraph] [patch] netgraph source assumes 32-bit time o kern/120266 net [udp] [panic] gnugk causes kernel panic when closing U o kern/120130 net [carp] [panic] carp causes kernel panics in any conste o bin/120060 net routed(8) deletes link-level routes in the presence of o kern/119945 net [rum] [panic] rum device in hostap mode, cause kernel o kern/119791 net [nfs] UDP NFS mount of aliased IP addresses from a Sol o kern/119617 net [nfs] nfs error on wpa network when reseting/shutdown f kern/119516 net [ip6] [panic] _mtx_lock_sleep: recursed on non-recursi o kern/119432 net [arp] route add -host -iface causes arp e o kern/119225 net [wi] 7.0-RC1 no carrier with Prism 2.5 wifi card [regr o kern/118727 net [netgraph] [patch] [request] add new ng_pf module o kern/117448 net [carp] 6.2 kernel crash [regression] o kern/117423 net [vlan] Duplicate IP on different interfaces o bin/117339 net [patch] route(8): loading routing management commands o kern/117271 net [tap] OpenVPN TAP uses 99% CPU on releng_6 when if_tap o bin/116643 net [patch] [request] fstat(1): add INET/INET6 socket deta o kern/116185 net [iwi] if_iwi driver leads system to reboot o kern/115239 net [ipnat] panic with 'kmem_map too small' using ipnat o kern/115019 net [netgraph] ng_ether upper hook packet flow stops on ad o kern/115002 net [wi] if_wi timeout. failed allocation (busy bit). ifco o kern/114915 net [patch] [pcn] pcn (sys/pci/if_pcn.c) ethernet driver f o kern/113432 net [ucom] WARNING: attempt to net_add_domain(netgraph) af o kern/112722 net [ipsec] [udp] IP v4 udp fragmented packet reject o kern/112686 net [patm] patm driver freezes System (FreeBSD 6.2-p4) i38 o bin/112557 net [patch] ppp(8) lock file should not use symlink name o kern/112528 net [nfs] NFS over TCP under load hangs with "impossible p o kern/111457 net [ral] ral(4) freeze o kern/109470 net [wi] Orinoco Classic Gold PC Card Can't Channel Hop o kern/109308 net [pppd] [panic] Multiple panics kernel ppp suspected [r o bin/108895 net pppd(8): PPPoE dead connections on 6.2 [regression] o kern/107944 net [wi] [patch] Forget to unlock mutex-locks o conf/107035 net [patch] bridge(8): bridge interface given in rc.conf n o kern/106444 net [netgraph] [panic] Kernel Panic on Binding to an ip to o kern/106438 net [ipf] ipfilter: keep state does not seem to allow repl o kern/106316 net [dummynet] dummynet with multipass ipfw drops packets o kern/105945 net Address can disappear from network interface s kern/105943 net Network stack may modify read-only mbuf chain copies o bin/105925 net problems with ifconfig(8) and vlan(4) [regression] o kern/104851 net [inet6] [patch] On link routes not configured when usi o kern/104751 net [netgraph] kernel panic, when getting info about my tr o kern/103191 net Unpredictable reboot o kern/103135 net [ipsec] ipsec with ipfw divert (not NAT) encodes a pac o kern/102540 net [netgraph] [patch] supporting vlan(4) by ng_fec(4) o conf/102502 net [netgraph] [patch] ifconfig name does't rename netgrap o kern/102035 net [plip] plip networking disables parallel port printing o kern/101948 net [ipf] [panic] Kernel Panic Trap No 12 Page Fault - cau o kern/100709 net [libc] getaddrinfo(3) should return TTL info o kern/100519 net [netisr] suggestion to fix suboptimal network polling o kern/98978 net [ipf] [patch] ipfilter drops OOW packets under 6.1-Rel o kern/98597 net [inet6] Bug in FreeBSD 6.1 IPv6 link-local DAD procedu o bin/98218 net wpa_supplicant(8) blacklist not working o kern/97306 net [netgraph] NG_L2TP locks after connection with failed o conf/97014 net [gif] gifconfig_gif? in rc.conf does not recognize IPv f kern/96268 net [socket] TCP socket performance drops by 3000% if pack o kern/95519 net [ral] ral0 could not map mbuf o kern/95288 net [pppd] [tty] [panic] if_ppp panic in sys/kern/tty_subr o kern/95277 net [netinet] [patch] IP Encapsulation mask_match() return o kern/95267 net packet drops periodically appear f kern/93378 net [tcp] Slow data transfer in Postfix and Cyrus IMAP (wo o kern/93019 net [ppp] ppp and tunX problems: no traffic after restarti o kern/92880 net [libc] [patch] almost rewritten inet_network(3) functi s kern/92279 net [dc] Core faults everytime I reboot, possible NIC issu o kern/91859 net [ndis] if_ndis does not work with Asus WL-138 s kern/91777 net [ipf] [patch] wrong behaviour with skip rule inside an o kern/91364 net [ral] [wep] WF-511 RT2500 Card PCI and WEP o kern/91311 net [aue] aue interface hanging s kern/90086 net [hang] 5.4p8 on supermicro P8SCT hangs during boot if o kern/87521 net [ipf] [panic] using ipfilter "auth" keyword leads to k o kern/87421 net [netgraph] [panic]: ng_ether + ng_eiface + if_bridge s kern/86920 net [ndis] ifconfig: SIOCS80211: Invalid argument [regress o kern/86871 net [tcp] [patch] allocation logic for PCBs in TIME_WAIT s o kern/86427 net [lor] Deadlock with FASTIPSEC and nat o kern/86103 net [ipf] Illegal NAT Traversal in IPFilter o kern/85780 net 'panic: bogus refcnt 0' in routing/ipv6 o bin/85445 net ifconfig(8): deprecated keyword to ifconfig inoperativ p kern/85320 net [gre] [patch] possible depletion of kernel stack in ip o bin/82975 net route change does not parse classfull network as given o kern/82881 net [netgraph] [panic] ng_fec(4) causes kernel panic after o bin/82185 net [patch] ndp(8) can delete the incorrect entry o kern/81095 net IPsec connection stops working if associated network i o kern/79895 net [ipf] 5.4-RC2 breaks ipfilter NAT when using netgraph o kern/78968 net FreeBSD freezes on mbufs exhaustion (network interface o kern/78090 net [ipf] ipf filtering on bridged packets doesn't work if o kern/77341 net [ip6] problems with IPV6 implementation o kern/77273 net [ipf] ipfilter breaks ipv6 statefull filtering on 5.3 s kern/77195 net [ipf] [patch] ipfilter ioctl SIOCGNATL does not match o kern/75873 net Usability problem with non-RFC-compliant IP spoof prot s kern/75407 net [an] an(4): no carrier after short time a kern/71474 net [route] route lookup does not skip interfaces marked d o kern/71469 net default route to internet magically disappears with mu o kern/70904 net [ipf] ipfilter ipnat problem with h323 proxy support o kern/66225 net [netgraph] [patch] extend ng_eiface(4) control message o kern/65616 net IPSEC can't detunnel GRE packets after real ESP encryp s kern/60293 net [patch] FreeBSD arp poison patch a kern/56233 net IPsec tunnel (ESP) over IPv6: MTU computation is wrong o kern/54383 net [nfs] [patch] NFS root configurations without dynamic s bin/41647 net ifconfig(8) doesn't accept lladdr along with inet addr s kern/39937 net ipstealth issue a kern/38554 net [patch] changing interface ipaddress doesn't seem to w o kern/34665 net [ipf] [hang] ipfilter rcmd proxy "hangs". o kern/31647 net [libc] socket calls can return undocumented EINVAL o kern/30186 net [libc] getaddrinfo(3) does not handle incorrect servna o kern/27474 net [ipf] [ppp] Interactive use of user PPP and ipfilter c o conf/23063 net [arp] [patch] for static ARP tables in rc.network 361 problems total. From owner-freebsd-net@FreeBSD.ORG Mon May 2 12:10:54 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6043A106564A for ; Mon, 2 May 2011 12:10:54 +0000 (UTC) (envelope-from gpalmer@freebsd.org) Received: from noop.in-addr.com (mail.in-addr.com [IPv6:2001:470:8:162::1]) by mx1.freebsd.org (Postfix) with ESMTP id 34D168FC0A for ; Mon, 2 May 2011 12:10:54 +0000 (UTC) Received: from gjp by noop.in-addr.com with local (Exim 4.74 (FreeBSD)) (envelope-from ) id 1QGrxi-0004qJ-On; Mon, 02 May 2011 08:10:50 -0400 Date: Mon, 2 May 2011 08:10:50 -0400 From: Gary Palmer To: "Marc G. Fournier" Message-ID: <20110502121050.GD73035@in-addr.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: gpalmer@freebsd.org X-SA-Exim-Scanned: No (on noop.in-addr.com); SAEximRunCond expanded to false Cc: freebsd-net@freebsd.org Subject: Re: SNMP Network Auto Discovery software ... ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 12:10:54 -0000 On Wed, Apr 27, 2011 at 03:55:11PM -0300, Marc G. Fournier wrote: > > Would like to find something that runs on FreeBSD that I can use to map > our network, preferrably dumping to a database, and grabbing > information like: interface / ip / cpus / hostname, etc ... > > Server needs to run on FreeBSD ... needs to be able to commuicate, via > SNMP, with Windows, Cisco, Linux, FreeBSD, NetApp Filers, etc ... > > Would like it to be able to generate an overall map of our network, but, > also, be able to use it as a basis for keeping stuff liek nagios / cacti > up to date ... > > Web based interface into the database would be nice ... > > Is there anything like this available that runs on FreeBSD that ppl are > happily using? net-mgmt/scotty3 in ports used to have a network discovery mode. Haven't used it in years but it may be worth a look. Gary From owner-freebsd-net@FreeBSD.ORG Mon May 2 12:29:22 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38898106566C for ; Mon, 2 May 2011 12:29:22 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B6D008FC08 for ; Mon, 2 May 2011 12:29:21 +0000 (UTC) Received: by bwz12 with SMTP id 12so6576702bwz.13 for ; Mon, 02 May 2011 05:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8MmPxk5lrI7FnNdk6Mv9kUfwrem3lGTaBf+pKz4lL1k=; b=okRmR7gz1sHdjPrn3b0YgfMau+KgvMp5Q0Q62fRYATsreCXiT8J8s9YmIIFff6tFhw CW+C6TUS2PGFardB/8fuJMPkujGail8CSXM2blNfqZmwb4mx/LZrzbwYSSVlbMC8Yu/y zEwZ0auUpG61l2CzdcN1RI1TONSJmi2Pi7jZc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=NN47YVktkPHD6P2gS7ySS4Vz7N+4RJROZpXjzOoN5c82q3C4aT3xxqedRHcNLDoZPx Tm/B2i+QkLxGxgSFp8GA34oe4A8j/GrZbltW2FM4MfMzMrJ0XZuM/KakyEpSCAZCa2Tn +/GXPJOgCBimxPKwgHgnM6jccTUDH0ExbiZzI= MIME-Version: 1.0 Received: by 10.223.74.83 with SMTP id t19mr3279106faj.149.1304339360515; Mon, 02 May 2011 05:29:20 -0700 (PDT) Received: by 10.223.20.145 with HTTP; Mon, 2 May 2011 05:29:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 May 2011 07:29:20 -0500 Message-ID: From: Adam Vande More To: "Marc G. Fournier" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: SNMP Network Auto Discovery software ... ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 12:29:22 -0000 On Wed, Apr 27, 2011 at 1:55 PM, Marc G. Fournier wrote: > > Would like to find something that runs on FreeBSD that I can use to map our > network, preferrably dumping to a database, and grabbing information like: > interface / ip / cpus / hostname, etc ... > > Server needs to run on FreeBSD ... needs to be able to commuicate, via > SNMP, with Windows, Cisco, Linux, FreeBSD, NetApp Filers, etc ... > > Would like it to be able to generate an overall map of our network, but, > also, be able to use it as a basis for keeping stuff liek nagios / cacti up > to date ... > > Web based interface into the database would be nice ... > > Is there anything like this available that runs on FreeBSD that ppl are > happily using? > I've used OpenNMS and zabbix on FreeBSD servers. I liked the OpenNMS interface(restful) better than zabbix for several reasons, but ultimately the fact it's java based and resource intensive required me to go with zabbix. Zabbix is good too, except for some annoying, non-critical interface bugs. -- Adam Vande More From owner-freebsd-net@FreeBSD.ORG Mon May 2 13:21:57 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B516E106566B for ; Mon, 2 May 2011 13:21:57 +0000 (UTC) (envelope-from scrappy@hub.org) Received: from hub.org (hub.org [200.46.204.220]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD338FC19 for ; Mon, 2 May 2011 13:21:57 +0000 (UTC) Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by hub.org (Postfix) with ESMTP id 18D953254338; Mon, 2 May 2011 10:21:55 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 51478-08; Mon, 2 May 2011 13:21:54 +0000 (UTC) Received: by hub.org (Postfix, from userid 1002) id DBF9C3254334; Mon, 2 May 2011 10:21:54 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by hub.org (Postfix) with ESMTP id D56CA3250A9F; Mon, 2 May 2011 10:21:54 -0300 (ADT) Date: Mon, 2 May 2011 10:21:54 -0300 (ADT) From: "Marc G. Fournier" To: Gary Palmer In-Reply-To: <20110502121050.GD73035@in-addr.com> Message-ID: References: <20110502121050.GD73035@in-addr.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: SNMP Network Auto Discovery software ... ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 13:21:57 -0000 Nailed it, thank you ... I've used this one in the past, and it was fantastic then .. .couldn't recall the name, and when I did a 'grep -i snmp' in the descr files under net-mgmt, wasn't finding that one :( Thx ... On Mon, 2 May 2011, Gary Palmer wrote: > On Wed, Apr 27, 2011 at 03:55:11PM -0300, Marc G. Fournier wrote: >> >> Would like to find something that runs on FreeBSD that I can use to map >> our network, preferrably dumping to a database, and grabbing >> information like: interface / ip / cpus / hostname, etc ... >> >> Server needs to run on FreeBSD ... needs to be able to commuicate, via >> SNMP, with Windows, Cisco, Linux, FreeBSD, NetApp Filers, etc ... >> >> Would like it to be able to generate an overall map of our network, but, >> also, be able to use it as a basis for keeping stuff liek nagios / cacti >> up to date ... >> >> Web based interface into the database would be nice ... >> >> Is there anything like this available that runs on FreeBSD that ppl are >> happily using? > > > net-mgmt/scotty3 in ports used to have a network discovery mode. Haven't > used it in years but it may be worth a look. > > Gary > ---- Marc G. Fournier Hub.Org Hosting Solutions S.A. scrappy@hub.org http://www.hub.org Yahoo:yscrappy Skype: hub.org ICQ:7615664 MSN:scrappy@hub.org From owner-freebsd-net@FreeBSD.ORG Mon May 2 16:05:43 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AED61106566B for ; Mon, 2 May 2011 16:05:43 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8368FC0A for ; Mon, 2 May 2011 16:05:43 +0000 (UTC) Received: by iwn33 with SMTP id 33so6664317iwn.13 for ; Mon, 02 May 2011 09:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=PYESEjW3x6x6LUxxIht6fAATcsgIEwN8yyFwWtxW7RM=; b=AT3wDHWPwdcSEVqKJnTUxU5z3lJKEZNSEK6vMMASiPZgK42Fpvn3p+S/C+864Wm0nF CyDTyQhQNl7kR2LrRjC+0YC/UJFol7GSsIR2ABBoATnraBA9vt++C1YaP5skta5Z0QVL Jv1/GzprKXBtpzPWauoaQ1vqe/VQ9tpZkidZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rQz+PDqkke1ezjAVECNgezT2d921bc2/AGeqPGFZ5WuhjkakxWo9kVvO5LQ6wAsiIO ydsULzcNFU0CXU+GYtetUxQ59k1kCKEt8RUO5qwwAN+/VFuFNR+SUEy1MBGyiKYvgz3v dHuo3+fVgzMZvdKgqRU8Ahp34xgPByl1xuk0g= MIME-Version: 1.0 Received: by 10.42.139.5 with SMTP id e5mr5990801icu.136.1304352342380; Mon, 02 May 2011 09:05:42 -0700 (PDT) Received: by 10.42.165.132 with HTTP; Mon, 2 May 2011 09:05:42 -0700 (PDT) In-Reply-To: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> Date: Mon, 2 May 2011 12:05:42 -0400 Message-ID: From: Arnaud Lacombe To: "Li, Qing" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: Re: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 16:05:43 -0000 Hi, On Mon, May 2, 2011 at 4:03 AM, Li, Qing wrote: > Please give this patch a try for IPv4 ARP > > http://people.freebsd.org/~qingli/arp2.patch > Your patch works; the manually added address is kept upon a up/down/up transition. However, the interface address is still flush, which I find inconsistent with it being marked 'permanent'. - Arnaud > --Qing > > ________________________________________ > From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] on be= half of Li, Qing > Sent: Monday, May 02, 2011 12:45 AM > To: Arnaud Lacombe > Cc: freebsd-net@freebsd.org; Ingo Flaschberger > Subject: RE: interface ip arp > > Your patch doesn't work because the in_lltable_prefix_free() is =A0a gene= ric function. > > The static entries are kept only when issuing if-down command, however, i= f the interface > address is being removed, permanent static entries are gone and have to b= e reinstalled. > > I already have a working patch for IPv4, just going over the IPv6 code. > > I will post the patch in a few minutes. > > -- Qing > > ________________________________________ > From: Arnaud Lacombe [lacombar@gmail.com] > Sent: Monday, May 02, 2011 12:41 AM > To: Li, Qing > Cc: Ingo Flaschberger; freebsd-net@freebsd.org > Subject: Re: interface ip arp > > Hi, > > On Sun, May 1, 2011 at 10:50 PM, Li, Qing wrote: >> jeez, this bug has been around for quite a while ... >> >> Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch >> > d'oh!... Concerning Ingo's bug, your patch do the job, my report was > bad, 4.9-RELEASE and 7.x show the same behavior: > > # uname -a > FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13 > # ifconfig em0 up 192.168.45.200/24 > # arp -n 192.168.45.200 > ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet] > # ifconfig em0 down > # arp -n 192.168.45.200 > 192.168.45.200 (192.168.45.200) -- no entry > # ifconfig em0 up > # arp -n 192.168.45.200 > 192.168.45.200 (192.168.45.200) -- no entry > > The behavioral change I noticed is that permanent address (manually > added) in the ARP table are flushed along with all other addresses on >>8.x (cf. the script output of my previous mail) while they are kept > in the cache on <7.x during a down/up transition. The following patch: > > diff --git a/sys/netinet/in.c b/sys/netinet/in.c > index 1012012..27e44a2 100644 > --- a/sys/netinet/in.c > +++ b/sys/netinet/in.c > @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt, > > =A0 =A0 =A0 =A0for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH_SAFE(lle, &llt->lle_head[i], = lle_next, next) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lle->la_flags & LLE_STA= TIC) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (IN_ARE_MASKED_ADDR_EQU= AL((struct > sockaddr_in *)L3_ADDR(lle), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pfx, msk)) { > > partially restores the old behavior. Only partially as before 8.x, > interface addresses were not marked as 'permanent'. You could manually > add a 'permanent' entry for this address in such a way it would > survive the down/up transition. In 8.x, the interface address is > marked as 'permanent', but is removed explicitly by arp_ifscrub(). So > even the above change would not work for the interface address. > > Shouldn't this address be removed later when "removing all L2 entries > on the given prefix", in which case it would not have to be re-added > again, if marking it 'permanent' is deliberate ? > > Thanks, > =A0- Arnaud > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Mon May 2 23:01:21 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B616D1065709 for ; Mon, 2 May 2011 23:01:21 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8294B8FC14 for ; Mon, 2 May 2011 23:01:21 +0000 (UTC) Received: by pzk27 with SMTP id 27so4264046pzk.13 for ; Mon, 02 May 2011 16:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=WYBWmcz1WlNOhtMsWoZn6qHji6MX+lRtiQZGQwzgmrE=; b=H560FVCUfAeTiB3RzU7hXwxeOm8DuKmfuZLPVf93D03I2C6C/BsniZlhN9WMJOhOuL kHTD/WS44qSe/ffYzwaP0sAmOrFN10F0E4I2OHS5nOmn3w0li1IQAR4mrbWdT5dmxETf 7OvaUPQO2Uwc/4T/DeY+nZI4FsntveO2fPi7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=OIojTTxvbdFCRAJKEF61hqx0cAmJWGyj/oWq0R6Wu0lpiOiDnld5+PodA+/pkLPd/W bmEcC/kuvJn8pvftVlp8dF/Oa+p8BhwEcnrPHvBstZeqZvkHiFASUc/RUknenNFeU0n9 OBBA9BuIjT0xnSlu9nBnXP5ll4//rNmVua4F8= Received: by 10.68.22.35 with SMTP id a3mr4177484pbf.477.1304377281002; Mon, 02 May 2011 16:01:21 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id s7sm92307pbn.15.2011.05.02.16.01.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2011 16:01:19 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 02 May 2011 16:00:35 -0700 From: YongHyeon PYUN Date: Mon, 2 May 2011 16:00:35 -0700 To: freebsd-net@freebsd.org Message-ID: <20110502230035.GB1655@michelle.cdnetworks.com> References: <201104290001.p3T01EvQ082443@artema.vpn.ibs> <20110429095231.GA17786@relay.ibs.dn.ua> <20110429182807.GA21084@michelle.cdnetworks.com> <20110429184634.GA34176@relay.ibs.dn.ua> <20110429185605.GB21084@michelle.cdnetworks.com> <20110430204339.GA25769@michelle.cdnetworks.com> <20110501154947.GC70166@relay.ibs.dn.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110501154947.GC70166@relay.ibs.dn.ua> User-Agent: Mutt/1.4.2.3i Subject: Re: collisions on tun interfaces ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 23:01:21 -0000 On Sun, May 01, 2011 at 06:49:47PM +0300, Zeus V Panchenko wrote: > Adrian Chadd (adrian@freebsd.org) [11.05.01 09:09] wrote: > > On 1 May 2011 04:43, YongHyeon PYUN wrote: > > > > > It's tunable. Set net.link.ifqmaxlen. > > > > I know it's tunable at boot time; I mean why is it that low by default? > > > > and what will be acceptable value for ASDL connections 8 and more MBit/s? > Maybe that depends on traffic pattern. I agree default value is too low but I don't know what would be best default value since I don't have experimentation data. Note, most non-pseudo drivers do not rely on the tunable. From owner-freebsd-net@FreeBSD.ORG Mon May 2 23:02:54 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31567106566B for ; Mon, 2 May 2011 23:02:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id 019598FC08 for ; Mon, 2 May 2011 23:02:53 +0000 (UTC) Received: by pxi11 with SMTP id 11so2454577pxi.35 for ; Mon, 02 May 2011 16:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=K4X2eruOyYkDBNXkRlTJl5i0hxdk71BlCdV69AGErsc=; b=ucQOjF/fiCYHz2YmEHnWZJUhWoQ6iJhYu1GMwx3L0p3lplAqkfFz+YMkjRmixWavwc +xeWZ45UkrmOiZGaESkDDXix6jIBSlksbvL3miV6lKcJ57KwJHLGglIoLBBM3GhM4pYw Tp5Cvq9JfF3YF/0HXIgCiIwh1+vUdr2g0IMyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=i77vwZf/o1c/EVfsm4q6MT+0pMUZMHy1C8Pm72GV/BBSj+zyYK5C9HkV5ijdOwkF+V zcE+in9pmhneNRZD+xAKtml5kGUZYMkHzSH9hfwM5td9hEJflUd7ZqljQ6+aJADS78Uk q74+k/bcCKOojPcpNX5jyMJiWYya2mk+o/Ljw= Received: by 10.143.26.8 with SMTP id d8mr3278765wfj.343.1304377373306; Mon, 02 May 2011 16:02:53 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id p40sm1120438wfc.7.2011.05.02.16.02.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2011 16:02:52 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 02 May 2011 16:02:08 -0700 From: YongHyeon PYUN Date: Mon, 2 May 2011 16:02:08 -0700 To: freebsd-net@freebsd.org Message-ID: <20110502230208.GC1655@michelle.cdnetworks.com> References: <201104290001.p3T01EvQ082443@artema.vpn.ibs> <20110429095231.GA17786@relay.ibs.dn.ua> <20110429182807.GA21084@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110429182807.GA21084@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Subject: Re: collisions on tun interfaces ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 23:02:54 -0000 On Fri, Apr 29, 2011 at 11:28:07AM -0700, YongHyeon PYUN wrote: > On Fri, Apr 29, 2011 at 12:52:31PM +0300, Zeus V Panchenko wrote: > > Hi, > > > > may somebody epxplain it for me, what can cause collisions on tun > > interfaces created by ppp(8) and openvpn? > > > > > uname -a > > FreeBSD 8.2-STABLE #0 i386 > > > > > netstat -i > > Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll > > tun0 1492 18940349 0 0 15737760 0 45668 > > tun0 1492 A.B.C.D A-B-C-D.domain 15623965 - - 12429351 - - > > tun1 1500 12721670 0 0 9957662 0 11161 > > tun1 1500 E.F.G.H E-F-G-H.vpn 6454 - - 445751 - - > > > > > > rl0: flags=8843 metric 0 mtu 1500 > > options=3808 > > ether 00:30:4f:67:cf:81 > > media: Ethernet autoselect (100baseTX ) > > status: active > > tun0: flags=8051 metric 0 mtu 1492 > > options=80000 > > inet A.B.C.D --> A1.B1.C1.D1 netmask 0xffffffff > > Opened by PID 3943 > > tun1: flags=8051 metric 0 mtu 1500 > > options=80000 > > inet E.F.G.H --> E1.F1.G1.H1 netmask 0xffffffff > > Opened by PID 1387 > > > > tun0 is created by ppp(8) > > > > in /etc/ppp.conf is: > > default: > > set log Phase Chat LCP IPCP CCP tun command > > set server /var/run/ppp/internet "" 0177 > > set device PPPoE:rl0 > > set speed sync > > enable lqr echo > > set lqrperiod 30 > > set login > > set ctsrts off > > add default HISADDR > > set timeout 0 > > set redial 0 0 > > set cd 5 > > > > tun1 is created by OpenVPN with configuration: > > client > > dev tun1 > > proto udp > > ... > > > > so, what can cause the collisions and can i fix them? > > > > It seems tun(4) just increments collision counter whenever it > can't enqueue packet. Because it's not collision at all I think > it's a bug that had been there from day 1. Just nuking updating the > counter will address the issue. You still can get the previous > collision counter of tun(4) with d option of netstat which shows > number of packets dropped due to send queue full. If there is no objection, I'll commit it in this week. From owner-freebsd-net@FreeBSD.ORG Mon May 2 23:21:12 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62CAD106567E for ; Mon, 2 May 2011 23:21:12 +0000 (UTC) (envelope-from if@xip.at) Received: from chile.gbit.at (ns1.xip.at [193.239.188.99]) by mx1.freebsd.org (Postfix) with ESMTP id A2FF18FC26 for ; Mon, 2 May 2011 23:21:10 +0000 (UTC) Received: (qmail 18175 invoked from network); 3 May 2011 01:21:09 +0200 Received: from unknown (HELO filebunker.xip.at) (89.207.145.147) by chile.gbit.at with (DHE-RSA-AES256-SHA encrypted) SMTP; 3 May 2011 01:21:09 +0200 Date: Tue, 3 May 2011 01:21:08 +0200 (CEST) From: Ingo Flaschberger To: YongHyeon PYUN In-Reply-To: <20110502230035.GB1655@michelle.cdnetworks.com> Message-ID: References: <201104290001.p3T01EvQ082443@artema.vpn.ibs> <20110429095231.GA17786@relay.ibs.dn.ua> <20110429182807.GA21084@michelle.cdnetworks.com> <20110429184634.GA34176@relay.ibs.dn.ua> <20110429185605.GB21084@michelle.cdnetworks.com> <20110430204339.GA25769@michelle.cdnetworks.com> <20110501154947.GC70166@relay.ibs.dn.ua> <20110502230035.GB1655@michelle.cdnetworks.com> User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: collisions on tun interfaces ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 23:21:12 -0000 >>>> It's tunable. Set net.link.ifqmaxlen. >>> >>> I know it's tunable at boot time; I mean why is it that low by default? >>> >> >> and what will be acceptable value for ASDL connections 8 and more MBit/s? >> > > Maybe that depends on traffic pattern. I agree default value is too > low but I don't know what would be best default value since I don't > have experimentation data. Note, most non-pseudo drivers do not > rely on the tunable. perhaps to mention the net.link.ifqmaxlen tuneable and symptoms at tun manpage? Kind regards, Ingo Flaschberger From owner-freebsd-net@FreeBSD.ORG Tue May 3 06:12:32 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A351065677; Tue, 3 May 2011 06:12:32 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7B98FC14; Tue, 3 May 2011 06:12:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p436CVmI083615; Tue, 3 May 2011 06:12:31 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p436CV2r083611; Tue, 3 May 2011 06:12:31 GMT (envelope-from linimon) Date: Tue, 3 May 2011 06:12:31 GMT Message-Id: <201105030612.p436CV2r083611@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-net@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 06:12:32 -0000 Old Synopsis: em0 fails to init on CURRENT after March 17 New Synopsis: [em] em0 fails to init on CURRENT after March 17 Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Tue May 3 06:12:14 UTC 2011 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=156667 From owner-freebsd-net@FreeBSD.ORG Tue May 3 06:51:07 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976221065675; Tue, 3 May 2011 06:51:07 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6DC1F8FC19; Tue, 3 May 2011 06:51:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p436p75D024461; Tue, 3 May 2011 06:51:07 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p436p7ri024452; Tue, 3 May 2011 06:51:07 GMT (envelope-from linimon) Date: Tue, 3 May 2011 06:51:07 GMT Message-Id: <201105030651.p436p7ri024452@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-net@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/156770: [ipfw] [dummynet] [patch]: performance improvement and several extensions X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 06:51:07 -0000 Old Synopsis: ipfw/dummynet: performance improvement and several extensions New Synopsis: [ipfw] [dummynet] [patch]: performance improvement and several extensions Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Tue May 3 06:50:31 UTC 2011 Responsible-Changed-Why: reclassify. http://www.freebsd.org/cgi/query-pr.cgi?pr=156770 From owner-freebsd-net@FreeBSD.ORG Tue May 3 11:44:28 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D22106566C; Tue, 3 May 2011 11:44:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AAB1D8FC1A; Tue, 3 May 2011 11:44:28 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p43BiSga023555; Tue, 3 May 2011 11:44:28 GMT (envelope-from ae@freefall.freebsd.org) Received: (from ae@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p43BiSAX023551; Tue, 3 May 2011 11:44:28 GMT (envelope-from ae) Date: Tue, 3 May 2011 11:44:28 GMT Message-Id: <201105031144.p43BiSAX023551@freefall.freebsd.org> To: ae@FreeBSD.org, freebsd-net@FreeBSD.org, freebsd-ipfw@FreeBSD.org From: ae@FreeBSD.org Cc: Subject: Re: kern/156770: [ipfw] [dummynet] [patch]: performance improvement and several extensions X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 11:44:28 -0000 Synopsis: [ipfw] [dummynet] [patch]: performance improvement and several extensions Responsible-Changed-From-To: freebsd-net->freebsd-ipfw Responsible-Changed-By: ae Responsible-Changed-When: Tue May 3 11:42:34 UTC 2011 Responsible-Changed-Why: Seems it is related to ipfw. http://www.freebsd.org/cgi/query-pr.cgi?pr=156770 From owner-freebsd-net@FreeBSD.ORG Tue May 3 16:30:14 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77567106564A for ; Tue, 3 May 2011 16:30:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB378FC08 for ; Tue, 3 May 2011 16:30:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p43GUESS077410 for ; Tue, 3 May 2011 16:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p43GUEDP077405; Tue, 3 May 2011 16:30:14 GMT (envelope-from gnats) Date: Tue, 3 May 2011 16:30:14 GMT Message-Id: <201105031630.p43GUEDP077405@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Arnaud Lacombe Cc: Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Arnaud Lacombe List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 16:30:14 -0000 The following reply was made to PR kern/156667; it has been noted by GNATS. From: Arnaud Lacombe To: bug-followup@FreeBSD.org, marcus@blazingdot.com Cc: Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 Date: Tue, 3 May 2011 12:22:47 -0400 could you include the output of `netstat -m' ? it is all likely to be yet another "`nmbclusterrs' too low issue", in which case bumping `kern.ipc.nmbclusters' will do the job. From owner-freebsd-net@FreeBSD.ORG Tue May 3 17:40:16 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7441510656A6 for ; Tue, 3 May 2011 17:40:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 624108FC1E for ; Tue, 3 May 2011 17:40:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p43HeGmT042795 for ; Tue, 3 May 2011 17:40:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p43HeGiI042793; Tue, 3 May 2011 17:40:16 GMT (envelope-from gnats) Date: Tue, 3 May 2011 17:40:16 GMT Message-Id: <201105031740.p43HeGiI042793@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/149306: commit references a PR X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 17:40:16 -0000 The following reply was made to PR kern/149306; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/149306: commit references a PR Date: Tue, 3 May 2011 17:37:34 +0000 (UTC) Author: jhb Date: Tue May 3 17:37:24 2011 New Revision: 221393 URL: http://svn.freebsd.org/changeset/base/221393 Log: Reimplement how PCI-PCI bridges manage their I/O windows. Previously the driver would verify that requests for child devices were confined to any existing I/O windows, but the driver relied on the firmware to initialize the windows and would never grow the windows for new requests. Now the driver actively manages the I/O windows. This is implemented by allocating a bus resource for each I/O window from the parent PCI bus and suballocating that resource to child devices. The suballocations are managed by creating an rman for each I/O window. The suballocated resources are mapped by passing the bus_activate_resource() call up to the parent PCI bus. Windows are grown when needed by using bus_adjust_resource() to adjust the resource allocated from the parent PCI bus. If the adjust request succeeds, the window is adjusted and the suballocation request for the child device is retried. When growing a window, the rman_first_free_region() and rman_last_free_region() routines are used to determine if the front or end of the existing I/O window is free. From using that, the smallest ranges that need to be added to either the front or back of the window are computed. The driver will first try to grow the window in whichever direction requires the smallest growth first followed by the other direction if that fails. Subtractive bridges will first attempt to satisfy requests for child resources from I/O windows (including attempts to grow the windows). If that fails, the request is passed up to the parent PCI bus directly however. The PCI-PCI bridge driver will try to use firmware-assigned ranges for child BARs first and only allocate a "fresh" range if that specific range cannot be accommodated in the I/O window. This allows systems where the firmware assigns resources during boot but later wipes the I/O windows (some ACPI BIOSen are known to do this) to "rediscover" the original I/O window ranges. The ACPI Host-PCI bridge driver has been adjusted to correctly honor hw.acpi.host_mem_start and the I/O port equivalent when a PCI-PCI bridge makes a wildcard request for an I/O window range. The new PCI-PCI bridge driver is only enabled if the NEW_PCIB kernel option is enabled. This is a transition aide to allow platforms that do not yet support bus_activate_resource() and bus_adjust_resource() in their Host-PCI bridge drivers (and possibly other drivers as needed) to use the old driver for now. Once all platforms support the new driver, the kernel option and old driver will be removed. PR: kern/143874 kern/149306 Tested by: mav Modified: head/sys/amd64/pci/pci_bus.c head/sys/conf/options head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h head/sys/i386/pci/pci_bus.c head/sys/sparc64/pci/apb.c head/sys/sparc64/pci/ofw_pcib.c head/sys/x86/pci/qpi.c head/sys/x86/x86/mptable_pci.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/amd64/pci/pci_bus.c Tue May 3 17:37:24 2011 (r221393) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 3 16:36:39 2011 (r221392) +++ head/sys/conf/options Tue May 3 17:37:24 2011 (r221393) @@ -136,6 +136,7 @@ MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h MPROF_BUFFERS opt_mprof.h MPROF_HASH_SIZE opt_mprof.h +NEW_PCIB opt_global.h NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NO_ADAPTIVE_SX Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Tue May 3 17:37:24 2011 (r221393) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -370,11 +371,17 @@ acpi_pcib_acpi_alloc_resource(device_t d * Hardcoding like this sucks, so a more MD/MI way needs to be * found to do it. This is typically only used on older laptops * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. + * is likely OK. + * + * PCI-PCI bridges may allocate smaller ranges for their windows, + * but the heuristics here should apply to those, so we allow + * several different end addresses. */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) + if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || + end == 0xffffffff)) start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) + if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || + end == 0xffff || end == 0xffffffff)) start = 0x1000; return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/dev/acpica/acpi_pcib_pci.c Tue May 3 17:37:24 2011 (r221393) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/dev/pci/pci.c Tue May 3 17:37:24 2011 (r221393) @@ -3967,6 +3967,26 @@ pci_alloc_resource(device_t dev, device_ break; case SYS_RES_IOPORT: case SYS_RES_MEMORY: +#ifdef NEW_PCIB + /* + * PCI-PCI bridge I/O window resources are not BARs. + * For those allocations just pass the request up the + * tree. + */ + if (cfg->hdrtype == PCIM_HDRTYPE_BRIDGE) { + switch (*rid) { + case PCIR_IOBASEL_1: + case PCIR_MEMBASE_1: + case PCIR_PMBASEL_1: + /* + * XXX: Should we bother creating a resource + * list entry? + */ + return (bus_generic_alloc_resource(dev, child, + type, rid, start, end, count, flags)); + } + } +#endif /* Reserve resources for this BAR if needed. */ rle = resource_list_find(rl, type, *rid); if (rle == NULL) { Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/dev/pci/pci_pci.c Tue May 3 17:37:24 2011 (r221393) @@ -36,14 +36,16 @@ __FBSDID("$FreeBSD$"); */ #include -#include +#include #include +#include +#include #include -#include -#include #include #include +#include +#include #include #include @@ -73,8 +75,13 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), +#ifdef NEW_PCIB + DEVMETHOD(bus_adjust_resource, pcib_adjust_resource), + DEVMETHOD(bus_release_resource, pcib_release_resource), +#else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), +#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), @@ -100,6 +107,243 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc)); DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0); +#ifdef NEW_PCIB +/* + * XXX Todo: + * - properly handle the ISA enable bit. If it is set, we should change + * the behavior of the I/O window resource and rman to not allocate the + * blocked ranges (upper 768 bytes of each 1K in the first 64k of the + * I/O port address space). + */ + +/* + * Is a resource from a child device sub-allocated from one of our + * resource managers? + */ +static int +pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) +{ + + switch (type) { + case SYS_RES_IOPORT: + return (rman_is_region_manager(r, &sc->io.rman)); + case SYS_RES_MEMORY: + /* Prefetchable resources may live in either memory rman. */ + if (rman_get_flags(r) & RF_PREFETCHABLE && + rman_is_region_manager(r, &sc->pmem.rman)) + return (1); + return (rman_is_region_manager(r, &sc->mem.rman)); + } + return (0); +} + +static int +pcib_is_window_open(struct pcib_window *pw) +{ + + return (pw->valid && pw->base < pw->limit); +} + +/* + * XXX: If RF_ACTIVE did not also imply allocating a bus space tag and + * handle for the resource, we could pass RF_ACTIVE up to the PCI bus + * when allocating the resource windows and rely on the PCI bus driver + * to do this for us. + */ +static void +pcib_activate_window(struct pcib_softc *sc, int type) +{ + + PCI_ENABLE_IO(device_get_parent(sc->dev), sc->dev, type); +} + +static void +pcib_write_windows(struct pcib_softc *sc, int mask) +{ + device_t dev; + uint32_t val; + + dev = sc->dev; + if (sc->io.valid && mask & WIN_IO) { + val = pci_read_config(dev, PCIR_IOBASEL_1, 1); + if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) { + pci_write_config(dev, PCIR_IOBASEH_1, + sc->io.base >> 16, 2); + pci_write_config(dev, PCIR_IOLIMITH_1, + sc->io.limit >> 16, 2); + } + pci_write_config(dev, PCIR_IOBASEL_1, sc->io.base >> 8, 1); + pci_write_config(dev, PCIR_IOLIMITL_1, sc->io.limit >> 8, 1); + } + + if (mask & WIN_MEM) { + pci_write_config(dev, PCIR_MEMBASE_1, sc->mem.base >> 16, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, sc->mem.limit >> 16, 2); + } + + if (sc->pmem.valid && mask & WIN_PMEM) { + val = pci_read_config(dev, PCIR_PMBASEL_1, 2); + if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) { + pci_write_config(dev, PCIR_PMBASEH_1, + sc->pmem.base >> 32, 4); + pci_write_config(dev, PCIR_PMLIMITH_1, + sc->pmem.limit >> 32, 4); + } + pci_write_config(dev, PCIR_PMBASEL_1, sc->pmem.base >> 16, 2); + pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmem.limit >> 16, 2); + } +} + +static void +pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, + int flags, pci_addr_t max_address) +{ + char buf[64]; + int error, rid; + + if (max_address != (u_long)max_address) + max_address = ~0ul; + w->rman.rm_start = 0; + w->rman.rm_end = max_address; + w->rman.rm_type = RMAN_ARRAY; + snprintf(buf, sizeof(buf), "%s %s window", + device_get_nameunit(sc->dev), w->name); + w->rman.rm_descr = strdup(buf, M_DEVBUF); + error = rman_init(&w->rman); + if (error) + panic("Failed to initialize %s %s rman", + device_get_nameunit(sc->dev), w->name); + + if (!pcib_is_window_open(w)) + return; + + if (w->base > max_address || w->limit > max_address) { + device_printf(sc->dev, + "initial %s window has too many bits, ignoring\n", w->name); + return; + } + rid = w->reg; + w->res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, + w->limit - w->base + 1, flags); + if (w->res == NULL) { + device_printf(sc->dev, + "failed to allocate initial %s window: %#jx-%#jx\n", + w->name, (uintmax_t)w->base, (uintmax_t)w->limit); + w->base = max_address; + w->limit = 0; + pcib_write_windows(sc, w->mask); + return; + } + pcib_activate_window(sc, type); + + error = rman_manage_region(&w->rman, rman_get_start(w->res), + rman_get_end(w->res)); + if (error) + panic("Failed to initialize rman with resource"); +} + +/* + * Initialize I/O windows. + */ +static void +pcib_probe_windows(struct pcib_softc *sc) +{ + pci_addr_t max; + device_t dev; + uint32_t val; + + dev = sc->dev; + + /* Determine if the I/O port window is implemented. */ + val = pci_read_config(dev, PCIR_IOBASEL_1, 1); + if (val == 0) { + /* + * If 'val' is zero, then only 16-bits of I/O space + * are supported. + */ + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + if (pci_read_config(dev, PCIR_IOBASEL_1, 1) != 0) { + sc->io.valid = 1; + pci_write_config(dev, PCIR_IOBASEL_1, 0, 1); + } + } else + sc->io.valid = 1; + + /* Read the existing I/O port window. */ + if (sc->io.valid) { + sc->io.reg = PCIR_IOBASEL_1; + sc->io.step = 12; + sc->io.mask = WIN_IO; + sc->io.name = "I/O port"; + if ((val & PCIM_BRIO_MASK) == PCIM_BRIO_32) { + sc->io.base = PCI_PPBIOBASE( + pci_read_config(dev, PCIR_IOBASEH_1, 2), val); + sc->io.limit = PCI_PPBIOLIMIT( + pci_read_config(dev, PCIR_IOLIMITH_1, 2), + pci_read_config(dev, PCIR_IOLIMITL_1, 1)); + max = 0xffffffff; + } else { + sc->io.base = PCI_PPBIOBASE(0, val); + sc->io.limit = PCI_PPBIOLIMIT(0, + pci_read_config(dev, PCIR_IOLIMITL_1, 1)); + max = 0xffff; + } + pcib_alloc_window(sc, &sc->io, SYS_RES_IOPORT, 0, max); + } + + /* Read the existing memory window. */ + sc->mem.valid = 1; + sc->mem.reg = PCIR_MEMBASE_1; + sc->mem.step = 20; + sc->mem.mask = WIN_MEM; + sc->mem.name = "memory"; + sc->mem.base = PCI_PPBMEMBASE(0, + pci_read_config(dev, PCIR_MEMBASE_1, 2)); + sc->mem.limit = PCI_PPBMEMLIMIT(0, + pci_read_config(dev, PCIR_MEMLIMIT_1, 2)); + pcib_alloc_window(sc, &sc->mem, SYS_RES_MEMORY, 0, 0xffffffff); + + /* Determine if the prefetchable memory window is implemented. */ + val = pci_read_config(dev, PCIR_PMBASEL_1, 2); + if (val == 0) { + /* + * If 'val' is zero, then only 32-bits of memory space + * are supported. + */ + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + if (pci_read_config(dev, PCIR_PMBASEL_1, 2) != 0) { + sc->pmem.valid = 1; + pci_write_config(dev, PCIR_PMBASEL_1, 0, 2); + } + } else + sc->pmem.valid = 1; + + /* Read the existing prefetchable memory window. */ + if (sc->pmem.valid) { + sc->pmem.reg = PCIR_PMBASEL_1; + sc->pmem.step = 20; + sc->pmem.mask = WIN_PMEM; + sc->pmem.name = "prefetch"; + if ((val & PCIM_BRPM_MASK) == PCIM_BRPM_64) { + sc->pmem.base = PCI_PPBMEMBASE( + pci_read_config(dev, PCIR_PMBASEH_1, 4), val); + sc->pmem.limit = PCI_PPBMEMLIMIT( + pci_read_config(dev, PCIR_PMLIMITH_1, 4), + pci_read_config(dev, PCIR_PMLIMITL_1, 2)); + max = 0xffffffffffffffff; + } else { + sc->pmem.base = PCI_PPBMEMBASE(0, val); + sc->pmem.limit = PCI_PPBMEMLIMIT(0, + pci_read_config(dev, PCIR_PMLIMITL_1, 2)); + max = 0xffffffff; + } + pcib_alloc_window(sc, &sc->pmem, SYS_RES_MEMORY, + RF_PREFETCHABLE, max); + } +} + +#else + /* * Is the prefetch window open (eg, can we allocate memory in it?) */ @@ -230,6 +474,7 @@ pcib_set_mem_decode(struct pcib_softc *s pci_write_config(dev, PCIR_PMLIMITH_1, pmemhi, 4); pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmemlimit >> 16, 2); } +#endif /* * Get current bridge configuration. @@ -247,10 +492,12 @@ pcib_cfg_save(struct pcib_softc *sc) sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2); sc->seclat = pci_read_config(dev, PCIR_SECLAT_1, 1); +#ifndef NEW_PCIB if (sc->command & PCIM_CMD_PORTEN) pcib_get_io_decode(sc); if (sc->command & PCIM_CMD_MEMEN) pcib_get_mem_decode(sc); +#endif } /* @@ -269,10 +516,14 @@ pcib_cfg_restore(struct pcib_softc *sc) pci_write_config(dev, PCIR_SUBBUS_1, sc->subbus, 1); pci_write_config(dev, PCIR_BRIDGECTL_1, sc->bridgectl, 2); pci_write_config(dev, PCIR_SECLAT_1, sc->seclat, 1); +#ifdef NEW_PCIB + pcib_write_windows(sc, WIN_IO | WIN_MEM | WIN_PMEM); +#else if (sc->command & PCIM_CMD_PORTEN) pcib_set_io_decode(sc); if (sc->command & PCIM_CMD_MEMEN) pcib_set_mem_decode(sc); +#endif } /* @@ -389,18 +640,35 @@ pcib_attach_common(device_t dev) if ((pci_get_devid(dev) & 0xff00ffff) == 0x24008086 || pci_read_config(dev, PCIR_PROGIF, 1) == PCIP_BRIDGE_PCI_SUBTRACTIVE) sc->flags |= PCIB_SUBTRACTIVE; - + +#ifdef NEW_PCIB + pcib_probe_windows(sc); +#endif if (bootverbose) { device_printf(dev, " domain %d\n", sc->domain); device_printf(dev, " secondary bus %d\n", sc->secbus); device_printf(dev, " subordinate bus %d\n", sc->subbus); - device_printf(dev, " I/O decode 0x%x-0x%x\n", sc->iobase, sc->iolimit); +#ifdef NEW_PCIB + if (pcib_is_window_open(&sc->io)) + device_printf(dev, " I/O decode 0x%jx-0x%jx\n", + (uintmax_t)sc->io.base, (uintmax_t)sc->io.limit); + if (pcib_is_window_open(&sc->mem)) + device_printf(dev, " memory decode 0x%jx-0x%jx\n", + (uintmax_t)sc->mem.base, (uintmax_t)sc->mem.limit); + if (pcib_is_window_open(&sc->pmem)) + device_printf(dev, " prefetched decode 0x%jx-0x%jx\n", + (uintmax_t)sc->pmem.base, (uintmax_t)sc->pmem.limit); +#else + if (pcib_is_io_open(sc)) + device_printf(dev, " I/O decode 0x%x-0x%x\n", + sc->iobase, sc->iolimit); if (pcib_is_nonprefetch_open(sc)) device_printf(dev, " memory decode 0x%jx-0x%jx\n", (uintmax_t)sc->membase, (uintmax_t)sc->memlimit); if (pcib_is_prefetch_open(sc)) device_printf(dev, " prefetched decode 0x%jx-0x%jx\n", (uintmax_t)sc->pmembase, (uintmax_t)sc->pmemlimit); +#endif else device_printf(dev, " no prefetched decode\n"); if (sc->flags & PCIB_SUBTRACTIVE) @@ -502,6 +770,377 @@ pcib_write_ivar(device_t dev, device_t c return(ENOENT); } +#ifdef NEW_PCIB +static const char * +pcib_child_name(device_t child) +{ + static char buf[64]; + + if (device_get_nameunit(child) != NULL) + return (device_get_nameunit(child)); + snprintf(buf, sizeof(buf), "pci%d:%d:%d:%d", pci_get_domain(child), + pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); + return (buf); +} + +/* + * Attempt to allocate a resource from the existing resources assigned + * to a window. + */ +static struct resource * +pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, + device_t child, int type, int *rid, u_long start, u_long end, u_long count, + u_int flags) +{ + struct resource *res; + + if (!pcib_is_window_open(w)) + return (NULL); + + res = rman_reserve_resource(&w->rman, start, end, count, + flags & ~RF_ACTIVE, child); + if (res == NULL) + return (NULL); + + if (bootverbose) + device_printf(sc->dev, + "allocated %s range (%#lx-%#lx) for rid %x of %s\n", + w->name, rman_get_start(res), rman_get_end(res), *rid, + pcib_child_name(child)); + rman_set_rid(res, *rid); + + /* + * If the resource should be active, pass that request up the + * tree. This assumes the parent drivers can handle + * activating sub-allocated resources. + */ + if (flags & RF_ACTIVE) { + if (bus_activate_resource(child, type, *rid, res) != 0) { + rman_release_resource(res); + return (NULL); + } + } + + return (res); +} + +/* + * Attempt to grow a window to make room for a given resource request. + * The 'step' parameter is log_2 of the desired I/O window's alignment. + */ +static int +pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, + u_long start, u_long end, u_long count, u_int flags) +{ + u_long align, start_free, end_free, front, back; + int error, rid; + + /* + * Clamp the desired resource range to the maximum address + * this window supports. Reject impossible requests. + */ + if (!w->valid) + return (EINVAL); + if (end > w->rman.rm_end) + end = w->rman.rm_end; + if (start + count - 1 > end || start + count < start) + return (EINVAL); + + /* + * If there is no resource at all, just try to allocate enough + * aligned space for this resource. + */ + if (w->res == NULL) { + if (RF_ALIGNMENT(flags) < w->step) { + flags &= ~RF_ALIGNMENT_MASK; + flags |= RF_ALIGNMENT_LOG2(w->step); + } + start &= ~((1ul << w->step) - 1); + end |= ((1ul << w->step) - 1); + count = roundup2(count, 1ul << w->step); + rid = w->reg; + w->res = bus_alloc_resource(sc->dev, type, &rid, start, end, + count, flags & ~RF_ACTIVE); + if (w->res == NULL) { + if (bootverbose) + device_printf(sc->dev, + "failed to allocate initial %s window (%#lx-%#lx,%#lx)\n", + w->name, start, end, count); + return (ENXIO); + } + if (bootverbose) + device_printf(sc->dev, + "allocated initial %s window of %#lx-%#lx\n", + w->name, rman_get_start(w->res), + rman_get_end(w->res)); + error = rman_manage_region(&w->rman, rman_get_start(w->res), + rman_get_end(w->res)); + if (error) { + if (bootverbose) + device_printf(sc->dev, + "failed to add initial %s window to rman\n", + w->name); + bus_release_resource(sc->dev, type, w->reg, w->res); + w->res = NULL; + return (error); + } + pcib_activate_window(sc, type); + goto updatewin; + } + + /* + * See if growing the window would help. Compute the minimum + * amount of address space needed on both the front and back + * ends of the existing window to satisfy the allocation. + * + * For each end, build a candidate region adjusting for the + * required alignment, etc. If there is a free region at the + * edge of the window, grow from the inner edge of the free + * region. Otherwise grow from the window boundary. + * + * XXX: Special case: if w->res is completely empty and the + * request size is larger than w->res, we should find the + * optimal aligned buffer containing w->res and allocate that. + */ + if (bootverbose) + device_printf(sc->dev, + "attempting to grow %s window for (%#lx-%#lx,%#lx)\n", + w->name, start, end, count); + align = 1ul << RF_ALIGNMENT(flags); + if (start < rman_get_start(w->res)) { + if (rman_first_free_region(&w->rman, &start_free, &end_free) != + 0 || start_free != rman_get_start(w->res)) + end_free = rman_get_start(w->res) - 1; + if (end_free > end) + end_free = end; + + /* Move end_free down until it is properly aligned. */ + end_free &= ~(align - 1); + front = end_free - count; + + /* + * The resource would now be allocated at (front, + * end_free). Ensure that fits in the (start, end) + * bounds. end_free is checked above. If 'front' is + * ok, ensure it is properly aligned for this window. + * Also check for underflow. + */ + if (front >= start && front <= end_free) { + if (bootverbose) + printf("\tfront candidate range: %#lx-%#lx\n", + front, end_free); + front &= (1ul << w->step) - 1; + front = rman_get_start(w->res) - front; + } else + front = 0; + } else + front = 0; + if (end > rman_get_end(w->res)) { + if (rman_last_free_region(&w->rman, &start_free, &end_free) != + 0 || end_free != rman_get_end(w->res)) + start_free = rman_get_end(w->res) + 1; + if (start_free < start) + start_free = start; + + /* Move start_free up until it is properly aligned. */ + start_free = roundup2(start_free, align); + back = start_free + count; + + /* + * The resource would now be allocated at (start_free, + * back). Ensure that fits in the (start, end) + * bounds. start_free is checked above. If 'back' is + * ok, ensure it is properly aligned for this window. + * Also check for overflow. + */ + if (back <= end && start_free <= back) { + if (bootverbose) + printf("\tback candidate range: %#lx-%#lx\n", + start_free, back); + back = roundup2(back, w->step) - 1; + back -= rman_get_end(w->res); + } else + back = 0; + } else + back = 0; + + /* + * Try to allocate the smallest needed region first. + * If that fails, fall back to the other region. + */ + error = ENOSPC; + while (front != 0 || back != 0) { + if (front != 0 && (front <= back || back == 0)) { + error = bus_adjust_resource(sc->dev, type, w->res, + rman_get_start(w->res) - front, + rman_get_end(w->res)); + if (error == 0) + break; + front = 0; + } else { + error = bus_adjust_resource(sc->dev, type, w->res, + rman_get_start(w->res), + rman_get_end(w->res) + back); + if (error == 0) + break; + back = 0; + } + } + + if (error) + return (error); + if (bootverbose) + device_printf(sc->dev, "grew %s window to %#lx-%#lx\n", + w->name, rman_get_start(w->res), rman_get_end(w->res)); + + /* Add the newly allocated region to the resource manager. */ + if (w->base != rman_get_start(w->res)) { + KASSERT(w->limit == rman_get_end(w->res), ("both ends moved")); + error = rman_manage_region(&w->rman, rman_get_start(w->res), + w->base - 1); + } else { + KASSERT(w->limit != rman_get_end(w->res), + ("neither end moved")); + error = rman_manage_region(&w->rman, w->limit + 1, + rman_get_end(w->res)); + } + if (error) { + if (bootverbose) + device_printf(sc->dev, + "failed to expand %s resource manager\n", w->name); + bus_adjust_resource(sc->dev, type, w->res, w->base, w->limit); + return (error); + } + +updatewin: + /* Save the new window. */ + w->base = rman_get_start(w->res); + w->limit = rman_get_end(w->res); + KASSERT((w->base & ((1ul << w->step) - 1)) == 0, + ("start address is not aligned")); + KASSERT((w->limit & ((1ul << w->step) - 1)) == (1ul << w->step) - 1, + ("end address is not aligned")); + pcib_write_windows(sc, w->mask); + return (0); +} + +/* + * We have to trap resource allocation requests and ensure that the bridge + * is set up to, or capable of handling them. + */ +struct resource * +pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct pcib_softc *sc; + struct resource *r; + + sc = device_get_softc(dev); + + /* + * VGA resources are decoded iff the VGA enable bit is set in + * the bridge control register. VGA resources do not fall into + * the resource windows and are passed up to the parent. + */ + if ((type == SYS_RES_IOPORT && pci_is_vga_ioport_range(start, end)) || + (type == SYS_RES_MEMORY && pci_is_vga_memory_range(start, end))) { + if (sc->bridgectl & PCIB_BCR_VGA_ENABLE) + return (bus_generic_alloc_resource(dev, child, type, + rid, start, end, count, flags)); + else + return (NULL); + } + + switch (type) { + case SYS_RES_IOPORT: + r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, + end, count, flags); + if (r != NULL) + break; + if (pcib_grow_window(sc, &sc->io, type, start, end, count, + flags) == 0) + r = pcib_suballoc_resource(sc, &sc->io, child, type, + rid, start, end, count, flags); + break; + case SYS_RES_MEMORY: + /* + * For prefetchable resources, prefer the prefetchable + * memory window, but fall back to the regular memory + * window if that fails. Try both windows before + * attempting to grow a window in case the firmware + * has used a range in the regular memory window to + * map a prefetchable BAR. + */ + if (flags & RF_PREFETCHABLE) { + r = pcib_suballoc_resource(sc, &sc->pmem, child, type, + rid, start, end, count, flags); + if (r != NULL) + break; + } + r = pcib_suballoc_resource(sc, &sc->mem, child, type, rid, + start, end, count, flags); + if (r != NULL) + break; + if (flags & RF_PREFETCHABLE) { + if (pcib_grow_window(sc, &sc->pmem, type, start, end, + count, flags) == 0) { + r = pcib_suballoc_resource(sc, &sc->pmem, child, + type, rid, start, end, count, flags); + if (r != NULL) + break; + } + } + if (pcib_grow_window(sc, &sc->mem, type, start, end, count, + flags & ~RF_PREFETCHABLE) == 0) + r = pcib_suballoc_resource(sc, &sc->mem, child, type, + rid, start, end, count, flags); + break; + default: + return (bus_generic_alloc_resource(dev, child, type, rid, + start, end, count, flags)); + } + + /* + * If attempts to suballocate from the window fail but this is a + * subtractive bridge, pass the request up the tree. + */ + if (sc->flags & PCIB_SUBTRACTIVE && r == NULL) + return (bus_generic_alloc_resource(dev, child, type, rid, + start, end, count, flags)); + return (r); +} + +int +pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, + u_long start, u_long end) +{ + struct pcib_softc *sc; + + sc = device_get_softc(bus); + if (pcib_is_resource_managed(sc, type, r)) + return (rman_adjust_resource(r, start, end)); + return (bus_generic_adjust_resource(bus, child, type, r, start, end)); +} + +int +pcib_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pcib_softc *sc; + int error; + + sc = device_get_softc(dev); + if (pcib_is_resource_managed(sc, type, r)) { + if (rman_get_flags(r) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, r); + if (error) + return (error); + } + return (rman_release_resource(r)); + } + return (bus_generic_release_resource(dev, child, type, rid, r)); +} +#else /* * We have to trap resource allocation requests and ensure that the bridge * is set up to, or capable of handling them. @@ -657,6 +1296,7 @@ pcib_alloc_resource(device_t dev, device return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } +#endif /* * PCIB interface. Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue May 3 16:36:39 2011 (r221392) +++ head/sys/dev/pci/pcib_private.h Tue May 3 17:37:24 2011 (r221393) @@ -39,6 +39,24 @@ */ DECLARE_CLASS(pcib_driver); +#ifdef NEW_PCIB +#define WIN_IO 0x1 +#define WIN_MEM 0x2 +#define WIN_PMEM 0x4 + +struct pcib_window { + pci_addr_t base; /* base address */ + pci_addr_t limit; /* topmost address */ + struct rman rman; + struct resource *res; + int reg; /* resource id from parent */ + int valid; + int mask; /* WIN_* bitmask of this window */ + int step; /* log_2 of window granularity */ + const char *name; +}; +#endif + /* * Bridge-specific data. */ @@ -53,12 +71,18 @@ struct pcib_softc u_int pribus; /* primary bus number */ u_int secbus; /* secondary bus number */ u_int subbus; /* subordinate bus number */ +#ifdef NEW_PCIB + struct pcib_window io; /* I/O port window */ + struct pcib_window mem; /* memory window */ + struct pcib_window pmem; /* prefetchable memory window */ +#else pci_addr_t pmembase; /* base address of prefetchable memory */ pci_addr_t pmemlimit; /* topmost address of prefetchable memory */ pci_addr_t membase; /* base address of memory window */ pci_addr_t memlimit; /* topmost address of memory window */ uint32_t iobase; /* base address of port window */ uint32_t iolimit; /* topmost address of port window */ +#endif uint16_t secstat; /* secondary bus status register */ uint16_t bridgectl; /* bridge control register */ uint8_t seclat; /* secondary bus latency timer */ @@ -74,6 +98,12 @@ int pcib_read_ivar(device_t dev, device int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +#ifdef NEW_PCIB +int pcib_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end); +int pcib_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r); +#endif int pcib_maxslots(device_t dev); uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width); Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/i386/pci/pci_bus.c Tue May 3 17:37:24 2011 (r221393) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/sparc64/pci/apb.c ============================================================================== --- head/sys/sparc64/pci/apb.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/sparc64/pci/apb.c Tue May 3 17:37:24 2011 (r221393) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcib.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/sparc64/pci/ofw_pcib.c Tue May 3 17:37:24 2011 (r221393) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/x86/pci/qpi.c ============================================================================== --- head/sys/x86/pci/qpi.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/x86/pci/qpi.c Tue May 3 17:37:24 2011 (r221393) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/x86/x86/mptable_pci.c ============================================================================== --- head/sys/x86/x86/mptable_pci.c Tue May 3 16:36:39 2011 (r221392) +++ head/sys/x86/x86/mptable_pci.c Tue May 3 17:37:24 2011 (r221393) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Tue May 3 18:35:03 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49503106566C; Tue, 3 May 2011 18:35:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1BABB8FC16; Tue, 3 May 2011 18:35:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p43IZ2vS096045; Tue, 3 May 2011 18:35:02 GMT (envelope-from jhb@freefall.freebsd.org) Received: (from jhb@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p43IZ2kN096041; Tue, 3 May 2011 18:35:02 GMT (envelope-from jhb) Date: Tue, 3 May 2011 18:35:02 GMT Message-Id: <201105031835.p43IZ2kN096041@freefall.freebsd.org> To: aksenzov@gmail.com, jhb@FreeBSD.org, freebsd-net@FreeBSD.org, jhb@FreeBSD.org From: jhb@FreeBSD.org Cc: Subject: Re: kern/149306: [alc] Doesn't work Atheros AR8131 PCIe Gigabit Ethernet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 18:35:03 -0000 Synopsis: [alc] Doesn't work Atheros AR8131 PCIe Gigabit Ethernet State-Changed-From-To: open->patched State-Changed-By: jhb State-Changed-When: Tue May 3 18:34:39 UTC 2011 State-Changed-Why: Probable fix committed to HEAD. Responsible-Changed-From-To: freebsd-net->jhb Responsible-Changed-By: jhb Responsible-Changed-When: Tue May 3 18:34:39 UTC 2011 Responsible-Changed-Why: Probable fix committed to HEAD. http://www.freebsd.org/cgi/query-pr.cgi?pr=149306 From owner-freebsd-net@FreeBSD.ORG Tue May 3 19:38:13 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2587106564A for ; Tue, 3 May 2011 19:38:13 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id AF56D8FC18 for ; Tue, 3 May 2011 19:38:13 +0000 (UTC) Received: from PWSVL-EXCHTS-01.internal.cacheflow.com ([10.2.2.122]) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p43JcCd7006875 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 3 May 2011 12:38:12 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-01.internal.cacheflow.com ([fe80::5c50:e2ba:8115:4223%20]) with mapi id 14.01.0255.000; Tue, 3 May 2011 12:38:06 -0700 From: "Li, Qing" To: Arnaud Lacombe Thread-Topic: interface ip arp Thread-Index: AQHMCFqrtGblL2pVN0K+AdsrWd9STpR4pYP8gAAxBUiAAMbUgP//ivAOgAAFxbCAAPwlAIABSgWQ Date: Tue, 3 May 2011 19:38:01 +0000 Message-ID: References: <10E473DB-A690-4468-953A-08D87AE07F68@bluecoat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.9.45.9] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-net@freebsd.org" , Ingo Flaschberger Subject: RE: interface ip arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 19:38:13 -0000 Okay, please give the following patch a try, which should give the behavior= s that you observe in R6.x and R7.x. http://people.freebsd.org/~qingli/arp3.patch Thanks, --Qing > -----Original Message----- > From: Arnaud Lacombe [mailto:lacombar@gmail.com] > Sent: Monday, May 02, 2011 9:06 AM > To: Li, Qing > Cc: freebsd-net@freebsd.org; Ingo Flaschberger > Subject: Re: interface ip arp >=20 > Hi, >=20 > On Mon, May 2, 2011 at 4:03 AM, Li, Qing wrote: > > Please give this patch a try for IPv4 ARP > > > > http://people.freebsd.org/~qingli/arp2.patch > > > Your patch works; the manually added address is kept upon a up/down/up > transition. However, the interface address is still flush, which I > find inconsistent with it being marked 'permanent'. >=20 > - Arnaud >=20 > > --Qing > > > > ________________________________________ > > From: owner-freebsd-net@freebsd.org [owner-freebsd-net@freebsd.org] > on behalf of Li, Qing > > Sent: Monday, May 02, 2011 12:45 AM > > To: Arnaud Lacombe > > Cc: freebsd-net@freebsd.org; Ingo Flaschberger > > Subject: RE: interface ip arp > > > > Your patch doesn't work because the in_lltable_prefix_free() is =A0a > generic function. > > > > The static entries are kept only when issuing if-down command, > however, if the interface > > address is being removed, permanent static entries are gone and have > to be reinstalled. > > > > I already have a working patch for IPv4, just going over the IPv6 > code. > > > > I will post the patch in a few minutes. > > > > -- Qing > > > > ________________________________________ > > From: Arnaud Lacombe [lacombar@gmail.com] > > Sent: Monday, May 02, 2011 12:41 AM > > To: Li, Qing > > Cc: Ingo Flaschberger; freebsd-net@freebsd.org > > Subject: Re: interface ip arp > > > > Hi, > > > > On Sun, May 1, 2011 at 10:50 PM, Li, Qing > wrote: > >> jeez, this bug has been around for quite a while ... > >> > >> Please try patch at =A0http://people.freebsd.org/~qingli/arp.patch > >> > > d'oh!... Concerning Ingo's bug, your patch do the job, my report was > > bad, 4.9-RELEASE and 7.x show the same behavior: > > > > # uname -a > > FreeBSD server 7.1-RELEASE-p13 FreeBSD 7.1-RELEASE-p13 > > # ifconfig em0 up 192.168.45.200/24 > > # arp -n 192.168.45.200 > > ? (192.168.45.200) at 00:03:2d:16:6e:fc on em0 permanent [ethernet] > > # ifconfig em0 down > > # arp -n 192.168.45.200 > > 192.168.45.200 (192.168.45.200) -- no entry > > # ifconfig em0 up > > # arp -n 192.168.45.200 > > 192.168.45.200 (192.168.45.200) -- no entry > > > > The behavioral change I noticed is that permanent address (manually > > added) in the ARP table are flushed along with all other addresses on > >>8.x (cf. the script output of my previous mail) while they are kept > > in the cache on <7.x during a down/up transition. The following patch: > > > > diff --git a/sys/netinet/in.c b/sys/netinet/in.c > > index 1012012..27e44a2 100644 > > --- a/sys/netinet/in.c > > +++ b/sys/netinet/in.c > > @@ -1372,6 +1372,8 @@ in_lltable_prefix_free(struct lltable *llt, > > > > =A0 =A0 =A0 =A0for (i=3D0; i < LLTBL_HASHTBL_SIZE; i++) { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH_SAFE(lle, &llt->lle_head[i]= , lle_next, > next) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lle->la_flags & LLE_S= TATIC) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (IN_ARE_MASKED_ADDR_E= QUAL((struct > > sockaddr_in *)L3_ADDR(lle), > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pfx, msk)) { > > > > partially restores the old behavior. Only partially as before 8.x, > > interface addresses were not marked as 'permanent'. You could > manually > > add a 'permanent' entry for this address in such a way it would > > survive the down/up transition. In 8.x, the interface address is > > marked as 'permanent', but is removed explicitly by arp_ifscrub(). So > > even the above change would not work for the interface address. > > > > Shouldn't this address be removed later when "removing all L2 entries > > on the given prefix", in which case it would not have to be re-added > > again, if marking it 'permanent' is deliberate ? > > > > Thanks, > > =A0- Arnaud > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net- > unsubscribe@freebsd.org" > > From owner-freebsd-net@FreeBSD.ORG Wed May 4 17:05:51 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E253D106567B for ; Wed, 4 May 2011 17:05:51 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id B3B848FC18 for ; Wed, 4 May 2011 17:05:51 +0000 (UTC) Received: by pxi11 with SMTP id 11so968741pxi.7 for ; Wed, 04 May 2011 10:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=gG0q3LExZCMdBj1+8YZ8U0iLrQ6WQNMwSOACmN1kZls=; b=YzetaDsDqvHotsBTrmh5ZFBliXA+T+yRZoWw5ruUOYXcHs3OgKFhjv51gUsWFsrrcd KB/JiMAVKr5uuqOD3uqZq9Opu4Jh8K2vK1LYVK79xDfSgPc0thNmAUS8wVoS5zYJhO6T TjuqzvENIoiTNCrT6jHTcqb9Nl8zE0E5HGytk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Fn7TJ8F+ULRky9Gus/i1msI16TPlLICRGlH1Ga52vFVQDMrhJ1YZAhEctKZ8m9sNei XQlmg2BKbzqQ2Zrylx4+EkpjqZjy99Iqm7QnXsddbgehCR1fG0qzjKJU9pg03WxcgxVt 7IZEHxwxErqJB1RwQrc6LVF32hIl3LQ1zpv5I= Received: by 10.143.96.29 with SMTP id y29mr704499wfl.130.1304528751229; Wed, 04 May 2011 10:05:51 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id q5sm841948pbp.65.2011.05.04.10.05.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2011 10:05:49 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 04 May 2011 10:05:05 -0700 From: YongHyeon PYUN Date: Wed, 4 May 2011 10:05:05 -0700 To: Paul Thornton Message-ID: <20110504170505.GA9362@michelle.cdnetworks.com> References: <4DADD913.5010208@prt.org> <20110419220907.GD1637@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110419220907.GD1637@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: Broadcom BCM57765 support? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 17:05:52 -0000 On Tue, Apr 19, 2011 at 03:09:07PM -0700, YongHyeon PYUN wrote: > On Tue, Apr 19, 2011 at 07:48:51PM +0100, Paul Thornton wrote: > > Hi, > > > > The bge driver doesn't support this chipset yet and I was wondering if > > anyone has looked at implementing it. > > > > NetBSD looks like it has support for it. Now I may be wrong here, but > > it appears that the BCM57765 is similar to other devices based on the > > NetBSD if_bge.c source version 1.194. > > > > I've tried applying the NetBSD changes to the FreeBSD bge source but I > > don't know enough about the hardware and the code is different enough > > that I haven't made it very far. I can get a patched 8.2 kernel to > > detect the device, complain that the ASIC is unknown, read the MAC > > address correctly and determine there is link but as soon as you attempt > > to ifconfig up the interface the machine locks up. > > > > I'm happy to try and port this over but need a nudge in the right > > direction from someone who knows the code. > > > > Here is experimental patch for BCM57765 family controllers. I > don't have these controllers so the patch was not tested at all > except compile. Recent Broadcom controllers like BCM57765 support > EEE(Energy Efficient Ethernet) feature but it is not yet supported > by the patch. > Also it would good to see the output of "pciconf -lcbv" and dmesg > after applying the patch. FYI: Committed to HEAD(r221445). From owner-freebsd-net@FreeBSD.ORG Wed May 4 17:15:00 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DBEF1065678 for ; Wed, 4 May 2011 17:15:00 +0000 (UTC) (envelope-from prt@prt.org) Received: from smtp5.uk.umis.net (smtp5.mail.clearhost.co.uk [IPv6:2001:1420::25:105]) by mx1.freebsd.org (Postfix) with ESMTP id CB62B8FC0C for ; Wed, 4 May 2011 17:14:59 +0000 (UTC) Received: from www1.prt.org ([217.65.161.4] helo=dhcp-26-221.ripemtg.ripe.net) by smtp5.uk.umis.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QHff8-0001HL-Ca for freebsd-net@freebsd.org; Wed, 04 May 2011 17:14:58 +0000 Message-ID: <4DC18992.4040604@prt.org> Date: Wed, 04 May 2011 18:14:58 +0100 From: Paul Thornton User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <4DADD913.5010208@prt.org> <20110419220907.GD1637@michelle.cdnetworks.com> <20110504170505.GA9362@michelle.cdnetworks.com> In-Reply-To: <20110504170505.GA9362@michelle.cdnetworks.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Broadcom BCM57765 support? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 17:15:00 -0000 On 04/05/2011 18:05, YongHyeon PYUN wrote: > > FYI: Committed to HEAD(r221445). I've been away from the machines with this chipset for the past week so have not finished the testing, but can report that the initial tests I did involving normal use, jumbo frames, v4 and v6 etc. all worked fine and throughput was good. Once I have done a thorough test of the NIC I will post a report here. Paul. From owner-freebsd-net@FreeBSD.ORG Wed May 4 17:27:06 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03082106564A for ; Wed, 4 May 2011 17:27:06 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id C87818FC15 for ; Wed, 4 May 2011 17:27:05 +0000 (UTC) Received: by pzk27 with SMTP id 27so778462pzk.13 for ; Wed, 04 May 2011 10:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=As8XzDvcVECjuuYr+WQHwYlW4WzrJ9TOmU4EUNJ8XXU=; b=I78ohTcmWybDqkLPU+hSVcy7MTGuAgrPxnw20RzIcDv3EQmi5F5m0LIH7wVQzwlNuJ zIfvxQbsZWoIUjyEyn0J8ur2pAnytPaBLgU239rDOlIEOgJvo9U603imI2+UZpicmBLy WSKm/yB8H1pA7H64xKQjFvZTc+PfcdqJxJQMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=F+Y4DyW74lguUvsiec4HxOxmpKVjMdofoovtrWWyrKKLN13OtBuIYp+8trhFJXEEKw VY29xVyqnLLEjj4Nd/eBvoxMUNm7P4/S+YRjbdMRYjsKWtc5liC4JlExq6lmP2x6c+xh rAoBxdMfscK5Ei0nYpvhjpGf+21dL1miMb0/A= Received: by 10.68.55.200 with SMTP id u8mr1765548pbp.462.1304530025464; Wed, 04 May 2011 10:27:05 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id q5sm856048pbs.11.2011.05.04.10.27.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2011 10:27:04 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 04 May 2011 10:26:21 -0700 From: YongHyeon PYUN Date: Wed, 4 May 2011 10:26:21 -0700 To: Paul Thornton Message-ID: <20110504172621.GB9362@michelle.cdnetworks.com> References: <4DADD913.5010208@prt.org> <20110419220907.GD1637@michelle.cdnetworks.com> <20110504170505.GA9362@michelle.cdnetworks.com> <4DC18992.4040604@prt.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DC18992.4040604@prt.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: Broadcom BCM57765 support? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 17:27:06 -0000 On Wed, May 04, 2011 at 06:14:58PM +0100, Paul Thornton wrote: > On 04/05/2011 18:05, YongHyeon PYUN wrote: > > > > FYI: Committed to HEAD(r221445). > > I've been away from the machines with this chipset for the past week so > have not finished the testing, but can report that the initial tests I > did involving normal use, jumbo frames, v4 and v6 etc. all worked fine > and throughput was good. > I tested it with both 57765X and 57785X. All seems to work as expected. Jumbo frame performance also looks very good. > Once I have done a thorough test of the NIC I will post a report here. > Ok, thanks in advance. > Paul. From owner-freebsd-net@FreeBSD.ORG Wed May 4 20:12:35 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 308F3106566C for ; Wed, 4 May 2011 20:12:35 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id E257F8FC0C for ; Wed, 4 May 2011 20:12:34 +0000 (UTC) Received: by vxc34 with SMTP id 34so2064321vxc.13 for ; Wed, 04 May 2011 13:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=/j/WAAyBE1SKhykTI/M60F7K78yU4cWI070opq7lzwQ=; b=C0UGt7zMg4HjLoXlopl9Uc7sT8ci6oruktyJ153s2wn3xCUfxCMYEpWB3ZoQ8Th1wc 0fEc86mU3i6I8Qa0ObpB3FPgOsn0oHo5VvKDerDAdQJaXvpnY38ESW4LXxpNtrZ7TqDn tx5MDFDSzuA0SHoD/silVUwmtQgy8RXM30bKA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mQsvfBXa8rbgZl8QOq3++1fx/YCgLvB/T5K3KSI0n5YuV5kCYHMVOYcHYhiI6vXd97 kWsOjVi5RT1PWl/LxtVpnzRWG3NObKuk3JKkMsZSeAZP6G4l0KCFAXxaE/LtknlX+VWo kFinlJlrEsDl65fyRayT5z59jxW3NaO2zP9sc= MIME-Version: 1.0 Received: by 10.52.107.98 with SMTP id hb2mr1859718vdb.247.1304538556753; Wed, 04 May 2011 12:49:16 -0700 (PDT) Received: by 10.220.93.7 with HTTP; Wed, 4 May 2011 12:49:16 -0700 (PDT) Date: Wed, 4 May 2011 12:49:16 -0700 Message-ID: From: Vijay Singh To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: gdb scripts for mbuf leaks X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 20:12:35 -0000 Hi, I am trying to track down an mbuf leak caused by an in-kernel custom application. Does anyone here have any gdb scripts that would traverse the zone (zone mbuf in this case) and print out all objects that are currently allocated? -vijay PS: I see the count of mbufs (current/cache/total) going up constantly. From owner-freebsd-net@FreeBSD.ORG Thu May 5 17:53:52 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48A2D106564A for ; Thu, 5 May 2011 17:53:52 +0000 (UTC) (envelope-from gpm@hotplug.ru) Received: from shadow.rusoft.ru (shadow.rusoft.ru [217.16.18.75]) by mx1.freebsd.org (Postfix) with ESMTP id 927F58FC19 for ; Thu, 5 May 2011 17:53:50 +0000 (UTC) Received: from shadow.rusoft.ru (localhost [127.0.0.1]) by shadow.rusoft.ru (Postfix) with ESMTP id 8670C3827 for ; Thu, 5 May 2011 21:37:53 +0400 (MSD) Received: from jazz.rusoft.ru (unknown [83.222.3.162]) by shadow.rusoft.ru (Postfix) with ESMTP id 5D48C3826 for ; Thu, 5 May 2011 21:37:53 +0400 (MSD) Received: from ghost-pc.home.lan (unknown [213.141.135.21]) by jazz.rusoft.ru (Postfix) with ESMTPA id 2B4111CC00F for ; Thu, 5 May 2011 21:37:52 +0400 (MSD) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-net@freebsd.org Date: Thu, 05 May 2011 21:37:12 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Emil Muratov" Message-ID: User-Agent: Opera Mail/11.10 (Win32) X-Virus-Scanned: ClamAV using ClamSMTP Subject: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 17:53:52 -0000 Hi all. I have a small home router/nas running nvidia ion platform with onboard = = nfe LAN adapter. About a month ago I changed ISP and setup pppoe client with mpd5.5. Sinc= e = that time my router issues kernel panic once or twice a day with "Fatal trap 12: page fault = = while in kernel mode" and (nfe0 taskq) is the current process. Updating to the latest stable doesn't help. I don=E2=80=99t know what to= do next, = any help would be much appreciated. Below is kgdb backtrace, dmesg outpu= t, = kernel config file, if anything is missing just let me know. Thanx. =3D=3D=3D=3D=3D epia.home.lan dumped core - see /crash/vmcore.15 Thu May 5 18:29:58 MSD 2011 FreeBSD epia.home.lan 8.2-STABLE FreeBSD 8.2-STABLE #1: Tue May 3 = 22:11:56 MSD 2011 root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug = = amd64 panic: page fault GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you= = are welcome to change it and/or distribute copies of it under certain = conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for detai= ls. This GDB was configured as "amd64-marcel-freebsd"... Unread portion of the kernel message buffer: Fatal trap 12: page fault while in kernel mode cpuid =3D 0; apic id =3D 00 fault virtual address =3D 0xffffff800ff02ac8 fault code =3D supervisor write data, page not present instruction pointer =3D 0x20:0xffffffff8037d7bb stack pointer =3D 0x28:0xffffff80000fde20 frame pointer =3D 0x28:0xffffff80000fde60 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 0 (nfe0 taskq) trap number =3D 12 panic: page fault cpuid =3D 0 KDB: stack backtrace: #0 0xffffffff802a97a3 at kdb_backtrace+0x5e #1 0xffffffff8027aa98 at panic+0x182 #2 0xffffffff804466d0 at trap_fatal+0x292 #3 0xffffffff80446a85 at trap_pfault+0x286 #4 0xffffffff80446f2f at trap+0x3cb #5 0xffffffff8042ff54 at calltrap+0x8 #6 0xffffffff8035ceb4 at ipfw_nat+0x20a #7 0xffffffff803547e3 at ipfw_chk+0xbaf #8 0xffffffff8035977c at ipfw_check_hook+0xf9 #9 0xffffffff8032a221 at pfil_run_hooks+0x9c #10 0xffffffff8035fe84 at ip_input+0x2d0 #11 0xffffffff8032947f at netisr_dispatch_src+0x71 #12 0xffffffff80c22cab at ng_iface_rcvdata+0xdc #13 0xffffffff80c18964 at ng_apply_item+0x20a #14 0xffffffff80c17afd at ng_snd_item+0x2a1 #15 0xffffffff80c18964 at ng_apply_item+0x20a #16 0xffffffff80c17afd at ng_snd_item+0x2a1 #17 0xffffffff80c25305 at ng_ppp_rcvdata+0x202 Uptime: 18h57m47s Physical memory: 2005 MB Dumping 1644 MB: 1629 1613 1597 1581 1565 1549 1533 1517 1501 1485 1469 = = 1453 1437 1421 1405 1389 1373 1357 1341 1325 1309 1293 1277 1261 1245 12= 29 = 1213 1197 1181 1165 1149 1133 1117 1101 1085 1069 1053 1037 1021 1005 98= 9 = 973 957 941 925 909 893 877 861 845 829 813 797 781 765 749 733 717 701 = = 685 669 653 637 621 605 589 573 557 541 525 509 493 477 461 445 429 413 = = 397 381 365 349 333 317 301 285 269 253 237 221 205 189 173 157 141 125 = = 109 93 77 61 45 29 13 Reading symbols from /boot/kernel/zfs.ko...Reading symbols from = /boot/kernel/zfs.ko.symbols...done. done. Loaded symbols for /boot/kernel/zfs.ko Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from = = /boot/kernel/opensolaris.ko.symbols...done. done. Loaded symbols for /boot/kernel/opensolaris.ko Reading symbols from /boot/kernel/krpc.ko...Reading symbols from = /boot/kernel/krpc.ko.symbols...done. done. Loaded symbols for /boot/kernel/krpc.ko Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from = /boot/kernel/if_nfe.ko.symbols...done. done. Loaded symbols for /boot/kernel/if_nfe.ko Reading symbols from /boot/kernel/aio.ko...Reading symbols from = /boot/kernel/aio.ko.symbols...done. done. Loaded symbols for /boot/kernel/aio.ko Reading symbols from /boot/kernel/alias_ftp.ko...Reading symbols from = /boot/kernel/alias_ftp.ko.symbols...done. done. Loaded symbols for /boot/kernel/alias_ftp.ko Reading symbols from /boot/kernel/if_stf.ko...Reading symbols from = /boot/kernel/if_stf.ko.symbols...done. done. Loaded symbols for /boot/kernel/if_stf.ko Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from = /boot/kernel/ng_socket.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_socket.ko Reading symbols from /boot/kernel/netgraph.ko...Reading symbols from = /boot/kernel/netgraph.ko.symbols...done. done. Loaded symbols for /boot/kernel/netgraph.ko Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from = /boot/kernel/ng_mppc.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_mppc.ko Reading symbols from /boot/kernel/rc4.ko...Reading symbols from = /boot/kernel/rc4.ko.symbols...done. done. Loaded symbols for /boot/kernel/rc4.ko Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from = /boot/kernel/ng_iface.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_iface.ko Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from = /boot/kernel/ng_ppp.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_ppp.ko Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from = /boot/kernel/ng_tee.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_tee.ko Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from = /boot/kernel/ng_ether.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_ether.ko Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from = /boot/kernel/ng_pppoe.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_pppoe.ko Reading symbols from /boot/kernel/accf_http.ko...Reading symbols from = /boot/kernel/accf_http.ko.symbols...done. done. Loaded symbols for /boot/kernel/accf_http.ko Reading symbols from /boot/kernel/accf_data.ko...Reading symbols from = /boot/kernel/accf_data.ko.symbols...done. done. Loaded symbols for /boot/kernel/accf_data.ko Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from = /boot/kernel/ng_tcpmss.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_tcpmss.ko #0 doadump () at pcpu.h:224 224 pcpu.h: No such file or directory. in pcpu.h (kgdb) #0 doadump () at pcpu.h:224 #1 0xffffffff8027a615 in boot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.c:419 #2 0xffffffff8027aa82 in panic (fmt=3DVariable "fmt" is not available.)= at /usr/src/sys/kern/kern_shutdown.c:592 #3 0xffffffff804466d0 in trap_fatal (frame=3D0xc, eva=3DVariable "eva" = is not = available.) at /usr/src/sys/amd64/amd64/trap.c:811 #4 0xffffffff80446a85 in trap_pfault (frame=3D0xffffff80000fe720, = usermode=3D0) at /usr/src/sys/amd64/amd64/trap.c:727 #5 0xffffffff80446f2f in trap (frame=3D0xffffff80000fe720) at /usr/src/sys/amd64/amd64/trap.c:477 #6 0xffffffff8042ff54 in calltrap () at /usr/src/sys/amd64/amd64/exception.S:228 #7 0xffffffff80c2c8ce in pppoe_findsession (privp=3DVariable "privp" is= not = available.) at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.c= :566 #8 0xffffffff80c2cfe7 in ng_pppoe_rcvdata_ether (hook=3DVariable "hook"= is = not available.) at = /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.c:1613 #9 0xffffffff80c18964 in ng_apply_item (node=3D0xffffff002105ec00, item=3D0xffffff0054a36500, rw=3D0) at = /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #10 0xffffffff80c17afd in ng_snd_item (item=3D0xffffff0054a36500, flags=3D= 0) at = /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #11 0xffffffff80320b5a in ether_demux (ifp=3D0xffffff0006862800, m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:911 #12 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0006862800, m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 #13 0xffffffff80320aa2 in ether_demux (ifp=3D0xffffff0001676800, m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:803 #14 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0001676800, m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 #15 0xffffffff809eb76e in nfe_jrxeof (sc=3D0xffffff80003ae000, count=3D1= 85, rx_npktsp=3D0x0) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c= :2303 #16 0xffffffff809effea in nfe_int_task (arg=3DVariable "arg" is not = available.) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:1899 #17 0xffffffff802b3f7e in taskqueue_run_locked (queue=3D0xffffff00017227= 00) at /usr/src/sys/kern/subr_taskqueue.c:248 #18 0xffffffff802b410c in taskqueue_thread_loop (arg=3DVariable "arg" is= not = available.) at /usr/src/sys/kern/subr_taskqueue.c:385 #19 0xffffffff80252d5d in fork_exit ( callout=3D0xffffffff802b40c4 , arg=3D0xffffff80003ae1b8, frame=3D0xffffff80000fec50) at /usr/src/sys/kern/kern_fork.c:865 #20 0xffffffff8043049e in fork_trampoline () at /usr/src/sys/amd64/amd64/exception.S:603 #21 0x0000000000000000 in ?? () #22 0x0000000000000000 in ?? () #23 0x0000000000000000 in ?? () #24 0x0000000000000000 in ?? () #25 0x0000000000000000 in ?? () #26 0x0000000000000000 in ?? () #27 0x0000000000000000 in ?? () #28 0x0000000000000000 in ?? () #29 0x0000000000000000 in ?? () #30 0x0000000000000000 in ?? () #31 0x0000000000000000 in ?? () #32 0x0000000000000000 in ?? () #33 0x0000000000000000 in ?? () #34 0x0000000000000000 in ?? () #35 0x0000000000000000 in ?? () #36 0x0000000000000000 in ?? () #37 0x0000000000000000 in ?? () #38 0x0000000000000000 in ?? () #39 0x0000000000000000 in ?? () #40 0x0000000000000000 in ?? () #41 0x0000000000000000 in ?? () #42 0x0000000000000000 in ?? () #43 0x0000000000000000 in ?? () #44 0x0000000000000000 in ?? () #45 0xffffffff80665140 in affinity () #46 0x0000000000000000 in ?? () #47 0x0000000000000000 in ?? () #48 0xffffff0001741460 in ?? () #49 0xffffff80000fe380 in ?? () #50 0xffffff80000fe328 in ?? () #51 0xffffff00015b8000 in ?? () #52 0xffffffff8029d819 in sched_switch (td=3D0xffffffff802b40c4, newtd=3D0xffffff80003ae1b8, flags=3DVariable "flags" is not availab= le. ) at /usr/src/sys/kern/sched_ule.c:1859 Previous frame inner to this frame (corrupt stack?) (kgdb) DMESG --- Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994= The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.2-STABLE #1: Tue May 3 22:11:56 MSD 2011 root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug amd64 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Atom(TM) CPU 330 @ 1.60GHz (1600.01-MHz K8-class CPU) Origin =3D "GenuineIntel" Id =3D 0x106c2 Family =3D 6 Model =3D 1c= Stepping = =3D 2 Features=3D0xbfe9fbff Features2=3D0x40e31d AMD Features=3D0x20000800 AMD Features2=3D0x1 TSC: P-state invariant real memory =3D 2147483648 (2048 MB) avail memory =3D 2025250816 (1931 MB) ACPI APIC Table: <072310 APIC1353> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 cpu2 (AP): APIC ID: 2 cpu3 (AP/HT): APIC ID: 3 ioapic0: Changing APIC ID to 4 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 cryptosoft0: on motherboard acpi0: <072310 RSDT1353> on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi0: reservation of fefe1000, 1000 (3) failed acpi0: reservation of fee01000, ff000 (3) failed acpi0: reservation of fec00000, 1000 (3) failed acpi0: reservation of fee00000, 1000 (3) failed acpi0: reservation of 0, a0000 (3) failed acpi0: reservation of 100000, 7ff00000 (3) failed Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 0.1 (no driver attached) isab0: port 0x4f00-0x4fff at device 3.0 on pci0 isa0: on isab0 pci0: at device 3.1 (no driver attached) pci0: at device 3.2 (no driver attached) pci0: at device 3.3 (no driver attached) pci0: at device 3.5 (no driver attached) ohci0: mem 0xfae7f000-0xfae7ffff ir= q = 16 at device 4.0 on pci0 ohci0: [ITHREAD] usbus0: on ohci0 ehci0: mem 0xfae7ec00-0xfae7ecf= f = irq 18 at device 4.1 on pci0 ehci0: [ITHREAD] usbus1: EHCI version 1.0 usbus1: on ehci0 pcib1: at device 9.0 on pci0 pci3: on pcib1 nfe0: port 0xd080-0xd087 mem = 0xfae7d000-0xfae7dfff,0xfae7e800-0xfae7e8ff,0xfae7e400-0xfae7e40f irq 22= = at device 10.0 on pci0 miibus0: on nfe0 rgephy0: PHY 3 on miibus0 rgephy0: 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, = 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, = 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, = 1000baseT-FDX-flow-master, auto, auto-flow nfe0: Ethernet address: 00:25:22:21:86:89 nfe0: [FILTER] ahci0: port = 0xd000-0xd007,0xcc00-0xcc03,0xc880-0xc887,0xc800-0xc803,0xc480-0xc48f me= m = 0xfae76000-0xfae77fff irq 23 at device 11.0 on pci0 ahci0: [ITHREAD] ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported ahcich0: at channel 0 on ahci0 ahcich0: [ITHREAD] ahcich1: at channel 1 on ahci0 ahcich1: [ITHREAD] ahcich2: at channel 2 on ahci0 ahcich2: [ITHREAD] ahcich3: at channel 3 on ahci0 ahcich3: [ITHREAD] ahcich4: at channel 4 on ahci0 ahcich4: [ITHREAD] ahcich5: at channel 5 on ahci0 ahcich5: [ITHREAD] pcib2: irq 20 at device 12.0 on pci0 pci2: on pcib2 pcib3: at device 16.0 on pci0 pci1: on pcib3 vgapci0: port 0xec00-0xec7f mem = 0xfb000000-0xfbffffff,0xe0000000-0xefffffff,0xf6000000-0xf7ffffff irq 21= = at device 0.0 on pci1 acpi_button0: on acpi0 acpi_hpet0: iomem 0xfed00000-0xfed00fff irq= = 2,8 on acpi0 Timecounter "HPET" frequency 25000000 Hz quality 900 atrtc0: port 0x70-0x71 on acpi0 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: [FILTER] sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa= 0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] p4tcc0: on cpu0 p4tcc1: on cpu1 p4tcc2: on cpu2 p4tcc3: on cpu3 ZFS filesystem version 5 ZFS storage pool version 28 Timecounters tick every 1.000 msec ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based = forwarding enabled, default to deny, logging disabled load_dn_sched dn_sched FIFO loaded load_dn_sched dn_sched PRIO loaded load_dn_sched dn_sched QFQ loaded load_dn_sched dn_sched RR loaded load_dn_sched dn_sched WF2Q+ loaded usbus0: 12Mbps Full Speed USB v1.0 usbus1: 480Mbps High Speed USB v2.0 ugen0.1: at usbus0 uhub0: on usbus= 0 ugen1.1: at usbus1 uhub1: on usbus= 1 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-7 SATA 2.x device ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 ada1: ATA-8 SATA 2.x device ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada1: Command Queueing enabled ada1: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) ada2 at ahcich2 bus 0 scbus2 target 0 lun 0 ada2: ATA-8 SATA 2.x device ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada2: Command Queueing enabled ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) ada3 at ahcich3 bus 0 scbus3 target 0 lun 0 ada3: ATA-7 SATA 2.x device ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada3: Command Queueing enabled ada3: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) SMP: AP CPU #3 Launched! SMP: AP CPU #1 Launched! SMP: AP CPU #2 Launched! uhub0: 10 ports with 10 removable, self powered Root mount waiting for: usbus1 Root mount waiting for: usbus1 Root mount waiting for: usbus1 Root mount waiting for: usbus1 uhub1: 10 ports with 10 removable, self powered Trying to mount root from zfs:rz KERNCONF -------- > grep -v -e "^#" /root/conf/ION4debug cpu HAMMER ident ION4debug makeoptions DEBUG=3D-g # Build kernel with gdb(1) deb= ug = symbols options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemptio= n options INET # InterNETworking options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates suppor= t options UFS_ACL # Support for access control lis= ts options UFS_DIRHASH # Improve performance on big = directories options UFS_GJOURNAL # Enable gjournal-based UFS = journaling options PROCFS # Process filesystem (requires = PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) options SCSI_DELAY=3D5000 # Delay (in ms) before probing= SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time = extensions options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being = = interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for = hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework options FLOWTABLE # per-cpu routing cache options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a pani= c options SMP # Symmetric MultiProcessor Kerne= l device cpufreq options DEVICE_POLLING options IPFIREWALL options IPDIVERT options IPFIREWALL_FORWARD options IPFIREWALL_NAT options IPSTEALTH options DUMMYNET options LIBALIAS device crypto device acpi device pci device ahci device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) device pass # Passthrough device (direct SCSI access= ) device atkbdc # AT keyboard controller device atkbd # AT keyboard device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver device sc device uart # Generic UART driver device miibus # MII bus support device loop # Network loopback device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) device firmware # firmware assist module device bpf # Berkeley packet filter device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device usb # USB Bus (required) device uhid # "Human Interface Devices" device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus an= d = da device ums # Mouse From owner-freebsd-net@FreeBSD.ORG Thu May 5 18:22:10 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714D5106566C for ; Thu, 5 May 2011 18:22:10 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 36F358FC15 for ; Thu, 5 May 2011 18:22:09 +0000 (UTC) Received: by iyj12 with SMTP id 12so2898833iyj.13 for ; Thu, 05 May 2011 11:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jb5QQGWlhytJWCf/qzwDl8k3c8aP9sunC73iuQpFVOo=; b=LokC9r6L/pPR5/Z2XfjkUplVMc/xwEtq7gqMhHybuzaA/i+uuvYwEZjIIQp1+mqkfa +lPMC31/+gk/X3foCHt+tAmZAlwnES5xgG/+tz7ztHpXKDWEfeFTiOMmPHn7R7F6LhJ0 UQguLbzq/b+ZjyCFcoCljM7YEiub/QJsIf3Dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cHOZN2ihxuR/ChRSp+V9TC0PR+99uWjPcx0ib+Fl4FngrJx9/2A3C/Aco1wmi8L2Sz apH9WJDGJdHGFNeiJ/g9D6FJsKFG9oaExFwceTEd6HwWgU1TgoTWNbZfE7m3VxnIAYOX SyAGPYpROtxfRo0zwOXLU/kDm71PUESIhCKlU= MIME-Version: 1.0 Received: by 10.42.162.202 with SMTP id z10mr1415018icx.203.1304619729458; Thu, 05 May 2011 11:22:09 -0700 (PDT) Received: by 10.42.167.5 with HTTP; Thu, 5 May 2011 11:22:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 May 2011 14:22:09 -0400 Message-ID: From: Arnaud Lacombe To: Emil Muratov Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 18:22:10 -0000 Hi, On Thu, May 5, 2011 at 1:37 PM, Emil Muratov wrote: > > > Hi all. > > I have a small home router/nas running nvidia ion platform with onboard n= fe > LAN adapter. > About a month ago I changed ISP and setup pppoe client with mpd5.5. Since > that time my router > issues kernel panic once or twice a day with "Fatal trap 12: page fault > while in kernel mode" and (nfe0 taskq) is the current process. > Updating to the latest stable doesn't help. I don=92t know what to do nex= t, > any help would be much appreciated. Below is kgdb backtrace, dmesg output= , > kernel config file, if anything is missing just let me know. > Your error looks like a nice use-after-free. Could you 'disassemble 0xffffffff8037d7bb' in gdb, and find the matching faulty dereference ? I'd tend not to trust code relying on "big hack", as per the preamble of m_megapullup(): /* * m_megapullup() - this function is a big hack. * Thankfully, it's only used in ng_nat and ipfw+nat. *... which look like a re-invention of m_copydata()... - Arnaud > Thanx. > > > > =3D=3D=3D=3D=3D > epia.home.lan dumped core - see /crash/vmcore.15 > > Thu May =A05 18:29:58 MSD 2011 > > FreeBSD epia.home.lan 8.2-STABLE FreeBSD 8.2-STABLE #1: Tue May =A03 22:1= 1:56 > MSD 2011 =A0 =A0 root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug =A0amd= 64 > > panic: page fault > > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you = are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. =A0Type "show warranty" for deta= ils. > This GDB was configured as "amd64-marcel-freebsd"... > > Unread portion of the kernel message buffer: > > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =A0 =3D 0xffffff800ff02ac8 > fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D supervisor write data, page not= present > instruction pointer =A0 =A0 =3D 0x20:0xffffffff8037d7bb > stack pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xffffff80000fde20 > frame pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xffffff80000fde60 > code segment =A0 =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1= b > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0, pres 1, long 1,= def32 0, gran 1 > processor eflags =A0 =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0 > current process =A0 =A0 =A0 =A0 =3D 0 (nfe0 taskq) > trap number =A0 =A0 =A0 =A0 =A0 =A0 =3D 12 > panic: page fault > cpuid =3D 0 > KDB: stack backtrace: > #0 0xffffffff802a97a3 at kdb_backtrace+0x5e > #1 0xffffffff8027aa98 at panic+0x182 > #2 0xffffffff804466d0 at trap_fatal+0x292 > #3 0xffffffff80446a85 at trap_pfault+0x286 > #4 0xffffffff80446f2f at trap+0x3cb > #5 0xffffffff8042ff54 at calltrap+0x8 > #6 0xffffffff8035ceb4 at ipfw_nat+0x20a > #7 0xffffffff803547e3 at ipfw_chk+0xbaf > #8 0xffffffff8035977c at ipfw_check_hook+0xf9 > #9 0xffffffff8032a221 at pfil_run_hooks+0x9c > #10 0xffffffff8035fe84 at ip_input+0x2d0 > #11 0xffffffff8032947f at netisr_dispatch_src+0x71 > #12 0xffffffff80c22cab at ng_iface_rcvdata+0xdc > #13 0xffffffff80c18964 at ng_apply_item+0x20a > #14 0xffffffff80c17afd at ng_snd_item+0x2a1 > #15 0xffffffff80c18964 at ng_apply_item+0x20a > #16 0xffffffff80c17afd at ng_snd_item+0x2a1 > #17 0xffffffff80c25305 at ng_ppp_rcvdata+0x202 > Uptime: 18h57m47s > Physical memory: 2005 MB > Dumping 1644 MB: 1629 1613 1597 1581 1565 1549 1533 1517 1501 1485 1469 1= 453 > 1437 1421 1405 1389 1373 1357 1341 1325 1309 1293 1277 1261 1245 1229 121= 3 > 1197 1181 1165 1149 1133 1117 1101 1085 1069 1053 1037 1021 1005 989 973 = 957 > 941 925 909 893 877 861 845 829 813 797 781 765 749 733 717 701 685 669 6= 53 > 637 621 605 589 573 557 541 525 509 493 477 461 445 429 413 397 381 365 3= 49 > 333 317 301 285 269 253 237 221 205 189 173 157 141 125 109 93 77 61 45 2= 9 > 13 > > Reading symbols from /boot/kernel/zfs.ko...Reading symbols from > /boot/kernel/zfs.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/zfs.ko > Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from > /boot/kernel/opensolaris.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/opensolaris.ko > Reading symbols from /boot/kernel/krpc.ko...Reading symbols from > /boot/kernel/krpc.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/krpc.ko > Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from > /boot/kernel/if_nfe.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/if_nfe.ko > Reading symbols from /boot/kernel/aio.ko...Reading symbols from > /boot/kernel/aio.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/aio.ko > Reading symbols from /boot/kernel/alias_ftp.ko...Reading symbols from > /boot/kernel/alias_ftp.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/alias_ftp.ko > Reading symbols from /boot/kernel/if_stf.ko...Reading symbols from > /boot/kernel/if_stf.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/if_stf.ko > Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from > /boot/kernel/ng_socket.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_socket.ko > Reading symbols from /boot/kernel/netgraph.ko...Reading symbols from > /boot/kernel/netgraph.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/netgraph.ko > Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from > /boot/kernel/ng_mppc.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_mppc.ko > Reading symbols from /boot/kernel/rc4.ko...Reading symbols from > /boot/kernel/rc4.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/rc4.ko > Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from > /boot/kernel/ng_iface.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_iface.ko > Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from > /boot/kernel/ng_ppp.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_ppp.ko > Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from > /boot/kernel/ng_tee.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_tee.ko > Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from > /boot/kernel/ng_ether.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_ether.ko > Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from > /boot/kernel/ng_pppoe.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_pppoe.ko > Reading symbols from /boot/kernel/accf_http.ko...Reading symbols from > /boot/kernel/accf_http.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/accf_http.ko > Reading symbols from /boot/kernel/accf_data.ko...Reading symbols from > /boot/kernel/accf_data.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/accf_data.ko > Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from > /boot/kernel/ng_tcpmss.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/ng_tcpmss.ko > #0 =A0doadump () at pcpu.h:224 > 224 =A0 =A0 pcpu.h: No such file or directory. > =A0 =A0 =A0 =A0in pcpu.h > (kgdb) #0 =A0doadump () at pcpu.h:224 > #1 =A00xffffffff8027a615 in boot (howto=3D260) > =A0 =A0at /usr/src/sys/kern/kern_shutdown.c:419 > #2 =A00xffffffff8027aa82 in panic (fmt=3DVariable "fmt" is not available.= ) > =A0 =A0at /usr/src/sys/kern/kern_shutdown.c:592 > #3 =A00xffffffff804466d0 in trap_fatal (frame=3D0xc, eva=3DVariable "eva"= is not > available.) > =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:811 > #4 =A00xffffffff80446a85 in trap_pfault (frame=3D0xffffff80000fe720, user= mode=3D0) > =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:727 > #5 =A00xffffffff80446f2f in trap (frame=3D0xffffff80000fe720) > =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:477 > #6 =A00xffffffff8042ff54 in calltrap () > =A0 =A0at /usr/src/sys/amd64/amd64/exception.S:228 > #7 =A00xffffffff80c2c8ce in pppoe_findsession (privp=3DVariable "privp" i= s not > available.) > =A0 =A0at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.= c:566 > #8 =A00xffffffff80c2cfe7 in ng_pppoe_rcvdata_ether (hook=3DVariable "hook= " is > not available.) > =A0 =A0at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.= c:1613 > #9 =A00xffffffff80c18964 in ng_apply_item (node=3D0xffffff002105ec00, > =A0 =A0item=3D0xffffff0054a36500, rw=3D0) > =A0 =A0at > /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 > #10 0xffffffff80c17afd in ng_snd_item (item=3D0xffffff0054a36500, flags= =3D0) > =A0 =A0at > /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 > #11 0xffffffff80320b5a in ether_demux (ifp=3D0xffffff0006862800, > =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:911 > #12 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0006862800, > =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 > #13 0xffffffff80320aa2 in ether_demux (ifp=3D0xffffff0001676800, > =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:803 > #14 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0001676800, > =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 > #15 0xffffffff809eb76e in nfe_jrxeof (sc=3D0xffffff80003ae000, count=3D18= 5, > =A0 =A0rx_npktsp=3D0x0) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.= c:2303 > #16 0xffffffff809effea in nfe_int_task (arg=3DVariable "arg" is not > available.) > =A0 =A0at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:1899 > #17 0xffffffff802b3f7e in taskqueue_run_locked (queue=3D0xffffff000172270= 0) > =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:248 > #18 0xffffffff802b410c in taskqueue_thread_loop (arg=3DVariable "arg" is = not > available.) > =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:385 > #19 0xffffffff80252d5d in fork_exit ( > =A0 =A0callout=3D0xffffffff802b40c4 , > =A0 =A0arg=3D0xffffff80003ae1b8, frame=3D0xffffff80000fec50) > =A0 =A0at /usr/src/sys/kern/kern_fork.c:865 > #20 0xffffffff8043049e in fork_trampoline () > =A0 =A0at /usr/src/sys/amd64/amd64/exception.S:603 > #21 0x0000000000000000 in ?? () > #22 0x0000000000000000 in ?? () > #23 0x0000000000000000 in ?? () > #24 0x0000000000000000 in ?? () > #25 0x0000000000000000 in ?? () > #26 0x0000000000000000 in ?? () > #27 0x0000000000000000 in ?? () > #28 0x0000000000000000 in ?? () > #29 0x0000000000000000 in ?? () > #30 0x0000000000000000 in ?? () > #31 0x0000000000000000 in ?? () > #32 0x0000000000000000 in ?? () > #33 0x0000000000000000 in ?? () > #34 0x0000000000000000 in ?? () > #35 0x0000000000000000 in ?? () > #36 0x0000000000000000 in ?? () > #37 0x0000000000000000 in ?? () > #38 0x0000000000000000 in ?? () > #39 0x0000000000000000 in ?? () > #40 0x0000000000000000 in ?? () > #41 0x0000000000000000 in ?? () > #42 0x0000000000000000 in ?? () > #43 0x0000000000000000 in ?? () > #44 0x0000000000000000 in ?? () > #45 0xffffffff80665140 in affinity () > #46 0x0000000000000000 in ?? () > #47 0x0000000000000000 in ?? () > #48 0xffffff0001741460 in ?? () > #49 0xffffff80000fe380 in ?? () > #50 0xffffff80000fe328 in ?? () > #51 0xffffff00015b8000 in ?? () > #52 0xffffffff8029d819 in sched_switch (td=3D0xffffffff802b40c4, > =A0 =A0newtd=3D0xffffff80003ae1b8, flags=3DVariable "flags" is not availa= ble. > ) at /usr/src/sys/kern/sched_ule.c:1859 > Previous frame inner to this frame (corrupt stack?) > (kgdb) > > > DMESG > --- > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > =A0 =A0 =A0 =A0The Regents of the University of California. All rights re= served. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 8.2-STABLE #1: Tue May =A03 22:11:56 MSD 2011 > =A0 =A0root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug amd64 > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Intel(R) Atom(TM) CPU =A0330 =A0 @ 1.60GHz (1600.01-MHz K8-class CPU= ) > =A0Origin =3D "GenuineIntel" =A0Id =3D 0x106c2 =A0Family =3D 6 =A0Model = =3D 1c =A0Stepping =3D 2 > =A0Features=3D0xbfe9fbff > =A0Features2=3D0x40e31d > =A0AMD Features=3D0x20000800 > =A0AMD Features2=3D0x1 > =A0TSC: P-state invariant > real memory =A0=3D 2147483648 (2048 MB) > avail memory =3D 2025250816 (1931 MB) > ACPI APIC Table: <072310 APIC1353> > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads > =A0cpu0 (BSP): APIC ID: =A00 > =A0cpu1 (AP/HT): APIC ID: =A01 > =A0cpu2 (AP): APIC ID: =A02 > =A0cpu3 (AP/HT): APIC ID: =A03 > ioapic0: Changing APIC ID to 4 > ioapic0 irqs 0-23 on motherboard > kbd1 at kbdmux0 > cryptosoft0: on motherboard > acpi0: <072310 RSDT1353> on motherboard > acpi0: [ITHREAD] > acpi0: Power Button (fixed) > acpi0: reservation of fefe1000, 1000 (3) failed > acpi0: reservation of fee01000, ff000 (3) failed > acpi0: reservation of fec00000, 1000 (3) failed > acpi0: reservation of fee00000, 1000 (3) failed > acpi0: reservation of 0, a0000 (3) failed > acpi0: reservation of 100000, 7ff00000 (3) failed > Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 > acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 > cpu0: on acpi0 > cpu1: on acpi0 > cpu2: on acpi0 > cpu3: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pci0: at device 0.1 (no driver attached) > isab0: port 0x4f00-0x4fff at device 3.0 on pci0 > isa0: on isab0 > pci0: at device 3.1 (no driver attached) > pci0: at device 3.2 (no driver attached) > pci0: at device 3.3 (no driver attached) > pci0: at device 3.5 (no driver attached) > ohci0: mem 0xfae7f000-0xfae7ffff irq= 16 > at device 4.0 on pci0 > ohci0: [ITHREAD] > usbus0: on ohci0 > ehci0: mem 0xfae7ec00-0xfae7ecff > irq 18 at device 4.1 on pci0 > ehci0: [ITHREAD] > usbus1: EHCI version 1.0 > usbus1: on ehci0 > pcib1: at device 9.0 on pci0 > pci3: on pcib1 > nfe0: port 0xd080-0xd087 mem > 0xfae7d000-0xfae7dfff,0xfae7e800-0xfae7e8ff,0xfae7e400-0xfae7e40f irq 22 = at > device 10.0 on pci0 > miibus0: on nfe0 > rgephy0: PHY 3 on miibus0 > rgephy0: =A010baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-= FDX, > 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, > 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto= , > auto-flow > nfe0: Ethernet address: 00:25:22:21:86:89 > nfe0: [FILTER] > ahci0: port > 0xd000-0xd007,0xcc00-0xcc03,0xc880-0xc887,0xc800-0xc803,0xc480-0xc48f mem > 0xfae76000-0xfae77fff irq 23 at device 11.0 on pci0 > ahci0: [ITHREAD] > ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported > ahcich0: at channel 0 on ahci0 > ahcich0: [ITHREAD] > ahcich1: at channel 1 on ahci0 > ahcich1: [ITHREAD] > ahcich2: at channel 2 on ahci0 > ahcich2: [ITHREAD] > ahcich3: at channel 3 on ahci0 > ahcich3: [ITHREAD] > ahcich4: at channel 4 on ahci0 > ahcich4: [ITHREAD] > ahcich5: at channel 5 on ahci0 > ahcich5: [ITHREAD] > pcib2: irq 20 at device 12.0 on pci0 > pci2: on pcib2 > pcib3: at device 16.0 on pci0 > pci1: on pcib3 > vgapci0: port 0xec00-0xec7f mem > 0xfb000000-0xfbffffff,0xe0000000-0xefffffff,0xf6000000-0xf7ffffff irq 21 = at > device 0.0 on pci1 > acpi_button0: on acpi0 > acpi_hpet0: iomem 0xfed00000-0xfed00fff irq = 2,8 > on acpi0 > Timecounter "HPET" frequency 25000000 Hz quality 900 > atrtc0: port 0x70-0x71 on acpi0 > uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 > uart0: [FILTER] > sc0: at flags 0x100 on isa0 > sc0: VGA <16 virtual consoles, flags=3D0x300> > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > atkbdc0: at port 0x60,0x64 on isa0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > atkbd0: [ITHREAD] > p4tcc0: on cpu0 > p4tcc1: on cpu1 > p4tcc2: on cpu2 > p4tcc3: on cpu3 > ZFS filesystem version 5 > ZFS storage pool version 28 > Timecounters tick every 1.000 msec > ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based > forwarding enabled, default to deny, logging disabled > load_dn_sched dn_sched FIFO loaded > load_dn_sched dn_sched PRIO loaded > load_dn_sched dn_sched QFQ loaded > load_dn_sched dn_sched RR loaded > load_dn_sched dn_sched WF2Q+ loaded > usbus0: 12Mbps Full Speed USB v1.0 > usbus1: 480Mbps High Speed USB v2.0 > ugen0.1: at usbus0 > uhub0: on usbus0 > ugen1.1: at usbus1 > uhub1: on usbus1 > ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 > ada0: ATA-7 SATA 2.x device > ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) > ada0: Command Queueing enabled > ada0: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) > ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 > ada1: ATA-8 SATA 2.x device > ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) > ada1: Command Queueing enabled > ada1: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) > ada2 at ahcich2 bus 0 scbus2 target 0 lun 0 > ada2: ATA-8 SATA 2.x device > ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) > ada2: Command Queueing enabled > ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) > ada3 at ahcich3 bus 0 scbus3 target 0 lun 0 > ada3: ATA-7 SATA 2.x device > ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) > ada3: Command Queueing enabled > ada3: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) > SMP: AP CPU #3 Launched! > SMP: AP CPU #1 Launched! > SMP: AP CPU #2 Launched! > uhub0: 10 ports with 10 removable, self powered > Root mount waiting for: usbus1 > Root mount waiting for: usbus1 > Root mount waiting for: usbus1 > Root mount waiting for: usbus1 > uhub1: 10 ports with 10 removable, self powered > Trying to mount root from zfs:rz > > > KERNCONF > -------- >> >> grep -v -e "^#" /root/conf/ION4debug > > cpu =A0 =A0 =A0 =A0 =A0 =A0 HAMMER > ident =A0 =A0 =A0 =A0 =A0 ION4debug > > makeoptions =A0 =A0 DEBUG=3D-g =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Build ker= nel with gdb(1) debug > symbols > > options =A0 =A0 =A0 =A0 SCHED_ULE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # ULE sched= uler > options =A0 =A0 =A0 =A0 PREEMPTION =A0 =A0 =A0 =A0 =A0 =A0 =A0# Enable ke= rnel thread preemption > options =A0 =A0 =A0 =A0 INET =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Int= erNETworking > options =A0 =A0 =A0 =A0 INET6 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # IPv6 = communications protocols > options =A0 =A0 =A0 =A0 FFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Ber= keley Fast Filesystem > options =A0 =A0 =A0 =A0 SOFTUPDATES =A0 =A0 =A0 =A0 =A0 =A0 # Enable FFS = soft updates support > options =A0 =A0 =A0 =A0 UFS_ACL =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Support= for access control lists > options =A0 =A0 =A0 =A0 UFS_DIRHASH =A0 =A0 =A0 =A0 =A0 =A0 # Improve per= formance on big > directories > options =A0 =A0 =A0 =A0 UFS_GJOURNAL =A0 =A0 =A0 =A0 =A0 =A0# Enable gjou= rnal-based UFS > journaling > options =A0 =A0 =A0 =A0 PROCFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Proce= ss filesystem (requires > PSEUDOFS) > options =A0 =A0 =A0 =A0 PSEUDOFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Pseudo-= filesystem framework > options =A0 =A0 =A0 =A0 GEOM_PART_GPT =A0 =A0 =A0 =A0 =A0 # GUID Partitio= n Tables. > options =A0 =A0 =A0 =A0 GEOM_LABEL =A0 =A0 =A0 =A0 =A0 =A0 =A0# Provides = labelization > options =A0 =A0 =A0 =A0 COMPAT_43TTY =A0 =A0 =A0 =A0 =A0 =A0# BSD 4.3 TTY= compat (sgtty) > options =A0 =A0 =A0 =A0 SCSI_DELAY=3D5000 =A0 =A0 =A0 =A0 # Delay (in ms)= before probing SCSI > options =A0 =A0 =A0 =A0 KTRACE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# ktrac= e(1) support > options =A0 =A0 =A0 =A0 STACK =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # stack= (9) support > options =A0 =A0 =A0 =A0 SYSVSHM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-st= yle shared memory > options =A0 =A0 =A0 =A0 SYSVMSG =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-st= yle message queues > options =A0 =A0 =A0 =A0 SYSVSEM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-st= yle semaphores > options =A0 =A0 =A0 =A0 P1003_1B_SEMAPHORES =A0 =A0 # POSIX-style semapho= res > options =A0 =A0 =A0 =A0 _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real= -time > extensions > options =A0 =A0 =A0 =A0 PRINTF_BUFR_SIZE=3D128 =A0 =A0# Prevent printf ou= tput being > interspersed. > options =A0 =A0 =A0 =A0 KBD_INSTALL_CDEV =A0 =A0 =A0 =A0# install a CDEV = entry in /dev > options =A0 =A0 =A0 =A0 HWPMC_HOOKS =A0 =A0 =A0 =A0 =A0 =A0 # Necessary k= ernel hooks for > hwpmc(4) > options =A0 =A0 =A0 =A0 AUDIT =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Secur= ity event auditing > options =A0 =A0 =A0 =A0 MAC =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Tru= stedBSD MAC Framework > options =A0 =A0 =A0 =A0 FLOWTABLE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # per-cpu r= outing cache > options =A0 =A0 =A0 =A0 INCLUDE_CONFIG_FILE =A0 =A0 # Include this file i= n kernel > > options =A0 =A0 =A0 =A0 KDB =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Ker= nel debugger related code > options =A0 =A0 =A0 =A0 KDB_TRACE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Print a s= tack trace for a panic > > options =A0 =A0 =A0 =A0 SMP =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Sym= metric MultiProcessor Kernel > > device =A0 =A0 =A0 =A0 =A0cpufreq > > options =A0 =A0 =A0 =A0 DEVICE_POLLING > options =A0 =A0 =A0 =A0 IPFIREWALL > options =A0 =A0 =A0 =A0 IPDIVERT > options =A0 =A0 =A0 =A0 IPFIREWALL_FORWARD > options =A0 =A0 =A0 =A0 IPFIREWALL_NAT > options =A0 =A0 =A0 =A0 IPSTEALTH > options =A0 =A0 =A0 =A0 DUMMYNET > > options =A0 =A0 =A0 =A0 LIBALIAS > > device =A0 =A0 =A0 =A0 =A0crypto > > device =A0 =A0 =A0 =A0 =A0acpi > device =A0 =A0 =A0 =A0 =A0pci > > device =A0 =A0 =A0 =A0 =A0ahci > > device =A0 =A0 =A0 =A0 =A0scbus =A0 =A0 =A0 =A0 =A0 # SCSI bus (required = for SCSI) > device =A0 =A0 =A0 =A0 =A0da =A0 =A0 =A0 =A0 =A0 =A0 =A0# Direct Access (= disks) > device =A0 =A0 =A0 =A0 =A0pass =A0 =A0 =A0 =A0 =A0 =A0# Passthrough devic= e (direct SCSI access) > > device =A0 =A0 =A0 =A0 =A0atkbdc =A0 =A0 =A0 =A0 =A0# AT keyboard control= ler > device =A0 =A0 =A0 =A0 =A0atkbd =A0 =A0 =A0 =A0 =A0 # AT keyboard > device =A0 =A0 =A0 =A0 =A0psm =A0 =A0 =A0 =A0 =A0 =A0 # PS/2 mouse > > device =A0 =A0 =A0 =A0 =A0kbdmux =A0 =A0 =A0 =A0 =A0# keyboard multiplexe= r > > device =A0 =A0 =A0 =A0 =A0vga =A0 =A0 =A0 =A0 =A0 =A0 # VGA video card dr= iver > > device =A0 =A0 =A0 =A0 =A0sc > > device =A0 =A0 =A0 =A0 =A0uart =A0 =A0 =A0 =A0 =A0 =A0# Generic UART driv= er > > device =A0 =A0 =A0 =A0 =A0miibus =A0 =A0 =A0 =A0 =A0# MII bus support > > device =A0 =A0 =A0 =A0 =A0loop =A0 =A0 =A0 =A0 =A0 =A0# Network loopback > device =A0 =A0 =A0 =A0 =A0random =A0 =A0 =A0 =A0 =A0# Entropy device > device =A0 =A0 =A0 =A0 =A0ether =A0 =A0 =A0 =A0 =A0 # Ethernet support > device =A0 =A0 =A0 =A0 =A0vlan =A0 =A0 =A0 =A0 =A0 =A0# 802.1Q VLAN suppo= rt > device =A0 =A0 =A0 =A0 =A0tun =A0 =A0 =A0 =A0 =A0 =A0 # Packet tunnel. > device =A0 =A0 =A0 =A0 =A0pty =A0 =A0 =A0 =A0 =A0 =A0 # BSD-style compati= bility pseudo ttys > device =A0 =A0 =A0 =A0 =A0md =A0 =A0 =A0 =A0 =A0 =A0 =A0# Memory "disks" > device =A0 =A0 =A0 =A0 =A0gif =A0 =A0 =A0 =A0 =A0 =A0 # IPv6 and IPv4 tun= neling > device =A0 =A0 =A0 =A0 =A0faith =A0 =A0 =A0 =A0 =A0 # IPv6-to-IPv4 relayi= ng (translation) > device =A0 =A0 =A0 =A0 =A0firmware =A0 =A0 =A0 =A0# firmware assist modul= e > > device =A0 =A0 =A0 =A0 =A0bpf =A0 =A0 =A0 =A0 =A0 =A0 # Berkeley packet f= ilter > > device =A0 =A0 =A0 =A0 =A0uhci =A0 =A0 =A0 =A0 =A0 =A0# UHCI PCI->USB int= erface > device =A0 =A0 =A0 =A0 =A0ohci =A0 =A0 =A0 =A0 =A0 =A0# OHCI PCI->USB int= erface > device =A0 =A0 =A0 =A0 =A0ehci =A0 =A0 =A0 =A0 =A0 =A0# EHCI PCI->USB int= erface (USB 2.0) > device =A0 =A0 =A0 =A0 =A0usb =A0 =A0 =A0 =A0 =A0 =A0 # USB Bus (required= ) > device =A0 =A0 =A0 =A0 =A0uhid =A0 =A0 =A0 =A0 =A0 =A0# "Human Interface = Devices" > device =A0 =A0 =A0 =A0 =A0ukbd =A0 =A0 =A0 =A0 =A0 =A0# Keyboard > device =A0 =A0 =A0 =A0 =A0umass =A0 =A0 =A0 =A0 =A0 # Disks/Mass storage = - Requires scbus and da > device =A0 =A0 =A0 =A0 =A0ums =A0 =A0 =A0 =A0 =A0 =A0 # Mouse > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Thu May 5 18:49:01 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8703D1065672 for ; Thu, 5 May 2011 18:49:01 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4972B8FC08 for ; Thu, 5 May 2011 18:49:00 +0000 (UTC) Received: by iyj12 with SMTP id 12so2926966iyj.13 for ; Thu, 05 May 2011 11:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=I6YvVVOEvQ+j1Sihgei0V+o2NWA1FcQFvCxv8A9tUf4=; b=F28qvyJfdr4juGSI17sGQ8tSkpQyo8SWq8xqyKgk5eNjeWCHZrSX8ND+0VHIEp6gUm fueag/afLBSXBXFxyk8EL4HsIQ+w4jxQcOSg+ogmZnQwQWgDaENHZgClOuNMiRXdKa2G WYPXqTSkCV6r4HYXy+/xEYLmoi7hNOcwcyGW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fwV6J+kbyPnSaxLE8//vQM6L1WUOxV70Lx+Oz2mf2MXXD3tOyPdbOmrQmXynoaANlo T5pusINnCP2yHVNWxpbPlevmfM8bG7excXBZ6G7/4Ip7+52ZOpJRw/edKIrLw4hRt9U8 aZjObn+4q1XLmsLhSKE3IGD8HDr0SkV4m2irY= MIME-Version: 1.0 Received: by 10.42.246.133 with SMTP id ly5mr1250410icb.404.1304621340275; Thu, 05 May 2011 11:49:00 -0700 (PDT) Received: by 10.42.167.5 with HTTP; Thu, 5 May 2011 11:49:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 May 2011 14:49:00 -0400 Message-ID: From: Arnaud Lacombe To: Emil Muratov Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, Paolo Pisati Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 18:49:01 -0000 Hi, On Thu, May 5, 2011 at 2:22 PM, Arnaud Lacombe wrote: > Hi, > > On Thu, May 5, 2011 at 1:37 PM, Emil Muratov wrote: >> >> >> Hi all. >> >> I have a small home router/nas running nvidia ion platform with onboard = nfe >> LAN adapter. >> About a month ago I changed ISP and setup pppoe client with mpd5.5. Sinc= e >> that time my router >> issues kernel panic once or twice a day with "Fatal trap 12: page fault >> while in kernel mode" and (nfe0 taskq) is the current process. >> Updating to the latest stable doesn't help. I don=92t know what to do ne= xt, >> any help would be much appreciated. Below is kgdb backtrace, dmesg outpu= t, >> kernel config file, if anything is missing just let me know. >> > Your error looks like a nice use-after-free. Could you 'disassemble > 0xffffffff8037d7bb' in gdb, and find the matching faulty dereference ? > I'd tend not to trust code relying on "big hack", as per the preamble > of m_megapullup(): > There is a stale reference to the mbuf passed to, and freed in m_megapullup(); could you test the following patch ? diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c index f8c3e63..80c13dc 100644 --- a/sys/netinet/ipfw/ip_fw_nat.c +++ b/sys/netinet/ipfw/ip_fw_nat.c @@ -263,7 +263,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m) retval =3D LibAliasOut(t->lib, c, mcl->m_len + M_TRAILINGSPACE(mcl)); if (retval =3D=3D PKT_ALIAS_RESPOND) { - m->m_flags |=3D M_SKIP_FIREWALL; + mcl->m_flags |=3D M_SKIP_FIREWALL; retval =3D PKT_ALIAS_OK; } if (retval !=3D PKT_ALIAS_OK && This was introduced in r188294 by piso@ (added to the CC: list). - Arnaud > /* > =A0* m_megapullup() - this function is a big hack. > =A0* Thankfully, it's only used in ng_nat and ipfw+nat. > =A0*... > > which look like a re-invention of m_copydata()... > > =A0- Arnaud > >> Thanx. >> >> >> >> =3D=3D=3D=3D=3D >> epia.home.lan dumped core - see /crash/vmcore.15 >> >> Thu May =A05 18:29:58 MSD 2011 >> >> FreeBSD epia.home.lan 8.2-STABLE FreeBSD 8.2-STABLE #1: Tue May =A03 22:= 11:56 >> MSD 2011 =A0 =A0 root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug =A0am= d64 >> >> panic: page fault >> >> GNU gdb 6.1.1 [FreeBSD] >> Copyright 2004 Free Software Foundation, Inc. >> GDB is free software, covered by the GNU General Public License, and you= are >> welcome to change it and/or distribute copies of it under certain >> conditions. >> Type "show copying" to see the conditions. >> There is absolutely no warranty for GDB. =A0Type "show warranty" for det= ails. >> This GDB was configured as "amd64-marcel-freebsd"... >> >> Unread portion of the kernel message buffer: >> >> Fatal trap 12: page fault while in kernel mode >> cpuid =3D 0; apic id =3D 00 >> fault virtual address =A0 =3D 0xffffff800ff02ac8 >> fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D supervisor write data, page no= t present >> instruction pointer =A0 =A0 =3D 0x20:0xffffffff8037d7bb >> stack pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xffffff80000fde20 >> frame pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xffffff80000fde60 >> code segment =A0 =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x= 1b >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0, pres 1, long 1= , def32 0, gran 1 >> processor eflags =A0 =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D = 0 >> current process =A0 =A0 =A0 =A0 =3D 0 (nfe0 taskq) >> trap number =A0 =A0 =A0 =A0 =A0 =A0 =3D 12 >> panic: page fault >> cpuid =3D 0 >> KDB: stack backtrace: >> #0 0xffffffff802a97a3 at kdb_backtrace+0x5e >> #1 0xffffffff8027aa98 at panic+0x182 >> #2 0xffffffff804466d0 at trap_fatal+0x292 >> #3 0xffffffff80446a85 at trap_pfault+0x286 >> #4 0xffffffff80446f2f at trap+0x3cb >> #5 0xffffffff8042ff54 at calltrap+0x8 >> #6 0xffffffff8035ceb4 at ipfw_nat+0x20a >> #7 0xffffffff803547e3 at ipfw_chk+0xbaf >> #8 0xffffffff8035977c at ipfw_check_hook+0xf9 >> #9 0xffffffff8032a221 at pfil_run_hooks+0x9c >> #10 0xffffffff8035fe84 at ip_input+0x2d0 >> #11 0xffffffff8032947f at netisr_dispatch_src+0x71 >> #12 0xffffffff80c22cab at ng_iface_rcvdata+0xdc >> #13 0xffffffff80c18964 at ng_apply_item+0x20a >> #14 0xffffffff80c17afd at ng_snd_item+0x2a1 >> #15 0xffffffff80c18964 at ng_apply_item+0x20a >> #16 0xffffffff80c17afd at ng_snd_item+0x2a1 >> #17 0xffffffff80c25305 at ng_ppp_rcvdata+0x202 >> Uptime: 18h57m47s >> Physical memory: 2005 MB >> Dumping 1644 MB: 1629 1613 1597 1581 1565 1549 1533 1517 1501 1485 1469 = 1453 >> 1437 1421 1405 1389 1373 1357 1341 1325 1309 1293 1277 1261 1245 1229 12= 13 >> 1197 1181 1165 1149 1133 1117 1101 1085 1069 1053 1037 1021 1005 989 973= 957 >> 941 925 909 893 877 861 845 829 813 797 781 765 749 733 717 701 685 669 = 653 >> 637 621 605 589 573 557 541 525 509 493 477 461 445 429 413 397 381 365 = 349 >> 333 317 301 285 269 253 237 221 205 189 173 157 141 125 109 93 77 61 45 = 29 >> 13 >> >> Reading symbols from /boot/kernel/zfs.ko...Reading symbols from >> /boot/kernel/zfs.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/zfs.ko >> Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from >> /boot/kernel/opensolaris.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/opensolaris.ko >> Reading symbols from /boot/kernel/krpc.ko...Reading symbols from >> /boot/kernel/krpc.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/krpc.ko >> Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from >> /boot/kernel/if_nfe.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/if_nfe.ko >> Reading symbols from /boot/kernel/aio.ko...Reading symbols from >> /boot/kernel/aio.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/aio.ko >> Reading symbols from /boot/kernel/alias_ftp.ko...Reading symbols from >> /boot/kernel/alias_ftp.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/alias_ftp.ko >> Reading symbols from /boot/kernel/if_stf.ko...Reading symbols from >> /boot/kernel/if_stf.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/if_stf.ko >> Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from >> /boot/kernel/ng_socket.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_socket.ko >> Reading symbols from /boot/kernel/netgraph.ko...Reading symbols from >> /boot/kernel/netgraph.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/netgraph.ko >> Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from >> /boot/kernel/ng_mppc.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_mppc.ko >> Reading symbols from /boot/kernel/rc4.ko...Reading symbols from >> /boot/kernel/rc4.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/rc4.ko >> Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from >> /boot/kernel/ng_iface.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_iface.ko >> Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from >> /boot/kernel/ng_ppp.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_ppp.ko >> Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from >> /boot/kernel/ng_tee.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_tee.ko >> Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from >> /boot/kernel/ng_ether.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_ether.ko >> Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from >> /boot/kernel/ng_pppoe.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_pppoe.ko >> Reading symbols from /boot/kernel/accf_http.ko...Reading symbols from >> /boot/kernel/accf_http.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/accf_http.ko >> Reading symbols from /boot/kernel/accf_data.ko...Reading symbols from >> /boot/kernel/accf_data.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/accf_data.ko >> Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from >> /boot/kernel/ng_tcpmss.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_tcpmss.ko >> #0 =A0doadump () at pcpu.h:224 >> 224 =A0 =A0 pcpu.h: No such file or directory. >> =A0 =A0 =A0 =A0in pcpu.h >> (kgdb) #0 =A0doadump () at pcpu.h:224 >> #1 =A00xffffffff8027a615 in boot (howto=3D260) >> =A0 =A0at /usr/src/sys/kern/kern_shutdown.c:419 >> #2 =A00xffffffff8027aa82 in panic (fmt=3DVariable "fmt" is not available= .) >> =A0 =A0at /usr/src/sys/kern/kern_shutdown.c:592 >> #3 =A00xffffffff804466d0 in trap_fatal (frame=3D0xc, eva=3DVariable "eva= " is not >> available.) >> =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:811 >> #4 =A00xffffffff80446a85 in trap_pfault (frame=3D0xffffff80000fe720, use= rmode=3D0) >> =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:727 >> #5 =A00xffffffff80446f2f in trap (frame=3D0xffffff80000fe720) >> =A0 =A0at /usr/src/sys/amd64/amd64/trap.c:477 >> #6 =A00xffffffff8042ff54 in calltrap () >> =A0 =A0at /usr/src/sys/amd64/amd64/exception.S:228 >> #7 =A00xffffffff80c2c8ce in pppoe_findsession (privp=3DVariable "privp" = is not >> available.) >> =A0 =A0at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe= .c:566 >> #8 =A00xffffffff80c2cfe7 in ng_pppoe_rcvdata_ether (hook=3DVariable "hoo= k" is >> not available.) >> =A0 =A0at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe= .c:1613 >> #9 =A00xffffffff80c18964 in ng_apply_item (node=3D0xffffff002105ec00, >> =A0 =A0item=3D0xffffff0054a36500, rw=3D0) >> =A0 =A0at >> /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 >> #10 0xffffffff80c17afd in ng_snd_item (item=3D0xffffff0054a36500, flags= =3D0) >> =A0 =A0at >> /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 >> #11 0xffffffff80320b5a in ether_demux (ifp=3D0xffffff0006862800, >> =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:911 >> #12 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0006862800, >> =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 >> #13 0xffffffff80320aa2 in ether_demux (ifp=3D0xffffff0001676800, >> =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:803 >> #14 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0001676800, >> =A0 =A0m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 >> #15 0xffffffff809eb76e in nfe_jrxeof (sc=3D0xffffff80003ae000, count=3D1= 85, >> =A0 =A0rx_npktsp=3D0x0) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe= .c:2303 >> #16 0xffffffff809effea in nfe_int_task (arg=3DVariable "arg" is not >> available.) >> =A0 =A0at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:1899 >> #17 0xffffffff802b3f7e in taskqueue_run_locked (queue=3D0xffffff00017227= 00) >> =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:248 >> #18 0xffffffff802b410c in taskqueue_thread_loop (arg=3DVariable "arg" is= not >> available.) >> =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:385 >> #19 0xffffffff80252d5d in fork_exit ( >> =A0 =A0callout=3D0xffffffff802b40c4 , >> =A0 =A0arg=3D0xffffff80003ae1b8, frame=3D0xffffff80000fec50) >> =A0 =A0at /usr/src/sys/kern/kern_fork.c:865 >> #20 0xffffffff8043049e in fork_trampoline () >> =A0 =A0at /usr/src/sys/amd64/amd64/exception.S:603 >> #21 0x0000000000000000 in ?? () >> #22 0x0000000000000000 in ?? () >> #23 0x0000000000000000 in ?? () >> #24 0x0000000000000000 in ?? () >> #25 0x0000000000000000 in ?? () >> #26 0x0000000000000000 in ?? () >> #27 0x0000000000000000 in ?? () >> #28 0x0000000000000000 in ?? () >> #29 0x0000000000000000 in ?? () >> #30 0x0000000000000000 in ?? () >> #31 0x0000000000000000 in ?? () >> #32 0x0000000000000000 in ?? () >> #33 0x0000000000000000 in ?? () >> #34 0x0000000000000000 in ?? () >> #35 0x0000000000000000 in ?? () >> #36 0x0000000000000000 in ?? () >> #37 0x0000000000000000 in ?? () >> #38 0x0000000000000000 in ?? () >> #39 0x0000000000000000 in ?? () >> #40 0x0000000000000000 in ?? () >> #41 0x0000000000000000 in ?? () >> #42 0x0000000000000000 in ?? () >> #43 0x0000000000000000 in ?? () >> #44 0x0000000000000000 in ?? () >> #45 0xffffffff80665140 in affinity () >> #46 0x0000000000000000 in ?? () >> #47 0x0000000000000000 in ?? () >> #48 0xffffff0001741460 in ?? () >> #49 0xffffff80000fe380 in ?? () >> #50 0xffffff80000fe328 in ?? () >> #51 0xffffff00015b8000 in ?? () >> #52 0xffffffff8029d819 in sched_switch (td=3D0xffffffff802b40c4, >> =A0 =A0newtd=3D0xffffff80003ae1b8, flags=3DVariable "flags" is not avail= able. >> ) at /usr/src/sys/kern/sched_ule.c:1859 >> Previous frame inner to this frame (corrupt stack?) >> (kgdb) >> >> >> DMESG >> --- >> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 >> =A0 =A0 =A0 =A0The Regents of the University of California. All rights r= eserved. >> FreeBSD is a registered trademark of The FreeBSD Foundation. >> FreeBSD 8.2-STABLE #1: Tue May =A03 22:11:56 MSD 2011 >> =A0 =A0root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug amd64 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> CPU: Intel(R) Atom(TM) CPU =A0330 =A0 @ 1.60GHz (1600.01-MHz K8-class CP= U) >> =A0Origin =3D "GenuineIntel" =A0Id =3D 0x106c2 =A0Family =3D 6 =A0Model = =3D 1c =A0Stepping =3D 2 >> =A0Features=3D0xbfe9fbff >> =A0Features2=3D0x40e31d >> =A0AMD Features=3D0x20000800 >> =A0AMD Features2=3D0x1 >> =A0TSC: P-state invariant >> real memory =A0=3D 2147483648 (2048 MB) >> avail memory =3D 2025250816 (1931 MB) >> ACPI APIC Table: <072310 APIC1353> >> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs >> FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads >> =A0cpu0 (BSP): APIC ID: =A00 >> =A0cpu1 (AP/HT): APIC ID: =A01 >> =A0cpu2 (AP): APIC ID: =A02 >> =A0cpu3 (AP/HT): APIC ID: =A03 >> ioapic0: Changing APIC ID to 4 >> ioapic0 irqs 0-23 on motherboard >> kbd1 at kbdmux0 >> cryptosoft0: on motherboard >> acpi0: <072310 RSDT1353> on motherboard >> acpi0: [ITHREAD] >> acpi0: Power Button (fixed) >> acpi0: reservation of fefe1000, 1000 (3) failed >> acpi0: reservation of fee01000, ff000 (3) failed >> acpi0: reservation of fec00000, 1000 (3) failed >> acpi0: reservation of fee00000, 1000 (3) failed >> acpi0: reservation of 0, a0000 (3) failed >> acpi0: reservation of 100000, 7ff00000 (3) failed >> Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 >> acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 >> cpu0: on acpi0 >> cpu1: on acpi0 >> cpu2: on acpi0 >> cpu3: on acpi0 >> pcib0: port 0xcf8-0xcff on acpi0 >> pci0: on pcib0 >> pci0: at device 0.1 (no driver attached) >> isab0: port 0x4f00-0x4fff at device 3.0 on pci0 >> isa0: on isab0 >> pci0: at device 3.1 (no driver attached) >> pci0: at device 3.2 (no driver attached) >> pci0: at device 3.3 (no driver attached) >> pci0: at device 3.5 (no driver attached) >> ohci0: mem 0xfae7f000-0xfae7ffff ir= q 16 >> at device 4.0 on pci0 >> ohci0: [ITHREAD] >> usbus0: on ohci0 >> ehci0: mem 0xfae7ec00-0xfae7ecf= f >> irq 18 at device 4.1 on pci0 >> ehci0: [ITHREAD] >> usbus1: EHCI version 1.0 >> usbus1: on ehci0 >> pcib1: at device 9.0 on pci0 >> pci3: on pcib1 >> nfe0: port 0xd080-0xd087 mem >> 0xfae7d000-0xfae7dfff,0xfae7e800-0xfae7e8ff,0xfae7e400-0xfae7e40f irq 22= at >> device 10.0 on pci0 >> miibus0: on nfe0 >> rgephy0: PHY 3 on miibus0 >> rgephy0: =A010baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX= -FDX, >> 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, >> 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, aut= o, >> auto-flow >> nfe0: Ethernet address: 00:25:22:21:86:89 >> nfe0: [FILTER] >> ahci0: port >> 0xd000-0xd007,0xcc00-0xcc03,0xc880-0xc887,0xc800-0xc803,0xc480-0xc48f me= m >> 0xfae76000-0xfae77fff irq 23 at device 11.0 on pci0 >> ahci0: [ITHREAD] >> ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported >> ahcich0: at channel 0 on ahci0 >> ahcich0: [ITHREAD] >> ahcich1: at channel 1 on ahci0 >> ahcich1: [ITHREAD] >> ahcich2: at channel 2 on ahci0 >> ahcich2: [ITHREAD] >> ahcich3: at channel 3 on ahci0 >> ahcich3: [ITHREAD] >> ahcich4: at channel 4 on ahci0 >> ahcich4: [ITHREAD] >> ahcich5: at channel 5 on ahci0 >> ahcich5: [ITHREAD] >> pcib2: irq 20 at device 12.0 on pci0 >> pci2: on pcib2 >> pcib3: at device 16.0 on pci0 >> pci1: on pcib3 >> vgapci0: port 0xec00-0xec7f mem >> 0xfb000000-0xfbffffff,0xe0000000-0xefffffff,0xf6000000-0xf7ffffff irq 21= at >> device 0.0 on pci1 >> acpi_button0: on acpi0 >> acpi_hpet0: iomem 0xfed00000-0xfed00fff irq= 2,8 >> on acpi0 >> Timecounter "HPET" frequency 25000000 Hz quality 900 >> atrtc0: port 0x70-0x71 on acpi0 >> uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 >> uart0: [FILTER] >> sc0: at flags 0x100 on isa0 >> sc0: VGA <16 virtual consoles, flags=3D0x300> >> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa= 0 >> atkbdc0: at port 0x60,0x64 on isa0 >> atkbd0: irq 1 on atkbdc0 >> kbd0 at atkbd0 >> atkbd0: [GIANT-LOCKED] >> atkbd0: [ITHREAD] >> p4tcc0: on cpu0 >> p4tcc1: on cpu1 >> p4tcc2: on cpu2 >> p4tcc3: on cpu3 >> ZFS filesystem version 5 >> ZFS storage pool version 28 >> Timecounters tick every 1.000 msec >> ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based >> forwarding enabled, default to deny, logging disabled >> load_dn_sched dn_sched FIFO loaded >> load_dn_sched dn_sched PRIO loaded >> load_dn_sched dn_sched QFQ loaded >> load_dn_sched dn_sched RR loaded >> load_dn_sched dn_sched WF2Q+ loaded >> usbus0: 12Mbps Full Speed USB v1.0 >> usbus1: 480Mbps High Speed USB v2.0 >> ugen0.1: at usbus0 >> uhub0: on usbus= 0 >> ugen1.1: at usbus1 >> uhub1: on usbus= 1 >> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 >> ada0: ATA-7 SATA 2.x device >> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada0: Command Queueing enabled >> ada0: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 >> ada1: ATA-8 SATA 2.x device >> ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada1: Command Queueing enabled >> ada1: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> ada2 at ahcich2 bus 0 scbus2 target 0 lun 0 >> ada2: ATA-8 SATA 2.x device >> ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada2: Command Queueing enabled >> ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada3 at ahcich3 bus 0 scbus3 target 0 lun 0 >> ada3: ATA-7 SATA 2.x device >> ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada3: Command Queueing enabled >> ada3: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> SMP: AP CPU #3 Launched! >> SMP: AP CPU #1 Launched! >> SMP: AP CPU #2 Launched! >> uhub0: 10 ports with 10 removable, self powered >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> uhub1: 10 ports with 10 removable, self powered >> Trying to mount root from zfs:rz >> >> >> KERNCONF >> -------- >>> >>> grep -v -e "^#" /root/conf/ION4debug >> >> cpu =A0 =A0 =A0 =A0 =A0 =A0 HAMMER >> ident =A0 =A0 =A0 =A0 =A0 ION4debug >> >> makeoptions =A0 =A0 DEBUG=3D-g =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Build ke= rnel with gdb(1) debug >> symbols >> >> options =A0 =A0 =A0 =A0 SCHED_ULE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # ULE sche= duler >> options =A0 =A0 =A0 =A0 PREEMPTION =A0 =A0 =A0 =A0 =A0 =A0 =A0# Enable k= ernel thread preemption >> options =A0 =A0 =A0 =A0 INET =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# In= terNETworking >> options =A0 =A0 =A0 =A0 INET6 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # IPv6= communications protocols >> options =A0 =A0 =A0 =A0 FFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Be= rkeley Fast Filesystem >> options =A0 =A0 =A0 =A0 SOFTUPDATES =A0 =A0 =A0 =A0 =A0 =A0 # Enable FFS= soft updates support >> options =A0 =A0 =A0 =A0 UFS_ACL =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Suppor= t for access control lists >> options =A0 =A0 =A0 =A0 UFS_DIRHASH =A0 =A0 =A0 =A0 =A0 =A0 # Improve pe= rformance on big >> directories >> options =A0 =A0 =A0 =A0 UFS_GJOURNAL =A0 =A0 =A0 =A0 =A0 =A0# Enable gjo= urnal-based UFS >> journaling >> options =A0 =A0 =A0 =A0 PROCFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Proc= ess filesystem (requires >> PSEUDOFS) >> options =A0 =A0 =A0 =A0 PSEUDOFS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Pseudo= -filesystem framework >> options =A0 =A0 =A0 =A0 GEOM_PART_GPT =A0 =A0 =A0 =A0 =A0 # GUID Partiti= on Tables. >> options =A0 =A0 =A0 =A0 GEOM_LABEL =A0 =A0 =A0 =A0 =A0 =A0 =A0# Provides= labelization >> options =A0 =A0 =A0 =A0 COMPAT_43TTY =A0 =A0 =A0 =A0 =A0 =A0# BSD 4.3 TT= Y compat (sgtty) >> options =A0 =A0 =A0 =A0 SCSI_DELAY=3D5000 =A0 =A0 =A0 =A0 # Delay (in ms= ) before probing SCSI >> options =A0 =A0 =A0 =A0 KTRACE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# ktra= ce(1) support >> options =A0 =A0 =A0 =A0 STACK =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # stac= k(9) support >> options =A0 =A0 =A0 =A0 SYSVSHM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-s= tyle shared memory >> options =A0 =A0 =A0 =A0 SYSVMSG =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-s= tyle message queues >> options =A0 =A0 =A0 =A0 SYSVSEM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # SYSV-s= tyle semaphores >> options =A0 =A0 =A0 =A0 P1003_1B_SEMAPHORES =A0 =A0 # POSIX-style semaph= ores >> options =A0 =A0 =A0 =A0 _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B rea= l-time >> extensions >> options =A0 =A0 =A0 =A0 PRINTF_BUFR_SIZE=3D128 =A0 =A0# Prevent printf o= utput being >> interspersed. >> options =A0 =A0 =A0 =A0 KBD_INSTALL_CDEV =A0 =A0 =A0 =A0# install a CDEV= entry in /dev >> options =A0 =A0 =A0 =A0 HWPMC_HOOKS =A0 =A0 =A0 =A0 =A0 =A0 # Necessary = kernel hooks for >> hwpmc(4) >> options =A0 =A0 =A0 =A0 AUDIT =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Secu= rity event auditing >> options =A0 =A0 =A0 =A0 MAC =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Tr= ustedBSD MAC Framework >> options =A0 =A0 =A0 =A0 FLOWTABLE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # per-cpu = routing cache >> options =A0 =A0 =A0 =A0 INCLUDE_CONFIG_FILE =A0 =A0 # Include this file = in kernel >> >> options =A0 =A0 =A0 =A0 KDB =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Ke= rnel debugger related code >> options =A0 =A0 =A0 =A0 KDB_TRACE =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Print a = stack trace for a panic >> >> options =A0 =A0 =A0 =A0 SMP =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Sy= mmetric MultiProcessor Kernel >> >> device =A0 =A0 =A0 =A0 =A0cpufreq >> >> options =A0 =A0 =A0 =A0 DEVICE_POLLING >> options =A0 =A0 =A0 =A0 IPFIREWALL >> options =A0 =A0 =A0 =A0 IPDIVERT >> options =A0 =A0 =A0 =A0 IPFIREWALL_FORWARD >> options =A0 =A0 =A0 =A0 IPFIREWALL_NAT >> options =A0 =A0 =A0 =A0 IPSTEALTH >> options =A0 =A0 =A0 =A0 DUMMYNET >> >> options =A0 =A0 =A0 =A0 LIBALIAS >> >> device =A0 =A0 =A0 =A0 =A0crypto >> >> device =A0 =A0 =A0 =A0 =A0acpi >> device =A0 =A0 =A0 =A0 =A0pci >> >> device =A0 =A0 =A0 =A0 =A0ahci >> >> device =A0 =A0 =A0 =A0 =A0scbus =A0 =A0 =A0 =A0 =A0 # SCSI bus (required= for SCSI) >> device =A0 =A0 =A0 =A0 =A0da =A0 =A0 =A0 =A0 =A0 =A0 =A0# Direct Access = (disks) >> device =A0 =A0 =A0 =A0 =A0pass =A0 =A0 =A0 =A0 =A0 =A0# Passthrough devi= ce (direct SCSI access) >> >> device =A0 =A0 =A0 =A0 =A0atkbdc =A0 =A0 =A0 =A0 =A0# AT keyboard contro= ller >> device =A0 =A0 =A0 =A0 =A0atkbd =A0 =A0 =A0 =A0 =A0 # AT keyboard >> device =A0 =A0 =A0 =A0 =A0psm =A0 =A0 =A0 =A0 =A0 =A0 # PS/2 mouse >> >> device =A0 =A0 =A0 =A0 =A0kbdmux =A0 =A0 =A0 =A0 =A0# keyboard multiplex= er >> >> device =A0 =A0 =A0 =A0 =A0vga =A0 =A0 =A0 =A0 =A0 =A0 # VGA video card d= river >> >> device =A0 =A0 =A0 =A0 =A0sc >> >> device =A0 =A0 =A0 =A0 =A0uart =A0 =A0 =A0 =A0 =A0 =A0# Generic UART dri= ver >> >> device =A0 =A0 =A0 =A0 =A0miibus =A0 =A0 =A0 =A0 =A0# MII bus support >> >> device =A0 =A0 =A0 =A0 =A0loop =A0 =A0 =A0 =A0 =A0 =A0# Network loopback >> device =A0 =A0 =A0 =A0 =A0random =A0 =A0 =A0 =A0 =A0# Entropy device >> device =A0 =A0 =A0 =A0 =A0ether =A0 =A0 =A0 =A0 =A0 # Ethernet support >> device =A0 =A0 =A0 =A0 =A0vlan =A0 =A0 =A0 =A0 =A0 =A0# 802.1Q VLAN supp= ort >> device =A0 =A0 =A0 =A0 =A0tun =A0 =A0 =A0 =A0 =A0 =A0 # Packet tunnel. >> device =A0 =A0 =A0 =A0 =A0pty =A0 =A0 =A0 =A0 =A0 =A0 # BSD-style compat= ibility pseudo ttys >> device =A0 =A0 =A0 =A0 =A0md =A0 =A0 =A0 =A0 =A0 =A0 =A0# Memory "disks" >> device =A0 =A0 =A0 =A0 =A0gif =A0 =A0 =A0 =A0 =A0 =A0 # IPv6 and IPv4 tu= nneling >> device =A0 =A0 =A0 =A0 =A0faith =A0 =A0 =A0 =A0 =A0 # IPv6-to-IPv4 relay= ing (translation) >> device =A0 =A0 =A0 =A0 =A0firmware =A0 =A0 =A0 =A0# firmware assist modu= le >> >> device =A0 =A0 =A0 =A0 =A0bpf =A0 =A0 =A0 =A0 =A0 =A0 # Berkeley packet = filter >> >> device =A0 =A0 =A0 =A0 =A0uhci =A0 =A0 =A0 =A0 =A0 =A0# UHCI PCI->USB in= terface >> device =A0 =A0 =A0 =A0 =A0ohci =A0 =A0 =A0 =A0 =A0 =A0# OHCI PCI->USB in= terface >> device =A0 =A0 =A0 =A0 =A0ehci =A0 =A0 =A0 =A0 =A0 =A0# EHCI PCI->USB in= terface (USB 2.0) >> device =A0 =A0 =A0 =A0 =A0usb =A0 =A0 =A0 =A0 =A0 =A0 # USB Bus (require= d) >> device =A0 =A0 =A0 =A0 =A0uhid =A0 =A0 =A0 =A0 =A0 =A0# "Human Interface= Devices" >> device =A0 =A0 =A0 =A0 =A0ukbd =A0 =A0 =A0 =A0 =A0 =A0# Keyboard >> device =A0 =A0 =A0 =A0 =A0umass =A0 =A0 =A0 =A0 =A0 # Disks/Mass storage= - Requires scbus and da >> device =A0 =A0 =A0 =A0 =A0ums =A0 =A0 =A0 =A0 =A0 =A0 # Mouse >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> > From owner-freebsd-net@FreeBSD.ORG Thu May 5 18:55:19 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110A81065672 for ; Thu, 5 May 2011 18:55:19 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CAECF8FC0A for ; Thu, 5 May 2011 18:55:18 +0000 (UTC) Received: by iwn33 with SMTP id 33so2899643iwn.13 for ; Thu, 05 May 2011 11:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1zO0hk/FqptRYn7Y/jwVx3Htu3YwEGzT1SXnd5zcYw4=; b=o1unlHSEfHi5CjHyayT+ekJV0JrBkAQKuWuGMLOZUQPqW/ZZSlsB4NX8cr/Lv586TC LjCkIel/tQc3n2LpaZ2KLWrFG/PtnWQLGdSUsaf1uxnXM/RAUPca7KMWCmCERoAK3OmF t6k+8cv3crwNaqvqOx0aJZHizwGolTuW2rOOI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=m7QEq0Vqwwj1Y7Z0Yw0LqaGhB24w0Q1+hO2IgvZLDpNsZq+mNgdejtYPi6oi7rXVOl 1y/1F8X/h9mgIbFSYFMoxcG/7WiHKrnb1VAz/msmQtfim8AzQ51OG+UNOIZdL4bdRNMr TezOvTPk2QYkOMim/dQcGJsWfkXwOjEnlAXA4= MIME-Version: 1.0 Received: by 10.42.162.202 with SMTP id z10mr1466530icx.203.1304621718033; Thu, 05 May 2011 11:55:18 -0700 (PDT) Received: by 10.42.167.5 with HTTP; Thu, 5 May 2011 11:55:18 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 May 2011 14:55:18 -0400 Message-ID: From: Arnaud Lacombe To: Emil Muratov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, Paolo Pisati Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 18:55:19 -0000 Hi, On Thu, May 5, 2011 at 2:49 PM, Arnaud Lacombe wrote: > There is a stale reference to the mbuf passed to, and freed in > m_megapullup(); could you test the following patch ? > > diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c > index f8c3e63..80c13dc 100644 > --- a/sys/netinet/ipfw/ip_fw_nat.c > +++ b/sys/netinet/ipfw/ip_fw_nat.c > @@ -263,7 +263,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat > *t, struct mbuf *m) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0retval =3D LibAliasOut(t->lib, c, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mcl->m_len + M_TRAILINGSPA= CE(mcl)); > =A0 =A0 =A0 =A0if (retval =3D=3D PKT_ALIAS_RESPOND) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 m->m_flags |=3D M_SKIP_FIREWALL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mcl->m_flags |=3D M_SKIP_FIREWALL; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0retval =3D PKT_ALIAS_OK; > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (retval !=3D PKT_ALIAS_OK && > > This was introduced in r188294 by piso@ (added to the CC: list). > this can only happen if you are NAT'ing SCTP traffic. So it might not be the culprit in your case.. =A0- Arnaud From owner-freebsd-net@FreeBSD.ORG Thu May 5 19:27:41 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E14106566B for ; Thu, 5 May 2011 19:27:41 +0000 (UTC) (envelope-from gpm@hotplug.ru) Received: from shadow.rusoft.ru (shadow.rusoft.ru [217.16.18.75]) by mx1.freebsd.org (Postfix) with ESMTP id B717C8FC08 for ; Thu, 5 May 2011 19:27:40 +0000 (UTC) Received: from shadow.rusoft.ru (localhost [127.0.0.1]) by shadow.rusoft.ru (Postfix) with ESMTP id 085C63375; Thu, 5 May 2011 23:27:39 +0400 (MSD) Received: from jazz.rusoft.ru (unknown [83.222.3.162]) by shadow.rusoft.ru (Postfix) with ESMTP id C899C3373; Thu, 5 May 2011 23:27:38 +0400 (MSD) Received: from ghost-pc.home.lan (unknown [213.141.135.21]) by jazz.rusoft.ru (Postfix) with ESMTPA id 786771CC00F; Thu, 5 May 2011 23:27:38 +0400 (MSD) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Arnaud Lacombe" References: Date: Thu, 05 May 2011 23:27:29 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Emil Muratov" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.10 (Win32) X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-net@freebsd.org Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 19:27:41 -0000 >> Hi all. >> >> I have a small home router/nas running nvidia ion platform with onboa= rd = >> nfe >> LAN adapter. >> About a month ago I changed ISP and setup pppoe client with mpd5.5. = >> Since >> that time my router >> issues kernel panic once or twice a day with "Fatal trap 12: page fau= lt >> while in kernel mode" and (nfe0 taskq) is the current process. >> Updating to the latest stable doesn't help. I don=E2=80=99t know what= to do = >> next, >> any help would be much appreciated. Below is kgdb backtrace, dmesg = >> output, >> kernel config file, if anything is missing just let me know. >> > Your error looks like a nice use-after-free. Could you 'disassemble > 0xffffffff8037d7bb' in gdb, and find the matching faulty dereference ?= Hi. Thanx for reply! I'm afraid my skills is not enough to understand = "'disassemble > 0xffffffff8037d7bb' in gdb, and find the matching faulty dereference" = :( Can you provide me some step-by-step tips for dummies? ;) I'll try to do= = my best. > I'd tend not to trust code relying on "big hack", as per the preamble > of m_megapullup(): > > /* > * m_megapullup() - this function is a big hack. > * Thankfully, it's only used in ng_nat and ipfw+nat. > *... > > which look like a re-invention of m_copydata()... > > - Arnaud > >> Thanx. >> >> >> >> =3D=3D=3D=3D=3D >> epia.home.lan dumped core - see /crash/vmcore.15 >> >> Thu May 5 18:29:58 MSD 2011 >> >> FreeBSD epia.home.lan 8.2-STABLE FreeBSD 8.2-STABLE #1: Tue May 3 = >> 22:11:56 >> MSD 2011 root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug amd64= >> >> panic: page fault >> >> GNU gdb 6.1.1 [FreeBSD] >> Copyright 2004 Free Software Foundation, Inc. >> GDB is free software, covered by the GNU General Public License, and = = >> you are >> welcome to change it and/or distribute copies of it under certain >> conditions. >> Type "show copying" to see the conditions. >> There is absolutely no warranty for GDB. Type "show warranty" for = >> details. >> This GDB was configured as "amd64-marcel-freebsd"... >> >> Unread portion of the kernel message buffer: >> >> Fatal trap 12: page fault while in kernel mode >> cpuid =3D 0; apic id =3D 00 >> fault virtual address =3D 0xffffff800ff02ac8 >> fault code =3D supervisor write data, page not present >> instruction pointer =3D 0x20:0xffffffff8037d7bb >> stack pointer =3D 0x28:0xffffff80000fde20 >> frame pointer =3D 0x28:0xffffff80000fde60 >> code segment =3D base 0x0, limit 0xfffff, type 0x1b >> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >> processor eflags =3D interrupt enabled, resume, IOPL =3D 0 >> current process =3D 0 (nfe0 taskq) >> trap number =3D 12 >> panic: page fault >> cpuid =3D 0 >> KDB: stack backtrace: >> #0 0xffffffff802a97a3 at kdb_backtrace+0x5e >> #1 0xffffffff8027aa98 at panic+0x182 >> #2 0xffffffff804466d0 at trap_fatal+0x292 >> #3 0xffffffff80446a85 at trap_pfault+0x286 >> #4 0xffffffff80446f2f at trap+0x3cb >> #5 0xffffffff8042ff54 at calltrap+0x8 >> #6 0xffffffff8035ceb4 at ipfw_nat+0x20a >> #7 0xffffffff803547e3 at ipfw_chk+0xbaf >> #8 0xffffffff8035977c at ipfw_check_hook+0xf9 >> #9 0xffffffff8032a221 at pfil_run_hooks+0x9c >> #10 0xffffffff8035fe84 at ip_input+0x2d0 >> #11 0xffffffff8032947f at netisr_dispatch_src+0x71 >> #12 0xffffffff80c22cab at ng_iface_rcvdata+0xdc >> #13 0xffffffff80c18964 at ng_apply_item+0x20a >> #14 0xffffffff80c17afd at ng_snd_item+0x2a1 >> #15 0xffffffff80c18964 at ng_apply_item+0x20a >> #16 0xffffffff80c17afd at ng_snd_item+0x2a1 >> #17 0xffffffff80c25305 at ng_ppp_rcvdata+0x202 >> Uptime: 18h57m47s >> Physical memory: 2005 MB >> Dumping 1644 MB: 1629 1613 1597 1581 1565 1549 1533 1517 1501 1485 14= 69 = >> 1453 >> 1437 1421 1405 1389 1373 1357 1341 1325 1309 1293 1277 1261 1245 1229= = >> 1213 >> 1197 1181 1165 1149 1133 1117 1101 1085 1069 1053 1037 1021 1005 989 = = >> 973 957 >> 941 925 909 893 877 861 845 829 813 797 781 765 749 733 717 701 685 6= 69 = >> 653 >> 637 621 605 589 573 557 541 525 509 493 477 461 445 429 413 397 381 3= 65 = >> 349 >> 333 317 301 285 269 253 237 221 205 189 173 157 141 125 109 93 77 61 = 45 = >> 29 >> 13 >> >> Reading symbols from /boot/kernel/zfs.ko...Reading symbols from >> /boot/kernel/zfs.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/zfs.ko >> Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols fr= om >> /boot/kernel/opensolaris.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/opensolaris.ko >> Reading symbols from /boot/kernel/krpc.ko...Reading symbols from >> /boot/kernel/krpc.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/krpc.ko >> Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from >> /boot/kernel/if_nfe.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/if_nfe.ko >> Reading symbols from /boot/kernel/aio.ko...Reading symbols from >> /boot/kernel/aio.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/aio.ko >> Reading symbols from /boot/kernel/alias_ftp.ko...Reading symbols from= >> /boot/kernel/alias_ftp.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/alias_ftp.ko >> Reading symbols from /boot/kernel/if_stf.ko...Reading symbols from >> /boot/kernel/if_stf.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/if_stf.ko >> Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from= >> /boot/kernel/ng_socket.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_socket.ko >> Reading symbols from /boot/kernel/netgraph.ko...Reading symbols from >> /boot/kernel/netgraph.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/netgraph.ko >> Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from >> /boot/kernel/ng_mppc.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_mppc.ko >> Reading symbols from /boot/kernel/rc4.ko...Reading symbols from >> /boot/kernel/rc4.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/rc4.ko >> Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from >> /boot/kernel/ng_iface.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_iface.ko >> Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from >> /boot/kernel/ng_ppp.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_ppp.ko >> Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from >> /boot/kernel/ng_tee.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_tee.ko >> Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from >> /boot/kernel/ng_ether.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_ether.ko >> Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from >> /boot/kernel/ng_pppoe.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_pppoe.ko >> Reading symbols from /boot/kernel/accf_http.ko...Reading symbols from= >> /boot/kernel/accf_http.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/accf_http.ko >> Reading symbols from /boot/kernel/accf_data.ko...Reading symbols from= >> /boot/kernel/accf_data.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/accf_data.ko >> Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from= >> /boot/kernel/ng_tcpmss.ko.symbols...done. >> done. >> Loaded symbols for /boot/kernel/ng_tcpmss.ko >> #0 doadump () at pcpu.h:224 >> 224 pcpu.h: No such file or directory. >> in pcpu.h >> (kgdb) #0 doadump () at pcpu.h:224 >> #1 0xffffffff8027a615 in boot (howto=3D260) >> at /usr/src/sys/kern/kern_shutdown.c:419 >> #2 0xffffffff8027aa82 in panic (fmt=3DVariable "fmt" is not availabl= e.) >> at /usr/src/sys/kern/kern_shutdown.c:592 >> #3 0xffffffff804466d0 in trap_fatal (frame=3D0xc, eva=3DVariable "ev= a" is = >> not >> available.) >> at /usr/src/sys/amd64/amd64/trap.c:811 >> #4 0xffffffff80446a85 in trap_pfault (frame=3D0xffffff80000fe720, = >> usermode=3D0) >> at /usr/src/sys/amd64/amd64/trap.c:727 >> #5 0xffffffff80446f2f in trap (frame=3D0xffffff80000fe720) >> at /usr/src/sys/amd64/amd64/trap.c:477 >> #6 0xffffffff8042ff54 in calltrap () >> at /usr/src/sys/amd64/amd64/exception.S:228 >> #7 0xffffffff80c2c8ce in pppoe_findsession (privp=3DVariable "privp"= is = >> not >> available.) >> at = >> /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.c:566 >> #8 0xffffffff80c2cfe7 in ng_pppoe_rcvdata_ether (hook=3DVariable "ho= ok" = >> is >> not available.) >> at = >> /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.c:1613= >> #9 0xffffffff80c18964 in ng_apply_item (node=3D0xffffff002105ec00, >> item=3D0xffffff0054a36500, rw=3D0) >> at >> /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:23= 27 >> #10 0xffffffff80c17afd in ng_snd_item (item=3D0xffffff0054a36500, fla= gs=3D0) >> at >> /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:22= 44 >> #11 0xffffffff80320b5a in ether_demux (ifp=3D0xffffff0006862800, >> m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:911 >> #12 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0006862800, >> m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 >> #13 0xffffffff80320aa2 in ether_demux (ifp=3D0xffffff0001676800, >> m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:803 >> #14 0xffffffff80320f41 in ether_input (ifp=3D0xffffff0001676800, >> m=3D0xffffff0039907700) at /usr/src/sys/net/if_ethersubr.c:753 >> #15 0xffffffff809eb76e in nfe_jrxeof (sc=3D0xffffff80003ae000, count=3D= 185, >> rx_npktsp=3D0x0) at = >> /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:2303 >> #16 0xffffffff809effea in nfe_int_task (arg=3DVariable "arg" is not >> available.) >> at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:1899 >> #17 0xffffffff802b3f7e in taskqueue_run_locked = >> (queue=3D0xffffff0001722700) >> at /usr/src/sys/kern/subr_taskqueue.c:248 >> #18 0xffffffff802b410c in taskqueue_thread_loop (arg=3DVariable "arg"= is = >> not >> available.) >> at /usr/src/sys/kern/subr_taskqueue.c:385 >> #19 0xffffffff80252d5d in fork_exit ( >> callout=3D0xffffffff802b40c4 , >> arg=3D0xffffff80003ae1b8, frame=3D0xffffff80000fec50) >> at /usr/src/sys/kern/kern_fork.c:865 >> #20 0xffffffff8043049e in fork_trampoline () >> at /usr/src/sys/amd64/amd64/exception.S:603 >> #21 0x0000000000000000 in ?? () >> #22 0x0000000000000000 in ?? () >> #23 0x0000000000000000 in ?? () >> #24 0x0000000000000000 in ?? () >> #25 0x0000000000000000 in ?? () >> #26 0x0000000000000000 in ?? () >> #27 0x0000000000000000 in ?? () >> #28 0x0000000000000000 in ?? () >> #29 0x0000000000000000 in ?? () >> #30 0x0000000000000000 in ?? () >> #31 0x0000000000000000 in ?? () >> #32 0x0000000000000000 in ?? () >> #33 0x0000000000000000 in ?? () >> #34 0x0000000000000000 in ?? () >> #35 0x0000000000000000 in ?? () >> #36 0x0000000000000000 in ?? () >> #37 0x0000000000000000 in ?? () >> #38 0x0000000000000000 in ?? () >> #39 0x0000000000000000 in ?? () >> #40 0x0000000000000000 in ?? () >> #41 0x0000000000000000 in ?? () >> #42 0x0000000000000000 in ?? () >> #43 0x0000000000000000 in ?? () >> #44 0x0000000000000000 in ?? () >> #45 0xffffffff80665140 in affinity () >> #46 0x0000000000000000 in ?? () >> #47 0x0000000000000000 in ?? () >> #48 0xffffff0001741460 in ?? () >> #49 0xffffff80000fe380 in ?? () >> #50 0xffffff80000fe328 in ?? () >> #51 0xffffff00015b8000 in ?? () >> #52 0xffffffff8029d819 in sched_switch (td=3D0xffffffff802b40c4, >> newtd=3D0xffffff80003ae1b8, flags=3DVariable "flags" is not availa= ble. >> ) at /usr/src/sys/kern/sched_ule.c:1859 >> Previous frame inner to this frame (corrupt stack?) >> (kgdb) >> >> >> DMESG >> --- >> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1= 994 >> The Regents of the University of California. All rights reserv= ed. >> FreeBSD is a registered trademark of The FreeBSD Foundation. >> FreeBSD 8.2-STABLE #1: Tue May 3 22:11:56 MSD 2011 >> root@epia.home.lan:/usr/obj/usr/src/sys/ION4debug amd64 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> CPU: Intel(R) Atom(TM) CPU 330 @ 1.60GHz (1600.01-MHz K8-class CPU= ) >> Origin =3D "GenuineIntel" Id =3D 0x106c2 Family =3D 6 Model =3D 1= c = >> Stepping =3D 2 >> Features=3D0xbfe9fbff >> Features2=3D0x40e31d >> AMD Features=3D0x20000800 >> AMD Features2=3D0x1 >> TSC: P-state invariant >> real memory =3D 2147483648 (2048 MB) >> avail memory =3D 2025250816 (1931 MB) >> ACPI APIC Table: <072310 APIC1353> >> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs >> FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads >> cpu0 (BSP): APIC ID: 0 >> cpu1 (AP/HT): APIC ID: 1 >> cpu2 (AP): APIC ID: 2 >> cpu3 (AP/HT): APIC ID: 3 >> ioapic0: Changing APIC ID to 4 >> ioapic0 irqs 0-23 on motherboard >> kbd1 at kbdmux0 >> cryptosoft0: on motherboard >> acpi0: <072310 RSDT1353> on motherboard >> acpi0: [ITHREAD] >> acpi0: Power Button (fixed) >> acpi0: reservation of fefe1000, 1000 (3) failed >> acpi0: reservation of fee01000, ff000 (3) failed >> acpi0: reservation of fec00000, 1000 (3) failed >> acpi0: reservation of fee00000, 1000 (3) failed >> acpi0: reservation of 0, a0000 (3) failed >> acpi0: reservation of 100000, 7ff00000 (3) failed >> Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 >> acpi_timer0: <32-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi= 0 >> cpu0: on acpi0 >> cpu1: on acpi0 >> cpu2: on acpi0 >> cpu3: on acpi0 >> pcib0: port 0xcf8-0xcff on acpi0 >> pci0: on pcib0 >> pci0: at device 0.1 (no driver attached) >> isab0: port 0x4f00-0x4fff at device 3.0 on pci0 >> isa0: on isab0 >> pci0: at device 3.1 (no driver attached) >> pci0: at device 3.2 (no driver attached) >> pci0: at device 3.3 (no driver attached) >> pci0: at device 3.5 (no driver attached) >> ohci0: mem 0xfae7f000-0xfae7ffff= = >> irq 16 >> at device 4.0 on pci0 >> ohci0: [ITHREAD] >> usbus0: on ohci0 >> ehci0: mem = >> 0xfae7ec00-0xfae7ecff >> irq 18 at device 4.1 on pci0 >> ehci0: [ITHREAD] >> usbus1: EHCI version 1.0 >> usbus1: on ehci0 >> pcib1: at device 9.0 on pci0 >> pci3: on pcib1 >> nfe0: port 0xd080-0xd087 mem= >> 0xfae7d000-0xfae7dfff,0xfae7e800-0xfae7e8ff,0xfae7e400-0xfae7e40f irq= = >> 22 at >> device 10.0 on pci0 >> miibus0: on nfe0 >> rgephy0: PHY 3 on miibus0 >> rgephy0: 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, = >> 100baseTX-FDX, >> 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, >> 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, = = >> auto, >> auto-flow >> nfe0: Ethernet address: 00:25:22:21:86:89 >> nfe0: [FILTER] >> ahci0: port >> 0xd000-0xd007,0xcc00-0xcc03,0xc880-0xc887,0xc800-0xc803,0xc480-0xc48f= = >> mem >> 0xfae76000-0xfae77fff irq 23 at device 11.0 on pci0 >> ahci0: [ITHREAD] >> ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported >> ahcich0: at channel 0 on ahci0 >> ahcich0: [ITHREAD] >> ahcich1: at channel 1 on ahci0 >> ahcich1: [ITHREAD] >> ahcich2: at channel 2 on ahci0 >> ahcich2: [ITHREAD] >> ahcich3: at channel 3 on ahci0 >> ahcich3: [ITHREAD] >> ahcich4: at channel 4 on ahci0 >> ahcich4: [ITHREAD] >> ahcich5: at channel 5 on ahci0 >> ahcich5: [ITHREAD] >> pcib2: irq 20 at device 12.0 on pci0 >> pci2: on pcib2 >> pcib3: at device 16.0 on pci0 >> pci1: on pcib3 >> vgapci0: port 0xec00-0xec7f mem >> 0xfb000000-0xfbffffff,0xe0000000-0xefffffff,0xf6000000-0xf7ffffff irq= = >> 21 at >> device 0.0 on pci1 >> acpi_button0: on acpi0 >> acpi_hpet0: iomem 0xfed00000-0xfed00fff = = >> irq 2,8 >> on acpi0 >> Timecounter "HPET" frequency 25000000 Hz quality 900 >> atrtc0: port 0x70-0x71 on acpi0 >> uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acp= i0 >> uart0: [FILTER] >> sc0: at flags 0x100 on isa0 >> sc0: VGA <16 virtual consoles, flags=3D0x300> >> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on = = >> isa0 >> atkbdc0: at port 0x60,0x64 on isa0 >> atkbd0: irq 1 on atkbdc0 >> kbd0 at atkbd0 >> atkbd0: [GIANT-LOCKED] >> atkbd0: [ITHREAD] >> p4tcc0: on cpu0 >> p4tcc1: on cpu1 >> p4tcc2: on cpu2 >> p4tcc3: on cpu3 >> ZFS filesystem version 5 >> ZFS storage pool version 28 >> Timecounters tick every 1.000 msec >> ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based >> forwarding enabled, default to deny, logging disabled >> load_dn_sched dn_sched FIFO loaded >> load_dn_sched dn_sched PRIO loaded >> load_dn_sched dn_sched QFQ loaded >> load_dn_sched dn_sched RR loaded >> load_dn_sched dn_sched WF2Q+ loaded >> usbus0: 12Mbps Full Speed USB v1.0 >> usbus1: 480Mbps High Speed USB v2.0 >> ugen0.1: at usbus0 >> uhub0: on = >> usbus0 >> ugen1.1: at usbus1 >> uhub1: on = >> usbus1 >> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 >> ada0: ATA-7 SATA 2.x device >> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada0: Command Queueing enabled >> ada0: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 >> ada1: ATA-8 SATA 2.x device >> ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada1: Command Queueing enabled >> ada1: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> ada2 at ahcich2 bus 0 scbus2 target 0 lun 0 >> ada2: ATA-8 SATA 2.x device >> ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada2: Command Queueing enabled >> ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C) >> ada3 at ahcich3 bus 0 scbus3 target 0 lun 0 >> ada3: ATA-7 SATA 2.x device >> ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada3: Command Queueing enabled >> ada3: 1430799MB (2930277168 512 byte sectors: 16H 63S/T 16383C) >> SMP: AP CPU #3 Launched! >> SMP: AP CPU #1 Launched! >> SMP: AP CPU #2 Launched! >> uhub0: 10 ports with 10 removable, self powered >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> Root mount waiting for: usbus1 >> uhub1: 10 ports with 10 removable, self powered >> Trying to mount root from zfs:rz >> >> >> KERNCONF >> -------- >>> >>> grep -v -e "^#" /root/conf/ION4debug >> >> cpu HAMMER >> ident ION4debug >> >> makeoptions DEBUG=3D-g # Build kernel with gdb(1) = debug >> symbols >> >> options SCHED_ULE # ULE scheduler >> options PREEMPTION # Enable kernel thread = >> preemption >> options INET # InterNETworking >> options INET6 # IPv6 communications protoco= ls >> options FFS # Berkeley Fast Filesystem >> options SOFTUPDATES # Enable FFS soft updates = >> support >> options UFS_ACL # Support for access control = = >> lists >> options UFS_DIRHASH # Improve performance on big >> directories >> options UFS_GJOURNAL # Enable gjournal-based UFS >> journaling >> options PROCFS # Process filesystem (require= s >> PSEUDOFS) >> options PSEUDOFS # Pseudo-filesystem framework= >> options GEOM_PART_GPT # GUID Partition Tables. >> options GEOM_LABEL # Provides labelization >> options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) >> options SCSI_DELAY=3D5000 # Delay (in ms) before prob= ing = >> SCSI >> options KTRACE # ktrace(1) support >> options STACK # stack(9) support >> options SYSVSHM # SYSV-style shared memory >> options SYSVMSG # SYSV-style message queues >> options SYSVSEM # SYSV-style semaphores >> options P1003_1B_SEMAPHORES # POSIX-style semaphores >> options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-tim= e >> extensions >> options PRINTF_BUFR_SIZE=3D128 # Prevent printf output bei= ng >> interspersed. >> options KBD_INSTALL_CDEV # install a CDEV entry in /de= v >> options HWPMC_HOOKS # Necessary kernel hooks for >> hwpmc(4) >> options AUDIT # Security event auditing >> options MAC # TrustedBSD MAC Framework >> options FLOWTABLE # per-cpu routing cache >> options INCLUDE_CONFIG_FILE # Include this file in kernel= >> >> options KDB # Kernel debugger related cod= e >> options KDB_TRACE # Print a stack trace for a = >> panic >> >> options SMP # Symmetric MultiProcessor = >> Kernel >> >> device cpufreq >> >> options DEVICE_POLLING >> options IPFIREWALL >> options IPDIVERT >> options IPFIREWALL_FORWARD >> options IPFIREWALL_NAT >> options IPSTEALTH >> options DUMMYNET >> >> options LIBALIAS >> >> device crypto >> >> device acpi >> device pci >> >> device ahci >> >> device scbus # SCSI bus (required for SCSI) >> device da # Direct Access (disks) >> device pass # Passthrough device (direct SCSI = >> access) >> >> device atkbdc # AT keyboard controller >> device atkbd # AT keyboard >> device psm # PS/2 mouse >> >> device kbdmux # keyboard multiplexer >> >> device vga # VGA video card driver >> >> device sc >> >> device uart # Generic UART driver >> >> device miibus # MII bus support >> >> device loop # Network loopback >> device random # Entropy device >> device ether # Ethernet support >> device vlan # 802.1Q VLAN support >> device tun # Packet tunnel. >> device pty # BSD-style compatibility pseudo ttys= >> device md # Memory "disks" >> device gif # IPv6 and IPv4 tunneling >> device faith # IPv6-to-IPv4 relaying (translation)= >> device firmware # firmware assist module >> >> device bpf # Berkeley packet filter >> >> device uhci # UHCI PCI->USB interface >> device ohci # OHCI PCI->USB interface >> device ehci # EHCI PCI->USB interface (USB 2.0) >> device usb # USB Bus (required) >> device uhid # "Human Interface Devices" >> device ukbd # Keyboard >> device umass # Disks/Mass storage - Requires scbus= = >> and da >> device ums # Mouse >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org= " >> > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"= -- = =D0=9D=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE =D0=B2 =D0=BF=D0=BE=D1=87= =D1=82=D0=BE=D0=B2=D0=BE=D0=BC =D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B5= =D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0 Opera: http://www.oper= a.com/mail/ From owner-freebsd-net@FreeBSD.ORG Thu May 5 19:33:06 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BB3A1065674 for ; Thu, 5 May 2011 19:33:06 +0000 (UTC) (envelope-from gpm@hotplug.ru) Received: from shadow.rusoft.ru (shadow.rusoft.ru [217.16.18.75]) by mx1.freebsd.org (Postfix) with ESMTP id E1D878FC1C for ; Thu, 5 May 2011 19:33:05 +0000 (UTC) Received: from shadow.rusoft.ru (localhost [127.0.0.1]) by shadow.rusoft.ru (Postfix) with ESMTP id 758C335BD; Thu, 5 May 2011 23:33:04 +0400 (MSD) Received: from jazz.rusoft.ru (unknown [83.222.3.162]) by shadow.rusoft.ru (Postfix) with ESMTP id 4E16835BC; Thu, 5 May 2011 23:33:04 +0400 (MSD) Received: from ghost-pc.home.lan (unknown [213.141.135.21]) by jazz.rusoft.ru (Postfix) with ESMTPA id 7579F1CC011; Thu, 5 May 2011 23:33:04 +0400 (MSD) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Arnaud Lacombe" References: Date: Thu, 05 May 2011 23:32:55 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Emil Muratov" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.10 (Win32) X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-net@freebsd.org Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 19:33:06 -0000 > Hi, > > On Thu, May 5, 2011 at 2:49 PM, Arnaud Lacombe > wrote: >> There is a stale reference to the mbuf passed to, and freed in >> m_megapullup(); could you test the following patch ? >> >> diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c >> index f8c3e63..80c13dc 100644 >> --- a/sys/netinet/ipfw/ip_fw_nat.c >> +++ b/sys/netinet/ipfw/ip_fw_nat.c >> @@ -263,7 +263,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat >> *t, struct mbuf *m) >> retval = LibAliasOut(t->lib, c, >> mcl->m_len + M_TRAILINGSPACE(mcl)); >> if (retval == PKT_ALIAS_RESPOND) { >> - m->m_flags |= M_SKIP_FIREWALL; >> + mcl->m_flags |= M_SKIP_FIREWALL; >> retval = PKT_ALIAS_OK; >> } >> if (retval != PKT_ALIAS_OK && >> >> This was introduced in r188294 by piso@ (added to the CC: list). >> > this can only happen if you are NAT'ing SCTP traffic. So it might not > be the culprit in your case.. > > - Arnaud I don't use anything related to sctp but I'll do check the patch, there is nothing more to do for me now anyway. From owner-freebsd-net@FreeBSD.ORG Fri May 6 03:20:13 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 825E1106564A for ; Fri, 6 May 2011 03:20:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 074C58FC14 for ; Fri, 6 May 2011 03:20:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p463KCjO003637 for ; Fri, 6 May 2011 03:20:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p463KC1J003636; Fri, 6 May 2011 03:20:12 GMT (envelope-from gnats) Date: Fri, 6 May 2011 03:20:12 GMT Message-Id: <201105060320.p463KC1J003636@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Marcus Reid Cc: Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marcus Reid List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 03:20:13 -0000 The following reply was made to PR kern/156667; it has been noted by GNATS. From: Marcus Reid To: Arnaud Lacombe Cc: bug-followup@FreeBSD.org Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 Date: Thu, 5 May 2011 20:10:24 -0700 Looks like a fix for this problem was just checked in 9 hours ago. This ticket can be closed. From owner-freebsd-net@FreeBSD.ORG Fri May 6 03:30:19 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5AA1065740 for ; Fri, 6 May 2011 03:30:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 53DA08FC0C for ; Fri, 6 May 2011 03:30:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p463UJYA011941 for ; Fri, 6 May 2011 03:30:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p463UJQx011938; Fri, 6 May 2011 03:30:19 GMT (envelope-from gnats) Date: Fri, 6 May 2011 03:30:19 GMT Message-Id: <201105060330.p463UJQx011938@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Marcus Reid Cc: Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marcus Reid List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 03:30:19 -0000 The following reply was made to PR kern/156667; it has been noted by GNATS. From: Marcus Reid To: Arnaud Lacombe Cc: bug-followup@FreeBSD.org Subject: Re: kern/156667: [em] em0 fails to init on CURRENT after March 17 Date: Thu, 5 May 2011 19:53:27 -0700 On Tue, May 03, 2011 at 12:22:47PM -0400, Arnaud Lacombe wrote: > could you include the output of `netstat -m' ? it is all likely to be > yet another "`nmbclusterrs' too low issue", in which case bumping > `kern.ipc.nmbclusters' will do the job. Here's default, with problem: 1025/640/1665 mbufs in use (current/cache/total) 1023/297/1320/25600 mbuf clusters in use (current/cache/total/max) 1023/257 mbuf+clusters out of packet secondary zone in use (current/cache) 0/35/35/12800 4k (page size) jumbo clusters in use (current/cache/total/max) 0/0/0/6400 9k jumbo clusters in use (current/cache/total/max) 0/0/0/3200 16k jumbo clusters in use (current/cache/total/max) 2302K/894K/3196K bytes allocated to network (current/cache/total) 0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters) 0/0/0 requests for jumbo clusters denied (4k/9k/16k) 0/0/0 sfbufs in use (current/peak/max) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 0 calls to protocol drain routines Here's with kern.ipc.nmbclusters bumped to 100000, same problem: 1025/640/1665 mbufs in use (current/cache/total) 1023/305/1328/100000 mbuf clusters in use (current/cache/total/max) 1023/257 mbuf+clusters out of packet secondary zone in use (current/cache) 0/35/35/50000 4k (page size) jumbo clusters in use (current/cache/total/max) 0/0/0/25000 9k jumbo clusters in use (current/cache/total/max) 0/0/0/12500 16k jumbo clusters in use (current/cache/total/max) 2302K/910K/3212K bytes allocated to network (current/cache/total) 0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters) 0/0/0 requests for jumbo clusters denied (4k/9k/16k) 0/0/0 sfbufs in use (current/peak/max) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 0 calls to protocol drain routines From owner-freebsd-net@FreeBSD.ORG Fri May 6 14:11:00 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD071106567E for ; Fri, 6 May 2011 14:11:00 +0000 (UTC) (envelope-from cole@opteqint.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B424F8FC13 for ; Fri, 6 May 2011 14:11:00 +0000 (UTC) Received: by iyj12 with SMTP id 12so3812436iyj.13 for ; Fri, 06 May 2011 07:11:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.186.85 with SMTP id cr21mr2273134ibb.164.1304689755917; Fri, 06 May 2011 06:49:15 -0700 (PDT) Received: by 10.231.33.8 with HTTP; Fri, 6 May 2011 06:49:15 -0700 (PDT) X-Originating-IP: [196.215.131.152] Date: Fri, 6 May 2011 15:49:15 +0200 Message-ID: From: Cole To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: kernel module, TCP state, and mbuf question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 14:11:00 -0000 Hi. Im currently working on a kernel module to modify data on tcp sessions leaving and coming into the box. And I have this working. However I've run into the issue where I am now breaking the TCP state. When I modify the data in the tcp packets, the size of that data may change, meaning that I have to then update the packet size and so forth. Now this works for the first packet with data inside it, but the rest of the packets leaving on this TCP stream then have the error where their sequence number is now wrong. i.e. If I modify the data, and the new data size is then less than that of the original packet, that means the next sequence number of the out going packet will actually be higher than it should be, and the other side will think it has missed a packet somewhere. In my kernel module I am using pfil_add_hook to hook into the outgoing packets, and from there I am inspecting and modifying the packets as needed. My function definition for the function I pass to pfil_add_hook is the default one as follows: chkoutput(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp) I was wondering if it is possible to somehow get access to the TCP state for the tcp stream for the mbuf/packet I have received and if I can modify the th_seq to match my new values, or if I will need to keep my own state information for any streams I modify and then update the outgoing packets th_seq values as needed? Any information or help will be gladly appreciated. Regards /Cole From owner-freebsd-net@FreeBSD.ORG Fri May 6 14:39:54 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D66106566B; Fri, 6 May 2011 14:39:54 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1BCE28FC08; Fri, 6 May 2011 14:39:54 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p46Edr3F053762; Fri, 6 May 2011 14:39:53 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p46EdrZu053758; Fri, 6 May 2011 14:39:53 GMT (envelope-from linimon) Date: Fri, 6 May 2011 14:39:53 GMT Message-Id: <201105061439.p46EdrZu053758@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-net@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/156845: [re] Driver update request for RTL 8105EL X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 14:39:54 -0000 Old Synopsis: Driver update request for RTL 8105EL New Synopsis: [re] Driver update request for RTL 8105EL Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Fri May 6 14:39:24 UTC 2011 Responsible-Changed-Why: reclassify. http://www.freebsd.org/cgi/query-pr.cgi?pr=156845 From owner-freebsd-net@FreeBSD.ORG Fri May 6 16:24:32 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71CC41065674 for ; Fri, 6 May 2011 16:24:32 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate.funkthat.com [70.36.235.232]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4E68FC2A for ; Fri, 6 May 2011 16:24:31 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id p46G9d2W076505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 May 2011 09:09:39 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id p46G9cVq076503; Fri, 6 May 2011 09:09:38 -0700 (PDT) (envelope-from jmg) Date: Fri, 6 May 2011 09:09:37 -0700 From: John-Mark Gurney To: Cole Message-ID: <20110506160937.GN90732@funkthat.com> Mail-Followup-To: Cole , freebsd-net@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 06 May 2011 09:09:39 -0700 (PDT) Cc: freebsd-net@freebsd.org Subject: Re: kernel module, TCP state, and mbuf question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 16:24:32 -0000 Cole wrote this message on Fri, May 06, 2011 at 15:49 +0200: > Im currently working on a kernel module to modify data on tcp sessions > leaving and coming into the box. And I have this working. However I've > run into the issue where I am now breaking the TCP state. > When I modify the data in the tcp packets, the size of that data may > change, meaning that I have to then update the packet size and so > forth. Now this works for the first packet with data inside it, but > the rest of the packets leaving on this TCP stream then have the error > where their sequence number is now wrong. i.e. If I modify the data, > and the new data size is then less than that of the original packet, > that means the next sequence number of the out going packet will > actually be higher than it should be, and the other side will think it > has missed a packet somewhere. Why not keep a delta sequence number and always update the sequence number by this delta? Where the delta is the number of bytes added/removed from the stream? Seems easier than reaching into the TCP structure. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-net@FreeBSD.ORG Fri May 6 16:48:23 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41614106566C for ; Fri, 6 May 2011 16:48:23 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C21478FC16 for ; Fri, 6 May 2011 16:48:22 +0000 (UTC) Received: by fxm11 with SMTP id 11so3452728fxm.13 for ; Fri, 06 May 2011 09:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=tLlgd1q5fDj7dEqObEs8Y2F+S+nPi4PTHyI3+tX+iEs=; b=jHGRIIJqy9FxS4107b3SIK7GscmKssF5L+lUswjAUD0WZ/tgznmFWt+J+lR8u4nQBX roKbJCazx4byTqdoUJEdqFj6RJZLaBpS758FQDv9815qqDZwDBC/2TpzFfAGxOJ6RyDK BCpcdubLzrQaC7TcdEULfG9WUUHUykmpL261s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; b=EquQFxhv3ijLIXnAaguyy2bfPTSnOZts8fqP0Fh+u0vxXnKJ2eYkwQIjd/2m8twCql YUOzKhVgFqXcojb4+ELKNWL+hCbxUog4D/LpeA+GDloRSyVcFeo4GjtvxkWR0+Tc9Hb2 svs0tl8vP9akFiKUFO9y20xBxnCKKUp9j0bpI= Received: by 10.223.161.194 with SMTP id s2mr213347fax.143.1304698601691; Fri, 06 May 2011 09:16:41 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id j11sm1129381faa.44.2011.05.06.09.16.40 (version=SSLv3 cipher=OTHER); Fri, 06 May 2011 09:16:41 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DC41EC8.5060607@FreeBSD.org> Date: Fri, 06 May 2011 19:16:08 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: freebsd-net X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: TCP ISN increment without periodic callout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 16:48:23 -0000 Hi. Our TCP ISN mechanism uses callouts with 100Hz rate to implement linear ISN increment. For many systems it is the most active callout now. It was less important before, but now it uses additional timer interrupts in cases when new event timers subsystem could skip them, allowing CPU to remain in deeper sleep state, saving power. I've implemented simple patch, removing that periodic callout and updating ISN directly inside tcp_new_isn() function, taking to account how much time (ticks) passed since the last call: http://people.freebsd.org/~mav/no_isn_callout.patch Comparison on 3-CPU system shows idle interrupt rate reduction from 140Hz to 70Hz with this patch. Any comments/objections? -- Alexander Motin From owner-freebsd-net@FreeBSD.ORG Fri May 6 17:08:00 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B147106566C for ; Fri, 6 May 2011 17:08:00 +0000 (UTC) (envelope-from cole@opteqint.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 520118FC08 for ; Fri, 6 May 2011 17:07:59 +0000 (UTC) Received: by iyj12 with SMTP id 12so4006633iyj.13 for ; Fri, 06 May 2011 10:07:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.186.85 with SMTP id cr21mr2437005ibb.164.1304701679533; Fri, 06 May 2011 10:07:59 -0700 (PDT) Received: by 10.231.33.8 with HTTP; Fri, 6 May 2011 10:07:59 -0700 (PDT) X-Originating-IP: [196.215.131.152] In-Reply-To: <20110506160937.GN90732@funkthat.com> References: <20110506160937.GN90732@funkthat.com> Date: Fri, 6 May 2011 19:07:59 +0200 Message-ID: From: Cole To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: kernel module, TCP state, and mbuf question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 17:08:00 -0000 On 6 May 2011 18:09, John-Mark Gurney wrote: > Cole wrote this message on Fri, May 06, 2011 at 15:49 +0200: >> Im currently working on a kernel module to modify data on tcp sessions >> leaving and coming into the box. And I have this working. However I've >> run into the issue where I am now breaking the TCP state. >> When I modify the data in the tcp packets, the size of that data may >> change, meaning that I have to then update the packet size and so >> forth. Now this works for the first packet with data inside it, but >> the rest of the packets leaving on this TCP stream then have the error >> where their sequence number is now wrong. i.e. If I modify the data, >> and the new data size is then less than that of the original packet, >> that means the next sequence number of the out going packet will >> actually be higher than it should be, and the other side will think it >> has missed a packet somewhere. > > Why not keep a delta sequence number and always update the sequence > number by this delta? =A0Where the delta is the number of bytes > added/removed from the stream? > > Seems easier than reaching into the TCP structure. Yeah, that would be me keeping my own state of what the next sequence number should be. I was just wondering how difficult it would be to get to the actual TCP stream state for a given mbuf and to update the next sequence number there if need be. So that is the module is unloaded all the streams will continue to function and it wont kill anything. Regards /Cole From owner-freebsd-net@FreeBSD.ORG Fri May 6 19:16:32 2011 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB0D1065677; Fri, 6 May 2011 19:16:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 761E28FC08; Fri, 6 May 2011 19:16:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p46JGW0s005350; Fri, 6 May 2011 19:16:32 GMT (envelope-from yongari@freefall.freebsd.org) Received: (from yongari@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p46JGVUI005343; Fri, 6 May 2011 19:16:31 GMT (envelope-from yongari) Date: Fri, 6 May 2011 19:16:31 GMT Message-Id: <201105061916.p46JGVUI005343@freefall.freebsd.org> To: antonav@mail.ru, yongari@FreeBSD.org, freebsd-net@FreeBSD.org, yongari@FreeBSD.org From: yongari@FreeBSD.org Cc: Subject: Re: kern/156845: [re] Driver update request for RTL 8105EL X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 19:16:32 -0000 Synopsis: [re] Driver update request for RTL 8105EL State-Changed-From-To: open->feedback State-Changed-By: yongari State-Changed-When: Fri May 6 19:15:50 UTC 2011 State-Changed-Why: RTL8105E support is already in HEAD and merged to both stable/8 and stable/7. Please update your source tree to stable/8 or use re(4)/rl(4) driver in stable/8. Responsible-Changed-From-To: freebsd-net->yongari Responsible-Changed-By: yongari Responsible-Changed-When: Fri May 6 19:15:50 UTC 2011 Responsible-Changed-Why: Track. http://www.freebsd.org/cgi/query-pr.cgi?pr=156845 From owner-freebsd-net@FreeBSD.ORG Fri May 6 20:53:56 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51B6C10656EB for ; Fri, 6 May 2011 20:53:56 +0000 (UTC) (envelope-from mh.unet@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id 291878FC13 for ; Fri, 6 May 2011 20:53:56 +0000 (UTC) Received: by pxi11 with SMTP id 11so2805594pxi.7 for ; Fri, 06 May 2011 13:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=6cpXI7uTBkezUagq9UtRs3mojN4IP5T6GF+f+3NTMQo=; b=NjpAz/zM7Ky3PrDRbqnWky9XOcRGDiNRd4GvR2MSY/W0Ds29T6SF3yrL80IlLQ17+G d8xxdqAEl/LBbgnC4kE3OZz3ChH6ljYVu6BiYfK8V7hmOjAN1JYXRIK8fqrJN7r5VbNB QPzj5blm1lrT6cYSg1JnmVZwDFT6QrCMOCt4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Zy5O/S/S93ujUZz6Olcxuii6zCv15aceoxvL840czkdNNrD9PffIJ6LtVPqprenZEH nRWHOx2KM67VVSBOoYeSKjW38FfbEEaxIyDgTwEoY7/irumZLOmeSCXkIx9BDQNBReev QUIfujM4byV7tC2BqqziIUBTUWaMZ7eqrf8uo= MIME-Version: 1.0 Received: by 10.142.49.19 with SMTP id w19mr2094762wfw.51.1304713665660; Fri, 06 May 2011 13:27:45 -0700 (PDT) Received: by 10.143.33.3 with HTTP; Fri, 6 May 2011 13:27:45 -0700 (PDT) Date: Fri, 6 May 2011 13:27:45 -0700 Message-ID: From: Mickey Harvey To: freebsd-net@freebsd.org X-Mailman-Approved-At: Fri, 06 May 2011 21:17:43 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: run pf or ipfw within a jail? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 20:53:56 -0000 Is it possible to run pf or ipfw within a jail? I am running 8.2 and have vimage compiled in the kernel. From owner-freebsd-net@FreeBSD.ORG Sat May 7 00:19:38 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0071065675; Sat, 7 May 2011 00:19:38 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.212.176]) by mx1.freebsd.org (Postfix) with ESMTP id C61548FC16; Sat, 7 May 2011 00:19:37 +0000 (UTC) Received: by pxi11 with SMTP id 11so2912431pxi.7 for ; Fri, 06 May 2011 17:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:cc:subject:message-id:reply-to :mail-followup-to:mime-version:content-type:content-disposition :user-agent:organization:x-operation-sytem; bh=i/t6uZ/ItU2N7+8WDVS213OsuUwwcNo2q9ZJWVtcvkI=; b=xmT223unNvKsronFS3lYx40lOww56APJ5wYiLPhr8mfKQoZZ2rQca3tJJSRIPisqGz soKcC0tuHQmTjXKZfoO/mjdo/oEOHDCEvUtMaPm6FYwh4EvIAH4jSHKJxuo+atgp2f49 JYrAZV3cciBSzUWyuyIWh93F1NMQKfN5EcDgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mail-followup-to :mime-version:content-type:content-disposition:user-agent :organization:x-operation-sytem; b=lHns402J/oJrZyhBX/0ZNYAPgzFoMIzI3b59TEQQyG/1BxQqDQhwa9+/OwqLejczh1 K82kL7MiJuBPDwdy/TdQTazm6UL0XUFVFbbvcgzo23nN0AHgB+5518RZrAqWLcow58U6 p/THDzLs7mJuV9TRe1new1acwDGAqXiVcwfgM= Received: by 10.142.62.39 with SMTP id k39mr2142157wfa.179.1304727577257; Fri, 06 May 2011 17:19:37 -0700 (PDT) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id p10sm4775120wfl.21.2011.05.06.17.19.34 (version=SSLv3 cipher=OTHER); Fri, 06 May 2011 17:19:36 -0700 (PDT) Received: by weongyo (sSMTP sendmail emulation); Fri, 06 May 2011 17:19:50 -0700 From: Weongyo Jeong Date: Fri, 6 May 2011 17:19:50 -0700 To: freebsd-current@freebsd.org Message-ID: <20110507001950.GC36896@weongyo> Mail-Followup-To: freebsd-current@freebsd.org, freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: freebsd-net@freebsd.org Subject: [CFT] Early Retransmit for TCP (rfc5827) patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 00:19:38 -0000 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello all, I'd like to send another patch to support RFC5827 in TCP stack which could be found at: http://people.freebsd.org/~weongyo/patch_20110506_rfc5827.diff This patch supports all Early Retransmit logics (Byte-Based Early Retransmit and Segment-Based Early Retransmit) when net.inet.tcp.rfc5827 sysctl knob is turned on. Please note that Segment-Based Early Retransmit logic is separated using khelp module because it adds additional operations and requires variable spaces to track segment boundaries on the right side window. So if the khelp module is loaded, it's a preference but if not the default logic is `Byte-Based Early Retransmit'. I implemented based on DragonflyBSD's implementation but it looked it's not same with RFC specification what I thought so I changed most of parts. In my test environments it looks it's working correctly. Please review and test my work and tell me if you have any concerns and questions. regards, Weongyo Jeong --J/dobhs11T7y2rNN Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch_20110506_rfc5827.diff" Index: usr.bin/netstat/inet.c =================================================================== --- usr.bin/netstat/inet.c (revision 221564) +++ usr.bin/netstat/inet.c (working copy) @@ -622,6 +622,7 @@ "\t\t%lu data packet%s (%lu byte%s) retransmitted\n"); p(tcps_sndrexmitbad, "\t\t%lu data packet%s unnecessarily retransmitted\n"); + p(tcps_sndearlyrexmit, "\t%lu packet%s early retransmitted\n"); p(tcps_mturesent, "\t\t%lu resend%s initiated by MTU discovery\n"); p2a(tcps_sndacks, tcps_delack, "\t\t%lu ack-only packet%s (%lu delayed)\n"); Index: share/man/man4/Makefile =================================================================== --- share/man/man4/Makefile (revision 221564) +++ share/man/man4/Makefile (working copy) @@ -140,6 +140,7 @@ gpib.4 \ gre.4 \ h_ertt.4 \ + h_tcper.4 \ harp.4 \ hatm.4 \ hfa.4 \ Index: share/man/man4/h_tcper.4 =================================================================== --- share/man/man4/h_tcper.4 (revision 0) +++ share/man/man4/h_tcper.4 (revision 0) @@ -0,0 +1,60 @@ +.\" +.\" Copyright (c) 2011 Weongyo Jeong +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: share/man/man4/h_ertt.4 218912 2011-02-21 11:56:11Z lstewart $ +.\" +.Dd May 4, 2011 +.Dt h_tcper 9 +.Os +.Sh NAME +.Nm h_tcper +.Nd Segment Boundary Tracker Khelp module +.Sh SYNOPSIS +.In netinet/khelp/h_tcper.h +.Sh DESCRIPTION +The +.Nm +Khelp module works within the +.Xr khelp 9 +framework to provide TCP with a per-connection, segment boundary tracker. +It's to form an understanding as to how many actual segments have been +transmitted, but not acknowledged. +Its implementation is done by the sender by tracking the boundaries of +the four segments on the right side of the current window. +.Sh SEE ALSO +.Xr hhook 9 , +.Xr khelp 9 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 9.0 . +The module was first released in 2011 by Weongyo Jeong +.Sh AUTHORS +.An -nosplit +The +.Nm +Khelp module and this manual page were written by +.An Weongyo Jeong Aq weongyo@freebsd.org . Index: sys/netinet/tcp_input.c =================================================================== --- sys/netinet/tcp_input.c (revision 221564) +++ sys/netinet/tcp_input.c (working copy) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include /* for proc0 declaration */ @@ -101,6 +102,7 @@ #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ +#include #ifdef IPSEC #include @@ -161,6 +163,11 @@ &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); +VNET_DEFINE(int, tcp_do_rfc5827) = 0; +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc5827, CTLFLAG_RW, + &VNET_NAME(tcp_do_rfc5827), 0, + "Enable RFC 5827 (Early Retransmit)"); + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); VNET_DEFINE(int, tcp_do_ecn) = 0; @@ -260,6 +267,63 @@ } } +static int +tcp_getrexmtthresh(struct tcpcb *tp) +{ +#define iceildiv(n, d) (((n) + (d) - 1) / (d)) + struct inpcb *inp = tp->t_inpcb; + struct socket *so = inp->inp_socket; + struct tcper *te; + uint32_t oseg, ownd, sent; + int32_t tcper_id; + int ER_thresh; + + if (!V_tcp_do_rfc5827) + goto def; + if ((sent = tp->snd_max - tp->snd_una) == 0) + goto def; + + tcper_id = khelp_get_id("tcper"); + if (tcper_id > 0) { + /* + * Segment-Based Early Retransmit + */ + te = khelp_get_osd(tp->osd, tcper_id); + KASSERT(te != NULL, ("%s: te is NULL", __func__)); + oseg = te->numseg; + if (oseg > 0 && oseg < 4 && + (sent == so->so_snd.sb_cc || tp->snd_wnd == 0)) { + ER_thresh = oseg - 1; + if ((tp->t_flags & TF_SACK_PERMIT) == 0 || + tcp_sack_oseg(tp, te->segb, te->sege, + TCP_ER_MAXSEGB, ER_thresh)) { + TCPSTAT_INC(tcps_sndearlyrexmit); + return (ER_thresh); + } + } + goto def; + } + + /* + * Byte-Based Early Retransmit + */ + ownd = sent; + if (ownd < (4 * tp->t_maxseg) && + (sent == so->so_snd.sb_cc || tp->snd_wnd == 0)) { + ER_thresh = iceildiv(ownd, tp->t_maxseg) - 1; + if (((tp->t_flags & TF_SACK_PERMIT) == 0 || + ownd <= tp->t_maxseg || + tcp_sack_ownd(tp, ownd - tp->t_maxseg)) && + tp->t_dupacks + 1 >= ER_thresh) { + TCPSTAT_INC(tcps_sndearlyrexmit); + return (ER_thresh); + } + } +def: + return (tcprexmtthresh); +#undef iceildiv +} + /* * CC wrapper hook functions */ @@ -2372,6 +2436,10 @@ if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { + int rexmtthresh; + + rexmtthresh = tcp_getrexmtthresh(tp); + TCPSTAT_INC(tcps_rcvdupack); /* * If we have outstanding data (other than @@ -2403,7 +2471,7 @@ if (!tcp_timer_active(tp, TT_REXMT) || th->th_ack != tp->snd_una) tp->t_dupacks = 0; - else if (++tp->t_dupacks > tcprexmtthresh || + else if (++tp->t_dupacks > rexmtthresh || IN_FASTRECOVERY(tp->t_flags)) { cc_ack_received(tp, th, CC_DUPACK); if ((tp->t_flags & TF_SACK_PERMIT) && @@ -2427,7 +2495,7 @@ tp->snd_cwnd += tp->t_maxseg; (void) tcp_output(tp); goto drop; - } else if (tp->t_dupacks == tcprexmtthresh) { + } else if (tp->t_dupacks == rexmtthresh) { tcp_seq onxt = tp->snd_nxt; /* Index: sys/netinet/tcp_var.h =================================================================== --- sys/netinet/tcp_var.h (revision 221564) +++ sys/netinet/tcp_var.h (working copy) @@ -493,6 +493,9 @@ u_long tcps_sig_err_sigopt; /* No signature expected by socket */ u_long tcps_sig_err_nosigopt; /* No signature provided by segment */ + /* Early Retransmit */ + u_long tcps_sndearlyrexmit; /* early Fast Retransmissions */ + u_long _pad[12]; /* 6 UTO, 6 TBD */ }; @@ -610,6 +613,7 @@ VNET_DECLARE(int, ss_fltsz_local); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(int, tcp_do_rfc5827); #define V_tcb VNET(tcb) #define V_tcbinfo VNET(tcbinfo) #define V_tcpstat VNET(tcpstat) @@ -622,6 +626,7 @@ #define V_ss_fltsz_local VNET(ss_fltsz_local) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_do_rfc5827 VNET(tcp_do_rfc5827) VNET_DECLARE(int, tcp_do_sack); /* SACK enabled/disabled */ VNET_DECLARE(int, tcp_sc_rst_sock_fail); /* RST on sock alloc failure */ @@ -726,6 +731,9 @@ struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); void tcp_free_sackholes(struct tcpcb *tp); +boolean_t tcp_sack_ownd(struct tcpcb *tp, uint32_t amount); +boolean_t tcp_sack_oseg(struct tcpcb *tp, tcp_seq *seqb, tcp_seq *sege, + uint32_t numseq, uint32_t amount); int tcp_newreno(struct tcpcb *, struct tcphdr *); u_long tcp_seq_subtract(u_long, u_long ); Index: sys/netinet/khelp/h_tcper.c =================================================================== --- sys/netinet/khelp/h_tcper.c (revision 0) +++ sys/netinet/khelp/h_tcper.c (revision 0) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2011 Weongyo Jeong + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: sys/netinet/khelp/h_ertt.c 217806 2011-01-24 23:08:38Z lstewart $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +static int +tcper_input(int hhook_type, int hhook_id, void *udata, void *ctx_data, + void *hdata, struct osd *hosd) +{ + struct tcper *te; + struct tcp_hhook_data *thdp; + struct tcpcb *tp; + struct tcphdr *th; + int i; + + KASSERT(ctx_data != NULL, ("%s: ctx_data is NULL!", __func__)); + KASSERT(hdata != NULL, ("%s: hdata is NULL!", __func__)); + + te = (struct tcper *)hdata; + thdp = ctx_data; + tp = thdp->tp; + th = thdp->th; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + if ((te->flags & TCP_ER_HAVEONE) == 0) + return (0); + + for (i = 0; i < TCP_ER_MAXSEGB; i++) { + if (SEQ_GT(th->th_ack, te->segb[i])) { + if (te->segb[i] == te->max) { + te->max = tp->snd_una; + te->flags &= ~TCP_ER_HAVEONE; + } + if (te->segb[i] != te->sege[i]) + te->numseg--; + te->segb[i] = tp->snd_una; + te->sege[i] = tp->snd_una; + } + } + return (0); +} + +static int +tcper_output(int hhook_type, int hhook_id, void *udata, void *ctx_data, + void *hdata, struct osd *hosd) +{ + struct tcper *te; + struct tcp_hhook_data *thdp; + struct tcpcb *tp; + struct tcphdr *th; + tcp_seq seq, tmpseq; + long len; + int i; + + KASSERT(ctx_data != NULL, ("%s: ctx_data is NULL!", __func__)); + KASSERT(hdata != NULL, ("%s: hdata is NULL!", __func__)); + + te = (struct tcper *)hdata; + thdp = ctx_data; + tp = thdp->tp; + th = thdp->th; + len = thdp->len; + seq = ntohl(th->th_seq); + + INP_WLOCK_ASSERT(tp->t_inpcb); + + if ((te->flags & TCP_ER_HAVEONE) == 0) { + for (i = 0; i < TCP_ER_MAXSEGB - 1; i++) { + te->segb[i] = tp->snd_una; + te->sege[i] = tp->snd_una; + } + te->flags |= TCP_ER_HAVEONE; + goto update; + } + if (SEQ_LEQ(seq, te->max)) + return (0); + /* + * XXX PLEASE FIX ME TO BE SMARTER. + * There'd be better algorithms not to swap twice or other approaches. + */ + for (i = 0; i < TCP_ER_MAXSEGB - 1; i++) { + /* swap segb[i] and segb[i + 1] */ + tmpseq = te->segb[i]; + te->segb[i] = te->segb[i + 1]; + te->segb[i + 1] = tmpseq; + /* swap sege[i] and sege[i + 1] */ + tmpseq = te->sege[i]; + te->sege[i] = te->sege[i + 1]; + te->sege[i + 1] = tmpseq; + } +update: + te->segb[TCP_ER_MAXSEGB - 1] = seq; + te->sege[TCP_ER_MAXSEGB - 1] = seq + len; + te->max = seq; + if (len > 0) { + /* + * XXX Increases or Decreases only the packet length is larger + * than zero. It means we ASSUME that only a packet + * (length > 0) is considered as a outstanding segment. + */ + te->numseg++; + } + return (0); +} + +static int +tcper_ctor(void *mem, int size, void *arg, int flags) +{ + struct tcper *te = mem; + + te->flags = 0; + te->numseg = 0; + return (0); +} + +static struct helper tcper_helper = { + .h_flags = HELPER_NEEDS_OSD, + .h_classes = HELPER_CLASS_TCP +}; + +/* Define the helper hook info required by ERTT. */ +static struct hookinfo tcper_hooks[] = { + { + .hook_type = HHOOK_TYPE_TCP, + .hook_id = HHOOK_TCP_EST_IN, + .hook_udata = NULL, + .hook_func = &tcper_input + }, + { + .hook_type = HHOOK_TYPE_TCP, + .hook_id = HHOOK_TCP_EST_OUT, + .hook_udata = NULL, + .hook_func = &tcper_output + } +}; + +KHELP_DECLARE_MOD_UMA(tcper, &tcper_helper, tcper_hooks, 1, + sizeof(struct tcper), tcper_ctor, NULL); Property changes on: sys/netinet/khelp/h_tcper.c ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: sys/netinet/khelp/h_tcper.h =================================================================== --- sys/netinet/khelp/h_tcper.h (revision 0) +++ sys/netinet/khelp/h_tcper.h (revision 0) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2011 Weongyo Jeong + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: sys/netinet/khelp/h_ertt.h 217806 2011-01-24 23:08:38Z lstewart $ + */ + +#ifndef _NETINET_KHELP_H_RFC5827_ +#define _NETINET_KHELP_H_RFC5827_ + +struct tcper { +#define TCP_ER_MAXSEGB 4 + uint32_t flags; +#define TCP_ER_HAVEONE 0x00000001 /* set if at least one seg in */ + tcp_seq segb[TCP_ER_MAXSEGB]; + tcp_seq sege[TCP_ER_MAXSEGB]; + tcp_seq max; + int numseg; +}; + +#endif Property changes on: sys/netinet/khelp/h_tcper.h ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: sys/netinet/tcp_sack.c =================================================================== --- sys/netinet/tcp_sack.c (revision 221564) +++ sys/netinet/tcp_sack.c (working copy) @@ -684,3 +684,54 @@ return; tp->snd_nxt = tp->snd_fack; } + +/* + * True if at least "amount" bytes has been SACKed. + * Used by Early Retransmit. + */ +boolean_t +tcp_sack_ownd(struct tcpcb *tp, uint32_t amount) +{ + struct sackhole *p; + uint32_t ackedbyte; + + ackedbyte = tp->snd_fack - tp->snd_una; + TAILQ_FOREACH(p, &tp->snd_holes, scblink) { + KASSERT(ackedbyte >= p->end - p->start, + ("%s: assert failed", __func__)); + ackedbyte -= p->end - p->start; + } + if (ackedbyte >= amount) + return (TRUE); + return (FALSE); +} + +/* + * True if at least "amount" segments has been SACKed. + * Used by Early Retransmit. + */ +boolean_t +tcp_sack_oseg(struct tcpcb *tp, tcp_seq *segb, tcp_seq *sege, uint32_t numseq, + uint32_t amount) +{ + struct sackhole *p; + int segment_sacked = 0, i, inhole; + + for (i = 0; i < numseq; i++) { + inhole = 0; + TAILQ_FOREACH(p, &tp->snd_holes, scblink) { + if (SEQ_GEQ(segb[i], p->start) && + SEQ_LEQ(sege[i], p->end)) { + inhole = 1; + break; + } + } + if (inhole) + continue; + if (SEQ_GT(segb[i], tp->snd_fack)) + continue; + if (++segment_sacked >= amount) + return (TRUE); + } + return (FALSE); +} Index: sys/modules/khelp/h_tcper/Makefile =================================================================== --- sys/modules/khelp/h_tcper/Makefile (revision 0) +++ sys/modules/khelp/h_tcper/Makefile (revision 0) @@ -0,0 +1,9 @@ +# $FreeBSD: sys/modules/khelp/h_ertt/Makefile 217806 2011-01-24 23:08:38Z lstewart $ + +.include + +.PATH: ${.CURDIR}/../../../netinet/khelp +KMOD= h_tcper +SRCS= h_tcper.h h_tcper.c + +.include Property changes on: sys/modules/khelp/h_tcper/Makefile ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: sys/modules/khelp/Makefile =================================================================== --- sys/modules/khelp/Makefile (revision 221564) +++ sys/modules/khelp/Makefile (working copy) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= h_ertt +SUBDIR= h_ertt h_tcper .include --J/dobhs11T7y2rNN-- From owner-freebsd-net@FreeBSD.ORG Sat May 7 12:01:51 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D42D106566C for ; Sat, 7 May 2011 12:01:51 +0000 (UTC) (envelope-from gpm@hotplug.ru) Received: from shadow.rusoft.ru (shadow.rusoft.ru [217.16.18.75]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6488FC15 for ; Sat, 7 May 2011 12:01:50 +0000 (UTC) Received: from shadow.rusoft.ru (localhost [127.0.0.1]) by shadow.rusoft.ru (Postfix) with ESMTP id C39AA3C5D; Sat, 7 May 2011 16:01:48 +0400 (MSD) Received: from jazz.rusoft.ru (unknown [83.222.3.162]) by shadow.rusoft.ru (Postfix) with ESMTP id A848E3C5C; Sat, 7 May 2011 16:01:48 +0400 (MSD) Received: from ghost-pc.home.lan (unknown [213.141.135.21]) by jazz.rusoft.ru (Postfix) with ESMTPA id 4DF2B1CC011; Sat, 7 May 2011 16:01:48 +0400 (MSD) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Arnaud Lacombe" References: Date: Sat, 07 May 2011 16:01:23 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Emil Muratov" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.10 (Win32) X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-net@freebsd.org Subject: Re: nfe taskq kernel panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 12:01:51 -0000 > On Thu, May 5, 2011 at 2:49 PM, Arnaud Lacombe > wrote: >> There is a stale reference to the mbuf passed to, and freed in >> m_megapullup(); could you test the following patch ? >> >> diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c >> index f8c3e63..80c13dc 100644 >> --- a/sys/netinet/ipfw/ip_fw_nat.c >> +++ b/sys/netinet/ipfw/ip_fw_nat.c >> @@ -263,7 +263,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat >> *t, struct mbuf *m) >> retval = LibAliasOut(t->lib, c, >> mcl->m_len + M_TRAILINGSPACE(mcl)); >> if (retval == PKT_ALIAS_RESPOND) { >> - m->m_flags |= M_SKIP_FIREWALL; >> + mcl->m_flags |= M_SKIP_FIREWALL; >> retval = PKT_ALIAS_OK; >> } >> if (retval != PKT_ALIAS_OK && >> >> This was introduced in r188294 by piso@ (added to the CC: list). >> > this can only happen if you are NAT'ing SCTP traffic. So it might not > be the culprit in your case.. > > - Arnaud Hi! I've got another crash with this patch applied, so you were right this was not my case. Providing backtrace if it might help. GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... Unread portion of the kernel message buffer: Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0xffffff802f98aac8 fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff8037dfdb stack pointer = 0x28:0xffffff80000fde20 frame pointer = 0x28:0xffffff80000fde60 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (nfe0 taskq) trap number = 12 panic: page fault cpuid = 2 KDB: stack backtrace: #0 0xffffffff802a97a3 at kdb_backtrace+0x5e #1 0xffffffff8027aa98 at panic+0x182 #2 0xffffffff80446ef0 at trap_fatal+0x292 #3 0xffffffff804472a5 at trap_pfault+0x286 #4 0xffffffff8044774f at trap+0x3cb #5 0xffffffff80430774 at calltrap+0x8 #6 0xffffffff8035d506 at ipfw_nat+0x206 #7 0xffffffff80354cea at ipfw_chk+0xb1a #8 0xffffffff80359c6a at ipfw_check_hook+0xfa #9 0xffffffff8032a221 at pfil_run_hooks+0x9c #10 0xffffffff803605f3 at ip_input+0x2d3 #11 0xffffffff8032947f at netisr_dispatch_src+0x71 #12 0xffffffff80c22cab at ng_iface_rcvdata+0xdc #13 0xffffffff80c18964 at ng_apply_item+0x20a #14 0xffffffff80c17afd at ng_snd_item+0x2a1 #15 0xffffffff80c18964 at ng_apply_item+0x20a #16 0xffffffff80c17afd at ng_snd_item+0x2a1 #17 0xffffffff80c25305 at ng_ppp_rcvdata+0x202 Uptime: 15h24m44s Physical memory: 2005 MB Dumping 1547 MB: 1532 1516 1500 1484 1468 1452 1436 1420 1404 1388 1372 1356 1340 1324 1308 1292 1276 1260 1244 1228 1212 1196 1180 1164 1148 1132 1116 1100 1084 1068 1052 1036 1020 1004 988 972 956 940 924 908 892 876 860 844 828 812 796 780 764 748 732 716 700 684 668 652 636 620 604 588 572 556 540 524 508 492 476 460 444 428 412 396 380 364 348 332 316 300 284 268 252 236 220 204 188 172 156 140 124 108 92 76 60 44 28 12 Reading symbols from /boot/kernel/zfs.ko...Reading symbols from /boot/kernel/zfs.ko.symbols...done. done. Loaded symbols for /boot/kernel/zfs.ko Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from /boot/kernel/opensolaris.ko.symbols...done. done. Loaded symbols for /boot/kernel/opensolaris.ko Reading symbols from /boot/kernel/krpc.ko...Reading symbols from /boot/kernel/krpc.ko.symbols...done. done. Loaded symbols for /boot/kernel/krpc.ko Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from /boot/kernel/if_nfe.ko.symbols...done. done. Loaded symbols for /boot/kernel/if_nfe.ko Reading symbols from /boot/kernel/aio.ko...Reading symbols from /boot/kernel/aio.ko.symbols...done. done. Loaded symbols for /boot/kernel/aio.ko Reading symbols from /boot/kernel/alias_ftp.ko...Reading symbols from /boot/kernel/alias_ftp.ko.symbols...done. done. Loaded symbols for /boot/kernel/alias_ftp.ko Reading symbols from /boot/kernel/if_stf.ko...Reading symbols from /boot/kernel/if_stf.ko.symbols...done. done. Loaded symbols for /boot/kernel/if_stf.ko Reading symbols from /boot/kernel/ng_socket.ko...Reading symbols from /boot/kernel/ng_socket.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_socket.ko Reading symbols from /boot/kernel/netgraph.ko...Reading symbols from /boot/kernel/netgraph.ko.symbols...done. done. Loaded symbols for /boot/kernel/netgraph.ko Reading symbols from /boot/kernel/ng_mppc.ko...Reading symbols from /boot/kernel/ng_mppc.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_mppc.ko Reading symbols from /boot/kernel/rc4.ko...Reading symbols from /boot/kernel/rc4.ko.symbols...done. done. Loaded symbols for /boot/kernel/rc4.ko Reading symbols from /boot/kernel/ng_iface.ko...Reading symbols from /boot/kernel/ng_iface.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_iface.ko Reading symbols from /boot/kernel/ng_ppp.ko...Reading symbols from /boot/kernel/ng_ppp.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_ppp.ko Reading symbols from /boot/kernel/ng_tee.ko...Reading symbols from /boot/kernel/ng_tee.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_tee.ko Reading symbols from /boot/kernel/ng_ether.ko...Reading symbols from /boot/kernel/ng_ether.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_ether.ko Reading symbols from /boot/kernel/ng_pppoe.ko...Reading symbols from /boot/kernel/ng_pppoe.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_pppoe.ko Reading symbols from /boot/kernel/accf_http.ko...Reading symbols from /boot/kernel/accf_http.ko.symbols...done. done. Loaded symbols for /boot/kernel/accf_http.ko Reading symbols from /boot/kernel/accf_data.ko...Reading symbols from /boot/kernel/accf_data.ko.symbols...done. done. Loaded symbols for /boot/kernel/accf_data.ko Reading symbols from /boot/kernel/ng_tcpmss.ko...Reading symbols from /boot/kernel/ng_tcpmss.ko.symbols...done. done. Loaded symbols for /boot/kernel/ng_tcpmss.ko #0 doadump () at pcpu.h:224 224 pcpu.h: No such file or directory. in pcpu.h (kgdb) #0 doadump () at pcpu.h:224 #1 0xffffffff8027a615 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:419 #2 0xffffffff8027aa82 in panic (fmt=Variable "fmt" is not available. ) at /usr/src/sys/kern/kern_shutdown.c:592 #3 0xffffffff80446ef0 in trap_fatal (frame=0xc, eva=Variable "eva" is not available. ) at /usr/src/sys/amd64/amd64/trap.c:811 #4 0xffffffff804472a5 in trap_pfault (frame=0xffffff80000fdd70, usermode=0) at /usr/src/sys/amd64/amd64/trap.c:727 #5 0xffffffff8044774f in trap (frame=0xffffff80000fdd70) at /usr/src/sys/amd64/amd64/trap.c:477 #6 0xffffffff80430774 in calltrap () at /usr/src/sys/amd64/amd64/exception.S:228 #7 0xffffffff8037dfdb in LibAliasIn (la=0xffffff802f97b000, ptr=0xffffff809d95a01c "E", maxpacketsize=9188) at atomic.h:159 #8 0xffffffff8035d506 in ipfw_nat (args=0xffffff80000fe050, t=0xffffff001940d180, m=Variable "m" is not available. ) at /usr/src/sys/netinet/ipfw/ip_fw_nat.c:261 #9 0xffffffff80354cea in ipfw_chk (args=0xffffff80000fe050) at /usr/src/sys/netinet/ipfw/ip_fw2.c:2136 #10 0xffffffff80359c6a in ipfw_check_hook (arg=Variable "arg" is not available. ) at /usr/src/sys/netinet/ipfw/ip_fw_pfil.c:139 #11 0xffffffff8032a221 in pfil_run_hooks (ph=Variable "ph" is not available. ) at /usr/src/sys/net/pfil.c:82 #12 0xffffffff803605f3 in ip_input (m=0xffffff003bdc5600) at /usr/src/sys/netinet/ip_input.c:532 #13 0xffffffff8032947f in netisr_dispatch_src (proto=1, source=Variable "source" is not available. ) at /usr/src/sys/net/netisr.c:859 #14 0xffffffff80c22cab in ng_iface_rcvdata (hook=Variable "hook" is not available. ) at /usr/src/sys/modules/netgraph/iface/../../../netgraph/ng_iface.c:784 #15 0xffffffff80c18964 in ng_apply_item (node=0xffffff002fa72300, item=0xffffff0074cc5880, rw=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #16 0xffffffff80c17afd in ng_snd_item (item=0xffffff0074cc5880, flags=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #17 0xffffffff80c18964 in ng_apply_item (node=0xffffff00143e1c00, item=0xffffff0074cc5880, rw=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #18 0xffffffff80c17afd in ng_snd_item (item=0xffffff0074cc5880, flags=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #19 0xffffffff80c25305 in ng_ppp_rcvdata (hook=Variable "hook" is not available. ) at /usr/src/sys/modules/netgraph/ppp/../../../netgraph/ng_ppp.c:1524 #20 0xffffffff80c18964 in ng_apply_item (node=0xffffff002fbe4c00, item=0xffffff0074cc5880, rw=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #21 0xffffffff80c17afd in ng_snd_item (item=0xffffff0074cc5880, flags=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #22 0xffffffff80c18964 in ng_apply_item (node=0xffffff003b975000, item=0xffffff0074cc5880, rw=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #23 0xffffffff80c17afd in ng_snd_item (item=0xffffff0074cc5880, flags=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #24 0xffffffff80c2cfc1 in ng_pppoe_rcvdata_ether (hook=Variable "hook" is not available. ) at /usr/src/sys/modules/netgraph/pppoe/../../../netgraph/ng_pppoe.c:1657 #25 0xffffffff80c18964 in ng_apply_item (node=0xffffff002ff4d600, item=0xffffff0074cc5880, rw=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2327 #26 0xffffffff80c17afd in ng_snd_item (item=0xffffff0074cc5880, flags=0) at /usr/src/sys/modules/netgraph/netgraph/../../../netgraph/ng_base.c:2244 #27 0xffffffff80320b5a in ether_demux (ifp=0xffffff0006a61000, m=0xffffff003bdc5600) at /usr/src/sys/net/if_ethersubr.c:911 #28 0xffffffff80320f41 in ether_input (ifp=0xffffff0006a61000, m=0xffffff003bdc5600) at /usr/src/sys/net/if_ethersubr.c:753 #29 0xffffffff80320aa2 in ether_demux (ifp=0xffffff0001676800, m=0xffffff003bdc5600) at /usr/src/sys/net/if_ethersubr.c:803 #30 0xffffffff80320f41 in ether_input (ifp=0xffffff0001676800, m=0xffffff003bdc5600) at /usr/src/sys/net/if_ethersubr.c:753 #31 0xffffffff809ec76e in nfe_jrxeof (sc=0xffffff80003ae000, count=191, rx_npktsp=0x0) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:2303 #32 0xffffffff809f0fea in nfe_int_task (arg=Variable "arg" is not available. ) at /usr/src/sys/modules/nfe/../../dev/nfe/if_nfe.c:1899 #33 0xffffffff802b3f7e in taskqueue_run_locked (queue=0xffffff0001722700) at /usr/src/sys/kern/subr_taskqueue.c:248 #34 0xffffffff802b410c in taskqueue_thread_loop (arg=Variable "arg" is not available. ) at /usr/src/sys/kern/subr_taskqueue.c:385 #35 0xffffffff80252d5d in fork_exit ( callout=0xffffffff802b40c4 , arg=0xffffff80003ae1b8, frame=0xffffff80000fec50) at /usr/src/sys/kern/kern_fork.c:865 #36 0xffffffff80430cbe in fork_trampoline () at /usr/src/sys/amd64/amd64/exception.S:603 #37 0x0000000000000000 in ?? () #38 0x0000000000000000 in ?? () #39 0x0000000000000000 in ?? () #40 0x0000000000000000 in ?? () #41 0x0000000000000000 in ?? () #42 0x0000000000000000 in ?? () #43 0x0000000000000000 in ?? () #44 0x0000000000000000 in ?? () #45 0x0000000000000000 in ?? () #46 0x0000000000000000 in ?? () #47 0x0000000000000000 in ?? () #48 0x0000000000000000 in ?? () #49 0x0000000000000000 in ?? () #50 0x0000000000000000 in ?? () #51 0x0000000000000000 in ?? () #52 0x0000000000000000 in ?? () #53 0x0000000000000000 in ?? () #54 0x0000000000000000 in ?? () #55 0x0000000000000000 in ?? () #56 0x0000000000000000 in ?? () #57 0x0000000000000000 in ?? () #58 0x0000000000000000 in ?? () #59 0x0000000000000000 in ?? () #60 0x0000000000000000 in ?? () #61 0xffffffff80665940 in affinity () #62 0x0000000000000000 in ?? () #63 0x0000000000000000 in ?? () #64 0xffffff0001741460 in ?? () #65 0xffffff80000fd9d0 in ?? () #66 0xffffff80000fd978 in ?? () #67 0xffffff00015b8000 in ?? () #68 0xffffffff8029d819 in sched_switch (td=0xffffffff802b40c4, newtd=0xffffff80003ae1b8, flags=Variable "flags" is not available. ) at /usr/src/sys/kern/sched_ule.c:1859 Previous frame inner to this frame (corrupt stack?) (kgdb) From owner-freebsd-net@FreeBSD.ORG Sat May 7 14:28:41 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D26D1065670 for ; Sat, 7 May 2011 14:28:41 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id DF51C8FC16 for ; Sat, 7 May 2011 14:28:40 +0000 (UTC) Received: (qmail invoked by alias); 07 May 2011 14:28:39 -0000 Received: from adsl-179.79.107.81.tellas.gr (EHLO [192.168.73.193]) [79.107.81.179] by mail.gmx.com (mp-eu005) with SMTP; 07 May 2011 16:28:39 +0200 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX1+6+ZoFIp+6la2JTUp2YVhjLrQg5h7uHYyuCTjZ27 7i0NKWux3p25oy Message-ID: <4DC55711.7010003@gmx.com> Date: Sat, 07 May 2011 17:28:33 +0300 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: multipart/mixed; boundary="------------090002030702080708060609" X-Y-GMX-Trusted: 0 Subject: STP and if_epair, ngeth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 14:28:41 -0000 This is a multi-part message in MIME format. --------------090002030702080708060609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, The STP code in bridgestp.c uses ifmedia to check duplex status. if_epair and ng_eiface interfaces commonly used in VIMAGE enabled jails do not support ifmedia and thus stay forever disabled when STP is enabled on such interfaces. Could you review the patch? Thanks, Nikos --------------090002030702080708060609 Content-Type: text/plain; name="bridgestp.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bridgestp.c.diff" Index: sys/net/bridgestp.c =================================================================== --- sys/net/bridgestp.c (revision 221584) +++ sys/net/bridgestp.c (working copy) @@ -1804,12 +1804,19 @@ bzero((char *)&ifmr, sizeof(ifmr)); error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); - if ((error == 0) && (ifp->if_flags & IFF_UP)) { - if (ifmr.ifm_status & IFM_ACTIVE) { + if (ifp->if_flags & IFF_UP) { + if (ifp->if_link_state == LINK_STATE_UP) { /* A full-duplex link is assumed to be point to point */ if (bp->bp_flags & BSTP_PORT_AUTOPTP) { - bp->bp_ptp_link = - ifmr.ifm_active & IFM_FDX ? 1 : 0; + /* Interfaces that do not support ifmedia, + * are assumed to be full-duplex. if_epair + * and ng_eiface fall into this category. + */ + if (error == 0) + bp->bp_ptp_link = + ifmr.ifm_active & IFM_FDX ? 1 : 0; + else if (error == EINVAL) + bp->bp_ptp_link = 1; } /* Calc the cost if the link was down previously */ --------------090002030702080708060609-- From owner-freebsd-net@FreeBSD.ORG Sat May 7 23:44:47 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B8B1065674 for ; Sat, 7 May 2011 23:44:47 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 639328FC0A for ; Sat, 7 May 2011 23:44:47 +0000 (UTC) Received: by vxc34 with SMTP id 34so6248520vxc.13 for ; Sat, 07 May 2011 16:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=TY2Wqbxb15d9d/QObpYJ213HLxm5FXDQrXI0ceXsvN0=; b=tWj7cDNQIXVhVRo3VDf4BF39mCRLXgIUwtcvMjWNahE+hKfLLULGZsd2gApzPpvqe2 AlChrn48vpnVFk5ok1msC5UbkqaMXzNO5Sj827Yw4vi/lfU40QkGps0tbwrrEBsI0wwe JRmVG4OSTMF/LoFm8jUWD3K7vI4q8Xvpc2/Pk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=vUFUv5LMyBNbtz+1ib7WfhWhvTXnhq2PkmFNfwwPiD758jZ4xVbQ+940Fye1bvvoVH HpvMZ8xNKDcTAWgZ7CG7kR2aocwf6rHXKwijwfaqVWj6Ljz39S1Z7pJRxQSO5iD7z2lS DY5HgK5J8lq+XcaKafTbWKdbDUAlG6OOzOzis= MIME-Version: 1.0 Received: by 10.220.70.213 with SMTP id e21mr1030198vcj.234.1304811886498; Sat, 07 May 2011 16:44:46 -0700 (PDT) Received: by 10.220.93.7 with HTTP; Sat, 7 May 2011 16:44:46 -0700 (PDT) Date: Sat, 7 May 2011 16:44:46 -0700 Message-ID: From: Vijay Singh To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: vijay singh Subject: interface Ierrs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 23:44:47 -0000 Hi. I am seeing errors reported by "netstat -i". I am running a 7.2 kernel. delta88b% netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll eth1 1500 00:a0:98:08:6c:ef 17515937 114620 12317753 0 0 eth1 1500 192.168.10.0 192.168.10.8 17514886 - 12317738 - - How do I find out why there are these errors? I see that there are enough mbufs, and though there are mbuf failures reported, the Ierrs are significantly higher. delta88b% netstat -m 6441/26064/32505 mbufs in use (current/cache/total) 5792/250208/256000/256000 mbuf clusters in use (current/cache/total/max) 5124/955 mbuf+clusters out of packet secondary zone in use (current/cache) 128/336/464/12800 4k (page size) jumbo clusters in use (current/cache/total/max) 512/283/795/6400 9k jumbo clusters in use (current/cache/total/max) 0/0/0/3200 16k jumbo clusters in use (current/cache/total/max) 18314K/510823K/529137K bytes allocated to network (current/cache/total) 0/3485/1350 requests for mbufs denied (mbufs/clusters/mbuf+clusters) 0/0/0 requests for jumbo clusters denied (4k/9k/16k) 0/0/0 sfbufs in use (current/peak/max) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 0 calls to protocol drain routines Any help is appreciated. -vijay