From yoshfuji@linux-ipv6.org Sat Nov 1 03:01:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 03:02:02 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA1B1R25009335 for ; Sat, 1 Nov 2003 03:01:28 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA1B1Wlg018026; Sat, 1 Nov 2003 20:01:33 +0900 Date: Sat, 01 Nov 2003 20:01:32 +0900 (JST) Message-Id: <20031101.200132.55114465.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] IPV{4,6}: Fix one more inappropriate use of inet6_sk()->ipv6only From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1166 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. Sorry, I forgot to fix this one... ===== net/ipv4/tcp_ipv4.c 1.75 vs edited ===== --- 1.75/net/ipv4/tcp_ipv4.c Tue Oct 28 20:10:47 2003 +++ edited/net/ipv4/tcp_ipv4.c Sat Nov 1 19:36:45 2003 @@ -187,7 +187,7 @@ sk_for_each_bound(sk2, node, &tb->owners) { if (sk != sk2 && - !ipv6_only_sock(sk2) && + !tcp_v6_ipv6only(sk2) && (!sk->sk_bound_dev_if || !sk2->sk_bound_dev_if || sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From daniel.blueman@gmx.net Sat Nov 1 10:13:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 10:14:08 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA1IDX25019208 for ; Sat, 1 Nov 2003 10:13:34 -0800 Received: (qmail 13073 invoked by uid 0); 1 Nov 2003 18:13:27 -0000 Received: from 81.107.229.142 by www6.gmx.net with HTTP; Sat, 1 Nov 2003 19:13:27 +0100 (MET) Date: Sat, 1 Nov 2003 19:13:27 +0100 (MET) From: "Daniel Blueman" To: "David S. Miller" Cc: devik@cdi.cz, netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 References: <20031030130859.605f856d.davem@redhat.com> Subject: Re: [2.6.0-test9] QoS HTB crash... X-Priority: 3 (Normal) X-Authenticated: #8973862 Message-ID: <4371.1067710407@www6.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-archive-position: 1167 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniel.blueman@gmx.net Precedence: bulk X-list: netdev Having applied this patch, I still get this issue when I kill pppd: Oops: 0002 [#1] CPU: 0 >>EIP; c02ced99 <===== >>ebx; d9c0586c <_end+19797f60/3fb906f4> >>ecx; dc95adf8 <_end+1c4ed4ec/3fb906f4> >>edx; d9c057f8 <_end+19797eec/3fb906f4> >>esi; dc95adf8 <_end+1c4ed4ec/3fb906f4> >>edi; df4eceac <_end+1f07f5a0/3fb906f4> >>ebp; d9c4bdfc <_end+197de4f0/3fb906f4> >>esp; d9c4bde4 <_end+197de4d8/3fb906f4> Trace; c011a647 Trace; c02d3876 Trace; c02d3b1f Trace; c02d3b5e Trace; c011a647 Trace; c02d3cc4 Trace; c02ce073 Trace; c02cdedc Trace; c02ce112 Trace; c02c1ea9 Trace; c02c260a Trace; c01398e8 Trace; c02b59e2 Trace; c02bd6ce Trace; c0235f8c Trace; c023c1ce Trace; c0183836 Trace; c016527c <__fput+7c/cd> Trace; c02363a5 Trace; c01652bb <__fput+bb/cd> Trace; c0163353 Trace; c0163481 Trace; c010a3eb Code; c02ced99 00000000 <_EIP>: Code; c02ced99 <===== 0: 83 ae 58 01 00 00 01 subl $0x1,0x158(%esi) <===== Code; c02ceda0 7: 8b 5d f8 mov 0xfffffff8(%ebp),%ebx Code; c02ceda3 a: 8b 75 fc mov 0xfffffffc(%ebp),%esi Code; c02ceda6 d: 89 ec mov %ebp,%esp Code; c02ceda8 f: 5d pop %ebp Code; c02ceda9 10: c3 ret Code; c02cedaa 11: 83 ab 3c 00 00 00 00 subl $0x0,0x3c(%ebx) <0>Kernel panic: Fatal exception in interrupt --- > On Thu, 30 Oct 2003 20:50:16 +0100 (CET) > devik wrote: > > > thanks for the report. I know that there is an issue regarding > > HTB in 2.6.x. Please send me net/sched/sch_htb.o, > > net/sched/sch_htb.c (just to be sure) and be sure that you > > build the kernel with debugging symbols (see debugging section > > of menuconfig/xconfig). > > I think the problem is the changes that were made > in 2.5.x to htb_next_rb_node(). It used to be: > > static void htb_next_rb_node(rb_node_t **n) > { > rb_node_t *p; > if ((*n)->rb_right) { > /* child at right. use it or its leftmost ancestor */ > *n = (*n)->rb_right; > while ((*n)->rb_left) > *n = (*n)->rb_left; > return; > } > while ((p = (*n)->rb_parent) != NULL) { > /* if we've arrived from left child then we have next node > */ > if (p->rb_left == *n) break; > *n = p; > } > *n = p; > } > > But it was changed into: > > static void htb_next_rb_node(struct rb_node **n) > { > *n = rb_next(*n); > } > > This is wrong, the new code has much different side effects > than the original code. > > This looks like the problem, devik what do you think? > -- Daniel J Blueman NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ From akpm@osdl.org Sat Nov 1 13:34:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 13:34:55 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA1LXu25023712 for ; Sat, 1 Nov 2003 13:34:16 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA1LXhC16609; Sat, 1 Nov 2003 13:33:46 -0800 Date: Sat, 1 Nov 2003 13:36:01 -0800 From: Andrew Morton To: Stian Jordet Cc: netdev@oss.sgi.com Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk Message-Id: <20031101133601.7cf12497.akpm@osdl.org> In-Reply-To: <1067705386.666.1.camel@chevrolet.hybel> References: <1067705386.666.1.camel@chevrolet.hybel> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1168 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Stian Jordet wrote: > > Hello, > kernel 2.6.0-test9 works perfect here, but with the latest cset I get > the attached oops at boottime. Hope this helps someone. > Please send your .config. > NET: Registered protocol family 23 > Unable to handle kernel NULL pointer dereference at virtual address 00000004 > printing eip: > c03de40d > *pde = 00000000 > Oops: 0002 [#1] > CPU: 0 > CIP: 0060:[] Not tainted > EFLAGS: 00010202 > EIP is at dev_add_pack+0x4d/0xb0 > eax: 00000038 ebx: c062f2f8 ecx: 00000000 edx: c05799e0 > esi: c05799d0 edi: 00000000 ebp: 00000000 esp: c152ffb4 > ds: 007b es: 007b ss: 0068 > Process swapper (pid: 1, threadinfo=c152e000 task=dff8f900) > Stack: c05e7fc8 00000001 c05defad c05799d0 c04af833 c05c094c 00000000 00000000 > c01359af 00000000 c152e000 c01050f6 00000002 c01050a0 00000000 c01072b9 > 00000000 00000000 00000000 > Call Trace: > [] irda_init+0x3d/0x60 > [] do_initcalls+0x2c/0xa0 > [] init_workqueues+0xf/0x24 > [] init+0x56/0x180 > [] init+0x0/0x180 > [] kernel_thread_helper+0x5/0xc > > Code: 89 51 04 89 90 c0 f2 62 c0 c6 05 40 3c 57 c0 01 b8 00 e0 ff > (0)Kernel panic: Fatal exception in interrupt > In interrupt handler - not syncing > > > From liste@jordet.nu Sat Nov 1 13:54:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 13:54:51 -0800 (PST) Received: from dodge.hybel (root@dodge.jordet.nu [217.13.8.142]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA1Lro25024174 for ; Sat, 1 Nov 2003 13:54:11 -0800 Received: from chevrolet.hybel (stianj@chevrolet.hybel [192.168.0.2]) by dodge.hybel (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA1LreuY024928 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 1 Nov 2003 22:53:41 +0100 Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk From: Stian Jordet To: Andrew Morton Cc: netdev@oss.sgi.com In-Reply-To: <20031101133601.7cf12497.akpm@osdl.org> References: <1067705386.666.1.camel@chevrolet.hybel> <20031101133601.7cf12497.akpm@osdl.org> Content-Type: multipart/mixed; boundary="=-CXZmLYdmid/PKgG6qYdK" Message-Id: <1067723628.643.0.camel@chevrolet.hybel> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 01 Nov 2003 22:53:48 +0100 X-archive-position: 1169 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: liste@jordet.nu Precedence: bulk X-list: netdev --=-CXZmLYdmid/PKgG6qYdK Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by dodge.hybel id hA1LreuY024928 l=F8r, 01.11.2003 kl. 22.36 skrev Andrew Morton: > Stian Jordet wrote: > > > > Hello, > > kernel 2.6.0-test9 works perfect here, but with the latest cset I get > > the attached oops at boottime. Hope this helps someone. > >=20 >=20 > Please send your .config. Here you are :) Thanks for looking into this :) Best regards, Stian > > NET: Registered protocol family 23 > > Unable to handle kernel NULL pointer dereference at virtual address 0= 0000004 > > printing eip: > > c03de40d > > *pde =3D 00000000 > > Oops: 0002 [#1] > > CPU: 0 > > CIP: 0060:[] Not tainted > > EFLAGS: 00010202 > > EIP is at dev_add_pack+0x4d/0xb0 > > eax: 00000038 ebx: c062f2f8 ecx: 00000000 edx: c05799e0 > > esi: c05799d0 edi: 00000000 ebp: 00000000 esp: c152ffb4 > > ds: 007b es: 007b ss: 0068 > > Process swapper (pid: 1, threadinfo=3Dc152e000 task=3Ddff8f900) > > Stack: c05e7fc8 00000001 c05defad c05799d0 c04af833 c05c094c 00000000= 00000000 > > c01359af 00000000 c152e000 c01050f6 00000002 c01050a0 00000000= c01072b9 > > 00000000 00000000 00000000 > > Call Trace: > > [] irda_init+0x3d/0x60 > > [] do_initcalls+0x2c/0xa0 > > [] init_workqueues+0xf/0x24 > > [] init+0x56/0x180 > > [] init+0x0/0x180 > > [] kernel_thread_helper+0x5/0xc > > =20 > > Code: 89 51 04 89 90 c0 f2 62 c0 c6 05 40 3c 57 c0 01 b8 00 e0 ff > > (0)Kernel panic: Fatal exception in interrupt > > In interrupt handler - not syncing > > =20 > >=20 > >=20 --=-CXZmLYdmid/PKgG6qYdK Content-Disposition: attachment; filename=config-2.6.0-test9 Content-Type: text/plain; name=config-2.6.0-test9; charset=iso-8859-1 Content-Transfer-Encoding: 7bit # # Automatically generated make config: don't edit # CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_STANDALONE=y CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y # # General setup # CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=17 CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y # # Processor type and features # CONFIG_X86_PC=y # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set CONFIG_MPENTIUMIII=y # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MELAN is not set # CONFIG_MCRUSOE is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=5 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_HPET_TIMER is not set # CONFIG_HPET_EMULATE_RTC is not set CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_PREEMPT=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y # CONFIG_X86_MCE_NONFATAL is not set # CONFIG_X86_MCE_P4THERMAL is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set CONFIG_MICROCODE=y CONFIG_X86_MSR=y CONFIG_X86_CPUID=y # CONFIG_EDD is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y CONFIG_HAVE_DEC_LOCK=y # # Power management options (ACPI, APM) # CONFIG_PM=y CONFIG_SOFTWARE_SUSPEND=y # CONFIG_PM_DISK is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y # CONFIG_ACPI_AC is not set # CONFIG_ACPI_BATTERY is not set CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_FAN is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_THERMAL is not set # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_TOSHIBA is not set # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y # CONFIG_ACPI_RELAXED_AML is not set # # APM (Advanced Power Management) BIOS Support # # CONFIG_APM is not set # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y # CONFIG_ISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=y CONFIG_YENTA=y CONFIG_CARDBUS=y # CONFIG_I82092 is not set # CONFIG_TCIC is not set # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_MISC=y # # Device Drivers # # # Generic Driver Options # # CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=y CONFIG_PARPORT_PC=y CONFIG_PARPORT_PC_CML1=y # CONFIG_PARPORT_SERIAL is not set # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_PC_PCMCIA is not set # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # # CONFIG_ISAPNP is not set CONFIG_PNPBIOS=y # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_INITRD is not set # CONFIG_LBD is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set # CONFIG_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECS=y # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes # # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_IDEPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_GENERIC is not set # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDE_TCQ is not set # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_IDEDMA_PCI_WIP is not set CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_DMA_NONPCI is not set # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=y # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_REPORT_LUNS is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=y CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 CONFIG_AIC7XXX_RESET_DELAY_MS=5000 # CONFIG_AIC7XXX_PROBE_EISA_VL is not set # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # PCMCIA SCSI adapter support # # CONFIG_PCMCIA_AHA152X is not set # CONFIG_PCMCIA_FDOMAIN is not set # CONFIG_PCMCIA_NINJA_SCSI is not set # CONFIG_PCMCIA_QLOGIC is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support (EXPERIMENTAL) # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set # CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set # CONFIG_IPV6 is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=y CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IRC=y # CONFIG_IP_NF_TFTP is not set # CONFIG_IP_NF_AMANDA is not set CONFIG_IP_NF_QUEUE=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y # CONFIG_IP_NF_MATCH_IPRANGE is not set CONFIG_IP_NF_MATCH_MAC=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_AH_ESP=y CONFIG_IP_NF_MATCH_LENGTH=y CONFIG_IP_NF_MATCH_TTL=y CONFIG_IP_NF_MATCH_TCPMSS=y CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_OWNER=y CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_SAME is not set CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=y CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y CONFIG_IP_NF_TARGET_ECN=y CONFIG_IP_NF_TARGET_DSCP=y CONFIG_IP_NF_TARGET_MARK=y # CONFIG_IP_NF_TARGET_CLASSIFY is not set CONFIG_IP_NF_TARGET_LOG=y CONFIG_IP_NF_TARGET_ULOG=y CONFIG_IP_NF_TARGET_TCPMSS=y CONFIG_IP_NF_ARPTABLES=y # CONFIG_IP_NF_ARPFILTER is not set CONFIG_IP_NF_ARP_MANGLE=y # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETDEVICES=y # # ARCnet devices # # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set CONFIG_E100=y # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set # CONFIG_E1000 is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SIS190 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set CONFIG_PPP=y CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=y CONFIG_PPP_SYNC_TTY=y CONFIG_PPP_DEFLATE=y CONFIG_PPP_BSDCOMP=y # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # # Wan interfaces # # CONFIG_WAN is not set # # PCMCIA network device support # CONFIG_NET_PCMCIA=y # CONFIG_PCMCIA_3C589 is not set # CONFIG_PCMCIA_3C574 is not set # CONFIG_PCMCIA_FMVJ18X is not set CONFIG_PCMCIA_PCNET=y # CONFIG_PCMCIA_NMCLAN is not set # CONFIG_PCMCIA_SMC91C92 is not set # CONFIG_PCMCIA_XIRC2PS is not set # CONFIG_PCMCIA_AXNET is not set # # Amateur Radio support # # CONFIG_HAMRADIO is not set # # IrDA (infrared) support # CONFIG_IRDA=y # # IrDA protocols # # CONFIG_IRLAN is not set # CONFIG_IRNET is not set CONFIG_IRCOMM=y # CONFIG_IRDA_ULTRA is not set # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y CONFIG_IRDA_DEBUG=y # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=y # # Dongle support # # CONFIG_DONGLE is not set # # Old SIR device drivers # # CONFIG_IRPORT_SIR is not set # # Old Serial dongle support # # # FIR device drivers # # CONFIG_USB_IRDA is not set # CONFIG_TOSHIBA_FIR is not set # CONFIG_VLSI_FIR is not set # # Bluetooth support # CONFIG_BT=y CONFIG_BT_L2CAP=y CONFIG_BT_SCO=y CONFIG_BT_RFCOMM=y CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=y CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m # CONFIG_BT_USB_SCO is not set # CONFIG_BT_USB_ZERO_PACKET is not set # CONFIG_BT_HCIUART is not set # CONFIG_BT_HCIDTL1 is not set # CONFIG_BT_HCIBT3C is not set # CONFIG_BT_HCIBLUECARD is not set # CONFIG_BT_HCIBTUART is not set # CONFIG_BT_HCIVHCI is not set # # ISDN subsystem # # CONFIG_ISDN_BOOL is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # CONFIG_GAMEPORT=y CONFIG_SOUND_GAMEPORT=y # CONFIG_GAMEPORT_NS558 is not set # CONFIG_GAMEPORT_L4 is not set CONFIG_GAMEPORT_EMU10K1=y # CONFIG_GAMEPORT_VORTEX is not set # CONFIG_GAMEPORT_FM801 is not set # CONFIG_GAMEPORT_CS461x is not set CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_PS2_SYNAPTICS is not set # CONFIG_MOUSE_SERIAL is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=y # CONFIG_INPUT_UINPUT is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_CONSOLE is not set # CONFIG_SERIAL_8250_CS is not set # CONFIG_SERIAL_8250_ACPI is not set CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 # CONFIG_PRINTER is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set # # I2C support # CONFIG_I2C=y # CONFIG_I2C_CHARDEV is not set # # I2C Algorithms # # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set CONFIG_I2C_VIAPRO=y # # I2C Hardware Sensors Chip support # CONFIG_I2C_SENSOR=y # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_VIA686A is not set CONFIG_SENSORS_W83781D=y # # Mice # # CONFIG_BUSMOUSE is not set # CONFIG_QIC02_TAPE is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set # CONFIG_HW_RANDOM is not set CONFIG_NVRAM=y CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=m # CONFIG_AGP_ALI is not set # CONFIG_AGP_ATI is not set # CONFIG_AGP_AMD is not set # CONFIG_AGP_AMD64 is not set # CONFIG_AGP_INTEL is not set # CONFIG_AGP_NVIDIA is not set # CONFIG_AGP_SIS is not set # CONFIG_AGP_SWORKS is not set CONFIG_AGP_VIA=m # CONFIG_DRM is not set # # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HANGCHECK_TIMER is not set # # Multimedia devices # CONFIG_VIDEO_DEV=y # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_BWQCAM is not set # CONFIG_VIDEO_CQCAM is not set # CONFIG_VIDEO_W9966 is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_ZR36120 is not set CONFIG_VIDEO_SAA7134=y # CONFIG_VIDEO_MXB is not set # CONFIG_VIDEO_DPC is not set # CONFIG_VIDEO_HEXIUM_ORION is not set # CONFIG_VIDEO_HEXIUM_GEMINI is not set # # Radio Adapters # # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set CONFIG_VIDEO_TUNER=y CONFIG_VIDEO_BUF=y # CONFIG_VIDEO_BTCX is not set # # Graphics support # CONFIG_FB=y # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y # CONFIG_FB_HGA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set CONFIG_FB_RADEON=y # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_PM3 is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=m CONFIG_PCI_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LOGO_LINUX_CLUT224=y # # Sound # CONFIG_SOUND=y # # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_SEQUENCER=m # CONFIG_SND_SEQ_DUMMY is not set CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y CONFIG_SND_RTCTIMER=m # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # # CONFIG_SND_DUMMY is not set # CONFIG_SND_VIRMIDI is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set CONFIG_SND_MPU401=m # # PCI devices # # CONFIG_SND_ALI5451 is not set # CONFIG_SND_AZT3328 is not set # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS4281 is not set CONFIG_SND_EMU10K1=m # CONFIG_SND_KORG1212 is not set # CONFIG_SND_NM256 is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set # CONFIG_SND_HDSP is not set # CONFIG_SND_TRIDENT is not set # CONFIG_SND_YMFPCI is not set # CONFIG_SND_ALS4000 is not set # CONFIG_SND_CMIPCI is not set # CONFIG_SND_ENS1370 is not set # CONFIG_SND_ENS1371 is not set # CONFIG_SND_ES1938 is not set # CONFIG_SND_ES1968 is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_FM801 is not set # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_VIA82XX is not set # CONFIG_SND_VX222 is not set # # ALSA USB devices # # CONFIG_SND_USB_AUDIO is not set # # PCMCIA devices # # CONFIG_SND_VXPOCKET is not set # CONFIG_SND_VXP440 is not set # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # # USB Host Controller Drivers # # CONFIG_USB_EHCI_HCD is not set # CONFIG_USB_OHCI_HCD is not set CONFIG_USB_UHCI_HCD=y # # USB Device Class drivers # # CONFIG_USB_AUDIO is not set # # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=y CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # # USB Human Interface Devices (HID) # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_XPAD is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set CONFIG_USB_SCANNER=y # CONFIG_USB_MICROTEK is not set # CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # CONFIG_USB_VICAM is not set # CONFIG_USB_DSBR is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set # CONFIG_USB_PWC is not set # CONFIG_USB_SE401 is not set # CONFIG_USB_STV680 is not set # # USB Network adaptors # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # # USB port drivers # # CONFIG_USB_USS720 is not set # # USB Serial Converter support # CONFIG_USB_SERIAL=m # CONFIG_USB_SERIAL_GENERIC is not set # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set # CONFIG_USB_SERIAL_EMPEG is not set # CONFIG_USB_SERIAL_FTDI_SIO is not set # CONFIG_USB_SERIAL_VISOR is not set # CONFIG_USB_SERIAL_IPAQ is not set # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_EDGEPORT_TI is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set # CONFIG_USB_SERIAL_KEYSPAN is not set # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set # CONFIG_USB_SERIAL_MCT_U232 is not set CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_SAFE is not set # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers # # CONFIG_USB_TIGL is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_BRLVGER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_TEST is not set # CONFIG_USB_GADGET is not set # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_XATTR is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_XFS_FS=y # CONFIG_XFS_RT is not set CONFIG_XFS_QUOTA=y CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set # CONFIG_QFMT_V2 is not set CONFIG_QUOTACTL=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_NTFS_FS=y # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_V4=y # CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_SUNRPC_GSS is not set CONFIG_SMB_FS=y # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y CONFIG_SMB_NLS=y CONFIG_NLS=y # # Native Language Support # CONFIG_NLS_DEFAULT="iso8859-15" CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set CONFIG_NLS_CODEPAGE_850=y # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set CONFIG_NLS_CODEPAGE_865=y # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set CONFIG_NLS_ISO8859_15=y # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=y # # Profiling support # # CONFIG_PROFILING is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_IOVIRT is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_FRAME_POINTER is not set CONFIG_X86_EXTRA_IRQS=y CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y # # Security options # # CONFIG_SECURITY is not set # # Cryptographic options # # CONFIG_CRYPTO is not set # # Library routines # CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y CONFIG_X86_TRAMPOLINE=y CONFIG_PC=y --=-CXZmLYdmid/PKgG6qYdK-- From akpm@osdl.org Sat Nov 1 16:01:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 16:02:35 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA201d25026191 for ; Sat, 1 Nov 2003 16:01:59 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA201VC01085; Sat, 1 Nov 2003 16:01:31 -0800 Date: Sat, 1 Nov 2003 16:03:50 -0800 From: Andrew Morton To: Stian Jordet Cc: netdev@oss.sgi.com, "David S. Miller" Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk Message-Id: <20031101160350.2f1fe0af.akpm@osdl.org> In-Reply-To: <1067723628.643.0.camel@chevrolet.hybel> References: <1067705386.666.1.camel@chevrolet.hybel> <20031101133601.7cf12497.akpm@osdl.org> <1067723628.643.0.camel@chevrolet.hybel> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hA201d25026191 X-archive-position: 1170 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Stian Jordet wrote: > > lør, 01.11.2003 kl. 22.36 skrev Andrew Morton: > > Stian Jordet wrote: > > > > > > Hello, > > > kernel 2.6.0-test9 works perfect here, but with the latest cset I get > > > the attached oops at boottime. Hope this helps someone. > > > > > > > Please send your .config. > > Here you are :) Thanks for looking into this :) OK, it goes bang because ptype_all has not been initialised yet. This is because net_dev_init() is fs_initcall, and irda_init() is subsys_initcall - irda_init() runs before net_dev_init(). Dave, I'm not sure what's the best thing to do here - I was afraid that the initcall level shuffling was a bit premature. IRDA doesn't look flexible (hugs to JT for commenting this nicely): /* * The IrDA stack must be initialised *before* drivers get initialised, * and *before* higher protocols (IrLAN/IrCOMM/IrNET) get initialised, * otherwise bad things will happen (hashbins will be NULL for example). * Those modules are at module_init()/device_initcall() level. * * On the other hand, it needs to be initialised *after* the basic * networking, the /proc/net filesystem and sysctl module. Those are * currently initialised in .../init/main.c (before initcalls). * Also, IrDA drivers needs to be initialised *after* the random number * generator (main stack and higher layer init don't need it anymore). * * Jean II */ So I dunno. Maybe we need to just revert the PNP patch, think about it some more? diff -puN drivers/pnp/isapnp/core.c~pnp-initcall-revert drivers/pnp/isapnp/core.c --- 25/drivers/pnp/isapnp/core.c~pnp-initcall-revert 2003-11-01 16:02:36.000000000 -0800 +++ 25-akpm/drivers/pnp/isapnp/core.c 2003-11-01 16:02:54.000000000 -0800 @@ -1160,7 +1160,7 @@ int __init isapnp_init(void) return 0; } -fs_initcall(isapnp_init); +device_initcall(isapnp_init); /* format is: noisapnp */ diff -puN net/core/dev.c~pnp-initcall-revert net/core/dev.c --- 25/net/core/dev.c~pnp-initcall-revert 2003-11-01 16:02:36.000000000 -0800 +++ 25-akpm/net/core/dev.c 2003-11-01 16:02:54.000000000 -0800 @@ -3067,7 +3067,7 @@ out: return rc; } -fs_initcall(net_dev_init); +subsys_initcall(net_dev_init); EXPORT_SYMBOL(__dev_get); EXPORT_SYMBOL(__dev_get_by_flags); _ From acme@conectiva.com.br Sat Nov 1 17:15:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 17:16:25 -0800 (PST) Received: from oops.kerneljanitors.org (1-131.ctame700-6.telepar.net.br [200.193.158.131]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA21FJ25030573 for ; Sat, 1 Nov 2003 17:15:39 -0800 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 093F81966F; Sun, 2 Nov 2003 00:49:23 +0000 (UTC) Date: Sat, 1 Nov 2003 22:49:23 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Linux Networking Development Mailing List Subject: [PATCH] LLC: fix client side after sockaddr_llc fixup Message-ID: <20031102004923.GB11632@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1171 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Hi David, After I did the fixup in struct sockaddr_llc, i.e. not to use 3 addresses, but just one the server side was OK, as I said to you in that RFC, but the client side was working by luck, i.e. it was always getting the destination sap and using it as both local and destination sap, this was because llc_ui_autobind was OK for servers and clients in the past with 3 addresses, but now it can't be shared by PF_LLC->bind() and PF_LLC->{sendmsg, connect}, so I made ->bind() have its own specific autobinding code and llc_ui_autobind is now only used by ->connect() and ->sendmsg(). This makes the client able to make multiple connections to the same sap on another machine. I refrained from changing the comments in llc_ui_bind and llc_ui_autobind to make the hunks in this patch look sane, will submit another patch that updates the comments to the (now) correct behaviour. Tested running sshd server with PF_LLC patch on both machines and connecting back and forth several times, everything working fine now. Best Regards, - Arnaldo ===== net/llc/af_llc.c 1.57 vs edited ===== --- 1.57/net/llc/af_llc.c Thu Oct 30 16:35:41 2003 +++ edited/net/llc/af_llc.c Sat Nov 1 21:36:53 2003 @@ -250,41 +250,19 @@ if (!sk->sk_zapped) goto out; - /* bind to a specific sap, optional. */ - if (!addr->sllc_sap) { - rc = -EUSERS; - addr->sllc_sap = llc_ui_autoport(); - if (!addr->sllc_sap) - goto out; - } - sap = llc_sap_find(addr->sllc_sap); - if (!sap) { - sap = llc_sap_open(addr->sllc_sap, NULL); - rc = -EBUSY; /* some other network layer is using the sap */ - if (!sap) - goto out; - } else { - struct llc_addr laddr, daddr; - struct sock *ask; - - memset(&laddr, 0, sizeof(laddr)); - memset(&daddr, 0, sizeof(daddr)); - /* - * FIXME: check if the the address is multicast, - * only SOCK_DGRAM can do this. - */ - memcpy(laddr.mac, addr->sllc_mac, IFHWADDRLEN); - laddr.lsap = addr->sllc_sap; - rc = -EADDRINUSE; /* mac + sap clash. */ - ask = llc_lookup_established(sap, &daddr, &laddr); - if (ask) { - sock_put(ask); - goto out; - } - } - llc->laddr.lsap = addr->sllc_sap; - if (llc->dev) - memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); + rc = -ENODEV; + llc->dev = dev_getfirstbyhwtype(addr->sllc_arphrd); + if (!llc->dev) + goto out; + rc = -EUSERS; + llc->laddr.lsap = llc_ui_autoport(); + if (!llc->laddr.lsap) + goto out; + rc = -EBUSY; /* some other network layer is using the sap */ + sap = llc_sap_open(llc->laddr.lsap, NULL); + if (!sap) + goto out; + memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); memcpy(&llc->addr, addr, sizeof(llc->addr)); /* assign new connection to its SAP */ llc_sap_add_socket(sap, sk); @@ -315,6 +293,8 @@ { struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; struct sock *sk = sock->sk; + struct llc_opt *llc = llc_sk(sk); + struct llc_sap *sap; int rc = -EINVAL; dprintk("%s: binding %02X\n", __FUNCTION__, addr->sllc_sap); @@ -323,8 +303,43 @@ rc = -EAFNOSUPPORT; if (addr->sllc_family != AF_LLC) goto out; - /* use autobind, to avoid code replication. */ - rc = llc_ui_autobind(sock, addr); + if (!addr->sllc_sap) { + rc = -EUSERS; + addr->sllc_sap = llc_ui_autoport(); + if (!addr->sllc_sap) + goto out; + } + sap = llc_sap_find(addr->sllc_sap); + if (!sap) { + sap = llc_sap_open(addr->sllc_sap, NULL); + rc = -EBUSY; /* some other network layer is using the sap */ + if (!sap) + goto out; + } else { + struct llc_addr laddr, daddr; + struct sock *ask; + + memset(&laddr, 0, sizeof(laddr)); + memset(&daddr, 0, sizeof(daddr)); + /* + * FIXME: check if the the address is multicast, + * only SOCK_DGRAM can do this. + */ + memcpy(laddr.mac, addr->sllc_mac, IFHWADDRLEN); + laddr.lsap = addr->sllc_sap; + rc = -EADDRINUSE; /* mac + sap clash. */ + ask = llc_lookup_established(sap, &daddr, &laddr); + if (ask) { + sock_put(ask); + goto out; + } + } + llc->laddr.lsap = addr->sllc_sap; + memcpy(llc->laddr.mac, addr->sllc_mac, IFHWADDRLEN); + memcpy(&llc->addr, addr, sizeof(llc->addr)); + /* assign new connection to its SAP */ + llc_sap_add_socket(sap, sk); + rc = sk->sk_zapped = 0; out: return rc; } @@ -399,15 +414,7 @@ llc->daddr.lsap = addr->sllc_sap; memcpy(llc->daddr.mac, addr->sllc_mac, IFHWADDRLEN); } - if (!llc->dev) { - rc = -ENODEV; - dev = dev_getfirstbyhwtype(addr->sllc_arphrd); - if (!dev) - goto out; - llc->dev = dev; - memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); - } else - dev = llc->dev; + dev = llc->dev; if (sk->sk_type != SOCK_STREAM) goto out; rc = -EALREADY; @@ -610,7 +617,7 @@ int rc = -EOPNOTSUPP; dprintk("%s: accepting on %02X\n", __FUNCTION__, - llc_sk(sk)->addr.sllc_sap); + llc_sk(sk)->laddr.lsap); lock_sock(sk); if (sk->sk_type != SOCK_STREAM) goto out; @@ -622,7 +629,7 @@ if (rc) goto out; dprintk("%s: got a new connection on %02X\n", __FUNCTION__, - llc_sk(sk)->addr.sllc_sap); + llc_sk(sk)->laddr.lsap); skb = skb_dequeue(&sk->sk_receive_queue); rc = -EINVAL; if (!skb->sk) @@ -747,13 +754,7 @@ if (rc) goto release; } - if (!llc->dev) { - rc = -ENODEV; - dev = dev_getfirstbyhwtype(addr->sllc_arphrd); - if (!dev) - goto release; - } else - dev = llc->dev; + dev = llc->dev; hdrlen = dev->hard_header_len + llc_ui_header_len(sk, addr); size = hdrlen + len; if (size > dev->mtu) From davem@pizda.ninka.net Sat Nov 1 19:36:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 19:37:26 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA23ah25031937 for ; Sat, 1 Nov 2003 19:36:46 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA17405; Sat, 1 Nov 2003 19:29:26 -0800 Date: Sat, 1 Nov 2003 19:29:26 -0800 From: "David S. Miller" To: Andrew Morton Cc: liste@jordet.nu, netdev@oss.sgi.com Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk Message-Id: <20031101192926.3c7d516f.davem@redhat.com> In-Reply-To: <20031101160350.2f1fe0af.akpm@osdl.org> References: <1067705386.666.1.camel@chevrolet.hybel> <20031101133601.7cf12497.akpm@osdl.org> <1067723628.643.0.camel@chevrolet.hybel> <20031101160350.2f1fe0af.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1172 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 1 Nov 2003 16:03:50 -0800 Andrew Morton wrote: > OK, it goes bang because ptype_all has not been initialised yet. > > This is because net_dev_init() is fs_initcall, and irda_init() is > subsys_initcall - irda_init() runs before net_dev_init(). > > Dave, I'm not sure what's the best thing to do here - I was afraid that the > initcall level shuffling was a bit premature. Turns out my suspicions were correct afterall :-) If it's just ptype_all that it needs, why don't we just initialize that one list head at compile time? From akpm@osdl.org Sat Nov 1 19:49:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 19:50:10 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA23na25032405 for ; Sat, 1 Nov 2003 19:49:36 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA23nHC27507; Sat, 1 Nov 2003 19:49:17 -0800 Date: Sat, 1 Nov 2003 19:51:37 -0800 From: Andrew Morton To: "David S. Miller" Cc: liste@jordet.nu, netdev@oss.sgi.com Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk Message-Id: <20031101195137.0b19784a.akpm@osdl.org> In-Reply-To: <20031101192926.3c7d516f.davem@redhat.com> References: <1067705386.666.1.camel@chevrolet.hybel> <20031101133601.7cf12497.akpm@osdl.org> <1067723628.643.0.camel@chevrolet.hybel> <20031101160350.2f1fe0af.akpm@osdl.org> <20031101192926.3c7d516f.davem@redhat.com> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1173 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev "David S. Miller" wrote: > > If it's just ptype_all that it needs, why don't we just initialize > that one list head at compile time? Pessimism, basically. I'm sure we could locally fix IRDA, but what other bugs has that initcall change introduced? From davem@pizda.ninka.net Sat Nov 1 19:52:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 19:52:44 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA23qA25032684 for ; Sat, 1 Nov 2003 19:52:11 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA17446; Sat, 1 Nov 2003 19:44:53 -0800 Date: Sat, 1 Nov 2003 19:44:53 -0800 From: "David S. Miller" To: Andrew Morton Cc: liste@jordet.nu, netdev@oss.sgi.com Subject: Re: Oops at "NET: Registering protocol family 23" at boot with 2.6.0t9-bk Message-Id: <20031101194453.70cb8405.davem@redhat.com> In-Reply-To: <20031101195137.0b19784a.akpm@osdl.org> References: <1067705386.666.1.camel@chevrolet.hybel> <20031101133601.7cf12497.akpm@osdl.org> <1067723628.643.0.camel@chevrolet.hybel> <20031101160350.2f1fe0af.akpm@osdl.org> <20031101192926.3c7d516f.davem@redhat.com> <20031101195137.0b19784a.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1174 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 1 Nov 2003 19:51:37 -0800 Andrew Morton wrote: > "David S. Miller" wrote: > > > > If it's just ptype_all that it needs, why don't we just initialize > > that one list head at compile time? > > Pessimism, basically. I'm sure we could locally fix IRDA, but what > other bugs has that initcall change introduced? Okie dokie, I'll likely just revert it in my tree after I look this issue over a little more. From rusty@samba.org Sat Nov 1 22:23:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 22:24:20 -0800 (PST) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA26Nj25004319 for ; Sat, 1 Nov 2003 22:23:46 -0800 Received: by lists.samba.org (Postfix, from userid 590) id 8755A2C003; Sun, 2 Nov 2003 06:23:45 +0000 (GMT) From: Rusty Russell To: anton@samba.org, kuznet@ms2.inr.ac.ru, davem@redhat.com Cc: netdev@oss.sgi.com Subject: Flow cache uses unsigned long for cpu mask. Date: Sun, 02 Nov 2003 16:34:35 +1100 Message-Id: <20031102062345.8755A2C003@lists.samba.org> X-archive-position: 1175 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev net/core/flow.c uses "unsigned long flow_cache_cpu_map": AFAICT this should be a cpumask_t. Just doing an unrelated audit... Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From davem@pizda.ninka.net Sat Nov 1 22:58:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 22:58:42 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA26w925004868 for ; Sat, 1 Nov 2003 22:58:09 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA17668; Sat, 1 Nov 2003 22:50:50 -0800 Date: Sat, 1 Nov 2003 22:50:50 -0800 From: "David S. Miller" To: Rusty Russell Cc: anton@samba.org, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: net/core/flow.c cpu handling? Message-Id: <20031101225050.4de96a8b.davem@redhat.com> In-Reply-To: <20031102062345.A472E2C0CD@lists.samba.org> References: <20031102062345.A472E2C0CD@lists.samba.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1176 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Very likely, the code is how it is in order to make the 2.4.x backport of this code and the 2.6.x version as similar as humanly possible. From rusty@samba.org Sat Nov 1 23:16:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 23:16:38 -0800 (PST) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA27Ft25005365 for ; Sat, 1 Nov 2003 23:15:55 -0800 Received: by lists.samba.org (Postfix, from userid 590) id A472E2C0CD; Sun, 2 Nov 2003 06:23:45 +0000 (GMT) From: Rusty Russell To: anton@samba.org, kuznet@ms2.inr.ac.ru, davem@redhat.com Cc: netdev@oss.sgi.com Subject: net/core/flow.c cpu handling? Date: Sun, 02 Nov 2003 17:22:55 +1100 Message-Id: <20031102062345.A472E2C0CD@lists.samba.org> X-archive-position: 1177 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Hi again, Is there something I'm missing, or wouldn't the code in net/core/flow.c be much simpler if: 1) flow_cache_cpu_prepare() were done for each possible cpu, not dynamically as they came up. 2) The cpucontrol lock is held in flow_cache_flush to guarantee that cpus don't go up and down. 3) The normal cpu_online_map were used instead of flow_cache_cpu_map. The patch below is untested, but if you can't see anything wrong with the approach, I'll test it. Cheers, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. Name: Simplify CPU Handling in net/core/flow.c Author: Rusty Russell Status: Booted on 2.6.0-test9-bk6 D: The cpu handling in net/core/flow.c is flawed, because it uses an D: unsigned long instead of a cpumask_t. This replaces that code D: with a much simpler version which allocates for every possible CPU, D: (the same amount of work on most machines) and takes the cpucontrol D: semaphore when flushing. --- linux-2.6.0-test9-bk4/net/core/flow.c 2003-10-09 18:03:03.000000000 +1000 +++ working-2.6.0-test9-bk4-hotcpu-with-kthread/net/core/flow.c 2003-11-02 17:10:55.000000000 +1100 @@ -65,23 +65,18 @@ struct flow_flush_info { atomic_t cpuleft; - unsigned long cpumap; struct completion completion; }; static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL }; #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu)) -static DECLARE_MUTEX(flow_cache_cpu_sem); -static unsigned long flow_cache_cpu_map; -static unsigned int flow_cache_cpu_count; - static void flow_cache_new_hashrnd(unsigned long arg) { int i; for (i = 0; i < NR_CPUS; i++) - if (test_bit(i, &flow_cache_cpu_map)) + if (cpu_possible(i)) flow_hash_rnd_recalc(i) = 1; flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD; @@ -178,7 +173,9 @@ cpu = smp_processor_id(); fle = NULL; - if (!test_bit(cpu, &flow_cache_cpu_map)) + /* Packet really early in init? Making flow_cache_init a + * pre-smp initcall would solve this. --RR */ + if (!flow_table(cpu)) goto nocache; if (flow_hash_rnd_recalc(cpu)) @@ -277,9 +274,6 @@ struct tasklet_struct *tasklet; cpu = smp_processor_id(); - if (!test_bit(cpu, &info->cpumap)) - return; - tasklet = flow_flush_tasklet(cpu); tasklet->data = (unsigned long)info; tasklet_schedule(tasklet); @@ -288,29 +282,23 @@ void flow_cache_flush(void) { struct flow_flush_info info; - static DECLARE_MUTEX(flow_flush_sem); - - down(&flow_cache_cpu_sem); - info.cpumap = flow_cache_cpu_map; - atomic_set(&info.cpuleft, flow_cache_cpu_count); - up(&flow_cache_cpu_sem); + /* Don't want cpus going down or up during this, also protects + * against multiple callers. */ + down(&cpucontrol); + atomic_set(&info.cpuleft, num_online_cpus()); init_completion(&info.completion); - down(&flow_flush_sem); - local_bh_disable(); smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0); - if (test_bit(smp_processor_id(), &info.cpumap)) - flow_cache_flush_tasklet((unsigned long)&info); + flow_cache_flush_tasklet((unsigned long)&info); local_bh_enable(); wait_for_completion(&info.completion); - - up(&flow_flush_sem); + up(&cpucontrol); } -static int __devinit flow_cache_cpu_prepare(int cpu) +static void __devinit flow_cache_cpu_prepare(int cpu) { struct tasklet_struct *tasklet; unsigned long order; @@ -323,9 +311,8 @@ flow_table(cpu) = (struct flow_cache_entry **) __get_free_pages(GFP_KERNEL, order); - if (!flow_table(cpu)) - return NOTIFY_BAD; + panic("NET: failed to allocate flow cache order %lu\n", order); memset(flow_table(cpu), 0, PAGE_SIZE << order); @@ -334,39 +321,8 @@ tasklet = flow_flush_tasklet(cpu); tasklet_init(tasklet, flow_cache_flush_tasklet, 0); - - return NOTIFY_OK; -} - -static int __devinit flow_cache_cpu_online(int cpu) -{ - down(&flow_cache_cpu_sem); - set_bit(cpu, &flow_cache_cpu_map); - flow_cache_cpu_count++; - up(&flow_cache_cpu_sem); - - return NOTIFY_OK; -} - -static int __devinit flow_cache_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) -{ - unsigned long cpu = (unsigned long)cpu; - switch (action) { - case CPU_UP_PREPARE: - return flow_cache_cpu_prepare(cpu); - break; - case CPU_ONLINE: - return flow_cache_cpu_online(cpu); - break; - } - return NOTIFY_OK; } -static struct notifier_block __devinitdata flow_cache_cpu_nb = { - .notifier_call = flow_cache_cpu_notify, -}; - static int __init flow_cache_init(void) { int i; @@ -388,15 +344,9 @@ flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD; add_timer(&flow_hash_rnd_timer); - register_cpu_notifier(&flow_cache_cpu_nb); - for (i = 0; i < NR_CPUS; i++) { - if (!cpu_online(i)) - continue; - if (flow_cache_cpu_prepare(i) == NOTIFY_OK && - flow_cache_cpu_online(i) == NOTIFY_OK) - continue; - panic("NET: failed to initialise flow cache hash table\n"); - } + for (i = 0; i < NR_CPUS; i++) + if (cpu_possible(i)) + flow_cache_cpu_prepare(i); return 0; } From davem@pizda.ninka.net Sat Nov 1 23:16:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 23:17:18 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA27Gk25005390 for ; Sat, 1 Nov 2003 23:16:46 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA17715; Sat, 1 Nov 2003 23:09:21 -0800 Date: Sat, 1 Nov 2003 23:09:21 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV{4,6}: Fix one more inappropriate use of inet6_sk()->ipv6only Message-Id: <20031101230921.285fc538.davem@redhat.com> In-Reply-To: <20031101.200132.55114465.yoshfuji@linux-ipv6.org> References: <20031101.200132.55114465.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1178 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Applied, thanks Yoshfuji. From davem@pizda.ninka.net Sat Nov 1 23:17:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 23:18:18 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA27Hm25005936 for ; Sat, 1 Nov 2003 23:17:48 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA17742; Sat, 1 Nov 2003 23:10:27 -0800 Date: Sat, 1 Nov 2003 23:10:27 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] LLC: fix procfs reading when there are saps without sockets Message-Id: <20031101231027.13d06c8c.davem@redhat.com> In-Reply-To: <20031101065504.GK3705@conectiva.com.br> References: <20031101065504.GK3705@conectiva.com.br> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1179 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Applied, thanks Arnaldo. From davem@pizda.ninka.net Sat Nov 1 23:19:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Nov 2003 23:19:33 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA27J125006307 for ; Sat, 1 Nov 2003 23:19:01 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA17774; Sat, 1 Nov 2003 23:11:42 -0800 Date: Sat, 1 Nov 2003 23:11:42 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] LLC: fix client side after sockaddr_llc fixup Message-Id: <20031101231142.2bec7e27.davem@redhat.com> In-Reply-To: <20031102004923.GB11632@conectiva.com.br> References: <20031102004923.GB11632@conectiva.com.br> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1180 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Applied, thanks Arnaldo. From laforge@gnumonks.org Sun Nov 2 06:48:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 06:49:33 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA2Emv25021878 for ; Sun, 2 Nov 2003 06:48:58 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.22) id 1AGJXD-0003Tj-5x; Sun, 02 Nov 2003 15:48:55 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1AGDiF-0001NH-5z; Sun, 02 Nov 2003 09:35:55 +0100 Date: Sun, 2 Nov 2003 09:35:55 +0100 From: Harald Welte To: Joseph Conlin Cc: netdev@oss.sgi.com, jrd@cc.usu.edu Subject: Re: Replace the Nagle Algorithm Message-ID: <20031102083555.GG1536@sunbeam.de.gnumonks.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ndw/alBWmZEhfcZ" Content-Disposition: inline In-Reply-To: X-Operating-system: Linux sunbeam 2.6.0-test5-nftest X-Date: Today is Setting Orange, the 13rd day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -6.7 (------) X-archive-position: 1181 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --4ndw/alBWmZEhfcZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 20, 2003 at 12:58:19PM -0600, Joseph Conlin wrote: > I see in the archives and the code that I have looked at (2.4.22, > 2.6.0-test8) that the Minshall algorithm is being used to reduce the > effects of Nagle/delayed ACK interaction. I haven't seen any mention of > the following solution, proposed as an IETF draft RFC by Joe Doupnik > (jrd@cc.usu.edu). >=20 > http://netlab1.usu.edu/pub/misc/draft-doupnik-tcpimpl-nagle-mode-00.txt Interesting, but do you know why this has not been aprooved as RFC and never became more than a draft of the TCP implementation working group? --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --4ndw/alBWmZEhfcZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/pMHrXaXGVTD0i/8RAvh+AKCSFS3PebGTt/FCcSXclZP8gs0nxACfcbgh XBIxvcDguLxJdDpMKxyCAvc= =H46q -----END PGP SIGNATURE----- --4ndw/alBWmZEhfcZ-- From laforge@gnumonks.org Sun Nov 2 06:52:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 06:53:32 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA2Eqv25022248 for ; Sun, 2 Nov 2003 06:52:58 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.22) id 1AGJXB-0003Sf-2B; Sun, 02 Nov 2003 15:48:53 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1AGE8u-0001hB-CB; Sun, 02 Nov 2003 10:03:28 +0100 Date: Sun, 2 Nov 2003 10:03:28 +0100 From: Harald Welte To: Christian Cc: netdev@oss.sgi.com Subject: Re: ppc32 lockups with 2.6 (maybe network related) Message-ID: <20031102090328.GI1536@sunbeam.de.gnumonks.org> References: <3FA10C2E.1000205@g-house.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k9xkV0rc9XGsukaG" Content-Disposition: inline In-Reply-To: <3FA10C2E.1000205@g-house.de> X-Operating-system: Linux sunbeam 2.6.0-test5-nftest X-Date: Today is Setting Orange, the 13rd day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -6.7 (------) X-archive-position: 1182 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --k9xkV0rc9XGsukaG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 30, 2003 at 02:03:42PM +0100, Christian wrote: >=20 > I am not subscribed to netdev@oss.sgi.com, please CC me. > i posted to LKML too, but followed an advise better posting to this list. Please consider mailing this to the linuxppc-dev list, since you have a ppc specific bug. > Thank you, > Christian. --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --k9xkV0rc9XGsukaG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/pMhgXaXGVTD0i/8RAs4NAJ0Q6fOTLM4QqehYkntKyP/ZOOJPxwCfaptc pdUrQwKH6ePphJ3MLBNjvas= =5L+m -----END PGP SIGNATURE----- --k9xkV0rc9XGsukaG-- From laforge@gnumonks.org Sun Nov 2 06:53:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 06:53:53 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA2ErI25022255 for ; Sun, 2 Nov 2003 06:53:19 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.22) id 1AGJXC-0003Sf-SY; Sun, 02 Nov 2003 15:48:55 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1AGE4B-0001dh-Bm; Sun, 02 Nov 2003 09:58:35 +0100 Date: Sun, 2 Nov 2003 09:58:35 +0100 From: Harald Welte To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove historic entries in Documentation/Changes Message-ID: <20031102085835.GH1536@sunbeam.de.gnumonks.org> References: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aF3LVLvitz/VQU3c" Content-Disposition: inline In-Reply-To: <20031029.012202.105420248.yoshfuji@linux-ipv6.org> X-Operating-system: Linux sunbeam 2.6.0-test5-nftest X-Date: Today is Setting Orange, the 13rd day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -6.2 (------) X-archive-position: 1183 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --aF3LVLvitz/VQU3c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Yoshifuji! Please consider the following update for netfilter/iptables, instead of removing any reference to it. --- linux-old/Documentation/Changes 2003-09-29 21:20:11.000000000 +0200 +++ linux/Documentation/Changes 2003-11-02 09:56:09.000000000 +0100 @@ -237,13 +237,15 @@ General changes --------------- =20 -The IP firewalling and NAT code has been replaced again. The new -netfilter software (including ipfwadm and ipchains backwards- -compatible modules) is currently distributed separately. - If you have advanced network configuration needs, you should probably consider using the network tools from ip-route2. =20 +Packet Filter / NAT +------------------- +The packet filtering and NAT code uses the same tools like the previous 2.= 4.x +kernel series (iptables). It still includes backwards-compatibility modul= es +for 2.2.x-style ipchains and 2.0.x-style ipfwadm. + PPP --- =20 @@ -400,11 +402,9 @@ --------- o =20 -Netfilter ---------- -o -o -o +Iptables +-------- +o =20 Ip-route2 --------- --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --aF3LVLvitz/VQU3c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/pMc7XaXGVTD0i/8RAmDRAJ49qfDwKFF2UtCIjbkj/TietFzzeACePjPS EJbFH95MuNC4KJzCm4cm9ds= =Emx2 -----END PGP SIGNATURE----- --aF3LVLvitz/VQU3c-- From amir.noam@intel.com Sun Nov 2 06:54:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 06:54:40 -0800 (PST) Received: from petasus.isw.intel.com (petasus.isw.intel.com [192.55.37.196]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA2Es425022532 for ; Sun, 2 Nov 2003 06:54:05 -0800 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by petasus.isw.intel.com (8.11.6-20030918-01/8.11.6/d: solo.mc,v 1.56 2003/05/22 21:18:22 rfjohns1 Exp $) with ESMTP id hA2Erb313358 for ; Sun, 2 Nov 2003 14:53:37 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id hA2EvAu03030 for ; Sun, 2 Nov 2003 14:57:10 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003110216535409775 ; Sun, 02 Nov 2003 16:53:54 +0200 Received: from jrslxjul4.npdj.intel.com (jrslxjul4 [10.12.254.188]) by sun111.npdj.intel.com (8.12.9/8.12.9/MailSET/Hub) with ESMTP id hA2Eq9BN002967; Sun, 2 Nov 2003 16:52:12 +0200 (IST) Content-Type: text/plain; charset="iso-8859-1" From: Amir Noam To: "Jay Vosburgh" Subject: Re: [Bonding-devel] Re: [PATCH 2/10] [bonding 2.6] fix monitoring functions Date: Sun, 2 Nov 2003 16:53:51 +0200 User-Agent: KMail/1.4.3 Cc: "Jeff Garzik" , , , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200311021653.51194.amir.noam@intel.com> X-archive-position: 1184 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev On Thursday 30 October 2003 07:12 pm, Jay Vosburgh wrote: > >However, the following patch that restores backward > > compatibility with old ifenslave is still needed for 2.6. I > > see that it's already been applied by David Miller to 2.4. > > I thought we were dropping the ancient > (SIOCDEVPRIVATE) backwards compatibility in 2.6. This patch restores compatibility with old ifenslave versions that still use the SIOCBONDSETHWADDR command, not necessarily the SIOCDEVPRIVATE ioctls, so this patch is definitely needed for now. If we really want to remove backward compatibility in 2.6 we should do it for all bonding commands and replace them with the new interface. The problem is, since 2.6 is in effect in code freeze I'm not sure if we can actually replace the bonding<->ifenslave interface at this time (as much as I'd like to do it). Jeff, David, We haven't heard from either one of you on this issue: We want to drop support for SIOCDEVPRIVATE in 2.6. As a side effect this will force users to upgrade their user land tools anyway, so we might as well use this opportunity to insert the new interface to replace the current one. (Obviously, it would be preferable for such a change to take effect before 2.6.0 is made final) What do you think about making changes to the 2.6 bonding that will force users to upgrade their ifenslave application? (this new ifenslave will be, of course, backward compatible with 2.4 bonding). For now, however, this patch that restores backward compatibility is still needed for 2.6. I've noticed I'd sent out the wrong patch before (on 2003/10/30), so here is the corrected patch. Sorry for the mix up. Amir diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Oct 30 10:38:34 2003 +++ b/drivers/net/bonding/bond_main.c Sun Nov 2 15:14:21 2003 @@ -3047,6 +3047,10 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; + case BOND_SETHWADDR_OLD: + case SIOCBONDSETHWADDR: + ret = bond_sethwaddr(master_dev, slave_dev); + break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { From amir.noam@intel.com Sun Nov 2 06:55:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 06:55:41 -0800 (PST) Received: from petasus.isw.intel.com (petasus.isw.intel.com [192.55.37.196]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA2EtP25025670 for ; Sun, 2 Nov 2003 06:55:26 -0800 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by petasus.isw.intel.com (8.11.6-20030918-01/8.11.6/d: solo.mc,v 1.56 2003/05/22 21:18:22 rfjohns1 Exp $) with ESMTP id hA2Esv313524 for ; Sun, 2 Nov 2003 14:54:58 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id hA2EwVu03171 for ; Sun, 2 Nov 2003 14:58:31 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003110216551532671 ; Sun, 02 Nov 2003 16:55:15 +0200 Received: from jrslxjul4.npdj.intel.com (jrslxjul4 [10.12.254.188]) by sun111.npdj.intel.com (8.12.9/8.12.9/MailSET/Hub) with ESMTP id hA2ErXBN002982; Sun, 2 Nov 2003 16:53:33 +0200 (IST) Content-Type: text/plain; charset="iso-8859-1" From: Amir Noam To: "Jay Vosburgh" , "David S. Miller" Subject: Re: [Bonding-devel] [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Date: Sun, 2 Nov 2003 16:55:15 +0200 User-Agent: KMail/1.4.3 Cc: , , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200311021655.15498.amir.noam@intel.com> X-archive-position: 1185 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev On Friday 31 October 2003 10:10 pm, Jay Vosburgh wrote: > Jeff, can you apply Amir's patch, as it seems to work > just fine except for this ignorable problem? I'll append the > patch below for your convenience. That patch also applies to 2.6 (after the "restore backward compatibility" patch) with an offset of one line per chunk. I've appended it here again, against 2.6, just in case you want it to apply cleanly with no warnings. Amir diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Sun Nov 2 15:06:08 2003 +++ b/drivers/net/bonding/bond_main.c Sun Nov 2 15:06:18 2003 @@ -3573,6 +3573,62 @@ static void bond_destroy_proc_info(struc bond->bond_proc_file = NULL; } } + +/* Create the bonding directory under /proc/net, if doesn't exist yet. + * Caller must hold rtnl_lock. + */ +static void bond_create_proc_dir(void) +{ + int len = strlen(DRV_NAME); + + for (bond_proc_dir = proc_net->subdir; bond_proc_dir; + bond_proc_dir = bond_proc_dir->next) { + if ((bond_proc_dir->namelen == len) && + !memcmp(bond_proc_dir->name, DRV_NAME, len)) { + break; + } + } + + if (!bond_proc_dir) { + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir) { + bond_proc_dir->owner = THIS_MODULE; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: cannot create /proc/net/%s\n", + DRV_NAME); + } + } +} + +/* Destroy the bonding directory under /proc/net, if empty. + * Caller must hold rtnl_lock. + */ +static void bond_destroy_proc_dir(void) +{ + struct proc_dir_entry *de; + + if (!bond_proc_dir) { + return; + } + + /* verify that the /proc dir is empty */ + for (de = bond_proc_dir->subdir; de; de = de->next) { + /* ignore . and .. */ + if (*(de->name) != '.') { + break; + } + } + + if (de) { + if (bond_proc_dir->owner == THIS_MODULE) { + bond_proc_dir->owner = NULL; + } + } else { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +} #endif /* CONFIG_PROC_FS */ /* @@ -3828,6 +3884,9 @@ static struct notifier_block bond_netdev .notifier_call = bond_netdev_event, }; +/* De-initialize device specific data. + * Caller must hold rtnl_lock. + */ static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; @@ -3839,6 +3898,9 @@ static inline void bond_deinit(struct ne #endif } +/* Unregister and free all bond devices. + * Caller must hold rtnl_lock. + */ static void bond_free_all(void) { struct bonding *bond, *nxt; @@ -3846,16 +3908,13 @@ static void bond_free_all(void) list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { struct net_device *dev = bond->device; - unregister_netdev(dev); + unregister_netdevice(dev); bond_deinit(dev); free_netdev(dev); } #ifdef CONFIG_PROC_FS - if (bond_proc_dir) { - remove_proc_entry(DRV_NAME, proc_net); - bond_proc_dir = NULL; - } + bond_destroy_proc_dir(); #endif } @@ -4233,18 +4292,12 @@ static int __init bonding_init(void) primary = NULL; } + rtnl_lock(); + #ifdef CONFIG_PROC_FS - bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); - if (bond_proc_dir == NULL) { - printk(KERN_WARNING - "bonding_init(): can not create /proc/net/" DRV_NAME); - } else { - bond_proc_dir->owner = THIS_MODULE; - } + bond_create_proc_dir(); #endif - rtnl_lock(); - err = 0; for (no = 0; no < max_bonds; no++) { struct net_device *dev; @@ -4287,18 +4340,21 @@ static int __init bonding_init(void) return 0; out_err: - rtnl_unlock(); - /* free and unregister all bonds that were successfully added */ bond_free_all(); + rtnl_unlock(); + return err; } static void __exit bonding_exit(void) { unregister_netdevice_notifier(&bond_netdev_notifier); + + rtnl_lock(); bond_free_all(); + rtnl_unlock(); } module_init(bonding_init); From pekkas@netcore.fi Sun Nov 2 23:26:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Nov 2003 23:27:25 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA37Qo25015900 for ; Sun, 2 Nov 2003 23:26:51 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id hA37QbT27984; Mon, 3 Nov 2003 09:26:37 +0200 Date: Mon, 3 Nov 2003 09:26:36 +0200 (EET) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 on-link assumption considered harmful In-Reply-To: <1067615762.3423.264.camel@hades.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1186 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Fri, 31 Oct 2003, David Woodhouse wrote: > On Thu, 2003-10-30 at 21:09 +0200, Pekka Savola wrote: > > Just to give a heads-up before this is finalized, to give people ability > > to prepare or comment prior to this process is formalized in the IETF. > > With corresponding changes to the route advertisement protocol as used > by radvd, so that routes can actually be advertised to autoconfigured > nodes? Or does that already exist and I just missed it when I was > looking? Do you mean: http://www.ietf.org/internet-drafts/draft-ietf-ipv6-router-selection-02.txt This has nothing to do with this subject (AFAICS), but one person just a couple of days ago asked about this and wanted to know whether anyone else is hacking this, and if not, whether he should go ahead. We gave (as radvd maintainers) a thumbs-up. If you're also interested in hacking this, contact me off-list, and I'll ask the other person whether he'd like to get some help.. (Obviously, the preferences will need support in the kernel too.) -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From rusty@samba.org Mon Nov 3 02:28:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 02:29:04 -0800 (PST) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3ASU25023258 for ; Mon, 3 Nov 2003 02:28:31 -0800 Received: by lists.samba.org (Postfix, from userid 590) id E1C622C05E; Mon, 3 Nov 2003 10:28:29 +0000 (GMT) From: Rusty Russell To: "David S. Miller" Cc: anton@samba.org, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: net/core/flow.c cpu handling? In-reply-to: Your message of "Sat, 01 Nov 2003 22:50:50 -0800." <20031101225050.4de96a8b.davem@redhat.com> Date: Mon, 03 Nov 2003 21:26:40 +1100 Message-Id: <20031103102829.E1C622C05E@lists.samba.org> X-archive-position: 1187 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev In message <20031101225050.4de96a8b.davem@redhat.com> you write: > > Very likely, the code is how it is in order to make the > 2.4.x backport of this code and the 2.6.x version as > similar as humanly possible. Hmm, AFAICT the patch I sent should be easier, not harder to backport. Anyway, I'm carrying the patch as part of the hotplug CPU patches: we can discuss it once 2.6.0 is out. Thanks, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From wensong@linux-vs.org Mon Nov 3 06:17:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 06:18:09 -0800 (PST) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3EHS25001438 for ; Mon, 3 Nov 2003 06:17:32 -0800 Received: from penguin.linux-vs.org ([211.136.74.13]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id hA3EH0MP024985 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 3 Nov 2003 22:17:11 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id hA3EFl4L005800; Mon, 3 Nov 2003 22:15:48 +0800 Date: Mon, 3 Nov 2003 22:15:47 +0800 (CST) From: Wensong Zhang To: netdev@oss.sgi.com cc: "David S. Miller" , Julian Anastasov Subject: [2.4/2.6 PATCH] Cosmetic IP_VS_INFO fix Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463811584-2066790978-1067868947=:5797" X-archive-position: 1188 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463811584-2066790978-1067868947=:5797 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Here is minor cosmetic fix to add the trailing '\n'. Please check and apply them. Thanks, Wensong ---1463811584-2066790978-1067868947=:5797 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-tidyup.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-tidyup.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTE3OCAgLT4gMS4xMTc5IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jCTEuMiAgICAgLT4gMS4zICAgIA0K Iw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdlU2V0 IExvZw0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KIyAwMy8xMS8wMwl3ZW5zb25nQGxpbnV4LXZzLm9yZwkxLjEx NzkNCiMgW0lQVlNdIENvc21ldGljIElQX1ZTX0lORk8gZml4IHRvIGFkZCB0 aGUgdHJhaWxpbmcgJ1xuJw0KIyANCiMgUGF0Y2ggZnJvbSBIb3JtcyA8aG9y bXNAdmVyZ2VuZXQubmV0Pg0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLQ0KIw0KZGlmZiAtTnJ1IGEvbmV0L2lwdjQv aXB2cy9pcF92c19jdGwuYyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMN Ci0tLSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMJTW9uIE5vdiAgMyAy MTo1Nzo0NCAyMDAzDQorKysgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5j CU1vbiBOb3YgIDMgMjE6NTc6NDQgMjAwMw0KQEAgLTE3NDAsOSArMTc0MCw5 IEBADQogCSAqIENoZWNrIGZvciB2YWxpZCBwcm90b2NvbDogVENQIG9yIFVE UC4gRXZlbiBmb3IgZndtYXJrIT0wDQogCSAqLw0KIAlpZiAodXJ1bGUtPnBy b3RvY29sIT1JUFBST1RPX1RDUCAmJiB1cnVsZS0+cHJvdG9jb2whPUlQUFJP VE9fVURQKSB7DQotCQlJUF9WU19JTkZPKCJ2c19jdGw6IGludmFsaWQgcHJv dG9jb2w6ICVkICVkLiVkLiVkLiVkOiVkICVzIiwNCi0JCQkgICBudG9ocyh1 cnVsZS0+cHJvdG9jb2wpLCBOSVBRVUFEKHVydWxlLT52YWRkciksDQotCQkJ ICAgbnRvaHModXJ1bGUtPnZwb3J0KSwgdXJ1bGUtPnNjaGVkX25hbWUpOw0K KwkJSVBfVlNfRVJSKCJzZXRfY3RsOiBpbnZhbGlkIHByb3RvY29sICVkICVk LiVkLiVkLiVkOiVkICVzXG4iLA0KKwkJCSAgbnRvaHModXJ1bGUtPnByb3Rv Y29sKSwgTklQUVVBRCh1cnVsZS0+dmFkZHIpLA0KKwkJCSAgbnRvaHModXJ1 bGUtPnZwb3J0KSwgdXJ1bGUtPnNjaGVkX25hbWUpOw0KIAkJcmV0ID0gLUVG QVVMVDsNCiAJCWdvdG8gb3V0X3VubG9jazsNCiAJfQ0K ---1463811584-2066790978-1067868947=:5797 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.5-ipvs-tidyup.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.5-ipvs-tidyup.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTQwMyAgLT4gMS4xNDA0IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jCTEuMTEgICAgLT4gMS4xMiAgIA0K Iw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdlU2V0 IExvZw0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KIyAwMy8xMS8wMwl3ZW5zb25nQGxpbnV4LXZzLm9yZwkxLjE0 MDQNCiMgW0lQVlNdIENvc21ldGljIElQX1ZTX0lORk8gZml4IHRvIGFkZCB0 aGUgdHJhaWxpbmcgJ1xuJw0KIyANCiMgUGF0Y2ggZnJvbSBIb3JtcyA8aG9y bXNAdmVyZ2VuZXQubmV0Pg0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLQ0KIw0KZGlmZiAtTnJ1IGEvbmV0L2lwdjQv aXB2cy9pcF92c19jdGwuYyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMN Ci0tLSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMJTW9uIE5vdiAgMyAy MjoxMDozMiAyMDAzDQorKysgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5j CU1vbiBOb3YgIDMgMjI6MTA6MzIgMjAwMw0KQEAgLTE4MzksOSArMTgzOSw5 IEBADQogDQogCS8qIENoZWNrIGZvciB2YWxpZCBwcm90b2NvbDogVENQIG9y IFVEUCwgZXZlbiBmb3IgZndtYXJrIT0wICovDQogCWlmICh1c3ZjLT5wcm90 b2NvbCE9SVBQUk9UT19UQ1AgJiYgdXN2Yy0+cHJvdG9jb2whPUlQUFJPVE9f VURQKSB7DQotCQlJUF9WU19JTkZPKCJ2c19jdGw6IGludmFsaWQgcHJvdG9j b2w6ICVkICVkLiVkLiVkLiVkOiVkICVzIiwNCi0JCQkgICBudG9ocyh1c3Zj LT5wcm90b2NvbCksIE5JUFFVQUQodXN2Yy0+YWRkciksDQotCQkJICAgbnRv aHModXN2Yy0+cG9ydCksIHVzdmMtPnNjaGVkX25hbWUpOw0KKwkJSVBfVlNf RVJSKCJzZXRfY3RsOiBpbnZhbGlkIHByb3RvY29sICVkICVkLiVkLiVkLiVk OiVkICVzXG4iLA0KKwkJCSAgbnRvaHModXN2Yy0+cHJvdG9jb2wpLCBOSVBR VUFEKHVzdmMtPmFkZHIpLA0KKwkJCSAgbnRvaHModXN2Yy0+cG9ydCksIHVz dmMtPnNjaGVkX25hbWUpOw0KIAkJcmV0ID0gLUVGQVVMVDsNCiAJCWdvdG8g b3V0X3VubG9jazsNCiAJfQ0K ---1463811584-2066790978-1067868947=:5797-- From hch@infradead.org Mon Nov 3 07:12:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 07:12:52 -0800 (PST) Received: from phoenix.infradead.org (pub234.cambridge.redhat.com [213.86.99.234] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3FC725003995 for ; Mon, 3 Nov 2003 07:12:12 -0800 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 1AGgMr-0007cx-Ck; Mon, 03 Nov 2003 15:11:45 +0000 Date: Mon, 3 Nov 2003 15:11:45 +0000 From: Christoph Hellwig To: "David S. Miller" Cc: Rusty Russell , anton@samba.org, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: net/core/flow.c cpu handling? Message-ID: <20031103151145.A29287@infradead.org> References: <20031102062345.A472E2C0CD@lists.samba.org> <20031101225050.4de96a8b.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031101225050.4de96a8b.davem@redhat.com>; from davem@redhat.com on Sat, Nov 01, 2003 at 10:50:50PM -0800 X-archive-position: 1189 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev On Sat, Nov 01, 2003 at 10:50:50PM -0800, David S. Miller wrote: > > Very likely, the code is how it is in order to make the > 2.4.x backport of this code and the 2.6.x version as > similar as humanly possible. Well, the current code is wrong for 2.6 and breaks badly for machines with more than 32/64 cpus. -- Christoph Hellwig - Freelance Hacker Contact me for driver hacking and kernel development consulting From yoshfuji@linux-ipv6.org Mon Nov 3 10:24:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 10:24:55 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3IOK25008919 for ; Mon, 3 Nov 2003 10:24:21 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA3IO2lg028840; Tue, 4 Nov 2003 03:24:02 +0900 Date: Tue, 04 Nov 2003 03:24:02 +0900 (JST) Message-Id: <20031104.032402.67222659.yoshfuji@linux-ipv6.org> To: pekkas@netcore.fi Cc: dwmw2@infradead.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6 on-link assumption considered harmful From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <1067615762.3423.264.camel@hades.cambridge.redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1190 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. In article (at Mon, 3 Nov 2003 09:26:36 +0200 (EET)), Pekka Savola says: > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-router-selection-02.txt > > This has nothing to do with this subject (AFAICS), but one person just a > couple of days ago asked about this and wanted to know whether anyone else > is hacking this, and if not, whether he should go ahead. We gave (as > radvd maintainers) a thumbs-up. Host code is already available in USAGI tree since January, 2003. I'll contribute this to mainline (after 2.6.0). Thanks. --yoshfuji From pp@ee.oulu.fi Mon Nov 3 12:53:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 12:54:20 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3Krg25015981 for ; Mon, 3 Nov 2003 12:53:43 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id hA3KrawE026468; Mon, 3 Nov 2003 22:53:36 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.12.10/8.12.10/Submit) id hA3KrZfS012571; Mon, 3 Nov 2003 22:53:35 +0200 (EET) Date: Mon, 3 Nov 2003 22:53:35 +0200 From: Pekka Pietikainen To: Charles Bueche Cc: netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-ID: <20031103205335.GA7668@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1067888106.3366.20.camel@bluez.bueche.ch> User-Agent: Mutt/1.4.1i X-archive-position: 1191 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Mon, Nov 03, 2003 at 08:35:38PM +0100, Charles Bueche wrote: > Hi, > > I tried to reduce the MTU to 1464 because I'm behind an ADSL router. > Rigth when I do the "ifconfig eth0 192.168.0.4 mtu 1464", it hangs the > port. > The problem can be reproduced. I have attached a few log extracts. I > would be ready to test patches or new versions if needed. Heh Thanks for the report. Looking at the code and previous bugs in it, I can safely say I found the problem and a few similar ones that could be triggered when using ethtool :-) Anyway, here's a (untested) patch that should fix the problem. As a bonus I even snuck in a new feature, power management support! --- /usr/src/linux-2.6.0-0.test9.1.67/drivers/net/b44.c 2003-10-25 21:43:30.000000000 +0300 +++ linux-2.6.0-test9/drivers/net/b44.c 2003-11-03 22:25:15.943854312 +0200 @@ -25,8 +25,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.91" -#define DRV_MODULE_RELDATE "Oct 3, 2003" +#define DRV_MODULE_VERSION "0.92" +#define DRV_MODULE_RELDATE "Nov 3, 2003" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -942,6 +942,8 @@ b44_init_hw(bp); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } @@ -1558,6 +1560,8 @@ netif_wake_queue(bp->dev); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } case ETHTOOL_GPAUSEPARAM: { @@ -1601,6 +1605,8 @@ } spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } }; @@ -1852,11 +1858,57 @@ } } +#ifdef CONFIG_PM +static int b44_suspend(struct pci_dev *pdev, u32 state) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + del_timer_sync(&bp->timer); + + spin_lock_irq(&bp->lock); + + b44_halt(bp); + netif_carrier_off(bp->dev); + netif_device_detach(bp->dev); + b44_free_rings(bp); + + spin_unlock_irq(&bp->lock); + return 0; +} + +static int b44_resume(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + spin_lock_irq(&bp->lock); + + b44_init_rings(bp); + b44_init_hw(bp); + netif_device_attach(bp->dev); + spin_unlock_irq(&bp->lock); + + b44_enable_ints(bp); + return 0; +} +#endif /* CONFIG_PM */ + static struct pci_driver b44_driver = { .name = DRV_MODULE_NAME, .id_table = b44_pci_tbl, .probe = b44_init_one, .remove = __devexit_p(b44_remove_one), +#ifdef CONFIG_PM + .suspend = b44_suspend, + .resume = b44_resume, +#endif /* CONFIG_PM */ }; static int __init b44_init(void) From davem@pizda.ninka.net Mon Nov 3 14:50:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 14:51:13 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3MoI25019437 for ; Mon, 3 Nov 2003 14:50:38 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA16260; Mon, 3 Nov 2003 14:45:21 -0800 Date: Mon, 3 Nov 2003 14:45:21 -0800 From: "David S. Miller" To: Rusty Russell Cc: anton@samba.org, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: net/core/flow.c cpu handling? Message-Id: <20031103144521.0aec9ea3.davem@redhat.com> In-Reply-To: <20031103102829.E1C622C05E@lists.samba.org> References: <20031101225050.4de96a8b.davem@redhat.com> <20031103102829.E1C622C05E@lists.samba.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1192 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 03 Nov 2003 21:26:40 +1100 Rusty Russell wrote: > In message <20031101225050.4de96a8b.davem@redhat.com> you write: > > > > Very likely, the code is how it is in order to make the > > 2.4.x backport of this code and the 2.6.x version as > > similar as humanly possible. > > Hmm, AFAICT the patch I sent should be easier, not harder to backport. > > Anyway, I'm carrying the patch as part of the hotplug CPU patches: we > can discuss it once 2.6.0 is out. I intend to review your patch today, there is no justification for the problems you've pointed out in this code regardless of how difficult or easy fixing it makes a backport. From davem@pizda.ninka.net Mon Nov 3 14:52:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 14:52:43 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3MqB25019630 for ; Mon, 3 Nov 2003 14:52:11 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA16267; Mon, 3 Nov 2003 14:47:07 -0800 Date: Mon, 3 Nov 2003 14:47:07 -0800 From: "David S. Miller" To: Wensong Zhang Cc: netdev@oss.sgi.com, ja@ssi.bg Subject: Re: [2.4/2.6 PATCH] Cosmetic IP_VS_INFO fix Message-Id: <20031103144707.30fa18df.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1193 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Cosmetic fixes can wait for 2.6.1 and 2.4.24 From davem@pizda.ninka.net Mon Nov 3 15:00:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 15:01:19 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3N0j25020236 for ; Mon, 3 Nov 2003 15:00:45 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA16281; Mon, 3 Nov 2003 14:55:39 -0800 Date: Mon, 3 Nov 2003 14:55:39 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: rusty@rustcorp.com.au, anton@samba.org, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: net/core/flow.c cpu handling? Message-Id: <20031103145539.17f3ba01.davem@redhat.com> In-Reply-To: <20031103151145.A29287@infradead.org> References: <20031102062345.A472E2C0CD@lists.samba.org> <20031101225050.4de96a8b.davem@redhat.com> <20031103151145.A29287@infradead.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1194 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 3 Nov 2003 15:11:45 +0000 Christoph Hellwig wrote: > On Sat, Nov 01, 2003 at 10:50:50PM -0800, David S. Miller wrote: > > > > Very likely, the code is how it is in order to make the > > 2.4.x backport of this code and the 2.6.x version as > > similar as humanly possible. > > Well, the current code is wrong for 2.6 and breaks badly for machines > with more than 32/64 cpus. I totally understand, I am in no way trying to justify what the code is doing. From davem@pizda.ninka.net Mon Nov 3 15:21:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Nov 2003 15:21:50 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA3NLG25020760 for ; Mon, 3 Nov 2003 15:21:16 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA16422; Mon, 3 Nov 2003 15:16:18 -0800 Date: Mon, 3 Nov 2003 15:16:18 -0800 From: "David S. Miller" To: Pekka Pietikainen Cc: charles@bueche.ch, netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-Id: <20031103151618.79704b30.davem@redhat.com> In-Reply-To: <20031103205335.GA7668@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1195 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 3 Nov 2003 22:53:35 +0200 Pekka Pietikainen wrote: > Anyway, here's a (untested) patch that should fix the problem. As a bonus I > even snuck in a new feature, power management support! I think Jeff should merge this upstrea, but I really disagree with the CONFIG_PM ifdefs for the power-management support. From pp@ee.oulu.fi Tue Nov 4 03:16:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 03:16:38 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4BFx25022355 for ; Tue, 4 Nov 2003 03:16:00 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id hA4BFuwE023940; Tue, 4 Nov 2003 13:15:56 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.12.10/8.12.10/Submit) id hA4BFthM027680; Tue, 4 Nov 2003 13:15:55 +0200 (EET) Date: Tue, 4 Nov 2003 13:15:55 +0200 From: Pekka Pietikainen To: "David S. Miller" Cc: charles@bueche.ch, netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-ID: <20031104111555.GA26860@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20031103151618.79704b30.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 1196 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Mon, Nov 03, 2003 at 03:16:18PM -0800, David S. Miller wrote: > I think Jeff should merge this upstrea, but I really disagree > with the CONFIG_PM ifdefs for the power-management support. Fine with me (patch with CONFIG_PM removed included) Oh btw., when trying out whether the new code even compiles/loads I got the following in rmmod, does it look like something caused by generic code or should I look for a reason in b44? :-) (This is 2.6.0-test9-bk6). kernel BUG at net/core/dev.c:2882! invalid operand: 0000 [#1] CPU: 0 EIP: 0060:[] Tainted: P EFLAGS: 00010297 EIP is at free_netdev+0x2d/0x40 eax: ddfd6800 ebx: ddfd6800 ecx: 1f2e9da0 edx: 00000003 esi: dff5d000 edi: dff5d054 ebp: de743ec4 esp: de743ec4 ds: 007b es: 007b ss: 0068 Process rmmod (pid: 18966, threadinfo=de742000 task=c797b320) Stack: de743edc e090011d ddfd6800 dff5d000 e0902544 00000000 de743eec c01c8c09 dff5d000 dff5d054 de743f04 c0210dd0 dff5d054 dff5d080 e0902590 e0902590 de743f18 c0210e02 dff5d054 e0902544 c02fb458 de743f2c c0211039 e0902544 Call Trace: [] b44_remove_one+0x3d/0x60 [b44] [] pci_device_remove+0x39/0x40 [] device_release_driver+0x60/0x70 [] driver_detach+0x22/0x40 [] bus_remove_driver+0x39/0x70 [] driver_unregister+0x14/0x26 [] pci_unregister_driver+0x17/0x30 [] b44_cleanup+0x12/0x14 [b44] [] sys_delete_module+0x113/0x190 [] do_munmap+0x14f/0x1b0 [] sys_munmap+0x43/0x60 [] sysenter_past_esp+0x52/0x71 Code: 0f 0b 42 0b ab 48 2e c0 eb de c9 e9 93 6e ef ff 8d 76 00 55 Trying to reproduce on a fresh non-nvidia-tainted -bk8 rmmod initially worked, then I did /sbin/modprobe b44; /sbin/ifup eth0; /sbin/rmmod b44 managed to trigger another race: eth0: no IPv6 routers present Unable to handle kernel paging request at virtual address 706647ef printing eip: c0254415 *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010216 EIP is at rtnetlink_fill_ifinfo+0x2a5/0x480 eax: 706647e3 ebx: df037800 ecx: 00000ee4 edx: c68fa09c esi: 00000000 edi: df037805 ebp: dff8deb4 esp: dff8de88 ds: 007b es: 007b ss: 0068 Process events/0 (pid: 3, threadinfo=dff8c000 task=c151cc80) Stack: c689fd80 00000004 00000004 dff8dea4 00000ee4 00000f60 c68fa000 000005dc c689fd80 ffffffff 00000011 dff8dee4 c02548ac c689fd80 df037800 00000011 00000000 00000000 ffffffff df037800 c0335c00 df037800 00000006 dff8def8 Call Trace: [] rtmsg_ifinfo+0x5c/0xd0 [] rtnetlink_event+0x35/0x62 [] notifier_call_chain+0x2d/0x50 [] netdev_wait_allrefs+0xc0/0x110 [] netdev_run_todo+0x10c/0x1f0 [] __down_failed+0xb/0x14 [] worker_thread+0x1bb/0x2a0 [] linkwatch_event+0x0/0x30 [] default_wake_function+0x0/0x30 [] ret_from_fork+0x6/0x14 [] default_wake_function+0x0/0x30 [] worker_thread+0x0/0x2a0 [] kernel_thread_helper+0x5/0xc Code: 8b 50 0c b9 ff ff ff ff 31 c0 83 c2 08 89 d7 f2 ae f7 d1 49 --- /usr/src/linux-2.6.0-0.test9.1.67/drivers/net/b44.c 2003-10-25 21:43:30.000000000 +0300 +++ linux-2.6.0-test9/drivers/net/b44.c 2003-11-04 12:32:13.403426192 +0200 @@ -25,8 +25,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.91" -#define DRV_MODULE_RELDATE "Oct 3, 2003" +#define DRV_MODULE_VERSION "0.92" +#define DRV_MODULE_RELDATE "Nov 4, 2003" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -942,6 +942,8 @@ b44_init_hw(bp); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } @@ -1558,6 +1560,8 @@ netif_wake_queue(bp->dev); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } case ETHTOOL_GPAUSEPARAM: { @@ -1601,6 +1605,8 @@ } spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } }; @@ -1852,11 +1858,53 @@ } } +static int b44_suspend(struct pci_dev *pdev, u32 state) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + del_timer_sync(&bp->timer); + + spin_lock_irq(&bp->lock); + + b44_halt(bp); + netif_carrier_off(bp->dev); + netif_device_detach(bp->dev); + b44_free_rings(bp); + + spin_unlock_irq(&bp->lock); + return 0; +} + +static int b44_resume(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + spin_lock_irq(&bp->lock); + + b44_init_rings(bp); + b44_init_hw(bp); + netif_device_attach(bp->dev); + spin_unlock_irq(&bp->lock); + + b44_enable_ints(bp); + return 0; +} + static struct pci_driver b44_driver = { .name = DRV_MODULE_NAME, .id_table = b44_pci_tbl, .probe = b44_init_one, .remove = __devexit_p(b44_remove_one), + .suspend = b44_suspend, + .resume = b44_resume, }; static int __init b44_init(void) -- Pekka Pietikainen From kuznet@ms2.inr.ac.ru Tue Nov 4 04:34:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 04:34:45 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4CYA25030301 for ; Tue, 4 Nov 2003 04:34:11 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id PAA15518; Tue, 4 Nov 2003 15:33:03 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200311041233.PAA15518@yakov.inr.ac.ru> Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS To: davem@redhat.com (David S. Miller) Date: Tue, 4 Nov 2003 15:33:03 +0300 (MSK) Cc: jmorris@redhat.com, cfriesen@nortelnetworks.com, hadi@znyx.com, netdev@oss.sgi.com In-Reply-To: <20031030120140.678b721b.davem@redhat.com> from "David S. Miller" at ïËÔ 30, 2003 12:01:40 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1197 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! [cced to Jamal] > I've always been confused about all of the weird things > we do to handle DSCP et al. when masking the TOS bits all > over the place. TOS bits are masked only in one place: when doing routing by TOS, implemented by some existing routing engines sort of OSPF. No bits but TOS bits are used for these things. > Alexey, what is going on here? #1. Setting priority derived from TOS is different thing, it is just to make life more convenient for old and still existing applications: telnet, ftp, ssh, which set TOS bits in some way, which used to be reasonable. Actually, even not four bits but only two bits are used. #2. If the host is inside diffserv environment all these things just have no effects and make no sense. That's why we do not change anything (except for disabling access to ECN bits). > reasons. Firstly, if we're using the old bit fields it should be the > precedence bits that are used for the skb priority rather than the tos > field. Secondly, the whole precedence/tos thing has been obsoleted by > the 6-bit DSCP field, of which the first 3 bits are supposed to be > backwards compatible with the old precedence field. Shouldn't we > properly handle that? See above #1. Precedence bits used to be _non-sense_ in the past and their use outside of context of setup of your routers (in pre-DS world) or outide context of diffserv does not make sense. What's about "backward-compatibility", it sounds funny, DS is made compatible with Cisco use precedence and this has nothing to do with end users (where socket options make sense), precedence bits are rewritten by routers for their own use. > Secondly, for vlan priority tagging there are only 3 bits available. > This means that practically speaking anyone using vlan priorities needs > to limit themselves to priorities 0-7. Thirdly. :-) Technically speaking, direct access of user to such things is prohibited in any case. So, use proper classifiers to do right mappings. > Currently, for me to send a packet with IP precedence bits set to a > nonzero value *and* vlan priority set to the same value, I have to do > the following: > > int opt = PRIORITY << 5; > setsockopt(mysocks[i], SOL_IP, IP_TOS, &opt, sizeof(opt)); > opt = PRIORITY; > setsockopt(mysocks[i], SOL_SOCKET, SO_PRIORITY, &opt, sizeof(opt)); This is right. > This is kind of ugly. Hmm.. This is kinda nice. IP_TOS sets real TOS bits without any funny shifts and masks, but with some reasonable access control, SO_PRIORITY sets priority. TOS and PRIORITY are not related. > I propose adding a new IP socket option, IP_DSCP, > which would let you set the 6-bit DSCP value (which is then shifted by > two bits in the kernel to generate the 8-bit value for the header > field). I do not even think that IP_DSCP makes sense in diffserv environment. Packets are marked according to DS rules, not according to desire of particular user. Anyway, the thing which you suggest is equal to IP_TOS in this part. > The high-order 3 bits would then be automatically used to set > the socket priority to make a vlan egress mapping simple. Not even subject to discuss... In old current world it is just wrong, in new world it is even wronger. If DSCP is used for prioritizing, it is used via proper classifiers, not via some rules hardcoded to kernel. Alexey From an3h0ny@yahoo.fr Tue Nov 4 05:32:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 05:33:15 -0800 (PST) Received: from web11105.mail.yahoo.com (web11105.mail.yahoo.com [216.136.131.152]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4DWf25032470 for ; Tue, 4 Nov 2003 05:32:41 -0800 Message-ID: <20031104133240.89887.qmail@web11105.mail.yahoo.com> Received: from [195.68.44.148] by web11105.mail.yahoo.com via HTTP; Tue, 04 Nov 2003 14:32:40 CET Date: Tue, 4 Nov 2003 14:32:40 +0100 (CET) From: =?iso-8859-1?q?an7?= Subject: tcp checksumming To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1198 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Hello, In tcp_rcv_established(), when you are in fast path, you use checksum and copy (the first function in the chain is tcp_copy_to_iovec) to finally delivering data to the user. I browse datagram.c,checksum.h,skbuff.c,tcp_input.c and only sees (mainly by following function calls in datagram.c) checksum calculation, by a lot of calls to csum_fold() and csum_partial(), and copy to iovec, but i have never seen the checksum _verification_. I learn that skb->csum is (when you have not CHECKSUM UNECESSARY defined in the case of a device computing the checksum by itself) the checksum on running data.But it is used in all functions,and get replaced by a function result. I don't see where it is used as a comparison My question is pretty simple : where in the code, is the tcp checksum verified (compared to the computed one). My first impression was that it was done in the *copy_and_csum* functions, but i only see checksum computation. That is to say, it is like a side effect of keeping data in a buffer with a bad checksum.(maybe it is removed after ? i don't think so) PS : i have posted here many times, never get an answer. Please pay a little attention ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From an3h0ny@yahoo.fr Tue Nov 4 05:36:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 05:37:02 -0800 (PST) Received: from web11102.mail.yahoo.com (web11102.mail.yahoo.com [216.136.131.149]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4DaG25000408 for ; Tue, 4 Nov 2003 05:36:28 -0800 Message-ID: <20031104133615.86082.qmail@web11102.mail.yahoo.com> Received: from [195.68.44.148] by web11102.mail.yahoo.com via HTTP; Tue, 04 Nov 2003 14:36:15 CET Date: Tue, 4 Nov 2003 14:36:15 +0100 (CET) From: =?iso-8859-1?q?an7?= Subject: tcp checksumming To: davem@redhat.com Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1199 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: an3h0ny@yahoo.fr Precedence: bulk X-list: netdev Hello, In tcp_rcv_established(), when you are in fast path, you use checksum and copy (the first function in the chain is tcp_copy_to_iovec) to finally delivering data to the user. I browse datagram.c,checksum.h,skbuff.c,tcp_input.c and only sees (mainly by following function calls in datagram.c) checksum calculation, by a lot of calls to csum_fold() and csum_partial(), and copy to iovec, but i have never seen the checksum _verification_. I learn that skb->csum is (when you have not CHECKSUM UNECESSARY defined in the case of a device computing the checksum by itself) the checksum on running data.But it is used in all functions,and get replaced by a function result. I don't see where it is used as a comparison My question is pretty simple : where in the code, is the tcp checksum verified (compared to the computed one). My first impression was that it was done in the *copy_and_csum* functions, but i only see checksum computation. That is to say, it is like a side effect of keeping data in a buffer with a bad checksum.(maybe it is removed after ? i don't think so) ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From rmk@arm.linux.org.uk Tue Nov 4 06:28:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 06:29:28 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4ESm25001317 for ; Tue, 4 Nov 2003 06:28:49 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1AH2Ai-0003ca-1L; Tue, 04 Nov 2003 14:28:40 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1AH2Ah-0003GZ-9R; Tue, 04 Nov 2003 14:28:39 +0000 Date: Tue, 4 Nov 2003 14:28:39 +0000 From: Russell King To: davem@redhat.com, netdev@oss.sgi.com Subject: Fwd: tcp checksumming Message-ID: <20031104142839.C2207@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i X-Message-Flag: Your copy of Microsoft Outlook is vulnerable to viruses. See www.mutt.org for more details. X-archive-position: 1200 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk@arm.linux.org.uk Precedence: bulk X-list: netdev Not my problem. Please ensure that replies are directed at the appropriate address (ie not me.) Thanks. ----- Forwarded message from an7 ----- Date: Tue, 4 Nov 2003 15:17:59 +0100 (CET) From: an7 Subject: tcp checksumming Hello, i am sorry russel, but i asked many times on netdev without having the answer, i tried to understand by myself during two weeks..please help me In tcp_rcv_established(), when you are in fast path, you use checksum and copy (the first function in the chain is tcp_copy_to_iovec) to finally delivering data to the user. I browse datagram.c,checksum.h,skbuff.c,tcp_input.c and only sees (mainly by following function calls in datagram.c) checksum calculation, by a lot of calls to csum_fold() and csum_partial(), and copy to iovec, but i have never seen the checksum _verification_. I learn that skb->csum is (when you have not CHECKSUM UNECESSARY defined in the case of a device computing the checksum by itself) the checksum on running data.But it is used in all functions,and get replaced by a function result. I don't see where it is used as a comparison My question is pretty simple : where in the code, is the tcp checksum verified (compared to the computed one). My first impression was that it was done in the *copy_and_csum* functions, but i only see checksum computation. That is to say, it is like a side effect of keeping data in a buffer with a bad checksum.(maybe it is removed after ? i don't think so) ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com ----- End forwarded message ----- -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From hadi@znyx.com Tue Nov 4 08:04:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 08:05:18 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4G4b25003151 for ; Tue, 4 Nov 2003 08:04:37 -0800 Received: from [10.0.0.9] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2003110408031756:2421 ; Tue, 4 Nov 2003 08:03:17 -0800 Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Alexey Cc: "David S. Miller" , jmorris@redhat.com, cfriesen@nortelnetworks.com, netdev@oss.sgi.com In-Reply-To: <200311041233.PAA15518@yakov.inr.ac.ru> References: <200311041233.PAA15518@yakov.inr.ac.ru> Organization: Znyx Networks Message-Id: <1067961866.1031.41.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2003 11:04:26 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/04/2003 08:03:18 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/04/2003 08:03:27 AM, Serialize complete at 11/04/2003 08:03:27 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain X-archive-position: 1201 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev Hi, I agree with Alexey in regards to DSCP should be done by classifiers. Current mode of operation is: Whatever DSCP value you set will be reset by the network/box manager depending on some criteria they set. Applications running as root or sudo can of course open a netlink connection and set these values via a classifier. Actually one important thing easy to miss is that the IEEE priorities are reverse to what the IETF priorities are (who would have thunk, eh?). I havent looked at the VLAN code however blindly using the sk/skb->priority is _bad_ given that sk/skb->priority is based on IETF semantics. I bet you the Linux vlan code doesnt know this. cheers, jamal From cfriesen@nortelnetworks.com Tue Nov 4 09:03:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 09:04:14 -0800 (PST) Received: from zcars0m9.nortelnetworks.com (zcars0m9.nortelnetworks.com [47.129.242.157]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4H3e25009899 for ; Tue, 4 Nov 2003 09:03:40 -0800 Received: from zcard309.ca.nortel.com (zcard309.ca.nortel.com [47.129.242.69]) by zcars0m9.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id hA4H2ko16582; Tue, 4 Nov 2003 12:02:47 -0500 (EST) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard309.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id VRTPFR89; Tue, 4 Nov 2003 12:02:47 -0500 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id V8PGYW84; Tue, 4 Nov 2003 12:02:47 -0500 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 049272E151; Tue, 4 Nov 2003 12:02:46 -0500 (EST) Message-ID: <3FA7DBB5.1090500@nortelnetworks.com> Date: Tue, 04 Nov 2003 12:02:45 -0500 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru Cc: "David S. Miller" , jmorris@redhat.com, hadi@znyx.com, netdev@oss.sgi.com Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS References: <200311041233.PAA15518@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1202 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev kuznet@ms2.inr.ac.ru wrote: >>Currently, for me to send a packet with IP precedence bits set to a >>nonzero value *and* vlan priority set to the same value, I have to do >>the following: >> >>int opt = PRIORITY << 5; >>setsockopt(mysocks[i], SOL_IP, IP_TOS, &opt, sizeof(opt)); >>opt = PRIORITY; >>setsockopt(mysocks[i], SOL_SOCKET, SO_PRIORITY, &opt, sizeof(opt)); > Hmm.. This is kinda nice. IP_TOS sets real TOS bits without any funny > shifts and masks, but with some reasonable access control, SO_PRIORITY > sets priority. TOS and PRIORITY are not related. If that were the case, I'd be happy. However, when you set the TOS bits (which really sets the whole 8-bit field, rather than just the 4 TOS bits), the kernel also sets the socket priority but only uses the TOS bits to do so. If we're going to set the whole 8-bit field, wouldn't it make sense to use the priority bits to set the priority? Or even leave the socket priority totally alone? This is why I proposed the IP_DSCP option which would have sane handling of the socket priority when setting the DSCP value. > I do not even think that IP_DSCP makes sense in diffserv environment. > Packets are marked according to DS rules, not according to desire > of particular user. If root wants to send out a packet with particular DSCP settings, doesn't it make sense to make that option available? It's a field in the IP packet header, we should be able to set it with an IP option. Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From davem@pizda.ninka.net Tue Nov 4 09:18:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 09:19:28 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4HIq25010376 for ; Tue, 4 Nov 2003 09:18:54 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA18861; Tue, 4 Nov 2003 09:13:55 -0800 Date: Tue, 4 Nov 2003 09:13:55 -0800 From: "David S. Miller" To: Pekka Pietikainen Cc: charles@bueche.ch, netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-Id: <20031104091355.70d6a3d1.davem@redhat.com> In-Reply-To: <20031104111555.GA26860@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1203 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003 13:15:55 +0200 Pekka Pietikainen wrote: > Oh btw., when trying out whether the new code even compiles/loads > I got the following in rmmod, does it look like something caused > by generic code or should I look for a reason in b44? :-) > (This is 2.6.0-test9-bk6). free_netdev() is being invoked before the device registration state advanced to NETREG_UNREGISTERED, likely unregister_netdev() has not been called first or a bogus pointer was passed into the routine. From davem@pizda.ninka.net Tue Nov 4 09:29:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 09:30:27 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4HTn25010813 for ; Tue, 4 Nov 2003 09:29:50 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA18912; Tue, 4 Nov 2003 09:24:43 -0800 Date: Tue, 4 Nov 2003 09:24:43 -0800 From: "David S. Miller" To: Russell King Cc: netdev@oss.sgi.com, an3h0ny@yahoo.fr Subject: Re: Fwd: tcp checksumming Message-Id: <20031104092443.0dad265a.davem@redhat.com> In-Reply-To: <20031104142839.C2207@flint.arm.linux.org.uk> References: <20031104142839.C2207@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1204 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev > Not my problem. Sorry Russell, this an7 guy is getting really fucking annoying... He tried to force me to read the source code for him the other week too... so I definitely feel for you. From pp@ee.oulu.fi Tue Nov 4 13:19:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 13:20:19 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4LJc25016017 for ; Tue, 4 Nov 2003 13:19:39 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id hA4LJbwE020171 for ; Tue, 4 Nov 2003 23:19:37 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.12.10/8.12.10/Submit) id hA4LJbXx004481 for netdev@oss.sgi.com; Tue, 4 Nov 2003 23:19:37 +0200 (EET) Date: Tue, 4 Nov 2003 23:19:37 +0200 From: Pekka Pietikainen To: netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-ID: <20031104211937.GA3888@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> <20031104091355.70d6a3d1.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20031104091355.70d6a3d1.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 1205 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Tue, Nov 04, 2003 at 09:13:55AM -0800, David S. Miller wrote: > free_netdev() is being invoked before the device registration > state advanced to NETREG_UNREGISTERED, likely unregister_netdev() > has not been called first or a bogus pointer was passed into > the routine. Ah, like a missing SET_NETDEV_DEV? :-) I still got reliable rtnetlink_fill_ifinfo oopses (quick debugging showed strlen(dev->qdisc_sleeping->ops->id); to be the location of the oops), which went away after adding debug printk's to the module remove stuff, and didn't come back after removing them and instead removing the device from modprobe.conf (since I suspected it might have to do with the device getting rmmoded and getting immediately insmod'd since something tried to use the device). Then I put it back there and it's behaved since. Weird, or maybe I forgot a make modules_install before the initial fix. Whatever. Also added a add_timer() to resume, which it obviously needs... --- /usr/src/linux-2.6.0-0.test9.1.67/drivers/net/b44.c 2003-10-25 21:43:30.000000000 +0300 +++ linux-2.6.0-test9/drivers/net/b44.c 2003-11-04 22:12:25.776969400 +0200 @@ -25,8 +25,8 @@ #define DRV_MODULE_NAME "b44" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "0.91" -#define DRV_MODULE_RELDATE "Oct 3, 2003" +#define DRV_MODULE_VERSION "0.92" +#define DRV_MODULE_RELDATE "Nov 4, 2003" #define B44_DEF_MSG_ENABLE \ (NETIF_MSG_DRV | \ @@ -942,6 +942,8 @@ b44_init_hw(bp); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } @@ -1558,6 +1560,8 @@ netif_wake_queue(bp->dev); spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } case ETHTOOL_GPAUSEPARAM: { @@ -1601,6 +1605,8 @@ } spin_unlock_irq(&bp->lock); + b44_enable_ints(bp); + return 0; } }; @@ -1752,6 +1758,7 @@ } SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev,&pdev->dev); /* No interesting netdevice features in this card... */ dev->features |= 0; @@ -1852,11 +1859,56 @@ } } +static int b44_suspend(struct pci_dev *pdev, u32 state) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + del_timer_sync(&bp->timer); + + spin_lock_irq(&bp->lock); + + b44_halt(bp); + netif_carrier_off(bp->dev); + netif_device_detach(bp->dev); + b44_free_rings(bp); + + spin_unlock_irq(&bp->lock); + return 0; +} + +static int b44_resume(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + struct b44 *bp = dev->priv; + + if (!netif_running(dev)) + return 0; + + spin_lock_irq(&bp->lock); + + b44_init_rings(bp); + b44_init_hw(bp); + netif_device_attach(bp->dev); + spin_unlock_irq(&bp->lock); + + bp->timer.expires = jiffies + HZ; + add_timer(&bp->timer); + + b44_enable_ints(bp); + return 0; +} + static struct pci_driver b44_driver = { .name = DRV_MODULE_NAME, .id_table = b44_pci_tbl, .probe = b44_init_one, .remove = __devexit_p(b44_remove_one), + .suspend = b44_suspend, + .resume = b44_resume, }; static int __init b44_init(void) -- Pekka Pietikainen From davem@pizda.ninka.net Tue Nov 4 13:25:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 13:26:08 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4LPF25016455 for ; Tue, 4 Nov 2003 13:25:35 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA19893; Tue, 4 Nov 2003 13:20:17 -0800 Date: Tue, 4 Nov 2003 13:20:17 -0800 From: "David S. Miller" To: Pekka Pietikainen Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: changing MTU on b44 breaks eth0 Message-Id: <20031104132017.1d43a69c.davem@redhat.com> In-Reply-To: <20031104211937.GA3888@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> <20031104091355.70d6a3d1.davem@redhat.com> <20031104211937.GA3888@ee.oulu.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1206 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003 23:19:37 +0200 Pekka Pietikainen wrote: > On Tue, Nov 04, 2003 at 09:13:55AM -0800, David S. Miller wrote: > > free_netdev() is being invoked before the device registration > > state advanced to NETREG_UNREGISTERED, likely unregister_netdev() > > has not been called first or a bogus pointer was passed into > > the routine. > Ah, like a missing SET_NETDEV_DEV? :-) Wonderful, Jeff please integrate this b44 patch from Pekka. From acme@conectiva.com.br Tue Nov 4 14:31:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 14:32:03 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4MVQ25017332 for ; Tue, 4 Nov 2003 14:31:29 -0800 Received: from [200.181.169.115] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AH9jQ-0001hd-00 for netdev@oss.sgi.com; Tue, 04 Nov 2003 20:33:01 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 81F3BE72F; Tue, 4 Nov 2003 22:31:19 +0000 (UTC) Date: Tue, 4 Nov 2003 20:31:19 -0200 From: Arnaldo Carvalho de Melo To: netdev@oss.sgi.com Subject: [Bug 1490] New: _decode_session[46] does not set type or code for ICMP or ICMPv6] Message-ID: <20031104223118.GB23401@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1207 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev FYI ----- Forwarded message from bugme-daemon@osdl.org ----- Date: Tue, 4 Nov 2003 08:54:36 -0800 From: bugme-daemon@osdl.org Subject: [Bug 1490] New: _decode_session[46] does not set type or code for ICMP or ICMPv6 To: acme@conectiva.com.br http://bugme.osdl.org/show_bug.cgi?id=1490 Summary: _decode_session[46] does not set type or code for ICMP or ICMPv6 Kernel Version: 2.6.0-test9 Status: NEW Severity: normal Owner: acme@conectiva.com.br Submitter: bbuesker@qualcomm.com Distribution: Redhat 9 Hardware Environment: x86 Software Environment: ipsec-tools-0.2.2 Problem Description: The _decode_session[46] functions do not set the type and code for ICMP and ICMPv6. These values need to be set so that policies can be matched based on these fields, since setkey allows for specifying policies based on the type and code. Furthermore, __xfrm[46]_selector_match do not correctly handle ICMP and ICMPv6. The type should be compared against the xfrm_selector's sport field, and the code should be compared against the dport field. The type and code are both 8 bit fields, whereas __xfrm[46]_selector_match is comparing 16 bit values. Steps to reproduce: Insert a policy into the SPD using setkey that requires IPsec protection. For example, require inbound router advertisements to be protected with ESP with the following: spdadd ::/0 ::/0 icmp6 134,0 -P in ipsec esp/transport//require; Then send a router advertisement to the system under test. The packet will not be dropped, and the system will generate an IPv6 address. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. ----- End forwarded message ----- From davem@pizda.ninka.net Tue Nov 4 14:34:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 14:35:26 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4MYo25017670 for ; Tue, 4 Nov 2003 14:34:52 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA20176; Tue, 4 Nov 2003 14:29:49 -0800 Date: Tue, 4 Nov 2003 14:29:49 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [Bug 1490] New: _decode_session[46] does not set type or code for ICMP or ICMPv6] Message-Id: <20031104142949.0a57d416.davem@redhat.com> In-Reply-To: <20031104223118.GB23401@conectiva.com.br> References: <20031104223118.GB23401@conectiva.com.br> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1208 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003 20:31:19 -0200 Arnaldo Carvalho de Melo wrote: > FYI This should be posted to netdev so that people like Herbert Xu, Alexey, James Morris, and others can look at it. From acme@conectiva.com.br Tue Nov 4 14:35:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 14:35:36 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4MZ225017679 for ; Tue, 4 Nov 2003 14:35:03 -0800 Received: from [200.181.169.115] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AH9mv-0001vL-00 for netdev@oss.sgi.com; Tue, 04 Nov 2003 20:36:38 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id D1BEFE72F; Tue, 4 Nov 2003 22:34:54 +0000 (UTC) Date: Tue, 4 Nov 2003 20:34:54 -0200 From: Arnaldo Carvalho de Melo To: netdev@oss.sgi.com Subject: [Bug 1491] New: No SADB_EXPIRE message sent when soft byte lifetime is reached] Message-ID: <20031104223453.GC23401@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1209 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev One more... ----- Forwarded message from bugme-daemon@osdl.org ----- Date: Tue, 4 Nov 2003 09:26:37 -0800 From: bugme-daemon@osdl.org Subject: [Bug 1491] New: No SADB_EXPIRE message sent when soft byte lifetime is reached To: acme@conectiva.com.br http://bugme.osdl.org/show_bug.cgi?id=1491 Summary: No SADB_EXPIRE message sent when soft byte lifetime is reached Kernel Version: 2.6.0-test4 Status: NEW Severity: normal Owner: acme@conectiva.com.br Submitter: bbuesker@qualcomm.com Distribution: Redhat 9 Hardware Environment: x86 Software Environment: ipsec-tools-0.2.2 Problem Description: If byte lifetimes are used for IPsec security associations, the kernel does not send an SADB_EXPIRE message to the key management daemon (racoon) when the soft lifetime in terms of bytes is exceeded. Racoon only receives an SADB_EXPIRE message when the hard lifetime is exceeded. Steps to reproduce: Reenable byte lifetimes in racoon. Set up a security policy requiring IPsec, and with racoon running on two different machines, trigger the IKE negotiation by sending a packet. Once the SA is established, continue sending packets until the soft byte lifetime is exceeded. At this point, racoon should receive an SADB_EXPIRE message indicating the soft lifetime has been exceeded. This message is never sent by the kernel. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. ----- End forwarded message ----- From torvalds@osdl.org Tue Nov 4 14:44:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 14:44:56 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4MiM25018403 for ; Tue, 4 Nov 2003 14:44:22 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA4MiEC24127 for ; Tue, 4 Nov 2003 14:44:14 -0800 X-Received: from localhost (localhost.localdomain [127.0.0.1]) by home.osdl.org (8.12.10/8.12.10) with ESMTP id hA4MFdNW001952 for ; Tue, 4 Nov 2003 14:15:40 -0800 X-Received: from localhost.localdomain [127.0.0.1] by localhost with IMAP (fetchmail-6.2.0) for torvalds@localhost (single-drop); Tue, 04 Nov 2003 14:15:40 -0800 (PST) X-Received: from fire-1.osdl.org (air1.pdx.osdl.net [172.20.0.5]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA4MErC18450 for ; Tue, 4 Nov 2003 14:14:53 -0800 X-Received: from vger.kernel.org (vger.kernel.org [67.72.78.212]) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id hA4MELAi024092 for ; Tue, 4 Nov 2003 14:14:52 -0800 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261267AbTKDWM4 (ORCPT ); Tue, 4 Nov 2003 17:12:56 -0500 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261332AbTKDWM4 (ORCPT ); Tue, 4 Nov 2003 17:12:56 -0500 X-Received: from user-12hcje4.cable.mindspring.com ([69.22.77.196]:35464 "EHLO bender.davehollis.com") by vger.kernel.org with ESMTP id S261267AbTKDWMs (ORCPT ); Tue, 4 Nov 2003 17:12:48 -0500 X-Received: from davehollis.com (washdc3-ar10-4-63-121-042.washdc3.dsl-verizon.net [4.63.121.42]) (authenticated bits=0) by bender.davehollis.com (8.12.8/8.12.8) with ESMTP id hA4MCiOV024001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 4 Nov 2003 17:12:45 -0500 Message-ID: <3FA8245B.8030302@davehollis.com> Date: Tue, 04 Nov 2003 17:12:43 -0500 From: David T Hollis User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031027 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kernel Mailing List Subject: Oops in __xfrm4_state_lookup when setting up an IPSEC tunnel X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.36 X-Scanned-By: MIMEDefang 2.37 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org ReSent-Date: Tue, 4 Nov 2003 14:44:07 -0800 (PST) ReSent-From: Linus Torvalds ReSent-To: netdev@oss.sgi.com ReSent-Subject: Oops in __xfrm4_state_lookup when setting up an IPSEC tunnel ReSent-Message-ID: X-archive-position: 1210 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev I am trying to setup an IPV4 IPSEC tunnel between two systems with the following topology: 192.168.1.0/24 | gw1 (2.6.0-test9-bk7) | 66.22.66.22 | Internet | 44.33.44.33 | gw2 (2.6.0-test9-bk9) | 172.16.100.100/24 Both firewalls are RedHat 9 based installs, running stock 2.6.0-test9 kernels (note the variance on bk7 and bk9). Both are running Shorewall 1.4.7c to setup iptables/netfilter firewalling. If I configure the SAD and SPDs on gw2, than setup them up on gw1, gw2 Oops hard on __xfrm4_state_lookup. I have not yet hand copied the entire dump but have the initial pertinent info: EIP is at __xfrm4_state_lookup+0x6f/0xa0 Call Stack is: xfrm_state_lookup xfrm_rcv_encap match [ ipt_conntrack ] match [ ipt_state ] ipt_do_table [ ip_tables ] ip_local_deliver ipt_hook [ iptable_filter] xfrm4_rcv ip_local_deliver_finish ip_local_deliver_finish nf_hook_slow ip_load_deliver_finish ip_local_deliver ip_local_deliver_finish ip_rcv_finish ip_rcv_finish nf_hook_slow Between reproductions of the crash (which are easy to repeat - that's good.... I guess..) the constant is that it's dying in the xfrm_state_lookup area. gw1 (the bk7 system) has not crashed in any way. tcpdump output on gw2 watching traffic to/from gw1 right at a crash: 17:02:42.147923 66.22.66.22 > 44.33.44.33: ESP(spi=0x00000201,seq=0x1) (DF) 17:02:42.147923 truncated-ip - 16 bytes missing! 66.22.66.22 > 69.0.0.84: truncated-ip - 16268 bytes missing! 44.33.44.33 > 69.0.0.84: xns-idp (frag 13060:16352@30720) (ipip-proto-4) 17:02:43.147660 66.22.66.22 > 44.33.44.33: ESP(spi=0x00000201,seq=0x2) (DF) 17:02:43.147660 truncated-ip - 16 bytes missing! 66.22.66.22 > 69.0.0.84: bad-hlen 0 (ipip-proto-4) 17:02:44.146738 66.22.66.22 > 44.33.44.33: ESP(spi=0x00000201,seq=0x3) (DF) 17:02:44.146738 truncated-ip - 16 bytes missing! 66.22.66.22 > 69.0.0.84: bad-hlen 8 (ipip-proto-4) /sbin/lsmod: Module Size Used by xfrm_user 15300 - md5 3936 - aes 32544 - des 11616 - ah4 7776 - esp4 10496 - af_key 32848 - autofs 15456 - serial_cs 8136 - 8250 20960 - serial_core 22240 - 3c574_cs 13804 - parport_pc 27240 - parport 43016 - ipt_ULOG 6440 - ipt_ttl 1824 - ipt_TOS 2432 - ipt_tos 1504 - ipt_TCPMSS 4224 - ipt_tcpmss 2176 - ipt_state 1824 - ipt_REJECT 6816 - ipt_REDIRECT 2080 - ipt_recent 10668 - ipt_pkttype 1504 - ipt_physdev 2064 - ipt_owner 3104 - ipt_multiport 1920 - ipt_MASQUERADE 3584 - ipt_MARK 1984 - ipt_mark 1568 - ipt_mac 1856 - ipt_LOG 5472 - ipt_limit 2272 - ipt_length 1600 - ipt_helper 2048 - ipt_esp 1856 - ipt_ECN 3200 - ipt_ecn 2112 - ipt_DSCP 2464 - ipt_dscp 1568 - ipt_conntrack 2432 - ipt_ah 1856 - ip_queue 10584 - ip_nat_tftp 3344 - ip_nat_snmp_basic 11588 - ip_nat_irc 4112 - ip_nat_ftp 4752 - ip_nat_amanda 2940 - ip_conntrack_tftp 3508 - ip_conntrack_irc 71220 - ip_conntrack_ftp 72084 - ip_conntrack_amanda 69796 - arpt_mangle 2336 - arptable_filter 1984 - arp_tables 12512 - iptable_nat 21964 - ip_conntrack 31536 - iptable_mangle 2720 - iptable_filter 2688 - ip_tables 16128 - hid 24992 - uhci_hcd 31184 - usbcore 107772 - My manual tunnel config: #!/sbin/setkey -f # Flush the SAD and SPD flush; spdflush; # ESP SAs doing encryption using 192 bit long keys (168 + 24 parity) # and authentication using 128 bit long keys add 66.22.66.22 44.33.44.33 esp 0x201 -m tunnel -E 3des-cbc 0x12d49767b12e4565d5fb95bf1d5248db93c60a90d7602a44 -A hmac-md5 0x2013c28f56dea12fae2835b3654d60a2; add 44.33.44.33 66.22.66.22 esp 0x301 -m tunnel -E 3des-cbc 0x40127f0a79fda7311b3c5344f5d5bd9a0fcd8bd926caae5f -A hmac-md5 0xd1b9a27cb7ab9562a0c8ad21f82be8b8; # Security policies spdadd 192.168.1.0/24 172.16.100.0/24 any -P out ipsec esp/tunnel/66.22.66.22-44.33.44.33/require; spdadd 172.16.100.0/24 192.168.1.0/24 any -P in ipsec esp/tunnel/44.33.44.33-66.22.66.22/require; /sbin/setkey -D: 44.33.44.33 66.22.66.22 esp mode=tunnel spi=769(0x00000301) reqid=0(0x00000000) E: 3des-cbc 40127f0a 79fda731 1b3c5344 f5d5bd9a 0fcd8bd9 26caae5f A: hmac-md5 d1b9a27c b7ab9562 a0c8ad21 f82be8b8 seq=0x00000000 replay=0 flags=0x00000000 state=mature created: Nov 4 16:43:39 2003 current: Nov 4 16:44:35 2003 diff: 56(s) hard: 0(s) soft: 0(s) last: hard: 0(s) soft: 0(s) current: 0(bytes) hard: 0(bytes) soft: 0(bytes) allocated: 0 hard: 0 soft: 0 sadb_seq=1 pid=3930 refcnt=0 66.22.66.22 44.33.44.33 esp mode=tunnel spi=513(0x00000201) reqid=0(0x00000000) E: 3des-cbc 12d49767 b12e4565 d5fb95bf 1d5248db 93c60a90 d7602a44 A: hmac-md5 2013c28f 56dea12f ae2835b3 654d60a2 seq=0x00000000 replay=0 flags=0x00000000 state=mature created: Nov 4 16:43:39 2003 current: Nov 4 16:44:35 2003 diff: 56(s) hard: 0(s) soft: 0(s) last: hard: 0(s) soft: 0(s) current: 0(bytes) hard: 0(bytes) soft: 0(bytes) allocated: 0 hard: 0 soft: 0 sadb_seq=0 pid=3930 refcnt=0 /sbin/setkey -D -P: 172.16.100.0/24[any] 192.168.1.0/24[any] any in ipsec esp/tunnel/44.33.44.33-66.22.66.22/require created: Nov 4 16:43:39 2003 lastused: lifetime: 0(s) validtime: 0(s) spid=8 seq=1 pid=3931 refcnt=1 192.168.1.0/24[any] 172.16.100.0/24[any] any out ipsec esp/tunnel/66.22.66.22-44.33.44.33/require created: Nov 4 16:43:39 2003 lastused: lifetime: 0(s) validtime: 0(s) spid=1 seq=0 pid=3931 refcnt=1 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From jt@bougret.hpl.hp.com Tue Nov 4 15:15:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 15:16:01 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4NF625019194 for ; Tue, 4 Nov 2003 15:15:16 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id 861E31C01CEA; Tue, 4 Nov 2003 14:42:02 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810+JAGae91741+JAGae92668)/8.9.3 HPLabs Timeshare Server) with ESMTP id OAA24525; Tue, 4 Nov 2003 14:42:01 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AH9s9-0003wD-00; Tue, 04 Nov 2003 14:42:01 -0800 Date: Tue, 4 Nov 2003 14:42:01 -0800 To: Arnaldo Carvalho de Melo Cc: Linux Networking Development Mailing List Subject: Re: [PATCH] fix skb leak in af_irda.c Message-ID: <20031104224201.GA15041@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031101051931.GI3705@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031101051931.GI3705@conectiva.com.br> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 1211 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Sat, Nov 01, 2003 at 03:19:31AM -0200, Arnaldo Carvalho de Melo wrote: > Hi David, Jean, > > Please apply. > > - Arnaldo Hum... It looks as if it didn't made into the kernel. Ok, I'll add that in my patch queue and push that for you ;-) Have fun... Jean From davem@pizda.ninka.net Tue Nov 4 15:37:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 15:38:14 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA4Nbe25019681 for ; Tue, 4 Nov 2003 15:37:40 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA20357; Tue, 4 Nov 2003 15:30:42 -0800 Date: Tue, 4 Nov 2003 15:30:42 -0800 From: "David S. Miller" To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, acme@conectiva.com.br, netdev@oss.sgi.com Subject: Re: [PATCH] fix skb leak in af_irda.c Message-Id: <20031104153042.416b9c36.davem@redhat.com> In-Reply-To: <20031104224201.GA15041@bougret.hpl.hp.com> References: <20031101051931.GI3705@conectiva.com.br> <20031104224201.GA15041@bougret.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1212 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003 14:42:01 -0800 Jean Tourrilhes wrote: > On Sat, Nov 01, 2003 at 03:19:31AM -0200, Arnaldo Carvalho de Melo wrote: > > Hi David, Jean, > > > > Please apply. > > Hum... It looks as if it didn't made into the kernel. Ok, I'll > add that in my patch queue and push that for you ;-) It isn't in because I was waiting for an acknowledgment from you Jean :-) From jt@bougret.hpl.hp.com Tue Nov 4 16:29:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 16:30:05 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA50TV25023205 for ; Tue, 4 Nov 2003 16:29:31 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 2BCF61C016C4; Tue, 4 Nov 2003 16:29:31 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810+JAGae91741+JAGae92668)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA28951; Tue, 4 Nov 2003 16:29:30 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AHBYA-0004B6-00; Tue, 04 Nov 2003 16:29:30 -0800 Date: Tue, 4 Nov 2003 16:29:30 -0800 To: "David S. Miller" Cc: acme@conectiva.com.br, netdev@oss.sgi.com Subject: Re: [PATCH] fix skb leak in af_irda.c Message-ID: <20031105002930.GA16055@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031101051931.GI3705@conectiva.com.br> <20031104224201.GA15041@bougret.hpl.hp.com> <20031104153042.416b9c36.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031104153042.416b9c36.davem@redhat.com> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 1213 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Tue, Nov 04, 2003 at 03:30:42PM -0800, David S. Miller wrote: > On Tue, 4 Nov 2003 14:42:01 -0800 > Jean Tourrilhes wrote: > > > On Sat, Nov 01, 2003 at 03:19:31AM -0200, Arnaldo Carvalho de Melo wrote: > > > Hi David, Jean, > > > > > > Please apply. > > > > Hum... It looks as if it didn't made into the kernel. Ok, I'll > > add that in my patch queue and push that for you ;-) > > It isn't in because I was waiting for an acknowledgment > from you Jean :-) *Ahem*... Sorry about that... I personally would prefer the following patch. The difference is mostly cosmetic. Tested with 2.6.0-test9. Anyway, both patches are obviously correct. Thanks for keeping on top of those things... Jean --------------------------------------------------------- diff -u -p linux/net/irda/af_irda.d4.c linux/net/irda/af_irda.c --- linux/net/irda/af_irda.d4.c Tue Nov 4 14:37:25 2003 +++ linux/net/irda/af_irda.c Tue Nov 4 14:39:10 2003 @@ -188,8 +188,10 @@ static void irda_connect_confirm(void *i IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); sk = self->sk; - if (sk == NULL) + if (sk == NULL) { + dev_kfree_skb(skb); return; + } dev_kfree_skb(skb); // Should be ??? skb_queue_tail(&sk->sk_receive_queue, skb); @@ -248,8 +250,10 @@ static void irda_connect_indication(void IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); sk = self->sk; - if (sk == NULL) + if (sk == NULL) { + dev_kfree_skb(skb); return; + } /* How much header space do we need to reserve */ self->max_header_size = max_header_size; From davem@pizda.ninka.net Tue Nov 4 16:35:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 16:35:40 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA50Z625023566 for ; Tue, 4 Nov 2003 16:35:06 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA20552; Tue, 4 Nov 2003 16:28:05 -0800 Date: Tue, 4 Nov 2003 16:28:05 -0800 From: "David S. Miller" To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, acme@conectiva.com.br, netdev@oss.sgi.com Subject: Re: [PATCH] fix skb leak in af_irda.c Message-Id: <20031104162805.78d6ab4c.davem@redhat.com> In-Reply-To: <20031105002930.GA16055@bougret.hpl.hp.com> References: <20031101051931.GI3705@conectiva.com.br> <20031104224201.GA15041@bougret.hpl.hp.com> <20031104153042.416b9c36.davem@redhat.com> <20031105002930.GA16055@bougret.hpl.hp.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1214 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003 16:29:30 -0800 Jean Tourrilhes wrote: > I personally would prefer the following patch. The difference > is mostly cosmetic. Tested with 2.6.0-test9. Anyway, both patches are > obviously correct. Applied, with attribution also given to Arnaldo. Thanks. From hadi@cyberus.ca Tue Nov 4 19:01:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 19:01:48 -0800 (PST) Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA531B25031739 for ; Tue, 4 Nov 2003 19:01:12 -0800 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AHDuv-0002V8-Od; Tue, 04 Nov 2003 22:01:10 -0500 Subject: Re: Announce: NetKeeper Firewall For Linux From: jamal Reply-To: hadi@cyberus.ca To: Emmanuel Fleury Cc: "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, Mikkel Christiansen In-Reply-To: <1067335655.10628.7.camel@rade7.s.cs.auc.dk> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> Content-Type: text/plain Organization: jamalopolis Message-Id: <1068001237.1064.31.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2003 22:00:37 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1215 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Hi, On Tue, 2003-10-28 at 05:07, Emmanuel Fleury wrote: > Hi, > > On Tue, 2003-10-28 at 10:42, David S. Miller wrote: > > On Mon, 27 Oct 2003 21:13:32 +0100 > > Emmanuel Fleury wrote: > > > > > For more details check out the netkeeper web-site: > > > http://www.cs.auc.dk/~fleury/netkeeper/ > > > > You may want to have a look at: > > > > http://www.cyberus.ca/~hadi/patches/action/README > > > > which I believe is the way to implement these kinds > > of things. > > Actually, that is exactly the direction which we have been aiming at. You seem to be attempting to replicate that functionalilty actually;-> (as opposed to using it). Therefore you are going to miss a lot of good things. What was posted already is just the beggining. If you want to incorporate i can send you the latest patches (posted patches have intentional bugs to see who is actually testing). You seem to be already hooking into netfilter btw so not sure how easy it would be for you; Why do you have a limit to 8 actions? BTW, since you compile your filters, how fast are you at adding rules? What about dynamic in kernel rules (such as those that may be created by contracking) - do you have to cross to user space to compile them? - Is there any reason you move the commit decision to the kernel? Could this not have been done in user space? I have doubts how fast you can install rules - which is a fundamental measure of good filters. cheers, jamal From jmorris@redhat.com Tue Nov 4 20:11:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Nov 2003 20:12:17 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA54BY25032610 for ; Tue, 4 Nov 2003 20:11:36 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hA54BUM28041; Tue, 4 Nov 2003 23:11:31 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hA54BU605569; Tue, 4 Nov 2003 23:11:30 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id hA54BT4s021573; Tue, 4 Nov 2003 23:11:29 -0500 Date: Tue, 4 Nov 2003 23:12:30 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: David T Hollis cc: Kernel Mailing List , Subject: Re: Oops in __xfrm4_state_lookup when setting up an IPSEC tunnel In-Reply-To: <3FA8245B.8030302@davehollis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1216 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Tue, 4 Nov 2003, David T Hollis wrote: > Both firewalls are RedHat 9 based installs, running stock 2.6.0-test9 > kernels (note the variance on bk7 and bk9). Both are running Shorewall > 1.4.7c to setup iptables/netfilter firewalling. Nothing obvious has changed between these snapshots which would cause this. Are the filtering rules the same at each gateway? Are you able to reproduce the problem without any filtering rules? > > If I configure the SAD and SPDs on gw2, than setup them up on gw1, gw2 > Oops hard on __xfrm4_state_lookup. I have not yet hand copied the > entire dump but have the initial pertinent > info: > > EIP is at __xfrm4_state_lookup+0x6f/0xa0 If you compile your kernel with -g, you should be able to find the corresponding line of code (e.g. with addr2line). - James -- James Morris From vnuorval@tcs.hut.fi Wed Nov 5 03:38:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 03:38:50 -0800 (PST) Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Bc625015018 for ; Wed, 5 Nov 2003 03:38:06 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 89CFD8001C2; Wed, 5 Nov 2003 13:02:03 +0200 (EET) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5B23Gn027984; Wed, 5 Nov 2003 13:02:03 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5B226R027980; Wed, 5 Nov 2003 13:02:02 +0200 Date: Wed, 5 Nov 2003 13:02:02 +0200 (EET) From: Ville Nuorvala To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] IPv6: Also fix tunnel skb->h.raw bug in ip6_tunnel.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1217 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev Hi Dave, I noticed the skb->h.raw bug was fixed for ipip.c, ip_gre.c and sit.c, but not for ip6_tunnel.c. Here is a patch for it as well. Please apply! Thanks, Ville ===== net/ipv6/ip6_tunnel.c 1.12 vs edited ===== --- 1.12/net/ipv6/ip6_tunnel.c Sun Oct 19 10:12:04 2003 +++ edited/net/ipv6/ip6_tunnel.c Wed Nov 5 09:48:13 2003 @@ -681,7 +681,6 @@ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, dev); goto tx_err_dst_release; } - skb->h.raw = skb->nh.raw; /* * Okay, now see if we can stuff it in the buffer as-is. @@ -702,6 +701,8 @@ } dst_release(skb->dst); skb->dst = dst_clone(dst); + + skb->h.raw = skb->nh.raw; if (opt) ipv6_push_nfrag_opts(skb, opt, &proto, NULL); -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From vnuorval@tcs.hut.fi Wed Nov 5 04:11:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 04:12:21 -0800 (PST) Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5CBQ25017147 for ; Wed, 5 Nov 2003 04:11:30 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id AC6AB800217; Wed, 5 Nov 2003 13:35:33 +0200 (EET) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5BZXGn028096; Wed, 5 Nov 2003 13:35:33 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5BZXvh028092; Wed, 5 Nov 2003 13:35:33 +0200 Date: Wed, 5 Nov 2003 13:35:33 +0200 (EET) From: Ville Nuorvala To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] IPv6: Flowinfo fix in ip6_tunnel.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1218 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev Hi Dave, would you also apply this minor patch? This makes the handling of flowlabels consistent with the way flowlabels are passed from userspace using sockopts. Thanks, Ville ===== net/ipv6/ip6_tunnel.c 1.13 vs edited ===== --- 1.13/net/ipv6/ip6_tunnel.c Wed Nov 5 09:52:58 2003 +++ edited/net/ipv6/ip6_tunnel.c Wed Nov 5 10:01:12 2003 @@ -810,9 +810,9 @@ fl->fl6_flowlabel = 0; if (!(p->flags&IP6_TNL_F_USE_ORIG_TCLASS)) - fl->fl6_flowlabel |= IPV6_TCLASS_MASK & htonl(p->flowinfo); + fl->fl6_flowlabel |= IPV6_TCLASS_MASK & p->flowinfo; if (!(p->flags&IP6_TNL_F_USE_ORIG_FLOWLABEL)) - fl->fl6_flowlabel |= IPV6_FLOWLABEL_MASK & htonl(p->flowinfo); + fl->fl6_flowlabel |= IPV6_FLOWLABEL_MASK & p->flowinfo; ip6_tnl_set_cap(t); -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From vnuorval@tcs.hut.fi Wed Nov 5 05:07:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 05:08:10 -0800 (PST) Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5D7Z25021413 for ; Wed, 5 Nov 2003 05:07:36 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 8CC50800211; Wed, 5 Nov 2003 15:07:34 +0200 (EET) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5D7YGn028364; Wed, 5 Nov 2003 15:07:34 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5D7XmG028360; Wed, 5 Nov 2003 15:07:34 +0200 Date: Wed, 5 Nov 2003 15:07:32 +0200 (EET) From: Ville Nuorvala To: yoshfuji@linux-ipv6.org Cc: davem@redhat.com, netdev@oss.sgi.com Subject: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1219 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev Hello Yoshifuji-san, this (rewritten) patch configures link-local addresses to the ip6-ip6 tunnel devices so you can run link-local protocols over them. If you are ok with the patch, perhaps we could push it forward to Dave. Thanks, Ville ===== net/ipv6/addrconf.c 1.74 vs edited ===== --- 1.74/net/ipv6/addrconf.c Tue Oct 28 13:10:47 2003 +++ edited/net/ipv6/addrconf.c Wed Nov 5 14:50:29 2003 @@ -1818,6 +1818,58 @@ sit_route_add(dev); } +#if defined(CONFIG_IPV6_TUNNEL) || defined(CONFIG_IPV6_TUNNEL_MODULE) + +static inline int +ip6_tnl_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev) +{ + struct in6_addr lladdr; + + if (!ipv6_get_lladdr(link_dev, &lladdr)) { + addrconf_add_linklocal(idev, &lladdr); + return 0; + } + return -1; +} + +static void ip6_tnl_add_linklocal(struct inet6_dev *idev) +{ + struct net_device *link_dev; + + /* first try to inherit the link-local address from the link device */ + if (idev->dev->iflink && + (link_dev = __dev_get_by_index(idev->dev->iflink))) { + if (!ip6_tnl_inherit_linklocal(idev, link_dev)) + return; + } + /* then try to inherit it from any device */ + for (link_dev = dev_base; link_dev; link_dev = link_dev->next) { + if (!ip6_tnl_inherit_linklocal(idev, link_dev)) + return; + } + printk(KERN_DEBUG "init ip6-ip6: add_linklocal failed\n"); +} + +/* + * Autoconfigure tunnel with a link-local address so routing protocols, + * DHCPv6, MLD etc. can be run over the virtual link + */ + +static void addrconf_ip6_tnl_config(struct net_device *dev) +{ + struct inet6_dev *idev; + + ASSERT_RTNL(); + + if ((idev = addrconf_add_dev(dev)) == NULL) { + printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); + return; + } + ip6_tnl_add_linklocal(idev); + addrconf_add_mroute(dev); +} +#endif + int addrconf_notify(struct notifier_block *this, unsigned long event, void * data) @@ -1831,7 +1883,11 @@ case ARPHRD_SIT: addrconf_sit_config(dev); break; - +#if defined(CONFIG_IPV6_TUNNEL) || defined(CONFIG_IPV6_TUNNEL_MODULE) + case ARPHRD_TUNNEL6: + addrconf_ip6_tnl_config(dev); + break; +#endif case ARPHRD_LOOPBACK: init_loopback(dev); break; ===== net/ipv6/ip6_tunnel.c 1.14 vs edited ===== --- 1.14/net/ipv6/ip6_tunnel.c Wed Nov 5 10:11:00 2003 +++ edited/net/ipv6/ip6_tunnel.c Wed Nov 5 14:58:27 2003 @@ -821,6 +821,8 @@ else dev->flags &= ~IFF_POINTOPOINT; + dev->iflink = p->link; + if (p->flags & IP6_TNL_F_CAP_XMIT) { struct rt6_info *rt = rt6_lookup(&p->raddr, &p->laddr, p->link, 0); @@ -829,8 +831,6 @@ return; if (rt->rt6i_dev) { - dev->iflink = rt->rt6i_dev->ifindex; - dev->hard_header_len = rt->rt6i_dev->hard_header_len + sizeof (struct ipv6hdr); @@ -1040,7 +1040,6 @@ dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); dev->flags |= IFF_NOARP; - dev->iflink = 0; dev->addr_len = sizeof(struct in6_addr); } -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From hadi@znyx.com Wed Nov 5 06:54:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 06:54:59 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5EsP25022911 for ; Wed, 5 Nov 2003 06:54:25 -0800 Received: from [10.0.0.9] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2003110506531276:3436 ; Wed, 5 Nov 2003 06:53:12 -0800 Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Chris Friesen Cc: Alexey , "David S. Miller" , jmorris@redhat.com, netdev@oss.sgi.com In-Reply-To: <3FA7DBB5.1090500@nortelnetworks.com> References: <200311041233.PAA15518@yakov.inr.ac.ru> <3FA7DBB5.1090500@nortelnetworks.com> Organization: Znyx Networks Message-Id: <1068044059.1022.0.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Nov 2003 09:54:22 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/05/2003 06:53:13 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/05/2003 06:53:14 AM, Serialize complete at 11/05/2003 06:53:14 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain X-archive-position: 1220 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev On Tue, 2003-11-04 at 12:02, Chris Friesen wrote: > > I do not even think that IP_DSCP makes sense in diffserv environment. > > Packets are marked according to DS rules, not according to desire > > of particular user. > > If root wants to send out a packet with particular DSCP settings, > doesn't it make sense to make that option available? It's a field in > the IP packet header, we should be able to set it with an IP option. > Just to give you some history: This topic has been discussed to death in the past. Look at the diffserv mailing lists. Common practise is that the network manager controls the DSCP. They _never_ trust the user. Of course this gives a lot of power to network managers and router vendors such as nortel. But these guys own the network. Qos is a way for them to make more money from different services. The only OS vendor that made noise on this was MS. And they lost too. I think thye now have a diffserv API which is not different from what we have on tc. BTW, i would worry about the vlan 802.1p QoS settings. While they may appear to give you QoS within the box, once those bits start crossing the network with switches that do 802.1q/p you may find that the result is the opposite. cheers, jamal From fleury@cs.auc.dk Wed Nov 5 07:30:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 07:31:22 -0800 (PST) Received: from mailhost.cs.auc.dk (root@mailhost.cs.auc.dk [130.225.194.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5FUO25023725 for ; Wed, 5 Nov 2003 07:30:45 -0800 Received: from rade7.s.cs.auc.dk (fleury@rade7.s.cs.auc.dk [192.168.194.153]) by mailhost.cs.auc.dk (8.12.10/8.12.10) with ESMTP id hA5FTKlN023255; Wed, 5 Nov 2003 16:29:20 +0100 (MET) Subject: Re: Announce: NetKeeper Firewall For Linux From: Emmanuel Fleury To: hadi@cyberus.ca Cc: "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, Mikkel Christiansen In-Reply-To: <1068001237.1064.31.camel@jzny.localdomain> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> <1068001237.1064.31.camel@jzny.localdomain> Content-Type: text/plain; charset=iso-8859-15 Organization: Aalborg University -- Computer Science Dept. Message-Id: <1068046114.31636.92.camel@rade7.s.cs.auc.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 05 Nov 2003 16:28:34 +0100 X-Scanned-By: MIMEDefang 2.14 X-MIME-Autoconverted: from 8bit to quoted-printable by mailhost.cs.auc.dk id hA5FTKlN023255 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hA5FUO25023725 X-archive-position: 1221 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fleury@cs.auc.dk Precedence: bulk X-list: netdev Hi, On Wed, 2003-11-05 at 04:00, jamal wrote: > > You seem to be attempting to replicate that functionality actually;-> > (as opposed to using it). Therefore you are going to miss a lot of > good things. What was posted already is just the beggining. I'm not sure it is the case (but I might have missed the point). My first answer to David S. Miller was probably misleading. What we are trying to do is to investigate an alternate algorithm to do packet classification. Our overall goal is not to produce a shiny tool that goes into Linux, but a new scheme which is more scalable than the one that everybody is using right now (i.e. the "world famous" classification based on rulesets). If our scheme can be useful and is, at some point, included in one existing tool, I would be the first one to take the netkeeper code and put it to the trash (as it serve only to demonstrate and tune our scheme). So do not consider us as "yet another concurrent project to fight with", because we are not really aiming at the same thing. :) > If you want to incorporate i can send you the latest patches (posted > patches have intentional bugs to see who is actually testing). You > seem to be already hooking into netfilter btw so not sure how easy it > would be for you; Anyway, reading some new code can give us nice ideas. We would be pleased to see what you've already achieved. > Why do you have a limit to 8 actions? This limit is totally artificial. Basically, the story is that we had a union in a struct and we filled up the memory space with these actions so that no memory was left behind. We decided (on arbitrary basis) that nobody would attach more than 8 different actions to a precise packet. We also though that having 256 different actions would be enough. In fact, these two limits (8 and 256) are totally artificial and have been introduced in our prototype just because it was "convenient". We can extend the list of actions by using a chained list and code the actions on a bigger variable than a byte. > BTW, since you compile your filters, how fast are you at adding rules? So, here, you are hitting the sensitive spot ! In fact, we are totally ignorant of what are the requirements on these dynamic updates in networking. So any discussion about this is extremely valuable for us. For your question, the theory (and the practice) is telling us that the time to add a new rule to an existing ruleset depend essentially of the complexity of the already existing ruleset. Don't miss my point, the number of rules which compose the ruleset is not the only parameter. Because, as your are going through an optimization a ruleset with a lot of trivial rules is simplified and will be trivial at the end. Therefore, it essentially depend on the ruleset to which you are adding your new rule. But, we still have to work on this part. The way we have coded the compiler is very simple and we have already some ideas on how to optimize it. Actually, a good thing for us would be to know what are your expectation in matter of adding a new rule. What is "acceptable" and what is "not". And, now, some tables with numbers: +--------+---------+-------+-------+----------+ | #rules | time(s) | nodes | edges | size(KB) | +--------+---------+-------+-------+----------+ | 10 | 0.01 | 28 | 102 | 1.584 | | 25 | 0.03 | 77 | 279 | 4.296 | | 50 | 0.11 | 128 | 481 | 7.332 | | 100 | 0.44 | 232 | 891 | 13.500 | | 250 | 3.44 | 542 | 2109 | 31.836 | | 500 | 19.14 | 998 | 3952 | 59.424 | | 1,000 | 37.72 | 1884 | 7544 | 113.160 | | 2,500 | 102.1 | 4289 | 17493 | 261.408 | | 5,000 | 237.0 | 7678 | 31880 | 474.720 | | 10,000 | 571.4 | 13420 | 57417 | 850.068 | | 25,000 | 1832.0 | 24657 |116673 | 1695.984 | | 50,000 | 5221.0 | 37416 |198754 | 2834.064 | +--------+---------+-------+-------+----------+ The rulesets considered here are totally artificially generated and are matching our worst case in term of computing time. Of course your question was about taking one of this big filters and then add one tiny winny rule to it. So, I guess the time to do so would be at most 1s (in the very worst case, I would say). > What about dynamic in kernel rules (such as those that may be created > by contracking) - do you have to cross to user space to compile them? We have some ideas on how to handle it. But for now, the scheme is totally static. I would say that we are keeping this area of research (stateful inspection) for later. :) > - Is there any reason you move the commit decision to the kernel? > Could this not have been done in user space? Yes, definitely. When coding in the kernel, we are coding with the idea that: « The kernel should defend itself against user-space. » So, when the user say: "Commit". The kernel will first check the decision diagram for safety (no NULL pointers, out of range variables, no loops, etc) and depending of the tests, will take the decision to commit or not. Actually, I think I read some stuff about it on the Netfilter-devel mailing-list. As far as I remember, there was a similar problem in netfilter as the safety of the whole thing is never really tested in depth. Therefore you can end-up with some loops or inconsistancy (WARNING: I'm not sure about it!). > I have doubts how fast you can install rules - which is a fundamental > measure of good filters. The fact is that theory is saying that optimizing is a complex problem (but it still has a polynomial time complexity ). But, we can for sure improve A LOT our current tools. The problem for us is that we do not know against what we are fighting ! We really need some hints on how fast should be this operation (just to see if it is possible or not in our scheme). PS: I would like also to say here that we got a really great feed back from the nf-hipac team. So, thank a lot to Michael Bellion and Thomas Heinz. Regards -- Emmanuel Netkeeper (An IDD firewall) http://www.cs.auc.dk/~fleury/netkeeper/ From s0348365@sms.ed.ac.uk Wed Nov 5 08:59:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 08:59:42 -0800 (PST) Received: from grassmarket.ucs.ed.ac.uk (grassmarket.ucs.ed.ac.uk [129.215.166.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Gx625028556 for ; Wed, 5 Nov 2003 08:59:07 -0800 Received: from 10.22.0.132 ([10.22.0.132]) by grassmarket.ucs.ed.ac.uk (8.12.10/8.12.9) with ESMTP id hA5GwvM3004527; Wed, 5 Nov 2003 16:58:58 GMT From: Alistair John Strachan To: Andrew Morton Subject: Re: 2.6.0-test9-mm2 Date: Wed, 5 Nov 2003 17:02:00 +0000 User-Agent: KMail/1.5.93 References: <20031104225544.0773904f.akpm@osdl.org> In-Reply-To: <20031104225544.0773904f.akpm@osdl.org> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@oss.sgi.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200311051702.00372.s0348365@sms.ed.ac.uk> X-archive-position: 1222 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: s0348365@sms.ed.ac.uk Precedence: bulk X-list: netdev On Wednesday 05 November 2003 06:55, Andrew Morton wrote: > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test9/2 >.6.0-test9-mm2/ > > > - Various random fixes. Maybe about half of these are 2.6.0-worthy. > > - Some improvements to the anticipatory IO scheduler and more readahead > tweaks should help some of those database benchmarks. > > The anticipatory scheduler is still a bit behind the deadline scheduler > in these random seeky loads - it most likely always will be. > > - "A new driver for the ethernet interface of the NVIDIA nForce chipset, > licensed under GPL." > > Testing of this would be appreciated. Send any reports to linux-kernel > or netdev@oss.sgi.com and Manfred will scoop them up, thanks. > I tried the force driver on my nForce2 machine and although it mostly works (DHCP works, I can receive mail over the interface, etc..) it doesn't seem to handle really bulky loads. For example, I'm running an FTP server on the machine (proftpd), and although FTP navigation works just fine, transferring large files just causes the transfer to hang indefinitely. Removing the driver and using NVIDIA's proprietary driver allows me to transfer via FTP properly. -- Cheers, Alistair. personal: alistair()devzero!co!uk university: s0348365()sms!ed!ac!uk student: CS/AI Undergraduate contact: 7/10 Darroch Court, University of Edinburgh. From yoshfuji@linux-ipv6.org Wed Nov 5 09:28:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 09:29:12 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5HSc25029128 for ; Wed, 5 Nov 2003 09:28:39 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA5HSmlg009365; Thu, 6 Nov 2003 02:28:49 +0900 Date: Thu, 06 Nov 2003 02:28:48 +0900 (JST) Message-Id: <20031106.022848.02505922.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Fw: why is mode of /proc/sys/net/ipv6/icmp directory only 0500? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Nov__6_02:28:48_2003_499)--" Content-Transfer-Encoding: 7bit X-archive-position: 1223 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev ----Next_Part(Thu_Nov__6_02:28:48_2003_499)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit David, please apply this. I don't see any reason to keep it 0500. Thanks. ----Next_Part(Thu_Nov__6_02:28:48_2003_499)-- Content-Type: Message/Rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: Received: from cerberus.hongo.wide.ad.jp (root@cerberus.hongo.wide.ad.jp [203.178.139.93]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA5HHalg009324 for ; Thu, 6 Nov 2003 02:17:36 +0900 Received: from linux6.nezu.wide.ad.jp (linux6.nezu.wide.ad.jp [203.178.142.218]) by cerberus.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA5HHO4x014830 for ; Thu, 6 Nov 2003 02:17:24 +0900 Received: from ginger.lcs.mit.edu (ginger.lcs.mit.edu [18.26.0.82]) by linux6.nezu.wide.ad.jp (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA5HHMF1000551 for ; Thu, 6 Nov 2003 02:17:23 +0900 Received: from ginger.lcs.mit.edu (localhost [127.0.0.1]) by ginger.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id hA5HHHWB027535 for ; Wed, 5 Nov 2003 12:17:21 -0500 Message-Id: <200311051717.hA5HHHWB027535@ginger.lcs.mit.edu> From: Tim Shepard To: yoshfuji@linux-ipv6.org Subject: why is mode of /proc/sys/net/ipv6/icmp directory only 0500? Date: Wed, 05 Nov 2003 12:17:17 -0500 Sender: shep@ginger.lcs.mit.edu MIME-Version: 1.0 I did a google search to find why the mode of the /proc/sys/net/ipv6/icmp directory is only 0500 and found that it originates in a patch of yours: http://lwn.net/Articles/13656/ Why not have mode 0555, like this patch below? If not 0555, then IMHO there needs to be a comment that justifies 0500. -Tim Shepard --- net/ipv6/sysctl_net_ipv6.c.DIST 2003-10-25 14:42:54.000000000 -0400 +++ net/ipv6/sysctl_net_ipv6.c 2003-11-05 12:10:34.000000000 -0500 @@ -22,25 +22,25 @@ ctl_table ipv6_table[] = { { .ctl_name = NET_IPV6_ROUTE, .procname = "route", .maxlen = 0, .mode = 0555, .child = ipv6_route_table }, { .ctl_name = NET_IPV6_ICMP, .procname = "icmp", .maxlen = 0, - .mode = 0500, + .mode = 0555, .child = ipv6_icmp_table }, { .ctl_name = NET_IPV6_BINDV6ONLY, .procname = "bindv6only", .data = &sysctl_ipv6_bindv6only, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec }, { .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, ----Next_Part(Thu_Nov__6_02:28:48_2003_499)---- From modica@sgi.com Wed Nov 5 10:03:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 10:04:25 -0800 (PST) Received: from zok.sgi.com (zok.sgi.com [204.94.215.101]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5I3q25006290 for ; Wed, 5 Nov 2003 10:03:52 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hA5I3kq0022788 for ; Wed, 5 Nov 2003 10:03:47 -0800 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hA5I3kP513174002 for ; Wed, 5 Nov 2003 12:03:46 -0600 (CST) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hA5I3jRn352140039 for ; Wed, 5 Nov 2003 12:03:46 -0600 (CST) Message-ID: <3FA93B82.5070508@sgi.com> Date: Wed, 05 Nov 2003 12:03:46 -0600 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: High interrupt rate even when using NAPI Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1224 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Hi All, I just noticed some strange behavior with the tg3 driver. Even with NAPI enabled, during high loads of 1500 byte MTUS, I'm seeing a very high interrupt rate. To move 500kBytes/sec I'm seeing 22k interrupts/sec. It tracks very closely with the actualy throughput. That amounts to about 1 interrupt per 23 bytes. I figured with NAPI, we should do a lot better than that. Is there a tuneable or some driver stat that I can track to figure out what's happening here? I'd like to see that interrupt number be a lot lower. Steve -- Steve Modica MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From davem@pizda.ninka.net Wed Nov 5 10:13:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 10:13:35 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5ID225024324 for ; Wed, 5 Nov 2003 10:13:03 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA03636; Wed, 5 Nov 2003 10:07:51 -0800 Date: Wed, 5 Nov 2003 10:07:50 -0800 From: "David S. Miller" To: Steve Modica Cc: netdev@oss.sgi.com Subject: Re: High interrupt rate even when using NAPI Message-Id: <20031105100750.63974931.davem@redhat.com> In-Reply-To: <3FA93B82.5070508@sgi.com> References: <3FA93B82.5070508@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1225 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 05 Nov 2003 12:03:46 -0600 Steve Modica wrote: > I just noticed some strange behavior with the tg3 driver. The tg3 driver needs to poke the chip a hundred times per second in order to work around a hardware bug, eack poke causes an interrupt. This is needed regardless of whether the chip is processing packets or not. From romieu@fr.zoreil.com Wed Nov 5 10:39:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 10:39:51 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5IdD25025119 for ; Wed, 5 Nov 2003 10:39:14 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id hA5IY8Jo012800; Wed, 5 Nov 2003 19:34:08 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hA5IY0Km012799; Wed, 5 Nov 2003 19:34:00 +0100 Date: Wed, 5 Nov 2003 19:34:00 +0100 From: Francois Romieu To: "Alexandra N. Kossovsky" Cc: linux-kernel@vger.kernel.org, ShuChen , netdev@oss.sgi.com Subject: Re: r8169 with big-endian (patch) Message-ID: <20031105193400.A12375@electric-eye.fr.zoreil.com> References: <20031105104625.D26209@oktet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031105104625.D26209@oktet.ru>; from sasha@oktet.ru on Wed, Nov 05, 2003 at 10:46:26AM +0300 X-Organisation: Land of Sunshine Inc. X-archive-position: 1226 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Greetings, Alexandra N. Kossovsky : [...] > Here is the patch to make RTL-8169 PCI Gbit ethernet card to work with > big-endian host. The patch is against 2.4.22 kernel. Please Cc: such patches to netdev@oss.sgi.com as well as jgarzik@pobox.com. [...] > @@ -664,19 +675,21 @@ > } > > tp->TxDescArrays = > - kmalloc(NUM_TX_DESC * sizeof (struct TxDesc) + 256, GFP_KERNEL); > + pci_alloc_consistent(tp->pci_dev, > + NUM_TX_DESC * sizeof (struct TxDesc) + 256, > + &tp->TxDescDmaAddrs); > - TxPhyAddr = virt_to_bus(tp->TxDescArrays); > - diff = 256 - (TxPhyAddr - ((TxPhyAddr >> 8) << 8)); > - TxPhyAddr += diff; > + diff = 256 - (tp->TxDescDmaAddrs - ((tp->TxDescDmaAddrs >> 8) << 8)); > + tp->TxDescDmaAddr = tp->TxDescDmaAddrs + diff; > tp->TxDescArray = (struct TxDesc *) (tp->TxDescArrays + diff); Remove the alignment stuff. pci_alloc_consistent() does it for you, see Documentation/DMA-mapping.txt: [...] The cpu return address and the DMA bus master address are both guaranteed to be aligned to the smallest PAGE_SIZE order which is greater than or equal to the requested size. This invariant @@ -684,12 +697,18 @@ [...] - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); + tp->RxBufferRings = pci_alloc_consistent(tp->pci_dev, + RX_BUF_SIZE * NUM_RX_DESC, + &tp->RxBufferDmas); You don't want consistent mapping for the data buffer. Either you pci_map_single() the whole kmalloced() area and you sync it when needed or you turn this code into usual, per skb, pci_map_single() calls and you remove the big Rx data buffer. -- Ueimor From masterpe@xs4all.nl Wed Nov 5 11:04:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 11:04:43 -0800 (PST) Received: from smtpzilla2.xs4all.nl (smtpzilla2.xs4all.nl [194.109.127.138]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5J4825025881 for ; Wed, 5 Nov 2003 11:04:09 -0800 Received: from lawbox.int.mpe.xs4all.nl (mpe.xs4all.nl [213.84.237.99]) by smtpzilla2.xs4all.nl (8.12.9/8.12.9) with ESMTP id hA5J45NY013585 for ; Wed, 5 Nov 2003 20:04:06 +0100 (CET) Subject: Report on the forcedeth driver From: Laurens To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1068059045.3618.3.camel@lawbox.int.mpe.xs4all.nl> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 05 Nov 2003 20:04:05 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 1227 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: masterpe@xs4all.nl Precedence: bulk X-list: netdev I tested the new driver as was requested and it works properly. I'm sending this to you now using the forcedeth module. Only note I have is that dhcpcd eth0 takes significantly longer to load then with nvnet. So as far as I'm concerned speed is the only "issue". good luck, Lawrence From davem@pizda.ninka.net Wed Nov 5 12:31:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 12:32:10 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5KVa25030680 for ; Wed, 5 Nov 2003 12:31:37 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA04293; Wed, 5 Nov 2003 12:26:31 -0800 Date: Wed, 5 Nov 2003 12:26:31 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: Fw: why is mode of /proc/sys/net/ipv6/icmp directory only 0500? Message-Id: <20031105122631.10112a14.davem@redhat.com> In-Reply-To: <20031106.022848.02505922.yoshfuji@linux-ipv6.org> References: <20031106.022848.02505922.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1228 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 06 Nov 2003 02:28:48 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > David, please apply this. > I don't see any reason to keep it 0500. Applied, thank you. From davem@pizda.ninka.net Wed Nov 5 12:40:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 12:40:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5KeF25031101 for ; Wed, 5 Nov 2003 12:40:15 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA04336; Wed, 5 Nov 2003 12:34:08 -0800 Date: Wed, 5 Nov 2003 12:34:08 -0800 From: "David S. Miller" To: Ville Nuorvala Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Also fix tunnel skb->h.raw bug in ip6_tunnel.c Message-Id: <20031105123408.5db4d1ec.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1229 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 5 Nov 2003 13:02:02 +0200 (EET) Ville Nuorvala wrote: > I noticed the skb->h.raw bug was fixed for ipip.c, ip_gre.c and sit.c, but > not for ip6_tunnel.c. Here is a patch for it as well. Please apply! Applied, thanks Ville. From bcwhite@precidia.com Wed Nov 5 12:41:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 12:41:39 -0800 (PST) Received: from mx2.magma.ca (mx2.magma.ca [206.191.0.250]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Kf325031132 for ; Wed, 5 Nov 2003 12:41:06 -0800 Received: from mail2.magma.ca (mail2.magma.ca [206.191.0.214]) by mx2.magma.ca Magma's Mail Server with ESMTP id hA5Kf2O0029024 for ; Wed, 5 Nov 2003 15:41:02 -0500 Received: from ottgate.precidia.com (ottgate.precidia.com [206.191.32.162]) by mail2.magma.ca (8.12.10/8.12.9) with ESMTP id hA5Kf2kJ018867 for ; Wed, 5 Nov 2003 15:41:02 -0500 Received: from tolkien.ott.precidia.com [10.0.1.2] (mail) by ottgate.precidia.com with esmtp (Exim 3.35 #1 (Debian)) id 1AHUSc-0001BT-00; Wed, 05 Nov 2003 15:41:02 -0500 Received: from adams.ott.precidia.com (precidia.com) [10.0.2.138] by tolkien.ott.precidia.com with esmtp (Exim 3.35 #1 (Debian)) id 1AHUSc-0000HP-00; Wed, 05 Nov 2003 15:41:02 -0500 Message-ID: <3FA9605E.2876B0D5@precidia.com> Date: Wed, 05 Nov 2003 15:41:02 -0500 From: Brian White Organization: Precidia Technologies http://www.precidia.com/ X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: rp_filter dropping things it shouldn't Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1230 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bcwhite@precidia.com Precedence: bulk X-list: netdev Kernel: 2.4.20 Arch: i386 Dist: debian/testing While experimenting with an automatic dial-backup system, we ended up with the situation where we have two default routes, one to PPP with a metric of 0 and one to ethernet with a metric of 1. The PPP route is brought on-line when connectivity to a remote host is not possible over ethernet but the default route over eth0 needs to remain so we can continue to check that link. The problem is that when we bind to eth0 to ping the remote host and a reply does come back (thus indicating we can close the dial-backup link), the ping reply is getting dropped by "rp_filter". My guess is that rp_filter sees that the preferred default route is over ppp0 and thus assumes that packets should not be coming over eth0, which of course they do since that is the interface/address the request was sent from. Setting "rp_filter" to "0" for "eth0" fixed this problem. Brian ( bcwhite@precidia.com ) ------------------------------------------------------------------------------- "A dollar saved is two dollars earned." -- Dave Chilton (The Wealthy Barber) From davem@pizda.ninka.net Wed Nov 5 12:41:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 12:41:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5KfF25031173 for ; Wed, 5 Nov 2003 12:41:15 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA04356; Wed, 5 Nov 2003 12:35:08 -0800 Date: Wed, 5 Nov 2003 12:35:08 -0800 From: "David S. Miller" To: Ville Nuorvala Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Flowinfo fix in ip6_tunnel.c Message-Id: <20031105123508.20599fc6.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1231 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 5 Nov 2003 13:35:33 +0200 (EET) Ville Nuorvala wrote: > would you also apply this minor patch? This makes the handling of > flowlabels consistent with the way flowlabels are passed from userspace > using sockopts. This looks fine, applied thanks. From modica@sgi.com Wed Nov 5 12:41:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 12:42:26 -0800 (PST) Received: from rj.sgi.com (mtvcafw.sgi.com [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Kfq25031361 for ; Wed, 5 Nov 2003 12:41:52 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hA5IlGOO014881 for ; Wed, 5 Nov 2003 10:47:16 -0800 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hA5KfkP513155175 for ; Wed, 5 Nov 2003 14:41:46 -0600 (CST) Received: from sgi.com (eagdhcp-232-154.americas.sgi.com [128.162.232.154]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hA5KfkRn347449038 for ; Wed, 5 Nov 2003 14:41:46 -0600 (CST) Message-ID: <3FA9608A.1020706@sgi.com> Date: Wed, 05 Nov 2003 14:41:46 -0600 From: Steve Modica Organization: SGI User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: High interrupt rate on tg3 driver Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1232 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Hi All, It turns out that there's a hardware bug that can cause a missed interrupt with the 570X chipset. So the tg3 driver will poke the card every 10msec to make sure we don't miss one. Each of these pokes generates an interrupt. However this still doesn't explain the high interrupt rate I'm seeing. I'm seeing about 22k/sec when moving 500kBytes/sec of data. I've got 5 cards ports on the system, so I can account for 500/sec, and I could even see each NAPI interrupt/poll cycle generating a few hundred a sec, but 22000 seems like way too many. Can anyone think of a real good way to capture this? Profiling just shows me spending a lot of time in tg3_poll, do_csum and memcpy. Steve -- Steve Modica work: 651-683-3224 MTS-Technical Lead "Give a man a fish, and he will eat for a day, hit him with a fish and he leaves you alone" - me From davem@pizda.ninka.net Wed Nov 5 12:59:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 13:00:28 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Kxn25000643 for ; Wed, 5 Nov 2003 12:59:50 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA04429; Wed, 5 Nov 2003 12:53:42 -0800 Date: Wed, 5 Nov 2003 12:53:42 -0800 From: "David S. Miller" To: Ville Nuorvala Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device Message-Id: <20031105125342.7e7e2ee9.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1233 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 5 Nov 2003 15:07:32 +0200 (EET) Ville Nuorvala wrote: > If you are ok with the patch, perhaps we could push it forward to Dave. When a decision is made about this patch, just let me know. Thanks. From jgarzik@pobox.com Wed Nov 5 13:37:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 13:37:40 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5Law25001772 for ; Wed, 5 Nov 2003 13:36:59 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35237 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AHVKi-00088L-Nd; Wed, 05 Nov 2003 21:36:56 +0000 Message-ID: <3FA96D68.4090806@pobox.com> Date: Wed, 05 Nov 2003 16:36:40 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Pekka Pietikainen , netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> <20031104091355.70d6a3d1.davem@redhat.com> <20031104211937.GA3888@ee.oulu.fi> <20031104132017.1d43a69c.davem@redhat.com> In-Reply-To: <20031104132017.1d43a69c.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1234 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Tue, 4 Nov 2003 23:19:37 +0200 > Pekka Pietikainen wrote: > > >>On Tue, Nov 04, 2003 at 09:13:55AM -0800, David S. Miller wrote: >> >>>free_netdev() is being invoked before the device registration >>>state advanced to NETREG_UNREGISTERED, likely unregister_netdev() >>>has not been called first or a bogus pointer was passed into >>>the routine. >> >>Ah, like a missing SET_NETDEV_DEV? :-) > > > Wonderful, Jeff please integrate this b44 patch from Pekka. If someone can send me the latest patch, certainly! :) There wasn't a patch appended to this message I'm replying to, nor did any of the patches I saw on netdev include a SET_NETDEV_DEV change... Jeff From davem@pizda.ninka.net Wed Nov 5 13:41:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 13:41:49 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5LfF25002570 for ; Wed, 5 Nov 2003 13:41:15 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA04622; Wed, 5 Nov 2003 13:35:17 -0800 Date: Wed, 5 Nov 2003 13:35:16 -0800 From: "David S. Miller" To: Jeff Garzik Cc: pp@ee.oulu.fi, netdev@oss.sgi.com Subject: Re: changing MTU on b44 breaks eth0 Message-Id: <20031105133516.289a62b9.davem@redhat.com> In-Reply-To: <3FA96D68.4090806@pobox.com> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> <20031104091355.70d6a3d1.davem@redhat.com> <20031104211937.GA3888@ee.oulu.fi> <20031104132017.1d43a69c.davem@redhat.com> <3FA96D68.4090806@pobox.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1235 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 05 Nov 2003 16:36:40 -0500 Jeff Garzik wrote: > If someone can send me the latest patch, certainly! :) > > There wasn't a patch appended to this message I'm replying to, nor did > any of the patches I saw on netdev include a SET_NETDEV_DEV change... The most recent one did, I'll forward to you under seperate cover. From jmorris@redhat.com Wed Nov 5 15:18:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 15:18:55 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA5NI425007828 for ; Wed, 5 Nov 2003 15:18:21 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hA5NI3M11120 for ; Wed, 5 Nov 2003 18:18:03 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.64.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hA5NI3605106 for ; Wed, 5 Nov 2003 18:18:03 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.65.238]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id hA5NI24s008708 for ; Wed, 5 Nov 2003 18:18:02 -0500 Date: Wed, 5 Nov 2003 18:19:05 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: netdev@oss.sgi.com Subject: Re: Oops in __xfrm4_state_lookup when setting up an IPSEC tunnel (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1236 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev Here is some better debug info, also, he was able to resolve the issue by fixing his policy (previously posted to lkml), so it looks like a bug to be investigated. ---------- Forwarded message ---------- Date: Wed, 05 Nov 2003 10:26:58 -0500 From: David T Hollis To: James Morris Cc: David S. Miller Subject: Re: Oops in __xfrm4_state_lookup when setting up an IPSEC tunnel James Morris wrote: >On Wed, 5 Nov 2003, David T Hollis wrote: > > > > >>>>EIP is at __xfrm4_state_lookup+0x6f/0xa0 >>>> >>>> >>>> >>>> >>>If you compile your kernel with -g, you should be able to find the >>>corresponding line of code (e.g. with addr2line). >>> >>> >>> >>> Here's a much better dump of information. This time I went with no netfilter stuff loaded, very bare bones. Without those modules, the dump didn't scroll past the screen so I was able to get the rather important bit about KERNEL: ASSERTION (x->km.state == XFRM_STATE_DEAD) failed at net/xfrm/xfrm_state.c (193) (this is in __xfrm_state_destroy). So the state of my transform is set to dead for some reason, next question is why that would be. I still die in __xfrm4_state_lookup on the list_for_each_entry. KERNEL: ASSERTION (x->km.state == XFRM_STATE_DEAD) failed at net/xfrm/xfrm_state.c (193) Unable to handle kernel paging request at virtual address 39302035 printing eip: c02a7c8f *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010282 EIP is at __xfrm4_state_lookup+0x6f/0xa0 Call Trace: xfrm_state_lookup+0x4c/0x70 xfrm4_rcv_encap+0x9f/0x390 default_wake_function+0x2a/0x30 xfrm4_rcv+0x17/0x20 ip_local_deliver+0xe5/0x230 ip_rcv+0x31f/0x470 netif_recieve_skb+0x183/0x200 From krkumar@us.ibm.com Wed Nov 5 16:03:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 16:03:49 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA603925009587 for ; Wed, 5 Nov 2003 16:03:16 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA6033hn564492; Wed, 5 Nov 2003 19:03:03 -0500 Received: from DYN318430BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA60320N201486; Wed, 5 Nov 2003 19:03:02 -0500 Date: Wed, 5 Nov 2003 16:00:49 -0800 (PST) From: Krishna Kumar X-X-Sender: krkumar@DYN318430BLD.beaverton.ibm.com To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH] panic during unregister_netdevice() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1237 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev Hi dave, While doing a test comprising of : insmod e100 ifup eth0 rmmod e100 on test9-bk9 bits, I got the following Oops : Nov 5 14:54:58 linux kernel: Unable to handle kernel paging request at virtual address 0260025d Nov 5 14:54:58 linux kernel: printing eip: Nov 5 14:54:58 linux kernel: c0318a5a Nov 5 14:54:58 linux kernel: *pde = 00000000 Nov 5 14:54:58 linux kernel: Oops: 0000 [#1] Nov 5 14:54:58 linux kernel: CPU: 0 Nov 5 14:54:58 linux kernel: EIP: 0060:[__rta_fill+90/160] Not tainted Nov 5 14:54:58 linux kernel: EIP: 0060:[] Not tainted Nov 5 14:54:58 linux kernel: EFLAGS: 00010282 Nov 5 14:54:58 linux kernel: EIP is at __rta_fill+0x5a/0xa0 Nov 5 14:54:58 linux kernel: eax: 00000008 ebx: 00000004 ecx: 00000001 edx: c94fe980 Nov 5 14:54:58 linux kernel: esi: 0260025d edi: c7e8a054 ebp: c1553e64 esp: c1553e48 Nov 5 14:54:58 linux kernel: ds: 007b es: 007b ss: 0068 Nov 5 14:54:58 linux kernel: Process events/0 (pid: 4, threadinfo=c1552000 task=c152c670) Nov 5 14:54:58 linux kernel: Stack: c1553e6c c011b36e c0433800 00000008 c7e8a050 ce77a000 00000000 c1553e98 Nov 5 14:54:58 linux kernel: c0318fee c94fe980 0000000a 00000004 0260025d c030a268 00000000 c7e8a000 Nov 5 14:54:58 linux kernel: 011b000e c94fe980 ce77a000 00000011 c1553ec8 c031943c c94fe980 ce77a000 Nov 5 14:54:58 linux kernel: Call Trace: Nov 5 14:54:58 linux kernel: [recalc_task_prio+126/384] recalc_task_prio+0x7e/0x180 Nov 5 14:54:58 linux kernel: [] recalc_task_prio+0x7e/0x180 Nov 5 14:54:58 linux kernel: [rtnetlink_fill_ifinfo+862/1264] rtnetlink_fill_ifinfo+0x35e/0x4f0 Nov 5 14:54:58 linux kernel: [] rtnetlink_fill_ifinfo+0x35e/0x4f0 Nov 5 14:54:58 linux kernel: [alloc_skb+72/240] alloc_skb+0x48/0xf0 Nov 5 14:54:58 linux kernel: [] alloc_skb+0x48/0xf0 Nov 5 14:54:58 linux kernel: [rtmsg_ifinfo+92/208] rtmsg_ifinfo+0x5c/0xd0 Nov 5 14:54:58 linux kernel: [] rtmsg_ifinfo+0x5c/0xd0 Nov 5 14:54:58 linux kernel: [rtnetlink_event+48/117] rtnetlink_event+0x30/0x75 Nov 5 14:54:58 linux kernel: [] rtnetlink_event+0x30/0x75 Nov 5 14:54:58 linux kernel: [notifier_call_chain+45/80] notifier_call_chain+0x2d/0x50 Nov 5 14:54:58 linux kernel: [] notifier_call_chain+0x2d/0x50 Nov 5 14:54:58 linux kernel: [netdev_wait_allrefs+242/320] netdev_wait_allrefs+0xf2/0x140 Nov 5 14:54:58 linux kernel: [] netdev_wait_allrefs+0xf2/0x140 Nov 5 14:54:58 linux kernel: [netdev_run_todo+347/608] netdev_run_todo+0x15b/0x260 Nov 5 14:54:58 linux kernel: [] netdev_run_todo+0x15b/0x260 Nov 5 14:54:58 linux kernel: [worker_thread+531/800] worker_thread+0x213/0x320 Nov 5 14:54:58 linux kernel: [] worker_thread+0x213/0x320 Nov 5 14:54:58 linux kernel: [linkwatch_event+0/48] linkwatch_event+0x0/0x30 Nov 5 14:54:58 linux kernel: [] linkwatch_event+0x0/0x30 Nov 5 14:54:58 linux kernel: [default_wake_function+0/48] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [ret_from_fork+6/20] ret_from_fork+0x6/0x14 Nov 5 14:54:58 linux kernel: [] ret_from_fork+0x6/0x14 Nov 5 14:54:58 linux kernel: [default_wake_function+0/48] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [worker_thread+0/800] worker_thread+0x0/0x320 Nov 5 14:54:58 linux kernel: [] worker_thread+0x0/0x320 Nov 5 14:54:58 linux kernel: [kernel_thread_helper+5/24] kernel_thread_helper+0x5/0x18 Nov 5 14:54:58 linux kernel: [] kernel_thread_helper+0x5/0x18 Nov 5 14:54:58 linux kernel: Nov 5 14:54:58 linux kernel: Code: f3 a5 f6 c3 02 74 02 66 a5 f6 c3 01 74 01 a4 8b 5d f4 8b 75 I think the problem is as follows (changed between 2.4 and 2.6). unregister_netdevice() drops the last reference to the device and waits for the ref counter for the dev to drop to zero. While it is OK for unregister_netdevice to call notifier_call_chain (since it does a dev_put at the end of the routine), netdev_wait_allrefs() cannot do the same until it gets it's own reference. The dev can disappear during this when the last reference gets dropped by the process holding it. Following patch should fix it. I will try to reproduce this with and without the patch to be certain. Thanks, - KK diff -ruN linux-2.6.0-test9-bk9/net/core/dev.c linux-2.6.0-test9-bk9.new/net/core/dev.c --- linux-2.6.0-test9-bk9/net/core/dev.c 2003-11-05 15:43:21.000000000 -0800 +++ linux-2.6.0-test9-bk9.new/net/core/dev.c 2003-11-05 15:43:50.000000000 -0800 @@ -2749,8 +2749,10 @@ rtnl_exlock(); /* Rebroadcast unregister notification */ + dev_hold(dev); notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); + dev_put(dev); if (test_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { From kumarkr@us.ibm.com Wed Nov 5 16:27:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 16:27:57 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA60RF25013256 for ; Wed, 5 Nov 2003 16:27:24 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA60R9cF351550; Wed, 5 Nov 2003 19:27:09 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA60R86s164102; Wed, 5 Nov 2003 17:27:09 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: davem@redhat.com Cc: netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Wed, 5 Nov 2003 16:26:46 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/05/2003 17:27:08 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1238 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev About the patch below, I am still not clear about dev->reg_state (NETREG_UNREGISTERING) being used correctly, or how netdev_run_todo works correctly, so possibly the race may not be fixed. I am trying to reproduce this again. I will look some more into this. thanks, - KK |---------+-------------------------------> | | krkumar@us.ltcfwd.li| | | nux.ibm.com | | | Sent by: | | | netdev-bounce@oss.sg| | | i.com | | | | | | | | | 11/05/2003 04:00 PM | | | | |---------+-------------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: davem@redhat.com | | cc: netdev@oss.sgi.com | | Subject: [PATCH] panic during unregister_netdevice() | | | >-----------------------------------------------------------------------------------------------------------------| Hi dave, While doing a test comprising of : insmod e100 ifup eth0 rmmod e100 on test9-bk9 bits, I got the following Oops : Nov 5 14:54:58 linux kernel: Unable to handle kernel paging request at virtual address 0260025d Nov 5 14:54:58 linux kernel: printing eip: Nov 5 14:54:58 linux kernel: c0318a5a Nov 5 14:54:58 linux kernel: *pde = 00000000 Nov 5 14:54:58 linux kernel: Oops: 0000 [#1] Nov 5 14:54:58 linux kernel: CPU: 0 Nov 5 14:54:58 linux kernel: EIP: 0060:[__rta_fill+90/160] Not tainted Nov 5 14:54:58 linux kernel: EIP: 0060:[] Not tainted Nov 5 14:54:58 linux kernel: EFLAGS: 00010282 Nov 5 14:54:58 linux kernel: EIP is at __rta_fill+0x5a/0xa0 Nov 5 14:54:58 linux kernel: eax: 00000008 ebx: 00000004 ecx: 00000001 edx: c94fe980 Nov 5 14:54:58 linux kernel: esi: 0260025d edi: c7e8a054 ebp: c1553e64 esp: c1553e48 Nov 5 14:54:58 linux kernel: ds: 007b es: 007b ss: 0068 Nov 5 14:54:58 linux kernel: Process events/0 (pid: 4, threadinfo=c1552000 task=c152c670) Nov 5 14:54:58 linux kernel: Stack: c1553e6c c011b36e c0433800 00000008 c7e8a050 ce77a000 00000000 c1553e98 Nov 5 14:54:58 linux kernel: c0318fee c94fe980 0000000a 00000004 0260025d c030a268 00000000 c7e8a000 Nov 5 14:54:58 linux kernel: 011b000e c94fe980 ce77a000 00000011 c1553ec8 c031943c c94fe980 ce77a000 Nov 5 14:54:58 linux kernel: Call Trace: Nov 5 14:54:58 linux kernel: [recalc_task_prio+126/384] recalc_task_prio+0x7e/0x180 Nov 5 14:54:58 linux kernel: [] recalc_task_prio+0x7e/0x180 Nov 5 14:54:58 linux kernel: [rtnetlink_fill_ifinfo+862/1264] rtnetlink_fill_ifinfo+0x35e/0x4f0 Nov 5 14:54:58 linux kernel: [] rtnetlink_fill_ifinfo+0x35e/0x4f0 Nov 5 14:54:58 linux kernel: [alloc_skb+72/240] alloc_skb+0x48/0xf0 Nov 5 14:54:58 linux kernel: [] alloc_skb+0x48/0xf0 Nov 5 14:54:58 linux kernel: [rtmsg_ifinfo+92/208] rtmsg_ifinfo+0x5c/0xd0 Nov 5 14:54:58 linux kernel: [] rtmsg_ifinfo+0x5c/0xd0 Nov 5 14:54:58 linux kernel: [rtnetlink_event+48/117] rtnetlink_event+0x30/0x75 Nov 5 14:54:58 linux kernel: [] rtnetlink_event+0x30/0x75 Nov 5 14:54:58 linux kernel: [notifier_call_chain+45/80] notifier_call_chain+0x2d/0x50 Nov 5 14:54:58 linux kernel: [] notifier_call_chain+0x2d/0x50 Nov 5 14:54:58 linux kernel: [netdev_wait_allrefs+242/320] netdev_wait_allrefs+0xf2/0x140 Nov 5 14:54:58 linux kernel: [] netdev_wait_allrefs+0xf2/0x140 Nov 5 14:54:58 linux kernel: [netdev_run_todo+347/608] netdev_run_todo+0x15b/0x260 Nov 5 14:54:58 linux kernel: [] netdev_run_todo+0x15b/0x260 Nov 5 14:54:58 linux kernel: [worker_thread+531/800] worker_thread+0x213/0x320 Nov 5 14:54:58 linux kernel: [] worker_thread+0x213/0x320 Nov 5 14:54:58 linux kernel: [linkwatch_event+0/48] linkwatch_event+0x0/0x30 Nov 5 14:54:58 linux kernel: [] linkwatch_event+0x0/0x30 Nov 5 14:54:58 linux kernel: [default_wake_function+0/48] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [ret_from_fork+6/20] ret_from_fork+0x6/0x14 Nov 5 14:54:58 linux kernel: [] ret_from_fork+0x6/0x14 Nov 5 14:54:58 linux kernel: [default_wake_function+0/48] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [] default_wake_function+0x0/0x30 Nov 5 14:54:58 linux kernel: [worker_thread+0/800] worker_thread+0x0/0x320 Nov 5 14:54:58 linux kernel: [] worker_thread+0x0/0x320 Nov 5 14:54:58 linux kernel: [kernel_thread_helper+5/24] kernel_thread_helper+0x5/0x18 Nov 5 14:54:58 linux kernel: [] kernel_thread_helper+0x5/0x18 Nov 5 14:54:58 linux kernel: Nov 5 14:54:58 linux kernel: Code: f3 a5 f6 c3 02 74 02 66 a5 f6 c3 01 74 01 a4 8b 5d f4 8b 75 I think the problem is as follows (changed between 2.4 and 2.6). unregister_netdevice() drops the last reference to the device and waits for the ref counter for the dev to drop to zero. While it is OK for unregister_netdevice to call notifier_call_chain (since it does a dev_put at the end of the routine), netdev_wait_allrefs() cannot do the same until it gets it's own reference. The dev can disappear during this when the last reference gets dropped by the process holding it. Following patch should fix it. I will try to reproduce this with and without the patch to be certain. Thanks, - KK diff -ruN linux-2.6.0-test9-bk9/net/core/dev.c linux-2.6.0-test9-bk9.new/net/core/dev.c --- linux-2.6.0-test9-bk9/net/core/dev.c 2003-11-05 15:43:21.000000000 -0800 +++ linux-2.6.0-test9-bk9.new/net/core/dev.c 2003-11-05 15:43:50.000000000 -0800 @@ -2749,8 +2749,10 @@ rtnl_exlock(); /* Rebroadcast unregister notification */ + dev_hold(dev); notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); + dev_put(dev); if (test_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) { From shemminger@osdl.org Wed Nov 5 16:30:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 16:31:10 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA60UH25013612 for ; Wed, 5 Nov 2003 16:30:37 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA60U4C02926; Wed, 5 Nov 2003 16:30:04 -0800 Date: Wed, 5 Nov 2003 16:30:25 -0800 From: Stephen Hemminger To: Krishna Kumar Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031105163025.796cc462.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1239 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev > > diff -ruN linux-2.6.0-test9-bk9/net/core/dev.c linux-2.6.0-test9-bk9.new/net/core/dev.c > --- linux-2.6.0-test9-bk9/net/core/dev.c 2003-11-05 15:43:21.000000000 -0800 > +++ linux-2.6.0-test9-bk9.new/net/core/dev.c 2003-11-05 15:43:50.000000000 -0800 > @@ -2749,8 +2749,10 @@ > rtnl_exlock(); > > /* Rebroadcast unregister notification */ > + dev_hold(dev); > notifier_call_chain(&netdev_chain, > NETDEV_UNREGISTER, dev); > + dev_put(dev); > > if (test_bit(__LINK_STATE_LINKWATCH_PENDING, > &dev->state)) { > Hey, what if the dev refcount goes to zero before your dev_hold? Actually this repeated notifier looks like it wouldn't work anyway. Why would a protocol drop it's reference when notified a second time? I would argue even running the loop once means some protocol is busted. From davem@pizda.ninka.net Wed Nov 5 16:39:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 16:39:44 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA60d125014514 for ; Wed, 5 Nov 2003 16:39:02 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA05210; Wed, 5 Nov 2003 16:33:51 -0800 Date: Wed, 5 Nov 2003 16:33:50 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: krkumar@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031105163350.66bf2763.davem@redhat.com> In-Reply-To: <20031105163025.796cc462.shemminger@osdl.org> References: <20031105163025.796cc462.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1240 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 5 Nov 2003 16:30:25 -0800 Stephen Hemminger wrote: > Hey, what if the dev refcount goes to zero before your dev_hold? > Actually this repeated notifier looks like it wouldn't work anyway. > Why would a protocol drop it's reference when notified a second time? > > I would argue even running the loop once means some protocol is busted. If the loops runs once or twice that is not a bug, it is possible for processes to grab onto the device via rtnetlink queries and similar and we have to pause and potentially schedule to deal with that. The core problem is that we end up putting the device reference to zero a second time, and for that reason we should prevent it by holding onto a reference around the entire loop and wait for the refcount to drop to '1'. That would fix the bug wouldn't it? From kumarkr@us.ibm.com Wed Nov 5 16:42:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 16:43:29 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA60gt25015252 for ; Wed, 5 Nov 2003 16:42:56 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA60gikF358828; Wed, 5 Nov 2003 19:42:44 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA60gh6s160818; Wed, 5 Nov 2003 17:42:43 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: Stephen Hemminger Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Wed, 5 Nov 2003 16:42:12 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/05/2003 17:42:43 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1241 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev > Hey, what if the dev refcount goes to zero before your dev_hold? Actually, that is what I had written in my second mail. > I would argue even running the loop once means some protocol is busted. I have seen a message regarding ref count of 1, some delay and then the rmmod works fine. So it doesn't seem busted. - KK |---------+----------------------------> | | Stephen Hemminger| | | | | | Sent by: | | | netdev-bounce@oss| | | .sgi.com | | | | | | | | | 11/05/2003 04:30 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: krkumar@us.ltcfwd.linux.ibm.com | | cc: davem@redhat.com, netdev@oss.sgi.com | | Subject: Re: [PATCH] panic during unregister_netdevice() | | | >-----------------------------------------------------------------------------------------------------------------| > > diff -ruN linux-2.6.0-test9-bk9/net/core/dev.c linux-2.6.0-test9-bk9.new/net/core/dev.c > --- linux-2.6.0-test9-bk9/net/core/dev.c 2003-11-05 15:43:21.000000000 -0800 > +++ linux-2.6.0-test9-bk9.new/net/core/dev.c 2003-11-05 15:43:50.000000000 -0800 > @@ -2749,8 +2749,10 @@ > rtnl_exlock(); > > /* Rebroadcast unregister notification */ > + dev_hold(dev); > notifier_call_chain(&netdev_chain, > NETDEV_UNREGISTER, dev); > + dev_put(dev); > > if (test_bit(__LINK_STATE_LINKWATCH_PENDING, > &dev->state)) { > Hey, what if the dev refcount goes to zero before your dev_hold? Actually this repeated notifier looks like it wouldn't work anyway. Why would a protocol drop it's reference when notified a second time? I would argue even running the loop once means some protocol is busted. From shemminger@osdl.org Wed Nov 5 17:09:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 17:09:50 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA619925015853 for ; Wed, 5 Nov 2003 17:09:09 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA618tC10887; Wed, 5 Nov 2003 17:08:56 -0800 Date: Wed, 5 Nov 2003 17:09:15 -0800 From: Stephen Hemminger To: Krishna Kumar Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031105170915.14793157.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1242 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Try this. Instead of dropping the last reference in unregister, it does it after all other references are gone (sort of like the old 2.4 code). diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Wed Nov 5 17:04:57 2003 +++ b/net/core/dev.c Wed Nov 5 17:04:57 2003 @@ -2743,7 +2743,7 @@ unsigned long rebroadcast_time, warning_time; rebroadcast_time = warning_time = jiffies; - while (atomic_read(&dev->refcnt) != 0) { + while (atomic_read(&dev->refcnt) > 1) { if (time_after(jiffies, rebroadcast_time + 1 * HZ)) { rtnl_shlock(); rtnl_exlock(); @@ -2838,6 +2838,7 @@ dev->reg_state = NETREG_UNREGISTERED; netdev_wait_allrefs(dev); + dev_put(dev); /* paranoia */ BUG_ON(atomic_read(&dev->refcnt)); @@ -2974,7 +2975,6 @@ /* Finish processing unregister after unlock */ net_set_todo(dev); - dev_put(dev); return 0; } From kumarkr@us.ibm.com Wed Nov 5 17:17:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 17:17:43 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA61H725016265 for ; Wed, 5 Nov 2003 17:17:08 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA61GtcF129032; Wed, 5 Nov 2003 20:16:55 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA61Gs6s164034; Wed, 5 Nov 2003 18:16:55 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: "David S. Miller" Cc: krkumar@us.ibm.com, netdev@oss.sgi.com, Stephen Hemminger X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Wed, 5 Nov 2003 17:16:10 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/05/2003 18:16:54 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1243 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev > If the loops runs once or twice that is not a bug, it is possible for > processes to grab onto the device via rtnetlink queries and similar > and we have to pause and potentially schedule to deal with that. Yes. I guess rtnetlink_rcv() calls netdev_run_todo() to handle that case. > The core problem is that we end up putting the device reference to > zero a second time, and for that reason we should prevent it by > holding onto a reference around the entire loop and wait for the > refcount to drop to '1'. That was my original intention, but won't a driver that calls unregister_netdevice() followed by a free_netdev() still panic the system ? Since the netdev_run_todo() can run after this is done and derefernce the 'dev'. (Or is the refcount of the dev->kobject going to be > 1 and hence not freed ? This class/object code is new to me). Thanks, - KK From kumarkr@us.ibm.com Wed Nov 5 17:21:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 17:21:51 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA61LG25016623 for ; Wed, 5 Nov 2003 17:21:16 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA61L4kF135216; Wed, 5 Nov 2003 20:21:04 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA61L36s159532; Wed, 5 Nov 2003 18:21:03 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: Stephen Hemminger Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Wed, 5 Nov 2003 17:20:06 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/05/2003 18:21:02 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1244 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev So how will this guarantee that the dev is valid after the dev_put() long enough to do the BUG_ON() and dev->destructor code ? Won't the same panic happen ? Any idea how the dev gets freed up ? I was still in the old 2.4 kernel mode thinking that dev_put does it, but it seems to be done by using the class/object stuff in free_netdev(). Won't a driver doing a unregister followed by a free_netdev still panic the system if we reference the dev at a later stage (even with the put at this place) ? thanks, - KK |---------+----------------------------> | | Stephen Hemminger| | | | | | Sent by: | | | netdev-bounce@oss| | | .sgi.com | | | | | | | | | 11/05/2003 05:09 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: Krishna Kumar/Beaverton/IBM@IBMUS | | cc: davem@redhat.com, krkumar@us.ltcfwd.linux.ibm.com, netdev@oss.sgi.com | | Subject: Re: [PATCH] panic during unregister_netdevice() | | | >-----------------------------------------------------------------------------------------------------------------| Try this. Instead of dropping the last reference in unregister, it does it after all other references are gone (sort of like the old 2.4 code). diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Wed Nov 5 17:04:57 2003 +++ b/net/core/dev.c Wed Nov 5 17:04:57 2003 @@ -2743,7 +2743,7 @@ unsigned long rebroadcast_time, warning_time; rebroadcast_time = warning_time = jiffies; - while (atomic_read(&dev->refcnt) != 0) { + while (atomic_read(&dev->refcnt) > 1) { if (time_after(jiffies, rebroadcast_time + 1 * HZ)) { rtnl_shlock(); rtnl_exlock(); @@ -2838,6 +2838,7 @@ dev->reg_state = NETREG_UNREGISTERED; netdev_wait_allrefs(dev); + dev_put(dev); /* paranoia */ BUG_ON(atomic_read(&dev->refcnt)); @@ -2974,7 +2975,6 @@ /* Finish processing unregister after unlock */ net_set_todo(dev); - dev_put(dev); return 0; } From shemminger@osdl.org Wed Nov 5 17:33:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 17:34:04 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA61XO25017078 for ; Wed, 5 Nov 2003 17:33:25 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA61WpC14667; Wed, 5 Nov 2003 17:32:51 -0800 Date: Wed, 5 Nov 2003 17:33:11 -0800 From: Stephen Hemminger To: Krishna Kumar Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031105173311.0b9f8bfc.shemminger@osdl.org> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1245 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 5 Nov 2003 17:20:06 -0800 Krishna Kumar wrote: > > > > > So how will this guarantee that the dev is valid after the dev_put() long > enough to do the > BUG_ON() and dev->destructor code ? Won't the same panic happen ? > Because the code there should be able to depend on having the last reference. No other code should be able to find the dev to get a new reference to it, since it is no longer in the dev_list. Code that does dev_hold's without already having a reference is just not playing fair. > Any idea how the dev gets freed up ? I was still in the old 2.4 kernel mode > thinking that > dev_put does it, but it seems to be done by using the class/object stuff in > free_netdev(). > > Won't a driver doing a unregister followed by a free_netdev still panic the > system if we > reference the dev at a later stage (even with the put at this place) ? > > thanks, > > - KK > From kumarkr@us.ibm.com Wed Nov 5 17:43:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 17:43:45 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA61hA25017506 for ; Wed, 5 Nov 2003 17:43:10 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA61gwlQ312766; Wed, 5 Nov 2003 20:42:58 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA61gv6s156490; Wed, 5 Nov 2003 18:42:57 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: Stephen Hemminger Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Wed, 5 Nov 2003 17:42:28 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/05/2003 18:42:57 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1246 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev Nope, I still get the panic with the change you suggested. We need to understand this better though we seem to be on the right track. I will try to get the stack now (couldn't get this time since I was on the X display, my mouse still works but not the keyboard). Thanks, - KK |---------+----------------------------> | | Stephen Hemminger| | | | | | Sent by: | | | netdev-bounce@oss| | | .sgi.com | | | | | | | | | 11/05/2003 05:33 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: Krishna Kumar/Beaverton/IBM@IBMUS | | cc: davem@redhat.com, krkumar@us.ltcfwd.linux.ibm.com, netdev@oss.sgi.com | | Subject: Re: [PATCH] panic during unregister_netdevice() | | | >-----------------------------------------------------------------------------------------------------------------| On Wed, 5 Nov 2003 17:20:06 -0800 Krishna Kumar wrote: > > > > > So how will this guarantee that the dev is valid after the dev_put() long > enough to do the > BUG_ON() and dev->destructor code ? Won't the same panic happen ? > Because the code there should be able to depend on having the last reference. No other code should be able to find the dev to get a new reference to it, since it is no longer in the dev_list. Code that does dev_hold's without already having a reference is just not playing fair. > Any idea how the dev gets freed up ? I was still in the old 2.4 kernel mode > thinking that > dev_put does it, but it seems to be done by using the class/object stuff in > free_netdev(). > > Won't a driver doing a unregister followed by a free_netdev still panic the > system if we > reference the dev at a later stage (even with the put at this place) ? > > thanks, > > - KK > From hadi@cyberus.ca Wed Nov 5 19:29:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 19:30:15 -0800 (PST) Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA63Td25019296 for ; Wed, 5 Nov 2003 19:29:40 -0800 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AHaq1-0000tX-9f; Wed, 05 Nov 2003 22:29:37 -0500 Subject: Re: Announce: NetKeeper Firewall For Linux From: jamal Reply-To: hadi@cyberus.ca To: Emmanuel Fleury Cc: "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, Mikkel Christiansen In-Reply-To: <1068046114.31636.92.camel@rade7.s.cs.auc.dk> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> <1068001237.1064.31.camel@jzny.localdomain> <1068046114.31636.92.camel@rade7.s.cs.auc.dk> Content-Type: text/plain; charset=ISO-8859-1 Organization: jamalopolis Message-Id: <1068089345.1020.17.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Nov 2003 22:29:06 -0500 Content-Transfer-Encoding: 8bit X-archive-position: 1247 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Hi, On Wed, 2003-11-05 at 10:28, Emmanuel Fleury wrote: > Hi, > > On Wed, 2003-11-05 at 04:00, jamal wrote: > > > > You seem to be attempting to replicate that functionality actually;-> > > (as opposed to using it). Therefore you are going to miss a lot of > > good things. What was posted already is just the beggining. > > I'm not sure it is the case (but I might have missed the point). > Yes, i think you missed my point ;-> You guys are doing a great job at coming up with some good packet classification algorithm(s). I wanna encourage you to continue doing that. OTOH, I have spent a lot of time thinking and coming up with a good architecture for the action part (that follows classification). So it will be a shame if you miss that because you happened to see one good thing in the old code. Putting the two together will result in some good things. You trying to redo what i am doing will mean you are always a few steps behind[1]. Now if you can do it better than what i have, then you can convert me too - thats the way opensource works. > Anyway, reading some new code can give us nice ideas. > We would be pleased to see what you've already achieved. > Lets work together instead of you trying to get nice ideas from my new code. This way you benefit from any evolution i have; and i have lots coming down. You must switch to making your code tc filter capable to do this. > > Why do you have a limit to 8 actions? > > This limit is totally artificial. > > Basically, the story is that we had a union in a struct and we filled up > the memory space with these actions so that no memory was left behind. > We decided (on arbitrary basis) that nobody would attach more than 8 > different actions to a precise packet. We also though that having 256 > different actions would be enough. > Probably true; but no point in making the limits when you dont have to. > In fact, these two limits (8 and 256) are totally artificial and > have been introduced in our prototype just because it was "convenient". > We can extend the list of actions by using a chained list and code the > actions on a bigger variable than a byte. > I dont understand why you even have this byte to encode an action. Look at my code. > > BTW, since you compile your filters, how fast are you at adding rules? > > So, here, you are hitting the sensitive spot ! > > In fact, we are totally ignorant of what are the requirements on these > dynamic updates in networking. So any discussion about this is extremely > valuable for us. > Anything that requires "connection setup" to dynamically add rules is a candidate. Think Voip SIP Proxy server for example which will insert rules; think any authentication schemes that are needed before installing rules, think tcp-splicing etc. > For your question, the theory (and the practice) is telling us that the > time to add a new rule to an existing ruleset depend essentially of the > complexity of the already existing ruleset. > I think thats a design issue. For example while u32 classifier may not process as fast as you (lookups would take longer relatively ) - its insertion time is independent of the complexity of the rules. Lakshman (sp?) had a good paper on the tradeoffs between memory space used, lookup times and insertion times (there was another variable) and i think he may have proved you cant have all of them work well at the same time. > Don't miss my point, the number of rules which compose the ruleset is > not the only parameter. Because, as your are going through an > optimization a ruleset with a lot of trivial rules is simplified and > will be trivial at the end. > > Therefore, it essentially depend on the ruleset to which you are adding > your new rule. > > But, we still have to work on this part. The way we have coded the > compiler is very simple and we have already some ideas on how to > optimize it. > > Actually, a good thing for us would be to know what are your expectation > in matter of adding a new rule. What is "acceptable" and what is "not". > > And, now, some tables with numbers: > > +--+--+--+--+--+ > | #rules | time(s) | nodes | edges | size(KB) | > +--+--+--+--+--+ > | 10 | 0.01 | 28 | 102 | 1.584 | > | 25 | 0.03 | 77 | 279 | 4.296 | > | 50 | 0.11 | 128 | 481 | 7.332 | > | 100 | 0.44 | 232 | 891 | 13.500 | > | 250 | 3.44 | 542 | 2109 | 31.836 | > | 500 | 19.14 | 998 | 3952 | 59.424 | > | 1,000 | 37.72 | 1884 | 7544 | 113.160 | > | 2,500 | 102.1 | 4289 | 17493 | 261.408 | > | 5,000 | 237.0 | 7678 | 31880 | 474.720 | > | 10,000 | 571.4 | 13420 | 57417 | 850.068 | > | 25,000 | 1832.0 | 24657 |116673 | 1695.984 | > | 50,000 | 5221.0 | 37416 |198754 | 2834.064 | > +--+--+--+--+--+ > So if you add rule #50000 while there are already 49999 existing it will take over an hour to install in the worst case, did i understand this correctly? > The rulesets considered here are totally artificially generated and are > matching our worst case in term of computing time. > > Of course your question was about taking one of this big filters and > then add one tiny winny rule to it. So, I guess the time to do so would > be at most 1s (in the very worst case, I would say). > Ok, so i didnt understand your table above then. 1s is very bad; actually i shouldnt say that since i dont have numbers infront of me of what is considered good. I will look this up > > What about dynamic in kernel rules (such as those that may be created > > by contracking) - do you have to cross to user space to compile them? > > We have some ideas on how to handle it. But for now, the scheme is > totally static. I would say that we are keeping this area of research > (stateful inspection) for later. :) > Which is fine. I would say for something like firewalling you have a desirable feature of very optimized lookups. > > - Is there any reason you move the commit decision to the kernel? > > Could this not have been done in user space? > > Yes, definitely. > > When coding in the kernel, we are coding with the idea that: > « The kernel should defend itself against user-space. » > > So, when the user say: "Commit". > > The kernel will first check the decision diagram for safety (no NULL > pointers, out of range variables, no loops, etc) and depending of the > tests, will take the decision to commit or not. > > Actually, I think I read some stuff about it on the Netfilter-devel > mailing-list. As far as I remember, there was a similar problem in > netfilter as the safety of the whole thing is never really tested in > depth. Therefore you can end-up with some loops or inconsistancy > (WARNING: I'm not sure about it!). > That sounds more like still a user space problem ;-> I saw in your paper briefly that you have infact a checker for something like this. That checker should run outside the kernel in my opinion. The value in putting the commit in the kernel maybe for say making sure you get the memory allocation you want etc before installing. But even this is not a strong arguement. > > I have doubts how fast you can install rules - which is a fundamental > > measure of good filters. > > The fact is that theory is saying that optimizing is a complex problem > (but it still has a polynomial time complexity ). But, we can for sure > improve A LOT our current tools. The problem for us is that we do not > know against what we are fighting ! We really need some hints on how > fast should be this operation (just to see if it is possible or not in > our scheme). > So i would suggest that you look at the Lakshman paper for starters. In my view the most important issues in priority order are: lookup speed regardless of table size, insert/delete rate regardless of table size, Capacity (should be able to go to the hundreds of thousands of flows), memory use for storage purposes - although i dont really care very much about these since memory is cheap these days. > PS: I would like also to say here that we got a really great feed back > from the nf-hipac team. So, thank a lot to Michael Bellion and Thomas > Heinz. > I am sorry i confused you with them;-> I suppose you are both from .dk. cheers, jamal [1]I briefly looked at your paper and it seems the only action you had initially was DENY or ACCEPT. Looking at your code you now have an action dispatcher that seems to be exactly like the old one i have (you havent implemented code around it but you have the hooks in place). This is why i made the comment. From greearb@candelatech.com Wed Nov 5 20:24:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 20:25:21 -0800 (PST) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA64Om25022880 for ; Wed, 5 Nov 2003 20:24:49 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hA64OhQN025015 for ; Wed, 5 Nov 2003 20:24:43 -0800 Message-ID: <3FA9CD0B.8000707@candelatech.com> Date: Wed, 05 Nov 2003 20:24:43 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'netdev@oss.sgi.com'" Subject: [PATCH] 802.1q vlan updates Content-Type: multipart/mixed; boundary="------------080500030205060300080101" X-archive-position: 1248 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080500030205060300080101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here is a patch that is a cleaned up version of something I sent a while back. This adds the ability to query a device to see if it is a vlan device by asking for the vlan's parent device. One can deduce that a querried interface is not a VLAN by looking at the IOCTL error code. Patch is against 2.4.22-pre9, compile tested and extracted from a run-time tested patch. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------080500030205060300080101 Content-Type: text/plain; name="vlan_2.4.22.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vlan_2.4.22.patch" --- linux-2.4.22/net/8021q/vlan_dev.c 2003-11-05 19:54:38.000000000 -0800 +++ linux-2.4.22.vlan/net/8021q/vlan_dev.c 2003-11-05 19:41:20.000000000 -0800 @@ -1,4 +1,4 @@ -/* +/* -*- linux-c -*- * INET 802.1Q VLAN * Ethernet-type device handling. * @@ -636,6 +636,60 @@ return -EINVAL; } + +int vlan_dev_get_realdev_name(const char *dev_name, char* result) +{ + struct net_device *dev = dev_get_by_name(dev_name); + int rv = 0; + + if (dev) { + if (dev->priv_flags & IFF_802_1Q_VLAN) { + strncpy(result, VLAN_DEV_INFO(dev)->real_dev->name, 23); + dev_put(dev); + rv = 0; + } else { + /*printk(KERN_ERR + "%s: %s is not a vlan device, priv_flags: %hX.\n", + __FUNCTION__, dev->name, dev->priv_flags);*/ + dev_put(dev); + rv = -EINVAL; + } + } else { + /* printk(KERN_ERR "%s: Could not find device: %s\n", + __FUNCTION__, dev_name); */ + rv = -ENODEV; + } + + return rv; +} + +int vlan_dev_get_vid(const char *dev_name, unsigned short* result) +{ + struct net_device *dev = dev_get_by_name(dev_name); + int rv = 0; + + if (dev) { + if (dev->priv_flags & IFF_802_1Q_VLAN) { + *result = VLAN_DEV_INFO(dev)->vlan_id; + dev_put(dev); + rv = 0; + } else { + /*printk(KERN_ERR + "%s: %s is not a vlan device, priv_flags: %hX.\n", + __FUNCTION__, dev->name, dev->priv_flags);*/ + dev_put(dev); + rv = -EINVAL; + } + } else { + /* printk(KERN_ERR "%s: Could not find device: %s\n", + __FUNCTION__, dev_name);*/ + rv = -ENODEV; + } + + return rv; +} + + int vlan_dev_set_mac_address(struct net_device *dev, void *addr_struct_p) { struct sockaddr *addr = (struct sockaddr *)(addr_struct_p); --- linux-2.4.22/net/8021q/vlan.c 2003-11-05 19:54:38.000000000 -0800 +++ linux-2.4.22.vlan/net/8021q/vlan.c 2003-11-05 19:46:04.000000000 -0800 @@ -1,4 +1,4 @@ -/* +/* -*- linux-c -*- * INET 802.1Q VLAN * Ethernet-type device handling. * @@ -657,15 +657,9 @@ int vlan_ioctl_handler(unsigned long arg) { int err = 0; + unsigned short vid = 0; struct vlan_ioctl_args args; - /* everything here needs root permissions, except aguably the - * hack ioctls for sending packets. However, I know _I_ don't - * want users running that on my network! --BLG - */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (copy_from_user(&args, (void*)arg, sizeof(struct vlan_ioctl_args))) return -EFAULT; @@ -680,24 +674,33 @@ switch (args.cmd) { case SET_VLAN_INGRESS_PRIORITY_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + err = vlan_dev_set_ingress_priority(args.device1, args.u.skb_priority, args.vlan_qos); break; case SET_VLAN_EGRESS_PRIORITY_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; err = vlan_dev_set_egress_priority(args.device1, args.u.skb_priority, args.vlan_qos); break; case SET_VLAN_FLAG_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; err = vlan_dev_set_vlan_flag(args.device1, args.u.flag, args.vlan_qos); break; case SET_VLAN_NAME_TYPE_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; if ((args.u.name_type >= 0) && (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { vlan_name_type = args.u.name_type; @@ -707,17 +710,9 @@ } break; - /* TODO: Figure out how to pass info back... - case GET_VLAN_INGRESS_PRIORITY_IOCTL: - err = vlan_dev_get_ingress_priority(args); - break; - - case GET_VLAN_EGRESS_PRIORITY_IOCTL: - err = vlan_dev_get_egress_priority(args); - break; - */ - case ADD_VLAN_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; /* we have been given the name of the Ethernet Device we want to * talk to: args.dev1 We also have the * VLAN ID: args.u.VID @@ -730,12 +725,53 @@ break; case DEL_VLAN_CMD: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; /* Here, the args.dev1 is the actual VLAN we want * to get rid of. */ err = unregister_vlan_device(args.device1); break; + case GET_VLAN_INGRESS_PRIORITY_CMD: + /* TODO: Implement + err = vlan_dev_get_ingress_priority(args); + if (copy_to_user((void*)arg, &args, + sizeof(struct vlan_ioctl_args))) { + err = -EFAULT; + } + */ + err = -EINVAL; + break; + + case GET_VLAN_EGRESS_PRIORITY_CMD: + /* TODO: Implement + err = vlan_dev_get_egress_priority(args.device1, &(args.args); + if (copy_to_user((void*)arg, &args, + sizeof(struct vlan_ioctl_args))) { + err = -EFAULT; + } + */ + err = -EINVAL; + break; + + case GET_VLAN_REALDEV_NAME_CMD: + err = vlan_dev_get_realdev_name(args.device1, args.u.device2); + if (copy_to_user((void*)arg, &args, + sizeof(struct vlan_ioctl_args))) { + err = -EFAULT; + } + break; + + case GET_VLAN_VID_CMD: + err = vlan_dev_get_vid(args.device1, &vid); + args.u.VID = vid; + if (copy_to_user((void*)arg, &args, + sizeof(struct vlan_ioctl_args))) { + err = -EFAULT; + } + break; + default: /* pass on to underlying device instead?? */ printk(VLAN_DBG "%s: Unknown VLAN CMD: %x \n", --- linux-2.4.22/include/linux/if_vlan.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22.vlan/include/linux/if_vlan.h 2003-11-05 19:47:37.000000000 -0800 @@ -213,7 +213,9 @@ GET_VLAN_INGRESS_PRIORITY_CMD, GET_VLAN_EGRESS_PRIORITY_CMD, SET_VLAN_NAME_TYPE_CMD, - SET_VLAN_FLAG_CMD + SET_VLAN_FLAG_CMD, + GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */ + GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ }; enum vlan_name_types { --------------080500030205060300080101-- From schuster.sven@gmx.de Wed Nov 5 23:31:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Nov 2003 23:32:23 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA67Vm25025121 for ; Wed, 5 Nov 2003 23:31:49 -0800 Received: (qmail 27078 invoked by uid 65534); 6 Nov 2003 07:31:42 -0000 Received: from unknown (EHLO gmx.de) (213.172.101.181) by mail.gmx.net (mp003) with SMTP; 06 Nov 2003 08:31:42 +0100 X-Authenticated: #2425915 Message-ID: <3FA9F8D5.9020601@gmx.de> Date: Thu, 06 Nov 2003 08:31:33 +0100 From: Sven Schuster User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: de-de, en, en-us MIME-Version: 1.0 To: linux-net@vger.kernel.org CC: netdev Subject: Linux <---> Unixware slow networking with e100 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1249 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schuster.sven@gmx.de Precedence: bulk X-list: netdev Hello everybody, we have a little problem here with networking between linux (redhat AS 2.1 2.4.9-e.27smp) and unixware 7.1.1 . The network card is a Intel 82557 Ethernet Pro 100 (lspci output) on a 100 mbit network. When doing data transfers between two linux machines, everything works fine, we have transfer rates of about 10 MB/s. But when _receiving_ data from one of the unixware machines, we just get a few kB/s, max. about 100 kB/s. When _sending_ data to a unixware machine, the transfer rate is fine too. Are there any known issues between linux and unixware (except the SCO thing ;-) ) ?? At first we used the eepro100 driver, but this gave us poor performance on receive with every other machine, whether it was unixware or linux. Another thing on that machine is, that there's a Intel 82544GC copper gigabit card in it. When using this one with the e1000 driver, it also gave us bad performance on receive (also just around max. 100 kB/s). Maxbe there are some options for module loading for the e1000 driver?? Thanks in advance for any tips!!! Sven From kuznet@ms2.inr.ac.ru Thu Nov 6 01:32:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 01:33:08 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA69W925030581 for ; Thu, 6 Nov 2003 01:32:29 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id MAA14771; Thu, 6 Nov 2003 12:31:28 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200311060931.MAA14771@yakov.inr.ac.ru> Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS To: cfriesen@nortelnetworks.com (Chris Friesen) Date: Thu, 6 Nov 2003 12:31:28 +0300 (MSK) Cc: davem@redhat.com (David S. Miller), jmorris@redhat.com, hadi@znyx.com, netdev@oss.sgi.com In-Reply-To: <3FA7DBB5.1090500@nortelnetworks.com> from "Chris Friesen" at Nov 04, 2003 12:02:45 PM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1250 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > If that were the case, I'd be happy. However, when you set the TOS bits > (which really sets the whole 8-bit field, rather than just the 4 TOS > bits), It was not our choice. :-) > the kernel also sets the socket priority but only uses the TOS > bits to do so. Look at straces of your telnet, ftp and ssh. You will understand why it is made and why it would be better not to change this. It affects local queuing in right way in default situation. > If we're going to set the whole 8-bit field, wouldn't it > make sense to use the priority bits to set the priority? There are no "priority" bits in this field. Priority is defined by outgoing device. > If root wants to send out a packet with particular DSCP settings, > doesn't it make sense to make that option available? It's a field in > the IP packet header, we should be able to set it with an IP option. IP_TOS. :-) I feel there is some misunderstanding about sk->priority thing. It is the lowest significance hint about priority, when no other classification is supplied. Read: when the node is dumb and is not aware about any such things. I would agree with you if this field had opposite priority: i.e. overrided all the system-wide settings. It does not. What's about VLAN thing, this approach enforces you to use DSCP directly and never use skb->priority (well, to be more exact, to use it when you have no another hints available: in this case our skb->priority is _right_ hint) Alexey From fleury@cs.auc.dk Thu Nov 6 02:27:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 02:28:02 -0800 (PST) Received: from mailhost.cs.auc.dk (root@mailhost.cs.auc.dk [130.225.194.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6ARP25031431 for ; Thu, 6 Nov 2003 02:27:26 -0800 Received: from rade7.s.cs.auc.dk (fleury@rade7.s.cs.auc.dk [192.168.194.153]) by mailhost.cs.auc.dk (8.12.10/8.12.10) with ESMTP id hA6AR2lN011841; Thu, 6 Nov 2003 11:27:03 +0100 (MET) Subject: Re: Announce: NetKeeper Firewall For Linux From: Emmanuel Fleury To: hadi@cyberus.ca Cc: "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, Mikkel Christiansen In-Reply-To: <1068089345.1020.17.camel@jzny.localdomain> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> <1068001237.1064.31.camel@jzny.localdomain> <1068046114.31636.92.camel@rade7.s.cs.auc.dk> <1068089345.1020.17.camel@jzny.localdomain> Content-Type: text/plain; charset=iso-8859-15 Organization: Aalborg University -- Computer Science Dept. Message-Id: <1068114376.1532.115.camel@rade7.s.cs.auc.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 06 Nov 2003 11:26:16 +0100 X-Scanned-By: MIMEDefang 2.14 X-MIME-Autoconverted: from 8bit to quoted-printable by mailhost.cs.auc.dk id hA6AR2lN011841 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hA6ARP25031431 X-archive-position: 1251 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fleury@cs.auc.dk Precedence: bulk X-list: netdev Hi, On Thu, 2003-11-06 at 04:29, jamal wrote: > > Yes, i think you missed my point ;-> Oops ! :) > You guys are doing a great job at coming up with some good packet > classification algorithm(s). I wanna encourage you to continue doing > that. > OTOH, I have spent a lot of time thinking and coming up with a good > architecture for the action part (that follows classification). So it > will be a shame if you miss that because you happened to see one > good thing in the old code. > Putting the two together will result in some good things. You trying to > redo what i am doing will mean you are always a few steps behind[1]. Now > if you can do it better than what i have, then you can convert me > too - thats the way opensource works. Ok, actually we were so focused on the classification scheme that we didn't really try to do something nice for the actions... In a matter of facts, we have only one action (log) and it is not even implemented. So, we will definitely look at your code to avoid us to have to think about this part (and avoid to have to recode the actions). > Anything that requires "connection setup" to dynamically add rules is a > candidate. Think Voip SIP Proxy server for example which will insert > rules; think any authentication schemes that are needed before > installing rules, think tcp-splicing etc. Ok, but you are speaking about non permanent rules (aka dynamic rules). The idea we have to handle stateful inspection is to have the core filter (totally static) plus some "state" nodes placed inside the IDD which are calling a function to evaluate the "state" of the packet (based on some informations given by the packet header and a database of the open connections). When reaching the terminals, one of the action can be to change the state of the connection. I guess that what you describe can be handled by such mechanism (better than changing the ruleset each time). As it is handled outside of the IDD, this take only the time of the look-up in the database and the time to modify the database (when necessary). But, I over simplified things here, this scheme is far from being ready at this point. We should investigate it more in depth (we need more time!!!). > I think thats a design issue. For example while u32 classifier may not > process as fast as you (lookups would take longer relatively ) - its > insertion time is independent of the complexity of the rules. > Lakshman (sp?) had a good paper on the tradeoffs between memory space > used, lookup times and insertion times (there was another variable) and > i think he may have proved you cant have all of them work well at the > same time. Ok. Could you give more details about the references of this paper from Lakshman ? > So if you add rule #50000 while there are already 49999 existing > it will take over an hour to install in the worst case, did i understand > this correctly? Yes (I messed up things in the following paragraph), you are totally right here. I totally forgot that you have to deal with rule-overlapping which is actually making things incredibly sequential). > > Of course your question was about taking one of this big filters and > > then add one tiny winy rule to it. So, I guess the time to do so would > > be at most 1s (in the very worst case, I would say). I am wrong here, terribly wrong. The thing is that is you add a rule at the end of your filter, you will not have to rebuild it, but inserting a rule randomly in the list is... bad. For now, we don't have any good algorithm to insert a rule, so we just rebuild the whole thing. > > When coding in the kernel, we are coding with the idea that: > > « The kernel should defend itself against user-space. » > > > > So, when the user say: "Commit". > > > > The kernel will first check the decision diagram for safety (no NULL > > pointers, out of range variables, no loops, etc) and depending of the > > tests, will take the decision to commit or not. > > That sounds more like still a user space problem ;-> No. Users shouldn't be able to break the kernel just by misconfiguring it. > I saw in your paper briefly that you have infact a checker for something > like this. If you are speaking about the "network access verifier", it is something totally different. But, I might have misunderstood you. > In my view the most important issues in priority order are: > lookup speed regardless of table size, insert/delete rate regardless of > table size, Capacity (should be able to go to the hundreds of thousands > of flows), memory use for storage purposes - although i dont really care > very much about these since memory is cheap these days. Ok, I think we have to work on the insert/delete part. I know for a fact that insert/delete inside the IDD is not an option (as the complexity of this operation is too high), so we will look at some other way to handle it. > > PS: I would like also to say here that we got a really great feed back > > from the nf-hipac team. So, thank a lot to Michael Bellion and Thomas > > Heinz. > > > > I am sorry i confused you with them;-> I suppose you are both from .dk. No, Michael and Thomas are from Germany. Mikkel Christiansen is from Denmark and I'm from France (working in Denmark currently). > [1]I briefly looked at your paper and it seems the only action you had > initially was DENY or ACCEPT. We can extend this without any problem. > Looking at your code you now have an action dispatcher that seems > to be exactly like the old one i have (you havent implemented code > around it but you have the hooks in place). This is why i made the > comment. Actually, as I said, we were just no so concerned about the handling of the actions, so we just did it in the most natural way (for us). It is a good sign that we are meeting your very first implementation. Regards -- Emmanuel Fleury Computer Science Department, | Office: B1-201 Aalborg University, | Phone: +45 96 35 72 23 Fredriks Bajersvej 7E, | Fax: +45 98 15 98 89 9220 Aalborg East, Denmark | Email: fleury@cs.auc.dk From sasha@mail.oktet.ru Thu Nov 6 03:56:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 03:56:54 -0800 (PST) Received: from mail.oktet.ru (mail.oktet.ru [193.125.193.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6Bu325001498 for ; Thu, 6 Nov 2003 03:56:17 -0800 Received: from mail.oktet.ru (localhost.localdomain [127.0.0.1]) by mail.oktet.ru (8.12.9/8.12.9) with ESMTP id hA6BtlUL021102; Thu, 6 Nov 2003 14:55:47 +0300 Received: (from sasha@localhost) by mail.oktet.ru (8.12.9/8.12.9/Submit) id hA6Btdmi021101; Thu, 6 Nov 2003 14:55:39 +0300 Date: Thu, 6 Nov 2003 14:55:38 +0300 From: "Alexandra N. Kossovsky" To: Francois Romieu Cc: linux-kernel@vger.kernel.org, ShuChen , netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: r8169 with big-endian (patch) Message-ID: <20031106145538.A21034@oktet.ru> References: <20031105104625.D26209@oktet.ru> <20031105193400.A12375@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20031105193400.A12375@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Wed, Nov 05, 2003 at 07:34:00PM +0100 X-archive-position: 1252 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sasha@oktet.ru Precedence: bulk X-list: netdev --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello. Here is next version of the patch, thanks to Francois Romieu. Best regards, Alexandra. -- Alexandra N. Kossovsky OKTET Ltd. http://www.oktet.ru/ 1 Ulianovskaya st., Petergof, St.Petersburg, 198904 Russia Phones: +7(812)428-43-84(work) +7(812)184-52-58(home) +7(812)956-42-86(mobile) mailto:sasha@oktet.ru --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169.diff" --- drivers/net/r8169.c.orig 2003-11-06 14:53:18.000000000 +0300 +++ drivers/net/r8169.c 2003-11-06 14:54:17.000000000 +0300 @@ -33,6 +33,11 @@ - Copy mc_filter setup code from 8139cp (includes an optimization, and avoids set_bit use) +VERSION 1.2.1 2003/11/04 + (C) OKTET Ltd. (www.oktet.ru) + Author Alexandra N. Kossovsky + - Replace bus_to_virt/virt_to_bus by pci_alloc_consistent. + - Insert cpu_to_le/le_to_cpu where it is necessary. */ #include @@ -45,7 +50,7 @@ #include -#define RTL8169_VERSION "1.2" +#define RTL8169_VERSION "1.2.1" #define MODULENAME "r8169" #define RTL8169_DRIVER_NAME MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION #define PFX MODULENAME ": " @@ -165,12 +170,6 @@ RxErr = 0x02, RxOK = 0x01, - /*RxStatusDesc */ - RxRES = 0x00200000, - RxCRC = 0x00080000, - RxRUNT = 0x00100000, - RxRWT = 0x00400000, - /*ChipCmdBits */ CmdReset = 0x10, CmdRxEnb = 0x08, @@ -251,10 +250,16 @@ "RTL-8169", 0x00, 0xff7e1880,},}; enum _DescStatusBit { - OWNbit = 0x80000000, - EORbit = 0x40000000, - FSbit = 0x20000000, - LSbit = 0x10000000, + OWNbit = __constant_cpu_to_le32(0x80000000), + EORbit = __constant_cpu_to_le32(0x40000000), + FSbit = __constant_cpu_to_le32(0x20000000), + LSbit = __constant_cpu_to_le32(0x10000000), + + /*RxStatusDesc */ + RxRES = __constant_cpu_to_le32(0x00200000), + RxCRC = __constant_cpu_to_le32(0x00080000), + RxRUNT = __constant_cpu_to_le32(0x00100000), + RxRWT = __constant_cpu_to_le32(0x00400000), }; struct TxDesc { @@ -280,17 +285,20 @@ unsigned long cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ unsigned long cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ unsigned long dirty_tx; - unsigned char *TxDescArrays; /* Index of Tx Descriptor buffer */ - unsigned char *RxDescArrays; /* Index of Rx Descriptor buffer */ struct TxDesc *TxDescArray; /* Index of 256-alignment Tx Descriptor buffer */ struct RxDesc *RxDescArray; /* Index of 256-alignment Rx Descriptor buffer */ + dma_addr_t TxDescDmaAddr; /* DMA address of TxDescArray */ + dma_addr_t RxDescDmaAddr; /* DMA address of RxDescArray */ unsigned char *RxBufferRings; /* Index of Rx Buffer */ unsigned char *RxBufferRing[NUM_RX_DESC]; /* Index of Rx Buffer array */ + dma_addr_t RxBufferDmas; /* DMA address of RxBufferRings */ + dma_addr_t RxBufferDma[NUM_RX_DESC]; /* DMA addresses of RxBufferRing */ struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ }; MODULE_AUTHOR("Realtek"); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); +MODULE_LICENSE("GPL"); MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); static int rtl8169_open(struct net_device *dev); @@ -654,8 +662,6 @@ { struct rtl8169_private *tp = dev->priv; int retval; - u8 diff; - u32 TxPhyAddr, RxPhyAddr; retval = request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); @@ -663,36 +669,37 @@ return retval; } - tp->TxDescArrays = - kmalloc(NUM_TX_DESC * sizeof (struct TxDesc) + 256, GFP_KERNEL); - // Tx Desscriptor needs 256 bytes alignment; - TxPhyAddr = virt_to_bus(tp->TxDescArrays); - diff = 256 - (TxPhyAddr - ((TxPhyAddr >> 8) << 8)); - TxPhyAddr += diff; - tp->TxDescArray = (struct TxDesc *) (tp->TxDescArrays + diff); - - tp->RxDescArrays = - kmalloc(NUM_RX_DESC * sizeof (struct RxDesc) + 256, GFP_KERNEL); - // Rx Desscriptor needs 256 bytes alignment; - RxPhyAddr = virt_to_bus(tp->RxDescArrays); - diff = 256 - (RxPhyAddr - ((RxPhyAddr >> 8) << 8)); - RxPhyAddr += diff; - tp->RxDescArray = (struct RxDesc *) (tp->RxDescArrays + diff); + tp->TxDescArray = (struct TxDesc *) + pci_alloc_consistent(tp->pci_dev, + NUM_TX_DESC * sizeof (struct TxDesc) + 256, + &tp->TxDescDmaAddr); + + tp->RxDescArray = (struct RxDesc *) + pci_alloc_consistent(tp->pci_dev, + NUM_RX_DESC * sizeof (struct RxDesc) + 256, + &tp->RxDescDmaAddr); - if (tp->TxDescArrays == NULL || tp->RxDescArrays == NULL) { + if (tp->TxDescArray == NULL || tp->RxDescArray == NULL) { printk(KERN_INFO "Allocate RxDescArray or TxDescArray failed\n"); free_irq(dev->irq, dev); - if (tp->TxDescArrays) - kfree(tp->TxDescArrays); - if (tp->RxDescArrays) - kfree(tp->RxDescArrays); + if (tp->TxDescArray) + pci_free_consistent(tp->pci_dev, + NUM_TX_DESC * sizeof (struct TxDesc) + 256, + tp->TxDescArray, tp->TxDescDmaAddr); + if (tp->RxDescArray) + pci_free_consistent(tp->pci_dev, + NUM_RX_DESC * sizeof (struct RxDesc) + 256, + tp->RxDescArray, tp->RxDescDmaAddr); return -ENOMEM; } - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); + tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); if (tp->RxBufferRings == NULL) { printk(KERN_INFO "Allocate RxBufferRing failed\n"); } + tp->RxBufferDmas = pci_map_single(tp->pci_dev, tp->RxBufferRings, + RX_BUF_SIZE * NUM_RX_DESC, + PCI_DMA_FROMDEVICE); rtl8169_init_ring(dev); rtl8169_hw_start(dev); @@ -733,13 +740,13 @@ /* Set DMA burst size and Interframe Gap Time */ RTL_W32(TxConfig, - (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << - TxInterFrameGapShift)); + (TX_DMA_BURST << TxDMAShift) | + (InterFrameGap << TxInterFrameGapShift)); tp->cur_rx = 0; - RTL_W32(TxDescStartAddr, virt_to_bus(tp->TxDescArray)); - RTL_W32(RxDescStartAddr, virt_to_bus(tp->RxDescArray)); + RTL_W32(TxDescStartAddr, tp->TxDescDmaAddr); + RTL_W32(RxDescStartAddr, tp->RxDescDmaAddr); RTL_W8(Cfg9346, Cfg9346_Lock); udelay(10); @@ -775,12 +782,17 @@ for (i = 0; i < NUM_RX_DESC; i++) { if (i == (NUM_RX_DESC - 1)) tp->RxDescArray[i].status = - (OWNbit | EORbit) + RX_BUF_SIZE; + (OWNbit | EORbit) | + __constant_cpu_to_le32(RX_BUF_SIZE); else - tp->RxDescArray[i].status = OWNbit + RX_BUF_SIZE; + tp->RxDescArray[i].status = OWNbit | + __constant_cpu_to_le32(RX_BUF_SIZE); tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]); - tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]); + tp->RxBufferDma[i] = + (dma_addr_t)((unsigned int)tp->RxBufferDmas + + i * RX_BUF_SIZE); + tp->RxDescArray[i].buf_addr = cpu_to_le32(tp->RxBufferDma[i]); } } @@ -842,15 +854,19 @@ if ((tp->TxDescArray[entry].status & OWNbit) == 0) { tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].buf_addr = virt_to_bus(skb->data); + tp->TxDescArray[entry].buf_addr = + cpu_to_le32(pci_map_single(tp->pci_dev, skb->data, + skb->len, PCI_DMA_TODEVICE)); if (entry != (NUM_TX_DESC - 1)) tp->TxDescArray[entry].status = - (OWNbit | FSbit | LSbit) | ((skb->len > ETH_ZLEN) ? - skb->len : ETH_ZLEN); + (OWNbit | FSbit | LSbit) | + cpu_to_le32((skb->len > ETH_ZLEN) ? + skb->len : ETH_ZLEN); else tp->TxDescArray[entry].status = (OWNbit | EORbit | FSbit | LSbit) | - ((skb->len > ETH_ZLEN) ? skb->len : ETH_ZLEN); + cpu_to_le32(((skb->len > ETH_ZLEN) ? + skb->len : ETH_ZLEN)); RTL_W8(TxPoll, 0x40); //set polling bit @@ -884,8 +900,14 @@ while (tx_left > 0) { if ((tp->TxDescArray[entry].status & OWNbit) == 0) { - dev_kfree_skb_irq(tp-> - Tx_skbuff[dirty_tx % NUM_TX_DESC]); + struct sk_buff *skb = + tp->Tx_skbuff[dirty_tx % NUM_TX_DESC]; + + pci_unmap_single(tp->pci_dev, + le32_to_cpu(tp->TxDescArray[entry]. + buf_addr), + skb->len, PCI_DMA_TODEVICE); + dev_kfree_skb_irq(skb); tp->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL; tp->stats.tx_packets++; dirty_tx++; @@ -926,12 +948,16 @@ tp->stats.rx_crc_errors++; } else { pkt_size = - (int) (tp->RxDescArray[cur_rx]. - status & 0x00001FFF) - 4; + (int) (le32_to_cpu(tp->RxDescArray[cur_rx]. + status) & 0x00001FFF) - 4; skb = dev_alloc_skb(pkt_size + 2); if (skb != NULL) { skb->dev = dev; skb_reserve(skb, 2); // 16 byte align the IP fields. // + pci_dma_sync_single(tp->pci_dev, + tp->RxBufferDmas, + RX_BUF_SIZE * NUM_RX_DESC, + PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, tp->RxBufferRing[cur_rx], pkt_size, 0); skb_put(skb, pkt_size); @@ -940,13 +966,15 @@ if (cur_rx == (NUM_RX_DESC - 1)) tp->RxDescArray[cur_rx].status = - (OWNbit | EORbit) + RX_BUF_SIZE; + (OWNbit | EORbit) | + __constant_cpu_to_le32(RX_BUF_SIZE); else tp->RxDescArray[cur_rx].status = - OWNbit + RX_BUF_SIZE; + OWNbit | + __constant_cpu_to_le32(RX_BUF_SIZE); tp->RxDescArray[cur_rx].buf_addr = - virt_to_bus(tp->RxBufferRing[cur_rx]); + cpu_to_le32(tp->RxBufferDma[cur_rx]); dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; @@ -1045,12 +1073,16 @@ free_irq(dev->irq, dev); rtl8169_tx_clear(tp); - kfree(tp->TxDescArrays); - kfree(tp->RxDescArrays); - tp->TxDescArrays = NULL; - tp->RxDescArrays = NULL; + pci_free_consistent(tp->pci_dev, + NUM_TX_DESC * sizeof (struct TxDesc) + 256, + tp->TxDescArray, tp->TxDescDmaAddr); + pci_free_consistent(tp->pci_dev, + NUM_RX_DESC * sizeof (struct RxDesc) + 256, + tp->RxDescArray, tp->RxDescDmaAddr); tp->TxDescArray = NULL; tp->RxDescArray = NULL; + pci_unmap_single(tp->pci_dev, tp->RxBufferDmas, + RX_BUF_SIZE * NUM_RX_DESC, PCI_DMA_FROMDEVICE); kfree(tp->RxBufferRings); for (i = 0; i < NUM_RX_DESC; i++) { tp->RxBufferRing[i] = NULL; --fUYQa+Pmc3FrFX/N-- From cfriesen@nortelnetworks.com Thu Nov 6 06:52:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 06:52:59 -0800 (PST) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6EqQ25008051 for ; Thu, 6 Nov 2003 06:52:27 -0800 Received: from zcard307.ca.nortel.com (zcard307.ca.nortel.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id hA6EpaA23579; Thu, 6 Nov 2003 09:51:36 -0500 (EST) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id WJGYASW9; Thu, 6 Nov 2003 09:51:36 -0500 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id WLB8QF9X; Thu, 6 Nov 2003 09:51:36 -0500 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 171A12E151; Thu, 6 Nov 2003 09:51:35 -0500 (EST) Message-ID: <3FAA5FF6.50509@nortelnetworks.com> Date: Thu, 06 Nov 2003 09:51:34 -0500 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru Cc: "David S. Miller" , jmorris@redhat.com, hadi@znyx.com, netdev@oss.sgi.com Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS References: <200311060931.MAA14771@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1253 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev kuznet@ms2.inr.ac.ru wrote: > What's about VLAN thing, this approach enforces you to use > DSCP directly and never use skb->priority (well, to be more exact, > to use it when you have no another hints available: in this case > our skb->priority is _right_ hint) Okay, maybe you can help me out then. I would like to send a vlan tagged packet, with vlan priority of x and DSCP field of (x<<5). What is the proper way to do this, if I should not be using skb->priority? Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From masterpe@xs4all.nl Thu Nov 6 08:55:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 08:56:22 -0800 (PST) Received: from smtpzilla3.xs4all.nl (smtpzilla3.xs4all.nl [194.109.127.139]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6Gth25012486 for ; Thu, 6 Nov 2003 08:55:44 -0800 Received: from lawbox.int.mpe.xs4all.nl (mpe.xs4all.nl [213.84.237.99]) by smtpzilla3.xs4all.nl (8.12.9/8.12.9) with ESMTP id hA6GtgS0065381 for ; Thu, 6 Nov 2003 17:55:42 +0100 (CET) Subject: New found issues with forcedeth From: Laurens To: netdev@oss.sgi.com In-Reply-To: <1068059045.3618.3.camel@lawbox.int.mpe.xs4all.nl> References: <1068059045.3618.3.camel@lawbox.int.mpe.xs4all.nl> Content-Type: text/plain Message-Id: <1068137741.3611.9.camel@lawbox.int.mpe.xs4all.nl> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 06 Nov 2003 17:55:41 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 1254 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: masterpe@xs4all.nl Precedence: bulk X-list: netdev Further testing revealed several other problems, let me first start with my specs: Kernel: Linux 2.6.0-test9-mm2 Distro: Gentoo Base System version 1.4.3.11 CPU: AMD Athlon(tm) XP 2700+ Disk: Maxtor 6Y120P0 Ethernet: nVidia Corporation nForce2 XFree86: 4.3.0 Monitor: Iiyama AS4314UT, TFT-Master Pro 17 Videocard: nVidia Corporation NV15DDR [GeForce2 Ti] Audio: Creative Labs SB Live! EMU10k1 Issues: - dhcpcd eth0 takes longer to load - emerge sync (gentoo update tool) hangs in the middle of updating (confirmed not to happen with nvnet) - modprobe segfaulted on "modprobe -r forcedeth" (note: eth0 was not active) On the good side: - nvnet seems to mess up my framebuffer, forcedeth does not :) Should you require more information just ask. good luck, Lawrence From kaber@trash.net Thu Nov 6 09:52:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 09:53:30 -0800 (PST) Received: from gw.localnet (port-212-202-185-245.reverse.qdsl-home.de [212.202.185.245]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6Hqt25014355 for ; Thu, 6 Nov 2003 09:52:56 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AHnpE-0000FU-00; Thu, 06 Nov 2003 18:21:40 +0100 Message-ID: <3FAA832A.6000505@trash.net> Date: Thu, 06 Nov 2003 18:21:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031024 Debian/1.5-2 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH]: fix skb_copy_expand offset calculation Content-Type: multipart/mixed; boundary="------------080502050700020003090802" X-archive-position: 1255 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080502050700020003090802 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi Dave, this patch fixes offset calculation in skb_copy_expand. head_copy_len = skb_headroom(skb); head_copy_off = 0; if (newheadroom < head_copy_len) { head_copy_off = head_copy_len - newheadroom; head_copy_len = newheadroom; } /* Copy the linear header and data. */ if (skb_copy_bits(skb, -head_copy_len, n->head + head_copy_off, skb->len + head_copy_len)) It looks like it is intended to copy as much as possible, cutting off bytes at the beginning is there is not enough room. For the case newheadroom < head_copy_len that means it needs to copy newheadroom bytes from skb->data - newheadroom to n->head, so head_copy_off needs to be 0. I don't know how the data copied is used later on but I assume it is intended to stay continous. That means in the case that newheadroom > skb_headroom(skb) we need to copy skb_headroom(skb) bytes to n->head + newheadroom - skb_headroom(skb), so head_copy_off becomes newheadroom - head_copy_len. In the patch the case newheadroom == skb_headroom(skb) is handled with the first condition to save either a jump or a subtraction. The patch is verified to fix the problem that led me to this, ipt_REJECT produced broken RSTs which triggered the "ipt_hook: happy cracking!" line in ip_conntrack_standalone.c. Best regards, Patrick --------------080502050700020003090802 Content-Type: text/plain; name="2.6-skb_copy_expand.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6-skb_copy_expand.diff" # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1413 -> 1.1414 # net/core/skbuff.c 1.32 -> 1.33 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/06 kaber@trash.net 1.1414 # Fix skb_copy_expand offset calculation # -------------------------------------------- # diff -Nru a/net/core/skbuff.c b/net/core/skbuff.c --- a/net/core/skbuff.c Thu Nov 6 17:34:55 2003 +++ b/net/core/skbuff.c Thu Nov 6 17:34:55 2003 @@ -595,10 +595,10 @@ head_copy_len = skb_headroom(skb); head_copy_off = 0; - if (newheadroom < head_copy_len) { - head_copy_off = head_copy_len - newheadroom; + if (newheadroom <= head_copy_len) head_copy_len = newheadroom; - } + else + head_copy_off = newheadroom - head_copy_len; /* Copy the linear header and data. */ if (skb_copy_bits(skb, -head_copy_len, n->head + head_copy_off, --------------080502050700020003090802-- From kumarkr@us.ibm.com Thu Nov 6 11:59:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 12:00:18 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6Jxc25019173 for ; Thu, 6 Nov 2003 11:59:44 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA6JxPcF256458; Thu, 6 Nov 2003 14:59:25 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA6JxOJC167838; Thu, 6 Nov 2003 12:59:24 -0700 Subject: Re: [PATCH] panic during unregister_netdevice() To: Stephen Hemminger Cc: davem@redhat.com, krkumar@us.ibm.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Thu, 6 Nov 2003 11:58:24 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/06/2003 12:59:24 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1256 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev Actually, even the original code looks good, and if that panic'd, the following won't change that (verified it also). When unregister_netdev() is called by the driver, it first calls unregister_netdevice() which drops it's last ref to the dev, making it zero. unregister_netdev() then calls rtnl_unlock() which calls netdev_run_todo(), which calls netdev_wait_allrefs() and only after that succeeds, does the driver do a free_netdev(). So the dev should not be freed while the wait_ref() is executing, and the original code looks correct. I don't know if it is some corruption on my system, some hardware problem ? I will look some more, also try to get a different machine. - KK |---------+----------------------------> | | Stephen Hemminger| | | | | | Sent by: | | | netdev-bounce@oss| | | .sgi.com | | | | | | | | | 11/05/2003 05:09 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: Krishna Kumar/Beaverton/IBM@IBMUS | | cc: davem@redhat.com, krkumar@us.ltcfwd.linux.ibm.com, netdev@oss.sgi.com | | Subject: Re: [PATCH] panic during unregister_netdevice() | | | >-----------------------------------------------------------------------------------------------------------------| Try this. Instead of dropping the last reference in unregister, it does it after all other references are gone (sort of like the old 2.4 code). diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Wed Nov 5 17:04:57 2003 +++ b/net/core/dev.c Wed Nov 5 17:04:57 2003 @@ -2743,7 +2743,7 @@ unsigned long rebroadcast_time, warning_time; rebroadcast_time = warning_time = jiffies; - while (atomic_read(&dev->refcnt) != 0) { + while (atomic_read(&dev->refcnt) > 1) { if (time_after(jiffies, rebroadcast_time + 1 * HZ)) { rtnl_shlock(); rtnl_exlock(); @@ -2838,6 +2838,7 @@ dev->reg_state = NETREG_UNREGISTERED; netdev_wait_allrefs(dev); + dev_put(dev); /* paranoia */ BUG_ON(atomic_read(&dev->refcnt)); @@ -2974,7 +2975,6 @@ /* Finish processing unregister after unlock */ net_set_todo(dev); - dev_put(dev); return 0; } From davem@pizda.ninka.net Thu Nov 6 12:05:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 12:06:25 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6K5d25019642 for ; Thu, 6 Nov 2003 12:05:51 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA21388; Thu, 6 Nov 2003 11:59:36 -0800 Date: Thu, 6 Nov 2003 11:59:35 -0800 From: "David S. Miller" To: Krishna Kumar Cc: shemminger@osdl.org, krkumar@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031106115935.0cd56745.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1257 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 6 Nov 2003 11:58:24 -0800 Krishna Kumar wrote: > When unregister_netdev() is called by the driver, it first calls > unregister_netdevice() which > drops it's last ref to the dev, making it zero. unregister_netdev() then > calls rtnl_unlock() which > calls netdev_run_todo(), which calls netdev_wait_allrefs() and only after > that succeeds, > does the driver do a free_netdev(). So the dev should not be freed while > the wait_ref() is > executing, and the original code looks correct. That's correct. > I don't know if it is some corruption on my system, some hardware problem ? > I will look > some more, also try to get a different machine. It could be some 'user after free' or similar issue. Just an idea of something else to look for. My earlier comments about "putting to zero multiple times" were misguided, I forgot that these days dev_put() just decrements the count and does not do anything special when the count reaches zero. From davem@pizda.ninka.net Thu Nov 6 12:25:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 12:26:02 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6KPS25023260 for ; Thu, 6 Nov 2003 12:25:28 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA21548; Thu, 6 Nov 2003 12:20:11 -0800 Date: Thu, 6 Nov 2003 12:20:11 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH]: fix skb_copy_expand offset calculation Message-Id: <20031106122011.49d18674.davem@redhat.com> In-Reply-To: <3FAA832A.6000505@trash.net> References: <3FAA832A.6000505@trash.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1258 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 06 Nov 2003 18:21:46 +0100 Patrick McHardy wrote: > The patch is verified to fix the problem that led me to this, ipt_REJECT > produced broken RSTs which triggered the "ipt_hook: happy cracking!" > line in ip_conntrack_standalone.c. Great work Patrick, your analysis and fix is definitely correct. Patch applied, thanks. From davem@pizda.ninka.net Thu Nov 6 12:52:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 12:52:51 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6KqE25024023 for ; Thu, 6 Nov 2003 12:52:17 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA21675; Thu, 6 Nov 2003 12:46:59 -0800 Date: Thu, 6 Nov 2003 12:46:59 -0800 From: "David S. Miller" To: Ben Greear Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 802.1q vlan updates Message-Id: <20031106124659.109c0d5c.davem@redhat.com> In-Reply-To: <3FA9CD0B.8000707@candelatech.com> References: <3FA9CD0B.8000707@candelatech.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1259 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 05 Nov 2003 20:24:43 -0800 Ben Greear wrote: > Here is a patch that is a cleaned up version of something I sent > a while back. This adds the ability to query a device to see if > it is a vlan device by asking for the vlan's parent device. > One can deduce that a querried interface is not a VLAN by looking > at the IOCTL error code. > > Patch is against 2.4.22-pre9, compile tested and extracted from a run-time > tested patch. I'll push this to Marcelo for 2.4.24, thanks. If you could cook up and test a 2.6.x version, I'll push that in for 2.6.1 From greearb@candelatech.com Thu Nov 6 13:01:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 13:01:34 -0800 (PST) Received: from grok.yi.org (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6L1025024474 for ; Thu, 6 Nov 2003 13:01:01 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hA6L0sQN002798; Thu, 6 Nov 2003 13:00:55 -0800 Message-ID: <3FAAB686.1090004@candelatech.com> Date: Thu, 06 Nov 2003 13:00:54 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: [PATCH] 802.1q vlan updates References: <3FA9CD0B.8000707@candelatech.com> <20031106124659.109c0d5c.davem@redhat.com> In-Reply-To: <20031106124659.109c0d5c.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1260 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Wed, 05 Nov 2003 20:24:43 -0800 > Ben Greear wrote: > > >>Here is a patch that is a cleaned up version of something I sent >>a while back. This adds the ability to query a device to see if >>it is a vlan device by asking for the vlan's parent device. >>One can deduce that a querried interface is not a VLAN by looking >>at the IOCTL error code. >> >>Patch is against 2.4.22-pre9, compile tested and extracted from a run-time >>tested patch. > > > I'll push this to Marcelo for 2.4.24, thanks. > > If you could cook up and test a 2.6.x version, I'll push that in > for 2.6.1 I have yet to start using 2.6, but I'll get a test system up as soon as 2.6.0 comes out and will send a patch shortly there-after. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From krkumar@us.ibm.com Thu Nov 6 13:10:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 13:11:19 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6LAV25025331 for ; Thu, 6 Nov 2003 13:10:44 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA6LAJIw232736; Thu, 6 Nov 2003 16:10:19 -0500 Received: from DYN318430BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA6LAFJD156620; Thu, 6 Nov 2003 14:10:16 -0700 Date: Thu, 6 Nov 2003 13:07:57 -0800 (PST) From: Krishna Kumar X-X-Sender: krkumar@DYN318430BLD.beaverton.ibm.com To: "David S. Miller" cc: Krishna Kumar , , Subject: Re: [PATCH] panic during unregister_netdevice() In-Reply-To: <20031106115935.0cd56745.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1261 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev I think I found the problem in the link event code. linkwatch_event() calls rtnl_unlock() when it gets an event (UNREGISTER) for the device going down. But this gets called before the device unregister gets called, via the rmmod/pci_device_remove), and frees up the dev. Later the device unregister code panics the system. I also noticed that this panic happens for e100 but not for the 3com driver. 3com doesn't generate events for up/down using the linkwatch. I tested with the following patch, and the panic disappeared (the device shutdown properly). Dave, any need for rtnl_unlock() in this code ? Thanks, - KK diff -ruN linux-2.6.0-test9-bk9/net/core/link_watch.c linux-2.6.0-test9-bk9.new/net/core/link_watch.c --- linux-2.6.0-test9-bk9/net/core/link_watch.c 2003-11-06 12:26:30.000000000 -0800 +++ linux-2.6.0-test9-bk9.new/net/core/link_watch.c 2003-11-06 12:25:41.000000000 -0800 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -89,9 +90,11 @@ linkwatch_nextevent = jiffies + HZ; clear_bit(LW_RUNNING, &linkwatch_flags); - rtnl_lock(); + rtnl_shlock(); + rtnl_exlock(); linkwatch_run_queue(); - rtnl_unlock(); + rtnl_exunlock(); + rtnl_shunlock(); } On Thu, 6 Nov 2003, David S. Miller wrote: > On Thu, 6 Nov 2003 11:58:24 -0800 > Krishna Kumar wrote: > > > When unregister_netdev() is called by the driver, it first calls > > unregister_netdevice() which > > drops it's last ref to the dev, making it zero. unregister_netdev() then > > calls rtnl_unlock() which > > calls netdev_run_todo(), which calls netdev_wait_allrefs() and only after > > that succeeds, > > does the driver do a free_netdev(). So the dev should not be freed while > > the wait_ref() is > > executing, and the original code looks correct. > > That's correct. > > > I don't know if it is some corruption on my system, some hardware problem ? > > I will look > > some more, also try to get a different machine. > > It could be some 'user after free' or similar issue. > Just an idea of something else to look for. > > My earlier comments about "putting to zero multiple times" were > misguided, I forgot that these days dev_put() just decrements the > count and does not do anything special when the count reaches zero. > > From davem@pizda.ninka.net Thu Nov 6 13:20:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 13:21:12 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6LKH25026121 for ; Thu, 6 Nov 2003 13:20:37 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA21779; Thu, 6 Nov 2003 13:14:57 -0800 Date: Thu, 6 Nov 2003 13:14:57 -0800 From: "David S. Miller" To: Krishna Kumar Cc: kumarkr@us.ibm.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] panic during unregister_netdevice() Message-Id: <20031106131457.384694a5.davem@redhat.com> In-Reply-To: References: <20031106115935.0cd56745.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1262 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 6 Nov 2003 13:07:57 -0800 (PST) Krishna Kumar wrote: > I tested with the following patch, and the panic disappeared (the > device shutdown properly). Dave, any need for rtnl_unlock() in this > code ? This linkwatch code never generates new entries on the netdev todo list so your patch looks fine. I'm going to apply it, thanks a lot. From charles@bueche.ch Thu Nov 6 14:02:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Nov 2003 14:03:33 -0800 (PST) Received: from james.netnea.com (ns1.netnea.com [138.189.116.70]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA6M2u25028464 for ; Thu, 6 Nov 2003 14:02:58 -0800 Received: from bluez.bueche.ch (adsl-212-101-16-88.solnet.ch [212.101.16.88]) by james.netnea.com (8.12.10+Sun/8.12.2) with ESMTP id hA6M2l9k007238; Thu, 6 Nov 2003 23:02:47 +0100 (MET) Received: from localhost.solnet.ch (localhost [127.0.0.1]) by bluez.bueche.ch (Postfix) with ESMTP id 241CA143FC; Thu, 6 Nov 2003 23:02:44 +0100 (MET) Subject: Re: changing MTU on b44 breaks eth0 From: Charles Bueche To: Pekka Pietikainen Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20031104111555.GA26860@ee.oulu.fi> References: <1067888106.3366.20.camel@bluez.bueche.ch> <20031103205335.GA7668@ee.oulu.fi> <20031103151618.79704b30.davem@redhat.com> <20031104111555.GA26860@ee.oulu.fi> Content-Type: text/plain Message-Id: <1068156163.3496.8.camel@bluez.bueche.ch> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 06 Nov 2003 23:02:44 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 1263 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: charles@bueche.ch Precedence: bulk X-list: netdev Hi all, sorry for the late answer. I tried to apply the patch mentionned below, and it reject at Hunk #1. I run linux 2.4.22, my b44.c carry version 0.9. Can you please send me the full b44.c file so I can try again ? I'm a bit unsure wheter I should try anyway, your discussions are not very understable to me. Pardon my ignorance of kernel dumps :-) I would be very happy if I could simply recompile this particular module, and not my full kernel after patching a single file. Is there a way to find the commands originaly used to compile and link this module from some logs ? Regards, Charles On Tue, 2003-11-04 at 12:15, Pekka Pietikainen wrote: > On Mon, Nov 03, 2003 at 03:16:18PM -0800, David S. Miller wrote: > > I think Jeff should merge this upstrea, but I really disagree > > with the CONFIG_PM ifdefs for the power-management support. > Fine with me (patch with CONFIG_PM removed included) > > Oh btw., when trying out whether the new code even compiles/loads > I got the following in rmmod, does it look like something caused > by generic code or should I look for a reason in b44? :-) > (This is 2.6.0-test9-bk6). > > kernel BUG at net/core/dev.c:2882! > invalid operand: 0000 [#1] > CPU: 0 > EIP: 0060:[] Tainted: P > EFLAGS: 00010297 > EIP is at free_netdev+0x2d/0x40 > eax: ddfd6800 ebx: ddfd6800 ecx: 1f2e9da0 edx: 00000003 > esi: dff5d000 edi: dff5d054 ebp: de743ec4 esp: de743ec4 > ds: 007b es: 007b ss: 0068 > Process rmmod (pid: 18966, threadinfo=de742000 task=c797b320) > Stack: de743edc e090011d ddfd6800 dff5d000 e0902544 00000000 de743eec > c01c8c09 > dff5d000 dff5d054 de743f04 c0210dd0 dff5d054 dff5d080 e0902590 > e0902590 > de743f18 c0210e02 dff5d054 e0902544 c02fb458 de743f2c c0211039 > e0902544 > Call Trace: > [] b44_remove_one+0x3d/0x60 [b44] > [] pci_device_remove+0x39/0x40 > [] device_release_driver+0x60/0x70 > [] driver_detach+0x22/0x40 > [] bus_remove_driver+0x39/0x70 > [] driver_unregister+0x14/0x26 > [] pci_unregister_driver+0x17/0x30 > [] b44_cleanup+0x12/0x14 [b44] > [] sys_delete_module+0x113/0x190 > [] do_munmap+0x14f/0x1b0 > [] sys_munmap+0x43/0x60 > [] sysenter_past_esp+0x52/0x71 > > Code: 0f 0b 42 0b ab 48 2e c0 eb de c9 e9 93 6e ef ff 8d 76 00 55 > > Trying to reproduce on a fresh non-nvidia-tainted -bk8 rmmod initially worked, > then I did /sbin/modprobe b44; /sbin/ifup eth0; /sbin/rmmod b44 > managed to trigger another race: > > eth0: no IPv6 routers present > Unable to handle kernel paging request at virtual address 706647ef > printing eip: > c0254415 > *pde = 00000000 > Oops: 0000 [#1] > CPU: 0 > EIP: 0060:[] Not tainted > EFLAGS: 00010216 > EIP is at rtnetlink_fill_ifinfo+0x2a5/0x480 > eax: 706647e3 ebx: df037800 ecx: 00000ee4 edx: c68fa09c > esi: 00000000 edi: df037805 ebp: dff8deb4 esp: dff8de88 > ds: 007b es: 007b ss: 0068 > Process events/0 (pid: 3, threadinfo=dff8c000 task=c151cc80) > Stack: c689fd80 00000004 00000004 dff8dea4 00000ee4 00000f60 c68fa000 > 000005dc > c689fd80 ffffffff 00000011 dff8dee4 c02548ac c689fd80 df037800 > 00000011 > 00000000 00000000 ffffffff df037800 c0335c00 df037800 00000006 > dff8def8 > Call Trace: > [] rtmsg_ifinfo+0x5c/0xd0 > [] rtnetlink_event+0x35/0x62 > [] notifier_call_chain+0x2d/0x50 > [] netdev_wait_allrefs+0xc0/0x110 > [] netdev_run_todo+0x10c/0x1f0 > [] __down_failed+0xb/0x14 > [] worker_thread+0x1bb/0x2a0 > [] linkwatch_event+0x0/0x30 > [] default_wake_function+0x0/0x30 > [] ret_from_fork+0x6/0x14 > [] default_wake_function+0x0/0x30 > [] worker_thread+0x0/0x2a0 > [] kernel_thread_helper+0x5/0xc > > Code: 8b 50 0c b9 ff ff ff ff 31 c0 83 c2 08 89 d7 f2 ae f7 d1 49 > > --- /usr/src/linux-2.6.0-0.test9.1.67/drivers/net/b44.c 2003-10-25 21:43:30.000000000 +0300 > +++ linux-2.6.0-test9/drivers/net/b44.c 2003-11-04 12:32:13.403426192 +0200 > @@ -25,8 +25,8 @@ > > #define DRV_MODULE_NAME "b44" > #define PFX DRV_MODULE_NAME ": " > -#define DRV_MODULE_VERSION "0.91" > -#define DRV_MODULE_RELDATE "Oct 3, 2003" > +#define DRV_MODULE_VERSION "0.92" > +#define DRV_MODULE_RELDATE "Nov 4, 2003" > > #define B44_DEF_MSG_ENABLE \ > (NETIF_MSG_DRV | \ > @@ -942,6 +942,8 @@ > b44_init_hw(bp); > spin_unlock_irq(&bp->lock); > > + b44_enable_ints(bp); > + > return 0; > } > > @@ -1558,6 +1560,8 @@ > netif_wake_queue(bp->dev); > spin_unlock_irq(&bp->lock); > > + b44_enable_ints(bp); > + > return 0; > } > case ETHTOOL_GPAUSEPARAM: { > @@ -1601,6 +1605,8 @@ > } > spin_unlock_irq(&bp->lock); > > + b44_enable_ints(bp); > + > return 0; > } > }; > @@ -1852,11 +1858,53 @@ > } > } > > +static int b44_suspend(struct pci_dev *pdev, u32 state) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + struct b44 *bp = dev->priv; > + > + if (!netif_running(dev)) > + return 0; > + > + del_timer_sync(&bp->timer); > + > + spin_lock_irq(&bp->lock); > + > + b44_halt(bp); > + netif_carrier_off(bp->dev); > + netif_device_detach(bp->dev); > + b44_free_rings(bp); > + > + spin_unlock_irq(&bp->lock); > + return 0; > +} > + > +static int b44_resume(struct pci_dev *pdev) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + struct b44 *bp = dev->priv; > + > + if (!netif_running(dev)) > + return 0; > + > + spin_lock_irq(&bp->lock); > + > + b44_init_rings(bp); > + b44_init_hw(bp); > + netif_device_attach(bp->dev); > + spin_unlock_irq(&bp->lock); > + > + b44_enable_ints(bp); > + return 0; > +} > + > static struct pci_driver b44_driver = { > .name = DRV_MODULE_NAME, > .id_table = b44_pci_tbl, > .probe = b44_init_one, > .remove = __devexit_p(b44_remove_one), > + .suspend = b44_suspend, > + .resume = b44_resume, > }; > > static int __init b44_init(void) -- Charles Bueche sand, snow, wave, wind and net -surfer From fdonzet@yahoo.fr Fri Nov 7 00:38:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 00:39:17 -0800 (PST) Received: from web25202.mail.ukl.yahoo.com (web25202.mail.ukl.yahoo.com [217.12.10.62]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA78co25006908 for ; Fri, 7 Nov 2003 00:38:51 -0800 Message-ID: <20031107083844.74787.qmail@web25202.mail.ukl.yahoo.com> Received: from [195.68.44.148] by web25202.mail.ukl.yahoo.com via HTTP; Fri, 07 Nov 2003 09:38:44 CET Date: Fri, 7 Nov 2003 09:38:44 +0100 (CET) From: =?iso-8859-1?q?francois=20donzet?= Subject: problem in driver network code To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1264 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fdonzet@yahoo.fr Precedence: bulk X-list: netdev Hi all I am writing my own ethernet driver, and i have a little question on checksum offloading : I am trying to understand the role of skb->csum. I've read some code, and see that it is filled (for example in e100 code) by the sum of all words excepting the ethernet II header. The fact is, on an input path, if CHECKSUM_HW is set, TCP uses skb->csum to verify the complete checksum (adding the pseudo header one). It seems to me that there is a problem ;). If i store in skb->csum a sum of all words of the packet data, it will be unusable by tcp (the skb->csum doesn't contain the checksum of tcpheader plus data only, as the ipheader is part of the packet when the sum is computed) What do i miss ? I think the skb->csum MUST at one point contain only a sum on tcpheader+data. ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From hadi@cyberus.ca Fri Nov 7 05:28:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 05:28:41 -0800 (PST) Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA7DSO25021508 for ; Fri, 7 Nov 2003 05:28:24 -0800 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AI6f0-0006LJ-6J; Fri, 07 Nov 2003 08:28:22 -0500 Subject: Re: Announce: NetKeeper Firewall For Linux From: jamal Reply-To: hadi@cyberus.ca To: Emmanuel Fleury Cc: "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, Mikkel Christiansen In-Reply-To: <1068114376.1532.115.camel@rade7.s.cs.auc.dk> References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> <1068001237.1064.31.camel@jzny.localdomain> <1068046114.31636.92.camel@rade7.s.cs.auc.dk> <1068089345.1020.17.camel@jzny.localdomain> <1068114376.1532.115.camel@rade7.s.cs.auc.dk> Content-Type: text/plain; charset=ISO-8859-1 Organization: jamalopolis Message-Id: <1068211670.1031.49.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 07 Nov 2003 08:27:50 -0500 Content-Transfer-Encoding: 8bit X-archive-position: 1265 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Thu, 2003-11-06 at 05:26, Emmanuel Fleury wrote: > Ok, actually we were so focused on the classification scheme that we > didn't really try to do something nice for the actions... In a matter of > facts, we have only one action (log) and it is not even implemented. > > So, we will definitely look at your code to avoid us to have to think > about this part (and avoid to have to recode the actions). > I am asking you to switch to the TC code. I dont think i am making my point across ;->[1]. Integrate your classifer like any other tc classifier and then you dont have to look at my code unless you really want to. > > Anything that requires "connection setup" to dynamically add rules is a > > candidate. Think Voip SIP Proxy server for example which will insert > > rules; think any authentication schemes that are needed before > > installing rules, think tcp-splicing etc. > > Ok, but you are speaking about non permanent rules (aka dynamic rules). > These types are most dominant these days in my opinion unless you are a single user behind a DSL line. > The idea we have to handle stateful inspection is to have the core > filter (totally static) plus some "state" nodes placed inside the IDD > which are calling a function to evaluate the "state" of the packet > (based on some informations given by the packet header and a database of > the open connections). Isnt the state database another classifier and therefore you will be faced with the same challenges for it? I dont think you wuill get a free ride putting the state lookups somewhere else. > When reaching the terminals, one of the action > can be to change the state of the connection. tc allows you to have multiple cascaded classifiers; so you could "reclassify" and jump to a state classifier. I think the other guys from .dk also had their own scheme of achieving the same goal. Being able to do this in my opinion is architecturally cleaner. > I guess that what you describe can be handled by such mechanism > (better than changing the ruleset each time). As it is handled outside > of the IDD, this take only the time of the look-up in the database and > the time to modify the database (when necessary). > This is true if you consider the state database to be a different problem other than a classification one. > But, I over simplified things here, this scheme is far from being ready > at this point. We should investigate it more in depth (we need more > time!!!). > no problem. > > I think thats a design issue. For example while u32 classifier may not > > process as fast as you (lookups would take longer relatively ) - its > > insertion time is independent of the complexity of the rules. > > Lakshman (sp?) had a good paper on the tradeoffs between memory space > > used, lookup times and insertion times (there was another variable) and > > i think he may have proved you cant have all of them work well at the > > same time. > > Ok. Could you give more details about the references of this paper from > Lakshman ? > You are in academia, you better make sure you are aware of these things ;-> The Lakshman paper describes an algorithm but i remember it was the first to introduce classification constraints: T.V.Lakshman and D.Stiliadis. High Speed Policy-based Packet Forwarding Using Efficient Multi-dimensional Range Matching. Proceedings of ACM Sigcomm98 Another good paper to look at is: A.Feldmann and S.Muthukrishnan. Tradeoffs for packet classification. Proceedings of IEEE Infocom2000 > I am wrong here, terribly wrong. The thing is that is you add a rule at > the end of your filter, you will not have to rebuild it, but inserting a > rule randomly in the list is... bad. For now, we don't have any good > algorithm to insert a rule, so we just rebuild the whole thing. > Then you have some work to do > > > When coding in the kernel, we are coding with the idea that: > > > « The kernel should defend itself against user-space. » > > > > > > So, when the user say: "Commit". > > > > > > The kernel will first check the decision diagram for safety (no NULL > > > pointers, out of range variables, no loops, etc) and depending of the > > > tests, will take the decision to commit or not. > > > > That sounds more like still a user space problem ;-> > > No. > > Users shouldn't be able to break the kernel just by misconfiguring it. > Couldnt you, knowing the rules already existing check for breakage in user space? > > I saw in your paper briefly that you have infact a checker for something > > like this. > > If you are speaking about the "network access verifier", it is something > totally different. But, I might have misunderstood you. > I meant that network access verifier. I believe you should be able to verify things not only just in user space bu even in a remote location (example a network management station). Now this stuff is interesting. > > In my view the most important issues in priority order are: > > lookup speed regardless of table size, insert/delete rate regardless of > > table size, Capacity (should be able to go to the hundreds of thousands > > of flows), memory use for storage purposes - although i dont really care > > very much about these since memory is cheap these days. > > Ok, I think we have to work on the insert/delete part. I know for a fact > that insert/delete inside the IDD is not an option (as the complexity of > this operation is too high), so we will look at some other way to handle > it. > cool. Looking forward to see some of your thoughts on this when you have experienced it. cheers, jamal [1] Look at your action code dispatch name and my old one and note the name being _exactly_ the same. I dont think it is a big coincidence and i dont think you had any bad intent. I am just saying you can continue doing that or you can integrate. Why dont we drop this part of the discussion if you dont wanna move forward to the tc code? I thought you agreed with Dave to integrate ;-> From rask@sygehus.dk Fri Nov 7 09:17:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 09:17:32 -0800 (PST) Received: from 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (0x50a41c03.albnxx15.adsl-dhcp.tele.dk [80.164.28.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA7HHE25025248 for ; Fri, 7 Nov 2003 09:17:15 -0800 Received: by 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 883EB2C69D; Fri, 7 Nov 2003 18:15:13 +0100 (CET) Date: Fri, 7 Nov 2003 18:15:12 +0100 From: Rask Ingemann Lambertsen To: francois donzet Cc: netdev@oss.sgi.com Subject: Re: problem in driver network code Message-ID: <20031107181508.A1102@sygehus.dk> References: <20031107083844.74787.qmail@web25202.mail.ukl.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031107083844.74787.qmail@web25202.mail.ukl.yahoo.com>; from fdonzet@yahoo.fr on Fri, Nov 07, 2003 at 09:38:44AM +0100 X-archive-position: 1266 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev On Fri, Nov 07, 2003 at 09:38:44AM +0100, francois donzet wrote: > > It seems to me that there is a problem ;). If i store > in skb->csum a sum of all words of the packet data, it > will be unusable by tcp (the skb->csum doesn't > contain the checksum of tcpheader plus data only, as > the ipheader is part of the packet when the sum is > computed) That can be accounted for by the TCP code because the IP header is known to the TCP code. IIRC, the pseudoheader is similiar to a real IP header, so it may take just a few lines of code to make up for the difference, but I haven't checked that. What do you do with an IEEE 802.1q (VLAN) or 802.2 (LLC) packet? The VLAN code in vlan_skb_recv() does not adjust skb->csum or skb->ip_summed. Neither does the 802.2 code. -- Regards, Rask Ingemann Lambertsen From krkumar@us.ibm.com Fri Nov 7 11:04:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 11:04:24 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA7J4325027470 for ; Fri, 7 Nov 2003 11:04:09 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hA7J3vcF452612; Fri, 7 Nov 2003 14:03:57 -0500 Received: from [9.47.18.241] (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hA7J3tZ9324764; Fri, 7 Nov 2003 12:03:56 -0700 Date: Fri, 7 Nov 2003 11:01:41 -0800 (PST) From: Krishna Kumar X-X-Sender: krkumar@linux.local To: "David S. Miller" cc: netdev@oss.sgi.com, Subject: [PATCH] Hang in downing interface with IPv6 PRIVACY In-Reply-To: <20031106115935.0cd56745.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1267 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev While using PRIVACY extensions, I sometimes get a hang when I remove the interface. But I can reproduce this every time using the test script at the end of the mail (hang depends on the order of address deletion). The bug is in ipv6_del_addr() where if a temp address is being deleted, it does an __in6_ifa_put() of the main address from which it was derived (basically the autoconf prefix address). So if the main address was deleted first, it's ifp ref count would be 1 and it would 'wait' to be freed till it's temp address was freed first. When the temp address is deleted, the __put() routine drops the main address's ifp ref count to 0, but not free it. unregister_netdevice() hangs giving message that ref count is 1. Fix tested overnight. Also, the code at the top of the routine is unnecessary, the same is being done when the address is found a little later in that routine. Thanks, - KK -------------------------- PATCH ----------------------------------------- diff -ruN linux-2.6.0-test9-bk9/net/ipv6/addrconf.c linux-2.6.0-test9-bk9.new/net/ipv6/addrconf.c --- linux-2.6.0-test9-bk9/net/ipv6/addrconf.c 2003-11-07 10:56:42.000000000 -0800 +++ linux-2.6.0-test9-bk9.new/net/ipv6/addrconf.c 2003-11-07 10:56:50.000000000 -0800 @@ -571,15 +571,6 @@ ifp->dead = 1; -#ifdef CONFIG_IPV6_PRIVACY - spin_lock_bh(&ifp->lock); - if (ifp->ifpub) { - __in6_ifa_put(ifp->ifpub); - ifp->ifpub = NULL; - } - spin_unlock_bh(&ifp->lock); -#endif - write_lock_bh(&addrconf_hash_lock); for (ifap = &inet6_addr_lst[hash]; (ifa=*ifap) != NULL; ifap = &ifa->lst_next) { @@ -600,7 +591,7 @@ if (ifa == ifp) { *ifap = ifa->tmp_next; if (ifp->ifpub) { - __in6_ifa_put(ifp->ifpub); + in6_ifa_put(ifp->ifpub); ifp->ifpub = NULL; } __in6_ifa_put(ifp); ----------------------- TEST PROGRAM ------------------------------------ insmod /lib/modules/2.6.0-test9-bk9/kernel/drivers/net/e100/e100.ko ifup eth0 # enable privacy address creation echo 1 > /proc/sys/net/ipv6/conf/eth0/use_tempaddr # set router, get autoconf/privacy addresses echo 1 > /proc/sys/net/ipv6/conf/all/forwarding radvd echo 0 > /proc/sys/net/ipv6/conf/all/forwarding # wait for radvd to configure interface addresses sleep 10 # kill radvd (paranoia) kill `ps -ef|grep radvd|grep -v grep|awk '{print $2}'` # delete last regular address first! (happens to be regular :-) ifconfig eth0 del `ifconfig eth0 | grep Site | tail -1 | awk '{print $3}'` # now delete all other addresses. bug happens here when the temp address # is deleted, it doesn't free the regular addresses 'ifp'. for i in `ifconfig eth0 | grep Site | awk '{print $3}'` do ifconfig eth0 del $i done ifdown eth0 rmmod e100 From steiner@sgi.com Fri Nov 7 14:37:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 14:37:50 -0800 (PST) Received: from tolkor.sgi.com (tolkor.sgi.com [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA7Mba25000800 for ; Fri, 7 Nov 2003 14:37:36 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hA7Mv7Hc003189 for ; Fri, 7 Nov 2003 16:57:07 -0600 Received: from thistle-e236.americas.sgi.com (thistle-e236.americas.sgi.com [128.162.236.204]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hA7MbUP513415548 for ; Fri, 7 Nov 2003 16:37:30 -0600 (CST) Received: from attica.americas.sgi.com (attica.americas.sgi.com [128.162.236.44]) by thistle-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hA7MbT0L22539445 for ; Fri, 7 Nov 2003 16:37:29 -0600 (CST) Received: (from steiner@localhost) by attica.americas.sgi.com (8.11.6/8.11.6/erikj-RedHat-7.2-Eagan) id hA7MbT223824 for netdev@oss.sgi.com; Fri, 7 Nov 2003 16:37:29 -0600 Date: Fri, 7 Nov 2003 16:37:29 -0600 From: Jack Steiner To: netdev@oss.sgi.com Subject: FW: [PATCH] - Incorrect cpumask definition in net/core/flow.c Message-ID: <20031107223729.GA20687@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 1268 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steiner@sgi.com Precedence: bulk X-list: netdev (I sent this to akpm earlier - I think I sent it to the wrong list) This fixes a problem in net/core/flow.c. The field "cpumap" is defined as a "unsigned long". It should be a "cpumask_t". # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1402 -> 1.1403 # net/core/flow.c 1.15 -> 1.16 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/07 steiner@attica.americas.sgi.com 1.1403 # Change cpumap definition from "unsigned long" to "cpumask_t". # -------------------------------------------- # diff -Nru a/net/core/flow.c b/net/core/flow.c --- a/net/core/flow.c Fri Nov 7 15:04:08 2003 +++ b/net/core/flow.c Fri Nov 7 15:04:08 2003 @@ -65,7 +65,7 @@ struct flow_flush_info { atomic_t cpuleft; - unsigned long cpumap; + cpumask_t cpumap; struct completion completion; }; static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL }; @@ -73,7 +73,7 @@ #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu)) static DECLARE_MUTEX(flow_cache_cpu_sem); -static unsigned long flow_cache_cpu_map; +static cpumask_t flow_cache_cpu_map; static unsigned int flow_cache_cpu_count; static void flow_cache_new_hashrnd(unsigned long arg) -- Thanks Jack Steiner (steiner@sgi.com) 651-683-5302 Principal Engineer SGI - Silicon Graphics, Inc. From akpm@osdl.org Fri Nov 7 15:43:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 15:43:54 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA7Nhd25001941 for ; Fri, 7 Nov 2003 15:43:39 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA7NhQC03864; Fri, 7 Nov 2003 15:43:27 -0800 Date: Fri, 7 Nov 2003 15:43:55 -0800 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com, Jack Steiner Subject: Fw: [PATCH] - Incorrect cpumask definition in net/core/flow.c Message-Id: <20031107154355.74fe4fd4.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1269 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev One for you please Dave. Begin forwarded message: Date: Fri, 7 Nov 2003 15:08:48 -0600 From: Jack Steiner To: akpm@osdl.org, linux-kernel@vger.kernel.org Cc: Jesse Barnes Subject: [PATCH] - Incorrect cpumask definition in net/core/flow.c This fixes a problem in net/core/flow.c. The field "cpumap" is defined as a "unsigned long". It should be a "cpumask_t". # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1402 -> 1.1403 # net/core/flow.c 1.15 -> 1.16 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/07 steiner@attica.americas.sgi.com 1.1403 # Change cpumap definition from "unsigned long" to "cpumask_t". # -------------------------------------------- # diff -Nru a/net/core/flow.c b/net/core/flow.c --- a/net/core/flow.c Fri Nov 7 15:04:08 2003 +++ b/net/core/flow.c Fri Nov 7 15:04:08 2003 @@ -65,7 +65,7 @@ struct flow_flush_info { atomic_t cpuleft; - unsigned long cpumap; + cpumask_t cpumap; struct completion completion; }; static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL }; @@ -73,7 +73,7 @@ #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu)) static DECLARE_MUTEX(flow_cache_cpu_sem); -static unsigned long flow_cache_cpu_map; +static cpumask_t flow_cache_cpu_map; static unsigned int flow_cache_cpu_count; static void flow_cache_new_hashrnd(unsigned long arg) -- Thanks Jack Steiner (steiner@sgi.com) 651-683-5302 Principal Engineer SGI - Silicon Graphics, Inc. From davem@pizda.ninka.net Fri Nov 7 16:17:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 16:18:02 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA80Hk25002532 for ; Fri, 7 Nov 2003 16:17:47 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA05757; Fri, 7 Nov 2003 16:12:12 -0800 Date: Fri, 7 Nov 2003 16:12:12 -0800 From: "David S. Miller" To: Jack Steiner Cc: netdev@oss.sgi.com Subject: Re: FW: [PATCH] - Incorrect cpumask definition in net/core/flow.c Message-Id: <20031107161212.5521629b.davem@redhat.com> In-Reply-To: <20031107223729.GA20687@sgi.com> References: <20031107223729.GA20687@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1270 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 7 Nov 2003 16:37:29 -0600 Jack Steiner wrote: > The field "cpumap" is defined as a "unsigned long". It > should be a "cpumask_t". You can't just do this, that's more broken than the original code. You have to _ALSO_ change all of the accesses to these objects to use the cpumask interfaces. From herbert@gondor.apana.org.au Fri Nov 7 18:58:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Nov 2003 18:59:05 -0800 (PST) Received: from arnor.me.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA82wl25006767 for ; Fri, 7 Nov 2003 18:58:49 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.me.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1AIJIV-0005Wt-00; Sat, 08 Nov 2003 13:57:59 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AIJIT-0002q9-00; Sat, 08 Nov 2003 13:57:57 +1100 From: Herbert Xu To: steiner@sgi.com (Jack Steiner), davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] - Incorrect cpumask definition in net/core/flow.c Organization: Core In-Reply-To: <20031107210848.GA10774@sgi.com> X-Newsgroups: apana.lists.os.linux.kernel User-Agent: tin/1.7.2-20031002 ("Berneray") (UNIX) (Linux/2.4.22-1-686-smp (i686)) Message-Id: Date: Sat, 08 Nov 2003 13:57:57 +1100 X-archive-position: 1271 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Jack Steiner wrote: > This fixes a problem in net/core/flow.c. > > The field "cpumap" is defined as a "unsigned long". It > should be a "cpumask_t". Thanks. Here is a patch that changes the operations on the maps as well for consistency. -- Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- Index: kernel-source-2.5/net/core/flow.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/core/flow.c,v retrieving revision 1.8 diff -u -r1.8 flow.c --- kernel-source-2.5/net/core/flow.c 11 Oct 2003 06:29:28 -0000 1.8 +++ kernel-source-2.5/net/core/flow.c 8 Nov 2003 02:54:01 -0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -65,7 +66,7 @@ struct flow_flush_info { atomic_t cpuleft; - unsigned long cpumap; + cpumask_t cpumap; struct completion completion; }; static DEFINE_PER_CPU(struct tasklet_struct, flow_flush_tasklets) = { NULL }; @@ -73,7 +74,7 @@ #define flow_flush_tasklet(cpu) (&per_cpu(flow_flush_tasklets, cpu)) static DECLARE_MUTEX(flow_cache_cpu_sem); -static unsigned long flow_cache_cpu_map; +static cpumask_t flow_cache_cpu_map; static unsigned int flow_cache_cpu_count; static void flow_cache_new_hashrnd(unsigned long arg) @@ -81,7 +82,7 @@ int i; for (i = 0; i < NR_CPUS; i++) - if (test_bit(i, &flow_cache_cpu_map)) + if (cpu_isset(i, flow_cache_cpu_map)) flow_hash_rnd_recalc(i) = 1; flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD; @@ -178,7 +179,7 @@ cpu = smp_processor_id(); fle = NULL; - if (!test_bit(cpu, &flow_cache_cpu_map)) + if (!cpu_isset(cpu, flow_cache_cpu_map)) goto nocache; if (flow_hash_rnd_recalc(cpu)) @@ -277,7 +278,7 @@ struct tasklet_struct *tasklet; cpu = smp_processor_id(); - if (!test_bit(cpu, &info->cpumap)) + if (!cpu_isset(cpu, info->cpumap)) return; tasklet = flow_flush_tasklet(cpu); @@ -301,7 +302,7 @@ local_bh_disable(); smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0); - if (test_bit(smp_processor_id(), &info.cpumap)) + if (cpu_isset(smp_processor_id(), info.cpumap)) flow_cache_flush_tasklet((unsigned long)&info); local_bh_enable(); @@ -341,7 +342,7 @@ static int __devinit flow_cache_cpu_online(int cpu) { down(&flow_cache_cpu_sem); - set_bit(cpu, &flow_cache_cpu_map); + cpu_set(cpu, flow_cache_cpu_map); flow_cache_cpu_count++; up(&flow_cache_cpu_sem); From garzik@gtf.org Sat Nov 8 09:56:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 09:56:23 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA8Hu025027566 for ; Sat, 8 Nov 2003 09:56:00 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 5B3E766AB; Sat, 8 Nov 2003 12:27:48 -0500 (EST) Date: Sat, 8 Nov 2003 12:27:48 -0500 From: Jeff Garzik To: torvalds@osdl.org Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] net driver fixes Message-ID: <20031108172748.GA8186@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 1272 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Linus, please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.5 This will update the following files: drivers/net/b44.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-- drivers/net/pcnet32.c | 4 +++ 2 files changed, 58 insertions(+), 2 deletions(-) through these ChangeSets: (03/11/08 1.1416) [netdrvr pcnet32] add missing pci_dma_sync_single a patch for the pcnet32.c driver which adds a missing call to pci_dma_sync_single. If a received packet is smaller than rx_copybreak the pcnet driver will recycle the receive buffer which requires calling pci_dma_sync_single. Patch is against 2.6 but I it's also needed in 2.4. Without that call the processor might still have old stale data in the data cache when the processor accesses the recycled buffer. (03/11/08 1.1415) [netdrvr b44] Fix irq enable/disable; fix oops due to lack of SET_NETDEV_DEV() call Also, add suspend/resume functions. From rddunlap@osdl.org Sat Nov 8 16:07:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 16:07:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA907325001009 for ; Sat, 8 Nov 2003 16:07:03 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA906vC19837; Sat, 8 Nov 2003 16:06:57 -0800 Date: Sat, 8 Nov 2003 16:04:41 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: saw@saw.sw.com.sg, akpm@osdl.org Subject: [PATCH] enabling netdev boot options (2.6.0-t9) Message-Id: <20031108160441.3a0a5505.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1274 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev description: enable eepro100 and 3c59x drivers to recognize 'netdev=' boot options: use dev_alloc_name() to assign an interface name, then use netdev_boot_setup_check() to check for boot options for that interface (name); maintainer: Andrey V. Savochkin (saw@saw.sw.com.sg); Andrew Morton (akpm@osdl.org) et al product_versions: Linux 2.6.0-test9 diffstat:= drivers/net/3c59x.c | 15 ++++++++++++++- drivers/net/eepro100.c | 12 +++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff -Naurp ./drivers/net/eepro100.c~netdev ./drivers/net/eepro100.c --- ./drivers/net/eepro100.c~netdev 2003-10-25 11:44:01.000000000 -0700 +++ ./drivers/net/eepro100.c 2003-11-08 15:32:36.000000000 -0800 @@ -681,17 +681,19 @@ static int __devinit speedo_found1(struc SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (dev->mem_start > 0) + rtnl_lock(); + + if (dev_alloc_name(dev, dev->name) < 0) + goto err_free_unlock; + + if (netdev_boot_setup_check(dev) && dev->mem_start > 0) { option = dev->mem_start; + } else if (card_idx >= 0 && options[card_idx] >= 0) option = options[card_idx]; else option = 0; - rtnl_lock(); - if (dev_alloc_name(dev, dev->name) < 0) - goto err_free_unlock; - /* Read the station address EEPROM before doing the reset. Nominally his should even be done before accepting the device, but then we wouldn't have a device name with which to report the error. diff -Naurp ./drivers/net/3c59x.c~netdev ./drivers/net/3c59x.c --- ./drivers/net/3c59x.c~netdev 2003-10-25 11:42:42.000000000 -0700 +++ ./drivers/net/3c59x.c 2003-11-08 15:29:50.000000000 -0800 @@ -259,6 +259,7 @@ static int vortex_debug = 1; #include #include #include +#include #include #include #include @@ -1110,6 +1111,16 @@ static int __devinit vortex_probe1(struc SET_NETDEV_DEV(dev, gendev); vp = dev->priv; + rtnl_lock(); + + retval = dev_alloc_name(dev, dev->name); + if (retval < 0) + goto err_free_unlock; + + rtnl_unlock(); + + netdev_boot_setup_check(dev); + option = global_options; /* The lower four bits are the media type. */ @@ -1468,8 +1479,10 @@ free_ring: free_region: if (vp->must_free_region) release_region(ioaddr, vci->io_size); - free_netdev(dev); +err_free_unlock: printk(KERN_ERR PFX "vortex_probe1 fails. Returns %d\n", retval); + rtnl_unlock(); + free_netdev(dev); out: return retval; } From rddunlap@osdl.org Sat Nov 8 16:06:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 16:06:56 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA906f25000986 for ; Sat, 8 Nov 2003 16:06:43 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA906WC19811; Sat, 8 Nov 2003 16:06:33 -0800 Date: Sat, 8 Nov 2003 16:04:16 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: saw@saw.sw.com.sg, akpm@osdl.org Subject: [PATCH/RFC] enabling netdev boot options Message-Id: <20031108160416.236ec29d.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1273 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev I have modified 3c59x.c (for 2.4.22 and 2.6.0-test9) and eepro100 (for 2.6.0-test9 only) to check for netdev= boot options. I have verified that this change works (on 2.6.0-test9) when using an Intel PRO/100 NIC. netdev_boot_setup_check() needs to know the interface name to check for boot options, so I added calls to dev_alloc_name() so that the interface name would be assigned before calling netdev_boot_setup_check(). Other options include wedging some function so that netdev_boot_setup_check() is called automatically, but it needs to be done very soon after dev_alloc_name() so that dev->{irq, base_addr, mem_start, mem_end} are not clobbered. (Here are some other options that I've considered.) Option 3: with an API change, it could pass back a struct ifmap instead of clobbering the dev-> fields. Option 4: use something other than interface name to save and lookup netdev boot options. Possibly a unique identifier, like a MAC address. Option 5: I expect that the long-term solution is to use sysfs (2.6.x or 2.7). Any comments/preferences about that? 3c59x patch for 2.4.22 is below. 2.6.0-test9 patch follows in next email. -- ~Randy description: enable 3c59x driver to recognize 'netdev=' boot options changelog: use dev_alloc_name() to assign an interface name, then use netdev_boot_setup_check() to check for boot options for that interface (name); maintainer: Andrew Morton et al product_versions: Linux 2.4.22 patch_name: 3c59x-boot-setup.patch patch_version: 2003-11-08.15:22:30 diffstat:= drivers/net/3c59x.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletion(-) diff -Naurp ./drivers/net/3c59x.c~boot-setup ./drivers/net/3c59x.c --- ./drivers/net/3c59x.c~boot-setup 2003-08-25 04:44:42.000000000 -0700 +++ ./drivers/net/3c59x.c 2003-11-08 15:20:15.000000000 -0800 @@ -250,6 +250,7 @@ static int vortex_debug = 1; #include #include #include +#include #include #include #include @@ -1017,6 +1018,16 @@ static int __devinit vortex_probe1(struc SET_MODULE_OWNER(dev); vp = dev->priv; + rtnl_lock(); + + retval = dev_alloc_name(dev, dev->name); + if (retval < 0) + goto err_free_unlock; + + rtnl_unlock(); + + netdev_boot_setup_check(dev); + /* The lower four bits are the media type. */ if (dev->mem_start) { /* @@ -1351,8 +1362,10 @@ free_ring: free_region: if (vp->must_free_region) release_region(ioaddr, vci->io_size); - kfree (dev); +err_free_unlock: printk(KERN_ERR PFX "vortex_probe1 fails. Returns %d\n", retval); + rtnl_unlock(); + kfree (dev); out: return retval; } From akpm@osdl.org Sat Nov 8 16:19:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 16:19:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA90JK25004494 for ; Sat, 8 Nov 2003 16:19:20 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA90JDC21337; Sat, 8 Nov 2003 16:19:13 -0800 Date: Sat, 8 Nov 2003 16:22:48 -0800 From: Andrew Morton To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg Subject: Re: [PATCH/RFC] enabling netdev boot options Message-Id: <20031108162248.5846ab46.akpm@osdl.org> In-Reply-To: <20031108160416.236ec29d.rddunlap@osdl.org> References: <20031108160416.236ec29d.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1275 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev "Randy.Dunlap" wrote: > > > I have modified 3c59x.c (for 2.4.22 and 2.6.0-test9) and eepro100 > (for 2.6.0-test9 only) to check for netdev= boot options. A worthy project, thanks. > + rtnl_lock(); > + > + retval = dev_alloc_name(dev, dev->name); > + if (retval < 0) > + goto err_free_unlock; > + > + rtnl_unlock(); It would be better to move this locking into the core net layer. Call dev_alloc_name_which_takes_rtnl_lock() here ;) > + > + netdev_boot_setup_check(dev); > + > /* The lower four bits are the media type. */ > if (dev->mem_start) { > /* > @@ -1351,8 +1362,10 @@ free_ring: > free_region: > if (vp->must_free_region) > release_region(ioaddr, vci->io_size); > - kfree (dev); > +err_free_unlock: > printk(KERN_ERR PFX "vortex_probe1 fails. Returns %d\n", retval); > + rtnl_unlock(); > + kfree (dev); > out: > return retval; > } This causes an rtnl_unlock() imbalance if vortex_probe1() takes the `goto free_region' path, does it not?? From rddunlap@osdl.org Sat Nov 8 17:06:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 17:06:18 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA916425005163 for ; Sat, 8 Nov 2003 17:06:04 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA915wC27353; Sat, 8 Nov 2003 17:05:58 -0800 Date: Sat, 8 Nov 2003 17:03:42 -0800 From: "Randy.Dunlap" To: Andrew Morton Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg Subject: Re: [PATCH/RFC] enabling netdev boot options Message-Id: <20031108170342.78548c86.rddunlap@osdl.org> In-Reply-To: <20031108162248.5846ab46.akpm@osdl.org> References: <20031108160416.236ec29d.rddunlap@osdl.org> <20031108162248.5846ab46.akpm@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1276 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Sat, 8 Nov 2003 16:22:48 -0800 Andrew Morton wrote: | "Randy.Dunlap" wrote: | > | > | > I have modified 3c59x.c (for 2.4.22 and 2.6.0-test9) and eepro100 | > (for 2.6.0-test9 only) to check for netdev= boot options. | | A worthy project, thanks. | | > + rtnl_lock(); | > + | > + retval = dev_alloc_name(dev, dev->name); | > + if (retval < 0) | > + goto err_free_unlock; | > + | > + rtnl_unlock(); | | It would be better to move this locking into the core net layer. | Call dev_alloc_name_which_takes_rtnl_lock() here ;) Makes sense, but I'm wary of some drivers which do rtnl_lock() early and hold it for long times (like eepro100). Methinks that it shouldn't do that, but that's a different patch. | > @@ -1351,8 +1362,10 @@ free_ring: | > free_region: | > if (vp->must_free_region) | > release_region(ioaddr, vci->io_size); | > - kfree (dev); | > +err_free_unlock: | > printk(KERN_ERR PFX "vortex_probe1 fails. Returns %d\n", retval); | > + rtnl_unlock(); | > + kfree (dev); | > out: | > return retval; | > } | | This causes an rtnl_unlock() imbalance if vortex_probe1() takes the | `goto free_region' path, does it not?? I'll check that again. Might be right. -- ~Randy From rddunlap@osdl.org Sat Nov 8 18:53:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 18:54:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA92rk25006181 for ; Sat, 8 Nov 2003 18:53:48 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA92reC06532; Sat, 8 Nov 2003 18:53:40 -0800 Date: Sat, 8 Nov 2003 18:51:23 -0800 From: "Randy.Dunlap" To: Andrew Morton Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg Subject: Re: [PATCH/RFC] enabling netdev boot options Message-Id: <20031108185123.2fb8f1ac.rddunlap@osdl.org> In-Reply-To: <20031108162248.5846ab46.akpm@osdl.org> References: <20031108160416.236ec29d.rddunlap@osdl.org> <20031108162248.5846ab46.akpm@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1277 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Sat, 8 Nov 2003 16:22:48 -0800 Andrew Morton wrote: | "Randy.Dunlap" wrote: | > | > | > I have modified 3c59x.c (for 2.4.22 and 2.6.0-test9) and eepro100 | > (for 2.6.0-test9 only) to check for netdev= boot options. | | A worthy project, thanks. | | > + rtnl_lock(); | > + | > + retval = dev_alloc_name(dev, dev->name); | > + if (retval < 0) | > + goto err_free_unlock; | > + | > + rtnl_unlock(); | | It would be better to move this locking into the core net layer. | Call dev_alloc_name_which_takes_rtnl_lock() here ;) [snip] | This causes an rtnl_unlock() imbalance if vortex_probe1() takes the | `goto free_region' path, does it not?? Yes, that's right. Updated patch is below (for 2.4.22), still using rtnl_lock() and rtnl_unlock(). I'll make a locking version of dev_alloc_name() next [for 2.6], as well as 2.6.0-test9 patch updates. I'll make a locking version of dev_alloc_name() for 2.4.2x if it's wanted. Thanks. -- ~Randy description: enable 3c59x driver to recognize 'netdev=' boot options changelog: use dev_alloc_name() to assign an interface name, then use netdev_boot_setup_check() to check for boot options for that interface (name); maintainer: Andrew Morton et al product_versions: Linux 2.4.22 diffstat:= drivers/net/3c59x.c | 13 +++++++++++++ 1 files changed, 13 insertions(+) diff -Naurp ./drivers/net/3c59x.c~boot-setup ./drivers/net/3c59x.c --- ./drivers/net/3c59x.c~boot-setup 2003-08-25 04:44:42.000000000 -0700 +++ ./drivers/net/3c59x.c 2003-11-08 18:42:01.000000000 -0800 @@ -250,6 +250,7 @@ static int vortex_debug = 1; #include #include #include +#include #include #include #include @@ -1017,6 +1018,18 @@ static int __devinit vortex_probe1(struc SET_MODULE_OWNER(dev); vp = dev->priv; + rtnl_lock(); + + retval = dev_alloc_name(dev, dev->name); + if (retval < 0) { + rtnl_unlock(); + goto free_region; + } + + rtnl_unlock(); + + netdev_boot_setup_check(dev); + /* The lower four bits are the media type. */ if (dev->mem_start) { /* From rddunlap@osdl.org Sat Nov 8 20:46:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 20:46:51 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA94kT25010364 for ; Sat, 8 Nov 2003 20:46:33 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA94kNC18448; Sat, 8 Nov 2003 20:46:23 -0800 Date: Sat, 8 Nov 2003 20:44:06 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: saw@saw.sw.com.sg, akpm@osdl.org Subject: Re: [PATCH] enabling netdev boot options (2.6.0-t9) Message-Id: <20031108204406.5dbbdc87.rddunlap@osdl.org> In-Reply-To: <20031108160441.3a0a5505.rddunlap@osdl.org> References: <20031108160441.3a0a5505.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1278 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Here's an update for 2.6.0-test9. This update adds dev_alloc_name_lock(), which takes and releases the rtnl lock to call dev_alloc_name(), so that the caller doesn't have to do that. More comments? Thanks, -- ~Randy description: enable eepro100 and 3c59x drivers to recognize 'netdev=' boot options: use dev_alloc_name() to assign an interface name if rtnl lock is already held (eepro100); use [new] dev_alloc_name_lock() to assign interface name if required lock is not already held; then use netdev_boot_setup_check() to check for boot options for that interface (name); add dev_alloc_name_lock() to net/core/dev.c; maintainer: Andrey V. Savochkin (saw@saw.sw.com.sg); Andrew Morton (akpm@osdl.org) et al product_versions: Linux 2.6.0-test9 diffstat:= drivers/net/3c59x.c | 6 ++++++ drivers/net/eepro100.c | 12 +++++++----- include/linux/netdevice.h | 1 + net/core/dev.c | 23 +++++++++++++++++++++++ 4 files changed, 37 insertions(+), 5 deletions(-) diff -Naurp ./drivers/net/eepro100.c~netdev ./drivers/net/eepro100.c --- ./drivers/net/eepro100.c~netdev 2003-10-25 11:44:01.000000000 -0700 +++ ./drivers/net/eepro100.c 2003-11-08 20:05:38.000000000 -0800 @@ -681,17 +681,19 @@ static int __devinit speedo_found1(struc SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (dev->mem_start > 0) + rtnl_lock(); + + if (dev_alloc_name(dev, dev->name) < 0) + goto err_free_unlock; + + if (netdev_boot_setup_check(dev) && dev->mem_start > 0) { option = dev->mem_start; + } else if (card_idx >= 0 && options[card_idx] >= 0) option = options[card_idx]; else option = 0; - rtnl_lock(); - if (dev_alloc_name(dev, dev->name) < 0) - goto err_free_unlock; - /* Read the station address EEPROM before doing the reset. Nominally his should even be done before accepting the device, but then we wouldn't have a device name with which to report the error. diff -Naurp ./drivers/net/3c59x.c~netdev ./drivers/net/3c59x.c --- ./drivers/net/3c59x.c~netdev 2003-10-25 11:42:42.000000000 -0700 +++ ./drivers/net/3c59x.c 2003-11-08 20:13:39.000000000 -0800 @@ -1110,6 +1110,12 @@ static int __devinit vortex_probe1(struc SET_NETDEV_DEV(dev, gendev); vp = dev->priv; + retval = dev_alloc_name_lock(dev, dev->name); + if (retval < 0) + goto free_region; + + netdev_boot_setup_check(dev); + option = global_options; /* The lower four bits are the media type. */ diff -Naurp ./net/core/dev.c~netdev ./net/core/dev.c --- ./net/core/dev.c~netdev 2003-10-25 11:43:39.000000000 -0700 +++ ./net/core/dev.c 2003-11-08 20:15:00.000000000 -0800 @@ -635,6 +635,29 @@ int dev_alloc_name(struct net_device *de } /** + * dev_alloc_name_lock - allocate a name for a device, + * with required locking + * @dev: device + * @name: name format string + * + * Passed a format string - eg "lt%d" it will try and find a suitable + * id. Not efficient for many devices, not called a lot. + * This function takes the rtnl lock while allocating the name and + * adding the device in order to avoid duplicates. + * Returns the number of the unit assigned or a negative errno code. + */ + +int dev_alloc_name_lock(struct net_device *dev, const char *name) +{ + int ret; + + rtnl_lock(); + ret = dev_alloc_name(dev, name); + rtnl_unlock(); + return ret; +} + +/** * dev_alloc - allocate a network device and name * @name: name format string * @err: error return pointer diff -Naurp ./include/linux/netdevice.h~netdev ./include/linux/netdevice.h --- ./include/linux/netdevice.h~netdev 2003-10-25 11:44:45.000000000 -0700 +++ ./include/linux/netdevice.h 2003-11-08 20:01:33.000000000 -0800 @@ -518,6 +518,7 @@ static inline __deprecated struct net_de return __dev_alloc(name, err); } extern int dev_alloc_name(struct net_device *dev, const char *name); +extern int dev_alloc_name_lock(struct net_device *dev, const char *name); extern int dev_open(struct net_device *dev); extern int dev_close(struct net_device *dev); extern int dev_queue_xmit(struct sk_buff *skb); From torvalds@osdl.org Sat Nov 8 21:53:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 21:54:07 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA95rn25011289 for ; Sat, 8 Nov 2003 21:53:50 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA95riC25706 for ; Sat, 8 Nov 2003 21:53:44 -0800 X-Received: from localhost (localhost.localdomain [127.0.0.1]) by home.osdl.org (8.12.10/8.12.10) with ESMTP id hA94ZXqR002010 for ; Sat, 8 Nov 2003 20:35:33 -0800 X-Received: from localhost.localdomain [127.0.0.1] by localhost with IMAP (fetchmail-6.2.0) for torvalds@localhost (single-drop); Sat, 08 Nov 2003 20:35:33 -0800 (PST) X-Received: from fire-1.osdl.org (air1.pdx.osdl.net [172.20.0.5]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA94XgC17622 for ; Sat, 8 Nov 2003 20:33:42 -0800 X-Received: from vger.kernel.org (vger.kernel.org [67.72.78.212]) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id hA94Xf0e017266 for ; Sat, 8 Nov 2003 20:33:42 -0800 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262174AbTKIE2Y (ORCPT ); Sat, 8 Nov 2003 23:28:24 -0500 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262176AbTKIE2Y (ORCPT ); Sat, 8 Nov 2003 23:28:24 -0500 X-Received: from cap175-219-202.pixi.net ([207.175.219.202]:39812 "EHLO beaucox.com") by vger.kernel.org with ESMTP id S262174AbTKIE2W (ORCPT ); Sat, 8 Nov 2003 23:28:22 -0500 X-Received: from 10.0.0.2 (10.0.0.2:33411) by cap175-219-202.pixi.net with [XMail 1.17 (Linux/Ix86) ESMTP Server] id for from ; Sat, 8 Nov 2003 18:21:16 -1000 From: "Beau E. Cox" Organization: BeauCox.com To: linux-kernel@vger.kernel.org Subject: PROBLEM: PATCH for 2.4.23-pre4 and up hang on one system Date: Sat, 8 Nov 2003 18:27:28 -1000 User-Agent: KMail/1.5.4 Cc: Marcelo Tosatti MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200311081341.38553.beau@beaucox.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-Scanned-By: MIMEDefang 2.36 ReSent-Date: Sat, 8 Nov 2003 21:53:22 -0800 (PST) ReSent-From: Linus Torvalds ReSent-To: netdev@oss.sgi.com ReSent-Subject: PROBLEM: PATCH for 2.4.23-pre4 and up hang on one system ReSent-Message-ID: X-archive-position: 1279 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev submitted Sat Nov 8 13:08:55 HST 2003 by Beau E. Cox [1.] One line summary of the problem: Patch that fixes my problem: Starting with 2.4.23-pre4 my system hangs during startup and/or is generally unstable (see patch in [ X. ] below.) [2.] Full description of the problem/report: Origionally I had catagorized this problem with the startup sequence; the system always seemed to hang when squid was started before mysql, etc. Moving squid near the end of the startup process, I thought the problem was in hand. However, the system (pre9) proved unstable (would not stay up for longer than one day.) The problem exhibits itself with a solid 'hang'; no oops, no dumps, nada. [ 3. ] - [ 7. ] See previous posting; no hardware or configuration changes. [X.] Other notes, patches, fixes, workarounds: This patch to net/ipv4/netfilter/ip_nat_core.c fixed my problem in all 2.4.23 versions pre4 - pre9: --- linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_core.c 2003-11-08 03:01:59.000000000 -1000 +++ linux-2.4.23-pre3/net/ipv4/netfilter/ip_nat_core.c 2003-11-08 03:00:47.000000000 -1000 @@ -157,8 +157,8 @@ continue; } - if (!(mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED) - || proto->in_range(&newtuple, IP_NAT_MANIP_SRC, + if ((mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED) + && proto->in_range(&newtuple, IP_NAT_MANIP_SRC, &mr->range[i].min, &mr->range[i].max)) return 1; } It is simply a rollback of changes to ip_nat_core.c made in pre4. Since my patch is to ip_nat_core.c, I should mention that I use NAT via iptables. Here is an the relevant section if my iptables startup script: [...] # setup nat echo " applying nat rules" echo "" $iptables -F FORWARD $iptables -F -t nat $iptables -P FORWARD DROP $iptables -A FORWARD -i eth0 -j ACCEPT $iptables -A INPUT -i eth0 -j ACCEPT $iptables -A OUTPUT -o eth0 -j ACCEPT $iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT $iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j SNAT --to-source x.x.x.x [...] All the information I can think of relating to this problem is at: ftp://beaucox.com/pub/kernel/2.4.23-pre4-bug Please see the README file. ---------------------------WARNING-------------------------- I am NOT a kernel programmer. The patch above was arrived at by hit-or-miss. I REALLY don't know what I am doing (but my system works now!) ---------------------------WARNING-------------------------- Aloha => Beau; PS: Please let me know if you need more information. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From akpm@osdl.org Sat Nov 8 22:02:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 22:03:02 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA962m25011706 for ; Sat, 8 Nov 2003 22:02:49 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hA962hC26737; Sat, 8 Nov 2003 22:02:43 -0800 Date: Sat, 8 Nov 2003 22:06:21 -0800 From: Andrew Morton To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg Subject: Re: [PATCH] enabling netdev boot options (2.6.0-t9) Message-Id: <20031108220621.11d39feb.akpm@osdl.org> In-Reply-To: <20031108204406.5dbbdc87.rddunlap@osdl.org> References: <20031108160441.3a0a5505.rddunlap@osdl.org> <20031108204406.5dbbdc87.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1280 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev "Randy.Dunlap" wrote: > > +int dev_alloc_name_lock(struct net_device *dev, const char *name) You'll need to export this guy to modules. From davem@pizda.ninka.net Sat Nov 8 22:32:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 22:32:50 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA96Wa25012283 for ; Sat, 8 Nov 2003 22:32:36 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA23045; Sat, 8 Nov 2003 22:26:45 -0800 Date: Sat, 8 Nov 2003 22:26:45 -0800 From: "David S. Miller" To: Herbert Xu Cc: steiner@sgi.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] - Incorrect cpumask definition in net/core/flow.c Message-Id: <20031108222645.4e3d23f1.davem@redhat.com> In-Reply-To: References: <20031107210848.GA10774@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1281 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 08 Nov 2003 13:57:57 +1100 Herbert Xu wrote: > Here is a patch that changes the operations on the maps as well > for consistency. This is the correct patch, applied thanks. I have another patch that cleans up this stuff in a better albeit intrusive way from Rusty, but let's be safe for 2.6.0 From davem@pizda.ninka.net Sat Nov 8 22:36:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Nov 2003 22:36:41 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA96aT25012658 for ; Sat, 8 Nov 2003 22:36:29 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA23080; Sat, 8 Nov 2003 22:30:49 -0800 Date: Sat, 8 Nov 2003 22:30:49 -0800 From: "David S. Miller" To: Krishna Kumar Cc: netdev@oss.sgi.com, krkumar@us.ibm.com Subject: Re: [PATCH] Hang in downing interface with IPv6 PRIVACY Message-Id: <20031108223049.36651f8d.davem@redhat.com> In-Reply-To: References: <20031106115935.0cd56745.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1282 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 7 Nov 2003 11:01:41 -0800 (PST) Krishna Kumar wrote: > While using PRIVACY extensions, I sometimes get a hang when I remove the > interface. But I can reproduce this every time using the test script at > the end of the mail (hang depends on the order of address deletion). ... > The bug is in ipv6_del_addr() where if a temp address is being deleted ... > Also, the code at the top of the routine is unnecessary, the same is being > done when the address is found a little later in that routine. Looks great, applied. Thanks. From rask@sygehus.dk Sun Nov 9 02:57:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 02:57:59 -0800 (PST) Received: from 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (0x50a41c03.albnxx15.adsl-dhcp.tele.dk [80.164.28.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Avi25019022 for ; Sun, 9 Nov 2003 02:57:45 -0800 Received: by 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 452891F439; Sun, 9 Nov 2003 11:55:36 +0100 (CET) Date: Sun, 9 Nov 2003 11:55:35 +0100 From: Rask Ingemann Lambertsen To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg, akpm@osdl.org Subject: Re: [PATCH] enabling netdev boot options (2.6.0-t9) Message-ID: <20031109115535.A1282@sygehus.dk> References: <20031108160441.3a0a5505.rddunlap@osdl.org> <20031108204406.5dbbdc87.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031108204406.5dbbdc87.rddunlap@osdl.org>; from rddunlap@osdl.org on Sat, Nov 08, 2003 at 08:44:06PM -0800 X-archive-position: 1283 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev On Sat, Nov 08, 2003 at 08:44:06PM -0800, Randy.Dunlap wrote: > > Here's an update for 2.6.0-test9. This update adds > dev_alloc_name_lock(), which takes and releases the rtnl lock > to call dev_alloc_name(), so that the caller doesn't have to do that. > > More comments? I don't like that name for the function. dev_alloc_name_lock() makes it natural to think that there is a matching dev_alloc_name_unlock() function which you should call afterwards. How about dev_alloc_name_locked() or dev_alloc_name_with_lock() instead? -- Regards, Rask Ingemann Lambertsen From rask@sygehus.dk Sun Nov 9 03:36:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 03:37:03 -0800 (PST) Received: from 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (0x50a41c03.albnxx15.adsl-dhcp.tele.dk [80.164.28.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Bag25019726 for ; Sun, 9 Nov 2003 03:36:45 -0800 Received: by 0x50a41c03.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 21F951F439; Sun, 9 Nov 2003 12:34:36 +0100 (CET) Date: Sun, 9 Nov 2003 12:34:35 +0100 From: Rask Ingemann Lambertsen To: Sven Schuster Cc: linux-net@vger.kernel.org, netdev Subject: Re: Linux <---> Unixware slow networking with e100 Message-ID: <20031109123435.B1282@sygehus.dk> References: <3FA9F8D5.9020601@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FA9F8D5.9020601@gmx.de>; from schuster.sven@gmx.de on Thu, Nov 06, 2003 at 08:31:33AM +0100 X-archive-position: 1284 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev On Thu, Nov 06, 2003 at 08:31:33AM +0100, Sven Schuster wrote: > But when _receiving_ data from one of the unixware machines, we > just get a few kB/s, max. about 100 kB/s. When _sending_ data to > a unixware machine, the transfer rate is fine too. Are there any > known issues between linux and unixware (except the SCO thing > ;-) ) ?? Run tcpdump and see what the window sizes are when sending data from Unixware to Linux. -- Regards, Rask Ingemann Lambertsen From wsx@6com.sk Sun Nov 9 04:28:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 04:29:18 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9CSt25028456 for ; Sun, 9 Nov 2003 04:28:56 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id BE5374C00083; Sun, 9 Nov 2003 07:28:44 -0500 (EST) Date: Sun, 9 Nov 2003 13:28:44 +0100 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031109122844.GA14241@wsx.ksp.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1285 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Hello, I have found the following problem with 2.6.0-test9-bk13 on sparc64: We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that sparc64). We get the following corrupted answer: 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I When doing exactly same to x86 box (with 2.6.0-test7-bk7 running), we get the correct answer: 13:17:31.140230 3ffe:80ee:1:0:204:76ff:fe97:d69a > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: icmp6: 3ffe:80ee:1:0:204:76ff:fe97:d69a udp port 33434 unreachable (len 72, hlim 63) 0x0000 6000 0000 0048 3a3f 3ffe 80ee 0001 0000 ....H:??....... 0x0010 0204 76ff fe97 d69a 3ffe 80ee 000a 0000 ..v.....?....... 0x0020 0201 03ff fed5 bd1e 0104 fb79 0000 0000 ...........y.... 0x0030 6000 0000 0018 1101 3ffe 80ee 000a 0000 .......?....... 0x0040 0201 03ff fed5 bd1e 3ffe 80ee 0001 0000 ........?....... 0x0050 0204 76ff fe97 d69a 8018 829a 0018 0c82 ..v............. 0x0060 0000 1df3 0000 0005 5b30 ae3f 3512 0200 ........[0.?5... Jan From wsx@6com.sk Sun Nov 9 05:26:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 05:26:18 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9DPw25029182 for ; Sun, 9 Nov 2003 05:26:00 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 37F904C00083; Sun, 9 Nov 2003 08:25:53 -0500 (EST) Date: Sun, 9 Nov 2003 14:25:53 +0100 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031109132552.GA17096@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031109122844.GA14241@wsx.ksp.sk> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1286 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev This may be related to the problem (on sparc64): # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from ::1, 30 hops max, 24 byte packets Bus error # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 -s 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets Bus error # traceroute6 www.kame.net traceroute to orange.kame.net (2001:200:0:8002:203:47ff:fea5:3085) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets 1 skbra-00-01.pop.xs26.net (3ffe:80ee:3bd:0:a00:20ff:fec9:3aad) 0.953 ms 0.305 ms 0.341 ms ... The following lines are appearing in dmesg: raw v6 hw csum failure. All of this worked fine in 2.4.22-pre6. The common problem of 2.4 and 2.6 is with IPv4 traceroute, but it is probably because of buggy 64-bit traceroute, because it worked fine in 32-bit userspace: # traceroute www.google.com traceroute to www.google.akadns.net (216.239.57.99), 30 hops max, 52 byte packets Bus error On Sun, Nov 09, 2003 at 01:28:44PM +0100, Jan Oravec wrote: > Hello, > > > I have found the following problem with 2.6.0-test9-bk13 on sparc64: > > We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that > sparc64). We get the following corrupted answer: > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I > > > When doing exactly same to x86 box (with 2.6.0-test7-bk7 running), we get > the correct answer: > > 13:17:31.140230 3ffe:80ee:1:0:204:76ff:fe97:d69a > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: icmp6: 3ffe:80ee:1:0:204:76ff:fe97:d69a udp port 33434 unreachable (len 72, hlim 63) > 0x0000 6000 0000 0048 3a3f 3ffe 80ee 0001 0000 ....H:??....... > 0x0010 0204 76ff fe97 d69a 3ffe 80ee 000a 0000 ..v.....?....... > 0x0020 0201 03ff fed5 bd1e 0104 fb79 0000 0000 ...........y.... > 0x0030 6000 0000 0018 1101 3ffe 80ee 000a 0000 .......?....... > 0x0040 0201 03ff fed5 bd1e 3ffe 80ee 0001 0000 ........?....... > 0x0050 0204 76ff fe97 d69a 8018 829a 0018 0c82 ..v............. > 0x0060 0000 1df3 0000 0005 5b30 ae3f 3512 0200 ........[0.?5... > > > Jan > From wsx@6com.sk Sun Nov 9 05:39:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 05:40:08 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Ddj25029583 for ; Sun, 9 Nov 2003 05:39:50 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 0445F4C00083; Sun, 9 Nov 2003 08:39:39 -0500 (EST) Date: Sun, 9 Nov 2003 14:39:39 +0100 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031109133939.GA17333@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> <20031109132552.GA17096@wsx.ksp.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031109132552.GA17096@wsx.ksp.sk> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1287 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev And another observation is that on 2.6.0-test9-bk4 on Opteron x86_64 when I do: # traceroute6 ::1 The kernel crashs. I will have kernel OOPS output tommorow (the box is located in office) On Sun, Nov 09, 2003 at 02:25:53PM +0100, Jan Oravec wrote: > This may be related to the problem (on sparc64): > > # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from ::1, 30 hops max, 24 byte packets > Bus error > > # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 -s 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets > Bus error > > # traceroute6 www.kame.net > traceroute to orange.kame.net (2001:200:0:8002:203:47ff:fea5:3085) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets > 1 skbra-00-01.pop.xs26.net (3ffe:80ee:3bd:0:a00:20ff:fec9:3aad) 0.953 ms 0.305 ms 0.341 ms > ... > > The following lines are appearing in dmesg: > raw v6 hw csum failure. > > All of this worked fine in 2.4.22-pre6. > > > The common problem of 2.4 and 2.6 is with IPv4 traceroute, but it is > probably because of buggy 64-bit traceroute, because it worked fine in > 32-bit userspace: > > # traceroute www.google.com > traceroute to www.google.akadns.net (216.239.57.99), 30 hops max, 52 byte packets > Bus error > > > > On Sun, Nov 09, 2003 at 01:28:44PM +0100, Jan Oravec wrote: > > Hello, > > > > > > I have found the following problem with 2.6.0-test9-bk13 on sparc64: > > > > We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that > > sparc64). We get the following corrupted answer: > > > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I > > > > > > When doing exactly same to x86 box (with 2.6.0-test7-bk7 running), we get > > the correct answer: > > > > 13:17:31.140230 3ffe:80ee:1:0:204:76ff:fe97:d69a > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: icmp6: 3ffe:80ee:1:0:204:76ff:fe97:d69a udp port 33434 unreachable (len 72, hlim 63) > > 0x0000 6000 0000 0048 3a3f 3ffe 80ee 0001 0000 ....H:??....... > > 0x0010 0204 76ff fe97 d69a 3ffe 80ee 000a 0000 ..v.....?....... > > 0x0020 0201 03ff fed5 bd1e 0104 fb79 0000 0000 ...........y.... > > 0x0030 6000 0000 0018 1101 3ffe 80ee 000a 0000 .......?....... > > 0x0040 0201 03ff fed5 bd1e 3ffe 80ee 0001 0000 ........?....... > > 0x0050 0204 76ff fe97 d69a 8018 829a 0018 0c82 ..v............. > > 0x0060 0000 1df3 0000 0005 5b30 ae3f 3512 0200 ........[0.?5... > > > > > > Jan > > > From wsx@6com.sk Sun Nov 9 06:38:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 06:38:27 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Ec325030397 for ; Sun, 9 Nov 2003 06:38:04 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 085434C00083; Sun, 9 Nov 2003 09:37:58 -0500 (EST) Date: Sun, 9 Nov 2003 15:37:57 +0100 From: Jan Oravec To: netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031109143757.GA17943@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> <20031109132552.GA17096@wsx.ksp.sk> <20031109133939.GA17333@wsx.ksp.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031109133939.GA17333@wsx.ksp.sk> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1288 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev A colleague of mine has Opteron at home, he tried traceroute6 ::1 on 2.6.0-test9-bk4, here is the kernel output: RDX: 0000000000000048 RSI: 000001001ec06048 RDI: 000001011ec06218 RBP: 0000000000000048 R08: 0000000000000000 R09: 0000000000000000 R10: 000001001ea6d1c0 R11: 00000000000000dc R12: 0000000000000001 R13: 0000000000000000 R14: 000001001f95f740 R15: 000001001ec06048 FS: 0000002a958d2060(0000) GS:ffffffff804f4500(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000000101000 CR4: 00000000000006a0 Process traceroute6 (pid: 787, stackpage=1001eaf04e0) Stack: 0000000000000000 0000000000000000 0000000000000048 0000000000000048 000001001f95f740 0000000000000000 0000000000000048 ffffffff802e710f 0000000000000246 ffffffff8021f8d0 Call Trace:{csum_partial_copy_nocheck+15} {skb_copy_and_csum_bits+96} {icmpv6_getfrag+35} {ip6_append_data+1158} {icmpv6_getfrag+0} {icmpv6_send+1044} {updv6_rcv+647} {ip6_input_finish+429} {ip6_input_finish+0} {nf_hook_slow+227} {ip6_input_finish+0} {ip6_rcv_finish+0} {ip6_input+662} {nf_interate+94} {ip6_rcv_finish+0} {ip6_rcv_finish+31} {nf_hook_slow+227} {ip6_rcv_finish+0} {ipv6_rcv+503} {netif_receive_skb+394} {process_backlog+138} {net_rx_action+123} {do_softirq+123} {dev_queue_xmit+354} {neigh_resolve_output+322} {ip6_output_finish+0} {ip6_output_finish+163} {ip6_output_finish+0} {nf_hook_slow+227} {ip6_output_finish+0} {dst_output+0} {ip6_output2+540} {dst_output+17} {nf_hook_slow+227} {dst_output+0} {ip6_push_pending_frames+784} {ip6_append_data+1158} {udp_v6_push_pending_frames+319} {udpv6_sendmsg+1861} {inet_sendmsg+84} {sock_sendmsg+125} {find_get_page+13} {filemap_nopage+269} {do_no_page+813} {sockfd_lookup+32} {move_addr_to_kernel+39} {sys_sendto+233} {inet_setsockopt+18} {sys_setsockopt+147} {system_call+124} Code: c7 00 f2 ff ff ff eb d6 48 8b 44 24 08 c7 00 f2 ff ff ff eb RIP {csum_partial_copy_generic+349} RSP <000001001e6354c8> CR2: 0000000000000000 <0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing On Sun, Nov 09, 2003 at 02:39:39PM +0100, Jan Oravec wrote: > And another observation is that on 2.6.0-test9-bk4 on Opteron x86_64 when I > do: > > # traceroute6 ::1 > > The kernel crashs. > > I will have kernel OOPS output tommorow (the box is located in office) > > > > On Sun, Nov 09, 2003 at 02:25:53PM +0100, Jan Oravec wrote: > > This may be related to the problem (on sparc64): > > > > # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > > traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from ::1, 30 hops max, 24 byte packets > > Bus error > > > > # traceroute6 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 -s 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > > traceroute to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (3ffe:80ee:3bd:0:a00:20ff:fec7:a192) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets > > Bus error > > > > # traceroute6 www.kame.net > > traceroute to orange.kame.net (2001:200:0:8002:203:47ff:fea5:3085) from 3ffe:80ee:3bd:0:a00:20ff:fec7:a192, 30 hops max, 24 byte packets > > 1 skbra-00-01.pop.xs26.net (3ffe:80ee:3bd:0:a00:20ff:fec9:3aad) 0.953 ms 0.305 ms 0.341 ms > > ... > > > > The following lines are appearing in dmesg: > > raw v6 hw csum failure. > > > > All of this worked fine in 2.4.22-pre6. > > > > > > The common problem of 2.4 and 2.6 is with IPv4 traceroute, but it is > > probably because of buggy 64-bit traceroute, because it worked fine in > > 32-bit userspace: > > > > # traceroute www.google.com > > traceroute to www.google.akadns.net (216.239.57.99), 30 hops max, 52 byte packets > > Bus error > > > > > > > > On Sun, Nov 09, 2003 at 01:28:44PM +0100, Jan Oravec wrote: > > > Hello, > > > > > > > > > I have found the following problem with 2.6.0-test9-bk13 on sparc64: > > > > > > We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that > > > sparc64). We get the following corrupted answer: > > > > > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > > > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > > > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > > > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > > > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > > > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > > > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > > > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I > > > > > > > > > When doing exactly same to x86 box (with 2.6.0-test7-bk7 running), we get > > > the correct answer: > > > > > > 13:17:31.140230 3ffe:80ee:1:0:204:76ff:fe97:d69a > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: icmp6: 3ffe:80ee:1:0:204:76ff:fe97:d69a udp port 33434 unreachable (len 72, hlim 63) > > > 0x0000 6000 0000 0048 3a3f 3ffe 80ee 0001 0000 ....H:??....... > > > 0x0010 0204 76ff fe97 d69a 3ffe 80ee 000a 0000 ..v.....?....... > > > 0x0020 0201 03ff fed5 bd1e 0104 fb79 0000 0000 ...........y.... > > > 0x0030 6000 0000 0018 1101 3ffe 80ee 000a 0000 .......?....... > > > 0x0040 0201 03ff fed5 bd1e 3ffe 80ee 0001 0000 ........?....... > > > 0x0050 0204 76ff fe97 d69a 8018 829a 0018 0c82 ..v............. > > > 0x0060 0000 1df3 0000 0005 5b30 ae3f 3512 0200 ........[0.?5... > > > > > > > > > Jan > > > > > > From schuster.sven@gmx.de Sun Nov 9 06:48:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 06:49:05 -0800 (PST) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Emo25030844 for ; Sun, 9 Nov 2003 06:48:51 -0800 Received: (qmail 15969 invoked by uid 65534); 9 Nov 2003 14:48:39 -0000 Received: from p50884561.dip0.t-ipconnect.de (EHLO gmx.de) (80.136.69.97) by mail.gmx.net (mp001) with SMTP; 09 Nov 2003 15:48:39 +0100 X-Authenticated: #2425915 Message-ID: <3FAE528B.6090002@gmx.de> Date: Sun, 09 Nov 2003 15:43:23 +0100 From: Sven Schuster User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: de-de, en, en-us MIME-Version: 1.0 To: Rask Ingemann Lambertsen CC: linux-net@vger.kernel.org, netdev Subject: Re: Linux <---> Unixware slow networking with e100 References: <3FA9F8D5.9020601@gmx.de> <20031109123435.B1282@sygehus.dk> In-Reply-To: <20031109123435.B1282@sygehus.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1289 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schuster.sven@gmx.de Precedence: bulk X-list: netdev Rask Ingemann Lambertsen wrote: >On Thu, Nov 06, 2003 at 08:31:33AM +0100, Sven Schuster wrote: > > >>But when _receiving_ data from one of the unixware machines, we >>just get a few kB/s, max. about 100 kB/s. When _sending_ data to >>a unixware machine, the transfer rate is fine too. Are there any >>known issues between linux and unixware (except the SCO thing >>;-) ) ?? >> > >Run tcpdump and see what the window sizes are when sending data from >Unixware to Linux. > This actually seems to be a problem with either a switch in the network or with the onboard intel network card. I think it's one of the switches, or maybe the combination of those (one Planet FN-SW102 100 Mbit and one Foundry B15000 with the ports of our machines running at 100 Mbit), because we have the same slow transfer rates in this network from unixware to unixware. I did some tests yesterday directly from a redhat AS 2.1 to a unixware machine via cat. 7 crossover, and I didn't have any problems. And over a Planet switch (100 Mbit) there also were no problems. But thanks for your tip!! I'll get back and report what the issue was for the archives. Sven From mixxel@cs.auc.dk Sun Nov 9 12:53:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 12:53:34 -0800 (PST) Received: from loke.sp-aarhus.dk (loke.sp-aarhus.dk [130.225.8.55]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9KrI25009974 for ; Sun, 9 Nov 2003 12:53:19 -0800 Received: from 3e6b62de.rev.stofanet.dk ([62.107.98.222] helo=cs.auc.dk) by loke.sp-aarhus.dk with esmtp (Exim 3.35 #1 (Debian)) id 1AIvez-00080q-00; Sun, 09 Nov 2003 20:55:45 +0100 Message-ID: <3FAE9B9B.60007@cs.auc.dk> Date: Sun, 09 Nov 2003 20:55:07 +0100 From: Mikkel Christiansen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Emmanuel Fleury , "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: Announce: NetKeeper Firewall For Linux References: <1067285612.552.9.camel@aphrodite.olympus.net> <20031028014223.129933be.davem@redhat.com> <1067335655.10628.7.camel@rade7.s.cs.auc.dk> <1068001237.1064.31.camel@jzny.localdomain> <1068046114.31636.92.camel@rade7.s.cs.auc.dk> <1068089345.1020.17.camel@jzny.localdomain> <1068114376.1532.115.camel@rade7.s.cs.auc.dk> <1068211670.1031.49.camel@jzny.localdomain> In-Reply-To: <1068211670.1031.49.camel@jzny.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 1290 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mixxel@cs.auc.dk Precedence: bulk X-list: netdev jamal wrote: >On Thu, 2003-11-06 at 05:26, Emmanuel Fleury wrote: > > > >>Ok, actually we were so focused on the classification scheme that we >>didn't really try to do something nice for the actions... In a matter of >>facts, we have only one action (log) and it is not even implemented. >> >>So, we will definitely look at your code to avoid us to have to think >>about this part (and avoid to have to recode the actions). >> >> >> > >I am asking you to switch to the TC code. I dont think i am making my >point across ;->[1]. Integrate your classifer like any other tc >classifier and then you dont have to look at my code unless you really >want to. > > > If we integrate it would mean a new/alternative interface to tc where you compile the filter/configuratoin before uploading. We believe this is a good thing since it allows admins to (syntax) check the filter before inserting it. I believe the guys from shorewall sees this as a missing feature of iptables. Would you consider such an interface for tc good are bad? >>>Anything that requires "connection setup" to dynamically add rules is a >>>candidate. Think Voip SIP Proxy server for example which will insert >>>rules; think any authentication schemes that are needed before >>>installing rules, think tcp-splicing etc. >>> >>> >>Ok, but you are speaking about non permanent rules (aka dynamic rules). >> >> >> > >These types are most dominant these days in my opinion unless you are a >single user behind a DSL line. > > > >>The idea we have to handle stateful inspection is to have the core >>filter (totally static) plus some "state" nodes placed inside the IDD >>which are calling a function to evaluate the "state" of the packet >>(based on some informations given by the packet header and a database of >>the open connections). >> >> > >Isnt the state database another classifier and therefore you will be >faced with the same challenges for it? >I dont think you wuill get a free ride putting the state lookups >somewhere else. > > > current scheme cant handle dynamic rules - and it will be a while (if ever) before it can. >>When reaching the terminals, one of the action >>can be to change the state of the connection. >> >> > >tc allows you to have multiple cascaded classifiers; so >you could "reclassify" and jump to a state classifier. >I think the other guys from .dk also had their own scheme of achieving >the same goal. Being able to do this in my opinion is architecturally >cleaner. > > > >>I guess that what you describe can be handled by such mechanism >>(better than changing the ruleset each time). As it is handled outside >>of the IDD, this take only the time of the look-up in the database and >>the time to modify the database (when necessary). >> >> >> > >This is true if you consider the state database to be a different >problem other than a classification one. > > > >>But, I over simplified things here, this scheme is far from being ready >>at this point. We should investigate it more in depth (we need more >>time!!!). >> >> >> > >no problem. > > > >>>I think thats a design issue. For example while u32 classifier may not >>>process as fast as you (lookups would take longer relatively ) - its >>>insertion time is independent of the complexity of the rules. >>>Lakshman (sp?) had a good paper on the tradeoffs between memory space >>>used, lookup times and insertion times (there was another variable) and >>>i think he may have proved you cant have all of them work well at the >>>same time. >>> >>> >>Ok. Could you give more details about the references of this paper from >>Lakshman ? >> >> >> > >You are in academia, you better make sure you are aware of these >things ;-> > > > >The Lakshman paper describes an algorithm but i remember it was the >first to introduce classification constraints: > >T.V.Lakshman and D.Stiliadis. High Speed Policy-based Packet Forwarding >Using Efficient Multi-dimensional Range Matching. Proceedings of ACM >Sigcomm98 > >Another good paper to look at is: > >A.Feldmann and S.Muthukrishnan. Tradeoffs for packet classification. >Proceedings of IEEE Infocom2000 > > > >>I am wrong here, terribly wrong. The thing is that is you add a rule at >>the end of your filter, you will not have to rebuild it, but inserting a >>rule randomly in the list is... bad. For now, we don't have any good >>algorithm to insert a rule, so we just rebuild the whole thing. >> >> >> > >Then you have some work to do > > > >>>>When coding in the kernel, we are coding with the idea that: >>>> « The kernel should defend itself against user-space. » >>>> >>>>So, when the user say: "Commit". >>>> >>>>The kernel will first check the decision diagram for safety (no NULL >>>>pointers, out of range variables, no loops, etc) and depending of the >>>>tests, will take the decision to commit or not. >>>> >>>> >>>That sounds more like still a user space problem ;-> >>> >>> >>No. >> >>Users shouldn't be able to break the kernel just by misconfiguring it. >> >> >> > >Couldnt you, knowing the rules already existing check for breakage in >user space? > > > no - if someone decided to write their own "client/compiler" in userspace they could potentially produce a broken IDD - that could crash the kernel! >>>I saw in your paper briefly that you have infact a checker for something >>>like this. >>> >>> >>If you are speaking about the "network access verifier", it is something >>totally different. But, I might have misunderstood you. >> >> >> > >I meant that network access verifier. I believe you should be able to >verify things not only just in user space bu even in a remote location >(example a network management station). Now this stuff is interesting. > > > >>>In my view the most important issues in priority order are: >>>lookup speed regardless of table size, insert/delete rate regardless of >>>table size, Capacity (should be able to go to the hundreds of thousands >>>of flows), memory use for storage purposes - although i dont really care >>>very much about these since memory is cheap these days. >>> >>> >>Ok, I think we have to work on the insert/delete part. I know for a fact >>that insert/delete inside the IDD is not an option (as the complexity of >>this operation is too high), so we will look at some other way to handle >>it. >> >> >> > >cool. Looking forward to see some of your thoughts on this when you have >experienced it. > >cheers, >jamal > >[1] Look at your action code dispatch name and my old one and note the >name being _exactly_ the same. I dont think it is a big coincidence and >i dont think you had any bad intent. I am just saying you can continue >doing that or you can integrate. Why dont we drop this part of the >discussion if you dont wanna move forward to the tc code? I thought you >agreed with Dave to integrate ;-> > > > Well, then you need to think again - it is in fact a coincidence! Cheers Mikkel From yoshfuji@linux-ipv6.org Sun Nov 9 13:59:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 13:59:51 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9Lxb25010892 for ; Sun, 9 Nov 2003 13:59:37 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA9Lxqlg032593; Mon, 10 Nov 2003 06:59:53 +0900 Date: Sun, 09 Nov 2003 15:59:52 -0600 (CST) Message-Id: <20031109.155952.106613268.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH 2/2] [IPV{4,6}] Normalize jiffies values reported to userspace From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1292 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. [2/2] [IPV{4,6}] Normalize jiffies values reported to userspace ===== net/ipv4/route.c 1.73 vs edited ===== --- 1.73/net/ipv4/route.c Tue Oct 7 23:54:12 2003 +++ edited/net/ipv4/route.c Mon Nov 10 06:34:08 2003 @@ -89,6 +89,7 @@ #include #include #include +#include #include #include #include @@ -2309,7 +2310,7 @@ ci.rta_used = rt->u.dst.__use; ci.rta_clntref = atomic_read(&rt->u.dst.__refcnt); if (rt->u.dst.expires) - ci.rta_expires = rt->u.dst.expires - jiffies; + ci.rta_expires = jiffies_to_clock_t(rt->u.dst.expires - jiffies); else ci.rta_expires = 0; ci.rta_error = rt->u.dst.error; ===== net/ipv6/route.c 1.58 vs edited ===== --- 1.58/net/ipv6/route.c Sun Aug 31 13:26:12 2003 +++ edited/net/ipv6/route.c Mon Nov 10 06:34:08 2003 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -717,7 +718,7 @@ return -ENOMEM; rt->u.dst.obsolete = -1; - rt->rt6i_expires = rtmsg->rtmsg_info; + rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info); if (nlh && (r = NLMSG_DATA(nlh))) { rt->rt6i_protocol = r->rtm_protocol; } else { @@ -1535,7 +1536,7 @@ RTA_PUT(skb, RTA_PRIORITY, 4, &rt->rt6i_metric); ci.rta_lastuse = jiffies - rt->u.dst.lastuse; if (rt->rt6i_expires) - ci.rta_expires = rt->rt6i_expires - jiffies; + ci.rta_expires = jiffies_to_clock_t(rt->rt6i_expires - jiffies); else ci.rta_expires = 0; ci.rta_used = rt->u.dst.__use; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Nov 9 13:59:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 13:59:26 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9LxC25010856 for ; Sun, 9 Nov 2003 13:59:12 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hA9LxQlg032590; Mon, 10 Nov 2003 06:59:26 +0900 Date: Sun, 09 Nov 2003 15:59:25 -0600 (CST) Message-Id: <20031109.155925.112987543.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH 1/2] linux/times.h needs asm/param.h From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1291 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev [1/1] linux/times.h needs asm/param.h linux/times.h depends on asm/param.h (USER_HZ). ===== include/linux/times.h 1.4 vs edited ===== --- 1.4/include/linux/times.h Fri Jul 18 01:54:48 2003 +++ edited/include/linux/times.h Mon Nov 10 06:34:07 2003 @@ -4,6 +4,7 @@ #ifdef __KERNEL__ #include #include +#include #if (HZ % USER_HZ)==0 # define jiffies_to_clock_t(x) ((x) / (HZ / USER_HZ)) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From rddunlap@osdl.org Sun Nov 9 15:29:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 15:29:29 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hA9NTD25013076 for ; Sun, 9 Nov 2003 15:29:14 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hA9NT4C24939; Sun, 9 Nov 2003 15:29:04 -0800 Date: Sun, 9 Nov 2003 15:26:43 -0800 From: "Randy.Dunlap" To: Rask Ingemann Lambertsen Cc: netdev@oss.sgi.com, saw@saw.sw.com.sg, akpm@osdl.org Subject: Re: [PATCH] enabling netdev boot options (2.6.0-t9) Message-Id: <20031109152643.73688224.rddunlap@osdl.org> In-Reply-To: <20031109115535.A1282@sygehus.dk> References: <20031108160441.3a0a5505.rddunlap@osdl.org> <20031108204406.5dbbdc87.rddunlap@osdl.org> <20031109115535.A1282@sygehus.dk> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1293 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Sun, 9 Nov 2003 11:55:35 +0100 Rask Ingemann Lambertsen wrote: | I don't like that name for the function. dev_alloc_name_lock() makes it | natural to think that there is a matching dev_alloc_name_unlock() function | which you should call afterwards. How about dev_alloc_name_locked() or | dev_alloc_name_with_lock() instead? I didn't like that name either. Now changed to dev_alloc_name_locked() and exported. Take 3 below. More comments? -- ~Randy description: enable eepro100 and 3c59x drivers to recognize 'netdev=' boot options: use dev_alloc_name() to assign an interface name if rtnl lock is already held (eepro100); use [new] dev_alloc_name_locked() to assign interface name if required lock is not already held; then use netdev_boot_setup_check() to check for boot options for that interface (name); add dev_alloc_name_locked() to net/core/dev.c; export dev_alloc_name_locked() for modules; maintainer: Andrey V. Savochkin (saw@saw.sw.com.sg); Andrew Morton (akpm@osdl.org) et al product_versions: Linux 2.6.0-test9 diffstat:= drivers/net/3c59x.c | 6 ++++++ drivers/net/eepro100.c | 12 +++++++----- include/linux/netdevice.h | 1 + net/core/dev.c | 24 ++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff -Naurp ./drivers/net/eepro100.c~netdev ./drivers/net/eepro100.c --- ./drivers/net/eepro100.c~netdev 2003-10-25 11:44:01.000000000 -0700 +++ ./drivers/net/eepro100.c 2003-11-08 20:05:38.000000000 -0800 @@ -681,17 +681,19 @@ static int __devinit speedo_found1(struc SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (dev->mem_start > 0) + rtnl_lock(); + + if (dev_alloc_name(dev, dev->name) < 0) + goto err_free_unlock; + + if (netdev_boot_setup_check(dev) && dev->mem_start > 0) { option = dev->mem_start; + } else if (card_idx >= 0 && options[card_idx] >= 0) option = options[card_idx]; else option = 0; - rtnl_lock(); - if (dev_alloc_name(dev, dev->name) < 0) - goto err_free_unlock; - /* Read the station address EEPROM before doing the reset. Nominally his should even be done before accepting the device, but then we wouldn't have a device name with which to report the error. diff -Naurp ./drivers/net/3c59x.c~netdev ./drivers/net/3c59x.c --- ./drivers/net/3c59x.c~netdev 2003-10-25 11:42:42.000000000 -0700 +++ ./drivers/net/3c59x.c 2003-11-09 15:13:01.000000000 -0800 @@ -1110,6 +1110,12 @@ static int __devinit vortex_probe1(struc SET_NETDEV_DEV(dev, gendev); vp = dev->priv; + retval = dev_alloc_name_locked(dev, dev->name); + if (retval < 0) + goto free_region; + + netdev_boot_setup_check(dev); + option = global_options; /* The lower four bits are the media type. */ diff -Naurp ./net/core/dev.c~netdev ./net/core/dev.c --- ./net/core/dev.c~netdev 2003-10-25 11:43:39.000000000 -0700 +++ ./net/core/dev.c 2003-11-09 15:04:10.000000000 -0800 @@ -635,6 +635,29 @@ int dev_alloc_name(struct net_device *de } /** + * dev_alloc_name_locked - allocate a name for a device, + * with required locking + * @dev: device + * @name: name format string + * + * Passed a format string - eg "lt%d" it will try and find a suitable + * id. Not efficient for many devices, not called a lot. + * This function takes the rtnl lock while allocating the name and + * adding the device in order to avoid duplicates. + * Returns the number of the unit assigned or a negative errno code. + */ + +int dev_alloc_name_locked(struct net_device *dev, const char *name) +{ + int ret; + + rtnl_lock(); + ret = dev_alloc_name(dev, name); + rtnl_unlock(); + return ret; +} + +/** * dev_alloc - allocate a network device and name * @name: name format string * @err: error return pointer @@ -3035,6 +3058,7 @@ EXPORT_SYMBOL(call_netdevice_notifiers); EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(__dev_alloc); EXPORT_SYMBOL(dev_alloc_name); +EXPORT_SYMBOL(dev_alloc_name_locked); EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_get_by_flags); EXPORT_SYMBOL(dev_get_by_index); diff -Naurp ./include/linux/netdevice.h~netdev ./include/linux/netdevice.h --- ./include/linux/netdevice.h~netdev 2003-10-25 11:44:45.000000000 -0700 +++ ./include/linux/netdevice.h 2003-11-09 15:13:41.000000000 -0800 @@ -518,6 +518,7 @@ static inline __deprecated struct net_de return __dev_alloc(name, err); } extern int dev_alloc_name(struct net_device *dev, const char *name); +extern int dev_alloc_name_locked(struct net_device *dev, const char *name); extern int dev_open(struct net_device *dev); extern int dev_close(struct net_device *dev); extern int dev_queue_xmit(struct sk_buff *skb); From davem@pizda.ninka.net Sun Nov 9 19:30:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Nov 2003 19:31:07 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAA3Uq25018584 for ; Sun, 9 Nov 2003 19:30:52 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA11921; Sun, 9 Nov 2003 19:25:02 -0800 Date: Sun, 9 Nov 2003 19:25:02 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/2] [IPV{4,6}] Normalize jiffies values reported to userspace Message-Id: <20031109192502.4f60783b.davem@redhat.com> In-Reply-To: <20031109.155952.106613268.yoshfuji@linux-ipv6.org> References: <20031109.155952.106613268.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1294 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 09 Nov 2003 15:59:52 -0600 (CST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > [1/1] linux/times.h needs asm/param.h > [2/2] [IPV{4,6}] Normalize jiffies values reported to userspace Both patches applied, arigato Yoshfuji-san. From fdonzet@yahoo.fr Mon Nov 10 00:14:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 00:15:01 -0800 (PST) Received: from web25201.mail.ukl.yahoo.com (web25201.mail.ukl.yahoo.com [217.12.10.61]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAA8EN25025114 for ; Mon, 10 Nov 2003 00:14:24 -0800 Message-ID: <20031110081417.55732.qmail@web25201.mail.ukl.yahoo.com> Received: from [195.68.44.148] by web25201.mail.ukl.yahoo.com via HTTP; Mon, 10 Nov 2003 09:14:17 CET Date: Mon, 10 Nov 2003 09:14:17 +0100 (CET) From: =?iso-8859-1?q?francois=20donzet?= Subject: Re: problem in driver network code To: Rask Ingemann Lambertsen Cc: netdev@oss.sgi.com In-Reply-To: <20031107181508.A1102@sygehus.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1295 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fdonzet@yahoo.fr Precedence: bulk X-list: netdev --- Rask Ingemann Lambertsen a écrit : > On Fri, Nov 07, 2003 at 09:38:44AM +0100, francois > donzet wrote: > > > > It seems to me that there is a problem ;). If i > store > > in skb->csum a sum of all words of the packet > data, it > > will be unusable by tcp (the skb->csum doesn't > > contain the checksum of tcpheader plus data only, > as > > the ipheader is part of the packet when the sum is > > computed) > > That can be accounted for by the TCP code because > the IP header is known to > the TCP code. IIRC, the pseudoheader is similiar to > a real IP header, so it > may take just a few lines of code to make up for the > difference, but I > haven't checked that. The theory seems fine, but there is no clue of this way in the code. > What do you do with an IEEE 802.1q (VLAN) or 802.2 > (LLC) packet? The VLAN > code in vlan_skb_recv() does not adjust skb->csum or > skb->ip_summed. Neither > does the 802.2 code. no matter the link layer header is 802.3,802.2 or 8021.q . Tcp checksum offloading is supported, whatever the type of the link layer (as skb->csum is computed without the link layer header). ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From fdonzet@yahoo.fr Mon Nov 10 03:29:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 03:29:39 -0800 (PST) Received: from web25201.mail.ukl.yahoo.com (web25201.mail.ukl.yahoo.com [217.12.10.61]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAABTL25031375 for ; Mon, 10 Nov 2003 03:29:21 -0800 Message-ID: <20031110112915.3483.qmail@web25201.mail.ukl.yahoo.com> Received: from [195.68.44.148] by web25201.mail.ukl.yahoo.com via HTTP; Mon, 10 Nov 2003 12:29:15 CET Date: Mon, 10 Nov 2003 12:29:15 +0100 (CET) From: =?iso-8859-1?q?francois=20donzet?= Subject: checksum offloading To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1296 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fdonzet@yahoo.fr Precedence: bulk X-list: netdev Hi, i have a little question : When tcp checksum offloading is enabled, the chip computes a sum on all words of the packet contents and stores the result in skb->csum, setting skb->ip_summed to CHECKSUM_HW. (see for example, e100_main.c) Then, when packet reaches tcp layer, via tcp_checksum_init(), tcp checksum is verified (using together skb->csum and the pseudo header checksum). How does TCP deal with skb->csum, as it doesn't cover only the tcpheader+data (but ipheader+tcpheader+data) Thanks. ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From filia@softhome.net Mon Nov 10 03:10:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 03:34:57 -0800 (PST) Received: from natsmtp01.rzone.de (natsmtp01.rzone.de [81.169.145.166]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAABAp25031214 for ; Mon, 10 Nov 2003 03:10:52 -0800 Received: from softhome.net ([212.18.200.6]) by post.webmailer.de (8.12.10/8.12.10) with ESMTP id hAABAlOw000089; Mon, 10 Nov 2003 12:10:48 +0100 (MET) Message-ID: <3FAF7236.7020209@softhome.net> Date: Mon, 10 Nov 2003 12:10:46 +0100 From: "Ihar 'Philips' Filipau" Organization: Home Sweet Home User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030927 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Linux Kernel Mailing List CC: netdev@oss.sgi.com Subject: net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1297 X-Approved-By: ralf@linux-mips.org X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: filia@softhome.net Precedence: bulk X-list: netdev Hi! [ I'm trying to cc: netdev - but they are not that welcome - and require subscription. I'm way too lazy (and my mail box is not that fast) to subscribe to send simple typo - if this is a case at all. ] [ kernel v2.6.0-test7 as found on lxr.linux.no, 2.4.{18,22} has the same - but line numbers are different. ] On line 1057 we have: "msg->msg_flags|=MSG_TRUNC;" to indicate that message was truncated. But on line 1073, where we make return status to user, we check against user suplied flags, but NOT msg->msg_flags. It looks like obvious typo. -- Ihar 'Philips' Filipau / with best regards from Saarbruecken. -- _ _ _ "... and for $64000 question, could you get yourself |_|*|_| vaguely familiar with the notion of on-topic posting?" |_|_|*| -- Al Viro @ LKML |*|*|*| From hno@marasystems.com Mon Nov 10 07:12:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 07:12:50 -0800 (PST) Received: from filer.marasystems.com (marasystems.com [213.150.153.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAFCN25006918 for ; Mon, 10 Nov 2003 07:12:25 -0800 Received: from localhost (henrik@localhost) by filer.marasystems.com (8.11.6/8.11.6) with ESMTP id hAAFC4F04138; Mon, 10 Nov 2003 16:12:04 +0100 Date: Mon, 10 Nov 2003 16:12:04 +0100 (CET) From: Henrik Nordstrom X-X-Sender: henrik@filer.marasystems.com To: Mikkel Christiansen cc: hadi@cyberus.ca, Emmanuel Fleury , "David S. Miller" , , Subject: Re: Announce: NetKeeper Firewall For Linux In-Reply-To: <3FAE9B9B.60007@cs.auc.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1298 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hno@marasystems.com Precedence: bulk X-list: netdev On Sun, 9 Nov 2003, Mikkel Christiansen wrote: > uploading. We believe this is a good thing since it allows > admins to (syntax) check the filter before inserting it. > I believe the guys from shorewall sees this as a missing > feature of iptables. See iptables-restore. It is exacly this (compile whole ruleset before insert) for iptables. The only thing missing is that it only compiles one table at a time. Regards Henrik From yoshfuji@linux-ipv6.org Mon Nov 10 08:45:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 08:45:55 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAGjK25011460 for ; Mon, 10 Nov 2003 08:45:41 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hAAGjalg004853; Tue, 11 Nov 2003 01:45:36 +0900 Date: Mon, 10 Nov 2003 10:45:36 -0600 (CST) Message-Id: <20031110.104536.79654717.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1299 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. more jiffies normalizations reported to userspace, in core/neighbour.c. ===== include/linux/sysctl.h 1.53 vs edited ===== --- 1.53/include/linux/sysctl.h Thu Oct 30 05:19:30 2003 +++ edited/include/linux/sysctl.h Tue Nov 11 01:12:31 2003 @@ -726,6 +726,8 @@ void __user *, size_t *); extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, void __user *, size_t *); +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, + void __user *, size_t *); extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, ===== kernel/sysctl.c 1.55 vs edited ===== --- 1.55/kernel/sysctl.c Thu Oct 2 16:12:07 2003 +++ edited/kernel/sysctl.c Tue Nov 11 01:12:32 2003 @@ -37,6 +37,7 @@ #include #include #include +#include #include #ifdef CONFIG_ROOT_NFS @@ -1750,6 +1751,114 @@ return do_proc_dointvec(table,write,filp,buffer,lenp,HZ,OP_SET); } +/** + * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds + * @table: the sysctl table + * @write: %TRUE if this is a write to the sysctl file + * @filp: the file structure + * @buffer: the user buffer + * @lenp: the size of the user buffer + * + * Reads/writes up to table->maxlen/sizeof(unsigned int) integer + * values from/to the user buffer, treated as an ASCII string. + * The values read are assumed to be in 1/USER_HZ seconds, and + * are converted into jiffies. + * + * Returns 0 on success. + */ +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void __user *buffer, size_t *lenp) +{ + int *i, vleft, first=1, neg, val; + size_t left, len; + + #define TMPBUFLEN 20 + char buf[TMPBUFLEN], *p; + + if (!table->data || !table->maxlen || !*lenp || + (filp->f_pos && !write)) { + *lenp = 0; + return 0; + } + + i = (int *) table->data; + vleft = table->maxlen / sizeof(int); + left = *lenp; + + for (; left && vleft--; i++, first=0) { + if (write) { + while (left) { + char c; + if (get_user(c,(char __user *) buffer)) + return -EFAULT; + if (!isspace(c)) + break; + left--; + buffer++; + } + if (!left) + break; + neg = 0; + len = left; + if (len > TMPBUFLEN-1) + len = TMPBUFLEN-1; + if(copy_from_user(buf, buffer, len)) + return -EFAULT; + buf[len] = 0; + p = buf; + if (*p == '-' && left > 1) { + neg = 1; + left--, p++; + } + if (*p < '0' || *p > '9') + break; + val = clock_t_to_jiffies(simple_strtoul(p, &p, 0)); + len = p-buf; + if ((len < left) && *p && !isspace(*p)) + break; + if (neg) + val = -val; + buffer += len; + left -= len; + *i = val; + } else { + p = buf; + if (!first) + *p++ = '\t'; + sprintf(p, "%d", jiffies_to_clock_t(*i)); + len = strlen(buf); + if (len > left) + len = left; + if(copy_to_user(buffer, buf, len)) + return -EFAULT; + left -= len; + buffer += len; + } + } + + if (!write && !first && left) { + if(put_user('\n', (char *) buffer)) + return -EFAULT; + left--, buffer++; + } + if (write) { + p = (char *) buffer; + while (left) { + char c; + if(get_user(c, p++)) + return -EFAULT; + if (!isspace(c)) + break; + left--; + } + } + if (write && first) + return -EINVAL; + *lenp -= left; + filp->f_pos += *lenp; + return 0; +} + #else /* CONFIG_PROC_FS */ int proc_dostring(ctl_table *table, int write, struct file *filp, @@ -1788,6 +1897,12 @@ return -ENOSYS; } +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) +{ + return -ENOSYS; +} + int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) { @@ -1975,6 +2090,12 @@ return -ENOSYS; } +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) +{ + return -ENOSYS; +} + int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { @@ -2007,6 +2128,7 @@ EXPORT_SYMBOL(proc_dointvec); EXPORT_SYMBOL(proc_dointvec_jiffies); EXPORT_SYMBOL(proc_dointvec_minmax); +EXPORT_SYMBOL(proc_dointvec_userhz_jiffies); EXPORT_SYMBOL(proc_dostring); EXPORT_SYMBOL(proc_doulongvec_minmax); EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); ===== net/core/neighbour.c 1.20 vs edited ===== --- 1.20/net/core/neighbour.c Tue Oct 21 14:59:11 2003 +++ edited/net/core/neighbour.c Tue Nov 11 01:12:34 2003 @@ -24,6 +24,7 @@ #ifdef CONFIG_SYSCTL #include #endif +#include #include #include #include @@ -1510,7 +1511,7 @@ .procname = "retrans_time", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_REACHABLE_TIME, @@ -1552,21 +1553,21 @@ .procname = "anycast_delay", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_PROXY_DELAY, .procname = "proxy_delay", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_LOCKTIME, .procname = "locktime", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_GC_INTERVAL, -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Mon Nov 10 08:48:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 08:48:40 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAGmR25014594 for ; Mon, 10 Nov 2003 08:48:27 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hAAGmhlg004896; Tue, 11 Nov 2003 01:48:43 +0900 Date: Mon, 10 Nov 2003 10:48:43 -0600 (CST) Message-Id: <20031110.104843.65576225.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] DECNET: Normalize jiffies reported to userspace From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1300 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. jiffies normalization for decnet. ===== net/decnet/dn_route.c 1.18 vs edited ===== --- 1.18/net/decnet/dn_route.c Wed Jul 23 15:33:06 2003 +++ edited/net/decnet/dn_route.c Tue Nov 11 01:31:31 2003 @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -1508,11 +1509,11 @@ RTA_PUT(skb, RTA_GATEWAY, 2, &rt->rt_gateway); if (rtnetlink_put_metrics(skb, rt->u.dst.metrics) < 0) goto rtattr_failure; - ci.rta_lastuse = jiffies - rt->u.dst.lastuse; + ci.rta_lastuse = jiffies_to_clock_t(jiffies - rt->u.dst.lastuse); ci.rta_used = rt->u.dst.__use; ci.rta_clntref = atomic_read(&rt->u.dst.__refcnt); if (rt->u.dst.expires) - ci.rta_expires = rt->u.dst.expires - jiffies; + ci.rta_expires = jiffies_to_clock_t(rt->u.dst.expires - jiffies); else ci.rta_expires = 0; ci.rta_error = rt->u.dst.error; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Mon Nov 10 08:50:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 08:50:20 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAGo625014950 for ; Mon, 10 Nov 2003 08:50:07 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hAAGoNlg004930; Tue, 11 Nov 2003 01:50:23 +0900 Date: Mon, 10 Nov 2003 10:50:23 -0600 (CST) Message-Id: <20031110.105023.116811039.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] IPV{4,6}: Normalize jiffies reported to userspace in routing code (missing pieces) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1301 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Sorry, I failed to fix these bits. ===== net/ipv4/route.c 1.74 vs edited ===== --- 1.74/net/ipv4/route.c Mon Nov 10 12:26:48 2003 +++ edited/net/ipv4/route.c Tue Nov 11 01:43:28 2003 @@ -2306,7 +2306,7 @@ RTA_PUT(skb, RTA_GATEWAY, 4, &rt->rt_gateway); if (rtnetlink_put_metrics(skb, rt->u.dst.metrics) < 0) goto rtattr_failure; - ci.rta_lastuse = jiffies - rt->u.dst.lastuse; + ci.rta_lastuse = jiffies_to_clock_t(jiffies - rt->u.dst.lastuse); ci.rta_used = rt->u.dst.__use; ci.rta_clntref = atomic_read(&rt->u.dst.__refcnt); if (rt->u.dst.expires) ===== net/ipv6/route.c 1.59 vs edited ===== --- 1.59/net/ipv6/route.c Mon Nov 10 12:26:48 2003 +++ edited/net/ipv6/route.c Tue Nov 11 01:42:00 2003 @@ -1534,7 +1534,7 @@ if (rt->u.dst.dev) RTA_PUT(skb, RTA_OIF, sizeof(int), &rt->rt6i_dev->ifindex); RTA_PUT(skb, RTA_PRIORITY, 4, &rt->rt6i_metric); - ci.rta_lastuse = jiffies - rt->u.dst.lastuse; + ci.rta_lastuse = jiffies_to_clock_t(jiffies - rt->u.dst.lastuse); if (rt->rt6i_expires) ci.rta_expires = jiffies_to_clock_t(rt->rt6i_expires - jiffies); else -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From pp@ee.oulu.fi Mon Nov 10 10:19:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 10:19:34 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAIJJ25023776 for ; Mon, 10 Nov 2003 10:19:20 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id hAAIJHf2012689 for ; Mon, 10 Nov 2003 20:19:17 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.12.10/8.12.10/Submit) id hAAIJHNl025857 for netdev@oss.sgi.com; Mon, 10 Nov 2003 20:19:17 +0200 (EET) Date: Mon, 10 Nov 2003 20:19:17 +0200 From: Pekka Pietikainen To: netdev@oss.sgi.com Subject: [patch] 2.4 lacks dummy SET_NETDEV_DEV Message-ID: <20031110181917.GA25846@ee.oulu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 1302 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev Just noticed that 2.4 doesn't have a dummy SET_NETDEV_DEV for drivers written for 2.6 (like the b44 fixes that got merged a few days back, so it wouldn't actually compile :-) ) --- linux-2.4.22/include/linux/netdevice.h.orig 2003-10-03 20:30:14.000000000 +0300 +++ linux-2.4.22/include/linux/netdevice.h 2003-11-10 20:12:46.480609408 +0200 @@ -454,6 +454,8 @@ #endif /* CONFIG_NET_DIVERT */ }; +/* 2.6 compatibility */ +#define SET_NETDEV_DEV(net, pdev) do { } while (0) struct packet_type { From riel@redhat.com Mon Nov 10 13:31:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 13:31:47 -0800 (PST) Received: from chimarrao.boston.redhat.com (nat-pool-bos.redhat.com [66.187.230.200]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAALVV25029471 for ; Mon, 10 Nov 2003 13:31:31 -0800 Received: from chimarrao.boston.redhat.com (localhost.localdomain [127.0.0.1]) by chimarrao.boston.redhat.com (8.12.8/8.12.8) with ESMTP id hAALVUeh002978; Mon, 10 Nov 2003 16:31:30 -0500 Received: from localhost (riel@localhost) by chimarrao.boston.redhat.com (8.12.8/8.12.8/Submit) with ESMTP id hAALVTap002975; Mon, 10 Nov 2003 16:31:29 -0500 X-Authentication-Warning: chimarrao.boston.redhat.com: riel owned process doing -bs Date: Mon, 10 Nov 2003 16:31:29 -0500 (EST) From: Rik van Riel X-X-Sender: riel@chimarrao.boston.redhat.com To: Dave Miller cc: linux-kernel@vger.kernel.org, Subject: 2.6 ipv6 doesn't take route advertisements Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1303 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: riel@redhat.com Precedence: bulk X-list: netdev Hi, it looks like the 2.6 kernel doesn't take default route advertisements from either zebra or radvd. I can see the default routes being advertised with radvdump, but they don't show up in the routing table of either of my 2.6 machines. They both run a fairly recent 2.6 kernel. Known bug ? -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan From gandalf@wlug.westbo.se Mon Nov 10 13:59:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 13:59:15 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAALx125031012 for ; Mon, 10 Nov 2003 13:59:02 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id AACEB2C0013; Mon, 10 Nov 2003 22:58:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id 562092C0014; Mon, 10 Nov 2003 22:58:57 +0100 (CET) Received: from null.rsn.bth.se ([127.0.0.1]) by localhost (null [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 23256-10; Mon, 10 Nov 2003 22:58:56 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id BD4742C0013; Mon, 10 Nov 2003 22:58:56 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id 496754408; Mon, 10 Nov 2003 22:58:57 +0100 (CET) Subject: Re: 2.6 ipv6 doesn't take route advertisements From: Martin Josefsson To: Rik van Riel Cc: Dave Miller , linux-kernel@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-JE8rCjEXJ8wazuw75Pzj" Message-Id: <1068501536.774.1.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 10 Nov 2003 22:58:57 +0100 X-Virus-Scanned: by amavisd-new-20030616-p5 X-archive-position: 1304 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev --=-JE8rCjEXJ8wazuw75Pzj Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2003-11-10 at 22:31, Rik van Riel wrote: > Hi, >=20 > it looks like the 2.6 kernel doesn't take default route > advertisements from either zebra or radvd. I can see > the default routes being advertised with radvdump, but > they don't show up in the routing table of either of my > 2.6 machines. They both run a fairly recent 2.6 kernel. >=20 > Known bug ? Works fine here with test9-bk15 Router runs radvd. default dev eth1 proto kernel metric 256 mtu 1500 advmss 1440 metric10 6= 4 default dev eth2 proto kernel metric 256 mtu 1500 advmss 1440 metric10 6= 4 default via fe80::202:b3ff:fe5f:11fd dev eth0 proto kernel metric 1024 e= xpires 1788sec mtu 1500 advmss 1440 metric10 64 --=20 /Martin --=-JE8rCjEXJ8wazuw75Pzj Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/sAofWm2vlfa207ERAl3aAKCFBsQN6V2ftFEyssROiv5wmN5NLwCfbmQP /lEiXbz/YuRCVL8c/zjYFVU= =p5gv -----END PGP SIGNATURE----- --=-JE8rCjEXJ8wazuw75Pzj-- From pp@ee.oulu.fi Mon Nov 10 14:14:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 14:14:47 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAAMEW25000386 for ; Mon, 10 Nov 2003 14:14:34 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.12.10/8.12.10) with ESMTP id hAAMEVf2004428 for ; Tue, 11 Nov 2003 00:14:31 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.12.10/8.12.10/Submit) id hAAMEU8D026560 for netdev@oss.sgi.com; Tue, 11 Nov 2003 00:14:30 +0200 (EET) Date: Tue, 11 Nov 2003 00:14:30 +0200 From: Pekka Pietikainen To: netdev@oss.sgi.com Subject: Re: [patch] 2.4 lacks dummy SET_NETDEV_DEV Message-ID: <20031110221430.GA26556@ee.oulu.fi> References: <20031110181917.GA25846@ee.oulu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20031110181917.GA25846@ee.oulu.fi> User-Agent: Mutt/1.4.1i X-archive-position: 1305 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Mon, Nov 10, 2003 at 08:19:17PM +0200, Pekka Pietikainen wrote: > Just noticed that 2.4 doesn't have a dummy SET_NETDEV_DEV for drivers > written for 2.6 (like the b44 fixes that got merged a few days back, so > it wouldn't actually compile :-) ) Ah, except Jeff merged a version without the call so there should be no problem :-) (I still like the idea of being able to use exactly the same driver source on 2.4/2.6 though) From johnip@sgi.com Mon Nov 10 17:25:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 17:25:33 -0800 (PST) Received: from tolkor.sgi.com (tolkor.SGI.COM [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB1Ot25005745 for ; Mon, 10 Nov 2003 17:25:15 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hAB1ibHc013388 for ; Mon, 10 Nov 2003 19:44:37 -0600 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hAB1OnP513480711; Mon, 10 Nov 2003 19:24:49 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hAB1OaRn345584938; Mon, 10 Nov 2003 19:24:37 -0600 (CST) Message-ID: <3FB03A56.7000709@sgi.com> Date: Mon, 10 Nov 2003 19:24:38 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> In-Reply-To: <20031014095323.71c8b9fe.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1306 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev I'm working on a patch for the tg3 driver for 2.6 Please can you look at this. I'm not too sure about the Kconfig entry as I have not done one before :- --- linux/drivers/net/tg3.c 2003-11-10 18:28:10.000000000 -0600 +++ patch/drivers/net/tg3.c 2003-11-10 18:58:35.000000000 -0600 @@ -2257,7 +2257,11 @@ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#if defined(CONFIG_UNALIGNED_EXPENSIVE) + && tp->rx_offset == 2 +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, --- linux/drivers/net/Kconfig 2003-10-25 13:44:36.000000000 -0500 +++ patch/drivers/net/Kconfig 2003-11-10 19:21:15.000000000 -0600 @@ -2017,6 +2017,9 @@ To compile this driver as a module, choose M here: the module will be called tg3. This is recommended. +config CONFIG_UNALIGNED_EXPENSIVE + bool "Use Aligned SKB's for 5701 cards (for Itanium2 based systems)" + depends on TIGON3 && IA64 endmenu # Thks John -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From davem@pizda.ninka.net Mon Nov 10 18:19:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 18:19:54 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB2Jd25006487 for ; Mon, 10 Nov 2003 18:19:40 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA15107; Mon, 10 Nov 2003 18:13:19 -0800 Date: Mon, 10 Nov 2003 18:13:19 -0800 From: "David S. Miller" To: francois donzet Cc: netdev@oss.sgi.com Subject: Re: checksum offloading Message-Id: <20031110181319.0a6e0463.davem@redhat.com> In-Reply-To: <20031110112915.3483.qmail@web25201.mail.ukl.yahoo.com> References: <20031110112915.3483.qmail@web25201.mail.ukl.yahoo.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1307 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev I would like to ask that you not send out your questions to all the mailing lists _AND_ privately to every developer you can find an email address for. This is rude and greatly _DECREASES_ the likelyhood that someone will bother to answer your question. Thanks. From davem@pizda.ninka.net Mon Nov 10 18:35:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 18:35:49 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB2Za25006901 for ; Mon, 10 Nov 2003 18:35:36 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA15160; Mon, 10 Nov 2003 18:29:11 -0800 Date: Mon, 10 Nov 2003 18:29:11 -0800 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031110182911.2c5a121b.davem@redhat.com> In-Reply-To: <3FB03A56.7000709@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1308 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Nov 2003 19:24:38 -0600 John Partridge wrote: > Please can you look at this. I'm not too sure about the Kconfig entry as I have not done one before :- It belongs in arch/${ARCH}/Kconfig not drivers/net/Kconfig It's a static property of the architecture, not something the user chooses one way or the other. From davem@pizda.ninka.net Mon Nov 10 22:20:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 22:20:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB6KV25012378 for ; Mon, 10 Nov 2003 22:20:33 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA15677; Mon, 10 Nov 2003 22:14:29 -0800 Date: Mon, 10 Nov 2003 22:14:29 -0800 From: "David S. Miller" To: Pekka Pietikainen Cc: netdev@oss.sgi.com Subject: Re: [patch] 2.4 lacks dummy SET_NETDEV_DEV Message-Id: <20031110221429.04732a57.davem@redhat.com> In-Reply-To: <20031110221430.GA26556@ee.oulu.fi> References: <20031110181917.GA25846@ee.oulu.fi> <20031110221430.GA26556@ee.oulu.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1309 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 00:14:30 +0200 Pekka Pietikainen wrote: > (I still like the idea of being able to use exactly the same driver > source on 2.4/2.6 though) I agree, someone should merge in the dummy SET_NETDEV_DEV once Marcelo starts up 2.4.24-preX From davem@pizda.ninka.net Mon Nov 10 22:46:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 22:47:08 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB6ks25012841 for ; Mon, 10 Nov 2003 22:46:55 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id VAA15643; Mon, 10 Nov 2003 21:46:04 -0800 Date: Mon, 10 Nov 2003 21:46:03 -0800 From: "David S. Miller" To: Jan Oravec Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-Id: <20031110214603.0057e365.davem@redhat.com> In-Reply-To: <20031109122844.GA14241@wsx.ksp.sk> References: <20031109122844.GA14241@wsx.ksp.sk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1310 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 9 Nov 2003 13:28:44 +0100 Jan Oravec wrote: > We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that > sparc64). We get the following corrupted answer: > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I What specifically about this packet makes you think it is corrupted? Let's look at the ICMP header you say is "correct" from the x86 box: > 0104 fb79 0000 0000 type = ICMPV6_DEST_UNREACH code = ICMPV6_PORT_UNREACH In the sparc64 generated packet these two values are identical: > 0104 aa7c 0000 0000 So why does tcpdump not say that this is "udp port XXX unreachable" like it does for the x86 generated packet. Incorrect checksum or corrupted payload after the icmp6 header? What compiler are you using to build 2.6.x kernels btw? We could be looking at a miscompile here. The bus error you reported from running traceroute6 on the sparc64 system is not that useful, can you use gdb or some other tool to figure out where inside of tcpdump6 the bus error is occuring? Is is happening in the tcpdump6 program itself? It is due to a failed system call? Thanks. From yoshfuji@linux-ipv6.org Mon Nov 10 23:06:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:07:07 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB76q25013331 for ; Mon, 10 Nov 2003 23:06:52 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hAB76rlg020571; Tue, 11 Nov 2003 16:06:54 +0900 Date: Tue, 11 Nov 2003 01:06:53 -0600 (CST) Message-Id: <20031111.010653.76483304.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: jan.oravec@6com.sk, netdev@oss.sgi.com Subject: Re: IPv6/sparc64: icmp port unreachable corruption From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031110214603.0057e365.davem@redhat.com> References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1311 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20031110214603.0057e365.davem@redhat.com> (at Mon, 10 Nov 2003 21:46:03 -0800), "David S. Miller" says: > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I > > What specifically about this packet makes you think it is corrupted? : > So why does tcpdump not say that this is "udp port XXX unreachable" > like it does for the x86 generated packet. > > Incorrect checksum or corrupted payload after the icmp6 header? 0x0030- should be the copy of the original packet. it is corrupted. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@pizda.ninka.net Mon Nov 10 23:08:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:08:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB78Y25013669 for ; Mon, 10 Nov 2003 23:08:34 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA15705; Mon, 10 Nov 2003 23:02:33 -0800 Date: Mon, 10 Nov 2003 23:02:33 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code Message-Id: <20031110230233.254061da.davem@redhat.com> In-Reply-To: <20031110.104536.79654717.yoshfuji@linux-ipv6.org> References: <20031110.104536.79654717.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1312 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Nov 2003 10:45:36 -0600 (CST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > more jiffies normalizations reported to userspace, in core/neighbour.c. ... > +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, > + void __user *, size_t *); This function is huge and it reuses a lot of existing logic. Cannot you implement it simply like this: int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, void __user *, size_t *) { return do_proc_dointvec(table,write,filp,buffer,lenp,HZ/USER_HZ,OP_SET); } Right? Linus, what we need here is a function that converts to/from USER_HZ and HZ jiffies for a few sysctl knobs in core/neighbour.c Yoshfuji copied all of the logic of routines such as do_proc_dointvec() replacing the "conv" conversion multiplies and divides with calls to jiffies_to_clock_t() and friends. While this is the cleanest implementation it sure wastes a lot of code for such a minor difference in behavior. Won't my above idea work? Another idea is to change do_proc_dointvec() to take a conversion function pointer instead of this "conv" thing. Maybe even proc_dointvec_minmax() could be implemented in terms of do_proc_dointvec() with such a scheme. From davem@pizda.ninka.net Mon Nov 10 23:09:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:10:02 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB79n25014012 for ; Mon, 10 Nov 2003 23:09:50 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA15733; Mon, 10 Nov 2003 23:03:49 -0800 Date: Mon, 10 Nov 2003 23:03:49 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] DECNET: Normalize jiffies reported to userspace Message-Id: <20031110230349.693d2fbd.davem@redhat.com> In-Reply-To: <20031110.104843.65576225.yoshfuji@linux-ipv6.org> References: <20031110.104843.65576225.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Nov 2003 10:48:43 -0600 (CST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > jiffies normalization for decnet. Applied, arigato Yoshfuji. From davem@pizda.ninka.net Mon Nov 10 23:13:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:13:32 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB7DJ25014378 for ; Mon, 10 Nov 2003 23:13:19 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA15755; Mon, 10 Nov 2003 23:07:18 -0800 Date: Mon, 10 Nov 2003 23:07:18 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV{4,6}: Normalize jiffies reported to userspace in routing code (missing pieces) Message-Id: <20031110230718.5edf31c9.davem@redhat.com> In-Reply-To: <20031110.105023.116811039.yoshfuji@linux-ipv6.org> References: <20031110.105023.116811039.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Nov 2003 10:50:23 -0600 (CST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Sorry, I failed to fix these bits. Applied, thank you very much. From davem@pizda.ninka.net Mon Nov 10 23:18:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:18:55 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB7Ig25014811 for ; Mon, 10 Nov 2003 23:18:42 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA15768; Mon, 10 Nov 2003 23:12:38 -0800 Date: Mon, 10 Nov 2003 23:12:38 -0800 From: "David S. Miller" To: "Ihar 'Philips' Filipau" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags Message-Id: <20031110231238.4742a158.davem@redhat.com> In-Reply-To: <3FAF7236.7020209@softhome.net> References: <3FAF7236.7020209@softhome.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1315 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Nov 2003 12:10:46 +0100 "Ihar 'Philips' Filipau" wrote: > On line 1057 we have: "msg->msg_flags|=MSG_TRUNC;" to indicate that > message was truncated. > > But on line 1073, where we make return status to user, we check > against user suplied flags, but NOT msg->msg_flags. > > It looks like obvious typo. Indeed, you're right. Thanks for the report, I'll fix this in both 2.4.x and 2.6.x From ja@ssi.bg Mon Nov 10 23:29:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Nov 2003 23:30:05 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB7Tb25015249 for ; Mon, 10 Nov 2003 23:29:41 -0800 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id hAB7TJx01181; Tue, 11 Nov 2003 09:29:25 +0200 Date: Tue, 11 Nov 2003 09:29:19 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: netdev@oss.sgi.com cc: "David S. Miller" , Wensong Zhang Subject: [2.6 PATCH] ipvs - make sure the timer expires on one cpu Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-419511311-1068535759=:1155" X-archive-position: 1316 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-419511311-1068535759=:1155 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, The attached patch fixes the timer expiration for IPVS. The goal is to avoid scheduling of running timer on another CPU in short time (jiffie), ip_vs_conn_expire must run only on one CPU at time per conn. Regards -- Julian Anastasov --1607745702-419511311-1068535759=:1155 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="timer-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: ipvs timer fix Content-Disposition: attachment; filename="timer-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM0OCAgLT4gMS4xMzQ5IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYwkxLjExICAgIC0+IDEuMTIgICAN CiMNCiMgVGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNl dCBMb2cNCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCiMgMDMvMTEvMTEJamFAc3NpLmJnCTEuMTM0OQ0KIyBbSVBW U106IG1ha2Ugc3VyZSB0aGUgdGltZXIgZXhwaXJlcyBvbiBvbmUgY3B1DQoj IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t DQojDQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYyBi L25ldC9pcHY0L2lwdnMvaXBfdnNfY29ubi5jDQotLS0gYS9uZXQvaXB2NC9p cHZzL2lwX3ZzX2Nvbm4uYwlUdWUgTm92IDExIDA4OjUyOjE2IDIwMDMNCisr KyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfY29ubi5jCVR1ZSBOb3YgMTEgMDg6 NTI6MTYgMjAwMw0KQEAgLTUzNSw4ICs1MzUsMTAgQEANCiANCiB2b2lkIGlw X3ZzX2Nvbm5fZXhwaXJlX25vdyhzdHJ1Y3QgaXBfdnNfY29ubiAqY3ApDQog ew0KLQljcC0+dGltZW91dCA9IDA7DQotCW1vZF90aW1lcigmY3AtPnRpbWVy LCBqaWZmaWVzKTsNCisJaWYgKGRlbF90aW1lcigmY3AtPnRpbWVyKSkgew0K KwkJY3AtPnRpbWVvdXQgPSAwOw0KKwkJbW9kX3RpbWVyKCZjcC0+dGltZXIs IGppZmZpZXMpOw0KKwl9DQogCV9faXBfdnNfY29ubl9wdXQoY3ApOw0KIH0N CiANCg== --1607745702-419511311-1068535759=:1155-- From ja@ssi.bg Tue Nov 11 00:07:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 00:07:59 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAB87K25016075 for ; Tue, 11 Nov 2003 00:07:39 -0800 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id hAB87HO01729; Tue, 11 Nov 2003 10:07:17 +0200 Date: Tue, 11 Nov 2003 10:07:17 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: netdev@oss.sgi.com cc: "David S. Miller" , Wensong Zhang Subject: Re: [2.6 PATCH] ipvs - make sure the timer expires on one cpu In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-1832032584-1068538037=:1176" X-archive-position: 1317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-1832032584-1068538037=:1176 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, Ah, sorry. It is bad idea to set cp->timeout to 0. Please, better use the attached patch instead. Regards -- Julian Anastasov --1607745702-1832032584-1068538037=:1176 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="timer-2.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: fix ipvs timer, v2 Content-Disposition: attachment; filename="timer-2.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM0OCAgLT4gMS4xMzQ5IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYwkxLjExICAgIC0+IDEuMTIgICAN CiMNCiMgVGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNl dCBMb2cNCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCiMgMDMvMTEvMTEJamFAc3NpLmJnCTEuMTM0OQ0KIyBbSVBW U106IG1ha2Ugc3VyZSB0aGUgdGltZXIgZXhwaXJlcyBvbiBvbmUgY3B1DQoj IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t DQojDQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2Nvbm4uYyBi L25ldC9pcHY0L2lwdnMvaXBfdnNfY29ubi5jDQotLS0gYS9uZXQvaXB2NC9p cHZzL2lwX3ZzX2Nvbm4uYwlUdWUgTm92IDExIDEwOjA0OjE4IDIwMDMNCisr KyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfY29ubi5jCVR1ZSBOb3YgMTEgMTA6 MDQ6MTggMjAwMw0KQEAgLTUzNSw4ICs1MzUsOCBAQA0KIA0KIHZvaWQgaXBf dnNfY29ubl9leHBpcmVfbm93KHN0cnVjdCBpcF92c19jb25uICpjcCkNCiB7 DQotCWNwLT50aW1lb3V0ID0gMDsNCi0JbW9kX3RpbWVyKCZjcC0+dGltZXIs IGppZmZpZXMpOw0KKwlpZiAoZGVsX3RpbWVyKCZjcC0+dGltZXIpKQ0KKwkJ bW9kX3RpbWVyKCZjcC0+dGltZXIsIGppZmZpZXMpOw0KIAlfX2lwX3ZzX2Nv bm5fcHV0KGNwKTsNCiB9DQogDQo= --1607745702-1832032584-1068538037=:1176-- From amir.noam@intel.com Tue Nov 11 02:32:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 02:32:36 -0800 (PST) Received: from hermes.iil.intel.com (hermes.iil.intel.com [192.198.152.99]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABAW925021355 for ; Tue, 11 Nov 2003 02:32:13 -0800 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by hermes.iil.intel.com (8.12.9-20030918-01/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id hABAW3YX016677 for ; Tue, 11 Nov 2003 10:32:03 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id hABAZJI26839 for ; Tue, 11 Nov 2003 10:35:19 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003111112320224340 ; Tue, 11 Nov 2003 12:32:02 +0200 Received: from jrslxjul4.npdj.intel.com (jrslxjul4 [10.12.254.188]) by sun111.npdj.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id hABAVxFo027278; Tue, 11 Nov 2003 12:32:00 +0200 (IST) Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: jgarzik@pobox.com, davem@redhat.com Subject: [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Date: Tue, 11 Nov 2003 12:32:01 +0200 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200311111232.01428.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 1318 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev Hi, Since 2.4.23-rc1 is out, I'm resending this patch that fixes a problem in the creation/destruction of the /proc/net/bonding dir, introduced in 2.4.23-pre5. Please apply. Amir diff -Narup a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Oct 23 14:47:31 2003 +++ b/drivers/net/bonding/bond_main.c Thu Oct 23 17:04:52 2003 @@ -3574,6 +3574,62 @@ static void bond_destroy_proc_info(struc bond->bond_proc_file = NULL; } } + +/* Create the bonding directory under /proc/net, if doesn't exist yet. + * Caller must hold rtnl_lock. + */ +static void bond_create_proc_dir(void) +{ + int len = strlen(DRV_NAME); + + for (bond_proc_dir = proc_net->subdir; bond_proc_dir; + bond_proc_dir = bond_proc_dir->next) { + if ((bond_proc_dir->namelen == len) && + !memcmp(bond_proc_dir->name, DRV_NAME, len)) { + break; + } + } + + if (!bond_proc_dir) { + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir) { + bond_proc_dir->owner = THIS_MODULE; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: cannot create /proc/net/%s\n", + DRV_NAME); + } + } +} + +/* Destroy the bonding directory under /proc/net, if empty. + * Caller must hold rtnl_lock. + */ +static void bond_destroy_proc_dir(void) +{ + struct proc_dir_entry *de; + + if (!bond_proc_dir) { + return; + } + + /* verify that the /proc dir is empty */ + for (de = bond_proc_dir->subdir; de; de = de->next) { + /* ignore . and .. */ + if (*(de->name) != '.') { + break; + } + } + + if (de) { + if (bond_proc_dir->owner == THIS_MODULE) { + bond_proc_dir->owner = NULL; + } + } else { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +} #endif /* CONFIG_PROC_FS */ /* @@ -3829,6 +3885,9 @@ static struct notifier_block bond_netdev .notifier_call = bond_netdev_event, }; +/* De-initialize device specific data. + * Caller must hold rtnl_lock. + */ static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; @@ -3840,6 +3899,9 @@ static inline void bond_deinit(struct ne #endif } +/* Unregister and free all bond devices. + * Caller must hold rtnl_lock. + */ static void bond_free_all(void) { struct bonding *bond, *nxt; @@ -3847,16 +3909,13 @@ static void bond_free_all(void) list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { struct net_device *dev = bond->device; - unregister_netdev(dev); + unregister_netdevice(dev); bond_deinit(dev); free_netdev(dev); } #ifdef CONFIG_PROC_FS - if (bond_proc_dir) { - remove_proc_entry(DRV_NAME, proc_net); - bond_proc_dir = NULL; - } + bond_destroy_proc_dir(); #endif } @@ -4234,18 +4293,12 @@ static int __init bonding_init(void) primary = NULL; } + rtnl_lock(); + #ifdef CONFIG_PROC_FS - bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); - if (bond_proc_dir == NULL) { - printk(KERN_WARNING - "bonding_init(): can not create /proc/net/" DRV_NAME); - } else { - bond_proc_dir->owner = THIS_MODULE; - } + bond_create_proc_dir(); #endif - rtnl_lock(); - err = 0; for (no = 0; no < max_bonds; no++) { struct net_device *dev; @@ -4288,18 +4341,21 @@ static int __init bonding_init(void) return 0; out_err: - rtnl_unlock(); - /* free and unregister all bonds that were successfully added */ bond_free_all(); + rtnl_unlock(); + return err; } static void __exit bonding_exit(void) { unregister_netdevice_notifier(&bond_netdev_notifier); + + rtnl_lock(); bond_free_all(); + rtnl_unlock(); } module_init(bonding_init); From torvalds@osdl.org Tue Nov 11 09:03:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 09:04:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABH3x25012579 for ; Tue, 11 Nov 2003 09:03:59 -0800 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hABH3qC22725 for ; Tue, 11 Nov 2003 09:03:53 -0800 X-Received: from localhost (localhost.localdomain [127.0.0.1]) by home.osdl.org (8.12.10/8.12.10) with ESMTP id hABGtmXK006671 for ; Tue, 11 Nov 2003 08:55:48 -0800 X-Received: from localhost.localdomain [127.0.0.1] by localhost with IMAP (fetchmail-6.2.0) for torvalds@localhost (single-drop); Tue, 11 Nov 2003 08:55:48 -0800 (PST) X-Received: from fire-1.osdl.org (air1.pdx.osdl.net [172.20.0.5]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hABGtWC20841 for ; Tue, 11 Nov 2003 08:55:32 -0800 X-Received: from vger.kernel.org (vger.kernel.org [67.72.78.212]) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id hABGt718001147 for ; Tue, 11 Nov 2003 08:55:31 -0800 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263667AbTKKQn4 (ORCPT ); Tue, 11 Nov 2003 11:43:56 -0500 X-Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263680AbTKKQn4 (ORCPT ); Tue, 11 Nov 2003 11:43:56 -0500 X-Received: from theendless.org ([216.251.47.14]:20167 "EHLO morpheus.theendless.org") by vger.kernel.org with ESMTP id S263667AbTKKQnn (ORCPT ); Tue, 11 Nov 2003 11:43:43 -0500 X-Received: from localhost (localhost [127.0.0.1]) by morpheus.theendless.org (8.12.9/8.12.2) with ESMTP id hABGhgfi008132 for ; Tue, 11 Nov 2003 11:43:42 -0500 Date: Tue, 11 Nov 2003 11:43:42 -0500 (EST) From: morpheus To: linux-kernel@vger.kernel.org Subject: linux-2.6.0-test9 and IPVS (Kernel OOPS) with sync daemon started. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-Scanned-By: MIMEDefang 2.36 ReSent-Date: Tue, 11 Nov 2003 09:03:50 -0800 (PST) ReSent-From: Linus Torvalds ReSent-To: netdev@oss.sgi.com ReSent-Subject: linux-2.6.0-test9 and IPVS (Kernel OOPS) with sync daemon started. ReSent-Message-ID: X-archive-position: 1319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Hi, Being my first post to the list I hope all the information included is as accurate and detailed as possible. Feedback is greatly appreciated, thanks in advance. SUMMARY: I seem to have found a problem with the linux-2.6.0-test9 kernel and the Sync daemon that comes with IPVS. I can reproduce the problem without fail and it produces a kernel OOPS every time. PROBLEM REPORT: The setup is as follows. 2 hardware identical linux machines are functioning as directors in an IPVS setup. One is master and the other backup. I have successfully implemented failover on these servers. However, when attempting to use the stateful failover option in ipvsadm (IPVS) by running "ipvsadm --start-daemon master" on the master and "ipvsadm --start-daemon slave" on the slave and failing the connection over, the kernel on the slave machine craps out. It produces an oops which is posted (after processing via ksymoops) below. It seems to happen at the exact moment that the slave machine takes over the virtual ip's that the master machine owned, ie. right after gratiuitous arps are sent out to make sure everyone knows where the new ips are. Keep in mind that the slave machine does NOT take over the main IP's of the primary director, as this may lead to some networking issues which should still not cause an OOps. If I do not enable the sync-daemon (ie. NO stateful failover), everything keeps on trudging along as normal. KERNEL VERSION: Linux version 2.6.0-test9 (root@director1) (gcc version 3.2) #1 SMP Sat Feb 7 21:38:27 EST 2004 OOPS OUTPUT (ksymoops processed): Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010246 eax: 00000010 ebx: f7022880 ecx: f7022880 edx: 00000010 esi: 00000000 edi: f76e9d80 ebp: 00000010 esp: c0389d2c ds: 007b es: 007b ss: 0068 Stack: c0389d48 c1b41000 00000000 c02c8975 c0353900 c0389d48 f70b500c f733be20 f77ec680 c0353900 00000036 00000000 00000000 f76e9d80 c0354840 f7022880 c02d9ec5 f76e9d80 00000014 c0389dd0 00000014 c02cd3ad 00000006 5601a8c0 [] fib_validate_source+0x1f5/0x296 [] tcp_state_transition+0x3f/0x2d6 [] ip_vs_conn_in_get+0xad/0x26e [] ip_vs_dr_xmit+0x0/0x744 [] ip_local_deliver_finish+0x0/0x162 [] ip_vs_in+0x185/0x304 [] nf_iterate+0x71/0xa6 [] ip_local_deliver_finish+0x0/0x162 [] nf_hook_slow+0x79/0x124 [] ip_local_deliver_finish+0x0/0x162 [] ip_local_deliver+0x1b7/0x1d6 [] ip_local_deliver_finish+0x0/0x162 [] ip_rcv+0x360/0x4d8 [] netif_receive_skb+0x13f/0x17a [] process_backlog+0x80/0x112 [] net_rx_action+0x7a/0x104 [] do_softirq+0xc3/0xc6 [] do_IRQ+0xf6/0x114 [] default_idle+0x0/0x2e [] common_interrupt+0x18/0x20 [] default_idle+0x0/0x2e [] default_idle+0x2a/0x2e [] cpu_idle+0x37/0x40 [] _stext+0x0/0x52 [] start_kernel+0x194/0x1c2 [] unknown_bootoption+0x0/0xfc Code: a1 10 00 00 00 c7 44 24 4c 00 00 00 00 88 94 24 88 00 00 00 >>EIP; c02d5eac <===== >>ebx; f7022880 <_end+36c18f10/3fbf4690> >>ecx; f7022880 <_end+36c18f10/3fbf4690> >>edi; f76e9d80 <_end+372e0410/3fbf4690> >>esp; c0389d2c Code; c02d5eac 00000000 <_EIP>: Code; c02d5eac <===== 0: a1 10 00 00 00 mov 0x10,%eax <===== Code; c02d5eb1 5: c7 44 24 4c 00 00 00 movl $0x0,0x4c(%esp,1) Code; c02d5eb8 c: 00 Code; c02d5eb9 d: 88 94 24 88 00 00 00 mov %dl,0x88(%esp,1) <0>Kernel panic: Fatal exception in interrupt 1 warning and 1 error issued. Results may not be reliable. ENVIRONMENT: LESSKEY=/etc/lesskey.bin MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man INFODIR=/usr/local/info:/usr/share/info:/usr/info NNTPSERVER=news HOSTNAME=director2 XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB SHELL=/bin/bash TERM=xterm HOST=director2 PROFILEREAD=true SSH_CLIENT=192.168.1.86 34233 22 SSH_TTY=/dev/pts/0 USER=kris LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31:ex=00;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32: XNLSPATH=/usr/X11R6/lib/X11/nls HOSTTYPE=i386 PAGER=less MINICOM=-c on PATH=/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin MAIL=/var/mail/kris CPU=i686 LC_COLLATE=POSIX PWD=/root INPUTRC=/etc/inputrc LANG=en_US TEXINPUTS=:/home/kris/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX HOME=/root SHLVL=2 OSTYPE=linux LESS_ADVANCED_PREPROCESSOR=no no_proxy=localhost LS_OPTIONS=-a -N --color=tty -T 0 WINDOWMANAGER=/usr/X11R6/bin/kde LOGNAME=kris MACHTYPE=i686-suse-linux LESS=-M -I PRINTER=lp LESSOPEN=lessopen.sh %s INFOPATH=/usr/local/info:/usr/share/info:/usr/info LESSCLOSE=lessclose.sh %s %s COLORTERM=1 _=/usr/bin/env OLDPWD=/usr/src/linux/Documentation SOFTWARE: The software responsible for failing the machines over and reconfiguring the virutal ip's on the backup server is heartbeat. It is currently "beating" on the eth0 interface. The same interface that is used for traffic loadbalancing and access to the internet (ie. the only interface on the machine. ver_linux: Linux director2 2.6.0-test9 #1 SMP Sat Feb 7 21:38:27 EST 2004 i686 unknown Gnu C 3.2 Gnu make 3.79.1 util-linux 2.11u mount 2.11u module-init-tools implemented e2fsprogs 1.28 xfsprogs 2.2.1 nfs-utils 1.0.1 Linux C Library 27 11:31 /lib/libc.so.6 Dynamic linker (ldd) 2.2.5 Linux C++ Library 5.0.0 Procps 2.0.7 Net-tools 1.60 Kbd 76: Sh-utils 2.0 Modules Loaded CPU (/proc/cpuinfo): processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 10 cpu MHz : 1004.570 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 1978.36 processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 8 model name : Pentium III (Coppermine) stepping : 10 cpu MHz : 1004.570 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 2007.04 MODULE INFO(/proc/modules): N/A DRIVER/HARDWARE INFO (/proc/ioports, /proc/iomem): ioports: 0000-001f : dma1 0020-0021 : pic1 0040-005f : timer 0060-006f : keyboard 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : ide0 02f8-02ff : serial 0376-0376 : ide1 03c0-03df : vga+ 03f6-03f6 : ide0 03f8-03ff : serial 0cf8-0cff : PCI conf1 a400-a4ff : 0000:00:0c.0 a800-a83f : 0000:00:09.0 a800-a83f : eepro100 b000-b0ff : 0000:00:08.1 b400-b4ff : 0000:00:08.0 b800-b83f : 0000:00:07.0 b800-b83f : eepro100 d000-d01f : 0000:00:04.3 d400-d41f : 0000:00:04.2 d800-d80f : 0000:00:04.1 d800-d807 : ide0 d808-d80f : ide1 e800-e80f : 0000:00:04.4 iomem: 00000000-0009ffff : System RAM 000a0000-000bffff : Video RAM area 000c8000-000c97ff : Extension ROM 000f0000-000fffff : System ROM 00100000-3fffbfff : System RAM 00100000-002e545e : Kernel code 002e545f-003875ff : Kernel data 3fffc000-3fffefff : ACPI Tables 3ffff000-3fffffff : ACPI Non-volatile Storage f5000000-f5000fff : 0000:00:0c.0 f5800000-f581ffff : 0000:00:09.0 f6000000-f6000fff : 0000:00:09.0 f6000000-f6000fff : eepro100 f6800000-f6801fff : 0000:00:08.1 f7000000-f70003ff : 0000:00:08.1 f7800000-f7801fff : 0000:00:08.0 f8000000-f80003ff : 0000:00:08.0 f8800000-f88fffff : 0000:00:07.0 f9000000-f9000fff : 0000:00:07.0 f9000000-f9000fff : eepro100 fa000000-faffffff : 0000:00:0c.0 fc000000-fdffffff : 0000:00:00.0 fec00000-fec00fff : reserved fee00000-fee00fff : reserved ffff0000-ffffffff : reserved PCI INFO (lspci -vvv): 00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4) Subsystem: Asustek Computer, Inc.: Unknown device 8038 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Capabilities: [c0] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset- FastB2B- Capabilities: [80] Power Management version 2 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 00:04.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) Subsystem: Asustek Computer, Inc.: Unknown device 8038 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- [disabled] [size=64K] Capabilities: [dc] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 PME-Enable- DSel=0 DScale=2 PME- 00:0c.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro 215GP (rev 5c) (prog-if 00 [VGA]) Subsystem: ATI Technologies Inc Rage Pro Turbo Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- ; Tue, 11 Nov 2003 12:04:57 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hABK4pq0007478 for ; Tue, 11 Nov 2003 12:04:51 -0800 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hABK4oP513506989; Tue, 11 Nov 2003 14:04:51 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hABK4mRn352988623; Tue, 11 Nov 2003 14:04:49 -0600 (CST) Message-ID: <3FB140E2.1070007@sgi.com> Date: Tue, 11 Nov 2003 14:04:50 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> In-Reply-To: <20031110182911.2c5a121b.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1320 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Is this OK ? I was not sure about the order should depends be beofre default or the other way round ? or does it matter ? I suspect it does. Thks John --- linux/drivers/net/tg3.c 2003-11-10 18:28:10.000000000 -0600 +++ patch/drivers/net/tg3.c 2003-11-10 18:58:35.000000000 -0600 @@ -2257,7 +2257,11 @@ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#if defined(CONFIG_UNALIGNED_EXPENSIVE) + && tp->rx_offset == 2 +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 +++ patch/arch/ia64/Kconfig 2003-11-11 14:01:42.000000000 -0600 @@ -468,6 +468,11 @@ agent" (/sbin/hotplug) to load modules and set up software needed to use devices as you hotplug them. +config CONFIG_UNALIGNED_EXPENSIVE + bool "Use Aligned SKB's for Tigon3 5701 network adapters" + depends on MCKINLEY + default y + source "drivers/pci/hotplug/Kconfig" source "drivers/pcmcia/Kconfig" -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From davem@pizda.ninka.net Tue Nov 11 12:30:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 12:30:48 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABKUY25019217 for ; Tue, 11 Nov 2003 12:30:35 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA30791; Tue, 11 Nov 2003 12:24:03 -0800 Date: Tue, 11 Nov 2003 12:24:03 -0800 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031111122403.2d7bcf28.davem@redhat.com> In-Reply-To: <3FB140E2.1070007@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 14:04:50 -0600 John Partridge wrote: > Is this OK ? I was not sure about the order should depends be beofre default or > the other way round ? or does it matter ? I suspect it does. Why are you depending upon MCKINLEY? Don't all ia64 cpus give traps for unaligned memory accesses? That is what this CONFIG option tells the whole kernel. From davem@pizda.ninka.net Tue Nov 11 12:32:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 12:32:33 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABKWK25019595 for ; Tue, 11 Nov 2003 12:32:20 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA30797; Tue, 11 Nov 2003 12:25:45 -0800 Date: Tue, 11 Nov 2003 12:25:45 -0800 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031111122545.6bb8bfe5.davem@redhat.com> In-Reply-To: <3FB140E2.1070007@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1322 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 14:04:50 -0600 John Partridge wrote: > +config CONFIG_UNALIGNED_EXPENSIVE > + bool "Use Aligned SKB's for Tigon3 5701 network adapters" > + depends on MCKINLEY > + default y > + Also, this help text is broken too. I repeat: "THIS IS NOT A TIGON3 5701 NETWORK ADAPTER SPECIFIC HACK" It is a config variable that all network drivers in the kernel can test to make copybreak and related decisions for copy vs. read directly packet handling. Please stop making this a tigon3 specific thing. From akpm@osdl.org Tue Nov 11 13:01:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 13:01:36 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABL1C25020264 for ; Tue, 11 Nov 2003 13:01:20 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hABL16C02768; Tue, 11 Nov 2003 13:01:06 -0800 Date: Tue, 11 Nov 2003 13:05:13 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Thomas Habets Subject: Fw: PROBLEM: Memory leak in -test9? Message-Id: <20031111130513.67caea63.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue__11_Nov_2003_13:05:13_-0800_081fbdd0" X-archive-position: 1323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart_Tue__11_Nov_2003_13:05:13_-0800_081fbdd0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit A memory leak in the tcp6_sock slab. Begin forwarded message: Date: Tue, 11 Nov 2003 16:36:57 +0100 From: Thomas Habets To: Linux Kernel Mailing List Subject: PROBLEM: Memory leak in -test9? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 (I'm not on the list. CC any replies) [2.] There seems to be a memory leak in 2.6.0-test9. Before I go on I'll mention that the box is running Debian sarge (testing), and the compiler is gcc 3.3.1. A lot of memory is used (and eventually it will crash), but very little is in cache or buffers. After shutting down zebra, postgresql, snmp and apache this is what the system looked like. Notice the Slab-size in /proc/meminfo. I don't know what slab is, but it's getting bigger... I think. It's not that big after reboot anyway. The memory gets used up after a few days of uptime, and when all memory is used, the box eventually becomes unresponsive due to excessive swap use. Note that this box doesn't do anything (almost). It's a workstation that's not in use. It has the above mentioned daemons running (but unused) and also sshs every 5 minutes to another box for mrtg graph stats. (rsa keys) /proc/config.gz attached. /proc/sysvipc/{sem,shm,msg} are empty. I'll leave it running in case you want more info, but it will fill up all mem and crash in a few days if it does what some other -test? did. Sorry if it just looks like it will do the same, and this is all just normal behavior. [3.] Memory leak, slab [4.] Linux version 2.6.0-test9 (andy@rex) (gcc version 3.3.1 20030626 (Debian prerelease)) #4 Tue Oct 28 15:12:18 CET 2003 [7.1] $ sh scripts/ver_linux If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes. Linux rex 2.6.0-test9 #4 Tue Oct 28 15:12:18 CET 2003 i686 GNU/Linux Gnu C 3.3.1 Gnu make 3.80 util-linux 2.11z mount 2.11z module-init-tools 0.9.13-pre e2fsprogs 1.34-WIP nfs-utils 1.0.3 Linux C Library 2.3.1 Dynamic linker (ldd) 2.3.1 Procps 3.1.9 Net-tools 1.60 Console-tools 0.2.3 Sh-utils 5.0 Modules Loaded twofish serpent aes blowfish sha256 dummy 8139too mii crc32 [7.2.] Processor information (from /proc/cpuinfo): $ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 6 model name : Celeron (Mendocino) stepping : 5 cpu MHz : 467.898 cache size : 128 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips : 923.64 [7.3.] Module information (from /proc/modules): $ cat /proc/modules twofish 38752 0 - Live 0xcc89d000 serpent 13600 0 - Live 0xcc880000 aes 31616 0 - Live 0xcc886000 blowfish 9824 0 - Live 0xcc87c000 sha256 13888 0 - Live 0xcc877000 dummy 1924 0 - Live 0xcc869000 8139too 24320 0 - Live 0xcc870000 mii 5152 1 8139too, Live 0xcc864000 crc32 4320 1 8139too, Live 0xcc861000 [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) $ cat /proc/ioports /proc/iomem 0000-001f : dma1 0020-0021 : pic1 0040-005f : timer 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : ide0 0213-0213 : ISAPnP 0376-0376 : ide1 03c0-03df : vga+ 03f6-03f6 : ide0 0a79-0a79 : isapnp write 0cf8-0cff : PCI conf1 4000-403f : 0000:00:07.3 5000-501f : 0000:00:07.3 d000-dfff : PCI Bus #01 e000-e01f : 0000:00:07.2 e000-e01f : uhci_hcd e400-e4ff : 0000:00:08.0 e800-e8ff : 0000:00:0b.0 e800-e8ff : 8139too f000-f00f : 0000:00:07.1 f000-f007 : ide0 f008-f00f : ide1 00000000-0009fbff : System RAM 0009fc00-0009ffff : reserved 000a0000-000bffff : Video RAM area 000c0000-000c7fff : Video ROM 000f0000-000fffff : System ROM 00100000-0bfeffff : System RAM 00100000-00490e26 : Kernel code 00490e27-005a08bf : Kernel data 0bff0000-0bff2fff : ACPI Non-volatile Storage 0bff3000-0bffffff : ACPI Tables e0000000-e3ffffff : 0000:00:00.0 e4000000-e5ffffff : PCI Bus #01 e4000000-e4ffffff : 0000:01:00.0 e6000000-e6ffffff : PCI Bus #01 e6000000-e6ffffff : 0000:01:00.0 e7000000-e7ffffff : 0000:00:08.0 ea000000-ea0000ff : 0000:00:0b.0 ea000000-ea0000ff : 8139too ea001000-ea001fff : 0000:00:08.0 ffff0000-ffffffff : reserved [7.5.] PCI information ('lspci -vvv' as root) That's a lot, and I doubt it would help. Ask if you need it. [7.6.] SCSI information (from /proc/scsi/scsi) No SCSI [7.7.] Other information that might be relevant to the problem (please look in /proc and include all information that you think to be relevant): $ uptime 00:51:38 up 6 days, 11:54, 5 users, load average: 0.02, 0.02, 0.00 $ free -m total used free shared buffers cached Mem: 184 168 15 0 7 12 -/+ buffers/cache: 148 35 Swap: 243 74 168 (these two commands were run a day after the above mentioned daemons were shut off: RSS $ ps uax | awk '{ foo+= $6 } END{print foo}' 36380 $ free -m total used free shared buffers cached Mem: 184 168 16 0 3 11 - -/+ buffers/cache: 153 31 Swap: 243 87 155 now back to yesterdays /proc/meminfo) $ cat /proc/meminfo MemTotal: 189240 kB MemFree: 16208 kB Buffers: 7536 kB Cached: 12940 kB SwapCached: 18400 kB Active: 22316 kB Inactive: 27176 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 189240 kB LowFree: 16208 kB SwapTotal: 248996 kB SwapFree: 172572 kB Dirty: 380 kB Writeback: 0 kB Mapped: 24460 kB Slab: 121272 kB Committed_AS: 89412 kB PageTables: 744 kB VmallocTotal: 843720 kB VmallocUsed: 604 kB VmallocChunk: 843048 kB $ ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.2 1212 428 ? S Nov04 0:04 init [2] root 2 0.0 0.0 0 0 ? SWN Nov04 0:00 [ksoftirqd/0] root 3 0.0 0.0 0 0 ? SW< Nov04 0:01 [events/0] root 4 0.0 0.0 0 0 ? SW< Nov04 0:04 [kblockd/0] root 5 0.0 0.0 0 0 ? SW Nov04 0:00 [khubd] root 6 0.0 0.0 0 0 ? SW Nov04 0:00 [kapmd] root 8 0.0 0.0 0 0 ? SW Nov04 0:01 [pdflush] root 9 0.0 0.0 0 0 ? SW Nov04 0:09 [kswapd0] root 10 0.0 0.0 0 0 ? SW< Nov04 0:00 [aio/0] root 11 0.0 0.0 0 0 ? SW< Nov04 0:00 [xfslogd/0] root 12 0.0 0.0 0 0 ? SW< Nov04 0:00 [xfsdatad/0] root 13 0.0 0.0 0 0 ? SW Nov04 0:00 [pagebufd] root 15 0.0 0.0 0 0 ? SW Nov04 0:00 [kseriod] root 16 0.0 0.0 0 0 ? SW Nov04 0:30 [kjournald] root 30 0.0 0.5 2568 964 ? S Nov04 0:00 /sbin/devfsd /dev root 178 0.0 0.2 1408 424 ? S Nov04 0:00 dhclient -pf /var/run/dhclient.eth0.pid eth0 daemon 189 0.0 0.1 1316 288 ? S Nov04 0:00 /sbin/portmap root 273 0.0 0.2 1296 508 ? S Nov04 0:28 /sbin/syslogd root 279 0.0 0.2 2456 396 ? S Nov04 0:00 /sbin/klogd root 293 0.0 0.2 1240 392 ? S Nov04 0:00 /usr/sbin/inetd root 397 0.0 0.2 2684 492 ? S Nov04 0:00 /usr/sbin/sshd root 400 0.0 0.2 1208 456 ? S Nov04 0:00 /usr/sbin/uptimed root 407 0.0 0.2 4128 488 ? S Nov04 0:00 /usr/bin/X11/xfs -daemon root 467 0.0 0.2 2476 428 ? S Nov04 0:00 /bin/bash /etc/rc2.d/S20xprint posix_sh_forced start root 469 0.0 0.2 4020 464 ? S Nov04 0:00 /usr/X11R6/bin/Xprt -ac -pn -nolisten tcp -audit 4 -fp /usr/X11R6/lib/X11/fonts/Type1,/usr/X11R6/lib/X11/fonts/100dpi,/usr/X11R6/lib root 470 0.0 0.1 1196 308 ? S Nov04 0:00 tee -a /dev/null root 471 0.0 0.1 1200 376 ? S Nov04 0:00 logger -p lpr.notice -t Xprt_64 root 489 0.0 0.2 1372 464 ? S Nov04 0:00 /sbin/rpc.statd root 493 0.0 1.0 1908 1900 ? SL Nov04 0:00 /usr/sbin/ntpd root 498 0.0 0.1 2952 340 ? S Nov04 0:03 /usr/sbin/arpwatch -N -p daemon 501 0.0 0.1 1320 220 ? S Nov04 0:00 /usr/sbin/atd root 504 0.0 0.1 1396 324 ? S Nov04 0:00 /usr/sbin/cron root 516 0.0 0.2 2936 432 ? S Nov04 0:00 /usr/bin/X11/xdm root 517 0.0 0.0 1200 176 tty1 S Nov04 0:00 /sbin/getty 38400 tty1 root 518 0.0 0.0 1200 176 tty2 S Nov04 0:00 /sbin/getty 38400 tty2 root 519 0.0 0.0 1200 176 tty3 S Nov04 0:00 /sbin/getty 38400 tty3 root 520 0.0 0.0 1200 176 tty4 S Nov04 0:00 /sbin/getty 38400 tty4 root 521 0.0 0.0 1200 176 tty5 S Nov04 0:00 /sbin/getty 38400 tty5 root 522 0.0 0.0 1200 176 tty6 S Nov04 0:00 /sbin/getty 38400 tty6 root 529 0.0 0.6 47508 1276 ? S Nov04 1:38 /usr/X11R6/bin/X vt7 -dpi 100 -nolisten tcp -auth /var/lib/xdm/authdir/authfiles/A:0-8vgmon root 531 0.0 0.1 3388 316 ? S Nov04 0:00 -:0 root 544 0.7 8.9 51300 16980 ? S Nov04 67:24 xconsole - -geometry 480x130-0-0 -notify -verbose -fn fixed -exitOnFail -file /dev/xconsole andy 563 0.0 0.2 3472 392 ? S Nov04 0:01 x-window-manager andy 624 0.0 0.0 2372 156 ? S Nov04 0:00 /usr/bin/ssh-agent x-window-manager andy 626 0.0 0.1 3472 256 ? S Nov04 0:00 x-window-manager -d :0.1 -s andy 628 0.0 0.1 2332 220 ? S Nov04 0:00 /usr/bin/Animate --window 0 --context 8 andy 629 0.0 0.1 3048 256 ? S Nov04 0:00 /usr/bin/Wharf - --window 0 --context 8 andy 631 0.0 0.0 2332 188 ? S Nov04 0:00 /usr/bin/Animate --window 0 --context 8 andy 632 0.0 0.1 3048 228 ? S Nov04 0:00 /usr/bin/Wharf - --window 0 --context 8 andy 635 0.0 0.1 3048 280 ? S Nov04 0:00 /usr/bin/Pager - --window 0 --context 8 0 0 andy 639 0.0 0.1 3048 204 ? S Nov04 0:00 /usr/bin/Pager - --window 0 --context 8 0 0 root 22089 0.0 0.1 1684 244 ? S Nov08 0:00 /USR/SBIN/CRON root 22090 0.0 0.0 2156 176 ? S Nov08 0:00 /bin/sh -c if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then /usr/bin/mrtg /etc/mrtg.cfg >> /var/log/mrtg/mrtg.log 2>&1; fi root 22091 0.0 0.1 8572 192 ? S Nov08 0:01 /usr/bin/perl - -w /usr/bin/mrtg /etc/mrtg.cfg andy 22093 0.0 0.1 2752 216 ? S Nov08 0:00 ssh xxxxxxx /home/andy/mrtg/linux_stats.pl eth0 root 25679 0.0 0.0 0 0 ? SW Nov09 0:00 [pdflush] andy 2463 0.0 0.3 4728 576 ? S Nov10 0:00 x-terminal-emulator -T XTerminal@rex andy 2467 0.0 0.3 4736 700 ? S Nov10 0:00 x-terminal-emulator -T XTerminal@rex andy 2470 0.0 0.8 3344 1548 pts/0 S Nov10 0:00 bash andy 2474 0.0 0.4 4728 912 ? S Nov10 0:00 x-terminal-emulator -T XTerminal@rex andy 2477 0.0 0.5 3368 968 pts/1 S Nov10 0:00 bash andy 2490 0.0 0.4 3344 800 pts/2 S Nov10 0:00 bash root 2518 0.0 0.3 5760 704 ? S 00:01 0:00 sshd: andy [priv] andy 2520 0.0 0.5 5780 948 ? S 00:01 0:00 sshd: andy@pts/3 andy 2521 0.0 0.9 3380 1868 pts/3 S 00:01 0:00 -bash andy 2763 0.0 0.4 2500 760 pts/3 R 00:27 0:00 ps aux dmesg - -- Linux version 2.6.0-test9 (thomas@rex) (gcc version 3.3.1 20030626 (Debian prerelease)) #4 Tue Oct 28 15:12:18 CET 2003 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000000bff0000 (usable) BIOS-e820: 000000000bff0000 - 000000000bff3000 (ACPI NVS) BIOS-e820: 000000000bff3000 - 000000000c000000 (ACPI data) BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) 191MB LOWMEM available. On node 0 totalpages: 49136 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 45040 pages, LIFO batch:10 HighMem zone: 0 pages, LIFO batch:1 DMI 2.2 present. Building zonelist for node : 0 Kernel command line: root=/dev/hda3 ro Local APIC disabled by BIOS -- reenabling. Found and enabled local APIC! Initializing CPU#0 PID hash table entries: 1024 (order 10: 8192 bytes) Detected 467.898 MHz processor. Console: colour VGA+ 80x25 Memory: 188808k/196544k available (3651k kernel code, 7100k reserved, 1086k data, 184k init, 0k highmem) Calibrating delay loop... 923.64 BogoMIPS Security Scaffold v1.0.0 initialized Capability LSM initialized Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: 0183fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0183fbff 00000000 00000000 00000000 CPU: L1 I cache: 16K, L1 D cache: 16K CPU: L2 cache: 128K CPU: After all inits, caps: 0183fbff 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: Intel Celeron (Mendocino) stepping 05 Enabling fast FPU save and restore... done. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX enabled ExtINT on CPU#0 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 Using local APIC timer interrupts. calibrating APIC timer ... ..... CPU clock speed is 467.0661 MHz. ..... host bus clock speed is 66.0808 MHz. NET: Registered protocol family 16 PCI: PCI BIOS revision 2.10 entry at 0xfb2d0, last bus=1 PCI: Using configuration type 1 mtrr: v2.0 (20020519) Linux Plug and Play Support v0.97 (c) Adam Belay PnPBIOS: Scanning system for PnP BIOS support... PnPBIOS: Found PnP BIOS installation structure at 0xc00fbed0 PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xbef8, dseg 0xf0000 PnPBIOS: 16 nodes reported by PnP BIOS; 16 recorded by driver drivers/usb/core/usb.c: registered new driver usbfs drivers/usb/core/usb.c: registered new driver hub PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Using IRQ router PIIX [8086/7110] at 0000:00:07.0 apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16ac) ikconfig 0.7 with /proc/config* VFS: Disk quotas dquot_6.5.1 Coda Kernel/Venus communications, v6.0.0, coda@cs.cmu.edu devfs: v1.22 (20021013) Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x1 Installing knfsd (copyright (C) 1996 okir@monad.swb.de). udf: registering filesystem SGI XFS for Linux with ACLs, no debug enabled SGI XFS Quota Management subsystem Initializing Cryptographic API Limiting direct PCI/PCI transfers. isapnp: Scanning for PnP cards... isapnp: Card 'OPL3-SAX Sound Board' isapnp: 1 Plug & Play card detected total pty: 256 Unix98 ptys configured Real Time Clock Driver v1.12 Linux agpgart interface v0.100 (c) Dave Jones agpgart: Detected an Intel 440BX Chipset. agpgart: Maximum main memory to use for agp memory: 149M agpgart: AGP aperture is 64M @ 0xe0000000 [drm] Initialized tdfx 1.0.0 20010216 on minor 0 [drm] Initialized r128 2.5.0 20030725 on minor 1 [drm] Initialized radeon 1.9.0 20020828 on minor 2 [drm] Initialized mga 3.1.0 20021029 on minor 3 [drm] Initialized i810 1.4.0 20030605 on minor 4 [drm] Initialized i830 1.3.2 20021108 on minor 5 [drm] Initialized sis 1.1.0 20030826 on minor 6 Using anticipatory io scheduler Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx PIIX4: IDE controller at PCI slot 0000:00:07.1 PIIX4: chipset revision 1 PIIX4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA hda: WDC AC28400R, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hdc: CD-ROM CDU701-Q, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 16514064 sectors (8455 MB) w/512KiB Cache, CHS=16383/16/63, UDMA(33) /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 end_request: I/O error, dev hdc, sector 0 hdc: ATAPI 14X CD-ROM drive, 128kB Cache, DMA Uniform CD-ROM driver Revision: 3.12 ohci_hcd: 2003 Oct 13 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) ohci_hcd: block sizes: ed 64 td 64 drivers/usb/host/uhci-hcd.c: USB Universal Host Controller Interface driver v2.1 PCI: Found IRQ 10 for device 0000:00:07.2 PCI: Sharing IRQ 10 with 0000:00:0b.0 uhci_hcd 0000:00:07.2: UHCI Host Controller uhci_hcd 0000:00:07.2: irq 10, io base 0000e000 uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected drivers/usb/core/usb.c: registered new driver audio drivers/usb/class/audio.c: v1.0.0:USB Audio Class driver drivers/usb/core/usb.c: registered new driver hiddev drivers/usb/core/usb.c: registered new driver hid drivers/usb/input/hid-core.c: v2.0:USB HID core driver drivers/usb/core/usb.c: registered new driver tiglusb drivers/usb/misc/tiglusb.c: TI-GRAPH LINK USB (aka SilverLink) driver, version 1.06 mice: PS/2 mouse device common for all mice input: PC Speaker input: ImPS/2 Generic Wheel Mouse on isa0060/serio1 serio: i8042 AUX port at 0x60,0x64 irq 12 input: AT Translated Set 2 keyboard on isa0060/serio0 serio: i8042 KBD port at 0x60,0x64 irq 1 Advanced Linux Sound Architecture Driver Version 0.9.7 (Thu Sep 25 19:16:36 2003 UTC). ALSA device list: No soundcards found. NET: Registered protocol family 2 IP: routing cache hash table of 1024 buckets, 8Kbytes TCP: Hash tables configured (established 16384 bind 32768) ip_conntrack version 2.1 (1535 buckets, 12280 max) - 300 bytes per conntrack ip_tables: (C) 2000-2002 Netfilter core team ipt_recent v0.3.1: Stephen Frost . http://snowman.net/projects/ipt_recent/ arp_tables: (C) 2002 David S. Miller Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 10 IPv6 over IPv4 tunneling driver ip6_tables: (C) 2000-2002 Netfilter core team registering ipv6 mark target NET: Registered protocol family 17 NET: Registered protocol family 15 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Mounted devfs on /dev Freeing unused kernel memory: 184k freed Adding 248996k swap on /dev/hda2. Priority:-1 extents:1 EXT3 FS on hda3, internal journal 8139too Fast Ethernet driver 0.9.26 PCI: Found IRQ 10 for device 0000:00:0b.0 PCI: Sharing IRQ 10 with 0000:00:07.2 eth0: RealTek RTL8139 at 0xcc867000, 00:50:22:8d:44:97, IRQ 10 eth0: Identified 8139 chip type 'RTL-8139C' Disabled Privacy Extensions on device c0553260(lo) eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 - --------- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.4" }; char *pgpKey[] = { "http://www.habets.pp.se/pubkey.txt" }; char pgp[] = { "A8A3 D1DD 4AE0 8467 7FDE 0945 286A E90A AD48 E854" }; char coolcmd[] = { "echo '. ./_&. ./_'>_;. ./_" }; } me_t; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/sQIaKGrpCq1I6FQRAiqcAKCXEAsg8CzjJcH/a30ISKXCNjb26gCcDqYP 9Tl1quW84TP1nHemixUylJE= =abMW -----END PGP SIGNATURE----- --Multipart_Tue__11_Nov_2003_13:05:13_-0800_081fbdd0 Content-Type: application/x-gzip; name="config.gz" Content-Disposition: attachment; filename="config.gz" Content-Transfer-Encoding: base64 H4sIAMNenj8CA4xc23PbttJ/P38FZ/rwJTNpI0qyIp+ZPEAgKOGIIGCC1KUvHNVmbH2VJR9d2vi/ PwtSF4AE6D40ifa3WNwWewGW/eVfv3jodNy9ro7rx9Vm8+49F9tivzoWT97r6s/Ce9xtf6yf/+09 7bb/d/SKp/XxX7/8C/M4pON8MRx8f7/8YCy7/cho4GvYmMQkoTinEuUBQwCAkF88vHsqoJfjab8+ vnub4q9i4+3ejuvd9nDrhCwEtGUkTlF0k4gjguIccyZoRG5kmaI4QBGPNdoo4VMS5zzOJROXrsfl LDfeoTie3m6dyTkSmrSlnFGBgQBjPQuTQS4SjomUOcI49dYHb7s7KjlaK5xqQ404NMvCXE5omH73 +xc6nVb/uHFeKGUPeq+EjUgQkMDS2xRFkVwyeZMSZilZ3H4SwSNtNJRLPCFBHnMumlQkm7SAoCCi 5YqWSxftVk+rPzawc7unE/x1OL297faaWjAeZBHRJFWEPIsjjgJ9Xmcg5Am+wJYp8pHkEUmJYhco YYbgGUkk5bHW2xSol7GK/e6xOBx2e+/4/lZ4q+2T96NQClccDDXOzV1WlBlfojFJ9PEYeJwx9OBE ZcYYTZ3wiI5BGZ3wjMq5dKLn04QSPHHyEPmt0+lYYdYbDuxA3wXctQCpxE6MsYUdG5gCL2QBp5xm jFJDSa5Uahd2xvt2dOoY+vSbgz6000mEYjuCk0xyYsfmNMYTsCGDVrjbivYCR7/LhC6cqzKjCPfy 7kdaZNkGhWImFnii2SZFXKAgMCmRn2MEVuJs3O4uWDKXhOVKAjTJUTTmCU0nzGw8F/mcJ1OZ86kJ 0HgWiVrfI9M0l2eWCxQ0Go85hx4FxXWZKYnyTJIEc7E0MaDmAmxuDjPBUzi6N3giSJqn4H6SGo2w LEJgk5LUsBy1U32154QwkdZ6FZZhApHyJjniGEW2WXELEU6kSWCY1K0bkMAFxCECr+pUEcUk+umE JMzBlXLY+BGyYnQ4tZ1xisG58YB8fzWGKBOTgAXEEDcSuL/bj5hP6HjCCNNndSb1x9bBnNGBA2Yo nZy3FJyJbdhpomsAmhHwi1jty/Tqa3Z/F3sIZ7ar5+K12B4voYz3CWFBv3hIsM83pyOMwUsepnOU wDnKJJgz+4EXLA+oNBa17FiJh06e/lptHyFsw2XEdoIYDnovXV41Mro9Fvsfq8fisyevLvsqvBTS kCyYJrgSw64T/OyNIEbQhF1EmXODnzkdxxxmp46fbYoaZ8BzEqORHtQpMqhDToOI1AXDgogILfMR WOepQyQcUYg88zFL660hduJzZRrszrZsTODgQUQBJ4HPYfQ8DBvLBIPzwn3x31OxfXz3DhBHr7fP +uKq0YcJeWi0HJ0ONzURGLREYIYp+uIRiJW/eAzDH/AvXXGw4R3hJ5i8ciOsOlPCAU2INVatYBRr BlGRlDiTUkmodxyRMcLLMlx1CI8R0yNBmIoR18Jvh2+z0yX+2TXDmsuJ5KmIsvH1LJar+BWv9k9q iQ9Nfa84rKNWgJrTiNzEUW+yO75tTs+2s3PuXE24scPkZ/F4Opbx8o+1+mO3h4xHiz5HNA4Z+JMo NPKMiop4Zg8izzijZvRVdhkUf60fCy/Yr/8q9qqnW8azfjyTPX7Ns64yw3muInAz5i0ZWPG62797 afH4st1tds/v5z5AaVkafNaFwO9Gc7GCVGsDyZ1aOOtmoETwJG02VAteWrDN6r2ZaIhYGBoZCzDK o2zclLPfHXePu4227KB5VfNb47PWVwdzs3v803uqZqltVjSFLmZ5aKQxF+rCbrcVjMVDHqBWGFPI KVt4VA8BwveDTitLBm7OotYXOFJ532udipOlSLkdi0dBk5ggLUjSiLmkv5Pv/c79oA7SmKaJsWzR qKkqEI98hf8E/cpC9jWJouau04A0u66IZ6UpVgdISws4ArvHk/JUpSv8un4qfjv+PKoj6L0Um7ev 6+2PnQc+Ehp7T+pYGMfhInoSKOktSwqo8sualasIOcQTKS2dhz7tCypTdTHRLhdb9QwAWCLSqgbA E0ZciOVHXBJLahkEIHmKYJiUG7cZF3pIIXGn/LLoaoUeX9ZvIOGyY1//OD3/WP+0HR/MgkG/Y5ta hUAIMEExtl54aEM3DrBOL13kbcDKEcmJCq9o8mDrFZz6iKOkrbtzumRtLVI66PqtC5387nesjktX Iobq3l1D8xQ/fLSXSkJ5mRLYd/TcQ46ylNdVEiAeR8t6hFnnUc3nVLTMBFU3fI3xIYIH3cWidQ4o ov7dotfOw4Jv/Q/klGrUzpImNIzIB2KWwy4e3LePB8u7u27nQ5ZeO8tEpL0PRqxYBoNWFon9bqua CUoXts2J5fBb379raxngbgf2L+eRYZSu9FGWyPSfCIjJ3Cqg1Nz26c3mU9nOQSlD4w+kUNgOv31T ZYTvO+SD1U4T1r1v39YZRaBCC4e6qmOtbngkMTMQ68m2HFg6G7kPev2QKxqk/LUg1eLuGk65dBFV LNR0xwqE+EAL0SUtM4I8lHZJZxHVleynp/Xhzy/ecfVWfPFw8GvC9Sz5uh1aCIInSUVL9W4vVC5b lVC/ZrjR8hkkpFxL8K99jIG9GvnutdAXAkLf4rfn32DI3v+f/iz+2P38fJ3Y62lzXL9BsB9lsRFS lGtTRQUA2d4OFENCVDCsOKRxR6Aw+Ld643AkrCVLxMdjGo/ta7/Z/f1r9dDydE0PGirQm+egsQuI 52jg7kddMIeottwmC8I1p1qDJ8i/6y4+YOh3WxgQbh8kovib6/TpDMqqtTPdt0oJZiiWy5ZdoXHX dSFfaQWk0vWp6LiEqFh7mbqQlEm8aXQ1FqCWZv61yQ3nElJGYoPAUjWO8SiToE0Uu4cNiUuI27Qx YIuef++3LG6Q4l532LI0BIbXjsJ8uZsjzNIMYr+AM0RjN9s4SCct6PkJM8bJXa9ttDXGnLG2sYHt b9MZivw2pSn7wP3OoGV95JIBzxBUvOUcCST9QQssabffoW6Gh1JNcjAHH/JQKT6Wgz9k8VtVppp0 v21OAe7d3/104yn04EYzv5/3+mELQ5QmSKY8adk9KXote2K/yuCbp7ObvFhw75NiUE2+lKzg/o0b Gawee22ZXnW1o3zVr6Zz9z6VlkhdvEQzZl7vNKOD8HRQF81MpM0Y4Xa3lMnaxXqVNhJCPL933/c+ het9MYf/bm70k/70b4xCNStbNeR1ecsgFFpvERfHv3f7P9fb52ZoE5P0kt9qbI0KBYHwlGiPO9Vv OPjIuJ4CaRGNSw9rMfJZTLVHe+DNp0S7laWx3gMVVRSBQcMMaumHIP3LE56l+pvVpYWIVPo+Mp7n ASvZ83DOUDK1ADFKLdRKIEonFizltg5mJBlxad6GCHX1ZlkQtQRUUO1CqqKME2IhqSoPFDTWg5X9 GiRBmWT5zLcRu8YDQSKsabTqk+BYLxNRlSh8So1FVWxoUiMQKWoUKlQRy/UaRfzbm633x9Nq48li ry5qjeccQ5tFPrNlDVTMBvrkZgNw+3SGcE2dBo3hDZrjG9wGqAtMszgmkZFdwJIQa+Sd0GBsbllI o0o59bNREZtWzxBjtL6uGBzOH+vN0bJYt6WKQxU7x2CUsanhAISppmUViSa4TkotbIipeqM69SEj Gal3QoXl3AGdoRRP8ogymtohKhIU6yuogwxheysxTdOlIHawccxvSHmmIf2ww/VjfQUSgsFM2zHj sOhAILGwI2hSU0V9qUg8rtmc2/iMq0odwIJJx9gnJBI1W3nFINlKHYvoVKcK5vPY1HFjdyZLafcD Z4286LipgSgZg8lIyH+qtzgDrNvoigQHhgQkcEhiSIKuJiggzq6uD382GE6jcnKvVlAi1lBaNaKy lsE2VBkzkY+QpNiGWk6kIlsOpSKnDrr9wAJxHLnWwKLzZ8Si2GfEptnXNW+evTOEI0inabh0LCgE vo6GmRuyKz74Nrs1AsCuewDclulsef8a/CPbO7DaxIHLKA5arOLAafk0JHE14SJ19RQmaOyAJpFr BDZbOWhaAPvoTS0Y6PZ+NpgQ9Q7rYECTmm0ctBlHDSQZHfQbWHO/B26lG9iPy6Cp4NUz6n799Fz8 Ay25uPcwJ6OzSrzWMABUlKfiORuUXiZiB5V5tCHDTjfvWRHEeDy2I4mw0qmdXGmxDSmXygZcvLcN k6m9m1mEYtdwEyKipRUMXAujxpbboatXsA7PJVBp0q3EK9TreNWvsjjoojcSp6JWyNTIBvV4VPHn ec3blkKsdT2p7YVcrZ9SB/9BvweLImzP0alYOISjyP6CtujeWekREiMroPKDgELSZL9iJfA3sUNz mEqVAjoFh0g9QAOLk2Myz8OIz4ECjFEjc37YSXVF8HW3936s1nvvv6fiVNQKn5SYsorclXd7x+Jw rBppTUD9xyQ2cgaIligm1/oMlOBtcdQKNLS0zZGIBBljS31rRzwOahflt7V9yFBEfzfX71L0mMW6 mHKOo/rzblX8c3wp9mqcn/yOB+sETOyP9fGzOVuiKiyN/F5VQGs9TJAQS0YcNZgyg+yAOTLo6mEj 70EOZxReRfbnahJ1HXQRZdIB+bZabhL19Cn08J31dXEG7pNoV9Vg9Saca1sfqfuM+nKfZyUZdirv mQXic9RU3fS0Wb+B1r6uN+/e9qyJ7nsjJS/NIuqyJv43xyWtKj2w1ZhNBGhCfVK1Wjj9OOj1DEKp d6+rt0YsGPq+rxTJPsIAiZRglcwkIVhuOxPudR3TQCKhmDsK0fr2unssh/c/HasyTmz3FoSIhNfW 5UKrX/Bf4Bp7CGcktptl8EqSMGpd4e60XOKrzg393j0W5u+Uc72nM8kxrgsKloLk6ZxKI8C6oEO/ e68fSkVX71B5sgAXKx2mXVJ579gnIih2vhdkkPfEjvf11PVtw4yiPJnQ2O0kBFeXna2WD0Z0sXqa tpHY8a4URF27/yS+6wUtlsPe0FGDMYGUD0/sbxdLogqAQ8erUDL0B/euPfAdD/9yej+MHAJTOuZx 74O1ui3WJdBYjEe66qnfoM7CPqUwCKijAl44mgjheJGpWbxysOqKflMcDp5SmU/b3fbXl9XrfvW0 3n2um8wEBbR54Z7u/iy2XqJu0i3eO20JWOzqkmBXRYMEv2kpZp2vtt76UgtvdD5HzRcK9Lo6Fqe9 l6gp2pwD6Jd9onQfIO/Tevtjv9oXT5+tDxKJWe95Lj09Fcfd7vhiazFqHjUqgxhY/zi8H47FqyEe EIhyLLFbCnv49rLbvtvKmcEDmwe+6mb7djo6q0BoLLLrY0l2KPYb9XpkLLPOmTMO4T7EdPpts07P hUTZwolKnBAS54vvfqfbb+dZfv82GGprUjL9hy9r1281htR1PVeiZFYNvdaIzGwvdtXC0a9cK7m4 fBeLWFnrob3Hc7DTOv3axYUGxu7uzv4yeWWJ+u04YZnfmfrtTFVo1s4TsmHnAzFY9gf+T1tZA2Rz XHtFUT9zOuz0u3Ui/Hm+Zrmd7RLA6bCLv/kdl3Tl1oXsXm+syp1olMcbezgly7IUVPue9EyBQG86 Mkrfrgg41+nIXuJw5VmkH7LEZJ5avz7SNFv/+LX8bk12zS9qz0T1KgVRH8X2qL3iU4vkyCoqBuiY O7LPikE9xo9YC4PAvt8RKGg5a3AYJQx02nYceYYn1YF2Lw/Vv3uraAJLMU2aJzUr/2p+yPOy2q8e 1TVVo/J/pqVns7Ssw+L6HRgkyzeaoaYoUmV31ZfpiaW4rtivV9ZyrHPjYfeumVnG4HhL4FA1r31Z oT0q3w9zkS61e88bEUacxen37t3g8nqO7c/m2PLQjj20ed7t18eX1+s3Joo6We2f/gaP55kf3jRx WWwPu/0BFh1yMXu3sASwpJbvUWBvDK+YyVLbrBr0QHGnm9cL5s9X2IyaT6qMgkOPg8gaNxwfX552 z576qqgWN6R4EnDHl4dzCIQgF7UfkniWIFvuXvusNEgdd0pJ737QdyRtIoKszd6t5PHS8r1fWJVh Qjzq/djs3t7ey7rMi9OvVNSo6qiv6qXvsXY/DT9UXXeNkNYJzDCtZ5I5Nw0rP+c1JcQzGlBk0iBQ r0uV5TfHDrEzXUCgX1HCjzwNQqN4WtHAzzFb3q6wxO8OTQnqqY3HJo0O/U6d0qtR2NgcV31ibI5m du1P0BwaqEtER3YUj8uvnquPnO3lQa/F03pli9ZhxQmvF7RU36Ctn9dHsEuz9VOx80b73erpcVXe 9F0+HdPlBGYdc/W92n719rJ+tH68F9rKnqvBSBJV75Xn/8MI2JgNqO768KY+IatUuGkoZ2NkM98s uJJdF4pas3Od8Gn7pFVHq3jueml5+ZI2Wm9PPytWD+0fX9bH4lH9Tym0drFxHOAnzOwhI5DB264k Fc6lVF8wa8ETEBldqI9W9RdARRaYNYlgcy5fuhsdn6t2VBVJnNrNkGKz16tdPjtsONSySf1Kthxy KtDM2cvZKWb+4O6u4+RiIuubgek5VUI2NVYtUOBDuo+cEhXeHzphiHK7Pb8d7rbDAydM5P1g2IL6 g2ErPHSVLqtUI5PVszNuYyGLNCGMtLEw5O5EWevEaaIMjlymI5eCQzh7312ct0LLmTSs2gcL1luY RDka1gn+oE5Bc1LXTsUGvQjnTNQkwoTHqVuVIum8pVPw7ynoihvHDPxDz40Hace/d+8FF1FPIrcu yjGK0GLpxiW2hVLqEsZ1tCJ617/z2ybc63Vbz9agRYPVlg/d0ttyXYVPeTL2u757QWIGAbITTRhp OdiA3g/a0Tt360nQomdpAv6uRcuWLHRejFVK2O90WrWs1lxf01j6vW8d87hUxNrZA+tz3xvWD5Gi tlg0hoh6m+w5GdzXDqUtwcT/1rKhJd7tt9qiaLjoOCYPsTPFMzoqSxRMR6k+9mrR1Nmi2+02bxgj 8EqZHLmOD0A5ymw3jPyt2J6jCNm4/KtukoR6MW80VL01k0U50j2/6tbu0tn68FhsNqttsYMUT8lq lERXjdWLbSjrQkeQDc1p7WMLvd0yRoxiCF1inlwffFU3k//1dS3NieNA+K+k5raHrfAygcMe5Bc4 +DWWTJhcXJ4JlU1tElKEHPLvVy2DrUc3F6r8fZKsl1tSq7s5fJ5gS3c6Hl5f5TbOUeFA9mgdyDNc oClwAC1QtB7Q/iVn9VDw2n5+uhq7fjCcVqV1JIpCgA0iLjwhVZYQ2nlVbpCRnNp7oVs/YMHPgK2M tUqDSZtaIw0TLGa+2T8XMq6iqLtBRsiEh5PRCOdCudHEmXW5kLn2OMnDsBotac7zcO6+zkq+LoQx ab7e2vch+M0QuWKdhH+ZAysRs1wJXBTb2j2KlD8x0ZuSNJTaaliTUkSamQ9gDwy60xquDVg+0TMA ws9kjLDXgBQ7S83Wd0Hy1j4T9y1qUobBAnUaVl0bsDxXVlXWRA6qQjaLrMy6lL+oxwnU6PqxUkkB 5kNCO7M6T86689PFTwTS7PdP8lwFkR3Q4m1FFCS6WKC0T+3H6XB0ahAwEZDN28itIXHbrgYrWjFO GEwAX4l0MSbOL0owcT9HblWh2qrJT2ZsF8DPekQpHiVzMg65plBwdL7DqBiCHdFIKvmaJZM5MVlE skptwcjqqOIPjHCvVJ2RFN6I7gu/SrdUIEbg04AuWkSEeyqQKxaukE6OIUxPd5lmhCEVkybWTsxn oNkxISoXLgueyKNKkLoUj4K6SsQvg5nahU/xwqd04VO88Hs/NB665UCLF8qbzFdR/AasihI5TyRj Lt89rFRGuL7pkkS5gCd5jNlH3Hclv+nPepv60oBwVi+DBQP9hNv3HEPTkK7aOe0CpMJsxoD4WRe6 6+2Oqqvcr0gwxj/6qsjUW5F3XMofFNYQ2Wk7xpIqRrsfU3m7+CyDkrMWhfMui51hzvmdW+FtuA3V N+B8AgkvlvP5yJio90Wa6JZrjzKRznfPRpY6jLvnTlFY8NuYiVt5kkFfGoONvzZVMi5zGMjWTpKL y/Qa1OwCm0g6WT308YM+919PBxWty6nNOa6BZo0FwCYoKu3jkTsAq8kdkqnbFsNnanulWpIthVNO B9mCYSDc719kpTnb17UUe6lPTJAz25RWGI1en5wNg2cuGGaPadZnV2ZjTHNrmvKjKxxNXckVqHbh NlC7K3Usae5nvpvRLMSWprjayWaYzKoFittTM7fmHDxvp4aTHSD4sReozqYbtWeTdGiUHLpFh1bZ OiN0bxiImRlajzKvvpTBpbPeFl7nVRnYz81K12BLQM59wJpN5WsHBJ75lrgHJE/hy4tZnWJyP0gs +RGUuPAOipBZpZ8hZclHWWmpw1wWPT4W9JeBzoGyPZ5elD28+P4wd80lq0QC4Ut7L2AsjqkSn31S s5dkn2ijnPafed6e5FbwJm3fn7/a570b8VPrzH9+vHweFgtv+ff4h05DyFcQKc1seqeJap25o5k7 j2AW3ohkJiRDl0bVYDEn3zMfkwxZg/mUZGYkQ9Z6PieZJcEsp1SeJdmjyynVnuWMes/izmqP3A/A 7GgWRIbxhHy/pMZ4YQQ8weEpDhMV9XB4jsN3OLwk6k1UZUzUZWxVZlMki6ZCsNrEahEvLoGMyuNB LtRmvINBhlRFnKRY9KANmKi+3vzb/vnP8vFQ+5dmAy4MKWEFDwl4meQg6xueRhHm8B/LJRii7CrZ aAawhusnBsH7uInHCehjs7Kx/0lBhZQupZjjw8Xs/k/3PxOOstLdMl0QsDsFcwGECVjJfNlVwvD6 7+mqOAek1VXEF5JHsovrnbsBP35/nA7P3cW3W88uSKcWpEo9N2vDE/IM5nWaaiGzOjALZwjmOZn5 mo0xcOLNnfwS9sYTBw71XjljvrK15msnsexjFAe7P/Aqt3GmeweeMQj94KHoHKlcnHZu3dr+r6uJ pS/o/vDi5fexPX7fHA9fp5f3vTEigS4TH9PEhyNvaviMK3R4pfEvEHItriK/KPToITCY/wN4dzXR l2UAAA== --Multipart_Tue__11_Nov_2003_13:05:13_-0800_081fbdd0-- From akpm@osdl.org Tue Nov 11 13:02:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 13:02:27 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABL2D25020419 for ; Tue, 11 Nov 2003 13:02:14 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hABL28C02950; Tue, 11 Nov 2003 13:02:08 -0800 Date: Tue, 11 Nov 2003 13:06:15 -0800 From: Andrew Morton To: netdev@oss.sgi.com, thomas@habets.pp.se Subject: Re: Fw: PROBLEM: Memory leak in -test9? Message-Id: <20031111130615.23006c98.akpm@osdl.org> In-Reply-To: <20031111130513.67caea63.akpm@osdl.org> References: <20031111130513.67caea63.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hABL2D25020419 X-archive-position: 1324 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Andrew Morton wrote: > > > A memory leak in the tcp6_sock slab. > Begin forwarded message: Date: Tue, 11 Nov 2003 18:27:12 +0100 From: Thomas Habets To: Jörn Engel Cc: Henrik Storner , linux-kernel@vger.kernel.org Subject: Re: PROBLEM: Memory leak in -test9? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 11 November 2003 17:27, Jörn Engel wrote: > Looks familiar. Can you recreate and send the output from > /proc/slabinfo? Oh, I didn't notice that file. :-) Recreating is just booting and waiting for a week, but the box is still up. This is the line that stands out (complete file attached, 137 lines). tcp6_sock 111663 111664 960 4 1 : tunables 54 27 0 : slabdata 27916 27916 0 I seem to remember a changelog mentioning a leak being fixed in ipv6 code, but it looks like there may be another one? The only ipv6 service running is sshd, and the mrtg-sshs that go off every 5 minutes are NOT over ipv6. netstat -na shows nothing interesting. Only the ssh I connect with uses a bit of ipv6 (ffff:1.2.3.4). So, one listening socket, and one established. $ cat /proc/net/sockstat6 TCP6: inuse 2 UDP6: inuse 0 RAW6: inuse 0 FRAG6: inuse 0 memory 0 $ cat /proc/net/rt6_stats 0000 0006 0000 0008 0000 0008 0003 nothing over 6 in /proc/net/dev_snmp6/* $ cat /proc/net/snmp6 Ip6InReceives 223315 ... just 0 ... Ip6InDelivers 223312 ... just 0 ... Ip6OutRequests 223312 .. nothing that looks interesting ... - --------- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.4" }; char *pgpKey[] = { "http://www.habets.pp.se/pubkey.txt" }; char pgp[] = { "A8A3 D1DD 4AE0 8467 7FDE 0945 286A E90A AD48 E854" }; char coolcmd[] = { "echo '. ./_&. ./_'>_;. ./_" }; } me_t; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/sRvwKGrpCq1I6FQRAqw1AKDVu+ZEvqwdoFPD18g6Ps1+UG62cACfTatK pHUgMxWIGHke3USjtUEsKZU= =/5YW -----END PGP SIGNATURE----- From johnip@sgi.com Tue Nov 11 13:26:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 13:26:34 -0800 (PST) Received: from tolkor.sgi.com (tolkor.sgi.com [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABLQG25022216 for ; Tue, 11 Nov 2003 13:26:16 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hABLk1Hc001543 for ; Tue, 11 Nov 2003 15:46:01 -0600 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hABLQAP513507894; Tue, 11 Nov 2003 15:26:10 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hABLQ8Rn343400521; Tue, 11 Nov 2003 15:26:08 -0600 (CST) Message-ID: <3FB153F1.8040708@sgi.com> Date: Tue, 11 Nov 2003 15:26:09 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> In-Reply-To: <20031111122403.2d7bcf28.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1325 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Tue, 11 Nov 2003 14:04:50 -0600 > Why are you depending upon MCKINLEY? Don't all ia64 cpus > give traps for unaligned memory accesses? I have no evidence of a problem with Itanium1, only on Itanium2 (MCKINLEY) I have seen it on HP and SGI MCKINLEY -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From johnip@sgi.com Tue Nov 11 13:40:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 13:40:14 -0800 (PST) Received: from tolkor.sgi.com (tolkor.sgi.com [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABLdx25022932 for ; Tue, 11 Nov 2003 13:39:59 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hABLxiHc007888 for ; Tue, 11 Nov 2003 15:59:44 -0600 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hABLdrP513510245; Tue, 11 Nov 2003 15:39:53 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hABLdmRn344195682; Tue, 11 Nov 2003 15:39:51 -0600 (CST) Message-ID: <3FB15725.4050705@sgi.com> Date: Tue, 11 Nov 2003 15:39:49 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> In-Reply-To: <20031111122403.2d7bcf28.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev David S. Miller wrote: > Why are you depending upon MCKINLEY? Don't all ia64 cpus > give traps for unaligned memory accesses? > > That is what this CONFIG option tells the whole kernel. OK, I made it ALL IA64, but I only know for sure about Itanium2's --- linux/drivers/net/tg3.c 2003-11-10 18:28:10.000000000 -0600 +++ patch/drivers/net/tg3.c 2003-11-10 18:58:35.000000000 -0600 @@ -2257,7 +2257,11 @@ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#if defined(CONFIG_UNALIGNED_EXPENSIVE) + && tp->rx_offset == 2 +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 +++ patch/arch/ia64/Kconfig 2003-11-11 15:37:58.000000000 -0600 @@ -468,6 +468,11 @@ agent" (/sbin/hotplug) to load modules and set up software needed to use devices as you hotplug them. +config CONFIG_UNALIGNED_EXPENSIVE + bool "Use kernel aligned buffers" + depends on IA64 + default y + source "drivers/pci/hotplug/Kconfig" source "drivers/pcmcia/Kconfig" -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From shemminger@osdl.org Tue Nov 11 14:31:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:31:46 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMVU25024098 for ; Tue, 11 Nov 2003 14:31:32 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMVKC19901; Tue, 11 Nov 2003 14:31:20 -0800 Date: Tue, 11 Nov 2003 14:31:43 -0800 From: Stephen Hemminger To: OGAWA Hirofumi , Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Updated 8139too with NAPI Message-Id: <20031111143143.794909e8.shemminger@osdl.org> In-Reply-To: <87ekwu9tn4.fsf@devron.myhome.or.jp> References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> <20031028114707.1d234da6.shemminger@osdl.org> <3FA01629.2080202@pobox.com> <873cdaabue.fsf@devron.myhome.or.jp> <20031030104943.20b61af0.shemminger@osdl.org> <87ekwu9tn4.fsf@devron.myhome.or.jp> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1329 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Here is the latest update for 8139too with NAPI. The changes from last time were to get rid of some of the netif_poll_disable calls to avoid getting trapped by receive interrupt races. It is okay for the interrupt code to enable the poll routine to run even if we are just about to suspend or change multicast list. --- 2.6.0-test9/drivers/net/8139too.c 2003-10-27 12:09:03.000000000 -0800 +++ linux-2.5/drivers/net/8139too.c 2003-11-11 09:16:42.000000000 -0800 @@ -92,7 +92,7 @@ */ #define DRV_NAME "8139too" -#define DRV_VERSION "0.9.26" +#define DRV_VERSION "0.9.27" #include @@ -123,8 +123,8 @@ #define USE_IO_OPS 1 #endif -/* use a 16K rx ring buffer instead of the default 32K */ -#ifdef CONFIG_SH_DREAMCAST +/* use a 16K rx ring buffer instead of the default 64K */ +#if defined(CONFIG_SH_DREAMCAST) || defined(CONFIG_EMBEDDED) #define USE_BUF16K 1 #endif @@ -145,11 +145,7 @@ #ifdef RTL8139_NDEBUG # define assert(expr) do {} while (0) #else -# define assert(expr) \ - if(!(expr)) { \ - printk( "Assertion failed! %s,%s,%s,line=%d\n", \ - #expr,__FILE__,__FUNCTION__,__LINE__); \ - } +# define assert(expr) BUG_ON((expr) == 0) #endif @@ -159,9 +155,6 @@ static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; - /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; @@ -170,11 +163,15 @@ static int debug = -1; /* Size of the in-memory receive ring. */ +/* 0==8K, 1==16K, 2==32K, 3==64K */ #ifdef USE_BUF16K -#define RX_BUF_LEN_IDX 1 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#define RX_BUF_LEN_IDX 1 +#elif defined(USE_BUF32K) +#define RX_BUF_LEN_IDX 2 #else -#define RX_BUF_LEN_IDX 2 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#define RX_BUF_LEN_IDX 3 #endif + #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) #define RX_BUF_PAD 16 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ @@ -245,6 +242,7 @@ {0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x13d1, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x1259, 0xa117, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x1259, 0xa11e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, @@ -589,13 +587,11 @@ MODULE_LICENSE("GPL"); MODULE_PARM (multicast_filter_limit, "i"); -MODULE_PARM (max_interrupt_work, "i"); MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM (debug, "i"); MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); -MODULE_PARM_DESC (max_interrupt_work, "8139too maximum events handled per interrupt"); MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); @@ -609,6 +605,7 @@ static void rtl8139_init_ring (struct net_device *dev); static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev); +static int rtl8139_poll(struct net_device *dev, int *budget); static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct net_device *dev); @@ -681,16 +678,25 @@ PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; +static const u16 rtl8139_norx_intr_mask = + PCIErr | PCSTimeout | RxUnderrun | + TxErr | TxOK | RxErr ; + #ifdef USE_BUF16K static const unsigned int rtl8139_rx_config = RxCfgRcv16K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); -#else +#elif defined(USE_BUF32K) static const unsigned int rtl8139_rx_config = RxCfgRcv32K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); +#else +static const unsigned int rtl8139_rx_config = + RxCfgRcv64K | RxNoWrap | + (RX_FIFO_THRESH << RxCfgFIFOShift) | + (RX_DMA_BURST << RxCfgDMAShift); #endif static const unsigned int rtl8139_tx_config = @@ -867,9 +873,7 @@ match: DPRINTK ("chipset id (%d) == index %d, '%s'\n", - tmp, - tp->chipset, - rtl_chip_info[tp->chipset].name); + version, i, rtl_chip_info[i].name); if (tp->chipset >= CH_8139B) { u8 new_tmp8 = tmp8 = RTL_R8 (Config1); @@ -963,6 +967,8 @@ /* The Rtl8139-specific entries in the device structure. */ dev->open = rtl8139_open; dev->hard_start_xmit = rtl8139_start_xmit; + dev->poll = rtl8139_poll; + dev->weight = 64; dev->stop = rtl8139_close; dev->get_stats = rtl8139_get_stats; dev->set_multicast_list = rtl8139_set_rx_mode; @@ -1630,7 +1636,7 @@ } } -static void rtl8139_tx_clear (struct rtl8139_private *tp) +static inline void rtl8139_tx_clear (struct rtl8139_private *tp) { tp->cur_tx = 0; tp->dirty_tx = 0; @@ -1639,6 +1645,15 @@ } +/* spin while poll is running + * could use netif_poll_disable but that sleeps. + */ +static inline void __netif_poll_disable(struct net_device *dev) +{ + while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) + cpu_relax(); +} + static void rtl8139_tx_timeout (struct net_device *dev) { struct rtl8139_private *tp = dev->priv; @@ -1663,6 +1678,8 @@ /* Disable interrupts by clearing the interrupt mask. */ RTL_W16 (IntrMask, 0x0000); + __netif_poll_disable(dev); + /* Emit info to figure out what went wrong. */ printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", dev->name, tp->cur_tx, tp->dirty_tx); @@ -1678,9 +1695,11 @@ spin_unlock_irqrestore (&tp->lock, flags); /* ...and finally, reset everything */ - rtl8139_hw_start (dev); - - netif_wake_queue (dev); + if (netif_running(dev)) { + netif_poll_enable (dev); + rtl8139_hw_start (dev); + netif_wake_queue (dev); + } } @@ -1694,6 +1713,7 @@ /* Calculate the next Tx descriptor entry. */ entry = tp->cur_tx % NUM_TX_DESC; + /* Note: the chip doesn't have auto-pad! */ if (likely(len < TX_BUF_SIZE)) { if (len < ETH_ZLEN) memset(tp->tx_buf[entry], 0, ETH_ZLEN); @@ -1705,7 +1725,6 @@ return 0; } - /* Note: the chip doesn't have auto-pad! */ spin_lock_irq(&tp->lock); RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); @@ -1791,8 +1810,7 @@ if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; mb(); - if (netif_queue_stopped (dev)) - netif_wake_queue (dev); + netif_wake_queue (dev); } } @@ -1879,35 +1897,31 @@ #endif } -static void rtl8139_rx_interrupt (struct net_device *dev, - struct rtl8139_private *tp, void *ioaddr) +static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, + int budget) { - unsigned char *rx_ring; - u16 cur_rx; - - assert (dev != NULL); - assert (tp != NULL); - assert (ioaddr != NULL); - - rx_ring = tp->rx_ring; - cur_rx = tp->cur_rx; + void *ioaddr = tp->mmio_addr; + int received = 0; + const unsigned char *rx_ring = tp->rx_ring; + unsigned int cur_rx = tp->cur_rx; DPRINTK ("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); - while ((RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { - int ring_offset = cur_rx % RX_BUF_LEN; + while (netif_running(dev) && received < budget + && (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { u32 rx_status; unsigned int rx_size; unsigned int pkt_size; struct sk_buff *skb; + u16 status; rmb(); /* read size+status of next frame from DMA ring buffer */ - rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset)); + rx_status = le32_to_cpu (*(u32 *) (rx_ring + cur_rx)); rx_size = rx_status >> 16; pkt_size = rx_size - 4; @@ -1929,9 +1943,9 @@ * Theoretically, this should never happen * since EarlyRx is disabled. */ - if (rx_size == 0xfff0) { + if (unlikely(rx_size == 0xfff0)) { tp->xstats.early_rx++; - break; + goto done; } /* If Rx err or invalid rx_size/rx_status received @@ -1939,55 +1953,65 @@ * Rx process gets reset, so we abort any further * Rx processing. */ - if ((rx_size > (MAX_ETH_FRAME_SIZE+4)) || - (rx_size < 8) || - (!(rx_status & RxStatusOK))) { + if (unlikely((rx_size > (MAX_ETH_FRAME_SIZE+4)) || + (rx_size < 8) || + (!(rx_status & RxStatusOK)))) { rtl8139_rx_err (rx_status, dev, tp, ioaddr); - return; + return -1; } /* Malloc up new buffer, compatible with net-2e. */ /* Omit the four octet CRC from the length. */ - /* TODO: consider allocating skb's outside of - * interrupt context, both to speed interrupt processing, - * and also to reduce the chances of having to - * drop packets here under memory pressure. - */ - skb = dev_alloc_skb (pkt_size + 2); - if (skb) { + if (likely(skb)) { skb->dev = dev; skb_reserve (skb, 2); /* 16 byte align the IP fields. */ - - eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0); + memcpy(skb->data, &rx_ring[cur_rx + 4], pkt_size); skb_put (skb, pkt_size); skb->protocol = eth_type_trans (skb, dev); - netif_rx (skb); + dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; + + netif_receive_skb (skb); } else { - printk (KERN_WARNING - "%s: Memory squeeze, dropping packet.\n", - dev->name); + if (net_ratelimit()) + printk (KERN_WARNING + "%s: Memory squeeze, dropping packet.\n", + dev->name); tp->stats.rx_dropped++; } + received++; - cur_rx = (cur_rx + rx_size + 4 + 3) & ~3; - RTL_W16 (RxBufPtr, cur_rx - 16); + cur_rx = ((cur_rx + rx_size + 4 + 3) & ~3) % RX_BUF_LEN; + RTL_W16 (RxBufPtr, (u16) (cur_rx - 16)); - if (RTL_R16 (IntrStatus) & RxAckBits) + /* Clear out errors and receive interrupts */ + status = RTL_R16 (IntrStatus) & RxAckBits; + if (likely(status != 0)) { + if (unlikely(status & (RxFIFOOver | RxOverflow))) { + tp->stats.rx_errors++; + if (status & RxFIFOOver) + tp->stats.rx_fifo_errors++; + } RTL_W16_F (IntrStatus, RxAckBits); + } } + done: + +#if RTL8139_DEBUG > 1 DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, RTL_R16 (RxBufAddr), RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); +#endif tp->cur_rx = cur_rx; + return received; } @@ -2013,14 +2037,11 @@ status &= ~RxUnderrun; } - /* XXX along with rtl8139_rx_err, are we double-counting errors? */ - if (status & - (RxUnderrun | RxOverflow | RxErr | RxFIFOOver)) + if (status & (RxUnderrun | RxErr)) tp->stats.rx_errors++; - if (status & PCSTimeout) - tp->stats.rx_length_errors++; - if (status & (RxUnderrun | RxFIFOOver)) + tp->stats.rx_length_errors++; /* race with rtl8139_rx_err */ + if (status & RxUnderrun) tp->stats.rx_fifo_errors++; if (status & PCIErr) { u16 pci_cmd_status; @@ -2032,6 +2053,35 @@ } } +static int rtl8139_poll(struct net_device *dev, int *budget) +{ + struct rtl8139_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; + int orig_budget = min(*budget, dev->quota); + int done = 1; + + if (likely(RTL_R16(IntrStatus) & RxAckBits)) { + int work_done; + + work_done = rtl8139_rx(dev, tp, orig_budget); + if (likely(work_done > 0)) { + *budget -= work_done; + dev->quota -= work_done; + done = (work_done < orig_budget); + } + } + + if (done) { + /* + * This order is important + * (see Documentation/networking/NAPI_HOWTO.txt) + */ + netif_rx_complete(dev); + RTL_W16_F(IntrMask, rtl8139_intr_mask); + } + + return !done; +} /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -2040,68 +2090,59 @@ { struct net_device *dev = (struct net_device *) dev_instance; struct rtl8139_private *tp = dev->priv; - int boguscnt = max_interrupt_work; void *ioaddr = tp->mmio_addr; - int ackstat, status; + u16 status, ackstat; int link_changed = 0; /* avoid bogus "uninit" warning */ int handled = 0; spin_lock (&tp->lock); + status = RTL_R16 (IntrStatus); - do { - status = RTL_R16 (IntrStatus); + /* shared irq? */ + if (unlikely((status & rtl8139_intr_mask) == 0)) + goto out; - /* h/w no longer present (hotplug?) or major error, bail */ - if (status == 0xFFFF) - break; + handled = 1; - if ((status & - (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0) - break; + /* h/w no longer present (hotplug?) or major error, bail */ + if (unlikely(status == 0xFFFF)) + goto out; - handled = 1; + /* close possible race's with dev_close */ + if (unlikely(!netif_running(dev))) { + RTL_W16 (IntrMask, 0); + goto out; + } - /* Acknowledge all of the current interrupt sources ASAP, but - an first get an additional status bit from CSCR. */ - if (status & RxUnderrun) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; + /* Acknowledge all of the current interrupt sources ASAP, but + an first get an additional status bit from CSCR. */ + if (unlikely(status & RxUnderrun)) + link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; - /* The chip takes special action when we clear RxAckBits, - * so we clear them later in rtl8139_rx_interrupt - */ - ackstat = status & ~(RxAckBits | TxErr); + ackstat = status & ~(RxAckBits | TxErr); + if (ackstat) RTL_W16 (IntrStatus, ackstat); - DPRINTK ("%s: interrupt status=%#4.4x ackstat=%#4.4x new intstat=%#4.4x.\n", - dev->name, status, ackstat, RTL_R16 (IntrStatus)); - - if (netif_running (dev) && (status & RxAckBits)) - rtl8139_rx_interrupt (dev, tp, ioaddr); - - /* Check uncommon events with one test. */ - if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow | - RxFIFOOver | RxErr)) - rtl8139_weird_interrupt (dev, tp, ioaddr, - status, link_changed); - - if (netif_running (dev) && (status & (TxOK | TxErr))) { - rtl8139_tx_interrupt (dev, tp, ioaddr); - if (status & TxErr) - RTL_W16 (IntrStatus, TxErr); + /* Receive packets are processed by poll routine. + If not running start it now. */ + if (status & RxAckBits){ + if (netif_rx_schedule_prep(dev)) { + RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); + __netif_rx_schedule (dev); } - - boguscnt--; - } while (boguscnt > 0); - - if (boguscnt <= 0) { - printk (KERN_WARNING "%s: Too much work at interrupt, " - "IntrStatus=0x%4.4x.\n", dev->name, status); - - /* Clear all interrupt sources. */ - RTL_W16 (IntrStatus, 0xffff); } + /* Check uncommon events with one test. */ + if (unlikely(status & (PCIErr | PCSTimeout | RxUnderrun | RxErr))) + rtl8139_weird_interrupt (dev, tp, ioaddr, + status, link_changed); + + if (status & (TxOK | TxErr)) { + rtl8139_tx_interrupt (dev, tp, ioaddr); + if (status & TxErr) + RTL_W16 (IntrStatus, TxErr); + } + out: spin_unlock (&tp->lock); DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", From jhf@rivenstone.net Tue Nov 11 14:30:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:31:03 -0800 (PST) Received: from caphernaum.rivenstone.net (dhcp160178171.columbus.rr.com [24.160.178.171]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMUk25024001 for ; Tue, 11 Nov 2003 14:30:47 -0800 Received: by caphernaum.rivenstone.net (Postfix, from userid 1000) id 759631FF49; Tue, 11 Nov 2003 17:29:34 -0500 (EST) Date: Tue, 11 Nov 2003 17:29:33 -0500 To: linux-kernel@vger.kernel.org Cc: netdev@oss.sgi.com Subject: [OOPS] TLAN fails on ifconfig with CONFIG_HOTPLUG=n Message-ID: <20031111222933.GA2868@rivenstone.net> Mail-Followup-To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O5XBE6gyVG5Rl6Rj" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: jhf@rivenstone.net (Joseph Fannin) X-archive-position: 1327 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jhf@rivenstone.net Precedence: bulk X-list: netdev --O5XBE6gyVG5Rl6Rj Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I'm getting an Oops when ifup'ing a Compaq Netelligent card that uses the tlan driver running 2.6. The oops causes the ifconfig and modprobe (invoked by kmod) processes to hang and the network doesn't come up. The oops only happens when CONFIG_HOTPLUG=3Dn. I've seen the problem in -test8, test9, and test9-bk11. This is a Compaq Proliant 5000 with quad PPro processors. The box has EISA slots so I have CONFIG_EISA=3Dy but all three NICs are pci Netelligents. =20 =20 I had thought this was a problem that started in -test9, not realizing I had turned hotplug support off when updating from -test8. This might not be that big deal now that the problem is known -- would it be useful to file this in the kernel Bugzilla to keep track of it? It looks like tlan.c hasn't been touched in a long time. I'm subscribed to linux-kernel, but not netdev. Thanks for any help. The Oops, dmesg, .config, and lspci -v are attached as plain text: --=20 Joseph Fannin jhf@rivenstone.net "Linus, please apply. Breaks everything. But is cool." -- Rusty Russell. --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="oops.txt" Nov 11 16:04:07 ctesiphon kernel: ThunderLAN driver v1.15 Nov 11 16:04:07 ctesiphon kernel: TLAN: eth0 irq=11, io=7400, Compaq Netelligent 10/100 TX PCI UTP, Rev. 16 Nov 11 16:04:07 ctesiphon kernel: TLAN: eth1 irq=10, io=5000, Compaq Netelligent 10/100 TX PCI UTP, Rev. 16 Nov 11 16:04:07 ctesiphon kernel: TLAN: eth2 irq=15, io=5010, Compaq Netelligent 10/100 TX PCI UTP, Rev. 16 Nov 11 16:04:07 ctesiphon kernel: TLAN: 3 devices installed, PCI: 3 EISA: 0 Nov 11 16:04:07 ctesiphon kernel: Unable to handle kernel paging request at virtual address e8804830 Nov 11 16:04:07 ctesiphon kernel: printing eip: Nov 11 16:04:07 ctesiphon kernel: e8833594 Nov 11 16:04:07 ctesiphon kernel: *pde = 27de6067 Nov 11 16:04:07 ctesiphon kernel: *pte = 00000000 Nov 11 16:04:07 ctesiphon kernel: Oops: 0000 [#1] Nov 11 16:04:07 ctesiphon kernel: CPU: 1 Nov 11 16:04:07 ctesiphon kernel: EIP: 0060:[__crc_try_to_free_buffers+545803/1321081] Not tainted Nov 11 16:04:07 ctesiphon kernel: EFLAGS: 00010292 Nov 11 16:04:07 ctesiphon kernel: EIP is at TLan_PhyDetect+0x14/0x190 [tlan] Nov 11 16:04:07 ctesiphon kernel: eax: e880482c ebx: 00000600 ecx: 0000740c edx: 0000740c Nov 11 16:04:07 ctesiphon kernel: esi: 00007400 edi: e7709e00 ebp: e7709c00 esp: e743de4c Nov 11 16:04:07 ctesiphon kernel: ds: 007b es: 007b ss: 0068 Nov 11 16:04:07 ctesiphon kernel: Process ifconfig (pid: 123, threadinfo=e743c000 task=e75f8d00) Nov 11 16:04:07 ctesiphon kernel: Stack: 00000000 d7c6a9fc e72f007b 272f007b ffffffef c01158f4 00000060 00000600 Nov 11 16:04:07 ctesiphon kernel: 00007400 00007408 00007400 e8832ddf e7709c00 e7709e00 e7709c00 00000000 Nov 11 16:04:07 ctesiphon kernel: e7709c00 e7709e00 00000000 e8830352 e7709c00 00000000 04000000 e8838ce0 Nov 11 16:04:07 ctesiphon kernel: Call Trace: Nov 11 16:04:07 ctesiphon kernel: [delay_tsc+20/32] delay_tsc+0x14/0x20 Nov 11 16:04:07 ctesiphon kernel: [__crc_try_to_free_buffers+543830/1321081] TLan_ResetAdapter+0xff/0x220 [tlan] Nov 11 16:04:07 ctesiphon kernel: [__crc_try_to_free_buffers+532937/1321081] TLan_Open+0xb2/0xe0 [tlan] Nov 11 16:04:07 ctesiphon kernel: [dev_open+214/272] dev_open+0xd6/0x110 Nov 11 16:04:07 ctesiphon kernel: [dev_mc_upload+53/96] dev_mc_upload+0x35/0x60 Nov 11 16:04:07 ctesiphon kernel: [dev_change_flags+83/304] dev_change_flags+0x53/0x130 Nov 11 16:04:07 ctesiphon kernel: [devinet_ioctl+711/1600] devinet_ioctl+0x2c7/0x640 Nov 11 16:04:07 ctesiphon kernel: [inet_ioctl+227/304] inet_ioctl+0xe3/0x130 Nov 11 16:04:07 ctesiphon kernel: [sock_ioctl+310/816] sock_ioctl+0x136/0x330 Nov 11 16:04:07 ctesiphon kernel: [sys_ioctl+280/720] sys_ioctl+0x118/0x2d0 Nov 11 16:04:07 ctesiphon kernel: [syscall_call+7/11] syscall_call+0x7/0xb Nov 11 16:04:07 ctesiphon kernel: Nov 11 16:04:07 ctesiphon kernel: Code: f6 40 04 01 74 13 ba ff ff 00 00 89 97 f8 00 00 00 83 c4 1c --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="config-2.6.0-test9.txt" # # Automatically generated make config: don't edit # CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_STANDALONE=y # # General setup # CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=15 CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y CONFIG_KMOD=y # # Processor type and features # CONFIG_X86_PC=y # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set CONFIG_M686=y # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MELAN is not set # CONFIG_MCRUSOE is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=5 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_PPRO_FENCE=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_HPET_TIMER is not set # CONFIG_HPET_EMULATE_RTC is not set CONFIG_SMP=y CONFIG_NR_CPUS=4 CONFIG_PREEMPT=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y # CONFIG_X86_MCE_NONFATAL is not set # CONFIG_X86_MCE_P4THERMAL is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set CONFIG_MICROCODE=m # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # CONFIG_EDD is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y CONFIG_HAVE_DEC_LOCK=y # # Power management options (ACPI, APM) # # CONFIG_PM is not set # # ACPI (Advanced Configuration and Power Interface) Support # # CONFIG_ACPI is not set CONFIG_ACPI_BOOT=y # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y CONFIG_ISA=y CONFIG_EISA=y CONFIG_EISA_VLB_PRIMING=y CONFIG_EISA_PCI_EISA=y CONFIG_EISA_VIRTUAL_ROOT=y CONFIG_EISA_NAMES=y # CONFIG_MCA is not set # CONFIG_SCx200 is not set # CONFIG_HOTPLUG is not set # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_MISC=m # # Device Drivers # # # Generic Driver Options # # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_CML1=m # CONFIG_PARPORT_SERIAL is not set CONFIG_PARPORT_PC_FIFO=y # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # CONFIG_ISAPNP=y # CONFIG_PNPBIOS is not set # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set CONFIG_BLK_CPQ_DA=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_INITRD is not set # CONFIG_LBD is not set # # ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set # # SCSI device support # CONFIG_SCSI=y # CONFIG_SCSI_PROC_FS is not set # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_REPORT_LUNS=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=m CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 CONFIG_AIC7XXX_PROBE_EISA_VL=y # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set # CONFIG_SCSI_NCR53C406A is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_SIM710 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # Old CD-ROM drivers (not SCSI, not IDE) # # CONFIG_CD_NO_IDESCSI is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support (EXPERIMENTAL) # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set CONFIG_INET_ECN=y CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_IPV6 is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_NETFILTER is not set # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETDEVICES=y # # ARCnet devices # # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y # CONFIG_MII is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_B44 is not set # CONFIG_CS89x0 is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set # CONFIG_E100 is not set # CONFIG_LNE390 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_NE3210 is not set # CONFIG_ES3210 is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set CONFIG_TLAN=m # CONFIG_VIA_RHINE is not set # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set # CONFIG_E1000 is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SIS190 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # # Wan interfaces # # CONFIG_WAN is not set # # Amateur Radio support # # CONFIG_HAMRADIO is not set # # IrDA (infrared) support # # CONFIG_IRDA is not set # # Bluetooth support # # CONFIG_BT is not set # # ISDN subsystem # # CONFIG_ISDN_BOOL is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=800 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=600 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_PS2_SYNAPTICS is not set # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_INPORT is not set # CONFIG_MOUSE_LOGIBM is not set # CONFIG_MOUSE_PC110PAD is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=y # CONFIG_INPUT_UINPUT is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=m CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=m CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set # # I2C support # # CONFIG_I2C is not set # # I2C Algorithms # # # I2C Hardware Bus support # # # I2C Hardware Sensors Chip support # # CONFIG_I2C_SENSOR is not set # # Mice # # CONFIG_BUSMOUSE is not set # CONFIG_QIC02_TAPE is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set CONFIG_SOFT_WATCHDOG=y # CONFIG_WDT is not set # CONFIG_WDTPCI is not set # CONFIG_PCWATCHDOG is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_EUROTECH_WDT is not set # CONFIG_IB700_WDT is not set # CONFIG_I810_TCO is not set # CONFIG_MIXCOMWD is not set # CONFIG_SCx200_WDT is not set # CONFIG_60XX_WDT is not set # CONFIG_W83877F_WDT is not set # CONFIG_MACHZ_WDT is not set # CONFIG_SC520_WDT is not set # CONFIG_AMD7XX_TCO is not set # CONFIG_ALIM7101_WDT is not set # CONFIG_ALIM1535_WDT is not set # CONFIG_SC1200_WDT is not set # CONFIG_WAFER_WDT is not set # CONFIG_CPU5_WDT is not set # CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set CONFIG_HANGCHECK_TIMER=y # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # # CONFIG_FB is not set # CONFIG_VIDEO_SELECT is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # # Sound # # CONFIG_SOUND is not set # # USB support # # CONFIG_USB is not set # CONFIG_USB_GADGET is not set # # File systems # CONFIG_EXT2_FS=m CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_EXT2_FS_SECURITY is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y CONFIG_JFS_FS=m # CONFIG_JFS_POSIX_ACL is not set # CONFIG_JFS_DEBUG is not set CONFIG_JFS_STATISTICS=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set # CONFIG_XFS_QUOTA is not set CONFIG_XFS_POSIX_ACL=y CONFIG_MINIX_FS=m # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=m CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_UDF_FS=m # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS=y CONFIG_DEVPTS_FS_XATTR=y # CONFIG_DEVPTS_FS_SECURITY is not set CONFIG_TMPFS=y # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # CONFIG_NFS_FS=m CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=m CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_NFSD_TCP=y CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=m # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y CONFIG_SMB_NLS=y CONFIG_NLS=y # # Native Language Support # CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=m # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=m # # Profiling support # # CONFIG_PROFILING is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_IOVIRT is not set CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_FRAME_POINTER is not set CONFIG_X86_EXTRA_IRQS=y CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y # # Security options # # CONFIG_SECURITY is not set # # Cryptographic options # # CONFIG_CRYPTO is not set # # Library routines # CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=m CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y CONFIG_X86_TRAMPOLINE=y CONFIG_PC=y --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lspci-v.txt" 00:0b.0 PCI bridge: IBM IBM27-82351 (rev 07) (prog-if 00 [Normal decode]) Flags: bus master, medium devsel, latency 96 Bus: primary=00, secondary=01, subordinate=01, sec-latency=248 I/O behind bridge: 00006000-00006fff Memory behind bridge: c6e00000-c6efffff Prefetchable memory behind bridge: b8000000-bfffffff 00:0c.0 Network controller: Compaq Computer Corporation Netelligent 10/100 (rev 10) Flags: bus master, medium devsel, latency 64, IRQ 10 I/O ports at 5000 [size=16] Memory at c6dffff0 (32-bit, non-prefetchable) [size=16] Expansion ROM at [disabled] [size=64K] 00:0e.0 Network controller: Compaq Computer Corporation Netelligent 10/100 (rev 10) Flags: bus master, medium devsel, latency 64, IRQ 15 I/O ports at 5010 [size=16] Memory at c6dfffe0 (32-bit, non-prefetchable) [size=16] Expansion ROM at [disabled] [size=64K] 00:0f.0 Non-VGA unclassified device: Intel Corp. 82375EB (rev 15) Flags: bus master, medium devsel, latency 248 00:14.0 RAM memory: Intel Corp. 450KX/GX [Orion] - 82453KX/GX Memory controller (rev 05) Flags: fast devsel 00:19.0 Host bridge: Intel Corp. 450KX/GX [Orion] - 82454KX/GX PCI bridge (rev 06) Flags: bus master, medium devsel, latency 32 00:1a.0 Host bridge: Intel Corp. 450KX/GX [Orion] - 82454KX/GX PCI bridge (rev 06) Flags: bus master, medium devsel, latency 32 01:00.0 Unknown mass storage controller: Compaq Computer Corporation Smart-2/P RAID Controller (rev 03) Subsystem: Compaq Computer Corporation Smart-2/P Array Controller Flags: bus master, medium devsel, latency 0, IRQ 7 I/O ports at 6000 [size=256] Memory at c6efff00 (32-bit, non-prefetchable) [size=256] Memory at b8000000 (32-bit, prefetchable) [size=128M] Expansion ROM at [disabled] [size=16K] 02:0a.0 SCSI storage controller: LSI Logic / Symbios Logic 53c825 (rev 02) Flags: bus master, medium devsel, latency 255, IRQ 14 I/O ports at 7000 [size=256] Memory at c6ffff00 (32-bit, non-prefetchable) [size=256] 02:0e.0 Network controller: Compaq Computer Corporation Netelligent 10/100 (rev 10) Flags: bus master, medium devsel, latency 64, IRQ 11 I/O ports at 7400 [size=16] Memory at c6fffef0 (32-bit, non-prefetchable) [size=16] Expansion ROM at [disabled] [size=64K] 02:0f.0 Non-VGA unclassified device: Intel Corp. 82375EB (rev 15) Flags: medium devsel --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.txt" Content-Transfer-Encoding: quoted-printable Linux version 2.6.0-test8 (root@ctesiphon) (gcc version 3.3.2 (Debian)) #10= SMP Tue Nov 11 15:53:52 EST 2003 Video mode to be used for restore is ffff BIOS-provided physical RAM map: BIOS-88: 0000000000000000 - 000000000009f000 (usable) BIOS-88: 0000000000100000 - 0000000001000000 (usable) user-defined physical RAM map: user: 0000000000000000 - 00000000000a0000 (usable) user: 0000000000100000 - 0000000028000000 (usable) 640MB LOWMEM available. found SMP MP-table at 000f4ff0 hm, page 000f4000 reserved twice. hm, page 000f5000 reserved twice. hm, page 000fb000 reserved twice. hm, page 000fc000 reserved twice. On node 0 totalpages: 163840 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 159744 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 DMI not present. ACPI: Unable to locate RSDP Intel MultiProcessor Specification v1.4 Virtual Wire compatibility mode. OEM ID: COMPAQ Product ID: PROLIANT APIC at: 0xFEE00000 Processor #3 6:1 APIC version 16 Processor #0 6:1 APIC version 16 Processor #1 6:1 APIC version 16 Processor #2 6:1 APIC version 16 I/O APIC #8 Version 17 at 0xFEC00000. Enabling APIC mode: Flat. Using 1 I/O APICs Processors: 4 Building zonelist for node : 0 Kernel command line: root=3D/dev/sda3 ro rootflags=3Ddata=3Dwriteback,acl,u= ser_xattr memmap=3Dexactmap memmap=3D640K@0 memmap=3D639M@1M psmouse_imps2 Initializing CPU#0 PID hash table entries: 4096 (order 12: 32768 bytes) Detected 200.167 MHz processor. Console: colour VGA+ 80x25 Debug: sleeping function called from invalid context at include/asm/semapho= re.h:119 in_atomic():1, irqs_disabled():1 Call Trace: [] __might_sleep+0xa0/0xd0 [] acquire_console_sem+0x39/0x60 [] register_console+0x85/0x1d0 [] con_init+0x202/0x240 [] _stext+0x0/0x70 [] console_init+0x33/0x40 [] start_kernel+0xdf/0x190 [] unknown_bootoption+0x0/0x120 Memory: 645316k/655360k available (1434k kernel code, 9252k reserved, 438k = data, 396k init, 0k highmem) Debug: sleeping function called from invalid context at mm/slab.c:1857 in_atomic():1, irqs_disabled():0 Call Trace: [] __might_sleep+0xa0/0xd0 [] kmem_cache_alloc+0x78/0x80 [] _stext+0x0/0x70 [] kmem_cache_create+0x7b/0x560 [] mem_init+0x17a/0x200 [] _stext+0x0/0x70 [] kmem_cache_init+0x129/0x310 [] start_kernel+0xef/0x190 [] unknown_bootoption+0x0/0x120 Calibrating delay loop... 391.16 BogoMIPS Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: 0000fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0000fbff 00000000 00000000 00000000 CPU: L1 I cache: 8K, L1 D cache: 8K CPU: L2 cache: 256K CPU: After all inits, caps: 0000f3ff 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX CPU0: Intel Pentium Pro stepping 09 per-CPU timeslice cutoff: 730.25 usecs. task migration cache decay timeout: 1 msecs. enabled ExtINT on CPU#0 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 Booting processor 1/0 eip 2000 Initializing CPU#1 masked ExtINT on CPU#1 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 Calibrating delay loop... 399.36 BogoMIPS CPU: After generic identify, caps: 0000fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0000fbff 00000000 00000000 00000000 CPU: L1 I cache: 8K, L1 D cache: 8K CPU: L2 cache: 512K CPU: After all inits, caps: 0000f3ff 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#1. CPU1: Intel Pentium Pro stepping 09 Booting processor 2/1 eip 2000 Initializing CPU#2 masked ExtINT on CPU#2 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 Calibrating delay loop... 399.36 BogoMIPS CPU: After generic identify, caps: 0000fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0000fbff 00000000 00000000 00000000 CPU: L1 I cache: 8K, L1 D cache: 8K CPU: L2 cache: 512K CPU: After all inits, caps: 0000f3ff 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#2. CPU2: Intel Pentium Pro stepping 09 Booting processor 3/2 eip 2000 Initializing CPU#3 masked ExtINT on CPU#3 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 Calibrating delay loop... 398.33 BogoMIPS CPU: After generic identify, caps: 0000fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0000fbff 00000000 00000000 00000000 CPU: L1 I cache: 8K, L1 D cache: 8K CPU: L2 cache: 256K CPU: After all inits, caps: 0000f3ff 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#3. CPU3: Intel Pentium Pro stepping 09 Total of 4 processors activated (1588.22 BogoMIPS). ENABLING IO-APIC IRQs Setting 8 in the phys_id_present_map =2E..changing IO-APIC physical APIC ID to 8 ... ok. init IO_APIC IRQs IO-APIC (apicid-pin) 8-0 not connected. =2E.TIMER: vector=3D0x31 pin1=3D2 pin2=3D0 number of MP IRQ sources: 16. number of IO-APIC #8 registers: 16. testing the IO APIC....................... IO APIC #8...... =2E... register #00: 08000000 =2E...... : physical APIC id: 08 =2E...... : Delivery Type: 0 =2E...... : LTS : 0 =2E... register #01: 000F0011 =2E...... : max redirection entries: 000F =2E...... : PRQ implemented: 0 =2E...... : IO APIC version: 0011 =2E... register #02: 00000000 =2E...... : arbitration: 00 =2E... IRQ redirection table: NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect: =20 00 000 00 1 0 0 0 0 0 0 00 01 001 01 0 0 0 0 0 1 1 39 02 001 01 0 0 0 0 0 1 1 31 03 001 01 0 0 0 0 0 1 1 41 04 001 01 0 0 0 0 0 1 1 49 05 001 01 0 0 0 0 0 1 1 51 06 001 01 0 0 0 0 0 1 1 59 07 001 01 1 1 0 0 0 1 1 61 08 001 01 0 0 0 0 0 1 1 69 09 001 01 0 0 0 0 0 1 1 71 0a 001 01 1 1 0 0 0 1 1 79 0b 001 01 1 1 0 0 0 1 1 81 0c 001 01 0 0 0 0 0 1 1 89 0d 001 01 0 0 0 0 0 1 1 91 0e 001 01 1 1 0 0 0 1 1 99 0f 001 01 1 1 0 0 0 1 1 A1 IRQ to pin mappings: IRQ0 -> 0:2 IRQ1 -> 0:1 IRQ3 -> 0:3 IRQ4 -> 0:4 IRQ5 -> 0:5 IRQ6 -> 0:6 IRQ7 -> 0:7 IRQ8 -> 0:8 IRQ9 -> 0:9 IRQ10 -> 0:10 IRQ11 -> 0:11 IRQ12 -> 0:12 IRQ13 -> 0:13 IRQ14 -> 0:14 IRQ15 -> 0:15 =2E................................... done. Using local APIC timer interrupts. calibrating APIC timer ... =2E.... CPU clock speed is 199.0958 MHz. =2E.... host bus clock speed is 66.0652 MHz. checking TSC synchronization across 4 CPUs: passed. Starting migration thread for cpu 0 Bringing up 1 CPU 1 IS NOW UP! Starting migration thread for cpu 1 Bringing up 2 CPU 2 IS NOW UP! Starting migration thread for cpu 2 Bringing up 3 CPU 3 IS NOW UP! Starting migration thread for cpu 3 CPUS done 8 NET: Registered protocol family 16 EISA bus registered PCI: PCI BIOS revision 2.10 entry at 0xf0066, last bus=3D2 PCI: Using configuration type 1 mtrr: v2.0 (20020519) Linux Plug and Play Support v0.97 (c) Adam Belay SCSI subsystem initialized PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: i440KX/GX host bridge 0000:00:19.0: secondary bus 00 PCI: i440KX/GX host bridge 0000:00:1a.0: secondary bus 02 PCI BIOS passed nonexistent PCI bus 1! PCI: Device 02:78 not found by BIOS PCI: Device 00:78 not found by BIOS PCI: Device 00:a0 not found by BIOS PCI: Device 00:c8 not found by BIOS PCI: Device 00:d0 not found by BIOS Starting balanced_irq ikconfig 0.7 with /proc/config* isapnp: Scanning for PnP cards... isapnp: No Plug & Play device found pty: 256 Unix98 ptys configured Real Time Clock Driver v1.12 Software Watchdog Timer: 0.06, soft_margin: 60 sec, nowayout: 0 Hangcheck: starting hangcheck timer 0.5.0 (tick is 180 seconds, margin is 6= 0 seconds). cpqarray: Device 0xe11 has been found at bus 1 dev 0 func 0 Compaq SMART2 Driver (v 2.4.5) Found 1 controller(s) cpqarray: Finding drives on ida0Using anticipatory io scheduler (SMART-2/P) cpqarray ida/c0d0: blksz=3D512 nr_blks=3D53303670 ida/c0d0: p1 p2 p3 p4 sym0: <825> rev 0x2 at pci 0000:02:0a.0 irq 14 sym0: No NVRAM, ID 7, Fast-10, SE, parity checking sym0: SCSI BUS has been reset. scsi0 : sym-2.1.18b sym0:0: FAST-10 SCSI 10.0 MB/s ST (100.0 ns, offset 8) Vendor: HP Model: 1.050 GB #A1 Rev: 9004 Type: Direct-Access ANSI SCSI revision: 02 sym0:0:0: tagged command queuing enabled, command queue depth 16. Vendor: COMPAQ Model: CRD-254V Rev: 1.06 Type: CD-ROM ANSI SCSI revision: 02 SCSI device sda: 2051460 512-byte hdwr sectors (1050 MB) SCSI device sda: drive cache: write through sda: sda1 sda2 sda3 Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 mice: PS/2 mouse device common for all mice input: PC Speaker input: PS2++ Logitech Wheel Mouse on isa0060/serio1 serio: i8042 AUX port at 0x60,0x64 irq 12 input: AT Translated Set 2 keyboard on isa0060/serio0 serio: i8042 KBD port at 0x60,0x64 irq 1 EISA: Probing bus 0 at 0000:02:0f.0 EISA: Mainboard CPQ1561 detected. Cannot allocate resource for EISA slot 5 Cannot allocate resource for EISA slot 6 Cannot allocate resource for EISA slot 7 EISA: Detected 0 cards. pci_eisa : Could not register EISA root pci_eisa: probe of 0000:00:0f.0 failed with error -1 NET: Registered protocol family 2 IP: routing cache hash table of 8192 buckets, 64Kbytes TCP: Hash tables configured (established 262144 bind 65536) NET: Registered protocol family 1 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with writeback data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 396k freed EXT3 FS on sda3, internal journal kjournald starting. Commit interval 5 seconds EXT3 FS on sda2, internal journal EXT3-fs: mounted filesystem with ordered data mode. IA-32 Microcode Update Driver: v1.13 microcode: No suitable data for cpu 0 microcode: No suitable data for cpu 1 microcode: No suitable data for cpu 2 microcode: No suitable data for cpu 3 ThunderLAN driver v1.15 TLAN: eth0 irq=3D11, io=3D7400, Compaq Netelligent 10/100 TX PCI UTP, Rev. = 16 TLAN: eth1 irq=3D10, io=3D5000, Compaq Netelligent 10/100 TX PCI UTP, Rev. = 16 TLAN: eth2 irq=3D15, io=3D5010, Compaq Netelligent 10/100 TX PCI UTP, Rev. = 16 TLAN: 3 devices installed, PCI: 3 EISA: 0 Unable to handle kernel paging request at virtual address e8804830 printing eip: e8833594 *pde =3D 27de6067 *pte =3D 00000000 Oops: 0000 [#1] CPU: 2 EIP: 0060:[] Not tainted EFLAGS: 00010292 EIP is at TLan_PhyDetect+0x14/0x190 [tlan] eax: e880482c ebx: 00000600 ecx: 0000740c edx: 0000740c esi: 00007400 edi: e7d8f200 ebp: e7d8f000 esp: e735de4c ds: 007b es: 007b ss: 0068 Process ifconfig (pid: 123, threadinfo=3De735c000 task=3De735f960) Stack: 00000000 00019717 e72d007b 272d007b ffffffef c01158f6 00000060 00000= 600=20 00007400 00007408 00007400 e8832ddf e7d8f000 e7d8f200 e7d8f000 00000= 000=20 e7d8f000 e7d8f200 00000000 e8830352 e7d8f000 00000000 04000000 e8838= ce0=20 Call Trace: [] delay_tsc+0x16/0x20 [] TLan_ResetAdapter+0xff/0x220 [tlan] [] TLan_Open+0xb2/0xe0 [tlan] [] dev_open+0xd6/0x110 [] dev_mc_upload+0x35/0x60 [] dev_change_flags+0x53/0x130 [] devinet_ioctl+0x2c7/0x640 [] inet_ioctl+0xe3/0x130 [] sock_ioctl+0x136/0x330 [] sys_ioctl+0x118/0x2d0 [] syscall_call+0x7/0xb Code: f6 40 04 01 74 13 ba ff ff 00 00 89 97 f8 00 00 00 83 c4 1c=20 =20 --YZ5djTAD1cGYuMQK-- --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/sWLNWv4KsgKfSVgRAjneAJ0e1r7UDdxbDf/oVWjk8jY7RDuMOwCfbN2j sHT/Z3TXOWfuR+acACqnJpc= =wBQY -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj-- From yoshfuji@linux-ipv6.org Tue Nov 11 14:31:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:31:26 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMVB25024058 for ; Tue, 11 Nov 2003 14:31:12 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hABMVSlg024910; Wed, 12 Nov 2003 07:31:28 +0900 Date: Tue, 11 Nov 2003 16:31:28 -0600 (CST) Message-Id: <20031111.163128.48152698.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031110230233.254061da.davem@redhat.com> References: <20031110.104536.79654717.yoshfuji@linux-ipv6.org> <20031110230233.254061da.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20031110230233.254061da.davem@redhat.com> (at Mon, 10 Nov 2003 23:02:33 -0800), "David S. Miller" says: > Cannot you implement it simply like this: > > int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, > void __user *, size_t *) > { > return do_proc_dointvec(table,write,filp,buffer,lenp,HZ/USER_HZ,OP_SET); > } I did not do this since this looses some precisions. > Another idea is to change do_proc_dointvec() to take a conversion function > pointer instead of this "conv" thing. Maybe even proc_dointvec_minmax() > could be implemented in terms of do_proc_dointvec() with such a scheme. This is essentially identical to what I thought. Okay, how about this? ===== include/linux/sysctl.h 1.53 vs edited ===== --- 1.53/include/linux/sysctl.h Thu Oct 30 05:19:30 2003 +++ edited/include/linux/sysctl.h Wed Nov 12 07:07:34 2003 @@ -726,6 +726,8 @@ void __user *, size_t *); extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, void __user *, size_t *); +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, + void __user *, size_t *); extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, ===== kernel/sysctl.c 1.55 vs edited ===== --- 1.55/kernel/sysctl.c Thu Oct 2 16:12:07 2003 +++ edited/kernel/sysctl.c Wed Nov 12 07:07:34 2003 @@ -37,6 +37,7 @@ #include #include #include +#include #include #ifdef CONFIG_ROOT_NFS @@ -1050,8 +1051,8 @@ * cover common cases - * * proc_dostring(), proc_dointvec(), proc_dointvec_jiffies(), - * proc_dointvec_minmax(), proc_doulongvec_ms_jiffies_minmax(), - * proc_doulongvec_minmax() + * proc_dointvec_userhz_jiffies(), proc_dointvec_minmax(), + * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax() * * It is the handler's job to read the input buffer from user memory * and process it. The handler should return 0 on success. @@ -1322,19 +1323,36 @@ return r; } -#define OP_SET 0 -#define OP_AND 1 -#define OP_OR 2 -#define OP_MAX 3 -#define OP_MIN 4 +static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp, + int *valp, + int write, void *data) +{ + if (write) { + *valp = *negp ? -*lvalp : *lvalp; + } else { + int val = *valp; + if (val < 0) { + *negp = -1; + *lvalp = (unsigned long)-val; + } else { + *negp = 0; + *lvalp = (unsigned long)val; + } + } + return 0; +} static int do_proc_dointvec(ctl_table *table, int write, struct file *filp, - void __user *buffer, size_t *lenp, int conv, int op) + void __user *buffer, size_t *lenp, + int (*conv)(int *negp, unsigned long *lvalp, int *valp, + int write, void *data), + void *data) { +#define TMPBUFLEN 20 int *i, vleft, first=1, neg, val; + unsigned long lval; size_t left, len; - #define TMPBUFLEN 20 char buf[TMPBUFLEN], *p; if (!table->data || !table->maxlen || !*lenp || @@ -1344,9 +1362,12 @@ } i = (int *) table->data; - vleft = table->maxlen / sizeof(int); + vleft = table->maxlen / sizeof(*i); left = *lenp; - + + if (!conv) + conv = do_proc_dointvec_conv; + for (; left && vleft--; i++, first=0) { if (write) { while (left) { @@ -1362,8 +1383,8 @@ break; neg = 0; len = left; - if (len > TMPBUFLEN-1) - len = TMPBUFLEN-1; + if (len > sizeof(buf) - 1) + len = sizeof(buf) - 1; if(copy_from_user(buf, buffer, len)) return -EFAULT; buf[len] = 0; @@ -1374,7 +1395,9 @@ } if (*p < '0' || *p > '9') break; - val = simple_strtoul(p, &p, 0) * conv; + + lval = simple_strtoul(p, &p, 0); + len = p-buf; if ((len < left) && *p && !isspace(*p)) break; @@ -1382,22 +1405,18 @@ val = -val; buffer += len; left -= len; - switch(op) { - case OP_SET: *i = val; break; - case OP_AND: *i &= val; break; - case OP_OR: *i |= val; break; - case OP_MAX: if(*i < val) - *i = val; - break; - case OP_MIN: if(*i > val) - *i = val; - break; - } + + if (conv(&neg, &lval, i, 1, data)) + break; } else { p = buf; if (!first) *p++ = '\t'; - sprintf(p, "%d", (*i) / conv); + + if (conv(&neg, &lval, i, 1, data)) + break; + + sprintf(p, "%s%lu", neg ? "-" : "", lval); len = strlen(buf); if (len > left) len = left; @@ -1429,6 +1448,7 @@ *lenp -= left; filp->f_pos += *lenp; return 0; +#undef TMPBUFLEN } /** @@ -1447,7 +1467,45 @@ int proc_dointvec(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { - return do_proc_dointvec(table,write,filp,buffer,lenp,1,OP_SET); + return do_proc_dointvec(table,write,filp,buffer,lenp, + NULL,NULL); +} + +#define OP_SET 0 +#define OP_AND 1 +#define OP_OR 2 +#define OP_MAX 3 +#define OP_MIN 4 + +static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp, + int *valp, + int write, void *data) +{ + int op = *(int *)data; + if (write) { + int val = *negp ? -*lvalp : *lvalp; + switch(op) { + case OP_SET: *valp = val; break; + case OP_AND: *valp &= val; break; + case OP_OR: *valp |= val; break; + case OP_MAX: if(*valp < val) + *valp = val; + break; + case OP_MIN: if(*valp > val) + *valp = val; + break; + } + } else { + int val = *valp; + if (val < 0) { + *negp = -1; + *lvalp = (unsigned long)-val; + } else { + *negp = 0; + *lvalp = (unsigned long)val; + } + } + return 0; } /* @@ -1457,11 +1515,44 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { + int op; + if (!capable(CAP_SYS_MODULE)) { return -EPERM; } - return do_proc_dointvec(table,write,filp,buffer,lenp,1, - (current->pid == 1) ? OP_SET : OP_AND); + + op = (current->pid == 1) ? OP_SET : OP_AND; + return do_proc_dointvec(table,write,filp,buffer,lenp, + do_proc_dointvec_bset_conv,&op); +} + +struct do_proc_dointvec_minmax_conv_param { + int *min; + int *max; +}; + +static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, + int *valp, + int write, void *data) +{ + struct do_proc_dointvec_minmax_conv_param *param = data; + if (write) { + int val = *negp ? -*lvalp : *lvalp; + if ((param->min && *param->min > val) || + (param->max && *param->max < val)) + return -EINVAL; + *valp = val; + } else { + int val = *valp; + if (val < 0) { + *negp = -1; + *lvalp = (unsigned long)-val; + } else { + *negp = 0; + *lvalp = (unsigned long)val; + } + } + return 0; } /** @@ -1483,98 +1574,12 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { - int *i, *min, *max, vleft, first=1, neg, val; - size_t len, left; - #define TMPBUFLEN 20 - char buf[TMPBUFLEN], *p; - - if (!table->data || !table->maxlen || !*lenp || - (filp->f_pos && !write)) { - *lenp = 0; - return 0; - } - - i = (int *) table->data; - min = (int *) table->extra1; - max = (int *) table->extra2; - vleft = table->maxlen / sizeof(int); - left = *lenp; - - for (; left && vleft--; i++, min++, max++, first=0) { - if (write) { - while (left) { - char c; - if(get_user(c, (char *) buffer)) - return -EFAULT; - if (!isspace(c)) - break; - left--; - buffer++; - } - if (!left) - break; - neg = 0; - len = left; - if (len > TMPBUFLEN-1) - len = TMPBUFLEN-1; - if(copy_from_user(buf, buffer, len)) - return -EFAULT; - buf[len] = 0; - p = buf; - if (*p == '-' && left > 1) { - neg = 1; - left--, p++; - } - if (*p < '0' || *p > '9') - break; - val = simple_strtoul(p, &p, 0); - len = p-buf; - if ((len < left) && *p && !isspace(*p)) - break; - if (neg) - val = -val; - buffer += len; - left -= len; - - if ((min && val < *min) || (max && val > *max)) - continue; - *i = val; - } else { - p = buf; - if (!first) - *p++ = '\t'; - sprintf(p, "%d", *i); - len = strlen(buf); - if (len > left) - len = left; - if(copy_to_user(buffer, buf, len)) - return -EFAULT; - left -= len; - buffer += len; - } - } - - if (!write && !first && left) { - if(put_user('\n', (char *) buffer)) - return -EFAULT; - left--, buffer++; - } - if (write) { - p = (char *) buffer; - while (left) { - char c; - if(get_user(c, p++)) - return -EFAULT; - if (!isspace(c)) - break; - left--; - } - } - if (write && first) - return -EINVAL; - *lenp -= left; - filp->f_pos += *lenp; - return 0; + struct do_proc_dointvec_minmax_conv_param param = { + .min = (int *) table->extra1, + .max = (int *) table->extra2, + }; + return do_proc_dointvec(table, write, filp, buffer, lenp, + do_proc_dointvec_minmax_conv, ¶m); } static int do_proc_doulongvec_minmax(ctl_table *table, int write, @@ -1729,6 +1734,48 @@ } +static int do_proc_dointvec_jiffies_conv(int *negp, unsigned long *lvalp, + int *valp, + int write, void *data) +{ + if (write) { + *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ); + } else { + int val = *valp; + unsigned long lval; + if (val < 0) { + *negp = -1; + lval = (unsigned long)-val; + } else { + *negp = 0; + lval = (unsigned long)val; + } + *lvalp = lval / HZ; + } + return 0; +} + +static int do_proc_dointvec_userhz_jiffies_conv(int *negp, unsigned long *lvalp, + int *valp, + int write, void *data) +{ + if (write) { + *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); + } else { + int val = *valp; + unsigned long lval; + if (val < 0) { + *negp = -1; + lval = (unsigned long)-val; + } else { + *negp = 0; + lval = (unsigned long)val; + } + *lvalp = jiffies_to_clock_t(lval); + } + return 0; +} + /** * proc_dointvec_jiffies - read a vector of integers as seconds * @table: the sysctl table @@ -1747,7 +1794,30 @@ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { - return do_proc_dointvec(table,write,filp,buffer,lenp,HZ,OP_SET); + return do_proc_dointvec(table,write,filp,buffer,lenp, + do_proc_dointvec_jiffies_conv,NULL); +} + +/** + * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds + * @table: the sysctl table + * @write: %TRUE if this is a write to the sysctl file + * @filp: the file structure + * @buffer: the user buffer + * @lenp: the size of the user buffer + * + * Reads/writes up to table->maxlen/sizeof(unsigned int) integer + * values from/to the user buffer, treated as an ASCII string. + * The values read are assumed to be in 1/USER_HZ seconds, and + * are converted into jiffies. + * + * Returns 0 on success. + */ +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void __user *buffer, size_t *lenp) +{ + return do_proc_dointvec(table,write,filp,buffer,lenp, + do_proc_dointvec_userhz_jiffies_conv,NULL); } #else /* CONFIG_PROC_FS */ @@ -1788,6 +1858,12 @@ return -ENOSYS; } +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) +{ + return -ENOSYS; +} + int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) { @@ -1975,6 +2051,12 @@ return -ENOSYS; } +int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) +{ + return -ENOSYS; +} + int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp) { @@ -2007,6 +2089,7 @@ EXPORT_SYMBOL(proc_dointvec); EXPORT_SYMBOL(proc_dointvec_jiffies); EXPORT_SYMBOL(proc_dointvec_minmax); +EXPORT_SYMBOL(proc_dointvec_userhz_jiffies); EXPORT_SYMBOL(proc_dostring); EXPORT_SYMBOL(proc_doulongvec_minmax); EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); ===== net/core/neighbour.c 1.20 vs edited ===== --- 1.20/net/core/neighbour.c Tue Oct 21 14:59:11 2003 +++ edited/net/core/neighbour.c Wed Nov 12 07:12:25 2003 @@ -24,6 +24,7 @@ #ifdef CONFIG_SYSCTL #include #endif +#include #include #include #include @@ -1510,7 +1511,7 @@ .procname = "retrans_time", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_REACHABLE_TIME, @@ -1552,21 +1553,21 @@ .procname = "anycast_delay", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_PROXY_DELAY, .procname = "proxy_delay", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_LOCKTIME, .procname = "locktime", .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_dointvec, + .proc_handler = &proc_dointvec_userhz_jiffies, }, { .ctl_name = NET_NEIGH_GC_INTERVAL, -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From wsx@6com.sk Tue Nov 11 14:37:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:37:22 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMav25025133 for ; Tue, 11 Nov 2003 14:36:58 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 647314C00083; Tue, 11 Nov 2003 17:26:11 -0500 (EST) Date: Tue, 11 Nov 2003 23:26:11 +0100 From: Jan Oravec To: "David S. Miller" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031111222611.GA1239@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031110214603.0057e365.davem@redhat.com> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1330 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev > > We do traceroute6 to 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 (IP of that > > sparc64). We get the following corrupted answer: > > > > 13:17:47.191547 3ffe:80ee:3bd:0:a00:20ff:fec7:a192 > 3ffe:80ee:a:0:201:3ff:fed5:bd1e: [|icmp6] (len 72, hlim 62) > > 0x0000 6000 0000 0048 3a3e 3ffe 80ee 03bd 0000 ....H:>?....... > > 0x0010 0a00 20ff fec7 a192 3ffe 80ee 000a 0000 ........?....... > > 0x0020 0201 03ff fed5 bd1e 0104 aa7c 0000 0000 ...........|.... > > 0x0030 0000 0064 0000 0000 0100 0000 0100 0000 ...d............ > > 0x0040 aaaa aaaa aaaa aaaa 9680 c00b c622 7fec .............".. > > 0x0050 aaaa aaaa aaaa aaaa 9680 c00b c622 7ffc .............".. > > 0x0060 aaaa aaaa 0000 0000 8a10 2000 04c2 8049 ...............I > > What specifically about this packet makes you think it is corrupted? The ICMP reply should contain the original packet. > What compiler are you using to build 2.6.x kernels btw? We could > be looking at a miscompile here. 3.3.2 > The bus error you reported from running traceroute6 on the sparc64 > system is not that useful, can you use gdb or some other tool to > figure out where inside of tcpdump6 the bus error is occuring? Is is > happening in the tcpdump6 program itself? It is due to a failed system > call? I am running 64-bit-only userspace and there is no gdb/strace for sparc64 yet :(. But I think I have found the problem: icmpv6_send() can get skb where skb->nh.raw < skb->data, thus computed plen (see icmp.c:382) is negative. When passed as unsigned int to __skb_pull, it underflows and is interpreted as 0x100000000-something_small. In __skb_pull we then increase skb->data by that number; because skb->data is 64-bit while plen is 32-bit, we get pointer which is 0x100000000 higher than needed. On 32-bit platform that does not cause any troubles because it overflows again. I do not know whether icmpv6_send() was meant to receive skb with ->data pulled no more than nh.raw; in that case I suggest the following patch (against test9-bk16): --- linux/net/ipv6/udp.c.orig 2003-11-11 23:04:08.393138608 +0100 +++ linux/net/ipv6/udp.c 2003-11-11 23:07:20.964089789 +0100 @@ -677,6 +677,7 @@ goto discard; UDP6_INC_STATS_BH(UdpNoPorts); + __skb_push(skb, skb->data - skb->nh.raw); icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev); kfree_skb(skb); I looked at the other icmpv6_send() calls; they seem to be OK (not 100% sure). Instead, if we want make icmpv6_send to work with any ->data, we could use this patch: --- linux/net/ipv6/icmp.c.orig 2003-10-25 20:43:17.000000000 +0200 +++ linux/net/ipv6/icmp.c 2003-11-11 23:23:09.661409756 +0100 @@ -380,7 +380,11 @@ } plen = skb->nh.raw - skb->data; - __skb_pull(skb, plen); + if (plen < 0) + __skb_push(skb, -plen); + else + __skb_pull(skb, plen); + len = skb->len; len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); if (len < 0) { @@ -399,7 +403,10 @@ goto out_put; } err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr)); - __skb_push(skb, plen); + if (plen < 0) + __skb_pull(skb, -plen); + else + __skb_push(skb, plen); if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB) ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH); Jan From shemminger@osdl.org Tue Nov 11 14:42:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:42:57 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMgi25025531 for ; Tue, 11 Nov 2003 14:42:45 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMgZC21928; Tue, 11 Nov 2003 14:42:35 -0800 Date: Tue, 11 Nov 2003 14:42:58 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] typo in net-drivers-2.5-exp 3c507 Message-Id: <20031111144258.3a02e3c8.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Fix auto-probing loop in new probing code for 3c507. This patch is against net-drivers-2.5-exp repository. Found by viro. diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c Tue Nov 11 09:36:13 2003 +++ b/drivers/net/3c507.c Tue Nov 11 09:36:13 2003 @@ -332,11 +332,11 @@ else if (io != 0) err = -ENXIO; /* Don't probe at all. */ else { - for (port = ports; *port; port++) { - err = el16_probe1(dev, io); - if (!err) - break; - } + for (port = ports; *port; port++) { + err = el16_probe1(dev, *port); + if (!err) + break; + } } if (err) From shemminger@osdl.org Tue Nov 11 14:44:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:44:26 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMi525025827 for ; Tue, 11 Nov 2003 14:44:05 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMhWC22054; Tue, 11 Nov 2003 14:43:32 -0800 Date: Tue, 11 Nov 2003 14:43:54 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] 3c59x netpoll typo Message-Id: <20031111144354.2542488e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1332 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Poll code (in net-drivers-2.5-exp) was calling undefined function. diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c --- a/drivers/net/3c59x.c Tue Nov 11 09:59:30 2003 +++ b/drivers/net/3c59x.c Tue Nov 11 09:59:30 2003 @@ -928,7 +928,7 @@ local_save_flags(flags); local_irq_disable(); (vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev,NULL); - local_restore_flags(flags); + local_irq_restore(flags); } #endif From shemminger@osdl.org Tue Nov 11 14:45:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:45:48 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMjZ25026253 for ; Tue, 11 Nov 2003 14:45:35 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMiwC22709; Tue, 11 Nov 2003 14:44:58 -0800 Date: Tue, 11 Nov 2003 14:45:21 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] depca - error patch memory leaks Message-Id: <20031111144521.58a1f495.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hABMjZ25026253 X-archive-position: 1333 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Fix leaks on error unwinds. Found by viro. diff -Nru a/drivers/net/depca.c b/drivers/net/depca.c --- a/drivers/net/depca.c Tue Nov 11 09:36:20 2003 +++ b/drivers/net/depca.c Tue Nov 11 09:36:20 2003 @@ -681,8 +681,7 @@ lp->sh_mem = ioremap(mem_start, mem_len); if (lp->sh_mem == NULL) { printk(KERN_ERR "depca: cannot remap ISA memory, aborting\n"); - release_mem_region (mem_start, mem_len); - goto out_priv; + goto out1; } lp->mem_start = mem_start; @@ -771,7 +770,7 @@ status = -ENXIO; if (!irqnum) { printk(" and failed to detect IRQ line.\n"); - goto out_priv; + goto out2; } else { for (dev->irq = 0, i = 0; (depca_irq[i]) && (!dev->irq); i++) if (irqnum == depca_irq[i]) { @@ -781,7 +780,7 @@ if (!dev->irq) { printk(" but incorrect IRQ line detected.\n"); - return -ENXIO; + goto out2; } } } else { @@ -807,11 +806,14 @@ device->driver_data = dev; SET_NETDEV_DEV (dev, device); - register_netdev (dev); - return 0; - - out_priv: - + status = register_netdev(dev); + if (status == 0) + return 0; +out2: + iounmap(lp->sh_mem); +out1: + release_mem_region (mem_start, mem_len); +out_priv: return status; } From shemminger@osdl.org Tue Nov 11 14:46:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:46:22 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMk925026393 for ; Tue, 11 Nov 2003 14:46:09 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMjZC22897; Tue, 11 Nov 2003 14:45:35 -0800 Date: Tue, 11 Nov 2003 14:45:57 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] ethertap can use alloc_etherdev Message-Id: <20031111144557.38bde052.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1334 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Can use alloc_etherdev, don't need to call ether_setup. Found by viro. diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c --- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 +++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 @@ -72,8 +72,7 @@ struct net_device *dev; int err = -ENOMEM; - dev = alloc_netdev(sizeof(struct net_local), "tap%d", - ether_setup); + dev = alloc_etherdev(sizeof(struct net_local)); if (!dev) goto out; From shemminger@osdl.org Tue Nov 11 14:48:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 14:48:49 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABMma25026981 for ; Tue, 11 Nov 2003 14:48:36 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hABMkfC23105; Tue, 11 Nov 2003 14:46:41 -0800 Date: Tue, 11 Nov 2003 14:47:04 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] sk_g16 missing declaration Message-Id: <20031111144704.1d6910de.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1335 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev The new probe code in net-drivers-2.5-exp lost a declaration for the module case (thanks al). diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Tue Nov 11 09:36:10 2003 +++ b/drivers/net/sk_g16.c Tue Nov 11 09:36:10 2003 @@ -604,6 +604,9 @@ #ifdef MODULE + +static struct net_device *SK_dev; + static int __init SK_init_module (void) { SK_dev = SK_init(-1); From davem@pizda.ninka.net Tue Nov 11 15:17:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 15:18:00 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABNHj25027815 for ; Tue, 11 Nov 2003 15:17:47 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA31327; Tue, 11 Nov 2003 15:09:27 -0800 Date: Tue, 11 Nov 2003 15:09:27 -0800 From: "David S. Miller" To: johnip@sgi.com Cc: ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com, davidm@hpl.hp.com Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-Id: <20031111150927.3474ef46.davem@redhat.com> In-Reply-To: <3FB15725.4050705@sgi.com> References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1336 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 15:39:49 -0600 John Partridge wrote: > OK, I made it ALL IA64, but I only know for sure about Itanium2's This patch looks a lot better. Jeff, perhaps you'll combine this with the thing David Mosberger wanted and then merge? From davem@pizda.ninka.net Tue Nov 11 15:19:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 15:20:09 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABNJu25028170 for ; Tue, 11 Nov 2003 15:19:56 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA31376; Tue, 11 Nov 2003 15:13:40 -0800 Date: Tue, 11 Nov 2003 15:13:40 -0800 From: "David S. Miller" To: Jan Oravec Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-Id: <20031111151340.3d129bc7.davem@redhat.com> In-Reply-To: <20031111222611.GA1239@wsx.ksp.sk> References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> <20031111222611.GA1239@wsx.ksp.sk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 23:26:11 +0100 Jan Oravec wrote: > > The bus error you reported from running traceroute6 on the sparc64 > > system is not that useful, can you use gdb or some other tool to > > figure out where inside of tcpdump6 the bus error is occuring? Is is > > happening in the tcpdump6 program itself? It is due to a failed system > > call? > > I am running 64-bit-only userspace and there is no gdb/strace for sparc64 > yet :(. Yes there is a gdb, here is a prebuilt 64-bit gdb for you. It is even statically linked so there are no shared library dependencies. It can debug 32-bit processes as well: ftp://pizda.ninka.net/pub/for_jakub/gdb64 Enjoy. > But I think I have found the problem: > > icmpv6_send() can get skb where skb->nh.raw < skb->data, thus computed plen > (see icmp.c:382) is negative. When passed as unsigned int to __skb_pull, it > underflows and is interpreted as 0x100000000-something_small. In __skb_pull > we then increase skb->data by that number; because skb->data is 64-bit while > plen is 32-bit, we get pointer which is 0x100000000 higher than needed. On > 32-bit platform that does not cause any troubles because it overflows again. > > I do not know whether icmpv6_send() was meant to receive skb with ->data > pulled no more than nh.raw; in that case I suggest the following patch > (against test9-bk16): Great analysis, thanks a lot. I will look at your patch proposals. From akpm@osdl.org Tue Nov 11 15:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 15:26:30 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABNQH25028589 for ; Tue, 11 Nov 2003 15:26:17 -0800 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id hABNQ5C31673; Tue, 11 Nov 2003 15:26:05 -0800 Date: Tue, 11 Nov 2003 15:30:13 -0800 From: Andrew Morton To: jhf@rivenstone.net (Joseph Fannin) Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [OOPS] TLAN fails on ifconfig with CONFIG_HOTPLUG=n Message-Id: <20031111153013.3b9eba6e.akpm@osdl.org> In-Reply-To: <20031111222933.GA2868@rivenstone.net> References: <20031111222933.GA2868@rivenstone.net> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1338 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev jhf@rivenstone.net (Joseph Fannin) wrote: > > I'm getting an Oops when ifup'ing a Compaq Netelligent card that > uses the tlan driver running 2.6. Does this fix it? diff -puN drivers/net/tlan.c~tlan-oops-fix drivers/net/tlan.c --- 25/drivers/net/tlan.c~tlan-oops-fix 2003-11-11 15:29:32.000000000 -0800 +++ 25-akpm/drivers/net/tlan.c 2003-11-11 15:29:38.000000000 -0800 @@ -234,7 +234,7 @@ static struct board { const char *deviceLabel; u32 flags; u16 addrOfs; -} board_info[] __devinitdata = { +} board_info[] = { { "Compaq Netelligent 10 T PCI UTP", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, { "Compaq Netelligent 10/100 TX PCI UTP", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, { "Compaq Integrated NetFlex-3/P", TLAN_ADAPTER_NONE, 0x83 }, _ From ja@ssi.bg Tue Nov 11 15:46:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 15:47:11 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABNkl25029121 for ; Tue, 11 Nov 2003 15:46:51 -0800 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id hABNkhI02533; Wed, 12 Nov 2003 01:46:43 +0200 Date: Wed, 12 Nov 2003 01:46:43 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: netdev@oss.sgi.com cc: "David S. Miller" , Wensong Zhang , morpheus Subject: [2.6 PATCH] ipvs - avoid NULL ptr deref in __ip_vs_get_out_rt Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-1855971336-1068594403=:2506" X-archive-position: 1339 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-1855971336-1068594403=:2506 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, The attached patch fixes the problem as reported from Kris (morpheus at theendless.org) under subject "linux-2.6.0-test9 and IPVS (Kernel OOPS) with sync daemon started.". Kris reported that the fix works. It fixes a copy-and-paste bug which leads to dereferencing a NULL ptr in __ip_vs_get_out_rt. Regards -- Julian Anastasov --1607745702-1855971336-1068594403=:2506 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rt-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: fix dest rt Content-Disposition: attachment; filename="rt-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM0OSAgLT4gMS4xMzUwIA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX3htaXQuYwkxLjYgICAgIC0+IDEuNyAgICAN CiMNCiMgVGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNl dCBMb2cNCiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCiMgMDMvMTEvMTIJamFAc3NpLmJnCTEuMTM1MA0KIyBbSVBW U106IGF2b2lkIE5VTEwgcHRyIGRlcmVmIGZvciBkZXN0IGluIF9faXBfdnNf Z2V0X291dF9ydA0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLQ0KIw0KZGlmZiAtTnJ1IGEvbmV0L2lwdjQvaXB2cy9p cF92c194bWl0LmMgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX3htaXQuYw0KLS0t IGEvbmV0L2lwdjQvaXB2cy9pcF92c194bWl0LmMJV2VkIE5vdiAxMiAwMTow MDozNSAyMDAzDQorKysgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX3htaXQuYwlX ZWQgTm92IDEyIDAxOjAwOjM1IDIwMDMNCkBAIC05OCw3ICs5OCw3IEBADQog CQkJLm9pZiA9IDAsDQogCQkJLm5sX3UgPSB7DQogCQkJCS5pcDRfdSA9IHsN Ci0JCQkJCS5kYWRkciA9IGRlc3QtPmFkZHIsDQorCQkJCQkuZGFkZHIgPSBj cC0+ZGFkZHIsDQogCQkJCQkuc2FkZHIgPSAwLA0KIAkJCQkJLnRvcyA9IHJ0 b3MsIH0gfSwNCiAJCX07DQo= --1607745702-1855971336-1068594403=:2506-- From davem@pizda.ninka.net Tue Nov 11 15:54:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 15:55:09 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hABNsr25029563 for ; Tue, 11 Nov 2003 15:54:55 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA31570; Tue, 11 Nov 2003 15:48:32 -0800 Date: Tue, 11 Nov 2003 15:48:32 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, wensong@linux-vs.org, morpheus@theendless.org Subject: Re: [2.6 PATCH] ipvs - avoid NULL ptr deref in __ip_vs_get_out_rt Message-Id: <20031111154832.1017f57f.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1340 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 12 Nov 2003 01:46:43 +0200 (EET) Julian Anastasov wrote: > The attached patch fixes the problem as reported from > Kris (morpheus at theendless.org) under subject "linux-2.6.0-test9 and > IPVS (Kernel OOPS) with sync daemon started.". Kris reported that > the fix works. It fixes a copy-and-paste bug which leads to dereferencing > a NULL ptr in __ip_vs_get_out_rt. Applied, thanks Julian. I assume 2.4.x does not need this fix. From davem@pizda.ninka.net Tue Nov 11 16:01:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:01:38 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC01P25030000 for ; Tue, 11 Nov 2003 16:01:25 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA31597; Tue, 11 Nov 2003 15:55:18 -0800 Date: Tue, 11 Nov 2003 15:55:18 -0800 From: "David S. Miller" To: Andrew Morton Cc: jhf@rivenstone.net, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [OOPS] TLAN fails on ifconfig with CONFIG_HOTPLUG=n Message-Id: <20031111155518.52db3e71.davem@redhat.com> In-Reply-To: <20031111153013.3b9eba6e.akpm@osdl.org> References: <20031111222933.GA2868@rivenstone.net> <20031111153013.3b9eba6e.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1341 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 15:30:13 -0800 Andrew Morton wrote: > Does this fix it? ... > -} board_info[] __devinitdata = { > +} board_info[] = { This fix is needed, definitely. Even if it doesn't cure this specific bug. I'll merge this into my networking tree and push to Linus. Thanks Andrew. From ja@ssi.bg Tue Nov 11 16:01:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:02:09 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC01p25030032 for ; Tue, 11 Nov 2003 16:01:54 -0800 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id hAC01YI02609; Wed, 12 Nov 2003 02:01:34 +0200 Date: Wed, 12 Nov 2003 02:01:34 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, , Subject: Re: [2.6 PATCH] ipvs - avoid NULL ptr deref in __ip_vs_get_out_rt In-Reply-To: <20031111154832.1017f57f.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1342 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Tue, 11 Nov 2003, David S. Miller wrote: > I assume 2.4.x does not need this fix. Yes, 2.4 is ok Regards -- Julian Anastasov From davem@pizda.ninka.net Tue Nov 11 16:08:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:08:25 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC08725030790 for ; Tue, 11 Nov 2003 16:08:08 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA31653; Tue, 11 Nov 2003 16:02:00 -0800 Date: Tue, 11 Nov 2003 16:02:00 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code Message-Id: <20031111160200.72cee93a.davem@redhat.com> In-Reply-To: <20031111.163128.48152698.yoshfuji@linux-ipv6.org> References: <20031110.104536.79654717.yoshfuji@linux-ipv6.org> <20031110230233.254061da.davem@redhat.com> <20031111.163128.48152698.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1343 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 16:31:28 -0600 (CST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > In article <20031110230233.254061da.davem@redhat.com> (at Mon, 10 Nov 2003 23:02:33 -0800), "David S. Miller" says: > > > Another idea is to change do_proc_dointvec() to take a conversion function > > pointer instead of this "conv" thing. Maybe even proc_dointvec_minmax() > > could be implemented in terms of do_proc_dointvec() with such a scheme. > > This is essentially identical to what I thought. > Okay, how about this? This looks very nice, thank you Yoshfuji. I'm asking Linus what we should do here. It's a big change to make to fix this bug, and if he thinks so too we'll just use your original patch which is a safer version of the fix for 2.6.0 purposes. If that happens, we'll integrate this nicer version for 2.6.1 or something like this. Thank you again. From davem@pizda.ninka.net Tue Nov 11 16:09:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:09:53 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC09d25031131 for ; Tue, 11 Nov 2003 16:09:40 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA31695; Tue, 11 Nov 2003 16:03:21 -0800 Date: Tue, 11 Nov 2003 16:03:20 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, wensong@linux-vs.org Subject: Re: [2.6 PATCH] ipvs - make sure the timer expires on one cpu Message-Id: <20031111160320.29620aca.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1344 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 10:07:17 +0200 (EET) Julian Anastasov wrote: > Ah, sorry. It is bad idea to set cp->timeout to 0. Please, > better use the attached patch instead. Applied, thanks Julian. From ak@suse.de Tue Nov 11 16:14:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:14:40 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC0EG25031558 for ; Tue, 11 Nov 2003 16:14:17 -0800 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 943BE17DA550; Wed, 12 Nov 2003 00:53:30 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 14000) id 4E226105C0; Wed, 12 Nov 2003 00:53:30 +0100 (CET) Date: Wed, 12 Nov 2003 00:53:30 +0100 From: Andi Kleen To: John Partridge Cc: "David S. Miller" , ak@suse.de, netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031111235330.GA25553@wotan.suse.de> References: <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FB15725.4050705@sgi.com> X-archive-position: 1345 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > +config CONFIG_UNALIGNED_EXPENSIVE > + bool "Use kernel aligned buffers" Drop the "bool" line. Then it will be invisible, which is the right thing here. > + depends on IA64 > + default y > + -Andi From wsx@6com.sk Tue Nov 11 16:41:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:41:53 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC0fT25002462 for ; Tue, 11 Nov 2003 16:41:40 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 8B7E84C00083; Tue, 11 Nov 2003 19:41:23 -0500 (EST) Date: Wed, 12 Nov 2003 01:41:23 +0100 From: Jan Oravec To: "David S. Miller" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031112004123.GA2749@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> <20031111222611.GA1239@wsx.ksp.sk> <20031111151340.3d129bc7.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031111151340.3d129bc7.davem@redhat.com> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1346 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev > Yes there is a gdb, here is a prebuilt 64-bit gdb for you. It is even > statically linked so there are no shared library dependencies. It can > debug 32-bit processes as well: > > ftp://pizda.ninka.net/pub/for_jakub/gdb64 Thanks a lot! That is exactly what I was looking for, now I can debug IPv4 traceroute :-). Jan From garzik@gtf.org Tue Nov 11 16:45:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:46:17 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC0jq25002847 for ; Tue, 11 Nov 2003 16:45:56 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 975E9666D; Tue, 11 Nov 2003 19:45:46 -0500 (EST) Date: Tue, 11 Nov 2003 19:45:46 -0500 From: Jeff Garzik To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: [BK PATCHES] 2.6.x experimental net driver updates Message-ID: <20031112004546.GA2164@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 1347 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev BK users: bk pull bk://gkernel.bkbits.net/net-drivers-2.5-exp Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk16-netdrvr-exp1.patch.bz2 This will update the following files: Documentation/networking/netconsole.txt | 57 ++ drivers/net/3c501.c | 116 ++--- drivers/net/3c501.h | 1 drivers/net/3c505.c | 128 +++--- drivers/net/3c507.c | 120 +++--- drivers/net/3c515.c | 23 - drivers/net/3c527.c | 584 +++++++++++++---------------- drivers/net/3c59x.c | 17 drivers/net/8139too.c | 51 +- drivers/net/82596.c | 83 ++-- drivers/net/Kconfig | 7 drivers/net/Makefile | 1 drivers/net/Space.c | 161 +++++--- drivers/net/amd8111e.c | 14 drivers/net/de620.c | 63 ++- drivers/net/defxx.c | 2 drivers/net/dummy.c | 2 drivers/net/eepro100.c | 21 + drivers/net/eql.c | 2 drivers/net/natsemi.c | 39 + drivers/net/netconsole.c | 120 ++++++ drivers/net/ni5010.c | 184 ++++----- drivers/net/ni52.c | 118 +++-- drivers/net/ni65.c | 101 +++-- drivers/net/ns83820.c | 2 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 14 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 +++------ drivers/net/skfp/skfddi.c | 32 - drivers/net/tg3.c | 16 drivers/net/tokenring/proteon.c | 184 ++++----- drivers/net/tokenring/skisa.c | 182 ++++----- drivers/net/tokenring/smctr.c | 194 +++++---- drivers/net/tulip/Kconfig | 20 + drivers/net/tulip/interrupt.c | 410 +++++++++++++++----- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 76 ++- drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++++------------ drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wireless/arlan-main.c | 283 +++++--------- drivers/net/wireless/arlan.h | 6 drivers/net/wireless/wavelan.c | 171 +++----- drivers/net/wireless/wavelan.p.h | 5 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + net/Kconfig | 20 - net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 ++++++++++++++++++++++++++++++++ net/wanrouter/wanmain.c | 2 52 files changed, 2997 insertions(+), 1997 deletions(-) through these ChangeSets: (03/11/11 1.1433) [PATCH] sk_g16 missing declaration The new probe code in net-drivers-2.5-exp lost a declaration for the module case (thanks al). (03/11/11 1.1432) [PATCH] arlan new probe code needs to register Fix arlan registration in the net-drivers-2.5-exp repo. Need to call register_netdev. Found by viro. (03/11/11 1.1431) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1430) [PATCH] typo in net-drivers-2.5-exp 3c507 Fix auto-probing loop in new probing code for 3c507. This patch is against net-drivers-2.5-exp repository. Found by viro. (03/10/29 1.1380.2.24) [PATCH] netpoll for eepro100 netpoll for eepro100 This was in Ingo's old original netconsole patches. (03/10/29 1.1380.2.23) [PATCH] fix tg3 netpoll No need to use disable_irq because tg3 is properly spinlocked. Can just call the interrupt handler directly. (03/10/29 1.1380.2.22) [PATCH] Netpoll for pcnet32 netpoll for pcnet32 (03/10/29 1.1380.2.21) [PATCH] netpoll for amd8111e netpoll for amd8111e (03/10/29 1.1380.2.20) [PATCH] netpoll for tulip Netpoll for tulip. Uses disable_irq() because tulip is unfortunately still lockless. (03/10/29 1.1380.2.19) [PATCH] netpoll for 3c59x >From the old -aa tree with minor changes. Orginally done by Andrea I think. (03/10/29 1.1380.5.3) [NET] use the netpoll API to transmit kernel printks over UDP (03/10/29 1.1380.5.2) [NET] Add netpoll support for tg3 (03/10/29 1.1380.5.1) [NET] add netpoll API (03/10/29 1.1380.2.17) [PATCH] trivial -- skfp_probe should be static skfp_probe used to be called from Space.c but isn't any more. Therefore it no longer needs to be global. All the calls to insert_device() pass skfp_probe as a second arg, so just use it directly. Jeff, this also is janitor type stuff, so just put it in net-2.5-exp (03/10/29 1.1380.2.16) [PATCH] (4/6) skisa -- probe2 Convert the SK-NET TMS380 ISA card to the new probe2 format. (03/10/29 1.1380.2.15) [PATCH] (3/6) proteon -- probe2 Convert proteon token ring driver to new probing. (03/10/29 1.1380.2.14) [PATCH] (2/6) smctr -- probe2 Convert the SMC tokenring driver to new probing. (03/10/29 1.1380.2.13) [PATCH] (1/6) tokenring probing change Ugh, two patches got crossed. This is the correct first one. (03/10/29 1.1380.2.12) [netdrvr 3c527] fix race (03/10/29 1.1380.2.11) [netdrvr 3c527] whitespace changes (sync up with maintainer) (03/10/14 1.1337.26.21) [PATCH] (12/12) Probe2 -- 82596 Originally by Al Viro (NE23-82596) * switched 82596 to dynamic allocation * 82596: fixed resource leaks on failure exits Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.20) [PATCH] (11/12) Probe2 -- 3c501 >From viro NE22-3c501 * switched 3c501 to dynamic allocation * 3c501: embedded ->priv * 3c501: fixed clobbering on autoprobe * 3c501: fixed resource leaks on failure exits Additional: * probe correctly when no device present * fix loop forever bug in probing * free_netdev (03/10/14 1.1337.26.19) [PATCH] (10/12) Probe2 -- wavelan Original by Al Viro (NE21-wavelan) * switched wavelan to dynamic allocation * wavelan: embedded ->priv * wavelan: fixed clobbering on autoprobe * wavelan: fixed IO before request_region() * wavelan: fixed resource leaks on failure exits * wavelan: fixed order of freeing bugs Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.18) [PATCH] (09/12) Probe2 -- arlan Convert arlan driver to new probing. This meant a rather large rework of the probing code for this driver since it did a lot ofnon standard things. (03/10/14 1.1337.26.17) [PATCH] (08/12) Probe2 -- 3c507 Originally by Al Viro (NE19-3c507) * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. Updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.16) [PATCH] (07/12) Probe2 -- 3c505 from viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits Additional: * add free_netdev (03/10/14 1.1337.26.15) [PATCH] (06/12) Probe2 -- sk16 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev (03/10/14 1.1337.26.14) [PATCH] (05/12) Probe2 -- ni5010 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev (03/10/14 1.1337.26.13) [PATCH] (04/12) Probe2 -- ni52 >From viro NE15-ni52 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe Additional: * add free_netdev (03/10/14 1.1337.26.12) [PATCH] (03/12) Probe2 -- ni65 Convert ni65 driver to new probing; patch sequence goes bottom up on the probe list. * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprobe (03/10/14 1.1337.26.11) [PATCH] (2/12) Probe2 -- de620 Rework de620 driver to new dynamic allocation Originally by Al Viro. * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() Updated to ~jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.10) [PATCH] (1/12) Probe2 infrastructure for 2.6 experimental New infrastructure to allow probing older builtin drivers (like ISA) Originally by Al Viro, updated to apply agains jgarzik/net-drivers-2.5-exp (03/10/14 1.1337.26.9) [netdrvr tulip] support NAPI Contributed by Robert Ollsson. (03/10/14 1.1337.26.8) [PATCH] smctr - get rid of MOD_INC/DEC Get rid of warning now that module refcounting now done by network code not drivers. Not tested on real hardware. (03/10/14 1.1337.26.7) [PATCH] janitor: insert missing iounmap(), add error handling Hi, Please apply to 2.6.0-test6-current. Thanks, -- ~Randy From: Leann Ogasawara Subject: Re: [Kernel-janitors] [PATCH] insert missing iounmap() > > Patch inserts a missing iounmap(). Implements a cleanup path > > for error handling as well. Feedback is much appreciated. Thanks :) ===== drivers/net/natsemi.c 1.55 vs edited ===== linux-260-test6-kj1-rddunlap/drivers/net/natsemi.c | 39 ++++++++++----------- 1 files changed, 20 insertions(+), 19 deletions(-) (03/10/14 1.1337.26.6) [PATCH] release region in skfddi driver This is a multi-part message in MIME format. (03/10/14 1.1337.26.5) [netdrvr 3c527] remove cli/sti Richard Procter and I worked to remove cli/sti to add proper SMP support (I did the original stuff and Richard did the actual current code :)). Besides that, Richard did a great jog improving the perfomance of the driver quite a bit: - Improve mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). - Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle Original post: http://marc.theaimsgroup.com/?l=linux-netdev&m=106438449315202&w=2 Since it didn't apply cleanly against 2.6.0-test6, I forward ported it. Patch attached. Jeff, please consider applying, Thanks. (03/10/14 1.1337.26.4) [PATCH] remove dev_get from wanrouter The call to dev_get() in wanrouter_device_new_if is racy and redundant and should be removed. The later 'register_netdev()' does the same test internally and will return the appropriate error if the name already exists. This patch is against 2.6.0-test6. Resend of earlier patch because it was ignored, or missed. (03/10/14 1.1337.26.3) [PATCH] 2.6.0-test6 - more free_netdev() conversion Compiles ok (with true .o generated, yeah). Please review. free_netdev() of devices allocated through use of alloc_netdev(). Though baroque, drivers/net/3c515.c now uses alloc_etherdev(). drivers/net/3c515.c | 23 ++++++++++++----------- drivers/net/defxx.c | 2 +- drivers/net/dummy.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/plip.c | 14 ++++++++++---- drivers/net/shaper.c | 11 ++++++++--- drivers/net/tun.c | 18 +++++++++--------- 9 files changed, 43 insertions(+), 31 deletions(-) (03/10/14 1.1337.26.2) [PATCH] wan/lmc -- convert to new network device model Resend of LMC driver patch for 2.6.0-test6 * do proper probing * allocate network device with alloc_netdev * use standard pci_id's instead of local defines * use standard PCI device interface to find and remove devices. (03/10/14 1.1337.26.1) [netdrvr 8139too] support netif_msg_* interface From shemminger@osdl.org Tue Nov 11 16:48:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:48:30 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC0lv25003236 for ; Tue, 11 Nov 2003 16:48:17 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hAC0lZC15107; Tue, 11 Nov 2003 16:47:35 -0800 Date: Tue, 11 Nov 2003 16:47:58 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] ethertap can use alloc_etherdev Message-Id: <20031111164758.66298833.shemminger@osdl.org> In-Reply-To: <3FB17650.2000408@pobox.com> References: <20031111144557.38bde052.shemminger@osdl.org> <3FB17650.2000408@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1348 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 18:52:48 -0500 Jeff Garzik wrote: > Stephen Hemminger wrote: > > Can use alloc_etherdev, don't need to call ether_setup. > > Found by viro. > > > > diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c > > --- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 > > +++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 > > @@ -72,8 +72,7 @@ > > struct net_device *dev; > > int err = -ENOMEM; > > > > - dev = alloc_netdev(sizeof(struct net_local), "tap%d", > > - ether_setup); > > + dev = alloc_etherdev(sizeof(struct net_local)); > > > Um? This clearly changes the device's interface name, which > alloc_etherdev() not ether_setup() assigns. > It forces it already several lines later and it hasn't registered yet. if (!dev) goto out; SET_MODULE_OWNER(dev); sprintf(dev->name, "tap%d", unit); dev->base_addr = unit + NETLINK_TAPBASE; -- Stephen Hemminger Open Source Development Lab http://developer.osdl.org :-) Ignorance never settles a question From jgarzik@pobox.com Tue Nov 11 16:51:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 16:51:13 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC0ox25003636 for ; Tue, 11 Nov 2003 16:51:00 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41158 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJjDm-0006EB-KI; Wed, 12 Nov 2003 00:50:58 +0000 Message-ID: <3FB183E5.1050403@pobox.com> Date: Tue, 11 Nov 2003 19:50:45 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] ethertap can use alloc_etherdev References: <20031111144557.38bde052.shemminger@osdl.org> <3FB17650.2000408@pobox.com> <20031111164758.66298833.shemminger@osdl.org> In-Reply-To: <20031111164758.66298833.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1349 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > It forces it already several lines later and it hasn't registered yet. OK. I applied all but this patch and another one that didn't apply cleanly. Grab the latest net-drivers-2.5-exp patch I just posted, and resend against that... Jeff From drepper@redhat.com Tue Nov 11 17:07:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 17:07:37 -0800 (PST) Received: from myware.akkadia.org (root@cpe-24-221-190-179.ca.sprintbbd.net [24.221.190.179]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC17525004249 for ; Tue, 11 Nov 2003 17:07:22 -0800 Received: from redhat.com (drepper@myware.akkadia.org [192.168.7.70]) by myware.akkadia.org (8.12.10/8.12.10) with ESMTP id hAC15S2C020219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Nov 2003 17:05:28 -0800 Message-ID: <3FB18758.8040708@redhat.com> Date: Tue, 11 Nov 2003 17:05:28 -0800 From: Ulrich Drepper Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, kuznet@ms2.inr.ac.ru Subject: RFC 3484 support X-Enigmail-Version: 0.81.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 X-MIME-Autoconverted: from 8bit to quoted-printable by myware.akkadia.org id hAC15S2C020219 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAC17525004249 X-archive-position: 1350 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: drepper@redhat.com Precedence: bulk X-list: netdev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I want to implement RFC 3484 support in getaddrinfo for glibc but there is the tiny little problem with the source address selection which has to be solved as part of the destination address selection. To sort the destination addresses the source address for each of the addresses returned by getaddrinfo must be determined. This can be done in two ways: 1. use the existing kernel functionality and provide an interface to it which userlevel can use 2. re-implement routing at userlevel #2 above has serious problems. To accurately re-implement the kernels routing decision making a huge amount of data is needed. Not only the routing information, but also transient errors, all the kernel parameters and flags influencing routines etc. This is, I'd say, virtually impossible which would mean an implementation with the source address selection happening at userlevel would do a bad job in some cases. So my question is: is there interest in adding support for method #1 to the kernel? Could we get a syscall or whatever to pass down to the kernel a set of addresses (and whatever else is needed) and the kernel passing back information about the sorted list (either the sorting list or a transformation description of some sort)? [I'm not on this list, so please cc: me. DaveM made me post here.] - -- âž§ Ulrich Drepper âž§ Red Hat, Inc. âž§ 444 Castro St âž§ Mountain View, CA â– -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/sYdY2ijCOnn/RHQRAppvAJ9MuBPXJM5tH93mXwRu2prifwo+GACfSjzg tuMC3yIgcqugevSYvuJpC2g= =yEdb -----END PGP SIGNATURE----- From johnip@sgi.com Tue Nov 11 17:47:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 17:47:26 -0800 (PST) Received: from rj.sgi.com (mtvcafw.sgi.com [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC1l825028302 for ; Tue, 11 Nov 2003 17:47:09 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hABNqrOO032708 for ; Tue, 11 Nov 2003 15:52:53 -0800 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hAC1l2P512878549; Tue, 11 Nov 2003 19:47:02 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hAC1kbRn335527520; Tue, 11 Nov 2003 19:46:37 -0600 (CST) Message-ID: <3FB190FE.20005@sgi.com> Date: Tue, 11 Nov 2003 19:46:38 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> <20031111235330.GA25553@wotan.suse.de> In-Reply-To: <20031111235330.GA25553@wotan.suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1351 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Thanks Andi, Andi Kleen wrote: > Drop the "bool" line. Then it will be invisible, which is the right thing here. --- linux/drivers/net/tg3.c 2003-11-10 18:28:10.000000000 -0600 +++ patch/drivers/net/tg3.c 2003-11-10 18:58:35.000000000 -0600 @@ -2257,7 +2257,11 @@ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#if defined(CONFIG_UNALIGNED_EXPENSIVE) + && tp->rx_offset == 2 +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 +++ patch/arch/ia64/Kconfig 2003-11-11 19:45:06.000000000 -0600 @@ -468,6 +468,10 @@ agent" (/sbin/hotplug) to load modules and set up software needed to use devices as you hotplug them. +config CONFIG_UNALIGNED_EXPENSIVE + depends on IA64 + default y + source "drivers/pci/hotplug/Kconfig" source "drivers/pcmcia/Kconfig" -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From yoshfuji@linux-ipv6.org Tue Nov 11 19:35:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 19:36:05 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC3Zk25002306 for ; Tue, 11 Nov 2003 19:35:47 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-6.6) with ESMTP id hAC3a3lg026213; Wed, 12 Nov 2003 12:36:04 +0900 Date: Tue, 11 Nov 2003 21:36:03 -0600 (CST) Message-Id: <20031111.213603.27789451.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031111160200.72cee93a.davem@redhat.com> References: <20031110230233.254061da.davem@redhat.com> <20031111.163128.48152698.yoshfuji@linux-ipv6.org> <20031111160200.72cee93a.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1352 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20031111160200.72cee93a.davem@redhat.com> (at Tue, 11 Nov 2003 16:02:00 -0800), "David S. Miller" says: > I'm asking Linus what we should do here. It's a big change to > make to fix this bug, and if he thinks so too we'll just use > your original patch which is a safer version of the fix for 2.6.0 > purposes. If that happens, we'll integrate this nicer version > for 2.6.1 or something like this. Yes, it is the reason why I did not submit this fisrt; to avoid "big" change before 2.6.0. Just in case Linus accept this change now, please apply following on top of the patch because I sent you wrong version with typo... Thanks. --- linux26-sysctl/kernel/sysctl.c.orig Wed Nov 12 12:25:35 2003 +++ linux26-sysctl+fix/kernel/sysctl.c Wed Nov 12 12:27:18 2003 @@ -1413,7 +1413,7 @@ if (!first) *p++ = '\t'; - if (conv(&neg, &lval, i, 1, data)) + if (conv(&neg, &lval, i, 0, data)) break; sprintf(p, "%s%lu", neg ? "-" : "", lval); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jhf@rivenstone.net Tue Nov 11 21:09:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 21:10:03 -0800 (PST) Received: from caphernaum.rivenstone.net (dhcp160178171.columbus.rr.com [24.160.178.171]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC59U25006231 for ; Tue, 11 Nov 2003 21:09:32 -0800 Received: by caphernaum.rivenstone.net (Postfix, from userid 1000) id 6728C1FF49; Tue, 11 Nov 2003 23:41:37 -0500 (EST) Date: Tue, 11 Nov 2003 23:41:36 -0500 To: "David S. Miller" Cc: Andrew Morton , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [OOPS] TLAN fails on ifconfig with CONFIG_HOTPLUG=n Message-ID: <20031112044136.GA1401@rivenstone.net> Mail-Followup-To: "David S. Miller" , Andrew Morton , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20031111222933.GA2868@rivenstone.net> <20031111153013.3b9eba6e.akpm@osdl.org> <20031111155518.52db3e71.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20031111155518.52db3e71.davem@redhat.com> User-Agent: Mutt/1.5.4i From: jhf@rivenstone.net (Joseph Fannin) X-archive-position: 1353 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jhf@rivenstone.net Precedence: bulk X-list: netdev --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 11, 2003 at 03:55:18PM -0800, David S. Miller wrote: > On Tue, 11 Nov 2003 15:30:13 -0800 > Andrew Morton wrote: >=20 > > Does this fix it? > ... > > -} board_info[] __devinitdata =3D { > > +} board_info[] =3D { >=20 > This fix is needed, definitely. Even if it doesn't cure this > specific bug. >=20 > I'll merge this into my networking tree and push to Linus. Even better, it fixes the bug. :-) Thank you. --=20 Joseph Fannin jhf@rivenstone.net "That's all I have to say about that." -- Forrest Gump. --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/sboAWv4KsgKfSVgRAi1HAJ9OWO45F4Y3NYG8P2leSMJOBUayIgCaA6CS DcotuiHsTWlmmr+u3c5VGKk= =JeWb -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2-- From escott@fas.harvard.edu Tue Nov 11 21:36:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 21:37:08 -0800 (PST) Received: from us19.unix.fas.harvard.edu (us19.unix.fas.harvard.edu [140.247.35.199]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC5ap25006745 for ; Tue, 11 Nov 2003 21:36:52 -0800 Received: from roam141-131.student.harvard.edu (roam141-131.student.harvard.edu [140.247.141.131]) by us19.unix.fas.harvard.edu (8.11.7p2/8.11.7) with ESMTP id hAC5aoG30759; Wed, 12 Nov 2003 00:36:50 -0500 Subject: 2.6 kernel and 3c905C-TX/TX-M [Tornado] From: David Wright Escott To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1068615390.4164.8.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 12 Nov 2003 00:36:31 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1354 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: escott@fas.harvard.edu Precedence: bulk X-list: netdev Ever since around 2.5.60 or so I have been unable to get networking to work, and I just tried with both test9 and test9-mm2 kernel with no success. The driver module will insert into the kernel but ifconfig will not bring up the network. I would really like to be able to move up to a 2.6 series kernel but I can't without getting networking to work. If anyone knows why this is happening I would greatly appreciate any pointers, or if there is anything I can do to give more substantial information please let me know. Thanks, David From ak@suse.de Tue Nov 11 22:44:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Nov 2003 22:44:41 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC6iF25007705 for ; Tue, 11 Nov 2003 22:44:15 -0800 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 252B517DBE05; Wed, 12 Nov 2003 07:19:59 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 14000) id 32546105C0; Wed, 12 Nov 2003 07:19:58 +0100 (CET) Date: Wed, 12 Nov 2003 07:19:58 +0100 From: Andi Kleen To: John Partridge Cc: Andi Kleen , "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031112061958.GA12065@wotan.suse.de> References: <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> <20031111235330.GA25553@wotan.suse.de> <3FB190FE.20005@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FB190FE.20005@sgi.com> X-archive-position: 1355 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev > --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 > +++ patch/arch/ia64/Kconfig 2003-11-11 19:45:06.000000000 -0600 > @@ -468,6 +468,10 @@ > agent" (/sbin/hotplug) to load modules and set up software needed > to use devices as you hotplug them. > > +config CONFIG_UNALIGNED_EXPENSIVE Sorry to nitpick again and not catching it earlier, but are you sure it works this way? Normally the options in Kconfig are not prefixed with CONFIG_* So config UNALIGNED_EXPENSIVE would be likely correct -Andi > + depends on IA64 > + default y > + > source "drivers/pci/hotplug/Kconfig" > > source "drivers/pcmcia/Kconfig" From jgarzik@pobox.com Wed Nov 12 01:22:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 01:22:48 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC9MT25003334 for ; Wed, 12 Nov 2003 01:22:30 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40894 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJfa5-0003FD-GH; Tue, 11 Nov 2003 20:57:45 +0000 Message-ID: <3FB14D3B.8060200@pobox.com> Date: Tue, 11 Nov 2003 15:57:31 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: johnip@sgi.com, ak@suse.de, netdev@oss.sgi.com, jes@sgi.com Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <3F844578.40306@sgi.com> <20031008101046.376abc3b.davem@redhat.com> <3F8455BE.8080300@sgi.com> <20031008183742.GA24822@wotan.suse.de> <20031008122223.1ba5ac79.davem@redhat.com> <20031008202248.GA15611@oldwotan.suse.de> <3F8702FF.70500@sgi.com> <20031010192036.GA31727@wotan.suse.de> <3F8802E6.5030601@sgi.com> <20031011131921.GC21763@wotan.suse.de> <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122545.6bb8bfe5.davem@redhat.com> In-Reply-To: <20031111122545.6bb8bfe5.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1356 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Tue, 11 Nov 2003 14:04:50 -0600 > John Partridge wrote: > > >>+config CONFIG_UNALIGNED_EXPENSIVE >>+ bool "Use Aligned SKB's for Tigon3 5701 network adapters" >>+ depends on MCKINLEY >>+ default y >>+ > > > Also, this help text is broken too. > > I repeat: "THIS IS NOT A TIGON3 5701 NETWORK ADAPTER SPECIFIC HACK" > > It is a config variable that all network drivers in the kernel can > test to make copybreak and related decisions for copy vs. read > directly packet handling. > > Please stop making this a tigon3 specific thing. We should CC David Mosberger on this, too. He's been wanting something like this (for, as you say, all network drivers) for a while now. Jeff From davem@pizda.ninka.net Wed Nov 12 01:33:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 01:33:14 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAC9X025003789 for ; Wed, 12 Nov 2003 01:33:01 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA00687; Wed, 12 Nov 2003 01:26:41 -0800 Date: Wed, 12 Nov 2003 01:26:41 -0800 From: "David S. Miller" To: "David S. Miller" Cc: jan.oravec@6com.sk, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-Id: <20031112012641.00018cb8.davem@redhat.com> In-Reply-To: <20031111151340.3d129bc7.davem@redhat.com> References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> <20031111222611.GA1239@wsx.ksp.sk> <20031111151340.3d129bc7.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1357 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 11 Nov 2003 15:13:40 -0800 "David S. Miller" wrote: > I will look at your patch proposals. All of the __skb_{push,pull}() modifications made by icmpv6_send() are illegal. The SKB could be cloned and being inspected by other entities in the networking, therefore moving the pointers around could cause problems. Therefore what we do instead is propagate the: skb->nh.raw - skb->data offset into the skb_copy_and_csum_bits() calls. This is what the pre-IPSEC version of the icmpv6 code did. When you pass a negative offset into skb_copy_and_csum_bits() this means start that many bytes before skb->data Jan, can you give this patch a try with your setup? Thanks a lot. --- net/ipv6/icmp.c.~1~ Wed Nov 12 01:04:01 2003 +++ net/ipv6/icmp.c Wed Nov 12 01:26:16 2003 @@ -86,15 +86,6 @@ .flags = INET6_PROTO_FINAL, }; -struct icmpv6_msg { - struct icmp6hdr icmph; - struct sk_buff *skb; - int offset; - struct in6_addr *daddr; - int len; - __u32 csum; -}; - static __inline__ int icmpv6_xmit_lock(void) { local_bh_disable(); @@ -258,11 +249,19 @@ return err; } +struct icmpv6_msg { + struct sk_buff *skb; + int offset; +}; + static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) { - struct sk_buff *org_skb = (struct sk_buff *)from; + struct icmpv6_msg *msg = (struct icmpv6_msg *) from; + struct sk_buff *org_skb = msg->skb; __u32 csum = 0; - csum = skb_copy_and_csum_bits(org_skb, offset, to, len, csum); + + csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset, + to, len, csum); skb->csum = csum_block_add(skb->csum, csum, odd); return 0; } @@ -281,9 +280,10 @@ struct dst_entry *dst; struct icmp6hdr tmp_hdr; struct flowi fl; + struct icmpv6_msg msg; int iif = 0; int addr_type = 0; - int len, plen; + int len; int hlimit = -1; int err = 0; @@ -379,27 +379,29 @@ hlimit = dst_metric(dst, RTAX_HOPLIMIT); } - plen = skb->nh.raw - skb->data; - __skb_pull(skb, plen); + msg.skb = skb; + msg.offset = skb->nh.raw - skb->data; + len = skb->len; len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); if (len < 0) { if (net_ratelimit()) printk(KERN_DEBUG "icmp: len problem\n"); - __skb_push(skb, plen); goto out_dst_release; } idev = in6_dev_get(skb->dev); - err = ip6_append_data(sk, icmpv6_getfrag, skb, len + sizeof(struct icmp6hdr), sizeof(struct icmp6hdr), - hlimit, NULL, &fl, (struct rt6_info*)dst, MSG_DONTWAIT); + err = ip6_append_data(sk, icmpv6_getfrag, &msg, + len + sizeof(struct icmp6hdr), + sizeof(struct icmp6hdr), + hlimit, NULL, &fl, (struct rt6_info*)dst, + MSG_DONTWAIT); if (err) { ip6_flush_pending_frames(sk); goto out_put; } err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr)); - __skb_push(skb, plen); if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB) ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH); @@ -423,6 +425,7 @@ struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; struct icmp6hdr tmp_hdr; struct flowi fl; + struct icmpv6_msg msg; struct dst_entry *dst; int err = 0; int hlimit = -1; @@ -464,7 +467,10 @@ idev = in6_dev_get(skb->dev); - err = ip6_append_data(sk, icmpv6_getfrag, skb, skb->len + sizeof(struct icmp6hdr), + msg.skb = skb; + msg.offset = 0; + + err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), sizeof(struct icmp6hdr), hlimit, NULL, &fl, (struct rt6_info*)dst, MSG_DONTWAIT); From herbert@gondor.apana.org.au Wed Nov 12 02:48:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 02:49:00 -0800 (PST) Received: from arnor.me.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACAmj25007237 for ; Wed, 12 Nov 2003 02:48:46 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.me.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1AJsY9-0002tp-00; Wed, 12 Nov 2003 21:48:37 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AJsY5-00043g-00; Wed, 12 Nov 2003 21:48:33 +1100 Date: Wed, 12 Nov 2003 21:48:33 +1100 To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: [TG3] Initialise reset_task properly Message-ID: <20031112104833.GA15583@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1358 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Jeff: I've received a queue_work crash report due to reset_task in tg3 not being initialised correctly. This patch should fix it. Cheers, -- Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: kernel-source-2.5/drivers/net/tg3.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/tg3.c,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 tg3.c --- kernel-source-2.5/drivers/net/tg3.c 26 Oct 2003 02:10:30 -0000 1.1.1.14 +++ kernel-source-2.5/drivers/net/tg3.c 12 Nov 2003 10:45:36 -0000 @@ -7601,7 +7601,7 @@ spin_lock_init(&tp->lock); spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); - PREPARE_WORK(&tp->reset_task, tg3_reset_task, tp); + INIT_WORK(&tp->reset_task, tg3_reset_task, tp); tp->regs = (unsigned long) ioremap(tg3reg_base, tg3reg_len); if (tp->regs == 0UL) { --x+6KMIRAuhnl3hBn-- From herbert@gondor.apana.org.au Wed Nov 12 02:49:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 02:49:53 -0800 (PST) Received: from arnor.me.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACAna25007342 for ; Wed, 12 Nov 2003 02:49:38 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.me.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1AJsYy-0002wG-00; Wed, 12 Nov 2003 21:49:28 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AJsYy-00044H-00; Wed, 12 Nov 2003 21:49:28 +1100 Date: Wed, 12 Nov 2003 21:49:28 +1100 To: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [TG3] Initialise reset_task properly Message-ID: <20031112104928.GA15629@gondor.apana.org.au> References: <20031112104833.GA15583@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <20031112104833.GA15583@gondor.apana.org.au> User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1359 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 12, 2003 at 09:48:33PM +1100, herbert wrote: > > I've received a queue_work crash report due to reset_task in tg3 not being > initialised correctly. This patch should fix it. And here is the 2.4 version. -- Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=q Index: kernel-source-2.4/drivers/net/tg3.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/drivers/net/tg3.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 tg3.c --- kernel-source-2.4/drivers/net/tg3.c 30 Aug 2003 06:01:39 -0000 1.1.1.4 +++ kernel-source-2.4/drivers/net/tg3.c 12 Nov 2003 10:46:11 -0000 @@ -6714,7 +6714,7 @@ spin_lock_init(&tp->lock); spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); - PREPARE_TQUEUE(&tp->reset_task, tg3_reset_task, tp); + INIT_TQUEUE(&tp->reset_task, tg3_reset_task, tp); tp->regs = (unsigned long) ioremap(tg3reg_base, tg3reg_len); if (tp->regs == 0UL) { --OXfL5xGRrasGEqWY-- From jgarzik@pobox.com Wed Nov 12 06:38:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 06:38:52 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACEcS25016754 for ; Wed, 12 Nov 2003 06:38:29 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41462 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJp4Y-0002il-56; Wed, 12 Nov 2003 07:05:50 +0000 Message-ID: <3FB1DBBF.1010403@pobox.com> Date: Wed, 12 Nov 2003 02:05:35 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: John Partridge , "David S. Miller" , netdev@oss.sgi.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> <20031111235330.GA25553@wotan.suse.de> <3FB190FE.20005@sgi.com> <20031112061958.GA12065@wotan.suse.de> In-Reply-To: <20031112061958.GA12065@wotan.suse.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1360 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Andi Kleen wrote: >>--- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 >>+++ patch/arch/ia64/Kconfig 2003-11-11 19:45:06.000000000 -0600 >>@@ -468,6 +468,10 @@ >> agent" (/sbin/hotplug) to load modules and set up software needed >> to use devices as you hotplug them. >> >>+config CONFIG_UNALIGNED_EXPENSIVE > > > Sorry to nitpick again and not catching it earlier, but are you sure it works > this way? Normally the options in Kconfig are not prefixed with CONFIG_* > > So > > config UNALIGNED_EXPENSIVE > > would be likely correct indeed. For my part, I will apply the patch to drivers/net/tg3.c, which is fine, and will let the arch/ia64/Kconfig patch go through normal channels (since ia64 seems to be flowing these days). Jeff From jgarzik@pobox.com Wed Nov 12 06:39:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 06:40:19 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACEds25016896 for ; Wed, 12 Nov 2003 06:39:57 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41635 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJw9v-0000sM-Ty; Wed, 12 Nov 2003 14:39:52 +0000 Message-ID: <3FB24629.4090302@pobox.com> Date: Wed, 12 Nov 2003 09:39:37 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: netdev@oss.sgi.com Subject: Re: [TG3] Initialise reset_task properly References: <20031112104833.GA15583@gondor.apana.org.au> In-Reply-To: <20031112104833.GA15583@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1361 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Herbert Xu wrote: > Hi Jeff: > > I've received a queue_work crash report due to reset_task in tg3 not being > initialised correctly. This patch should fix it. Thanks, I'll send this to Linus/Marcelo today... Jeff From wsx@6com.sk Wed Nov 12 07:14:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 07:15:13 -0800 (PST) Received: from mail.6com.sk (cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACFEu25017807 for ; Wed, 12 Nov 2003 07:14:57 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 8B2634C00083; Wed, 12 Nov 2003 10:14:44 -0500 (EST) Date: Wed, 12 Nov 2003 16:14:44 +0100 From: Jan Oravec To: "David S. Miller" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-ID: <20031112151444.GA9727@wsx.ksp.sk> Reply-To: Jan Oravec References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> <20031111222611.GA1239@wsx.ksp.sk> <20031111151340.3d129bc7.davem@redhat.com> <20031112012641.00018cb8.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031112012641.00018cb8.davem@redhat.com> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1362 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev > All of the __skb_{push,pull}() modifications made by icmpv6_send() > are illegal. The SKB could be cloned and being inspected by other > entities in the networking, therefore moving the pointers around > could cause problems. > > Therefore what we do instead is propagate the: > > skb->nh.raw - skb->data > > offset into the skb_copy_and_csum_bits() calls. This is what > the pre-IPSEC version of the icmpv6 code did. > > When you pass a negative offset into skb_copy_and_csum_bits() > this means start that many bytes before skb->data OK, I like your patch more. You have forgot to decrease 'len' by msg.offset here: > - plen = skb->nh.raw - skb->data; > - __skb_pull(skb, plen); > + msg.skb = skb; > + msg.offset = skb->nh.raw - skb->data; > + > len = skb->len; I've fixed that and tested, here is a working patch: --- linux/net/ipv6/icmp.c.orig 2003-11-12 16:02:23.000000000 +0100 +++ linux/net/ipv6/icmp.c 2003-11-12 16:03:59.000000000 +0100 @@ -86,15 +86,6 @@ .flags = INET6_PROTO_FINAL, }; -struct icmpv6_msg { - struct icmp6hdr icmph; - struct sk_buff *skb; - int offset; - struct in6_addr *daddr; - int len; - __u32 csum; -}; - static __inline__ int icmpv6_xmit_lock(void) { local_bh_disable(); @@ -258,11 +249,19 @@ return err; } +struct icmpv6_msg { + struct sk_buff *skb; + int offset; +}; + static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) { - struct sk_buff *org_skb = (struct sk_buff *)from; + struct icmpv6_msg *msg = (struct icmpv6_msg *) from; + struct sk_buff *org_skb = msg->skb; __u32 csum = 0; - csum = skb_copy_and_csum_bits(org_skb, offset, to, len, csum); + + csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset, + to, len, csum); skb->csum = csum_block_add(skb->csum, csum, odd); return 0; } @@ -281,9 +280,10 @@ struct dst_entry *dst; struct icmp6hdr tmp_hdr; struct flowi fl; + struct icmpv6_msg msg; int iif = 0; int addr_type = 0; - int len, plen; + int len; int hlimit = -1; int err = 0; @@ -379,27 +379,29 @@ hlimit = dst_metric(dst, RTAX_HOPLIMIT); } - plen = skb->nh.raw - skb->data; - __skb_pull(skb, plen); - len = skb->len; + msg.skb = skb; + msg.offset = skb->nh.raw - skb->data; + + len = skb->len - msg.offset; len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); if (len < 0) { if (net_ratelimit()) printk(KERN_DEBUG "icmp: len problem\n"); - __skb_push(skb, plen); goto out_dst_release; } idev = in6_dev_get(skb->dev); - err = ip6_append_data(sk, icmpv6_getfrag, skb, len + sizeof(struct icmp6hdr), sizeof(struct icmp6hdr), - hlimit, NULL, &fl, (struct rt6_info*)dst, MSG_DONTWAIT); + err = ip6_append_data(sk, icmpv6_getfrag, &msg, + len + sizeof(struct icmp6hdr), + sizeof(struct icmp6hdr), + hlimit, NULL, &fl, (struct rt6_info*)dst, + MSG_DONTWAIT); if (err) { ip6_flush_pending_frames(sk); goto out_put; } err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr)); - __skb_push(skb, plen); if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB) ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH); @@ -423,6 +425,7 @@ struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; struct icmp6hdr tmp_hdr; struct flowi fl; + struct icmpv6_msg msg; struct dst_entry *dst; int err = 0; int hlimit = -1; @@ -464,7 +467,10 @@ idev = in6_dev_get(skb->dev); - err = ip6_append_data(sk, icmpv6_getfrag, skb, skb->len + sizeof(struct icmp6hdr), + msg.skb = skb; + msg.offset = 0; + + err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), sizeof(struct icmp6hdr), hlimit, NULL, &fl, (struct rt6_info*)dst, MSG_DONTWAIT); Jan From johnip@sgi.com Wed Nov 12 07:32:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 07:33:02 -0800 (PST) Received: from tolkor.sgi.com (tolkor.sgi.com [198.149.18.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACFWl25018309 for ; Wed, 12 Nov 2003 07:32:47 -0800 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by tolkor.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id hACFqZHc006240 for ; Wed, 12 Nov 2003 09:52:35 -0600 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id hACFWfP513397056; Wed, 12 Nov 2003 09:32:41 -0600 (CST) Received: from sgi.com (fundament.americas.sgi.com [128.162.233.56]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id hACFWSRn344321620; Wed, 12 Nov 2003 09:32:29 -0600 (CST) Message-ID: <3FB2528E.9020605@sgi.com> Date: Wed, 12 Nov 2003 09:32:30 -0600 From: John Partridge Reply-To: johnip@sgi.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031022 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: Andi Kleen , "David S. Miller" , netdev@oss.sgi.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem References: <20031011105054.0e16a607.davem@redhat.com> <3F8C290A.3010508@sgi.com> <20031014095323.71c8b9fe.davem@redhat.com> <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> <20031111235330.GA25553@wotan.suse.de> <3FB190FE.20005@sgi.com> <20031112061958.GA12065@wotan.suse.de> <3FB1DBBF.1010403@pobox.com> In-Reply-To: <3FB1DBBF.1010403@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1363 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnip@sgi.com Precedence: bulk X-list: netdev Jeff Garzik wrote: > Andi Kleen wrote: >> Sorry to nitpick again and not catching it earlier, but are you sure >> it works this way? Normally the options in Kconfig are not prefixed >> with CONFIG_* >> So >> config UNALIGNED_EXPENSIVE >> would be likely correct Yes, that looks right to me. I'm still learning the whole 2.6 Kconfig thing > > > > indeed. > > For my part, I will apply the patch to drivers/net/tg3.c, which is fine, > and will let the arch/ia64/Kconfig patch go through normal channels > (since ia64 seems to be flowing these days). > > Jeff > > Is this OK ? --- linux/drivers/net/tg3.c 2003-11-10 18:28:10.000000000 -0600 +++ patch/drivers/net/tg3.c 2003-11-10 18:58:35.000000000 -0600 @@ -2257,7 +2257,11 @@ len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#if defined(CONFIG_UNALIGNED_EXPENSIVE) + && tp->rx_offset == 2 +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 +++ patch/arch/ia64/Kconfig 2003-11-12 09:31:14.000000000 -0600 @@ -468,6 +468,10 @@ agent" (/sbin/hotplug) to load modules and set up software needed to use devices as you hotplug them. +config UNALIGNED_EXPENSIVE + depends on IA64 + default y + source "drivers/pci/hotplug/Kconfig" source "drivers/pcmcia/Kconfig" -- John Partridge Silicon Graphics Inc Tel: 651-683-3428 Vnet: 233-3428 E-Mail: johnip@sgi.com From fdonzet@yahoo.fr Wed Nov 12 07:37:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 07:37:30 -0800 (PST) Received: from web25203.mail.ukl.yahoo.com (web25203.mail.ukl.yahoo.com [217.12.10.63]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACFbD25018724 for ; Wed, 12 Nov 2003 07:37:16 -0800 Message-ID: <20031112153708.41440.qmail@web25203.mail.ukl.yahoo.com> Received: from [195.68.44.148] by web25203.mail.ukl.yahoo.com via HTTP; Wed, 12 Nov 2003 16:37:08 CET Date: Wed, 12 Nov 2003 16:37:08 +0100 (CET) From: =?iso-8859-1?q?francois=20donzet?= Subject: tracing a packet through the kernel stack To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1364 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fdonzet@yahoo.fr Precedence: bulk X-list: netdev Hi there, i am trying to trace a packet which checksum has been calculated in hardware (skb->ip_summed set to CHECKSUM_HW) when it comes to the tcp layer. I start with net/tcp_ipv4.c/tcp_v4_recv(). Here, there is a call to tcp_v4_checksum_init(). If the call returns a negative number, the packet is considered invalid (checksum problem), and we go to the label bad_packet. i looked at tcp_v4_checksum_init() (in tcp_ipv4 too). When skb->ip_summed is set to CHECKSUM_HW, we first set it to CHECKSUM_UNECESSARY, to indicate that checksum hasn't to be computed later. Then we call tcp_v4_check() function, with params including the skb->len value, the source ip address,destination ip address, and the value of skb->csum. As far i know, skb->csum contains a sum of the entire packet contents, computed by the hardware which received the packet at the link layer level. To sump up, We have : tcp_v4_recv()-->tcp_v4_checksum_init()-->tcp_v4_check()-->csum_tcpudpmagic(). When i look at the architecture dependent code (asm-x86 for me) : csum_tcpudp_magic is followed by csum_tcpudp_nofold, and csum_fold calls. In my understanding of the checksumming operations, csum_tcpudp_magic() computes the pseudo header checksum, based on the source adress, the destination adress, the length of the packet and the ip protocol of the packet (here tcp). The initial sum to be add in contains the value of skb->csum. My initial believing would have been that (as someone suggests me after), some substractions from the skb->csum (as pseudoheader contains fields in ip header) would be made before checking the entire TCP checksum. But here, the skb->csum value is used "as is" in the TCP checksum computation. If you can give a little help, or tell me if i am looking the wrong part of code, thanks. ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From hirofumi@mail.parknet.co.jp Wed Nov 12 07:42:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 07:42:15 -0800 (PST) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACFfw25019093 for ; Wed, 12 Nov 2003 07:42:00 -0800 Received: from ibmpc.myhome.or.jp [210.171.164.65] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id A33D13C0138; Thu, 13 Nov 2003 00:39:25 +0900 Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id hACFfdXB007866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 13 Nov 2003 00:41:41 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) with ESMTP id hACFfdEQ005554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 13 Nov 2003 00:41:39 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) id hACFfYtg005550; Thu, 13 Nov 2003 00:41:34 +0900 To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] Updated 8139too with NAPI References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> <20031028114707.1d234da6.shemminger@osdl.org> <3FA01629.2080202@pobox.com> <873cdaabue.fsf@devron.myhome.or.jp> <20031030104943.20b61af0.shemminger@osdl.org> <87ekwu9tn4.fsf@devron.myhome.or.jp> <20031111143143.794909e8.shemminger@osdl.org> From: OGAWA Hirofumi Date: Thu, 13 Nov 2003 00:41:34 +0900 In-Reply-To: <20031111143143.794909e8.shemminger@osdl.org> Message-ID: <87d6bx4ms1.fsf@devron.myhome.or.jp> Lines: 39 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 1365 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hirofumi@mail.parknet.co.jp Precedence: bulk X-list: netdev Stephen Hemminger writes: > @@ -1663,6 +1678,8 @@ > /* Disable interrupts by clearing the interrupt mask. */ > RTL_W16 (IntrMask, 0x0000); > > + __netif_poll_disable(dev); Rx-poll can enable interrupt. However, because it can happen on SMP only, then reset of chips should be done sooner or later, so I don't care so much. > + /* > + * This order is important > + * (see Documentation/networking/NAPI_HOWTO.txt) > + */ > + netif_rx_complete(dev); > + RTL_W16_F(IntrMask, rtl8139_intr_mask); netif_rx_complete(dev); -- interrupted -- in rtl8139_interrupt(), if (netif_rx_schedule_prep(dev)) { RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); __netif_rx_schedule (dev); } -- resume -- /* enable interrupt, but rx-poll is already scheduling */ RTL_W16_F(IntrMask, rtl8139_intr_mask); So doesn't disable interrupt. Umm... this problem was things that my patch fixed. Any objections? local_irq_disable(); __netif_rx_complete(dev); RTL_W16_F(IntrMask, rtl8139_intr_mask); local_irq_enable(); -- OGAWA Hirofumi From hch@infradead.org Wed Nov 12 07:43:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 07:44:10 -0800 (PST) Received: from phoenix.infradead.org (pub234.cambridge.redhat.com [213.86.99.234] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACFhu25019388 for ; Wed, 12 Nov 2003 07:43:57 -0800 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 1AJx9r-0000da-95; Wed, 12 Nov 2003 15:43:51 +0000 Date: Wed, 12 Nov 2003 15:43:51 +0000 From: Christoph Hellwig To: John Partridge Cc: Jeff Garzik , Andi Kleen , "David S. Miller" , netdev@oss.sgi.com, jes@sgi.com, David Mosberger Subject: Re: Tigon3 5701 PCI-X recv performance problem Message-ID: <20031112154351.A2415@infradead.org> References: <3FB03A56.7000709@sgi.com> <20031110182911.2c5a121b.davem@redhat.com> <3FB140E2.1070007@sgi.com> <20031111122403.2d7bcf28.davem@redhat.com> <3FB15725.4050705@sgi.com> <20031111235330.GA25553@wotan.suse.de> <3FB190FE.20005@sgi.com> <20031112061958.GA12065@wotan.suse.de> <3FB1DBBF.1010403@pobox.com> <3FB2528E.9020605@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FB2528E.9020605@sgi.com>; from johnip@sgi.com on Wed, Nov 12, 2003 at 09:32:30AM -0600 X-archive-position: 1366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev > --- linux/arch/ia64/Kconfig 2003-10-25 13:44:46.000000000 -0500 > +++ patch/arch/ia64/Kconfig 2003-11-12 09:31:14.000000000 -0600 > @@ -468,6 +468,10 @@ > agent" (/sbin/hotplug) to load modules and set up software needed > to use devices as you hotplug them. > > +config UNALIGNED_EXPENSIVE > + depends on IA64 this line is not needed - if you're in the ia64 Kconfig it's always set. From jgarzik@pobox.com Wed Nov 12 08:01:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 08:02:04 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACG1m25020089 for ; Wed, 12 Nov 2003 08:01:51 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41764 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJxRC-00024x-Di; Wed, 12 Nov 2003 16:01:46 +0000 Message-ID: <3FB2595B.8090506@pobox.com> Date: Wed, 12 Nov 2003 11:01:31 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: OGAWA Hirofumi CC: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] Updated 8139too with NAPI References: <3F9070B6.9090306@pobox.com> <873cdqbt6z.fsf@devron.myhome.or.jp> <20031020131106.6862e951.shemminger@osdl.org> <877k2ysohc.fsf@devron.myhome.or.jp> <20031028114707.1d234da6.shemminger@osdl.org> <3FA01629.2080202@pobox.com> <873cdaabue.fsf@devron.myhome.or.jp> <20031030104943.20b61af0.shemminger@osdl.org> <87ekwu9tn4.fsf@devron.myhome.or.jp> <20031111143143.794909e8.shemminger@osdl.org> <87d6bx4ms1.fsf@devron.myhome.or.jp> In-Reply-To: <87d6bx4ms1.fsf@devron.myhome.or.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1367 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev OGAWA Hirofumi wrote: > netif_rx_complete(dev); > -- interrupted -- > in rtl8139_interrupt(), > if (netif_rx_schedule_prep(dev)) { > RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); > __netif_rx_schedule (dev); > } > -- resume -- > /* enable interrupt, but rx-poll is already scheduling */ > RTL_W16_F(IntrMask, rtl8139_intr_mask); good point... From rask@sygehus.dk Wed Nov 12 11:50:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 11:50:49 -0800 (PST) Received: from 0x50a1449e.albnxx15.adsl-dhcp.tele.dk (0x50a1449e.albnxx15.adsl-dhcp.tele.dk [80.161.68.158]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACJoM25009473 for ; Wed, 12 Nov 2003 11:50:36 -0800 Received: by 0x50a1449e.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 6CA95AC1; Wed, 12 Nov 2003 20:48:04 +0100 (CET) Date: Wed, 12 Nov 2003 20:48:04 +0100 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: network interface cards native vlans support in linux kernel? Message-ID: <20031112204804.B968@sygehus.dk> References: <20030709152814.GC15293@gtf.org> <20031022140624.A9145@vip.cybercity.dk> <3F96B7FD.7080607@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3F96B7FD.7080607@candelatech.com>; from greearb@candelatech.com on Wed, Oct 22, 2003 at 10:01:49AM -0700 X-archive-position: 1368 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev On Wed, Oct 22, 2003 at 10:01:49AM -0700, Ben Greear wrote: > Rask Ingemann Lambertsen wrote: > > > > What does a driver need to do to make sure it can handle vlan frames? Is it > > enought to be prepared to handle frames of size dev->mtu+4? How do I know 4 > > bytes will be enough tomorrow when someone introduces VLAN2 with a 64-bit tag? > > Checking for CONFIG_VLAN is of no use, right? > > It needs to be able to handle 1518 bytes (+crc), send and receive. I'd > suggest using the Intel e100 or e1000, as they both support VLANs just fine. > Most other GigE nics work too. I was thinking about what to do as a driver *writer* rather than as a driver *user*. #include and allocating buffers of (dev->mtu + VLAN_ETH_HLEN) bytes. Some chips, such as the Tulip series, need an extra 4 bytes for the CRC when receiving. -- Regards, Rask Ingemann Lambertsen From jgarzik@pobox.com Wed Nov 12 13:25:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 13:25:44 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACLP825013373 for ; Wed, 12 Nov 2003 13:25:29 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41092 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJiJi-0005fR-Mh; Tue, 11 Nov 2003 23:53:02 +0000 Message-ID: <3FB17650.2000408@pobox.com> Date: Tue, 11 Nov 2003 18:52:48 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] ethertap can use alloc_etherdev References: <20031111144557.38bde052.shemminger@osdl.org> In-Reply-To: <20031111144557.38bde052.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1369 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > Can use alloc_etherdev, don't need to call ether_setup. > Found by viro. > > diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c > --- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 > +++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003 > @@ -72,8 +72,7 @@ > struct net_device *dev; > int err = -ENOMEM; > > - dev = alloc_netdev(sizeof(struct net_local), "tap%d", > - ether_setup); > + dev = alloc_etherdev(sizeof(struct net_local)); Um? This clearly changes the device's interface name, which alloc_etherdev() not ether_setup() assigns. Jeff From davem@pizda.ninka.net Wed Nov 12 14:47:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 14:47:33 -0800 (PST) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hACMlK25015213 for ; Wed, 12 Nov 2003 14:47:20 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA15854; Wed, 12 Nov 2003 14:40:54 -0800 Date: Wed, 12 Nov 2003 14:40:54 -0800 From: "David S. Miller" To: Jan Oravec Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: IPv6/sparc64: icmp port unreachable corruption Message-Id: <20031112144054.2b65feb9.davem@redhat.com> In-Reply-To: <20031112151444.GA9727@wsx.ksp.sk> References: <20031109122844.GA14241@wsx.ksp.sk> <20031110214603.0057e365.davem@redhat.com> <20031111222611.GA1239@wsx.ksp.sk> <20031111151340.3d129bc7.davem@redhat.com> <20031112012641.00018cb8.davem@redhat.com> <20031112151444.GA9727@wsx.ksp.sk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1371 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 179 Lines: 6 On Wed, 12 Nov 2003 16:14:44 +0100 Jan Oravec wrote: > You have forgot to decrease 'len' by msg.offset here: Indeed, thanks a lot for all of your help Jan. From shemminger@osdl.org Wed Nov 12 16:30:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:31:03 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0US25019415 for ; Wed, 12 Nov 2003 16:30:49 -0800 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hAD0TkC28036; Wed, 12 Nov 2003 16:29:47 -0800 Date: Wed, 12 Nov 2003 16:30:09 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] de4x5 - missing free on error path Message-Id: <20031112163009.2be5e47d.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1372 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 491 Lines: 14 NE54-de4x5 - fix missing free on error path - found by viro diff -Nru a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c --- a/drivers/net/tulip/de4x5.c Tue Nov 11 14:15:07 2003 +++ b/drivers/net/tulip/de4x5.c Tue Nov 11 14:15:07 2003 @@ -1237,6 +1237,8 @@ if (lp->useSROM) { lp->state = INITIALISED; if (srom_infoleaf_info(dev)) { + dma_free_coherent (gendev, lp->dma_size, + lp->rx_ring, lp->dma_rings); return -ENXIO; } srom_init(dev); From shemminger@osdl.org Wed Nov 12 16:40:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:40:38 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0eP25019863 for ; Wed, 12 Nov 2003 16:40:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0eId29878; Wed, 12 Nov 2003 16:40:18 -0800 Date: Wed, 12 Nov 2003 16:40:18 -0800 From: Stephen Hemminger Message-Id: <200311130040.hAD0eId29878@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (0/42) intro Cc: netdev@oss.sgi.com X-archive-position: 1373 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 150 Lines: 4 This is the update to Al viro's changes to probing to have all network devices use dynamic allocation. The patches are against net-drivers-2.5-exp. From shemminger@osdl.org Wed Nov 12 16:40:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:40:48 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0eY25019870 for ; Wed, 12 Nov 2003 16:40:34 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0eSK29895; Wed, 12 Nov 2003 16:40:28 -0800 Date: Wed, 12 Nov 2003 16:40:28 -0800 From: Stephen Hemminger Message-Id: <200311130040.hAD0eSK29895@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (1/42) ewrk3 Cc: netdev@oss.sgi.com X-archive-position: 1374 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 24569 Lines: 852 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 10:22:14 2003 +++ b/drivers/net/Space.c Tue Nov 11 10:22:14 2003 @@ -56,7 +56,7 @@ extern int fmv18x_probe(struct net_device *); extern int eth16i_probe(struct net_device *); extern struct net_device *i82596_probe(int unit); -extern int ewrk3_probe(struct net_device *); +extern struct net_device *ewrk3_probe(int unit); extern struct net_device *el1_probe(int unit); extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); @@ -256,13 +256,13 @@ #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ {eepro_probe, 0}, #endif -#ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ - {ewrk3_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ + {ewrk3_probe, 0}, +#endif #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ {i82596_probe, 0}, #endif diff -Nru a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c --- a/drivers/net/ewrk3.c Tue Nov 11 10:22:14 2003 +++ b/drivers/net/ewrk3.c Tue Nov 11 10:22:14 2003 @@ -324,25 +324,14 @@ static int Write_EEPROM(short data, u_long iobase, u_char eaddr); static u_char get_hw_addr(struct net_device *dev, u_char * eeprom_image, char chipType); -static void isa_probe(struct net_device *dev, u_long iobase); -static void eisa_probe(struct net_device *dev, u_long iobase); -static struct net_device *alloc_device(struct net_device *dev, u_long iobase); -static int ewrk3_dev_index(char *s); -static struct net_device *insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *)); +static int ewrk3_probe1(struct net_device *dev, u_long iobase, int irq); +static int isa_probe(struct net_device *dev, u_long iobase); +static int eisa_probe(struct net_device *dev, u_long iobase); - -#ifdef MODULE -static int autoprobed = 1, loading_module = 1; - -#else -static u_char irq[] = -{5, 0, 10, 3, 11, 9, 15, 12}; -static int autoprobed, loading_module; - -#endif /* MODULE */ +static u_char irq[MAX_NUM_EWRK3S+1] = {5, 0, 10, 3, 11, 9, 15, 12}; static char name[EWRK3_STRLEN + 1]; -static int num_ewrk3s, num_eth; +static int num_ewrks3s; /* ** Miscellaneous defines... @@ -352,38 +341,50 @@ mdelay(1);\ } -int __init ewrk3_probe(struct net_device *dev) +struct net_device * __init ewrk3_probe(int unit) { - int tmp = num_ewrk3s, status = -ENODEV; - u_long iobase = dev->base_addr; + struct net_device *dev = alloc_etherdev(sizeof(struct ewrk3_private)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } SET_MODULE_OWNER(dev); - if ((iobase == 0) && loading_module) { - printk("Autoprobing is not supported when loading a module based driver.\n"); - status = -EIO; - } else { /* First probe for the Ethernet */ - /* Address PROM pattern */ - isa_probe(dev, iobase); - eisa_probe(dev, iobase); - - if ((tmp == num_ewrk3s) && (iobase != 0) && loading_module) { - printk("%s: ewrk3_probe() cannot find device at 0x%04lx.\n", dev->name, - iobase); - } - /* - ** Walk the device list to check that at least one device - ** initialised OK - */ - for (; (dev->priv == NULL) && (dev->next != NULL); dev = dev->next); + err = ewrk3_probe1(dev, dev->base_addr, dev->irq); + if (err) + goto out; + return dev; +out: + free_netdev(dev); + return ERR_PTR(err); + +} - if (dev->priv) - status = 0; - if (iobase == 0) - autoprobed = 1; - } +static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq) +{ + int err; - return status; + dev->base_addr = iobase; + dev->irq = irq; + + /* Address PROM pattern */ + err = isa_probe(dev, iobase); + if (err != 0) + err = eisa_probe(dev, iobase); + + if (err) + return err; + + err = register_netdev(dev); + if (err) + release_region(dev->base_addr, EWRK3_TOTAL_SIZE); + + return err; } static int __init @@ -396,8 +397,8 @@ u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0; /* - ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot. - ** This also disables the EISA_ENABLE bit in the EISA Control Register. + ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot. + ** This also disables the EISA_ENABLE bit in the EISA Control Register. */ if (iobase > 0x400) eisa_cr = inb(EISA_CR); @@ -409,232 +410,210 @@ icr &= 0x70; outb(icr, EWRK3_ICR); /* Disable all the IRQs */ - if (nicsr == (CSR_TXD | CSR_RXD)) { + if (nicsr == (CSR_TXD | CSR_RXD)) + return -ENXIO; - /* Check that the EEPROM is alive and well and not living on Pluto... */ - for (chksum = 0, i = 0; i < EEPROM_MAX; i += 2) { - union { - short val; - char c[2]; - } tmp; - - tmp.val = (short) Read_EEPROM(iobase, (i >> 1)); - eeprom_image[i] = tmp.c[0]; - eeprom_image[i + 1] = tmp.c[1]; - chksum += eeprom_image[i] + eeprom_image[i + 1]; - } - - if (chksum != 0) { /* Bad EEPROM Data! */ - printk("%s: Device has a bad on-board EEPROM.\n", dev->name); - status = -ENXIO; - } else { - EthwrkSignature(name, eeprom_image); - if (*name != '\0') { /* found a EWRK3 device */ - dev->base_addr = iobase; - - if (iobase > 0x400) { - outb(eisa_cr, EISA_CR); /* Rewrite the EISA CR */ - } - lemac = eeprom_image[EEPROM_CHIPVER]; - cmr = inb(EWRK3_CMR); - - if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) || - ((lemac == LeMAC2) && !(cmr & CMR_HS))) { - printk("%s: %s at %#4lx", dev->name, name, iobase); - hard_strapped = 1; - } else if ((iobase & 0x0fff) == EWRK3_EISA_IO_PORTS) { - /* EISA slot address */ - printk("%s: %s at %#4lx (EISA slot %ld)", - dev->name, name, iobase, ((iobase >> 12) & 0x0f)); - } else { /* ISA port address */ - printk("%s: %s at %#4lx", dev->name, name, iobase); - } - - if (!status) { - printk(", h/w address "); - if (lemac != LeMAC2) - DevicePresent(iobase); /* need after EWRK3_INIT */ - status = get_hw_addr(dev, eeprom_image, lemac); - for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet addr. */ - printk("%2.2x:", dev->dev_addr[i]); - } - printk("%2.2x,\n", dev->dev_addr[i]); - if (status) { - printk(" which has an EEPROM CRC error.\n"); - status = -ENXIO; - } else { - if (lemac == LeMAC2) { /* Special LeMAC2 CMR things */ - cmr &= ~(CMR_RA | CMR_WB | CMR_LINK | CMR_POLARITY | CMR_0WS); - if (eeprom_image[EEPROM_MISC0] & READ_AHEAD) - cmr |= CMR_RA; - if (eeprom_image[EEPROM_MISC0] & WRITE_BEHIND) - cmr |= CMR_WB; - if (eeprom_image[EEPROM_NETMAN0] & NETMAN_POL) - cmr |= CMR_POLARITY; - if (eeprom_image[EEPROM_NETMAN0] & NETMAN_LINK) - cmr |= CMR_LINK; - if (eeprom_image[EEPROM_MISC0] & _0WS_ENA) - cmr |= CMR_0WS; - } - if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM) - cmr |= CMR_DRAM; - outb(cmr, EWRK3_CMR); - - cr = inb(EWRK3_CR); /* Set up the Control Register */ - cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD; - if (cr & SETUP_APD) - cr |= eeprom_image[EEPROM_SETUP] & SETUP_PS; - cr |= eeprom_image[EEPROM_MISC0] & FAST_BUS; - cr |= eeprom_image[EEPROM_MISC0] & ENA_16; - outb(cr, EWRK3_CR); + /* Check that the EEPROM is alive and well and not living on Pluto... */ + for (chksum = 0, i = 0; i < EEPROM_MAX; i += 2) { + union { + short val; + char c[2]; + } tmp; + + tmp.val = (short) Read_EEPROM(iobase, (i >> 1)); + eeprom_image[i] = tmp.c[0]; + eeprom_image[i + 1] = tmp.c[1]; + chksum += eeprom_image[i] + eeprom_image[i + 1]; + } + + if (chksum != 0) { /* Bad EEPROM Data! */ + printk("%s: Device has a bad on-board EEPROM.\n", dev->name); + return -ENXIO; + } + + EthwrkSignature(name, eeprom_image); + if (*name == '\0') + return -ENXIO; + + dev->base_addr = iobase; + + if (iobase > 0x400) { + outb(eisa_cr, EISA_CR); /* Rewrite the EISA CR */ + } + lemac = eeprom_image[EEPROM_CHIPVER]; + cmr = inb(EWRK3_CMR); + + if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) || + ((lemac == LeMAC2) && !(cmr & CMR_HS))) { + printk("%s: %s at %#4lx", dev->name, name, iobase); + hard_strapped = 1; + } else if ((iobase & 0x0fff) == EWRK3_EISA_IO_PORTS) { + /* EISA slot address */ + printk("%s: %s at %#4lx (EISA slot %ld)", + dev->name, name, iobase, ((iobase >> 12) & 0x0f)); + } else { /* ISA port address */ + printk("%s: %s at %#4lx", dev->name, name, iobase); + } + + printk(", h/w address "); + if (lemac != LeMAC2) + DevicePresent(iobase); /* need after EWRK3_INIT */ + status = get_hw_addr(dev, eeprom_image, lemac); + for (i = 0; i < ETH_ALEN - 1; i++) { /* get the ethernet addr. */ + printk("%2.2x:", dev->dev_addr[i]); + } + printk("%2.2x,\n", dev->dev_addr[i]); + + if (status) { + printk(" which has an EEPROM CRC error.\n"); + return -ENXIO; + } + + if (lemac == LeMAC2) { /* Special LeMAC2 CMR things */ + cmr &= ~(CMR_RA | CMR_WB | CMR_LINK | CMR_POLARITY | CMR_0WS); + if (eeprom_image[EEPROM_MISC0] & READ_AHEAD) + cmr |= CMR_RA; + if (eeprom_image[EEPROM_MISC0] & WRITE_BEHIND) + cmr |= CMR_WB; + if (eeprom_image[EEPROM_NETMAN0] & NETMAN_POL) + cmr |= CMR_POLARITY; + if (eeprom_image[EEPROM_NETMAN0] & NETMAN_LINK) + cmr |= CMR_LINK; + if (eeprom_image[EEPROM_MISC0] & _0WS_ENA) + cmr |= CMR_0WS; + } + if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM) + cmr |= CMR_DRAM; + outb(cmr, EWRK3_CMR); + + cr = inb(EWRK3_CR); /* Set up the Control Register */ + cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD; + if (cr & SETUP_APD) + cr |= eeprom_image[EEPROM_SETUP] & SETUP_PS; + cr |= eeprom_image[EEPROM_MISC0] & FAST_BUS; + cr |= eeprom_image[EEPROM_MISC0] & ENA_16; + outb(cr, EWRK3_CR); - /* - ** Determine the base address and window length for the EWRK3 - ** RAM from the memory base register. - */ - mem_start = inb(EWRK3_MBR); - shmem_length = 0; - if (mem_start != 0) { - if ((mem_start >= 0x0a) && (mem_start <= 0x0f)) { - mem_start *= SHMEM_64K; - shmem_length = SHMEM_64K; - } else if ((mem_start >= 0x14) && (mem_start <= 0x1f)) { - mem_start *= SHMEM_32K; - shmem_length = SHMEM_32K; - } else if ((mem_start >= 0x40) && (mem_start <= 0xff)) { - mem_start = mem_start * SHMEM_2K + 0x80000; - shmem_length = SHMEM_2K; - } else { - status = -ENXIO; - } - } - /* - ** See the top of this source code for comments about - ** uncommenting this line. - */ + /* + ** Determine the base address and window length for the EWRK3 + ** RAM from the memory base register. + */ + mem_start = inb(EWRK3_MBR); + shmem_length = 0; + if (mem_start != 0) { + if ((mem_start >= 0x0a) && (mem_start <= 0x0f)) { + mem_start *= SHMEM_64K; + shmem_length = SHMEM_64K; + } else if ((mem_start >= 0x14) && (mem_start <= 0x1f)) { + mem_start *= SHMEM_32K; + shmem_length = SHMEM_32K; + } else if ((mem_start >= 0x40) && (mem_start <= 0xff)) { + mem_start = mem_start * SHMEM_2K + 0x80000; + shmem_length = SHMEM_2K; + } else { + return -ENXIO; + } + } + /* + ** See the top of this source code for comments about + ** uncommenting this line. + */ /* FORCE_2K_MODE; */ + + if (hard_strapped) { + printk(" is hard strapped.\n"); + } else if (mem_start) { + printk(" has a %dk RAM window", (int) (shmem_length >> 10)); + printk(" at 0x%.5lx", mem_start); + } else { + printk(" is in I/O only mode"); + } - if (!status) { - if (hard_strapped) { - printk(" is hard strapped.\n"); - } else if (mem_start) { - printk(" has a %dk RAM window", (int) (shmem_length >> 10)); - printk(" at 0x%.5lx", mem_start); - } else { - printk(" is in I/O only mode"); - } - - /* private area & initialise */ - dev->priv = (void *) kmalloc(sizeof(struct ewrk3_private), - GFP_KERNEL); - if (dev->priv == NULL) { - return -ENOMEM; - } - lp = (struct ewrk3_private *) dev->priv; - memset(dev->priv, 0, sizeof(struct ewrk3_private)); - lp->shmem_base = mem_start; - lp->shmem_length = shmem_length; - lp->lemac = lemac; - lp->hard_strapped = hard_strapped; - lp->led_mask = CR_LED; - spin_lock_init(&lp->hw_lock); - - lp->mPage = 64; - if (cmr & CMR_DRAM) - lp->mPage <<= 1; /* 2 DRAMS on module */ - - sprintf(lp->adapter_name, "%s (%s)", name, dev->name); - request_region(iobase, EWRK3_TOTAL_SIZE, lp->adapter_name); - - lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM; - - if (!hard_strapped) { - /* - ** Enable EWRK3 board interrupts for autoprobing - */ - icr |= ICR_IE; /* Enable interrupts */ - outb(icr, EWRK3_ICR); - - /* The DMA channel may be passed in on this parameter. */ - dev->dma = 0; - - /* To auto-IRQ we enable the initialization-done and DMA err, - interrupts. For now we will always get a DMA error. */ - if (dev->irq < 2) { + lp = (struct ewrk3_private *) dev->priv; + lp->shmem_base = mem_start; + lp->shmem_length = shmem_length; + lp->lemac = lemac; + lp->hard_strapped = hard_strapped; + lp->led_mask = CR_LED; + spin_lock_init(&lp->hw_lock); + + lp->mPage = 64; + if (cmr & CMR_DRAM) + lp->mPage <<= 1; /* 2 DRAMS on module */ + + sprintf(lp->adapter_name, "%s (%s)", name, dev->name); + + lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM; + + if (!hard_strapped) { + /* + ** Enable EWRK3 board interrupts for autoprobing + */ + icr |= ICR_IE; /* Enable interrupts */ + outb(icr, EWRK3_ICR); + + /* The DMA channel may be passed in on this parameter. */ + dev->dma = 0; + + /* To auto-IRQ we enable the initialization-done and DMA err, + interrupts. For now we will always get a DMA error. */ + if (dev->irq < 2) { #ifndef MODULE - u_char irqnum; - unsigned long irq_mask; + u_char irqnum; + unsigned long irq_mask; - irq_mask = probe_irq_on(); - - /* - ** Trigger a TNE interrupt. - */ - icr |= ICR_TNEM; - outb(1, EWRK3_TDQ); /* Write to the TX done queue */ - outb(icr, EWRK3_ICR); /* Unmask the TXD interrupt */ - - irqnum = irq[((icr & IRQ_SEL) >> 4)]; - - mdelay(20); - dev->irq = probe_irq_off(irq_mask); - if ((dev->irq) && (irqnum == dev->irq)) { - printk(" and uses IRQ%d.\n", dev->irq); - } else { - if (!dev->irq) { - printk(" and failed to detect IRQ line.\n"); - } else if ((irqnum == 1) && (lemac == LeMAC2)) { - printk(" and an illegal IRQ line detected.\n"); - } else { - printk(", but incorrect IRQ line detected.\n"); - } - status = -ENXIO; - } - - DISABLE_IRQs; /* Mask all interrupts */ - -#endif /* MODULE */ - } else { - printk(" and requires IRQ%d.\n", dev->irq); - } - } - if (status) - release_region(iobase, EWRK3_TOTAL_SIZE); - } else { - status = -ENXIO; - } - } - } + irq_mask = probe_irq_on(); + + /* + ** Trigger a TNE interrupt. + */ + icr |= ICR_TNEM; + outb(1, EWRK3_TDQ); /* Write to the TX done queue */ + outb(icr, EWRK3_ICR); /* Unmask the TXD interrupt */ + + irqnum = irq[((icr & IRQ_SEL) >> 4)]; + + mdelay(20); + dev->irq = probe_irq_off(irq_mask); + if ((dev->irq) && (irqnum == dev->irq)) { + printk(" and uses IRQ%d.\n", dev->irq); } else { - status = -ENXIO; - } - } - - if (!status) { - if (ewrk3_debug > 1) { - printk(version); + if (!dev->irq) { + printk(" and failed to detect IRQ line.\n"); + } else if ((irqnum == 1) && (lemac == LeMAC2)) { + printk(" and an illegal IRQ line detected.\n"); + } else { + printk(", but incorrect IRQ line detected.\n"); + } + return -ENXIO; } - /* The EWRK3-specific entries in the device structure. */ - dev->open = ewrk3_open; - dev->hard_start_xmit = ewrk3_queue_pkt; - dev->stop = ewrk3_close; - dev->get_stats = ewrk3_get_stats; - dev->set_multicast_list = set_multicast_list; - dev->do_ioctl = ewrk3_ioctl; - dev->tx_timeout = ewrk3_timeout; - dev->watchdog_timeo = QUEUE_PKT_TIMEOUT; - dev->mem_start = 0; + DISABLE_IRQs; /* Mask all interrupts */ - /* Fill in the generic field of the device structure. */ - ether_setup(dev); +#endif /* MODULE */ + } else { + printk(" and requires IRQ%d.\n", dev->irq); } - } else { - status = -ENXIO; } - return status; + + if (ewrk3_debug > 1) { + printk(version); + } + /* The EWRK3-specific entries in the device structure. */ + dev->open = ewrk3_open; + dev->hard_start_xmit = ewrk3_queue_pkt; + dev->stop = ewrk3_close; + dev->get_stats = ewrk3_get_stats; + dev->set_multicast_list = set_multicast_list; + dev->do_ioctl = ewrk3_ioctl; + dev->tx_timeout = ewrk3_timeout; + dev->watchdog_timeo = QUEUE_PKT_TIMEOUT; + + dev->mem_start = 0; + + return 0; } @@ -1269,15 +1248,15 @@ /* ** ISA bus I/O device probe */ -static void __init isa_probe(struct net_device *dev, u_long ioaddr) +static int __init isa_probe(struct net_device *dev, u_long ioaddr) { - int i = num_ewrk3s, maxSlots; + int i = num_ewrks3s, maxSlots; + int ret = -ENODEV; + u_long iobase; - if (!ioaddr && autoprobed) - return; /* Been here before ! */ if (ioaddr >= 0x400) - return; /* Not ISA */ + goto out; if (ioaddr == 0) { /* Autoprobing */ iobase = EWRK3_IO_BASE; /* Get the first slot address */ @@ -1287,38 +1266,37 @@ maxSlots = i + 1; } - for (; (i < maxSlots) && (dev != NULL); iobase += EWRK3_IOP_INC, i++) { - if (!check_region(iobase, EWRK3_TOTAL_SIZE)) { + for (; (i < maxSlots) && (dev != NULL); + iobase += EWRK3_IOP_INC, i++) + { + if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name)) { if (DevicePresent(iobase) == 0) { - if ((dev = alloc_device(dev, iobase)) != NULL) { - if (ewrk3_hw_init(dev, iobase) == 0) { - num_ewrk3s++; - } - num_eth++; - } + int irq = dev->irq; + ret = ewrk3_hw_init(dev, iobase); + if (!ret) + break; + dev->irq = irq; } - } else if (autoprobed) { - printk("%s: region already allocated at 0x%04lx.\n", dev->name, iobase); + release_region(iobase, EWRK3_TOTAL_SIZE); } } + out: - return; + return ret; } /* ** EISA bus I/O device probe. Probe from slot 1 since slot 0 is usually ** the motherboard. */ -static void __init eisa_probe(struct net_device *dev, u_long ioaddr) +static int __init eisa_probe(struct net_device *dev, u_long ioaddr) { int i, maxSlots; u_long iobase; - char name[EWRK3_STRLEN]; + int ret = -ENODEV; - if (!ioaddr && autoprobed) - return; /* Been here before ! */ if (ioaddr < 0x1000) - return; /* Not EISA */ + goto out; if (ioaddr == 0) { /* Autoprobing */ iobase = EISA_SLOT_INC; /* Get the first slot address */ @@ -1332,114 +1310,22 @@ for (i = 1; (i < maxSlots) && (dev != NULL); i++, iobase += EISA_SLOT_INC) { if (EISA_signature(name, EISA_ID) == 0) { - if (!check_region(iobase, EWRK3_TOTAL_SIZE)) { - if (DevicePresent(iobase) == 0) { - if ((dev = alloc_device(dev, iobase)) != NULL) { - if (ewrk3_hw_init(dev, iobase) == 0) { - num_ewrk3s++; - } - num_eth++; - } - } - } else if (autoprobed) { - printk("%s: region already allocated at 0x%04lx.\n", dev->name, iobase); + if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name) && + DevicePresent(iobase) == 0) { + int irq = dev->irq; + ret = ewrk3_hw_init(dev, iobase); + if (!ret) + break; + dev->irq = irq; } + release_region(iobase, EWRK3_TOTAL_SIZE); } } - return; + out: + return ret; } -/* - ** Search the entire 'eth' device list for a fixed probe. If a match isn't - ** found then check for an autoprobe or unused device location. If they - ** are not available then insert a new device structure at the end of - ** the current list. - */ -static struct net_device * __init alloc_device(struct net_device *dev, u_long iobase) -{ - struct net_device *adev = NULL; - int fixed = 0, new_dev = 0; - - num_eth = ewrk3_dev_index(dev->name); - if (loading_module) - return dev; - - while (1) { - if (((dev->base_addr == EWRK3_NDA) || (dev->base_addr == 0)) && !adev) { - adev = dev; - } else if ((dev->priv == NULL) && (dev->base_addr == iobase)) { - fixed = 1; - } else { - if (dev->next == NULL) { - new_dev = 1; - } else if (strncmp(dev->next->name, "eth", 3) != 0) { - new_dev = 1; - } - } - if ((dev->next == NULL) || new_dev || fixed) - break; - dev = dev->next; - num_eth++; - } - if (adev && !fixed) { - dev = adev; - num_eth = ewrk3_dev_index(dev->name); - new_dev = 0; - } - if (((dev->next == NULL) && - ((dev->base_addr != EWRK3_NDA) && (dev->base_addr != 0)) && !fixed) || - new_dev) { - num_eth++; /* New device */ - dev = insert_device(dev, iobase, ewrk3_probe); - } - return dev; -} - -/* - ** If at end of eth device list and can't use current entry, malloc - ** one up. If memory could not be allocated, print an error message. - */ -static struct net_device * __init -insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *)) -{ - struct net_device *new; - - new = (struct net_device *) kmalloc(sizeof(struct net_device) + 8, GFP_KERNEL); - if (new == NULL) { - printk("eth%d: Device not initialised, insufficient memory\n", num_eth); - return NULL; - } else { - new->next = dev->next; - dev->next = new; - dev = dev->next; /* point to the new device */ - if (num_eth > 9999) { - sprintf(dev->name, "eth????"); /* New device name */ - } else { - sprintf(dev->name, "eth%d", num_eth); /* New device name */ - } - dev->base_addr = iobase; /* assign the io address */ - dev->init = init; /* initialisation routine */ - } - - return dev; -} - -static int __init -ewrk3_dev_index(char *s) -{ - int i = 0, j = 0; - - for (; *s; s++) { - if (isdigit(*s)) { - j = 1; - i = (i * 10) + (*s - '0'); - } else if (j) - break; - } - - return i; -} /* ** Read the EWRK3 EEPROM using this routine @@ -2074,8 +1960,7 @@ #ifdef MODULE static struct net_device *ewrk3_devs[MAX_NUM_EWRK3S]; static int ndevs; -static int io[MAX_NUM_EWRK3S+1] = { 0x300, 0, }; /* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */ -static int irq[MAX_NUM_EWRK3S+1] = { 5, 0, }; /* or use the insmod io= irq= options */ +static int io[MAX_NUM_EWRK3S+1] = { 0x300, 0, }; /* '21' below should really be 'MAX_NUM_EWRK3S' */ MODULE_PARM(io, "0-21i"); @@ -2083,50 +1968,39 @@ MODULE_PARM_DESC(io, "EtherWORKS 3 I/O base address(es)"); MODULE_PARM_DESC(irq, "EtherWORKS 3 IRQ number(s)"); -static void ewrk3_exit_module(void) +static __exit void ewrk3_exit_module(void) { int i; for( i=0; ipriv) { - kfree(ewrk3_devs[i]->priv); - ewrk3_devs[i]->priv = NULL; - } - ewrk3_devs[i]->irq = 0; - release_region(ewrk3_devs[i]->base_addr, EWRK3_TOTAL_SIZE); free_netdev(ewrk3_devs[i]); ewrk3_devs[i] = NULL; } } -static int ewrk3_init_module(void) +static __init int ewrk3_init_module(void) { int i=0; while( io[i] && irq[i] ) { - ewrk3_devs[ndevs] = kmalloc(sizeof(struct net_device), GFP_KERNEL); - if (!ewrk3_devs[ndevs]) - goto error; - memset(ewrk3_devs[ndevs], 0, sizeof(struct net_device)); - ewrk3_devs[ndevs]->base_addr = io[i]; - ewrk3_devs[ndevs]->irq = irq[i]; - ewrk3_devs[ndevs]->init = ewrk3_probe; - - if (register_netdev(ewrk3_devs[ndevs]) == 0) - ndevs++; - else - kfree(ewrk3_devs[ndevs]); + struct net_device *dev + = alloc_etherdev(sizeof(struct ewrk3_private)); + + if (!dev) + break; + if (ewrk3_probe1(dev, io[i], irq[i]) != 0) { + free_netdev(dev); + break; + } + + ewrk3_devs[ndevs++] = dev; i++; } return ndevs ? 0 : -EIO; - -error: - ewrk3_exit_module(); - return -ENOMEM; } From shemminger@osdl.org Wed Nov 12 16:40:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:40:58 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ei25019885 for ; Wed, 12 Nov 2003 16:40:45 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0ecG29903; Wed, 12 Nov 2003 16:40:38 -0800 Date: Wed, 12 Nov 2003 16:40:38 -0800 From: Stephen Hemminger Message-Id: <200311130040.hAD0ecG29903@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (2/42) eepro Cc: netdev@oss.sgi.com X-archive-position: 1375 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 11442 Lines: 413 Patch from viro: NE26-eepro * switched eepro to dynamic allocation * eepro: embedded ->priv * eepro: fixed clobbering on autoprobe * eepro: fixed IO before request_region() * eepro: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:24 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:24 2003 @@ -50,7 +50,7 @@ extern int hp_probe(struct net_device *dev); extern int hp_plus_probe(struct net_device *dev); extern int express_probe(struct net_device *); -extern int eepro_probe(struct net_device *); +extern struct net_device *eepro_probe(int unit); extern int at1500_probe(struct net_device *); extern int at1700_probe(struct net_device *); extern int fmv18x_probe(struct net_device *); @@ -253,13 +253,13 @@ #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ {express_probe, 0}, #endif -#ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ - {eepro_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ + {eepro_probe, 0}, +#endif #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ {ewrk3_probe, 0}, #endif diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c --- a/drivers/net/eepro.c Tue Nov 11 09:35:24 2003 +++ b/drivers/net/eepro.c Tue Nov 11 09:35:24 2003 @@ -302,9 +302,7 @@ /* Index to functions, as function prototypes. */ -extern int eepro_probe(struct net_device *dev); - -static int eepro_probe1(struct net_device *dev, short ioaddr); +static int eepro_probe1(struct net_device *dev, int autoprobe); static int eepro_open(struct net_device *dev); static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev); static irqreturn_t eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -527,10 +525,11 @@ If dev->base_addr == 2, allocate space for the device and return success (detachable devices only). */ -int __init eepro_probe(struct net_device *dev) +static int __init do_eepro_probe(struct net_device *dev) { int i; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -563,24 +562,48 @@ #endif if (base_addr > 0x1ff) /* Check a single specified location. */ - return eepro_probe1(dev, base_addr); + return eepro_probe1(dev, 0); else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; - for (i = 0; eepro_portlist[i]; i++) { - int ioaddr = eepro_portlist[i]; - - if (check_region(ioaddr, EEPRO_IO_EXTENT)) - continue; - if (eepro_probe1(dev, ioaddr) == 0) + dev->base_addr = eepro_portlist[i]; + dev->irq = irq; + if (eepro_probe1(dev, 1) == 0) return 0; } return -ENODEV; } +struct net_device * __init eepro_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct eepro_local)); + int err; + + if (!dev) + return ERR_PTR(-ENODEV); + + SET_MODULE_OWNER(dev); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = do_eepro_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, EEPRO_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) { unsigned short Word; @@ -713,83 +736,75 @@ probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */ -static int __init eepro_probe1(struct net_device *dev, short ioaddr) +static int __init eepro_probe1(struct net_device *dev, int autoprobe) { unsigned short station_addr[6], id, counter; - int i, j, irqMask, retval = 0; + int i; struct eepro_local *lp; enum iftype { AUI=0, BNC=1, TPE=2 }; + int ioaddr = dev->base_addr; + + /* Grab the region so we can find another board if autoIRQ fails. */ + if (!request_region(ioaddr, EEPRO_IO_EXTENT, dev->name)) { + if (!autoprobe) + printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", + ioaddr); + return -EBUSY; + } /* Now, we are going to check for the signature of the ID_REG (register 2 of bank 0) */ - id=inb(ioaddr + ID_REG); + id = inb(ioaddr + ID_REG); - if (((id) & ID_REG_MASK) != ID_REG_SIG) { - retval = -ENODEV; + if ((id & ID_REG_MASK) != ID_REG_SIG) goto exit; - } - /* We seem to have the 82595 signature, let's - play with its counter (last 2 bits of - register 2 of bank 0) to be sure. */ + /* We seem to have the 82595 signature, let's + play with its counter (last 2 bits of + register 2 of bank 0) to be sure. */ - counter = (id & R_ROBIN_BITS); - - if (((id=inb(ioaddr+ID_REG)) & R_ROBIN_BITS)!=(counter + 0x40)) { - retval = -ENODEV; - goto exit; - } + counter = id & R_ROBIN_BITS; - /* Initialize the device structure */ - dev->priv = kmalloc(sizeof(struct eepro_local), GFP_KERNEL); - if (!dev->priv) { - retval = -ENOMEM; + if ((inb(ioaddr + ID_REG) & R_ROBIN_BITS) != (counter + 0x40)) goto exit; - } - - memset(dev->priv, 0, sizeof(struct eepro_local)); - - lp = (struct eepro_local *)dev->priv; - /* default values */ - lp->eepro = 0; + lp = (struct eepro_local *)dev->priv; + memset(lp, 0, sizeof(struct eepro_local)); lp->xmt_bar = XMT_BAR_PRO; lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_PRO; lp->xmt_upper_limit_reg = XMT_UPPER_LIMIT_REG_PRO; lp->eeprom_reg = EEPROM_REG_PRO; + spin_lock_init(&lp->lock); - /* Now, get the ethernet hardware address from - the EEPROM */ - station_addr[0] = read_eeprom(ioaddr, 2, dev); - - /* FIXME - find another way to know that we've found - * an Etherexpress 10 - */ - if (station_addr[0] == 0x0000 || - station_addr[0] == 0xffff) { - lp->eepro = LAN595FX_10ISA; + /* Now, get the ethernet hardware address from + the EEPROM */ + station_addr[0] = read_eeprom(ioaddr, 2, dev); + + /* FIXME - find another way to know that we've found + * an Etherexpress 10 + */ + if (station_addr[0] == 0x0000 || station_addr[0] == 0xffff) { + lp->eepro = LAN595FX_10ISA; lp->eeprom_reg = EEPROM_REG_10; lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_10; lp->xmt_upper_limit_reg = XMT_UPPER_LIMIT_REG_10; lp->xmt_bar = XMT_BAR_10; - station_addr[0] = read_eeprom(ioaddr, 2, dev); - } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + station_addr[0] = read_eeprom(ioaddr, 2, dev); + } + station_addr[1] = read_eeprom(ioaddr, 3, dev); + station_addr[2] = read_eeprom(ioaddr, 4, dev); if (!lp->eepro) { if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; - } - - /* Fill in the 'dev' fields. */ - dev->base_addr = ioaddr; + } + /* Fill in the 'dev' fields. */ for (i=0; i < 6; i++) - dev->dev_addr[i] = ((unsigned char *) station_addr)[5-i]; + dev->dev_addr[i] = ((unsigned char *) station_addr)[5-i]; /* RX buffer must be more than 3K and less than 29K */ if (dev->mem_end < 3072 || dev->mem_end > 29696) @@ -798,65 +813,49 @@ /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) - dev->if_port = BNC; + if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + dev->if_port = BNC; else dev->if_port = TPE; - if ((dev->irq < 2) && (lp->eepro!=0)) { - i = read_eeprom(ioaddr, 1, dev); - irqMask = read_eeprom(ioaddr, 7, dev); - i &= 0x07; /* Mask off INT number */ - - for (j=0; ((j<16) && (i>=0)); j++) { - if ((irqMask & (1<irq = j; - break; /* found bit corresponding to irq */ - } - i--; /* count bits set in irqMask */ - } - } - if (dev->irq < 2) { - printk(KERN_ERR " Duh! invalid interrupt vector stored in EEPROM.\n"); - retval = -ENODEV; - goto freeall; - } else - if (dev->irq==2) dev->irq = 9; - } - - /* Grab the region so we can find another board if autoIRQ fails. */ - if (!request_region(ioaddr, EEPRO_IO_EXTENT, dev->name)) { - printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", ioaddr); - goto freeall; - } - ((struct eepro_local *)dev->priv)->lock = SPIN_LOCK_UNLOCKED; - - dev->open = eepro_open; - dev->stop = eepro_close; - dev->hard_start_xmit = eepro_send_packet; - dev->get_stats = eepro_get_stats; - dev->set_multicast_list = &set_multicast_list; - dev->tx_timeout = eepro_tx_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - - /* Fill in the fields of the device structure with - ethernet generic values */ - ether_setup(dev); - + if (dev->irq < 2 && lp->eepro != 0) { + /* Mask off INT number */ + int count = read_eeprom(ioaddr, 1, dev) & 7; + unsigned irqMask = read_eeprom(ioaddr, 7, dev); + + while (count--) + irqMask &= irqMask - 1; + + count = ffs(irqMask); + + if (count) + dev->irq = count - 1; + + if (dev->irq < 2) { + printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n"); + goto exit; + } else if (dev->irq == 2) { + dev->irq = 9; + } + } + + dev->open = eepro_open; + dev->stop = eepro_close; + dev->hard_start_xmit = eepro_send_packet; + dev->get_stats = eepro_get_stats; + dev->set_multicast_list = &set_multicast_list; + dev->tx_timeout = eepro_tx_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + /* print boot time info */ eepro_print_info(dev); /* reset 82595 */ - eepro_reset(ioaddr); - + eepro_reset(ioaddr); + return 0; exit: - return retval; -freeall: - kfree(dev->priv); - goto exit; - + release_region(dev->base_addr, EEPRO_IO_EXTENT); + return -ENODEV; } /* Open/initialize the board. This is called (in the current kernel) @@ -1701,7 +1700,7 @@ #ifdef MODULE #define MAX_EEPRO 8 -static struct net_device dev_eepro[MAX_EEPRO]; +static struct net_device *dev_eepro[MAX_EEPRO]; static int io[MAX_EEPRO]; static int irq[MAX_EEPRO]; @@ -1729,6 +1728,7 @@ int init_module(void) { + struct net_device *dev; int i; if (io[0] == 0 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); @@ -1743,17 +1743,24 @@ } for (i = 0; i < MAX_EEPRO; i++) { - struct net_device *d = &dev_eepro[n_eepro]; - d->mem_end = mem[i]; - d->base_addr = io[i]; - d->irq = irq[i]; - d->init = eepro_probe; - - if (register_netdev(d) == 0) - n_eepro++; - else - break; + dev = alloc_etherdev(sizeof(struct eepro_local)); + if (!dev) + break; + + dev->mem_end = mem[i]; + dev->base_addr = io[i]; + dev->irq = irq[i]; + + if (do_eepro_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_eepro[n_eepro++] = dev; + continue; + } + release_region(dev->base_addr, EEPRO_IO_EXTENT); } + free_netdev(dev); + break; + } if (n_eepro) printk(KERN_INFO "%s", version); @@ -1767,15 +1774,10 @@ int i; for (i=0; ipriv); - d->priv=NULL; - - /* If we don't do this, we can't re-insmod it later. */ - release_region(d->base_addr, EEPRO_IO_EXTENT); - + struct net_device *dev = dev_eepro[i]; + unregister_netdev(dev); + release_region(dev->base_addr, EEPRO_IO_EXTENT); + free_netdev(dev); } } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:41:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:41:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0f225020077 for ; Wed, 12 Nov 2003 16:41:02 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0em429916; Wed, 12 Nov 2003 16:40:48 -0800 Date: Wed, 12 Nov 2003 16:40:48 -0800 From: Stephen Hemminger Message-Id: <200311130040.hAD0em429916@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (3/42) eexpress Cc: netdev@oss.sgi.com X-archive-position: 1376 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6298 Lines: 238 Based on viro NE27-eexpress * switched eexpress to dynamic allocation * eexpress: embedded ->priv * eexpress: fixed clobbering on autoprobe * eexpress: fixed IO without request_region() * eexpress: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:27 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:27 2003 @@ -49,7 +49,7 @@ extern int ne_probe(struct net_device *dev); extern int hp_probe(struct net_device *dev); extern int hp_plus_probe(struct net_device *dev); -extern int express_probe(struct net_device *); +extern struct net_device *express_probe(int unit); extern struct net_device *eepro_probe(int unit); extern int at1500_probe(struct net_device *); extern int at1700_probe(struct net_device *); @@ -250,13 +250,13 @@ #ifdef CONFIG_ETH16I {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */ #endif -#ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ - {express_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ + {express_probe, 0}, +#endif #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ {eepro_probe, 0}, #endif diff -Nru a/drivers/net/eexpress.c b/drivers/net/eexpress.c --- a/drivers/net/eexpress.c Tue Nov 11 09:35:27 2003 +++ b/drivers/net/eexpress.c Tue Nov 11 09:35:27 2003 @@ -244,7 +244,6 @@ * Prototypes for Linux interface */ -extern int express_probe(struct net_device *dev); static int eexp_open(struct net_device *dev); static int eexp_close(struct net_device *dev); static void eexp_timeout(struct net_device *dev); @@ -334,11 +333,13 @@ * checks for presence of EtherExpress card */ -int __init express_probe(struct net_device *dev) +static int __init do_express_probe(struct net_device *dev) { unsigned short *port; static unsigned short ports[] = { 0x240,0x300,0x310,0x270,0x320,0x340,0 }; unsigned short ioaddr = dev->base_addr; + int dev_irq = dev->irq; + int err; SET_MODULE_OWNER(dev); @@ -391,27 +392,58 @@ } } #endif - if (ioaddr&0xfe00) - return eexp_hw_probe(dev,ioaddr); - else if (ioaddr) + if (ioaddr&0xfe00) { + if (!request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress")) + return -EBUSY; + err = eexp_hw_probe(dev,ioaddr); + release_region(ioaddr, EEXP_IO_EXTENT); + return err; + } else if (ioaddr) return -ENXIO; for (port=&ports[0] ; *port ; port++ ) { unsigned short sum = 0; int i; + if (!request_region(*port, EEXP_IO_EXTENT, "EtherExpress")) + continue; for ( i=0 ; i<4 ; i++ ) { unsigned short t; t = inb(*port + ID_PORT); sum |= (t>>4) << ((t & 0x03)<<2); } - if (sum==0xbaba && !eexp_hw_probe(dev,*port)) + if (sum==0xbaba && !eexp_hw_probe(dev,*port)) { + release_region(*port, EEXP_IO_EXTENT); return 0; + } + release_region(*port, EEXP_IO_EXTENT); + dev->irq = dev_irq; } return -ENODEV; } +struct net_device * __init express_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = do_express_probe(dev); + if (!err) { + err = register_netdev(dev); + if (!err) + return dev; + } + free_netdev(dev); + return ERR_PTR(err); +} + /* * open and initialize the adapter, ready for use */ @@ -1058,7 +1090,7 @@ unsigned int memory_size; int i; unsigned short xsum = 0; - struct net_local *lp; + struct net_local *lp = dev->priv; printk("%s: EtherExpress 16 at %#x ",dev->name,ioaddr); @@ -1108,17 +1140,18 @@ buswidth = !((setupval & 0x400) >> 10); } - dev->priv = lp = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (!dev->priv) - return -ENOMEM; - - memset(dev->priv, 0, sizeof(struct net_local)); + memset(lp, 0, sizeof(struct net_local)); spin_lock_init(&lp->lock); printk("(IRQ %d, %s connector, %d-bit bus", dev->irq, eexp_ifmap[dev->if_port], buswidth?8:16); + if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress")) + return -EBUSY; + eexp_hw_set_interface(dev); + + release_region(dev->base_addr + 0x300e, 1); /* Find out how much RAM we have on the card */ outw(0, dev->base_addr + WRITE_PTR); @@ -1156,7 +1189,6 @@ break; default: printk(") bad memory size (%dk).\n", memory_size); - kfree(dev->priv); return -ENODEV; break; } @@ -1171,7 +1203,6 @@ dev->set_multicast_list = &eexp_set_multicast; dev->tx_timeout = eexp_timeout; dev->watchdog_timeo = 2*HZ; - ether_setup(dev); return 0; } @@ -1654,7 +1685,7 @@ #define EEXP_MAX_CARDS 4 /* max number of cards to support */ -static struct net_device dev_eexp[EEXP_MAX_CARDS]; +static struct net_device *dev_eexp[EEXP_MAX_CARDS]; static int irq[EEXP_MAX_CARDS]; static int io[EEXP_MAX_CARDS]; @@ -1671,25 +1702,30 @@ */ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < EEXP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_eexp[this_dev]; + dev = alloc_etherdev(sizeof(struct net_local)); dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; - dev->init = express_probe; if (io[this_dev] == 0) { - if (this_dev) break; + if (this_dev) + break; printk(KERN_NOTICE "eexpress.c: Module autoprobe not recommended, give io=xx.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "eexpress.c: Failed to register card at 0x%x.\n", io[this_dev]); - if (found != 0) return 0; - return -ENXIO; + if (do_express_probe(dev) == 0 && register_netdev(dev) == 0) { + dev_eexp[this_dev] = dev; + found++; + continue; } - found++; + printk(KERN_WARNING "eexpress.c: Failed to register card at 0x%x.\n", io[this_dev]); + free_netdev(dev); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void cleanup_module(void) @@ -1697,11 +1733,10 @@ int this_dev; for (this_dev = 0; this_dev < EEXP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_eexp[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_eexp[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:41:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:41:18 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0f425020119 for ; Wed, 12 Nov 2003 16:41:04 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0ew229935; Wed, 12 Nov 2003 16:40:58 -0800 Date: Wed, 12 Nov 2003 16:40:58 -0800 From: Stephen Hemminger Message-Id: <200311130040.hAD0ew229935@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (4/42) eth16i Cc: netdev@oss.sgi.com X-archive-position: 1377 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 7342 Lines: 269 NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:29 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:29 2003 @@ -54,7 +54,7 @@ extern int at1500_probe(struct net_device *); extern int at1700_probe(struct net_device *); extern int fmv18x_probe(struct net_device *); -extern int eth16i_probe(struct net_device *); +extern struct net_device *eth16i_probe(int unit); extern struct net_device *i82596_probe(int unit); extern struct net_device *ewrk3_probe(int unit); extern struct net_device *el1_probe(int unit); @@ -247,13 +247,13 @@ #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ {fmv18x_probe, 0}, #endif -#ifdef CONFIG_ETH16I - {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */ -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ETH16I + {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */ +#endif #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ {express_probe, 0}, #endif diff -Nru a/drivers/net/eth16i.c b/drivers/net/eth16i.c --- a/drivers/net/eth16i.c Tue Nov 11 09:35:29 2003 +++ b/drivers/net/eth16i.c Tue Nov 11 09:35:29 2003 @@ -369,7 +369,6 @@ #define NUM_OF_EISA_IRQS 8 static unsigned int eth16i_tx_buf_map[] = { 2048, 2048, 4096, 8192 }; -static unsigned int boot = 1; /* Use 0 for production, 1 for verification, >2 for debug */ #ifndef ETH16I_DEBUG @@ -395,8 +394,6 @@ /* Function prototypes */ -extern int eth16i_probe(struct net_device *dev); - static int eth16i_probe1(struct net_device *dev, int ioaddr); static int eth16i_check_signature(int ioaddr); static int eth16i_probe_port(int ioaddr); @@ -418,7 +415,7 @@ static void eth16i_skip_packet(struct net_device *dev); static void eth16i_multicast(struct net_device *dev); static void eth16i_select_regbank(unsigned char regbank, int ioaddr); -static void eth16i_initialize(struct net_device *dev); +static void eth16i_initialize(struct net_device *dev, int boot); #if 0 static int eth16i_set_irq(struct net_device *dev); @@ -432,7 +429,7 @@ static char cardname[] __initdata = "ICL EtherTeam 16i/32"; -int __init eth16i_probe(struct net_device *dev) +static int __init do_eth16i_probe(struct net_device *dev) { int i; int ioaddr; @@ -461,14 +458,38 @@ return -ENODEV; } +struct net_device * __init eth16i_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct eth16i_local)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = do_eth16i_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, ETH16I_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init eth16i_probe1(struct net_device *dev, int ioaddr) { - struct eth16i_local *lp; + struct eth16i_local *lp = dev->priv; static unsigned version_printed; int retval; - boot = 1; /* To inform initilization that we are in boot probe */ - /* Let's grab the region */ if (!request_region(ioaddr, ETH16I_IO_EXTENT, dev->name)) return -EBUSY; @@ -531,22 +552,13 @@ eth16i_select_regbank(TRANSCEIVER_MODE_RB, ioaddr); outb(0x38, ioaddr + TRANSCEIVER_MODE_REG); - eth16i_initialize(dev); /* Initialize rest of the chip's registers */ + eth16i_initialize(dev, 1); /* Initialize rest of the chip's registers */ /* Now let's same some energy by shutting down the chip ;) */ BITCLR(ioaddr + CONFIG_REG_1, POWERUP); /* Initialize the device structure */ - if(dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct eth16i_local), GFP_KERNEL); - if(dev->priv == NULL) { - free_irq(dev->irq, dev); - retval = -ENOMEM; - goto out; - } - } - - memset(dev->priv, 0, sizeof(struct eth16i_local)); + memset(lp, 0, sizeof(struct eth16i_local)); dev->open = eth16i_open; dev->stop = eth16i_close; dev->hard_start_xmit = eth16i_tx; @@ -554,15 +566,7 @@ dev->set_multicast_list = eth16i_multicast; dev->tx_timeout = eth16i_timeout; dev->watchdog_timeo = TX_TIMEOUT; - - lp = (struct eth16i_local *)dev->priv; spin_lock_init(&lp->lock); - - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - - boot = 0; - return 0; out: release_region(ioaddr, ETH16I_IO_EXTENT); @@ -570,7 +574,7 @@ } -static void eth16i_initialize(struct net_device *dev) +static void eth16i_initialize(struct net_device *dev, int boot) { int ioaddr = dev->base_addr; int i, node_w = 0; @@ -953,7 +957,7 @@ outb(0xc0 | POWERUP, ioaddr + CONFIG_REG_1); /* Initialize the chip */ - eth16i_initialize(dev); + eth16i_initialize(dev, 0); /* Set the transmit buffer size */ lp->tx_buf_size = eth16i_tx_buf_map[ETH16I_TX_BUF_SIZE & 0x03]; @@ -1401,7 +1405,7 @@ #define MAX_ETH16I_CARDS 4 /* Max number of Eth16i cards per module */ -static struct net_device dev_eth16i[MAX_ETH16I_CARDS]; +static struct net_device *dev_eth16i[MAX_ETH16I_CARDS]; static int io[MAX_ETH16I_CARDS]; #if 0 static int irq[MAX_ETH16I_CARDS]; @@ -1431,14 +1435,14 @@ int init_module(void) { int this_dev, found = 0; + struct net_device *dev; + + for (this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) { + dev = alloc_etherdev(sizeof(struct eth16i_local)); + if (!dev) + break; - for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) - { - struct net_device *dev = &dev_eth16i[this_dev]; - - dev->irq = 0; /* irq[this_dev]; */ dev->base_addr = io[this_dev]; - dev->init = eth16i_probe; if(debug != -1) eth16i_debug = debug; @@ -1448,44 +1452,43 @@ dev->if_port = eth16i_parse_mediatype(mediatype[this_dev]); - if(io[this_dev] == 0) - { - if(this_dev != 0) break; /* Only autoprobe 1st one */ + if(io[this_dev] == 0) { + if(this_dev != 0) /* Only autoprobe 1st one */ + break; printk(KERN_NOTICE "eth16i.c: Presently autoprobing (not recommended) for a single card.\n"); } - if(register_netdev(dev) != 0) - { - printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n", - io[this_dev]); - - if(found != 0) return 0; - return -ENXIO; + if (do_eth16i_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_eth16i[found++] = dev; + continue; + } + free_irq(dev->irq, dev); + release_region(dev->base_addr, ETH16I_IO_EXTENT); } - - found++; + printk(KERN_WARNING "eth16i.c No Eth16i card found (i/o = 0x%x).\n", + io[this_dev]); + free_netdev(dev); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void cleanup_module(void) { int this_dev; - for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) - { - struct net_device* dev = &dev_eth16i[this_dev]; + for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) { + struct net_device *dev = dev_eth16i[this_dev]; - if(dev->priv != NULL) - { + if(dev->priv) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; - free_irq(dev->irq, dev); release_region(dev->base_addr, ETH16I_IO_EXTENT); - + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:41:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:41:28 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0fE25020334 for ; Wed, 12 Nov 2003 16:41:14 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0f8a29995; Wed, 12 Nov 2003 16:41:08 -0800 Date: Wed, 12 Nov 2003 16:41:08 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0f8a29995@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (5/42) fmv18 Cc: netdev@oss.sgi.com X-archive-position: 1378 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6950 Lines: 251 Based on viro, NE29-fmv18 * switched fmv18x to dynamic allocation * fmv18x: embedded ->priv * fmv18x: fixed resource leaks on failure exits * fmv18x: fixed clobbering on autoprobe * fmv18x: compile fix - comment is _not_ an empty statement. The thing had been b0rken since 2.4.3-pre2, BTW... diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 10:19:59 2003 +++ b/drivers/net/Space.c Tue Nov 11 10:19:59 2003 @@ -53,7 +53,7 @@ extern struct net_device *eepro_probe(int unit); extern int at1500_probe(struct net_device *); extern int at1700_probe(struct net_device *); -extern int fmv18x_probe(struct net_device *); +extern struct net_device *fmv18x_probe(int unit); extern struct net_device *eth16i_probe(int unit); extern struct net_device *i82596_probe(int unit); extern struct net_device *ewrk3_probe(int unit); @@ -244,13 +244,13 @@ #ifdef CONFIG_AT1700 {at1700_probe, 0}, #endif -#ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ - {fmv18x_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ + {fmv18x_probe, 0}, +#endif #ifdef CONFIG_ETH16I {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */ #endif diff -Nru a/drivers/net/fmv18x.c b/drivers/net/fmv18x.c --- a/drivers/net/fmv18x.c Tue Nov 11 10:19:59 2003 +++ b/drivers/net/fmv18x.c Tue Nov 11 10:19:59 2003 @@ -57,7 +57,7 @@ #include #include -static int fmv18x_probe_list[] __initdata = { +static unsigned fmv18x_probe_list[] __initdata = { 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0 }; @@ -109,8 +109,6 @@ /* Index to functions, as function prototypes. */ -extern int fmv18x_probe(struct net_device *dev); - static int fmv18x_probe1(struct net_device *dev, short ioaddr); static int net_open(struct net_device *dev); static int net_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -129,23 +127,50 @@ (detachable devices only). */ -int __init fmv18x_probe(struct net_device *dev) +static int io = 0x220; +static int irq; + +struct net_device * __init fmv18x_probe(int unit) { - int i; - int base_addr = dev->base_addr; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return fmv18x_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; fmv18x_probe_list[i]; i++) - if (fmv18x_probe1(dev, fmv18x_probe_list[i]) == 0) - return 0; - - return -ENODEV; + if (io > 0x1ff) { /* Check a single specified location. */ + err = fmv18x_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = fmv18x_probe_list; *port; port++) + if (fmv18x_probe1(dev, *port) == 0) + break; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, FMV18X_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } /* The Fujitsu datasheet suggests that the NIC be probed for by checking its @@ -160,7 +185,7 @@ { char irqmap[4] = {3, 7, 10, 15}; char irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15}; - unsigned int i, irq, retval; + unsigned int i, retval; struct net_local *lp; /* Resetting the chip doesn't reset the ISA interface, so don't bother. @@ -170,6 +195,9 @@ if (!request_region(ioaddr, FMV18X_IO_EXTENT, dev->name)) return -EBUSY; + dev->irq = irq; + dev->base_addr = ioaddr; + /* Check I/O address configuration and Fujitsu vendor code */ if (inb(ioaddr+FJ_MACADDR ) != 0x00 || inb(ioaddr+FJ_MACADDR+1) != 0x00 @@ -181,9 +209,8 @@ /* Check PnP mode for FMV-183/184/183A/184A. */ /* This PnP routine is very poor. IO and IRQ should be known. */ if (inb(ioaddr + FJ_STATUS1) & 0x20) { - irq = dev->irq; for (i = 0; i < 8; i++) { - if (irq == irqmap_pnp[i]) + if (dev->irq == irqmap_pnp[i]) break; } if (i == 8) { @@ -193,22 +220,19 @@ } else { if (fmv18x_probe_list[inb(ioaddr + FJ_CONFIG0) & 0x07] != ioaddr) return -ENODEV; - irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03]; + dev->irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03]; } /* Snarf the interrupt vector now. */ - retval = request_irq(irq, &net_interrupt, 0, dev->name, dev); + retval = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev); if (retval) { printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on" - "IRQ %d.\n", ioaddr, irq); + "IRQ %d.\n", ioaddr, dev->irq); goto out; } printk("%s: FMV-18x found at %#3x, IRQ %d, address ", dev->name, - ioaddr, irq); - - dev->base_addr = ioaddr; - dev->irq = irq; + ioaddr, dev->irq); for(i = 0; i < 6; i++) { unsigned char val = inb(ioaddr + FJ_MACADDR + i); @@ -279,14 +303,10 @@ dev->watchdog_timeo = HZ/10; dev->get_stats = net_get_stats; dev->set_multicast_list = set_multicast_list; - - /* Fill in the fields of 'dev' with ethernet-generic values. */ - - ether_setup(dev); return 0; out_irq: - free_irq(irq, dev); + free_irq(dev->irq, dev); out: release_region(ioaddr, FMV18X_IO_EXTENT); return retval; @@ -413,9 +433,7 @@ lp->tx_queue_len = 0; dev->trans_start = jiffies; lp->tx_started = 1; - } else if (lp->tx_queue_len < 4096 - 1502) - /* Yes, there is room for one more packet. */ - else + } else if (lp->tx_queue_len >= 4096 - 1502) /* No room for a packet */ netif_stop_queue(dev); dev_kfree_skb(skb); @@ -628,9 +646,7 @@ } #ifdef MODULE -static struct net_device dev_fmv18x; -static int io = 0x220; -static int irq; +static struct net_device *dev_fmv18x; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -644,26 +660,19 @@ { if (io == 0) printk("fmv18x: You should not use auto-probing with insmod!\n"); - dev_fmv18x.base_addr = io; - dev_fmv18x.irq = irq; - dev_fmv18x.init = fmv18x_probe; - if (register_netdev(&dev_fmv18x) != 0) { - printk("fmv18x: register_netdev() returned non-zero.\n"); - return -EIO; - } + dev_fmv18x = fmv18x_probe(-1); + if (IS_ERR(dev_fmv18x)) + return PTR_ERR(dev_fmv18x); return 0; } void cleanup_module(void) { - unregister_netdev(&dev_fmv18x); - kfree(dev_fmv18x.priv); - dev_fmv18x.priv = NULL; - - /* If we don't do this, we can't re-insmod it later. */ - free_irq(dev_fmv18x.irq, &dev_fmv18x); - release_region(dev_fmv18x.base_addr, FMV18X_IO_EXTENT); + unregister_netdev(dev_fmv18x); + free_irq(dev_fmv18x->irq, dev_fmv18x); + release_region(dev_fmv18x->base_addr, FMV18X_IO_EXTENT); + free_netdev(dev_fmv18x); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:41:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:41:43 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0fQ25020526 for ; Wed, 12 Nov 2003 16:41:27 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0fIg30099; Wed, 12 Nov 2003 16:41:18 -0800 Date: Wed, 12 Nov 2003 16:41:18 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0fIg30099@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (6/42) at1700 Cc: netdev@oss.sgi.com X-archive-position: 1379 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 7731 Lines: 304 Based on viro NE30-at1700 * switched at1700 to dynamic allocation * at1700: embedded ->priv * at1700: fixed resource leaks on failure exits * at1700: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:37 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:37 2003 @@ -52,7 +52,7 @@ extern struct net_device *express_probe(int unit); extern struct net_device *eepro_probe(int unit); extern int at1500_probe(struct net_device *); -extern int at1700_probe(struct net_device *); +extern struct net_device *at1700_probe(int unit); extern struct net_device *fmv18x_probe(int unit); extern struct net_device *eth16i_probe(int unit); extern struct net_device *i82596_probe(int unit); @@ -241,13 +241,13 @@ #ifdef CONFIG_CS89x0 {cs89x0_probe, 0}, #endif -#ifdef CONFIG_AT1700 - {at1700_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_AT1700 + {at1700_probe, 0}, +#endif #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ {fmv18x_probe, 0}, #endif diff -Nru a/drivers/net/at1700.c b/drivers/net/at1700.c --- a/drivers/net/at1700.c Tue Nov 11 09:35:37 2003 +++ b/drivers/net/at1700.c Tue Nov 11 09:35:37 2003 @@ -81,12 +81,12 @@ */ #ifndef CONFIG_X86_PC9800 -static int at1700_probe_list[] __initdata = { +static unsigned at1700_probe_list[] __initdata = { 0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0 }; #else /* CONFIG_X86_PC9800 */ -static int at1700_probe_list[] __initdata = { +static unsigned at1700_probe_list[] __initdata = { 0x1d6, 0x1d8, 0x1da, 0x1d4, 0xd4, 0xd2, 0xd8, 0xd0, 0 }; @@ -196,8 +196,6 @@ /* Index to functions, as function prototypes. */ -extern int at1700_probe(struct net_device *dev); - static int at1700_probe1(struct net_device *dev, int ioaddr); static int read_eeprom(long ioaddr, int location); static int net_open(struct net_device *dev); @@ -232,24 +230,78 @@ (detachable devices only). */ -int __init at1700_probe(struct net_device *dev) +#ifndef CONFIG_X86_PC9800 +static int io = 0x260; +#else +static int io = 0xd0; +#endif + +static int irq; + +static void cleanup_card(struct net_device *dev) { - int i; - int base_addr = dev->base_addr; +#ifdef CONFIG_MCA + struct net_local *lp = dev->priv; + if (lp->mca_slot) + mca_mark_as_unused(lp->mca_slot); +#endif + free_irq(dev->irq, NULL); +#ifndef CONFIG_X86_PC9800 + release_region(dev->base_addr, AT1700_IO_EXTENT); +#else + { + int i; + for (i = 0; i < 0x2000; i += 0x200) + release_region(dev->base_addr + i, 2); + } +#endif +} + +struct net_device * __init at1700_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } else { + dev->base_addr = io; + dev->irq = irq; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return at1700_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; at1700_probe_list[i]; i++) { - int ioaddr = at1700_probe_list[i]; - if (at1700_probe1(dev, ioaddr) == 0) - return 0; + if (io > 0x1ff) { /* Check a single specified location. */ + err = at1700_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = at1700_probe_list; *port; port++) { + if (at1700_probe1(dev, *port) == 0) + break; + dev->irq = irq; + } + if (!*port) + err = -ENODEV; } - return -ENODEV; + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); } /* The Fujitsu datasheet suggests that the NIC be probed for by checking its @@ -267,7 +319,7 @@ char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15}; unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0; int slot, ret = -ENODEV; - struct net_local *lp; + struct net_local *lp = dev->priv; #ifndef CONFIG_X86_PC9800 if (!request_region(ioaddr, AT1700_IO_EXTENT, dev->name)) @@ -284,9 +336,10 @@ } #endif - /* Resetting the chip doesn't reset the ISA interface, so don't bother. - That means we have to be careful with the register values we probe for. - */ + /* Resetting the chip doesn't reset the ISA interface, so don't bother. + That means we have to be careful with the register values we probe + for. + */ #ifdef notdef printk("at1700 probe at %#x, eeprom is %4.4x %4.4x %4.4x ctrl %4.4x.\n", ioaddr, read_eeprom(ioaddr, 4), read_eeprom(ioaddr, 5), @@ -331,15 +384,13 @@ break; /* probing for a card at a particular IO/IRQ */ - if (dev && - ((dev->irq && dev->irq != irq) || - (dev->base_addr && dev->base_addr != ioaddr))) { + if ((dev->irq && dev->irq != irq) || + (dev->base_addr && dev->base_addr != ioaddr)) { slot++; /* probing next slot */ continue; } - if (dev) - dev->irq = irq; + dev->irq = irq; /* claim the slot */ mca_set_adapter_name( slot, at1720_mca_adapters[j].name ); @@ -476,13 +527,7 @@ if (net_debug) printk(version); - /* Initialize the device structure. */ - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - ret = -ENOMEM; - goto err_out; - } - memset(dev->priv, 0, sizeof(struct net_local)); + memset(lp, 0, sizeof(struct net_local)); dev->open = net_open; dev->stop = net_close; @@ -492,11 +537,7 @@ dev->tx_timeout = net_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; - lp = (struct net_local *)dev->priv; - lp->lock = SPIN_LOCK_UNLOCKED; - - /* Fill in the fields of 'dev' with ethernet-generic values. */ - ether_setup(dev); + spin_lock_init(&lp->lock); lp->jumpered = is_fmv18x; lp->mca_slot = slot; @@ -505,14 +546,11 @@ if (ret) { printk (" AT1700 at %#3x is unusable due to a conflict on" "IRQ %d.\n", ioaddr, irq); - goto err_out_priv; + goto err_out; } return 0; -err_out_priv: - kfree(dev->priv); - dev->priv = NULL; err_out: #ifndef CONFIG_X86_PC9800 release_region(ioaddr, AT1700_IO_EXTENT); @@ -940,14 +978,7 @@ } #ifdef MODULE -static struct net_device dev_at1700; -#ifndef CONFIG_X86_PC9800 -static int io = 0x260; -#else -static int io = 0xd0; -#endif - -static int irq; +static struct net_device *dev_at1700; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -960,41 +991,18 @@ { if (io == 0) printk("at1700: You should not use auto-probing with insmod!\n"); - dev_at1700.base_addr = io; - dev_at1700.irq = irq; - dev_at1700.init = at1700_probe; - if (register_netdev(&dev_at1700) != 0) { - printk("at1700: register_netdev() returned non-zero.\n"); - return -EIO; - } + dev_at1700 = at1700_probe(-1); + if (IS_ERR(dev_at1700)) + return PTR_ERR(dev_at1700); return 0; } void cleanup_module(void) { -#ifdef CONFIG_MCA - struct net_local *lp = dev_at1700.priv; - if(lp->mca_slot) - { - mca_mark_as_unused(lp->mca_slot); - } -#endif - unregister_netdev(&dev_at1700); - kfree(dev_at1700.priv); - dev_at1700.priv = NULL; - - /* If we don't do this, we can't re-insmod it later. */ - free_irq(dev_at1700.irq, NULL); -#ifndef CONFIG_X86_PC9800 - release_region(dev_at1700.base_addr, AT1700_IO_EXTENT); -#else - { - int i; - for (i = 0; i < 0x2000; i += 0x200) - release_region(dev_at1700.base_addr + i, 2); - } -#endif + unregister_netdev(dev_at1700); + cleanup_card(dev_at1700); + free_netdev(dev_at1700); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Wed Nov 12 16:41:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:41:59 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0fi25020848 for ; Wed, 12 Nov 2003 16:41:44 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0fcM30165; Wed, 12 Nov 2003 16:41:38 -0800 Date: Wed, 12 Nov 2003 16:41:38 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0fcM30165@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (8/42) at1500 Cc: netdev@oss.sgi.com X-archive-position: 1380 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 1289 Lines: 37 Based on viro NE32-at1500 ROTFL. The last remnants of CONFIG_AT1500 removed - that was a hell of an ancient bug (at1500_probe() was never defined, AFAICS - all way back to 0.99.15). diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile Tue Nov 11 09:35:42 2003 +++ b/drivers/net/Makefile Tue Nov 11 09:35:42 2003 @@ -111,7 +111,6 @@ obj-$(CONFIG_DUMMY) += dummy.o obj-$(CONFIG_DE600) += de600.o obj-$(CONFIG_DE620) += de620.o -obj-$(CONFIG_AT1500) += lance.o obj-$(CONFIG_LANCE) += lance.o obj-$(CONFIG_SUN3_82586) += sun3_82586.o obj-$(CONFIG_SUN3LANCE) += sun3lance.o diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:42 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:42 2003 @@ -51,7 +51,6 @@ extern int hp_plus_probe(struct net_device *dev); extern struct net_device *express_probe(int unit); extern struct net_device *eepro_probe(int unit); -extern int at1500_probe(struct net_device *); extern struct net_device *at1700_probe(int unit); extern struct net_device *fmv18x_probe(int unit); extern struct net_device *eth16i_probe(int unit); @@ -234,9 +233,6 @@ #endif #ifdef CONFIG_SEEQ8005 {seeq8005_probe, 0}, -#endif -#ifdef CONFIG_AT1500 - {at1500_probe, 0}, #endif {NULL, 0}, }; From shemminger@osdl.org Wed Nov 12 16:42:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:42:29 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0gE25021448 for ; Wed, 12 Nov 2003 16:42:14 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0g8I30434; Wed, 12 Nov 2003 16:42:08 -0800 Date: Wed, 12 Nov 2003 16:42:08 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0g8I30434@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (11/42) lance Cc: netdev@oss.sgi.com X-archive-position: 1383 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 8609 Lines: 311 Based on viro NE35-lance * switched lance to dynamic allocation * lance: fixed init_etherdev races * lance: fixed resource leaks on failure exits * NB: probing code is, to put it mildly, odd. It _always_ does autoprobe, modular or not. WTF is going on there? diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:50 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:50 2003 @@ -85,7 +85,7 @@ extern int bagetlance_probe(struct net_device *); extern int mvme147lance_probe(struct net_device *dev); extern int tc515_probe(struct net_device *dev); -extern int lance_probe(struct net_device *dev); +extern struct net_device *lance_probe(int unit); extern int mace_probe(struct net_device *dev); extern int macsonic_probe(struct net_device *dev); extern int mac8390_probe(struct net_device *dev); @@ -225,13 +225,13 @@ #if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ {ne_probe, 0}, #endif -#ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */ - {lance_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */ + {lance_probe, 0}, +#endif #ifdef CONFIG_SMC9194 {smc_init, 0}, #endif diff -Nru a/drivers/net/lance.c b/drivers/net/lance.c --- a/drivers/net/lance.c Tue Nov 11 09:35:50 2003 +++ b/drivers/net/lance.c Tue Nov 11 09:35:50 2003 @@ -59,8 +59,8 @@ #include static unsigned int lance_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0}; -int lance_probe(struct net_device *dev); static int lance_probe1(struct net_device *dev, int ioaddr, int irq, int options); +static int __init do_lance_probe(struct net_device *dev); #ifdef LANCE_DEBUG static int lance_debug = LANCE_DEBUG; @@ -274,7 +274,6 @@ static unsigned char lance_need_isa_bounce_buffers = 1; static int lance_open(struct net_device *dev); -static int lance_open_fail(struct net_device *dev); static void lance_init_ring(struct net_device *dev, int mode); static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lance_rx(struct net_device *dev); @@ -286,10 +285,21 @@ +static void cleanup_card(struct net_device *dev) +{ + struct lance_private *lp = dev->priv; + if (dev->dma != 4) + free_dma(dev->dma); + release_region(dev->base_addr, LANCE_TOTAL_SIZE); + kfree(lp->tx_bounce_buffs); + kfree((void*)lp->rx_buffs); + kfree(lp); +} + #ifdef MODULE #define MAX_CARDS 8 /* Max number of interfaces (cards) per module */ -static struct net_device dev_lance[MAX_CARDS]; +static struct net_device *dev_lance[MAX_CARDS]; static int io[MAX_CARDS]; static int dma[MAX_CARDS]; static int irq[MAX_CARDS]; @@ -305,28 +315,35 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_lance[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->dma = dma[this_dev]; - dev->init = lance_probe; if (io[this_dev] == 0) { - if (this_dev != 0) break; /* only complain once */ + if (this_dev != 0) /* only complain once */ + break; printk(KERN_NOTICE "lance.c: Module autoprobing not allowed. Append \"io=0xNNN\" value(s).\n"); return -EPERM; } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "lance.c: No PCnet/LANCE card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) return 0; /* Got at least one. */ - return -ENXIO; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + dev->dma = dma[this_dev]; + if (do_lance_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_lance[found++] = dev; + continue; + } + cleanup_card(dev); } - found++; + free_netdev(dev); + break; } - - return 0; + if (found != 0) + return 0; + return -ENXIO; } void cleanup_module(void) @@ -334,13 +351,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_lance[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_lance[this_dev]; + if (dev) { unregister_netdev(dev); - free_dma(dev->dma); - release_region(dev->base_addr, LANCE_TOTAL_SIZE); - kfree(dev->priv); - dev->priv = NULL; + cleanup_card(dev); + free_netdev(dev); } } } @@ -352,7 +367,7 @@ board probes now that kmalloc() can allocate ISA DMA-able regions. This also allows the LANCE driver to be used as a module. */ -int __init lance_probe(struct net_device *dev) +static int __init do_lance_probe(struct net_device *dev) { int *port, result; @@ -387,6 +402,31 @@ return -ENODEV; } +struct net_device * __init lance_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENODEV); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = do_lance_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int options) { struct lance_private *lp; @@ -398,6 +438,7 @@ int hp_builtin = 0; /* HP on-board ethernet. */ static int did_version; /* Already printed version info. */ unsigned long flags; + int err = -ENOMEM; /* First we look for special cases. Check for HP's on-board ethernet by looking for 'HP' in the BIOS. @@ -432,7 +473,7 @@ outw(88, ioaddr+LANCE_ADDR); if (inw(ioaddr+LANCE_ADDR) != 88) { lance_version = 0; - } else { /* Good, it's a newer chip. */ + } else { /* Good, it's a newer chip. */ int chip_version = inw(ioaddr+LANCE_DATA); outw(89, ioaddr+LANCE_ADDR); chip_version |= inw(ioaddr+LANCE_DATA) << 16; @@ -447,13 +488,9 @@ } } - /* We can't use init_etherdev() to allocate dev->priv because it must + /* We can't allocate dev->priv from alloc_etherdev() because it must a ISA DMA-able region. */ - dev = init_etherdev(dev, 0); - if (!dev) - return -ENOMEM; SET_MODULE_OWNER(dev); - dev->open = lance_open_fail; chipname = chip_table[lance_version].name; printk("%s: %s at %#3x,", dev->name, chipname, ioaddr); @@ -465,8 +502,7 @@ dev->base_addr = ioaddr; /* Make certain the data structures used by the LANCE are aligned and DMAble. */ - lp = (struct lance_private *)(((unsigned long)kmalloc(sizeof(*lp)+7, - GFP_DMA | GFP_KERNEL)+7) & ~7); + lp = kmalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL); if(lp==NULL) return -ENODEV; if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp); @@ -486,7 +522,7 @@ lp->tx_bounce_buffs = NULL; lp->chip_version = lance_version; - lp->devlock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&lp->devlock); lp->init_block.mode = 0x0003; /* Disable Rx and Tx. */ for (i = 0; i < 6; i++) @@ -540,6 +576,7 @@ dma_channels = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) | (inb(DMA2_STAT_REG) & 0xf0); } + err = -ENODEV; if (dev->irq >= 2) printk(" assigned IRQ %d", dev->irq); else if (lance_version != 0) { /* 7990 boards need DMA detection first. */ @@ -559,7 +596,7 @@ printk(", probed IRQ %d", dev->irq); else { printk(", failed to detect IRQ line.\n"); - return -ENODEV; + goto out_tx; } /* Check for the initialization done bit, 0x0100, which means @@ -573,7 +610,7 @@ } else if (dev->dma) { if (request_dma(dev->dma, chipname)) { printk("DMA %d allocation failed.\n", dev->dma); - return -ENODEV; + goto out_tx; } else printk(", assigned DMA %d.\n", dev->dma); } else { /* OK, we have to auto-DMA. */ @@ -613,7 +650,7 @@ } if (i == 4) { /* Failure: bail. */ printk("DMA detection failed.\n"); - return -ENODEV; + goto out_tx; } } @@ -629,7 +666,7 @@ dev->irq = probe_irq_off(irq_mask); if (dev->irq == 0) { printk(" Failed to detect the 7990 IRQ line.\n"); - return -ENODEV; + goto out_dma; } printk(" Auto-IRQ detected IRQ%d.\n", dev->irq); } @@ -655,17 +692,17 @@ dev->watchdog_timeo = TX_TIMEOUT; return 0; -out_rx: kfree((void*)lp->rx_buffs); -out_lp: kfree(lp); - return -ENOMEM; +out_dma: + if (dev->dma != 4) + free_dma(dev->dma); +out_tx: + kfree(lp->tx_bounce_buffs); +out_rx: + kfree((void*)lp->rx_buffs); +out_lp: + kfree(lp); + return err; } - -static int -lance_open_fail(struct net_device *dev) -{ - return -ENODEV; -} - static int From shemminger@osdl.org Wed Nov 12 16:42:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:42:45 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0gM25021574 for ; Wed, 12 Nov 2003 16:42:23 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0fS230153; Wed, 12 Nov 2003 16:41:28 -0800 Date: Wed, 12 Nov 2003 16:41:28 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0fS230153@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (7/42) cs89x0 Cc: netdev@oss.sgi.com X-archive-position: 1385 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 7638 Lines: 282 Based on viro NE31-cs89x0 * switched cs89x0 to dynamic allocation * cs89x0: embedded ->priv * cs89x0: fixed resource leaks on failure exits * cs89x0: fixed clobbering on autoprobe * NB: cs89x0 calls request_region() with very odd arguments. Somebody ought to check WTF is going on there. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:40 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:40 2003 @@ -81,7 +81,7 @@ extern int apne_probe(struct net_device *); extern int bionet_probe(struct net_device *); extern int pamsnet_probe(struct net_device *); -extern int cs89x0_probe(struct net_device *dev); +extern struct net_device *cs89x0_probe(int unit); extern int hplance_probe(struct net_device *dev); extern int bagetlance_probe(struct net_device *); extern int mvme147lance_probe(struct net_device *dev); @@ -238,13 +238,13 @@ #ifdef CONFIG_AT1500 {at1500_probe, 0}, #endif -#ifdef CONFIG_CS89x0 - {cs89x0_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_CS89x0 + {cs89x0_probe, 0}, +#endif #ifdef CONFIG_AT1700 {at1700_probe, 0}, #endif diff -Nru a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c --- a/drivers/net/cs89x0.c Tue Nov 11 09:35:40 2003 +++ b/drivers/net/cs89x0.c Tue Nov 11 09:35:40 2003 @@ -212,9 +212,7 @@ /* Index to functions, as function prototypes. */ -extern int cs89x0_probe(struct net_device *dev); - -static int cs89x0_probe1(struct net_device *dev, int ioaddr); +static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular); static int net_open(struct net_device *dev); static int net_send_packet(struct sk_buff *skb, struct net_device *dev); static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -274,27 +272,51 @@ Return 0 on success. */ -int __init cs89x0_probe(struct net_device *dev) +struct net_device * __init cs89x0_probe(int unit) { - int i; - int base_addr = dev ? dev->base_addr : 0; - - SET_MODULE_OWNER(dev); + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + unsigned *port; + int err = 0; + int irq; + int io; + + if (!dev) + return ERR_PTR(-ENODEV); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; if (net_debug) - printk("cs89x0:cs89x0_probe(0x%x)\n", base_addr); + printk("cs89x0:cs89x0_probe(0x%x)\n", io); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return cs89x0_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; netcard_portlist[i]; i++) { - if (cs89x0_probe1(dev, netcard_portlist[i]) == 0) - return 0; + if (io > 0x1ff) { /* Check a single specified location. */ + err = cs89x0_probe1(dev, io, 0); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = netcard_portlist; *port; port++) { + if (cs89x0_probe1(dev, *port, 0) == 0) + break; + dev->irq = irq; + } + if (!*port) + err = -ENODEV; } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + outw(PP_ChipID, dev->base_addr + ADD_PORT); + release_region(dev->base_addr, NETCARD_IO_EXTENT); +out: + free_netdev(dev); printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n"); - return -ENODEV; + return ERR_PTR(err); } static int @@ -375,39 +397,34 @@ */ static int __init -cs89x0_probe1(struct net_device *dev, int ioaddr) +cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) { - struct net_local *lp; + struct net_local *lp = (struct net_local *)dev->priv; static unsigned version_printed; int i; unsigned rev_type = 0; int eeprom_buff[CHKSUM_LEN]; int retval; + SET_MODULE_OWNER(dev); /* Initialize the device structure. */ - if (dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == 0) { - retval = -ENOMEM; - goto out; - } - lp = (struct net_local *)dev->priv; + if (!modular) { memset(lp, 0, sizeof(*lp)); spin_lock_init(&lp->lock); -#if !defined(MODULE) && (ALLOW_DMA != 0) +#ifndef MODULE +#if ALLOW_DMA if (g_cs89x0_dma) { lp->use_dma = 1; lp->dma = g_cs89x0_dma; lp->dmasize = 16; /* Could make this an option... */ } #endif -#ifndef MODULE lp->force = g_cs89x0_media__force; #endif } - lp = (struct net_local *)dev->priv; /* Grab the region so we can find another board if autoIRQ fails. */ + /* WTF is going on here? */ if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, dev->name)) { printk(KERN_ERR "%s: request_region(0x%x, 0x%x) failed\n", dev->name, ioaddr, NETCARD_IO_EXTENT); @@ -696,9 +713,6 @@ dev->set_multicast_list = set_multicast_list; dev->set_mac_address = set_mac_address; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - printk("\n"); if (net_debug) printk("cs89x0_probe1() successful\n"); @@ -706,9 +720,6 @@ out2: release_region(ioaddr & ~3, NETCARD_IO_EXTENT); out1: - kfree(dev->priv); - dev->priv = 0; -out: return retval; } @@ -1655,7 +1666,7 @@ #ifdef MODULE -static struct net_device dev_cs89x0; +static struct net_device *dev_cs89x0; /* * Support the 'debug' module parm even if we're compiled for non-debug to @@ -1733,6 +1744,7 @@ int init_module(void) { + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); struct net_local *lp; int ret = 0; @@ -1741,18 +1753,12 @@ #else debug = 0; #endif - - dev_cs89x0.irq = irq; - dev_cs89x0.base_addr = io; - - dev_cs89x0.init = cs89x0_probe; - dev_cs89x0.priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev_cs89x0.priv == 0) { - printk(KERN_ERR "cs89x0.c: Out of memory.\n"); + if (!dev) return -ENOMEM; - } - memset(dev_cs89x0.priv, 0, sizeof(struct net_local)); - lp = (struct net_local *)dev_cs89x0.priv; + + dev->irq = irq; + dev->base_addr = io; + lp = dev->priv; #if ALLOW_DMA if (use_dma) { @@ -1782,7 +1788,10 @@ printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n"); ret = -EPERM; goto out; - } + } else if (io <= 0x1ff) { + ret = -ENXIO; + goto out; + } #if ALLOW_DMA if (use_dma && dmasize != 16 && dmasize != 64) { @@ -1791,30 +1800,31 @@ goto out; } #endif + ret = cs89x0_probe1(dev, io, 1); + if (ret) + goto out; - if (register_netdev(&dev_cs89x0) != 0) { + if (register_netdev(dev) != 0) { printk(KERN_ERR "cs89x0.c: No card found at 0x%x\n", io); ret = -ENXIO; + outw(PP_ChipID, dev->base_addr + ADD_PORT); + release_region(dev->base_addr, NETCARD_IO_EXTENT); goto out; } + dev_cs89x0 = dev; + return 0; out: - if (ret) - kfree(dev_cs89x0.priv); + free_netdev(dev); return ret; } void cleanup_module(void) { - if (dev_cs89x0.priv != NULL) { - /* Free up the private structure, or leak memory :-) */ - unregister_netdev(&dev_cs89x0); - outw(PP_ChipID, dev_cs89x0.base_addr + ADD_PORT); - kfree(dev_cs89x0.priv); - dev_cs89x0.priv = NULL; /* gets re-allocated by cs89x0_probe1 */ - /* If we don't do this, we can't re-insmod it later. */ - release_region(dev_cs89x0.base_addr, NETCARD_IO_EXTENT); - } + unregister_netdev(dev_cs89x0); + outw(PP_ChipID, dev_cs89x0->base_addr + ADD_PORT); + release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT); + free_netdev(dev_cs89x0); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:42:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43:01 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0gk25021980 for ; Wed, 12 Nov 2003 16:42:47 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0gci30563; Wed, 12 Nov 2003 16:42:38 -0800 Date: Wed, 12 Nov 2003 16:42:38 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0gci30563@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (14/42) hpplus Cc: netdev@oss.sgi.com X-archive-position: 1386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4949 Lines: 184 Based on NE38-hpplus * switched hp-plus to dynamic allocation * hp-plus: fixed order of freeing bugs * hp-plus: fixed resource leaks on failure exits * hp-plus: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:58 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:58 2003 @@ -48,7 +48,7 @@ extern int el2_probe(struct net_device *dev); extern struct net_device *ne_probe(int unit); extern int hp_probe(struct net_device *dev); -extern int hp_plus_probe(struct net_device *dev); +extern struct net_device *hp_plus_probe(int unit); extern struct net_device *express_probe(int unit); extern struct net_device *eepro_probe(int unit); extern struct net_device *at1700_probe(int unit); @@ -216,13 +216,13 @@ #ifdef CONFIG_HPLAN {hp_probe, 0}, #endif -#ifdef CONFIG_HPLAN_PLUS - {hp_plus_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_HPLAN_PLUS + {hp_plus_probe, 0}, +#endif #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ {e2100_probe, 0}, #endif diff -Nru a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c --- a/drivers/net/hp-plus.c Tue Nov 11 09:35:58 2003 +++ b/drivers/net/hp-plus.c Tue Nov 11 09:35:58 2003 @@ -92,7 +92,6 @@ EnableIRQ = 4, FakeIntr = 8, BootROMEnb = 0x10, IOEnb = 0x20, MemEnable = 0x40, ZeroWait = 0x80, MemDisable = 0x1000, }; -int hp_plus_probe(struct net_device *dev); static int hpp_probe1(struct net_device *dev, int ioaddr); static void hpp_reset_8390(struct net_device *dev); @@ -115,10 +114,11 @@ /* Probe a list of addresses for an HP LAN+ adaptor. This routine is almost boilerplate. */ -int __init hp_plus_probe(struct net_device *dev) +static int __init do_hpp_probe(struct net_device *dev) { int i; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -127,13 +127,49 @@ else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; - for (i = 0; hpplus_portlist[i]; i++) + for (i = 0; hpplus_portlist[i]; i++) { if (hpp_probe1(dev, hpplus_portlist[i]) == 0) return 0; + dev->irq = irq; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + /* NB: hpp_close() handles free_irq */ + release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init hp_plus_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_hpp_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + /* Do the interesting part of the probe at a single address. */ static int __init hpp_probe1(struct net_device *dev, int ioaddr) { @@ -400,7 +436,7 @@ #ifdef MODULE #define MAX_HPP_CARDS 4 /* Max number of HPP cards per module */ -static struct net_device dev_hpp[MAX_HPP_CARDS]; +static struct net_device *dev_hpp[MAX_HPP_CARDS]; static int io[MAX_HPP_CARDS]; static int irq[MAX_HPP_CARDS]; @@ -416,27 +452,34 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) { - struct net_device *dev = &dev_hpp[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->init = hp_plus_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "hp-plus.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + if (do_hpp_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_hpp[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -445,14 +488,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) { - struct net_device *dev = &dev_hpp[this_dev]; - if (dev->priv != NULL) { - int ioaddr = dev->base_addr - NIC_OFFSET; - void *priv = dev->priv; - /* NB: hpp_close() handles free_irq */ - release_region(ioaddr, HP_IO_EXTENT); + struct net_device *dev = dev_hpp[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:42:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:42:42 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0gP25021611 for ; Wed, 12 Nov 2003 16:42:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0gI730471; Wed, 12 Nov 2003 16:42:18 -0800 Date: Wed, 12 Nov 2003 16:42:18 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0gI730471@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (12/42) ne Cc: netdev@oss.sgi.com X-archive-position: 1384 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 11933 Lines: 415 Based on NE36-ne * switched ne/ne2k_cbus to dynamic allocation * ne/ne2k_cbus: fixed order of freeing bugs * ne/ne2k_cbus: fixed resource leaks on failure exits * ne/ne2k_cbus: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:35:31 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:35:31 2003 @@ -46,7 +46,7 @@ extern int ultra32_probe(struct net_device *dev); extern int wd_probe(struct net_device *dev); extern int el2_probe(struct net_device *dev); -extern int ne_probe(struct net_device *dev); +extern struct net_device *ne_probe(int unit); extern int hp_probe(struct net_device *dev); extern int hp_plus_probe(struct net_device *dev); extern struct net_device *express_probe(int unit); @@ -222,13 +222,13 @@ #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ {e2100_probe, 0}, #endif -#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ - {ne_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ + {ne_probe, 0}, +#endif #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */ {lance_probe, 0}, #endif diff -Nru a/drivers/net/ne.c b/drivers/net/ne.c --- a/drivers/net/ne.c Tue Nov 11 14:35:31 2003 +++ b/drivers/net/ne.c Tue Nov 11 14:35:31 2003 @@ -126,7 +126,6 @@ #define NESM_START_PG 0x40 /* First page of TX buffer */ #define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ -int ne_probe(struct net_device *dev); static int ne_probe1(struct net_device *dev, int ioaddr); static int ne_probe_isapnp(struct net_device *dev); @@ -163,9 +162,10 @@ E2010 starts at 0x100 and ends at 0x4000. E2010-x starts at 0x100 and ends at 0xffff. */ -int __init ne_probe(struct net_device *dev) +static int __init do_ne_probe(struct net_device *dev) { unsigned int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -183,6 +183,7 @@ /* Last resort. The semi-risky ISA auto-probe. */ for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) { int ioaddr = netcard_portlist[base_addr]; + dev->irq = irq; if (ne_probe1(dev, ioaddr) == 0) return 0; } @@ -191,6 +192,44 @@ return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + void *priv = dev->priv; + struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; + if (idev) + pnp_device_detach(idev); + free_irq(dev->irq, dev); + release_region(dev->base_addr, NE_IO_EXTENT); + kfree(priv); +} + +struct net_device * __init ne_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_ne_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init ne_probe_isapnp(struct net_device *dev) { int i; @@ -734,7 +773,7 @@ #ifdef MODULE #define MAX_NE_CARDS 4 /* Max number of NE cards per module */ -static struct net_device dev_ne[MAX_NE_CARDS]; +static struct net_device *dev_ne[MAX_NE_CARDS]; static int io[MAX_NE_CARDS]; static int irq[MAX_NE_CARDS]; static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */ @@ -758,25 +797,32 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; + struct net_device *dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; dev->irq = irq[this_dev]; dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; - dev->init = ne_probe; - if (register_netdev(dev) == 0) { - found++; - continue; - } - if (found != 0) { /* Got at least one. */ - return 0; + if (do_ne_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_ne[found++] = dev; + continue; + } + cleanup_card(dev); } + free_netdev(dev); + if (found) + break; if (io[this_dev] != 0) printk(KERN_WARNING "ne.c: No NE*000 card found at i/o = %#x\n", io[this_dev]); else printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\" value(s) for ISA cards.\n"); return -ENXIO; } - return 0; + if (found) + return 0; + return -ENODEV; } void cleanup_module(void) @@ -784,16 +830,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; - if (idev) - pnp_device_detach(idev); - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE_IO_EXTENT); + struct net_device *dev = dev_ne[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } diff -Nru a/drivers/net/ne2k_cbus.c b/drivers/net/ne2k_cbus.c --- a/drivers/net/ne2k_cbus.c Tue Nov 11 14:35:31 2003 +++ b/drivers/net/ne2k_cbus.c Tue Nov 11 14:35:31 2003 @@ -78,7 +78,6 @@ #include "ne2k_cbus.h" -int ne_probe(struct net_device *dev); static int ne_probe1(struct net_device *dev, int ioaddr); static int ne_open(struct net_device *dev); static int ne_close(struct net_device *dev); @@ -113,9 +112,10 @@ E2010 starts at 0x100 and ends at 0x4000. E2010-x starts at 0x100 and ends at 0xffff. */ -int __init ne_probe(struct net_device *dev) +static int __init do_ne_probe(struct net_device *dev) { unsigned int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -135,7 +135,7 @@ if (ei_debug > 2) printk(KERN_DEBUG "ne_probe(): call ne_probe_cbus(base_addr=0x%x)\n", base_addr); - result = ne_probe_cbus(dev, hw, base_addr); + result = ne_probe_cbus(dev, hw, base_addr, irq); if (result != 0) ne2k_cbus_destroy(dev); @@ -156,13 +156,13 @@ if (hw && hw->hwtype) { const unsigned short *plist; for (plist = hw->portlist; *plist; plist++) - if (ne_probe_cbus(dev, hw, *plist) == 0) + if (ne_probe_cbus(dev, hw, *plist, irq) == 0) return 0; } else { for (hw = &ne2k_cbus_hwinfo_list[0]; hw->hwtype; hw++) { const unsigned short *plist; for (plist = hw->portlist; *plist; plist++) - if (ne_probe_cbus(dev, hw, *plist) == 0) + if (ne_probe_cbus(dev, hw, *plist, irq) == 0) return 0; } } @@ -174,7 +174,47 @@ return -ENODEV; } -static int __init ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr) +static void cleanup_card(struct net_device *dev) +{ + const struct ne2k_cbus_region *rlist; + const struct ne2k_cbus_hwinfo *hw = ne2k_cbus_get_hwinfo((int)(dev->mem_start & NE2K_CBUS_HARDWARE_TYPE_MASK)); + + free_irq(dev->irq, dev); + for (rlist = hw->regionlist; rlist->range; rlist++) { + release_region(dev->base_addr + rlist->start, + rlist->range); + } + ne2k_cbus_destroy(dev); +} + +struct net_device * __init ne_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_ne_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + +static int __init ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr, int irq) { if (ei_debug > 2) printk(KERN_DEBUG "ne_probe_cbus(): entered. (called from %p)\n", @@ -182,6 +222,7 @@ if (hw && hw->hwtype) { ne2k_cbus_set_hwtype(dev, hw, ioaddr); + dev->irq = irq; return ne_probe1(dev, ioaddr); } else { /* auto detect */ @@ -189,6 +230,7 @@ printk(KERN_DEBUG "ne_probe_cbus(): try to determine hardware types.\n"); for (hw = &ne2k_cbus_hwinfo_list[0]; hw->hwtype; hw++) { ne2k_cbus_set_hwtype(dev, hw, ioaddr); + dev->irq = irq; if (ne_probe1(dev, ioaddr) == 0) return 0; } @@ -301,11 +343,12 @@ if (ei_debug > 2) printk(" [CNET98EL-specific initialize..."); outb_p(E8390_NODMA | E8390_STOP, ioaddr + E8390_CMD); /* 0x20|0x1 */ + ret = -ENODEV; i = inb(ioaddr); if ((i & ~0x2) != (0x20 | 0x01)) - return -ENODEV; + goto err_out; if ((inb(ioaddr + 0x7) & 0x80) != 0x80) - return -ENODEV; + goto err_out; outb_p(E8390_RXOFF, ioaddr + EN0_RXCR); /* out(ioaddr+0xc, 0x20) */ /* outb_p(ENDCFG_WTS|ENDCFG_FT1|ENDCFG_LS, ioaddr+EN0_DCFG); */ outb_p(ENDCFG_WTS | 0x48, ioaddr + EN0_DCFG); /* 0x49 */ @@ -330,7 +373,7 @@ if (ei_debug > 2) printk("] "); printk("memory failure at %x\n", i); - return -ENODEV; + goto err_out; } if (ei_debug > 2) printk(" good..."); @@ -338,7 +381,7 @@ if (ei_debug > 2) printk("] "); printk("IRQ must be specified for C-NET(98)E/L. probe failed.\n"); - return -ENODEV; + goto err_out; } outb((dev->irq > 5) ? (dev->irq & 4):(dev->irq >> 1), ioaddr + (0x2 | 0x400)); outb(0x7e, ioaddr + (0x4 | 0x400)); @@ -779,7 +822,7 @@ #ifdef MODULE #define MAX_NE_CARDS 4 /* Max number of NE cards per module */ -static struct net_device dev_ne[MAX_NE_CARDS]; +static struct net_device *dev_ne[MAX_NE_CARDS]; static int io[MAX_NE_CARDS]; static int irq[MAX_NE_CARDS]; static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */ @@ -806,26 +849,33 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; + struct net_device *dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; dev->irq = irq[this_dev]; dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; dev->mem_start = hwtype[this_dev]; - dev->init = ne_probe; - if (register_netdev(dev) == 0) { - found++; - continue; - } - if (found != 0) { /* Got at least one. */ - return 0; + if (do_ne_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_ne[found++] = dev; + continue; + } + cleanup_card(dev); } + free_netdev(dev); + if (found) + break; if (io[this_dev] != 0) printk(KERN_WARNING "ne2k_cbus: No NE*000 card found at i/o = %#x\n", io[this_dev]); else - printk(KERN_NOTICE "ne2k_cbus: You must supply \"io=0xNNN\" value(s) for C-Bus cards.\n"); + printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\" value(s) for ISA cards.\n"); return -ENXIO; } - return 0; + if (found) + return 0; + return -ENODEV; } void cleanup_module(void) @@ -833,18 +883,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; - if (dev->priv != NULL) { - const struct ne2k_cbus_region *rlist; - const struct ne2k_cbus_hwinfo *hw = ne2k_cbus_get_hwinfo((int)(dev->mem_start & NE2K_CBUS_HARDWARE_TYPE_MASK)); - - free_irq(dev->irq, dev); - for (rlist = hw->regionlist; rlist->range; rlist++) { - release_region(dev->base_addr + rlist->start, - rlist->range); - } + struct net_device *dev = dev_ne[this_dev]; + if (dev) { unregister_netdev(dev); - ne2k_cbus_destroy(dev); + cleanup_card(dev); + free_netdev(dev); } } } diff -Nru a/drivers/net/ne2k_cbus.h b/drivers/net/ne2k_cbus.h --- a/drivers/net/ne2k_cbus.h Tue Nov 11 14:35:31 2003 +++ b/drivers/net/ne2k_cbus.h Tue Nov 11 14:35:31 2003 @@ -477,5 +477,5 @@ } #endif -static int ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr); +static int ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr, int irq); /* End of ne2k_cbus.h */ From shemminger@osdl.org Wed Nov 12 16:42:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:42:18 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0g425021243 for ; Wed, 12 Nov 2003 16:42:04 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0fwn30285; Wed, 12 Nov 2003 16:41:58 -0800 Date: Wed, 12 Nov 2003 16:41:58 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0fwn30285@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (10/42) smc Cc: netdev@oss.sgi.com X-archive-position: 1382 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5721 Lines: 222 Based on viro NE34-smc * switched smc to dynamic allocation * smc: embedded ->priv * smc: fixed resource leaks on failure exits * smc: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 11:03:51 2003 +++ b/drivers/net/Space.c Tue Nov 11 11:03:51 2003 @@ -73,7 +73,7 @@ extern int sonic_probe(struct net_device *); extern struct net_device *SK_init(int unit); extern struct net_device *seeq8005_probe(int unit); -extern int smc_init( struct net_device * ); +extern struct net_device *smc_init(int unit); extern int atarilance_probe(struct net_device *); extern int sun3lance_probe(struct net_device *); extern int sun3_82586_probe(struct net_device *); @@ -228,13 +228,13 @@ #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */ {lance_probe, 0}, #endif -#ifdef CONFIG_SMC9194 - {smc_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SMC9194 + {smc_init, 0}, +#endif #ifdef CONFIG_SEEQ8005 {seeq8005_probe, 0}, #endif diff -Nru a/drivers/net/smc9194.c b/drivers/net/smc9194.c --- a/drivers/net/smc9194.c Tue Nov 11 11:03:51 2003 +++ b/drivers/net/smc9194.c Tue Nov 11 11:03:51 2003 @@ -191,7 +191,7 @@ . . NB:This shouldn't be static since it is referred to externally. */ -int smc_init(struct net_device *dev); +struct net_device *smc_init(int unit); /* . The kernel calls this function when someone wants to use the device, @@ -672,7 +672,7 @@ /*------------------------------------------------------------------------- | - | smc_init( struct net_device * dev ) + | smc_init(int unit) | Input parameters: | dev->base_addr == 0, try to find all possible locations | dev->base_addr == 1, return failure code @@ -680,31 +680,56 @@ | dev->base_addr == this is the address to check | | Output: - | 0 --> there is a device - | anything else, error + | pointer to net_device or ERR_PTR(error) | --------------------------------------------------------------------------- */ -int __init smc_init(struct net_device *dev) +static int io; +static int irq; +static int ifport; + +struct net_device * __init smc_init(int unit) { - int i; - int base_addr = dev->base_addr; + struct net_device *dev = alloc_etherdev(sizeof(struct smc_local)); + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } SET_MODULE_OWNER(dev); - /* try a specific location */ - if (base_addr > 0x1ff) - return smc_probe(dev, base_addr); - else if (base_addr != 0) - return -ENXIO; - - /* check every ethernet address */ - for (i = 0; smc_portlist[i]; i++) - if (smc_probe(dev, smc_portlist[i]) == 0) - return 0; - - /* couldn't find anything */ - return -ENODEV; + if (io > 0x1ff) { /* Check a single specified location. */ + err = smc_probe(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = smc_portlist; *port; port++) { + if (smc_probe(dev, *port) == 0) + break; + } + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, SMC_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } /*---------------------------------------------------------------------- @@ -821,6 +846,9 @@ if (!request_region(ioaddr, SMC_IO_EXTENT, dev->name)) return -EBUSY; + dev->irq = irq; + dev->if_port = ifport; + /* First, see if the high byte is 0x33 */ bank = inw( ioaddr + BANK_SELECT ); if ( (bank & 0xFF00) != 0x3300 ) { @@ -969,28 +997,14 @@ printk("%2.2x:", dev->dev_addr[i] ); printk("%2.2x \n", dev->dev_addr[5] ); - - /* Initialize the private structure. */ - if (dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct smc_local), GFP_KERNEL); - if (dev->priv == NULL) { - retval = -ENOMEM; - goto err_out; - } - } /* set the private data to zero by default */ memset(dev->priv, 0, sizeof(struct smc_local)); - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - /* Grab the IRQ */ retval = request_irq(dev->irq, &smc_interrupt, 0, dev->name, dev); if (retval) { printk("%s: unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, retval); - kfree(dev->priv); - dev->priv = NULL; goto err_out; } @@ -1524,10 +1538,7 @@ #ifdef MODULE -static struct net_device devSMC9194; -static int io; -static int irq; -static int ifport; +static struct net_device *devSMC9194; MODULE_LICENSE("GPL"); MODULE_PARM(io, "i"); @@ -1539,32 +1550,23 @@ int init_module(void) { - int result; - if (io == 0) printk(KERN_WARNING CARDNAME": You shouldn't use auto-probing with insmod!\n" ); /* copy the parameters from insmod into the device structure */ - devSMC9194.base_addr = io; - devSMC9194.irq = irq; - devSMC9194.if_port = ifport; - devSMC9194.init = smc_init; - if ((result = register_netdev(&devSMC9194)) != 0) - return result; - + devSMC9194 = smc_init(-1); + if (IS_ERR(devSMC9194)) + return PTR_ERR(devSMC9194); return 0; } void cleanup_module(void) { - unregister_netdev(&devSMC9194); - - free_irq(devSMC9194.irq, &devSMC9194); - release_region(devSMC9194.base_addr, SMC_IO_EXTENT); - - if (devSMC9194.priv) - kfree(devSMC9194.priv); + unregister_netdev(devSMC9194); + free_irq(devSMC9194->irq, devSMC9194); + release_region(devSMC9194->base_addr, SMC_IO_EXTENT); + free_netdev(devSMC9194); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:42:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43:11 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0gt25022126 for ; Wed, 12 Nov 2003 16:42:55 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0gmt30618; Wed, 12 Nov 2003 16:42:48 -0800 Date: Wed, 12 Nov 2003 16:42:48 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0gmt30618@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (15/42) hp Cc: netdev@oss.sgi.com X-archive-position: 1387 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4718 Lines: 185 Based on viro NE39-hp * switched hp to dynamic allocation * hp: fixed order of freeing bugs * hp: fixed resource leaks on failure exits * hp: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:36:00 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:36:00 2003 @@ -47,7 +47,7 @@ extern int wd_probe(struct net_device *dev); extern int el2_probe(struct net_device *dev); extern struct net_device *ne_probe(int unit); -extern int hp_probe(struct net_device *dev); +extern struct net_device *hp_probe(int unit); extern struct net_device *hp_plus_probe(int unit); extern struct net_device *express_probe(int unit); extern struct net_device *eepro_probe(int unit); @@ -213,13 +213,13 @@ #ifdef CONFIG_EL2 /* 3c503 */ {el2_probe, 0}, #endif -#ifdef CONFIG_HPLAN - {hp_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_HPLAN + {hp_probe, 0}, +#endif #ifdef CONFIG_HPLAN_PLUS {hp_plus_probe, 0}, #endif diff -Nru a/drivers/net/hp.c b/drivers/net/hp.c --- a/drivers/net/hp.c Tue Nov 11 09:36:00 2003 +++ b/drivers/net/hp.c Tue Nov 11 09:36:00 2003 @@ -55,7 +55,6 @@ #define HP_8BSTOP_PG 0x80 /* Last page +1 of RX ring */ #define HP_16BSTOP_PG 0xFF /* Same, for 16 bit cards. */ -int hp_probe(struct net_device *dev); static int hp_probe1(struct net_device *dev, int ioaddr); static int hp_open(struct net_device *dev); @@ -79,10 +78,11 @@ Also initialize the card and fill in STATION_ADDR with the station address. */ -int __init hp_probe(struct net_device *dev) +static int __init do_hp_probe(struct net_device *dev) { int i; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -91,13 +91,49 @@ else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; - for (i = 0; hppclan_portlist[i]; i++) + for (i = 0; hppclan_portlist[i]; i++) { if (hp_probe1(dev, hppclan_portlist[i]) == 0) return 0; + dev->irq = irq; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + free_irq(dev->irq, dev); + release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init hp_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_hp_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init hp_probe1(struct net_device *dev, int ioaddr) { int i, retval, board_id, wordmode; @@ -372,7 +408,7 @@ #ifdef MODULE #define MAX_HP_CARDS 4 /* Max number of HP cards per module */ -static struct net_device dev_hp[MAX_HP_CARDS]; +static struct net_device *dev_hp[MAX_HP_CARDS]; static int io[MAX_HP_CARDS]; static int irq[MAX_HP_CARDS]; @@ -388,27 +424,34 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) { - struct net_device *dev = &dev_hp[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->init = hp_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + if (do_hp_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_hp[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -417,14 +460,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) { - struct net_device *dev = &dev_hp[this_dev]; - if (dev->priv != NULL) { - int ioaddr = dev->base_addr - NIC_OFFSET; - void *priv = dev->priv; - free_irq(dev->irq, dev); - release_region(ioaddr, HP_IO_EXTENT); + struct net_device *dev = dev_hp[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:41:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:42:11 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ft25021082 for ; Wed, 12 Nov 2003 16:41:55 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0fmW30188; Wed, 12 Nov 2003 16:41:48 -0800 Date: Wed, 12 Nov 2003 16:41:48 -0800 From: Stephen Hemminger Message-Id: <200311130041.hAD0fmW30188@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (9/42) seeq8005 Cc: netdev@oss.sgi.com X-archive-position: 1381 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4944 Lines: 192 Based on viro NE33-seeq8005 * switched seeq8005 to dynamic allocation * seeq8005: embedded ->priv * seeq8005: fixed resource leaks on failure exits * seeq8005: fixed clobbering on autoprobe * seeq8005: fixed jiffies truncation * seeq8005: fixed a typo in Kconfig - module is _not_ called ewrk3 diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:45 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:45 2003 @@ -72,7 +72,7 @@ extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern struct net_device *SK_init(int unit); -extern int seeq8005_probe(struct net_device *); +extern struct net_device *seeq8005_probe(int unit); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); extern int sun3lance_probe(struct net_device *); @@ -231,13 +231,13 @@ #ifdef CONFIG_SMC9194 {smc_init, 0}, #endif -#ifdef CONFIG_SEEQ8005 - {seeq8005_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SEEQ8005 + {seeq8005_probe, 0}, +#endif #ifdef CONFIG_CS89x0 {cs89x0_probe, 0}, #endif diff -Nru a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c --- a/drivers/net/seeq8005.c Tue Nov 11 09:35:45 2003 +++ b/drivers/net/seeq8005.c Tue Nov 11 09:35:45 2003 @@ -78,8 +78,6 @@ /* Index to functions, as function prototypes. */ -extern int seeq8005_probe(struct net_device *dev); - static int seeq8005_probe1(struct net_device *dev, int ioaddr); static int seeq8005_open(struct net_device *dev); static void seeq8005_timeout(struct net_device *dev); @@ -102,22 +100,48 @@ If dev->base_addr == 1, always return failure. */ -int __init -seeq8005_probe(struct net_device *dev) -{ - int i; - int base_addr = dev ? dev->base_addr : 0; - - if (base_addr > 0x1ff) /* Check a single specified location. */ - return seeq8005_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; seeq8005_portlist[i]; i++) - if (seeq8005_probe1(dev, seeq8005_portlist[i]) == 0) - return 0; +static int io = 0x320; +static int irq = 10; - return -ENODEV; +struct net_device * __init seeq8005_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } + + if (io > 0x1ff) { /* Check a single specified location. */ + err = seeq8005_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = seeq8005_portlist; *port; port++) { + if (seeq8005_probe1(dev, *port) == 0) + break; + } + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, SEEQ8005_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } /* This is the real probe routine. Linux has a history of friendly device @@ -274,6 +298,7 @@ /* Fill in the 'dev' fields. */ dev->base_addr = ioaddr; + dev->irq = irq; /* Retrieve and print the ethernet address. */ for (i = 0; i < 6; i++) @@ -307,13 +332,6 @@ } } #endif - - /* Initialize the device structure. */ - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) - return -ENOMEM; - memset(dev->priv, 0, sizeof(struct net_local)); - dev->open = seeq8005_open; dev->stop = seeq8005_close; dev->hard_start_xmit = seeq8005_send_packet; @@ -321,10 +339,6 @@ dev->watchdog_timeo = HZ/20; dev->get_stats = seeq8005_get_stats; dev->set_multicast_list = set_multicast_list; - - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; return 0; @@ -721,9 +735,7 @@ #ifdef MODULE -static struct net_device dev_seeq = { .init = seeq8005_probe }; -static int io = 0x320; -static int irq = 10; +static struct net_device *dev_seeq; MODULE_LICENSE("GPL"); MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -732,28 +744,17 @@ int init_module(void) { - dev_seeq.irq=irq; - dev_seeq.base_addr=io; - if (register_netdev(&dev_seeq) != 0) - return -EIO; + dev_seeq = seeq8005_probe(-1); + if (IS_ERR(dev_seeq)) + return PTR_ERR(dev_seeq); return 0; } void cleanup_module(void) { - unregister_netdev(&dev_seeq); - - /* - * Free up the private structure, or leak memory :-) - */ - - kfree(dev_seeq.priv); - dev_seeq.priv = NULL; /* gets re-allocated by el1_probe1 */ - - /* - * If we don't do this, we can't re-insmod it later. - */ - release_region(dev_seeq.base_addr, SEEQ8005_IO_EXTENT); + unregister_netdev(dev_seeq); + release_region(dev_seeq->base_addr, SEEQ8005_IO_EXTENT); + free_netdev(dev_seeq); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:43:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43:40 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0hO25022669 for ; Wed, 12 Nov 2003 16:43:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0gSK30513; Wed, 12 Nov 2003 16:42:28 -0800 Date: Wed, 12 Nov 2003 16:42:28 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0gSK30513@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (13/42) e2100 Cc: netdev@oss.sgi.com X-archive-position: 1390 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5118 Lines: 188 Based on viro NE37-e2100 * switched e2100 to dynamic allocation * e2100: fixed order of freeing bugs * e2100: fixed resource leaks on failure exits * e2100: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:35:55 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:35:55 2003 @@ -66,7 +66,7 @@ extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); -extern int e2100_probe(struct net_device *); +extern struct net_device *e2100_probe(int unit); extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); @@ -219,13 +219,13 @@ #ifdef CONFIG_HPLAN_PLUS {hp_plus_probe, 0}, #endif -#ifdef CONFIG_E2100 /* Cabletron E21xx series. */ - {e2100_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_E2100 /* Cabletron E21xx series. */ + {e2100_probe, 0}, +#endif #if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ {ne_probe, 0}, #endif diff -Nru a/drivers/net/e2100.c b/drivers/net/e2100.c --- a/drivers/net/e2100.c Tue Nov 11 09:35:55 2003 +++ b/drivers/net/e2100.c Tue Nov 11 09:35:55 2003 @@ -95,7 +95,6 @@ #define E21_BIG_RX_STOP_PG 0xF0 /* Last page +1 of RX ring */ #define E21_TX_START_PG E21_RX_STOP_PG /* First page of TX buffer */ -int e2100_probe(struct net_device *dev); static int e21_probe1(struct net_device *dev, int ioaddr); static int e21_open(struct net_device *dev); @@ -117,10 +116,11 @@ station address). */ -int __init e2100_probe(struct net_device *dev) +static int __init do_e2100_probe(struct net_device *dev) { int *port; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -129,13 +129,50 @@ else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; - for (port = e21_probe_list; *port; port++) + for (port = e21_probe_list; *port; port++) { + dev->irq = irq; if (e21_probe1(dev, *port) == 0) return 0; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + void *priv = dev->priv; + /* NB: e21_close() handles free_irq */ + release_region(dev->base_addr, E21_IO_EXTENT); + kfree(priv); +} + +struct net_device * __init e2100_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_e2100_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init e21_probe1(struct net_device *dev, int ioaddr) { int i, status, retval; @@ -376,7 +413,7 @@ #ifdef MODULE #define MAX_E21_CARDS 4 /* Max number of E21 cards per module */ -static struct net_device dev_e21[MAX_E21_CARDS]; +static struct net_device *dev_e21[MAX_E21_CARDS]; static int io[MAX_E21_CARDS]; static int irq[MAX_E21_CARDS]; static int mem[MAX_E21_CARDS]; @@ -398,29 +435,36 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) { - struct net_device *dev = &dev_e21[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ - dev->init = e2100_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "e2100.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + dev->mem_start = mem[this_dev]; + dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ + if (do_e2100_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_e21[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -429,13 +473,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) { - struct net_device *dev = &dev_e21[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - /* NB: e21_close() handles free_irq */ - release_region(dev->base_addr, E21_IO_EXTENT); + struct net_device *dev = dev_e21[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:43:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43:44 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0hS25022731 for ; Wed, 12 Nov 2003 16:43:28 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0doC29737; Wed, 12 Nov 2003 16:39:50 -0800 Date: Wed, 12 Nov 2003 16:39:50 -0800 From: Stephen Hemminger Message-Id: <200311130039.hAD0doC29737@mail.osdl.org> To: (0/42), intro@osdl.org, jgarzik@pobox.com Subject: [PATCH] Cc: netdev@oss.sgi.com X-archive-position: 1391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 150 Lines: 4 This is the update to Al viro's changes to probing to have all network devices use dynamic allocation. The patches are against net-drivers-2.5-exp. From shemminger@osdl.org Wed Nov 12 16:43:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0hE25022453 for ; Wed, 12 Nov 2003 16:43:14 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0h8G30660; Wed, 12 Nov 2003 16:43:08 -0800 Date: Wed, 12 Nov 2003 16:43:08 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0h8G30660@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (17/42) wd Cc: netdev@oss.sgi.com X-archive-position: 1389 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4833 Lines: 189 Based on viro NE41-wd * switched wd to dynamic allocation * wd: fixed order of freeing bugs * wd: fixed resource leaks on failure exits * wd: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:36:05 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:36:05 2003 @@ -44,7 +44,7 @@ extern int hp100_probe(struct net_device *dev); extern int ultra_probe(struct net_device *dev); extern int ultra32_probe(struct net_device *dev); -extern int wd_probe(struct net_device *dev); +extern struct net_device *wd_probe(int unit); extern struct net_device *el2_probe(int unit); extern struct net_device *ne_probe(int unit); extern struct net_device *hp_probe(int unit); @@ -207,13 +207,13 @@ #ifdef CONFIG_ULTRA {ultra_probe, 0}, #endif -#ifdef CONFIG_WD80x3 - {wd_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_WD80x3 + {wd_probe, 0}, +#endif #ifdef CONFIG_EL2 /* 3c503 */ {el2_probe, 0}, #endif diff -Nru a/drivers/net/wd.c b/drivers/net/wd.c --- a/drivers/net/wd.c Tue Nov 11 09:36:05 2003 +++ b/drivers/net/wd.c Tue Nov 11 09:36:05 2003 @@ -47,7 +47,6 @@ static unsigned int wd_portlist[] __initdata = {0x300, 0x280, 0x380, 0x240, 0}; -int wd_probe(struct net_device *dev); static int wd_probe1(struct net_device *dev, int ioaddr); static int wd_open(struct net_device *dev); @@ -83,11 +82,14 @@ The wd_probe1() routine initializes the card and fills the station address field. */ -int __init wd_probe(struct net_device *dev) +static int __init do_wd_probe(struct net_device *dev) { int i; struct resource *r; int base_addr = dev->base_addr; + int irq = dev->irq; + int mem_start = dev->mem_start; + int mem_end = dev->mem_end; SET_MODULE_OWNER(dev); @@ -115,11 +117,48 @@ return 0; } release_region(ioaddr, WD_IO_EXTENT); + dev->irq = irq; + dev->mem_start = mem_start; + dev->mem_end = mem_end; } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + free_irq(dev->irq, dev); + release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init wd_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_wd_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init wd_probe1(struct net_device *dev, int ioaddr) { int i; @@ -446,7 +485,7 @@ #ifdef MODULE #define MAX_WD_CARDS 4 /* Max number of wd cards per module */ -static struct net_device dev_wd[MAX_WD_CARDS]; +static struct net_device *dev_wd[MAX_WD_CARDS]; static int io[MAX_WD_CARDS]; static int irq[MAX_WD_CARDS]; static int mem[MAX_WD_CARDS]; @@ -468,29 +507,36 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) { - struct net_device *dev = &dev_wd[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->mem_end = mem_end[this_dev]; - dev->init = wd_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "wd.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + dev->mem_start = mem[this_dev]; + dev->mem_end = mem_end[this_dev]; + if (do_wd_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_wd[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -499,14 +545,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) { - struct net_device *dev = &dev_wd[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - int ioaddr = dev->base_addr - WD_NIC_OFFSET; - free_irq(dev->irq, dev); - release_region(ioaddr, WD_IO_EXTENT); + struct net_device *dev = dev_wd[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:44:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44:49 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0iX25023912 for ; Wed, 12 Nov 2003 16:44:33 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0hmV30812; Wed, 12 Nov 2003 16:43:48 -0800 Date: Wed, 12 Nov 2003 16:43:48 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0hmV30812@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (21/42) sk_mca Cc: netdev@oss.sgi.com X-archive-position: 1396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6410 Lines: 261 NE45-sk_mca * switched sk-mca to dynamic allocation * sk-mca: switched to embedded ->priv * sk-mca: fixed order of freeing bugs * sk-mca: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 13:50:15 2003 +++ b/drivers/net/Space.c Tue Nov 11 13:50:15 2003 @@ -61,7 +61,7 @@ extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); -extern int skmca_probe(struct net_device *); +extern struct net_device *skmca_probe(int unit); extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); @@ -187,6 +187,10 @@ #ifdef CONFIG_ELMC_II /* 3c527 */ {mc32_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 mca_probes2[] __initdata = { #ifdef CONFIG_SKMC /* SKnet Microchannel */ {skmca_probe, 0}, #endif @@ -394,6 +398,7 @@ if (base_addr == 1) return; + probe_list2(unit, mca_probes2, base_addr == 0) && probe_list2(unit, isa_probes2, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } diff -Nru a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c --- a/drivers/net/sk_mca.c Tue Nov 11 13:50:15 2003 +++ b/drivers/net/sk_mca.c Tue Nov 11 13:50:15 2003 @@ -1022,18 +1022,39 @@ static int startslot; /* counts through slots when probing multiple devices */ -int __init skmca_probe(struct net_device *dev) +static void cleanup_card(struct net_device *dev) { + skmca_priv *priv = dev->priv; + DeinitBoard(dev); + if (dev->irq != 0) + free_irq(dev->irq, dev); + mca_mark_as_unused(priv->slot); + mca_set_adapter_procfn(priv->slot, NULL, NULL); +} + +struct net_device * __init skmca_probe(int unit) +{ + struct net_device *dev; int force_detect = 0; int junior, slot, i; int base = 0, irq = 0; skmca_priv *priv; skmca_medium medium; + int err; /* can't work without an MCA bus ;-) */ if (MCA_bus == 0) - return -ENODEV; + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(sizeof(skmca_priv)); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } SET_MODULE_OWNER(dev); @@ -1044,37 +1065,24 @@ /* search through slots */ - if (dev != NULL) { - base = dev->mem_start; - irq = dev->irq; - } - slot = dofind(&junior, startslot); - - while (slot != -1) { + base = dev->mem_start; + irq = dev->base_addr; + for (slot = startslot; (slot = dofind(&junior, slot)) != -1; slot++) { /* deduce card addresses */ getaddrs(slot, junior, &base, &irq, &medium); /* slot already in use ? */ - if (mca_is_adapter_used(slot)) { - slot = dofind(&junior, slot + 1); + if (mca_is_adapter_used(slot)) continue; - } /* were we looking for something different ? */ - if ((dev->irq != 0) || (dev->mem_start != 0)) { - if ((dev->irq != 0) && (dev->irq != irq)) { - slot = dofind(&junior, slot + 1); - continue; - } - if ((dev->mem_start != 0) - && (dev->mem_start != base)) { - slot = dofind(&junior, slot + 1); - continue; - } - } + if (dev->irq && dev->irq != irq) + continue; + if (dev->mem_start && dev->mem_start != base) + continue; /* found something that matches */ @@ -1083,8 +1091,10 @@ /* nothing found ? */ - if (slot == -1) - return ((base != 0) || (irq != 0)) ? ENXIO : ENODEV; + if (slot == -1) { + free_netdev(dev); + return (base || irq) ? ERR_PTR(-ENXIO) : ERR_PTR(-ENODEV); + } /* make procfs entries */ @@ -1102,17 +1112,14 @@ junior ? "Junior MC2" : "MC2+", slot + 1); /* allocate structure */ - priv = dev->priv = - (skmca_priv *) kmalloc(sizeof(skmca_priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; + priv = dev->priv; priv->slot = slot; priv->macbase = base + 0x3fc0; priv->ioregaddr = base + 0x3ff0; priv->ctrladdr = base + 0x3ff2; priv->cmdaddr = base + 0x3ff3; priv->medium = medium; - memset(&(priv->stat), 0, sizeof(struct net_device_stats)); + memset(&priv->stat, 0, sizeof(struct net_device_stats)); spin_lock_init(&priv->lock); /* set base + irq for this device (irq not allocated so far) */ @@ -1146,9 +1153,6 @@ dev->set_multicast_list = skmca_set_multicast_list; dev->flags |= IFF_MULTICAST; - /* generic setup */ - ether_setup(dev); - /* copy out MAC address */ for (i = 0; i < 6; i++) dev->dev_addr[i] = SKMCA_READB(priv->macbase + (i << 1)); @@ -1167,7 +1171,13 @@ startslot = slot + 1; - return 0; + err = register_netdev(dev); + if (err) { + cleanup_card(dev); + free_netdev(dev); + dev = ERR_PTR(err); + } + return dev; } /* ------------------------------------------------------------------------ @@ -1179,51 +1189,34 @@ #define DEVMAX 5 -static struct net_device moddevs[DEVMAX] = { - { .name = " ", .init = skmca_probe }, - { .name = " ", .init = skmca_probe }, - { .name = " ", .init = skmca_probe }, - { .name = " ", .init = skmca_probe }, - { .name = " ", .init = skmca_probe } -}; - -int irq; -int io; +static struct net_device *moddevs[DEVMAX]; int init_module(void) { - int z, res; + int z; startslot = 0; for (z = 0; z < DEVMAX; z++) { - strcpy(moddevs[z].name, " "); - res = register_netdev(moddevs + z); - if (res != 0) - return (z > 0) ? 0 : -EIO; + struct net_device *dev = skmca_probe(-1); + if (IS_ERR(dev)) + break; + moddevs[z] = dev; } - + if (!z) + return -EIO; return 0; } void cleanup_module(void) { - struct net_device *dev; - skmca_priv *priv; int z; for (z = 0; z < DEVMAX; z++) { - dev = moddevs + z; - if (dev->priv != NULL) { - priv = (skmca_priv *) dev->priv; - DeinitBoard(dev); - if (dev->irq != 0) - free_irq(dev->irq, dev); - dev->irq = 0; + struct net_device *dev = moddevs[z]; + if (dev) { unregister_netdev(dev); - mca_mark_as_unused(priv->slot); - mca_set_adapter_procfn(priv->slot, NULL, NULL); - kfree(dev->priv); - dev->priv = NULL; + cleanup_card(dev); + free_netdev(dev); } } } diff -Nru a/drivers/net/sk_mca.h b/drivers/net/sk_mca.h --- a/drivers/net/sk_mca.h Tue Nov 11 13:50:15 2003 +++ b/drivers/net/sk_mca.h Tue Nov 11 13:50:15 2003 @@ -178,7 +178,4 @@ #endif /* _SK_MCA_DRIVER_ */ -extern int skmca_probe(struct net_device *); - - #endif /* _SK_MCA_INCLUDE_ */ From shemminger@osdl.org Wed Nov 12 16:47:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:47:43 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0lO25026665 for ; Wed, 12 Nov 2003 16:47:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0lI431741; Wed, 12 Nov 2003 16:47:18 -0800 Date: Wed, 12 Nov 2003 16:47:18 -0800 From: Stephen Hemminger Message-Id: <200311130047.hAD0lI431741@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (42/42) atari_lance Cc: netdev@oss.sgi.com X-archive-position: 1414 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6172 Lines: 236 NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list diff -urN B9-sun3_lance/drivers/net/Space.c B9-atari_lance/drivers/net/Space.c --- B9-sun3_lance/drivers/net/Space.c Tue Nov 11 20:49:12 2003 +++ B9-atari_lance/drivers/net/Space.c Tue Nov 11 21:17:48 2003 @@ -74,7 +74,7 @@ extern struct net_device *SK_init(int unit); extern struct net_device *seeq8005_probe(int unit); extern struct net_device *smc_init(int unit); -extern int atarilance_probe(struct net_device *); +extern struct net_device *atarilance_probe(struct net_device *); extern struct net_device *sun3lance_probe(int unit); extern struct net_device *sun3_82586_probe(int unit); extern struct net_device *apne_probe(int unit); @@ -103,42 +103,11 @@ /* SBNI adapters */ extern int sbni_probe(int unit); -struct devprobe -{ - int (*probe)(struct net_device *dev); - int status; /* non-zero if autoprobe has failed */ -}; - struct devprobe2 { struct net_device *(*probe)(int unit); int status; /* non-zero if autoprobe has failed */ }; -/* - * probe_list walks a list of probe functions and calls each so long - * as a non-zero ioaddr is given, or as long as it hasn't already failed - * to find a card in the past (as recorded by "status") when asked to - * autoprobe (i.e. a probe that fails to find a card when autoprobing - * will not be asked to autoprobe again). It exits when a card is found. - */ -static int __init probe_list(struct net_device *dev, struct devprobe *plist) -{ - struct devprobe *p = plist; - unsigned long base_addr = dev->base_addr; - - while (p->probe != NULL) { - if (base_addr && p->probe(dev) == 0) /* probe given addr */ - return 0; - else if (p->status == 0) { /* has autoprobe failed yet? */ - p->status = p->probe(dev); /* no, try autoprobe */ - if (p->status == 0) - return 0; - } - p++; - } - return -ENODEV; -} - static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe) { struct net_device *dev; @@ -296,14 +265,10 @@ {NULL, 0}, }; -static struct devprobe m68k_probes[] __initdata = { +static struct devprobe2 m68k_probes[] __initdata = { #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */ {atarilance_probe, 0}, #endif - {NULL, 0}, -}; - -static struct devprobe2 m68k_probes2[] __initdata = { #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */ {sun3lance_probe, 0}, #endif @@ -355,40 +320,6 @@ * per bus interface. This drives the legacy devices only for now. */ -static int __init ethif_probe(int unit) -{ - struct net_device *dev; - int err = -ENODEV; - - dev = alloc_etherdev(0); - if (!dev) - return -ENOMEM; - - sprintf(dev->name, "eth%d", unit); - netdev_boot_setup_check(dev); - - /* - * Backwards compatibility - historically an I/O base of 1 was - * used to indicate not to probe for this ethN interface - */ - if (dev->base_addr == 1) { - free_netdev(dev); - return -ENXIO; - } - - /* - * The arch specific probes are 1st so that any on-board ethernet - * will be probed before other ISA/EISA/MCA/PCI bus cards. - */ - if (probe_list(dev, m68k_probes) == 0) - err = register_netdev(dev); - - if (err) - free_netdev(dev); - return err; - -} - static void __init ethif_probe2(int unit) { unsigned long base_addr = netdev_boot_base("eth", unit); @@ -396,7 +327,7 @@ if (base_addr == 1) return; - probe_list2(unit, m68k_probes2, base_addr == 0) && + probe_list2(unit, m68k_probes, base_addr == 0) && probe_list2(unit, mips_probes, base_addr == 0) && probe_list2(unit, eisa_probes, base_addr == 0) && probe_list2(unit, mca_probes, base_addr == 0) && @@ -485,8 +416,7 @@ trif_probe2(num); #endif for (num = 0; num < 8; ++num) - if (!ethif_probe(num)) - ethif_probe2(num); + ethif_probe2(num); #ifdef CONFIG_COPS cops_probe(0); diff -urN B9-sun3_lance/drivers/net/atarilance.c B9-atari_lance/drivers/net/atarilance.c --- B9-sun3_lance/drivers/net/atarilance.c Mon May 5 03:28:03 2003 +++ B9-atari_lance/drivers/net/atarilance.c Tue Nov 11 21:17:48 2003 @@ -371,26 +371,39 @@ } -int __init atarilance_probe( struct net_device *dev ) -{ +struct net_device * __init atarilance_probe(int unit) +{ int i; static int found; - - SET_MODULE_OWNER(dev); + struct net_device *dev; + int err = -ENODEV; if (!MACH_IS_ATARI || found) /* Assume there's only one board possible... That seems true, since * the Riebl/PAM board's address cannot be changed. */ - return( ENODEV ); + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(sizeof(struct lance_private)); + if (!dev) + return ERR_PTR(-ENOMEM); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + SET_MODULE_OWNER(dev); for( i = 0; i < N_LANCE_ADDR; ++i ) { if (lance_probe1( dev, &lance_addr_list[i] )) { found = 1; - return( 0 ); + err = register_netdev(dev); + if (!err) + return dev; + free_irq(dev->irq, dev); + break; } } - - return( ENODEV ); + free_netdev(dev); + return ERR_PTR(err); } @@ -511,12 +524,6 @@ return( 0 ); probe_ok: - init_etherdev( dev, sizeof(struct lance_private) ); - if (!dev->priv) { - dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL ); - if (!dev->priv) - return 0; - } lp = (struct lance_private *)dev->priv; MEM = (struct lance_memory *)memaddr; IO = lp->iobase = (struct lance_ioreg *)ioaddr; @@ -1171,26 +1178,21 @@ #ifdef MODULE -static struct net_device atarilance_dev; +static struct net_device *atarilance_dev; int init_module(void) - -{ int err; - - atarilance_dev.init = atarilance_probe; - if ((err = register_netdev( &atarilance_dev ))) { - if (err == -EIO) { - printk( "No Atari Lance board found. Module not loaded.\n"); - } - return( err ); - } - return( 0 ); +{ + atarilance_dev = atarilance_probe(-1); + if (IS_ERR(atarilance_dev)) + return PTR_ERR(atarilance_dev); + return 0; } void cleanup_module(void) - { - unregister_netdev( &atarilance_dev ); + unregister_netdev(atarilance_dev); + free_irq(atarilance_dev->irq, atarilance_dev); + free_netdev(atarilance_dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:43:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44:05 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0hj25023074 for ; Wed, 12 Nov 2003 16:43:46 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0hcm30797; Wed, 12 Nov 2003 16:43:38 -0800 Date: Wed, 12 Nov 2003 16:43:38 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0hcm30797@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (20/42) hp100-T10 Cc: netdev@oss.sgi.com X-archive-position: 1392 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 31706 Lines: 1077 NE44-hp100 * convert to dynamic allocation * use device model for PCI and EISA * use pci id's to find PCI devices * fix missing id's for 10 Mbit only PCI boards diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Nov 12 14:44:05 2003 +++ b/drivers/net/Space.c Wed Nov 12 14:44:05 2003 @@ -41,7 +41,7 @@ */ extern int ne2_probe(struct net_device *dev); -extern int hp100_probe(struct net_device *dev); +extern struct net_device *hp100_probe(int unit); extern struct net_device *ultra_probe(int unit); extern int ultra32_probe(struct net_device *dev); extern struct net_device *wd_probe(int unit); @@ -197,14 +197,10 @@ * ISA probes that touch addresses < 0x400 (including those that also * look for EISA/PCI/MCA cards in addition to ISA cards). */ -static struct devprobe isa_probes[] __initdata = { +static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_HP100 /* ISA, EISA & PCI */ {hp100_probe, 0}, #endif - {NULL, 0}, -}; - -static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_3C515 {tc515_probe, 0}, #endif @@ -382,8 +378,7 @@ if (probe_list(dev, m68k_probes) == 0 || probe_list(dev, mips_probes) == 0 || probe_list(dev, eisa_probes) == 0 || - probe_list(dev, mca_probes) == 0 || - probe_list(dev, isa_probes) == 0) + probe_list(dev, mca_probes) == 0) err = register_netdev(dev); if (err) diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Wed Nov 12 14:44:05 2003 +++ b/drivers/net/hp100.c Wed Nov 12 14:44:05 2003 @@ -118,8 +118,6 @@ #include #include -typedef struct net_device_stats hp100_stats_t; - #include "hp100.h" /* @@ -130,23 +128,8 @@ #define HP100_BUS_EISA 1 #define HP100_BUS_PCI 2 -#ifndef PCI_DEVICE_ID_HP_J2585B -#define PCI_DEVICE_ID_HP_J2585B 0x1031 -#endif -#ifndef PCI_VENDOR_ID_COMPEX -#define PCI_VENDOR_ID_COMPEX 0x11f6 -#endif -#ifndef PCI_DEVICE_ID_COMPEX_ENET100VG4 -#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 -#endif -#ifndef PCI_VENDOR_ID_COMPEX2 -#define PCI_VENDOR_ID_COMPEX2 0x101a -#endif -#ifndef PCI_DEVICE_ID_COMPEX2_100VG -#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 -#endif - #define HP100_REGION_SIZE 0x20 /* for ioports */ +#define HP100_SIG_LEN 8 /* same as EISA_SIG_LEN */ #define HP100_MAX_PACKET_SIZE (1536+4) #define HP100_MIN_PACKET_SIZE 60 @@ -165,20 +148,9 @@ * structures */ -struct hp100_eisa_id { - u_int id; - const char *name; - u_char bus; -}; - -struct hp100_pci_id { - u_short vendor; - u_short device; -}; - struct hp100_private { - struct hp100_eisa_id *id; spinlock_t lock; + char id[HP100_SIG_LEN]; u_short chip; u_short soft_model; u_int memory_size; @@ -196,7 +168,7 @@ u_char mac1_mode; u_char mac2_mode; u_char hash_bytes[8]; - hp100_stats_t stats; + struct net_device_stats stats; /* Rings for busmaster mode: */ hp100_ring_t *rxrhead; /* Head (oldest) index into rxring */ @@ -216,83 +188,36 @@ /* * variables */ - -static struct hp100_eisa_id hp100_eisa_ids[] = { - - /* 10/100 EISA card with revision A Cascade chip */ - {0x80F1F022, "HP J2577 rev A", HP100_BUS_EISA}, - - /* 10/100 ISA card with revision A Cascade chip */ - {0x50F1F022, "HP J2573 rev A", HP100_BUS_ISA}, - - /* 10 only EISA card with Cascade chip */ - {0x2019F022, "HP 27248B", HP100_BUS_EISA}, - - /* 10/100 EISA card with Cascade chip */ - {0x4019F022, "HP J2577", HP100_BUS_EISA}, - - /* 10/100 ISA card with Cascade chip */ - {0x5019F022, "HP J2573", HP100_BUS_ISA}, - - /* 10/100 EISA card with AT&T chip */ - {0x9019f022, "HP J2577", HP100_BUS_EISA }, - - /* 10/100 PCI card - old J2585A */ - {0x1030103c, "HP J2585A", HP100_BUS_PCI}, - - /* 10/100 PCI card - new J2585B - master capable */ - {0x1041103c, "HP J2585B", HP100_BUS_PCI}, - - /* 10 Mbit Combo Adapter */ - {0x1042103c, "HP J2970", HP100_BUS_PCI}, - - /* 10 Mbit 10baseT Adapter */ - {0x1040103c, "HP J2973", HP100_BUS_PCI}, - - /* 10/100 EISA card from Compex */ - {0x0103180e, "ReadyLink ENET100-VG4", HP100_BUS_EISA}, - - /* 10/100 EISA card from Compex - FreedomLine (sq5bpf) */ - /* Note: plhbrod@mbox.vol.cz reported that same ID have ISA */ - /* version of adapter, too... */ - {0x0104180e, "FreedomLine 100/VG", HP100_BUS_EISA}, - - /* 10/100 PCI card from Compex - FreedomLine - * - * I think this card doesn't like aic7178 scsi controller, but - * I haven't tested this much. It works fine on diskless machines. - * Jacek Lipkowski - */ - {0x021211f6, "FreedomLine 100/VG", HP100_BUS_PCI}, - - /* 10/100 PCI card from Compex (J2585A compatible) */ - {0x011211f6, "ReadyLink ENET100-VG4", HP100_BUS_PCI}, - - /* 10/100 PCI card from KTI */ - {0x40008e2e, "KTI DP-200", HP100_BUS_PCI } +static const char *hp100_isa_tbl[] = { + "HWPF150", /* HP J2573 rev A */ + "HWP1950", /* HP J2573 */ }; -#define HP100_EISA_IDS_SIZE (sizeof(hp100_eisa_ids)/sizeof(struct hp100_eisa_id)) - -#ifdef CONFIG_PCI -static struct hp100_pci_id hp100_pci_ids[] = { - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A}, - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B}, - {PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4}, - {PCI_VENDOR_ID_COMPEX2, PCI_DEVICE_ID_COMPEX2_100VG} +#ifdef CONFIG_EISA +static struct eisa_device_id hp100_eisa_tbl[] = { + { "HWPF180" }, /* HP J2577 rev A */ + { "HWP1920" }, /* HP 27248B */ + { "HWP1940" }, /* HP J2577 */ + { "HWP1990" }, /* HP J2577 */ + { "CPX0301" }, /* ReadyLink ENET100-VG4 */ + { "CPX0401" }, /* FreedomLine 100/VG */ }; +MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl); #endif -#define HP100_PCI_IDS_SIZE (sizeof(hp100_pci_ids)/sizeof(struct hp100_pci_id)) - +#ifdef CONFIG_PCI static struct pci_device_id hp100_pci_tbl[] = { {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,}, {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,}, + {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2970A, PCI_ANY_ID, PCI_ANY_ID,}, + {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2973A, PCI_ANY_ID, PCI_ANY_ID,}, {PCI_VENDOR_ID_COMPEX, PCI_DEVICE_ID_COMPEX_ENET100VG4, PCI_ANY_ID, PCI_ANY_ID,}, {PCI_VENDOR_ID_COMPEX2, PCI_DEVICE_ID_COMPEX2_100VG, PCI_ANY_ID, PCI_ANY_ID,}, +/* {PCI_VENDOR_ID_KTI, PCI_DEVICE_ID_KTI_DP200, PCI_ANY_ID, PCI_ANY_ID }, */ {} /* Terminating entry */ }; MODULE_DEVICE_TABLE(pci, hp100_pci_tbl); +#endif static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO; static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX; @@ -316,7 +241,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev); static void hp100_rx(struct net_device *dev); -static hp100_stats_t *hp100_get_stats(struct net_device *dev); +static struct net_device_stats *hp100_get_stats(struct net_device *dev); static void hp100_misc_interrupt(struct net_device *dev); static void hp100_update_stats(struct net_device *dev); static void hp100_clear_stats(struct hp100_private *lp, int ioaddr); @@ -370,196 +295,180 @@ * since this could cause problems when the card is not installed. */ -int __init hp100_probe(struct net_device *dev) +/* + * Read board id and convert to string. + * Effectively same code as decode_eisa_sig + */ +static __init const char *hp100_read_id(int ioaddr) { - int base_addr = dev ? dev->base_addr : 0; - int ioaddr = 0; - int pci_start_index = 0; + int i; + static char str[HP100_SIG_LEN]; + unsigned char sig[4], sum; + unsigned short rev; -#ifdef HP100_DEBUG_B - hp100_outw(0x4200, TRACE); - printk("hp100: %s: probe\n", dev->name); -#endif + hp100_page(ID_MAC_ADDR); + sum = 0; + for (i = 0; i < 4; i++) { + sig[i] = hp100_inb(BOARD_ID + i); + sum += sig[i]; + } - if (base_addr > 0xff) { /* Check a single specified location. */ - if (check_region(base_addr, HP100_REGION_SIZE)) - return -EINVAL; - if (base_addr < 0x400) - return hp100_probe1(dev, base_addr, HP100_BUS_ISA, - NULL); - if (EISA_bus && base_addr >= 0x1c38 && ((base_addr - 0x1c38) & 0x3ff) == 0) - return hp100_probe1(dev, base_addr, HP100_BUS_EISA, NULL); -#ifdef CONFIG_PCI - printk("hp100: %s: You must specify card # in i/o address parameter for PCI bus...", dev->name); -#else - return -ENODEV; -#endif - } else -#ifdef CONFIG_PCI - if (base_addr > 0 && base_addr < 8 + 1) - pci_start_index = 0x100 | (base_addr - 1); - else -#endif - if (base_addr != 0) - return -ENXIO; + sum += hp100_inb(BOARD_ID + i); + if (sum != 0xff) + return NULL; /* bad checksum */ - /* First: scan PCI bus(es) */ + str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1); + str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1); + str[2] = (sig[1] & 0x1f) + ('A' - 1); + rev = (sig[2] << 8) | sig[3]; + sprintf(str + 3, "%04X", rev); -#ifdef CONFIG_PCI - { - int pci_index; - struct pci_dev *pci_dev = NULL; - int pci_id_index; - u_short pci_command; - -#ifdef HP100_DEBUG_PCI - printk("hp100: %s: PCI BIOS is present, checking for devices..\n", dev->name); -#endif - pci_index = 0; - for (pci_id_index = 0; pci_id_index < HP100_PCI_IDS_SIZE; - pci_id_index++) { - while ((pci_dev = pci_find_device(hp100_pci_ids[pci_id_index].vendor, - hp100_pci_ids[pci_id_index].device, - pci_dev)) != NULL) { - if (pci_index < (pci_start_index & 7)) { - pci_index++; - continue; - } - if (pci_enable_device(pci_dev)) - continue; - /* found... */ - ioaddr = pci_resource_start(pci_dev, 0); - if (check_region(ioaddr, HP100_REGION_SIZE)) - continue; - pci_read_config_word(pci_dev, PCI_COMMAND, &pci_command); - if (!(pci_command & PCI_COMMAND_IO)) { -#ifdef HP100_DEBUG - printk("hp100: %s: PCI I/O Bit has not been set. Setting...\n", dev->name); -#endif - pci_command |= PCI_COMMAND_IO; - pci_write_config_word(pci_dev, PCI_COMMAND, pci_command); - } - if (!(pci_command & PCI_COMMAND_MASTER)) { -#ifdef HP100_DEBUG - printk("hp100: %s: PCI Master Bit has not been set. Setting...\n", dev->name); -#endif - pci_command |= PCI_COMMAND_MASTER; - pci_write_config_word(pci_dev, PCI_COMMAND, pci_command); - } -#ifdef HP100_DEBUG - printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr); -#endif - if (hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pci_dev) == 0) - return 0; - } - } - } - if (pci_start_index > 0) - return -ENODEV; -#endif /* CONFIG_PCI */ + return str; +} - /* Second: Probe all EISA possible port regions (if EISA bus present) */ - for (ioaddr = 0x1c38; EISA_bus && ioaddr < 0x10000; ioaddr += 0x400) { - if (check_region(ioaddr, HP100_REGION_SIZE)) - continue; - if (hp100_probe1(dev, ioaddr, HP100_BUS_EISA, NULL) == 0) - return 0; - } +static __init int hp100_isa_probe1(struct net_device *dev, int addr) +{ + const char *sig; + int i; + + if (!request_region(addr, HP100_REGION_SIZE, "hp100")) + goto err; + + sig = hp100_read_id(addr); + release_region(addr, HP100_REGION_SIZE); + + if (sig == NULL) + goto err; + + for (i = 0; i < ARRAY_SIZE(hp100_isa_tbl); i++) { + if (!strcmp(hp100_isa_tbl[i], sig)) + break; - /* Third: Probe all ISA possible port regions */ - for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) { - if (check_region(ioaddr, HP100_REGION_SIZE)) - continue; - if (hp100_probe1(dev, ioaddr, HP100_BUS_ISA, NULL) == 0) - return 0; } + if (i < ARRAY_SIZE(hp100_isa_tbl)) + return hp100_probe1(dev, addr, HP100_BUS_ISA, NULL); + err: return -ENODEV; + +} +/* + * Probe for ISA board. + * EISA and PCI are handled by device infrastructure. + */ + +static int __init hp100_isa_probe(struct net_device *dev, int addr) +{ + int err = -ENODEV; + + /* Probe for a specific ISA address */ + if (addr > 0xff && addr < 0x400) + err = hp100_isa_probe1(dev, addr); + + else if (addr != 0) + err = -ENXIO; + + else { + /* Probe all ISA possible port regions */ + for (addr = 0x100; addr < 0x400; addr += 0x20) { + err = hp100_isa_probe1(dev, addr); + if (!err) + break; + } + } + return err; +} + + +struct net_device * __init hp100_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); + int err; + + if (!dev) + return ERR_PTR(-ENODEV); + + SET_MODULE_OWNER(dev); + +#ifdef HP100_DEBUG_B + hp100_outw(0x4200, TRACE); + printk("hp100: %s: probe\n", dev->name); +#endif + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + + err = hp100_isa_probe(dev, dev->base_addr); + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; + out1: + release_region(dev->base_addr, HP100_REGION_SIZE); + out: + free_netdev(dev); + return ERR_PTR(err); } static int __init hp100_probe1(struct net_device *dev, int ioaddr, u_char bus, struct pci_dev *pci_dev) { int i; - - u_char uc, uc_1; - u_int eisa_id; + int err = -ENODEV; + const char *eid; u_int chip; + u_char uc; u_int memory_size = 0, virt_memory_size = 0; u_short local_mode, lsw; short mem_mapped; unsigned long mem_ptr_phys; void **mem_ptr_virt; struct hp100_private *lp; - struct hp100_eisa_id *eid; #ifdef HP100_DEBUG_B hp100_outw(0x4201, TRACE); printk("hp100: %s: probe1\n", dev->name); #endif - if (dev == NULL) { -#ifdef HP100_DEBUG - printk("hp100_probe1: %s: dev == NULL ?\n", dev->name); -#endif - return -EIO; - } + /* memory region for programmed i/o */ + if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100")) + goto out1; - if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) { - return -ENODEV; - } else { - chip = hp100_inw(PAGING) & HP100_CHIPID_MASK; + if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) + goto out2; + + chip = hp100_inw(PAGING) & HP100_CHIPID_MASK; #ifdef HP100_DEBUG - if (chip == HP100_CHIPID_SHASTA) - printk("hp100: %s: Shasta Chip detected. (This is a pre 802.12 chip)\n", dev->name); - else if (chip == HP100_CHIPID_RAINIER) - printk("hp100: %s: Rainier Chip detected. (This is a pre 802.12 chip)\n", dev->name); - else if (chip == HP100_CHIPID_LASSEN) - printk("hp100: %s: Lassen Chip detected.\n", dev->name); - else - printk("hp100: %s: Warning: Unknown CASCADE chip (id=0x%.4x).\n", dev->name, chip); + if (chip == HP100_CHIPID_SHASTA) + printk("hp100: %s: Shasta Chip detected. (This is a pre 802.12 chip)\n", dev->name); + else if (chip == HP100_CHIPID_RAINIER) + printk("hp100: %s: Rainier Chip detected. (This is a pre 802.12 chip)\n", dev->name); + else if (chip == HP100_CHIPID_LASSEN) + printk("hp100: %s: Lassen Chip detected.\n", dev->name); + else + printk("hp100: %s: Warning: Unknown CASCADE chip (id=0x%.4x).\n", dev->name, chip); #endif - } dev->base_addr = ioaddr; - hp100_page(ID_MAC_ADDR); - for (i = uc = eisa_id = 0; i < 4; i++) { - eisa_id >>= 8; - uc_1 = hp100_inb(BOARD_ID + i); - eisa_id |= uc_1 << 24; - uc += uc_1; - } - uc += hp100_inb(BOARD_ID + 4); - - if (uc != 0xff) { /* bad checksum? */ - printk("hp100_probe: %s: bad EISA ID checksum at base port 0x%x\n", dev->name, ioaddr); - return -ENODEV; - } - - for (i = 0; i < HP100_EISA_IDS_SIZE; i++) - if (hp100_eisa_ids[i].id == eisa_id) - break; - if (i >= HP100_EISA_IDS_SIZE) { - for (i = 0; i < HP100_EISA_IDS_SIZE; i++) - if ((hp100_eisa_ids[i].id & 0xf0ffffff) == (eisa_id & 0xf0ffffff)) - break; - if (i >= HP100_EISA_IDS_SIZE) { - printk ("hp100_probe: %s: card at port 0x%x isn't known (id = 0x%x)\n", dev->name, ioaddr, eisa_id); - return -ENODEV; - } - } - eid = &hp100_eisa_ids[i]; - if ((eid->id & 0x0f000000) < (eisa_id & 0x0f000000)) { - printk("hp100_probe: %s: newer version of card %s at port 0x%x - unsupported\n", dev->name, eid->name, ioaddr); - return -ENODEV; + eid = hp100_read_id(ioaddr); + if (eid == NULL) { /* bad checksum? */ + printk(KERN_WARNING "hp100_probe: bad ID checksum at base port 0x%x\n", ioaddr); + goto out2; } + hp100_page(ID_MAC_ADDR); for (i = uc = 0; i < 7; i++) uc += hp100_inb(LAN_ADDR + i); if (uc != 0xff) { - printk("hp100_probe: %s: bad lan address checksum (card %s at port 0x%x)\n", dev->name, eid->name, ioaddr); - return -EIO; + printk(KERN_WARNING "hp100_probe: bad lan address checksum at port 0x%x)\n", ioaddr); + err = -EIO; + goto out2; } /* Make sure, that all registers are correctly updated... */ @@ -607,17 +516,17 @@ hp100_outw(HP100_MEM_EN | HP100_RESET_LB, OPTION_LSW); hp100_outw(HP100_IO_EN | HP100_SET_LB, OPTION_LSW); hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_RESET_HB, OPTION_LSW); - printk("hp100: %s: IO mapped mode forced.\n", dev->name); + printk("hp100: IO mapped mode forced.\n"); } else if (local_mode == 2) { hp100_outw(HP100_MEM_EN | HP100_SET_LB, OPTION_LSW); hp100_outw(HP100_IO_EN | HP100_SET_LB, OPTION_LSW); hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_RESET_HB, OPTION_LSW); - printk("hp100: %s: Shared memory mode requested.\n", dev->name); + printk("hp100: Shared memory mode requested.\n"); } else if (local_mode == 4) { if (chip == HP100_CHIPID_LASSEN) { hp100_outw(HP100_BM_WRITE | HP100_BM_READ | HP100_SET_HB, OPTION_LSW); hp100_outw(HP100_IO_EN | HP100_MEM_EN | HP100_RESET_LB, OPTION_LSW); - printk("hp100: %s: Busmaster mode requested.\n", dev->name); + printk("hp100: Busmaster mode requested.\n"); } local_mode = 1; } @@ -643,7 +552,7 @@ /* Gracefully fallback to shared memory */ goto busmasterfail; } - printk("hp100: %s: Busmaster mode enabled.\n", dev->name); + printk("hp100: Busmaster mode enabled.\n"); hp100_outw(HP100_MEM_EN | HP100_IO_EN | HP100_RESET_LB, OPTION_LSW); } else { busmasterfail: @@ -675,7 +584,7 @@ mem_ptr_phys &= ~0x1fff; /* 8k alignment */ if (bus == HP100_BUS_ISA && (mem_ptr_phys & ~0xfffff) != 0) { - printk("hp100: %s: Can only use programmed i/o mode.\n", dev->name); + printk("hp100: Can only use programmed i/o mode.\n"); mem_ptr_phys = 0; mem_mapped = 0; local_mode = 3; /* Use programmed i/o */ @@ -699,7 +608,7 @@ } if (mem_ptr_virt == NULL) { /* all ioremap tries failed */ - printk("hp100: %s: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n", dev->name); + printk("hp100: Failed to ioremap the PCI card memory. Will have to use i/o mapped mode.\n"); local_mode = 3; virt_memory_size = 0; } @@ -710,17 +619,14 @@ mem_mapped = 0; mem_ptr_phys = 0; mem_ptr_virt = NULL; - printk("hp100: %s: Using (slow) programmed i/o mode.\n", dev->name); + printk("hp100: Using (slow) programmed i/o mode.\n"); } /* Initialise the "private" data structure for this card. */ - if ((dev->priv = kmalloc(sizeof(struct hp100_private), GFP_KERNEL)) == NULL) - return -ENOMEM; - lp = (struct hp100_private *) dev->priv; - memset(lp, 0, sizeof(struct hp100_private)); + spin_lock_init(&lp->lock); - lp->id = eid; + strlcpy(lp->id, eid, HP100_SIG_LEN); lp->chip = chip; lp->mode = local_mode; lp->bus = bus; @@ -741,9 +647,6 @@ lp->virt_memory_size = virt_memory_size; lp->rx_ratio = hp100_rx_ratio; /* can be conf'd with insmod */ - /* memory region for programmed i/o */ - request_region(dev->base_addr, HP100_REGION_SIZE, eid->name); - dev->open = hp100_open; dev->stop = hp100_close; @@ -776,10 +679,6 @@ /* Reset statistics (counters) */ hp100_clear_stats(lp, ioaddr); - SET_MODULE_OWNER(dev); - SET_NETDEV_DEV(dev, &pci_dev->dev); - ether_setup(dev); - /* If busmaster mode is wanted, a dma-capable memory area is needed for * the rx and tx PDLs * PCI cards can access the whole PC memory. Therefore GFP_DMA is not @@ -795,8 +694,10 @@ /* Conversion to new PCI API : * Pages are always aligned and zeroed, no need to it ourself. * Doc says should be OK for EISA bus as well - Jean II */ - if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL) - return -ENOMEM; + if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL) { + err = -ENOMEM; + goto out2; + } lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn); #ifdef HP100_DEBUG_BM @@ -818,7 +719,7 @@ lp->lan_type = hp100_sense_lan(dev); /* Print out a message what about what we think we have probed. */ - printk("hp100: %s: %s at 0x%x, IRQ %d, ", dev->name, lp->id->name, ioaddr, dev->irq); + printk("hp100: at 0x%x, IRQ %d, ", ioaddr, dev->irq); switch (bus) { case HP100_BUS_EISA: printk("EISA"); @@ -833,7 +734,7 @@ printk(" bus, %dk SRAM (rx/tx %d%%).\n", lp->memory_size >> 10, lp->rx_ratio); if (lp->mode == 2) { /* memory mapped */ - printk("hp100: %s: Memory area at 0x%lx-0x%lx", dev->name, mem_ptr_phys, + printk("hp100: Memory area at 0x%lx-0x%lx", mem_ptr_phys, (mem_ptr_phys + (mem_ptr_phys > 0x100000 ? (u_long) lp->memory_size : 16 * 1024)) - 1); if (mem_ptr_virt) printk(" (virtual base %p)", mem_ptr_virt); @@ -843,7 +744,8 @@ dev->mem_start = mem_ptr_phys; dev->mem_end = mem_ptr_phys + lp->memory_size; } - printk("hp100: %s: ", dev->name); + + printk("hp100: "); if (lp->lan_type != HP100_LAN_ERR) printk("Adapter is attached to "); switch (lp->lan_type) { @@ -861,6 +763,10 @@ } return 0; +out2: + release_region(ioaddr, HP100_REGION_SIZE); +out1: + return -ENODEV; } /* This procedure puts the card into a stable init state */ @@ -950,6 +856,7 @@ /* Finally try to log in the Hub if there may be a VG connection. */ if ((lp->lan_type == HP100_LAN_100) || (lp->lan_type == HP100_LAN_ERR)) hp100_login_to_vg_hub(dev, 0); /* relogin */ + } @@ -1152,7 +1059,7 @@ if (request_irq(dev->irq, hp100_interrupt, lp->bus == HP100_BUS_PCI || lp->bus == HP100_BUS_EISA ? SA_SHIRQ : SA_INTERRUPT, - lp->id->name, dev)) { + "hp100", dev)) { printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq); return -EAGAIN; } @@ -2054,7 +1961,7 @@ /* * statistics */ -static hp100_stats_t *hp100_get_stats(struct net_device *dev) +static struct net_device_stats *hp100_get_stats(struct net_device *dev) { unsigned long flags; int ioaddr = dev->base_addr; @@ -2558,10 +2465,14 @@ return HP100_LAN_COAX; } - if ((lp->id->id == 0x02019F022) || - (lp->id->id == 0x01042103c) || (lp->id->id == 0x01040103c)) - return HP100_LAN_ERR; /* Those cards don't have a 100 Mbit connector */ - + /* Those cards don't have a 100 Mbit connector */ + if ( !strcmp(lp->id, "HWP1920") || + (lp->pci_dev && + lp->pci_dev->vendor == PCI_VENDOR_ID && + (lp->pci_dev->device == PCI_DEVICE_ID_HP_J2970A || + lp->pci_dev->device == PCI_DEVICE_ID_HP_J2973A))) + return HP100_LAN_ERR; + if (val_VG & HP100_LINK_CABLE_ST) /* Can hear the HUBs tone. */ return HP100_LAN_100; return HP100_LAN_ERR; @@ -2915,121 +2826,247 @@ #endif +static void cleanup_dev(struct net_device *d) +{ + struct hp100_private *p = (struct hp100_private *) d->priv; + + unregister_netdev(d); + release_region(d->base_addr, HP100_REGION_SIZE); + + if (p->mode == 1) /* busmaster */ + pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f, + p->page_vaddr_algn, + virt_to_whatever(d, p->page_vaddr_algn)); + if (p->mem_ptr_virt) + iounmap(p->mem_ptr_virt); + + free_netdev(d); +} + +#ifdef CONFIG_EISA +static int __init hp100_eisa_probe (struct device *gendev) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); + struct eisa_device *edev = to_eisa_device(gendev); + int err; + + if (!dev) + return -ENOMEM; + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &edev->dev); + + err = hp100_probe1(dev, edev->base_addr, HP100_BUS_EISA, NULL); + if (err) + goto out1; + + err = register_netdev(dev); + if (err) + goto out2; + +#ifdef HP100_DEBUG + printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name, + dev->base_addr); +#endif + gendev->driver_data = dev; + return 0; + out2: + release_region(dev->base_addr, HP100_REGION_SIZE); + out1: + free_netdev(dev); + return err; +} + +static int __devexit hp100_eisa_remove (struct device *gendev) +{ + struct net_device *dev = gendev->driver_data; + cleanup_dev(dev); + return 0; +} + +static struct eisa_driver hp100_eisa_driver = { + .id_table = hp100_eisa_tbl, + .driver = { + .name = "hp100", + .probe = hp100_eisa_probe, + .remove = __devexit_p (hp100_eisa_remove), + } +}; +#endif + +#ifdef CONFIG_PCI +static int __devinit hp100_pci_probe (struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); + int ioaddr = pci_resource_start(pdev, 0); + u_short pci_command; + int err; + + if (!dev) + return -ENOMEM; + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &pdev->dev); + + pci_read_config_word(pdev, PCI_COMMAND, &pci_command); + if (!(pci_command & PCI_COMMAND_IO)) { +#ifdef HP100_DEBUG + printk("hp100: %s: PCI I/O Bit has not been set. Setting...\n", dev->name); +#endif + pci_command |= PCI_COMMAND_IO; + pci_write_config_word(pdev, PCI_COMMAND, pci_command); + } + + if (!(pci_command & PCI_COMMAND_MASTER)) { +#ifdef HP100_DEBUG + printk("hp100: %s: PCI Master Bit has not been set. Setting...\n", dev->name); +#endif + pci_command |= PCI_COMMAND_MASTER; + pci_write_config_word(pdev, PCI_COMMAND, pci_command); + } + + + err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev); + if (err) + goto out1; + err = register_netdev(dev); + if (err) + goto out2; + +#ifdef HP100_DEBUG + printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr); +#endif + pci_set_drvdata(pdev, dev); + return 0; + out2: + release_region(dev->base_addr, HP100_REGION_SIZE); + out1: + free_netdev(dev); + return err; +} + +static void __devexit hp100_pci_remove (struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + cleanup_dev(dev); +} + + +static struct pci_driver hp100_pci_driver = { + .name = "hp100", + .id_table = hp100_pci_tbl, + .probe = hp100_pci_probe, + .remove = __devexit_p(hp100_pci_remove), +}; +#endif + /* * module section */ -#ifdef MODULE - MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jaroslav Kysela , " "Siegfried \"Frieder\" Loeffler (dg1sek) "); MODULE_DESCRIPTION("HP CASCADE Architecture Driver for 100VG-AnyLan Network Adapters"); /* - * Note: if you have more than five 100vg cards in your pc, feel free to - * increase this value - */ - -#define HP100_DEVICES 5 - -/* - * Note: to register three eisa or pci devices, use: + * Note: to register three isa devices, use: * option hp100 hp100_port=0,0,0 * to register one card at io 0x280 as eth239, use: - * option hp100 hp100_port=0x280 hp100_name=eth239 + * option hp100 hp100_port=0x280 */ - +#if defined(MODULE) && defined(CONFIG_ISA) +#define HP100_DEVICES 5 /* Parameters set by insmod */ static int hp100_port[HP100_DEVICES] = { 0, [1 ... (HP100_DEVICES-1)] = -1 }; MODULE_PARM(hp100_port, "1-" __MODULE_STRING(HP100_DEVICES) "i"); -/* Allocate HP100_DEVICES strings of length IFNAMSIZ, one string for each device */ -static char hp100_name[HP100_DEVICES][IFNAMSIZ] = { "", "", "", "", "" }; -/* Allow insmod to write those HP100_DEVICES strings individually */ -MODULE_PARM(hp100_name, "1-" __MODULE_STRING(HP100_DEVICES) "c" __MODULE_STRING(IFNAMSIZ)); - /* List of devices */ static struct net_device *hp100_devlist[HP100_DEVICES]; -static void release_dev(int i) +static int __init hp100_isa_init(void) { - struct net_device *d = hp100_devlist[i]; - struct hp100_private *p = (struct hp100_private *) d->priv; + struct net_device *dev; + int i, err, cards = 0; - unregister_netdev(d); - release_region(d->base_addr, HP100_REGION_SIZE); + /* Don't autoprobe ISA bus */ + if (hp100_port[0] == 0) + return -ENODEV; - if (p->mode == 1) /* busmaster */ - pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f, p->page_vaddr_algn, virt_to_whatever(d, p->page_vaddr_algn)); - if (p->mem_ptr_virt) - iounmap(p->mem_ptr_virt); - kfree(d->priv); - d->priv = NULL; - free_netdev(d); - hp100_devlist[i] = NULL; + /* Loop on all possible base addresses */ + for (i = 0; i < HP100_DEVICES && hp100_port[i] != -1; ++i) { + dev = alloc_etherdev(sizeof(struct hp100_private)); + if (!dev) { + printk(KERN_WARNING "hp100: no memory for network device\n"); + while (cards > 0) + cleanup_dev(hp100_devlist[--cards]); + + return -ENOMEM; + } + SET_MODULE_OWNER(dev); + + err = hp100_isa_probe(dev, hp100_port[i]); + if (!err) { + err = register_netdev(dev); + if (!err) + hp100_devlist[cards++] = dev; + else + release_region(dev->base_addr, HP100_REGION_SIZE); + } + + if (err) + free_netdev(dev); + } + + return cards > 0 ? 0 : -ENODEV; } -static int __init hp100_module_init(void) +static void __exit hp100_isa_cleanup(void) { - int i, cards; + int i; -#ifndef CONFIG_PCI - if (hp100_port == 0 && !EISA_bus) - printk("hp100: You should not use auto-probing with insmod!\n"); + for (i = 0; i < HP100_DEVICES; i++) { + struct net_device *dev = hp100_devlist[i]; + if (dev) + cleanup_dev(dev); + } +} +#else +#define hp100_isa_init() (0) +#define hp100_isa_cleanup() do { } while(0) #endif - /* Loop on all possible base addresses */ - i = -1; - cards = 0; - while ((hp100_port[++i] != -1) && (i < HP100_DEVICES)) { - /* Create device and set basics args */ - hp100_devlist[i] = kmalloc(sizeof(struct net_device), GFP_KERNEL); - if (!hp100_devlist[i]) - goto fail; - memset(hp100_devlist[i], 0x00, sizeof(struct net_device)); -#if LINUX_VERSION_CODE >= 0x020362 /* 2.3.99-pre7 */ - memcpy(hp100_devlist[i]->name, hp100_name[i], IFNAMSIZ); /* Copy name */ -#else - hp100_devlist[i]->name = hp100_name[i]; -#endif /* LINUX_VERSION_CODE >= 0x020362 */ - hp100_devlist[i]->base_addr = hp100_port[i]; - hp100_devlist[i]->init = &hp100_probe; - - /* Try to create the device */ - if (register_netdev(hp100_devlist[i]) != 0) { - /* DeAllocate everything */ - /* Note: if dev->priv is mallocated, there is no way to fail */ - kfree(hp100_devlist[i]); - hp100_devlist[i] = (struct net_device *) NULL; - } else - cards++; - } /* Loop over all devices */ +static int __init hp100_module_init(void) +{ + int err; - return cards > 0 ? 0 : -ENODEV; - fail: - while (cards && --i) - if (hp100_devlist[i]) { - release_dev(i); - --cards; - } - return -ENOMEM; + err = hp100_isa_init(); + +#ifdef CONFIG_EISA + err |= eisa_driver_register(&hp100_eisa_driver); +#endif +#ifdef CONFIG_PCI + err |= pci_module_init(&hp100_pci_driver); +#endif + return err; } + static void __exit hp100_module_exit(void) { - int i; - - /* TODO: Check if all skb's are released/freed. */ - for (i = 0; i < HP100_DEVICES; i++) - if (hp100_devlist[i] != (struct net_device *) NULL) - release_dev(i); + hp100_isa_cleanup(); +#ifdef CONFIG_EISA + eisa_driver_unregister (&hp100_eisa_driver); +#endif +#ifdef CONFIG_PCI + pci_unregister_driver (&hp100_pci_driver); +#endif } module_init(hp100_module_init) module_exit(hp100_module_exit) - -#endif /* MODULE */ /* diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h --- a/include/linux/pci_ids.h Wed Nov 12 14:44:05 2003 +++ b/include/linux/pci_ids.h Wed Nov 12 14:44:05 2003 @@ -626,6 +626,8 @@ #define PCI_DEVICE_ID_HP_TACHLITE 0x1029 #define PCI_DEVICE_ID_HP_J2585A 0x1030 #define PCI_DEVICE_ID_HP_J2585B 0x1031 +#define PCI_DEVICE_ID_HP_J2973A 0x1040 +#define PCI_DEVICE_ID_HP_J2970A 0x1042 #define PCI_DEVICE_ID_HP_DIVA 0x1048 #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A From shemminger@osdl.org Wed Nov 12 16:45:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:45:20 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0j225024441 for ; Wed, 12 Nov 2003 16:45:02 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0iIv30919; Wed, 12 Nov 2003 16:44:18 -0800 Date: Wed, 12 Nov 2003 16:44:18 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0iIv30919@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (24/42) ne2 Cc: netdev@oss.sgi.com X-archive-position: 1399 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5314 Lines: 202 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 13:52:10 2003 +++ b/drivers/net/Space.c Tue Nov 11 13:52:10 2003 @@ -40,7 +40,7 @@ ethernet adaptor have the name "eth[0123...]". */ -extern int ne2_probe(struct net_device *dev); +extern struct net_device *ne2_probe(int unit); extern struct net_device *hp100_probe(int unit); extern struct net_device *ultra_probe(int unit); extern int ultra32_probe(struct net_device *dev); @@ -176,15 +176,10 @@ {NULL, 0}, }; - -static struct devprobe mca_probes[] __initdata = { +static struct devprobe2 mca_probes[] __initdata = { #ifdef CONFIG_NE2_MCA {ne2_probe, 0}, #endif - {NULL, 0}, -}; - -static struct devprobe2 mca_probes2[] __initdata = { #ifdef CONFIG_ELMC /* 3c523 */ {elmc_probe, 0}, #endif @@ -201,7 +196,7 @@ * ISA probes that touch addresses < 0x400 (including those that also * look for EISA/PCI/MCA cards in addition to ISA cards). */ -static struct devprobe2 isa_probes2[] __initdata = { +static struct devprobe2 isa_probes[] __initdata = { #ifdef CONFIG_HP100 /* ISA, EISA & PCI */ {hp100_probe, 0}, #endif @@ -381,8 +376,7 @@ */ if (probe_list(dev, m68k_probes) == 0 || probe_list(dev, mips_probes) == 0 || - probe_list(dev, eisa_probes) == 0 || - probe_list(dev, mca_probes) == 0) + probe_list(dev, eisa_probes) == 0) err = register_netdev(dev); if (err) @@ -398,8 +392,8 @@ if (base_addr == 1) return; - probe_list2(unit, mca_probes2, base_addr == 0) && - probe_list2(unit, isa_probes2, base_addr == 0) && + probe_list2(unit, mca_probes, base_addr == 0) && + probe_list2(unit, isa_probes, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } diff -Nru a/drivers/net/ne2.c b/drivers/net/ne2.c --- a/drivers/net/ne2.c Tue Nov 11 13:52:10 2003 +++ b/drivers/net/ne2.c Tue Nov 11 13:52:10 2003 @@ -242,7 +242,7 @@ * Note that at boot, this probe only picks up one card at a time. */ -int __init ne2_probe(struct net_device *dev) +static int __init do_ne2_probe(struct net_device *dev) { static int current_mca_slot = -1; int i; @@ -262,16 +262,55 @@ mca_find_unused_adapter(ne2_adapters[i].id, 0); if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) { + int res; mca_set_adapter_name(current_mca_slot, ne2_adapters[i].name); mca_mark_as_used(current_mca_slot); - return ne2_probe1(dev, current_mca_slot); + res = ne2_probe1(dev, current_mca_slot); + if (res) + mca_mark_as_unused(current_mca_slot); + return res; } } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + mca_mark_as_unused(ei_status.priv); + mca_set_adapter_procfn( ei_status.priv, NULL, NULL); + kfree(dev->priv); + free_irq(dev->irq, dev); + release_region(dev->base_addr, NE_IO_EXTENT); +} + +struct net_device * __init ne2_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_ne2_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} static int ne2_procinfo(char *buf, int slot, struct net_device *dev) { @@ -735,7 +774,7 @@ #ifdef MODULE #define MAX_NE_CARDS 4 /* Max number of NE cards per module */ -static struct net_device dev_ne[MAX_NE_CARDS]; +static struct net_device *dev_ne[MAX_NE_CARDS]; static int io[MAX_NE_CARDS]; static int irq[MAX_NE_CARDS]; static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */ @@ -754,23 +793,31 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; dev->irq = irq[this_dev]; dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; - dev->init = ne2_probe; - if (register_netdev(dev) != 0) { - if (found != 0) return 0; /* Got at least one. */ - - printk(KERN_WARNING "ne2.c: No NE/2 card found.\n"); - return -ENXIO; + if (do_ne2_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_ne[found++] = dev; + continue; + } + cleanup_card(dev); } - found++; + free_netdev(dev); + break; } - return 0; + if (found) + return 0; + printk(KERN_WARNING "ne2.c: No NE/2 card found\n"); + return -ENXIO; } void cleanup_module(void) @@ -778,14 +825,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; - if (dev->priv != NULL) { - mca_mark_as_unused(ei_status.priv); - mca_set_adapter_procfn( ei_status.priv, NULL, NULL); - kfree(dev->priv); - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE_IO_EXTENT); + struct net_device *dev = dev_ne[this_dev]; + if (dev) { unregister_netdev(dev); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:45:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:45:55 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ja25025038 for ; Wed, 12 Nov 2003 16:45:36 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0jS931210; Wed, 12 Nov 2003 16:45:28 -0800 Date: Wed, 12 Nov 2003 16:45:28 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0jS931210@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (31/42) mac89x0 Cc: netdev@oss.sgi.com X-archive-position: 1402 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5493 Lines: 204 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:15:51 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:15:51 2003 @@ -89,7 +89,7 @@ extern int mace_probe(struct net_device *dev); extern int macsonic_probe(struct net_device *dev); extern int mac8390_probe(struct net_device *dev); -extern int mac89x0_probe(struct net_device *dev); +extern struct net_device *mac89x0_probe(int unit); extern struct net_device *mc32_probe(int unit); extern struct net_device *cops_probe(int unit); extern struct net_device *ltpc_probe(void); @@ -329,6 +329,10 @@ #ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */ {mac8390_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 m68k_probes2[] __initdata = { #ifdef CONFIG_MAC89x0 {mac89x0_probe, 0}, #endif @@ -391,6 +395,7 @@ if (base_addr == 1) return; + probe_list2(unit, m68k_probes2, base_addr == 0) && probe_list2(unit, mips_probes, base_addr == 0) && probe_list2(unit, eisa_probes, base_addr == 0) && probe_list2(unit, mca_probes, base_addr == 0) && diff -Nru a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c --- a/drivers/net/mac89x0.c Tue Nov 11 14:15:51 2003 +++ b/drivers/net/mac89x0.c Tue Nov 11 14:15:51 2003 @@ -123,7 +123,6 @@ /* Index to functions, as function prototypes. */ -extern int mac89x0_probe(struct net_device *dev); #if 0 extern void reset_chip(struct net_device *dev); #endif @@ -170,8 +169,9 @@ /* Probe for the CS8900 card in slot E. We won't bother looking anywhere else until we have a really good reason to do so. */ -int __init mac89x0_probe(struct net_device *dev) +struct net_device * __init mac89x0_probe(int unit) { + struct net_device *dev; static int once_is_enough; struct net_local *lp; static unsigned version_printed; @@ -179,18 +179,28 @@ unsigned rev_type = 0; unsigned long ioaddr; unsigned short sig; + int err = -ENODEV; + + dev = alloc_etherdev(sizeof(struct net_local)); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } SET_MODULE_OWNER(dev); if (once_is_enough) - return -ENODEV; + goto out; once_is_enough = 1; /* We might have to parameterize this later */ slot = 0xE; /* Get out now if there's a real NuBus card in slot E */ if (nubus_find_slot(slot, NULL) != NULL) - return -ENODEV; + goto out; /* The pseudo-ISA bits always live at offset 0x300 (gee, wonder why...) */ @@ -206,21 +216,15 @@ local_irq_restore(flags); if (!card_present) - return -ENODEV; + goto out; } nubus_writew(0, ioaddr + ADD_PORT); sig = nubus_readw(ioaddr + DATA_PORT); if (sig != swab16(CHIP_EISA_ID_SIG)) - return -ENODEV; + goto out; /* Initialize the net_device structure. */ - if (dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (!dev->priv) - return -ENOMEM; - memset(dev->priv, 0, sizeof(struct net_local)); - } lp = (struct net_local *)dev->priv; /* Fill in the 'dev' fields. */ @@ -258,9 +262,7 @@ /* Try to read the MAC address */ if ((readreg(dev, PP_SelfST) & (EEPROM_PRESENT | EEPROM_OK)) == 0) { printk("\nmac89x0: No EEPROM, giving up now.\n"); - kfree(dev->priv); - dev->priv = NULL; - return -ENODEV; + goto out1; } else { for (i = 0; i < ETH_ALEN; i += 2) { /* Big-endian (why??!) */ @@ -277,6 +279,7 @@ for (i = 0; i < ETH_ALEN; i++) printk("%2.2x%s", dev->dev_addr[i], ((i < ETH_ALEN-1) ? ":" : "")); + printk("\n"); dev->open = net_open; dev->stop = net_close; @@ -285,11 +288,15 @@ dev->set_multicast_list = &set_multicast_list; dev->set_mac_address = &set_mac_address; - /* Fill in the fields of the net_device structure with ethernet values. */ - ether_setup(dev); - - printk("\n"); + err = register_netdev(dev); + if (err) + goto out1; return 0; +out1: + nubus_writew(0, dev->base_addr + ADD_PORT); +out: + free_netdev(dev); + return ERR_PTR(err); } #if 0 @@ -619,7 +626,7 @@ #ifdef MODULE -static struct net_device dev_cs89x0; +static struct net_device *dev_cs89x0; static int debug; MODULE_PARM(debug, "i"); @@ -630,36 +637,20 @@ init_module(void) { net_debug = debug; - dev_cs89x0.init = mac89x0_probe; - dev_cs89x0.priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (!dev_cs89x0.priv) - return -ENOMEM; - memset(dev_cs89x0.priv, 0, sizeof(struct net_local)); - - if (register_netdev(&dev_cs89x0) != 0) { + dev_cs89x0 = mac89x0_probe(-1); + if (IS_ERR(dev_cs89x0)) { printk(KERN_WARNING "mac89x0.c: No card found\n"); - kfree(dev_cs89x0.priv); - return -ENXIO; - } + return PTR_ERR(dev_cs89x0); + } return 0; } void cleanup_module(void) { - -#endif -#ifdef MODULE - nubus_writew(0, dev_cs89x0.base_addr + ADD_PORT); -#endif -#ifdef MODULE - - if (dev_cs89x0.priv != NULL) { - /* Free up the private structure, or leak memory :-) */ - unregister_netdev(&dev_cs89x0); - kfree(dev_cs89x0.priv); - dev_cs89x0.priv = NULL; /* gets re-allocated by cs89x0_probe1 */ - } + unregister_netdev(dev_cs89x0); + nubus_writew(0, dev_cs89x0->base_addr + ADD_PORT); + free_netdev(dev_cs89x0); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:44:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:45:09 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ip25024210 for ; Wed, 12 Nov 2003 16:44:52 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0hwl30832; Wed, 12 Nov 2003 16:43:58 -0800 Date: Wed, 12 Nov 2003 16:43:58 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0hwl30832@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (22/42) 3c527 Cc: netdev@oss.sgi.com X-archive-position: 1398 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5865 Lines: 243 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c --- a/drivers/net/3c527.c Tue Nov 11 13:50:29 2003 +++ b/drivers/net/3c527.c Tue Nov 11 13:50:29 2003 @@ -210,8 +210,6 @@ /* Index to functions, as function prototypes. */ -extern int mc32_probe(struct net_device *dev); - static int mc32_probe1(struct net_device *dev, int ioaddr); static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len); static int mc32_open(struct net_device *dev); @@ -224,9 +222,19 @@ static void mc32_reset_multicast_list(struct net_device *dev); static struct ethtool_ops netdev_ethtool_ops; +static void cleanup_card(struct net_device *dev) +{ + struct mc32_local *lp=dev->priv; + unsigned slot = lp->slot; + mca_mark_as_unused(slot); + mca_set_adapter_name(slot, NULL); + free_irq(dev->irq, dev); + release_region(dev->base_addr, MC32_IO_EXTENT); +} + /** * mc32_probe - Search for supported boards - * @dev: device to probe + * @unit: interface number to use * * Because MCA bus is a real bus and we can scan for cards we could do a * single scan for all boards here. Right now we use the passed in device @@ -234,10 +242,18 @@ * in particular. */ -int __init mc32_probe(struct net_device *dev) +struct net_device *__init mc32_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct mc32_local)); static int current_mca_slot = -1; int i; + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) + sprintf(dev->name, "eth%d", unit); SET_MODULE_OWNER(dev); @@ -258,12 +274,18 @@ mca_set_adapter_name(current_mca_slot, mc32_adapters[i].name); mca_mark_as_used(current_mca_slot); - return 0; + err = register_netdev(dev); + if (err) { + cleanup_card(dev); + free_netdev(dev); + dev = ERR_PTR(err); + } + return dev; } } } - return -ENODEV; + return ERR_PTR(-ENODEV); } /** @@ -283,7 +305,7 @@ int i, err; u8 POS; u32 base; - struct mc32_local *lp; + struct mc32_local *lp = dev->priv; static u16 mca_io_bases[]={ 0x7280,0x7290, 0x7680,0x7690, @@ -410,24 +432,14 @@ * Grab the IRQ */ - i = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); - if (i) { + err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev); + if (err) { release_region(dev->base_addr, MC32_IO_EXTENT); printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); - return i; - } - - - /* Initialize the device structure. */ - dev->priv = kmalloc(sizeof(struct mc32_local), GFP_KERNEL); - if (dev->priv == NULL) - { - err = -ENOMEM; - goto err_exit_irq; + goto err_exit_ports; } - memset(dev->priv, 0, sizeof(struct mc32_local)); - lp = dev->priv; + memset(lp, 0, sizeof(struct mc32_local)); lp->slot = slot; i=0; @@ -441,7 +453,7 @@ { printk(KERN_ERR "%s: failed to boot adapter.\n", dev->name); err = -ENODEV; - goto err_exit_free; + goto err_exit_irq; } udelay(1000); if(inb(dev->base_addr+2)&(1<<5)) @@ -456,7 +468,7 @@ else printk(KERN_ERR "%s: unknown failure %d.\n", dev->name, base); err = -ENODEV; - goto err_exit_free; + goto err_exit_irq; } base=0; @@ -472,7 +484,7 @@ { printk(KERN_ERR "%s: mailbox read fail (%d).\n", dev->name, i); err = -ENODEV; - goto err_exit_free; + goto err_exit_irq; } } @@ -515,15 +527,11 @@ dev->watchdog_timeo = HZ*5; /* Board does all the work */ dev->ethtool_ops = &netdev_ethtool_ops; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - return 0; -err_exit_free: - kfree(dev->priv); err_exit_irq: free_irq(dev->irq, dev); +err_exit_ports: release_region(dev->base_addr, MC32_IO_EXTENT); return err; } @@ -1628,7 +1636,7 @@ #ifdef MODULE -static struct net_device this_device; +static struct net_device *this_device; /** * init_module - entry point @@ -1640,12 +1648,9 @@ int init_module(void) { - int result; - - this_device.init = mc32_probe; - if ((result = register_netdev(&this_device)) != 0) - return result; - + this_device = mc32_probe(-1); + if (IS_ERR(this_device)) + return PTR_ERR(this_device); return 0; } @@ -1662,24 +1667,9 @@ void cleanup_module(void) { - int slot; - - unregister_netdev(&this_device); - - /* - * If we don't do this, we can't re-insmod it later. - */ - - if (this_device.priv) - { - struct mc32_local *lp=this_device.priv; - slot = lp->slot; - mca_mark_as_unused(slot); - mca_set_adapter_name(slot, NULL); - kfree(this_device.priv); - } - free_irq(this_device.irq, &this_device); - release_region(this_device.base_addr, MC32_IO_EXTENT); + unregister_netdev(this_device); + cleanup_card(this_device); + free_netdev(this_device); } #endif /* MODULE */ diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 13:50:29 2003 +++ b/drivers/net/Space.c Tue Nov 11 13:50:29 2003 @@ -90,7 +90,7 @@ extern int macsonic_probe(struct net_device *dev); extern int mac8390_probe(struct net_device *dev); extern int mac89x0_probe(struct net_device *dev); -extern int mc32_probe(struct net_device *dev); +extern struct net_device *mc32_probe(int unit); extern struct net_device *cops_probe(int unit); extern struct net_device *ltpc_probe(void); @@ -184,13 +184,13 @@ #ifdef CONFIG_ELMC /* 3c523 */ {elmc_probe, 0}, #endif -#ifdef CONFIG_ELMC_II /* 3c527 */ - {mc32_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 mca_probes2[] __initdata = { +#ifdef CONFIG_ELMC_II /* 3c527 */ + {mc32_probe, 0}, +#endif #ifdef CONFIG_SKMC /* SKnet Microchannel */ {skmca_probe, 0}, #endif From shemminger@osdl.org Wed Nov 12 16:44:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44:36 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0iE25023640 for ; Wed, 12 Nov 2003 16:44:15 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0i8G30878; Wed, 12 Nov 2003 16:44:08 -0800 Date: Wed, 12 Nov 2003 16:44:08 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0i8G30878@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (23/42) 3c523 Cc: netdev@oss.sgi.com X-archive-position: 1394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6050 Lines: 223 NE47-3c523 from viro * switched 3c523 to dynamic allocation * 3c523: switched to embedded ->priv * 3c523: fixed order of freeing bugs * 3c523: fixed resource leaks on failure exits diff -Nru a/drivers/net/3c523.c b/drivers/net/3c523.c --- a/drivers/net/3c523.c Tue Nov 11 13:50:42 2003 +++ b/drivers/net/3c523.c Tue Nov 11 13:50:42 2003 @@ -410,7 +410,7 @@ /*****************************************************************/ -int __init elmc_probe(struct net_device *dev) +static int __init do_elmc_probe(struct net_device *dev) { static int slot; int base_addr = dev->base_addr; @@ -420,7 +420,7 @@ int i = 0; unsigned int size = 0; int retval; - struct priv *pr; + struct priv *pr = dev->priv; SET_MODULE_OWNER(dev); if (MCA_bus == 0) { @@ -455,10 +455,9 @@ } /* we didn't find any 3c523 in the slots we checked for */ - if (slot == MCA_NOTFOUND) { - retval = ((base_addr || irq) ? -ENXIO : -ENODEV); - goto err_out; - } + if (slot == MCA_NOTFOUND) + return ((base_addr || irq) ? -ENXIO : -ENODEV); + mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC"); mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev); @@ -497,13 +496,7 @@ break; } - pr = dev->priv = kmalloc(sizeof(struct priv), GFP_KERNEL); - if (dev->priv == NULL) { - retval = -ENOMEM; - goto err_out; - } memset(pr, 0, sizeof(struct priv)); - pr->slot = slot; printk(KERN_INFO "%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision, @@ -530,8 +523,6 @@ if (!check586(dev, dev->mem_start, size)) { printk(KERN_ERR "%s: memprobe, Can't find memory at 0x%lx!\n", dev->name, dev->mem_start); - kfree(dev->priv); - dev->priv = NULL; retval = -ENODEV; goto err_out; } @@ -573,8 +564,6 @@ #endif dev->ethtool_ops = &netdev_ethtool_ops; - ether_setup(dev); - /* note that we haven't actually requested the IRQ from the kernel. That gets done in elmc_open(). I'm not sure that's such a good idea, but it works, so I'll go with it. */ @@ -585,9 +574,41 @@ return 0; err_out: + mca_set_adapter_procfn(slot, NULL, NULL); release_region(dev->base_addr, ELMC_IO_EXTENT); return retval; } + +static void cleanup_card(struct net_device *dev) +{ + mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL); + release_region(dev->base_addr, ELMC_IO_EXTENT); +} + +struct net_device * __init elmc_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = do_elmc_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} /********************************************** * init the chip (elmc-interrupt should be disabled?!) @@ -1245,7 +1266,7 @@ /* Increase if needed ;) */ #define MAX_3C523_CARDS 4 -static struct net_device dev_elmc[MAX_3C523_CARDS]; +static struct net_device *dev_elmc[MAX_3C523_CARDS]; static int irq[MAX_3C523_CARDS]; static int io[MAX_3C523_CARDS]; MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_3C523_CARDS) "i"); @@ -1258,16 +1279,24 @@ int this_dev,found = 0; /* Loop until we either can't find any more cards, or we have MAX_3C523_CARDS */ - for(this_dev=0; this_devirq=irq[this_dev]; dev->base_addr=io[this_dev]; - dev->init=elmc_probe; - if(register_netdev(dev)!=0) { - if(io[this_dev]==0) break; - printk(KERN_WARNING "3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]); - } else found++; + if (do_elmc_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_elmc[this_dev] = dev; + found++; + continue; + } + cleanup_card(dev); + } + free_netdev(dev); + if (io[this_dev]==0) + break; + printk(KERN_WARNING "3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]); } if(found==0) { @@ -1279,31 +1308,12 @@ void cleanup_module(void) { int this_dev; - for(this_dev=0; this_devpriv) { - /* shutdown interrupts on the card */ - elmc_id_reset586(); - if (dev->irq != 0) { - /* this should be done by close, but if we failed to - initialize properly something may have gotten hosed. */ - free_irq(dev->irq, dev); - dev->irq = 0; - } - if (dev->base_addr != 0) { - release_region(dev->base_addr, ELMC_IO_EXTENT); - dev->base_addr = 0; - } - irq[this_dev] = 0; - io[this_dev] = 0; + for (this_dev=0; this_devpriv))->slot, - NULL, NULL); - - kfree(dev->priv); - dev->priv = NULL; + cleanup_card(dev); + free_netdev(dev); } } } diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 13:50:42 2003 +++ b/drivers/net/Space.c Tue Nov 11 13:50:42 2003 @@ -60,7 +60,7 @@ extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); -extern int elmc_probe(struct net_device *); +extern struct net_device *elmc_probe(int unit); extern struct net_device *skmca_probe(int unit); extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); @@ -181,13 +181,13 @@ #ifdef CONFIG_NE2_MCA {ne2_probe, 0}, #endif -#ifdef CONFIG_ELMC /* 3c523 */ - {elmc_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 mca_probes2[] __initdata = { +#ifdef CONFIG_ELMC /* 3c523 */ + {elmc_probe, 0}, +#endif #ifdef CONFIG_ELMC_II /* 3c527 */ {mc32_probe, 0}, #endif From shemminger@osdl.org Wed Nov 12 16:46:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46:29 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0kF25025660 for ; Wed, 12 Nov 2003 16:46:15 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0k8q31383; Wed, 12 Nov 2003 16:46:08 -0800 Date: Wed, 12 Nov 2003 16:46:08 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0k8q31383@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (35/42) mvme147 Cc: netdev@oss.sgi.com X-archive-position: 1407 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4475 Lines: 150 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:16:47 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:16:47 2003 @@ -83,7 +83,7 @@ extern struct net_device *cs89x0_probe(int unit); extern int hplance_probe(struct net_device *dev); extern struct net_device *bagetlance_probe(int unit); -extern int mvme147lance_probe(struct net_device *dev); +extern struct net_device *mvme147lance_probe(int unit); extern struct net_device *tc515_probe(int unit); extern struct net_device *lance_probe(int unit); extern struct net_device *mace_probe(struct net_device *dev); @@ -317,13 +317,13 @@ #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */ {hplance_probe, 0}, #endif -#ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */ - {mvme147lance_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */ + {mvme147lance_probe, 0}, +#endif #ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */ {mace_probe, 0}, #endif diff -Nru a/drivers/net/mvme147.c b/drivers/net/mvme147.c --- a/drivers/net/mvme147.c Tue Nov 11 14:16:47 2003 +++ b/drivers/net/mvme147.c Tue Nov 11 14:16:47 2003 @@ -49,7 +49,6 @@ * plus board-specific init, open and close actions. * Oh, and we need to tell the generic code how to read and write LANCE registers... */ -int mvme147lance_probe(struct net_device *dev); static int m147lance_open(struct net_device *dev); static int m147lance_close(struct net_device *dev); static void m147lance_writerap(struct m147lance_private *lp, unsigned short value); @@ -60,13 +59,10 @@ typedef void (*writerdp_t)(void *, unsigned short); typedef unsigned short (*readrdp_t)(void *); -#ifdef MODULE -static struct m147lance_private *root_m147lance_dev; -#endif - /* Initialise the one and only on-board 7990 */ -int __init mvme147lance_probe(struct net_device *dev) +struct net_device * __init mvme147lance_probe(int unit) { + struct net_device *dev; static int called; static const char name[] = "MVME147 LANCE"; struct m147lance_private *lp; @@ -74,15 +70,17 @@ u_long address; if (!MACH_IS_MVME147 || called) - return -ENODEV; + return ERR_PTR(-ENODEV); called++; - SET_MODULE_OWNER(dev); + dev = alloc_etherdev(sizeof(struct m147lance_private)); + if (!dev) + return ERR_PTR(-ENOMEM); - dev->priv = kmalloc(sizeof(struct m147lance_private), GFP_KERNEL); - if (dev->priv == NULL) - return -ENOMEM; - memset(dev->priv, 0, sizeof(struct m147lance_private)); + if (unit >= 0) + sprintf(dev->name, "eth%d", unit); + + SET_MODULE_OWNER(dev); /* Fill the dev fields */ dev->base_addr = (unsigned long)MVME147_LANCE_BASE; @@ -118,7 +116,8 @@ if (!lp->ram) { printk("%s: No memory for LANCE buffers\n", dev->name); - return -ENODEV; + free_netdev(dev); + return ERR_PTR(-ENOMEM); } lp->lance.name = (char*)name; /* discards const, shut up gcc */ @@ -134,15 +133,15 @@ lp->lance.lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS; lp->lance.rx_ring_mod_mask = RX_RING_MOD_MASK; lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK; - ether_setup(dev); -#ifdef MODULE - dev->ifindex = dev_new_index(); - lp->next_module = root_m147lance_dev; - root_m147lance_dev = lp; -#endif /* MODULE */ + err = register_netdev(dev); + if (err) { + free_pages(lp->ram, 3); + free_netdev(dev); + return ERR_PTR(err); + } - return 0; + return dev; } static void m147lance_writerap(struct m147lance_private *lp, unsigned short value) @@ -185,23 +184,21 @@ #ifdef MODULE MODULE_LICENSE("GPL"); +static struct net_device *dev_mvme147_lance; int init_module(void) { - root_lance_dev = NULL; - return mvme147lance_probe(NULL); + dev_mvme147_lance = mvme147lance_probe(-1); + if (IS_ERR(dev_mvme147_lance)) + return PTR_ERR(dev_mvme147_lance); + return 0; } void cleanup_module(void) { - /* Walk the chain of devices, unregistering them */ - struct m147lance_private *lp; - while (root_m147lance_dev) { - lp = root_m147lance_dev->next_module; - unregister_netdev(root_lance_dev->dev); - free_pages(lp->ram, 3); - free_netdev(root_lance_dev->dev); - root_lance_dev = lp; - } + struct m147lance_private *lp = dev_mvme147_lance->priv; + unregister_netdev(dev_mvme147_lance); + free_pages(lp->ram, 3); + free_netdev(dev_mvme147_lance); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:44:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44:35 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0iE25023633 for ; Wed, 12 Nov 2003 16:44:14 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0hIp30689; Wed, 12 Nov 2003 16:43:18 -0800 Date: Wed, 12 Nov 2003 16:43:18 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0hIp30689@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (18/42) ultra Cc: netdev@oss.sgi.com X-archive-position: 1393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5019 Lines: 195 Based on viro NE42-ultra * switched smc-ultra to dynamic allocation * smc-ultra: fixed order of freeing bugs * smc-ultra: fixed resource leaks on failure exits * smc-ultra: fixed clobbering on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 09:36:08 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:36:08 2003 @@ -42,7 +42,7 @@ extern int ne2_probe(struct net_device *dev); extern int hp100_probe(struct net_device *dev); -extern int ultra_probe(struct net_device *dev); +extern struct net_device *ultra_probe(int unit); extern int ultra32_probe(struct net_device *dev); extern struct net_device *wd_probe(int unit); extern struct net_device *el2_probe(int unit); @@ -204,13 +204,13 @@ #ifdef CONFIG_3C515 {tc515_probe, 0}, #endif -#ifdef CONFIG_ULTRA - {ultra_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ULTRA + {ultra_probe, 0}, +#endif #ifdef CONFIG_WD80x3 {wd_probe, 0}, #endif diff -Nru a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c --- a/drivers/net/smc-ultra.c Tue Nov 11 09:36:08 2003 +++ b/drivers/net/smc-ultra.c Tue Nov 11 09:36:08 2003 @@ -76,7 +76,6 @@ static unsigned int ultra_portlist[] __initdata = {0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380, 0}; -int ultra_probe(struct net_device *dev); static int ultra_probe1(struct net_device *dev, int ioaddr); #ifdef __ISAPNP__ @@ -127,10 +126,11 @@ following. */ -int __init ultra_probe(struct net_device *dev) +static int __init do_ultra_probe(struct net_device *dev) { int i; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -147,13 +147,54 @@ printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n"); #endif - for (i = 0; ultra_portlist[i]; i++) + for (i = 0; ultra_portlist[i]; i++) { + dev->irq = irq; if (ultra_probe1(dev, ultra_portlist[i]) == 0) return 0; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + /* NB: ultra_close_card() does free_irq */ +#ifdef __ISAPNP__ + struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; + if (idev) + pnp_device_detach(idev); +#endif + release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init ultra_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + dev->priv = NULL; /* until all 8390-based use alloc_etherdev() */ + + err = do_ultra_probe(dev); + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); +} + static int __init ultra_probe1(struct net_device *dev, int ioaddr) { int i, retval; @@ -500,7 +541,7 @@ #ifdef MODULE #define MAX_ULTRA_CARDS 4 /* Max number of Ultra cards per module */ -static struct net_device dev_ultra[MAX_ULTRA_CARDS]; +static struct net_device *dev_ultra[MAX_ULTRA_CARDS]; static int io[MAX_ULTRA_CARDS]; static int irq[MAX_ULTRA_CARDS]; @@ -516,26 +557,34 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) { - struct net_device *dev = &dev_ultra[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->init = ultra_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "smc-ultra.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) return 0; /* Got at least one. */ - return -ENXIO; + dev = alloc_etherdev(0); + if (!dev) + break; + dev->priv = NULL; + dev->irq = irq[this_dev]; + dev->base_addr = io[this_dev]; + if (do_ultra_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_ultra[found++] = dev; + continue; + } + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]); + break; } - - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -544,20 +593,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) { - struct net_device *dev = &dev_ultra[this_dev]; - if (dev->priv != NULL) { - /* NB: ultra_close_card() does free_irq */ - int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; - -#ifdef __ISAPNP__ - struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv; - if (idev) - pnp_device_detach(idev); -#endif - + struct net_device *dev = dev_ultra[this_dev]; + if (dev) { unregister_netdev(dev); - release_region(ioaddr, ULTRA_IO_EXTENT); - kfree(dev->priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:47:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:47:39 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0lD25026542 for ; Wed, 12 Nov 2003 16:47:14 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0kIt31400; Wed, 12 Nov 2003 16:46:18 -0800 Date: Wed, 12 Nov 2003 16:46:18 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0kIt31400@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (36/42) hplance Cc: netdev@oss.sgi.com X-archive-position: 1413 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5770 Lines: 179 NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits diff -urN B9-mvme147/drivers/net/Space.c B9-hplance/drivers/net/Space.c --- B9-mvme147/drivers/net/Space.c Tue Nov 11 13:57:43 2003 +++ B9-hplance/drivers/net/Space.c Tue Nov 11 15:10:51 2003 @@ -81,7 +81,7 @@ extern int bionet_probe(struct net_device *); extern int pamsnet_probe(struct net_device *); extern struct net_device *cs89x0_probe(int unit); -extern int hplance_probe(struct net_device *dev); +extern struct net_device *hplance_probe(int unit); extern struct net_device *bagetlance_probe(int unit); extern struct net_device *mvme147lance_probe(int unit); extern struct net_device *tc515_probe(int unit); @@ -315,13 +315,13 @@ #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */ {pamsnet_probe, 0}, #endif -#ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */ - {hplance_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */ + {hplance_probe, 0}, +#endif #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */ {mvme147lance_probe, 0}, #endif diff -urN B9-mvme147/drivers/net/hplance.c B9-hplance/drivers/net/hplance.c --- B9-mvme147/drivers/net/hplance.c Fri Aug 22 23:10:48 2003 +++ B9-hplance/drivers/net/hplance.c Tue Nov 11 15:10:51 2003 @@ -50,8 +50,7 @@ * plus board-specific init, open and close actions. * Oh, and we need to tell the generic code how to read and write LANCE registers... */ -int hplance_probe(struct net_device *dev); -static int hplance_init(struct net_device *dev, int scode); +static void hplance_init(struct net_device *dev, int scode); static int hplance_open(struct net_device *dev); static int hplance_close(struct net_device *dev); static void hplance_writerap(void *priv, unsigned short value); @@ -62,57 +61,61 @@ static struct hplance_private *root_hplance_dev; #endif +static void cleanup_card(struct net_device *dev) +{ + struct hplance_private *lp = dev->priv; + dio_unconfig_board(lp->scode); +} + /* Find all the HP Lance boards and initialise them... */ -int __init hplance_probe(struct net_device *dev) +struct net_device * __init hplance_probe(int unit) { - int cards = 0, called = 0; + struct net_device *dev; + + if (!MACH_IS_HP300) + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(sizeof(struct hplance_private)); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } - if (!MACH_IS_HP300 || called) - return(ENODEV); - called++; + SET_MODULE_OWNER(dev); /* Isn't DIO nice? */ for(;;) { - int v, scode = dio_find(DIO_ID_LAN); + int scode = dio_find(DIO_ID_LAN); if (!scode) break; - if(cards) - dev = NULL; /* don't trash previous device, make a new one */ - cards++; - - v = hplance_init(dev, scode); - if (v) /* error, abort immediately */ - return v; + dio_config_board(scode); + hplance_init(dev, scode); + if (!register_netdev(dev)) { + struct hplance_private *lp = dev->priv; + lp->next_module = root_hplance_dev; + root_hplance_dev = lp; + return dev; + } + cleanup_card(dev); } - /* OK, return success, or ENODEV if we didn't find any cards */ - if (!cards) - return -ENODEV; - return 0; + free_netdev(dev); + return ERR_PTR(-ENODEV); } /* Initialise a single lance board at the given select code */ -static int __init hplance_init(struct net_device *dev, int scode) +static void __init hplance_init(struct net_device *dev, int scode) { const char *name = dio_scodetoname(scode); void *va = dio_scodetoviraddr(scode); struct hplance_private *lp; int i; -#ifdef MODULE - dev = init_etherdev(0, sizeof(struct hplance_private)); - if (!dev) - return -ENOMEM; -#else - dev->priv = kmalloc(sizeof(struct hplance_private), GFP_KERNEL); - if (dev->priv == NULL) - return -ENOMEM; - memset(dev->priv, 0, sizeof(struct hplance_private)); -#endif - SET_MODULE_OWNER(dev); - printk("%s: %s; select code %d, addr", dev->name, name, scode); /* reset the board */ @@ -154,17 +157,7 @@ lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK; lp->scode = scode; lp->base = va; - ether_setup(dev); printk(", irq %d\n", lp->lance.irq); - -#ifdef MODULE - dev->ifindex = dev_new_index(); - lp->next_module = root_hplance_dev; - root_hplance_dev = lp; -#endif /* MODULE */ - - dio_config_board(scode); /* tell bus scanning code this one's taken */ - return 0; } /* This is disgusting. We have to check the DIO status register for ack every @@ -227,8 +220,10 @@ MODULE_LICENSE("GPL"); int init_module(void) { - root_lance_dev = NULL; - return hplance_probe(NULL); + int found = 0; + while (!IS_ERR(hplance_probe(-1))) + found++; + return found ? 0 : -ENODEV; } void cleanup_module(void) @@ -237,8 +232,8 @@ struct hplance_private *lp; while (root_hplance_dev) { lp = root_hplance_dev->next_module; - dio_unconfig_board(lp->scode); unregister_netdev(root_lance_dev->dev); + cleanup_card(root_lance_dev->dev); free_netdev(root_lance_dev->dev); root_lance_dev = lp; } From shemminger@osdl.org Wed Nov 12 16:46:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46:20 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0k025025420 for ; Wed, 12 Nov 2003 16:46:01 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0j8s31144; Wed, 12 Nov 2003 16:45:08 -0800 Date: Wed, 12 Nov 2003 16:45:08 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0j8s31144@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (29/42) bagetlance Cc: netdev@oss.sgi.com X-archive-position: 1405 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4881 Lines: 179 NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:15:23 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:15:23 2003 @@ -82,7 +82,7 @@ extern int pamsnet_probe(struct net_device *); extern struct net_device *cs89x0_probe(int unit); extern int hplance_probe(struct net_device *dev); -extern int bagetlance_probe(struct net_device *); +extern struct net_device *bagetlance_probe(int unit); extern int mvme147lance_probe(struct net_device *dev); extern struct net_device *tc515_probe(int unit); extern struct net_device *lance_probe(int unit); @@ -339,6 +339,10 @@ #ifdef CONFIG_MIPS_JAZZ_SONIC {sonic_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 mips_probes2[] __initdata = { #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */ {bagetlance_probe, 0}, #endif @@ -392,6 +396,7 @@ if (base_addr == 1) return; + probe_list2(unit, mips_probes2, base_addr == 0) && probe_list2(unit, eisa_probes, base_addr == 0) && probe_list2(unit, mca_probes, base_addr == 0) && probe_list2(unit, isa_probes, base_addr == 0) && diff -Nru a/drivers/net/bagetlance.c b/drivers/net/bagetlance.c --- a/drivers/net/bagetlance.c Tue Nov 11 14:15:23 2003 +++ b/drivers/net/bagetlance.c Tue Nov 11 14:15:23 2003 @@ -465,30 +465,43 @@ } -int __init bagetlance_probe( struct net_device *dev ) - -{ int i; +struct net_device * __init bagetlance_probe(int unit) +{ + struct net_device *dev; + int i; static int found; - - SET_MODULE_OWNER(dev); + int err = -ENODEV; if (found) /* Assume there's only one board possible... That seems true, since * the Riebl/PAM board's address cannot be changed. */ - return( -ENODEV ); + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(sizeof(struct lance_private)); + if (!dev) + return ERR_PTR(-ENOMEM); + + SET_MODULE_OWNER(dev); for( i = 0; i < N_LANCE_ADDR; ++i ) { if (lance_probe1( dev, &lance_addr_list[i] )) { found = 1; - return( 0 ); + break; } } - - return( -ENODEV ); + if (!found) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); +out: + free_netdev(dev); + return ERR_PTR(err); } - - /* Derived from hwreg_present() in vme/config.c: */ static int __init addr_accessible( volatile void *regp, @@ -527,6 +540,7 @@ if (!addr_accessible( memaddr, 1, 1 )) goto probe_fail; if ((unsigned long)memaddr >= KSEG2) { + /* FIXME: do we need to undo that on cleanup paths? */ extern int kseg2_alloc_io (unsigned long addr, unsigned long size); if (kseg2_alloc_io((unsigned long)memaddr, BAGET_LANCE_MEM_SIZE)) { printk("bagetlance: unable map lance memory\n"); @@ -580,12 +594,6 @@ return( 0 ); probe_ok: - init_etherdev( dev, sizeof(struct lance_private) ); - if (!dev->priv) { - dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL ); - if (!dev->priv) - return 0; - } lp = (struct lance_private *)dev->priv; MEM = (struct lance_memory *)memaddr; IO = lp->iobase = (struct lance_ioreg *)ioaddr; @@ -617,8 +625,9 @@ if (lp->cardtype == PAM_CARD || memaddr == (unsigned short *)0xffe00000) { /* PAMs card and Riebl on ST use level 5 autovector */ - request_irq(BAGET_LANCE_IRQ, lance_interrupt, IRQ_TYPE_PRIO, - "PAM/Riebl-ST Ethernet", dev); + if (request_irq(BAGET_LANCE_IRQ, lance_interrupt, IRQ_TYPE_PRIO, + "PAM/Riebl-ST Ethernet", dev)) + goto probe_fail; dev->irq = (unsigned short)BAGET_LANCE_IRQ; } else { @@ -629,10 +638,11 @@ unsigned long irq = BAGET_LANCE_IRQ; if (!irq) { printk( "Lance: request for VME interrupt failed\n" ); - return( 0 ); + goto probe_fail; } - request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO, - "Riebl-VME Ethernet", dev); + if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO, + "Riebl-VME Ethernet", dev)) + goto probe_fail; dev->irq = irq; } @@ -1331,26 +1341,21 @@ #ifdef MODULE -static struct net_device bagetlance_dev; +static struct net_device *bagetlance_dev; int init_module(void) - -{ int err; - - bagetlance_dev.init = bagetlance_probe; - if ((err = register_netdev( &bagetlance_dev ))) { - if (err == -EIO) { - printk( "No Vme Lance board found. Module not loaded.\n"); - } - return( err ); - } - return( 0 ); +{ + bagetlance_dev = bagetlance_probe(-1); + if (IS_ERR(bagetlance_dev)) + return PTR_ERR(bagetlance_dev); + return 0; } void cleanup_module(void) - { - unregister_netdev( &bagetlance_dev ); + unregister_netdev(bagetlance_dev); + free_irq(bagetlance_dev->irq, bagetlance_dev); + free_netdev(bagetlance_dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:47:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:47:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0kt25026292 for ; Wed, 12 Nov 2003 16:46:56 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0kmQ31517; Wed, 12 Nov 2003 16:46:48 -0800 Date: Wed, 12 Nov 2003 16:46:48 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0kmQ31517@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (39/42) apne Cc: netdev@oss.sgi.com X-archive-position: 1411 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4192 Lines: 170 NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits diff -urN B9-bionet/drivers/net/Space.c B9-apne/drivers/net/Space.c --- B9-bionet/drivers/net/Space.c Tue Nov 11 15:23:17 2003 +++ B9-apne/drivers/net/Space.c Tue Nov 11 19:04:30 2003 @@ -77,7 +77,7 @@ extern int atarilance_probe(struct net_device *); extern int sun3lance_probe(struct net_device *); extern int sun3_82586_probe(struct net_device *); -extern int apne_probe(struct net_device *); +extern struct net_device *apne_probe(int unit); extern struct net_device *bionet_probe(int unit); extern struct net_device *pamsnet_probe(int unit); extern struct net_device *cs89x0_probe(int unit); @@ -306,13 +306,13 @@ #ifdef CONFIG_SUN3_82586 /* sun3 onboard Intel 82586 chip */ {sun3_82586_probe, 0}, #endif -#ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */ - {apne_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */ + {apne_probe, 0}, +#endif #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ {bionet_probe, 0}, #endif diff -urN B9-bionet/drivers/net/apne.c B9-apne/drivers/net/apne.c --- B9-bionet/drivers/net/apne.c Mon May 26 22:21:35 2003 +++ B9-apne/drivers/net/apne.c Tue Nov 11 19:04:30 2003 @@ -116,28 +116,38 @@ static int apne_owned; /* signal if card already owned */ -int __init apne_probe(struct net_device *dev) +struct net_device * __init apne_probe(int unit) { + struct net_device *dev; #ifndef MANUAL_CONFIG char tuple[8]; #endif + int err; if (apne_owned) - return -ENODEV; - - SET_MODULE_OWNER(dev); + return ERR_PTR(-ENODEV); if ( !(AMIGAHW_PRESENT(PCMCIA)) ) - return (-ENODEV); + return ERR_PTR(-ENODEV); printk("Looking for PCMCIA ethernet card : "); /* check if a card is inserted */ if (!(PCMCIA_INSERTED)) { printk("NO PCMCIA card inserted\n"); - return (-ENODEV); + return ERR_PTR(-ENODEV); + } + + dev = alloc_etherdev(0); + if (!dev) + return ERR_PTR(-ENOMEM); + dev->priv = NULL; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); } - + SET_MODULE_OWNER(dev); + /* disable pcmcia irq for readtuple */ pcmcia_disable_irq(); @@ -145,17 +155,41 @@ if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) || (tuple[2] != CISTPL_FUNCID_NETWORK)) { printk("not an ethernet card\n"); - return (-ENODEV); + /* XXX: shouldn't we re-enable irq here? */ + free_netdev(dev); + return ERR_PTR(-ENODEV); } #endif printk("ethernet PCMCIA card inserted\n"); - if (init_pcmcia()) - return apne_probe1(dev, IOBASE); - else - return (-ENODEV); + if (!init_pcmcia()) { + /* XXX: shouldn't we re-enable irq here? */ + free_netdev(dev); + return ERR_PTR(-ENODEV); + } + + if (!request_region(IOBASE, 0x20, dev->name)) { + free_netdev(dev); + return ERR_PTR(-EBUSY); + } + + err = apne_probe1(dev, IOBASE); + if (err) { + release_region(IOBASE, 0x20); + free_netdev(dev); + return ERR_PTR(err); + } + err = register_netdev(dev); + if (!err) + return dev; + pcmcia_disable_irq(); + free_irq(IRQ_AMIGA_PORTS, dev); + pcmcia_reset(); + release_region(IOBASE, 0x20); + free_netdev(dev); + return ERR_PTR(err); } static int __init apne_probe1(struct net_device *dev, int ioaddr) @@ -534,32 +568,29 @@ } #ifdef MODULE -static struct net_device apne_dev; +static struct net_device *apne_dev; int init_module(void) { int err; - apne_dev.init = apne_probe; - if ((err = register_netdev(&apne_dev))) { - if (err == -EIO) - printk("No PCMCIA NEx000 ethernet card found.\n"); - return (err); - } - return (0); + apne_dev = apne_probe(-1); + if (IS_ERR(apne_dev)) + return PTR_ERR(apne_dev); + return 0; } void cleanup_module(void) { - unregister_netdev(&apne_dev); + unregister_netdev(apne_dev); pcmcia_disable_irq(); - free_irq(IRQ_AMIGA_PORTS, &apne_dev); + free_irq(IRQ_AMIGA_PORTS, apne_dev); pcmcia_reset(); - apne_owned = 0; + free_netdev(apne_dev); } #endif From shemminger@osdl.org Wed Nov 12 16:46:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ju25025329 for ; Wed, 12 Nov 2003 16:45:56 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0jmd31264; Wed, 12 Nov 2003 16:45:48 -0800 Date: Wed, 12 Nov 2003 16:45:48 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0jmd31264@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (33/42) macsonic Cc: netdev@oss.sgi.com X-archive-position: 1404 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 5451 Lines: 204 NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:16:20 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:16:20 2003 @@ -87,7 +87,7 @@ extern struct net_device *tc515_probe(int unit); extern struct net_device *lance_probe(int unit); extern int mace_probe(struct net_device *dev); -extern int macsonic_probe(struct net_device *dev); +extern struct net_device *macsonic_probe(int unit); extern struct net_device *mac8390_probe(int unit); extern struct net_device *mac89x0_probe(int unit); extern struct net_device *mc32_probe(int unit); @@ -323,13 +323,13 @@ #ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */ {mace_probe, 0}, #endif -#ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */ - {macsonic_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */ + {macsonic_probe, 0}, +#endif #ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */ {mac8390_probe, 0}, #endif diff -Nru a/drivers/net/macsonic.c b/drivers/net/macsonic.c --- a/drivers/net/macsonic.c Tue Nov 11 14:16:20 2003 +++ b/drivers/net/macsonic.c Tue Nov 11 14:16:20 2003 @@ -74,7 +74,6 @@ static int reg_offset; -extern int macsonic_probe(struct net_device* dev); extern int mac_onboard_sonic_probe(struct net_device* dev); extern int mac_nubus_sonic_probe(struct net_device* dev); @@ -110,14 +109,38 @@ #define SONIC_READ_PROM(addr) nubus_readb(prom_addr+addr) -int __init macsonic_probe(struct net_device* dev) +struct net_device * __init macsonic_probe(int unit) { - int rv; + struct net_device *dev = alloc_etherdev(0); + int err; + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) + sprintf(dev->name, "eth%d", unit); + + SET_MODULE_OWNER(dev); /* This will catch fatal stuff like -ENOMEM as well as success */ - if ((rv = mac_onboard_sonic_probe(dev)) != -ENODEV) - return rv; - return mac_nubus_sonic_probe(dev); + err = mac_onboard_sonic_probe(dev); + if (err == 0) + goto found; + if (err != -ENODEV) + goto out; + err = mac_nubus_sonic_probe(dev); + if (err) + goto out; +found: + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + kfree(dev->priv); +out: + free_netdev(dev); + return ERR_PTR(err); } /* @@ -195,6 +218,7 @@ if ((lp->rba = (char *) kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL | GFP_DMA)) == NULL) { printk(KERN_ERR "%s: couldn't allocate receive buffers\n", dev->name); + dev->priv = NULL; kfree(lp); return -ENOMEM; } @@ -229,8 +253,6 @@ sonic_write(dev, SONIC_FAET, 0xffff); sonic_write(dev, SONIC_MPT, 0xffff); - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); return 0; } @@ -344,30 +366,6 @@ printk("yes\n"); - if (dev) { - dev = init_etherdev(dev, sizeof(struct sonic_local)); - if (!dev) - return -ENOMEM; - /* methinks this will always be true but better safe than sorry */ - if (dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct sonic_local), GFP_KERNEL); - if (!dev->priv) - return -ENOMEM; - } - } else { - dev = init_etherdev(NULL, sizeof(struct sonic_local)); - } - - if (dev == NULL) - return -ENOMEM; - - if(dev->priv) { - printk("%s: warning! sonic entering with priv already allocated!\n", - dev->name); - printk("%s: discarding, will attempt to reallocate\n", dev->name); - dev->priv = NULL; - } - /* Danger! My arms are flailing wildly! You *must* set this before using sonic_read() */ @@ -567,25 +565,6 @@ return -ENODEV; } - if (dev) { - dev = init_etherdev(dev, sizeof(struct sonic_local)); - if (!dev) - return -ENOMEM; - /* methinks this will always be true but better safe than sorry */ - if (dev->priv == NULL) { - dev->priv = kmalloc(sizeof(struct sonic_local), GFP_KERNEL); - if (!dev->priv) /* FIXME: kfree dev if necessary */ - return -ENOMEM; - } - } else { - dev = init_etherdev(NULL, sizeof(struct sonic_local)); - } - - if (dev == NULL) - return -ENOMEM; - - lp = (struct sonic_local*) dev->priv; - memset(lp, 0, sizeof(struct sonic_local)); /* Danger! My arms are flailing wildly! You *must* set this before using sonic_read() */ dev->base_addr = base_addr; @@ -631,8 +610,7 @@ } #ifdef MODULE -static char namespace[16] = ""; -static struct net_device dev_macsonic; +static struct net_device *dev_macsonic; MODULE_PARM(sonic_debug, "i"); MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)"); @@ -641,24 +619,20 @@ int init_module(void) { - dev_macsonic.name = namespace; - dev_macsonic.init = macsonic_probe; - - if (register_netdev(&dev_macsonic) != 0) { + dev_macsonic = macsonic_probe(-1); + if (IS_ERR(dev_macsonic)) { printk(KERN_WARNING "macsonic.c: No card found\n"); - return -ENXIO; - } + return PTR_ERR(dev_macsonic); + } return 0; } void cleanup_module(void) { - if (dev_macsonic.priv != NULL) { - unregister_netdev(&dev_macsonic); - kfree(dev_macsonic.priv); - dev_macsonic.priv = NULL; - } + unregister_netdev(dev_macsonic); + kfree(dev_macsonic->priv); + free_netdev(dev_macsonic); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:46:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46:27 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0k825025546 for ; Wed, 12 Nov 2003 16:46:08 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0jwP31318; Wed, 12 Nov 2003 16:45:58 -0800 Date: Wed, 12 Nov 2003 16:45:58 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0jwP31318@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (34/42) mac_mace Cc: netdev@oss.sgi.com X-archive-position: 1406 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 2812 Lines: 100 NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:16:33 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:16:33 2003 @@ -86,7 +86,7 @@ extern int mvme147lance_probe(struct net_device *dev); extern struct net_device *tc515_probe(int unit); extern struct net_device *lance_probe(int unit); -extern int mace_probe(struct net_device *dev); +extern struct net_device *mace_probe(struct net_device *dev); extern struct net_device *macsonic_probe(int unit); extern struct net_device *mac8390_probe(int unit); extern struct net_device *mac89x0_probe(int unit); @@ -320,13 +320,13 @@ #ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */ {mvme147lance_probe, 0}, #endif -#ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */ - {mace_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */ + {mace_probe, 0}, +#endif #ifdef CONFIG_MACSONIC /* Mac SONIC-based Ethernet of all sorts */ {macsonic_probe, 0}, #endif diff -Nru a/drivers/net/macmace.c b/drivers/net/macmace.c --- a/drivers/net/macmace.c Tue Nov 11 14:16:33 2003 +++ b/drivers/net/macmace.c Tue Nov 11 14:16:33 2003 @@ -180,7 +180,7 @@ * model of Macintrash has a MACE (AV macintoshes) */ -int mace_probe(struct net_device *unused) +struct net_device *mace_probe(int unit) { int j; struct mace_data *mp; @@ -188,13 +188,19 @@ struct net_device *dev; unsigned char checksum = 0; static int found = 0; + int err; - if (found || macintosh_config->ether_type != MAC_ETHER_MACE) return -ENODEV; + if (found || macintosh_config->ether_type != MAC_ETHER_MACE) + return ERR_PTR(-ENODEV); found = 1; /* prevent 'finding' one on every device probe */ - dev = init_etherdev(0, PRIV_BYTES); - if (!dev) return -ENOMEM; + dev = alloc_etherdev(PRIV_BYTES); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) + sprintf(dev->name, "eth%d", unit); mp = (struct mace_data *) dev->priv; dev->base_addr = (u32)MACE_BASE; @@ -221,7 +227,10 @@ checksum ^= bitrev(addr[j<<4]); } - if (checksum != 0xFF) return -ENODEV; + if (checksum != 0xFF) { + free_netdev(dev); + return -ENODEV; + } memset(&mp->stats, 0, sizeof(mp->stats)); @@ -234,13 +243,16 @@ dev->set_multicast_list = mace_set_multicast; dev->set_mac_address = mace_set_address; - ether_setup(dev); - printk(KERN_INFO "%s: 68K MACE, hardware address %.2X", dev->name, dev->dev_addr[0]); for (j = 1 ; j < 6 ; j++) printk(":%.2X", dev->dev_addr[j]); printk("\n"); - return 0; + err = register_netdev(dev); + if (!err) + return dev; + + free_netdev(dev); + return ERR_PTR(err); } /* From shemminger@osdl.org Wed Nov 12 16:45:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:45:46 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0jP25024853 for ; Wed, 12 Nov 2003 16:45:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0jIu31152; Wed, 12 Nov 2003 16:45:18 -0800 Date: Wed, 12 Nov 2003 16:45:18 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0jIu31152@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (30/42) jazzsonic Cc: netdev@oss.sgi.com X-archive-position: 1401 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 6096 Lines: 225 NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:15:38 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:15:38 2003 @@ -70,7 +70,7 @@ extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); -extern int sonic_probe(struct net_device *); +extern struct net_device *sonic_probe(int unit); extern struct net_device *SK_init(int unit); extern struct net_device *seeq8005_probe(int unit); extern struct net_device *smc_init(int unit); @@ -335,14 +335,10 @@ {NULL, 0}, }; -static struct devprobe mips_probes[] __initdata = { +static struct devprobe2 mips_probes[] __initdata = { #ifdef CONFIG_MIPS_JAZZ_SONIC {sonic_probe, 0}, #endif - {NULL, 0}, -}; - -static struct devprobe2 mips_probes2[] __initdata = { #ifdef CONFIG_BAGETLANCE /* Lance-based Baget ethernet boards */ {bagetlance_probe, 0}, #endif @@ -379,8 +375,7 @@ * The arch specific probes are 1st so that any on-board ethernet * will be probed before other ISA/EISA/MCA/PCI bus cards. */ - if (probe_list(dev, m68k_probes) == 0 || - probe_list(dev, mips_probes) == 0) + if (probe_list(dev, m68k_probes) == 0) err = register_netdev(dev); if (err) @@ -396,7 +391,7 @@ if (base_addr == 1) return; - probe_list2(unit, mips_probes2, base_addr == 0) && + probe_list2(unit, mips_probes, base_addr == 0) && probe_list2(unit, eisa_probes, base_addr == 0) && probe_list2(unit, mca_probes, base_addr == 0) && probe_list2(unit, isa_probes, base_addr == 0) && diff -Nru a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c --- a/drivers/net/jazzsonic.c Tue Nov 11 14:15:38 2003 +++ b/drivers/net/jazzsonic.c Tue Nov 11 14:15:38 2003 @@ -80,7 +80,6 @@ /* Index to functions, as function prototypes. */ -extern int sonic_probe(struct net_device *dev); static int sonic_probe1(struct net_device *dev, unsigned int base_addr, unsigned int irq); @@ -89,29 +88,57 @@ * Probe for a SONIC ethernet controller on a Mips Jazz board. * Actually probing is superfluous but we're paranoid. */ -int __init sonic_probe(struct net_device *dev) +struct net_device * __init sonic_probe(int unit) { - unsigned int base_addr = dev ? dev->base_addr : 0; + struct net_device *dev; + struct sonic_local *lp; + unsigned int base_addr; + int err = 0; int i; /* * Don't probe if we're not running on a Jazz board. */ if (mips_machgroup != MACH_GROUP_JAZZ) - return -ENODEV; - if (base_addr >= KSEG0) /* Check a single specified location. */ - return sonic_probe1(dev, base_addr, dev->irq); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; sonic_portlist[i].port; i++) { - int base_addr = sonic_portlist[i].port; - if (check_region(base_addr, 0x100)) - continue; - if (sonic_probe1(dev, base_addr, sonic_portlist[i].irq) == 0) - return 0; + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(0); + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + base_addr = dev->base_addr; + + if (base_addr >= KSEG0) { /* Check a single specified location. */ + err = sonic_probe1(dev, base_addr, dev->irq); + } else if (base_addr != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (i = 0; sonic_portlist[i].port; i++) { + int io = sonic_portlist[i].port; + if (sonic_probe1(dev, io, sonic_portlist[i].irq) == 0) + break; + } + if (!sonic_portlist[i].port) + err = -ENODEV; } - return -ENODEV; + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + lp = dev->priv; + vdma_free(lp->rba_laddr); + kfree(lp->rba); + vdma_free(lp->cda_laddr); + kfree(lp); + release_region(dev->base_addr, 0x100); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init sonic_probe1(struct net_device *dev, unsigned int base_addr, @@ -121,8 +148,11 @@ unsigned int silicon_revision; unsigned int val; struct sonic_local *lp; + int err = -ENODEV; int i; + if (!request_region(base_addr, 0x100, dev->name)) + return -EBUSY; /* * get the Silicon Revision ID. If this is one of the known * one assume that we found a SONIC ethernet controller at @@ -140,12 +170,9 @@ if (known_revisions[i] == 0xffff) { printk("SONIC ethernet controller not found (0x%4x)\n", silicon_revision); - return -ENODEV; + goto out; } - if (!request_region(base_addr, 0x100, dev->name)) - return -EBUSY; - if (sonic_debug && version_printed++ == 0) printk(version); @@ -175,6 +202,8 @@ } printk(" IRQ %d\n", irq); + + err = -ENOMEM; /* Initialize the device structure. */ if (dev->priv == NULL) { @@ -196,7 +225,7 @@ if (lp == NULL) { printk("%s: couldn't allocate memory for descriptors\n", dev->name); - return -ENOMEM; + goto out; } memset(lp, 0, sizeof(struct sonic_local)); @@ -206,7 +235,7 @@ if (lp->cda_laddr == ~0UL) { printk("%s: couldn't get DMA page entry for " "descriptors\n", dev->name); - return -ENOMEM; + goto out1; } lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda); @@ -219,7 +248,7 @@ if (!lp->rba) { printk("%s: couldn't allocate receive buffers\n", dev->name); - return -ENOMEM; + goto out2; } /* get virtual dma address */ @@ -228,7 +257,7 @@ if (lp->rba_laddr == ~0UL) { printk("%s: couldn't get DMA page entry for receive " "buffers\n",dev->name); - return -ENOMEM; + goto out3; } /* now convert pointer to KSEG1 pointer */ @@ -252,9 +281,16 @@ SONIC_WRITE(SONIC_FAET,0xffff); SONIC_WRITE(SONIC_MPT,0xffff); - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); return 0; +out3: + kfree(lp->rba); +out2: + vdma_free(lp->cda_laddr); +out1: + kfree(lp); +out: + release_region(base_addr, 0x100); + return err; } /* From shemminger@osdl.org Wed Nov 12 16:48:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:48:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0m425027240 for ; Wed, 12 Nov 2003 16:48:04 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0l8n31630; Wed, 12 Nov 2003 16:47:08 -0800 Date: Wed, 12 Nov 2003 16:47:08 -0800 From: Stephen Hemminger Message-Id: <200311130047.hAD0l8n31630@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (41/42) sun3_lance Cc: netdev@oss.sgi.com X-archive-position: 1415 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4098 Lines: 169 NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits diff -urN B9-sun3_82586/drivers/net/Space.c B9-sun3_lance/drivers/net/Space.c --- B9-sun3_82586/drivers/net/Space.c Tue Nov 11 20:25:10 2003 +++ B9-sun3_lance/drivers/net/Space.c Tue Nov 11 20:49:12 2003 @@ -75,7 +75,7 @@ extern struct net_device *seeq8005_probe(int unit); extern struct net_device *smc_init(int unit); extern int atarilance_probe(struct net_device *); -extern int sun3lance_probe(struct net_device *); +extern struct net_device *sun3lance_probe(int unit); extern struct net_device *sun3_82586_probe(int unit); extern struct net_device *apne_probe(int unit); extern struct net_device *bionet_probe(int unit); @@ -300,13 +300,13 @@ #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */ {atarilance_probe, 0}, #endif -#ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */ - {sun3lance_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */ + {sun3lance_probe, 0}, +#endif #ifdef CONFIG_SUN3_82586 /* sun3 onboard Intel 82586 chip */ {sun3_82586_probe, 0}, #endif diff -urN B9-sun3_82586/drivers/net/sun3lance.c B9-sun3_lance/drivers/net/sun3lance.c --- B9-sun3_82586/drivers/net/sun3lance.c Mon May 26 22:21:36 2003 +++ B9-sun3_lance/drivers/net/sun3lance.c Tue Nov 11 20:49:12 2003 @@ -246,9 +246,11 @@ /************************* End of Prototypes **************************/ -int __init sun3lance_probe( struct net_device *dev ) -{ +struct net_device * __init sun3lance_probe(int unit) +{ + struct net_device *dev; static int found; + int err = -ENODEV; /* check that this machine has an onboard lance */ switch(idprom->id_machtype) { @@ -259,18 +261,37 @@ break; default: - return(-ENODEV); + return ERR_PTR(-ENODEV); } - if(found) - return(-ENODEV); + if (found) + return ERR_PTR(-ENODEV); - if (lance_probe(dev)) { - found = 1; - return( 0 ); + dev = alloc_etherdev(sizeof(struct lance_private)); + if (!dev) + return ERR_PTR(-ENOMEM); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); } + SET_MODULE_OWNER(dev); + + if (!lance_probe(dev)) + goto out; - return( -ENODEV ); + err = register_netdev(dev); + if (err) + goto out1; + found = 1; + return dev; + +out1: +#ifdef CONFIG_SUN3 + iounmap(dev->base_addr); +#endif +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init lance_probe( struct net_device *dev) @@ -285,6 +306,8 @@ #ifdef CONFIG_SUN3 ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE); + if (!ioaddr) + return 0; #else ioaddr = SUN3X_LANCE; #endif @@ -303,17 +326,15 @@ ioaddr_probe[0] = tmp1; ioaddr_probe[1] = tmp2; +#ifdef CONFIG_SUN3 + iounmap(ioaddr); +#endif return 0; } - init_etherdev( dev, sizeof(struct lance_private) ); - if (!dev->priv) { - dev->priv = kmalloc( sizeof(struct lance_private), GFP_KERNEL ); - if (!dev->priv) - return 0; - } lp = (struct lance_private *)dev->priv; + /* XXX - leak? */ MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); lp->iobase = (volatile unsigned short *)ioaddr; @@ -921,32 +942,24 @@ #ifdef MODULE -static char devicename[9]; -static struct net_device sun3lance_dev = -{ - devicename, /* filled in by register_netdev() */ - 0, 0, 0, 0, /* memory */ - 0, 0, /* base, irq */ - 0, 0, 0, NULL, sun3lance_probe, -}; +static struct net_device *sun3lance_dev; int init_module(void) { - int err; - - if ((err = register_netdev( &sun3lance_dev ))) { - if (err == -EIO) { - printk( "SUN3 Lance not detected. Module not loaded.\n"); - } - return( err ); - } - return( 0 ); + sun3lance_dev = sun3lance_probe(-1); + if (IS_ERR(sun3lance_dev)) + return PTR_ERR(sun3lance_dev); + return 0; } void cleanup_module(void) { - unregister_netdev( &sun3lance_dev ); + unregister_netdev(sun3lance_dev); +#ifdef CONFIG_SUN3 + iounmap(sun3lance_dev->base_addr); +#endif + free_netdev(sun3lance_dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:46:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46:56 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0ka25025998 for ; Wed, 12 Nov 2003 16:46:36 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0kSJ31429; Wed, 12 Nov 2003 16:46:28 -0800 Date: Wed, 12 Nov 2003 16:46:28 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0kSJ31429@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (37/42) pamsnet Cc: netdev@oss.sgi.com X-archive-position: 1409 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4239 Lines: 163 NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits diff -urN B9-hplance/drivers/net/Space.c B9-pamsnet/drivers/net/Space.c --- B9-hplance/drivers/net/Space.c Tue Nov 11 15:10:51 2003 +++ B9-pamsnet/drivers/net/Space.c Tue Nov 11 15:18:06 2003 @@ -79,7 +79,7 @@ extern int sun3_82586_probe(struct net_device *); extern int apne_probe(struct net_device *); extern int bionet_probe(struct net_device *); -extern int pamsnet_probe(struct net_device *); +extern struct net_device *pamsnet_probe(int unit); extern struct net_device *cs89x0_probe(int unit); extern struct net_device *hplance_probe(int unit); extern struct net_device *bagetlance_probe(int unit); @@ -312,13 +312,13 @@ #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ {bionet_probe, 0}, #endif -#ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */ - {pamsnet_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_ATARI_PAMSNET /* At