From owner-freebsd-current@FreeBSD.ORG Sat Oct 1 20:51:28 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DE0016A41F for ; Sat, 1 Oct 2005 20:51:28 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id C00A143D46 for ; Sat, 1 Oct 2005 20:51:27 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j91KpO3T055729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 2 Oct 2005 00:51:25 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j91KpO1q055728 for current@FreeBSD.org; Sun, 2 Oct 2005 00:51:24 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 2 Oct 2005 00:51:24 +0400 From: Gleb Smirnoff To: current@FreeBSD.org Message-ID: <20051001205124.GR45345@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.6i Cc: Subject: [HEADSUP] big polling changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2005 20:51:28 -0000 Colleagues, I have just committed a big polling cleanup. First important point is that only two drivers were tested to work. Please, if you run CURRENT and polling(4), please reply to this mail, saying whether your NIC works or not. When I get approvements for all drivers, then I will be ready for MFC. Current state is: em - tested (ru, glebius) fxp - tested (glebius) ixgb - not tested (changeset similar to em) nge - not tested re - not tested vge - not tested dc - not tested rl - not tested sf - not tested sis - not tested ste - not tested vr - not tested xl - not tested The second important point is that you should not use kern.polling.enable anymore. Just turn polling on interface with ifconfig, either manually or via rc.conf. ----- Forwarded message from Gleb Smirnoff ----- glebius 2005-10-01 18:56:19 UTC FreeBSD src repository Modified files: sys/amd64/amd64 trap.c sys/dev/em if_em.c sys/dev/firewire 00README if_fwe.c if_fwip.c sys/dev/fxp if_fxp.c sys/dev/ixgb README if_ixgb.c sys/dev/nge if_nge.c sys/dev/re if_re.c sys/dev/vge if_vge.c sys/i386/i386 trap.c sys/kern kern_poll.c sys/net if.h if_var.h sys/pci if_dc.c if_rl.c if_sf.c if_sis.c if_ste.c if_vr.c if_xl.c Log: Big polling(4) cleanup. o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb Revision Changes Path 1.294 +0 -10 src/sys/amd64/amd64/trap.c 1.74 +37 -34 src/sys/dev/em/if_em.c 1.2 +0 -3 src/sys/dev/firewire/00README 1.39 +40 -29 src/sys/dev/firewire/if_fwe.c 1.10 +47 -31 src/sys/dev/firewire/if_fwip.c 1.248 +32 -24 src/sys/dev/fxp/if_fxp.c 1.2 +7 -8 src/sys/dev/ixgb/README 1.15 +43 -34 src/sys/dev/ixgb/if_ixgb.c 1.80 +37 -25 src/sys/dev/nge/if_nge.c 1.56 +49 -40 src/sys/dev/re/if_re.c 1.19 +51 -54 src/sys/dev/vge/if_vge.c 1.281 +0 -10 src/sys/i386/i386/trap.c 1.23 +88 -100 src/sys/kern/kern_poll.c 1.99 +2 -3 src/sys/net/if.h 1.103 +1 -1 src/sys/net/if_var.h 1.169 +41 -28 src/sys/pci/if_dc.c 1.158 +40 -36 src/sys/pci/if_rl.c 1.88 +45 -44 src/sys/pci/if_sf.c 1.140 +44 -31 src/sys/pci/if_sis.c 1.90 +41 -32 src/sys/pci/if_ste.c 1.108 +39 -31 src/sys/pci/if_vr.c 1.197 +45 -41 src/sys/pci/if_xl.c ----- End forwarded message ----- -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE