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 /* Atari PAMsNet Ethernet board */ + {pamsnet_probe, 0}, +#endif #ifdef CONFIG_HPLANCE /* HP300 internal Ethernet */ {hplance_probe, 0}, #endif diff -urN B9-hplance/drivers/net/atari_pamsnet.c B9-pamsnet/drivers/net/atari_pamsnet.c --- B9-hplance/drivers/net/atari_pamsnet.c Mon Jul 28 11:13:06 2003 +++ B9-pamsnet/drivers/net/atari_pamsnet.c Tue Nov 11 15:18:06 2003 @@ -158,8 +158,6 @@ static int get_status (void); static int calc_received (void *start_address); -extern int pamsnet_probe(struct net_device *dev); - static int pamsnet_open(struct net_device *dev); static int pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev); static void pamsnet_poll_rx(struct net_device *); @@ -562,12 +560,12 @@ /* Check for a network adaptor of this type, and return '0' if one exists. */ -int __init -pamsnet_probe (dev) - struct net_device *dev; +struct net_device * __init pamsnet_probe (int unit) { + struct net_device *dev; int i; HADDR *hwaddr; + int err; unsigned char station_addr[6]; static unsigned version_printed; @@ -575,12 +573,18 @@ static int no_more_found; if (no_more_found) - return -ENODEV; + return ERR_PTR(-ENODEV); + no_more_found = 1; + 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); - no_more_found = 1; - printk("Probing for PAM's Net/GK Adapter...\n"); /* Allocate the DMA buffer here since we need it for probing! */ @@ -618,11 +622,12 @@ ENABLE_IRQ(); stdma_release(); - if (lance_target < 0) + if (lance_target < 0) { printk("No PAM's Net/GK found.\n"); + free_netdev(dev); + return ERR_PTR(-ENODEV); + } - if ((dev == NULL) || (lance_target < 0)) - return -ENODEV; if (pamsnet_debug > 0 && version_printed++ == 0) printk(version); @@ -632,12 +637,6 @@ station_addr[3], station_addr[4], station_addr[5]); /* Initialize the 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)); - dev->open = pamsnet_open; dev->stop = pamsnet_close; dev->hard_start_xmit = pamsnet_send_packet; @@ -653,9 +652,12 @@ #endif dev->dev_addr[i] = station_addr[i]; } - ether_setup(dev); + err = register_netdev(dev); + if (!err) + return dev; - return(0); + free_netdev(dev); + return ERR_PTR(err); } /* Open/initialize the board. This is called (in the current kernel) @@ -866,25 +868,20 @@ #ifdef MODULE -static struct net_device pam_dev; - -int -init_module(void) { - int err; +static struct net_device *pam_dev; - pam_dev.init = pamsnet_probe; - if ((err = register_netdev(&pam_dev))) { - if (err == -EEXIST) { - printk("PAM's Net/GK: devices already present. Module not loaded.\n"); - } - return err; - } +int init_module(void) +{ + pam_dev = pamsnet_probe(-1); + if (IS_ERR(pam_dev)) + return PTR_ERR(pam_dev); return 0; } -void -cleanup_module(void) { - unregister_netdev(&pam_dev); +void cleanup_module(void) +{ + unregister_netdev(pam_dev); + free_netdev(pam_dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:47:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:47:23 -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 hAD0l425026370 for ; Wed, 12 Nov 2003 16:47:05 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0kwA31549; Wed, 12 Nov 2003 16:46:58 -0800 Date: Wed, 12 Nov 2003 16:46:58 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0kwA31549@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (40/42) sun3_82586 Cc: netdev@oss.sgi.com X-archive-position: 1412 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: 4398 Lines: 172 NE66-sun3_82586 * 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 Wed Nov 12 16:16:14 2003 +++ b/drivers/net/Space.c Wed Nov 12 16:16:14 2003 @@ -76,7 +76,7 @@ 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 *); +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); extern struct net_device *pamsnet_probe(int unit); @@ -302,13 +302,13 @@ #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 {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_SUN3_82586 /* sun3 onboard Intel 82586 chip */ + {sun3_82586_probe, 0}, +#endif #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */ {apne_probe, 0}, #endif diff -Nru a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c --- a/drivers/net/sun3_82586.c Wed Nov 12 16:16:14 2003 +++ b/drivers/net/sun3_82586.c Wed Nov 12 16:16:14 2003 @@ -277,10 +277,12 @@ memset((char *)p->scb,0,sizeof(struct scb_struct)); } -int __init sun3_82586_probe(struct net_device *dev) +struct net_device * __init sun3_82586_probe(int unit) { + struct net_device *dev; unsigned long ioaddr; static int found = 0; + int err = -ENOMEM; /* check that this machine has an onboard 82586 */ switch(idprom->id_machtype) { @@ -290,31 +292,51 @@ break; default: - return(-ENODEV); + return ERR_PTR(-ENODEV); } - if(found) - return -ENODEV; + if (found) + return ERR_PTR(-ENODEV); ioaddr = (unsigned long)ioremap(IE_OBIO, PAGE_SIZE); + if (!ioaddr) + return ERR_PTR(-ENOMEM); found = 1; + dev = alloc_etherdev(sizeof(struct priv)); + if (!dev) + goto out; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } SET_MODULE_OWNER(dev); dev->irq = IE_IRQ; dev->base_addr = ioaddr; - if(sun3_82586_probe1(dev, ioaddr) == 0) - return 0; - - return -ENODEV; + err = sun3_82586_probe1(dev, ioaddr); + if (err) + goto out1; + err = register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(ioaddr, SUN3_82586_TOTAL_SIZE); +out1: + free_netdev(dev); +out: + iounmap(ioaddr); + return ERR_PTR(err); } static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr) { int i, size, retval; -// if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, dev->name)) -// return -EBUSY; + if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, dev->name)) + return -EBUSY; /* copy in the ethernet address from the prom */ for(i = 0; i < 6 ; i++) @@ -341,16 +363,6 @@ goto out; } - dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); - if(dev->priv == NULL) { - printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name); - retval = -ENOMEM; - goto out; - } - - /* warning: we don't free it on errors */ - memset((char *) dev->priv,0,sizeof(struct priv)); - ((struct priv *) (dev->priv))->memtop = (char *)dvma_btov(dev->mem_start); ((struct priv *) (dev->priv))->base = (unsigned long) dvma_btov(0); alloc586(dev); @@ -374,11 +386,9 @@ dev->set_multicast_list = set_multicast_list; dev->if_port = 0; - - ether_setup(dev); - return 0; out: + release_region(ioaddr, SUN3_82586_TOTAL_SIZE); return retval; } @@ -1138,21 +1148,23 @@ #ifdef MODULE #error This code is not currently supported as a module -static struct net_device dev_sun3_82586; +static struct net_device *dev_sun3_82586; int init_module(void) { - dev_sun3_82586.init = sun3_82586_probe; - if (register_netdev(&dev_sun3_82586) != 0) - return -EIO; + dev_sun3_82586 = sun3_82586_probe(-1); + if (IS_ERR(dev_sun3_82586)) + return PTR_ERR(dev_sun3_82586); return 0; } void cleanup_module(void) { - unregister_netdev(&dev_sun3_82586); - kfree(dev_sun3_82586.priv); - dev_sun3_82586.priv = NULL; + unsigned long ioaddr = dev_sun3_82586->base_addr; + unregister_netdev(dev_sun3_82586); + release_region(ioaddr, SUN3_82586_TOTAL_SIZE); + iounmap(ioaddr); + free_netdev(dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:44:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44: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 hAD0iP25023812 for ; Wed, 12 Nov 2003 16:44:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0hSw30717; Wed, 12 Nov 2003 16:43:28 -0800 Date: Wed, 12 Nov 2003 16:43:28 -0800 From: Stephen Hemminger Message-Id: <200311130043.hAD0hSw30717@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (19/42) 3c515-T10 Cc: netdev@oss.sgi.com X-archive-position: 1395 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: 13464 Lines: 462 NE43-3c515 * convert to dynamic allocation * fixed up device list handling diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c --- a/drivers/net/3c515.c Wed Nov 12 13:20:13 2003 +++ b/drivers/net/3c515.c Wed Nov 12 13:20:13 2003 @@ -307,7 +307,8 @@ struct corkscrew_private { const char *product_name; - struct net_device *next_module; + struct list_head list; + struct net_device *our_dev; /* The Rx and Tx rings are here to keep them quad-word-aligned. */ struct boom_rx_desc rx_ring[RX_RING_SIZE]; struct boom_tx_desc tx_ring[TX_RING_SIZE]; @@ -329,6 +330,7 @@ full_bus_master_tx:1, full_bus_master_rx:1, /* Boomerang */ tx_full:1; spinlock_t lock; + struct device *dev; }; /* The action to take with a media selection timer tick. @@ -367,17 +369,12 @@ MODULE_DEVICE_TABLE(isapnp, corkscrew_isapnp_adapters); -static int corkscrew_isapnp_phys_addr[3]; - static int nopnp; #endif /* __ISAPNP__ */ -static int corkscrew_scan(struct net_device *dev); -static struct net_device *corkscrew_found_device(struct net_device *dev, - int ioaddr, int irq, - int product_index, - int options); -static int corkscrew_probe1(struct net_device *dev); +static struct net_device *corkscrew_scan(int unit); +static void corkscrew_setup(struct net_device *dev, int ioaddr, + struct pnp_dev *idev, int card_number); static int corkscrew_open(struct net_device *dev); static void corkscrew_timer(unsigned long arg); static int corkscrew_start_xmit(struct sk_buff *skb, @@ -413,47 +410,99 @@ #ifdef MODULE static int debug = -1; /* A list of all installed Vortex devices, for removing the driver module. */ -static struct net_device *root_corkscrew_dev; +/* we will need locking (and refcounting) if we ever use it for more */ +static LIST_HEAD(root_corkscrew_dev); int init_module(void) { - int cards_found; - + int found = 0; if (debug >= 0) corkscrew_debug = debug; if (corkscrew_debug) printk(version); - - root_corkscrew_dev = NULL; - cards_found = corkscrew_scan(NULL); - return cards_found ? 0 : -ENODEV; + while (corkscrew_scan(-1)) + found++; + return found ? 0 : -ENODEV; } #else -int tc515_probe(struct net_device *dev) +struct net_device *tc515_probe(int unit) { - int cards_found = 0; + struct net_device *dev = corkscrew_scan(unit); + static int printed; - SET_MODULE_OWNER(dev); - - cards_found = corkscrew_scan(dev); + if (!dev) + return ERR_PTR(-ENODEV); - if (corkscrew_debug > 0 && cards_found) + if (corkscrew_debug > 0 && !printed) { + printed = 1; printk(version); + } - return cards_found ? 0 : -ENODEV; + return dev; } #endif /* not MODULE */ -static int corkscrew_scan(struct net_device *dev) +static int check_device(unsigned ioaddr) +{ + int timer; + + if (!request_region(ioaddr, CORKSCREW_TOTAL_SIZE, "3c515")) + return 0; + /* Check the resource configuration for a matching ioaddr. */ + if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) { + release_region(ioaddr, CORKSCREW_TOTAL_SIZE); + return 0; + } + /* Verify by reading the device ID from the EEPROM. */ + outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd); + /* Pause for at least 162 us. for the read to take place. */ + for (timer = 4; timer >= 0; timer--) { + udelay(162); + if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) == 0) + break; + } + if (inw(ioaddr + Wn0EepromData) != 0x6d50) { + release_region(ioaddr, CORKSCREW_TOTAL_SIZE); + return 0; + } + return 1; +} + +static void cleanup_card(struct net_device *dev) +{ + struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + list_del_init(&vp->list); + if (dev->dma) + free_dma(dev->dma); + outw(TotalReset, dev->base_addr + EL3_CMD); + release_region(dev->base_addr, CORKSCREW_TOTAL_SIZE); + if (vp->dev) + pnp_device_detach(to_pnp_dev(vp->dev)); +} + +static struct net_device *corkscrew_scan(int unit) { - int cards_found = 0; + struct net_device *dev; + static int cards_found = 0; static int ioaddr; + int err; #ifdef __ISAPNP__ short i; static int pnp_cards; #endif + dev = alloc_etherdev(sizeof(struct corkscrew_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); + #ifdef __ISAPNP__ if(nopnp == 1) goto no_pnp; @@ -470,7 +519,7 @@ if (pnp_activate_dev(idev) < 0) { printk("pnp activate failed (out of resources?)\n"); pnp_device_detach(idev); - return -ENOMEM; + continue; } if (!pnp_port_valid(idev, 0) || !pnp_irq_valid(idev, 0)) { pnp_device_detach(idev); @@ -478,40 +527,22 @@ } ioaddr = pnp_port_start(idev, 0); irq = pnp_irq(idev, 0); - if(corkscrew_debug) - printk ("ISAPNP reports %s at i/o 0x%x, irq %d\n", - (char*) corkscrew_isapnp_adapters[i].driver_data, ioaddr, irq); - - if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) { + if (!check_device(ioaddr)) { pnp_device_detach(idev); continue; } - /* Verify by reading the device ID from the EEPROM. */ - { - int timer; - outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd); - /* Pause for at least 162 us. for the read to take place. */ - for (timer = 4; timer >= 0; timer--) { - udelay(162); - if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) - == 0) - break; - } - if (inw(ioaddr + Wn0EepromData) != 0x6d50) { - pnp_device_detach(idev); - continue; - } - } + if(corkscrew_debug) + printk ("ISAPNP reports %s at i/o 0x%x, irq %d\n", + (char*) corkscrew_isapnp_adapters[i].driver_data, ioaddr, irq); printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n", inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); /* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */ - corkscrew_isapnp_phys_addr[pnp_cards] = ioaddr; - corkscrew_found_device(dev, ioaddr, irq, CORKSCREW_ID, dev - && dev->mem_start ? dev-> - mem_start : options[cards_found]); - dev = 0; + corkscrew_setup(dev, ioaddr, idev, cards_found++); pnp_cards++; - cards_found++; + err = register_netdev(dev); + if (!err) + return dev; + cleanup_card(dev); } } no_pnp: @@ -519,123 +550,62 @@ /* Check all locations on the ISA bus -- evil! */ for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x20) { - int irq; -#ifdef __ISAPNP__ - /* Make sure this was not already picked up by isapnp */ - if(ioaddr == corkscrew_isapnp_phys_addr[0]) continue; - if(ioaddr == corkscrew_isapnp_phys_addr[1]) continue; - if(ioaddr == corkscrew_isapnp_phys_addr[2]) continue; -#endif /* __ISAPNP__ */ - if (check_region(ioaddr, CORKSCREW_TOTAL_SIZE)) - continue; - /* Check the resource configuration for a matching ioaddr. */ - if ((inw(ioaddr + 0x2002) & 0x1f0) != (ioaddr & 0x1f0)) + if (!check_device(ioaddr)) continue; - /* Verify by reading the device ID from the EEPROM. */ - { - int timer; - outw(EEPROM_Read + 7, ioaddr + Wn0EepromCmd); - /* Pause for at least 162 us. for the read to take place. */ - for (timer = 4; timer >= 0; timer--) { - udelay(162); - if ((inw(ioaddr + Wn0EepromCmd) & 0x0200) - == 0) - break; - } - if (inw(ioaddr + Wn0EepromData) != 0x6d50) - continue; - } + printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n", inl(ioaddr + 0x2002), inw(ioaddr + 0x2000)); - irq = inw(ioaddr + 0x2002) & 15; - corkscrew_found_device(dev, ioaddr, irq, CORKSCREW_ID, - dev && dev->mem_start ? dev->mem_start : - (cards_found >= MAX_UNITS ? -1 : - options[cards_found])); - dev = 0; - cards_found++; + corkscrew_setup(dev, ioaddr, NULL, cards_found++); + err = register_netdev(dev); + if (!err) + return dev; + cleanup_card(dev); } - if (corkscrew_debug) - printk(KERN_INFO "%d 3c515 cards found.\n", cards_found); - return cards_found; + free_netdev(dev); + return NULL; } -static struct net_device *corkscrew_found_device(struct net_device *dev, - int ioaddr, int irq, - int product_index, - int options) +static void corkscrew_setup(struct net_device *dev, int ioaddr, + struct pnp_dev *idev, int card_number) { - struct corkscrew_private *vp; - -#ifdef MODULE - /* Allocate and fill new device structure. */ - int dev_size = sizeof(struct corkscrew_private); - - dev = alloc_etherdev(dev_size); - if (!dev) - goto err_out; - memset(dev, 0, dev_size); + struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ + int i; + int irq; - vp = (struct corkscrew_private *) dev->priv; - dev->base_addr = ioaddr; - dev->irq = irq; - dev->dma = (product_index == CORKSCREW_ID ? inw(ioaddr + 0x2000) & 7 : 0); - dev->init = corkscrew_probe1; - vp->product_name = "3c515"; - vp->options = options; - if (options >= 0) { - vp->media_override = ((options & 7) == 2) ? 0 : options & 7; - vp->full_duplex = (options & 8) ? 1 : 0; - vp->bus_master = (options & 16) ? 1 : 0; + if (idev) { + irq = pnp_irq(idev, 0); + vp->dev = &idev->dev; } else { - vp->media_override = 7; - vp->full_duplex = 0; - vp->bus_master = 0; + irq = inw(ioaddr + 0x2002) & 15; } - vp->next_module = root_corkscrew_dev; - root_corkscrew_dev = dev; - SET_MODULE_OWNER(dev); - if (register_netdev(dev) < 0) - goto err_free_dev; -#else /* not a MODULE */ - /* Caution: quad-word alignment required for rings! */ - dev->priv = kmalloc(sizeof(struct corkscrew_private), GFP_KERNEL); - if (!dev->priv) - goto err_out; - memset(dev->priv, 0, sizeof(struct corkscrew_private)); - dev = init_etherdev(dev, sizeof(struct corkscrew_private)); + dev->base_addr = ioaddr; dev->irq = irq; - dev->dma = (product_index == CORKSCREW_ID ? inw(ioaddr + 0x2000) & 7 : 0); - vp = (struct corkscrew_private *) dev->priv; + dev->dma = inw(ioaddr + 0x2000) & 7; vp->product_name = "3c515"; - vp->options = options; - if (options >= 0) { - vp->media_override = ((options & 7) == 2) ? 0 : options & 7; - vp->full_duplex = (options & 8) ? 1 : 0; - vp->bus_master = (options & 16) ? 1 : 0; + vp->options = dev->mem_start; + vp->our_dev = dev; + + if (!vp->options) { + if (card_number >= MAX_UNITS) + vp->options = -1; + else + vp->options = options[card_number]; + } + + if (vp->options >= 0) { + vp->media_override = vp->options & 7; + if (vp->media_override == 2) + vp->media_override = 0; + vp->full_duplex = (vp->options & 8) ? 1 : 0; + vp->bus_master = (vp->options & 16) ? 1 : 0; } else { vp->media_override = 7; vp->full_duplex = 0; vp->bus_master = 0; } - - corkscrew_probe1(dev); -#endif /* MODULE */ - return dev; - -err_free_dev: - free_netdev(dev); -err_out: - return NULL; -} - -static int corkscrew_probe1(struct net_device *dev) -{ - int ioaddr = dev->base_addr; - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; - unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ - int i; + list_add(&vp->list, &root_corkscrew_dev); printk(KERN_INFO "%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr); @@ -707,9 +677,6 @@ /* vp->full_bus_master_rx = 0; */ vp->full_bus_master_rx = (vp->capabilities & 0x20) ? 1 : 0; - /* We do a request_region() to register /proc/ioports info. */ - request_region(ioaddr, CORKSCREW_TOTAL_SIZE, vp->product_name); - /* The 3c51x-specific entries in the device structure. */ dev->open = &corkscrew_open; dev->hard_start_xmit = &corkscrew_start_xmit; @@ -719,8 +686,6 @@ dev->get_stats = &corkscrew_get_stats; dev->set_multicast_list = &set_rx_mode; dev->ethtool_ops = &netdev_ethtool_ops; - - return 0; } @@ -1608,20 +1573,16 @@ #ifdef MODULE void cleanup_module(void) { - struct net_device *next_dev; - - while (root_corkscrew_dev) { - next_dev = - ((struct corkscrew_private *) root_corkscrew_dev-> - priv)->next_module; - if (root_corkscrew_dev->dma) - free_dma(root_corkscrew_dev->dma); - unregister_netdev(root_corkscrew_dev); - outw(TotalReset, root_corkscrew_dev->base_addr + EL3_CMD); - release_region(root_corkscrew_dev->base_addr, - CORKSCREW_TOTAL_SIZE); - free_netdev(root_corkscrew_dev); - root_corkscrew_dev = next_dev; + while (!list_empty(&root_corkscrew_dev)) { + struct net_device *dev; + struct corkscrew_private *vp; + + vp = list_entry(root_corkscrew_dev.next, + struct corkscrew_private, list); + dev = vp->our_dev; + unregister_netdev(dev); + cleanup_card(dev); + free_netdev(dev); } } #endif /* MODULE */ diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Nov 12 13:20:13 2003 +++ b/drivers/net/Space.c Wed Nov 12 13:20:13 2003 @@ -84,7 +84,7 @@ extern int hplance_probe(struct net_device *dev); extern int bagetlance_probe(struct net_device *); extern int mvme147lance_probe(struct net_device *dev); -extern int tc515_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 int macsonic_probe(struct net_device *dev); @@ -201,13 +201,13 @@ #ifdef CONFIG_HP100 /* ISA, EISA & PCI */ {hp100_probe, 0}, #endif -#ifdef CONFIG_3C515 - {tc515_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_3C515 + {tc515_probe, 0}, +#endif #ifdef CONFIG_ULTRA {ultra_probe, 0}, #endif From shemminger@osdl.org Wed Nov 12 16:43:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:43: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 hAD0h425022273 for ; Wed, 12 Nov 2003 16:43:04 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0gwO30638; Wed, 12 Nov 2003 16:42:58 -0800 Date: Wed, 12 Nov 2003 16:42:58 -0800 From: Stephen Hemminger Message-Id: <200311130042.hAD0gwO30638@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (16/42) 3c503 Cc: netdev@oss.sgi.com X-archive-position: 1388 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: 7564 Lines: 278 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe diff -Nru a/drivers/net/3c503.c b/drivers/net/3c503.c --- a/drivers/net/3c503.c Tue Nov 11 09:36:03 2003 +++ b/drivers/net/3c503.c Tue Nov 11 09:36:03 2003 @@ -60,7 +60,6 @@ #include "3c503.h" #define WRD_COUNT 4 -int el2_probe(struct net_device *dev); static int el2_pio_probe(struct net_device *dev); static int el2_probe1(struct net_device *dev, int ioaddr); @@ -90,11 +89,11 @@ If the ethercard isn't found there is an optional probe for ethercard jumpered to programmed-I/O mode. */ -int __init -el2_probe(struct net_device *dev) +static int __init do_el2_probe(struct net_device *dev) { int *addr, addrs[] = { 0xddffe, 0xd9ffe, 0xcdffe, 0xc9ffe, 0}; int base_addr = dev->base_addr; + int irq = dev->irq; SET_MODULE_OWNER(dev); @@ -104,16 +103,13 @@ return -ENXIO; for (addr = addrs; *addr; addr++) { - int i; - unsigned int base_bits = isa_readb(*addr); - /* Find first set bit. */ - for(i = 7; i >= 0; i--, base_bits >>= 1) - if (base_bits & 0x1) - break; - if (base_bits != 1) + unsigned base_bits = isa_readb(*addr); + int i = ffs(base_bits) - 1; + if (i == -1 || base_bits != (1 << i)) continue; if (el2_probe1(dev, netcard_portlist[i]) == 0) return 0; + dev->irq = irq; } #if ! defined(no_probe_nonshared_memory) return el2_pio_probe(dev); @@ -128,20 +124,57 @@ el2_pio_probe(struct net_device *dev) { int i; - int base_addr = dev ? dev->base_addr : 0; + int base_addr = dev->base_addr; + int irq = dev->irq; if (base_addr > 0x1ff) /* Check a single specified location. */ return el2_probe1(dev, base_addr); else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; - for (i = 0; netcard_portlist[i]; i++) + for (i = 0; netcard_portlist[i]; i++) { if (el2_probe1(dev, netcard_portlist[i]) == 0) return 0; + dev->irq = irq; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + /* NB: el2_close() handles free_irq */ + release_region(dev->base_addr, EL2_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init el2_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_el2_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); +} + /* Probe for the Etherlink II card at I/O port base IOADDR, returning non-zero on success. If found, set the station address and memory parameters in DEVICE. */ @@ -152,15 +185,19 @@ static unsigned version_printed; unsigned long vendor_id; - /* FIXME: code reads ioaddr + 0x400, we request ioaddr + 16 */ if (!request_region(ioaddr, EL2_IO_EXTENT, dev->name)) return -EBUSY; + if (!request_region(ioaddr + 0x400, 8, dev->name)) { + retval = -EBUSY; + goto out; + } + /* Reset and/or avoid any lurking NE2000 */ if (inb(ioaddr + 0x408) == 0xff) { mdelay(1); retval = -ENODEV; - goto out; + goto out1; } /* We verify that it's a 3C503 board by checking the first three octets @@ -171,7 +208,7 @@ if ( (iobase_reg & (iobase_reg - 1)) || (membase_reg & (membase_reg - 1))) { retval = -ENODEV; - goto out; + goto out1; } saved_406 = inb_p(ioaddr + 0x406); outb_p(ECNTRL_RESET|ECNTRL_THIN, ioaddr + 0x406); /* Reset it... */ @@ -184,7 +221,7 @@ /* Restore the register we frobbed. */ outb(saved_406, ioaddr + 0x406); retval = -ENODEV; - goto out; + goto out1; } if (ei_debug && version_printed++ == 0) @@ -195,7 +232,7 @@ if (ethdev_init(dev)) { printk ("3c503: unable to allocate memory for dev->priv.\n"); retval = -ENOMEM; - goto out; + goto out1; } printk("%s: 3c503 at i/o base %#3x, node ", dev->name, ioaddr); @@ -322,7 +359,10 @@ printk("\n%s: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n", dev->name, ei_status.name, (wordlength+1)<<3); } + release_region(ioaddr + 0x400, 8); return 0; +out1: + release_region(ioaddr + 0x400, 8); out: release_region(ioaddr, EL2_IO_EXTENT); return retval; @@ -633,7 +673,7 @@ #ifdef MODULE #define MAX_EL2_CARDS 4 /* Max number of EL2 cards per module */ -static struct net_device dev_el2[MAX_EL2_CARDS]; +static struct net_device *dev_el2[MAX_EL2_CARDS]; static int io[MAX_EL2_CARDS]; static int irq[MAX_EL2_CARDS]; static int xcvr[MAX_EL2_CARDS]; /* choose int. or ext. xcvr */ @@ -651,28 +691,35 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) { - struct net_device *dev = &dev_el2[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ - dev->init = el2_probe; if (io[this_dev] == 0) { if (this_dev != 0) break; /* only autoprobe 1st one */ printk(KERN_NOTICE "3c503.c: Presently autoprobing (not recommended) for a single card.\n"); } - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "3c503.c: No 3c503 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_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */ + if (do_el2_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_el2[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -681,13 +728,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) { - struct net_device *dev = &dev_el2[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - /* NB: el2_close() handles free_irq */ - release_region(dev->base_addr, EL2_IO_EXTENT); + struct net_device *dev = dev_el2[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + 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 09:36:03 2003 +++ b/drivers/net/Space.c Tue Nov 11 09:36:03 2003 @@ -45,7 +45,7 @@ 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 int el2_probe(struct net_device *dev); +extern struct net_device *el2_probe(int unit); extern struct net_device *ne_probe(int unit); extern struct net_device *hp_probe(int unit); extern struct net_device *hp_plus_probe(int unit); @@ -210,13 +210,13 @@ #ifdef CONFIG_WD80x3 {wd_probe, 0}, #endif -#ifdef CONFIG_EL2 /* 3c503 */ - {el2_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL2 /* 3c503 */ + {el2_probe, 0}, +#endif #ifdef CONFIG_HPLAN {hp_probe, 0}, #endif From shemminger@osdl.org Wed Nov 12 16:45:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:46: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 hAD0jq25025262 for ; Wed, 12 Nov 2003 16:45:52 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0iw231036; Wed, 12 Nov 2003 16:44:58 -0800 Date: Wed, 12 Nov 2003 16:44:58 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0iw231036@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (28/42) ultra32 Cc: netdev@oss.sgi.com X-archive-position: 1403 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: 5414 Lines: 190 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: 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:23:43 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:23:43 2003 @@ -43,7 +43,7 @@ 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); +extern struct net_device *ultra32_probe(int unit); extern struct net_device *wd_probe(int unit); extern struct net_device *el2_probe(int unit); extern struct net_device *ne_probe(int unit); @@ -160,14 +160,11 @@ * drivers that probe for EISA cards (in the ISA group). These are the * legacy EISA only driver probes, and also the legacy PCI probes */ -static struct devprobe eisa_probes[] __initdata = { + +static struct devprobe2 eisa_probes[] __initdata = { #ifdef CONFIG_ULTRA32 {ultra32_probe, 0}, #endif - {NULL, 0}, -}; - -static struct devprobe2 eisa_probes2[] __initdata = { #ifdef CONFIG_AC3200 {ac3200_probe, 0}, #endif @@ -379,8 +376,7 @@ * will be probed before other ISA/EISA/MCA/PCI bus cards. */ if (probe_list(dev, m68k_probes) == 0 || - probe_list(dev, mips_probes) == 0 || - probe_list(dev, eisa_probes) == 0) + probe_list(dev, mips_probes) == 0) err = register_netdev(dev); if (err) @@ -396,7 +392,7 @@ if (base_addr == 1) return; - probe_list2(unit, eisa_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) && probe_list2(unit, parport_probes, base_addr == 0); diff -Nru a/drivers/net/smc-ultra32.c b/drivers/net/smc-ultra32.c --- a/drivers/net/smc-ultra32.c Tue Nov 11 14:23:43 2003 +++ b/drivers/net/smc-ultra32.c Tue Nov 11 14:23:43 2003 @@ -61,7 +61,6 @@ #include "8390.h" -int ultra32_probe(struct net_device *dev); static int ultra32_probe1(struct net_device *dev, int ioaddr); static int ultra32_open(struct net_device *dev); static void ultra32_reset_8390(struct net_device *dev); @@ -98,26 +97,60 @@ #define ULTRA32_CFG6 (-0x15) /* 0xc8b */ #define ULTRA32_CFG7 0x0d /* 0xcad */ +static void cleanup_card(struct net_device *dev) +{ + int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET; + /* NB: ultra32_close_card() does free_irq */ + release_region(ioaddr, ULTRA32_IO_EXTENT); + kfree(dev->priv); +} /* Probe for the Ultra32. This looks like a 8013 with the station address PROM at I/O ports +8 to +13, with a checksum following. */ -int __init ultra32_probe(struct net_device *dev) +struct net_device * __init ultra32_probe(int unit) { - int ioaddr; - - if (!EISA_bus) return -ENODEV; + struct net_device *dev; + int base; + int irq; + int err = -ENODEV; + + if (!EISA_bus) + return ERR_PTR(-ENODEV); + + dev = alloc_etherdev(0); + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } SET_MODULE_OWNER(dev); - /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000 + ULTRA32_BASE; ioaddr < 0x9000; ioaddr += 0x1000) - if (ultra32_probe1(dev, ioaddr) == 0) - return 0; + irq = dev->irq; - return -ENODEV; + /* EISA spec allows for up to 16 slots, but 8 is typical. */ + for (base = 0x1000 + ULTRA32_BASE; base < 0x9000; base += 0x1000) { + if (ultra32_probe1(dev, base) == 0) + break; + dev->irq = irq; + } + if (base >= 0x9000) + 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 ultra32_probe1(struct net_device *dev, int ioaddr) @@ -380,7 +413,7 @@ #ifdef MODULE #define MAX_ULTRA32_CARDS 4 /* Max number of Ultra cards per module */ -static struct net_device dev_ultra[MAX_ULTRA32_CARDS]; +static struct net_device *dev_ultra[MAX_ULTRA32_CARDS]; MODULE_DESCRIPTION("SMC Ultra32 EISA ethernet driver"); MODULE_LICENSE("GPL"); @@ -390,18 +423,15 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_ULTRA32_CARDS; this_dev++) { - struct net_device *dev = &dev_ultra[this_dev]; - dev->init = ultra32_probe; - if (register_netdev(dev) != 0) { - if (found > 0) { /* Got at least one. */ - return 0; - } - printk(KERN_WARNING "smc-ultra32.c: No SMC Ultra32 found.\n"); - return -ENXIO; - } - found++; + struct net_device *dev = ultra32_probe(-1); + if (IS_ERR(dev)) + break; + dev_ultra[found++] = dev; } - return 0; + if (found) + return 0; + printk(KERN_WARNING "smc-ultra32.c: No SMC Ultra32 found.\n"); + return -ENXIO; } void cleanup_module(void) @@ -409,14 +439,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_ULTRA32_CARDS; this_dev++) { - struct net_device *dev = &dev_ultra[this_dev]; - if (dev->priv != NULL) { - int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET; - void *priv = dev->priv; - /* NB: ultra32_close_card() does free_irq */ - release_region(ioaddr, ULTRA32_IO_EXTENT); + struct net_device *dev = dev_ultra[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:45:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:45: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 hAD0jO25024846 for ; Wed, 12 Nov 2003 16:45:25 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0icV30973; Wed, 12 Nov 2003 16:44:38 -0800 Date: Wed, 12 Nov 2003 16:44:38 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0icV30973@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (26/42) es3210 Cc: netdev@oss.sgi.com X-archive-position: 1400 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: 4728 Lines: 183 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: 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:38:12 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:38:12 2003 @@ -64,7 +64,7 @@ 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 *); +extern struct net_device *es_probe(int unit); extern struct net_device *lne390_probe(int unit); extern struct net_device *e2100_probe(int unit); extern struct net_device *ni5010_probe(int unit); @@ -167,13 +167,13 @@ #ifdef CONFIG_AC3200 {ac3200_probe, 0}, #endif -#ifdef CONFIG_ES3210 - {es_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 eisa_probes2[] __initdata = { +#ifdef CONFIG_ES3210 + {es_probe, 0}, +#endif #ifdef CONFIG_LNE390 {lne390_probe, 0}, #endif diff -Nru a/drivers/net/es3210.c b/drivers/net/es3210.c --- a/drivers/net/es3210.c Tue Nov 11 14:38:12 2003 +++ b/drivers/net/es3210.c Tue Nov 11 14:38:12 2003 @@ -62,7 +62,6 @@ #include "8390.h" -int es_probe(struct net_device *dev); static int es_probe1(struct net_device *dev, int ioaddr); static int es_open(struct net_device *dev); @@ -125,9 +124,11 @@ * PROM for a match against the Racal-Interlan assigned value. */ -int __init es_probe(struct net_device *dev) +static int __init do_es_probe(struct net_device *dev) { unsigned short ioaddr = dev->base_addr; + int irq = dev->irq; + int mem_start = dev->mem_start; SET_MODULE_OWNER(dev); @@ -144,13 +145,50 @@ } /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) + for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) { if (es_probe1(dev, ioaddr) == 0) return 0; + dev->irq = irq; + dev->mem_start = mem_start; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + free_irq(dev->irq, dev); + release_region(dev->base_addr, ES_IO_EXTENT); + kfree(dev->priv); +} + +struct net_device * __init es_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_es_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 es_probe1(struct net_device *dev, int ioaddr) { int i, retval; @@ -376,7 +414,7 @@ #ifdef MODULE #define MAX_ES_CARDS 4 /* Max number of ES3210 cards per module */ #define NAMELEN 8 /* # of chars for storing dev->name */ -static struct net_device dev_es3210[MAX_ES_CARDS]; +static struct net_device *dev_es3210[MAX_ES_CARDS]; static int io[MAX_ES_CARDS]; static int irq[MAX_ES_CARDS]; static int mem[MAX_ES_CARDS]; @@ -393,26 +431,33 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) { - struct net_device *dev = &dev_es3210[this_dev]; + if (io[this_dev] == 0 && this_dev != 0) + break; + 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]; /* Currently ignored by driver */ - dev->init = es_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + dev->mem_start = mem[this_dev]; + if (do_es_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_es3210[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -421,13 +466,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_ES_CARDS; this_dev++) { - struct net_device *dev = &dev_es3210[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - free_irq(dev->irq, dev); - release_region(dev->base_addr, ES_IO_EXTENT); + struct net_device *dev = dev_es3210[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } From shemminger@osdl.org Wed Nov 12 16:44:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:44:52 -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 hAD0iY25023938 for ; Wed, 12 Nov 2003 16:44:34 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0iSG30954; Wed, 12 Nov 2003 16:44:28 -0800 Date: Wed, 12 Nov 2003 16:44:28 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0iSG30954@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (25/42) lne390 Cc: netdev@oss.sgi.com X-archive-position: 1397 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: 4866 Lines: 186 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: 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:59:56 2003 +++ b/drivers/net/Space.c Tue Nov 11 13:59:56 2003 @@ -65,7 +65,7 @@ extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); -extern int lne390_probe(struct net_device *); +extern struct net_device *lne390_probe(int unit); extern struct net_device *e2100_probe(int unit); extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); @@ -170,6 +170,10 @@ #ifdef CONFIG_ES3210 {es_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 eisa_probes2[] __initdata = { #ifdef CONFIG_LNE390 {lne390_probe, 0}, #endif @@ -392,6 +396,7 @@ if (base_addr == 1) return; + probe_list2(unit, eisa_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/lne390.c b/drivers/net/lne390.c --- a/drivers/net/lne390.c Tue Nov 11 13:59:56 2003 +++ b/drivers/net/lne390.c Tue Nov 11 13:59:56 2003 @@ -49,7 +49,6 @@ #include "8390.h" -int lne390_probe(struct net_device *dev); static int lne390_probe1(struct net_device *dev, int ioaddr); static int lne390_open(struct net_device *dev); @@ -103,9 +102,11 @@ * PROM for a match against the value assigned to Mylex. */ -int __init lne390_probe(struct net_device *dev) +static int __init do_lne390_probe(struct net_device *dev) { unsigned short ioaddr = dev->base_addr; + int irq = dev->irq; + int mem_start = dev->mem_start; int ret; SET_MODULE_OWNER(dev); @@ -135,11 +136,49 @@ if (lne390_probe1(dev, ioaddr) == 0) return 0; release_region(ioaddr, LNE390_IO_EXTENT); + dev->irq = irq; + dev->mem_start = mem_start; } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + free_irq(dev->irq, dev); + release_region(dev->base_addr, LNE390_IO_EXTENT); + if (ei_status.reg0) + iounmap((void *)dev->mem_start); + kfree(dev->priv); +} + +struct net_device * __init lne390_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_lne390_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 lne390_probe1(struct net_device *dev, int ioaddr) { int i, revision, ret; @@ -373,7 +412,7 @@ #ifdef MODULE #define MAX_LNE_CARDS 4 /* Max number of LNE390 cards per module */ -static struct net_device dev_lne[MAX_LNE_CARDS]; +static struct net_device *dev_lne[MAX_LNE_CARDS]; static int io[MAX_LNE_CARDS]; static int irq[MAX_LNE_CARDS]; static int mem[MAX_LNE_CARDS]; @@ -389,26 +428,33 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) { - struct net_device *dev = &dev_lne[this_dev]; + if (io[this_dev] == 0 && this_dev != 0) + break; + 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->init = lne390_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + if (do_lne390_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_lne[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; - } - return 0; + free_netdev(dev); + printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]); + break; + } + if (found) + return 0; + return -ENXIO; } void cleanup_module(void) @@ -416,15 +462,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_LNE_CARDS; this_dev++) { - struct net_device *dev = &dev_lne[this_dev]; - if (dev->priv != NULL) { - void *priv = dev->priv; - free_irq(dev->irq, dev); - release_region(dev->base_addr, LNE390_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); + struct net_device *dev = dev_lne[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(priv); + cleanup_card(dev); + free_netdev(dev); } } } 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 hAD0ka25025992 for ; Wed, 12 Nov 2003 16:46:36 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0jcJ31234; Wed, 12 Nov 2003 16:45:38 -0800 Date: Wed, 12 Nov 2003 16:45:38 -0800 From: Stephen Hemminger Message-Id: <200311130045.hAD0jcJ31234@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (32/42) mac8390 Cc: netdev@oss.sgi.com X-archive-position: 1408 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: 5543 Lines: 224 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Nov 11 14:16:07 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:16:07 2003 @@ -88,7 +88,7 @@ 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); +extern struct net_device *mac8390_probe(int unit); extern struct net_device *mac89x0_probe(int unit); extern struct net_device *mc32_probe(int unit); extern struct net_device *cops_probe(int unit); @@ -326,13 +326,13 @@ #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 {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */ + {mac8390_probe, 0}, +#endif #ifdef CONFIG_MAC89x0 {mac89x0_probe, 0}, #endif diff -Nru a/drivers/net/mac8390.c b/drivers/net/mac8390.c --- a/drivers/net/mac8390.c Tue Nov 11 14:16:07 2003 +++ b/drivers/net/mac8390.c Tue Nov 11 14:16:07 2003 @@ -124,11 +124,10 @@ static char version[] __initdata = "mac8390.c: v0.4 2001-05-15 David Huggins-Daines and others\n"; -extern int mac8390_probe(struct net_device * dev); extern enum mac8390_type mac8390_ident(struct nubus_dev * dev); extern int mac8390_memsize(unsigned long membase); extern int mac8390_memtest(struct net_device * dev); -extern int mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev, +static int mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev, enum mac8390_type type); static int mac8390_open(struct net_device * dev); @@ -223,14 +222,14 @@ return i * 0x1000; } -static int probed __initdata = 0; - -int __init mac8390_probe(struct net_device * dev) +struct net_device * __init mac8390_probe(int unit) { + struct net_device *dev; volatile unsigned short *i; - int boards_found = 0; int version_disp = 0; struct nubus_dev * ndev = NULL; + static int probed; + int err = -ENDOEV; struct nubus_dir dir; struct nubus_dirent ent; @@ -238,28 +237,29 @@ enum mac8390_type cardtype; - if (probed) - return -ENODEV; - probed++; - /* probably should check for Nubus instead */ if (!MACH_IS_MAC) - 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); + + SET_MODULE_OWNER(dev); while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK, NUBUS_TYPE_ETHERNET, ndev))) { - - dev = NULL; - - if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE) + /* Have we seen it already? */ + if (slots & (1<board->slot)) continue; + slots |= 1<board->slot; - dev = init_etherdev(dev, 0); - if (dev == NULL) { - printk(KERN_ERR "Unable to allocate etherdev" - "structure!\n"); - return -ENOMEM; - } + if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE) + continue; if (version_disp == 0) { version_disp = 1; @@ -358,21 +358,28 @@ printk(KERN_ERR "Card type %s is" " unsupported, sorry\n", cardname[cardtype]); - return -ENODEV; + continue; } } /* Do the nasty 8390 stuff */ - if (mac8390_initdev(dev, ndev, cardtype)) - continue; - boards_found++; + if (!mac8390_initdev(dev, ndev, cardtype)) + break; } - /* We're outta here */ - if (boards_found > 0) - return 0; - else - return -ENODEV; + if (!ndev) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; + +out1: + kfree(dev->priv); + dev->priv = NULL; +out: + free_netdev(dev); + return ERR_PTE(err); } #ifdef MODULE @@ -380,26 +387,40 @@ MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver"); MODULE_LICENSE("GPL"); +/* overkill, of course */ +static struct net_device *dev_mac8390[15]; int init_module(void) { - if (mac8390_probe(NULL)) { + int i; + for (i = 0; i < 15; i++) { + struct net_device *dev = mac8390_probe(-1); + if (IS_ERR(dev)) + break; + dev_mac890[i] = dev; + } + if (!i) { printk(KERN_NOTICE "mac8390.c: No useable cards found, driver NOT installed.\n"); return -ENODEV; } - lock_8390_module(); return 0; } void cleanup_module(void) { - /* FIXME: should probably keep track of net_device structs - somewhere and unregister them here? */ - unlock_8390_module(); + int i; + for (i = 0; i < 15; i++) { + struct net_device *dev = dev_mac890[i]; + if (dev) { + unregister_netdev(dev); + kfree(dev->priv); + free_netdev(dev); + } + } } #endif /* MODULE */ -int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev, +static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev, enum mac8390_type type) { static u32 fwrd4_offsets[16]={ @@ -499,6 +520,8 @@ break; default: printk(KERN_ERR "Card type %s is unsupported, sorry\n", cardname[type]); + kfree(dev->priv); + dev->priv = NULL; return -ENODEV; } @@ -529,7 +552,6 @@ printk ("%s: unable to get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; } - MOD_INC_USE_COUNT; return 0; } @@ -537,7 +559,6 @@ { free_irq(dev->irq, dev); ei_close(dev); - MOD_DEC_USE_COUNT; return 0; } From shemminger@osdl.org Wed Nov 12 16:46:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:47:15 -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 hAD0kk25026193 for ; Wed, 12 Nov 2003 16:46:46 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0kcx31474; Wed, 12 Nov 2003 16:46:38 -0800 Date: Wed, 12 Nov 2003 16:46:38 -0800 From: Stephen Hemminger Message-Id: <200311130046.hAD0kcx31474@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (38/42) bionet Cc: netdev@oss.sgi.com X-archive-position: 1410 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: 3895 Lines: 152 NE63-bionet * 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 Wed Nov 12 14:59:06 2003 +++ b/drivers/net/Space.c Wed Nov 12 14:59:06 2003 @@ -78,7 +78,7 @@ extern int sun3lance_probe(struct net_device *); extern int sun3_82586_probe(struct net_device *); extern int apne_probe(struct net_device *); -extern int bionet_probe(struct net_device *); +extern struct net_device *bionet_probe(int unit); extern struct net_device *pamsnet_probe(int unit); extern struct net_device *cs89x0_probe(int unit); extern struct net_device *hplance_probe(int unit); @@ -308,13 +308,13 @@ #ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */ {apne_probe, 0}, #endif -#ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ - {bionet_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 m68k_probes2[] __initdata = { +#ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ + {bionet_probe, 0}, +#endif #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */ {pamsnet_probe, 0}, #endif diff -Nru a/drivers/net/atari_bionet.c b/drivers/net/atari_bionet.c --- a/drivers/net/atari_bionet.c Wed Nov 12 14:59:06 2003 +++ b/drivers/net/atari_bionet.c Wed Nov 12 14:59:06 2003 @@ -148,8 +148,6 @@ /* Index to functions, as function prototypes. */ -extern int bionet_probe(struct net_device *dev); - static int bionet_open(struct net_device *dev); static int bionet_send_packet(struct sk_buff *skb, struct net_device *dev); static void bionet_poll_rx(struct net_device *); @@ -321,15 +319,26 @@ /* Check for a network adaptor of this type, and return '0' if one exists. */ -int __init -bionet_probe(struct net_device *dev){ +struct net_device * __init bionet_probe(int unit) +{ + struct net_device *dev; unsigned char station_addr[6]; static unsigned version_printed; static int no_more_found; /* avoid "Probing for..." printed 4 times */ int i; + int err; if (!MACH_IS_ATARI || no_more_found) - return -ENODEV; + return ERR_PTR(-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); printk("Probing for BioNet 100 Adapter...\n"); @@ -347,11 +356,10 @@ || station_addr[2] != 'O' ) { no_more_found = 1; printk( "No BioNet 100 found.\n" ); - return -ENODEV; + free_netdev(dev); + return ERR_PTR(-ENODEV); } - SET_MODULE_OWNER(dev); - if (bionet_debug > 0 && version_printed++ == 0) printk(version); @@ -369,12 +377,6 @@ nic_packet, phys_nic_packet ); } - 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)); - dev->open = bionet_open; dev->stop = bionet_close; dev->hard_start_xmit = bionet_send_packet; @@ -390,8 +392,11 @@ #endif dev->dev_addr[i] = station_addr[i]; } - ether_setup(dev); - return 0; + err = register_netdev(dev); + if (!err) + return dev; + free_netdev(dev); + return ERR_PTR(err); } /* Open/initialize the board. This is called (in the current kernel) @@ -640,25 +645,20 @@ #ifdef MODULE -static struct net_device bio_dev; - -int -init_module(void) { - int err; +static struct net_device *bio_dev; - bio_dev.init = bionet_probe; - if ((err = register_netdev(&bio_dev))) { - if (err == -EEXIST) { - printk("BIONET: devices already present. Module not loaded.\n"); - } - return err; - } +int init_module(void) +{ + bio_dev = bionet_probe(-1); + if (IS_ERR(bio_dev)) + return PTR_ERR(bio_dev); return 0; } -void -cleanup_module(void) { - unregister_netdev(&bio_dev); +void cleanup_module(void) +{ + unregister_netdev(bio_dev); + free_netdev(bio_dev); } #endif /* MODULE */ From shemminger@osdl.org Wed Nov 12 16:56:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:57: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 hAD0jh25025141 for ; Wed, 12 Nov 2003 16:45:44 -0800 Received: (from shemminger@localhost) by mail.osdl.org (8.11.6/8.11.6) id hAD0imB30995; Wed, 12 Nov 2003 16:44:48 -0800 Date: Wed, 12 Nov 2003 16:44:48 -0800 From: Stephen Hemminger Message-Id: <200311130044.hAD0imB30995@mail.osdl.org> To: jgarzik@pobox.com Subject: [PATCH] (27/42) ac3200 Cc: netdev@oss.sgi.com X-archive-position: 1416 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: 5014 Lines: 189 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: 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:23:23 2003 +++ b/drivers/net/Space.c Tue Nov 11 14:23:23 2003 @@ -63,7 +63,7 @@ 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 *); +extern struct net_device *ac3200_probe(int unit); extern struct net_device *es_probe(int unit); extern struct net_device *lne390_probe(int unit); extern struct net_device *e2100_probe(int unit); @@ -164,13 +164,13 @@ #ifdef CONFIG_ULTRA32 {ultra32_probe, 0}, #endif -#ifdef CONFIG_AC3200 - {ac3200_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 eisa_probes2[] __initdata = { +#ifdef CONFIG_AC3200 + {ac3200_probe, 0}, +#endif #ifdef CONFIG_ES3210 {es_probe, 0}, #endif diff -Nru a/drivers/net/ac3200.c b/drivers/net/ac3200.c --- a/drivers/net/ac3200.c Tue Nov 11 14:23:23 2003 +++ b/drivers/net/ac3200.c Tue Nov 11 14:23:23 2003 @@ -75,7 +75,6 @@ #define AC_START_PG 0x00 /* First page of 8390 TX buffer */ #define AC_STOP_PG 0x80 /* Last page +1 of the 8390 RX ring */ -int ac3200_probe(struct net_device *dev); static int ac_probe1(int ioaddr, struct net_device *dev); static int ac_open(struct net_device *dev); @@ -96,9 +95,11 @@ or the unique value in the station address PROM. */ -int __init ac3200_probe(struct net_device *dev) +static int __init do_ac3200_probe(struct net_device *dev) { unsigned short ioaddr = dev->base_addr; + int irq = dev->irq; + int mem_start = dev->mem_start; SET_MODULE_OWNER(dev); @@ -110,13 +111,53 @@ if ( ! EISA_bus) return -ENXIO; - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) + for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) { if (ac_probe1(ioaddr, dev) == 0) return 0; + dev->irq = irq; + dev->mem_start = mem_start; + } return -ENODEV; } +static void cleanup_card(struct net_device *dev) +{ + /* Someday free_irq may be in ac_close_card() */ + free_irq(dev->irq, dev); + release_region(dev->base_addr, AC_IO_EXTENT); + if (ei_status.reg0) + iounmap((void *)dev->mem_start); + kfree(dev->priv); +} + +struct net_device * __init ac3200_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_ac3200_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 ac_probe1(int ioaddr, struct net_device *dev) { int i, retval; @@ -338,7 +379,7 @@ #ifdef MODULE #define MAX_AC32_CARDS 4 /* Max number of AC32 cards per module */ -static struct net_device dev_ac32[MAX_AC32_CARDS]; +static struct net_device *dev_ac32[MAX_AC32_CARDS]; static int io[MAX_AC32_CARDS]; static int irq[MAX_AC32_CARDS]; static int mem[MAX_AC32_CARDS]; @@ -354,26 +395,33 @@ int init_module(void) { + struct net_device *dev; int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) { - struct net_device *dev = &dev_ac32[this_dev]; + if (io[this_dev] == 0 && this_dev != 0) + break; + 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]; /* Currently ignored by driver */ - dev->init = ac3200_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; + if (do_ac3200_probe(dev) == 0) { + if (register_netdev(dev) == 0) { + dev_ac32[found++] = dev; + continue; } - return -ENXIO; + cleanup_card(dev); } - found++; + free_netdev(dev); + printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]); + break; } - return 0; + if (found) + return 0; + return -ENXIO; } void @@ -382,16 +430,11 @@ int this_dev; for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) { - struct net_device *dev = &dev_ac32[this_dev]; - if (dev->priv != NULL) { - /* Someday free_irq may be in ac_close_card() */ - free_irq(dev->irq, dev); - release_region(dev->base_addr, AC_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); + struct net_device *dev = dev_ac32[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; + cleanup_card(dev); + free_netdev(dev); } } } From krkumar@us.ibm.com Wed Nov 12 16:58:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 16:58:58 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD0wh25002888 for ; Wed, 12 Nov 2003 16:58:43 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAD0wbFu436598; Wed, 12 Nov 2003 19:58:37 -0500 Received: from [9.47.18.241] (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAD0wa0E169092; Wed, 12 Nov 2003 17:58:36 -0700 Date: Wed, 12 Nov 2003 16:56:20 -0800 (PST) From: Krishna Kumar X-X-Sender: krkumar@linux.local To: davem@redhat.com cc: krkumar@us.ibm.com, , Subject: [PATCH] ref count bug in MLDv2 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1417 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 Content-Length: 2659 Lines: 93 Dave Stevens and I found this problem when the device is going down, mc_destroy_dev() calls igmp6_group_dropped which checks for IFF_UP before calling mld_add_delrec and posting a timer. IFF_UP need not be set though the device is going down (eg last address deletion). So timer can get started at this time. The problem is that when the timer fires (after ifdown is over) for the last time (mld_ifc_timer_expire), it does a __in6_dev_put() and that will not free up the idev. To fix that that the check must be for idev->dead instead. Thanks, - KK --------------------------------------------------------------------------- diff -ruN linux-2.6.0-test9-bk9/net/ipv6/mcast.c linux-2.6.0-test9-bk9.new/net/ipv6/mcast.c --- linux-2.6.0-test9-bk9/net/ipv6/mcast.c 2003-11-12 16:42:05.000000000 -0800 +++ linux-2.6.0-test9-bk9.new/net/ipv6/mcast.c 2003-11-12 16:41:36.000000000 -0800 @@ -664,7 +664,7 @@ goto done; spin_unlock_bh(&mc->mca_lock); - if (dev->flags&IFF_UP) + if (!mc->idev->dead) igmp6_leave_group(mc); spin_lock_bh(&mc->mca_lock); ----------------------------------------------------------------------------- Test script : insmod /lib/modules/2.6.0-test9-bk9/kernel/drivers/net/3c59x.ko ifup eth0 ~kkumar/t1 & a=$! sleep 1 ifdown eth0 rmmod 3c59x ----------------------------------------------------------------------------- where t1.c is : #include #include #include #define MCAST_JOIN_GROUP 42 #define MCAST_LEAVE_GROUP 45 #define _K_SS_MAXSIZE 128 /* Implementation specific max size */ struct __kernel_sockaddr_storage { unsigned short ss_family; /* address family */ /* Following field(s) are implementation specific */ char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; /* space to achieve desired size, */ /* _SS_MAXSIZE value minus size of ss_family */ }; struct group_req { uint32_t gr_interface; /* interface index */ struct __kernel_sockaddr_storage gr_group; }; main() { struct group_req greq; struct sockaddr_in6 *psin6; int s; s = socket(AF_INET6, SOCK_DGRAM, 0); if (s < 0) { perror("socket"); exit(1); } psin6 = (struct sockaddr_in6 *)&greq.gr_group; psin6->sin6_family = AF_INET6; if (inet_pton(AF_INET6, "ff02::3", &psin6->sin6_addr) <= 0) { perror("inet_pton"); exit(0); } greq.gr_interface = if_nametoindex("eth0"); if (setsockopt(s, SOL_IPV6, MCAST_JOIN_GROUP, &greq, sizeof(greq)) < 0) { perror("MCAST_JOIN_GROUP"); exit(1); } while(1); } From jgarzik@pobox.com Wed Nov 12 17:40:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 17:41:18 -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 hAD1es25003971 for ; Wed, 12 Nov 2003 17:40:55 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:42402 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AK6Td-0002s9-6B; Thu, 13 Nov 2003 01:40:53 +0000 Message-ID: <3FB2E115.8040304@pobox.com> Date: Wed, 12 Nov 2003 20:40: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: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] de4x5 - missing free on error path References: <20031112163009.2be5e47d.shemminger@osdl.org> In-Reply-To: <20031112163009.2be5e47d.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1418 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 Content-Length: 10 Lines: 3 applied From davem@pizda.ninka.net Wed Nov 12 18:04:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 18:05:03 -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 hAD24i25004601 for ; Wed, 12 Nov 2003 18:04:44 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA16733; Wed, 12 Nov 2003 17:58:26 -0800 Date: Wed, 12 Nov 2003 17:58:26 -0800 From: "David S. Miller" To: Krishna Kumar Cc: krkumar@us.ibm.com, netdev@oss.sgi.com, dlstevens@us.ibm.com Subject: Re: [PATCH] ref count bug in MLDv2 Message-Id: <20031112175826.13850359.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: 1419 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: 677 Lines: 16 On Wed, 12 Nov 2003 16:56:20 -0800 (PST) Krishna Kumar wrote: > Dave Stevens and I found this problem when the device is going down, > mc_destroy_dev() calls igmp6_group_dropped which checks for IFF_UP before > calling mld_add_delrec and posting a timer. > > IFF_UP need not be set though the device is going down (eg last address > deletion). So timer can get started at this time. The problem is that > when the timer fires (after ifdown is over) for the last time > (mld_ifc_timer_expire), it does a __in6_dev_put() and that will not free > up the idev. > > To fix that that the check must be for idev->dead instead. Applied, thanks a lot Krishna. From garzik@gtf.org Wed Nov 12 18:09:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Nov 2003 18:09:35 -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 hAD29B25004994 for ; Wed, 12 Nov 2003 18:09:11 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 04B316642; Wed, 12 Nov 2003 20:37:16 -0500 (EST) Date: Wed, 12 Nov 2003 20:37:15 -0500 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com Subject: [BK PATCHES] 2.5.x net driver fixes Message-ID: <20031113013715.GA10734@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: 1420 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 Content-Length: 1402 Lines: 48 Linus, please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.5 This will update the following files: drivers/net/tg3.c | 2 +- drivers/net/tulip/de4x5.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) through these ChangeSets: (03/11/12 1.1414.3.4) [netdrvr de4x5] NE54-de4x5 - fix missing free on error path - found by viro (03/11/12 1.1414.3.3) [netdrvr tg3] initialize workqueue correctly (fixes crash) diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c Wed Nov 12 20:34:35 2003 +++ b/drivers/net/tg3.c Wed Nov 12 20:34:35 2003 @@ -7605,7 +7605,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) { diff -Nru a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c --- a/drivers/net/tulip/de4x5.c Wed Nov 12 20:34:35 2003 +++ b/drivers/net/tulip/de4x5.c Wed Nov 12 20:34:35 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 fdonzet@yahoo.fr Thu Nov 13 00:36:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 00:36:17 -0800 (PST) Received: from web25207.mail.ukl.yahoo.com (web25207.mail.ukl.yahoo.com [217.12.10.67]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD8a125018756 for ; Thu, 13 Nov 2003 00:36:02 -0800 Message-ID: <20031113083556.29025.qmail@web25207.mail.ukl.yahoo.com> Received: from [195.68.44.148] by web25207.mail.ukl.yahoo.com via HTTP; Thu, 13 Nov 2003 09:35:56 CET Date: Thu, 13 Nov 2003 09:35:56 +0100 (CET) From: =?iso-8859-1?q?francois=20donzet?= Subject: skb->len <=76 To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1421 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 Content-Length: 401 Lines: 17 Hello, In the tcp_v4_checksum_init function, the statement if(skb->len<=76) appears. What does this size of 76 bytes represent ? And why it is a separate case from other packets? I dont think it is an arbitraty value ;) Thanks ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com From greearb@candelatech.com Thu Nov 13 01:28:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 01:29:09 -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 hAD9So25020272 for ; Thu, 13 Nov 2003 01:28:51 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAD9SfeO031252; Thu, 13 Nov 2003 01:28:41 -0800 Message-ID: <3FB34EC9.1000003@candelatech.com> Date: Thu, 13 Nov 2003 01:28:41 -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'" CC: "Feldman, Scott" Subject: e100 and bad CRC packets. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1422 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 Content-Length: 267 Lines: 12 Is there a way to make the e100 (and/or e1000) driver pass packets with bad CRC up the stack so that they could be passed to tcpdump or a raw packet socket? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From felix@allot.com Thu Nov 13 01:56:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 01:56:37 -0800 (PST) Received: from mxout4.netvision.net.il (mxout4.netvision.net.il [194.90.9.27]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAD9uM25020867 for ; Thu, 13 Nov 2003 01:56:23 -0800 Received: from exg.allot.com ([199.203.223.202]) by mxout4.netvision.net.il (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with ESMTP id <0HOA00E6BBF7WJ@mxout4.netvision.net.il> for netdev@oss.sgi.com; Thu, 13 Nov 2003 11:52:19 +0200 (IST) Received: from allot.com (199.203.223.201 [199.203.223.201]) by exg.allot.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id WLNNKBNL; Thu, 13 Nov 2003 11:51:59 +0200 Date: Thu, 13 Nov 2003 11:50:38 +0200 From: Felix Radensky Subject: ethtool support in sk98lin driver To: "'netdev@oss.sgi.com'" Message-id: <3FB353EE.7000300@allot.com> Organization: Allot Communications Ltd. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-archive-position: 1423 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felix@allot.com Precedence: bulk X-list: netdev Content-Length: 189 Lines: 10 Hi, Are there any plans to add ethtool support to sk98lin driver ? Most modern drivers have it, and it's a pity that actively maintained driver lacks this basic feature. Thanks. Felix. From kuznet@ms2.inr.ac.ru Thu Nov 13 02:08:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 02:08:41 -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 hADA8N25021394 for ; Thu, 13 Nov 2003 02:08:25 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id NAA23770; Thu, 13 Nov 2003 13:07:57 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200311131007.NAA23770@yakov.inr.ac.ru> Subject: Re: RFC 3484 support To: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Nov 2003 13:07:57 +0300 (MSK) Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, kuznet@ms2.inr.ac.ru In-Reply-To: <3FB18758.8040708@redhat.com> from "Ulrich Drepper" at îÏÑ 11, 2003 05:05:28 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: 1424 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 Content-Length: 1134 Lines: 34 Hello! > 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 This interface is connect() for example. Essentially, connect() on datagram socket with subsequent getsockname() makes exactly this. > #2 above has serious problems. This is just impossible. > 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)? Do you really need this? Right now the kernel is able to to determine a valid source address derived from some known destination address and nothing more. It is just connect(). I do not understand rfc3484, actually. Does it involve some policies made inside libc, which could contradict to policies used by kernel? If so, it is definitely unimplementable without surgery in the kernel. Alexey From herbert@gondor.apana.org.au Thu Nov 13 03:04:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 03:05:08 -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 hADB4m25025569 for ; Thu, 13 Nov 2003 03:04:50 -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 1AKFHE-0005eB-00; Thu, 13 Nov 2003 22:04:40 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AKFHC-0007gg-00; Thu, 13 Nov 2003 22:04:38 +1100 Date: Thu, 13 Nov 2003 22:04:38 +1100 To: davem@redhat.com, netdev@oss.sgi.com Subject: [IPV4] Always set hoplimit Message-ID: <20031113110438.GA29522@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1425 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 Content-Length: 1797 Lines: 50 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: Is there any reason why local/broadcast packets should have a ttl of zero? This is the result of the HOPLIMIT change as those packets doesn't get their HOPLIMIT set. This patch sets it for them. Am I missing something? -- 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 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: kernel-source-2.4/net/ipv4/route.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/net/ipv4/route.c,v retrieving revision 1.6 diff -u -r1.6 route.c --- kernel-source-2.4/net/ipv4/route.c 3 Sep 2003 10:27:21 -0000 1.6 +++ kernel-source-2.4/net/ipv4/route.c 13 Nov 2003 10:58:04 -0000 @@ -1275,9 +1275,6 @@ rt->rt_gateway = FIB_RES_GW(*res); memcpy(rt->u.dst.metrics, fi->fib_metrics, sizeof(rt->u.dst.metrics)); - if (rt->u.dst.metrics[RTAX_HOPLIMIT-1] == 0) - rt->u.dst.metrics[RTAX_HOPLIMIT-1] = - sysctl_ip_default_ttl; if (fi->fib_mtu == 0) { rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu; if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) && @@ -1291,6 +1288,8 @@ } else rt->u.dst.metrics[RTAX_MTU-1]= rt->u.dst.dev->mtu; + if (rt->u.dst.metrics[RTAX_HOPLIMIT-1] == 0) + rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl; if (rt->u.dst.metrics[RTAX_MTU-1] > IP_MAX_MTU) rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU; if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0) --RnlQjJ0d97Da+TV1-- From kuznet@ms2.inr.ac.ru Thu Nov 13 03:09:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 03:09:18 -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 hADB8w25026044 for ; Thu, 13 Nov 2003 03:08:59 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id OAA24780; Thu, 13 Nov 2003 14:08:00 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200311131108.OAA24780@yakov.inr.ac.ru> Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS To: cfriesen@nortelnetworks.com (Chris Friesen) Date: Thu, 13 Nov 2003 14:08:00 +0300 (MSK) Cc: davem@redhat.com, jmorris@redhat.com, hadi@znyx.com, netdev@oss.sgi.com In-Reply-To: <3FAA5FF6.50509@nortelnetworks.com> from "Chris Friesen" at îÏÑ 06, 2003 09:51:34 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: 1426 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 Content-Length: 537 Lines: 17 Hello! > 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? To set DSCP field you set the thing known as TOS with IP_TOS. To set VLAN priority, you tune VLAN f.e. to use DSCP bits in classifier to derive VLAN priority from those bits of DSCP, which you desire. DSCP>>5 in your case. And remember that if the box is DS aware, DS will rewrite your DSCP in the way consistent with sustem configuration. Alexey From jgarzik@pobox.com Thu Nov 13 04:21:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 04:22:06 -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 hADCLp25030030 for ; Thu, 13 Nov 2003 04:21:52 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40913 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJg7S-0003eU-9C; Tue, 11 Nov 2003 21:32:14 +0000 Message-ID: <3FB15550.8020807@pobox.com> Date: Tue, 11 Nov 2003 16:32:00 -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: johnip@sgi.com CC: "David S. Miller" , 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> <20031111122403.2d7bcf28.davem@redhat.com> <3FB153F1.8040708@sgi.com> In-Reply-To: <3FB153F1.8040708@sgi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1427 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 Content-Length: 403 Lines: 18 John Partridge wrote: > 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 Ask the other David M about eepro100.c patches he wanted to send to me... Jeff From richard@queensletch.com Thu Nov 13 05:16:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 05:16:27 -0800 (PST) Received: from mra03.ex.eclipse.net.uk (mra03.ex.eclipse.net.uk [212.104.129.88]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hADDG425030878 for ; Thu, 13 Nov 2003 05:16:08 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by mra03.ex.eclipse.net.uk (Postfix) with ESMTP id 473832E2DF1 for ; Thu, 13 Nov 2003 13:16:53 +0000 (GMT) Received: from mra03.ex.eclipse.net.uk ([127.0.0.1]) by localhost (mra03.ex.eclipse.net.uk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29981-01-90 for ; Thu, 13 Nov 2003 13:16:52 +0000 (GMT) Received: from Shuttle.lan (unknown [81.168.13.44]) by mra03.ex.eclipse.net.uk (Postfix) with ESMTP id 49C3A2E2BD1 for ; Thu, 13 Nov 2003 13:16:50 +0000 (GMT) From: Richard To: netdev@oss.sgi.com Subject: forcedeth Date: Thu, 13 Nov 2003 13:07:52 +0000 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311131307.53087.richard@queensletch.com> X-Virus-Scanned: by amavisd-new at eclipse.net.uk X-archive-position: 1428 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: richard@queensletch.com Precedence: bulk X-list: netdev Content-Length: 175 Lines: 7 Working fine here on a sudhian shuttle - nforce2. I obtained the driver via the mm2 patch. A way of tuning off the debug output would be nice. Good job all round, Richard From pekkas@netcore.fi Thu Nov 13 05:26:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 05:27:00 -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 hADDQh25031832 for ; Thu, 13 Nov 2003 05:26:44 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id hADDQLJ03676; Thu, 13 Nov 2003 15:26:21 +0200 Date: Thu, 13 Nov 2003 15:26:20 +0200 (EET) From: Pekka Savola To: kuznet@ms2.inr.ac.ru cc: Ulrich Drepper , , Subject: Re: RFC 3484 support In-Reply-To: <200311131007.NAA23770@yakov.inr.ac.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1429 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 Content-Length: 1928 Lines: 44 On Thu, 13 Nov 2003 kuznet@ms2.inr.ac.ru wrote: > Do you really need this? > > Right now the kernel is able to to determine a valid source address > derived from some known destination address and nothing more. It is > just connect(). > > I do not understand rfc3484, actually. Does it involve some policies made > inside libc, which could contradict to policies used by kernel? If so, > it is definitely unimplementable without surgery in the kernel. I'm not sure what you refer by policies. The policies of "matching label" and "higher precedence" could include manually configured policies which might subsequently be different in kernel and in libc (at least). But, I think you what you're really asking is whether we need destination address selection at all, because we already have policy control in the kernel for source address. The short answer is "yes", the longer answer is below. The destination address selection as specified by RFC 3484 is pretty much necessary for the "proper" address selection. Just having source address selection is not enough, because if we get multiple inputs as destination addresses, there has to be some way of selecting the best of them (combined with a best source address), as a trivial example: DNS lookup gives you 2002::1 and 2001::1 addresses (6to4 and native). The node has 2002:f00::1 address configured, but no "native" address. Currently getaddrinfo picks the destination address in a round-robin fashion. However, the best (s,d) -pair is (2002:f00::1, 2002::1), and you currently get that only one half of the time. This is a very simplistic example, but there are actually real failure modes and problems if the destination address selection is missing. HTH -- 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 kaber@trash.net Thu Nov 13 06:47:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 06:47:41 -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 hADElQ25001372 for ; Thu, 13 Nov 2003 06:47:27 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AKIkt-0004Dd-00; Thu, 13 Nov 2003 15:47:31 +0100 Message-ID: <3FB39990.3000205@trash.net> Date: Thu, 13 Nov 2003 15:47:44 +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 tbf_reset Content-Type: multipart/mixed; boundary="------------070108000100030408000200" X-archive-position: 1431 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 Content-Length: 1552 Lines: 48 This is a multi-part message in MIME format. --------------070108000100030408000200 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This patch fixes TBF purging an unused queue in tbf_reset instead of resetting q.qlen. I haven't checked the history, but it looks like this place was forgotten when making TBF classful. Best regards, Patrick --------------070108000100030408000200 Content-Type: text/plain; name="02-tbf_reset.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="02-tbf_reset.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.1428 -> 1.1429 # net/sched/sch_tbf.c 1.11 -> 1.12 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/12 kaber@trash.net 1.1429 # Reset q.qlen in tbf_reset instead of purging an unused queue # -------------------------------------------- # diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c Thu Nov 13 14:57:27 2003 +++ b/net/sched/sch_tbf.c Thu Nov 13 14:57:27 2003 @@ -268,7 +268,7 @@ struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data; qdisc_reset(q->qdisc); - skb_queue_purge(&sch->q); + sch->q.qlen = 0; sch->stats.backlog = 0; PSCHED_GET_TIME(q->t_c); q->tokens = q->buffer; --------------070108000100030408000200-- From kaber@trash.net Thu Nov 13 06:46:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 06:47:09 -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 hADEks25001280 for ; Thu, 13 Nov 2003 06:46:55 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AKIkH-0004DV-00; Thu, 13 Nov 2003 15:46:53 +0100 Message-ID: <3FB3996A.6080008@trash.net> Date: Thu, 13 Nov 2003 15:47:06 +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]: Adjust qlen when grafting in multiple qdiscs Content-Type: multipart/mixed; boundary="------------020408050900080401010701" X-archive-position: 1430 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 Content-Length: 2668 Lines: 91 This is a multi-part message in MIME format. --------------020408050900080401010701 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Dave, multiple qdiscs fail to adjust sch->q.qlen after grafting when the old qdisc is non-empty. This permanently damages the counter. TBF additionally needs to adjust stats.backlog. Best regards, Patrick --------------020408050900080401010701 Content-Type: text/plain; name="01-graft-qlen.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01-graft-qlen.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.1427 -> 1.1428 # net/sched/sch_tbf.c 1.10 -> 1.11 # net/sched/sch_cbq.c 1.13 -> 1.14 # net/sched/sch_dsmark.c 1.10 -> 1.11 # net/sched/sch_prio.c 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/12 kaber@trash.net 1.1428 # Adjust qlen when grafting in multiple qdiscs # -------------------------------------------- # diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c Thu Nov 13 14:57:07 2003 +++ b/net/sched/sch_cbq.c Thu Nov 13 14:57:07 2003 @@ -1670,6 +1670,7 @@ sch_tree_lock(sch); *old = cl->q; cl->q = new; + sch->q.qlen -= (*old)->q.qlen; qdisc_reset(*old); sch_tree_unlock(sch); diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c --- a/net/sched/sch_dsmark.c Thu Nov 13 14:57:07 2003 +++ b/net/sched/sch_dsmark.c Thu Nov 13 14:57:07 2003 @@ -75,8 +75,10 @@ new = &noop_qdisc; sch_tree_lock(sch); *old = xchg(&p->q,new); - if (*old) + if (*old) { + sch->q.qlen -= (*old)->q.qlen; qdisc_reset(*old); + } sch_tree_unlock(sch); /* @@@ move up ? */ return 0; } diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c --- a/net/sched/sch_prio.c Thu Nov 13 14:57:07 2003 +++ b/net/sched/sch_prio.c Thu Nov 13 14:57:07 2003 @@ -266,6 +266,7 @@ sch_tree_lock(sch); *old = q->queues[band]; q->queues[band] = new; + sch->q.qlen -= (*old)->q.qlen; qdisc_reset(*old); sch_tree_unlock(sch); diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c Thu Nov 13 14:57:07 2003 +++ b/net/sched/sch_tbf.c Thu Nov 13 14:57:07 2003 @@ -455,6 +455,8 @@ sch_tree_lock(sch); *old = xchg(&q->qdisc, new); qdisc_reset(*old); + sch->q.qlen = 0; + sch->stats.backlog = 0; sch_tree_unlock(sch); return 0; --------------020408050900080401010701-- From kaber@trash.net Thu Nov 13 06:50:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 06:50:19 -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 hADEo325002065 for ; Thu, 13 Nov 2003 06:50:04 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AKInQ-0004E6-00; Thu, 13 Nov 2003 15:50:08 +0100 Message-ID: <3FB39A2D.5020000@trash.net> Date: Thu, 13 Nov 2003 15:50:21 +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 queue limits in multiple qdiscs Content-Type: multipart/mixed; boundary="------------000806030802060909090404" X-archive-position: 1432 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 Content-Length: 3625 Lines: 110 This is a multi-part message in MIME format. --------------000806030802060909090404 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This patch fixes multiple qdiscs exceeding their limits: pfifo/pfifo_fast: by one packet bfifo/red/gred: by one full-sized packet in bytes RED and GRED should never reach their limits so this part is more cosmetic than fix. Best regards, Patrick --------------000806030802060909090404 Content-Type: text/plain; name="03-queue-limits.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="03-queue-limits.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.1431 -> 1.1432 # net/sched/sch_generic.c 1.9 -> 1.10 # net/sched/sch_teql.c 1.8 -> 1.9 # net/sched/sch_fifo.c 1.6 -> 1.7 # net/sched/sch_gred.c 1.12 -> 1.13 # net/sched/sch_red.c 1.8 -> 1.9 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/12 kaber@trash.net 1.1432 # Fix queue limits in multiple qdiscs # -------------------------------------------- # diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c --- a/net/sched/sch_fifo.c Thu Nov 13 15:23:33 2003 +++ b/net/sched/sch_fifo.c Thu Nov 13 15:23:33 2003 @@ -47,7 +47,7 @@ { struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data; - if (sch->stats.backlog <= q->limit) { + if (sch->stats.backlog + skb->len <= q->limit) { __skb_queue_tail(&sch->q, skb); sch->stats.backlog += skb->len; sch->stats.bytes += skb->len; @@ -108,7 +108,7 @@ { struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data; - if (sch->q.qlen <= q->limit) { + if (sch->q.qlen < q->limit) { __skb_queue_tail(&sch->q, skb); sch->stats.bytes += skb->len; sch->stats.packets++; diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c Thu Nov 13 15:23:33 2003 +++ b/net/sched/sch_generic.c Thu Nov 13 15:23:33 2003 @@ -275,7 +275,7 @@ list = ((struct sk_buff_head*)qdisc->data) + prio2band[skb->priority&TC_PRIO_MAX]; - if (list->qlen <= qdisc->dev->tx_queue_len) { + if (list->qlen < qdisc->dev->tx_queue_len) { __skb_queue_tail(list, skb); qdisc->q.qlen++; qdisc->stats.bytes += skb->len; diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c --- a/net/sched/sch_gred.c Thu Nov 13 15:23:33 2003 +++ b/net/sched/sch_gred.c Thu Nov 13 15:23:33 2003 @@ -110,7 +110,7 @@ unsigned long qave=0; int i=0; - if (!t->initd && skb_queue_len(&sch->q) <= sch->dev->tx_queue_len) { + if (!t->initd && skb_queue_len(&sch->q) < sch->dev->tx_queue_len) { D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n"); goto do_enqueue; } @@ -175,7 +175,7 @@ if ((q->qave+qave) < q->qth_min) { q->qcount = -1; enqueue: - if (q->backlog <= q->limit) { + if (q->backlog + skb->len <= q->limit) { q->backlog += skb->len; do_enqueue: __skb_queue_tail(&sch->q, skb); diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c --- a/net/sched/sch_red.c Thu Nov 13 15:23:33 2003 +++ b/net/sched/sch_red.c Thu Nov 13 15:23:33 2003 @@ -257,7 +257,7 @@ if (q->qave < q->qth_min) { q->qcount = -1; enqueue: - if (sch->stats.backlog <= q->limit) { + if (sch->stats.backlog + skb->len <= q->limit) { __skb_queue_tail(&sch->q, skb); sch->stats.backlog += skb->len; sch->stats.bytes += skb->len; --------------000806030802060909090404-- From kaber@trash.net Thu Nov 13 07:00:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 07:00:53 -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 hADF0T25002526 for ; Thu, 13 Nov 2003 07:00:30 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AKIxZ-0004FG-00; Thu, 13 Nov 2003 16:00:37 +0100 Message-ID: <3FB39CA2.401@trash.net> Date: Thu, 13 Nov 2003 16:00:50 +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: Martin Devera CC: netdev@oss.sgi.com Subject: [PATCH]: Check for leaf-class when classifying by priority Content-Type: multipart/mixed; boundary="------------050003080006020806060808" X-archive-position: 1433 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 Content-Length: 1771 Lines: 54 This is a multi-part message in MIME format. --------------050003080006020806060808 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi devik, this patch makes htb_classify check if a class is a leaf when classifying by priority. It also adds a check from cbq to skip htb_find if the majors of skb->priority and sch->handle differ. Best regards, Patrick --------------050003080006020806060808 Content-Type: text/plain; name="htb-classify.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="htb-classify.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.1430 -> 1.1431 # net/sched/sch_htb.c 1.15 -> 1.16 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/12 kaber@trash.net 1.1431 # Check for leaf-class when classifying by priority, don't try if majors differ # -------------------------------------------- # diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c --- a/net/sched/sch_htb.c Thu Nov 13 15:52:28 2003 +++ b/net/sched/sch_htb.c Thu Nov 13 15:52:28 2003 @@ -303,8 +303,10 @@ rules in it */ if (skb->priority == sch->handle) return HTB_DIRECT; /* X:0 (direct flow) selected */ - if ((cl = htb_find(skb->priority,sch)) != NULL) - return cl; + if (TC_H_MAJ(skb->priority^sch->handle) == 0 && + (cl = htb_find(skb->priority,sch)) != NULL) + if (cl->level == 0) + return cl; tcf = q->filter_list; while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { --------------050003080006020806060808-- From cfriesen@nortelnetworks.com Thu Nov 13 09:49:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 09:49:38 -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 hADHnM25009506 for ; Thu, 13 Nov 2003 09:49:25 -0800 Received: from zcard307.ca.nortel.com (americasm01.nt.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id hADHmWm13265; Thu, 13 Nov 2003 12:48:32 -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 WTC1H311; Thu, 13 Nov 2003 12:48:32 -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 WLB8QS4L; Thu, 13 Nov 2003 12:48:32 -0500 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id C4C6A2E151; Thu, 13 Nov 2003 12:48:30 -0500 (EST) Message-ID: <3FB3C3EE.6040802@nortelnetworks.com> Date: Thu, 13 Nov 2003 12:48:30 -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: davem@redhat.com, jmorris@redhat.com, hadi@znyx.com, netdev@oss.sgi.com Subject: Re: Fw: issues with SO_PRIORITY and IP_TOS References: <200311131108.OAA24780@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1434 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 Content-Length: 713 Lines: 22 kuznet@ms2.inr.ac.ru wrote: > To set VLAN priority, you tune VLAN f.e. to use DSCP bits in classifier > to derive VLAN priority from those bits of DSCP, which you desire. DSCP>>5 > in your case. Excellent. How do I do this? I know of the egress mapping of socket priority to vlan priority. How do I map DSCP to vlan priority? I know how to do this by setting the socket priority with another setsockopt call, but is there a way of doing this directly? 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 shemminger@osdl.org Thu Nov 13 11:25:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 11:25: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 hADJPg25011952 for ; Thu, 13 Nov 2003 11:25:42 -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 hADJOHC07352; Thu, 13 Nov 2003 11:24:18 -0800 Date: Thu, 13 Nov 2003 11:24:40 -0800 From: Stephen Hemminger To: "Mike_Phillips@URSCorp.com" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] ibmtr -- convert to new probeing Message-Id: <20031113112440.2fe0e12c.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: 1435 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: 11161 Lines: 382 This patch applies against net-drivers-2.5-exp. The line number offsets assume the earlier patchset, but this change doesn't overlap all those ether changes. * convert ibmtr driver to using the new probe interface -- ibmtr_probe2 * keep old ibmtr_probe for use as init handle because ibmtr_cs uses it * cleanup error paths in ibmtr_probe1 and module init * make only used locally functions static * do request_region before doing i/o * irq and mem were not really settable as module parameters so removed diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Nov 13 11:22:59 2003 +++ b/drivers/net/Space.c Thu Nov 13 11:22:59 2003 @@ -336,12 +336,15 @@ #ifdef CONFIG_TR /* Token-ring device probe */ -extern int ibmtr_probe(struct net_device *); +extern struct net_device *ibmtr_probe2(int unit); extern struct net_device *sk_isa_probe(int unit); extern struct net_device *proteon_probe(int unit); extern struct net_device *smctr_probe(int unit); -static struct devprobe2 tr_probes2[] __initdata = { +static struct devprobe2 tr_probes[] __initdata = { +#ifdef CONFIG_IBMTR + {ibmtr_probe2, 0}, +#endif #ifdef CONFIG_SKISA {sk_isa_probe, 0}, #endif @@ -354,37 +357,13 @@ {NULL, 0}, }; -static __init int trif_probe(int unit) -{ - struct net_device *dev; - int err = -ENODEV; - - dev = alloc_trdev(0); - if (!dev) - return -ENOMEM; - - sprintf(dev->name, "tr%d", unit); - netdev_boot_setup_check(dev); - if ( -#ifdef CONFIG_IBMTR - ibmtr_probe(dev) == 0 || -#endif - 0 ) - err = register_netdev(dev); - - if (err) - free_netdev(dev); - return err; - -} - static void __init trif_probe2(int unit) { unsigned long base_addr = netdev_boot_base("tr", unit); if (base_addr == 1) return; - probe_list2(unit, tr_probes2, base_addr == 0); + probe_list2(unit, tr_probes, base_addr == 0); } #endif @@ -411,8 +390,7 @@ #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (!trif_probe(num)) - trif_probe2(num); + trif_probe2(num); #endif for (num = 0; num < 8; ++num) ethif_probe2(num); diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c --- a/drivers/net/tokenring/ibmtr.c Thu Nov 13 11:22:59 2003 +++ b/drivers/net/tokenring/ibmtr.c Thu Nov 13 11:22:59 2003 @@ -193,7 +193,7 @@ static int trdev_init(struct net_device *dev); static int tok_open(struct net_device *dev); static int tok_init_card(struct net_device *dev); -void tok_open_adapter(unsigned long dev_addr); +static void tok_open_adapter(unsigned long dev_addr); static void open_sap(unsigned char type, struct net_device *dev); static void tok_set_multicast_list(struct net_device *dev); static int tok_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -202,11 +202,11 @@ static void initial_tok_int(struct net_device *dev); static void tr_tx(struct net_device *dev); static void tr_rx(struct net_device *dev); -void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); +static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); static void tok_rerun(unsigned long dev_addr); -void ibmtr_readlog(struct net_device *dev); +static void ibmtr_readlog(struct net_device *dev); static struct net_device_stats *tok_get_stats(struct net_device *dev); -int ibmtr_change_mtu(struct net_device *dev, int mtu); +static int ibmtr_change_mtu(struct net_device *dev, int mtu); static void find_turbo_adapters(int *iolist); static int ibmtr_portlist[IBMTR_MAX_ADAPTERS+1] __devinitdata = { @@ -332,19 +332,45 @@ if (base_addr && base_addr <= 0x1ff) /* Don't probe at all. */ return -ENXIO; - if (base_addr > 0x1ff) { /* Check a single specified location. */ - if (!ibmtr_probe1(dev, base_addr)) return 0; - return -ENODEV; - } + if (base_addr > 0x1ff) /* Check a single specified location. */ + return ibmtr_probe1(dev, base_addr); find_turbo_adapters(ibmtr_portlist); for (i = 0; ibmtr_portlist[i]; i++) { - int ioaddr = ibmtr_portlist[i]; - - if (!ibmtr_probe1(dev, ioaddr)) return 0; + if (!ibmtr_probe1(dev, ibmtr_portlist[i])) + return 0; } return -ENODEV; } +#ifndef MODULE +/* + * Called from Space.c to probe for token ring devices at boot + * time. + */ +struct net_device * __devinit ibmtr_probe2(int unit) +{ + struct net_device *dev = alloc_trdev(sizeof(struct tok_info)); + int err = 0; + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "tr%d", unit); + netdev_boot_setup_check(dev); + } + + dev->init = &ibmtr_probe; + + err = register_netdev(dev); + if (!err) + return dev; + + free_netdev(dev); + return ERR_PTR(err); +} +#endif + /*****************************************************************************/ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) @@ -360,6 +386,15 @@ unsigned long timeout; static int version_printed; #endif + int err = -ENODEV; + + /*?? Now, allocate some of the PIO PORTs for this driver.. */ + /* record PIOaddr range as busy */ + if (!request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr")) { + DPRINTK("Could not grab PIO range. Halting driver.\n"); + err = -EBUSY; + goto out1; + } /* Query the adapter PIO base port which will return * indication of where MMIO was placed. We also have a @@ -374,7 +409,7 @@ DPRINTK("ibmtr_probe1(): unhappy that inb(0x%X) == 0x%X, " "Hardware Problem?\n",PIOaddr,segment); #endif - return -ENODEV; + goto out2; } /* * Compute the linear base address of the MMIO area @@ -383,7 +418,7 @@ t_mmio = ioremap(((__u32) (segment & 0xfc) << 11) + 0x80000,2048); if (!t_mmio) { DPRINTK("Cannot remap mmiobase memory area") ; - return -ENODEV ; + goto out2; } intr = segment & 0x03; /* low bits is coded interrupt # */ if (ibmtr_debug_trace & TRC_INIT) @@ -427,12 +462,9 @@ if (cardpresent == TR_ISA && (readb(AIPFID + t_mmio) == 0x0e)) cardpresent = TR_ISAPNP; if (cardpresent == NOTOK) { /* "channel_id" did not match, report */ - if (!(ibmtr_debug_trace & TRC_INIT)) { -#ifndef PCMCIA - iounmap(t_mmio); -#endif - return -ENODEV; - } + if (!(ibmtr_debug_trace & TRC_INIT)) + goto out3; + DPRINTK( "Channel ID string not found for PIOaddr: %4hx\n", PIOaddr); DPRINTK("Expected for ISA: "); @@ -497,9 +529,7 @@ while (!readb(ti->mmio + ACA_OFFSET + ACA_RW + RRR_EVEN)){ if (!time_after(jiffies, timeout)) continue; DPRINTK( "Hardware timeout during initialization.\n"); - iounmap(t_mmio); - kfree(ti); - return -ENODEV; + goto out3; } ti->sram_virt = ((__u32)readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_EVEN)<<12); @@ -611,10 +641,7 @@ default: DPRINTK("Unknown shared ram paging info %01X\n", ti->shared_ram_paging); - iounmap(t_mmio); - kfree(ti); - return -ENODEV; - break; + goto out3; } /*end switch shared_ram_paging */ if (ibmtr_debug_trace & TRC_INIT) @@ -641,9 +668,7 @@ DPRINTK("Shared RAM for this adapter (%05x) exceeds " "driver limit (%05x), adapter not started.\n", chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); - iounmap(t_mmio); - kfree(ti); - return -ENODEV; + goto out3; } else { /* seems cool, record what we have figured out */ ti->sram_base = new_base >> 12; ibmtr_mem_base = chk_base; @@ -656,18 +681,7 @@ if (request_irq(dev->irq = irq, &tok_interrupt, 0, "ibmtr", dev) != 0) { DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", irq); - iounmap(t_mmio); - kfree(ti); - return -ENODEV; - } - /*?? Now, allocate some of the PIO PORTs for this driver.. */ - /* record PIOaddr range as busy */ - if (!request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr")) { - DPRINTK("Could not grab PIO range. Halting driver.\n"); - free_irq(dev->irq, dev); - iounmap(t_mmio); - kfree(ti); - return -EBUSY; + goto out3; } if (!version_printed++) { @@ -767,6 +781,15 @@ dev->mem_end = dev->mem_start + (ti->mapped_ram_size << 9) - 1; trdev_init(dev); return 0; /* Return 0 to indicate we have found a Token Ring card. */ + + out3: +#ifndef PCMCIA + iounmap(t_mmio); +#endif + out2: + release_region(PIOaddr, IBMTR_IO_EXTENT); + out1: + return err; } /*ibmtr_probe1() */ /*****************************************************************************/ @@ -900,7 +923,7 @@ #define DLC_MAX_SAP_OFST 32 #define DLC_MAX_STA_OFST 33 -void tok_open_adapter(unsigned long dev_addr) +static void tok_open_adapter(unsigned long dev_addr) { struct net_device *dev = (struct net_device *) dev_addr; struct tok_info *ti; @@ -1825,7 +1848,7 @@ /*****************************************************************************/ -void ibmtr_reset_timer(struct timer_list *tmr, struct net_device *dev) +static void ibmtr_reset_timer(struct timer_list *tmr, struct net_device *dev) { tmr->expires = jiffies + TR_RETRY_INTERVAL; tmr->data = (unsigned long) dev; @@ -1836,7 +1859,7 @@ /*****************************************************************************/ -void tok_rerun(unsigned long dev_addr){ +static void tok_rerun(unsigned long dev_addr){ struct net_device *dev = (struct net_device *)dev_addr; struct tok_info *ti = (struct tok_info *) dev->priv; @@ -1857,7 +1880,7 @@ /*****************************************************************************/ -void ibmtr_readlog(struct net_device *dev) +static void ibmtr_readlog(struct net_device *dev) { struct tok_info *ti; @@ -1890,7 +1913,7 @@ /*****************************************************************************/ -int ibmtr_change_mtu(struct net_device *dev, int mtu) +static int ibmtr_change_mtu(struct net_device *dev, int mtu) { struct tok_info *ti = (struct tok_info *) dev->priv; @@ -1908,40 +1931,38 @@ /* 3COM 3C619C supports 8 interrupts, 32 I/O ports */ static struct net_device *dev_ibmtr[IBMTR_MAX_ADAPTERS]; static int io[IBMTR_MAX_ADAPTERS] = { 0xa20, 0xa24 }; -static int irq[IBMTR_MAX_ADAPTERS]; -static int mem[IBMTR_MAX_ADAPTERS]; MODULE_LICENSE("GPL"); MODULE_PARM(io, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(IBMTR_MAX_ADAPTERS) "i"); + static int __init ibmtr_init(void) { int i; int count=0; + int err = -EIO; find_turbo_adapters(io); for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { - irq[i] = 0; - mem[i] = 0; - dev_ibmtr[i] = alloc_trdev(sizeof(struct tok_info)); - if (dev_ibmtr[i] == NULL) { - if (i == 0) - return -ENOMEM; + struct net_device *dev = alloc_trdev(sizeof(struct tok_info)); + + if (!dev) { + err = -ENOMEM; break; } - dev_ibmtr[i]->base_addr = io[i]; - dev_ibmtr[i]->irq = irq[i]; - dev_ibmtr[i]->mem_start = mem[i]; - dev_ibmtr[i]->init = &ibmtr_probe; - if (register_netdev(dev_ibmtr[i]) != 0) { - kfree(dev_ibmtr[i]); - dev_ibmtr[i] = NULL; + + SET_MODULE_OWNER(dev); + dev->init = &ibmtr_probe; + dev->base_addr = io[i]; + + err = register_netdev(dev); + if (err) { + free_netdev(dev); continue; } + dev_ibmtr[i] = dev; count++; } if (count) return 0; From shemminger@osdl.org Thu Nov 13 11:33:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 11:33:19 -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 hADJX125014489 for ; Thu, 13 Nov 2003 11:33:01 -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 hADJWGC08831; Thu, 13 Nov 2003 11:32:16 -0800 Date: Thu, 13 Nov 2003 11:32:39 -0800 From: Stephen Hemminger To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (19/42) 3c515-T10 Message-Id: <20031113113239.0e781305.shemminger@osdl.org> In-Reply-To: <200311130043.hAD0hSw30717@mail.osdl.org> References: <200311130043.hAD0hSw30717@mail.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: 1436 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: 796 Lines: 22 Also need this patch to the patch to allow 3c515 to be built as non-module. Al added list of list which is needed by module, but non-module might as well maintain it as well. diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c --- a/drivers/net/3c515.c Thu Nov 13 10:46:27 2003 +++ b/drivers/net/3c515.c Thu Nov 13 10:46:27 2003 @@ -407,11 +407,12 @@ /* Note: this is the only limit on the number of cards supported!! */ static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1, }; -#ifdef MODULE -static int debug = -1; /* A list of all installed Vortex devices, for removing the driver module. */ /* we will need locking (and refcounting) if we ever use it for more */ static LIST_HEAD(root_corkscrew_dev); + +#ifdef MODULE +static int debug = -1; int init_module(void) { From jgarzik@pobox.com Thu Nov 13 11:36:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 11:36:43 -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 hADJaT25014843 for ; Thu, 13 Nov 2003 11:36:30 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:43199 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AKNGV-0003TL-Cj; Thu, 13 Nov 2003 19:36:27 +0000 Message-ID: <3FB3DD2A.50604@pobox.com> Date: Thu, 13 Nov 2003 14:36:10 -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] (19/42) 3c515-T10 References: <200311130043.hAD0hSw30717@mail.osdl.org> <20031113113239.0e781305.shemminger@osdl.org> In-Reply-To: <20031113113239.0e781305.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1437 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 Content-Length: 40 Lines: 3 already checked in a different fix... From rask@sygehus.dk Thu Nov 13 13:50:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 13:51:18 -0800 (PST) Received: from 0x50a41c66.albnxx15.adsl-dhcp.tele.dk (0x50a41c66.albnxx15.adsl-dhcp.tele.dk [80.164.28.102]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hADLoq25019451 for ; Thu, 13 Nov 2003 13:50:55 -0800 Received: by 0x50a1449e.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 0A57BABA; Thu, 13 Nov 2003 22:48:31 +0100 (CET) Date: Thu, 13 Nov 2003 22:48:31 +0100 From: Rask Ingemann Lambertsen To: francois donzet Cc: netdev@oss.sgi.com Subject: hw checksum acceleration (Was: problem in driver network code) Message-ID: <20031113224831.A1052@sygehus.dk> References: <20031107181508.A1102@sygehus.dk> <20031110081417.55732.qmail@web25201.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: <20031110081417.55732.qmail@web25201.mail.ukl.yahoo.com>; from fdonzet@yahoo.fr on Mon, Nov 10, 2003 at 09:14:17AM +0100 X-archive-position: 1438 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 Content-Length: 912 Lines: 23 On Mon, Nov 10, 2003 at 09:14:17AM +0100, francois donzet wrote: > > 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). The documentation says that skb->csum covers the whole packet as seen by netif_rx(). eth_type_trans() pulls off the 14 byte header before netif_rx() is called. But if the frame is really 802.1q or 802.2, then the extra bytes of the header will be pulled off but skb->csum will still cover those bytes. Unless, of course, the device knows about 802.1q and 802.2, but that wasn't supposed to be necessary, was it? -- Regards, Rask Ingemann Lambertsen From drepper@redhat.com Thu Nov 13 15:14:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 15:14:38 -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 hADNEL25023273 for ; Thu, 13 Nov 2003 15:14: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 hADNCb2C022525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Nov 2003 15:12:37 -0800 Message-ID: <3FB40FE5.5040709@redhat.com> Date: Thu, 13 Nov 2003 15:12:37 -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: kuznet@ms2.inr.ac.ru CC: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: RFC 3484 support References: <200311131007.NAA23770@yakov.inr.ac.ru> In-Reply-To: <200311131007.NAA23770@yakov.inr.ac.ru> 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 hADNCb2C022525 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hADNEL25023273 X-archive-position: 1439 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 Content-Length: 1151 Lines: 32 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 kuznet@ms2.inr.ac.ru wrote: >>1. use the existing kernel functionality and provide an interface to it >> which userlevel can use > > > This interface is connect() for example. Essentially, connect() on > datagram socket with subsequent getsockname() makes exactly this. Wouldn't this require to set up a socket and connect it to each target address? The point of the whole source and destination address selection is it to avoid making connections with addresses/via interfaces which might have problems. getaddrinfo returns a list of addresses which a client program then tries in the order they are provided. The address which has the highest rate of success and the highest quality for the connection should be tried first. And all this is subject to all the customization and configuration going in the kernel. - -- âž§ Ulrich Drepper âž§ Red Hat, Inc. âž§ 444 Castro St âž§ Mountain View, CA â– -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/tA/l2ijCOnn/RHQRAiYcAKCjgzJXwd/zV7KaWBUnaIqNEUdHrgCeKq5g pQm7ViT1UChv0DtqKaxkdiY= =/Jay -----END PGP SIGNATURE----- From drepper@redhat.com Thu Nov 13 15:19:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 15:19:26 -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 hADNJ825023633 for ; Thu, 13 Nov 2003 15:19:09 -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 hADNHT2C022569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Nov 2003 15:17:30 -0800 Message-ID: <3FB41109.60902@redhat.com> Date: Thu, 13 Nov 2003 15:17:29 -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: Pekka Savola CC: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: RFC 3484 support References: In-Reply-To: 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 hADNHT2C022569 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hADNJ825023633 X-archive-position: 1440 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 Content-Length: 2362 Lines: 62 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pekka Savola wrote: > Currently getaddrinfo picks the destination address in a round-robin > fashion. That's what could be done but isn't since I see little value. We currently return IPv6 address, if there are any and if they are wanted, first, then the IPv4 addresses. The order in which multiple IPv6 and/or IPv4 addresses are returned depends on the order the server returns it and eventually on artificial round-robin selection. But the rest of your argumentation I fully support. I'm no expert at this, but all these possible IPv6 address uses can lead to big problems if the wrong address is chosen at any one time. Support for destination address selection is needed. And I really would like to avoid to implement something which will inevitably fall short of the real solution at userlevel. I could image something like this: a syscall with int destination_addr_sort (size_t n, struct addrinfo addr[], size_t reorder[]) n and addr are input parameters. reorder is an output parameter, a pointer to an array describing the transformation. I.e., it is not necessary for the kernel to shuffle the data around. It's not needed for getaddrinfo anyway. It means less data has to be transported. An alternative would be to pass something other than struct addrinfo elements down. That struct contains data the kernel doesn't need. I'd be fine with that, too. I'm open to any reasonable solution. If we cannot come to an agreement I'll have to try a user-level solution. But this will be slow[¹], and suck big time. [¹] BTW, it will be slow, among other things, because there is no way to cache and netlink-provided data at userlevel. For every name lookup we have to re-read the data. This already happens today to implement AI_ADDRCONFIG. I've mentioned to DaveM sometime back that I would love to get a netlink command which allows me to query a timestamp for the last interface configuration change. Then I could perform this one quick test and read the other data only if the timestamp changed. - -- âž§ Ulrich Drepper âž§ Red Hat, Inc. âž§ 444 Castro St âž§ Mountain View, CA â– -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/tBEJ2ijCOnn/RHQRAsbMAKCcQzX+GRBqA0O/nZzLfqw1Qko5ZACfe+P5 ODlgrjK3BcPqzjEWrSc6hIY= =8/PO -----END PGP SIGNATURE----- From pekkas@netcore.fi Thu Nov 13 15:29:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Nov 2003 15:29:39 -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 hADNTO25024094 for ; Thu, 13 Nov 2003 15:29:25 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id hADNT9h15618; Fri, 14 Nov 2003 01:29:09 +0200 Date: Fri, 14 Nov 2003 01:29:09 +0200 (EET) From: Pekka Savola To: Ulrich Drepper cc: kuznet@ms2.inr.ac.ru, , Subject: Re: RFC 3484 support In-Reply-To: <3FB41109.60902@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1441 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 Content-Length: 786 Lines: 18 On Thu, 13 Nov 2003, Ulrich Drepper wrote: > > Currently getaddrinfo picks the destination address in a round-robin > > fashion. > > That's what could be done but isn't since I see little value. We > currently return IPv6 address, if there are any and if they are wanted, > first, then the IPv4 addresses. The order in which multiple IPv6 and/or > IPv4 addresses are returned depends on the order the server returns it > and eventually on artificial round-robin selection. Oops, sorry. That's what I meant. The current behaviour is good. Putting v6 first is regular practice and good. -- 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 rask@sygehus.dk Fri Nov 14 04:58:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 04:59:05 -0800 (PST) Received: from 0x50a41cba.albnxx15.adsl-dhcp.tele.dk (0x50a41cba.albnxx15.adsl-dhcp.tele.dk [80.164.28.186]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAECwX25021082 for ; Fri, 14 Nov 2003 04:58:49 -0800 Received: by 0x50a41c66.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id A8807417F; Fri, 14 Nov 2003 13:55:59 +0100 (CET) Date: Fri, 14 Nov 2003 13:55:59 +0100 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: [PATCH] (17/42) wd Message-ID: <20031114135559.A1381@sygehus.dk> References: <200311130043.hAD0h8G30660@mail.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: <200311130043.hAD0h8G30660@mail.osdl.org>; from shemminger@osdl.org on Wed, Nov 12, 2003 at 04:43:08PM -0800 X-archive-position: 1442 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 Content-Length: 414 Lines: 13 On Wed, Nov 12, 2003 at 04:43:08PM -0800, Stephen Hemminger wrote: > 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 Btw, shouldn't this (and other shared memory board drivers) call request_mem_region() to reserve the shared memory area? -- Regards, Rask Ingemann Lambertsen From garzik@gtf.org Fri Nov 14 06:04:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 06:04:35 -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 hAEE4J25032085 for ; Fri, 14 Nov 2003 06:04:19 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 3A8526611; Fri, 14 Nov 2003 09:04:13 -0500 (EST) Date: Fri, 14 Nov 2003 09:04:13 -0500 From: Jeff Garzik To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [BK PATCHES] 2.5.x experimental net driver patches Message-ID: <20031114140413.GA15406@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: 1443 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 Content-Length: 26542 Lines: 798 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-bk18-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/3c503.c | 117 +++-- drivers/net/3c505.c | 128 ++--- drivers/net/3c507.c | 120 ++--- drivers/net/3c515.c | 328 ++++++-------- drivers/net/3c523.c | 108 ++-- drivers/net/3c527.c | 682 +++++++++++++---------------- drivers/net/3c59x.c | 17 drivers/net/8139too.c | 51 +- drivers/net/82596.c | 83 ++- drivers/net/Kconfig | 7 drivers/net/Makefile | 2 drivers/net/Space.c | 583 ++++++++++++------------- drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 77 ++- drivers/net/at1700.c | 166 +++---- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 65 +- drivers/net/atarilance.c | 58 +- drivers/net/bagetlance.c | 77 +-- drivers/net/cs89x0.c | 132 +++-- drivers/net/de620.c | 63 +- drivers/net/defxx.c | 2 drivers/net/dummy.c | 2 drivers/net/e2100.c | 88 ++- drivers/net/eepro.c | 256 +++++------ drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++- drivers/net/eth16i.c | 119 ++--- drivers/net/ewrk3.c | 684 ++++++++++++----------------- drivers/net/fmv18x.c | 111 ++-- drivers/net/hp-plus.c | 84 ++- drivers/net/hp.c | 84 ++- drivers/net/hp100.c | 743 ++++++++++++++++---------------- drivers/net/hplance.c | 85 +-- drivers/net/jazzsonic.c | 88 ++- drivers/net/lance.c | 129 +++-- drivers/net/lne390.c | 88 ++- drivers/net/mac8390.c | 97 ++-- drivers/net/mac89x0.c | 77 +-- drivers/net/macmace.c | 28 - drivers/net/macsonic.c | 102 +--- drivers/net/mvme147.c | 59 +- drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++- drivers/net/ne2.c | 82 ++- drivers/net/ne2k_cbus.c | 107 +++- drivers/net/ne2k_cbus.h | 2 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/seeq8005.c | 97 ++-- drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++----- drivers/net/sk_mca.c | 119 ++--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++-- drivers/net/smc-ultra32.c | 85 ++- drivers/net/smc9194.c | 110 ++-- drivers/net/sun3_82586.c | 72 +-- drivers/net/sun3lance.c | 79 +-- 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/wd.c | 89 ++- 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 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 +++++++++++++++++++++++++++ net/wanrouter/wanmain.c | 2 95 files changed, 6208 insertions(+), 4691 deletions(-) through these ChangeSets: (03/11/12 1.1479) [netdrvr 3c515] fix non-modular build (03/11/12 1.1478) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1477) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1476) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1475) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1474) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1473) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1472) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1471) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1470) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1469) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1468) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1467) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1466) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1465) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1464) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1463) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1462) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1461) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1460) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1459) [PATCH] (23/42) 3c523 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 (03/11/12 1.1458) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1457) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1456) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1455) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1454) [PATCH] (18/42) ultra 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 (03/11/12 1.1453) [PATCH] (17/42) wd 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 (03/11/12 1.1452) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1451) [PATCH] (15/42) hp 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 (03/11/12 1.1450) [PATCH] (14/42) hpplus 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 (03/11/12 1.1449) [PATCH] (13/42) e2100 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 (03/11/12 1.1448) [PATCH] (12/42) ne 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 (03/11/12 1.1447) [PATCH] (11/42) lance 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? (03/11/12 1.1446) [PATCH] (10/42) smc 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 (03/11/12 1.1445) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1444) [PATCH] (8/42) at1500 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). (03/11/12 1.1443) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1442) [PATCH] (6/42) at1700 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 (03/11/12 1.1441) [PATCH] (5/42) fmv18 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... (03/11/12 1.1440) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1439) [PATCH] (3/42) eexpress 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 (03/11/12 1.1438) [PATCH] (2/42) eepro 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 (03/11/12 1.1437) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.1.5) [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.1428.1.4) [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.1428.1.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.1.2) [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 Jackfritt@boh.de Fri Nov 14 11:49:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 11:50:11 -0800 (PST) Received: from smtp.successnet.de (root@bohsmtp.successnet.de [62.8.248.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAEJnt25012092 for ; Fri, 14 Nov 2003 11:49:57 -0800 Received: from boh.de (p5085181D.dip.t-dialin.net [80.133.24.29]) (authenticated bits=0) by smtp.successnet.de (8.12.9-20030918/8.12.7) with ESMTP id hAEKQDPI023978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 Nov 2003 21:26:15 +0100 Message-ID: <3FB53375.4050705@boh.de> Date: Fri, 14 Nov 2003 20:56:37 +0100 From: Joerg Esser User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030925 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: forcedeth 0.15: 08 Nov 2003 for kernel 2.4 just ping and DHCP traffic works on ASUS A7N8X-VM Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-MIME-Autoconverted: from 8bit to quoted-printable by smtp.successnet.de id hAEKQDPI023978 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAEJnt25012092 X-archive-position: 1445 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Jackfritt@boh.de Precedence: bulk X-list: netdev Content-Length: 4835 Lines: 111 Hi, I´ve tried the above version on my ASUS A7N8X-VM Board because with the nvnet driver I just could ping other Computers and the other just could refresh their IP over DHCP(I´ve installed it on the Computer with the ASUS Board). Everything else like Webbrowsing ,FTP, etc didn´t work. Now I tried your driver and I get the same results but with a lot more of debug output. What am I doing wrong ? Can you help ? Maybe I can help you with some information ? How do I catch the screen output from the driver maybe this can help you too ? Looks like network traffic from and to the NIC. Thx for this nice work. Motherboard: ASUS A7N8X-VM with BIOS Version 1009 lspci output: 00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (rev a2) 00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev a2) 00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev a2) 00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev a2) 00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev a2) 00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev a2) 00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a4) 00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2) 00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1) 00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1) 00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3) 00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2) 00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev a2) 01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX - nForce GPU] (rev a3) 02:06.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01) 02:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) 02:08.0 Multimedia controller: Philips Semiconductors: Unknown device 5402 (rev 82) libc: /lib/libc.so.6 GNU C Library stable release version 2.3.2, by Roland McGrath et al. Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 3.3.1. Compiled on a Linux 2.4.22 system on 2003-10-06. Available extensions: GNU libio by Per Bothner crypt add-on version 2.1 by Michael Glad and others linuxthreads-0.10 by Xavier Leroy BIND-8.2.3-T5B libthread_db work sponsored by Alpha Processor Inc NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk Report bugs using the `glibcbug' script to . driver insmod output: Nov 14 19:43:43 chaplin kernel: forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.15. Nov 14 19:43:43 chaplin kernel: PCI: Setting latency timer of device 00:04.0 to 64 Nov 14 19:43:43 chaplin kernel: forcedeth: resource 0 start fe800000 len 4096 fl ags 0x00000200. Nov 14 19:43:43 chaplin kernel: eth1: forcedeth.c: subsystem: 01043:80a7 Nov 14 19:43:43 chaplin kernel: eth1: MAC Address 01:23:45:67:89:ab Nov 14 19:44:10 chaplin kernel: forcedeth: open Nov 14 19:44:10 chaplin kernel: eth1: txrx_reset Nov 14 19:44:10 chaplin kernel: eth1: alloc_rx: Packet 0 marked as Available ......... Nov 14 19:44:10 chaplin kernel: eth1: alloc_rx: Packet 127 marked as Available Nov 14 19:44:10 chaplin kernel: eth1: mii_rw read from reg 2 at PHY 1: 0x0. Nov 14 19:44:10 chaplin kernel: eth1: mii_rw read from reg 3 at PHY 1: 0x8201. Nov 14 19:44:10 chaplin kernel: eth1: open: Found PHY 0000:8201 at address 1. Nov 14 19:44:10 chaplin kernel: eth1: mii_rw read from reg 4 at PHY 1: 0x1e1. Nov 14 19:44:10 chaplin kernel: eth1: mii_rw read from reg 5 at PHY 1: 0x0. Nov 14 19:44:10 chaplin kernel: eth1: update_linkspeed: PHY advertises 0x01e1, l pa 0x0000. Nov 14 19:44:10 chaplin kernel: eth1: bad ability 0000 - falling back to 10HD. Nov 14 19:44:10 chaplin kernel: eth1: start_rx Nov 14 19:44:10 chaplin kernel: eth1: stop_rx Nov 14 19:44:10 chaplin kernel: eth1: start_rx Nov 14 19:44:10 chaplin kernel: eth1: start_tx Nov 14 19:44:10 chaplin kernel: eth1: mii_rw read from reg 1 at PHY 1: 0x0. Nov 14 19:44:10 chaplin kernel: eth1: no link during initialization. Nov 14 19:44:10 chaplin kernel: eth1: nic_irq Nov 14 19:44:10 chaplin kernel: eth1: irq: 00000020 Nov 14 19:44:10 chaplin kernel: eth1: nic_irq completed Nov 14 19:44:10 chaplin kernel: eth1: nic_irq Nov 14 19:44:10 chaplin kernel: eth1: irq: 00000020 ......... From Holger.Kiehl@dwd.de Fri Nov 14 11:49:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 11:49:39 -0800 (PST) Received: from dwdmx2.dwd.de (dwdmx2.dwd.de [141.38.3.197]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAEJnG25012049 for ; Fri, 14 Nov 2003 11:49:17 -0800 Received: (qmail 2229925 invoked from network); 14 Nov 2003 18:40:58 -0000 Received: from mhofsv1.dwd.de (141.38.32.42) by dwdmx2.dwd.de with SMTP; 14 Nov 2003 18:40:58 -0000 Received: from praktifix.dwd.de by mhofsv1.dwd.de with ESMTP for netdev@oss.sgi.com; Fri, 14 Nov 2003 19:40:58 +0100 Date: Fri, 14 Nov 2003 18:40:58 +0000 (GMT) From: Holger Kiehl X-X-Sender: kiehl@praktifix.dwd.de To: netdev@oss.sgi.com Subject: Problems with ipv4 multicast implementation in 2.4? (fwd) Message-Id: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-archive-position: 1444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Holger.Kiehl@dwd.de Precedence: bulk X-list: netdev Content-Length: 7366 Lines: 128 Sorry for cross posting this message, but it has been pointed out that linux-kernel is the wrong list for this question. Hello We have about 25 systems that receive data via a pci DVB card from satellite. The data is received through multiple muticast streams by some closed source software. On all systems we notice that the free memory decreases until in most cases the system are no longer reachable via network. They then constantly print out: dst cache overflow. But I also have noticed that some systems lock up hard, I assume this is because we just increase the ip_dst_cache in /proc/sys/net/ipv4/route/max_size to some very large value. I also know that the German Telekom and Eumetsat have the same problems and always have to reboot their systems. I also have reports from Austria and expect many more systems in Europe are effected. To get more information I have setup 3 systems with different kernels and hardware and noticed that over the time ip_dst_cache and skbuff_head_cache in /proc/slabinfo always increase. They never go down. Also one or more of the of the size-x values always increase depending on the kernel and DVB card being used. Here some more slabinfo details and hardware being used: System1 : PIII 450MHz, 256MB ram, Kernel 2.4.23-pre9, pent@value DVB card System2 : PII 350MHz, 384MB ram, Kernel 2.4.21, pent@value DVB card System3 : P4 2.4GHz with HT enabled, 1 GB ram (high mem enabled), Kernel 2.4.23-rc1 and libata patch, Nova-S DVB card Now the slabinfo data every 24 hours: System1: ip_dst_cache 647 672 160 27 28 1 ip_dst_cache 7444 7464 160 311 311 1 ip_dst_cache 14339 14352 160 598 598 1 ip_dst_cache 21106 21120 160 880 880 1 ip_dst_cache 28101 28104 160 1171 1171 1 skbuff_head_cache 796 1008 160 41 42 1 skbuff_head_cache 7588 7824 160 326 326 1 skbuff_head_cache 14482 14688 160 612 612 1 skbuff_head_cache 21258 21480 160 895 895 1 skbuff_head_cache 28255 28416 160 1184 1184 1 size-2048 685 968 2048 343 484 1 size-2048 7483 7676 2048 3742 3838 1 size-2048 14376 14398 2048 7188 7199 1 size-2048 21146 21216 2048 10573 10608 1 size-2048 28142 28292 2048 14071 14146 1 System2: ip_dst_cache 9 48 160 1 2 1 ip_dst_cache 7437 7464 160 311 311 1 ip_dst_cache 15161 15168 160 632 632 1 ip_dst_cache 18831 18840 160 785 785 1 skbuff_head_cache 14 24 160 1 1 1 skbuff_head_cache 11482 12168 160 500 507 1 skbuff_head_cache 23312 23904 160 996 996 1 skbuff_head_cache 28900 29640 160 1235 1235 1 size-128 611 660 128 21 22 1 size-128 11987 12210 128 402 407 1 size-128 23800 23970 128 798 799 1 size-128 29445 29670 128 983 989 1 Slabinfo for every 12 hours and CONFIG_DEBUG_SLAB set: System3: ip_dst_cache 576 576 160 24 24 1 : 576 576 24 0 0 : 252 126 : 1946 48 1426 0 ip_dst_cache 17760 17760 160 740 740 1 : 17760 17760 740 0 0 : 252 126 : 46553 1480 29557 0 ip_dst_cache 35376 35376 160 1474 1474 1 : 35376 36403 1474 0 0 : 252 126 : 94140 3014 60309 0 ip_dst_cache 51624 51624 160 2151 2151 1 : 51624 53444 2151 0 0 : 252 126 : 138864 4431 89547 0 skbuff_head_cache 1311 1311 168 57 57 1 : 1311 79557 57 0 0 : 252 126 : 82108 735 81114 621 skbuff_head_cache 18492 18492 168 804 804 1 : 18492 3300792 804 0 0 : 252 126 : 3320868 27658 3303434 26050 skbuff_head_cache 36133 36133 168 1571 1571 1 : 36133 6652585 1583 12 0 : 252 126 : 6684139 55715 6649977 52420 skbuff_head_cache 52371 52371 168 2277 2277 1 : 52371 9913620 2294 17 0 : 252 126 : 9957116 82923 9907545 78097 size-8192 540 540 8192 540 540 2 : 540 3196 540 0 0 : 0 0 : 0 0 0 0 size-8192 17736 17738 8192 17736 17738 2 : 17738 23194 17738 0 0 : 0 0 : 0 0 0 0 size-8192 35367 35367 8192 35367 35367 2 : 35367 43715 35374 7 0 : 0 0 : 0 0 0 0 size-8192 51596 51598 8192 51596 51598 2 : 51598 62824 51611 13 0 : 0 0 : 0 0 0 0 size-2048 452 512 2048 240 256 1 : 512 75002 256 0 0 : 60 30 : 140293 2995 140145 2485 size-2048 454 514 2048 238 257 1 : 514 3029044 257 0 0 : 60 30 : 5130850 101465 5130703 100953 size-2048 456 486 2048 241 243 1 : 530 6113873 593 350 0 : 60 30 : 10457205 204975 10457530 203655 size-2048 454 484 2048 239 242 1 : 542 9104228 1042 800 0 : 60 30 : 15398297 305608 15399447 303014 size-128 2016 2268 136 78 81 1 : 2268 9125 81 0 0 : 252 126 : 23644 195 22128 56 size-128 19096 19096 136 682 682 1 : 19096 26457 682 0 0 : 252 126 : 131136 1401 113018 58 size-128 36708 36708 136 1311 1311 1 : 36708 59707 1317 6 0 : 252 126 : 255889 2833 220918 144 size-128 52920 52920 136 1890 1890 1 : 52920 81855 1911 21 0 : 252 126 : 370264 4135 319786 153 size-64 7844 7844 72 148 148 1 : 7844 7931 148 0 0 : 252 126 : 15660 253 9102 0 size-64 18497 18497 72 349 349 1 : 18497 18584 349 0 0 : 252 126 : 110763 655 93784 0 size-64 24963 24963 72 471 471 1 : 24963 32458 471 0 0 : 252 126 : 209402 1008 186275 0 size-64 34503 34503 72 651 651 1 : 34503 48900 651 0 0 : 252 126 : 305026 1613 272674 0 There is much more data available, the full slabinfo was taken every hour for each system. Additionally with the help of Jörn Engel I managed to setup System1 with gcov kernel patch and have all data available on an hourly basis until the system has reached "dst cache overflow". I have tried very hard to evaluate this data myself, but find that the linux network code is way beyond my c programming knowledge. Another thing noticed is that as the memory usage increases the systems become slower, when you log in on them and work there. Has anyone any suggestion of what else I can do to narrow down the problem? What I am also not sure if it is correct to assume the bug in the ipv4 multicast implementation, or can it still be a driver problem? But I assume two completely different drivers make this very unlikely. Please, can someone help me to find the bug. I am willing to do any tests or provide more information. Thanks, Holger PS: Please cc me, since I am not on the list. From tupshin@tupshin.com Fri Nov 14 13:20:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 13:20:27 -0800 (PST) Received: from bastard (postfix@adsl-67-114-19-185.dsl.pltn13.pacbell.net [67.114.19.185]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAELKD25016836 for ; Fri, 14 Nov 2003 13:20:13 -0800 Received: from localhost (bastard [127.0.0.1]) by bastard (Postfix) with ESMTP id AABEEF23E0 for ; Fri, 14 Nov 2003 13:20:13 -0800 (PST) Received: from bastard ([127.0.0.1]) by localhost (bastard [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29678-02-3 for ; Fri, 14 Nov 2003 13:20:07 -0800 (PST) Received: from tupshin.com (fussbudget [172.16.2.50]) by bastard (Postfix) with ESMTP id CA3DDF23DD for ; Fri, 14 Nov 2003 13:20:07 -0800 (PST) Message-ID: <3FB54707.5030102@tupshin.com> Date: Fri, 14 Nov 2003 13:20:07 -0800 From: Tupshin Harper User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: FW: gigabit ethernet, nfsroot, jumbo packets, questions, and bugs (2.6.0-test9) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1446 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tupshin@tupshin.com Precedence: bulk X-list: netdev Content-Length: 1722 Lines: 46 Forwarded from lkml by request: I'm trying to set up a diskless testbed using gigabit ethernet, and I'm running into a few issues. First, the scenario: One client, and one server each with an smc EZCard 1000. Kernel 2.6.0-test9 with the sk98lin driver on both sides Client has kernel compiled with sk98lin built in, and nfsroot and dhcp autoconfig built in. Client is getting bootstrapped off a hard drive (for now, since etherboot doesn't support the driver yet) with grub loading the nfsroot kernel from disk, and then mounting nfsroot by adding root=/dev/nfs What works: Everything basic. What doesn't: Above scenario with Jumbo packets (MTU = 9000 or anything above 1500) For performance reasons, I'm wanting to use large packets(the switch between the devices supports it, and jumbo packet communication works fine in the non-diskless scenario). Questions: 1) Is there a good way to set the MTU of the client via dhcp or by passing a parameter to the kernel? 2) If server is set to 9000 MTU and client is set to 1500 MTU, should complete failure ensue(e.g. nfs times out indefinitely), or should some autonegotiation take place? If there should be autonegotiation, then it isn't working. Definite Bug: If the server is set to 9000 MTU, ifconfig down, and ifconfig up with default MTU doesn't work. Ifconfig then claims that the card is set to 1500 MTU, but it is unable to communicate with the client until module is unloaded and reloaded, even though MTU is an ifconfig parameter and not a module parameter. I'm presuming that MTU has not actually been set back to 1500, but I don't know of an easy way to tell if that's the case when ifconfig appears to be lying to me. -Thanks -Tupshin From dlstevens@us.ibm.com Fri Nov 14 15:12:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 15:12:31 -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 hAENBw25018108 for ; Fri, 14 Nov 2003 15:12:07 -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 hAENBqH5249460; Fri, 14 Nov 2003 18:11:52 -0500 Received: from d03nm121.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 hAENBnRi150682; Fri, 14 Nov 2003 16:11:52 -0700 Importance: Normal Sensitivity: Subject: [PATCH] UDP/IPv6 multicasting To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Fri, 14 Nov 2003 16:11:50 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/14/2003 16:11:51 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE74DDFECB2698f9e8a93df938690918c07BBE74DDFECB269" Content-Disposition: inline X-archive-position: 1447 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1666 Lines: 44 --0__=07BBE74DDFECB2698f9e8a93df938690918c07BBE74DDFECB269 Content-type: text/plain; charset=US-ASCII Dave, Below is a patch to fix a problem reported by Brian Buesker. When binding to two different multicast addresses on the same UDP port, a copy sent to either multicast address is delivered to both. +-DLS --- linux-2.6.0-test9-bk12/net/ipv6/udp.c 2003-11-07 14:13:21.000000000 -0800 +++ linux-2.6.0-test9-bk12F1/net/ipv6/udp.c 2003-11-14 14:51:05.000000000 -0800 @@ -551,6 +551,7 @@ if (!ipv6_addr_any(&np->rcv_saddr)) { if (!ipv6_addr_cmp(&np->rcv_saddr, loc_addr)) return s; + continue; } if(!inet6_mc_check(s, loc_addr, rmt_addr)) continue; (See attached file: mcfix.patch.txt) --0__=07BBE74DDFECB2698f9e8a93df938690918c07BBE74DDFECB269 Content-type: application/octet-stream; name="mcfix.patch.txt" Content-Disposition: attachment; filename="mcfix.patch.txt" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMTIvbmV0L2lwdjYvdWRwLmMJMjAwMy0xMS0wNyAxNDox MzoyMS4wMDAwMDAwMDAgLTA4MDAKKysrIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMTJGMS9uZXQvaXB2 Ni91ZHAuYwkyMDAzLTExLTE0IDE0OjUxOjA1LjAwMDAwMDAwMCAtMDgwMApAQCAtNTUxLDYgKzU1 MSw3IEBACiAJCQlpZiAoIWlwdjZfYWRkcl9hbnkoJm5wLT5yY3Zfc2FkZHIpKSB7CiAJCQkJaWYg KCFpcHY2X2FkZHJfY21wKCZucC0+cmN2X3NhZGRyLCBsb2NfYWRkcikpCiAJCQkJCXJldHVybiBz OworCQkJCWNvbnRpbnVlOwogCQkJfQogCQkJaWYoIWluZXQ2X21jX2NoZWNrKHMsIGxvY19hZGRy LCBybXRfYWRkcikpCiAJCQkJY29udGludWU7Cg== --0__=07BBE74DDFECB2698f9e8a93df938690918c07BBE74DDFECB269-- From kuznet@ms2.inr.ac.ru Fri Nov 14 15:46:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 15:46:17 -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 hAENjx25018627 for ; Fri, 14 Nov 2003 15:46:04 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id CAA03631; Sat, 15 Nov 2003 02:45:46 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200311142345.CAA03631@yakov.inr.ac.ru> Subject: Re: RFC 3484 support To: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Nov 2003 02:45:46 +0300 (MSK) Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org In-Reply-To: <3FB40FE5.5040709@redhat.com> from "Ulrich Drepper" at Nov 13, 2003 03:12:37 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: 1448 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 Content-Length: 690 Lines: 18 Hello! > Wouldn't this require to set up a socket and connect it to each target > address? The point of the whole source and destination address > selection is it to avoid making connections Datagram connect() is exactly selection of the addresses, nothing more. I do not mind against specialized interface, but I still see plain connect() as a reasonable and, the most important, universal solution. > provided. The address which has the highest rate of success and the > highest quality for the connection should be tried first. Hmm... We do not account for this. Do you really propose to gather this kind of statistics in the kernel? I am afraid this is really difficult. Alexey From jgarzik@pobox.com Fri Nov 14 17:01:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 17:01:15 -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 hAF10x25022293 for ; Fri, 14 Nov 2003 17:01:01 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:44290 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AKoo4-00034x-CL; Sat, 15 Nov 2003 01:00:56 +0000 Message-ID: <3FB57AB5.8050002@pobox.com> Date: Fri, 14 Nov 2003 20:00: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> <20031112104928.GA15629@gondor.apana.org.au> In-Reply-To: <20031112104928.GA15629@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1449 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 Content-Length: 25 Lines: 3 applied to 2.4 and 2.6 From Mike_Phillips@URSCorp.com Fri Nov 14 17:50:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 17:51:04 -0800 (PST) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAF1oV25011445 for ; Fri, 14 Nov 2003 17:50:31 -0800 Subject: Re: [PATCH] ibmtr -- convert to new probeing To: Jeff Garzik Cc: netdev@oss.sgi.com, Stephen Hemminger X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Fri, 14 Nov 2003 20:50:04 -0800 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 11/14/2003 08:50:05 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 1450 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 86 Lines: 9 Jeff, Thanks. I'll try this out over the weekend and provide the feedback. Mike From herbert@gondor.apana.org.au Fri Nov 14 18:44:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 18:44: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 hAF2ib25014260 for ; Fri, 14 Nov 2003 18:44:39 -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 1AKqQN-00054E-00 for ; Sat, 15 Nov 2003 13:44:36 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AKqQM-0003CI-00 for ; Sat, 15 Nov 2003 13:44:34 +1100 Date: Sat, 15 Nov 2003 13:44:34 +1100 To: netdev@oss.sgi.com Subject: af_packet & CHECKSUM_HW Message-ID: <20031115024434.GA12276@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1451 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 Content-Length: 493 Lines: 15 Hi: Should the packet socket compute the checksums of CHECKSUM_HW packets before sending them to userspace? In other words, what do I tell confused users who see bad checksums in the tcpdump output over loopback and interfaces capable of hardware checksums? 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 From Mike_Phillips@URSCorp.com Fri Nov 14 22:10:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Nov 2003 22:11:17 -0800 (PST) Received: from smtp102.urscorp.com (smtp102.urscorp.com [65.207.129.233]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAF6Am25019341 for ; Fri, 14 Nov 2003 22:10:48 -0800 Subject: Re: [PATCH] ibmtr -- convert to new probeing To: Jeff Garzik Cc: netdev@oss.sgi.com, Stephen Hemminger X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: Mike_Phillips@URSCorp.com Date: Sat, 15 Nov 2003 00:53:18 -0500 X-MIMETrack: Serialize by Router on SMTP102/URSCorp(Release 5.0.11 |July 24, 2002) at 11/15/2003 01:10:21 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-archive-position: 1453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Mike_Phillips@URSCorp.com Precedence: bulk X-list: netdev Content-Length: 921 Lines: 24 Big badda boom !! Applied all patches (including mine to get ibmtr_cs working), insert pcmcia card, boom, panic, kernel halt, bye, bye system. It's getting very, very confused. Stephen's patch changes the behaviour in ibmtr.c so that it tries to probe the PIOAddr even when call via ibmtr_cs, can't do that, ibmtr_cs has already allocated the PIOAddr as part of the pcmcia setup. So ibmtr fails to allocate the same port. ibmtr.c tries to sanely exit, but ibmtr_cs isn't having any of it. Interrupts then decide to arrive, but none of the structures have been setup correctly and the kernel panics in the spinlock in tok_interrupt. Making sure ibmtr_cs is working is actually more important than ibmtr. IBM doesn't sell the isa cards anymore (I hope !!), but the pcmcia adapter is still being sold (in addition to the olympic based cardbus adapter) I need to dig up a real ISA adapter to try this with too. Mike From khc@pm.waw.pl Sat Nov 15 05:29:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Nov 2003 05:30:16 -0800 (PST) Received: from hq.pm.waw.pl (hq.pm.waw.pl [195.116.170.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAFDTv25032634 for ; Sat, 15 Nov 2003 05:29:58 -0800 Received: by hq.pm.waw.pl (Postfix, from userid 10) id 2643E358; Sat, 15 Nov 2003 14:29:53 +0100 (CET) Received: by defiant.pm.waw.pl (Postfix, from userid 500) id D5870302FB; Fri, 14 Nov 2003 22:04:27 +0100 (CET) To: Jeff Garzik Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [BK PATCHES] 2.5.x experimental net driver patches References: <20031114140413.GA15406@gtf.org> From: Krzysztof Halasa Date: 14 Nov 2003 22:04:27 +0100 In-Reply-To: <20031114140413.GA15406@gtf.org> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 1454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: khc@pm.waw.pl Precedence: bulk X-list: netdev Content-Length: 351 Lines: 13 Jeff Garzik writes: > 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-bk18-netdrvr-exp1.patch.bz2 How about a driver for PCI200SYN sync serial WAN card? Would you like me to send it again? -- Krzysztof Halasa, B*FH From matti.aarnio@zmailer.org Sat Nov 15 13:11:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Nov 2003 13:11:30 -0800 (PST) Received: from mail.zmailer.org ([62.78.96.67]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAFLBD25009518 for ; Sat, 15 Nov 2003 13:11:15 -0800 Received: (mea@mea-ext) by mail.zmailer.org id S258571AbTKOVLE (ORCPT ); Sat, 15 Nov 2003 23:11:04 +0200 Date: Sat, 15 Nov 2003 23:11:04 +0200 From: Matti Aarnio To: netdev@oss.sgi.com Subject: IPv6 autoconf oddity... (2.4.21/2.4.22 kernels) Message-ID: <20031115211104.GB2864@mea-ext.zmailer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 1455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: matti.aarnio@zmailer.org Precedence: bulk X-list: netdev I have two nearly identical machines at two locations. Or maybe not quite identical.. very nearly anyway. Machine running somewhat modified RedHat Rawhide 2.4.21-20.1.2024.2.1.nptlmea receives RAs from a cisco router, and autoconfigures nicely. Machine running RedHat Rawhide Fedora 2.4.22-1.2115.nptlsmp kernel fails to autoconf. That machine is receives RAs from a NetBSD router's rtadvd. Both machines run without any specific things to particularly enable IPv6 in their configurations. Besides of auto-loading the ipv6 module. Oddly the functioning pair isn't configured with EUI64=y setting, but the failing one is. Yet the cisco is configured to send EUI64 RAs... Any ideas ? /Matti Aarnio Cisco router advertisement: 21:28:24.008112 fe80::2b0:c2ff:fe89:c352 > ff02::1: icmp6: router advertisement(chlim=64, pref=medium, router_ltime=1800, reachable_time=0, retrans_time=0)(src lladdr: 00:b0:c2:89:c3:52) (prefix info: LA valid_ltime=2592000,preferred_ltime=604800, prefix=2001:14b8:0:3001::/64) [class 0x70] (len 56, hlim 255) 0x0000 6700 0000 0038 3aff fe80 0000 0000 0000 g....8:......... 0x0010 02b0 c2ff fe89 c352 ff02 0000 0000 0000 .......R........ 0x0020 0000 0000 0000 0001 8600 b5b6 4000 0708 ............@... 0x0030 0000 0000 0000 0000 0101 00b0 c289 c352 ...............R 0x0040 0304 40c0 0027 8d00 0009 3a80 0000 0000 ..@..'....:..... 0x0050 2001 14b8 0000 3001 0000 0000 0000 0000 ......0......... NetBSD rtadvd advertisemenent: # 21:18:42.468714 fe80::200:e2ff:fe70:341f > all-nodes-mc: icmp6: router advertisement(chlim=64, pref=medium, router_ltime=90, reachable_time=0, retrans_time=0)(src lladdr: 00:00:e2:70:34:1f) (prefix info: LA valid_ltime=2592000,preferred_ltime=604800, prefix=2001:14b8:0:3003::/64) (len 56, hlim 255) 0x0000 6000 0000 0038 3aff fe80 0000 0000 0000 `....8:......... 0x0010 0200 e2ff fe70 341f ff02 0000 0000 0000 .....p4......... 0x0020 0000 0000 0000 0001 8600 9c5b 4000 005a ...........[@..Z 0x0030 0000 0000 0000 0000 0101 0000 e270 341f .............p4. 0x0040 0304 40c0 0027 8d00 0009 3a80 0000 0000 ..@..'....:..... 0x0050 2001 14b8 0000 3003 0000 0000 0000 0000 ......0......... From acme@conectiva.com.br Sat Nov 15 13:18:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Nov 2003 13:19:13 -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 hAFLIt25009991 for ; Sat, 15 Nov 2003 13:18:58 -0800 Received: from [200.138.54.21] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AL7rF-000842-00 for netdev@oss.sgi.com; Sat, 15 Nov 2003 19:21:29 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 3B2CA1966D; Sat, 15 Nov 2003 21:20:34 +0000 (UTC) Date: Sat, 15 Nov 2003 19:20:34 -0200 From: Arnaldo Carvalho de Melo To: netdev@oss.sgi.com Subject: [RFC] moving the test for sockaddr->sa_family up Message-ID: <20031115212034.GA16326@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: 1456 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 Does anybody see any problem with this simplification? Not for 2.6.0, of course... - Arnaldo ===== net/socket.c 1.70 vs edited ===== --- 1.70/net/socket.c Wed Oct 29 18:19:30 2003 +++ edited/net/socket.c Sat Nov 15 04:53:48 2003 @@ -1187,13 +1187,17 @@ if((sock = sockfd_lookup(fd,&err))!=NULL) { if((err=move_addr_to_kernel(umyaddr,addrlen,address))>=0) { - err = security_socket_bind(sock, (struct sockaddr *)address, addrlen); - if (err) { - sockfd_put(sock); - return err; - } - err = sock->ops->bind(sock, (struct sockaddr *)address, addrlen); + struct sockaddr *saddr = (struct sockaddr *)address; + + err = -EAFNOSUPPORT; + if (saddr->sa_family != sock->sk->sk_family) + goto out_put; + err = security_socket_bind(sock, saddr, addrlen); + if (err) + goto out_put; + err = sock->ops->bind(sock, saddr, addrlen); } +out_put: sockfd_put(sock); } return err; ===== net/appletalk/ddp.c 1.40 vs edited ===== --- 1.40/net/appletalk/ddp.c Fri Oct 31 01:43:17 2003 +++ edited/net/appletalk/ddp.c Sat Nov 15 04:57:40 2003 @@ -1158,9 +1158,6 @@ if (!sk->sk_zapped || addr_len != sizeof(struct sockaddr_at)) return -EINVAL; - if (addr->sat_family != AF_APPLETALK) - return -EAFNOSUPPORT; - if (addr->sat_addr.s_net == htons(ATADDR_ANYNET)) { struct atalk_addr *ap = atalk_find_primary(); ===== net/atm/pvc.c 1.15 vs edited ===== --- 1.15/net/atm/pvc.c Fri Sep 5 06:35:34 2003 +++ edited/net/atm/pvc.c Sat Nov 15 04:58:22 2003 @@ -34,7 +34,6 @@ if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL; addr = (struct sockaddr_atmpvc *) sockaddr; - if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT; lock_sock(sk); vcc = ATM_SD(sock); if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) { ===== net/ax25/af_ax25.c 1.33 vs edited ===== --- 1.33/net/ax25/af_ax25.c Tue Oct 7 10:27:14 2003 +++ edited/net/ax25/af_ax25.c Sat Nov 15 05:01:10 2003 @@ -1030,9 +1030,6 @@ current->comm); } - if (addr->fsa_ax25.sax25_family != AF_AX25) - return -EINVAL; - call = ax25_findbyuid(current->euid); if (call == NULL && ax25_uid_policy && !capable(CAP_NET_ADMIN)) { return -EACCES; ===== net/bluetooth/hci_sock.c 1.26 vs edited ===== --- 1.26/net/bluetooth/hci_sock.c Fri Sep 12 12:44:53 2003 +++ edited/net/bluetooth/hci_sock.c Sat Nov 15 05:03:08 2003 @@ -264,9 +264,6 @@ BT_DBG("sock %p sk %p", sock, sk); - if (!haddr || haddr->hci_family != AF_BLUETOOTH) - return -EINVAL; - lock_sock(sk); if (hci_pi(sk)->hdev) { ===== net/bluetooth/l2cap.c 1.37 vs edited ===== --- 1.37/net/bluetooth/l2cap.c Thu Nov 13 04:30:44 2003 +++ edited/net/bluetooth/l2cap.c Sat Nov 15 05:03:41 2003 @@ -396,9 +396,6 @@ BT_DBG("sk %p, %s %d", sk, batostr(&la->l2_bdaddr), la->l2_psm); - if (!addr || addr->sa_family != AF_BLUETOOTH) - return -EINVAL; - lock_sock(sk); if (sk->sk_state != BT_OPEN) { ===== net/bluetooth/sco.c 1.25 vs edited ===== --- 1.25/net/bluetooth/sco.c Thu Nov 13 04:30:44 2003 +++ edited/net/bluetooth/sco.c Sat Nov 15 05:04:03 2003 @@ -472,9 +472,6 @@ BT_DBG("sk %p %s", sk, batostr(&sa->sco_bdaddr)); - if (!addr || addr->sa_family != AF_BLUETOOTH) - return -EINVAL; - lock_sock(sk); if (sk->sk_state != BT_OPEN) { ===== net/bluetooth/rfcomm/sock.c 1.27 vs edited ===== --- 1.27/net/bluetooth/rfcomm/sock.c Thu Nov 13 04:30:44 2003 +++ edited/net/bluetooth/rfcomm/sock.c Sat Nov 15 05:02:25 2003 @@ -323,9 +323,6 @@ BT_DBG("sk %p %s", sk, batostr(&sa->rc_bdaddr)); - if (!addr || addr->sa_family != AF_BLUETOOTH) - return -EINVAL; - lock_sock(sk); if (sk->sk_state != BT_OPEN) { ===== net/decnet/af_decnet.c 1.37 vs edited ===== --- 1.37/net/decnet/af_decnet.c Thu Nov 13 06:50:30 2003 +++ edited/net/decnet/af_decnet.c Sat Nov 15 05:05:09 2003 @@ -707,9 +707,6 @@ if (addr_len != sizeof(struct sockaddr_dn)) return -EINVAL; - if (saddr->sdn_family != AF_DECnet) - return -EINVAL; - if (dn_ntohs(saddr->sdn_nodeaddrl) && (dn_ntohs(saddr->sdn_nodeaddrl) != 2)) return -EINVAL; ===== net/econet/af_econet.c 1.27 vs edited ===== --- 1.27/net/econet/af_econet.c Tue Oct 7 10:27:14 2003 +++ edited/net/econet/af_econet.c Sat Nov 15 05:05:49 2003 @@ -188,8 +188,7 @@ * Check legality */ - if (addr_len < sizeof(struct sockaddr_ec) || - sec->sec_family != AF_ECONET) + if (addr_len < sizeof(struct sockaddr_ec)) return -EINVAL; eo->cb = sec->cb; ===== net/llc/af_llc.c 1.70 vs edited ===== --- 1.70/net/llc/af_llc.c Fri Nov 14 21:52:15 2003 +++ edited/net/llc/af_llc.c Sat Nov 15 05:10:12 2003 @@ -285,9 +285,6 @@ dprintk("%s: binding %02X\n", __FUNCTION__, addr->sllc_sap); if (unlikely(!sk->sk_zapped || addrlen != sizeof(*addr))) goto out; - rc = -EAFNOSUPPORT; - if (unlikely(addr->sllc_family != AF_LLC)) - goto out; if (!addr->sllc_sap) { rc = -EUSERS; addr->sllc_sap = llc_ui_autoport(); ===== net/netlink/af_netlink.c 1.37 vs edited ===== --- 1.37/net/netlink/af_netlink.c Tue Nov 4 17:48:39 2003 +++ edited/net/netlink/af_netlink.c Sat Nov 15 05:10:31 2003 @@ -329,9 +329,6 @@ struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; int err; - if (nladdr->nl_family != AF_NETLINK) - return -EINVAL; - /* Only superuser is allowed to listen multicasts */ if (nladdr->nl_groups && !netlink_capable(sock, NL_NONROOT_RECV)) return -EPERM; ===== net/netrom/af_netrom.c 1.40 vs edited ===== --- 1.40/net/netrom/af_netrom.c Sun Sep 21 22:17:31 2003 +++ edited/net/netrom/af_netrom.c Sat Nov 15 05:10:59 2003 @@ -570,10 +570,6 @@ release_sock(sk); return -EINVAL; } - if (addr->fsa_ax25.sax25_family != AF_NETROM) { - release_sock(sk); - return -EINVAL; - } if ((dev = nr_dev_get(&addr->fsa_ax25.sax25_call)) == NULL) { SOCK_DEBUG(sk, "NET/ROM: bind failed: invalid node callsign\n"); release_sock(sk); ===== net/packet/af_packet.c 1.35 vs edited ===== --- 1.35/net/packet/af_packet.c Tue Oct 7 10:27:14 2003 +++ edited/net/packet/af_packet.c Sat Nov 15 05:11:13 2003 @@ -901,8 +901,6 @@ if (addr_len < sizeof(struct sockaddr_ll)) return -EINVAL; - if (sll->sll_family != AF_PACKET) - return -EINVAL; if (sll->sll_ifindex) { err = -ENODEV; ===== net/rose/af_rose.c 1.33 vs edited ===== --- 1.33/net/rose/af_rose.c Tue Sep 9 15:22:56 2003 +++ edited/net/rose/af_rose.c Sat Nov 15 05:11:39 2003 @@ -654,9 +654,6 @@ if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose)) return -EINVAL; - if (addr->srose_family != AF_ROSE) - return -EINVAL; - if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) return -EINVAL; ===== net/unix/af_unix.c 1.56 vs edited ===== --- 1.56/net/unix/af_unix.c Thu Nov 13 04:37:45 2003 +++ edited/net/unix/af_unix.c Sat Nov 15 05:12:02 2003 @@ -649,10 +649,6 @@ struct unix_address *addr; struct hlist_head *list; - err = -EINVAL; - if (sunaddr->sun_family != AF_UNIX) - goto out; - if (addr_len==sizeof(short)) { err = unix_autobind(sock); goto out; ===== net/wanrouter/af_wanpipe.c 1.31 vs edited ===== --- 1.31/net/wanrouter/af_wanpipe.c Sun Oct 5 03:51:01 2003 +++ edited/net/wanrouter/af_wanpipe.c Sat Nov 15 05:12:24 2003 @@ -1340,10 +1340,6 @@ printk(KERN_INFO "wansock: Address length error\n"); return -EINVAL; } - if (sll->sll_family != AF_WANPIPE){ - printk(KERN_INFO "wansock: Illegal family name specified.\n"); - return -EINVAL; - } card = wanpipe_find_card (sll->sll_card); if (!card){ ===== net/x25/af_x25.c 1.38 vs edited ===== --- 1.38/net/x25/af_x25.c Thu Nov 13 01:18:49 2003 +++ edited/net/x25/af_x25.c Sat Nov 15 05:12:43 2003 @@ -587,8 +587,7 @@ struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr; if (!sk->sk_zapped || - addr_len != sizeof(struct sockaddr_x25) || - addr->sx25_family != AF_X25) + addr_len != sizeof(struct sockaddr_x25)) return -EINVAL; x25_sk(sk)->source_addr = addr->sx25_addr; From jgarzik@pobox.com Sat Nov 15 21:22:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Nov 2003 21:23:08 -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 hAG5Mr25020184 for ; Sat, 15 Nov 2003 21:22:54 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:41132 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AJikJ-0005wi-In; Wed, 12 Nov 2003 00:20:31 +0000 Message-ID: <3FB17CC2.4090401@pobox.com> Date: Tue, 11 Nov 2003 19:20:18 -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: OGAWA Hirofumi , 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> In-Reply-To: <20031111143143.794909e8.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1457 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: > 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. I'm OK with the patch, but like last time, it doesn't apply cleanly to net-drivers-2.5-exp... About to post an update, can you please rediff against that? Jeff From jmorris@redhat.com Sun Nov 16 05:44:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 05:45:08 -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 hAGDim25004251 for ; Sun, 16 Nov 2003 05:44:49 -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 hAGDifG31361; Sun, 16 Nov 2003 08:44:41 -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 hAGDiew04132; Sun, 16 Nov 2003 08:44:40 -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 hAGDicDJ002473; Sun, 16 Nov 2003 08:44:39 -0500 Date: Sun, 16 Nov 2003 08:44:38 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Herbert Xu cc: netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW In-Reply-To: <20031115024434.GA12276@gondor.apana.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1458 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 Sat, 15 Nov 2003, Herbert Xu wrote: > Hi: > > Should the packet socket compute the checksums of CHECKSUM_HW packets > before sending them to userspace? > > In other words, what do I tell confused users who see bad checksums > in the tcpdump output over loopback and interfaces capable of > hardware checksums? That this functionality does not belong in the kernel, as it serves no real purpose. - James -- James Morris From jmorris@redhat.com Sun Nov 16 05:56:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 05:56:25 -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 hAGDuA25004730 for ; Sun, 16 Nov 2003 05:56:11 -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 hAGDu7G01508; Sun, 16 Nov 2003 08:56:07 -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 hAGDu5w06314; Sun, 16 Nov 2003 08:56:05 -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 hAGDu4DJ002931; Sun, 16 Nov 2003 08:56:04 -0500 Date: Sun, 16 Nov 2003 08:56:04 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Arnaldo Carvalho de Melo cc: netdev@oss.sgi.com Subject: Re: [RFC] moving the test for sockaddr->sa_family up In-Reply-To: <20031115212034.GA16326@conectiva.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1459 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 Sat, 15 Nov 2003, Arnaldo Carvalho de Melo wrote: > Does anybody see any problem with this simplification? Not for 2.6.0, of > course... No, looks like a good idea. Might be able to push address length verification up there too. - James -- James Morris From jgarzik@pobox.com Sun Nov 16 08:31:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 08:32:01 -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 hAGGVk25008830 for ; Sun, 16 Nov 2003 08:31:47 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:44302 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AKoun-000394-Qm; Sat, 15 Nov 2003 01:07:53 +0000 Message-ID: <3FB57C55.5090602@pobox.com> Date: Fri, 14 Nov 2003 20:07:33 -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 , "Mike_Phillips@URSCorp.com" CC: netdev@oss.sgi.com Subject: Re: [PATCH] ibmtr -- convert to new probeing References: <20031113112440.2fe0e12c.shemminger@osdl.org> In-Reply-To: <20031113112440.2fe0e12c.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1460 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: > This patch applies against net-drivers-2.5-exp. The line number offsets assume > the earlier patchset, but this change doesn't overlap all those ether changes. > > * convert ibmtr driver to using the new probe interface -- ibmtr_probe2 > * keep old ibmtr_probe for use as init handle because ibmtr_cs uses it > * cleanup error paths in ibmtr_probe1 and module init > * make only used locally functions static > * do request_region before doing i/o > * irq and mem were not really settable as module parameters so removed Given that there has been some other activity in this driver, I would prefer to wait for Mike's ACK, before applying to net-drivers-2.5-exp (and eventually 2.6 when it re-opens). Jeff From jgarzik@pobox.com Sun Nov 16 10:16:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 10:16:46 -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 hAGIGR25010779 for ; Sun, 16 Nov 2003 10:16:28 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:45098 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ALRRh-00064L-ID; Sun, 16 Nov 2003 18:16:25 +0000 Message-ID: <3FB7BEE1.7030902@pobox.com> Date: Sun, 16 Nov 2003 13:16:01 -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: netdev@oss.sgi.com CC: Linux Kernel , Andrew Morton , viro@parcelfarce.linux.theplanet.co.uk, Stephen Hemminger Subject: [BK PATCHES] 2.6.x experimental net driver queue Content-Type: multipart/mixed; boundary="------------060104010205000600050802" X-archive-position: 1461 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 This is a multi-part message in MIME format. --------------060104010205000600050802 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit With massive help from Al and Stephen, init_etherdev uses should be very close to now. Also, adds some non-critical e100/e1000 fixes and updates. Test away... --------------060104010205000600050802 Content-Type: text/plain; name="linus.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linus.txt" BK users: bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5-exp Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk21-netdrvr-exp1.patch.bz2 This will update the following files: drivers/net/68360enet.c | 951 -------------------------------- Documentation/networking/netconsole.txt | 57 + drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c59x.c | 17 drivers/net/8139too.c | 51 + drivers/net/82596.c | 83 +- drivers/net/Kconfig | 7 drivers/net/Makefile | 2 drivers/net/Space.c | 583 +++++++++---------- drivers/net/a2065.c | 19 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 77 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 65 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 97 +-- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 28 drivers/net/macsonic.c | 102 +-- drivers/net/mvme147.c | 59 - drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 14 drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 72 +- drivers/net/sun3lance.c | 79 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 410 ++++++++++--- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 156 files changed, 7083 insertions(+), 6431 deletions(-) through these ChangeSets: (03/11/16 1.1518) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1517) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1516) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1515) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1514) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1513) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1512) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1511) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1510) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1509) [netdrvr depca] fix leaks on error (03/11/16 1.1508) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1507) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1506) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1505) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1504) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1503) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1502) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1501) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1500) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1499) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1498) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1497) [netdrvr declance] use alloc_etherdev (03/11/16 1.1496) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1495) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1494) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1493) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1492) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1491) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1490) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1489) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1488) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1487) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1486) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1485) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1484) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1483) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1482) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1481) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1480) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1479) [netdrvr 3c515] fix non-modular build (03/11/12 1.1478) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1477) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1476) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1475) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1474) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1473) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1472) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1471) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1470) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1469) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1468) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1467) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1466) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1465) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1464) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1463) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1462) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1461) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1460) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1459) [PATCH] (23/42) 3c523 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 (03/11/12 1.1458) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1457) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1456) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1455) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1454) [PATCH] (18/42) ultra 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 (03/11/12 1.1453) [PATCH] (17/42) wd 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 (03/11/12 1.1452) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1451) [PATCH] (15/42) hp 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 (03/11/12 1.1450) [PATCH] (14/42) hpplus 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 (03/11/12 1.1449) [PATCH] (13/42) e2100 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 (03/11/12 1.1448) [PATCH] (12/42) ne 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 (03/11/12 1.1447) [PATCH] (11/42) lance 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? (03/11/12 1.1446) [PATCH] (10/42) smc 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 (03/11/12 1.1445) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1444) [PATCH] (8/42) at1500 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). (03/11/12 1.1443) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1442) [PATCH] (6/42) at1700 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 (03/11/12 1.1441) [PATCH] (5/42) fmv18 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... (03/11/12 1.1440) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1439) [PATCH] (3/42) eexpress 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 (03/11/12 1.1438) [PATCH] (2/42) eepro 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 (03/11/12 1.1437) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.1.5) [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.1428.1.4) [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.1428.1.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.1.2) [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 --------------060104010205000600050802-- From acme@conectiva.com.br Sun Nov 16 11:05:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 11:05:50 -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 hAGJ5Q25011608 for ; Sun, 16 Nov 2003 11:05:28 -0800 Received: from [200.103.132.105] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1ALSFj-0000gz-00; Sun, 16 Nov 2003 17:08:07 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id E5ACB1966D; Sun, 16 Nov 2003 19:07:58 +0000 (UTC) Date: Sun, 16 Nov 2003 17:07:58 -0200 From: Arnaldo Carvalho de Melo To: James Morris Cc: netdev@oss.sgi.com Subject: Re: [RFC] moving the test for sockaddr->sa_family up Message-ID: <20031116190757.GA18416@conectiva.com.br> References: <20031115212034.GA16326@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1462 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 Em Sun, Nov 16, 2003 at 08:56:04AM -0500, James Morris escreveu: > On Sat, 15 Nov 2003, Arnaldo Carvalho de Melo wrote: > > > Does anybody see any problem with this simplification? Not for 2.6.0, of > > course... > > No, looks like a good idea. Might be able to push address length > verification up there too. Not really, look at the ax25 code... :-\ They have to support two address types, if we want to keep this flexibility we can't check it at the upper layer, does anybody here knows if we want or if we can ditch that thing in ax25? this: net/ax25/af_ax25.c static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sock *sk = sock->sk; struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr; ax25_dev *ax25_dev = NULL; ax25_address *call; ax25_cb *ax25; int err = 0; if (addr_len != sizeof(struct sockaddr_ax25) && addr_len != sizeof(struct full_sockaddr_ax25)) { /* support for old structure may go away some time */ if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || (addr_len > sizeof(struct full_sockaddr_ax25))) { return -EINVAL; } printk(KERN_WARNING "ax25_bind(): %s uses old (6 digipeater) socket structure.\n", current->comm); } I haven't checked for how many major kernel versions this thing is there, but I'd love to trow this away if possible. Ah, I tried to see if we could move the family test in the ->connect case as well, only to enlighten myself with a trick in PF_UNIX, namely: static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags) if (addr->sa_family != AF_UNSPEC) { } else { /* * 1003.1g breaking connected state with AF_UNSPEC */ other = NULL; unix_state_wlock(sk); } Oh well, the thing uses sa_family to a magic value to signal breaking connected state, the wonders never cease :( - Arnaldo From herbert@gondor.apana.org.au Sun Nov 16 12:52:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 12:52:33 -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 hAGKpv25015570 for ; Sun, 16 Nov 2003 12:52:18 -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 1ALTs5-0002Xa-00; Mon, 17 Nov 2003 07:51:49 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1ALTs2-0002DS-00; Mon, 17 Nov 2003 07:51:46 +1100 Date: Mon, 17 Nov 2003 07:51:46 +1100 To: James Morris Cc: netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-ID: <20031116205146.GA8477@gondor.apana.org.au> References: <20031115024434.GA12276@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1463 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 On Sun, Nov 16, 2003 at 08:44:38AM -0500, James Morris wrote: > On Sat, 15 Nov 2003, Herbert Xu wrote: > > > In other words, what do I tell confused users who see bad checksums > > in the tcpdump output over loopback and interfaces capable of > > hardware checksums? > > That this functionality does not belong in the kernel, as it serves no > real purpose. OK, I will quote you on that :) -- 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 From c-d.hailfinger.kernel.2003@gmx.net Sun Nov 16 14:12:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 14:13:14 -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 hAGMCw25016566 for ; Sun, 16 Nov 2003 14:12:59 -0800 Received: (qmail 18734 invoked by uid 65534); 16 Nov 2003 22:12:51 -0000 Received: from stud212108.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.108) by mail.gmx.net (mp027) with SMTP; 16 Nov 2003 23:12:51 +0100 X-Authenticated: #15936885 Message-ID: <3FB7F65C.3010007@gmx.net> Date: Sun, 16 Nov 2003 23:12:44 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: de, en MIME-Version: 1.0 To: Joerg Esser CC: netdev@oss.sgi.com, Manfred Spraul Subject: Re: forcedeth 0.15: 08 Nov 2003 for kernel 2.4 just ping and DHCP traffic X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1464 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2003@gmx.net Precedence: bulk X-list: netdev Joerg Esser wrote: > I've tried the above version on my ASUS A7N8X-VM Board because with the > nvnet driver I just could ping other Computers and the other just > could refresh their IP over DHCP(I?ve installed it on the Computer with > the ASUS Board). Everything else like Webbrowsing ,FTP, etc didn?t > work. Looking at the debug output you provided, it seems your BIOS doesn't set the MAC address correctly, but uses 01:23:45:67:89:ab instead. > Now I tried your driver and I get the same results but with a lot more > of debug output. Could you boot into MS-Windows and try to find out the MAC address from there, then set this MAC address under Linux with ifconfig, using the forcedeth driver since nvnet can't handle setting the MAC address manually. Oh, and the output of lspci -vvvxxx as root would probably give an additional clue what happens/ where the MAC address is stored. Carl-Daniel From c-d.hailfinger.kernel.2003@gmx.net Sun Nov 16 15:26:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 15:27:00 -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 hAGNQk25019549 for ; Sun, 16 Nov 2003 15:26:47 -0800 Received: (qmail 24002 invoked by uid 65534); 16 Nov 2003 23:26:40 -0000 Received: from stud212143.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.143) by mail.gmx.net (mp010) with SMTP; 17 Nov 2003 00:26:40 +0100 X-Authenticated: #15936885 Message-ID: <3FB807A3.8010207@gmx.net> Date: Mon, 17 Nov 2003 00:26:27 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: de, en MIME-Version: 1.0 To: Linux Kernel Mailing List CC: netdev@oss.sgi.com, Andrew Morton , Bernhard Rosenkraenzer , Andrew de Quincey , Manfred Spraul , Jeff Garzik Subject: forcedeth: version 0.17 available X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1465 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2003@gmx.net Precedence: bulk X-list: netdev Hello all, version 0.17 of forcedeth for Linux 2.4 and 2.6 is available at http://www.hailfinger.org/carldani/linux/patches/forcedeth/ Fixes in this release over 0.14: * 0.15: 08 Nov 2003: fix smp deadlock with set_multicast_list * during open. * 0.16: 15 Nov 2003: include file cleanup for ppc64, rx buffer * size increased to 1628 bytes. * 0.17: 16 Nov 2003: undo rx buffer size increase. Substract 1 * from the tx length. Known issues: * Oops during module removal, probably sysfs related. Could a sysfs expert please take a look at the code? Call trace is at http://www.ussg.iu.edu/hypermail/linux/kernel/0311.1/0213.html More traces (roughly the same) available on request. * Some boards give bogus MAC addresses and work only partially. Same problem happens with nvnet on these boards. * Transmit for packets close to MTU size was broken, should be fixed now. Please test. Regards, Carl-Daniel From jgarzik@pobox.com Sun Nov 16 15:26:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 15:27:06 -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 hAGNQb25019544 for ; Sun, 16 Nov 2003 15:26:38 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:45227 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ALVb4-0000gm-Ut; Sun, 16 Nov 2003 22:42:23 +0000 Message-ID: <3FB7FD36.1060006@pobox.com> Date: Sun, 16 Nov 2003 17:41:58 -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: netdev@oss.sgi.com CC: Linux Kernel Subject: [BK PATCHES] (updated] 2.6.x experimental net driver queue Content-Type: multipart/mixed; boundary="------------090300000606050008070409" X-archive-position: 1466 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 This is a multi-part message in MIME format. --------------090300000606050008070409 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit BK users were having a tough time, considering that (a) I forgot to push and (b) the BK URL in the previous email was incorrect. Corrected... --------------090300000606050008070409 Content-Type: text/plain; name="linus.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linus.txt" 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-bk21-netdrvr-exp1.patch.bz2 This will update the following files: drivers/net/68360enet.c | 951 -------------------------------- Documentation/networking/netconsole.txt | 57 + drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c59x.c | 17 drivers/net/8139too.c | 51 + drivers/net/82596.c | 83 +- drivers/net/Kconfig | 7 drivers/net/Makefile | 2 drivers/net/Space.c | 583 +++++++++---------- drivers/net/a2065.c | 19 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 77 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 65 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 97 +-- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 28 drivers/net/macsonic.c | 102 +-- drivers/net/mvme147.c | 59 - drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 14 drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 72 +- drivers/net/sun3lance.c | 79 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 410 ++++++++++--- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 156 files changed, 7083 insertions(+), 6431 deletions(-) through these ChangeSets: (03/11/16 1.1518) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1517) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1516) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1515) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1514) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1513) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1512) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1511) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1510) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1509) [netdrvr depca] fix leaks on error (03/11/16 1.1508) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1507) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1506) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1505) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1504) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1503) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1502) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1501) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1500) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1499) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1498) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1497) [netdrvr declance] use alloc_etherdev (03/11/16 1.1496) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1495) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1494) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1493) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1492) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1491) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1490) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1489) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1488) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1487) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1486) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1485) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1484) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1483) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1482) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1481) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1480) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1479) [netdrvr 3c515] fix non-modular build (03/11/12 1.1478) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1477) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1476) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1475) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1474) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1473) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1472) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1471) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1470) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1469) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1468) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1467) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1466) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1465) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1464) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1463) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1462) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1461) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1460) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1459) [PATCH] (23/42) 3c523 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 (03/11/12 1.1458) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1457) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1456) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1455) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1454) [PATCH] (18/42) ultra 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 (03/11/12 1.1453) [PATCH] (17/42) wd 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 (03/11/12 1.1452) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1451) [PATCH] (15/42) hp 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 (03/11/12 1.1450) [PATCH] (14/42) hpplus 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 (03/11/12 1.1449) [PATCH] (13/42) e2100 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 (03/11/12 1.1448) [PATCH] (12/42) ne 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 (03/11/12 1.1447) [PATCH] (11/42) lance 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? (03/11/12 1.1446) [PATCH] (10/42) smc 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 (03/11/12 1.1445) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1444) [PATCH] (8/42) at1500 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). (03/11/12 1.1443) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1442) [PATCH] (6/42) at1700 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 (03/11/12 1.1441) [PATCH] (5/42) fmv18 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... (03/11/12 1.1440) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1439) [PATCH] (3/42) eexpress 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 (03/11/12 1.1438) [PATCH] (2/42) eepro 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 (03/11/12 1.1437) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.1.5) [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.1428.1.4) [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.1428.1.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.1.2) [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 --------------090300000606050008070409-- From jgarzik@pobox.com Sun Nov 16 16:37:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 16:37:18 -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 hAH0b125023921 for ; Sun, 16 Nov 2003 16:37:02 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:45289 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ALXNz-0001yx-JR; Mon, 17 Nov 2003 00:36:59 +0000 Message-ID: <3FB81811.9090508@pobox.com> Date: Sun, 16 Nov 2003 19:36:33 -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: netdev@oss.sgi.com CC: Linux Kernel , Andrew Morton , viro@parcelfarce.linux.theplanet.co.uk Subject: [BK PATCHES] 2.6.x experimental net driver queue Content-Type: multipart/mixed; boundary="------------070909080505000701050604" X-archive-position: 1467 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 This is a multi-part message in MIME format. --------------070909080505000701050604 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Yet more updates. Syncing with Andrew Morton, and more syncing with Al Viro. No users of init_etherdev remain in the tree. (yay!) --------------070909080505000701050604 Content-Type: text/plain; name="net-drivers-2.5.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="net-drivers-2.5.txt" 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-bk21-netdrvr-exp2.patch.bz2 This will update the following files: drivers/net/68360enet.c | 951 -------------------------------- Documentation/networking/netconsole.txt | 57 + drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c527.h | 6 drivers/net/3c59x.c | 17 drivers/net/8139too.c | 51 + drivers/net/82596.c | 83 +- drivers/net/Kconfig | 9 drivers/net/Makefile | 2 drivers/net/Space.c | 583 +++++++++---------- drivers/net/a2065.c | 19 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 77 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 65 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ethertap.c | 3 drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lasi_82596.c | 17 drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 97 +-- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 28 drivers/net/macsonic.c | 102 +-- drivers/net/mvme147.c | 59 - drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 18 drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 72 +- drivers/net/sun3lance.c | 79 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 417 ++++++++++---- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 drivers/usb/gadget/ether.c | 2 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 636 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 160 files changed, 7103 insertions(+), 6452 deletions(-) through these ChangeSets: (03/11/16 1.1522) [netdrvr lasi_82596] remove ether_setup() call, fix leak in probe (03/11/16 1.1521) [netdrvr] alloc_etherdev-related cleanups Mostly removing unneeded calls to ether_setup(), which alloc_etherdev() already does for us. (03/11/16 1.1520) [netdrvr 3c527] applied missing pieces of Richard Proctor's 3c527 SMP update Minor stuff... remove unused constants, and mark non-experimental and non-broken in Kconfig. (03/11/16 1.1519) [netdrvr tulip] clean up tulip NAPI poll disable Looks like the same patch was applied multiple times. No negative effects except ugliness and a redundant test. (03/11/16 1.1518) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1517) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1516) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1515) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1514) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1513) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1512) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1511) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1510) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1509) [netdrvr depca] fix leaks on error (03/11/16 1.1508) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1507) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1506) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1505) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1504) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1503) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1502) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1501) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1500) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1499) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1498) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1497) [netdrvr declance] use alloc_etherdev (03/11/16 1.1496) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1495) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1494) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1493) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1492) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1491) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1490) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1489) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1488) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1487) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1486) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1485) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1484) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1483) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1482) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1481) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1480) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1479) [netdrvr 3c515] fix non-modular build (03/11/12 1.1478) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1477) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1476) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1475) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1474) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1473) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1472) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1471) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1470) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1469) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1468) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1467) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1466) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1465) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1464) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1463) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1462) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1461) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1460) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1459) [PATCH] (23/42) 3c523 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 (03/11/12 1.1458) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1457) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1456) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1455) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1454) [PATCH] (18/42) ultra 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 (03/11/12 1.1453) [PATCH] (17/42) wd 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 (03/11/12 1.1452) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1451) [PATCH] (15/42) hp 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 (03/11/12 1.1450) [PATCH] (14/42) hpplus 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 (03/11/12 1.1449) [PATCH] (13/42) e2100 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 (03/11/12 1.1448) [PATCH] (12/42) ne 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 (03/11/12 1.1447) [PATCH] (11/42) lance 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? (03/11/12 1.1446) [PATCH] (10/42) smc 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 (03/11/12 1.1445) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1444) [PATCH] (8/42) at1500 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). (03/11/12 1.1443) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1442) [PATCH] (6/42) at1700 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 (03/11/12 1.1441) [PATCH] (5/42) fmv18 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... (03/11/12 1.1440) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1439) [PATCH] (3/42) eexpress 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 (03/11/12 1.1438) [PATCH] (2/42) eepro 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 (03/11/12 1.1437) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.1.5) [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.1428.1.4) [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.1428.1.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.1.2) [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 --------------070909080505000701050604-- From brad_mssw@gentoo.org Sun Nov 16 20:00:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 20:00:51 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAH40S25026648 for ; Sun, 16 Nov 2003 20:00:29 -0800 Received: from brainwerkz.net (localhost [127.0.0.1]) by nameserver1.mcve.com (Postfix) with SMTP id 2824A83C47 for ; Sun, 16 Nov 2003 23:13:23 -0500 (EST) Received: from ip68-105-173-45.ga.at.cox.net ([68.105.173.45]) (SquirrelMail authenticated user brad) by mail.mainstreetsoftworks.com with HTTP; Sun, 16 Nov 2003 23:13:23 -0500 (EST) Message-ID: <47975.68.105.173.45.1069042403.squirrel@mail.mainstreetsoftworks.com> Date: Sun, 16 Nov 2003 23:13:23 -0500 (EST) Subject: [PATCH 2.6.0-test9-bk17] add official BCM5700 driver (instead of tg3 driver) From: "Brad House" To: X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.11) 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 hAH40S25026648 X-archive-position: 1468 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad_mssw@gentoo.org Precedence: bulk X-list: netdev Because of numerous reported problems with the tg3 driver, mainly on amd64 (x86_64/Opteron/Athlon64) boxes, we made a kernel patch from the latest official BCM5700 2.4 driver for the 2.6 kernel. This seems to resolve those problems, though also seems to be a much larger driver than the tg3 driver. http://dev.gentoo.org/~brad_mssw/kernel_patches/2.6.0/genpatches-0.4/302_bcm5700_broadcom_gigabit_drvr.patch Please CC me on any replies as I am not subscribed to this list. I also figured it would be ok to submit, as there's the eepro100 and e100 drivers for the intel nic, figured this was a similar instance. -Brad House brad_mssw@gentoo.org From brad_mssw@gentoo.org Sun Nov 16 20:35:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 20:36:05 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAH4Zg25030065 for ; Sun, 16 Nov 2003 20:35:42 -0800 Received: from brainwerkz.net (localhost [127.0.0.1]) by nameserver1.mcve.com (Postfix) with SMTP id 56AEB83C1D for ; Sun, 16 Nov 2003 23:08:09 -0500 (EST) Received: from ip68-105-173-45.ga.at.cox.net ([68.105.173.45]) (SquirrelMail authenticated user brad) by mail.mainstreetsoftworks.com with HTTP; Sun, 16 Nov 2003 23:08:09 -0500 (EST) Message-ID: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> Date: Sun, 16 Nov 2003 23:08:09 -0500 (EST) Subject: [PATCH 2.6.0-test9-bk6] r8169.c update for 8110S support from RTL 1.6 version From: "Brad House" To: X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.11) 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 hAH4Zg25030065 X-archive-position: 1469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad_mssw@gentoo.org Precedence: bulk X-list: netdev The current in-kernel version of the r8169 driver is v1.2 from RealTek. This is a patch against 2.6.0-test9-bk6 and later kernels that updates the driver to 1.6 from RealTek. Just small patches applied to it to port to 2.6 kernel, etc. It works with the 8110S chip found on many motherboards, especially x86_64 mobos. http://dev.gentoo.org/~brad_mssw/kernel_patches/2.6.0/genpatches-0.4/200_r8169-8110S-111203.patch Please CC me on any replies as I am not subscribed to the list. -Brad House brad_mssw@gentoo.org From brad_mssw@gentoo.org Sun Nov 16 21:34:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Nov 2003 21:34:51 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAH5YY25032658 for ; Sun, 16 Nov 2003 21:34:37 -0800 Received: from brainwerkz.net (localhost [127.0.0.1]) by nameserver1.mcve.com (Postfix) with SMTP id 78D4E83C1D for ; Mon, 17 Nov 2003 00:47:29 -0500 (EST) Received: from ip68-105-173-45.ga.at.cox.net ([68.105.173.45]) (SquirrelMail authenticated user brad) by mail.mainstreetsoftworks.com with HTTP; Mon, 17 Nov 2003 00:47:29 -0500 (EST) Message-ID: <48012.68.105.173.45.1069048049.squirrel@mail.mainstreetsoftworks.com> Date: Mon, 17 Nov 2003 00:47:29 -0500 (EST) Subject: forcedeth 0.17 bug + test results From: "Brad House" To: X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.11) 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 hAH5YY25032658 X-archive-position: 1470 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad_mssw@gentoo.org Precedence: bulk X-list: netdev The 0.17 patch had an improper length indicator so the last 2 lines of forcedeth.c were not included, which would cause a big nothing to happen when trying to modprobe the driver. The 2 lines lost were, even though they were in the patch, the length indicator prevented them from being copied into forcedeth.c: +module_init(init_nic); +module_exit(exit_nic); Anyhow, an updated patch that includes those 2 lines against 2.6.0-test9-bk21 is here: http://dev.gentoo.org/~brad_mssw/kernel_patches/2.6.0/genpatches-0.4/300_NVIDIA_forcedeth_v17_gentoo.patch No black magic though, the only thing changed is the length indicator in reality. As for test results, we have a success report on amd64/x86_64 on an nForce3 board in 64bit mode. Transfers on a 100Mbit network using scp are around 5MBytes/s, which is quite impressive (40Mbits/s), even though there are 'proclaimed irq problems'. (150 MB file) Thanks for the great work! Please CC me on any replies as I am not subscribed to this list. -Brad House brad_mssw@gentoo.org From herbert@gondor.apana.org.au Mon Nov 17 01:33:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 01:34:11 -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 hAH9Xn25011869 for ; Mon, 17 Nov 2003 01:33:51 -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 1ALfkE-00072a-00; Mon, 17 Nov 2003 20:32:30 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1ALfk9-0003F5-00; Mon, 17 Nov 2003 20:32:25 +1100 Date: Mon, 17 Nov 2003 20:32:25 +1100 To: "David S. Miller" , Jeff Garzik , netdev@oss.sgi.com Subject: [TG3] Always load TSO firmware Message-ID: <20031117093225.GA12420@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1471 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 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: In 2.5 the TSO firmware is always loaded on capable cards. This does not happen in 2.4. I've received a report from a Broadcom 5705M user that unless the firmware is loaded his card does not work. This patch makes it load the TSO firmware even if the kernel does not support it. The only catch is that the Broadcom driver doesn't always load the firmware either and yet it still works under 2.4 for that user. Despite that this should still be safe as 2.5 always loads the firmware regardless of whether TSO is going to be used or not. It also removes another variable between 2.4/2.5 when chasing down tg3 bugs. 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 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tg3.patch" 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.2 diff -u -r1.2 tg3.c --- kernel-source-2.5/drivers/net/tg3.c 12 Nov 2003 10:50:39 -0000 1.2 +++ kernel-source-2.5/drivers/net/tg3.c 17 Nov 2003 08:30:18 -0000 @@ -3857,8 +3857,6 @@ return 0; } -#if TG3_TSO_SUPPORT != 0 - #define TG3_TSO_FW_RELEASE_MAJOR 0x1 #define TG3_TSO_FW_RELASE_MINOR 0x3 #define TG3_TSO_FW_RELEASE_FIX 0x0 @@ -4445,8 +4443,6 @@ return 0; } -#endif /* TG3_TSO_SUPPORT != 0 */ - /* tp->lock is held. */ static void __tg3_set_mac_addr(struct tg3 *tp) { @@ -4644,7 +4640,6 @@ tw32(BUFMGR_DMA_DESC_POOL_ADDR, NIC_SRAM_DMA_DESC_POOL_BASE); tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE); } -#if TG3_TSO_SUPPORT != 0 else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { int fw_len; @@ -4659,7 +4654,6 @@ tw32(BUFMGR_MB_POOL_SIZE, NIC_SRAM_MBUF_POOL_SIZE5705 - fw_len - 0xa00); } -#endif if (!(tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE)) { tw32(BUFMGR_MB_RDMA_LOW_WATER, @@ -5005,13 +4999,11 @@ return err; } -#if TG3_TSO_SUPPORT != 0 if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { err = tg3_load_tso_firmware(tp); if (err) return err; } -#endif tp->tx_mode = TX_MODE_ENABLE; tw32(MAC_TX_MODE, tp->tx_mode); @@ -7649,7 +7641,6 @@ DEFAULT_MB_HIGH_WATER_5705; } -#if TG3_TSO_SUPPORT != 0 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 || tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 || @@ -7666,8 +7657,6 @@ dev->features |= NETIF_F_TSO; #endif -#endif - if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 && !(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) && !(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) { --HlL+5n6rz5pIUxbD-- From vnuorval@tcs.hut.fi Mon Nov 17 02:11:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 02:12:16 -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 hAHABs25012575 for ; Mon, 17 Nov 2003 02:11:57 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 842C780020D; Mon, 17 Nov 2003 12:11:53 +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 hAHABrsj021256; Mon, 17 Nov 2003 12:11:53 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAHABqqc021252; Mon, 17 Nov 2003 12:11:52 +0200 Date: Mon, 17 Nov 2003 12:11:52 +0200 (EET) From: Ville Nuorvala To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] IPv6: Fix erratic behavior in rt6_dump_route() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1472 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 ===== net/ipv6/route.c 1.60 vs edited ===== Hi Dave! I noticed some erratic behavior when doing "ip -6 r". I traced the problem to rt6_dump_route() where we typecast NLMSG_DATA() to a rtmsg without checking the size of the netlink message first. Seems like ip only passes a rtgenmsg to the kernel when it does a dump, so we end up reading pure garbage when we interpret it as a rtmsg. Please apply the patch! Thanks, Ville --- 1.60/net/ipv6/route.c Tue Nov 11 09:09:55 2003 +++ edited/net/ipv6/route.c Mon Nov 17 11:10:21 2003 @@ -1558,13 +1558,13 @@ static int rt6_dump_route(struct rt6_info *rt, void *p_arg) { struct rt6_rtnl_dump_arg *arg = (struct rt6_rtnl_dump_arg *) p_arg; - struct rtmsg *rtm; int prefix; - rtm = NLMSG_DATA(arg->cb->nlh); - if (rtm) + if (arg->cb->nlh->nlmsg_len >= NLMSG_LENGTH(sizeof(struct rtmsg))) { + struct rtmsg *rtm = NLMSG_DATA(arg->cb->nlh); prefix = (rtm->rtm_flags & RTM_F_PREFIX) != 0; - else prefix = 0; + } else + prefix = 0; return rt6_fill_node(arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE, NETLINK_CB(arg->cb->skb).pid, arg->cb->nlh->nlmsg_seq, -- 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@cyberus.ca Mon Nov 17 06:22:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 06:22:19 -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 hAHEM325025054 for ; Mon, 17 Nov 2003 06:22:04 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALkGP-00072Y-Ij; Mon, 17 Nov 2003 09:22:01 -0500 Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <3FB3996A.6080008@trash.net> References: <3FB3996A.6080008@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069076786.1075.19.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 09:22:01 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1473 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 Did you test some of this stuff or just did a mass-edit? I havent paid attention to all the details, but what would decrementing sch->q.qlen on grafting mean on a dsmark? cheers, jamal On Thu, 2003-11-13 at 09:47, Patrick McHardy wrote: > Hi Dave, > > multiple qdiscs fail to adjust sch->q.qlen after grafting when the > old qdisc is non-empty. This permanently damages the counter. > TBF additionally needs to adjust stats.backlog. > > Best regards, > Patrick > > > > ______________________________________________________________________ > > # 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.1427 -> 1.1428 > # net/sched/sch_tbf.c 1.10 -> 1.11 > # net/sched/sch_cbq.c 1.13 -> 1.14 > # net/sched/sch_dsmark.c 1.10 -> 1.11 > # net/sched/sch_prio.c 1.9 -> 1.10 > # > # The following is the BitKeeper ChangeSet Log > # -------------------------------------------- > # 03/11/12 kaber@trash.net 1.1428 > # Adjust qlen when grafting in multiple qdiscs > # -------------------------------------------- > # > diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c > --- a/net/sched/sch_cbq.c Thu Nov 13 14:57:07 2003 > +++ b/net/sched/sch_cbq.c Thu Nov 13 14:57:07 2003 > @@ -1670,6 +1670,7 @@ > sch_tree_lock(sch); > *old = cl->q; > cl->q = new; > + sch->q.qlen -= (*old)->q.qlen; > qdisc_reset(*old); > sch_tree_unlock(sch); > > diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c > --- a/net/sched/sch_dsmark.c Thu Nov 13 14:57:07 2003 > +++ b/net/sched/sch_dsmark.c Thu Nov 13 14:57:07 2003 > @@ -75,8 +75,10 @@ > new = &noop_qdisc; > sch_tree_lock(sch); > *old = xchg(&p->q,new); > - if (*old) > + if (*old) { > + sch->q.qlen -= (*old)->q.qlen; > qdisc_reset(*old); > + } > sch_tree_unlock(sch); /* @@@ move up ? */ > return 0; > } > diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c > --- a/net/sched/sch_prio.c Thu Nov 13 14:57:07 2003 > +++ b/net/sched/sch_prio.c Thu Nov 13 14:57:07 2003 > @@ -266,6 +266,7 @@ > sch_tree_lock(sch); > *old = q->queues[band]; > q->queues[band] = new; > + sch->q.qlen -= (*old)->q.qlen; > qdisc_reset(*old); > sch_tree_unlock(sch); > > diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c > --- a/net/sched/sch_tbf.c Thu Nov 13 14:57:07 2003 > +++ b/net/sched/sch_tbf.c Thu Nov 13 14:57:07 2003 > @@ -455,6 +455,8 @@ > sch_tree_lock(sch); > *old = xchg(&q->qdisc, new); > qdisc_reset(*old); > + sch->q.qlen = 0; > + sch->stats.backlog = 0; > sch_tree_unlock(sch); > > return 0; From hadi@cyberus.ca Mon Nov 17 06:22:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 06:22:19 -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 hAHEM125025052 for ; Mon, 17 Nov 2003 06:22:04 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALkGN-00071t-TB; Mon, 17 Nov 2003 09:21:59 -0500 Subject: Re: Announce: NetKeeper Firewall For Linux From: jamal Reply-To: hadi@cyberus.ca To: Mikkel Christiansen Cc: Emmanuel Fleury , "David S. Miller" , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: <3FAE9B9B.60007@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> <1068211670.1031.49.camel@jzny.localdomain> <3FAE9B9B.60007@cs.auc.dk> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069076627.1075.15.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 09:21:58 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1474 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 Sun, 2003-11-09 at 14:55, Mikkel Christiansen wrote: > > > 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. Why cant you use the same interface that exists today - the one that is used to load new filter rules? > We believe this is a good thing since it allows > admins to (syntax) check the filter before inserting it. Sure. It will be nice to have something like that in user space. > 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? > Refer to my comment above: I dont think you need anything new. Look at a simple classifier like fwmark and comment if you need something new. > >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. > Please think about that problem - otherwise you get an C in your course work from me ;-> (F would be too harsh ;->) > > > >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 think it is nice to have a feature that does the verification in user space before downloading. I didnt understand what you mean that someone else writes their own "client/compiler". Arent you the one in charge of this compiler? Why would you allow other people to write this compiler? cheers, jamal From kaber@trash.net Mon Nov 17 06:40:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 06:40:49 -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 hAHEeD25025945 for ; Mon, 17 Nov 2003 06:40:34 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALkY3-0008E5-00; Mon, 17 Nov 2003 15:40:15 +0100 Message-ID: <3FB8DDE0.1070105@trash.net> Date: Mon, 17 Nov 2003 15:40:32 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> In-Reply-To: <1069076786.1075.19.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1475 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 Hi Jamal, I've tested tbf and prio changes before and after. Unfortunately I've never used dsmark so I didn't test this part. I did try to make sure my changes make sense, and I still don't see why this wouldn't be correct. dsmark increments sch->q.qlen in enqueue, so it needs to adjust it in dsmark_graft if the old queue is non-empty. If this is wrong, please enlighten me so I can fix my patch. Best regards, Patrick jamal wrote: >Did you test some of this stuff or just did a mass-edit? I havent paid >attention to all the details, but what would decrementing sch->q.qlen on >grafting mean on a dsmark? > >cheers, >jamal > > > From kaber@trash.net Mon Nov 17 06:47:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 06:47:52 -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 hAHEla25026848 for ; Mon, 17 Nov 2003 06:47:39 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALkfE-0008SX-00; Mon, 17 Nov 2003 15:47:40 +0100 Message-ID: <3FB8DF9F.7030509@trash.net> Date: Mon, 17 Nov 2003 15:47:59 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH]: fix queue limits in multiple qdiscs References: <3FB39A2D.5020000@trash.net> <1069076955.1076.23.camel@jzny.localdomain> In-Reply-To: <1069076955.1076.23.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1476 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 I don't have strong feelings about this, I just kept wondering why tc displayes "pfifo limit 10 backlog 11". Best regards, Patrick jamal wrote: >valid but Too cosmetic, IMO; (who cares when you are off by a few >bytes?) > >cheers, >jamal > From hadi@cyberus.ca Mon Nov 17 06:59:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 06:59:30 -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 hAHExF25027809 for ; Mon, 17 Nov 2003 06:59:16 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALkqQ-0003pb-Ah; Mon, 17 Nov 2003 09:59:14 -0500 Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <3FB8DDE0.1070105@trash.net> References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069081153.1022.20.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 09:59:13 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1477 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 Patrick, It doesnt make sense to have more than one queue in Dsmark (used as a place holder/work queue while DSCP remarking). If reset() is already setting the length to 0 then it is not useful to set it to anything else (it may actually become a -ve number). I would suggest you use some of the examples in iproute2/examples/diffserv to test things out (for all your changes - the dsmark change was staring at me in the face - i didnt pay attention to the rest). cheers, jamal On Mon, 2003-11-17 at 09:40, Patrick McHardy wrote: > Hi Jamal, > > I've tested tbf and prio changes before and after. Unfortunately I've > never used dsmark so I didn't test this part. I did try to make sure > my changes make sense, and I still don't see why this wouldn't be > correct. dsmark increments sch->q.qlen in enqueue, so it needs to > adjust it in dsmark_graft if the old queue is non-empty. If this is > wrong, please enlighten me so I can fix my patch. > > Best regards, > Patrick > > > jamal wrote: > > >Did you test some of this stuff or just did a mass-edit? I havent paid > >attention to all the details, but what would decrementing sch->q.qlen on > >grafting mean on a dsmark? > > > >cheers, > >jamal > > > > > > > > > From hadi@cyberus.ca Mon Nov 17 07:01:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 07:01: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 hAHF1P25028198 for ; Mon, 17 Nov 2003 07:01:27 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALksW-00045u-V7; Mon, 17 Nov 2003 10:01:25 -0500 Subject: Re: [PATCH]: fix queue limits in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <3FB8DF9F.7030509@trash.net> References: <3FB39A2D.5020000@trash.net> <1069076955.1076.23.camel@jzny.localdomain> <3FB8DF9F.7030509@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069081284.1024.23.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 10:01:24 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1478 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 Like i said it is valid - but i wouldnt go out of my way to fix it (especially when 2.6 is frozen). cheers, jamal On Mon, 2003-11-17 at 09:47, Patrick McHardy wrote: > I don't have strong feelings about this, I just kept wondering why tc > displayes "pfifo limit 10 backlog 11". > > Best regards, > Patrick > > jamal wrote: > > >valid but Too cosmetic, IMO; (who cares when you are off by a few > >bytes?) > > > >cheers, > >jamal > > > > > From jes@trained-monkey.org Mon Nov 17 07:20:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 07:20:56 -0800 (PST) Received: from jaguar.mkp.net (jaguar.mkp.net [192.139.46.146]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHFKK25029179 for ; Mon, 17 Nov 2003 07:20:41 -0800 Received: from jes by jaguar.mkp.net with local (Exim 3.35 #1) id 1ALlAa-0005ej-00; Mon, 17 Nov 2003 10:20:04 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16312.59172.153904.436145@gargle.gargle.HOWL> Date: Mon, 17 Nov 2003 10:20:04 -0500 To: "David S. Miller" CC: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: [patch] net/core/flow.c X-Mailer: VM 7.03 under Emacs 21.2.1 From: Jes Sorensen X-archive-position: 1479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jes@trained-monkey.org Precedence: bulk X-list: netdev Hi Dave and Alexey, While browsing some of the net dev code I noticed that net/core/flow.c still uses an unsigned long and test_bit/set_bit for it's cpu mask instead of cpumask_t. Patch against 2.6.0-test9 included. Cheers, Jes --- linux-2.6.0-test9/net/core/flow.c~ Sat Oct 25 11:42:49 2003 +++ linux-2.6.0-test9/net/core/flow.c Mon Nov 17 07:27:38 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) @@ -81,7 +81,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 +178,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 +277,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 +301,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 +341,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 acme@conectiva.com.br Mon Nov 17 07:36:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 07:36:38 -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 hAHFaM25030856 for ; Mon, 17 Nov 2003 07:36:23 -0800 Received: from [200.138.50.39] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1ALlSv-0002d3-00; Mon, 17 Nov 2003 13:39:01 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id 258621966D; Mon, 17 Nov 2003 15:38:48 +0000 (UTC) Date: Mon, 17 Nov 2003 13:38:47 -0200 From: Arnaldo Carvalho de Melo To: Jes Sorensen Cc: "David S. Miller" , kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [patch] net/core/flow.c Message-ID: <20031117153847.GB19880@conectiva.com.br> References: <16312.59172.153904.436145@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16312.59172.153904.436145@gargle.gargle.HOWL> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 1480 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 Em Mon, Nov 17, 2003 at 10:20:04AM -0500, Jes Sorensen escreveu: > Hi Dave and Alexey, > > While browsing some of the net dev code I noticed that net/core/flow.c > still uses an unsigned long and test_bit/set_bit for it's cpu mask > instead of cpumask_t. > > Patch against 2.6.0-test9 included. Already in latest linus bk tree, see changeset 1.1414.4.2. - Arnaldo From kaber@trash.net Mon Nov 17 08:13:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 08:14:04 -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 hAHGDn25002081 for ; Mon, 17 Nov 2003 08:13:50 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALm0N-0002mn-00; Mon, 17 Nov 2003 17:13:35 +0100 Message-ID: <3FB8F3BF.6050509@trash.net> Date: Mon, 17 Nov 2003 17:13:51 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> In-Reply-To: <1069081153.1022.20.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1481 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 Hi Jamal, the patch was meant to fix the problem that when replacing (or deleting) a leaf queue that still holds packets the packets are not subtracted from the upper queue's q.qlen. dsmark_reset does set the length to 0 but it is not called when grafting. I've now verified experimentally the problem also exists in dsmark: # tc qdisc add dev eth0 root handle 1: dsmark indices 64 # tc qdisc add dev eth0 parent 1: pfifo limit 100 # netperf -H 192.168.0.1 < queue is holding 38 packets at this moment > # tc qdisc del dev eth0 parent 1: pfifo # tc qdisc add dev eth0 parent 1: pfifo limit 100 # tc -s -d qdisc show dev eth0 qdisc pfifo 800d: limit 100p Sent 296729221 bytes 854680 pkts (dropped 0, overlimits 0) backlog 33p qdisc dsmark 1: indices 0x0040 Sent 510414473 bytes 1489414 pkts (dropped 40, overlimits 0) backlog 71p While it may not be a common operation or not even make sense, it is a valid one and IMHO should be handled correctly. It actually did happen to me while playing with TBF. I missed dsmark only has a single queue so sch->q.qlen = 0 would be ok in dsmark_graft. If you're ok with that, I'm going to change the patch. Best regards, Patrick jamal wrote: >Patrick, > >It doesnt make sense to have more than one queue in Dsmark (used as a >place holder/work queue while DSCP remarking). >If reset() is already setting the length to 0 then it is not useful >to set it to anything else (it may actually become a -ve number). >I would suggest you use some of the examples in >iproute2/examples/diffserv to test things out (for all your changes - >the dsmark change was staring at me in the face - i didnt pay attention >to the rest). > >cheers, >jamal > > From hadi@cyberus.ca Mon Nov 17 09:05:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 09:06:10 -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 hAHH5s25006069 for ; Mon, 17 Nov 2003 09:05:55 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALkGQ-00072f-Sw; Mon, 17 Nov 2003 09:22:02 -0500 Subject: Re: [PATCH]: fix queue limits in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <3FB39A2D.5020000@trash.net> References: <3FB39A2D.5020000@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069076955.1076.23.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 09:22:02 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1482 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 valid but Too cosmetic, IMO; (who cares when you are off by a few bytes?) cheers, jamal On Thu, 2003-11-13 at 09:50, Patrick McHardy wrote: > This patch fixes multiple qdiscs exceeding their limits: > > pfifo/pfifo_fast: by one packet > bfifo/red/gred: by one full-sized packet in bytes > > RED and GRED should never reach their limits so this part is > more cosmetic than fix. > > Best regards, > Patrick > > > ______________________________________________________________________ > > # 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.1431 -> 1.1432 > # net/sched/sch_generic.c 1.9 -> 1.10 > # net/sched/sch_teql.c 1.8 -> 1.9 > # net/sched/sch_fifo.c 1.6 -> 1.7 > # net/sched/sch_gred.c 1.12 -> 1.13 > # net/sched/sch_red.c 1.8 -> 1.9 > # > # The following is the BitKeeper ChangeSet Log > # -------------------------------------------- > # 03/11/12 kaber@trash.net 1.1432 > # Fix queue limits in multiple qdiscs > # -------------------------------------------- > # > diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c > --- a/net/sched/sch_fifo.c Thu Nov 13 15:23:33 2003 > +++ b/net/sched/sch_fifo.c Thu Nov 13 15:23:33 2003 > @@ -47,7 +47,7 @@ > { > struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data; > > - if (sch->stats.backlog <= q->limit) { > + if (sch->stats.backlog + skb->len <= q->limit) { > __skb_queue_tail(&sch->q, skb); > sch->stats.backlog += skb->len; > sch->stats.bytes += skb->len; > @@ -108,7 +108,7 @@ > { > struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data; > > - if (sch->q.qlen <= q->limit) { > + if (sch->q.qlen < q->limit) { > __skb_queue_tail(&sch->q, skb); > sch->stats.bytes += skb->len; > sch->stats.packets++; > diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c > --- a/net/sched/sch_generic.c Thu Nov 13 15:23:33 2003 > +++ b/net/sched/sch_generic.c Thu Nov 13 15:23:33 2003 > @@ -275,7 +275,7 @@ > list = ((struct sk_buff_head*)qdisc->data) + > prio2band[skb->priority&TC_PRIO_MAX]; > > - if (list->qlen <= qdisc->dev->tx_queue_len) { > + if (list->qlen < qdisc->dev->tx_queue_len) { > __skb_queue_tail(list, skb); > qdisc->q.qlen++; > qdisc->stats.bytes += skb->len; > diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c > --- a/net/sched/sch_gred.c Thu Nov 13 15:23:33 2003 > +++ b/net/sched/sch_gred.c Thu Nov 13 15:23:33 2003 > @@ -110,7 +110,7 @@ > unsigned long qave=0; > int i=0; > > - if (!t->initd && skb_queue_len(&sch->q) <= sch->dev->tx_queue_len) { > + if (!t->initd && skb_queue_len(&sch->q) < sch->dev->tx_queue_len) { > D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n"); > goto do_enqueue; > } > @@ -175,7 +175,7 @@ > if ((q->qave+qave) < q->qth_min) { > q->qcount = -1; > enqueue: > - if (q->backlog <= q->limit) { > + if (q->backlog + skb->len <= q->limit) { > q->backlog += skb->len; > do_enqueue: > __skb_queue_tail(&sch->q, skb); > diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c > --- a/net/sched/sch_red.c Thu Nov 13 15:23:33 2003 > +++ b/net/sched/sch_red.c Thu Nov 13 15:23:33 2003 > @@ -257,7 +257,7 @@ > if (q->qave < q->qth_min) { > q->qcount = -1; > enqueue: > - if (sch->stats.backlog <= q->limit) { > + if (sch->stats.backlog + skb->len <= q->limit) { > __skb_queue_tail(&sch->q, skb); > sch->stats.backlog += skb->len; > sch->stats.bytes += skb->len; From brazilnut@us.ibm.com Mon Nov 17 09:16:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 09:16:44 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHHGC25006553 for ; Mon, 17 Nov 2003 09:16:23 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAHHG3n9642564; Mon, 17 Nov 2003 12:16:03 -0500 Received: from dyn318364bld.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 hAHHG1P1211128; Mon, 17 Nov 2003 12:16:01 -0500 Received: (from donf@localhost) by dyn318364bld.beaverton.ibm.com (8.11.6/8.11.6) id hAHH8he01546; Mon, 17 Nov 2003 09:08:43 -0800 From: Don Fry Message-Id: <200311171708.hAHH8he01546@dyn318364bld.beaverton.ibm.com> Subject: Re: forcedeth: version 0.17 available To: c-d.hailfinger.kernel.2003@gmx.net (Carl-Daniel Hailfinger) Date: Mon, 17 Nov 2003 09:08:42 -0800 (PST) Cc: netdev@oss.sgi.com In-Reply-To: <3FB807A3.8010207@gmx.net> from "Carl-Daniel Hailfinger" at Nov 17, 2003 12:26:27 AM 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: 1483 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Carl-Daniel, I just went through a similar oops for another driver last Thursday. Move the register_netdev(dev) after the initialization of 'dev->dev_stats = get_stats;' and the oops should be eliminated. Don > > Hello all, > > version 0.17 of forcedeth for Linux 2.4 and 2.6 is available at > http://www.hailfinger.org/carldani/linux/patches/forcedeth/ > > Fixes in this release over 0.14: > * 0.15: 08 Nov 2003: fix smp deadlock with set_multicast_list > * during open. > * 0.16: 15 Nov 2003: include file cleanup for ppc64, rx buffer > * size increased to 1628 bytes. > * 0.17: 16 Nov 2003: undo rx buffer size increase. Substract 1 > * from the tx length. > > Known issues: > * Oops during module removal, probably sysfs related. Could a > sysfs expert please take a look at the code? Call trace is at > http://www.ussg.iu.edu/hypermail/linux/kernel/0311.1/0213.html > More traces (roughly the same) available on request. > * Some boards give bogus MAC addresses and work only partially. > Same problem happens with nvnet on these boards. > * Transmit for packets close to MTU size was broken, should be > fixed now. > > Please test. > > > Regards, > Carl-Daniel > > > > -- Don Fry brazilnut@us.ibm.com From hadi@cyberus.ca Mon Nov 17 09:30:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 09:30:28 -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 hAHHUE25007073 for ; Mon, 17 Nov 2003 09:30:15 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALnCV-0007rY-U3; Mon, 17 Nov 2003 12:30:12 -0500 Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <3FB8F3BF.6050509@trash.net> References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069090210.1022.64.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 12:30:10 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1484 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 Patrick, What happens if you add another type of qdisc example RED (after you have deleted pfifo? Not that it makes a lot of sense to add anything than a simple FIFO or even makes sense to add a leaf qdisc to begin with). My opinion is that since these interfaces (ex qdisc) exist they exist to be (ab)used. Dsmark happens to work well with the single queue - maybe thats what needs to be documented as opposed to saying it deviates from a purist angle. Lets hear what the author of dsmark says. Werner? cheers, jamal PS: Again please note i didnt pay close attention to your other changes; so test them accordingly. On Mon, 2003-11-17 at 11:13, Patrick McHardy wrote: > Hi Jamal, > > the patch was meant to fix the problem that when replacing (or deleting) > a leaf queue that still holds packets the packets are not subtracted > from the upper queue's q.qlen. dsmark_reset does set the length to 0 but > it is not called when grafting. I've now verified experimentally the > problem also exists in dsmark: > > # tc qdisc add dev eth0 root handle 1: dsmark indices 64 > # tc qdisc add dev eth0 parent 1: pfifo limit 100 > # netperf -H 192.168.0.1 > < queue is holding 38 packets at this moment > > # tc qdisc del dev eth0 parent 1: pfifo > # tc qdisc add dev eth0 parent 1: pfifo limit 100 > # tc -s -d qdisc show dev eth0 > > qdisc pfifo 800d: limit 100p > Sent 296729221 bytes 854680 pkts (dropped 0, overlimits 0) > backlog 33p > > qdisc dsmark 1: indices 0x0040 > Sent 510414473 bytes 1489414 pkts (dropped 40, overlimits 0) > backlog 71p > > While it may not be a common operation or not even make sense, it is a > valid one and IMHO should be handled correctly. It actually did happen > to me while playing with TBF. I missed dsmark only has a single queue > so sch->q.qlen = 0 would be ok in dsmark_graft. If you're ok with that, > I'm going to change the patch. > > Best regards, > Patrick > > > jamal wrote: > > >Patrick, > > > >It doesnt make sense to have more than one queue in Dsmark (used as a > >place holder/work queue while DSCP remarking). > >If reset() is already setting the length to 0 then it is not useful > >to set it to anything else (it may actually become a -ve number). > >I would suggest you use some of the examples in > >iproute2/examples/diffserv to test things out (for all your changes - > >the dsmark change was staring at me in the face - i didnt pay attention > >to the rest). > > > >cheers, > >jamal > > > > > > > From geert@linux-m68k.org Mon Nov 17 09:58:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 09:59:06 -0800 (PST) Received: from witte.sonytel.be (witte.sonytel.be [80.88.33.193]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHHwm25008074 for ; Mon, 17 Nov 2003 09:58:50 -0800 Received: from waterleaf.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id hAHHweQG021622; Mon, 17 Nov 2003 18:58:41 +0100 (MET) Date: Mon, 17 Nov 2003 18:58:41 +0100 (MET) From: Geert Uytterhoeven To: Jeff Garzik cc: netdev@oss.sgi.com, Linux Kernel , Andrew Morton , Al Viro , Linux/m68k Subject: Re: [BK PATCHES] 2.6.x experimental net driver queue In-Reply-To: <3FB81811.9090508@pobox.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: geert@linux-m68k.org Precedence: bulk X-list: netdev On Sun, 16 Nov 2003, Jeff Garzik wrote: > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > Viro. > > No users of init_etherdev remain in the tree. (yay!) Here are some (untested, except for cross-gcc) fixes for the m68k-related drivers: - Space.c: fix incorrect prototypes for atarilance_probe() and mace_probe() - a2065.c: kill superfluous argument of alloc_etherdev() - apne.c: o fix incorrect prototype for apne_probe() o kill unused variable err - mac8390.c: o kill unused variable probed o fix typos ENDOEV -> ENODEV and ERR_PTE -> ERR_PTR o add missing variable slots - macmace.c: use ERR_PTR() where needed - macsonic.c: kill unused variable lp - mvme147.c: o kill conversion warning and kill a cast by making ram unsigned long o add missing variable err Note: The use of `slots' in mac8390.c is not in my tree. Do you know where that change comes from? --- linux-net2-2.6.0-test9.orig/drivers/net/Space.c 2003-11-17 11:41:17.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/Space.c 2003-11-17 18:38:56.000000000 +0100 @@ -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 struct net_device *atarilance_probe(struct net_device *); +extern struct net_device *atarilance_probe(int unit); 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); @@ -86,7 +86,7 @@ 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); +extern struct net_device *mace_probe(int unit); extern struct net_device *macsonic_probe(int unit); extern struct net_device *mac8390_probe(int unit); extern struct net_device *mac89x0_probe(int unit); --- linux-net2-2.6.0-test9.orig/drivers/net/a2065.c 2003-11-17 11:41:17.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/a2065.c 2003-11-17 18:39:24.000000000 +0100 @@ -737,7 +737,7 @@ continue; } - dev = alloc_etherdev(0, sizeof(struct lance_private)); + dev = alloc_etherdev(sizeof(struct lance_private)); if (dev == NULL) { release_resource(r1); --- linux-net2-2.6.0-test9.orig/drivers/net/apne.c 2003-11-17 11:41:17.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/apne.c 2003-11-17 18:38:56.000000000 +0100 @@ -72,7 +72,7 @@ #define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ -int apne_probe(struct net_device *dev); +struct net_device * __init apne_probe(int unit); static int apne_probe1(struct net_device *dev, int ioaddr); static int apne_open(struct net_device *dev); @@ -572,8 +572,6 @@ int init_module(void) { - int err; - apne_dev = apne_probe(-1); if (IS_ERR(apne_dev)) return PTR_ERR(apne_dev); --- linux-net2-2.6.0-test9.orig/drivers/net/mac8390.c 2003-11-17 11:41:20.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/mac8390.c 2003-11-17 18:38:56.000000000 +0100 @@ -228,12 +228,12 @@ volatile unsigned short *i; int version_disp = 0; struct nubus_dev * ndev = NULL; - static int probed; - int err = -ENDOEV; + int err = -ENODEV; struct nubus_dir dir; struct nubus_dirent ent; int offset; + static unsigned int slots; enum mac8390_type cardtype; @@ -379,7 +379,7 @@ dev->priv = NULL; out: free_netdev(dev); - return ERR_PTE(err); + return ERR_PTR(err); } #ifdef MODULE --- linux-net2-2.6.0-test9.orig/drivers/net/macmace.c 2003-11-17 11:41:20.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/macmace.c 2003-11-17 18:38:56.000000000 +0100 @@ -229,7 +229,7 @@ if (checksum != 0xFF) { free_netdev(dev); - return -ENODEV; + return ERR_PTR(-ENODEV); } memset(&mp->stats, 0, sizeof(mp->stats)); --- linux-net2-2.6.0-test9.orig/drivers/net/macsonic.c 2003-11-17 11:41:20.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/macsonic.c 2003-11-17 18:38:56.000000000 +0100 @@ -495,7 +495,6 @@ { static int slots; struct nubus_dev* ndev = NULL; - struct sonic_local* lp; unsigned long base_addr, prom_addr; u16 sonic_dcr; int id; --- linux-net2-2.6.0-test9.orig/drivers/net/mvme147.c 2003-11-17 11:41:20.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/mvme147.c 2003-11-17 18:38:56.000000000 +0100 @@ -41,7 +41,7 @@ struct m147lance_private { struct lance_private lance; void *base; - void *ram; + unsigned long ram; }; /* function prototypes... This is easy because all the grot is in the @@ -68,6 +68,7 @@ struct m147lance_private *lp; u_long *addr; u_long address; + int err; if (!MACH_IS_MVME147 || called) return ERR_PTR(-ENODEV); @@ -112,7 +113,7 @@ dev->dev_addr[5]); lp = (struct m147lance_private *)dev->priv; - lp->ram = (void *)__get_dma_pages(GFP_ATOMIC, 3); /* 16K */ + lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ if (!lp->ram) { printk("%s: No memory for LANCE buffers\n", dev->name); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From fubar@us.ibm.com Mon Nov 17 10:08:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 10:08:51 -0800 (PST) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com [32.97.182.106]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHI8Y25008531 for ; Mon, 17 Nov 2003 10:08:34 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e6.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAHI8SVn586930; Mon, 17 Nov 2003 13:08:28 -0500 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAHI8PKv091476; Mon, 17 Nov 2003 13:08:26 -0500 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id hAHI82H2029955; Mon, 17 Nov 2003 10:08:02 -0800 Message-Id: <200311171808.hAHI82H2029955@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: netdev@oss.sgi.com, jgarzik@pobox.com Subject: [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir Date: Mon, 17 Nov 2003 10:08:02 -0800 From: Jay Vosburgh X-archive-position: 1486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Jeff, can you apply this? It needs to be in for 2.4.23, and has been waiting for a couple of weeks. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com ------- Forwarded Message From: Amir Noam To: jgarzik@pobox.com, davem@redhat.com Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: [Bonding-devel] [PATCH] [bonding 2.4] fix creating/destroying the /proc/net/bonding dir 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); - ------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ Bonding-devel mailing list Bonding-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bonding-devel ------- End of Forwarded Message From kaber@trash.net Mon Nov 17 10:15:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 10:15:53 -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 hAHIFA25009320 for ; Mon, 17 Nov 2003 10:15:31 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALnu5-0004my-00; Mon, 17 Nov 2003 19:15:13 +0100 Message-ID: <3FB9103C.9080504@trash.net> Date: Mon, 17 Nov 2003 19:15:24 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> In-Reply-To: <1069090210.1022.64.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1487 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 jamal wrote: >Patrick, > >What happens if you add another type of qdisc example RED (after you >have deleted pfifo? Not that it makes a lot of sense to add anything >than a simple FIFO or even makes sense to add a leaf qdisc to begin >with). > > Exactly the same. dsmark's counter is damaged the moment I delete the pfifo qdisc holding packets. >My opinion is that since these interfaces (ex qdisc) exist they >exist to be (ab)used. >Dsmark happens to work well with the single queue - maybe thats what >needs to be documented as opposed to saying it deviates from a purist >angle. > > As I said I've never used dsmark, I changed it while fixing TBF (where it is a problem, TBF was changed not long ago to support attaching inner qdiscs), so anything is fine with me. I just became a purist defending correctness of the patch ;) Best regards, Patrick >Lets hear what the author of dsmark says. Werner? > >cheers, >jamal > >PS: Again please note i didnt pay close attention to your other changes; >so test them accordingly. > >On Mon, 2003-11-17 at 11:13, Patrick McHardy wrote: > > >>Hi Jamal, >> >>the patch was meant to fix the problem that when replacing (or deleting) >>a leaf queue that still holds packets the packets are not subtracted >>from the upper queue's q.qlen. dsmark_reset does set the length to 0 but >>it is not called when grafting. I've now verified experimentally the >>problem also exists in dsmark: >> >># tc qdisc add dev eth0 root handle 1: dsmark indices 64 >># tc qdisc add dev eth0 parent 1: pfifo limit 100 >># netperf -H 192.168.0.1 >>< queue is holding 38 packets at this moment > >># tc qdisc del dev eth0 parent 1: pfifo >># tc qdisc add dev eth0 parent 1: pfifo limit 100 >># tc -s -d qdisc show dev eth0 >> >>qdisc pfifo 800d: limit 100p >> Sent 296729221 bytes 854680 pkts (dropped 0, overlimits 0) >> backlog 33p >> >>qdisc dsmark 1: indices 0x0040 >> Sent 510414473 bytes 1489414 pkts (dropped 40, overlimits 0) >> backlog 71p >> >>While it may not be a common operation or not even make sense, it is a >>valid one and IMHO should be handled correctly. It actually did happen >>to me while playing with TBF. I missed dsmark only has a single queue >>so sch->q.qlen = 0 would be ok in dsmark_graft. If you're ok with that, >>I'm going to change the patch. >> >>Best regards, >>Patrick >> >> >>jamal wrote: >> >> >> >>>Patrick, >>> >>>It doesnt make sense to have more than one queue in Dsmark (used as a >>>place holder/work queue while DSCP remarking). >>>If reset() is already setting the length to 0 then it is not useful >>>to set it to anything else (it may actually become a -ve number). >>>I would suggest you use some of the examples in >>>iproute2/examples/diffserv to test things out (for all your changes - >>>the dsmark change was staring at me in the face - i didnt pay attention >>>to the rest). >>> >>>cheers, >>>jamal >>> >>> >>> >>> >> >> >> From werner@almesberger.net Mon Nov 17 11:38:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 11:39:07 -0800 (PST) Received: from host.almesberger.net (almesberger.net [63.105.73.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHJcq25010401 for ; Mon, 17 Nov 2003 11:38:52 -0800 Received: from almesberger.net (vpnwa-home [10.200.0.2]) by host.almesberger.net (8.11.6/8.9.3) with ESMTP id hAHJcgR07865; Mon, 17 Nov 2003 11:38:43 -0800 Received: (from werner@localhost) by almesberger.net (8.11.6/8.11.6) id hAHJcYl17094; Mon, 17 Nov 2003 16:38:34 -0300 Date: Mon, 17 Nov 2003 16:38:34 -0300 From: Werner Almesberger To: jamal Cc: Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs Message-ID: <20031117163834.V1330@almesberger.net> References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1069090210.1022.64.camel@jzny.localdomain>; from hadi@cyberus.ca on Mon, Nov 17, 2003 at 12:30:10PM -0500 X-archive-position: 1488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: werner@almesberger.net Precedence: bulk X-list: netdev jamal wrote: > My opinion is that since these interfaces (ex qdisc) exist they > exist to be (ab)used. Stated in such a general way, that sounds dangerous ;-) > Dsmark happens to work well with the single queue - maybe thats what > needs to be documented as opposed to saying it deviates from a purist > angle. tcio, section 2, towards the end: | Typically, each class ``owns'' one queue, but it is in principle | also possible that several classes share the same queue or even | that a single queue is used by all classes of the respective | queuing discipline. Now, I've of course only documented the status quo, and one could argue whether this actually makes sense. But then, it works well for dsmark, and doesn't seem to break anything else. I'm a bit confused about what the problem is here (or if there is one at all): if dsmark_graft is changed to adjust the statistics (which makes perfect sense to me), I don't see a reason why either subtracting the queue length of the former inner qdisc, or simply setting dsmark's queue lenghth to zero wouldn't work. Patrick, was the experiment "I've now verified experimentally the problem also exists in dsmark" done with or without your "sch->q.qlen -= (*old)->q.qlen;" patch ? This looks just like the behaviour I'd expect your patch to fix, no ? - Werner -- _________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net / /_http://www.almesberger.net/____________________________________________/ From vandrove@vc.cvut.cz Mon Nov 17 11:45:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 11:45:45 -0800 (PST) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHJjB25010780 for ; Mon, 17 Nov 2003 11:45:32 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) with ESMTP id hAHJisOw020584; Mon, 17 Nov 2003 20:44:54 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) id hAHJiqMl020579; Mon, 17 Nov 2003 20:44:52 +0100 Date: Mon, 17 Nov 2003 20:44:52 +0100 From: Petr Vandrovec To: Herbert Xu Cc: James Morris , netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-ID: <20031117194452.GB18448@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031116205146.GA8477@gondor.apana.org.au> User-Agent: Mutt/1.5.4i X-archive-position: 1489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev On Mon, Nov 17, 2003 at 07:51:46AM +1100, Herbert Xu wrote: > On Sun, Nov 16, 2003 at 08:44:38AM -0500, James Morris wrote: > > On Sat, 15 Nov 2003, Herbert Xu wrote: > > > > > In other words, what do I tell confused users who see bad checksums > > > in the tcpdump output over loopback and interfaces capable of > > > hardware checksums? > > > > That this functionality does not belong in the kernel, as it serves no > > real purpose. > > OK, I will quote you on that :) It would be nice if at least kernel did not stomp on skb2->h.raw so ptype callback could cope with situation and report to userspace where to put checksum. I already discussed it here two or so months ago, and only solution I was able to find is that VMware's vmnet have to parse itself network headers to find where to put checksum. Nothing for IPv6 users... Best regards, Petr Vandrovec From davem@pizda.ninka.net Mon Nov 17 12:38:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 12:38: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 hAHKcN25014341 for ; Mon, 17 Nov 2003 12:38:31 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA06056; Mon, 17 Nov 2003 12:30:47 -0800 Date: Mon, 17 Nov 2003 12:30:47 -0800 From: "David S. Miller" To: Petr Vandrovec Cc: herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-Id: <20031117123047.55377d3a.davem@redhat.com> In-Reply-To: <20031117194452.GB18448@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> 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: 1490 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, 17 Nov 2003 20:44:52 +0100 Petr Vandrovec wrote: > It would be nice if at least kernel did not stomp on skb2->h.raw so > ptype callback could cope with situation and report to userspace where > to put checksum. I already discussed it here two or so months ago, and > only solution I was able to find is that VMware's vmnet have to parse > itself network headers to find where to put checksum. Nothing for IPv6 > users... Remind me again why the vmnet driver can't just run skb_checksum() on packets that have CHECKSUM_HW set? From davem@pizda.ninka.net Mon Nov 17 12:46:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 12:47:03 -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 hAHKkY25014734 for ; Mon, 17 Nov 2003 12:46:40 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA06093; Mon, 17 Nov 2003 12:38:36 -0800 Date: Mon, 17 Nov 2003 12:38:36 -0800 From: "David S. Miller" To: Herbert Xu Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [TG3] Always load TSO firmware Message-Id: <20031117123836.2f8e70af.davem@redhat.com> In-Reply-To: <20031117093225.GA12420@gondor.apana.org.au> References: <20031117093225.GA12420@gondor.apana.org.au> 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: 1491 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, 17 Nov 2003 20:32:25 +1100 Herbert Xu wrote: > In 2.5 the TSO firmware is always loaded on capable cards. This > does not happen in 2.4. I've received a report from a Broadcom > 5705M user that unless the firmware is loaded his card does not > work. > > This patch makes it load the TSO firmware even if the kernel > does not support it. > > The only catch is that the Broadcom driver doesn't always load > the firmware either and yet it still works under 2.4 for that user. > > Despite that this should still be safe as 2.5 always loads the > firmware regardless of whether TSO is going to be used or not. > It also removes another variable between 2.4/2.5 when chasing > down tg3 bugs. I'd like to figure out the problem instead of applying this patch. In fact, the behavior is the biggest clue as to what the problem might be. Espcially since in 2.4.x the TSO firmware is not executed at all by the chip, and therefore should have no bearing on it's operation. Whether we load the TSO firmware or not on 5705 determines how big an onboard buffer area we give to the chip for packet data. It may be the case that we are miscalculating these values or not programming them into the chip correctly. This is where you should look for the problem. FWIW all of my 5782 and 5705 PCI boards work perfectly fine with the current 2.4.x driver. From davem@pizda.ninka.net Mon Nov 17 12:48:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 12:48: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 hAHKmT25015074 for ; Mon, 17 Nov 2003 12:48:34 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA06129; Mon, 17 Nov 2003 12:41:04 -0800 Date: Mon, 17 Nov 2003 12:41:04 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: [PATCH] UDP/IPv6 multicasting Message-Id: <20031117124104.570e1c72.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: 1492 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, 14 Nov 2003 16:11:50 -0700 David Stevens wrote: > Below is a patch to fix a problem reported by Brian Buesker. When > binding to > two different multicast addresses on the same UDP port, a copy sent to > either multicast > address is delivered to both. Thanks a lot David, I will review and probably apply this later on today. 2.4.x has identical code in this spot so I'll put the fix there as well and queue it up for 2.4.24-pre1. Thanks again. From davem@pizda.ninka.net Mon Nov 17 12:52:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 12:52: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 hAHKpt25015470 for ; Mon, 17 Nov 2003 12:52:19 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA06162; Mon, 17 Nov 2003 12:43:07 -0800 Date: Mon, 17 Nov 2003 12:43:07 -0800 From: "David S. Miller" To: Ville Nuorvala Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Fix erratic behavior in rt6_dump_route() Message-Id: <20031117124307.660df624.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: 1493 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, 17 Nov 2003 12:11:52 +0200 (EET) Ville Nuorvala wrote: > Hi Dave! > > I noticed some erratic behavior when doing "ip -6 r". I traced the problem > to rt6_dump_route() where we typecast NLMSG_DATA() to a rtmsg without > checking the size of the netlink message first. Seems like ip only passes > a rtgenmsg to the kernel when it does a dump, so we end up reading pure > garbage when we interpret it as a rtmsg. Please apply the patch! Thanks a lot Ville, I will review your patch a bit more and most likely apply it later today. From davem@pizda.ninka.net Mon Nov 17 12:52:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 12:53: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 hAHKqO25015483 for ; Mon, 17 Nov 2003 12:52:47 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA06181; Mon, 17 Nov 2003 12:44:43 -0800 Date: Mon, 17 Nov 2003 12:44:43 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [RFC] moving the test for sockaddr->sa_family up Message-Id: <20031117124443.7590c1d4.davem@redhat.com> In-Reply-To: <20031116190757.GA18416@conectiva.com.br> References: <20031115212034.GA16326@conectiva.com.br> <20031116190757.GA18416@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: 1494 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, 16 Nov 2003 17:07:58 -0200 Arnaldo Carvalho de Melo wrote: > Em Sun, Nov 16, 2003 at 08:56:04AM -0500, James Morris escreveu: > > On Sat, 15 Nov 2003, Arnaldo Carvalho de Melo wrote: > > > > > Does anybody see any problem with this simplification? Not for 2.6.0, of > > > course... > > > > No, looks like a good idea. Might be able to push address length > > verification up there too. > > Not really, look at the ax25 code... :-\ They have to support two address types, > if we want to keep this flexibility we can't check it at the upper layer, > does anybody here knows if we want or if we can ditch that thing in ax25? this: Right, this is the area where you need to be careful, where people need special semantics just like this ax25 case. I'm %100 fine with the original cleanup for 2.6.1 or later. From kaber@trash.net Mon Nov 17 13:10:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 13:10:59 -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 hAHLAN25016423 for ; Mon, 17 Nov 2003 13:10:44 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALqdU-0002iR-00; Mon, 17 Nov 2003 22:10:16 +0100 Message-ID: <3FB93947.2090804@trash.net> Date: Mon, 17 Nov 2003 22:10:31 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: Werner Almesberger CC: jamal , "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> <20031117163834.V1330@almesberger.net> In-Reply-To: <20031117163834.V1330@almesberger.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1495 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 Werner Almesberger wrote: >Patrick, was the experiment "I've now verified experimentally the >problem also exists in dsmark" done with or without your >"sch->q.qlen -= (*old)->q.qlen;" patch ? This looks just like the >behaviour I'd expect your patch to fix, no ? > > Correct, it was done without the patch and the patch is supposed to fix it. I'm going to send a new version which just sets q.qlen to 0 later. Best regards, Patrick >- Werner > > > From greearb@candelatech.com Mon Nov 17 13:52:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 13:52:38 -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 hAHLqN25017461 for ; Mon, 17 Nov 2003 13:52:24 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAHLqHeO009112 for ; Mon, 17 Nov 2003 13:52:18 -0800 Message-ID: <3FB94311.10004@candelatech.com> Date: Mon, 17 Nov 2003 13:52:17 -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: RFC: Enabling ethernet drivers to return FCS in the skb? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1496 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 Ethereal now has the ability to decode (and check) the FCS for ethernet frames (assuming it understands the protocol so it can determine that the last 4 bytes are FCS). Is there any interest in adding an Ethtool command to tell the driver to push the extra 4 bytes of CSUM into the skb? When enabling this feature, I'd also like to allow drivers to receive frames with bad FCS as well. This could be a separate flag if desired, but if only good FCS will ever be passed up the stack, then having it in the skb does not really add new information. At least some hardware appears to support receiving bad FCS frames (e1000, evidently), but I am not sure how wide-spread this feature is... Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From casellas@infres.enst.fr Mon Nov 17 15:58:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 15:58:34 -0800 (PST) Received: from infres.enst.fr (infres.enst.fr [137.194.192.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAHNwJ25019471 for ; Mon, 17 Nov 2003 15:58:20 -0800 Received: from gervaise.enst.fr (gervaise.enst.fr [137.194.160.71]) by infres.enst.fr (Postfix) with ESMTP id BBDA618F3; Tue, 18 Nov 2003 00:58:16 +0100 (MET) Received: from localhost (casellas@localhost) by gervaise.enst.fr (8.11.6+Sun/8.11.6) with ESMTP id hAHNwGc18854; Tue, 18 Nov 2003 00:58:16 +0100 (MET) X-Authentication-Warning: gervaise.enst.fr: casellas owned process doing -bs Date: Tue, 18 Nov 2003 00:58:16 +0100 (MET) From: Ramon Casellas X-X-Sender: casellas@gervaise.enst.fr To: mpls-linux-general@sf.net, Cc: netdev@oss.sgi.com Subject: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1497 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: casellas@infres.enst.fr Precedence: bulk X-list: netdev Hi all, After having spend some time using mpls-linux in the framework of some student projects that I manage (in order to evaluate the performance of protocols and algorithms like CSPF or MPLS load sharing), I have decided to work on the project, and the first thing I wanted to do is to port the kernel patch to 2.6 (I am only interested by now in the forwarding plane, and not in userspace apps and signaling protocols like MP-iBG/Zebra/RSVP-TE, etc.), focusing on cleaning up the current implementation, and documenting along the way :) Remark: I have been working with the latest official release mpls 1.1. (1.172). Of course there is a lot to be done, but, as per Mantainers' : " Try to release a few ALPHA test versions to the net. Announce them onto the kernel channel and await results" Please, bear with me. I have spent only four days looking and changing the code :)) and I'm relatively new to linux kernel development. Objectives: ----------------- * Document. Write something like a developer's guide, documenting the whole MPLS subsystem, with short references to the Linux kernel networking core API (e.g. void dev_add_pack(struct packet_type *pt)). Describe not only each function and its arguments, but be more pedagogic (the lack of documentation of the existing implementation is an entry barrier). Explain the subsystem parts and draw execution paths/flows, etc. Most students are *afraid* of digging in kernel code. The ultimate goal is to have a platform with quagga (OSPF-TE/MP-iBGP) and the corresponding signaling protocols (RSVP-TE, CR-LDP,LMP), with advanced MPLS-TE features, like re-routing and protection switching, bu before that I'd like to work in order to make the linux-kernel implementation rock solid. Some docs have been done: http://perso.enst.fr/~casellas/mpls-linux/index.html More to come :) * Analysis of the existing implementation: can it be simplified? * Synchronize. Is anyone working on this? Let us not reinvent the wheel :) citing Dave Miller (should-fix). "Real serious use of IPSEC is hampered by lack of MPLS support. MPLS is a switching technology that works by switching based upon fixed length labels prepended to packets. Many people use this and IPSEC to implement VPNs over public networks, it is also used for things like traffic engineering. Anyways, an existing (crappy) implementation exists. I've almost completed a rewrite, I should have something in the tree next week." I'd like to know what comments does Mr. Miller have, and of course, if he is working on something similar. What does he consider crappy (the MII/MOI Radix Trees , the Opcode and instructions, code quality, lack of comments/documentation / etc???) * When porting the existing 2.4 implementation try to be as little intrusive as possible. We should make an effort not to modify the core parts of the system. Some things that we should think about: - Adding a new data field to net_device: it has been done in 2.4 (void* mpls_ptr) just like other subsystems. Maybe we can find a way by using only private data. - Forwarding Information Base / Routing Tables, etc. Again, the 2.4 version patches some core parts like include/net/ip.h, ip_fib and similar, adding new data fields to core structs. Fortunately some chunks are no longer needed, since they have been added to the mainstream kernel (e.g. ETH_P_MPLS_UC). Unfortunately, I'm not very aware of 2.6 changes (yet) and some chunks do not apply cleanly, e.g: --- linux-kernel/include/net/ip.h Sat Aug 24 00:22:09 2002 +++ mpls-kernel-fixes/include/net/ip.h Wed Nov 13 19:38:10 2002 @@ -162,9 +162,9 @@ static inline int ip_send(struct sk_buff *skb) - Side effects. chunks like --- linux-kernel/net/core/neighbour.c Sat Aug 24 00:22:26 2002 +++ mpls-kernel-fixes/net/core/neighbour.c Tue Nov 12 20:00:46 2002 @@ -952,7 +952,7 @@ if (dev->hard_header_cache && dst->hh == NULL) { write_lock_bh(&neigh->lock); if (dst->hh == NULL) - neigh_hh_init(neigh, dst, dst->ops->protocol); + neigh_hh_init(neigh, dst, skb->protocol); May have some serious side effects to other networking subsystems. In the following, I'd like to discuss and find a consensus. What has been done ------------------------ * I took the 2.4 1.127 patch and cleaned it up, formatted the code, and added comments in the parts that I did understand (and of course, introducing some new obscure and difficult to debug bugs in the way). * Ported the code to 2.6.0-bk22, latest version as of today. * The patch is *alpha* quality. In fact, it compiles, but kernel oopses on boot. I still don't know if it's my fault (definitely the most probable option) or because I just took the bk22 version in order to have the latest patches to the net subsystem. * THE PATCH REQUIRES intensive "peer review", I have made some arbitrary changes in the places that the 2.6.0 has changed with regard to 2.4 (for example, 2.6 has no "key" in the rtable struct). dst_entrys and so on... (James I would really appreciate it if you could take the time to review it) The actual patch is at: http://perso.enst.fr/~casellas/mpls-linux/linux-2.6.0-test9-bk22-mpls.diff Known issues and ToDOs ----------------------- * The current (2.4. 1.172) has been implemented as "built-in", and lacks all the "exit" functions. The MPLS subsystem MUST be modular, at least, with mpls.ko and mpls_tunnel.ko. Care must be taken in order to leave the kernel "clean" on module removal. * Some parts (updtaing statistics or mpls_input) could be implemented as BH (work queues or whatever). * The actual procfs implementation (cf. mpls_proc) should be moved to sysfs. * The Radix tree approach is cumbersome, I should review some of James' design decisions. The semantics of mpls_label, mpls_push_data mpls_key's are a little confusing. There is no exact "label entry" as described in the RFC. * The mpls_instruction{build, copy, offer, scratch,...} is complicated. There are some 200-line functions that should be split. * Some "key" variables are declared "unsigned int", which may break in other archs. Should use u_int32_t where appropriate. * Audit the code for SMP. * Some parts are not clear to me: - why do we copy structs around (e.g. in mpls_set_in_label_instructions)? memcpy(&mir,in,sizeof(struct mpls_instruction_req)); - What's the difference between mpls_del_in_label and __mpls_del_in_label? When do we call __mpls_del_in_label? - Why mpls_instruction_copy copies only the addresses and does not increase the refcount of data? (pointer aliasing) - struct net_device* mpls_tunnel_get_by_name (const char* name), it just iterates the list of netdevs, and returns a pointer,but it breaks the semantics of get/put. why there is no reference counting here? - A lot of code is just there to check if the arguments are NULL or not. Maybe we should fix the callers, and put some temporary BUG_ON(NULL == dev). For most functions, having NULL as an argument is not a valid option. * Some parts are still a little obscure, like copying around struct mpls_label just to obtain a key. * Rough corners :) if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.0-test9-bk22-mpls; fi WARNING: /lib/modules/2.6.0-test9-bk22-mpls/kernel/net/ipv4/netfilter/ipt_MPLS.ko needs unknown symbol mpls_output WARNING: /lib/modules/2.6.0-test9-bk22-mpls/kernel/net/ipv4/netfilter/ipt_MPLS.ko needs unknown symbol mpls_set_nexthop Of course, your comments are most welcome, and I plan to keep on working on it. Do not hesitate to contact me if you want me to keep you posted. Regards, Ramon // ------------------------------------------------------------------- // Ramon Casellas - GET/ENST/INFRES/RHD/A508 - casellas@infres.enst.fr // 37/39 rue Dareau 75014 Paris -- http://perso.enst.fr/~casellas From kaber@trash.net Mon Nov 17 16:34:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 16:34:58 -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 hAI0Yg25023143 for ; Mon, 17 Nov 2003 16:34:43 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1ALtpK-0000nQ-00; Tue, 18 Nov 2003 01:34:42 +0100 Message-ID: <3FB96930.9020300@trash.net> Date: Tue, 18 Nov 2003 01:34:56 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: jamal , netdev@oss.sgi.com Subject: [UPDATED PATCH]: Adjust qlen when grafting in multiple qdiscs References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> <20031117163834.V1330@almesberger.net> In-Reply-To: <20031117163834.V1330@almesberger.net> Content-Type: multipart/mixed; boundary="------------010300040207020401010302" X-archive-position: 1498 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. --------------010300040207020401010302 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Dave, this patch fixes multiple qdiscs to adjust sch->q.qlen when replacing a non-empty inner qdisc. The only change to the first patch is in dsmark_graft: this patch directly sets sch->q.qlen to 0 instead of subtracting the length of the inner qdisc. Best regards, Patrick --------------010300040207020401010302 Content-Type: text/plain; name="graft-adjust-qlen.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="graft-adjust-qlen.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.1441 -> 1.1442 # net/sched/sch_tbf.c 1.10 -> 1.11 # net/sched/sch_cbq.c 1.13 -> 1.14 # net/sched/sch_dsmark.c 1.10 -> 1.11 # net/sched/sch_prio.c 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/18 kaber@trash.net 1.1442 # Adjust qlen when grafting in multiple qdiscs # -------------------------------------------- # diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c Tue Nov 18 01:18:14 2003 +++ b/net/sched/sch_cbq.c Tue Nov 18 01:18:14 2003 @@ -1670,6 +1670,7 @@ sch_tree_lock(sch); *old = cl->q; cl->q = new; + sch->q.qlen -= (*old)->q.qlen; qdisc_reset(*old); sch_tree_unlock(sch); diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c --- a/net/sched/sch_dsmark.c Tue Nov 18 01:18:14 2003 +++ b/net/sched/sch_dsmark.c Tue Nov 18 01:18:14 2003 @@ -77,6 +77,7 @@ *old = xchg(&p->q,new); if (*old) qdisc_reset(*old); + sch->q.qlen = 0; sch_tree_unlock(sch); /* @@@ move up ? */ return 0; } diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c --- a/net/sched/sch_prio.c Tue Nov 18 01:18:14 2003 +++ b/net/sched/sch_prio.c Tue Nov 18 01:18:14 2003 @@ -266,6 +266,7 @@ sch_tree_lock(sch); *old = q->queues[band]; q->queues[band] = new; + sch->q.qlen -= (*old)->q.qlen; qdisc_reset(*old); sch_tree_unlock(sch); diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c Tue Nov 18 01:18:14 2003 +++ b/net/sched/sch_tbf.c Tue Nov 18 01:18:14 2003 @@ -455,6 +455,8 @@ sch_tree_lock(sch); *old = xchg(&q->qdisc, new); qdisc_reset(*old); + sch->q.qlen = 0; + sch->stats.backlog = 0; sch_tree_unlock(sch); return 0; --------------010300040207020401010302-- From shemminger@osdl.org Mon Nov 17 16:48:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 16:48:47 -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 hAI0mY25023721 for ; Mon, 17 Nov 2003 16:48:34 -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 hAI0lSC13993; Mon, 17 Nov 2003 16:47:29 -0800 Date: Mon, 17 Nov 2003 16:47:57 -0800 From: Stephen Hemminger To: Mike_Phillips@URSCorp.com Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] ibmtr -- convert to new probeing Message-Id: <20031117164757.7a6ec07e.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: 1499 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 way ibmtr_cs.c #include's ibmtr.c is gross, but adding a few more #ifdef's should fix it again. This applies on top of earlier patch. It also cleans up some more things that should be defined as static. diff -Nru a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c --- a/drivers/net/pcmcia/ibmtr_cs.c Mon Nov 17 14:02:43 2003 +++ b/drivers/net/pcmcia/ibmtr_cs.c Mon Nov 17 14:02:43 2003 @@ -125,10 +125,6 @@ static dev_link_t *dev_list; -extern int ibmtr_probe(struct net_device *dev); -extern int trdev_init(struct net_device *dev); -extern irqreturn_t tok_interrupt (int irq, void *dev_id, struct pt_regs *regs); - /*====================================================================*/ typedef struct ibmtr_dev_t { diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c --- a/drivers/net/tokenring/ibmtr.c Mon Nov 17 14:02:43 2003 +++ b/drivers/net/tokenring/ibmtr.c Mon Nov 17 14:02:43 2003 @@ -152,7 +152,7 @@ /* this allows displaying full adapter information */ -char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; +static const char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; static char pcchannelid[] __devinitdata = { 0x05, 0x00, 0x04, 0x09, @@ -172,7 +172,7 @@ 0x03, 0x08, 0x02, 0x00 }; -char __devinit *adapter_def(char type) +static const char __devinit *adapter_def(char type) { switch (type) { case 0xF: return "PC Adapter | PC Adapter II | Adapter/A"; @@ -187,7 +187,6 @@ #define TRC_INITV 0x02 /* verbose init trace points */ unsigned char ibmtr_debug_trace = 0; -int ibmtr_probe(struct net_device *dev); static int ibmtr_probe1(struct net_device *dev, int ioaddr); static unsigned char get_sram_size(struct tok_info *adapt_info); static int trdev_init(struct net_device *dev); @@ -198,7 +197,7 @@ static void tok_set_multicast_list(struct net_device *dev); static int tok_send_packet(struct sk_buff *skb, struct net_device *dev); static int tok_close(struct net_device *dev); -irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void initial_tok_int(struct net_device *dev); static void tr_tx(struct net_device *dev); static void tr_rx(struct net_device *dev); @@ -207,6 +206,7 @@ static void ibmtr_readlog(struct net_device *dev); static struct net_device_stats *tok_get_stats(struct net_device *dev); static int ibmtr_change_mtu(struct net_device *dev, int mtu); +#ifndef PCMCIA static void find_turbo_adapters(int *iolist); static int ibmtr_portlist[IBMTR_MAX_ADAPTERS+1] __devinitdata = { @@ -216,7 +216,6 @@ static int __devinitdata turbo_irq[IBMTR_MAX_ADAPTERS] = {0}; static int __devinitdata turbo_searched = 0; -#ifndef PCMCIA static __u32 ibmtr_mem_base __initdata = 0xd0000; #endif @@ -240,6 +239,7 @@ * going away. */ +#ifndef PCMCIA static void __devinit find_turbo_adapters(int *iolist) { int ram_addr; int index=0; @@ -312,6 +312,7 @@ } } } +#endif /**************************************************************************** * ibmtr_probe(): Routine specified in the network device structure @@ -325,24 +326,28 @@ * which references it. ****************************************************************************/ -int __devinit ibmtr_probe(struct net_device *dev) +static int __devinit ibmtr_probe(struct net_device *dev) { - int i; int base_addr = dev->base_addr; +#ifndef PCMCIA + int i; +#endif if (base_addr && base_addr <= 0x1ff) /* Don't probe at all. */ return -ENXIO; if (base_addr > 0x1ff) /* Check a single specified location. */ return ibmtr_probe1(dev, base_addr); +#ifndef PCMCIA find_turbo_adapters(ibmtr_portlist); for (i = 0; ibmtr_portlist[i]; i++) { if (!ibmtr_probe1(dev, ibmtr_portlist[i])) return 0; } +#endif return -ENODEV; } -#ifndef MODULE +#if !defined(MODULE) && !defined(PCMCIA) /* * Called from Space.c to probe for token ring devices at boot * time. @@ -388,13 +393,14 @@ #endif int err = -ENODEV; - /*?? Now, allocate some of the PIO PORTs for this driver.. */ +#ifndef PCMCIA /* record PIOaddr range as busy */ if (!request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr")) { DPRINTK("Could not grab PIO range. Halting driver.\n"); err = -EBUSY; goto out1; } +#endif /* Query the adapter PIO base port which will return * indication of where MMIO was placed. We also have a @@ -787,8 +793,10 @@ iounmap(t_mmio); #endif out2: +#ifndef PCMCIA release_region(PIOaddr, IBMTR_IO_EXTENT); out1: +#endif return err; } /*ibmtr_probe1() */ @@ -1164,7 +1172,7 @@ /******************************************************************************/ -irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char status; /* unsigned char status_even ; */ From hadi@cyberus.ca Mon Nov 17 18:12:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 18:12:35 -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 hAI2CK25025090 for ; Mon, 17 Nov 2003 18:12:21 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ALoze-0006A5-Ha; Mon, 17 Nov 2003 14:25:02 -0500 Subject: Re: [PATCH]: Adjust qlen when grafting in multiple qdiscs From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <3FB9103C.9080504@trash.net> References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> <3FB9103C.9080504@trash.net> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069097101.1022.117.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 14:25:01 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1500 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 Mon, 2003-11-17 at 13:15, Patrick McHardy wrote: > >My opinion is that since these interfaces (ex qdisc) exist they > >exist to be (ab)used. > >Dsmark happens to work well with the single queue - maybe thats what > >needs to be documented as opposed to saying it deviates from a purist > >angle. > > > > > As I said I've never used dsmark, I changed it while fixing TBF (where > it is a problem, TBF was changed not long ago to support attaching inner > qdiscs), so anything is fine with me. I just became a purist defending > correctness of the patch ;) Now that we have invoked Werner - lets wait for his response then ;-> Sorry, didnt meant to drag this into 5-6 emails thread. I closely looked at your other changes on that patch and they looked fine. cheers, jamal From davem@pizda.ninka.net Mon Nov 17 18:59:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 18:59: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 hAI2xJ25025765 for ; Mon, 17 Nov 2003 18:59:26 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA07062; Mon, 17 Nov 2003 18:50:50 -0800 Date: Mon, 17 Nov 2003 18:50:50 -0800 From: "David S. Miller" To: Ville Nuorvala Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Fix erratic behavior in rt6_dump_route() Message-Id: <20031117185050.1cd10877.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: 1501 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, 17 Nov 2003 12:11:52 +0200 (EET) Ville Nuorvala wrote: > I noticed some erratic behavior when doing "ip -6 r". I traced the problem > to rt6_dump_route() where we typecast NLMSG_DATA() to a rtmsg without > checking the size of the netlink message first. Seems like ip only passes > a rtgenmsg to the kernel when it does a dump, so we end up reading pure > garbage when we interpret it as a rtmsg. Please apply the patch! Let's discuss this a little bit. :) I believed that these lengths are supposed to be verified at one level higher, in net/core/rtnetlink.c, see "rtm_min[]". Well, it doesn't do this length verification on dumps. I can only assume this is intentional. Ok, I see, cases like ipv4 check the length properly so it is clear that this is required. I will apply your patch. From c-d.hailfinger.kernel.2003@gmx.net Mon Nov 17 19:04:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 19:04:21 -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 hAI34625026153 for ; Mon, 17 Nov 2003 19:04:07 -0800 Received: (qmail 12790 invoked by uid 65534); 18 Nov 2003 03:04:00 -0000 Received: from stud212188.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.188) by mail.gmx.net (mp016) with SMTP; 18 Nov 2003 04:04:00 +0100 X-Authenticated: #15936885 Message-ID: <3FB98C18.8090305@gmx.net> Date: Tue, 18 Nov 2003 04:03:52 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: de, en MIME-Version: 1.0 To: Linux Kernel Mailing List CC: netdev@oss.sgi.com, Brad House Subject: Re: forcedeth: version 0.17 available References: <3FB807A3.8010207@gmx.net> In-Reply-To: <3FB807A3.8010207@gmx.net> X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2003@gmx.net Precedence: bulk X-list: netdev Carl-Daniel Hailfinger wrote: > > version 0.17 of forcedeth for Linux 2.4 and 2.6 is available at > http://www.hailfinger.org/carldani/linux/patches/forcedeth/ The patches for Linux 2.4 were malformed. Corrected versions have been uploaded a few hours ago. Thanks to Brad House for spotting this. Regards, Carl-Daniel From alexzapatka@hotmail.com Mon Nov 17 20:07:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 20:07:36 -0800 (PST) Received: from hotmail.com (bay2-f101.bay2.hotmail.com [65.54.247.101]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAI47K25027070 for ; Mon, 17 Nov 2003 20:07:20 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 17 Nov 2003 20:07:15 -0800 Received: from 12.64.146.94 by by2fd.bay2.hotmail.msn.com with HTTP; Tue, 18 Nov 2003 04:07:15 GMT X-Originating-IP: [12.64.146.94] X-Originating-Email: [alexzapatka@hotmail.com] From: "Alexander Zapatka" To: netdev@oss.sgi.com Subject: suggested forcedeth updates.... Date: Mon, 17 Nov 2003 23:07:15 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 18 Nov 2003 04:07:15.0521 (UTC) FILETIME=[736DDB10:01C3AD89] X-archive-position: 1503 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alexzapatka@hotmail.com Precedence: bulk X-list: netdev first let me say that forcedeth is a great project!!! i have been using it since you have released it and it is awesome.... but about the debuging thing having to change 1 to 0 and recompile is not always the easiest thing... so what i did was change the code to look like this: static int debug = 0; MODULE_PARM(debug,"i"); #if debug #define dprintk printk #else #define dprintk(x...) do { } while (0) #endif that way you can modprobe/insmod with debug=1 and debuging works... or you can just load it, or load it with debug=0 and no debuging info is printed. just thought it might be a nice addition. -o) /\\ Message void if penguin violated _\_V Don't mess with the penguin _________________________________________________________________ Send a QuickGreet with MSN Messenger http://www.msnmessenger-download.com/tracking/cdp_games From brad@mcve.com Mon Nov 17 20:39:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 20:39:12 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAI4cx25030414 for ; Mon, 17 Nov 2003 20:38:59 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 1FD6483C15; Mon, 17 Nov 2003 23:51:58 -0500 (EST) Message-ID: <3FB9A261.7080500@mcve.com> Date: Mon, 17 Nov 2003 23:38:57 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Carl-Daniel Hailfinger Cc: Linux Kernel Mailing List , netdev@oss.sgi.com, Brad House Subject: Re: forcedeth: version 0.17 available References: <3FB807A3.8010207@gmx.net> <3FB98C18.8090305@gmx.net> In-Reply-To: <3FB98C18.8090305@gmx.net> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Well, the problem I saw was with the 2.6 patch. These lines: +++ build-2.6/drivers/net/forcedeth.c 2003-11-15 23:00:30.000000000 +0100 @@ -0,0 +1,1416 @@ Should be +++ build-2.6/drivers/net/forcedeth.c 2003-11-15 23:00:30.000000000 +0100 @@ -0,0 +1,1418 @@ Otherwise, the last 2 lines: +module_init(init_nic); +module_exit(exit_nic); Get cut off. -Brad Carl-Daniel Hailfinger wrote: > Carl-Daniel Hailfinger wrote: > >>version 0.17 of forcedeth for Linux 2.4 and 2.6 is available at >>http://www.hailfinger.org/carldani/linux/patches/forcedeth/ > > > The patches for Linux 2.4 were malformed. Corrected versions have been > uploaded a few hours ago. > Thanks to Brad House for spotting this. > > > Regards, > Carl-Daniel > > From jgarzik@pobox.com Mon Nov 17 20:39:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 20:40:01 -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 hAI4dl25030536 for ; Mon, 17 Nov 2003 20:39:47 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:46343 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ALxeS-0008Uw-VD; Tue, 18 Nov 2003 04:39:45 +0000 Message-ID: <3FB9A277.70309@pobox.com> Date: Mon, 17 Nov 2003 23:39:19 -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: Brad House CC: netdev@oss.sgi.com Subject: r8169 and tg3 References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> In-Reply-To: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1505 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 Brad House wrote: > The current in-kernel version of the r8169 driver is v1.2 > from RealTek. This is a patch against 2.6.0-test9-bk6 > and later kernels that updates the driver to 1.6 from RealTek. > Just small patches applied to it to port to 2.6 kernel, etc. > It works with the 8110S chip found on many motherboards, > especially x86_64 mobos. A bit of history... SiS sent me a driver for their gigabit chip, SIS190 (sis190.c). Full of PCI DMA bugs, alignment problems, and fun like that. After taking flak for merging it :) I fixed all those bugs. Fast forward a bit, I find out that sis190.c was copied from r8169.c, and modified a bit to work with SiS chips. I look at r8169.c, and find all those same bugs -- and the RealTek updates don't address any of that. So, what needs to happen is somebody needs to look at the sis190 changes that went in, and apply those same fixes to r8169. Two tangents, while I have your attention: 1) If you have problems with the tg3 driver, we need to get those bug reports and fix them. bcm5700 is not going to be merged into the kernel. Further, there was at least one serious x86-64 issue that was fixed in tg3, and we need to make sure users are testing that driver, not a non-standard driver with bugs of its own. 2) Please CC me on all net driver patches, since I am the dude that actually puts those patches into the kernel. Thanks, Jeff From brad@mcve.com Mon Nov 17 20:51:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 20:51:57 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAI4pg25031215 for ; Mon, 17 Nov 2003 20:51:43 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id F268E83C15; Tue, 18 Nov 2003 00:04:41 -0500 (EST) Message-ID: <3FB9A55C.5090901@mcve.com> Date: Mon, 17 Nov 2003 23:51:40 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik Cc: Brad House , netdev@oss.sgi.com Subject: Re: r8169 and tg3 References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> In-Reply-To: <3FB9A277.70309@pobox.com> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1506 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Commenting below: > > So, what needs to happen is somebody needs to look at the sis190 changes > that went in, and apply those same fixes to r8169. Ok, cool. Didn't realize that, if you have a couple of references to those discussions or patches, that would be awesome (so I don't have to try to dig them up), otherwise, I'll research it some. I was also going to look into merging the big endian patches I saw posted earlier this month. > 1) If you have problems with the tg3 driver, we need to get those bug > reports and fix them. bcm5700 is not going to be merged into the > kernel. Further, there was at least one serious x86-64 issue that was > fixed in tg3, and we need to make sure users are testing that driver, > not a non-standard driver with bugs of its own. Ok, sounds like a plan. I'll get some testing on the latest tg3 driver then, have those been merged into 2.6.0-test9-bk21, or is there another patch I need to apply to my local tree (and in turn will be applied to Gentoo's tree)? > > 2) Please CC me on all net driver patches, since I am the dude that > actually puts those patches into the kernel. Cool, no problem. I just took over the amd64 port for Gentoo a couple months back, so I'm having to get into some stuff I haven't had to do before. But I'm starting to learn some of the kernel internals/driver infrastructure, so hopefully I'll be of some actual help in the near future, assuming my actual job doesn't get in the way ;) -Brad From casellas@infres.enst.fr Mon Nov 17 23:48:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Nov 2003 23:48:52 -0800 (PST) Received: from infres.enst.fr (infres.enst.fr [137.194.192.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAI7ma25002294 for ; Mon, 17 Nov 2003 23:48:37 -0800 Received: from gervaise.enst.fr (gervaise.enst.fr [137.194.160.71]) by infres.enst.fr (Postfix) with ESMTP id 0CCC1193A; Tue, 18 Nov 2003 08:48:35 +0100 (MET) Received: from localhost (casellas@localhost) by gervaise.enst.fr (8.11.6+Sun/8.11.6) with ESMTP id hAI7mYp21077; Tue, 18 Nov 2003 08:48:34 +0100 (MET) X-Authentication-Warning: gervaise.enst.fr: casellas owned process doing -bs Date: Tue, 18 Nov 2003 08:48:33 +0100 (MET) From: Ramon Casellas X-X-Sender: casellas@gervaise.enst.fr To: jamal Cc: mpls-linux-general@sf.net, "David S. Miller" , Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. In-Reply-To: <1069125993.1056.39.camel@jzny.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1507 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: casellas@infres.enst.fr Precedence: bulk X-list: netdev On 17 Nov 2003, jamal wrote: > code once it is deemed working. If you want to be on the list as well, > let me know. I am sure you as will James will both have valuable input. Hi Jamal, I would appreciate it, thanks. On the other hand, if you both agree, I would like to take a look at the new code, even if it does not even compile (and your userspace parts) to start documenting. Best regards, R. From drepper@redhat.com Tue Nov 18 01:01:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 01:01:22 -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 hAI90w25006429 for ; Tue, 18 Nov 2003 01:01:03 -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 hAI8xw4x023710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Nov 2003 01:00:03 -0800 Message-ID: <3FB9DF8E.7020509@redhat.com> Date: Tue, 18 Nov 2003 00:59:58 -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: kuznet@ms2.inr.ac.ru CC: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: RFC 3484 support References: <200311142345.CAA03631@yakov.inr.ac.ru> In-Reply-To: <200311142345.CAA03631@yakov.inr.ac.ru> 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 hAI8xw4x023710 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAI90w25006429 X-archive-position: 1508 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 kuznet@ms2.inr.ac.ru wrote: > Datagram connect() is exactly selection of the addresses, nothing more. I've now implemented a userlevel-only version of the destination address selection algorithm in glibc's getaddrinfo. The cost is 4 additional system calls per returned address plus potentially more (see below). The code has also limitation I don't think a userlevel implementation can overcome: ~ rules 3, 4, and 7 are not implemented. This info is, afaik, only available inside the kernel (if at all) ~ the source address selection also needs the label and precedence information. Therefore the kernel would have to share this information. ~ to read the label/preference data more syscalls are needed. And there is the question when to read that info. Once per program run? What about changes to the policies and programs which run for a long time? I'm OK with having this code I wrote as a backup solution. But I still would like to see the kernel supporting it directly. There are programs which do a lot name lookups and speed is important. - -- âž§ Ulrich Drepper âž§ Red Hat, Inc. âž§ 444 Castro St âž§ Mountain View, CA â– -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ud+O2ijCOnn/RHQRAu23AKDNzNfum+OQFwt2aJ5IgI87yEJTPACgoikN TKRhY6Kuu56b22mlh+Cguvs= =Q9dl -----END PGP SIGNATURE----- From wsx@6com.sk Tue Nov 18 02:00:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 02:00:48 -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 hAIA0H25009418 for ; Tue, 18 Nov 2003 02:00:30 -0800 Received: by mail.6com.sk (Postfix, from userid 501) id 0799B4C00083; Tue, 18 Nov 2003 05:00:02 -0500 (EST) Date: Tue, 18 Nov 2003 11:00:01 +0100 From: Jan Oravec To: Jeff Garzik Cc: Brad House , netdev@oss.sgi.com Subject: Re: r8169 and tg3 Message-ID: <20031118100001.GA23615@wsx.ksp.sk> Reply-To: Jan Oravec References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FB9A277.70309@pobox.com> User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 1509 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 Hi Jeff, > 1) If you have problems with the tg3 driver, we need to get those bug > reports and fix them. bcm5700 is not going to be merged into the > kernel. Further, there was at least one serious x86-64 issue that was > fixed in tg3, and we need to make sure users are testing that driver, > not a non-standard driver with bugs of its own. So here is the bug report: I have a 4-port card with two Broadcom 5704 chips plugged into PCI-X 1 of Tyan S2880 motherboard (the onboard 5704's are disabled) with single Opteron 240 processor. When loading tg3 driver, this appears in dmesg: eth0: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth1: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth2: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet eth3: Tigon3 [partno(BCM95704A6) rev 2003 PHY(5704)] (PCIX:133MHz:64-bit) 10/100/1000BaseT Ethernet The IRQs of the ports are: eth0: IRQ 28 eth1: IRQ 28 eth2: IRQ 28 eth3: IRQ 30 When we try configure eth0 only or eth3 only, it works fine. When only eth1 or eth2 are configured, the 'RUNNING' flag of the interface is missing even if the cable is plugged thus card does not work. When we turn eth0 up, eth1 and eth2 starts working, but the latency of transfers is horrible. After some debugging I realized this: When inserting printk() into tg3_interrupt(): When one of eth0, eth3 are up, I get 10 interrups per second for them (I heard that it's some workaround for HW bug). When one of eth1, eth2 are up, I get no interrupt. When one of eth1, eth2 are up and eth0 is up, I get 10 interrupts per second for each of them, but I get no interrupts when data are received on eth1 or eth2. That explains the horrible latency like: 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=10.0 ms 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=9.00 ms 64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=8.00 ms 64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=7.00 ms 64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=6.00 ms 64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=5.00 ms 64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=4.00 ms 64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=3.00 ms 64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=2.00 ms 64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=1.00 ms 64 bytes from 10.0.0.1: icmp_seq=11 ttl=64 time=99.9 ms 64 bytes from 10.0.0.1: icmp_seq=12 ttl=64 time=98.9 ms 64 bytes from 10.0.0.1: icmp_seq=13 ttl=64 time=97.9 ms 64 bytes from 10.0.0.1: icmp_seq=14 ttl=64 time=96.9 ms Also, I cannot see any interrupts in /proc/interrupts when I receive packets thru eth1/eth2. The problem is repeatable on other exactly same system. The NICs works fine on 32-bit architecture with 64-bit PCI-X. There are some reports that it works under 32-bit kernel on Opteron, but I have not tried this yet. The same problem appears with bcm5700 driver (except 10 ints/sec so the only way to make it partially work is to make traffic on eth0). If you need any details or have some suggestions what should I try, let me know. Thanks, Jan From hadi@cyberus.ca Tue Nov 18 02:39:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 02:39:33 -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 hAIAdJ25012556 for ; Tue, 18 Nov 2003 02:39:19 -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 1ALwW9-0003Cw-Nt; Mon, 17 Nov 2003 22:27:06 -0500 Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. From: jamal Reply-To: hadi@cyberus.ca To: Ramon Casellas Cc: mpls-linux-general@sf.net, "David S. Miller" , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1069125993.1056.39.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Nov 2003 22:26:34 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1510 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 there, On Mon, 2003-11-17 at 18:58, Ramon Casellas wrote: > Hi all, > > I'd like to know what comments does Mr. Miller have, and of course, if he > is working on something similar. What does he consider crappy (the MII/MOI > Radix Trees , the Opcode and instructions, code quality, lack of > comments/documentation / etc???) > Did you actually talk to James Leu before embarking on this rather valiant effort? If you did he may have warned you that the code was being rewritten from scratch. The code rewrite belongs to Dave Miller; i am adding user space support. James has been invited to look at that code once it is deemed working. If you want to be on the list as well, let me know. I am sure you as will James will both have valuable input. cheers, jamal From davem@pizda.ninka.net Tue Nov 18 03:09:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 03:09: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 hAIB9C25014768 for ; Tue, 18 Nov 2003 03:09:20 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA08366; Tue, 18 Nov 2003 03:01:32 -0800 Date: Tue, 18 Nov 2003 03:01:31 -0800 From: "David S. Miller" To: Jan Oravec Cc: jgarzik@pobox.com, brad_mssw@gentoo.org, netdev@oss.sgi.com Subject: Re: r8169 and tg3 Message-Id: <20031118030131.4bf8420a.davem@redhat.com> In-Reply-To: <20031118100001.GA23615@wsx.ksp.sk> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118100001.GA23615@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: 1511 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, 18 Nov 2003 11:00:01 +0100 Jan Oravec wrote: > The same problem appears with bcm5700 driver (except 10 ints/sec so the only > way to make it partially work is to make traffic on eth0). This smells of interrupt routing issues on this platform. From Geert.Uytterhoeven@sonycom.com Tue Nov 18 04:27:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 04:28:17 -0800 (PST) Received: from witte.sonytel.be (witte.sonytel.be [80.88.33.193]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAICRw25019803 for ; Tue, 18 Nov 2003 04:27:59 -0800 Received: from waterleaf.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id hAICRpQG006206; Tue, 18 Nov 2003 13:27:52 +0100 (MET) Date: Tue, 18 Nov 2003 13:27:52 +0100 (MET) From: Geert Uytterhoeven To: Jeff Garzik , Sam Creasey cc: netdev@oss.sgi.com, Linux Kernel , Andrew Morton , Al Viro , Linux/m68k Subject: Re: [BK PATCHES] 2.6.x experimental net driver queue In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1512 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: geert@linux-m68k.org Precedence: bulk X-list: netdev On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > Viro. > > > > No users of init_etherdev remain in the tree. (yay!) > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > drivers: I forget to test the Sun-3 drivers: - sun3_82586.c: o add missing casts to iounmap() calls o fix parameter of free_netdev() - sun3lance.c: add missing casts to iounmap() calls Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed to ioremap()? --- linux-net2-2.6.0-test9/drivers/net/sun3_82586.c 2003-11-17 11:06:18.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/sun3_82586.c 2003-11-18 13:03:01.000000000 +0100 @@ -327,7 +327,7 @@ out1: free_netdev(dev); out: - iounmap(ioaddr); + iounmap((void *)ioaddr); return ERR_PTR(err); } @@ -1163,8 +1163,8 @@ unsigned long ioaddr = dev_sun3_82586->base_addr; unregister_netdev(dev_sun3_82586); release_region(ioaddr, SUN3_82586_TOTAL_SIZE); - iounmap(ioaddr); - free_netdev(dev); + iounmap((void *)ioaddr); + free_netdev(dev_sun3_82586); } #endif /* MODULE */ --- linux-net2-2.6.0-test9/drivers/net/sun3lance.c 2003-11-17 11:06:18.000000000 +0100 +++ linux-net2-2.6.0-test9/drivers/net/sun3lance.c 2003-11-18 13:02:32.000000000 +0100 @@ -287,7 +287,7 @@ out1: #ifdef CONFIG_SUN3 - iounmap(dev->base_addr); + iounmap((void *)dev->base_addr); #endif out: free_netdev(dev); @@ -327,7 +327,7 @@ ioaddr_probe[1] = tmp2; #ifdef CONFIG_SUN3 - iounmap(ioaddr); + iounmap((void *)ioaddr); #endif return 0; } @@ -957,7 +957,7 @@ { unregister_netdev(sun3lance_dev); #ifdef CONFIG_SUN3 - iounmap(sun3lance_dev->base_addr); + iounmap((void *)sun3lance_dev->base_addr); #endif free_netdev(sun3lance_dev); } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From romieu@fr.zoreil.com Tue Nov 18 05:03:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 05:04:14 -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 hAID3v25020674 for ; Tue, 18 Nov 2003 05:03:58 -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 hAICwnK7002814; Tue, 18 Nov 2003 13:58:49 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAICwmoj002813; Tue, 18 Nov 2003 13:58:48 +0100 Date: Tue, 18 Nov 2003 13:58:48 +0100 From: Francois Romieu To: Jeff Garzik Cc: Brad House , netdev@oss.sgi.com Subject: Re: r8169 and tg3 Message-ID: <20031118135848.A2451@electric-eye.fr.zoreil.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.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: <3FB9A277.70309@pobox.com>; from jgarzik@pobox.com on Mon, Nov 17, 2003 at 11:39:19PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1513 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 Jeff Garzik : [...] > So, what needs to happen is somebody needs to look at the sis190 changes > that went in, and apply those same fixes to r8169. If no one objects, I can do for r8169 the same thing I did for sis190. Btw the DMA Rx/Tx rework is already in good shape (I rather like seeing Jeff improving (S)ATA than coming to copy over his RX and TX handling code :o) ). Anyway, the bk-commit patches which were related to sis190 are available at: http://www.fr.zoreil.com/people/francois/misc/sis190-rework.mbx -- Ueimor From vandrove@vc.cvut.cz Tue Nov 18 05:21:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 05:22:08 -0800 (PST) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIDLq25021166 for ; Tue, 18 Nov 2003 05:21:53 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) with ESMTP id hAIDLcOw029040; Tue, 18 Nov 2003 14:21:38 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) id hAIDLbM0029037; Tue, 18 Nov 2003 14:21:37 +0100 Date: Tue, 18 Nov 2003 14:21:37 +0100 From: Petr Vandrovec To: "David S. Miller" Cc: herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-ID: <20031118132137.GA23732@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> <20031117123047.55377d3a.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031117123047.55377d3a.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 1514 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev On Mon, Nov 17, 2003 at 12:30:47PM -0800, David S. Miller wrote: > On Mon, 17 Nov 2003 20:44:52 +0100 > Petr Vandrovec wrote: > > > It would be nice if at least kernel did not stomp on skb2->h.raw so > > ptype callback could cope with situation and report to userspace where > > to put checksum. I already discussed it here two or so months ago, and 3 months ago. > > only solution I was able to find is that VMware's vmnet have to parse > > itself network headers to find where to put checksum. Nothing for IPv6 > > users... > > Remind me again why the vmnet driver can't just run skb_checksum() > on packets that have CHECKSUM_HW set? Because vmnet driver (for bridged networking) is hooked through dev_add_pack. Place where to put checksum is defined as skb->h.raw + skb->csum, and what to checksum as skb->h.raw ... skb->data + skb->len. But unfortunately dev_queue_xmit_nit replaces skb2->h.raw with skb2->nh.raw - and so hook has to look at the packet contents to compute h.raw from packet data and protocol type. When I was complaining about this assignment, you told me that AF_PACKET requires skb->h.raw pointing to same place as skb->nh.raw. And I was not able to find place you were referring to, and thread died. Unfortunately I was not able to find netdev public archive, so below are two messages I sent on this subject in august. As far as I know, there was no reply on my second message. Currently vmnet does fixup below at the start of hook. Fortunately no 'Unknown EII protocol' message was reported from the users yet (and we compute checksum while doing copy_to_user, so there is almost no slowdown). /* *---------------------------------------------------------------------- * * VNetBridgeComputeHeaderPos -- * * Compute correct position for UDP/TCP header. * * Results: * None. * * Side effects: * skb->h.raw updated to point to the tcp/udp header. * *---------------------------------------------------------------------- */ static INLINE_SINGLE_CALLER void VNetBridgeComputeHeaderPos(struct sk_buff *skb) { /* Maybe some kernel gets it right... */ if (skb->h.raw != skb->nh.raw) { return; } switch (be16_to_cpu(skb->protocol)) { case ETH_P_IP: skb->h.raw = skb->nh.raw + (skb->nh.raw[0] & 0x0F) * 4; return; default: printk(KERN_DEBUG "Unknown EII protocol %04X: csum at %d\n", be16_to_cpu(skb->protocol), skb->csum); break; } return; } Thanks, Petr Vandrovec ------ Date: Mon, 18 Aug 2003 05:37:11 +0200 From: Petr Vandrovec To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: dev_add_pack and hardware checksumming Message-ID: <20030818033711.GA21360@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Status: RO Content-Length: 992 Lines: 23 Hi Dave, VMware uses dev_add_pack() for capturing ethernet traffic generated by the host and forwarding it to the guest. Unfortunately skb at the packet filter input is still in CHECKSUM_HW state, while skb->csum is relative to the skb->h.raw and dev_queue_xmit_nit overwrites skb->h.raw with skb->nh.raw. Due to this I have to peek at packet body to detect protocol & its header length, reinitialize skb->h.raw with this knowledge and then finally do skb_checksum_help(). For me it would be best if dev_queue_xmit_nit could just leave skb->h.raw alone, usable for skb_checksum_help(), but I assume that it is not possible due to backward compatibility? Other choice is doing checksumming in dev_queue_xmit_nit itself, before passing skb down to the registered packet handlers. BTW, it looks to me like that an uninitialized value is leaked in UDP's checksum field to the packets tcpdump on the host can capture... Thanks, Petr Vandrovec vandrove@vc.cvut.cz ------- Date: Mon, 18 Aug 2003 20:27:27 +0200 From: Petr Vandrovec To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: dev_add_pack and hardware checksumming Message-ID: <20030818182727.GD999@vana.vc.cvut.cz> References: <20030818033711.GA21360@vana.vc.cvut.cz> <20030817223851.5185bdee.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030817223851.5185bdee.davem@redhat.com> User-Agent: Mutt/1.5.4i Status: RO Content-Length: 1103 Lines: 29 On Sun, Aug 17, 2003 at 10:38:51PM -0700, David S. Miller wrote: > On Mon, 18 Aug 2003 05:37:11 +0200 > Petr Vandrovec wrote: > > > For me it would be best if dev_queue_xmit_nit could just leave > > skb->h.raw alone, > > The AF_PACKET layer depends upon skb->h.raw being set a certain > way. Have a look at the dev_add_pack() registered hooks that > net/packet/af_packet.c uses. Well, I do not see skb->h.raw used in any way in AF_PACKET hooks... Probably I missed some deeply nested generic function which accesses it... > > Other choice is doing checksumming in dev_queue_xmit_nit itself, > > before passing skb down to the registered packet handlers. > > This is not an option either. We're specifically not going to > undo checksum offloading just because tcpdump or some other > kind of tap is installed. And what's left, then? I can happilly offload checksum to some other place down in the chain, but for doing that I must know where I should put checksum, and currently this information is unavailable to the packet hook. Best regards, Petr Vandrovec From kala@pinerecords.com Tue Nov 18 05:58:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 05:58:24 -0800 (PST) Received: from louise.pinerecords.com (louise.pinerecords.com [213.168.176.16]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIDw725021982 for ; Tue, 18 Nov 2003 05:58:09 -0800 Received: from louise.pinerecords.com (localhost [127.0.0.1]) by louise.pinerecords.com with ESMTP id hAIDw5TD010261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Nov 2003 14:58:05 +0100 Received: (from kala@localhost) by louise.pinerecords.com (submit) id hAIDw5UM010260; Tue, 18 Nov 2003 14:58:05 +0100 Date: Tue, 18 Nov 2003 14:58:05 +0100 From: Tomas Szepe To: Andi Kleen Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz, davem@redhat.com Subject: Re: possible bug in tcp_input.c Message-ID: <20031118135805.GA9705@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com.suse.lists.linux.kernel> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-archive-position: 1515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: szepe@pinerecords.com Precedence: bulk X-list: netdev On Oct-24 2003, Fri, 19:57 +0200 Andi Kleen wrote: > > /* tcp_input.c, line 1138 */ > > static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) > > { > > return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); > > } > > tp->packets_out > 0 implies that there is at least one packet in the write > queue (it counts the number of unacked packets in flight, which are kept > in the write queue). When that's not the case something else is wrong. Yes, that's exactly what davem said. The corruption is happening somewhere in netsched/imq code that's not even part of the official kernel tree (and I'm told there's nobody to maintain the patch at present). Thanks, -- Tomas Szepe P.S. I can post the patchset we've been using on the crashing machines in case someone's interested, it's reasonably short: 9101 Jul 6 11:48 bridge-nf-0.0.7-against-2.4.22pre3.diff.gz 4123 Jul 6 11:14 imq-2.4.22pre3-1.diff.gz 1883 Jul 6 12:01 imq-nf-20030625-2.4.22pre3.diff.gz From ak@suse.de Tue Nov 18 06:11:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 06:11:19 -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 hAIEAt25022782 for ; Tue, 18 Nov 2003 06:10:56 -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 0C02D180DCD0; Tue, 18 Nov 2003 14:42:21 +0100 (CET) Received: (from ak@localhost) by oldwotan.suse.de (8.12.6/8.12.6/Submit) id h9OHvOvG016639; Fri, 24 Oct 2003 19:57:25 +0200 X-Authentication-Warning: oldwotan.suse.de: ak set sender to ak@suse.de using -f To: Tomas Szepe Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz, davem@redhat.com Subject: Re: possible bug in tcp_input.c References: <20031024162959.GB11154@louise.pinerecords.com.suse.lists.linux.kernel> From: Andi Kleen Date: 24 Oct 2003 19:57:24 +0200 In-Reply-To: <20031024162959.GB11154@louise.pinerecords.com.suse.lists.linux.kernel> Message-ID: Lines: 14 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 1516 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 Tomas Szepe writes: > /* tcp_input.c, line 1138 */ > static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) > { > return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); > } tp->packets_out > 0 implies that there is at least one packet in the write queue (it counts the number of unacked packets in flight, which are kept in the write queue). When that's not the case something else is wrong. -Andi From ak@suse.de Tue Nov 18 06:16:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 06:16:44 -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 hAIEGI25023180 for ; Tue, 18 Nov 2003 06:16:19 -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 DD6F6180DCCF; Tue, 18 Nov 2003 14:42:20 +0100 (CET) Received: (from ak@localhost) by oldwotan.suse.de (8.12.6/8.12.6/Submit) id h9SEVAl5012765; Tue, 28 Oct 2003 15:31:10 +0100 X-Authentication-Warning: oldwotan.suse.de: ak set sender to ak@suse.de using -f To: =?iso-8859-1?q?=C9ric?= Brunet Cc: davidm@hpl.hp.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com Subject: Re: status of ipchains in 2.6? References: <200310280127.h9S1RM5d002140@napali.hpl.hp.com.suse.lists.linux.kernel> <20031028090304.GA19302@lps.ens.fr.suse.lists.linux.kernel> From: Andi Kleen Date: 28 Oct 2003 15:31:09 +0100 In-Reply-To: <20031028090304.GA19302@lps.ens.fr.suse.lists.linux.kernel> Message-ID: Lines: 10 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1517 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 Éric Brunet writes: > > In my case, 2.6.0-test4 is working fine. Can you do a binary search in the versions to see which version broke it? test5-test8 all had netfilter changes. -Andi From ak@suse.de Tue Nov 18 06:30:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 06:30:59 -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 hAIEUY25023596 for ; Tue, 18 Nov 2003 06:30:35 -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 2882A180DFB4; Tue, 18 Nov 2003 15:01:24 +0100 (CET) Date: Tue, 18 Nov 2003 15:01:22 +0100 From: Andi Kleen To: Tomas Szepe Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, grof@dragon.cz, davem@redhat.com Subject: Re: possible bug in tcp_input.c Message-Id: <20031118150122.08d117f9.ak@suse.de> In-Reply-To: <20031118135805.GA9705@louise.pinerecords.com> References: <20031024162959.GB11154@louise.pinerecords.com.suse.lists.linux.kernel> <20031118135805.GA9705@louise.pinerecords.com> X-Mailer: Sylpheed version 0.8.9 (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: 1518 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 On Tue, 18 Nov 2003 14:58:05 +0100 Tomas Szepe wrote: > On Oct-24 2003, Fri, 19:57 +0200 > Andi Kleen wrote: > > > > /* tcp_input.c, line 1138 */ > > > static inline int tcp_head_timedout(struct sock *sk, struct tcp_opt *tp) > > > { > > > return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->write_queue)); > > > } > > > > tp->packets_out > 0 implies that there is at least one packet in the write > > queue (it counts the number of unacked packets in flight, which are kept > > in the write queue). When that's not the case something else is wrong. > > Yes, that's exactly what davem said. The corruption is happening somewhere > in netsched/imq code that's not even part of the official kernel tree (and > I'm told there's nobody to maintain the patch at present). Ignore the mail. It was some machine flushing out an old mail queue (with some very old mails from me that never made it out) I actually wrote it before DaveM if you check the dates ;-) -Andi From c-d.hailfinger.kernel.2003@gmx.net Tue Nov 18 06:45:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 06:45:52 -0800 (PST) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIEj725025505 for ; Tue, 18 Nov 2003 06:45:27 -0800 Received: (qmail 10861 invoked by uid 65534); 18 Nov 2003 14:45:01 -0000 Received: from stud214125.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.214.125) by mail.gmx.net (mp005) with SMTP; 18 Nov 2003 15:45:01 +0100 X-Authenticated: #15936885 Message-ID: <3FBA3066.80508@gmx.net> Date: Tue, 18 Nov 2003 15:44:54 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: de, en MIME-Version: 1.0 To: Brad House CC: Linux Kernel Mailing List , netdev@oss.sgi.com, Brad House Subject: Re: forcedeth: version 0.17 available References: <3FB807A3.8010207@gmx.net> <3FB98C18.8090305@gmx.net> <3FB9A261.7080500@mcve.com> In-Reply-To: <3FB9A261.7080500@mcve.com> X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1519 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2003@gmx.net Precedence: bulk X-list: netdev Brad House wrote: > Well, the problem I saw was with the 2.6 patch. > > These lines: > > +++ build-2.6/drivers/net/forcedeth.c 2003-11-15 23:00:30.000000000 > +0100 > @@ -0,0 +1,1416 @@ > > Should be > > +++ build-2.6/drivers/net/forcedeth.c 2003-11-15 23:00:30.000000000 > +0100 > @@ -0,0 +1,1418 @@ Aaah! The files were corrupted during upload. That's why I didn't find the problem you described in my local version. The problem is fixed now and MD5 sums have been uploaded to avoid this in the future. Thanks again, Carl-Daniel > Carl-Daniel Hailfinger wrote: > >> Carl-Daniel Hailfinger wrote: >> >>> version 0.17 of forcedeth for Linux 2.4 and 2.6 is available at >>> http://www.hailfinger.org/carldani/linux/patches/forcedeth/ >> >> >> >> The patches for Linux 2.4 were malformed. Corrected versions have been >> uploaded a few hours ago. >> Thanks to Brad House for spotting this. From akpm@osdl.org Tue Nov 18 10:56:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 10:56: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 hAIIuT25010721 for ; Tue, 18 Nov 2003 10:56:30 -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 hAIIuHC30192; Tue, 18 Nov 2003 10:56:17 -0800 Date: Tue, 18 Nov 2003 11:01:39 -0800 From: Andrew Morton To: Reuben Farrelly Cc: netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-Id: <20031118110139.45f2be60.akpm@osdl.org> In-Reply-To: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.net> References: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.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: 1520 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 It's one for the networking guys. The mm kernels have a patch which detects when atomic_dec_and_test takes an atomic_t negative - it is assumed that this is a bug so a warning is generated. Reuben Farrelly wrote: > > Hi Andrew, > > Have started to see this problem occur in -test9 and I think, -test8 (but > not before then). At the moment I'm running -test9-mm3 which has the same > problem. Kernel is not tainted. > > Fortunately when this box died a few mins ago (twice in a row) it was able > to dump a heap of stuff to syslog, so I got something useful out of the > crashes. This first one triggered when I started to load the ethernet card > up with a "debug ip packet detail" from a Cisco router ;-) > > Reuben > > Crash 1: > > > Nov 18 23:09:00 tornado kernel: Badness in atomic_dec_and_test at > include/asm/atomic.h:150 > Nov 18 23:09:00 tornado kernel: Call Trace: > Nov 18 23:09:00 tornado kernel: [] skb_release_data+0x14c/0x160 > Nov 18 23:09:00 tornado kernel: [] kfree_skbmem+0x13/0x30 > Nov 18 23:09:00 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > Nov 18 23:09:00 tornado kernel: [] e100intr+0x1e5/0x290 > Nov 18 23:09:00 tornado kernel: [] net_tx_action+0x4a/0xf0 > Nov 18 23:09:00 tornado kernel: [] do_softirq+0x95/0xa0 > Nov 18 23:09:00 tornado kernel: [] do_IRQ+0xfb/0x130 > Nov 18 23:09:00 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:00 tornado kernel: [] common_interrupt+0x18/0x20 > Nov 18 23:09:00 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:00 tornado kernel: [] > acpi_processor_idle+0xd4/0x1c5 [processor] > Nov 18 23:09:00 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:00 tornado kernel: [] cpu_idle+0x34/0x40 > Nov 18 23:09:00 tornado kernel: [] start_kernel+0x185/0x1c0 > Nov 18 23:09:00 tornado kernel: [] unknown_bootoption+0x0/0x120 > Nov 18 23:09:00 tornado kernel: > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:09:01 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:09:01 tornado kernel: Badness in atomic_dec_and_test at > include/asm/atomic.h:150 > Nov 18 23:09:01 tornado kernel: Call Trace: > Nov 18 23:09:01 tornado kernel: [] skb_release_data+0x14c/0x160 > Nov 18 23:09:01 tornado kernel: [] kfree_skbmem+0x13/0x30 > Nov 18 23:09:01 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > Nov 18 23:09:01 tornado kernel: [] __kfree_skb+0x16f/0x1b0 > Nov 18 23:09:01 tornado kernel: [] e100intr+0x1e5/0x290 > Nov 18 23:09:01 tornado kernel: [] net_tx_action+0x4a/0xf0 > Nov 18 23:09:01 tornado kernel: [] do_softirq+0x95/0xa0 > Nov 18 23:09:01 tornado kernel: [] do_IRQ+0xfb/0x130 > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] common_interrupt+0x18/0x20 > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] > acpi_processor_idle+0xb3/0x1c5 [processor] > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] cpu_idle+0x34/0x40 > Nov 18 23:09:01 tornado kernel: [] start_kernel+0x185/0x1c0 > Nov 18 23:09:01 tornado kernel: [] unknown_bootoption+0x0/0x120 > Nov 18 23:09:01 tornado kernel: > Nov 18 23:09:01 tornado kernel: BUG: dst underflow -1: c02921ef > Nov 18 23:09:01 tornado kernel: Badness in atomic_dec_and_test at > include/asm/atomic.h:150 > Nov 18 23:09:01 tornado kernel: Call Trace: > Nov 18 23:09:01 tornado kernel: [] sock_wfree+0x86/0xa0 > Nov 18 23:09:01 tornado kernel: [] __kfree_skb+0x7e/0x1b0 > Nov 18 23:09:01 tornado kernel: [] __kfree_skb+0x16f/0x1b0 > Nov 18 23:09:01 tornado kernel: [] e100intr+0x1e5/0x290 > Nov 18 23:09:01 tornado kernel: [] net_tx_action+0x4a/0xf0 > Nov 18 23:09:01 tornado kernel: [] do_softirq+0x95/0xa0 > Nov 18 23:09:01 tornado kernel: [] do_IRQ+0xfb/0x130 > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] common_interrupt+0x18/0x20 > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] > acpi_processor_idle+0xb3/0x1c5 [processor] > Nov 18 23:09:01 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:09:01 tornado kernel: [] cpu_idle+0x34/0x40 > Nov 18 23:09:01 tornado kernel: [] start_kernel+0x185/0x1c0 > Nov 18 23:09:01 tornado kernel: [] unknown_bootoption+0x0/0x120 > Nov 18 23:09:01 tornado kernel: > Nov 18 23:09:02 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:09:02 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:09:02 tornado kernel: BUG: dst underflow 0: c02d5c1b > Nov 18 23:09:02 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:09:02 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:09:02 tornado kernel: BUG: dst underflow -1: c02921ef > Nov 18 23:09:02 tornado kernel: Badness in atomic_dec_and_test at > include/asm/atomic.h:150 > Nov 18 23:09:02 tornado kernel: Call Trace: > Nov 18 23:09:02 tornado kernel: [] sock_wfree+0x86/0xa0 > Nov 18 23:09:02 tornado kernel: [] __kfree_skb+0x7e/0x1b0 > Nov 18 23:09:02 tornado kernel: [] __kfree_skb+0x16f/0x1b0 > Nov 18 23:09:02 tornado kernel: [] e100intr+0x1e5/0x290 > Nov 18 23:09:02 tornado kernel: [] net_tx_action+0x4a/0xf0 > Nov 18 23:09:02 tornado kernel: [] do_softirq+0x95/0xa0 > Nov 18 23:09:02 tornado kernel: [] do_IRQ+0xfb/0x130 > Nov 18 23:09:02 tornado kernel: [] common_interrupt+0x18/0x20 > Nov 18 23:09:02 tornado kernel: [] unix_dgram_sendmsg+0x3e/0x700 > Nov 18 23:09:02 tornado kernel: [] find_get_page+0x2c/0x60 > Nov 18 23:09:02 tornado kernel: [] sock_aio_write+0xc3/0xf0 > Nov 18 23:09:02 tornado kernel: [] do_sync_write+0xb1/0xe0 > Nov 18 23:09:02 tornado kernel: [] unlock_page+0x15/0x60 > Nov 18 23:09:02 tornado kernel: [] schedule+0x350/0x680 > Nov 18 23:09:02 tornado kernel: [] autoremove_wake_function+0x0/0x50 > Nov 18 23:09:02 tornado kernel: [] default_wake_function+0x0/0x20 > Nov 18 23:09:02 tornado kernel: [] do_timer+0xe0/0xf0 > Nov 18 23:09:02 tornado kernel: [] vfs_write+0xff/0x130 > Nov 18 23:09:02 tornado kernel: [] sys_write+0x42/0x70 > Nov 18 23:09:02 tornado kernel: [] sysenter_past_esp+0x43/0x65 > Nov 18 23:09:02 tornado kernel: > Nov 18 23:09:02 tornado kernel: BUG: dst underflow -2: c02921ef > > > Crash 2: > > Nov 18 23:23:56 tornado kernel: Badness in atomic_dec_and_test at > include/asm/atomic.h:150 > Nov 18 23:23:56 tornado kernel: Call Trace: > Nov 18 23:23:56 tornado kernel: [] skb_release_data+0x14c/0x160 > Nov 18 23:23:56 tornado kernel: [] kfree_skbmem+0x13/0x30 > Nov 18 23:23:56 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > Nov 18 23:23:56 tornado kernel: [] e100intr+0x1e5/0x290 > Nov 18 23:23:56 tornado kernel: [] net_tx_action+0x4a/0xf0 > Nov 18 23:23:56 tornado kernel: [] do_softirq+0x95/0xa0 > Nov 18 23:23:56 tornado kernel: [] do_IRQ+0xfb/0x130 > Nov 18 23:23:56 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:23:56 tornado kernel: [] common_interrupt+0x18/0x20 > Nov 18 23:23:56 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:23:56 tornado kernel: [] > acpi_processor_idle+0xd4/0x1c5 [processor] > Nov 18 23:23:56 tornado kernel: [] rest_init+0x0/0x60 > Nov 18 23:23:56 tornado kernel: [] cpu_idle+0x34/0x40 > Nov 18 23:23:56 tornado kernel: [] start_kernel+0x185/0x1c0 > Nov 18 23:23:56 tornado kernel: [] unknown_bootoption+0x0/0x120 > Nov 18 23:23:56 tornado kernel: > Nov 18 23:23:56 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:23:56 tornado kernel: Attempt to release alive inet socket dfd4c780 > Nov 18 23:23:56 tornado kernel: BUG: dst underflow 0: c02921ef > Nov 18 23:23:56 tornado kernel: Attempt to release alive inet socket dfd4c780 > From xose@wanadoo.es Tue Nov 18 11:46:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 11:47:13 -0800 (PST) Received: from smtp12.eresmas.com (smtp12.eresmas.com [62.81.235.112]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIJkv25012491 for ; Tue, 18 Nov 2003 11:46:59 -0800 Received: from [192.168.108.56] (helo=mx06.in.mad.eresmas.com) by smtp12.eresmas.com with esmtp (Exim 4.10) id 1AMBoI-0005N4-00; Tue, 18 Nov 2003 20:46:50 +0100 Received: from [80.103.137.34] (helo=wanadoo.es) by mx06.in.mad.eresmas.com with esmtp (Exim 4.20) id 1AMBoL-00043K-Ee; Tue, 18 Nov 2003 20:46:53 +0100 Message-ID: <3FBA771A.1010104@wanadoo.es> Date: Tue, 18 Nov 2003 20:46:34 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik@pobox.com Subject: [PATCH ] more RTL-8139 clone boards X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080508040700000809000000" X-archive-position: 1521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080508040700000809000000 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 0x018A 0x0106 LevelOne FPC-0106TX 0x126C 0x1211 Nortel Networks 10/100BaseTX 0x1743 0x8139 Peppercon AG ROL-F 0x021B 0x8139 Compaq HNE-300 -- HTML mails are going to trash automagically --------------080508040700000809000000 Content-Type: text/plain; name="8139too_idents.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="8139too_idents.diff" --- linux/drivers/net/8139too.c 2003-11-15 16:47:54.000000000 +0100 +++ new/drivers/net/8139too.c 2003-11-18 20:31:49.000000000 +0100 @@ -250,6 +250,10 @@ {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, {0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x018a, 0x0106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x126c, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x1743, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, + {0x021b, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, #ifdef CONFIG_SH_SECUREEDGE5410 /* Bogus 8139 silicon reports 8129 without external PROM :-( */ --------------080508040700000809000000-- From xose@wanadoo.es Tue Nov 18 12:49:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 12:49:36 -0800 (PST) Received: from smtp12.eresmas.com (smtp12.eresmas.com [62.81.235.112]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIKnI25016195 for ; Tue, 18 Nov 2003 12:49:21 -0800 Received: from [192.168.108.54] (helo=mx04.in.mad.eresmas.com) by smtp12.eresmas.com with esmtp (Exim 4.10) id 1AMCme-0007A9-00; Tue, 18 Nov 2003 21:49:12 +0100 Received: from [80.102.83.109] (helo=wanadoo.es) by mx04.in.mad.eresmas.com with esmtp (Exim 4.20) id 1AMCmh-0004v2-FQ; Tue, 18 Nov 2003 21:49:15 +0100 Message-ID: <3FBA85B6.8010008@wanadoo.es> Date: Tue, 18 Nov 2003 21:48:54 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik@pobox.com Subject: [PATCH ] more ne2k-pci clone boards X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040005060409030706010906" X-archive-position: 1522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040005060409030706010906 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 0x8c4a 0x1980 Winbond W89C940(misprogrammed) -- HTML mails are going to trash automagically --------------040005060409030706010906 Content-Type: text/plain; name="ne2k-pci_idents.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ne2k-pci_idents.diff" --- linux/drivers/net/ne2k-pci.c 2003-11-15 16:47:29.000000000 +0100 +++ new/drivers/net/ne2k-pci.c 2003-11-18 21:16:28.000000000 +0100 @@ -116,6 +116,7 @@ CH_Winbond_W89C940F, CH_Holtek_HT80232, CH_Holtek_HT80229, + CH_Winbond_89C940_8c4a, }; @@ -133,6 +134,7 @@ {"Winbond W89C940F", 0}, {"Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX}, {"Holtek HT80229", ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 }, + {"Winbond W89C940(misprogrammed)", 0}, {0,} }; @@ -148,6 +150,7 @@ { 0x1050, 0x5a5a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_W89C940F }, { 0x12c3, 0x0058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80232 }, { 0x12c3, 0x5598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80229 }, + { 0x8c4a, 0x1980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_89C940_8c4a }, { 0, } }; MODULE_DEVICE_TABLE(pci, ne2k_pci_tbl); --------------040005060409030706010906-- From sammy@sammy.net Tue Nov 18 13:07:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 13:07:42 -0800 (PST) Received: from sun3.sammy.net (sun3.sammy.net [68.162.198.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIL7Q25016766 for ; Tue, 18 Nov 2003 13:07:28 -0800 Received: (qmail 6882 invoked by uid 500); 19 Nov 2003 22:08:03 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 19 Nov 2003 22:08:02 -0000 Date: Wed, 19 Nov 2003 17:08:01 -0500 (EST) From: Sam Creasey X-X-Sender: sammy@sun3 To: Geert Uytterhoeven cc: Jeff Garzik , , Linux Kernel , Andrew Morton , Al Viro , Linux/m68k Subject: Re: [BK PATCHES] 2.6.x experimental net driver queue In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1523 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sammy@sammy.net Precedence: bulk X-list: netdev On Tue, 18 Nov 2003, Geert Uytterhoeven wrote: > On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > > Viro. > > > > > > No users of init_etherdev remain in the tree. (yay!) > > > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > > drivers: > > I forget to test the Sun-3 drivers: > - sun3_82586.c: > o add missing casts to iounmap() calls > o fix parameter of free_netdev() > - sun3lance.c: add missing casts to iounmap() calls > > Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not > defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed > to ioremap()? Should be... I looked back through a few versions of the code, and I'm not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented that line out long ago anyway). (I'm also amazed just how much of that driver I've forgotten in the last year or two :) -- Sam From jgarzik@pobox.com Tue Nov 18 13:42:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 13:43:05 -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 hAILgo25017334 for ; Tue, 18 Nov 2003 13:42:51 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47130 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMDcU-0001Ey-Kf; Tue, 18 Nov 2003 21:42:46 +0000 Message-ID: <3FBA923A.8000606@pobox.com> Date: Tue, 18 Nov 2003 16:42:18 -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: Geert Uytterhoeven CC: Sam Creasey , netdev@oss.sgi.com, Linux Kernel , Andrew Morton , Al Viro , Linux/m68k Subject: Re: [BK PATCHES] 2.6.x experimental net driver queue References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1524 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 thanks, applied both patches From xose@wanadoo.es Tue Nov 18 14:06:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 14:07:11 -0800 (PST) Received: from smtp11.eresmas.com (smtp11.eresmas.com [62.81.235.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAIM6u25018298 for ; Tue, 18 Nov 2003 14:06:57 -0800 Received: from [192.168.108.52] (helo=mx02.in.mad.eresmas.com) by smtp11.eresmas.com with esmtp (Exim 4.10) id 1AMDzi-0008MW-00; Tue, 18 Nov 2003 23:06:46 +0100 Received: from [80.102.80.160] (helo=wanadoo.es) by mx02.in.mad.eresmas.com with esmtp (Exim 4.20) id 1AMDzj-0008SF-QU; Tue, 18 Nov 2003 23:06:48 +0100 Message-ID: <3FBA97E4.1060004@wanadoo.es> Date: Tue, 18 Nov 2003 23:06:28 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik@pobox.com Subject: [PATCH ] more eepro100 boards X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------010307050302050103040800" X-archive-position: 1525 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010307050302050103040800 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit deleted PCI_DEVICE_ID_INTEL_82801BA_7, it's a duplicate of 0x2449 and added five boards: 0x1051 0x1052 0x1053 0x1054 0x1055 These should be deleted: 0x1035 0x1036 0x1037 0x1227 0x1228 0x5200 0x5201 Time ago, in conversation with some intel guys, they said me that those boards are not compatibles with the driver. Do anyone run eepro100 with any of those boards? -thanks- --------------010307050302050103040800 Content-Type: text/plain; name="eepro100_idents.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="eepro100_idents.diff" --- linux/drivers/net/eepro100.c 2003-08-27 17:26:41.000000000 +0200 +++ new/drivers/net/eepro100.c 2003-11-18 22:10:32.000000000 +0100 @@ -2374,8 +2374,6 @@ PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82559ER, PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_7, - PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1029, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1030, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1031, PCI_ANY_ID, PCI_ANY_ID, }, @@ -2393,6 +2391,11 @@ { PCI_VENDOR_ID_INTEL, 0x103D, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x103E, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1050, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1051, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1052, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1053, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1054, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1055, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1059, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1227, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, 0x1228, PCI_ANY_ID, PCI_ANY_ID, }, --------------010307050302050103040800-- From davem@pizda.ninka.net Tue Nov 18 14:30:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 14:30: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 hAIMU825019743 for ; Tue, 18 Nov 2003 14:30:28 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA24267; Tue, 18 Nov 2003 14:22:49 -0800 Date: Tue, 18 Nov 2003 14:22:49 -0800 From: "David S. Miller" To: Andrew Morton Cc: reuben-linux@reub.net, netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-Id: <20031118142249.045ff040.davem@redhat.com> In-Reply-To: <20031118110139.45f2be60.akpm@osdl.org> References: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.net> <20031118110139.45f2be60.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: 1526 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, 18 Nov 2003 11:01:39 -0800 Andrew Morton wrote: > It's one for the networking guys. > > The mm kernels have a patch which detects when atomic_dec_and_test > takes an atomic_t negative - it is assumed that this is a bug so > a warning is generated. It is a bug especially for the backtrace cases shown here, I'll take a look. From shemminger@osdl.org Tue Nov 18 16:17:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 16:17:25 -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 hAJ0HB25022347 for ; Tue, 18 Nov 2003 16:17:11 -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 hAJ0H0C22001; Tue, 18 Nov 2003 16:17:00 -0800 Date: Tue, 18 Nov 2003 16:17:30 -0800 From: Stephen Hemminger To: Jeff Garzik , OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: [PATCH] 8139too NAPI for net-drivers-2.5-exp Message-Id: <20031118161730.2690cb76.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: 1527 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 8139too version in net-drivers-2.5-exp modified for NAPI. Also: 64k receive ring - has to handle wrap for that case; the NoWrap flag does nothing if using this big ring. assert() -> BUG_ON() To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Tue Nov 18 16:16:59 2003 +++ b/drivers/net/8139too.c Tue Nov 18 16:16:59 2003 @@ -92,7 +92,7 @@ */ #define DRV_NAME "8139too" -#define DRV_VERSION "0.9.26" +#define DRV_VERSION "0.9.27" #include @@ -128,9 +128,11 @@ #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 +#else +#define USE_BUF64K 1 #endif /* define to 1 to enable copious debugging info */ @@ -150,11 +152,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 @@ -164,9 +162,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; @@ -175,15 +170,23 @@ 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 */ +#ifdef USE_BUF64K +#define RX_BUF_TOT_LEN RX_BUF_LEN +#else #define RX_BUF_TOT_LEN (RX_BUF_LEN + RX_BUF_PAD + RX_BUF_WRAP_PAD) +#endif /* Number of Tx descriptor registers. */ #define NUM_TX_DESC 4 @@ -455,7 +458,7 @@ RxCfgRcv32K = (1 << 12), RxCfgRcv64K = (1 << 11) | (1 << 12), - /* Disable packet wrap at end of Rx buffer */ + /* Disable packet wrap at end of Rx buffer. (not possible with 64k) */ RxNoWrap = (1 << 7), }; @@ -580,6 +583,7 @@ char twistie, twist_row, twist_col; /* Twister tune state. */ unsigned int default_port:4; /* Last dev->if_port value. */ spinlock_t lock; + spinlock_t rx_lock; chip_t chipset; pid_t thr_pid; wait_queue_head_t thr_wait; @@ -596,13 +600,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)"); @@ -616,6 +618,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); @@ -688,16 +691,27 @@ 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); +#elif defined(USE_BUF64K) +static const unsigned int rtl8139_rx_config = + RxCfgRcv64K | + (RX_FIFO_THRESH << RxCfgFIFOShift) | + (RX_DMA_BURST << RxCfgDMAShift); +#else +#error "Need to define receive buffer window" #endif static const unsigned int rtl8139_tx_config = @@ -874,9 +888,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); @@ -970,6 +982,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; @@ -995,6 +1009,7 @@ tp->msg_enable = (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); spin_lock_init (&tp->lock); + spin_lock_init (&tp->rx_lock); init_waitqueue_head (&tp->thr_wait); init_completion (&tp->thr_exited); tp->mii.dev = dev; @@ -1638,7 +1653,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; @@ -1668,6 +1683,7 @@ if (tmp8 & CmdTxEnb) RTL_W8 (ChipCmd, CmdRxEnb); + spin_lock(&tp->rx_lock); /* Disable interrupts by clearing the interrupt mask. */ RTL_W16 (IntrMask, 0x0000); @@ -1686,9 +1702,12 @@ spin_unlock_irqrestore (&tp->lock, flags); /* ...and finally, reset everything */ - rtl8139_hw_start (dev); - - netif_wake_queue (dev); + if (netif_running(dev)) { + rtl8139_hw_start (dev); + netif_wake_queue (dev); + } + spin_unlock(&tp->rx_lock); + } @@ -1702,6 +1721,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); @@ -1713,7 +1733,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)); @@ -1801,8 +1820,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); } } @@ -1890,30 +1908,41 @@ #endif } -static void rtl8139_rx_interrupt (struct net_device *dev, - struct rtl8139_private *tp, void *ioaddr) +static __inline__ void wrap_copy(struct sk_buff *skb, const unsigned char *ring, + u32 offset, unsigned int size) { - unsigned char *rx_ring; - u16 cur_rx; +#ifdef USE_BUF64K + u32 left = RX_BUF_LEN - offset; - assert (dev != NULL); - assert (tp != NULL); - assert (ioaddr != NULL); + if (size > left) { + memcpy(skb->data, ring + offset, left); + memcpy(skb->data+left, ring, size - left); + } else +#endif + memcpy(skb->data, ring + offset, size); +} - rx_ring = tp->rx_ring; - cur_rx = tp->cur_rx; +static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, + int budget) +{ + 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 ring_offset = cur_rx % RX_BUF_LEN; u32 rx_status; unsigned int rx_size; unsigned int pkt_size; struct sk_buff *skb; + u16 status; rmb(); @@ -1941,9 +1970,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 @@ -1951,55 +1980,66 @@ * 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. */ + wrap_copy(skb, rx_ring, ring_offset+4, pkt_size); - eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0); 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); + 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; } @@ -2025,14 +2065,12 @@ 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)) + if (status & RxUnderrun) tp->stats.rx_fifo_errors++; if (status & PCIErr) { u16 pci_cmd_status; @@ -2044,6 +2082,39 @@ } } +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; + + spin_lock(&tp->rx_lock); + 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) { + /* + * Order is important since data can get interrupted + * again when we think we are done. + */ + local_irq_disable(); + netif_rx_complete(dev); + RTL_W16_F(IntrMask, rtl8139_intr_mask); + local_irq_enable(); + } + spin_unlock(&tp->rx_lock); + + return !done; +} /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -2052,69 +2123,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); - if (netif_msg_intr(tp)) - printk (KERN_DEBUG "%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 davem@pizda.ninka.net Tue Nov 18 16:57:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 16:57: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 hAJ0vO25025724 for ; Tue, 18 Nov 2003 16:57:32 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA24600; Tue, 18 Nov 2003 16:49:44 -0800 Date: Tue, 18 Nov 2003 16:49:44 -0800 From: "David S. Miller" To: Andrew Morton Cc: reuben-linux@reub.net, netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-Id: <20031118164944.54544c39.davem@redhat.com> In-Reply-To: <20031118110139.45f2be60.akpm@osdl.org> References: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.net> <20031118110139.45f2be60.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: 1528 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, 18 Nov 2003 11:01:39 -0800 Andrew Morton wrote: > It's one for the networking guys. > > The mm kernels have a patch which detects when atomic_dec_and_test > takes an atomic_t negative - it is assumed that this is a bug so > a warning is generated. Andrew I've analyzed this a bit. This is incredible evidence in these dumps that either there is a bug in Linus's atomic_dec_and_test() debugging hack or GCC is miscompiling it in certain cases with certain versions of the compiler. Look at this: > > Nov 18 23:09:00 tornado kernel: [] skb_release_data+0x14c/0x160 > > Nov 18 23:09:00 tornado kernel: [] kfree_skbmem+0x13/0x30 > > Nov 18 23:09:00 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > > Nov 18 23:09:00 tornado kernel: [] e100intr+0x1e5/0x290 Ok, releasing an SKB data area twice. > > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef Freeing a 'dst' entry one too many times. > > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket dfd4c780 A socket refcount dropping to zero too early, before it's marked dead. These last two problems are very serious errors, and would have printed out debugging messages before the atomic_dec_and_test() patch. If these last two messages don't show up without the atomic_dec_and_test() debugging patch applied, well there you go... :-) In that debugging patch, I'm wondering something about x86. When one goes "sete %reg; sets %reg" does the first 'sete' modify the condition codes by chance? Probably not... From davem@pizda.ninka.net Tue Nov 18 17:06:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:07: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 hAJ16x25026181 for ; Tue, 18 Nov 2003 17:06:59 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA24626; Tue, 18 Nov 2003 16:59:09 -0800 Date: Tue, 18 Nov 2003 16:59:09 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [IPV4] Always set hoplimit Message-Id: <20031118165909.788d5388.davem@redhat.com> In-Reply-To: <20031113110438.GA29522@gondor.apana.org.au> References: <20031113110438.GA29522@gondor.apana.org.au> 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: 1529 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, 13 Nov 2003 22:04:38 +1100 Herbert Xu wrote: > Is there any reason why local/broadcast packets should have a ttl of zero? > This is the result of the HOPLIMIT change as those packets doesn't get > their HOPLIMIT set. This patch sets it for them. > > Am I missing something? I don't believe I changed this behavior intentionally. Let me look into the revision history to verify that. I'm likely going to apply your fix tonight, thanks. Although it is an interesting question because both broadcasts and locally destined packets have no reason to make it past the local subnet and thus have their TTL/HOPLIMIT decremented or tested. I therefore cannot imagine a case where the current behavior would cause a problem. Did you run into an actual problem that led you to this issue? If so, what was it? Or was this just determined by pure code review? From herbert@gondor.apana.org.au Tue Nov 18 17:08:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:08:56 -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 hAJ18e25026442 for ; Tue, 18 Nov 2003 17:08:42 -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 1AMGpZ-0001bm-00; Wed, 19 Nov 2003 12:08:29 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AMGpX-0006f9-00; Wed, 19 Nov 2003 12:08:27 +1100 Date: Wed, 19 Nov 2003 12:08:27 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [IPV4] Always set hoplimit Message-ID: <20031119010827.GA25593@gondor.apana.org.au> References: <20031113110438.GA29522@gondor.apana.org.au> <20031118165909.788d5388.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031118165909.788d5388.davem@redhat.com> User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1530 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 On Tue, Nov 18, 2003 at 04:59:09PM -0800, David S. Miller wrote: > > Did you run into an actual problem that led you to this issue? If > so, what was it? Or was this just determined by pure code review? Someone reported this problem to me after a picky firewall complained about getting broadcast packets with ttl == 0. 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 From davem@pizda.ninka.net Tue Nov 18 17:13:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:14: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 hAJ1Dc25026908 for ; Tue, 18 Nov 2003 17:13:45 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24684; Tue, 18 Nov 2003 17:05:33 -0800 Date: Tue, 18 Nov 2003 17:05:33 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [IPV4] Always set hoplimit Message-Id: <20031118170533.64f53889.davem@redhat.com> In-Reply-To: <20031119010827.GA25593@gondor.apana.org.au> References: <20031113110438.GA29522@gondor.apana.org.au> <20031118165909.788d5388.davem@redhat.com> <20031119010827.GA25593@gondor.apana.org.au> 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: 1531 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, 19 Nov 2003 12:08:27 +1100 Herbert Xu wrote: > On Tue, Nov 18, 2003 at 04:59:09PM -0800, David S. Miller wrote: > > > > Did you run into an actual problem that led you to this issue? If > > so, what was it? Or was this just determined by pure code review? > > Someone reported this problem to me after a picky firewall complained > about getting broadcast packets with ttl == 0. Ok, that doubly-justifies the fix. Thanks again Herbert. From dlstevens@us.ibm.com Tue Nov 18 17:19:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:19:50 -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 hAJ1JT25027266 for ; Tue, 18 Nov 2003 17:19:36 -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 hAJ1JNIw352658; Tue, 18 Nov 2003 20:19:23 -0500 Received: from d03nm121.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 hAJ1JM8U160430; Tue, 18 Nov 2003 18:19:23 -0700 Importance: Normal Sensitivity: Subject: MLDv2 MRC timer wrong units [PATCH] To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Tue, 18 Nov 2003 18:19:20 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/18/2003 18:19:22 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE770DF96454E8f9e8a93df938690918c07BBE770DF96454E" Content-Disposition: inline X-archive-position: 1532 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev --0__=07BBE770DF96454E8f9e8a93df938690918c07BBE770DF96454E Content-type: text/plain; charset=US-ASCII The MLD max response code is computing in units of 1/10th second, as in IGMPv3, but for MLD, it should be in milliseconds. Patch below. +-DLS --- linux-2.6.0-test9-bk12/net/ipv6/mcast.c 2003-11-07 14:13:21.000000000 -0800 +++ linux-2.6.0-test9-bk12F1/net/ipv6/mcast.c 2003-11-18 16:55:07.801413776 -0800 @@ -1040,7 +1040,7 @@ /* MLDv1 router present */ /* Translate milliseconds to jiffies */ - max_delay = ntohs(hdr->icmp6_maxdelay)*(HZ/10); + max_delay = (ntohs(hdr->icmp6_maxdelay)*HZ)/1000; switchback = (idev->mc_qrv + 1) * max_delay; idev->mc_v1_seen = jiffies + switchback; @@ -1052,7 +1052,7 @@ /* clear deleted report items */ mld_clear_delrec(idev); } else if (len >= 28) { - max_delay = MLDV2_MRC(ntohs(mlh2->mrc))*(HZ/10); + max_delay = (MLDV2_MRC(ntohs(mlh2->mrc))*HZ)/1000; if (!max_delay) max_delay = 1; idev->mc_maxdelay = max_delay; (See attached file: mld2fix.patch) --0__=07BBE770DF96454E8f9e8a93df938690918c07BBE770DF96454E Content-type: application/octet-stream; name="mld2fix.patch" Content-Disposition: attachment; filename="mld2fix.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMTIvbmV0L2lwdjYvbWNhc3QuYwkyMDAzLTExLTA3IDE0 OjEzOjIxLjAwMDAwMDAwMCAtMDgwMAorKysgbGludXgtMi42LjAtdGVzdDktYmsxMkYxL25ldC9p cHY2L21jYXN0LmMJMjAwMy0xMS0xOCAxNjo1NTowNy44MDE0MTM3NzYgLTA4MDAKQEAgLTEwNDAs NyArMTA0MCw3IEBACiAJCS8qIE1MRHYxIHJvdXRlciBwcmVzZW50ICovCiAKIAkJLyogVHJhbnNs YXRlIG1pbGxpc2Vjb25kcyB0byBqaWZmaWVzICovCi0JCW1heF9kZWxheSA9IG50b2hzKGhkci0+ aWNtcDZfbWF4ZGVsYXkpKihIWi8xMCk7CisJCW1heF9kZWxheSA9IChudG9ocyhoZHItPmljbXA2 X21heGRlbGF5KSpIWikvMTAwMDsKIAogCQlzd2l0Y2hiYWNrID0gKGlkZXYtPm1jX3FydiArIDEp ICogbWF4X2RlbGF5OwogCQlpZGV2LT5tY192MV9zZWVuID0gamlmZmllcyArIHN3aXRjaGJhY2s7 CkBAIC0xMDUyLDcgKzEwNTIsNyBAQAogCQkvKiBjbGVhciBkZWxldGVkIHJlcG9ydCBpdGVtcyAq LwogCQltbGRfY2xlYXJfZGVscmVjKGlkZXYpOwogCX0gZWxzZSBpZiAobGVuID49IDI4KSB7Ci0J CW1heF9kZWxheSA9IE1MRFYyX01SQyhudG9ocyhtbGgyLT5tcmMpKSooSFovMTApOworCQltYXhf ZGVsYXkgPSAoTUxEVjJfTVJDKG50b2hzKG1saDItPm1yYykpKkhaKS8xMDAwOwogCQlpZiAoIW1h eF9kZWxheSkKIAkJCW1heF9kZWxheSA9IDE7CiAJCWlkZXYtPm1jX21heGRlbGF5ID0gbWF4X2Rl bGF5Owo= --0__=07BBE770DF96454E8f9e8a93df938690918c07BBE770DF96454E-- From reuben-linux@reub.net Tue Nov 18 17:23:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:23:59 -0800 (PST) Received: from tornado.reub.net (219-88-72-199.adsl.xtra.co.nz [219.88.72.199]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJ1Nh25027629 for ; Tue, 18 Nov 2003 17:23:44 -0800 Received: (qmail 8494 invoked from network); 19 Nov 2003 01:23:40 -0000 Received: from unknown (HELO dc00241.reub.net) (202.37.49.110) by tornado.reub.net with SMTP; 19 Nov 2003 01:23:40 -0000 Message-Id: <6.0.1.1.0.20031119141720.024aaf20@tornado.reub.net> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Wed, 19 Nov 2003 14:22:40 +1300 To: "David S. Miller" , Andrew Morton From: Reuben Farrelly Subject: Re: Kernel crash in 2.6.0-test9-mm3 Cc: netdev@oss.sgi.com In-Reply-To: <20031118164944.54544c39.davem@redhat.com> References: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.net> <20031118110139.45f2be60.akpm@osdl.org> <20031118164944.54544c39.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-archive-position: 1533 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: reuben-linux@reub.net Precedence: bulk X-list: netdev FWIW I'm compiling with: [root@tornado log]# gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031107 (Red Hat Linux 3.3.2-2) [root@tornado log]# Reuben At 13:49 19/11/2003, David S. Miller wrote: >On Tue, 18 Nov 2003 11:01:39 -0800 >Andrew Morton wrote: > > > It's one for the networking guys. > > > > The mm kernels have a patch which detects when atomic_dec_and_test > > takes an atomic_t negative - it is assumed that this is a bug so > > a warning is generated. > >Andrew I've analyzed this a bit. This is incredible evidence in >these dumps that either there is a bug in Linus's atomic_dec_and_test() >debugging hack or GCC is miscompiling it in certain cases with certain >versions of the compiler. > >Look at this: > > > > Nov 18 23:09:00 tornado kernel: [] > skb_release_data+0x14c/0x160 > > > Nov 18 23:09:00 tornado kernel: [] kfree_skbmem+0x13/0x30 > > > Nov 18 23:09:00 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > > > Nov 18 23:09:00 tornado kernel: [] e100intr+0x1e5/0x290 > >Ok, releasing an SKB data area twice. > > > > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef > >Freeing a 'dst' entry one too many times. > > > > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket > dfd4c780 > >A socket refcount dropping to zero too early, before it's marked dead. > >These last two problems are very serious errors, and would have >printed out debugging messages before the atomic_dec_and_test() patch. >If these last two messages don't show up without the >atomic_dec_and_test() debugging patch applied, well there you >go... :-) > >In that debugging patch, I'm wondering something about x86. >When one goes "sete %reg; sets %reg" does the first 'sete' modify >the condition codes by chance? Probably not... From davem@pizda.ninka.net Tue Nov 18 17:28:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:28: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 hAJ1Ro25028021 for ; Tue, 18 Nov 2003 17:27:55 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24792; Tue, 18 Nov 2003 17:19:52 -0800 Date: Tue, 18 Nov 2003 17:19:52 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [UPDATED PATCH]: Adjust qlen when grafting in multiple qdiscs Message-Id: <20031118171952.7c990eb3.davem@redhat.com> In-Reply-To: <3FB96930.9020300@trash.net> References: <3FB3996A.6080008@trash.net> <1069076786.1075.19.camel@jzny.localdomain> <3FB8DDE0.1070105@trash.net> <1069081153.1022.20.camel@jzny.localdomain> <3FB8F3BF.6050509@trash.net> <1069090210.1022.64.camel@jzny.localdomain> <20031117163834.V1330@almesberger.net> <3FB96930.9020300@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: 1534 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, 18 Nov 2003 01:34:56 +0100 Patrick McHardy wrote: > this patch fixes multiple qdiscs to adjust sch->q.qlen when > replacing a non-empty inner qdisc. The only change to the > first patch is in dsmark_graft: this patch directly sets > sch->q.qlen to 0 instead of subtracting the length of the > inner qdisc. Applied, thanks Patrick. I'll stick this into my 2.4.24-pre1 queue as well. Thanks again. From davem@pizda.ninka.net Tue Nov 18 17:33:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:33:36 -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 hAJ1X825028387 for ; Tue, 18 Nov 2003 17:33:17 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24827; Tue, 18 Nov 2003 17:25:27 -0800 Date: Tue, 18 Nov 2003 17:25:27 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH]: Fix tbf_reset Message-Id: <20031118172527.5c2c0a1f.davem@redhat.com> In-Reply-To: <3FB39990.3000205@trash.net> References: <3FB39990.3000205@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: 1535 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, 13 Nov 2003 15:47:44 +0100 Patrick McHardy wrote: > This patch fixes TBF purging an unused queue in tbf_reset instead > of resetting q.qlen. I haven't checked the history, but it looks > like this place was forgotten when making TBF classful. Yes, the bug was introduced when adding inner-qdisc attaching support to TBF. Thanks for tracking this down Patrick, patch applied. From davem@pizda.ninka.net Tue Nov 18 17:43:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:43:22 -0800 (PST) Received: from pizda.ninka.net (pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJ1gs25028820 for ; Tue, 18 Nov 2003 17:43:03 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24863; Tue, 18 Nov 2003 17:34:57 -0800 Date: Tue, 18 Nov 2003 17:34:57 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: kaber@trash.net, netdev@oss.sgi.com Subject: Re: [PATCH]: fix queue limits in multiple qdiscs Message-Id: <20031118173457.5c85c671.davem@redhat.com> In-Reply-To: <1069081284.1024.23.camel@jzny.localdomain> References: <3FB39A2D.5020000@trash.net> <1069076955.1076.23.camel@jzny.localdomain> <3FB8DF9F.7030509@trash.net> <1069081284.1024.23.camel@jzny.localdomain> 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: 1536 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 17 Nov 2003 10:01:24 -0500 jamal wrote: > Like i said it is valid - but i wouldnt go out of my way to fix it > (especially when 2.6 is frozen). I agree with this sentiment, but only in part. Considering: 1) The output from 'tc' is very confusing and quite stupid. 2) Patrick did all the work to fix this bug. 3) His patch is %100 straight forward, simply, and easy to verify. I am going to apply his patch. Thanks Patrick. From davem@pizda.ninka.net Tue Nov 18 17:44:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:45: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 hAJ1ig25029087 for ; Tue, 18 Nov 2003 17:44:51 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24870; Tue, 18 Nov 2003 17:37:00 -0800 Date: Tue, 18 Nov 2003 17:37:00 -0800 From: "David S. Miller" To: Patrick McHardy Cc: devik@cdi.cz, netdev@oss.sgi.com Subject: Re: [PATCH]: Check for leaf-class when classifying by priority Message-Id: <20031118173700.213b646b.davem@redhat.com> In-Reply-To: <3FB39CA2.401@trash.net> References: <3FB39CA2.401@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: 1537 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, 13 Nov 2003 16:00:50 +0100 Patrick McHardy wrote: > this patch makes htb_classify check if a class is a leaf when classifying > by priority. It also adds a check from cbq to skip htb_find if the majors > of skb->priority and sch->handle differ. I'm going to hold on this patch for two reasons: 1) To allow Martin to respond and review it. 2) I want the OOPS'er we have pending on the HTB scheduler resolved first. Martin, have you made any progress with that HTB 2.6.x oops issue yet? Thanks guys. From davem@pizda.ninka.net Tue Nov 18 17:53:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:53: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 hAJ1rU25029621 for ; Tue, 18 Nov 2003 17:53:31 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24901; Tue, 18 Nov 2003 17:46:12 -0800 Date: Tue, 18 Nov 2003 17:46:12 -0800 From: "David S. Miller" To: Petr Vandrovec Cc: herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-Id: <20031118174612.48c0854e.davem@redhat.com> In-Reply-To: <20031118132137.GA23732@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> <20031117123047.55377d3a.davem@redhat.com> <20031118132137.GA23732@vana.vc.cvut.cz> 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: 1538 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, 18 Nov 2003 14:21:37 +0100 Petr Vandrovec wrote: > On Mon, Nov 17, 2003 at 12:30:47PM -0800, David S. Miller wrote: > > Remind me again why the vmnet driver can't just run skb_checksum() > > on packets that have CHECKSUM_HW set? > > Because vmnet driver (for bridged networking) is hooked through dev_add_pack. > Place where to put checksum is defined as skb->h.raw + skb->csum, and what > to checksum as skb->h.raw ... skb->data + skb->len. But unfortunately > dev_queue_xmit_nit replaces skb2->h.raw with skb2->nh.raw - and so hook > has to look at the packet contents to compute h.raw from packet data and > protocol type. Thanks so much for reminding me. I'd like to resolve this. One solution is evident, let me know what you think about the following idea. How about we add a flag the the packet_type structure, called PTYPE_FLAG_NEEDCHECKSUM. If it is set, we run skb_checksum() on CHECKSUM_HW SKBs and do not mangle the skb2->h.raw etc. pointers, then we pass it into ptype->func(). In this way all existing ptype->func() implementations get what they expect. Only if the flag is set will the new behavior occur. Comments? From davem@pizda.ninka.net Tue Nov 18 17:55:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 17:55: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 hAJ1tT25030003 for ; Tue, 18 Nov 2003 17:55:29 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA24941; Tue, 18 Nov 2003 17:47:50 -0800 Date: Tue, 18 Nov 2003 17:47:50 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: MLDv2 MRC timer wrong units [PATCH] Message-Id: <20031118174750.0f097ab1.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: 1539 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, 18 Nov 2003 18:19:20 -0700 David Stevens wrote: > The MLD max response code is computing in units of 1/10th second, > as in IGMPv3, but for MLD, it should be in milliseconds. Patch below. I will apply this, thanks David. From akpm@osdl.org Tue Nov 18 18:01:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 18:02: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 hAJ21p25030506 for ; Tue, 18 Nov 2003 18:01:51 -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 hAJ21ZC11283; Tue, 18 Nov 2003 18:01:35 -0800 Date: Tue, 18 Nov 2003 18:02:08 -0800 From: Andrew Morton To: "David S. Miller" Cc: reuben-linux@reub.net, netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-Id: <20031118180208.55eb0a14.akpm@osdl.org> In-Reply-To: <20031118164944.54544c39.davem@redhat.com> References: <6.0.1.1.2.20031118232152.01ae5728@tornado.reub.net> <20031118110139.45f2be60.akpm@osdl.org> <20031118164944.54544c39.davem@redhat.com> 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: 1540 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: > > On Tue, 18 Nov 2003 11:01:39 -0800 > Andrew Morton wrote: > > > It's one for the networking guys. > > > > The mm kernels have a patch which detects when atomic_dec_and_test > > takes an atomic_t negative - it is assumed that this is a bug so > > a warning is generated. > > Andrew I've analyzed this a bit. This is incredible evidence in > these dumps that either there is a bug in Linus's atomic_dec_and_test() > debugging hack or GCC is miscompiling it in certain cases with certain > versions of the compiler. > > Look at this: > > > > Nov 18 23:09:00 tornado kernel: [] skb_release_data+0x14c/0x160 > > > Nov 18 23:09:00 tornado kernel: [] kfree_skbmem+0x13/0x30 > > > Nov 18 23:09:00 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > > > Nov 18 23:09:00 tornado kernel: [] e100intr+0x1e5/0x290 > > Ok, releasing an SKB data area twice. > > > > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef > > Freeing a 'dst' entry one too many times. > > > > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket dfd4c780 > > A socket refcount dropping to zero too early, before it's marked dead. > > These last two problems are very serious errors, and would have > printed out debugging messages before the atomic_dec_and_test() patch. > If these last two messages don't show up without the > atomic_dec_and_test() debugging patch applied, well there you > go... :-) > > In that debugging patch, I'm wondering something about x86. > When one goes "sete %reg; sets %reg" does the first 'sete' modify > the condition codes by chance? Probably not... Beats me David. This is the only time where the correctness of that patch has been questioned. Reuben, can you please do a patch -R of ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test9/2.6.0-test9-mm3/broken-out/atomic_dec-debug.patch and see if the problem goes away? From kumarkr@us.ibm.com Tue Nov 18 18:23:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 18:23:44 -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 hAJ2NU25031091 for ; Tue, 18 Nov 2003 18:23:30 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAJ2NOH5296150; Tue, 18 Nov 2003 21:23:24 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAJ2NMjo329118; Tue, 18 Nov 2003 19:23:23 -0700 Subject: Re: Kernel crash in 2.6.0-test9-mm3 To: Reuben Farrelly Cc: Andrew Morton , "David S. Miller" , netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Tue, 18 Nov 2003 18:22:42 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2HF92 | October 15, 2003) at 11/18/2003 19:23:23 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1541 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 Could this be happening on an SMP system only ? If so, e100intr routine services tx queues (e100_tx_srv) without holding a lock. Can't multiple rx interrupts be scheduled on different cpus at the same time, and each execute dev_kfree_skb_irq() which decrements the ref count too many times ? But the softirq handler (net_tx_action) seems to clean up the skb once as the dec_test returns 1 only if count is zero, so I don't see where the dst ref is being decremented wrongly in this case. Can someone explain why the intr handler doesn't need locks to stop other intr on different cpu's from going through the same devices memory at the same time ? Thanks, - KK |---------+----------------------------> | | Reuben Farrelly | | | | | | Sent by: | | | netdev-bounce@oss| | | .sgi.com | | | | | | | | | 11/18/2003 05:22 | | | PM | | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------| | | | To: "David S. Miller" , Andrew Morton | | cc: netdev@oss.sgi.com | | Subject: Re: Kernel crash in 2.6.0-test9-mm3 | | | >-----------------------------------------------------------------------------------------------------------------| FWIW I'm compiling with: [root@tornado log]# gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031107 (Red Hat Linux 3.3.2-2) [root@tornado log]# Reuben At 13:49 19/11/2003, David S. Miller wrote: >On Tue, 18 Nov 2003 11:01:39 -0800 >Andrew Morton wrote: > > > It's one for the networking guys. > > > > The mm kernels have a patch which detects when atomic_dec_and_test > > takes an atomic_t negative - it is assumed that this is a bug so > > a warning is generated. > >Andrew I've analyzed this a bit. This is incredible evidence in >these dumps that either there is a bug in Linus's atomic_dec_and_test() >debugging hack or GCC is miscompiling it in certain cases with certain >versions of the compiler. > >Look at this: > > > > Nov 18 23:09:00 tornado kernel: [] > skb_release_data+0x14c/0x160 > > > Nov 18 23:09:00 tornado kernel: [] kfree_skbmem+0x13/0x30 > > > Nov 18 23:09:00 tornado kernel: [] __kfree_skb+0xb8/0x1b0 > > > Nov 18 23:09:00 tornado kernel: [] e100intr+0x1e5/0x290 > >Ok, releasing an SKB data area twice. > > > > Nov 18 23:09:00 tornado kernel: BUG: dst underflow 0: c02921ef > >Freeing a 'dst' entry one too many times. > > > > Nov 18 23:09:00 tornado kernel: Attempt to release alive inet socket > dfd4c780 > >A socket refcount dropping to zero too early, before it's marked dead. > >These last two problems are very serious errors, and would have >printed out debugging messages before the atomic_dec_and_test() patch. >If these last two messages don't show up without the >atomic_dec_and_test() debugging patch applied, well there you >go... :-) > >In that debugging patch, I'm wondering something about x86. >When one goes "sete %reg; sets %reg" does the first 'sete' modify >the condition codes by chance? Probably not... From davem@pizda.ninka.net Tue Nov 18 18:32:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 18:32: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 hAJ2WS25031504 for ; Tue, 18 Nov 2003 18:32:32 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA25061; Tue, 18 Nov 2003 18:24:42 -0800 Date: Tue, 18 Nov 2003 18:24:42 -0800 From: "David S. Miller" To: Krishna Kumar , scott.feldman@intel.com Cc: reuben-linux@reub.net, akpm@osdl.org, netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-Id: <20031118182442.7e9ea7e9.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: 1542 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, 18 Nov 2003 18:22:42 -0800 Krishna Kumar wrote: > Could this be happening on an SMP system only ? If so, e100intr routine > services tx queues (e100_tx_srv) without holding a lock. [ Scott we have a bug report, and we're trying to determine if the cause is that the e100 driver frees a TX SKB multiple times due to some race or other problem in current 2.6.x ] That's a very good point, and I looked a bit in this area. When e100intr() is doing it's work, it disables and clears the interrupt, only after doing RX and TX processing does it reenable chip interrupts via e100_set_intr_mask(). That is my analysis of the situation. However, with things like IOAPIC and such, it might be possible for two cpus to enter e100intr() simultaneously, both read the same status, both see that the interrupt is pending, and both thus process the interrupt and race with each other. Scott, what prevents the above from happening? From reuben-linux@reub.net Tue Nov 18 18:59:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 18:59:51 -0800 (PST) Received: from tornado.reub.net (219-88-72-199.adsl.xtra.co.nz [219.88.72.199]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJ2xM25032229 for ; Tue, 18 Nov 2003 18:59:23 -0800 Received: (qmail 17862 invoked from network); 19 Nov 2003 02:59:18 -0000 Received: from unknown (HELO dc00241.reub.net) (202.37.49.110) by tornado.reub.net with SMTP; 19 Nov 2003 02:59:18 -0000 Message-Id: <6.0.1.1.0.20031119155347.023f89d0@tornado.reub.net> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Wed, 19 Nov 2003 15:58:18 +1300 To: Krishna Kumar From: Reuben Farrelly Subject: Re: Kernel crash in 2.6.0-test9-mm3 Cc: Andrew Morton , "David S. Miller" , netdev@oss.sgi.com In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-archive-position: 1543 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: reuben-linux@reub.net Precedence: bulk X-list: netdev The system is a UP system.. # CONFIG_SMP is not set CONFIG_PREEMPT=y CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y I've put the full .config up at http://www.reub.net/linux/ Reuben At 15:22 19/11/2003, Krishna Kumar wrote: >Could this be happening on an SMP system only ? If so, e100intr routine >services tx queues (e100_tx_srv) >without holding a lock. Can't multiple rx interrupts be scheduled on >different cpus at the same time, and >each execute dev_kfree_skb_irq() which decrements the ref count too many >times ? But the softirq handler >(net_tx_action) seems to clean up the skb once as the dec_test returns 1 >only if count is zero, so I don't see >where the dst ref is being decremented wrongly in this case. From jmorris@redhat.com Tue Nov 18 19:35:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 19:35:15 -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 hAJ3Yx25000409 for ; Tue, 18 Nov 2003 19:34:59 -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 hAJ3YkH21220; Tue, 18 Nov 2003 22:34:46 -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 hAJ3Yiw09680; Tue, 18 Nov 2003 22:34:44 -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 hAJ3YeDJ026655; Tue, 18 Nov 2003 22:34:40 -0500 Date: Tue, 18 Nov 2003 22:34:40 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: "David S. Miller" cc: Petr Vandrovec , , Subject: Re: af_packet & CHECKSUM_HW In-Reply-To: <20031118174612.48c0854e.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1544 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, 18 Nov 2003, David S. Miller wrote: > In this way all existing ptype->func() implementations get what > they expect. Only if the flag is set will the new behavior occur. > > Comments? Sounds good. - James -- James Morris From dlstevens@us.ibm.com Tue Nov 18 20:55:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 20:56:11 -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 hAJ4tn25004299 for ; Tue, 18 Nov 2003 20:55:56 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAJ4thH5342162; Tue, 18 Nov 2003 23:55:43 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAJ4thru292214; Tue, 18 Nov 2003 21:55:43 -0700 Importance: Normal Sensitivity: Subject: MLDv1 /proc/net/igmp6 timer printing [PATCH] To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Tue, 18 Nov 2003 21:55:40 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/18/2003 21:55:43 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE770DF89FDC58f9e8a93df938690918c07BBE770DF89FDC5" Content-Disposition: inline X-archive-position: 1545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev --0__=07BBE770DF89FDC58f9e8a93df938690918c07BBE770DF89FDC5 Content-type: text/plain; charset=US-ASCII Dave, This is a bug, but mostly cosmetic, and it appears to have been there forever. It wasted a couple minutes for me because I expected the igmp6 file would list the timer correctly when it's running, but because of this bug, it doesn't. Let me know if I should hold it until later. The problem is the IPv6 multicast address flag "MAF_TIMER_RUNNING" is set on a join_group, and cleared by a report, but is never set again (e.g., from a query). The timer is set and running, but the /proc entry won't show it because it only reports the time left on the timer if the flag is set. Fix is to set the flag when the timer is set. +-DLS --- linux-2.6.0-test9-bk12/net/ipv6/mcast.c 2003-11-07 14:13:21.000000000 -0800 +++ linux-2.6.0-test9-bk12F1/net/ipv6/mcast.c 2003-11-18 20:38:00.000000000 -0800 @@ -978,6 +978,7 @@ ma->mca_timer.expires = jiffies + delay; if (!mod_timer(&ma->mca_timer, jiffies + delay)) atomic_inc(&ma->mca_refcnt); + ma->mca_flags |= MAF_TIMER_RUNNING; } static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, (See attached file: mldtr.patch) --0__=07BBE770DF89FDC58f9e8a93df938690918c07BBE770DF89FDC5 Content-type: application/octet-stream; name="mldtr.patch" Content-Disposition: attachment; filename="mldtr.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMTIvbmV0L2lwdjYvbWNhc3QuYwkyMDAzLTExLTA3IDE0 OjEzOjIxLjAwMDAwMDAwMCAtMDgwMAorKysgbGludXgtMi42LjAtdGVzdDktYmsxMkYxL25ldC9p cHY2L21jYXN0LmMJMjAwMy0xMS0xOCAyMDozODowMC4wMDAwMDAwMDAgLTA4MDAKQEAgLTk3OCw2 ICs5NzgsNyBAQAogCW1hLT5tY2FfdGltZXIuZXhwaXJlcyA9IGppZmZpZXMgKyBkZWxheTsKIAlp ZiAoIW1vZF90aW1lcigmbWEtPm1jYV90aW1lciwgamlmZmllcyArIGRlbGF5KSkKIAkJYXRvbWlj X2luYygmbWEtPm1jYV9yZWZjbnQpOworCW1hLT5tY2FfZmxhZ3MgfD0gTUFGX1RJTUVSX1JVTk5J Tkc7CiB9CiAKIHN0YXRpYyB2b2lkIG1sZF9tYXJrc291cmNlcyhzdHJ1Y3QgaWZtY2FkZHI2ICpw bWMsIGludCBuc3JjcywK --0__=07BBE770DF89FDC58f9e8a93df938690918c07BBE770DF89FDC5-- From davem@pizda.ninka.net Tue Nov 18 23:04:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 23:04:56 -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 hAJ74b25006311 for ; Tue, 18 Nov 2003 23:04:37 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA25486; Tue, 18 Nov 2003 22:57:18 -0800 Date: Tue, 18 Nov 2003 22:57:18 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: MLDv1 /proc/net/igmp6 timer printing [PATCH] Message-Id: <20031118225718.25686a30.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: 1546 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, 18 Nov 2003 21:55:40 -0700 David Stevens wrote: > The problem is the IPv6 multicast address flag > "MAF_TIMER_RUNNING" is set on a join_group, and cleared > by a report, but is never set again (e.g., from a query). The timer > is set and running, but the /proc entry won't show it because it > only reports the time left on the timer if the flag is set. > Fix is to set the flag when the timer is set. I want to apply this, but I'd like to ask you to fix a related issue at the same time. The jiffies reported to userspace by this multicast code does not convert HZ to USER_HZ, just include linux/times.h and use jiffies_to_clock_t(). We recently had to fix similar issues in other networking procfs files. Thanks David. From dlstevens@us.ibm.com Tue Nov 18 23:59:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Nov 2003 23:59:49 -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 hAJ7xT25007157 for ; Tue, 18 Nov 2003 23:59:36 -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 hAJ7xNkF246932; Wed, 19 Nov 2003 02:59:23 -0500 Received: from d03nm121.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 hAJ7xM8S150620; Wed, 19 Nov 2003 00:59:23 -0700 Importance: Normal Sensitivity: Subject: Re: MLDv1 /proc/net/igmp6 timer printing [PATCH] To: "David S. Miller" Cc: netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Wed, 19 Nov 2003 00:59:20 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/19/2003 00:59:22 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE770DFB82FF08f9e8a93df938690918c07BBE770DFB82FF0" Content-Disposition: inline X-archive-position: 1547 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev --0__=07BBE770DFB82FF08f9e8a93df938690918c07BBE770DFB82FF0 Content-type: text/plain; charset=US-ASCII Ok, here's the revised patch. +-DLS --- linux-2.6.0-test9-bk23/net/ipv6/mcast.c 2003-11-18 23:20:56.000000000 -0800 +++ linux-2.6.0-test9-bk23F1/net/ipv6/mcast.c 2003-11-18 23:30:18.573414608 -0800 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -978,6 +979,7 @@ ma->mca_timer.expires = jiffies + delay; if (!mod_timer(&ma->mca_timer, jiffies + delay)) atomic_inc(&ma->mca_refcnt); + ma->mca_flags |= MAF_TIMER_RUNNING; } static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, @@ -2157,7 +2159,8 @@ state->dev->ifindex, state->dev->name, NIP6(im->mca_addr), im->mca_users, im->mca_flags, - (im->mca_flags&MAF_TIMER_RUNNING) ? im->mca_timer.expires-jiffies : 0); + (im->mca_flags&MAF_TIMER_RUNNING) ? + jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0); return 0; } (See attached file: mld2tr2.patch) --0__=07BBE770DFB82FF08f9e8a93df938690918c07BBE770DFB82FF0 Content-type: application/octet-stream; name="mld2tr2.patch" Content-Disposition: attachment; filename="mld2tr2.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMjMvbmV0L2lwdjYvbWNhc3QuYwkyMDAzLTExLTE4IDIz OjIwOjU2LjAwMDAwMDAwMCAtMDgwMAorKysgbGludXgtMi42LjAtdGVzdDktYmsyM0YxL25ldC9p cHY2L21jYXN0LmMJMjAwMy0xMS0xOCAyMzozMDoxOC41NzM0MTQ2MDggLTA4MDAKQEAgLTM2LDYg KzM2LDcgQEAKICNpbmNsdWRlIDxsaW51eC9zb2NrZXQuaD4KICNpbmNsdWRlIDxsaW51eC9zb2Nr aW9zLmg+CiAjaW5jbHVkZSA8bGludXgvamlmZmllcy5oPgorI2luY2x1ZGUgPGxpbnV4L3RpbWVz Lmg+CiAjaW5jbHVkZSA8bGludXgvbmV0Lmg+CiAjaW5jbHVkZSA8bGludXgvaW4uaD4KICNpbmNs dWRlIDxsaW51eC9pbjYuaD4KQEAgLTk3OCw2ICs5NzksNyBAQAogCW1hLT5tY2FfdGltZXIuZXhw aXJlcyA9IGppZmZpZXMgKyBkZWxheTsKIAlpZiAoIW1vZF90aW1lcigmbWEtPm1jYV90aW1lciwg amlmZmllcyArIGRlbGF5KSkKIAkJYXRvbWljX2luYygmbWEtPm1jYV9yZWZjbnQpOworCW1hLT5t Y2FfZmxhZ3MgfD0gTUFGX1RJTUVSX1JVTk5JTkc7CiB9CiAKIHN0YXRpYyB2b2lkIG1sZF9tYXJr c291cmNlcyhzdHJ1Y3QgaWZtY2FkZHI2ICpwbWMsIGludCBuc3JjcywKQEAgLTIxNTcsNyArMjE1 OSw4IEBACiAJCSAgIHN0YXRlLT5kZXYtPmlmaW5kZXgsIHN0YXRlLT5kZXYtPm5hbWUsCiAJCSAg IE5JUDYoaW0tPm1jYV9hZGRyKSwKIAkJICAgaW0tPm1jYV91c2VycywgaW0tPm1jYV9mbGFncywK LQkJICAgKGltLT5tY2FfZmxhZ3MmTUFGX1RJTUVSX1JVTk5JTkcpID8gaW0tPm1jYV90aW1lci5l eHBpcmVzLWppZmZpZXMgOiAwKTsKKwkJICAgKGltLT5tY2FfZmxhZ3MmTUFGX1RJTUVSX1JVTk5J TkcpID8KKwkJICAgamlmZmllc190b19jbG9ja190KGltLT5tY2FfdGltZXIuZXhwaXJlcy1qaWZm aWVzKSA6IDApOwogCXJldHVybiAwOwogfQogCg== --0__=07BBE770DFB82FF08f9e8a93df938690918c07BBE770DFB82FF0-- From yoshfuji@linux-ipv6.org Wed Nov 19 00:04:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 00:04: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 hAJ84b25007567 for ; Wed, 19 Nov 2003 00:04:38 -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 hAJ850lg007443; Wed, 19 Nov 2003 17:05:00 +0900 Date: Wed, 19 Nov 2003 17:05:00 +0900 (JST) Message-Id: <20031119.170500.33118773.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: MLDv1 /proc/net/igmp6 timer printing [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: 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: 1548 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 (at Wed, 19 Nov 2003 00:59:20 -0700), David Stevens says: > Ok, here's the revised patch. please fix ipv4 as well. Index: net/ipv4/igmp.c =================================================================== RCS file: /cvsroot/usagi/usagi/kernel/linux26/net/ipv4/igmp.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- net/ipv4/igmp.c 9 Oct 2003 02:49:24 -0000 1.20 +++ net/ipv4/igmp.c 19 Nov 2003 07:11:46 -0000 1.21 @@ -2215,7 +2215,7 @@ seq_printf(seq, "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n", im->multiaddr, im->users, - im->tm_running, im->timer.expires-jiffies, im->reporter); + im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter); } return 0; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From greearb@candelatech.com Wed Nov 19 01:25:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 01:25:52 -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 hAJ9PB25011982 for ; Wed, 19 Nov 2003 01:25:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAJ9P6eO002169 for ; Wed, 19 Nov 2003 01:25:06 -0800 Message-ID: <3FBB36F2.7030402@candelatech.com> Date: Wed, 19 Nov 2003 01:25:06 -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: Function to determine if IP exists on a net-device? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1549 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 Is there a method already written that will tell me if an IP exists on a netdevice? If not, I am quite sure the answer lies in the in_ifaddr list, but which field holds the IP address for the device? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From Geert.Uytterhoeven@sonycom.com Wed Nov 19 01:37:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 01:38:12 -0800 (PST) Received: from witte.sonytel.be (witte.sonytel.be [80.88.33.193]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJ9bh25012406 for ; Wed, 19 Nov 2003 01:37:45 -0800 Received: from waterleaf.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id hAJ9bYQG003996; Wed, 19 Nov 2003 10:37:35 +0100 (MET) Date: Wed, 19 Nov 2003 10:37:35 +0100 (MET) From: Geert Uytterhoeven To: Sam Creasey cc: Jeff Garzik , netdev@oss.sgi.com, Linux Kernel , Andrew Morton , Al Viro , Linux/m68k Subject: Re: [BK PATCHES] 2.6.x experimental net driver queue In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1550 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: geert@linux-m68k.org Precedence: bulk X-list: netdev On Wed, 19 Nov 2003, Sam Creasey wrote: > On Tue, 18 Nov 2003, Geert Uytterhoeven wrote: > > On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > > > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > > > Viro. > > > > > > > > No users of init_etherdev remain in the tree. (yay!) > > > > > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > > > drivers: > > > > I forget to test the Sun-3 drivers: > > - sun3_82586.c: > > o add missing casts to iounmap() calls > > o fix parameter of free_netdev() > > - sun3lance.c: add missing casts to iounmap() calls > > > > Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not > > defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed > > to ioremap()? > > Should be... I looked back through a few versions of the code, and I'm > not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented > that line out long ago anyway). (I'm also amazed just how much of that > driver I've forgotten in the last year or two :) OK, so here's a additional patch that fixes that: --- linux/drivers/net/sun3_82586.c.orig 2003-11-19 10:32:09.000000000 +0100 +++ linux/drivers/net/sun3_82586.c 2003-11-19 10:33:44.000000000 +0100 @@ -55,6 +55,7 @@ #define DEBUG /* debug on */ #define SYSBUSVAL 0 /* 16 Bit */ +#define SUN3_82586_TOTAL_SIZE PAGE_SIZE #define sun3_attn586() {*(volatile unsigned char *)(dev->base_addr) |= IEOB_ATTEN; *(volatile unsigned char *)(dev->base_addr) &= ~IEOB_ATTEN;} #define sun3_reset586() {*(volatile unsigned char *)(dev->base_addr) = 0; udelay(100); *(volatile unsigned char *)(dev->base_addr) = IEOB_NORSET;} @@ -298,7 +299,7 @@ if (found) return ERR_PTR(-ENODEV); - ioaddr = (unsigned long)ioremap(IE_OBIO, PAGE_SIZE); + ioaddr = (unsigned long)ioremap(IE_OBIO, SUN3_82586_TOTAL_SIZE); if (!ioaddr) return ERR_PTR(-ENOMEM); found = 1; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From rask@sygehus.dk Wed Nov 19 03:39:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 03:39:32 -0800 (PST) Received: from 0x50a14406.albnxx15.adsl-dhcp.tele.dk (0x50a14406.albnxx15.adsl-dhcp.tele.dk [80.161.68.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJBcl25016469 for ; Wed, 19 Nov 2003 03:39:03 -0800 Received: by 0x50a14406.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 1155242B3; Wed, 19 Nov 2003 12:35:58 +0100 (CET) Date: Wed, 19 Nov 2003 12:35:57 +0100 From: Rask Ingemann Lambertsen To: "'netdev@oss.sgi.com'" Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? Message-ID: <20031119123556.A7622@sygehus.dk> References: <3FB94311.10004@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: <3FB94311.10004@candelatech.com>; from greearb@candelatech.com on Mon, Nov 17, 2003 at 01:52:17PM -0800 X-archive-position: 1552 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 Content-Length: 780 Lines: 19 On Mon, Nov 17, 2003 at 01:52:17PM -0800, Ben Greear wrote: > Is there any interest in adding an Ethtool command to tell the driver to > push the extra 4 bytes of CSUM into the skb? > > When enabling this feature, I'd also like to allow drivers to receive > frames with bad FCS as well. [cut] > At least some hardware appears > to support receiving bad FCS frames (e1000, evidently), but I am not sure > how wide-spread this feature is... The Intel i82586 and i82596 and can be told to receive frames with a bad FCS. They can also be told to send a precomputed FCS rather than computing it on the fly. The i82596 and tulip can also transfer the FCS to memory when receiving frames. I guess all of this is also supported on the i82557/8/9. -- Regards, Rask Ingemann Lambertsen From rask@sygehus.dk Wed Nov 19 03:51:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 03:51:59 -0800 (PST) Received: from 0x50a14406.albnxx15.adsl-dhcp.tele.dk (0x50a14406.albnxx15.adsl-dhcp.tele.dk [80.161.68.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJBpV25016909 for ; Wed, 19 Nov 2003 03:51:42 -0800 Received: by 0x50a14406.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id A24BC42B3; Wed, 19 Nov 2003 12:48:45 +0100 (CET) Date: Wed, 19 Nov 2003 12:48:45 +0100 From: Rask Ingemann Lambertsen To: Alexander Zapatka Cc: netdev@oss.sgi.com Subject: Re: suggested forcedeth updates.... Message-ID: <20031119124845.B7622@sygehus.dk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from alexzapatka@hotmail.com on Mon, Nov 17, 2003 at 11:07:15PM -0500 X-archive-position: 1553 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 Content-Length: 453 Lines: 14 On Mon, Nov 17, 2003 at 11:07:15PM -0500, Alexander Zapatka wrote: > that way you can modprobe/insmod with debug=1 and debuging works... or you > can just load it, or load it with debug=0 and no debuging info is printed. > > just thought it might be a nice addition. Even better would be to use the NETIF_MSG_* flags defined in linux/netdevice.c and to be able to use ethtool to change the setting at runtime. -- Regards, Rask Ingemann Lambertsen From vandrove@vc.cvut.cz Wed Nov 19 04:35:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 04:36:08 -0800 (PST) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJCZq25023066 for ; Wed, 19 Nov 2003 04:35:52 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) with ESMTP id hAJCZavY012529; Wed, 19 Nov 2003 13:35:36 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) id hAJCZZKT012526; Wed, 19 Nov 2003 13:35:35 +0100 Date: Wed, 19 Nov 2003 13:35:35 +0100 From: Petr Vandrovec To: "David S. Miller" Cc: herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-ID: <20031119123535.GA11108@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> <20031117123047.55377d3a.davem@redhat.com> <20031118132137.GA23732@vana.vc.cvut.cz> <20031118174612.48c0854e.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031118174612.48c0854e.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 1554 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 2363 Lines: 52 On Tue, Nov 18, 2003 at 05:46:12PM -0800, David S. Miller wrote: > On Tue, 18 Nov 2003 14:21:37 +0100 > Petr Vandrovec wrote: > > > On Mon, Nov 17, 2003 at 12:30:47PM -0800, David S. Miller wrote: > > > Remind me again why the vmnet driver can't just run skb_checksum() > > > on packets that have CHECKSUM_HW set? > > > > Because vmnet driver (for bridged networking) is hooked through dev_add_pack. > > Place where to put checksum is defined as skb->h.raw + skb->csum, and what > > to checksum as skb->h.raw ... skb->data + skb->len. But unfortunately > > dev_queue_xmit_nit replaces skb2->h.raw with skb2->nh.raw - and so hook > > has to look at the packet contents to compute h.raw from packet data and > > protocol type. > > Thanks so much for reminding me. > > I'd like to resolve this. One solution is evident, let me know > what you think about the following idea. > > How about we add a flag the the packet_type structure, called > PTYPE_FLAG_NEEDCHECKSUM. If it is set, we run skb_checksum() on > CHECKSUM_HW SKBs and do not mangle the skb2->h.raw etc. pointers, then > we pass it into ptype->func(). > > In this way all existing ptype->func() implementations get what > they expect. Only if the flag is set will the new behavior occur. I'm not sure that we should run skb_checksum() on the packet. In vmnet's case about 95% of all packets delivered to the hook is thrown away after checking target MAC address (they are not broadcasts & they are not for the virtual machine), and in these cases computing checksum is just waste of time. So I think that this option should be named PTYPE_FLAG_CANCHECKSUM, and it should affect only h.raw assignment - no checksumming should happen. For AF_PACKET needs we can create PTYPE_FLAG_NEEDCHECKSUM which would call skb_checksum() itself. But I think that adding skb_checksum call to af_packet hook itself is simpler. We can leave default case (no flags) as is, so hooks which expects h.raw==nh.raw still work, and system is not slowed down by doing checksums for hooks which do not need it. I see only one possible benefit from PTYPE_FLAG_NEEDCHECKSUM: we can checksum original skb, potentially saving some cycles in drivers which use skb_csum_and_copy_dev (or when two or more such hooks are registered). Best regards, Petr Vandrovec vandrove@vc.cvut.cz From macro@ds2.pg.gda.pl Wed Nov 19 05:20:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 05:20:49 -0800 (PST) Received: from jurand.ds.pg.gda.pl (postfix@jurand.ds.pg.gda.pl [153.19.208.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJDKT25023823 for ; Wed, 19 Nov 2003 05:20:34 -0800 Received: by jurand.ds.pg.gda.pl (Postfix, from userid 1011) id 54D2F49C97; Wed, 19 Nov 2003 14:20:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by jurand.ds.pg.gda.pl (Postfix) with ESMTP id 48A6A47813; Wed, 19 Nov 2003 14:20:24 +0100 (CET) Date: Wed, 19 Nov 2003 14:20:24 +0100 (CET) From: "Maciej W. Rozycki" To: Rask Ingemann Lambertsen Cc: "'netdev@oss.sgi.com'" Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? In-Reply-To: <20031119123556.A7622@sygehus.dk> Message-ID: References: <3FB94311.10004@candelatech.com> <20031119123556.A7622@sygehus.dk> Organization: Technical University of Gdansk MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: macro@ds2.pg.gda.pl Precedence: bulk X-list: netdev Content-Length: 1528 Lines: 32 On Wed, 19 Nov 2003, Rask Ingemann Lambertsen wrote: > > Is there any interest in adding an Ethtool command to tell the driver to > > push the extra 4 bytes of CSUM into the skb? > > > > When enabling this feature, I'd also like to allow drivers to receive > > frames with bad FCS as well. > [cut] > > At least some hardware appears > > to support receiving bad FCS frames (e1000, evidently), but I am not sure > > how wide-spread this feature is... > > The Intel i82586 and i82596 and can be told to receive frames with a bad FCS. > They can also be told to send a precomputed FCS rather than computing it on > the fly. The i82596 and tulip can also transfer the FCS to memory when > receiving frames. I guess all of this is also supported on the i82557/8/9. FYI, all DEC FDDI controllers we currently support (or support is being worked on) do support receiving bad frames -- all frames are always passed to the rx path and it's up to a driver to decide if a bad frame should be completely discarded or other actions should be taken. By specification the boards also support sending frames with a manually calculated checksum, which may possibly be intentionally wrong, but I haven't actually tested it. If such functionality is added for Ethernet boards, I'm willing to support it for these DEC FDDI boards as well. -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + From jgarzik@pobox.com Wed Nov 19 06:07:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 06:07:31 -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 hAJE7825024525 for ; Wed, 19 Nov 2003 06:07:09 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47506 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMSz4-0003rn-AW; Wed, 19 Nov 2003 14:07:06 +0000 Message-ID: <3FBB78ED.8050701@pobox.com> Date: Wed, 19 Nov 2003 09:06: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: Rask Ingemann Lambertsen CC: Alexander Zapatka , netdev@oss.sgi.com Subject: Re: suggested forcedeth updates.... References: <20031119124845.B7622@sygehus.dk> In-Reply-To: <20031119124845.B7622@sygehus.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1556 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 Content-Length: 478 Lines: 18 Rask Ingemann Lambertsen wrote: > On Mon, Nov 17, 2003 at 11:07:15PM -0500, Alexander Zapatka wrote: > > >>that way you can modprobe/insmod with debug=1 and debuging works... or you >>can just load it, or load it with debug=0 and no debuging info is printed. >> >>just thought it might be a nice addition. > > > Even better would be to use the NETIF_MSG_* flags defined in > linux/netdevice.c and to be able to use ethtool to change the setting at > runtime. agreed... From hadi@cyberus.ca Wed Nov 19 07:01:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 07:02:09 -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 hAJF1q25025393 for ; Wed, 19 Nov 2003 07:01:52 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AMTpz-0007X0-Aa; Wed, 19 Nov 2003 10:01:47 -0500 Subject: Re: af_packet & CHECKSUM_HW From: jamal Reply-To: hadi@cyberus.ca To: Petr Vandrovec Cc: "David S. Miller" , herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com In-Reply-To: <20031119123535.GA11108@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> <20031117123047.55377d3a.davem@redhat.com> <20031118132137.GA23732@vana.vc.cvut.cz> <20031118174612.48c0854e.davem@redhat.com> <20031119123535.GA11108@vana.vc.cvut.cz> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069254105.1025.26.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Nov 2003 10:01:45 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1557 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 Content-Length: 1603 Lines: 35 On Wed, 2003-11-19 at 07:35, Petr Vandrovec wrote: > I'm not sure that we should run skb_checksum() on the packet. In vmnet's > case about 95% of all packets delivered to the hook is thrown away after > checking target MAC address (they are not broadcasts & they are not for > the virtual machine), and in these cases computing checksum is just waste > of time. > > So I think that this option should be named PTYPE_FLAG_CANCHECKSUM, and it > should affect only h.raw assignment - no checksumming should happen. > > For AF_PACKET needs we can create PTYPE_FLAG_NEEDCHECKSUM which would call > skb_checksum() itself. But I think that adding skb_checksum call to af_packet > hook itself is simpler. > > We can leave default case (no flags) as is, so hooks which expects h.raw==nh.raw > still work, and system is not slowed down by doing checksums for hooks which > do not need it. > > I see only one possible benefit from PTYPE_FLAG_NEEDCHECKSUM: we can checksum > original skb, potentially saving some cycles in drivers which use > skb_csum_and_copy_dev (or when two or more such hooks are registered). I think this sort of stuff will greatly benefit from the tc extensions that i have been working on. instead of hacking on ptype you can instead write little modules that do speacilized work (like computing checksums) or dropping packets or setting these flags that can be later used for doing extra work. The code executes before the ptype level execution and using the u32 classifier you can grop any part of the packet. I can send you a patch if you want to give it a shot. cheers, jamal From alexzapatka@hotmail.com Wed Nov 19 07:06:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 07:06:35 -0800 (PST) Received: from hotmail.com (bay2-f153.bay2.hotmail.com [65.54.247.153]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJF6M25025788 for ; Wed, 19 Nov 2003 07:06:22 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 19 Nov 2003 07:06:14 -0800 Received: from 159.247.50.4 by by2fd.bay2.hotmail.msn.com with HTTP; Wed, 19 Nov 2003 15:06:13 GMT X-Originating-IP: [159.247.50.4] X-Originating-Email: [alexzapatka@hotmail.com] From: "Alexander Zapatka" To: rask@sygehus.dk, jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: Re: suggested forcedeth updates.... Date: Wed, 19 Nov 2003 10:06:13 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 19 Nov 2003 15:06:14.0030 (UTC) FILETIME=[ACA14AE0:01C3AEAE] X-archive-position: 1558 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alexzapatka@hotmail.com Precedence: bulk X-list: netdev Content-Length: 1909 Lines: 58 thats a great idea! except i dont know how to implement it in a patch :) hope it makes it in to the next version. -o) /\\ Message void if penguin violated _\_V Don't mess with the penguin ----Original Message Follows---- From: Rask Ingemann Lambertsen To: Alexander Zapatka CC: netdev@oss.sgi.com Subject: Re: suggested forcedeth updates.... Date: Wed, 19 Nov 2003 12:48:45 +0100 MIME-Version: 1.0 Received: from 0x50a14406.albnxx15.adsl-dhcp.tele.dk ([80.161.68.6]) by mc7-f27.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 19 Nov 2003 03:51:36 -0800 Received: by 0x50a14406.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500)id A24BC42B3; Wed, 19 Nov 2003 12:48:45 +0100 (CET) X-Message-Info: JGTYoYF78jH14zHqGtQ8WJps3LyBHhOo Message-ID: <20031119124845.B7622@sygehus.dk> References: User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from alexzapatka@hotmail.com on Mon, Nov 17, 2003 at 11:07:15PM -0500 Return-Path: rask@sygehus.dk X-OriginalArrivalTime: 19 Nov 2003 11:51:53.0303 (UTC) FILETIME=[864B8E70:01C3AE93] On Mon, Nov 17, 2003 at 11:07:15PM -0500, Alexander Zapatka wrote: > that way you can modprobe/insmod with debug=1 and debuging works... or you > can just load it, or load it with debug=0 and no debuging info is printed. > > just thought it might be a nice addition. Even better would be to use the NETIF_MSG_* flags defined in linux/netdevice.c and to be able to use ethtool to change the setting at runtime. -- Regards, Rask Ingemann Lambertsen _________________________________________________________________ Say “goodbye” to busy signals and slow downloads with a high-speed Internet connection! Prices start at less than $1 a day average. https://broadband.msn.com (Prices may vary by service area.) From vandrove@vc.cvut.cz Wed Nov 19 07:12:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 07:12:21 -0800 (PST) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJFC625026192 for ; Wed, 19 Nov 2003 07:12:07 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) with ESMTP id hAJFBnvY030526; Wed, 19 Nov 2003 16:11:49 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-5) id hAJFBnJM030523; Wed, 19 Nov 2003 16:11:49 +0100 Date: Wed, 19 Nov 2003 16:11:49 +0100 From: Petr Vandrovec To: jamal Cc: "David S. Miller" , herbert@gondor.apana.org.au, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: af_packet & CHECKSUM_HW Message-ID: <20031119151149.GA30100@vana.vc.cvut.cz> References: <20031115024434.GA12276@gondor.apana.org.au> <20031116205146.GA8477@gondor.apana.org.au> <20031117194452.GB18448@vana.vc.cvut.cz> <20031117123047.55377d3a.davem@redhat.com> <20031118132137.GA23732@vana.vc.cvut.cz> <20031118174612.48c0854e.davem@redhat.com> <20031119123535.GA11108@vana.vc.cvut.cz> <1069254105.1025.26.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1069254105.1025.26.camel@jzny.localdomain> User-Agent: Mutt/1.5.4i X-archive-position: 1559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 999 Lines: 20 On Wed, Nov 19, 2003 at 10:01:45AM -0500, jamal wrote: > > I think this sort of stuff will greatly benefit from the tc extensions > that i have been working on. > instead of hacking on ptype you can instead write little modules that > do speacilized work (like computing checksums) or dropping packets > or setting these flags that can be later used for doing extra work. > The code executes before the ptype level execution and using the u32 > classifier you can grop any part of the packet. I can send you a patch > if you want to give it a shot. I'll gladly look at it. From your short description it looks like that it could solve also our second longstanding problem: we cannot block host->guest packets from hitting wire, and if guest communicates only with host (this traffic does not hit wire as it is injected as if received from network card) then switches on the network do not know where guest lives, and these packets then flood whole network. Thanks, Petr Vandrovec From greearb@candelatech.com Wed Nov 19 07:34:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 07:34:14 -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 hAJFXx25029293 for ; Wed, 19 Nov 2003 07:34:00 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAJFXreO016584; Wed, 19 Nov 2003 07:33:54 -0800 Message-ID: <3FBB8D61.6010106@candelatech.com> Date: Wed, 19 Nov 2003 07:33:53 -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: Rask Ingemann Lambertsen CC: "'netdev@oss.sgi.com'" Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? References: <3FB94311.10004@candelatech.com> <20031119123556.A7622@sygehus.dk> In-Reply-To: <20031119123556.A7622@sygehus.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1560 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 Content-Length: 1388 Lines: 43 Rask Ingemann Lambertsen wrote: > On Mon, Nov 17, 2003 at 01:52:17PM -0800, Ben Greear wrote: > >>Is there any interest in adding an Ethtool command to tell the driver to >>push the extra 4 bytes of CSUM into the skb? >> >>When enabling this feature, I'd also like to allow drivers to receive >>frames with bad FCS as well. > > [cut] > >>At least some hardware appears >>to support receiving bad FCS frames (e1000, evidently), but I am not sure >>how wide-spread this feature is... > > > The Intel i82586 and i82596 and can be told to receive frames with a bad FCS. > They can also be told to send a precomputed FCS rather than computing it on > the fly. The i82596 and tulip can also transfer the FCS to memory when > receiving frames. I guess all of this is also supported on the i82557/8/9. If you have a patch or example code that shows how to do this, I'd love to see it. I have code that should RX bad CSUM from the Intel folks, but I can't get it to generate bad CRC (it does framing errors instead with my attempt), so I can't test the RX code properly! I have the path from user-space to the NIC written, so just need to tweak the drivers a bit... Do you know if tulip can be told to accept bad FCS and/or if it can generate a frame with bad FCS somehow? Thanks! Ben > -- Ben Greear Candela Technologies Inc http://www.candelatech.com From pb@bieringer.de Wed Nov 19 08:17:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 08:17:40 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJGH525032541 for ; Wed, 19 Nov 2003 08:17:06 -0800 Received: by smtp2.aerasec.de (Postfix, from userid 995) id C2F27137FB; Wed, 19 Nov 2003 16:40:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 9AF12137FD; Wed, 19 Nov 2003 16:40:34 +0100 (CET) X-AV-Checked: Wed Nov 19 16:40:34 2003 smtp2.aerasec.de Received: from [192.168.1.2] (p50805FBE.dip.t-dialin.net [80.128.95.190]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id 67A7E137FB; Wed, 19 Nov 2003 16:40:33 +0100 (CET) Date: Wed, 19 Nov 2003 16:40:30 +0100 From: Peter Bieringer To: Maillist USAGI-users Cc: Maillist netdev Subject: IPv6: use_tempaddr: how to set per interface instead for default/all? Message-ID: <14830000.1069256430@worker.muc.bieringer.de> X-Mailer: Mulberry/3.1.0 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-archive-position: 1561 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev Content-Length: 1075 Lines: 33 Hi, looks there exists a hen/egg problem for the "use_tempaddr" (RFC3041 support). I cannot set it per interface because: 1) if interface is down, the related key "net.ipv6.conf..use_tempaddr" doesn't exist 2) if interface is up, I can change the key, but nothing happen -> I have to change "net.ipv6.conf.default.use_tempaddr" *before* the interface where I want to enable this feature will come up. This is ok for systems with one interface....but on systems with more than one interface, this is not a good way, because it's very hard (or impossible) to code proper scripts. Is there a interface state possible where the sysctl keys per interface are already available, but interface is still down? Thanks for any answer. BTW: are there more keys existing which are only read/functional on the trigger edge interface down->up? Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From jgarzik@pobox.com Wed Nov 19 09:14:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:14:58 -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 hAJHEj25015536 for ; Wed, 19 Nov 2003 09:14:45 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47750 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMVue-0006j5-2n; Wed, 19 Nov 2003 17:14:44 +0000 Message-ID: <3FBBA4E7.7070505@pobox.com> Date: Wed, 19 Nov 2003 12:14:15 -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: Xose Vazquez Perez CC: netdev@oss.sgi.com Subject: Re: [PATCH ] more ne2k-pci clone boards References: <3FBA85B6.8010008@wanadoo.es> In-Reply-To: <3FBA85B6.8010008@wanadoo.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1563 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 Content-Length: 18 Lines: 3 applied, thanks From jgarzik@pobox.com Wed Nov 19 09:14:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:14:55 -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 hAJHEb25015531 for ; Wed, 19 Nov 2003 09:14:38 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47749 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMVuW-0006j1-Eo; Wed, 19 Nov 2003 17:14:36 +0000 Message-ID: <3FBBA4DF.4010403@pobox.com> Date: Wed, 19 Nov 2003 12:14:07 -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: Xose Vazquez Perez CC: netdev@oss.sgi.com Subject: Re: [PATCH ] more RTL-8139 clone boards References: <3FBA771A.1010104@wanadoo.es> In-Reply-To: <3FBA771A.1010104@wanadoo.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1562 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 Content-Length: 18 Lines: 3 applied, thanks From jgarzik@pobox.com Wed Nov 19 09:25:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:25:45 -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 hAJHPV25016290 for ; Wed, 19 Nov 2003 09:25:32 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47763 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMW52-0007CQ-CN; Wed, 19 Nov 2003 17:25:28 +0000 Message-ID: <3FBBA76B.4070606@pobox.com> Date: Wed, 19 Nov 2003 12:24:59 -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: Francois Romieu CC: Brad House , netdev@oss.sgi.com Subject: Re: r8169 and tg3 References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> In-Reply-To: <20031118135848.A2451@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1564 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 Content-Length: 791 Lines: 25 Francois Romieu wrote: > Jeff Garzik : > [...] > >>So, what needs to happen is somebody needs to look at the sis190 changes >>that went in, and apply those same fixes to r8169. > > > If no one objects, I can do for r8169 the same thing I did for sis190. > Btw the DMA Rx/Tx rework is already in good shape (I rather like seeing > Jeff improving (S)ATA than coming to copy over his RX and TX handling > code :o) ). > > Anyway, the bk-commit patches which were related to sis190 are available at: > http://www.fr.zoreil.com/people/francois/misc/sis190-rework.mbx hehe. I certainly don't object... You probably want to look over the r8169 v1.6 that Brad posted a link to, since it does have some improved 8169 hardware support (modulo bugs, of course). Jeff From shemminger@osdl.org Wed Nov 19 09:27:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:27: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 hAJHRV25016632 for ; Wed, 19 Nov 2003 09:27:31 -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 hAJHRKC06697; Wed, 19 Nov 2003 09:27:21 -0800 Date: Wed, 19 Nov 2003 09:27:51 -0800 From: Stephen Hemminger To: Xose Vazquez Perez Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH ] more RTL-8139 clone boards Message-Id: <20031119092751.3407c944.shemminger@osdl.org> In-Reply-To: <3FBA771A.1010104@wanadoo.es> References: <3FBA771A.1010104@wanadoo.es> 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: 1565 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: 269 Lines: 10 On Tue, 18 Nov 2003 20:46:34 +0100 Xose Vazquez Perez wrote: > > 0x018A 0x0106 LevelOne FPC-0106TX > 0x126C 0x1211 Nortel Networks 10/100BaseTX > 0x1743 0x8139 Peppercon AG ROL-F > 0x021B 0x8139 Compaq HNE-300 Maybe time to start using pci_ids.h? From jgarzik@pobox.com Wed Nov 19 09:33:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:33:56 -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 hAJHXd25017065 for ; Wed, 19 Nov 2003 09:33:40 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47772 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMWCv-0007Lb-AC; Wed, 19 Nov 2003 17:33:37 +0000 Message-ID: <3FBBA954.6000601@pobox.com> Date: Wed, 19 Nov 2003 12:33:08 -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: netdev@oss.sgi.com CC: Linux Kernel Subject: [CFT] 2.6.x experimental net driver updates Content-Type: multipart/mixed; boundary="------------030806090205050304060005" X-archive-position: 1566 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 Content-Length: 41727 Lines: 1179 This is a multi-part message in MIME format. --------------030806090205050304060005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Ok, Al Viro's net driver refcounting work is pretty much complete, and shemminger/ogawa NAPI conversation of 8139too is also merged. Please beat this up as much as possible. Don't let the "experimental" tag fool you... these changes should be solid, and will be going to Andrew/Linus when the 2.6.0 tree re-opens. Don't forget to CC netdev@oss.sgi.com on all feedback. Thanks! Jeff --------------030806090205050304060005 Content-Type: text/plain; name="linus.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linus.txt" 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-bk24-netdrvr-exp1.patch.bz2 This will update the following files: Documentation/networking/8139too.txt | 438 -------------- drivers/net/68360enet.c | 951 -------------------------------- Documentation/SubmittingPatches | 4 Documentation/networking/netconsole.txt | 57 + drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c527.h | 6 drivers/net/3c59x.c | 17 drivers/net/8139too.c | 334 ++++++----- drivers/net/82596.c | 83 +- drivers/net/Kconfig | 9 drivers/net/Makefile | 2 drivers/net/Space.c | 587 +++++++++---------- drivers/net/a2065.c | 21 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 81 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 67 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ethertap.c | 3 drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lasi_82596.c | 17 drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 103 ++- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 30 - drivers/net/macsonic.c | 103 +-- drivers/net/mvme147.c | 64 +- drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k-pci.c | 3 drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 18 drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 78 +- drivers/net/sun3lance.c | 85 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 417 ++++++++++---- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 drivers/usb/gadget/ether.c | 2 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 646 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 163 files changed, 7307 insertions(+), 7024 deletions(-) through these ChangeSets: (03/11/19 1.1435.2.96) [PATCH] 8139too NAPI for net-drivers-2.5-exp Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. Also: 64k receive ring - has to handle wrap for that case; the NoWrap flag does nothing if using this big ring. assert() -> BUG_ON() To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. (03/11/19 1.1435.2.95) [PATCH] more ne2k-pci clone boards (03/11/19 1.1435.2.94) [PATCH] more RTL-8139 clone boards (03/11/18 1.1435.2.93) [PATCH] sun3-related net driver fixes On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > Viro. > > > > No users of init_etherdev remain in the tree. (yay!) > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > drivers: I forget to test the Sun-3 drivers: - sun3_82586.c: o add missing casts to iounmap() calls o fix parameter of free_netdev() - sun3lance.c: add missing casts to iounmap() calls Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed to ioremap()? (03/11/18 1.1435.2.92) [PATCH] m68k-related net driver fixes On Sun, 16 Nov 2003, Jeff Garzik wrote: > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > Viro. > > No users of init_etherdev remain in the tree. (yay!) Here are some (untested, except for cross-gcc) fixes for the m68k-related drivers: - Space.c: fix incorrect prototypes for atarilance_probe() and mace_probe() - a2065.c: kill superfluous argument of alloc_etherdev() - apne.c: o fix incorrect prototype for apne_probe() o kill unused variable err - mac8390.c: o kill unused variable probed o fix typos ENDOEV -> ENODEV and ERR_PTE -> ERR_PTR o add missing variable slots - macmace.c: use ERR_PTR() where needed - macsonic.c: kill unused variable lp - mvme147.c: o kill conversion warning and kill a cast by making ram unsigned long o add missing variable err Note: The use of `slots' in mac8390.c is not in my tree. Do you know where that change comes from? (03/11/18 1.1435.2.91) [PATCH] netpoll: push zap_completion_queue for lkcd Move zap_completion_queue call inside netpoll so we don't need to export it separately. (03/11/18 1.1435.2.90) [PATCH] netpoll: fix compilation with CONFIG_NETPOLL_RX Fix compilation without CONFIG_NETPOLL_RX (03/11/16 1.1435.2.89) [netdrvr] remove init_etherdev mentions in Doc/SubmittingPatches, atari_pamsnet.c (03/11/16 1.1435.2.88) [netdrvr] remove Documentation/networking/8139too.txt All sections of the document are woefully outdated. (03/11/16 1.1435.2.87) [netdrvr lasi_82596] remove ether_setup() call, fix leak in probe (03/11/16 1.1435.2.86) [netdrvr] alloc_etherdev-related cleanups Mostly removing unneeded calls to ether_setup(), which alloc_etherdev() already does for us. (03/11/16 1.1435.2.85) [netdrvr 3c527] applied missing pieces of Richard Proctor's 3c527 SMP update Minor stuff... remove unused constants, and mark non-experimental and non-broken in Kconfig. (03/11/16 1.1435.2.84) [netdrvr tulip] clean up tulip NAPI poll disable Looks like the same patch was applied multiple times. No negative effects except ugliness and a redundant test. (03/11/16 1.1435.2.83) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1435.2.82) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1435.2.81) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1435.2.80) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1435.2.79) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1435.2.78) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1435.2.77) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1435.2.76) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1435.2.75) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1435.2.74) [netdrvr depca] fix leaks on error (03/11/16 1.1435.2.73) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1435.2.72) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1435.2.71) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1435.2.70) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.69) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1435.2.68) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1435.2.67) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.66) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1435.2.65) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.64) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1435.2.63) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.62) [netdrvr declance] use alloc_etherdev (03/11/16 1.1435.2.61) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1435.2.60) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1435.2.59) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1435.2.58) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1435.2.57) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1435.2.56) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1435.2.55) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1435.2.54) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1435.2.53) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1435.2.52) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1435.2.51) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1435.2.50) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1435.2.49) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1435.2.48) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1435.2.47) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1435.2.46) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1435.2.45) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1435.2.44) [netdrvr 3c515] fix non-modular build (03/11/12 1.1435.2.43) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1435.2.42) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.41) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.40) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.39) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.38) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.37) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.36) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.35) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1435.2.34) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.33) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1435.2.32) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1435.2.31) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.30) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1435.2.29) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1435.2.28) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1435.2.27) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1435.2.26) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1435.2.25) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1435.2.24) [PATCH] (23/42) 3c523 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 (03/11/12 1.1435.2.23) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1435.2.22) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1435.2.21) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1435.2.20) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1435.2.19) [PATCH] (18/42) ultra 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 (03/11/12 1.1435.2.18) [PATCH] (17/42) wd 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 (03/11/12 1.1435.2.17) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1435.2.16) [PATCH] (15/42) hp 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 (03/11/12 1.1435.2.15) [PATCH] (14/42) hpplus 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 (03/11/12 1.1435.2.14) [PATCH] (13/42) e2100 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 (03/11/12 1.1435.2.13) [PATCH] (12/42) ne 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 (03/11/12 1.1435.2.12) [PATCH] (11/42) lance 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? (03/11/12 1.1435.2.11) [PATCH] (10/42) smc 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 (03/11/12 1.1435.2.10) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1435.2.9) [PATCH] (8/42) at1500 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). (03/11/12 1.1435.2.8) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1435.2.7) [PATCH] (6/42) at1700 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 (03/11/12 1.1435.2.6) [PATCH] (5/42) fmv18 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... (03/11/12 1.1435.2.5) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1435.2.4) [PATCH] (3/42) eexpress 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 (03/11/12 1.1435.2.3) [PATCH] (2/42) eepro 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 (03/11/12 1.1435.2.2) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.2.5) [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.1428.2.4) [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.1428.2.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.2.2) [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 --------------030806090205050304060005-- From hadi@cyberus.ca Wed Nov 19 09:50:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 09:50:39 -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 hAJHo625018414 for ; Wed, 19 Nov 2003 09:50:26 -0800 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AMThG-0005wF-06; Wed, 19 Nov 2003 09:52:46 -0500 Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. From: jamal Reply-To: hadi@cyberus.ca To: Ramon Casellas Cc: mpls-linux-general@sf.net, "David S. Miller" , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1069253564.1025.14.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Nov 2003 09:52:44 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1567 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 Content-Length: 656 Lines: 25 Hi Ramon, Give me a few days; i need to get it to some sane level and would like to review with Dave first then James. Your interest is highly appreaciated. cheers, jamal On Tue, 2003-11-18 at 02:48, Ramon Casellas wrote: > On 17 Nov 2003, jamal wrote: > > > code once it is deemed working. If you want to be on the list as well, > > let me know. I am sure you as will James will both have valuable input. > > Hi Jamal, > > I would appreciate it, thanks. On the other hand, if you both agree, I > would like to take a look at the new code, even if it does not even > compile (and your userspace parts) to start documenting. > > Best regards, > R. From Robert.Olsson@data.slu.se Wed Nov 19 10:45:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 10:45:20 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAJIj525019367 for ; Wed, 19 Nov 2003 10:45:07 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id TAA07048; Wed, 19 Nov 2003 19:44:52 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 41A15EC23D; Wed, 19 Nov 2003 19:44:57 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16315.47657.228084.388046@robur.slu.se> Date: Wed, 19 Nov 2003 19:44:57 +0100 To: Jeff Garzik Cc: Francois Romieu , Brad House , netdev@oss.sgi.com Subject: Re: r8169 and tg3 In-Reply-To: <3FBBA76B.4070606@pobox.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 1568 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 465 Lines: 14 Jeff Garzik writes: > hehe. I certainly don't object... You probably want to look over the > r8169 v1.6 that Brad posted a link to, since it does have some improved > 8169 hardware support (modulo bugs, of course). Yes r8169 can be interesting... I played with it a bit from my head the sending performance was about 900 kpps (pktgen) and RX very OK too about 780 kpps with just dropping the skb instead of doing netif_receive. Cheers. --ro From hirofumi@mail.parknet.co.jp Wed Nov 19 11:02:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 11:02:48 -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 hAJJ2R25019962 for ; Wed, 19 Nov 2003 11:02:28 -0800 Received: from ibmpc.myhome.or.jp [210.171.164.65] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id ACD91E280128; Thu, 20 Nov 2003 04:00: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 hAJJ2IjV029680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 20 Nov 2003 04:02:19 +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 hAJJ2IH5014525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 20 Nov 2003 04:02:18 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.9/8.12.9/Debian-5) id hAJJ2EXT014522; Thu, 20 Nov 2003 04:02:14 +0900 To: Jeff Garzik Cc: Stephen Hemminger , netdev@oss.sgi.com, Jes Sorensen Subject: Re: [PATCH] 8139too NAPI for net-drivers-2.5-exp References: <20031118161730.2690cb76.shemminger@osdl.org> <3FBBA565.3090206@pobox.com> From: OGAWA Hirofumi Date: Thu, 20 Nov 2003 04:02:14 +0900 In-Reply-To: <3FBBA565.3090206@pobox.com> Message-ID: <871xs4w5ah.fsf@devron.myhome.or.jp> 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: 1569 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 Content-Length: 2225 Lines: 78 Jeff Garzik writes: > Stephen Hemminger wrote: > > Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. > > Also: > > 64k receive ring - has to handle wrap for that case; > > the NoWrap flag does nothing if using this big ring. > > assert() -> BUG_ON() > > > > To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. > + local_irq_disable(); > + netif_rx_complete(dev); > + RTL_W16_F(IntrMask, rtl8139_intr_mask); > + local_irq_enable(); Probably, by my mistake in previous mail. Sorry. This still has the races condition. It can trigger the same problem by shared interrupt on SMP. Probably the following ISR style should use the below combination. in ISR if (netif_rx_schedule_prep(dev)) { RTL_W16 (IntrMask, rtl8139_norx_intr_mask); __netif_rx_schedule(dev); } in ->poll local_irq_disable(); RTL_W16_F(IntrMask, rtl8139_intr_mask); __netif_rx_complete(dev); local_irq_enable(); And another one should use the below combination. (this style can change the flags of __LINK_STATE_RX_SCHED or __LINK_STATE_START anytime) in ISR if (status & RxAckBits) { RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); netif_rx_schedule (dev); } in ->poll local_irq_disable(); __netif_rx_complete(dev); RTL_W16_F(IntrMask, rtl8139_intr_mask); local_irq_enable(); If happen the shared interrupt, the this ISR style may lose a chance of netif_rx_schedule(). Anyway, the following patch should fix the problem. Please apply. Thanks. -- OGAWA Hirofumi drivers/net/8139too.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/8139too.c~8139too-fix-race drivers/net/8139too.c --- linux-2.6.0-test9/drivers/net/8139too.c~8139too-fix-race 2003-11-19 23:48:46.000000000 +0900 +++ linux-2.6.0-test9-hirofumi/drivers/net/8139too.c 2003-11-19 23:49:05.000000000 +0900 @@ -2107,8 +2107,8 @@ static int rtl8139_poll(struct net_devic * again when we think we are done. */ local_irq_disable(); - netif_rx_complete(dev); RTL_W16_F(IntrMask, rtl8139_intr_mask); + __netif_rx_complete(dev); local_irq_enable(); } spin_unlock(&tp->rx_lock); _ From jgarzik@pobox.com Wed Nov 19 11:20:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 11:21:11 -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 hAJJKu25020939 for ; Wed, 19 Nov 2003 11:20:57 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47775 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMWHD-0007Y1-9o; Wed, 19 Nov 2003 17:38:03 +0000 Message-ID: <3FBBAA5E.5020007@pobox.com> Date: Wed, 19 Nov 2003 12:37:34 -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: Xose Vazquez Perez , netdev@oss.sgi.com Subject: Re: [PATCH ] more RTL-8139 clone boards References: <3FBA771A.1010104@wanadoo.es> <20031119092751.3407c944.shemminger@osdl.org> In-Reply-To: <20031119092751.3407c944.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1570 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 Content-Length: 935 Lines: 32 Stephen Hemminger wrote: > On Tue, 18 Nov 2003 20:46:34 +0100 > Xose Vazquez Perez wrote: > > >>0x018A 0x0106 LevelOne FPC-0106TX >>0x126C 0x1211 Nortel Networks 10/100BaseTX >>0x1743 0x8139 Peppercon AG ROL-F >>0x021B 0x8139 Compaq HNE-300 > > > Maybe time to start using pci_ids.h? This is mainly a matter of opinion. My opinion: no. ;-) I think it's rather silly to keep adding to pci_ids.h, when the ids are just arbitrary hex numbers with no useful value. I certainly support mnemonic constants when they have value... but if the _only_ place a PCI id constant exists is (a) in a pci_device_id list and (b) in pci_ids.h, then it seems rather wasteful rather than helpful. IMO, the constants just bloat the pci_device_id list, whereas the ones with hex numbers are nice, single lines. As an aside, include/linux/pci_ids.h is a heavily patched file, and conflicts occur all the time. Jeff From shemminger@osdl.org Wed Nov 19 14:41:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 14:41:21 -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 hAJMf725028861 for ; Wed, 19 Nov 2003 14:41:07 -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 hAJMeHC00509; Wed, 19 Nov 2003 14:40:17 -0800 Date: Wed, 19 Nov 2003 14:40:29 -0800 From: Stephen Hemminger To: Jeff Garzik , OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: [RFT] (3/3) 8139too -- poll_controller Message-Id: <20031119144029.5ba66fda.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: 1573 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: 1550 Lines: 46 For net-drivers-2.5-exp, add a poll_controller hook to allow use of netconsole with this driver. jeff, don't have netconsole setup to test this so please give it a try before including it. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Wed Nov 19 14:34:13 2003 +++ b/drivers/net/8139too.c Wed Nov 19 14:34:13 2003 @@ -612,6 +612,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev); static int rtl8139_poll(struct net_device *dev, int *budget); +static void rtl8139_poll_controller(struct net_device *dev); static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance, struct pt_regs *regs); static int rtl8139_close (struct net_device *dev); @@ -989,6 +990,9 @@ dev->ethtool_ops = &rtl8139_ethtool_ops; dev->tx_timeout = rtl8139_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = rtl8139_poll_controller; +#endif /* note: the hardware is not capable of sg/csum/highdma, however * through the use of skb_copy_and_csum_dev we enable these @@ -2184,6 +2188,18 @@ return IRQ_RETVAL(handled); } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void rtl8139_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + rtl8139_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif static int rtl8139_close (struct net_device *dev) { From shemminger@osdl.org Wed Nov 19 14:40:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 14:41: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 hAJMee25028843 for ; Wed, 19 Nov 2003 14:40:40 -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 hAJMeCC00499; Wed, 19 Nov 2003 14:40:16 -0800 Date: Wed, 19 Nov 2003 14:36:45 -0800 From: Stephen Hemminger To: Jeff Garzik , OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: [PATCH] (1/3) 8139too -- put back old assert Message-Id: <20031119143645.0abc8658.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: 1571 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: 673 Lines: 21 For net-drivers-2.5-exp: Minimize code changes -- put back assert() macro with similar properties to the original. Added unlikely() and KERN_ERR tag. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Wed Nov 19 14:33:54 2003 +++ b/drivers/net/8139too.c Wed Nov 19 14:33:54 2003 @@ -152,7 +152,11 @@ #ifdef RTL8139_NDEBUG # define assert(expr) do {} while (0) #else -# define assert(expr) BUG_ON((expr) == 0) +# define assert(expr) \ + if(unlikely(!(expr))) { \ + printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ + #expr,__FILE__,__FUNCTION__,__LINE__); \ + } #endif From shemminger@osdl.org Wed Nov 19 14:40:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 14:41: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 hAJMes25028849 for ; Wed, 19 Nov 2003 14:40:54 -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 hAJMeHC00505; Wed, 19 Nov 2003 14:40:17 -0800 Date: Wed, 19 Nov 2003 14:38:07 -0800 From: Stephen Hemminger To: Jeff Garzik , OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: [PATCH] (2/3) 8139too -- configurable receive ring Message-Id: <20031119143807.0b05a0be.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: 1572 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: 4392 Lines: 149 For net-drivers-2.5-exp: Make the receive window configurable and go back to the original 32K by default. diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c Wed Nov 19 14:34:02 2003 +++ b/drivers/net/8139too.c Wed Nov 19 14:34:02 2003 @@ -128,13 +128,6 @@ #define USE_IO_OPS 1 #endif -/* use a 16K rx ring buffer instead of the default 64K */ -#if defined(CONFIG_SH_DREAMCAST) || defined(CONFIG_EMBEDDED) -#define USE_BUF16K 1 -#else -#define USE_BUF64K 1 -#endif - /* define to 1 to enable copious debugging info */ #undef RTL8139_DEBUG @@ -173,20 +166,12 @@ /* bitmapped message enable number */ 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 -#elif defined(USE_BUF32K) -#define RX_BUF_LEN_IDX 2 -#else -#define RX_BUF_LEN_IDX 3 -#endif - -#define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) +/* Ring size is now a config option */ +#define RX_BUF_LEN (8192 << CONFIG_8139_RXBUF_IDX) #define RX_BUF_PAD 16 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ -#ifdef USE_BUF64K + +#if RX_BUF_LEN == 65536 #define RX_BUF_TOT_LEN RX_BUF_LEN #else #define RX_BUF_TOT_LEN (RX_BUF_LEN + RX_BUF_PAD + RX_BUF_WRAP_PAD) @@ -703,23 +688,28 @@ PCIErr | PCSTimeout | RxUnderrun | TxErr | TxOK | RxErr ; -#ifdef USE_BUF16K +#if CONFIG_8139_RXBUF_IDX == 0 +static const unsigned int rtl8139_rx_config = + RxCfgRcv8K | RxNoWrap | + (RX_FIFO_THRESH << RxCfgFIFOShift) | + (RX_DMA_BURST << RxCfgDMAShift); +#elif CONFIG_8139_RXBUF_IDX == 1 static const unsigned int rtl8139_rx_config = RxCfgRcv16K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); -#elif defined(USE_BUF32K) +#elif CONFIG_8139_RXBUF_IDX == 2 static const unsigned int rtl8139_rx_config = RxCfgRcv32K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); -#elif defined(USE_BUF64K) +#elif CONFIG_8139_RXBUF_IDX == 3 static const unsigned int rtl8139_rx_config = RxCfgRcv64K | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); #else -#error "Need to define receive buffer window" +#error "Invalid configuration for 8139_RXBUF_IDX" #endif static const unsigned int rtl8139_tx_config = @@ -1916,26 +1906,26 @@ #endif } +#if CONFIG_8139_RXBUF_IDX == 3 static __inline__ void wrap_copy(struct sk_buff *skb, const unsigned char *ring, u32 offset, unsigned int size) { -#ifdef USE_BUF64K u32 left = RX_BUF_LEN - offset; if (size > left) { memcpy(skb->data, ring + offset, left); memcpy(skb->data+left, ring, size - left); } else -#endif memcpy(skb->data, ring + offset, size); } +#endif static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, int budget) { void *ioaddr = tp->mmio_addr; int received = 0; - const unsigned char *rx_ring = tp->rx_ring; + 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," @@ -2002,8 +1992,11 @@ if (likely(skb)) { skb->dev = dev; skb_reserve (skb, 2); /* 16 byte align the IP fields. */ +#if CONFIG_8139_RXBUF_IDX == 3 wrap_copy(skb, rx_ring, ring_offset+4, pkt_size); - +#else + eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0); +#endif skb_put (skb, pkt_size); skb->protocol = eth_type_trans (skb, dev); diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Wed Nov 19 14:34:02 2003 +++ b/drivers/net/Kconfig Wed Nov 19 14:34:02 2003 @@ -1564,6 +1564,24 @@ experience problems, you can enable this option to restore the old RX-reset behavior. If unsure, say N. +config 8139_RXBUF_IDX + int "Receive ring size (0 => 8K, 1 => 16K, 2 => 32K, 3 => 64K)" + depends on 8139TOO + range 0 3 + default 1 if EMBEDDED || SH_DREAMCAST + default 2 + help + The 8139too driver has a fixed area of memory for receiving data. + The default value is adequate for most systems. The 64KB + ring size has hardware issues that may cause problems. + Values: + 0 => 8 KB + 1 => 16 KB embedded systems + 2 => 32 KB default for most systems + 3 => 64 KB + If unsure, use the default 2. + + config SIS900 tristate "SiS 900/7016 PCI Fast Ethernet Adapter support" depends on NET_PCI && PCI From romieu@fr.zoreil.com Wed Nov 19 16:03:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 16:04:20 -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 hAK03u25031443 for ; Wed, 19 Nov 2003 16:03:57 -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 hAK00xK7022134; Thu, 20 Nov 2003 01:00:59 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAK00uw8022133; Thu, 20 Nov 2003 01:00:56 +0100 Date: Thu, 20 Nov 2003 01:00:56 +0100 From: Francois Romieu To: Jeff Garzik Cc: Brad House , netdev@oss.sgi.com Subject: [patches] 2.6.0-test9 - r8169 DMA API conversion Message-ID: <20031120010056.A19444@electric-eye.fr.zoreil.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FBBA76B.4070606@pobox.com>; from jgarzik@pobox.com on Wed, Nov 19, 2003 at 12:24:59PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1574 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 Content-Length: 18257 Lines: 581 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jeff Garzik : [...] > hehe. I certainly don't object... You probably want to look over the > r8169 v1.6 that Brad posted a link to, since it does have some improved > 8169 hardware support (modulo bugs, of course). Ok, will do (hmmm... looks like a free ticket for "Whitespace attacks"). I have attached the usual DMA rework for: - the Tx descriptors; - the Rx process (with the original big Rx buffer removed). Feel free to comment/review. Next patch tomorrow. -- Ueimor --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-dma-api-tx.patch" Conversion of Rx/Tx descriptors to consistent DMA: - use pci_alloc_consistent() for Rx/Tx descriptors in rtl8169_open() (balanced by pci_free_consistent() on error path as well as in rtl8169_close()); - removal of the fields {Rx/Tx}DescArrays in struct rtl8169_private as there is no need to store a non-256 bytes aligned address any more; - fix for rtl8169_open() leak when RxBufferRings allocation fails. Said allocation is pushed to rtl8169_init_ring() as part of an evil cunning plan. drivers/net/r8169.c | 99 +++++++++++++++++++++++++++------------------------- 1 files changed, 52 insertions(+), 47 deletions(-) diff -puN drivers/net/r8169.c~r8169-dma-api-tx drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-dma-api-tx 2003-11-19 20:30:09.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-19 21:24:44.000000000 +0100 @@ -89,6 +89,8 @@ static int multicast_filter_limit = 32; #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 64 /* Number of Rx descriptor registers */ #define RX_BUF_SIZE 1536 /* Rx Buffer size */ +#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) +#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) #define RTL_MIN_IO_SIZE 0x80 #define TX_TIMEOUT (6*HZ) @@ -280,10 +282,10 @@ struct rtl8169_private { 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 TxPhyAddr; + dma_addr_t RxPhyAddr; unsigned char *RxBufferRings; /* Index of Rx Buffer */ unsigned char *RxBufferRing[NUM_RX_DESC]; /* Index of Rx Buffer array */ struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ @@ -297,7 +299,7 @@ static int rtl8169_open(struct net_devic static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs); -static void rtl8169_init_ring(struct net_device *dev); +static int rtl8169_init_ring(struct net_device *dev); static void rtl8169_hw_start(struct net_device *dev); static int rtl8169_close(struct net_device *dev); static void rtl8169_set_rx_mode(struct net_device *dev); @@ -654,52 +656,48 @@ static int rtl8169_open(struct net_device *dev) { struct rtl8169_private *tp = dev->priv; + struct pci_dev *pdev = tp->pci_dev; int retval; - u8 diff; - u32 TxPhyAddr, RxPhyAddr; retval = request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); - if (retval) { - return retval; - } + if (retval < 0) + goto out; - 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); + retval = -ENOMEM; - if (tp->TxDescArrays == NULL || tp->RxDescArrays == 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); - return -ENOMEM; - } - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); - if (tp->RxBufferRings == NULL) { - printk(KERN_INFO "Allocate RxBufferRing failed\n"); - } + /* + * Rx and Tx desscriptors needs 256 bytes alignment. + * pci_alloc_consistent provides more. + */ + tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, + &tp->TxPhyAddr); + if (!tp->TxDescArray) + goto err_free_irq; + + tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, + &tp->RxPhyAddr); + if (!tp->RxDescArray) + goto err_free_tx; + + retval = rtl8169_init_ring(dev); + if (retval < 0) + goto err_free_rx; - rtl8169_init_ring(dev); rtl8169_hw_start(dev); - return 0; +out: + return retval; +err_free_rx: + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, + tp->RxPhyAddr); +err_free_tx: + pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, + tp->TxPhyAddr); +err_free_irq: + free_irq(dev->irq, dev); + goto out; } static void @@ -739,8 +737,8 @@ rtl8169_hw_start(struct net_device *dev) tp->cur_rx = 0; - RTL_W32(TxDescStartAddr, virt_to_bus(tp->TxDescArray)); - RTL_W32(RxDescStartAddr, virt_to_bus(tp->RxDescArray)); + RTL_W32(TxDescStartAddr, tp->TxPhyAddr); + RTL_W32(RxDescStartAddr, tp->RxPhyAddr); RTL_W8(Cfg9346, Cfg9346_Lock); udelay(10); @@ -758,12 +756,17 @@ rtl8169_hw_start(struct net_device *dev) } -static void -rtl8169_init_ring(struct net_device *dev) +static int rtl8169_init_ring(struct net_device *dev) { struct rtl8169_private *tp = dev->priv; int i; + tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); + if (tp->RxBufferRings == NULL) { + printk(KERN_INFO "Allocate RxBufferRing failed\n"); + return -ENOMEM; + } + tp->cur_rx = 0; tp->cur_tx = 0; tp->dirty_tx = 0; @@ -783,6 +786,7 @@ rtl8169_init_ring(struct net_device *dev tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]); tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]); } + return 0; } static void @@ -1026,6 +1030,7 @@ static int rtl8169_close(struct net_device *dev) { struct rtl8169_private *tp = dev->priv; + struct pci_dev *pdev = tp->pci_dev; void *ioaddr = tp->mmio_addr; int i; @@ -1049,10 +1054,10 @@ rtl8169_close(struct net_device *dev) free_irq(dev->irq, dev); rtl8169_tx_clear(tp); - kfree(tp->TxDescArrays); - kfree(tp->RxDescArrays); - tp->TxDescArrays = NULL; - tp->RxDescArrays = NULL; + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, + tp->RxPhyAddr); + pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, + tp->TxPhyAddr); tp->TxDescArray = NULL; tp->RxDescArray = NULL; kfree(tp->RxBufferRings); _ --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-dma-api-data-buffers.patch" Conversion of Rx data buffers to PCI DMA - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - rtl8169_rx_clear() walks the buffer ring and releases the allocated data buffers. It needs to be used in two places: - rtl8169_init_ring() failure path; - normal device release (i.e. rtl8169_close); - rtl8169_free_rx_skb() releases a Rx data buffer. Mostly an helper for rtl8169_rx_clear(). As such it must: - unmap the memory area; - release the skb; - prevent the ring descriptor from being used again; - rtl8169_alloc_rx_skb() prepares a Rx data buffer for use. As such it must: - allocate an skb; - map the memory area; - reflect the changes in the ring descriptor. This function is balanced by rtl8169_free_rx_skb(). - rtl8169_unmap_rx() simply helps with the 80-columns limit. - rtl8169_rx_fill() walks a given range of the buffer ring and try to turn any descriptor into a ready to use one. It returns the count of modified descriptors and exits if an allocation fails. It can be seen as balanced by rtl8169_rx_clear(). Motivation: - partially abstract the (usually big) piece of code for the refill logic at the end of the Rx interrupt; - factorize the refill logic and the initial ring setup. - simple conversion of rtl8169_rx_interrupt() without rx_copybreak (will be adressed in a later patch). drivers/net/r8169.c | 235 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 161 insertions(+), 74 deletions(-) diff -puN drivers/net/r8169.c~r8169-dma-api-data-buffers drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-dma-api-data-buffers 2003-11-19 21:26:45.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-20 00:45:00.000000000 +0100 @@ -279,15 +279,15 @@ struct rtl8169_private { struct net_device_stats stats; /* statistics of net device */ spinlock_t lock; /* spin lock flag */ int chipset; - 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; + u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ + u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ + u32 dirty_rx; + u32 dirty_tx; struct TxDesc *TxDescArray; /* Index of 256-alignment Tx Descriptor buffer */ struct RxDesc *RxDescArray; /* Index of 256-alignment Rx Descriptor buffer */ dma_addr_t TxPhyAddr; dma_addr_t RxPhyAddr; - unsigned char *RxBufferRings; /* Index of Rx Buffer */ - unsigned char *RxBufferRing[NUM_RX_DESC]; /* Index of Rx Buffer array */ + struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ }; @@ -756,37 +756,119 @@ rtl8169_hw_start(struct net_device *dev) } -static int rtl8169_init_ring(struct net_device *dev) +static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) +{ + desc->buf_addr = 0xdeadbeef; + desc->status = EORbit; +} + +static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, + struct RxDesc *desc) +{ + pci_unmap_single(pdev, desc->buf_addr, RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + dev_kfree_skb(*sk_buff); + *sk_buff = NULL; + rtl8169_make_unusable_by_asic(desc); +} + +static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) +{ + desc->buf_addr = mapping; + desc->status = OWNbit + RX_BUF_SIZE; +} + +static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct net_device *dev, + struct sk_buff **sk_buff, struct RxDesc *desc) +{ + struct sk_buff *skb; + dma_addr_t mapping; + int ret = 0; + + skb = dev_alloc_skb(RX_BUF_SIZE); + if (!skb) + goto err_out; + + skb->dev = dev; + skb_reserve(skb, 2); + *sk_buff = skb; + + mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); + + rtl8169_give_to_asic(desc, mapping); + +out: + return ret; + +err_out: + ret = -ENOMEM; + rtl8169_make_unusable_by_asic(desc); + goto out; +} + +static void rtl8169_rx_clear(struct rtl8169_private *tp) { - struct rtl8169_private *tp = dev->priv; int i; - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); - if (tp->RxBufferRings == NULL) { - printk(KERN_INFO "Allocate RxBufferRing failed\n"); - return -ENOMEM; + for (i = 0; i < NUM_RX_DESC; i++) { + if (tp->Rx_skbuff[i]) { + rtl8169_free_rx_skb(tp->pci_dev, tp->Rx_skbuff + i, + tp->RxDescArray + i); + } } +} - tp->cur_rx = 0; - tp->cur_tx = 0; - tp->dirty_tx = 0; +static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, + u32 start, u32 end) +{ + u32 cur; + + for (cur = start; end - start > 0; cur++) { + int ret, i = cur % NUM_RX_DESC; + + if (tp->Rx_skbuff[i]) + continue; + + ret = rtl8169_alloc_rx_skb(tp->pci_dev, dev, tp->Rx_skbuff + i, + tp->RxDescArray + i); + if (ret < 0) + break; + } + return cur - start; +} + +static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc) +{ + desc->status |= EORbit; +} + +static inline void rtl8169_unmark_as_last_descriptor(struct RxDesc *desc) +{ + desc->status &= ~EORbit; +} + +static int rtl8169_init_ring(struct net_device *dev) +{ + struct rtl8169_private *tp = dev->priv; + + tp->cur_rx = tp->dirty_rx = 0; + tp->cur_tx = tp->dirty_tx = 0; memset(tp->TxDescArray, 0x0, NUM_TX_DESC * sizeof (struct TxDesc)); memset(tp->RxDescArray, 0x0, NUM_RX_DESC * sizeof (struct RxDesc)); - for (i = 0; i < NUM_TX_DESC; i++) { - tp->Tx_skbuff[i] = NULL; - } - for (i = 0; i < NUM_RX_DESC; i++) { - if (i == (NUM_RX_DESC - 1)) - tp->RxDescArray[i].status = - (OWNbit | EORbit) + RX_BUF_SIZE; - else - tp->RxDescArray[i].status = OWNbit + RX_BUF_SIZE; + memset(tp->Tx_skbuff, 0x0, NUM_TX_DESC * sizeof(struct sk_buff *)); + memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); + + if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) + goto err_out; + + rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); - tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]); - tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]); - } return 0; + +err_out: + rtl8169_rx_clear(tp); + return -ENOMEM; } static void @@ -906,70 +988,77 @@ rtl8169_tx_interrupt(struct net_device * } } +static inline void rtl8169_unmap_rx(struct pci_dev *pdev, struct RxDesc *desc) +{ + pci_dma_sync_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); + pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); +} + static void rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, void *ioaddr) { - int cur_rx; - struct sk_buff *skb; - int pkt_size = 0; + int cur_rx, delta; assert(dev != NULL); assert(tp != NULL); assert(ioaddr != NULL); - cur_rx = tp->cur_rx; + cur_rx = tp->cur_rx % RX_BUF_SIZE; while ((tp->RxDescArray[cur_rx].status & OWNbit) == 0) { + u32 status = tp->RxDescArray[cur_rx].status; - if (tp->RxDescArray[cur_rx].status & RxRES) { + if (status & RxRES) { printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); tp->stats.rx_errors++; - if (tp->RxDescArray[cur_rx].status & (RxRWT | RxRUNT)) + if (status & (RxRWT | RxRUNT)) tp->stats.rx_length_errors++; - if (tp->RxDescArray[cur_rx].status & RxCRC) + if (status & RxCRC) tp->stats.rx_crc_errors++; } else { - pkt_size = - (int) (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. // - eth_copy_and_sum(skb, tp->RxBufferRing[cur_rx], - pkt_size, 0); - skb_put(skb, pkt_size); - skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); - - if (cur_rx == (NUM_RX_DESC - 1)) - tp->RxDescArray[cur_rx].status = - (OWNbit | EORbit) + RX_BUF_SIZE; - else - tp->RxDescArray[cur_rx].status = - OWNbit + RX_BUF_SIZE; - - tp->RxDescArray[cur_rx].buf_addr = - virt_to_bus(tp->RxBufferRing[cur_rx]); - dev->last_rx = jiffies; - tp->stats.rx_bytes += pkt_size; - tp->stats.rx_packets++; - } else { - printk(KERN_WARNING - "%s: Memory squeeze, deferring packet.\n", - dev->name); - /* We should check that some rx space is free. - If not, free one and mark stats->rx_dropped++. */ - tp->stats.rx_dropped++; - } - } + struct sk_buff *skb = tp->Rx_skbuff[cur_rx]; + int pkt_size = (status & 0x00001FFF) - 4; + + rtl8169_unmap_rx(tp->pci_dev, tp->RxDescArray + cur_rx); + + skb_put(skb, pkt_size); + skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); - cur_rx = (cur_rx + 1) % NUM_RX_DESC; + tp->Rx_skbuff[cur_rx] = NULL; + dev->last_rx = jiffies; + tp->stats.rx_bytes += pkt_size; + tp->stats.rx_packets++; + } + + tp->cur_rx++; + cur_rx = tp->cur_rx % NUM_RX_DESC; } - tp->cur_rx = cur_rx; + delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); + if (delta > 0) { + u32 old_last = (tp->dirty_rx - 1) % NUM_RX_DESC; + + tp->dirty_rx += delta; + rtl8169_mark_as_last_descriptor(tp->RxDescArray + + (tp->dirty_rx - 1)%NUM_RX_DESC); + rtl8169_unmark_as_last_descriptor(tp->RxDescArray + old_last); + } else if (delta < 0) + printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name); + + /* + * FIXME: until there is periodic timer to try and refill the ring, + * a temporary shortage may definitely kill the Rx process. + * - disable the asic to try and avoid an overflow and kick it again + * after refill ? + * - how do others driver handle this condition (Uh oh...). + */ + if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) + printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name); } /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -1032,7 +1121,6 @@ rtl8169_close(struct net_device *dev) struct rtl8169_private *tp = dev->priv; struct pci_dev *pdev = tp->pci_dev; void *ioaddr = tp->mmio_addr; - int i; netif_stop_queue(dev); @@ -1054,16 +1142,15 @@ rtl8169_close(struct net_device *dev) free_irq(dev->irq, dev); rtl8169_tx_clear(tp); + + rtl8169_rx_clear(tp); + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, tp->TxPhyAddr); tp->TxDescArray = NULL; tp->RxDescArray = NULL; - kfree(tp->RxBufferRings); - for (i = 0; i < NUM_RX_DESC; i++) { - tp->RxBufferRing[i] = NULL; - } return 0; } _ --n8g4imXOkfNTN/H1-- From brad@mcve.com Wed Nov 19 16:08:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 16:08:47 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK08U25032172 for ; Wed, 19 Nov 2003 16:08:31 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 8654F85774; Wed, 19 Nov 2003 19:21:38 -0500 (EST) Message-ID: <3FBC05FB.2020409@mcve.com> Date: Wed, 19 Nov 2003 19:08:27 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: Jeff Garzik , Brad House , netdev@oss.sgi.com Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> In-Reply-To: <20031120010056.A19444@electric-eye.fr.zoreil.com> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Content-Length: 19319 Lines: 583 Just because I'm way to lazy to actually look, is this against the original r8169, or my patch from the v1.6 driver ?? -Brad Francois Romieu wrote: > Jeff Garzik : > [...] > >>hehe. I certainly don't object... You probably want to look over the >>r8169 v1.6 that Brad posted a link to, since it does have some improved >>8169 hardware support (modulo bugs, of course). > > > Ok, will do (hmmm... looks like a free ticket for "Whitespace attacks"). > > I have attached the usual DMA rework for: > - the Tx descriptors; > - the Rx process (with the original big Rx buffer removed). > > Feel free to comment/review. Next patch tomorrow. > > -- > Ueimor > > > ------------------------------------------------------------------------ > > > Conversion of Rx/Tx descriptors to consistent DMA: > - use pci_alloc_consistent() for Rx/Tx descriptors in rtl8169_open() > (balanced by pci_free_consistent() on error path as well as in > rtl8169_close()); > - removal of the fields {Rx/Tx}DescArrays in struct rtl8169_private > as there is no need to store a non-256 bytes aligned address any more; > - fix for rtl8169_open() leak when RxBufferRings allocation fails. > Said allocation is pushed to rtl8169_init_ring() as part of an evil > cunning plan. > > > drivers/net/r8169.c | 99 +++++++++++++++++++++++++++------------------------- > 1 files changed, 52 insertions(+), 47 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-dma-api-tx drivers/net/r8169.c > --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-dma-api-tx 2003-11-19 20:30:09.000000000 +0100 > +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-19 21:24:44.000000000 +0100 > @@ -89,6 +89,8 @@ static int multicast_filter_limit = 32; > #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ > #define NUM_RX_DESC 64 /* Number of Rx descriptor registers */ > #define RX_BUF_SIZE 1536 /* Rx Buffer size */ > +#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) > +#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) > > #define RTL_MIN_IO_SIZE 0x80 > #define TX_TIMEOUT (6*HZ) > @@ -280,10 +282,10 @@ struct rtl8169_private { > 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 TxPhyAddr; > + dma_addr_t RxPhyAddr; > unsigned char *RxBufferRings; /* Index of Rx Buffer */ > unsigned char *RxBufferRing[NUM_RX_DESC]; /* Index of Rx Buffer array */ > struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ > @@ -297,7 +299,7 @@ static int rtl8169_open(struct net_devic > static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); > static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, > struct pt_regs *regs); > -static void rtl8169_init_ring(struct net_device *dev); > +static int rtl8169_init_ring(struct net_device *dev); > static void rtl8169_hw_start(struct net_device *dev); > static int rtl8169_close(struct net_device *dev); > static void rtl8169_set_rx_mode(struct net_device *dev); > @@ -654,52 +656,48 @@ static int > rtl8169_open(struct net_device *dev) > { > struct rtl8169_private *tp = dev->priv; > + struct pci_dev *pdev = tp->pci_dev; > int retval; > - u8 diff; > - u32 TxPhyAddr, RxPhyAddr; > > retval = > request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); > - if (retval) { > - return retval; > - } > + if (retval < 0) > + goto out; > > - 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); > + retval = -ENOMEM; > > - if (tp->TxDescArrays == NULL || tp->RxDescArrays == 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); > - return -ENOMEM; > - } > - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); > - if (tp->RxBufferRings == NULL) { > - printk(KERN_INFO "Allocate RxBufferRing failed\n"); > - } > + /* > + * Rx and Tx desscriptors needs 256 bytes alignment. > + * pci_alloc_consistent provides more. > + */ > + tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, > + &tp->TxPhyAddr); > + if (!tp->TxDescArray) > + goto err_free_irq; > + > + tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, > + &tp->RxPhyAddr); > + if (!tp->RxDescArray) > + goto err_free_tx; > + > + retval = rtl8169_init_ring(dev); > + if (retval < 0) > + goto err_free_rx; > > - rtl8169_init_ring(dev); > rtl8169_hw_start(dev); > > - return 0; > +out: > + return retval; > > +err_free_rx: > + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, > + tp->RxPhyAddr); > +err_free_tx: > + pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, > + tp->TxPhyAddr); > +err_free_irq: > + free_irq(dev->irq, dev); > + goto out; > } > > static void > @@ -739,8 +737,8 @@ rtl8169_hw_start(struct net_device *dev) > > tp->cur_rx = 0; > > - RTL_W32(TxDescStartAddr, virt_to_bus(tp->TxDescArray)); > - RTL_W32(RxDescStartAddr, virt_to_bus(tp->RxDescArray)); > + RTL_W32(TxDescStartAddr, tp->TxPhyAddr); > + RTL_W32(RxDescStartAddr, tp->RxPhyAddr); > RTL_W8(Cfg9346, Cfg9346_Lock); > udelay(10); > > @@ -758,12 +756,17 @@ rtl8169_hw_start(struct net_device *dev) > > } > > -static void > -rtl8169_init_ring(struct net_device *dev) > +static int rtl8169_init_ring(struct net_device *dev) > { > struct rtl8169_private *tp = dev->priv; > int i; > > + tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); > + if (tp->RxBufferRings == NULL) { > + printk(KERN_INFO "Allocate RxBufferRing failed\n"); > + return -ENOMEM; > + } > + > tp->cur_rx = 0; > tp->cur_tx = 0; > tp->dirty_tx = 0; > @@ -783,6 +786,7 @@ rtl8169_init_ring(struct net_device *dev > tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]); > tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]); > } > + return 0; > } > > static void > @@ -1026,6 +1030,7 @@ static int > rtl8169_close(struct net_device *dev) > { > struct rtl8169_private *tp = dev->priv; > + struct pci_dev *pdev = tp->pci_dev; > void *ioaddr = tp->mmio_addr; > int i; > > @@ -1049,10 +1054,10 @@ rtl8169_close(struct net_device *dev) > free_irq(dev->irq, dev); > > rtl8169_tx_clear(tp); > - kfree(tp->TxDescArrays); > - kfree(tp->RxDescArrays); > - tp->TxDescArrays = NULL; > - tp->RxDescArrays = NULL; > + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, > + tp->RxPhyAddr); > + pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, > + tp->TxPhyAddr); > tp->TxDescArray = NULL; > tp->RxDescArray = NULL; > kfree(tp->RxBufferRings); > > _ > > > ------------------------------------------------------------------------ > > > Conversion of Rx data buffers to PCI DMA > - endianness is kept in a fscked state as it is in the original code > (will be adressed in a later patch); > - rtl8169_rx_clear() walks the buffer ring and releases the allocated > data buffers. It needs to be used in two places: > - rtl8169_init_ring() failure path; > - normal device release (i.e. rtl8169_close); > - rtl8169_free_rx_skb() releases a Rx data buffer. Mostly an helper > for rtl8169_rx_clear(). As such it must: > - unmap the memory area; > - release the skb; > - prevent the ring descriptor from being used again; > - rtl8169_alloc_rx_skb() prepares a Rx data buffer for use. > As such it must: > - allocate an skb; > - map the memory area; > - reflect the changes in the ring descriptor. > This function is balanced by rtl8169_free_rx_skb(). > - rtl8169_unmap_rx() simply helps with the 80-columns limit. > - rtl8169_rx_fill() walks a given range of the buffer ring and > try to turn any descriptor into a ready to use one. It returns the > count of modified descriptors and exits if an allocation fails. > It can be seen as balanced by rtl8169_rx_clear(). Motivation: > - partially abstract the (usually big) piece of code for the refill > logic at the end of the Rx interrupt; > - factorize the refill logic and the initial ring setup. > - simple conversion of rtl8169_rx_interrupt() without rx_copybreak > (will be adressed in a later patch). > > > drivers/net/r8169.c | 235 +++++++++++++++++++++++++++++++++++----------------- > 1 files changed, 161 insertions(+), 74 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-dma-api-data-buffers drivers/net/r8169.c > --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-dma-api-data-buffers 2003-11-19 21:26:45.000000000 +0100 > +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-20 00:45:00.000000000 +0100 > @@ -279,15 +279,15 @@ struct rtl8169_private { > struct net_device_stats stats; /* statistics of net device */ > spinlock_t lock; /* spin lock flag */ > int chipset; > - 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; > + u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ > + u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ > + u32 dirty_rx; > + u32 dirty_tx; > struct TxDesc *TxDescArray; /* Index of 256-alignment Tx Descriptor buffer */ > struct RxDesc *RxDescArray; /* Index of 256-alignment Rx Descriptor buffer */ > dma_addr_t TxPhyAddr; > dma_addr_t RxPhyAddr; > - unsigned char *RxBufferRings; /* Index of Rx Buffer */ > - unsigned char *RxBufferRing[NUM_RX_DESC]; /* Index of Rx Buffer array */ > + struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ > struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ > }; > > @@ -756,37 +756,119 @@ rtl8169_hw_start(struct net_device *dev) > > } > > -static int rtl8169_init_ring(struct net_device *dev) > +static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) > +{ > + desc->buf_addr = 0xdeadbeef; > + desc->status = EORbit; > +} > + > +static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, > + struct RxDesc *desc) > +{ > + pci_unmap_single(pdev, desc->buf_addr, RX_BUF_SIZE, PCI_DMA_FROMDEVICE); > + dev_kfree_skb(*sk_buff); > + *sk_buff = NULL; > + rtl8169_make_unusable_by_asic(desc); > +} > + > +static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) > +{ > + desc->buf_addr = mapping; > + desc->status = OWNbit + RX_BUF_SIZE; > +} > + > +static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct net_device *dev, > + struct sk_buff **sk_buff, struct RxDesc *desc) > +{ > + struct sk_buff *skb; > + dma_addr_t mapping; > + int ret = 0; > + > + skb = dev_alloc_skb(RX_BUF_SIZE); > + if (!skb) > + goto err_out; > + > + skb->dev = dev; > + skb_reserve(skb, 2); > + *sk_buff = skb; > + > + mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE, > + PCI_DMA_FROMDEVICE); > + > + rtl8169_give_to_asic(desc, mapping); > + > +out: > + return ret; > + > +err_out: > + ret = -ENOMEM; > + rtl8169_make_unusable_by_asic(desc); > + goto out; > +} > + > +static void rtl8169_rx_clear(struct rtl8169_private *tp) > { > - struct rtl8169_private *tp = dev->priv; > int i; > > - tp->RxBufferRings = kmalloc(RX_BUF_SIZE * NUM_RX_DESC, GFP_KERNEL); > - if (tp->RxBufferRings == NULL) { > - printk(KERN_INFO "Allocate RxBufferRing failed\n"); > - return -ENOMEM; > + for (i = 0; i < NUM_RX_DESC; i++) { > + if (tp->Rx_skbuff[i]) { > + rtl8169_free_rx_skb(tp->pci_dev, tp->Rx_skbuff + i, > + tp->RxDescArray + i); > + } > } > +} > > - tp->cur_rx = 0; > - tp->cur_tx = 0; > - tp->dirty_tx = 0; > +static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, > + u32 start, u32 end) > +{ > + u32 cur; > + > + for (cur = start; end - start > 0; cur++) { > + int ret, i = cur % NUM_RX_DESC; > + > + if (tp->Rx_skbuff[i]) > + continue; > + > + ret = rtl8169_alloc_rx_skb(tp->pci_dev, dev, tp->Rx_skbuff + i, > + tp->RxDescArray + i); > + if (ret < 0) > + break; > + } > + return cur - start; > +} > + > +static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc) > +{ > + desc->status |= EORbit; > +} > + > +static inline void rtl8169_unmark_as_last_descriptor(struct RxDesc *desc) > +{ > + desc->status &= ~EORbit; > +} > + > +static int rtl8169_init_ring(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + > + tp->cur_rx = tp->dirty_rx = 0; > + tp->cur_tx = tp->dirty_tx = 0; > memset(tp->TxDescArray, 0x0, NUM_TX_DESC * sizeof (struct TxDesc)); > memset(tp->RxDescArray, 0x0, NUM_RX_DESC * sizeof (struct RxDesc)); > > - for (i = 0; i < NUM_TX_DESC; i++) { > - tp->Tx_skbuff[i] = NULL; > - } > - for (i = 0; i < NUM_RX_DESC; i++) { > - if (i == (NUM_RX_DESC - 1)) > - tp->RxDescArray[i].status = > - (OWNbit | EORbit) + RX_BUF_SIZE; > - else > - tp->RxDescArray[i].status = OWNbit + RX_BUF_SIZE; > + memset(tp->Tx_skbuff, 0x0, NUM_TX_DESC * sizeof(struct sk_buff *)); > + memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); > + > + if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) > + goto err_out; > + > + rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); > > - tp->RxBufferRing[i] = &(tp->RxBufferRings[i * RX_BUF_SIZE]); > - tp->RxDescArray[i].buf_addr = virt_to_bus(tp->RxBufferRing[i]); > - } > return 0; > + > +err_out: > + rtl8169_rx_clear(tp); > + return -ENOMEM; > } > > static void > @@ -906,70 +988,77 @@ rtl8169_tx_interrupt(struct net_device * > } > } > > +static inline void rtl8169_unmap_rx(struct pci_dev *pdev, struct RxDesc *desc) > +{ > + pci_dma_sync_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, > + PCI_DMA_FROMDEVICE); > + pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, > + PCI_DMA_FROMDEVICE); > +} > + > static void > rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, > void *ioaddr) > { > - int cur_rx; > - struct sk_buff *skb; > - int pkt_size = 0; > + int cur_rx, delta; > > assert(dev != NULL); > assert(tp != NULL); > assert(ioaddr != NULL); > > - cur_rx = tp->cur_rx; > + cur_rx = tp->cur_rx % RX_BUF_SIZE; > > while ((tp->RxDescArray[cur_rx].status & OWNbit) == 0) { > + u32 status = tp->RxDescArray[cur_rx].status; > > - if (tp->RxDescArray[cur_rx].status & RxRES) { > + if (status & RxRES) { > printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); > tp->stats.rx_errors++; > - if (tp->RxDescArray[cur_rx].status & (RxRWT | RxRUNT)) > + if (status & (RxRWT | RxRUNT)) > tp->stats.rx_length_errors++; > - if (tp->RxDescArray[cur_rx].status & RxCRC) > + if (status & RxCRC) > tp->stats.rx_crc_errors++; > } else { > - pkt_size = > - (int) (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. // > - eth_copy_and_sum(skb, tp->RxBufferRing[cur_rx], > - pkt_size, 0); > - skb_put(skb, pkt_size); > - skb->protocol = eth_type_trans(skb, dev); > - netif_rx(skb); > - > - if (cur_rx == (NUM_RX_DESC - 1)) > - tp->RxDescArray[cur_rx].status = > - (OWNbit | EORbit) + RX_BUF_SIZE; > - else > - tp->RxDescArray[cur_rx].status = > - OWNbit + RX_BUF_SIZE; > - > - tp->RxDescArray[cur_rx].buf_addr = > - virt_to_bus(tp->RxBufferRing[cur_rx]); > - dev->last_rx = jiffies; > - tp->stats.rx_bytes += pkt_size; > - tp->stats.rx_packets++; > - } else { > - printk(KERN_WARNING > - "%s: Memory squeeze, deferring packet.\n", > - dev->name); > - /* We should check that some rx space is free. > - If not, free one and mark stats->rx_dropped++. */ > - tp->stats.rx_dropped++; > - } > - } > + struct sk_buff *skb = tp->Rx_skbuff[cur_rx]; > + int pkt_size = (status & 0x00001FFF) - 4; > + > + rtl8169_unmap_rx(tp->pci_dev, tp->RxDescArray + cur_rx); > + > + skb_put(skb, pkt_size); > + skb->protocol = eth_type_trans(skb, dev); > + netif_rx(skb); > > - cur_rx = (cur_rx + 1) % NUM_RX_DESC; > + tp->Rx_skbuff[cur_rx] = NULL; > > + dev->last_rx = jiffies; > + tp->stats.rx_bytes += pkt_size; > + tp->stats.rx_packets++; > + } > + > + tp->cur_rx++; > + cur_rx = tp->cur_rx % NUM_RX_DESC; > } > > - tp->cur_rx = cur_rx; > + delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); > + if (delta > 0) { > + u32 old_last = (tp->dirty_rx - 1) % NUM_RX_DESC; > + > + tp->dirty_rx += delta; > + rtl8169_mark_as_last_descriptor(tp->RxDescArray + > + (tp->dirty_rx - 1)%NUM_RX_DESC); > + rtl8169_unmark_as_last_descriptor(tp->RxDescArray + old_last); > + } else if (delta < 0) > + printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name); > + > + /* > + * FIXME: until there is periodic timer to try and refill the ring, > + * a temporary shortage may definitely kill the Rx process. > + * - disable the asic to try and avoid an overflow and kick it again > + * after refill ? > + * - how do others driver handle this condition (Uh oh...). > + */ > + if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) > + printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name); > } > > /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ > @@ -1032,7 +1121,6 @@ rtl8169_close(struct net_device *dev) > struct rtl8169_private *tp = dev->priv; > struct pci_dev *pdev = tp->pci_dev; > void *ioaddr = tp->mmio_addr; > - int i; > > netif_stop_queue(dev); > > @@ -1054,16 +1142,15 @@ rtl8169_close(struct net_device *dev) > free_irq(dev->irq, dev); > > rtl8169_tx_clear(tp); > + > + rtl8169_rx_clear(tp); > + > pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, > tp->RxPhyAddr); > pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, > tp->TxPhyAddr); > tp->TxDescArray = NULL; > tp->RxDescArray = NULL; > - kfree(tp->RxBufferRings); > - for (i = 0; i < NUM_RX_DESC; i++) { > - tp->RxBufferRing[i] = NULL; > - } > > return 0; > } > > _ From romieu@fr.zoreil.com Wed Nov 19 16:53:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 16:54:10 -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 hAK0rt25004144 for ; Wed, 19 Nov 2003 16:53:56 -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 hAK0jpK7022525; Thu, 20 Nov 2003 01:45:51 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAK0joGS022524; Thu, 20 Nov 2003 01:45:50 +0100 Date: Thu, 20 Nov 2003 01:45:50 +0100 From: Francois Romieu To: Brad House Cc: Jeff Garzik , Brad House , netdev@oss.sgi.com Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion Message-ID: <20031120014550.A22377@electric-eye.fr.zoreil.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.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: <3FBC05FB.2020409@mcve.com>; from brad@mcve.com on Wed, Nov 19, 2003 at 07:08:27PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1576 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 Content-Length: 490 Lines: 16 Brad House : > Just because I'm way to lazy to actually look, is this > against the original r8169, or my patch from the v1.6 > driver ?? It is against the original r8169. Once finished, it should look like: - first cut at dma api conversion (today) - remaining bits of dma api conversion (tomorrow) - rx_copybreak (tomorrow) - your changes (week-end) - big-endian fixes (week-end) Each part divided in reasonably small patches to ease the test/review process. -- Ueimor From brad@mcve.com Wed Nov 19 16:59:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 16:59:53 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK0xa25004512 for ; Wed, 19 Nov 2003 16:59:36 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 5F57485774; Wed, 19 Nov 2003 20:12:46 -0500 (EST) Message-ID: <3FBC11F2.5080805@mcve.com> Date: Wed, 19 Nov 2003 19:59:30 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: Jeff Garzik , Brad House , netdev@oss.sgi.com Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.com> <20031120014550.A22377@electric-eye.fr.zoreil.com> In-Reply-To: <20031120014550.A22377@electric-eye.fr.zoreil.com> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1577 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Content-Length: 1069 Lines: 36 any reason why it's not against the v1.6 ? the current driver is missing support for the 8110S chip (or at least it doesn't seem to work at all), so you're cutting out all the chips on the mobos out there. Haven't looked to see if it's just a PCI ID or other functionality, but since the V1.2 is from realtek that's in the official kernel, it would make sense to use the 1.6 patch.... I suppose I could do it, but it would take me much more time simply because I'm not familiar with the changes you're making. -Brad Francois Romieu wrote: > Brad House : > >>Just because I'm way to lazy to actually look, is this >>against the original r8169, or my patch from the v1.6 >>driver ?? > > > It is against the original r8169. Once finished, it should look like: > - first cut at dma api conversion (today) > - remaining bits of dma api conversion (tomorrow) > - rx_copybreak (tomorrow) > - your changes (week-end) > - big-endian fixes (week-end) > > Each part divided in reasonably small patches to ease the test/review process. > > -- > Ueimor > From mashirle@us.ibm.com Wed Nov 19 16:21:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 17:13:50 -0800 (PST) Received: from linux2.suntekindustrial.com (wbar1.sjo1-4-4-004-065.sjo1.dsl-verizon.net [4.4.4.65]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK0Lq25003812 for ; Wed, 19 Nov 2003 16:21:59 -0800 Received: from ibm-mxl (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated bits=0) by linux2.suntekindustrial.com (8.12.8/8.12.8) with ESMTP id hAK1ULbO013387; Wed, 19 Nov 2003 17:30:27 -0800 Content-Type: text/plain; charset="us-ascii" From: Shirley Ma Organization: IBM Linux To: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: IPv6 MIB:ipv6PrefixTable implementation Date: Wed, 19 Nov 2003 16:21:38 -0800 User-Agent: KMail/1.4.3 Cc: xma@us.ibm.com MIME-Version: 1.0 Message-Id: <200311191621.38087.mashirle@us.ibm.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAK0Lq25003812 X-archive-position: 1578 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: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1816 Lines: 57 Hi, Alexy, A while ago, we had a discussion about IPv6 Prefix Table implementation. I agree with you it's not necessary to process offlink prefix. In each ipv6PrefixTable, there are 9 objects, which are Ifindex, Type, Prefix, Length, Origin(addrconf, manually, dhcp, others), OnLinkFlag, AutonomoueFlag, AdvPreferredLiftTime and ValidLifeTime. As we know, the routing table has all on-link prefix routes. But only Prefix, Length, Ifindex are saved in routing table, the rest objects info are not saved anywhere. One implementation detail question, do you think I need to save all the other Prefix Objects: Type, Origin(addrconf, manually, dhcp, others), OnLinkFlag, AutonomoueFlag, AdvPreferredLiftTime and ValidLifeTime in routing table also? If so, sounds like I add a big structure in each prefix route entry in the routing table. Thanks Shirley Ma IBM Linux Technology Center ======================= List: linux-netdev Subject: Re: [Issues] Implementation for IPv6 MIB:ipv6PrefixTable From: kuznet () ms2 ! inr ! ac ! ru Date: 2003-10-24 17:59:27 Hello! > First, do you think it's a good idea to save all prefix objects in routing > table? Those which are on-link, of course. > Second, where is the best location for the off-link prefix, on-link flag 0 > prefix to be saved? Do you really think off-link prefixes are to be saved? Prefix in use is onlink by defintion, so just return 1 in these bit and ignore off-link prefixes completely, they are meaningless, are not they? > Third, do you think it's a good idea to implement a prefix table/per > interface in the kernel? Well, if SNMP is going to be used as a tool to snoop ndisc promiscuously (which seems to be the case if it shows inforrmation about offlink prefixes), then it is definitely not a kernel task. Alexey From andre@tomt.net Wed Nov 19 17:34:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 17:34:43 -0800 (PST) Received: from mail.skjellin.no (mail.skjellin.no [80.239.42.67]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK1YJ25005667 for ; Wed, 19 Nov 2003 17:34:20 -0800 Received: (qmail 31029 invoked by uid 107); 20 Nov 2003 01:36:42 -0000 Received: from andre@tomt.net by ns1 by uid 1003 with qmail-scanner-1.20rc3 (clamuko: 0.60. sophie: 2.17/3.74. spamassassin: 2.60. Clear:RC:1:. Processed in 0.015402 secs); 20 Nov 2003 01:36:42 -0000 Received: from unknown (HELO slurv.pasop.tomt.net) (andre@tomt.net@217.8.136.222) by mail.skjellin.no with SMTP; 20 Nov 2003 01:36:42 -0000 Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion From: Andre Tomt To: netdev@oss.sgi.com Cc: Francois Romieu , Jeff Garzik , Brad House , Brad House In-Reply-To: <3FBC11F2.5080805@mcve.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.com> <20031120014550.A22377@electric-eye.fr.zoreil.com> <3FBC11F2.5080805@mcve.com> Content-Type: text/plain; charset=ISO-8859-1 Message-Id: <1069292052.3241.36.camel@slurv.pasop.tomt.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 20 Nov 2003 02:34:12 +0100 Content-Transfer-Encoding: 8bit X-archive-position: 1579 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre@tomt.net Precedence: bulk X-list: netdev Content-Length: 1288 Lines: 35 On Thu, 2003-11-20 at 01:59, Brad House wrote: > any reason why it's not against the v1.6 ? I think you misunderstood. If I intepret the list correctly, the 1.6 changes are in that list (as "your changes (week-end)".) > the current driver is missing support for the > 8110S chip (or at least it doesn't seem to work at all), > so you're cutting out all the chips on the mobos out there. > Haven't looked to see if it's just a PCI ID or other functionality, > but since the V1.2 is from realtek that's in the official > kernel, it would make sense to use the 1.6 patch.... IIRC, the realtek one got cleaned up a great deal before entering mainline, both bug-fixes and coding style cleanups. Your patch may revert a lot of that work (I havn't looked at it closely.) Also the changelog differs for the 1.2 entry between the two versions, indicating just this. Lets take one step at a time ;-) > > It is against the original r8169. Once finished, it should look like: > > - first cut at dma api conversion (today) > > - remaining bits of dma api conversion (tomorrow) > > - rx_copybreak (tomorrow) > > - your changes (week-end) > > - big-endian fixes (week-end) > > > > Each part divided in reasonably small patches to ease the test/review process. -- Mvh, André Tomt andre@tomt.net From brad@mcve.com Wed Nov 19 17:35:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 17:36:06 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK1Zq25006017 for ; Wed, 19 Nov 2003 17:35:52 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 1F6CF85774; Wed, 19 Nov 2003 20:49:02 -0500 (EST) Message-ID: <3FBC1A72.9020101@mcve.com> Date: Wed, 19 Nov 2003 20:35:46 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andre Tomt Cc: netdev@oss.sgi.com, Francois Romieu , Jeff Garzik , Brad House Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.com> <20031120014550.A22377@electric-eye.fr.zoreil.com> <3FBC11F2.5080805@mcve.com> <1069292052.3241.36.camel@slurv.pasop.tomt.net> In-Reply-To: <1069292052.3241.36.camel@slurv.pasop.tomt.net> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Content-Length: 1436 Lines: 45 yes, I definately misunderstood then ... sorry ;) I'll just apply the patches to my version and see what happens ;) -Brad Andre Tomt wrote: > On Thu, 2003-11-20 at 01:59, Brad House wrote: > >>any reason why it's not against the v1.6 ? > > > I think you misunderstood. If I intepret the list correctly, the 1.6 > changes are in that list (as "your changes (week-end)".) > > >>the current driver is missing support for the >>8110S chip (or at least it doesn't seem to work at all), >>so you're cutting out all the chips on the mobos out there. >>Haven't looked to see if it's just a PCI ID or other functionality, >>but since the V1.2 is from realtek that's in the official >>kernel, it would make sense to use the 1.6 patch.... > > > IIRC, the realtek one got cleaned up a great deal before entering > mainline, both bug-fixes and coding style cleanups. Your patch may > revert a lot of that work (I havn't looked at it closely.) Also the > changelog differs for the 1.2 entry between the two versions, indicating > just this. > > Lets take one step at a time ;-) > > >>>It is against the original r8169. Once finished, it should look like: >>>- first cut at dma api conversion (today) >>>- remaining bits of dma api conversion (tomorrow) >>>- rx_copybreak (tomorrow) >>>- your changes (week-end) >>>- big-endian fixes (week-end) >>> >>>Each part divided in reasonably small patches to ease the test/review process. > > From brad@mcve.com Wed Nov 19 17:36:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 17:37:12 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK1aw25006375 for ; Wed, 19 Nov 2003 17:36:58 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 2BD7585774; Wed, 19 Nov 2003 20:50:08 -0500 (EST) Message-ID: <3FBC1AB4.3040900@mcve.com> Date: Wed, 19 Nov 2003 20:36:52 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brad House Cc: Andre Tomt , netdev@oss.sgi.com, Francois Romieu , Jeff Garzik , Brad House Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.com> <20031120014550.A22377@electric-eye.fr.zoreil.com> <3FBC11F2.5080805@mcve.com> <1069292052.3241.36.camel@slurv.pasop.tomt.net> <3FBC1A72.9020101@mcve.com> In-Reply-To: <3FBC1A72.9020101@mcve.com> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1581 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Content-Length: 1681 Lines: 61 ok, misunderstood again ... geez .... now I get it ... he'll apply the 1.6 patch this weekend ... _sigh_ I really must be brain dead today. -Brad Brad House wrote: > yes, I definately misunderstood then ... > sorry ;) > I'll just apply the patches to my version and see what happens ;) > > -Brad > > Andre Tomt wrote: > >> On Thu, 2003-11-20 at 01:59, Brad House wrote: >> >>> any reason why it's not against the v1.6 ? >> >> >> >> I think you misunderstood. If I intepret the list correctly, the 1.6 >> changes are in that list (as "your changes (week-end)".) >> >> >>> the current driver is missing support for the >>> 8110S chip (or at least it doesn't seem to work at all), >>> so you're cutting out all the chips on the mobos out there. >>> Haven't looked to see if it's just a PCI ID or other functionality, >>> but since the V1.2 is from realtek that's in the official >>> kernel, it would make sense to use the 1.6 patch.... >> >> >> >> IIRC, the realtek one got cleaned up a great deal before entering >> mainline, both bug-fixes and coding style cleanups. Your patch may >> revert a lot of that work (I havn't looked at it closely.) Also the >> changelog differs for the 1.2 entry between the two versions, indicating >> just this. >> >> Lets take one step at a time ;-) >> >> >>>> It is against the original r8169. Once finished, it should look like: >>>> - first cut at dma api conversion (today) >>>> - remaining bits of dma api conversion (tomorrow) >>>> - rx_copybreak (tomorrow) >>>> - your changes (week-end) >>>> - big-endian fixes (week-end) >>>> >>>> Each part divided in reasonably small patches to ease the >>>> test/review process. >> >> >> > > > From greearb@candelatech.com Wed Nov 19 18:05:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 18:05:47 -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 hAK25X25007074 for ; Wed, 19 Nov 2003 18:05:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAK25FeO028938; Wed, 19 Nov 2003 18:05:22 -0800 Message-ID: <3FBC215B.2090100@candelatech.com> Date: Wed, 19 Nov 2003 18:05:15 -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: Function to determine if IP exists on a net-device? References: <3FBB36F2.7030402@candelatech.com> <20031119173103.1938bc51.davem@redhat.com> In-Reply-To: <20031119173103.1938bc51.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1582 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 Content-Length: 945 Lines: 34 David S. Miller wrote: > On Wed, 19 Nov 2003 01:25:06 -0800 > Ben Greear wrote: > > >>Is there a method already written that will tell me if an IP exists on >>a netdevice? >> >>If not, I am quite sure the answer lies in the in_ifaddr >>list, but which field holds the IP address for the device? > > > Call getifaddrs(), walk the list finding the each and every list entry > with the 'ifa_name' name matching the device you want. If there are > multiple addresses attached to an interface there will be multiple > in_ifaddr list entries with the 'ifa_name' of your interface. > > In each of those entry, check the sockaddr pointed to by the 'ifa_addr' > field. Is there not a more direct access if I already have the netdevice in question? ie, can I get at the list by looking at dev->ip_ptr struct? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From scott.feldman@intel.com Wed Nov 19 18:40:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 18:40:55 -0800 (PST) Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK2eI25008090 for ; Wed, 19 Nov 2003 18:40:30 -0800 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by hermes.jf.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 hAK2ekrF010845; Thu, 20 Nov 2003 02:40:46 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.jf.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 hAK2YBI08307; Thu, 20 Nov 2003 02:34:11 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.1.32) with SMTP id M2003111918400414471 ; Wed, 19 Nov 2003 18:40:04 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 19 Nov 2003 18:40:04 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Kernel crash in 2.6.0-test9-mm3 Date: Wed, 19 Nov 2003 18:40:04 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Kernel crash in 2.6.0-test9-mm3 Thread-Index: AcOuRVhr1DLwv4eASQ69GRM7hm/8OAAxs4mQ From: "Feldman, Scott" To: "David S. Miller" , "Krishna Kumar" Cc: , , X-OriginalArrivalTime: 20 Nov 2003 02:40:04.0755 (UTC) FILETIME=[9A79CE30:01C3AF0F] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAK2eI25008090 X-archive-position: 1583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev Content-Length: 1040 Lines: 23 > However, with things like IOAPIC and such, it might be > possible for two cpus to enter e100intr() simultaneously, > both read the same status, both see that the interrupt is > pending, and both thus process the interrupt and race with each other. > > Scott, what prevents the above from happening? Whoa, this question is freaking me out just a little bit: my assumption is that the device's interrupt line has been masked off at the CPU/PIC before e100intr() is ever called, so 1) there really isn't any need to disable device's interrupts from the driver (see eepro100.c), 2) or even hold a lock unless we shared something critical on the queuing side (see e1000), and 3) only one e100intr is running. [public spanking in order?] I'm not sure what's behind the rest of the bug report, but if you're saying e100intr() can be running simultaneously on two different CPUs, then there is a problem because the test for device interrupt and the acking of device interrupt are two steps that need to be protected with a lock. -scott From viro@www.linux.org.uk Wed Nov 19 18:54:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 18:54:46 -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 hAK2sO25008566 for ; Wed, 19 Nov 2003 18:54:25 -0800 Received: from viro by www.linux.org.uk with local (Exim 4.22) id 1AMexb-0000JX-R4; Thu, 20 Nov 2003 02:54:23 +0000 Date: Thu, 20 Nov 2003 02:54:23 +0000 From: viro@parcelfarce.linux.theplanet.co.uk To: Jeff Garzik Cc: netdev@oss.sgi.com, Linux Kernel Subject: Re: [CFT] 2.6.x experimental net driver updates Message-ID: <20031120025423.GB24159@parcelfarce.linux.theplanet.co.uk> References: <3FBBA954.6000601@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FBBA954.6000601@pobox.com> User-Agent: Mutt/1.4.1i X-archive-position: 1584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: viro@parcelfarce.linux.theplanet.co.uk Precedence: bulk X-list: netdev Content-Length: 596 Lines: 12 On Wed, Nov 19, 2003 at 12:33:08PM -0500, Jeff Garzik wrote: > Ok, Al Viro's net driver refcounting work is pretty much complete, and The hell it is. We are through with legacy probes, we are through with init_etherdev(), we are practically through with static struct net_device. However, we still have weird allocators (I've got almost all of them done by now, will submit in the next batch) and we still have struct net_device embedded as a field of other structures in several drivers. It's nowhere near as massive as legacy probes series, but it's going to be 10--20 patches. At least. From jgarzik@pobox.com Wed Nov 19 18:56:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 18:56:14 -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 hAK2tv25008933 for ; Wed, 19 Nov 2003 18:56:00 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48084 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMdl5-0008C6-0f; Thu, 20 Nov 2003 01:37:23 +0000 Message-ID: <3FBC1AB4.9010503@pobox.com> Date: Wed, 19 Nov 2003 20:36:52 -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: Brad House CC: Francois Romieu , Brad House , netdev@oss.sgi.com Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <3FBC05FB.2020409@mcve.com> <20031120014550.A22377@electric-eye.fr.zoreil.com> <3FBC11F2.5080805@mcve.com> In-Reply-To: <3FBC11F2.5080805@mcve.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1585 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 Content-Length: 669 Lines: 21 Brad House wrote: > any reason why it's not against the v1.6 ? > the current driver is missing support for the > 8110S chip (or at least it doesn't seem to work at all), > so you're cutting out all the chips on the mobos out there. > Haven't looked to see if it's just a PCI ID or other functionality, > but since the V1.2 is from realtek that's in the official > kernel, it would make sense to use the 1.6 patch.... > > I suppose I could do it, but it would take me much > more time simply because I'm not familiar with the > changes you're making. He's doing the work, and he included 1.6 in his list of changes... looks like everybody will be happy :) Jeff From reuben-linux@reub.net Wed Nov 19 19:06:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 19:07:06 -0800 (PST) Received: from tornado.reub.net (219-88-72-199.adsl.xtra.co.nz [219.88.72.199]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK36g25009433 for ; Wed, 19 Nov 2003 19:06:46 -0800 Received: (qmail 12961 invoked from network); 20 Nov 2003 03:06:30 -0000 Received: from unknown (HELO dc00241.reub.net) (202.37.49.110) by tornado.reub.net with SMTP; 20 Nov 2003 03:06:30 -0000 Message-Id: <6.0.1.1.0.20031120160110.02412b80@tornado.reub.net> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Thu, 20 Nov 2003 16:05:27 +1300 To: "David S. Miller" From: Reuben Farrelly Subject: Re: Kernel crash in 2.6.0-test9-mm3 Cc: kumarkr@us.ibm.com, akpm@osdl.org, netdev@oss.sgi.com In-Reply-To: <20031119185157.3edf69c8.davem@redhat.com> References: <6.0.1.1.0.20031119155347.023f89d0@tornado.reub.net> <20031119185157.3edf69c8.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-archive-position: 1586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: reuben-linux@reub.net Precedence: bulk X-list: netdev Content-Length: 558 Lines: 18 Yes - with the patch backed out, the system has been up for 20 hours without a crash and nothing has been logged. I was just holding off a bit longer before reporting back in case it just needs a bit more time to trigger ;-) Reuben At 15:51 20/11/2003, David S. Miller wrote: >On Wed, 19 Nov 2003 15:58:18 +1300 >Reuben Farrelly wrote: > > > The system is a UP system.. > >Have you done ask Andrew asked, backing out the atomic_dec_and_test() >debugging patch to see if all the weird kernel log messages go away >as a result? From jgarzik@pobox.com Wed Nov 19 21:24:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 21:24:35 -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 hAK5OG25017817 for ; Wed, 19 Nov 2003 21:24:21 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48162 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMhId-0001YF-7U; Thu, 20 Nov 2003 05:24:15 +0000 Message-ID: <3FBC4FE0.2020705@pobox.com> Date: Thu, 20 Nov 2003 00:23:44 -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: viro@parcelfarce.linux.theplanet.co.uk CC: netdev@oss.sgi.com, Linux Kernel Subject: Re: [CFT] 2.6.x experimental net driver updates References: <3FBBA954.6000601@pobox.com> <20031120025423.GB24159@parcelfarce.linux.theplanet.co.uk> In-Reply-To: <20031120025423.GB24159@parcelfarce.linux.theplanet.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1587 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 Content-Length: 819 Lines: 24 viro@parcelfarce.linux.theplanet.co.uk wrote: > On Wed, Nov 19, 2003 at 12:33:08PM -0500, Jeff Garzik wrote: > >>Ok, Al Viro's net driver refcounting work is pretty much complete, and > > > The hell it is. We are through with legacy probes, we are through with > init_etherdev(), we are practically through with static struct net_device. hehe :) I don't mean to suggest that all is clean and pure :) > However, we still have weird allocators (I've got almost all of them > done by now, will submit in the next batch) and we still have struct > net_device embedded as a field of other structures in several drivers. Some of that will be interesting. ns83820 for example embedded net_device on purpose... Ben seemed to think at the time it gave him some speed, a few less pointer derefs and such. Jeff From jgarzik@pobox.com Wed Nov 19 21:54:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 21:55:12 -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 hAK5st25018444 for ; Wed, 19 Nov 2003 21:54:56 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47754 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMVzC-000794-9z; Wed, 19 Nov 2003 17:19:26 +0000 Message-ID: <3FBBA601.3080709@pobox.com> Date: Wed, 19 Nov 2003 12:18:57 -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: Xose Vazquez Perez CC: netdev@oss.sgi.com Subject: Re: [PATCH ] more eepro100 boards References: <3FBA97E4.1060004@wanadoo.es> In-Reply-To: <3FBA97E4.1060004@wanadoo.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1588 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 Content-Length: 629 Lines: 35 Xose Vazquez Perez wrote: > deleted PCI_DEVICE_ID_INTEL_82801BA_7, it's a duplicate of 0x2449 > > and added five boards: > > 0x1051 > 0x1052 > 0x1053 > 0x1054 > 0x1055 > > > These should be deleted: > > 0x1035 > 0x1036 > 0x1037 > 0x1227 > 0x1228 > 0x5200 > 0x5201 > > Time ago, in conversation with some intel guys, they said me that > those boards are not compatibles with the driver. Do anyone run > eepro100 with any of those boards? Indeed.... I would like to delay this patch, until we are confirmed that these pci ids do indeed work with eepro100.c. Once we get confirmation, I am OK with applying. Jeff From c-d.hailfinger.kernel.2003@gmx.net Wed Nov 19 22:11:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 22:11:45 -0800 (PST) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK6BT25018942 for ; Wed, 19 Nov 2003 22:11:30 -0800 Received: (qmail 12566 invoked by uid 65534); 20 Nov 2003 06:11:23 -0000 Received: from stud212140.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.140) by mail.gmx.net (mp001) with SMTP; 20 Nov 2003 07:11:23 +0100 X-Authenticated: #15936885 Message-ID: <3FBC5B04.50801@gmx.net> Date: Thu, 20 Nov 2003 07:11:16 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 X-Accept-Language: de, en MIME-Version: 1.0 To: Linux Kernel Mailing List CC: netdev@oss.sgi.com, Manfred Spraul Subject: forcedeth: version 0.18 available X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1589 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: c-d.hailfinger.kernel.2003@gmx.net Precedence: bulk X-list: netdev Content-Length: 508 Lines: 21 Hello all, version 0.18 of forcedeth for Linux 2.4 and 2.6 is available at http://www.hailfinger.org/carldani/linux/patches/forcedeth/ It is also integrated in 2.6.0-test9-mm4. Fixes in this release over 0.17: * Avoid Oops on rmmod. Known issues: * Some boards give bogus MAC addresses and work only partially. Same problem happens with nvnet on these boards. * Possible system slowdown during periods of extreme network load, fix is currently being tested. Please test. Regards, Carl-Daniel From viro@www.linux.org.uk Wed Nov 19 22:59:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 22:59: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 hAK6xO25019646 for ; Wed, 19 Nov 2003 22:59:25 -0800 Received: from viro by www.linux.org.uk with local (Exim 4.22) id 1AMhf7-0002WP-Il; Thu, 20 Nov 2003 05:47:29 +0000 Date: Thu, 20 Nov 2003 05:47:29 +0000 From: viro@parcelfarce.linux.theplanet.co.uk To: Jeff Garzik Cc: netdev@oss.sgi.com, Linux Kernel Subject: Re: [CFT] 2.6.x experimental net driver updates Message-ID: <20031120054729.GC24159@parcelfarce.linux.theplanet.co.uk> References: <3FBBA954.6000601@pobox.com> <20031120025423.GB24159@parcelfarce.linux.theplanet.co.uk> <3FBC4FE0.2020705@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FBC4FE0.2020705@pobox.com> User-Agent: Mutt/1.4.1i X-archive-position: 1590 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: viro@parcelfarce.linux.theplanet.co.uk Precedence: bulk X-list: netdev Content-Length: 1469 Lines: 33 On Thu, Nov 20, 2003 at 12:23:44AM -0500, Jeff Garzik wrote: > viro@parcelfarce.linux.theplanet.co.uk wrote: > >On Wed, Nov 19, 2003 at 12:33:08PM -0500, Jeff Garzik wrote: > > > >>Ok, Al Viro's net driver refcounting work is pretty much complete, and > > > > > >The hell it is. We are through with legacy probes, we are through with > >init_etherdev(), we are practically through with static struct net_device. > > hehe :) I don't mean to suggest that all is clean and pure :) > > > >However, we still have weird allocators (I've got almost all of them > >done by now, will submit in the next batch) and we still have struct > >net_device embedded as a field of other structures in several drivers. > > Some of that will be interesting. ns83820 for example embedded > net_device on purpose... Ben seemed to think at the time it gave him > some speed, a few less pointer derefs and such. That's fine, but 83820 should be doing that the other way round. Note that for objects allocated by alloc_netdev() we have (char*) dev->priv == (char *)dev + const and constant can be found at compile time _if_ we pad in front of net_device and add a pointer to allocated block into net_device. So we can have exactly the same structure (modulo padding) and no extra dereferencing. All we need is inlined void *net_priv(struct net_device *); That, BTW, would be a win for other drivers using alloc_...() and not reassigning ->priv (i.e. majority of those beasts). From jgarzik@pobox.com Wed Nov 19 23:02:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 23:02:50 -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 hAK72a25020061 for ; Wed, 19 Nov 2003 23:02:36 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:47753 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMVwh-0006qj-W1; Wed, 19 Nov 2003 17:16:52 +0000 Message-ID: <3FBBA565.3090206@pobox.com> Date: Wed, 19 Nov 2003 12:16:21 -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: OGAWA Hirofumi , netdev@oss.sgi.com, Jes Sorensen Subject: Re: [PATCH] 8139too NAPI for net-drivers-2.5-exp References: <20031118161730.2690cb76.shemminger@osdl.org> In-Reply-To: <20031118161730.2690cb76.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1591 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 Content-Length: 753 Lines: 22 Stephen Hemminger wrote: > Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. > Also: > 64k receive ring - has to handle wrap for that case; > the NoWrap flag does nothing if using this big ring. > assert() -> BUG_ON() > > To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. Applied with a "but"... This patch still contains some errors WRT 8139 hardware and the RX path. But I'm comfortable with nailing those problems down during public testing of net-drivers-2.5-exp. Hirofumi, Stephen, and others, please test, particularly packet floods with (a) tiny packets and (b) huge packets. Ditto Jes, if you've still got hardware, and are interested in DoS fixes in 8139too. Jeff From reuben-linux@reub.net Wed Nov 19 23:30:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Nov 2003 23:30:54 -0800 (PST) Received: from tornado.reub.net (219-88-72-199.adsl.xtra.co.nz [219.88.72.199]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK7UY25020707 for ; Wed, 19 Nov 2003 23:30:35 -0800 Received: (qmail 14480 invoked from network); 20 Nov 2003 07:30:30 -0000 Received: from typhoon.reub.net (192.168.0.5) by tornado.reub.net with SMTP; 20 Nov 2003 07:30:30 -0000 Message-Id: <6.0.1.1.2.20031120202518.01b53738@tornado.reub.net> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Thu, 20 Nov 2003 20:30:31 +1300 To: "David S. Miller" From: Reuben Farrelly Subject: Re: Kernel crash in 2.6.0-test9-mm3 Cc: kumarkr@us.ibm.com, akpm@osdl.org, netdev@oss.sgi.com In-Reply-To: <20031119190258.4d926957.davem@redhat.com> References: <6.0.1.1.0.20031119155347.023f89d0@tornado.reub.net> <20031119185157.3edf69c8.davem@redhat.com> <6.0.1.1.0.20031120160110.02412b80@tornado.reub.net> <20031119190258.4d926957.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-archive-position: 1592 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: reuben-linux@reub.net Precedence: bulk X-list: netdev Content-Length: 953 Lines: 25 Ok I'll take this up with jakub@redhat, the gcc package maintainer at Redhat. What is interesting (or scary) is that the version of gcc that I'm using (3.3.2-2) is only one rebuild out from the one shipped in Fedora Core 1 (3.3.2-1), so I may not be the last person to hit this problem.. Reuben At 04:02 p.m. 20/11/2003, David S. Miller wrote: >On Thu, 20 Nov 2003 16:05:27 +1300 >Reuben Farrelly wrote: > > > Yes - with the patch backed out, the system has been up for 20 hours > > without a crash and nothing has been logged. I was just holding off a bit > > longer before reporting back in case it just needs a bit more time to > > trigger ;-) > >Thanks a lot for this feedback. > >I really think gcc-3.x you're using is miscompiling some parts of >the kernel with the patch applied. Someone should look at the >x86 output assembler for things like the atomic_dec_and_test() call >in net/core/skbuff.c:kfree_skbmem() From greearb@candelatech.com Thu Nov 20 00:30:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 00:30:50 -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 hAK8UY25024452 for ; Thu, 20 Nov 2003 00:30:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAK8USeO029831 for ; Thu, 20 Nov 2003 00:30:28 -0800 Message-ID: <3FBC7BA4.9070501@candelatech.com> Date: Thu, 20 Nov 2003 00:30:28 -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: Re: Function to determine if IP exists on a net-device? References: <3FBB36F2.7030402@candelatech.com> <20031119173103.1938bc51.davem@redhat.com> <3FBC215B.2090100@candelatech.com> <20031119181529.4c2b861a.davem@redhat.com> In-Reply-To: <20031119181529.4c2b861a.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1593 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 Content-Length: 1209 Lines: 57 David S. Miller wrote: > On Wed, 19 Nov 2003 18:05:15 -0800 > Ben Greear wrote: > > >>Is there not a more direct access if I already have the netdevice in question? >>ie, can I get at the list by looking at dev->ip_ptr struct? > > > Yes, using dev->ip_ptr as a "struct in_device *in_dev" > do something like this: > > struct in_ifaddr *ifa; > > read_lock(&in_dev->lock); > for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { > if (inet_ifa_match(my_addr, ifa)) { > /* match */ > } > } > read_unlock(&in_dev->lock); > > should work... > The inet_ifa_match thing uses a mask, and was matching everything on the subnet, or something... This seems to work though: static int is_ip_on_dev(struct net_device* dev, __u32 ip) { int rv = 0; struct in_device* in_dev = in_dev_get(dev); if (in_dev) { struct in_ifaddr *ifa; read_lock(&in_dev->lock); for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_address == ip) { /* match */ rv = 1; break; } } read_unlock(&in_dev->lock); in_dev_put(in_dev); } return rv; } -- Ben Greear Candela Technologies Inc http://www.candelatech.com From hans@schwimmbeck.de Thu Nov 20 00:50:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 00:50:51 -0800 (PST) Received: from moutng1.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAK8oE25025572 for ; Thu, 20 Nov 2003 00:50:35 -0800 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng1.kundenserver.de with esmtp (Exim 3.35 #1) id 1AMkVx-00017q-00 for netdev@oss.sgi.com; Thu, 20 Nov 2003 09:50:13 +0100 Received: from [217.235.72.70] (helo=192.168.1.1) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AMkVx-0002sP-00 for netdev@oss.sgi.com; Thu, 20 Nov 2003 09:50:13 +0100 From: Hans Schwimmbeck To: netdev@oss.sgi.com Subject: forcedeth 0.18 on nForce Date: Thu, 20 Nov 2003 09:50:57 +0100 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311200950.58211.hans@schwimmbeck.de> X-archive-position: 1594 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hans@schwimmbeck.de Precedence: bulk X-list: netdev Content-Length: 965 Lines: 30 System: Mainboard MSI nForce K7N415 Pro OS SUSE 8.2 updated kernel k_athlon-2.4.20-100 and kernel-source-2.4.20.SuSE-100 I compiled forcedeth 0.18 as external module by "make" using the makefile --------- KERNELDIR = /usr/src/linux CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O all: forcedeth.o --------- forcedeth.o is replacing nvnet.o and working so far without any problem. The only output I get in my /var/log/messages is: --------- Nov 20 08:22:52 linux kernel: forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.18. Nov 20 08:22:52 linux kernel: PCI: Setting latency timer of device 00:04.0 to 64 Nov 20 08:22:52 linux kernel: eth0: forcedeth.c: subsystem: 01462:373c --------- Is it possible to publish forcedeth.c in future releases as I prefer compiling as an external module to patching the sources? Anyway - thank's a lot for the great driver, hopefully Nvidia will think about their non-disclosure policy now. Hans From herbert@gondor.apana.org.au Thu Nov 20 01:56:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 01:56:45 -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 hAK9uL25026975 for ; Thu, 20 Nov 2003 01:56:22 -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 1AMlXk-0006uK-00; Thu, 20 Nov 2003 20:56:08 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AMlXh-0001iK-00; Thu, 20 Nov 2003 20:56:05 +1100 Date: Thu, 20 Nov 2003 20:56:05 +1100 To: "David S. Miller" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [TG3] Always load TSO firmware Message-ID: <20031120095605.GA6572@gondor.apana.org.au> References: <20031117093225.GA12420@gondor.apana.org.au> <20031117123836.2f8e70af.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20031117123836.2f8e70af.davem@redhat.com> User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1595 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 Content-Length: 1781 Lines: 56 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 17, 2003 at 12:38:36PM -0800, David S. Miller wrote: > > Whether we load the TSO firmware or not on 5705 determines how big > an onboard buffer area we give to the chip for packet data. It may > be the case that we are miscalculating these values or not programming > them into the chip correctly. OK, I've cross-checked with the Broadcom drivers and the problem seems to be specific to 5705 A1 which is the chipset in question. The Broadcom drivers limit the number of rx descriptors to 63 while tg3.c only limits it to 64. It has been confirmed that lowering the limit makes the problem go away. Here is the patch. Thanks, -- 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 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=q --- tg3.c.orig 2003-11-18 21:18:04.000000000 +1100 +++ tg3.c 2003-11-18 21:34:22.000000000 +1100 @@ -6067,8 +6067,8 @@ tp->rx_pending = ering->rx_pending; if ((tp->tg3_flags2 & TG3_FLG2_MAX_RXPEND_64) && - tp->rx_pending > 64) - tp->rx_pending = 64; + tp->rx_pending > 63) + tp->rx_pending = 63; tp->rx_jumbo_pending = ering->rx_jumbo_pending; tp->tx_pending = ering->tx_pending; @@ -7672,7 +7672,7 @@ !(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) && !(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) { tp->tg3_flags2 |= TG3_FLG2_MAX_RXPEND_64; - tp->rx_pending = 64; + tp->rx_pending = 63; } if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) --k+w/mQv8wyuph6w0-- From amir.noam@intel.com Thu Nov 20 02:08:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 02:09:07 -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 hAKA8o25027446 for ; Thu, 20 Nov 2003 02:08:51 -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 hAKA8hPt006525 for ; Thu, 20 Nov 2003 10:08:43 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.12.9-20030918-01/8.11.6/d: large-inner.mc,v 1.5 2003/10/14 21:47:05 root Exp $) with SMTP id hAKA8dgE012477 for ; Thu, 20 Nov 2003 10:08:43 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003112012084227455 ; Thu, 20 Nov 2003 12:08:42 +0200 Received: from jrslxjul6 (jrslxjul6 [10.12.220.56]) by sun111.npdj.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id hAKA8GFo014112; Thu, 20 Nov 2003 12:08:18 +0200 (IST) From: Amir Noam To: jgarzik@pobox.com, davem@redhat.com Subject: [PATCH] [bonding] fix creation of /proc/net/bonding dir Date: Thu, 20 Nov 2003 13:05:41 +0200 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311201305.53708.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 1596 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 Content-Length: 3713 Lines: 164 Jeff, David, This fix is waiting for almost a month to be applied, and it should be in 2.4.23. Can one of you, please, apply this and send it to Marcelo before 2.4.23 is made final? This fixes a bug that was introduced in 2.4.23-pre5, that causes problems to users who use multiple bonding modes. 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 dada1@cosmosbay.com Thu Nov 20 02:55:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 02:55:43 -0800 (PST) Received: from gw1.cosmosbay.com (gw1.cosmosbay.com [62.23.185.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAKAtS25029759 for ; Thu, 20 Nov 2003 02:55:29 -0800 Received: from edumazet (easynetvilleurbanne [212.180.56.17]) by gw1.cosmosbay.com (8.12.9/8.12.9) with SMTP id hAKAtKHK004025 for ; Thu, 20 Nov 2003 11:55:20 +0100 Message-ID: <02da01c3af54$c1f37f20$890010ac@edumazet> From: "dada1" To: Subject: Performance problem with route cache ? Date: Thu, 20 Nov 2003 11:55:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 1597 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dada1@cosmosbay.com Precedence: bulk X-list: netdev Content-Length: 2580 Lines: 85 Hi all I'm doing some oprofile on a bi athlon, linux-2.6.0-test8 kernel, (with a copybreak intel e1000 patch, because the machine receives a lot of small (< 30 bytes) messages) It seems the route cache may/should be tuned, but I dont know how. The machine receives about 10000 packets/second, from a lot of different IP. Cpu type: Athlon Cpu speed was (MHz estimation) : 1991.43 Counter 0 counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0x00 (No unit mask) count 50000 vma samples % symbol name a0251fd0 6477022 15.6789 rt_garbage_collect a028b6a0 2692339 6.51731 ipt_do_table a0254560 1779167 4.30681 ip_route_input a0251c40 1544801 3.73948 rt_may_expire a0273370 1119668 2.71037 tcp_v4_rcv a01f4350 1084883 2.62616 e1000_clean_rx_irq a013dd70 1048705 2.53859 free_block a013e120 844766 2.04492 kfree a0269cc0 600011 1.45244 tcp_rcv_established a0111c20 540780 1.30906 mark_offset_tsc a0235d40 536856 1.29956 skb_release_data a023a9a0 521576 1.26257 net_rx_action a0259dc0 515115 1.24693 ip_queue_xmit a023f990 498217 1.20603 dst_alloc a0260190 487681 1.18052 tcp_sendmsg a0231fe0 477588 1.15609 sockfd_lookup a0118c30 459348 1.11194 schedule a0261bd0 454353 1.09985 tcp_recvmsg a01070c0 442280 1.07062 default_idle # grep ip_dst_cache /proc/slabinfo ip_dst_cache 253051 324840 320 12 1 : tunables 54 27 8 : slabdata 27070 27070 0 # cat /proc/net/sockstat sockets: used 246459 TCP: inuse 245501 orphan 591 tw 5639 alloc 247035 mem 74061 UDP: inuse 6 RAW: inuse 0 FRAG: inuse 3 memory 1164 #grep "routing cache hash table " /var/log/syslog kernel: IP: routing cache hash table of 32768 buckets, 256Kbytes # cat /proc/meminfo MemTotal: 3371408 kB MemFree: 847716 kB Buffers: 70352 kB Cached: 91080 kB SwapCached: 0 kB Active: 1162512 kB Inactive: 27360 kB HighTotal: 1900544 kB HighFree: 161920 kB LowTotal: 1470864 kB LowFree: 685796 kB SwapTotal: 506008 kB SwapFree: 506008 kB Dirty: 2092 kB Writeback: 0 kB Mapped: 1038884 kB Slab: 704636 kB Committed_AS: 1549704 kB PageTables: 1412 kB VmallocTotal: 49144 kB VmallocUsed: 2380 kB VmallocChunk: 45896 kB HugePages_Total: 150 HugePages_Free: 48 Hugepagesize: 4096 kB Does anybody have a hint, what should I change to lower a bit the CPU used in kernel land ? Thanks Eric Dumazet From Robert.Olsson@data.slu.se Thu Nov 20 04:37:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 04:38:08 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAKCbp25006075 for ; Thu, 20 Nov 2003 04:37:52 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id NAA29985; Thu, 20 Nov 2003 13:37:43 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 12F30EC23D; Thu, 20 Nov 2003 13:37:49 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16316.46493.7576.116171@robur.slu.se> Date: Thu, 20 Nov 2003 13:37:49 +0100 To: "dada1" Cc: Subject: Performance problem with route cache ? In-Reply-To: <02da01c3af54$c1f37f20$890010ac@edumazet> References: <02da01c3af54$c1f37f20$890010ac@edumazet> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 1598 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 804 Lines: 24 dada1 writes: > Hi all > > I'm doing some oprofile on a bi athlon, linux-2.6.0-test8 kernel, (with a > copybreak intel e1000 patch, because the machine receives a lot of small (< > 30 bytes) messages) Does the copybreak help? I tested copybreak long time ago and saw no gain from it. Do you have pointer to the patch? > It seems the route cache may/should be tuned, but I dont know how. Tuning is not an easy task and not necessarily you will gain anything, It fully depends on your input traffic but it seems your system has a lot of dst entries. Which would cause a lot linear search. Packets per flow and no of parallel flows should be of interest for you. rtstat can give you a better feeling of incoming routing load. Is 10kpkts/s the max performance? Cheers. --ro From felix@allot.com Thu Nov 20 06:17:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 06:18:10 -0800 (PST) Received: from mxout5.netvision.net.il (mxout5.netvision.net.il [194.90.9.29]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAKEHh25007434 for ; Thu, 20 Nov 2003 06:17:44 -0800 Received: from exg.allot.com ([199.203.223.202]) by mxout5.netvision.net.il (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with ESMTP id <0HON00BEVI9AO9@mxout5.netvision.net.il> for netdev@oss.sgi.com; Thu, 20 Nov 2003 14:48:46 +0200 (IST) Received: from allot.com (199.203.223.201 [199.203.223.201]) by exg.allot.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id W9A3QKVH; Thu, 20 Nov 2003 14:48:39 +0200 Date: Thu, 20 Nov 2003 15:50:11 +0200 From: Felix Radensky Subject: hw tcp v4 csum failed on 2.4.23-rc2 To: netdev@oss.sgi.com Message-id: <3FBCC693.7070404@allot.com> Organization: Allot Communications Ltd. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-archive-position: 1599 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felix@allot.com Precedence: bulk X-list: netdev Content-Length: 1232 Lines: 41 Hi, I keep getting tons of this messages with 2.4.23-rc2 and e100 driver: memory : df576280 memory : df576200 memory : df576180 memory : df576100 memory : dca33f80 hw tcp v4 csum failed hw tcp v4 csum failed .... Is it a hardware problem or e100 problem ? The hardware is Asus MB with Pentum 4 2.4GHz 00:00.0 Host bridge: Intel Corp. 82865G/PE/P Processor to I/O Controller (rev 02) 00:02.0 VGA compatible controller: Intel Corp. 82865G Integrated Graphics Device (rev 02) 00:1d.0 USB Controller: Intel Corp. 82801EB USB (rev 02) 00:1d.1 USB Controller: Intel Corp. 82801EB USB (rev 02) 00:1d.2 USB Controller: Intel Corp. 82801EB USB (rev 02) 00:1d.3 USB Controller: Intel Corp. 82801EB USB (rev 02) 00:1d.7 USB Controller: Intel Corp. 82801EB USB2 (rev 02) 00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB PCI Bridge (rev c2) 00:1f.0 ISA bridge: Intel Corp. 82801EB LPC Interface Controller (rev 02) 00:1f.1 IDE interface: Intel Corp. 82801EB Ultra ATA Storage Controller (rev 02) 00:1f.3 SMBus: Intel Corp. 82801EB SMBus Controller (rev 02) 00:1f.5 Multimedia audio controller: Intel Corp. 82801EB AC'97 Audio Controller (rev 02) 01:08.0 Ethernet controller: Intel Corp.: Unknown device 1050 (rev 02) Thanks. Felix. From jgarzik@pobox.com Thu Nov 20 08:19:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 08:20:09 -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 hAKGJl25013134 for ; Thu, 20 Nov 2003 08:19:48 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48401 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMrWy-0006Jm-P7; Thu, 20 Nov 2003 16:19:44 +0000 Message-ID: <3FBCE981.7010405@pobox.com> Date: Thu, 20 Nov 2003 11:19:13 -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: Amir Noam CC: davem@redhat.com, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [bonding] fix creation of /proc/net/bonding dir References: <200311201305.53708.amir.noam@intel.com> In-Reply-To: <200311201305.53708.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1600 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 Content-Length: 18 Lines: 3 thanks, applied From rask@sygehus.dk Thu Nov 20 08:34:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 08:34:29 -0800 (PST) Received: from 0x50a14406.albnxx15.adsl-dhcp.tele.dk (0x50a14406.albnxx15.adsl-dhcp.tele.dk [80.161.68.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAKGY925013594 for ; Thu, 20 Nov 2003 08:34:10 -0800 Received: by 0x50a14406.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 6D62F45FA; Thu, 20 Nov 2003 17:34:08 +0100 (CET) Date: Thu, 20 Nov 2003 17:34:08 +0100 From: Rask Ingemann Lambertsen To: "'netdev@oss.sgi.com'" Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? Message-ID: <20031120173404.A1538@sygehus.dk> References: <3FB94311.10004@candelatech.com> <20031119123556.A7622@sygehus.dk> <3FBB8D61.6010106@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: <3FBB8D61.6010106@candelatech.com>; from greearb@candelatech.com on Wed, Nov 19, 2003 at 07:33:53AM -0800 X-archive-position: 1601 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 Content-Length: 5439 Lines: 149 On Wed, Nov 19, 2003 at 07:33:53AM -0800, Ben Greear wrote: > Rask Ingemann Lambertsen wrote: > > > > The Intel i82586 and i82596 and can be told to receive frames with a bad FCS. > > They can also be told to send a precomputed FCS rather than computing it on > > the fly. The i82596 and tulip can also transfer the FCS to memory when > > receiving frames. I guess all of this is also supported on the i82557/8/9. > > If you have a patch or example code that shows how to do this, I'd love to > see it. I have code that should RX bad CSUM from the Intel folks, but I can't > get it to generate bad CRC (it does framing errors instead with my attempt), > so I can't test the RX code properly! The i825xx Ethernet chips are configured by putting a configure command on the TX list. One of the bits of the configure command tells the chip to discard or keep packets with errors. Assuming you can find that piece of code, flipping the bit is easy enough. Similiarily for transferring the FCS to/from memory. IIRC, this is a per-frame setting for TX on i82596 and i82557/8/9. You can find i82596 documentation on Intel's home page and the i82557/8/9 on SourceForge under the e100 (or was it e1000?) project. You will still need to hack the RX code to not discard frames with the error flag set. I don't have any code to show for it. Please note that error counters displayed by "ifconfig" and "netstat -i" are based on /proc/net/dev (or so), which is a munged version of dev->get_stats(). Use "ip -s -s link show" to get the real values (and correctly labelled too). And even then, some drivers may not maintain the statistics properly. > I have the path from user-space to the NIC written, so just need to tweak the > drivers a bit... Indeed, since currently drivers are assumed to strip the FCS on RX and insert it on TX. There is no defined way of telling the drivers that the FCS should be in the skb. > Do you know if tulip can be told to accept bad FCS and/or if it can generate > a frame with bad FCS somehow? No. I don't know much about the tulip. But here is what I do know: 1) The FCS is transferred to memory right after the frame data. If you disable the rx_copy_break, then you'll find it in the skb (at skb->tail). 2) The maximum frame size, all included, is 2047 bytes, because of the descriptor format. Some "jumbo" frame, eh? 3) Frames larger than 1514 bytes (not including the FCS) are flagged as errored, even when otherwise perfectly fine, and passed to the host. With a bit of luck, the tulip will pass you frames with a bad FCS too. 4) The transmitter stops working after a few frames if the MTU is larger than about 2014 bytes. You can hack the RX path to mung the error bits before testing them. Like so (this is my experimental VLAN/jumbo frame hack for the de2104x driver): --- linux-2.6.0-test8/drivers/net/tulip/de2104x.c-orig Tue Oct 21 12:34:44 2003 +++ linux-2.6.0-test8/drivers/net/tulip/de2104x.c Tue Nov 11 15:29:15 2003 @@ -19,7 +19,6 @@ like dl2k.c/sundance.c * Constants (module parms?) for Rx work limit * Complete reset on PciErr - * Jumbo frames / dev->change_mtu * Adjust Rx FIFO threshold and Max Rx DMA burst on Rx FIFO error * Adjust Tx FIFO threshold and Max Tx DMA burst on Tx FIFO error * Implement Tx software interrupt mitigation via @@ -36,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -94,6 +100,7 @@ (CP)->tx_tail + (DE_TX_RING_SIZE - 1) - (CP)->tx_head : \ (CP)->tx_tail - (CP)->tx_head - 1) +#define PKT_BUF_SZ_MAX 2047 /* Maximum Rx buffer size. */ #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ #define RX_OFFSET 2 @@ -403,7 +410,7 @@ int rc; while (rx_work--) { - u32 status, len; + u32 status, len, status_hacked; dma_addr_t mapping; struct sk_buff *skb, *copy_skb; unsigned copying_skb, buflen; @@ -424,7 +431,13 @@ goto rx_next; } - if (unlikely((status & 0x38008300) != 0x0300)) { + /* Ugly Jumbo frame hack. Remove error flag on long frames. */ + if ((status & (RxErrLong | RxErrCRC | RxErrFIFO | RxErrRunt | RxErrFrame)) == RxErrLong) + status_hacked = status & ~(RxError | RxErrLong); + else + status_hacked = status; + + if (unlikely((status_hacked & 0x38008300) != 0x0300)) { de_rx_err_acct(de, rx_tail, status, len); goto rx_next; } @@ -1372,6 +1390,8 @@ printk(KERN_DEBUG "%s: enabling interface\n", dev->name); de->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); + if (de->rx_buf_sz > PKT_BUF_SZ_MAX) + de->rx_buf_sz = PKT_BUF_SZ_MAX; rc = de_alloc_rings(de); if (rc) { @@ -1464,6 +1482,18 @@ netif_wake_queue(dev); } +static int de_change_mtu (struct net_device *dev, int mtu) +{ + if (netif_running (dev)) + return (-EBUSY); + + if (mtu < 0 || mtu > PKT_BUF_SZ_MAX - VLAN_ETH_HLEN - 4) + return (-EINVAL); + + dev->mtu = mtu; + return (0); +} + static void __de_get_regs(struct de_private *de, u8 *buf) { int i; @@ -1964,6 +1994,7 @@ dev->ethtool_ops = &de_ethtool_ops; dev->tx_timeout = de_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + dev->change_mtu = de_change_mtu; dev->irq = pdev->irq; I saw a link to the tulip documentation somewhere, but I neither bookmarked the URL nor downloaded the documentation. :-( -- Regards, Rask Ingemann Lambertsen From amir.noam@intel.com Thu Nov 20 08:59:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 08:59:39 -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 hAKGxN25014150 for ; Thu, 20 Nov 2003 08:59:24 -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 hAKGxDPt031550 for ; Thu, 20 Nov 2003 16:59:13 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.12.9-20030918-01/8.11.6/d: large-inner.mc,v 1.5 2003/10/14 21:47:05 root Exp $) with SMTP id hAKGxDgC021239 for ; Thu, 20 Nov 2003 16:59:13 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003112018591220583 ; Thu, 20 Nov 2003 18:59:12 +0200 Received: from jrslxjul6 (jrslxjul6 [10.12.220.56]) by sun111.npdj.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id hAKGwkFo024149; Thu, 20 Nov 2003 18:58:49 +0200 (IST) From: Amir Noam To: jgarzik@pobox.com Subject: [PATCH 1/2] [bonding 2.6] Restore missing backward compatibility Date: Thu, 20 Nov 2003 19:56:21 +0200 User-Agent: KMail/1.5 Cc: davem@redhat.com, netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311201956.24771.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 1602 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 Content-Length: 829 Lines: 24 This patch (against latest 2.6.0) is also waiting for almost a month. It's already in 2.4 but is still very much needed for 2.6. Old ifenslave versions (like the one in Red Hat 9) don't work with the bonding module in the latest 2.6 kernel without it. 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 Thu Nov 20 08:59:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 08:59:42 -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 hAKGxR25014151 for ; Thu, 20 Nov 2003 08:59:28 -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 hAKGxMPt031562 for ; Thu, 20 Nov 2003 16:59:22 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.12.9-20030918-01/8.11.6/d: large-inner.mc,v 1.5 2003/10/14 21:47:05 root Exp $) with SMTP id hAKGxDgF021239 for ; Thu, 20 Nov 2003 16:59:21 GMT Received: from sun111.npdj.intel.com ([10.12.254.111]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003112018592012361 ; Thu, 20 Nov 2003 18:59:20 +0200 Received: from jrslxjul6 (jrslxjul6 [10.12.220.56]) by sun111.npdj.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id hAKGwvFo024152; Thu, 20 Nov 2003 18:58:57 +0200 (IST) From: Amir Noam To: jgarzik@pobox.com Subject: [PATCH 2/2] [bonding 2.6] fix creation of /proc/net/bonding dir Date: Thu, 20 Nov 2003 19:56:33 +0200 User-Agent: KMail/1.5 Cc: davem@redhat.com, netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311201956.35783.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 1603 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 Content-Length: 3483 Lines: 158 Fix the creation of the /proc/net/bonding dir. Patch is against 2.6. 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 rask@sygehus.dk Thu Nov 20 09:04:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 09:04:53 -0800 (PST) Received: from 0x50a14406.albnxx15.adsl-dhcp.tele.dk (0x50a14406.albnxx15.adsl-dhcp.tele.dk [80.161.68.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAKH4b25014926 for ; Thu, 20 Nov 2003 09:04:39 -0800 Received: by 0x50a14406.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id CED0E45FA; Thu, 20 Nov 2003 18:04:31 +0100 (CET) Date: Thu, 20 Nov 2003 18:04:31 +0100 From: Rask Ingemann Lambertsen To: Alexander Zapatka Cc: netdev@oss.sgi.com Subject: Re: suggested forcedeth updates.... Message-ID: <20031120180428.B1538@sygehus.dk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from alexzapatka@hotmail.com on Wed, Nov 19, 2003 at 10:06:13AM -0500 X-archive-position: 1604 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 Content-Length: 1364 Lines: 46 On Wed, Nov 19, 2003 at 10:06:13AM -0500, Alexander Zapatka wrote: > thats a great idea! except i dont know how to implement it in a patch :) > hope it makes it in to the next version. It is fairly simple. In the driver private structure, add a field named "msg_enable". In the probe function (the one where alloc_etherdev() is called), set the msg_enable field from the global debug variable. Then, use the macros from linux/netdevice.h to see if the debug output should be printed. For example: void forcedeth_init_one (stuff) { struct forcedeth_private *fp; ... dev = alloc_etherdev (sizeof (struct forcedeth_private)); ... fp = dev->priv; fp->msg_enable = debug; ... register_netdev (dev); } void forcedeth_rx_one (stuff) { struct forcedeth_private *fp = dev->priv; if (unlikely (netif_msg_rx_data (fp))) { printk_packet_data (); } } And so on. In some cases you may not have a dev and thus no dev->priv and need to use the NETIF_MSG_* flags directly, e.g. if (debug & NETIF_MSG_HW) dump_registers(); but I think that will only happen early in the probe function. Then there is the ethtool part. This used to involve a lots of ioctl() grot in every driver that wanted to be ethtool capable, but have a look at the dev->ethtool_ops patches posted recently, as they should simplify things a lot. -- Regards, Rask Ingemann Lambertsen From jgarzik@pobox.com Thu Nov 20 09:30:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 09:30:55 -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 hAKHUe25016104 for ; Thu, 20 Nov 2003 09:30:41 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48492 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMsdb-0007aW-JC; Thu, 20 Nov 2003 17:30:39 +0000 Message-ID: <3FBCFA1F.8090403@pobox.com> Date: Thu, 20 Nov 2003 12:30:07 -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: Amir Noam CC: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH 1/2] [bonding 2.6] Restore missing backward compatibility References: <200311201956.24771.amir.noam@intel.com> In-Reply-To: <200311201956.24771.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1605 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 Content-Length: 31 Lines: 3 thanks, applied both patches From jgarzik@pobox.com Thu Nov 20 10:00:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 10:00:21 -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 hAKI0425018143 for ; Thu, 20 Nov 2003 10:00:07 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48514 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMt61-0007xl-DI; Thu, 20 Nov 2003 18:00:01 +0000 Message-ID: <3FBD0102.1010309@pobox.com> Date: Thu, 20 Nov 2003 12:59:30 -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: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [TG3] Always load TSO firmware References: <20031117093225.GA12420@gondor.apana.org.au> <20031117123836.2f8e70af.davem@redhat.com> <20031120095605.GA6572@gondor.apana.org.au> In-Reply-To: <20031120095605.GA6572@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1606 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 Content-Length: 152 Lines: 7 Thanks. This changes the replenish threshold a bit, but I don't think it will adversely affect anything. Applied to 2.4 and 2.5, and sent upstream. From jgarzik@pobox.com Thu Nov 20 14:06:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 14:06:55 -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 hAKM6d25026973 for ; Thu, 20 Nov 2003 14:06:40 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48501 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AMsoO-0007hq-JN; Thu, 20 Nov 2003 17:41:48 +0000 Message-ID: <3FBCFCBD.5060609@pobox.com> Date: Thu, 20 Nov 2003 12:41:17 -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: Herbert Xu , netdev@oss.sgi.com Subject: Re: [TG3] Always load TSO firmware References: <20031117093225.GA12420@gondor.apana.org.au> <20031117123836.2f8e70af.davem@redhat.com> <20031120095605.GA6572@gondor.apana.org.au> <20031120092530.4dfe9016.davem@redhat.com> In-Reply-To: <20031120092530.4dfe9016.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1607 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 Content-Length: 693 Lines: 28 David S. Miller wrote: > On Thu, 20 Nov 2003 20:56:05 +1100 > Herbert Xu wrote: > > >>OK, I've cross-checked with the Broadcom drivers and the problem seems >>to be specific to 5705 A1 which is the chipset in question. >> >>The Broadcom drivers limit the number of rx descriptors to 63 while >>tg3.c only limits it to 64. It has been confirmed that lowering >>the limit makes the problem go away. >> >>Here is the patch. > > > Great work. > > Jeff, please push this around. I think it's serious enough for > 2.4.23-rcX personally. Will do, though I first need to check and see if non-power-of-two has any implications in the implementation... Jeff From dlstevens@us.ibm.com Thu Nov 20 14:34:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 14:34:20 -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 hAKMY025027489 for ; Thu, 20 Nov 2003 14:34:07 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAKMXsb7408676; Thu, 20 Nov 2003 17:33:54 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAKMXrfd313874; Thu, 20 Nov 2003 15:33:53 -0700 Importance: Normal Sensitivity: Subject: MLDv1 bug [PATCH] To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Thu, 20 Nov 2003 15:33:52 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/20/2003 15:33:53 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE777DFE8CE5B8f9e8a93df938690918c07BBE777DFE8CE5B" Content-Disposition: inline X-archive-position: 1608 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2466 Lines: 60 --0__=07BBE777DFE8CE5B8f9e8a93df938690918c07BBE777DFE8CE5B Content-type: text/plain; charset=US-ASCII Dave, Someone pointed out to me this apparently old bug in MLDv1. According to RFC 2710: "MLD messages are never sent for multicast addresses whose scope is 0 (reserved) or 1 (node-local). MLD messages ARE sent for multicast addresses whose scope is 2 (link-local), including Solicited-Node multicast addersses [ADDR-ARCH], except for the link-scope, all-nodes address (FF02::1)." The current MLDv1 code does not send reports for link-scope addresses and doesn't restrict scope 0. This may break switches that snoop reports for determining which ports should receive particular addresses. Patch below. +-DLS --- linux-2.6.0-test9-bk23/net/ipv6/mcast.c 2003-11-18 23:20:56.000000000 -0800 +++ linux-2.6.0-test9-bk23F2/net/ipv6/mcast.c 2003-11-20 14:22:51.910526392 -0800 @@ -960,8 +960,9 @@ { unsigned long delay = resptime; - /* Do not start timer for addresses with link/host scope */ - if (ipv6_addr_type(&ma->mca_addr)&(IPV6_ADDR_LINKLOCAL|IPV6_ADDR_LOOPBACK)) + /* Do not start timer for these addresses */ + if (ipv6_addr_is_ll_all_nodes(&ma->mca_addr) || + IPV6_ADDR_MC_SCOPE(&ma->mca_addr) < IPV6_ADDR_SCOPE_LINKLOCAL) return; if (del_timer(&ma->mca_timer)) { (See attached file: MLDv1LL.patch) --0__=07BBE777DFE8CE5B8f9e8a93df938690918c07BBE777DFE8CE5B Content-type: application/octet-stream; name="MLDv1LL.patch" Content-Disposition: attachment; filename="MLDv1LL.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMjMvbmV0L2lwdjYvbWNhc3QuYwkyMDAzLTExLTE4IDIz OjIwOjU2LjAwMDAwMDAwMCAtMDgwMAorKysgbGludXgtMi42LjAtdGVzdDktYmsyM0YyL25ldC9p cHY2L21jYXN0LmMJMjAwMy0xMS0yMCAxNDoyMjo1MS45MTA1MjYzOTIgLTA4MDAKQEAgLTk2MCw4 ICs5NjAsOSBAQAogewogCXVuc2lnbmVkIGxvbmcgZGVsYXkgPSByZXNwdGltZTsKIAotCS8qIERv IG5vdCBzdGFydCB0aW1lciBmb3IgYWRkcmVzc2VzIHdpdGggbGluay9ob3N0IHNjb3BlICovCi0J aWYgKGlwdjZfYWRkcl90eXBlKCZtYS0+bWNhX2FkZHIpJihJUFY2X0FERFJfTElOS0xPQ0FMfElQ VjZfQUREUl9MT09QQkFDSykpCisJLyogRG8gbm90IHN0YXJ0IHRpbWVyIGZvciB0aGVzZSBhZGRy ZXNzZXMgKi8KKwlpZiAoaXB2Nl9hZGRyX2lzX2xsX2FsbF9ub2RlcygmbWEtPm1jYV9hZGRyKSB8 fAorCSAgICBJUFY2X0FERFJfTUNfU0NPUEUoJm1hLT5tY2FfYWRkcikgPCBJUFY2X0FERFJfU0NP UEVfTElOS0xPQ0FMKQogCQlyZXR1cm47CiAKIAlpZiAoZGVsX3RpbWVyKCZtYS0+bWNhX3RpbWVy KSkgewo= --0__=07BBE777DFE8CE5B8f9e8a93df938690918c07BBE777DFE8CE5B-- From davem@pizda.ninka.net Thu Nov 20 15:57:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 15:57:52 -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 hAKNvU25028340 for ; Thu, 20 Nov 2003 15:57:31 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA25696; Thu, 20 Nov 2003 15:49:54 -0800 Date: Thu, 20 Nov 2003 15:49:54 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: MLDv1 bug [PATCH] Message-Id: <20031120154954.004b5713.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: 1609 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: 346 Lines: 8 On Thu, 20 Nov 2003 15:33:52 -0700 David Stevens wrote: > The current MLDv1 code does not send reports for link-scope addresses > and doesn't restrict scope 0. This may break switches that snoop reports for > determining which ports should receive particular addresses. Patch below. I'll apply this, thanks David. From romieu@fr.zoreil.com Thu Nov 20 16:43:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 16:44:15 -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 hAL0ht25031732 for ; Thu, 20 Nov 2003 16:43:56 -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 hAL0abK7003197; Fri, 21 Nov 2003 01:36:38 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAL0abYs003196; Fri, 21 Nov 2003 01:36:37 +0100 Date: Fri, 21 Nov 2003 01:36:37 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik , Brad House Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion Message-ID: <20031121013637.B31929@electric-eye.fr.zoreil.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031120010056.A19444@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Thu, Nov 20, 2003 at 01:00:56AM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 1610 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 Content-Length: 8597 Lines: 297 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Francois Romieu : [...] > Feel free to comment/review. Next patch tomorrow. The attached patches apply on top of yesterday's ones: r8169-start-xmit-fixes.patch r8169-dma-api-tx-buffers.patch r8169-rx_copybreak.patch Bugs apart, there shouldn't be anything subtle. -- Ueimor --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-start-xmit-fixes.patch" rtl8169_start_xmit fixes: - it forgot to update stats if the skb couldn't be expanded; - it didn't free it either if the descriptor was not available; - move the spin_unlock nearer of the exit point instead of duplicating it in the new branch. drivers/net/r8169.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff -puN drivers/net/r8169.c~r8169-start-xmit-fixes drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-start-xmit-fixes 2003-11-21 01:08:38.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-21 01:08:38.000000000 +0100 @@ -918,11 +918,13 @@ rtl8169_start_xmit(struct sk_buff *skb, struct rtl8169_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; int entry = tp->cur_tx % NUM_TX_DESC; + u32 len = skb->len; - if (skb->len < ETH_ZLEN) { + if (unlikely(skb->len < ETH_ZLEN)) { skb = skb_padto(skb, ETH_ZLEN); - if (skb == NULL) - return 0; + if (!skb) + goto err_update_stats; + len = ETH_ZLEN; } spin_lock_irq(&tp->lock); @@ -930,29 +932,32 @@ rtl8169_start_xmit(struct sk_buff *skb, if ((tp->TxDescArray[entry].status & OWNbit) == 0) { tp->Tx_skbuff[entry] = skb; tp->TxDescArray[entry].buf_addr = virt_to_bus(skb->data); - if (entry != (NUM_TX_DESC - 1)) - tp->TxDescArray[entry].status = - (OWNbit | FSbit | LSbit) | ((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); + tp->TxDescArray[entry].status = OWNbit | FSbit | LSbit | len | + (EORbit * !((entry + 1) % NUM_TX_DESC)); + RTL_W8(TxPoll, 0x40); //set polling bit dev->trans_start = jiffies; tp->cur_tx++; - } + } else + goto err_drop; - spin_unlock_irq(&tp->lock); if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) { netif_stop_queue(dev); } +out: + spin_unlock_irq(&tp->lock); return 0; + +err_drop: + dev_kfree_skb(skb); +err_update_stats: + tp->stats.tx_dropped++; + goto out; } static void _ --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-dma-api-tx-buffers.patch" Conversion of Tx data buffers to PCI DMA: - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - buf_addr of an unmapped descriptor is always set to the same value (cf rtl8169_unmap_tx_skb); - nothing fancy, really. drivers/net/r8169.c | 36 +++++++++++++++++++++++++++++------- 1 files changed, 29 insertions(+), 7 deletions(-) diff -puN drivers/net/r8169.c~r8169-dma-api-tx-buffers drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-dma-api-tx-buffers 2003-11-21 01:08:42.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-21 01:08:42.000000000 +0100 @@ -871,6 +871,17 @@ err_out: return -ENOMEM; } +static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, + struct TxDesc *desc) +{ + u32 len = sk_buff[0]->len; + + pci_unmap_single(pdev, desc->buf_addr, len < ETH_ZLEN ? ETH_ZLEN : len, + PCI_DMA_TODEVICE); + desc->buf_addr = 0x00; + *sk_buff = NULL; +} + static void rtl8169_tx_clear(struct rtl8169_private *tp) { @@ -878,9 +889,12 @@ rtl8169_tx_clear(struct rtl8169_private tp->cur_tx = 0; for (i = 0; i < NUM_TX_DESC; i++) { - if (tp->Tx_skbuff[i] != NULL) { - dev_kfree_skb(tp->Tx_skbuff[i]); - tp->Tx_skbuff[i] = NULL; + struct sk_buff *skb = tp->Tx_skbuff[i]; + + if (skb) { + rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + i, + tp->TxDescArray + i); + dev_kfree_skb(skb); tp->stats.tx_dropped++; } } @@ -930,8 +944,13 @@ rtl8169_start_xmit(struct sk_buff *skb, spin_lock_irq(&tp->lock); if ((tp->TxDescArray[entry].status & OWNbit) == 0) { + dma_addr_t mapping; + + mapping = pci_map_single(tp->pci_dev, skb->data, len, + PCI_DMA_TODEVICE); + tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].buf_addr = virt_to_bus(skb->data); + tp->TxDescArray[entry].buf_addr = mapping; tp->TxDescArray[entry].status = OWNbit | FSbit | LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC)); @@ -976,9 +995,12 @@ rtl8169_tx_interrupt(struct net_device * while (tx_left > 0) { if ((tp->TxDescArray[entry].status & OWNbit) == 0) { - dev_kfree_skb_irq(tp-> - Tx_skbuff[dirty_tx % NUM_TX_DESC]); - tp->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL; + int cur = dirty_tx % NUM_TX_DESC; + struct sk_buff *skb = tp->Tx_skbuff[cur]; + + rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + cur, + tp->TxDescArray + cur); + dev_kfree_skb_irq(skb); tp->stats.tx_packets++; dirty_tx++; tx_left--; _ --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-rx_copybreak.patch" Rx copybreak for small packets. - removal of rtl8169_unmap_rx() (unneeded as for now). drivers/net/r8169.c | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 39 insertions(+), 8 deletions(-) diff -puN drivers/net/r8169.c~r8169-rx_copybreak drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-rx_copybreak 2003-11-21 01:08:46.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-21 01:08:46.000000000 +0100 @@ -116,6 +116,8 @@ static struct pci_device_id rtl8169_pci_ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); +static int rx_copybreak = 200; + enum RTL8169_registers { MAC0 = 0, /* Ethernet hardware address. */ MAR0 = 8, /* Multicast filter. */ @@ -294,6 +296,7 @@ struct rtl8169_private { MODULE_AUTHOR("Realtek"); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_copybreak, "i"); static int rtl8169_open(struct net_device *dev); static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); @@ -771,6 +774,11 @@ static void rtl8169_free_rx_skb(struct p rtl8169_make_unusable_by_asic(desc); } +static inline void rtl8169_return_to_asic(struct RxDesc *desc) +{ + desc->status |= OWNbit + RX_BUF_SIZE; +} + static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) { desc->buf_addr = mapping; @@ -1015,12 +1023,26 @@ rtl8169_tx_interrupt(struct net_device * } } -static inline void rtl8169_unmap_rx(struct pci_dev *pdev, struct RxDesc *desc) +static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size, + struct RxDesc *desc, + struct net_device *dev) { - pci_dma_sync_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); + int ret = -1; + + if (pkt_size < rx_copybreak) { + struct sk_buff *skb; + + skb = dev_alloc_skb(pkt_size + 2); + if (skb) { + skb->dev = dev; + skb_reserve(skb, 2); + eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); + *sk_buff = skb; + rtl8169_return_to_asic(desc); + ret = 0; + } + } + return ret; } static void @@ -1046,17 +1068,26 @@ rtl8169_rx_interrupt(struct net_device * if (status & RxCRC) tp->stats.rx_crc_errors++; } else { + struct RxDesc *desc = tp->RxDescArray + cur_rx; struct sk_buff *skb = tp->Rx_skbuff[cur_rx]; int pkt_size = (status & 0x00001FFF) - 4; - rtl8169_unmap_rx(tp->pci_dev, tp->RxDescArray + cur_rx); + pci_dma_sync_single(tp->pci_dev, + le32_to_cpu(desc->buf_addr), + RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + + if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { + pci_unmap_single(tp->pci_dev, + le32_to_cpu(desc->buf_addr), + RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); + tp->Rx_skbuff[cur_rx] = NULL; + } skb_put(skb, pkt_size); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); - tp->Rx_skbuff[cur_rx] = NULL; - dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; _ --4Ckj6UjgE2iN1+kY-- From jgarzik@pobox.com Thu Nov 20 17:39:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 17:39:35 -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 hAL1d925032471 for ; Thu, 20 Nov 2003 17:39:10 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48890 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AN0GK-0007oG-Tq; Fri, 21 Nov 2003 01:39:09 +0000 Message-ID: <3FBD6C9D.3000207@pobox.com> Date: Thu, 20 Nov 2003 20:38: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: Francois Romieu CC: netdev@oss.sgi.com, Brad House Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <20031121013637.B31929@electric-eye.fr.zoreil.com> In-Reply-To: <20031121013637.B31929@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1611 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 Content-Length: 154 Lines: 7 The rx_copybreak didn't apply, but everything else did. Thanks much. Just posted a new net-drivers-2.5-exp patch, to which you may sync with. Jeff From jgarzik@pobox.com Thu Nov 20 18:55:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 18:55:46 -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 hAL2t825001375 for ; Thu, 20 Nov 2003 18:55:29 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:48889 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AN0Fg-0007mv-NK; Fri, 21 Nov 2003 01:38:29 +0000 Message-ID: <3FBD6C74.1000800@pobox.com> Date: Thu, 20 Nov 2003 20:37:56 -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: netdev@oss.sgi.com CC: romieu@fr.zoreil.com Subject: [BK PATCHES] 2.6.x experimental net driver queue Content-Type: multipart/mixed; boundary="------------080606070704070808060604" X-archive-position: 1612 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 Content-Length: 44228 Lines: 1223 This is a multi-part message in MIME format. --------------080606070704070808060604 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mainly just to sync up with Francois... --------------080606070704070808060604 Content-Type: text/plain; name="linus.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linus.txt" 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-bk24-netdrvr-exp3.patch.bz2 This will update the following files: Documentation/networking/8139too.txt | 438 -------------- drivers/net/68360enet.c | 951 -------------------------------- Documentation/SubmittingPatches | 4 Documentation/networking/netconsole.txt | 57 + drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c527.h | 6 drivers/net/3c59x.c | 17 drivers/net/8139too.c | 334 ++++++----- drivers/net/82596.c | 83 +- drivers/net/Kconfig | 9 drivers/net/Makefile | 2 drivers/net/Space.c | 587 +++++++++---------- drivers/net/a2065.c | 21 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 81 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 67 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ethertap.c | 3 drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lasi_82596.c | 17 drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 103 ++- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 30 - drivers/net/macsonic.c | 103 +-- drivers/net/mvme147.c | 64 +- drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k-pci.c | 3 drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 18 drivers/net/r8169.c | 401 ++++++++----- drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 78 +- drivers/net/sun3lance.c | 85 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 417 ++++++++++---- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 drivers/usb/gadget/ether.c | 2 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 646 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 164 files changed, 7567 insertions(+), 7165 deletions(-) through these ChangeSets: (03/11/20 1.1479) [netdrvr r8169] Conversion of Tx data buffers to PCI DMA: - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - buf_addr of an unmapped descriptor is always set to the same value (cf rtl8169_unmap_tx_skb); - nothing fancy, really. (03/11/20 1.1478) [netdrvr r8169] rtl8169_start_xmit fixes: - it forgot to update stats if the skb couldn't be expanded; - it didn't free it either if the descriptor was not available; - move the spin_unlock nearer of the exit point instead of duplicating it in the new branch. (03/11/20 1.1477) [netdrvr r8169] Conversion of Rx data buffers to PCI DMA - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - rtl8169_rx_clear() walks the buffer ring and releases the allocated data buffers. It needs to be used in two places: - rtl8169_init_ring() failure path; - normal device release (i.e. rtl8169_close); - rtl8169_free_rx_skb() releases a Rx data buffer. Mostly an helper for rtl8169_rx_clear(). As such it must: - unmap the memory area; - release the skb; - prevent the ring descriptor from being used again; - rtl8169_alloc_rx_skb() prepares a Rx data buffer for use. As such it must: - allocate an skb; - map the memory area; - reflect the changes in the ring descriptor. This function is balanced by rtl8169_free_rx_skb(). - rtl8169_unmap_rx() simply helps with the 80-columns limit. - rtl8169_rx_fill() walks a given range of the buffer ring and try to turn any descriptor into a ready to use one. It returns the count of modified descriptors and exits if an allocation fails. It can be seen as balanced by rtl8169_rx_clear(). Motivation: - partially abstract the (usually big) piece of code for the refill logic at the end of the Rx interrupt; - factorize the refill logic and the initial ring setup. - simple conversion of rtl8169_rx_interrupt() without rx_copybreak (will be adressed in a later patch). (03/11/20 1.1476) [netdrvr r8169] Conversion of Rx/Tx descriptors to consistent DMA: - use pci_alloc_consistent() for Rx/Tx descriptors in rtl8169_open() (balanced by pci_free_consistent() on error path as well as in rtl8169_close()); - removal of the fields {Rx/Tx}DescArrays in struct rtl8169_private as there is no need to store a non-256 bytes aligned address any more; - fix for rtl8169_open() leak when RxBufferRings allocation fails. Said allocation is pushed to rtl8169_init_ring() as part of an evil cunning plan. (03/11/19 1.1435.2.96) [PATCH] 8139too NAPI for net-drivers-2.5-exp Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. Also: 64k receive ring - has to handle wrap for that case; the NoWrap flag does nothing if using this big ring. assert() -> BUG_ON() To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. (03/11/19 1.1435.2.95) [PATCH] more ne2k-pci clone boards (03/11/19 1.1435.2.94) [PATCH] more RTL-8139 clone boards (03/11/18 1.1435.2.93) [PATCH] sun3-related net driver fixes On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > Viro. > > > > No users of init_etherdev remain in the tree. (yay!) > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > drivers: I forget to test the Sun-3 drivers: - sun3_82586.c: o add missing casts to iounmap() calls o fix parameter of free_netdev() - sun3lance.c: add missing casts to iounmap() calls Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed to ioremap()? (03/11/18 1.1435.2.92) [PATCH] m68k-related net driver fixes On Sun, 16 Nov 2003, Jeff Garzik wrote: > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > Viro. > > No users of init_etherdev remain in the tree. (yay!) Here are some (untested, except for cross-gcc) fixes for the m68k-related drivers: - Space.c: fix incorrect prototypes for atarilance_probe() and mace_probe() - a2065.c: kill superfluous argument of alloc_etherdev() - apne.c: o fix incorrect prototype for apne_probe() o kill unused variable err - mac8390.c: o kill unused variable probed o fix typos ENDOEV -> ENODEV and ERR_PTE -> ERR_PTR o add missing variable slots - macmace.c: use ERR_PTR() where needed - macsonic.c: kill unused variable lp - mvme147.c: o kill conversion warning and kill a cast by making ram unsigned long o add missing variable err Note: The use of `slots' in mac8390.c is not in my tree. Do you know where that change comes from? (03/11/18 1.1435.2.91) [PATCH] netpoll: push zap_completion_queue for lkcd Move zap_completion_queue call inside netpoll so we don't need to export it separately. (03/11/18 1.1435.2.90) [PATCH] netpoll: fix compilation with CONFIG_NETPOLL_RX Fix compilation without CONFIG_NETPOLL_RX (03/11/16 1.1435.2.89) [netdrvr] remove init_etherdev mentions in Doc/SubmittingPatches, atari_pamsnet.c (03/11/16 1.1435.2.88) [netdrvr] remove Documentation/networking/8139too.txt All sections of the document are woefully outdated. (03/11/16 1.1435.2.87) [netdrvr lasi_82596] remove ether_setup() call, fix leak in probe (03/11/16 1.1435.2.86) [netdrvr] alloc_etherdev-related cleanups Mostly removing unneeded calls to ether_setup(), which alloc_etherdev() already does for us. (03/11/16 1.1435.2.85) [netdrvr 3c527] applied missing pieces of Richard Proctor's 3c527 SMP update Minor stuff... remove unused constants, and mark non-experimental and non-broken in Kconfig. (03/11/16 1.1435.2.84) [netdrvr tulip] clean up tulip NAPI poll disable Looks like the same patch was applied multiple times. No negative effects except ugliness and a redundant test. (03/11/16 1.1435.2.83) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1435.2.82) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1435.2.81) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1435.2.80) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1435.2.79) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1435.2.78) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1435.2.77) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1435.2.76) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1435.2.75) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1435.2.74) [netdrvr depca] fix leaks on error (03/11/16 1.1435.2.73) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1435.2.72) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1435.2.71) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1435.2.70) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.69) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1435.2.68) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1435.2.67) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.66) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1435.2.65) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.64) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1435.2.63) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.62) [netdrvr declance] use alloc_etherdev (03/11/16 1.1435.2.61) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1435.2.60) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1435.2.59) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1435.2.58) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1435.2.57) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1435.2.56) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1435.2.55) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1435.2.54) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1435.2.53) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1435.2.52) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1435.2.51) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1435.2.50) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1435.2.49) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1435.2.48) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1435.2.47) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1435.2.46) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1435.2.45) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1435.2.44) [netdrvr 3c515] fix non-modular build (03/11/12 1.1435.2.43) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1435.2.42) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.41) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.40) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.39) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.38) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.37) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.36) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.35) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1435.2.34) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.33) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1435.2.32) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1435.2.31) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.30) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1435.2.29) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1435.2.28) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1435.2.27) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1435.2.26) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1435.2.25) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1435.2.24) [PATCH] (23/42) 3c523 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 (03/11/12 1.1435.2.23) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1435.2.22) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1435.2.21) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1435.2.20) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1435.2.19) [PATCH] (18/42) ultra 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 (03/11/12 1.1435.2.18) [PATCH] (17/42) wd 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 (03/11/12 1.1435.2.17) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1435.2.16) [PATCH] (15/42) hp 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 (03/11/12 1.1435.2.15) [PATCH] (14/42) hpplus 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 (03/11/12 1.1435.2.14) [PATCH] (13/42) e2100 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 (03/11/12 1.1435.2.13) [PATCH] (12/42) ne 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 (03/11/12 1.1435.2.12) [PATCH] (11/42) lance 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? (03/11/12 1.1435.2.11) [PATCH] (10/42) smc 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 (03/11/12 1.1435.2.10) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1435.2.9) [PATCH] (8/42) at1500 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). (03/11/12 1.1435.2.8) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1435.2.7) [PATCH] (6/42) at1700 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 (03/11/12 1.1435.2.6) [PATCH] (5/42) fmv18 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... (03/11/12 1.1435.2.5) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1435.2.4) [PATCH] (3/42) eexpress 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 (03/11/12 1.1435.2.3) [PATCH] (2/42) eepro 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 (03/11/12 1.1435.2.2) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.2.5) [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.1428.2.4) [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.1428.2.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.2.2) [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 --------------080606070704070808060604-- From dada1@cosmosbay.com Thu Nov 20 23:53:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Nov 2003 23:53:58 -0800 (PST) Received: from gw1.cosmosbay.com (gw1.cosmosbay.com [62.23.185.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAL7rg25007497 for ; Thu, 20 Nov 2003 23:53:43 -0800 Received: from edumazet (ALyon-209-1-31-23.w81-249.abo.wanadoo.fr [81.249.5.23]) by gw1.cosmosbay.com (8.12.9/8.12.9) with SMTP id hAL7rVHK029341; Fri, 21 Nov 2003 08:53:32 +0100 Message-ID: <037d01c3b004$86b78e00$890010ac@edumazet> From: "dada1" To: "Robert Olsson" Cc: , References: <02da01c3af54$c1f37f20$890010ac@edumazet> <16316.46493.7576.116171@robur.slu.se> Subject: Re: Performance problem with route cache ? Date: Fri, 21 Nov 2003 08:53:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 1613 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dada1@cosmosbay.com Precedence: bulk X-list: netdev Content-Length: 4547 Lines: 108 From: "Robert Olsson" > Does the copybreak help? I tested copybreak long time ago and saw no gain > from it. Do you have pointer to the patch? This is a patch kindly given to me by Scott Feldmann, that just copy the skb to a new shorter one. In my case, this is indeed usefull, because the server receives a lot of small tcp messages, from a lot of clients. Instead of using 2K or 4K buffers to store the data into socket, we end up using 64 bytes size buffers... quite a huge difference indeed. In case of a spike in network, the machine no longer consume 200 MB of lowmem and stay alive. In a router context, copybreak should not be used, because the extra copy is CPU intensive, and the data should not live long enough on memory. > > > It seems the route cache may/should be tuned, but I dont know how. > > Tuning is not an easy task and not necessarily you will gain anything, > It fully depends on your input traffic but it seems your system has a > lot of dst entries. Which would cause a lot linear search. Packets per > flow and no of parallel flows should be of interest for you. rtstat can > give you a better feeling of incoming routing load. > > Is 10kpkts/s the max performance? Well, the machine is not network bounded... We dont want to increase the trafic. The machine just receives a lot of frames from a lot of different IP. That is not a DOS attack. Some rtstat samples : rtstat -i 1 size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc GC: tot ignored goal_miss ovrf HASH: in _search out_search 279536 1490 11719 0 0 0 0 0 231 843 0 12562 12560 2 0 97100 6853 282928 1732 9705 0 0 0 0 0 275 800 0 10505 10503 2 0 80811 6774 278436 1211 10609 0 0 0 0 0 166 551 0 11160 11158 2 0 87831 4550 280942 1195 8996 0 0 0 0 0 299 1128 0 10124 10122 2 0 75815 9523 281774 1994 12201 0 0 0 0 0 295 1070 0 13271 13269 2 0 102299 8864 274220 1514 11692 0 0 0 0 0 252 929 0 12621 12619 2 0 96551 7743 274248 1271 10805 0 0 0 0 0 273 1094 0 11899 11897 2 0 88822 9013 278905 1157 9942 0 0 0 0 0 85 308 0 10250 10248 2 0 82651 2569 283423 1509 8471 0 0 0 0 0 176 631 0 9102 9100 2 0 71805 5286 288620 1530 7685 0 0 0 0 0 74 299 0 7984 7982 2 0 66499 2505 293264 1666 7432 0 0 0 0 0 174 552 0 7984 7982 2 0 65642 4785 296831 1840 7570 0 0 0 0 0 129 371 0 7941 7939 2 0 67687 3257 297902 2214 9863 0 0 0 0 0 346 1192 0 11055 11053 2 0 88987 10566 300225 2192 8136 0 0 0 0 0 308 877 0 9013 9011 2 0 74096 8029 size-32 931 1008 32 112 1 : tunables 120 60 8 : slabdata 9 9 0 size-64 18477 51566 64 59 1 : tunables 120 60 8 : slabdata 874 874 480 size-128 2013 2040 128 30 1 : tunables 120 60 8 : slabdata 68 68 0 size-256 90 90 256 15 1 : tunables 120 60 8 : slabdata 6 6 0 size-512 17569 37680 512 8 1 : tunables 54 27 8 : slabdata 4710 4710 27 size-1024 348 348 1024 4 1 : tunables 54 27 8 : slabdata 87 87 54 size-2048 13414 17306 2048 2 1 : tunables 24 12 8 : slabdata 8653 8653 96 size-4096 3970 3970 4096 1 1 : tunables 24 12 8 : slabdata 3970 3970 0 size-8192 139 139 8192 1 2 : tunables 8 4 0 : slabdata 139 139 0 ip_dst_cache 280165 386208 320 12 1 : tunables 54 27 8 : slabdata 32184 32184 0 skbuff_head_cache 35060 110200 192 20 1 : tunables 120 60 8 : slabdata 5510 5510 60 Thanks Eric Dumazet From anand@eis.iisc.ernet.in Fri Nov 21 01:19:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 01:19:58 -0800 (PST) Received: from iisc.ernet.in (iisc.ernet.in [144.16.64.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAL9JW25019364 for ; Fri, 21 Nov 2003 01:19:34 -0800 Received: from eis.iisc.ernet.in (eis.iisc.ernet.in [144.16.64.5]) by iisc.ernet.in (8.11.6/8.11.6) with SMTP id hAL9N2C01187 for ; Fri, 21 Nov 2003 14:53:02 +0530 Received: by eis.iisc.ernet.in (SMI-8.6/SMI-4.1) id OAA18759; Fri, 21 Nov 2003 14:49:24 +0530 From: anand@eis.iisc.ernet.in (SVR Anand) Message-Id: <200311210919.OAA18759@eis.iisc.ernet.in> Subject: Network flood To: netdev@oss.sgi.com Date: Fri, 21 Nov 2003 14:49:23 +0530 (GMT+05:30) X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1614 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anand@eis.iisc.ernet.in Precedence: bulk X-list: netdev Content-Length: 1300 Lines: 29 Hi, Please pardon me if I am sending this mail to an inappropriate mailing list. I have a setup where a Linux machine (2.6-test9)intrusively sits between the campus netwok and a cisco router that connects to the Internet. The network traffic pass through one one ethernet interface, get processed more on the lines of a firewall, and sent out on the other interface. The packet processing happens at the user level. I am using realtime support and enabled kernel preemption flag for the kernel image. The problem is, whenever there is a network flood either syn or icmp or any other kind, the Linux machine goes into a funny state and the first symtom is I cannot compile any program. The filesystem gets corrupted. Any amount of fsck doesn't help. The only way I come out is reinstalling Linux. I have tried RH, and Debian the distribution did not matter. There is nothing wrong with the basic hardware because the system works fine in the ideal network conditions. So, I have no clue whether it has to do with network handling, or something to do with the filesystem support or something else. Have you encountered this kind of problem ? Or am I the only one :) I know the group loves to discuss the in-depth core coding issues, but I need help in isolating my problem. Thanks. Anand From Robert.Olsson@data.slu.se Fri Nov 21 01:38:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 01:38:23 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAL9c325019845 for ; Fri, 21 Nov 2003 01:38:05 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id KAA13017; Fri, 21 Nov 2003 10:37:51 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 3FB69EC23D; Fri, 21 Nov 2003 10:37:56 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16317.56564.129747.186894@robur.slu.se> Date: Fri, 21 Nov 2003 10:37:56 +0100 To: "dada1" Cc: "Robert Olsson" , , Subject: Re: Performance problem with route cache ? In-Reply-To: <037d01c3b004$86b78e00$890010ac@edumazet> References: <02da01c3af54$c1f37f20$890010ac@edumazet> <16316.46493.7576.116171@robur.slu.se> <037d01c3b004$86b78e00$890010ac@edumazet> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 1615 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 1609 Lines: 38 dada1 writes: > Instead of using 2K or 4K buffers to store the data into socket, we end up > using 64 bytes size buffers... quite a huge difference indeed. > In case of a spike in network, the machine no longer consume 200 MB of > lowmem and stay alive. Well have no experice here... but think e1000 was using 4k for 1500 MTU packets at least before. > In a router context, copybreak should not be used, because the extra copy is > CPU intensive, and the data should not live long enough on memory. It easy to try again. I'm playing with realtek r8169 driver and are filling the skb one-by-one now as they are passed onto the stack. Rather than doing the RX-batch refill. I need to collect some data... > The machine just receives a lot of frames from a lot of different IP. That > is not a DOS attack. > rtstat -i 1 > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot > mc GC: tot ignored goal_miss ovrf HASH: in > _search out_search > 279536 1490 11719 0 0 0 0 0 231 843 > 0 12562 12560 2 0 Well not DoS? What is this? See you have almost 10 times more new entries per/sec then what hits your already huge dst-cache. (hit/total). Compare to a procduction router for 10:th of thousands of users at 55 kpps. size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc GC: tot ignored goal_miss ovrf HASH: in_search out_search 21797 54543 529 0 49 0 0 0 137 12 0 0 0 0 0 28139 59 Cheers. --ro From jgarzik@pobox.com Fri Nov 21 10:51:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 10:51:17 -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 hALIp025018220 for ; Fri, 21 Nov 2003 10:51:03 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32870 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1ANGMs-0008KV-EI; Fri, 21 Nov 2003 18:50:58 +0000 Message-ID: <3FBE5E70.9060102@pobox.com> Date: Fri, 21 Nov 2003 13:50:24 -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: russell@coker.com.au CC: Linux Kernel , rask@sygehus.dk, akpm@osdl.org, netdev@oss.sgi.com Subject: [PATCH/CFT] de2104x fixes References: <200311212051.32352.russell@coker.com.au> In-Reply-To: <200311212051.32352.russell@coker.com.au> Content-Type: multipart/mixed; boundary="------------060507000103040403010101" X-archive-position: 1616 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 Content-Length: 2417 Lines: 99 This is a multi-part message in MIME format. --------------060507000103040403010101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit So, can people give this a test? It includes a change that, I hope, addresses Russell's problem, as well as a patch from Rask. Jeff P.S. It would be great if people cc'd me on such bug reports ;-) Quicker to find and respond, these days. --------------060507000103040403010101 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" ===== drivers/net/tulip/de2104x.c 1.25 vs edited ===== --- 1.25/drivers/net/tulip/de2104x.c Thu Sep 11 18:46:11 2003 +++ edited/drivers/net/tulip/de2104x.c Fri Nov 21 13:48:17 2003 @@ -28,8 +28,8 @@ */ #define DRV_NAME "de2104x" -#define DRV_VERSION "0.6" -#define DRV_RELDATE "Sep 1, 2003" +#define DRV_VERSION "0.9" +#define DRV_RELDATE "Nov 21, 2003" #include #include @@ -1380,18 +1380,18 @@ return rc; } - rc = de_init_hw(de); + rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); if (rc) { - printk(KERN_ERR "%s: h/w init failure, err=%d\n", - dev->name, rc); + printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", + dev->name, dev->irq, rc); goto err_out_free; } - rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); + rc = de_init_hw(de); if (rc) { - printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", - dev->name, dev->irq, rc); - goto err_out_hw; + printk(KERN_ERR "%s: h/w init failure, err=%d\n", + dev->name, rc); + goto err_out_free_irq; } netif_start_queue(dev); @@ -1399,10 +1399,8 @@ return 0; -err_out_hw: - spin_lock_irqsave(&de->lock, flags); - de_stop_hw(de); - spin_unlock_irqrestore(&de->lock, flags); +err_out_free_irq: + free_irq (dev->irq, dev); err_out_free: de_free_rings(de); @@ -1571,13 +1569,17 @@ (ecmd->advertising == de->media_advertise)) return 0; /* nothing to change */ - de_link_down(de); - de_stop_rxtx(de); + if (netif_running(dev)) { + de_link_down(de); + de_stop_rxtx(de); + } de->media_type = new_media; de->media_lock = media_lock; de->media_advertise = ecmd->advertising; - de_set_media(de); + + if (netif_running(dev)) + de_set_media(de); return 0; } --------------060507000103040403010101-- From romieu@fr.zoreil.com Fri Nov 21 15:23:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 15:24:08 -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 hALNNp25032441 for ; Fri, 21 Nov 2003 15:23:53 -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 hALNK3K7013242; Sat, 22 Nov 2003 00:20:03 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hALNK2BX013241; Sat, 22 Nov 2003 00:20:02 +0100 Date: Sat, 22 Nov 2003 00:20:02 +0100 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [patches] 2.6.0-test9 - r8169 DMA API conversion Message-ID: <20031122002002.A12448@electric-eye.fr.zoreil.com> References: <47973.68.105.173.45.1069042089.squirrel@mail.mainstreetsoftworks.com> <3FB9A277.70309@pobox.com> <20031118135848.A2451@electric-eye.fr.zoreil.com> <3FBBA76B.4070606@pobox.com> <20031120010056.A19444@electric-eye.fr.zoreil.com> <20031121013637.B31929@electric-eye.fr.zoreil.com> <3FBD6C9D.3000207@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FBD6C9D.3000207@pobox.com>; from jgarzik@pobox.com on Thu, Nov 20, 2003 at 08:38:37PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1617 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 Content-Length: 3686 Lines: 127 --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jeff Garzik : > The rx_copybreak didn't apply, but everything else did. Thanks much. Oops, I forgot there was an extra MODULE_LICENSE() in net-drivers-2.5-exp. > Just posted a new net-drivers-2.5-exp patch, to which you may sync with. Updated rx_copybreak attached. -- Ueimor --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-rx_copybreak.patch" Rx copybreak for small packets. - removal of rtl8169_unmap_rx() (unneeded as for now). drivers/net/r8169.c | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 39 insertions(+), 8 deletions(-) diff -puN drivers/net/r8169.c~r8169-rx_copybreak drivers/net/r8169.c --- linux-2.6.0-test9-bk24-netdrvr-exp3/drivers/net/r8169.c~r8169-rx_copybreak 2003-11-22 00:14:22.000000000 +0100 +++ linux-2.6.0-test9-bk24-netdrvr-exp3-fr/drivers/net/r8169.c 2003-11-22 00:14:37.000000000 +0100 @@ -116,6 +116,8 @@ static struct pci_device_id rtl8169_pci_ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); +static int rx_copybreak = 200; + enum RTL8169_registers { MAC0 = 0, /* Ethernet hardware address. */ MAR0 = 8, /* Multicast filter. */ @@ -294,6 +296,7 @@ struct rtl8169_private { MODULE_AUTHOR("Realtek"); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_PARM(rx_copybreak, "i"); MODULE_LICENSE("GPL"); static int rtl8169_open(struct net_device *dev); @@ -772,6 +775,11 @@ static void rtl8169_free_rx_skb(struct p rtl8169_make_unusable_by_asic(desc); } +static inline void rtl8169_return_to_asic(struct RxDesc *desc) +{ + desc->status |= OWNbit + RX_BUF_SIZE; +} + static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) { desc->buf_addr = mapping; @@ -1016,12 +1024,26 @@ rtl8169_tx_interrupt(struct net_device * } } -static inline void rtl8169_unmap_rx(struct pci_dev *pdev, struct RxDesc *desc) +static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size, + struct RxDesc *desc, + struct net_device *dev) { - pci_dma_sync_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); + int ret = -1; + + if (pkt_size < rx_copybreak) { + struct sk_buff *skb; + + skb = dev_alloc_skb(pkt_size + 2); + if (skb) { + skb->dev = dev; + skb_reserve(skb, 2); + eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); + *sk_buff = skb; + rtl8169_return_to_asic(desc); + ret = 0; + } + } + return ret; } static void @@ -1047,17 +1069,26 @@ rtl8169_rx_interrupt(struct net_device * if (status & RxCRC) tp->stats.rx_crc_errors++; } else { + struct RxDesc *desc = tp->RxDescArray + cur_rx; struct sk_buff *skb = tp->Rx_skbuff[cur_rx]; int pkt_size = (status & 0x00001FFF) - 4; - rtl8169_unmap_rx(tp->pci_dev, tp->RxDescArray + cur_rx); + pci_dma_sync_single(tp->pci_dev, + le32_to_cpu(desc->buf_addr), + RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + + if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { + pci_unmap_single(tp->pci_dev, + le32_to_cpu(desc->buf_addr), + RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); + tp->Rx_skbuff[cur_rx] = NULL; + } skb_put(skb, pkt_size); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); - tp->Rx_skbuff[cur_rx] = NULL; - dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; tp->stats.rx_packets++; _ --bp/iNruPH9dso1Pn-- From dlstevens@us.ibm.com Fri Nov 21 16:08:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 16:08:32 -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 hAM08H25001694 for ; Fri, 21 Nov 2003 16:08:18 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAM08BJh327760; Fri, 21 Nov 2003 19:08:11 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAM08AKo322686; Fri, 21 Nov 2003 17:08:11 -0700 Importance: Normal Sensitivity: Subject: MLD compatibility mode doesn't account for extension headers [PATCH] To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Fri, 21 Nov 2003 17:08:07 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/21/2003 17:08:10 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE775DF93C9D58f9e8a93df938690918c07BBE775DF93C9D5" Content-Disposition: inline X-archive-position: 1618 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2195 Lines: 51 --0__=07BBE775DF93C9D58f9e8a93df938690918c07BBE775DF93C9D5 Content-type: text/plain; charset=US-ASCII Dave, The MLD v1 compatibility mode checks don't account for the fact that extension headers are included in the ipv6 payload_len field. That makes MLDv1 queries that include extension headers (like Router Alert) appear to be v2 packets. The below patch fixes the problem. +-DLS --- linux-2.6.0-test9-bk23F2/net/ipv6/mcast.c 2003-11-21 15:53:23.916402736 -0800 +++ linux-2.6.0-test9-bk23F3/net/ipv6/mcast.c 2003-11-21 15:51:31.360513832 -0800 @@ -1017,7 +1017,9 @@ if (!pskb_may_pull(skb, sizeof(struct in6_addr))) return -EINVAL; - len = ntohs(skb->nh.ipv6h->payload_len); + /* compute payload length excluding extension headers */ + len = ntohs(skb->nh.ipv6h->payload_len) + sizeof(struct ipv6hdr); + len -= (char *)skb->h.raw - (char *)skb->nh.ipv6h; /* Drop queries with not link local source */ if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr)&IPV6_ADDR_LINKLOCAL)) (See attached file: MLDext.patch) --0__=07BBE775DF93C9D58f9e8a93df938690918c07BBE775DF93C9D5 Content-type: application/octet-stream; name="MLDext.patch" Content-Disposition: attachment; filename="MLDext.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMjNGMi9uZXQvaXB2Ni9tY2FzdC5jCTIwMDMtMTEtMjEg MTU6NTM6MjMuOTE2NDAyNzM2IC0wODAwCisrKyBsaW51eC0yLjYuMC10ZXN0OS1iazIzRjMvbmV0 L2lwdjYvbWNhc3QuYwkyMDAzLTExLTIxIDE1OjUxOjMxLjM2MDUxMzgzMiAtMDgwMApAQCAtMTAx Nyw3ICsxMDE3LDkgQEAKIAlpZiAoIXBza2JfbWF5X3B1bGwoc2tiLCBzaXplb2Yoc3RydWN0IGlu Nl9hZGRyKSkpCiAJCXJldHVybiAtRUlOVkFMOwogCi0JbGVuID0gbnRvaHMoc2tiLT5uaC5pcHY2 aC0+cGF5bG9hZF9sZW4pOworCS8qIGNvbXB1dGUgcGF5bG9hZCBsZW5ndGggZXhjbHVkaW5nIGV4 dGVuc2lvbiBoZWFkZXJzICovCisJbGVuID0gbnRvaHMoc2tiLT5uaC5pcHY2aC0+cGF5bG9hZF9s ZW4pICsgc2l6ZW9mKHN0cnVjdCBpcHY2aGRyKTsKKwlsZW4gLT0gKGNoYXIgKilza2ItPmgucmF3 IC0gKGNoYXIgKilza2ItPm5oLmlwdjZoOyAKIAogCS8qIERyb3AgcXVlcmllcyB3aXRoIG5vdCBs aW5rIGxvY2FsIHNvdXJjZSAqLwogCWlmICghKGlwdjZfYWRkcl90eXBlKCZza2ItPm5oLmlwdjZo LT5zYWRkcikmSVBWNl9BRERSX0xJTktMT0NBTCkpCg== --0__=07BBE775DF93C9D58f9e8a93df938690918c07BBE775DF93C9D5-- From davem@pizda.ninka.net Fri Nov 21 16:46:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 16:46: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 hAM0kP25005075 for ; Fri, 21 Nov 2003 16:46:25 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA12768; Fri, 21 Nov 2003 16:46:21 -0800 Date: Fri, 21 Nov 2003 16:46:21 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: MLD compatibility mode doesn't account for extension headers [PATCH] Message-Id: <20031121164621.277f283d.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: 1619 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: 536 Lines: 14 On Fri, 21 Nov 2003 17:08:07 -0700 David Stevens wrote: > The MLD v1 compatibility mode checks don't account for the > fact that extension headers are included in the ipv6 payload_len field. > That makes MLDv1 queries that include extension headers (like > Router Alert) appear to be v2 packets. > The below patch fixes the problem. Looks good. I assume that all extension headers must appear _before_ the igmp stuff, and therefore no other headers may appear afterwards. I'll apply this, thanks. From bedboi@gmx.net Fri Nov 21 17:05:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 17:05:39 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAM15325005565 for ; Fri, 21 Nov 2003 17:05:24 -0800 Received: (qmail 19537 invoked by uid 65534); 22 Nov 2003 01:04:57 -0000 Received: from host216-102.pool80181.interbusiness.it (EHLO debian) (80.181.102.216) by mail.gmx.net (mp005) with SMTP; 22 Nov 2003 02:04:57 +0100 X-Authenticated: #10345676 Date: Sat, 22 Nov 2003 02:05:27 +0000 From: bedboi To: netdev@oss.sgi.com Subject: TCP Retx per tcp-flow Message-Id: <20031122020527.3f98f772.bedboi@gmx.net> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1620 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bedboi@gmx.net Precedence: bulk X-list: netdev Content-Length: 249 Lines: 6 Hi guys. I'm comparing TCP with a new congestion control algorithm and i need to get the number of segments retransmitted for a specific TCP flow. Is there a way to do this? (please don't tell man tcpdump...ok you'll tell it) Thnx in advance, Luca From dlstevens@us.ibm.com Fri Nov 21 18:29:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 18:29:29 -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 hAM2T925007360 for ; Fri, 21 Nov 2003 18:29:16 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAM2T46t293984; Fri, 21 Nov 2003 21:29:04 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAM2T3Ko107092; Fri, 21 Nov 2003 19:29:03 -0700 Importance: Normal Sensitivity: Subject: Re: MLD compatibility mode doesn't account for extension headers [PATCH] To: "David S. Miller" Cc: netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Fri, 21 Nov 2003 18:29:01 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 11/21/2003 19:29:03 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 1621 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 328 Lines: 16 >Looks good. I assume that all extension headers must appear >_before_ the igmp stuff, and therefore no other headers may >appear afterwards. Yes, MLD is the payload, so all extension headers must be between the IPv6 header and the MLD header. thanks, Dave, +-DLS From niv@us.ibm.com Fri Nov 21 23:02:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Nov 2003 23:03:10 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAM72o25013356 for ; Fri, 21 Nov 2003 23:02:57 -0800 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id hAM72fb0042208; Sat, 22 Nov 2003 02:02:41 -0500 Received: from us.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay03.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id hAM72e0h060602; Sat, 22 Nov 2003 00:02:40 -0700 Message-ID: <3FBF09A7.208@us.ibm.com> Date: Fri, 21 Nov 2003 23:00:55 -0800 From: Nivedita Singhvi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: bedboi CC: netdev@oss.sgi.com Subject: Re: TCP Retx per tcp-flow References: <20031122020527.3f98f772.bedboi@gmx.net> In-Reply-To: <20031122020527.3f98f772.bedboi@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1622 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: niv@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 355 Lines: 16 bedboi wrote: > Hi guys. I'm comparing TCP with a new congestion control algorithm and i need to get the number > of segments retransmitted for a specific TCP flow. Is there a way to do this? (please don't tell > man tcpdump...ok you'll tell it) Tried tcp_info.tcpi_retransmits? getsockopt() at SOL_TCP level and option TCP_INFO. thanks, Nivedita From torvalds@osdl.org Sat Nov 22 08:20:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 08:21: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 hAMGKu25027835 for ; Sat, 22 Nov 2003 08:20:57 -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 hAMGKeC11556; Sat, 22 Nov 2003 08:20:40 -0800 Date: Sat, 22 Nov 2003 08:20:40 -0800 (PST) From: Linus Torvalds To: SVR Anand cc: Kernel Mailing List , Subject: Re: 2.6.0-test9 : bridge freezes In-Reply-To: <200311221527.UAA29684@eis.iisc.ernet.in> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1623 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 Content-Length: 384 Lines: 12 On Sat, 22 Nov 2003, SVR Anand wrote: > > The problem is : After 3 to 4 hours of functioning, the bridge stops working > and the machine becomes unusable where it doesn't respond to keyboard, and > there is no video display. Sounds like a memory leak somewhere. It would probably be interesting to watch /proc/slabinfo every five minutes or so, and see what happens.. Linus From garzik@gtf.org Sat Nov 22 10:30:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 10:30:45 -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 hAMIU825029577 for ; Sat, 22 Nov 2003 10:30:28 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id E2B5B6698; Sat, 22 Nov 2003 13:30:01 -0500 (EST) Date: Sat, 22 Nov 2003 13:30:01 -0500 From: Jeff Garzik To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [BK PATCHES] 2.6.x experimental net driver queue Message-ID: <20031122183001.GA16993@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: 1624 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 Content-Length: 50719 Lines: 1397 Recent changes: * Most netdev alloc work from Al * 8139too stuff from shemminger and Hirofumi * r8169 stuff from Francois * m68k fixes from Geert 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-bk25-netdrvr-exp1.patch.bz2 This will update the following files: Documentation/networking/8139too.txt | 438 -------------- drivers/net/68360enet.c | 951 -------------------------------- Documentation/SubmittingPatches | 4 Documentation/networking/netconsole.txt | 57 + drivers/char/synclink.c | 43 - drivers/net/3c501.c | 116 +-- drivers/net/3c501.h | 1 drivers/net/3c503.c | 117 ++- drivers/net/3c505.c | 128 ++-- drivers/net/3c507.c | 120 ++-- drivers/net/3c515.c | 328 ++++------- drivers/net/3c523.c | 108 +-- drivers/net/3c527.c | 682 ++++++++++------------ drivers/net/3c527.h | 6 drivers/net/3c59x.c | 17 drivers/net/8139too.c | 405 ++++++++----- drivers/net/82596.c | 83 +- drivers/net/Kconfig | 27 drivers/net/Makefile | 2 drivers/net/Space.c | 587 +++++++++---------- drivers/net/a2065.c | 21 drivers/net/ac3200.c | 91 ++- drivers/net/amd8111e.c | 14 drivers/net/apne.c | 81 +- drivers/net/appletalk/ipddp.c | 62 +- drivers/net/appletalk/ltpc.c | 2 drivers/net/arcnet/arc-rimi.c | 131 +--- drivers/net/arcnet/arcnet.c | 6 drivers/net/arcnet/com20020-isa.c | 84 +- drivers/net/arcnet/com20020-pci.c | 54 - drivers/net/arcnet/com20020.c | 16 drivers/net/arcnet/com90io.c | 126 +--- drivers/net/arcnet/com90xx.c | 238 +++----- drivers/net/ariadne.c | 10 drivers/net/arm/am79c961a.c | 2 drivers/net/arm/ether00.c | 4 drivers/net/arm/ether1.c | 2 drivers/net/arm/ether3.c | 2 drivers/net/arm/etherh.c | 2 drivers/net/at1700.c | 166 ++--- drivers/net/atari_bionet.c | 62 +- drivers/net/atari_pamsnet.c | 67 +- drivers/net/atarilance.c | 58 + drivers/net/atp.c | 40 - drivers/net/au1000_eth.c | 61 -- drivers/net/bagetlance.c | 77 +- drivers/net/cs89x0.c | 132 ++-- drivers/net/de600.c | 59 + drivers/net/de600.h | 1 drivers/net/de620.c | 63 +- drivers/net/declance.c | 17 drivers/net/defxx.c | 2 drivers/net/depca.c | 20 drivers/net/dummy.c | 2 drivers/net/e100/e100_config.c | 8 drivers/net/e100/e100_main.c | 41 - drivers/net/e100/e100_phy.c | 14 drivers/net/e1000/e1000.h | 10 drivers/net/e1000/e1000_ethtool.c | 94 ++- drivers/net/e1000/e1000_hw.c | 65 +- drivers/net/e1000/e1000_hw.h | 9 drivers/net/e1000/e1000_main.c | 143 ++-- drivers/net/e1000/e1000_param.c | 45 - drivers/net/e2100.c | 88 ++ drivers/net/eepro.c | 256 ++++---- drivers/net/eepro100.c | 21 drivers/net/eexpress.c | 91 ++- drivers/net/eql.c | 2 drivers/net/es3210.c | 87 ++ drivers/net/eth16i.c | 119 ++-- drivers/net/ethertap.c | 3 drivers/net/ewrk3.c | 684 +++++++++-------------- drivers/net/fc/iph5526.c | 3 drivers/net/fc/iph5526_scsi.h | 2 drivers/net/fmv18x.c | 111 ++- drivers/net/gt96100eth.c | 49 - drivers/net/hamradio/baycom_epp.c | 2 drivers/net/hamradio/bpqether.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 2 drivers/net/hp-plus.c | 84 ++ drivers/net/hp.c | 84 ++ drivers/net/hp100.c | 743 +++++++++++++------------ drivers/net/hplance.c | 85 +- drivers/net/hydra.c | 19 drivers/net/jazzsonic.c | 88 ++ drivers/net/lance.c | 129 ++-- drivers/net/lasi_82596.c | 17 drivers/net/lne390.c | 88 ++ drivers/net/mac8390.c | 103 ++- drivers/net/mac89x0.c | 77 +- drivers/net/mace.c | 50 + drivers/net/macmace.c | 30 - drivers/net/macsonic.c | 103 +-- drivers/net/meth.c | 83 +- drivers/net/mvme147.c | 64 +- drivers/net/natsemi.c | 39 - drivers/net/ne.c | 83 ++ drivers/net/ne2.c | 82 ++ drivers/net/ne2k-pci.c | 3 drivers/net/ne2k_cbus.c | 107 ++- drivers/net/ne2k_cbus.h | 2 drivers/net/ne3210.c | 18 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/oaknet.c | 61 -- drivers/net/pci-skeleton.c | 2 drivers/net/pcmcia/3c574_cs.c | 7 drivers/net/pcmcia/3c589_cs.c | 7 drivers/net/pcmcia/com20020_cs.c | 32 - drivers/net/pcmcia/fmvj18x_cs.c | 7 drivers/net/pcmcia/nmclan_cs.c | 7 drivers/net/pcmcia/smc91c92_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 7 drivers/net/pcnet32.c | 11 drivers/net/plip.c | 18 drivers/net/ppp_generic.c | 67 +- drivers/net/r8169.c | 448 ++++++++++----- drivers/net/saa9730.c | 63 +- drivers/net/sb1250-mac.c | 49 - drivers/net/seeq8005.c | 97 +-- drivers/net/sgiseeq.c | 29 drivers/net/shaper.c | 11 drivers/net/sk_g16.c | 182 ++---- drivers/net/sk_mca.c | 119 +--- drivers/net/sk_mca.h | 3 drivers/net/skfp/skfddi.c | 32 - drivers/net/smc-ultra.c | 96 ++- drivers/net/smc-ultra32.c | 85 +- drivers/net/smc9194.c | 110 +-- drivers/net/stnic.c | 42 - drivers/net/sun3_82586.c | 81 +- drivers/net/sun3lance.c | 85 +- drivers/net/tc35815.c | 194 ++---- drivers/net/tg3.c | 16 drivers/net/tokenring/3c359.c | 4 drivers/net/tokenring/abyss.c | 2 drivers/net/tokenring/madgemc.c | 6 drivers/net/tokenring/proteon.c | 184 ++---- drivers/net/tokenring/skisa.c | 182 ++---- drivers/net/tokenring/smctr.c | 194 +++--- drivers/net/tokenring/tmspci.c | 2 drivers/net/tulip/Kconfig | 20 drivers/net/tulip/de2104x.c | 2 drivers/net/tulip/dmfe.c | 2 drivers/net/tulip/interrupt.c | 417 ++++++++++---- drivers/net/tulip/tulip.h | 18 drivers/net/tulip/tulip_core.c | 78 +- drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 3 drivers/net/tun.c | 18 drivers/net/wan/cosa.c | 37 - drivers/net/wan/lmc/lmc_main.c | 375 ++++-------- drivers/net/wan/lmc/lmc_var.h | 15 drivers/net/wan/x25_asy.c | 2 drivers/net/wd.c | 89 ++ drivers/net/wireless/arlan-main.c | 283 +++------ drivers/net/wireless/arlan.h | 6 drivers/net/wireless/atmel.c | 2 drivers/net/wireless/ray_cs.c | 17 drivers/net/wireless/strip.c | 2 drivers/net/wireless/wavelan.c | 251 +++----- drivers/net/wireless/wavelan.p.h | 58 - drivers/net/wireless/wavelan_cs.c | 113 +-- drivers/net/wireless/wavelan_cs.p.h | 49 - drivers/net/znet.c | 36 - drivers/net/zorro8390.c | 19 drivers/s390/net/qeth.c | 18 drivers/usb/gadget/ether.c | 2 include/linux/arcdevice.h | 1 include/linux/com20020.h | 1 include/linux/netdevice.h | 18 include/linux/netpoll.h | 38 + include/linux/pci_ids.h | 2 net/Kconfig | 20 net/core/Makefile | 1 net/core/dev.c | 39 + net/core/netpoll.c | 646 +++++++++++++++++++++ net/wanrouter/wanmain.c | 2 182 files changed, 8127 insertions(+), 7778 deletions(-) through these ChangeSets: (03/11/22 1.1500) [PATCH] 2.6.x experimental net driver queue fix On Wed, 19 Nov 2003, Sam Creasey wrote: > On Tue, 18 Nov 2003, Geert Uytterhoeven wrote: > > On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > > > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > > > Viro. > > > > > > > > No users of init_etherdev remain in the tree. (yay!) > > > > > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > > > drivers: > > > > I forget to test the Sun-3 drivers: > > - sun3_82586.c: > > o add missing casts to iounmap() calls > > o fix parameter of free_netdev() > > - sun3lance.c: add missing casts to iounmap() calls > > > > Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not > > defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed > > to ioremap()? > > Should be... I looked back through a few versions of the code, and I'm > not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented > that line out long ago anyway). (I'm also amazed just how much of that > driver I've forgotten in the last year or two :) OK, so here's a additional patch that fixes that: (03/11/22 1.1499) [PATCH] 8139too NAPI for net-drivers-2.5-exp Jeff Garzik writes: > Stephen Hemminger wrote: > > Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. > > Also: > > 64k receive ring - has to handle wrap for that case; > > the NoWrap flag does nothing if using this big ring. > > assert() -> BUG_ON() > > > > To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. > + local_irq_disable(); > + netif_rx_complete(dev); > + RTL_W16_F(IntrMask, rtl8139_intr_mask); > + local_irq_enable(); Probably, by my mistake in previous mail. Sorry. This still has the races condition. It can trigger the same problem by shared interrupt on SMP. Probably the following ISR style should use the below combination. in ISR if (netif_rx_schedule_prep(dev)) { RTL_W16 (IntrMask, rtl8139_norx_intr_mask); __netif_rx_schedule(dev); } in ->poll local_irq_disable(); RTL_W16_F(IntrMask, rtl8139_intr_mask); __netif_rx_complete(dev); local_irq_enable(); And another one should use the below combination. (this style can change the flags of __LINK_STATE_RX_SCHED or __LINK_STATE_START anytime) in ISR if (status & RxAckBits) { RTL_W16_F (IntrMask, rtl8139_norx_intr_mask); netif_rx_schedule (dev); } in ->poll local_irq_disable(); __netif_rx_complete(dev); RTL_W16_F(IntrMask, rtl8139_intr_mask); local_irq_enable(); If happen the shared interrupt, the this ISR style may lose a chance of netif_rx_schedule(). Anyway, the following patch should fix the problem. Please apply. Thanks. -- OGAWA Hirofumi drivers/net/8139too.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) (03/11/22 1.1498) [PATCH] (3/3) 8139too -- poll_controller For net-drivers-2.5-exp, add a poll_controller hook to allow use of netconsole with this driver. jeff, don't have netconsole setup to test this so please give it a try before including it. (03/11/22 1.1497) [PATCH] (2/3) 8139too -- configurable receive ring For net-drivers-2.5-exp: Make the receive window configurable and go back to the original 32K by default. (03/11/22 1.1496) [PATCH] (1/3) 8139too -- put back old assert For net-drivers-2.5-exp: Minimize code changes -- put back assert() macro with similar properties to the original. Added unlikely() and KERN_ERR tag. (03/11/22 1.1495) [netdrvr r8169] Rx copybreak for small packets. - removal of rtl8169_unmap_rx() (unneeded as for now). (03/11/22 1.1494) [wan cosa] netdev dyamic alloc (03/11/22 1.1493) [wan synclink] netdev dynamic alloc (03/11/22 1.1492) [netdrvr ppp] netdev dynamic alloc; convert ppp_net_init to alloc_netdev setup function (03/11/22 1.1491) [arcnet] create and use alloc_arcdev helper (03/11/22 1.1490) [arcnet com90xx] netdev dynamic alloc; module params; fix bugs (03/11/22 1.1489) [arcnet com20020] netdev dynamic alloc; module params; fix bugs (03/11/22 1.1488) [arcnet arc-rimi] use alloc_netdev; module params; fix bugs on error/cleanup (03/11/22 1.1487) [arcnet com90io] use alloc_netdev (03/11/22 1.1486) [appletalk ipddp] dynamically allocate struct net_device Converts from static to dynamic allocation, in preparation for further refcount changes. (03/11/22 1.1485) [netdrvr ne3210] remove #if 0'd code (03/11/22 1.1484) [wireless ray_cs] use alloc_etherdev (03/11/22 1.1483) [netdrvr meth] use alloc_etherdev; fix leaks on error/cleanup (03/11/22 1.1482) [netdrvr qeth] use alloc_etherdev instead of hand-allocating struct net_device (03/11/20 1.1479) [netdrvr r8169] Conversion of Tx data buffers to PCI DMA: - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - buf_addr of an unmapped descriptor is always set to the same value (cf rtl8169_unmap_tx_skb); - nothing fancy, really. (03/11/20 1.1478) [netdrvr r8169] rtl8169_start_xmit fixes: - it forgot to update stats if the skb couldn't be expanded; - it didn't free it either if the descriptor was not available; - move the spin_unlock nearer of the exit point instead of duplicating it in the new branch. (03/11/20 1.1477) [netdrvr r8169] Conversion of Rx data buffers to PCI DMA - endianness is kept in a fscked state as it is in the original code (will be adressed in a later patch); - rtl8169_rx_clear() walks the buffer ring and releases the allocated data buffers. It needs to be used in two places: - rtl8169_init_ring() failure path; - normal device release (i.e. rtl8169_close); - rtl8169_free_rx_skb() releases a Rx data buffer. Mostly an helper for rtl8169_rx_clear(). As such it must: - unmap the memory area; - release the skb; - prevent the ring descriptor from being used again; - rtl8169_alloc_rx_skb() prepares a Rx data buffer for use. As such it must: - allocate an skb; - map the memory area; - reflect the changes in the ring descriptor. This function is balanced by rtl8169_free_rx_skb(). - rtl8169_unmap_rx() simply helps with the 80-columns limit. - rtl8169_rx_fill() walks a given range of the buffer ring and try to turn any descriptor into a ready to use one. It returns the count of modified descriptors and exits if an allocation fails. It can be seen as balanced by rtl8169_rx_clear(). Motivation: - partially abstract the (usually big) piece of code for the refill logic at the end of the Rx interrupt; - factorize the refill logic and the initial ring setup. - simple conversion of rtl8169_rx_interrupt() without rx_copybreak (will be adressed in a later patch). (03/11/20 1.1476) [netdrvr r8169] Conversion of Rx/Tx descriptors to consistent DMA: - use pci_alloc_consistent() for Rx/Tx descriptors in rtl8169_open() (balanced by pci_free_consistent() on error path as well as in rtl8169_close()); - removal of the fields {Rx/Tx}DescArrays in struct rtl8169_private as there is no need to store a non-256 bytes aligned address any more; - fix for rtl8169_open() leak when RxBufferRings allocation fails. Said allocation is pushed to rtl8169_init_ring() as part of an evil cunning plan. (03/11/19 1.1435.2.96) [PATCH] 8139too NAPI for net-drivers-2.5-exp Here is the 8139too version in net-drivers-2.5-exp modified for NAPI. Also: 64k receive ring - has to handle wrap for that case; the NoWrap flag does nothing if using this big ring. assert() -> BUG_ON() To deal with the races with tx_timeout, put back in the rx_lock from earlier versions. (03/11/19 1.1435.2.95) [PATCH] more ne2k-pci clone boards (03/11/19 1.1435.2.94) [PATCH] more RTL-8139 clone boards (03/11/18 1.1435.2.93) [PATCH] sun3-related net driver fixes On Mon, 17 Nov 2003, Geert Uytterhoeven wrote: > On Sun, 16 Nov 2003, Jeff Garzik wrote: > > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > > Viro. > > > > No users of init_etherdev remain in the tree. (yay!) > > Here are some (untested, except for cross-gcc) fixes for the m68k-related > drivers: I forget to test the Sun-3 drivers: - sun3_82586.c: o add missing casts to iounmap() calls o fix parameter of free_netdev() - sun3lance.c: add missing casts to iounmap() calls Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed to ioremap()? (03/11/18 1.1435.2.92) [PATCH] m68k-related net driver fixes On Sun, 16 Nov 2003, Jeff Garzik wrote: > Yet more updates. Syncing with Andrew Morton, and more syncing with Al > Viro. > > No users of init_etherdev remain in the tree. (yay!) Here are some (untested, except for cross-gcc) fixes for the m68k-related drivers: - Space.c: fix incorrect prototypes for atarilance_probe() and mace_probe() - a2065.c: kill superfluous argument of alloc_etherdev() - apne.c: o fix incorrect prototype for apne_probe() o kill unused variable err - mac8390.c: o kill unused variable probed o fix typos ENDOEV -> ENODEV and ERR_PTE -> ERR_PTR o add missing variable slots - macmace.c: use ERR_PTR() where needed - macsonic.c: kill unused variable lp - mvme147.c: o kill conversion warning and kill a cast by making ram unsigned long o add missing variable err Note: The use of `slots' in mac8390.c is not in my tree. Do you know where that change comes from? (03/11/18 1.1435.2.91) [PATCH] netpoll: push zap_completion_queue for lkcd Move zap_completion_queue call inside netpoll so we don't need to export it separately. (03/11/18 1.1435.2.90) [PATCH] netpoll: fix compilation with CONFIG_NETPOLL_RX Fix compilation without CONFIG_NETPOLL_RX (03/11/16 1.1435.2.89) [netdrvr] remove init_etherdev mentions in Doc/SubmittingPatches, atari_pamsnet.c (03/11/16 1.1435.2.88) [netdrvr] remove Documentation/networking/8139too.txt All sections of the document are woefully outdated. (03/11/16 1.1435.2.87) [netdrvr lasi_82596] remove ether_setup() call, fix leak in probe (03/11/16 1.1435.2.86) [netdrvr] alloc_etherdev-related cleanups Mostly removing unneeded calls to ether_setup(), which alloc_etherdev() already does for us. (03/11/16 1.1435.2.85) [netdrvr 3c527] applied missing pieces of Richard Proctor's 3c527 SMP update Minor stuff... remove unused constants, and mark non-experimental and non-broken in Kconfig. (03/11/16 1.1435.2.84) [netdrvr tulip] clean up tulip NAPI poll disable Looks like the same patch was applied multiple times. No negative effects except ugliness and a redundant test. (03/11/16 1.1435.2.83) [netdrvr xircom_tulip_cb] remove bogus unregister_netdev call; use free_netdev (03/11/16 1.1435.2.82) [netdrvr stnic] fix typo from last stnic cset (03/11/16 1.1435.2.81) [netdrvr iph5526] use SET_MODULE_OWNER; small typedef cleanup (03/11/16 1.1435.2.80) [netdrvr pcmcia] s/kfree/free_netdev/ (03/11/16 1.1435.2.79) [netdrvr ether00] s/kfree/free_netdev/ ; remove redundant memset() calls (03/11/16 1.1435.2.78) [netdrvr] s/kfree/free_netdev/ where appropriate (03/11/16 1.1435.2.77) [wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef (03/11/16 1.1435.2.76) [netdrvr de600] use alloc_etherdev; request_region fixes (03/11/16 1.1435.2.75) [netdrvr atp] use alloc_etherdev, clean up probing (03/11/16 1.1435.2.74) [netdrvr depca] fix leaks on error (03/11/16 1.1435.2.73) [netdrvr saa9730] use alloc_etherdev, annotate bugs found but not fixed (03/11/16 1.1435.2.72) [netdrvr stnic] use alloc_etherdev (03/11/16 1.1435.2.71) [netdrvr sgiseeq] alloc_etherdev, SET_MODULE_OWNER, fix leaks on error (03/11/16 1.1435.2.70) [netdrvr sb1250-mac] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.69) [netdrvr au1000_eth] alloc_etherdev, SET_MODULE_OWNER, fix leaks/small bugs (03/11/16 1.1435.2.68) [netdrvr zorro8390] alloc_etherdev, SET_MODULE_OWNER (03/11/16 1.1435.2.67) [netdrvr mace] alloc_etherdev, fix leaks on error (03/11/16 1.1435.2.66) [netdrvr znet] alloc_etherdev, SET_MODULE_OWNER, remove #ifdef MODULE (03/11/16 1.1435.2.65) [netdrvr oaknet] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.64) [netdrvr hydra] use alloc_etherdev (03/11/16 1.1435.2.63) [netdrvr gt96100eth] use alloc_etherdev, fix leaks (03/11/16 1.1435.2.62) [netdrvr declance] use alloc_etherdev (03/11/16 1.1435.2.61) [netdrvr ariadne] use alloc_etherdev (03/11/16 1.1435.2.60) [netdrvr a2065] convert to alloc_etherdev (03/11/16 1.1435.2.59) [netdrvr tc35815] switch to using alloc_etherdev Also handle ioremap failure. (03/11/16 1.1435.2.58) [netdrvr tc35815] many fixes, major and minor * s/int/unsigned long/ for 'flags' arg passed to spin_lock_irqsave * s/unsigned int/unsigned long/ for I/O port addresses * no need to prevent tc35815_probe from being called multiple times... PCI layer will do things properly for us. * call pci_enable_device before accessing hardware, before obtaining irq number, and before obtaining I/O port addresses. * remove bogus 'if (pdev)' check in PCI API ->probe function * call SET_M0DULE_OWNER, remove MOD_{INC,DEC}_USE_COUNT * (cleanup) don't bother casting from a void* * (cleanup) mark debugging function with #if 0, just like the caller * Fix many printk statements to indicate that tc_readl() returns a long, not an int. * (cleanup) remove unused tc35815_proc_info function (03/11/16 1.1435.2.57) [e100] missed a kfree -> free_netdev * missed a kfree -> free_netdev (03/11/16 1.1435.2.56) [e100] add extended device-specific ethtool stats * Add extended device-specific ethtool stats (03/11/16 1.1435.2.55) [e100] remove __devinit from mis-marked funcs * Remove __devinit from mis-marked functions that are needed after init for things like ethtool. (anton@samba.org) (03/11/16 1.1435.2.54) [e1000] Internal SERDES link detect; delay after SPI * Internal SERDES designs must use indirect method to sample link status based on sampling MAC sync bits. * Need 10 msec delay after SPI eeprom write, otherwise back-to- back writes can get corrupted. * Allow for setup of multiple MAC addresses (not used for Linux - shared code change). * Updated comment block. (03/11/16 1.1435.2.53) [e1000] exit polling loop if interface is brought down * Exit polling loop if interface is brought down. (03/11/16 1.1435.2.52) [e1000] improve Tx flush method * Flush queued in-flight Tx descriptors when link is lost. 8254x stops processing Tx descriptors when link is lost, so outstanding Tx buffers will not be returned to OS unless we flush the Tx descriptor ring. This patch move the flush from the watchdog timer callback to process context to work around some issue with holding xmit_lock in timer callback. (03/11/16 1.1435.2.51) [e1000] print message if user overrides default ITR * Print message if user overrides default setting of ITR. (03/11/16 1.1435.2.50) [e1000] 82547 interrupt assert/de-assert re-ordering * 82547 needs interrupt disable/enable to keep interrupt assertion state synced between 82547 and APIC. 82547 will re-order assert and de-assert messages if hub link bus is busy (heavy traffic). Disabling interrupt on device works around re- order issue. (03/11/16 1.1435.2.49) [e1000] use unsigned long for I/O base addr * Use unsigned long for I/O base addr; can be 64-bit on some archs. (03/11/16 1.1435.2.48) [e1000] loopback diag test failing on big-endian * ethtool diag loopback test was failing on ppc because of endianness issue. (03/11/16 1.1435.2.47) [e1000] use pdev->irq rather than netdev->irq for * Use pdev->irq rather than netdev->irq for interrupt registration in anticipation of MSI interrupt API support. (03/11/16 1.1435.2.46) [e1000] add ethtool ring param support * Add ethtool ring param support (03/11/16 1.1435.2.45) [netdrvr] Remove never-referenced 68360enet.c (03/11/12 1.1435.2.44) [netdrvr 3c515] fix non-modular build (03/11/12 1.1435.2.43) [PATCH] (42/42) atari_lance NE68-atarilance * switched to dynamic allocation * fixed resource leaks on failure exits * also kill off last usage of probe_list (03/11/12 1.1435.2.42) [PATCH] (41/42) sun3_lance NE67-sun3lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.41) [PATCH] (40/42) sun3_82586 NE66-sun3_82586 * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.40) [PATCH] (39/42) apne NE64-apne * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.39) [PATCH] (38/42) bionet NE63-bionet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.38) [PATCH] (37/42) pamsnet NE62-pamsnet * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.37) [PATCH] (36/42) hplance NE61-hplance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.36) [PATCH] (35/42) mvme147 NE60-mvme147lance * switched to dynamic allocation * fixed resource leaks on failure exits (03/11/12 1.1435.2.35) [PATCH] (34/42) mac_mace NE59-mace * switched mace to dynamic allocation * mace: fixed resource leaks on failure exits (03/11/12 1.1435.2.34) [PATCH] (33/42) macsonic NE58-macsonic * switched macsonic to dynamic allocation * macsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.33) [PATCH] (32/42) mac8390 NE57-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits * get rid of MOD_INC/DEC (03/11/12 1.1435.2.32) [PATCH] (31/42) mac89x0 NE56-mac8390 * switched mac8390 to dynamic allocation * mac8390: fixed resource leaks on failure exits (03/11/12 1.1435.2.31) [PATCH] (30/42) jazzsonic NE55-jazzsonic * switched jazzsonic to dynamic allocation * jazzsonic: fixed resource leaks on failure exits (03/11/12 1.1435.2.30) [PATCH] (29/42) bagetlance NE54-bagetlance * switched bagetlance to dynamic allocation * bagetlance: embedded ->priv * bagetlance: fixed resource leaks on failure exits * bagetlance: fixed resource leaks on rmmod (03/11/12 1.1435.2.29) [PATCH] (28/42) ultra32 NE52-ultra32 * switched smc-ultra32 to dynamic allocation * smc-ultra32: fixed order of freeing bugs * smc-ultra32: fixed clobbering on autoprobe * smc-ultra32: fixed resource leaks on failure exits (03/11/12 1.1435.2.28) [PATCH] (27/42) ac3200 NE51-ac3200 * switched ac3200 to dynamic allocation * ac3200: fixed order of freeing bugs * ac3200: fixed clobbering on autoprobe * ac3200: fixed resource leaks on failure exits (03/11/12 1.1435.2.27) [PATCH] (26/42) es3210 NE50-es3210 * switched es3210 to dynamic allocation * es3210: fixed order of freeing bugs * es3210: fixed clobbering on autoprobe (03/11/12 1.1435.2.26) [PATCH] (25/42) lne390 NE49-lne390 * switched lne390 to dynamic allocation * lne390: fixed order of freeing bugs * lne390: fixed clobbering on autoprobe * lne390: fixed resource leaks on failure exits (03/11/12 1.1435.2.25) [PATCH] (24/42) ne2 NE48-ne2 from viro * switched ne2 to dynamic allocation * ne2: fixed order of freeing bugs * ne2: fixed resource leaks on failure exits (03/11/12 1.1435.2.24) [PATCH] (23/42) 3c523 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 (03/11/12 1.1435.2.23) [PATCH] (22/42) 3c527 NE46-3c527 * switched 3c527 to dynamic allocation * 3c527: switched to embedded ->priv * 3c527: fixed resource leaks on failure exits (03/11/12 1.1435.2.22) [PATCH] (21/42) sk_mca 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 (03/11/12 1.1435.2.21) [PATCH] (20/42) hp100-T10 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 (03/11/12 1.1435.2.20) [PATCH] (19/42) 3c515-T10 NE43-3c515 * convert to dynamic allocation * fixed up device list handling (03/11/12 1.1435.2.19) [PATCH] (18/42) ultra 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 (03/11/12 1.1435.2.18) [PATCH] (17/42) wd 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 (03/11/12 1.1435.2.17) [PATCH] (16/42) 3c503 Based on viro NE40-3c503 * switched 3c503 to dynamic allocation * 3c503: fixed order of freeing bugs * 3c503: fixed IO without request_region * 3c503: fixed resource leaks on failure exits * 3c503: fixed clobbering on autoprobe (03/11/12 1.1435.2.16) [PATCH] (15/42) hp 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 (03/11/12 1.1435.2.15) [PATCH] (14/42) hpplus 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 (03/11/12 1.1435.2.14) [PATCH] (13/42) e2100 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 (03/11/12 1.1435.2.13) [PATCH] (12/42) ne 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 (03/11/12 1.1435.2.12) [PATCH] (11/42) lance 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? (03/11/12 1.1435.2.11) [PATCH] (10/42) smc 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 (03/11/12 1.1435.2.10) [PATCH] (9/42) seeq8005 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 (03/11/12 1.1435.2.9) [PATCH] (8/42) at1500 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). (03/11/12 1.1435.2.8) [PATCH] (7/42) cs89x0 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. (03/11/12 1.1435.2.7) [PATCH] (6/42) at1700 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 (03/11/12 1.1435.2.6) [PATCH] (5/42) fmv18 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... (03/11/12 1.1435.2.5) [PATCH] (4/42) eth16i NE28-eth16i * switched eth16i to dynamic allocation * eth16i: embedded ->priv * eth16i: fixed resource leaks on failure exits (03/11/12 1.1435.2.4) [PATCH] (3/42) eexpress 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 (03/11/12 1.1435.2.3) [PATCH] (2/42) eepro 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 (03/11/12 1.1435.2.2) [PATCH] (1/42) ewrk3 Convert ewrk3 to dynamic allocation * get rid of private device allocation method * fix deeply nested function (03/11/11 1.1428.2.5) [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.1428.2.4) [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.1428.2.3) [PATCH] 3c59x netpoll typo Poll code (in net-drivers-2.5-exp) was calling undefined function. (03/11/11 1.1428.2.2) [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 jb@gxaafoot.homelinux.org Sat Nov 22 18:03:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 18:03:38 -0800 (PST) Received: from debian.local.gxaafoot.homelinux.org (themadhatter.net1.nerim.net [213.41.159.101]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAN23I25007052 for ; Sat, 22 Nov 2003 18:03:19 -0800 Received: by debian.local.gxaafoot.homelinux.org (Postfix, from userid 1000) id 15060BE85; Sun, 23 Nov 2003 03:03:07 +0100 (CET) Date: Sun, 23 Nov 2003 03:03:07 +0100 From: Jean-Baptiste To: netdev@oss.sgi.com Subject: A propos the tcp6_sock slab leak in test9 Message-ID: <20031123020306.GA23121@gxaafoot.homelinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 1625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jean-baptiste.note@m4x.org Precedence: bulk X-list: netdev Content-Length: 611 Lines: 24 Hi, I've got a box showing the ipv6_sock slab leak reported some time ago on the lkml and forwarded on this list on the 11th. The slab count is now around 8600 with just 13 days uptime. Opening/closing an ftp ipv6 connection is enough to increase the slab usage by one, and never see it go back... In case some investigation can be done on-site, i can give you full access to the box that's hooked 24/7 on the internet. Or you may equally redirect me to some work in order to track the problem. I'm running a stock test9 with only a wlan driver loaded from outside the kernel tree. Thanks for your work, JB From herbert@gondor.apana.org.au Sat Nov 22 22:16:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 22:16:40 -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 hAN6GD25012758 for ; Sat, 22 Nov 2003 22:16:15 -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 1ANnXP-0005KV-00; Sun, 23 Nov 2003 17:16:03 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1ANnXN-0003fM-00; Sun, 23 Nov 2003 17:16:01 +1100 Date: Sun, 23 Nov 2003 17:16:01 +1100 To: Jeff Garzik , netdev@oss.sgi.com Subject: [IRDA] Remove uses of isa_virt_to_bus Message-ID: <20031123061601.GA14072@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1626 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 Content-Length: 21883 Lines: 642 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: This patch removes the references to isa_virt_to_bus in the relevant ISA IRDA drivers by calling dma_alloc_coherent. 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 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: kernel-source-2.5/include/asm-i386/dma-mapping.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/asm-i386/dma-mapping.h,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 dma-mapping.h --- kernel-source-2.5/include/asm-i386/dma-mapping.h 17 Jan 2003 02:23:00 -0000 1.1.1.2 +++ kernel-source-2.5/include/asm-i386/dma-mapping.h 23 Nov 2003 04:27:00 -0000 @@ -2,6 +2,8 @@ #define _ASM_I386_DMA_MAPPING_H #include +#include +#include #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) Index: kernel-source-2.5/net/irda/irda_device.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/irda/irda_device.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 irda_device.c --- kernel-source-2.5/net/irda/irda_device.c 8 Oct 2003 19:24:05 -0000 1.1.1.8 +++ kernel-source-2.5/net/irda/irda_device.c 3 Nov 2003 10:54:42 -0000 @@ -557,7 +557,7 @@ * Setup the DMA channel. Commonly used by ISA FIR drivers * */ -void setup_dma(int channel, char *buffer, int count, int mode) +void setup_dma(int channel, dma_addr_t buffer, int count, int mode) { unsigned long flags; @@ -566,7 +566,7 @@ disable_dma(channel); clear_dma_ff(channel); set_dma_mode(channel, mode); - set_dma_addr(channel, isa_virt_to_bus(buffer)); + set_dma_addr(channel, buffer); set_dma_count(channel, count); enable_dma(channel); Index: kernel-source-2.5/include/net/irda/ali-ircc.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/irda/ali-ircc.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 ali-ircc.h --- kernel-source-2.5/include/net/irda/ali-ircc.h 19 Oct 2002 04:01:57 -0000 1.1.1.1 +++ kernel-source-2.5/include/net/irda/ali-ircc.h 23 Nov 2003 03:42:16 -0000 @@ -26,6 +26,7 @@ #include #include +#include #include /* SIR Register */ @@ -198,6 +199,8 @@ chipio_t io; /* IrDA controller information */ iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ + dma_addr_t tx_buff_dma; + dma_addr_t rx_buff_dma; __u8 ier; /* Interrupt enable register */ Index: kernel-source-2.5/include/net/irda/irda_device.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/irda/irda_device.h,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 irda_device.h --- kernel-source-2.5/include/net/irda/irda_device.h 8 Oct 2003 19:24:53 -0000 1.1.1.6 +++ kernel-source-2.5/include/net/irda/irda_device.h 3 Nov 2003 10:57:29 -0000 @@ -39,11 +39,13 @@ #ifndef IRDA_DEVICE_H #define IRDA_DEVICE_H +#include #include #include #include #include /* struct sk_buff */ #include +#include #include #include /* struct qos_info */ @@ -233,7 +235,7 @@ int irda_device_dongle_cleanup(dongle_t *dongle); #ifdef CONFIG_ISA -void setup_dma(int channel, char *buffer, int count, int mode); +void setup_dma(int channel, dma_addr_t buffer, int count, int mode); #endif void irda_task_delete(struct irda_task *task); Index: kernel-source-2.5/include/net/irda/nsc-ircc.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/irda/nsc-ircc.h,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 nsc-ircc.h --- kernel-source-2.5/include/net/irda/nsc-ircc.h 27 Sep 2003 00:02:02 -0000 1.1.1.3 +++ kernel-source-2.5/include/net/irda/nsc-ircc.h 23 Nov 2003 03:49:38 -0000 @@ -32,6 +32,7 @@ #include #include +#include #include /* DMA modes needed */ @@ -255,6 +256,8 @@ chipio_t io; /* IrDA controller information */ iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ + dma_addr_t tx_buff_dma; + dma_addr_t rx_buff_dma; __u8 ier; /* Interrupt enable register */ Index: kernel-source-2.5/include/net/irda/w83977af_ir.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/irda/w83977af_ir.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 w83977af_ir.h --- kernel-source-2.5/include/net/irda/w83977af_ir.h 19 Oct 2002 04:01:09 -0000 1.1.1.1 +++ kernel-source-2.5/include/net/irda/w83977af_ir.h 23 Nov 2003 04:05:52 -0000 @@ -26,6 +26,7 @@ #define W83977AF_IR_H #include +#include /* Flags for configuration register CRF0 */ #define ENBNKSEL 0x01 @@ -179,6 +180,8 @@ chipio_t io; /* IrDA controller information */ iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ + dma_addr_t tx_buff_dma; + dma_addr_t rx_buff_dma; /* Note : currently locking is *very* incomplete, but this * will get you started. Check in nsc-ircc.c for a proper Index: kernel-source-2.5/drivers/net/irda/ali-ircc.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/ali-ircc.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 ali-ircc.c --- kernel-source-2.5/drivers/net/irda/ali-ircc.c 8 Oct 2003 19:24:04 -0000 1.1.1.9 +++ kernel-source-2.5/drivers/net/irda/ali-ircc.c 23 Nov 2003 04:28:10 -0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -303,16 +304,18 @@ self->tx_buff.truesize = 14384; /* Allocate memory if needed */ - self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL |GFP_DMA); + self->rx_buff.head = + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { err = -ENOMEM; goto err_out2; } memset(self->rx_buff.head, 0, self->rx_buff.truesize); - self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->tx_buff.head = + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { err = -ENOMEM; goto err_out3; @@ -361,9 +364,11 @@ return 0; err_out4: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); err_out3: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); err_out2: release_region(self->io.fir_base, self->io.fir_ext); err_out1: @@ -397,10 +402,12 @@ release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); dev_self[self->index] = NULL; free_netdev(self->netdev); @@ -1567,7 +1574,8 @@ self->io.direction = IO_XMIT; setup_dma(self->io.dma, - self->tx_fifo.queue[self->tx_fifo.ptr].start, + ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start - + self->tx_buff.head) + self->tx_buff_dma, self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE); @@ -1719,7 +1727,7 @@ self->st_fifo.len = self->st_fifo.pending_bytes = 0; self->st_fifo.tail = self->st_fifo.head = 0; - setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, + setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, DMA_RX_MODE); /* Set Receive Mode,Brick Wall */ Index: kernel-source-2.5/drivers/net/irda/nsc-ircc.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/nsc-ircc.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 nsc-ircc.c --- kernel-source-2.5/drivers/net/irda/nsc-ircc.c 8 Oct 2003 19:24:00 -0000 1.1.1.9 +++ kernel-source-2.5/drivers/net/irda/nsc-ircc.c 23 Nov 2003 04:28:17 -0000 @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -309,8 +310,9 @@ self->tx_buff.truesize = 14384; /* Allocate memory if needed */ - self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->rx_buff.head = + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { err = -ENOMEM; goto out2; @@ -318,8 +320,9 @@ } memset(self->rx_buff.head, 0, self->rx_buff.truesize); - self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->tx_buff.head = + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { err = -ENOMEM; goto out3; @@ -370,9 +373,11 @@ return 0; out4: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); out3: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); out2: release_region(self->io.fir_base, self->io.fir_ext); out1: @@ -406,10 +411,12 @@ release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); dev_self[self->index] = NULL; free_netdev(self->netdev); @@ -1411,7 +1418,8 @@ outb(ECR1_DMASWP|ECR1_DMANF|ECR1_EXT_SL, iobase+ECR1); setup_dma(self->io.dma, - self->tx_fifo.queue[self->tx_fifo.ptr].start, + ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start - + self->tx_buff.head) + self->tx_buff_dma, self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE); @@ -1568,7 +1576,7 @@ self->st_fifo.len = self->st_fifo.pending_bytes = 0; self->st_fifo.tail = self->st_fifo.head = 0; - setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, + setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, DMA_RX_MODE); /* Enable DMA */ Index: kernel-source-2.5/drivers/net/irda/smsc-ircc2.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/smsc-ircc2.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 smsc-ircc2.c --- kernel-source-2.5/drivers/net/irda/smsc-ircc2.c 8 Oct 2003 19:24:16 -0000 1.1.1.2 +++ kernel-source-2.5/drivers/net/irda/smsc-ircc2.c 23 Nov 2003 04:30:19 -0000 @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -112,6 +113,8 @@ chipio_t io; /* IrDA controller information */ iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ + dma_addr_t tx_buff_dma; + dma_addr_t rx_buff_dma; struct qos_info qos; /* QoS capabilities for this device */ @@ -413,16 +416,18 @@ self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; - self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->rx_buff.head = + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { ERROR("%s, Can't allocate memory for receive buffer!\n", driver_name); goto err_out2; } - self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->tx_buff.head = + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { ERROR("%s, Can't allocate memory for transmit buffer!\n", driver_name); @@ -466,9 +471,11 @@ return 0; err_out4: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); err_out3: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); err_out2: free_netdev(self->netdev); dev_self[--dev_count] = NULL; @@ -1161,7 +1168,7 @@ IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB); /* Setup DMA controller (must be done after enabling chip DMA) */ - setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, + setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, DMA_TX_MODE); /* Enable interrupt */ @@ -1251,7 +1258,7 @@ outb(2050 & 0xff, iobase+IRCC_RX_SIZE_LO); /* Setup DMA controller */ - setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, + setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, DMA_RX_MODE); /* Enable burst mode chip Rx DMA */ @@ -1717,10 +1724,12 @@ release_region(self->io.sir_base, self->io.sir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); free_netdev(self->netdev); Index: kernel-source-2.5/drivers/net/irda/via-ircc.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/via-ircc.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 via-ircc.c --- kernel-source-2.5/drivers/net/irda/via-ircc.c 8 Oct 2003 19:24:00 -0000 1.1.1.4 +++ kernel-source-2.5/drivers/net/irda/via-ircc.c 23 Nov 2003 04:28:28 -0000 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -386,7 +387,8 @@ /* Allocate memory if needed */ self->rx_buff.head = - (__u8 *) kmalloc(self->rx_buff.truesize, GFP_KERNEL | GFP_DMA); + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { err = -ENOMEM; goto err_out2; @@ -394,7 +396,8 @@ memset(self->rx_buff.head, 0, self->rx_buff.truesize); self->tx_buff.head = - (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL | GFP_DMA); + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { err = -ENOMEM; goto err_out3; @@ -435,9 +438,11 @@ return 0; err_out4: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); err_out3: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); err_out2: release_region(self->io.fir_base, self->io.fir_ext); err_out1: @@ -471,9 +476,11 @@ __FUNCTION__, self->io.fir_base); release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); dev_self[self->index] = NULL; free_netdev(self->netdev); @@ -819,7 +826,7 @@ EnTXDMA(iobase, ON); EnRXDMA(iobase, OFF); - setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, + setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, DMA_TX_MODE); SetSendByte(iobase, self->tx_buff.len); @@ -900,7 +907,8 @@ EnTXDMA(iobase, ON); EnRXDMA(iobase, OFF); setup_dma(self->io.dma, - self->tx_fifo.queue[self->tx_fifo.ptr].start, + ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start - + self->tx_buff.head) + self->tx_buff_dma, self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE); #ifdef DBGMSG DBG(printk @@ -1025,7 +1033,7 @@ EnAllInt(iobase, ON); EnTXDMA(iobase, OFF); EnRXDMA(iobase, ON); - setup_dma(self->io.dma2, self->rx_buff.data, + setup_dma(self->io.dma2, self->rx_buff_dma, self->rx_buff.truesize, DMA_RX_MODE); TXStart(iobase, OFF); RXStart(iobase, ON); Index: kernel-source-2.5/drivers/net/irda/via-ircc.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/via-ircc.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 via-ircc.h --- kernel-source-2.5/drivers/net/irda/via-ircc.h 9 Aug 2003 08:11:57 -0000 1.1.1.1 +++ kernel-source-2.5/drivers/net/irda/via-ircc.h 23 Nov 2003 04:01:15 -0000 @@ -33,6 +33,7 @@ #include #include #include +#include #include #define MAX_TX_WINDOW 7 @@ -102,6 +103,8 @@ chipio_t io; /* IrDA controller information */ iobuff_t tx_buff; /* Transmit buffer */ iobuff_t rx_buff; /* Receive buffer */ + dma_addr_t tx_buff_dma; + dma_addr_t rx_buff_dma; __u8 ier; /* Interrupt enable register */ Index: kernel-source-2.5/drivers/net/irda/w83977af_ir.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/drivers/net/irda/w83977af_ir.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 w83977af_ir.c --- kernel-source-2.5/drivers/net/irda/w83977af_ir.c 8 Oct 2003 19:24:04 -0000 1.1.1.8 +++ kernel-source-2.5/drivers/net/irda/w83977af_ir.c 23 Nov 2003 04:28:34 -0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -209,8 +210,9 @@ self->tx_buff.truesize = 4000; /* Allocate memory if needed */ - self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->rx_buff.head = + dma_alloc_coherent(NULL, self->rx_buff.truesize, + &self->rx_buff_dma, GFP_KERNEL); if (self->rx_buff.head == NULL) { err = -ENOMEM; goto err_out1; @@ -218,8 +220,9 @@ memset(self->rx_buff.head, 0, self->rx_buff.truesize); - self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); + self->tx_buff.head = + dma_alloc_coherent(NULL, self->tx_buff.truesize, + &self->tx_buff_dma, GFP_KERNEL); if (self->tx_buff.head == NULL) { err = -ENOMEM; goto err_out2; @@ -254,9 +257,11 @@ return 0; err_out3: - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); err_out2: - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); err_out1: free_netdev(dev); err_out: @@ -299,10 +304,12 @@ release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) - kfree(self->tx_buff.head); + dma_free_coherent(NULL, self->tx_buff.truesize, + self->tx_buff.head, self->tx_buff_dma); if (self->rx_buff.head) - kfree(self->rx_buff.head); + dma_free_coherent(NULL, self->rx_buff.truesize, + self->rx_buff.head, self->rx_buff_dma); free_netdev(self->netdev); @@ -608,10 +615,10 @@ disable_dma(self->io.dma); clear_dma_ff(self->io.dma); set_dma_mode(self->io.dma, DMA_MODE_READ); - set_dma_addr(self->io.dma, isa_virt_to_bus(self->tx_buff.data)); + set_dma_addr(self->io.dma, self->tx_buff_dma); set_dma_count(self->io.dma, self->tx_buff.len); #else - setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, + setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, DMA_MODE_WRITE); #endif self->io.direction = IO_XMIT; @@ -765,10 +772,10 @@ disable_dma(self->io.dma); clear_dma_ff(self->io.dma); set_dma_mode(self->io.dma, DMA_MODE_READ); - set_dma_addr(self->io.dma, isa_virt_to_bus(self->rx_buff.data)); + set_dma_addr(self->io.dma, self->rx_buff_dma); set_dma_count(self->io.dma, self->rx_buff.truesize); #else - setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, + setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, DMA_MODE_READ); #endif /* --h31gzZEtNLTqOjlF-- From laforge@netfilter.org Sat Nov 22 22:50:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 22:51:08 -0800 (PST) Received: from dagobah.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAN6os25013301 for ; Sat, 22 Nov 2003 22:50:55 -0800 Received: from uucp by dagobah.gnumonks.org with local-bsmtp (Exim 4.22) id 1ANo56-0000H2-7V for netdev@oss.sgi.com; Sun, 23 Nov 2003 07:50:52 +0100 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1ANTfu-0001F2-00; Sat, 22 Nov 2003 10:03:30 +0100 Date: Sat, 22 Nov 2003 10:03:30 +0100 From: Harald Welte To: netdev@oss.sgi.com Cc: Netfilter Development Mailinglist Subject: IPv6 multicast (MLD,IGMP) code bypasses netfilter hooks Message-ID: <20031122090330.GB2745@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , netdev@oss.sgi.com, Netfilter Development Mailinglist Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test9 X-Date: Today is Sweetmorn, the 34th day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 1627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev Content-Length: 1474 Lines: 46 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! At least to me it was not known (until very recently) that the IPv6 multicast code in net/ipv6/mcast.c bypasses the netfilter hooks - but it does. I don't have the time to work on this right now, just wanted to drop a note to netdev that people are aware of this issue. This basically means that you cannot do packet filtering with ip6tables on outgoing MLD packets. If anyone wants to write a patch before I get the time: Feel free to do so. Dave: I think this would be post 2.6.0 stuff, wouldn't it? --=20 - Harald Welte http://www.netfilter.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 "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --gj572EiMnwbLXET9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/vyZhXaXGVTD0i/8RAhXMAJ9HwavVXbQRWHJKDypYudZuQREYjQCgkPUW G76+cbhcjLfrabhJ54YTMLY= =M8kW -----END PGP SIGNATURE----- --gj572EiMnwbLXET9-- From laforge@netfilter.org Sat Nov 22 22:50:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Nov 2003 22:51:08 -0800 (PST) Received: from dagobah.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAN6or25013300 for ; Sat, 22 Nov 2003 22:50:55 -0800 Received: from uucp by dagobah.gnumonks.org with local-bsmtp (Exim 4.22) id 1ANo55-0000Gz-Uf for netdev@oss.sgi.com; Sun, 23 Nov 2003 07:50:51 +0100 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1ANTYb-0001Ee-00; Sat, 22 Nov 2003 09:55:57 +0100 Date: Sat, 22 Nov 2003 09:55:57 +0100 From: Harald Welte To: jamal Cc: Ramon Casellas , mpls-linux-general@sf.net, "David S. Miller" , netdev@oss.sgi.com Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. Message-ID: <20031122085557.GA2745@obroa-skai.de.gnumonks.org> References: <1069125993.1056.39.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <1069125993.1056.39.camel@jzny.localdomain> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test9 X-Date: Today is Sweetmorn, the 34th day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 1628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev Content-Length: 1774 Lines: 47 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 17, 2003 at 10:26:34PM -0500, jamal wrote: > Did you actually talk to James Leu before embarking on this rather > valiant effort? If you did he may have warned you that the code was > being rewritten from scratch. The code rewrite belongs to Dave Miller; > i am adding user space support. James has been invited to look at that > code once it is deemed working. If you want to be on the list as well, > let me know. I am sure you as will James will both have valuable input. now that is interesting. I have a working patch for adding netfilter hooks to the old MPLS stack. If your rewrite doesn't yet have some, I'll gladly add them. I also have a working implementation of the draft-ietf-mpls-lsp-ping-01 based on the netfilter hooks for James Leu's MPLS implementation, btw. > cheers, > jamal --=20 - Harald Welte http://www.netfilter.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 "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/vySdXaXGVTD0i/8RAsRkAKCKaz6vCPFy9lQ9Y/Gifs+CPWGtkgCfbe7N 4dl6fuBLhhKkNCft8ERmkJw= =gadv -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- From greearb@candelatech.com Sun Nov 23 01:02:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 01:03:10 -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 hAN92l25018147 for ; Sun, 23 Nov 2003 01:02:48 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAN92fKt029698; Sun, 23 Nov 2003 01:02:42 -0800 Message-ID: <3FC077B1.1050807@candelatech.com> Date: Sun, 23 Nov 2003 01:02:41 -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: Rask Ingemann Lambertsen CC: "'netdev@oss.sgi.com'" Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? References: <3FB94311.10004@candelatech.com> <20031119123556.A7622@sygehus.dk> <3FBB8D61.6010106@candelatech.com> <20031120173404.A1538@sygehus.dk> In-Reply-To: <20031120173404.A1538@sygehus.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1629 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 Content-Length: 2157 Lines: 46 Rask Ingemann Lambertsen wrote: > On Wed, Nov 19, 2003 at 07:33:53AM -0800, Ben Greear wrote: > >>Rask Ingemann Lambertsen wrote: >> >>>The Intel i82586 and i82596 and can be told to receive frames with a bad FCS. >>>They can also be told to send a precomputed FCS rather than computing it on >>>the fly. The i82596 and tulip can also transfer the FCS to memory when >>>receiving frames. I guess all of this is also supported on the i82557/8/9. >> >>If you have a patch or example code that shows how to do this, I'd love to >>see it. I have code that should RX bad CSUM from the Intel folks, but I can't >>get it to generate bad CRC (it does framing errors instead with my attempt), >>so I can't test the RX code properly! > > > The i825xx Ethernet chips are configured by putting a configure command on > the TX list. One of the bits of the configure command tells the chip to > discard or keep packets with errors. Assuming you can find that piece of > code, flipping the bit is easy enough. Similiarily for transferring the FCS > to/from memory. IIRC, this is a per-frame setting for TX on i82596 and > i82557/8/9. You can find i82596 documentation on Intel's home page and > the i82557/8/9 on SourceForge under the e100 (or was it e1000?) project. Thanks, I found the e100 document (from sourceforge) and it looks like it can definately receive all sorts of busted packets with a little configuration. It's less clear what happens when you turn off the FCS generation. One part of the document mentions it gets it from RAM, which I assume means it uses the last part of the DMA'd packet??? Another explanation of the transmit state machine does not mention that you can disable FCS generation... I'm going to print this out and read it again in detail... I searched Intel's site for the e1000 docs, but could not find any detailed information. Does anyone have a link to a (legal) copy of the e1000 docs? Thanks for the detailed information. When I get the e100 and e1000 working to my satisfaction, I'll work on the tulip driver a bit. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From dlstevens@us.ibm.com Sun Nov 23 03:14:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 03:14:30 -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 hANBE325020907 for ; Sun, 23 Nov 2003 03:14:09 -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 hANBDhcp392814; Sun, 23 Nov 2003 06:13:43 -0500 Received: from d03nm121.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 hANBDfgQ152934; Sun, 23 Nov 2003 04:13:42 -0700 Importance: Normal Sensitivity: Subject: Re: IPv6 multicast (MLD,IGMP) code bypasses netfilter hooks To: Harald Welte , davem@redhat.com Cc: netdev@oss.sgi.com, Netfilter Development Mailinglist X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Sun, 23 Nov 2003 04:13:39 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF92 | October 15, 2003) at 11/23/2003 04:13:42 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE774DFAE8B708f9e8a93df938690918c07BBE774DFAE8B70" Content-Disposition: inline X-archive-position: 1630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 4612 Lines: 107 --0__=07BBE774DFAE8B708f9e8a93df938690918c07BBE774DFAE8B70 Content-type: text/plain; charset=US-ASCII Here's a patch to add netfilter hooks for MLD v1 & v2. Can you take quick look at it, Harald? +-DLS --- linux-2.6.0-test9-bk25/net/ipv6/mcast.c 2003-11-21 19:33:41.000000000 -0800 +++ linux-2.6.0-test9-bk25F1/net/ipv6/mcast.c 2003-11-23 01:32:39.000000000 -0800 @@ -46,6 +46,9 @@ #include #include +#include +#include + #include #include @@ -1265,6 +1268,7 @@ struct mld2_report *pmr = (struct mld2_report *)skb->h.raw; int payload_len, mldlen; struct inet6_dev *idev = in6_dev_get(skb->dev); + int err; payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h - sizeof(struct ipv6hdr); @@ -1273,8 +1277,10 @@ pmr->csum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, IPPROTO_ICMPV6, csum_partial(skb->h.raw, mldlen, 0)); - dev_queue_xmit(skb); - ICMP6_INC_STATS(idev,Icmp6OutMsgs); + err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev, + dev_queue_xmit); + if (!err) + ICMP6_INC_STATS(idev,Icmp6OutMsgs); if (likely(idev != NULL)) in6_dev_put(idev); } @@ -1603,12 +1609,15 @@ idev = in6_dev_get(skb->dev); - dev_queue_xmit(skb); - if (type == ICMPV6_MGM_REDUCTION) - ICMP6_INC_STATS(idev, Icmp6OutGroupMembReductions); - else - ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses); - ICMP6_INC_STATS(idev, Icmp6OutMsgs); + err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev, + dev_queue_xmit); + if (!err) { + if (type == ICMPV6_MGM_REDUCTION) + ICMP6_INC_STATS(idev, Icmp6OutGroupMembReductions); + else + ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses); + ICMP6_INC_STATS(idev, Icmp6OutMsgs); + } if (likely(idev != NULL)) in6_dev_put(idev); (See attached file: MLDNF.patch) --0__=07BBE774DFAE8B708f9e8a93df938690918c07BBE774DFAE8B70 Content-type: application/octet-stream; name="MLDNF.patch" Content-Disposition: attachment; filename="MLDNF.patch" Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4wLXRlc3Q5LWJrMjUvbmV0L2lwdjYvbWNhc3QuYwkyMDAzLTExLTIxIDE5 OjMzOjQxLjAwMDAwMDAwMCAtMDgwMAorKysgbGludXgtMi42LjAtdGVzdDktYmsyNUYxL25ldC9p cHY2L21jYXN0LmMJMjAwMy0xMS0yMyAwMTozMjozOS4wMDAwMDAwMDAgLTA4MDAKQEAgLTQ2LDYg KzQ2LDkgQEAKICNpbmNsdWRlIDxsaW51eC9wcm9jX2ZzLmg+CiAjaW5jbHVkZSA8bGludXgvc2Vx X2ZpbGUuaD4KIAorI2luY2x1ZGUgPGxpbnV4L25ldGZpbHRlci5oPgorI2luY2x1ZGUgPGxpbnV4 L25ldGZpbHRlcl9pcHY2Lmg+CisKICNpbmNsdWRlIDxuZXQvc29jay5oPgogI2luY2x1ZGUgPG5l dC9zbm1wLmg+CiAKQEAgLTEyNjUsNiArMTI2OCw3IEBACiAJc3RydWN0IG1sZDJfcmVwb3J0ICpw bXIgPSAoc3RydWN0IG1sZDJfcmVwb3J0ICopc2tiLT5oLnJhdzsKIAlpbnQgcGF5bG9hZF9sZW4s IG1sZGxlbjsKIAlzdHJ1Y3QgaW5ldDZfZGV2ICppZGV2ID0gaW42X2Rldl9nZXQoc2tiLT5kZXYp OworCWludCBlcnI7CiAKIAlwYXlsb2FkX2xlbiA9IHNrYi0+dGFpbCAtICh1bnNpZ25lZCBjaGFy ICopc2tiLT5uaC5pcHY2aCAtCiAJCXNpemVvZihzdHJ1Y3QgaXB2Nmhkcik7CkBAIC0xMjczLDgg KzEyNzcsMTAgQEAKIAogCXBtci0+Y3N1bSA9IGNzdW1faXB2Nl9tYWdpYygmcGlwNi0+c2FkZHIs ICZwaXA2LT5kYWRkciwgbWxkbGVuLAogCQlJUFBST1RPX0lDTVBWNiwgY3N1bV9wYXJ0aWFsKHNr Yi0+aC5yYXcsIG1sZGxlbiwgMCkpOwotCWRldl9xdWV1ZV94bWl0KHNrYik7Ci0JSUNNUDZfSU5D X1NUQVRTKGlkZXYsSWNtcDZPdXRNc2dzKTsKKwllcnIgPSBORl9IT09LKFBGX0lORVQ2LCBORl9J UDZfTE9DQUxfT1VULCBza2IsIE5VTEwsIHNrYi0+ZGV2LAorCQlkZXZfcXVldWVfeG1pdCk7CisJ aWYgKCFlcnIpCisJCUlDTVA2X0lOQ19TVEFUUyhpZGV2LEljbXA2T3V0TXNncyk7CiAJaWYgKGxp a2VseShpZGV2ICE9IE5VTEwpKQogCQlpbjZfZGV2X3B1dChpZGV2KTsKIH0KQEAgLTE2MDMsMTIg KzE2MDksMTUgQEAKIAogCWlkZXYgPSBpbjZfZGV2X2dldChza2ItPmRldik7CiAKLQlkZXZfcXVl dWVfeG1pdChza2IpOwotCWlmICh0eXBlID09IElDTVBWNl9NR01fUkVEVUNUSU9OKQotCQlJQ01Q Nl9JTkNfU1RBVFMoaWRldiwgSWNtcDZPdXRHcm91cE1lbWJSZWR1Y3Rpb25zKTsKLQllbHNlCi0J CUlDTVA2X0lOQ19TVEFUUyhpZGV2LCBJY21wNk91dEdyb3VwTWVtYlJlc3BvbnNlcyk7Ci0JSUNN UDZfSU5DX1NUQVRTKGlkZXYsIEljbXA2T3V0TXNncyk7CisJZXJyID0gTkZfSE9PSyhQRl9JTkVU NiwgTkZfSVA2X0xPQ0FMX09VVCwgc2tiLCBOVUxMLCBza2ItPmRldiwKKwkJZGV2X3F1ZXVlX3ht aXQpOworCWlmICghZXJyKSB7CisJCWlmICh0eXBlID09IElDTVBWNl9NR01fUkVEVUNUSU9OKQor CQkJSUNNUDZfSU5DX1NUQVRTKGlkZXYsIEljbXA2T3V0R3JvdXBNZW1iUmVkdWN0aW9ucyk7CisJ CWVsc2UKKwkJCUlDTVA2X0lOQ19TVEFUUyhpZGV2LCBJY21wNk91dEdyb3VwTWVtYlJlc3BvbnNl cyk7CisJCUlDTVA2X0lOQ19TVEFUUyhpZGV2LCBJY21wNk91dE1zZ3MpOworCX0KIAogCWlmIChs aWtlbHkoaWRldiAhPSBOVUxMKSkKIAkJaW42X2Rldl9wdXQoaWRldik7Cg== --0__=07BBE774DFAE8B708f9e8a93df938690918c07BBE774DFAE8B70-- From casellas@infres.enst.fr Sun Nov 23 05:40:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 05:40:39 -0800 (PST) Received: from infres.enst.fr (infres.enst.fr [137.194.192.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hANDe525030220 for ; Sun, 23 Nov 2003 05:40:06 -0800 Received: from gervaise.enst.fr (gervaise.enst.fr [137.194.160.71]) by infres.enst.fr (Postfix) with ESMTP id 49DF21A7A; Sun, 23 Nov 2003 14:13:56 +0100 (MET) Received: from localhost (casellas@localhost) by gervaise.enst.fr (8.11.6+Sun/8.11.6) with ESMTP id hANDDsM08371; Sun, 23 Nov 2003 14:13:54 +0100 (MET) X-Authentication-Warning: gervaise.enst.fr: casellas owned process doing -bs Date: Sun, 23 Nov 2003 14:13:54 +0100 (MET) From: Ramon Casellas X-X-Sender: casellas@gervaise.enst.fr To: Harald Welte Cc: jamal , , "David S. Miller" , , Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. In-Reply-To: <20031122085557.GA2745@obroa-skai.de.gnumonks.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: casellas@infres.enst.fr Precedence: bulk X-list: netdev Content-Length: 2029 Lines: 54 On Sat, 22 Nov 2003, Harald Welte wrote: > now that is interesting. I have a working patch for adding netfilter > hooks to the old MPLS stack. If your rewrite doesn't yet have some, > I'll gladly add them. > > I also have a working implementation of the draft-ietf-mpls-lsp-ping-01 > based on the netfilter hooks for James Leu's MPLS implementation, btw. Hi Harald, Thanks for your anwser. Some details: * Jamal and Dave are working on something. As soon as they release the code we can get a whole picture of the state of the project. I don't know the extent of their rewrite. Maybe jamal and/or Dave can give us an overview of their changes. We'll see. * In the meantime, we are syncing efforts with James. Right know we have a patch that applies to test9. It has mostly been a RFC (Rewrite, Format and Comment). What I did was: - Format the existing code, add comments for each function, start documenting, clean up unneeded local variables, conform to C90 - Rewrite the procfs implementation to use seq_files (I've tested a little and works) - Clean up the "tunnel" module. it compiles, boots and the entries are created in /proc/net/mpls/* * Your netfilter and LSP Ping impl. patch would be must welcome. IIRC correctly, James was also working on netfilter (I haven't, so I CC'ed him here). James, can you give us an overview of that? * I'm waiting (should come in some days) for James to commit my latest changes to the P4 repository. * CVS and sourceforge releases are out of date. We have two possibilities: either you set up a p4 client and wait for James commit, or I can provide you with a unified diff for 2.6.0-test9 using my private copy. However, I would be glad to take a look at your patches, even if they apply to the old code. Best regards // ------------------------------------------------------------------- // Ramon Casellas - GET/ENST/INFRES/RHD/A508 - casellas@infres.enst.fr // 37/39 rue Dareau 75014 Paris -- http://perso.enst.fr/~casellas From hadi@cyberus.ca Sun Nov 23 07:28:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 07:29:05 -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 hANFSj25031499 for ; Sun, 23 Nov 2003 07:28:46 -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 1ANwAF-0005Fq-3k; Sun, 23 Nov 2003 10:28:43 -0500 Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. From: jamal Reply-To: hadi@cyberus.ca To: Ramon Casellas Cc: Harald Welte , mpls-linux-general@lists.sourceforge.net, "David S. Miller" , netdev@oss.sgi.com, jleu@mindspring.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1069601291.1055.2663.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 23 Nov 2003 10:28:11 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1632 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 Content-Length: 2924 Lines: 78 Not sure if i wanna see another xxtable or netfilter hook in there just so we can do an LSP ping. I have some ideas, so I dont wanna see the patch incase it influences me; lets discuss later and if it turns out netfilter is the better way to go then we will take that path. Heres what i will do: I am going to write a design description since there is enough interest. The discussion belongs to a small list of interested people not netdev. Anyone willing to create a small mailing list? Make sure you subscribe DaveM. This way i can ask for help from people to do coding instead of being the bottleneck. cheers, jamal I am gonna start working on the doc about _NOW_ ; i should have something late today or early tommorow. On Sun, 2003-11-23 at 08:13, Ramon Casellas wrote: > On Sat, 22 Nov 2003, Harald Welte wrote: > > > now that is interesting. I have a working patch for adding netfilter > > hooks to the old MPLS stack. If your rewrite doesn't yet have some, > > I'll gladly add them. > > > > I also have a working implementation of the draft-ietf-mpls-lsp-ping-01 > > based on the netfilter hooks for James Leu's MPLS implementation, btw. > > Hi Harald, > > Thanks for your anwser. > > Some details: > > * Jamal and Dave are working on something. As soon as they release the > code we can get a whole picture of the state of the project. I don't know > the extent of their rewrite. Maybe jamal and/or Dave can give us an > overview of their changes. We'll see. > > * In the meantime, we are syncing efforts with James. Right know we have a > patch that applies to test9. It has mostly been a RFC (Rewrite, Format and > Comment). What I did was: > - Format the existing code, add comments for each function, start > documenting, clean up unneeded local variables, conform to C90 > - Rewrite the procfs implementation to use seq_files (I've tested a > little and works) > - Clean up the "tunnel" module. > it compiles, boots and the entries are created in /proc/net/mpls/* > > * Your netfilter and LSP Ping impl. patch would be must welcome. IIRC > correctly, James was also working on netfilter (I haven't, so I CC'ed him > here). James, can you give us an overview of that? > > * I'm waiting (should come in some days) for James to commit my latest > changes to the P4 repository. > > * CVS and sourceforge releases are out of date. We have two > possibilities: either you set up a p4 client and wait for James commit, or > I can provide you with a unified diff for 2.6.0-test9 using my private > copy. > > However, I would be glad to take a look at your patches, even if they > apply to the old code. > > Best regards > > > > // ------------------------------------------------------------------- > // Ramon Casellas - GET/ENST/INFRES/RHD/A508 - casellas@infres.enst.fr > // 37/39 rue Dareau 75014 Paris -- http://perso.enst.fr/~casellas > > > > From jleu@mindspring.com Sun Nov 23 08:15:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 08:15:55 -0800 (PST) Received: from localhost.localdomain ([192.203.120.89]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hANGFC25032209 for ; Sun, 23 Nov 2003 08:15:33 -0800 Received: from localhost.localdomain (jleu-laptop [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id hANGDSsH025070; Sun, 23 Nov 2003 10:13:28 -0600 Received: (from jleu@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id hANGDK6r025068; Sun, 23 Nov 2003 10:13:20 -0600 X-Authentication-Warning: localhost.localdomain: jleu set sender to jleu@mindspring.com using -f Date: Sun, 23 Nov 2003 10:13:19 -0600 From: "James R. Leu" To: jamal Cc: Ramon Casellas , Harald Welte , mpls-linux-general@lists.sourceforge.net, "David S. Miller" , netdev@oss.sgi.com Subject: Re: [ANNOUNCE] Porting MPLS-Linux to 2.6 (2.6.0-test9-bk22) comments welcome. Message-ID: <20031123161254.GE22638@mindspring.com> Reply-To: jleu@mindspring.com References: <1069601291.1055.2663.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1069601291.1055.2663.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-archive-position: 1633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jleu@mindspring.com Precedence: bulk X-list: netdev Content-Length: 3247 Lines: 84 I can start a 'mpls-linux-devel' mailing list over at SF if you would like. On Sun, Nov 23, 2003 at 10:28:11AM -0500, jamal wrote: > > Not sure if i wanna see another xxtable or netfilter hook in there just > so we can do an LSP ping. I have some ideas, so I dont wanna see the > patch incase it influences me; lets discuss later and if it turns out > netfilter is the better way to go then we will take that path. > Heres what i will do: I am going to write a design description since > there is enough interest. > The discussion belongs to a small list of interested people not netdev. > Anyone willing to create a small mailing list? Make sure you subscribe > DaveM. > This way i can ask for help from people to do coding instead of being > the bottleneck. > > cheers, > jamal > > I am gonna start working on the doc about _NOW_ ; i should have > something late today or early tommorow. > > > On Sun, 2003-11-23 at 08:13, Ramon Casellas wrote: > > On Sat, 22 Nov 2003, Harald Welte wrote: > > > > > now that is interesting. I have a working patch for adding netfilter > > > hooks to the old MPLS stack. If your rewrite doesn't yet have some, > > > I'll gladly add them. > > > > > > I also have a working implementation of the draft-ietf-mpls-lsp-ping-01 > > > based on the netfilter hooks for James Leu's MPLS implementation, btw. > > > > Hi Harald, > > > > Thanks for your anwser. > > > > Some details: > > > > * Jamal and Dave are working on something. As soon as they release the > > code we can get a whole picture of the state of the project. I don't know > > the extent of their rewrite. Maybe jamal and/or Dave can give us an > > overview of their changes. We'll see. > > > > * In the meantime, we are syncing efforts with James. Right know we have a > > patch that applies to test9. It has mostly been a RFC (Rewrite, Format and > > Comment). What I did was: > > - Format the existing code, add comments for each function, start > > documenting, clean up unneeded local variables, conform to C90 > > - Rewrite the procfs implementation to use seq_files (I've tested a > > little and works) > > - Clean up the "tunnel" module. > > it compiles, boots and the entries are created in /proc/net/mpls/* > > > > * Your netfilter and LSP Ping impl. patch would be must welcome. IIRC > > correctly, James was also working on netfilter (I haven't, so I CC'ed him > > here). James, can you give us an overview of that? > > > > * I'm waiting (should come in some days) for James to commit my latest > > changes to the P4 repository. > > > > * CVS and sourceforge releases are out of date. We have two > > possibilities: either you set up a p4 client and wait for James commit, or > > I can provide you with a unified diff for 2.6.0-test9 using my private > > copy. > > > > However, I would be glad to take a look at your patches, even if they > > apply to the old code. > > > > Best regards > > > > > > > > // ------------------------------------------------------------------- > > // Ramon Casellas - GET/ENST/INFRES/RHD/A508 - casellas@infres.enst.fr > > // 37/39 rue Dareau 75014 Paris -- http://perso.enst.fr/~casellas > > > > > > > > -- James R. Leu jleu@mindspring.com From garzik@gtf.org Sun Nov 23 09:36:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 09:37:04 -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 hANHak25003606 for ; Sun, 23 Nov 2003 09:36:49 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id D4D35660C; Sun, 23 Nov 2003 12:36:11 -0500 (EST) Date: Sun, 23 Nov 2003 12:36:11 -0500 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com Subject: [BK PATCH] fix oopsable net driver bug Message-ID: <20031123173611.GA27637@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: 1634 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 Content-Length: 792 Lines: 34 dev_kfree_skb, unlike kfree, will oops if passed NULL... and it might be passed NULL in this case, if skb_padto() returns NULL. Linus, please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.5 This will update the following files: drivers/net/sis190.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) through these ChangeSets: (03/11/20 1.1478) [netdrvr sis190] fix oopsable bug in TX path, related to skb_padto return Caught by Francois Romieu. diff -Nru a/drivers/net/sis190.c b/drivers/net/sis190.c --- a/drivers/net/sis190.c Sun Nov 23 12:34:07 2003 +++ b/drivers/net/sis190.c Sun Nov 23 12:34:07 2003 @@ -949,7 +949,8 @@ drop_tx: tp->stats.tx_dropped++; - dev_kfree_skb(skb); + if (skb) + dev_kfree_skb(skb); return 0; } From rask@sygehus.dk Sun Nov 23 12:30:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 12:30:36 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hANKU125012842 for ; Sun, 23 Nov 2003 12:30:22 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 674113E9C; Sun, 23 Nov 2003 21:29:59 +0100 (CET) Date: Sun, 23 Nov 2003 21:29:59 +0100 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: Kernel crash in 2.6.0-test9-mm3 Message-ID: <20031123212959.D1461@sygehus.dk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from scott.feldman@intel.com on Wed, Nov 19, 2003 at 06:40:04PM -0800 X-archive-position: 1635 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 Content-Length: 1012 Lines: 22 On Wed, Nov 19, 2003 at 06:40:04PM -0800, Feldman, Scott wrote: > > However, with things like IOAPIC and such, it might be > > possible for two cpus to enter e100intr() simultaneously, > > both read the same status, both see that the interrupt is > > pending, and both thus process the interrupt and race with each other. > > > > Scott, what prevents the above from happening? > > Whoa, this question is freaking me out just a little bit: my assumption > is that the device's interrupt line has been masked off at the CPU/PIC > before e100intr() is ever called, so 1) there really isn't any need to > disable device's interrupts from the driver (see eepro100.c), 2) or even > hold a lock unless we shared something critical on the queuing side (see > e1000), and 3) only one e100intr is running. [public spanking in > order?] Me too. My impression is also that the kernel guarantees that the interrupt handler is single threaded, regardless of IOAPIC, SMP and such. -- Regards, Rask Ingemann Lambertsen From romieu@fr.zoreil.com Sun Nov 23 15:13:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 15:14:11 -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 hANNDt25014837 for ; Sun, 23 Nov 2003 15:13:56 -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 hANN9eK7000890; Mon, 24 Nov 2003 00:09:40 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hANN9d8u000889; Mon, 24 Nov 2003 00:09:39 +0100 Date: Mon, 24 Nov 2003 00:09:39 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik , brad_mssw@gentoo.org Subject: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031124000939.A456@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031122183001.GA16993@gtf.org>; from jgarzik@pobox.com on Sat, Nov 22, 2003 at 01:30:01PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1636 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 Content-Length: 8069 Lines: 283 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jeff Garzik : [...] > * r8169 stuff from Francois First round of merge of Brad/Realtek's stuff. Applies on top of bk27 + bk25-netdrvr-exp1. -- Ueimor --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-mac-phy-version.patch" Add {mac/phy}_version. - change of identification logic in rtl8169_init_board(); - {chip/rtl_chip}_info are merged in rtl_chip_info; - misc style nits (lazy braces, SHOUTING MACROS from realtek converted to functions). drivers/net/r8169.c | 177 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 140 insertions(+), 37 deletions(-) diff -puN drivers/net/r8169.c~r8169-mac-phy-version drivers/net/r8169.c --- linux-2.6.0-test9-bk27-netdrvr-exp1/drivers/net/r8169.c~r8169-mac-phy-version 2003-11-24 00:07:21.000000000 +0100 +++ linux-2.6.0-test9-bk27-netdrvr-exp1-fr/drivers/net/r8169.c 2003-11-24 00:07:21.000000000 +0100 @@ -56,9 +56,11 @@ VERSION 1.2 <2002/11/30> printk( "Assertion failed! %s,%s,%s,line=%d\n", \ #expr,__FILE__,__FUNCTION__,__LINE__); \ } +#define dprintk(fmt, args...) do { printk(PFX fmt, ## args) } while (0) #else #define assert(expr) do {} while (0) -#endif +#define dprintk(fmt, args...) do {} while (0) +#endif /* RTL8169_DEBUG */ /* media options */ #define MAX_UNITS 8 @@ -103,11 +105,35 @@ static int multicast_filter_limit = 32; #define RTL_R16(reg) readw (ioaddr + (reg)) #define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg))) -static struct { +enum mac_version { + RTL_GIGA_MAC_VER_B = 0x00, + /* RTL_GIGA_MAC_VER_C = 0x03, */ + RTL_GIGA_MAC_VER_D = 0x01, + RTL_GIGA_MAC_VER_E = 0x02 +}; + +enum phy_version { + RTL_GIGA_PHY_VER_C = 0x03, /* PHY Reg 0x03 bit0-3 == 0x0000 */ + RTL_GIGA_PHY_VER_D = 0x04, /* PHY Reg 0x03 bit0-3 == 0x0000 */ + RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */ + RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */ + RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */ +}; + + +#define _R(NAME,MAC,MASK) \ + { .name = NAME, .mac_version = MAC, .RxConfigMask = MASK } + +const static struct { const char *name; -} board_info[] __devinitdata = { - { -"RealTek RTL8169 Gigabit Ethernet"},}; + u8 mac_version; + u32 RxConfigMask; /* Clears the bits supported by this chip */ +} rtl_chip_info[] __devinitdata = { + _R("RTL8169", RTL_GIGA_MAC_VER_B, 0xff7e1880), + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_D, 0xff7e1880), + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880) +}; +#undef _R static struct pci_device_id rtl8169_pci_tbl[] = { {0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, @@ -246,14 +272,6 @@ enum RTL8169_register_content { TBILinkOK = 0x02000000, }; -const static struct { - const char *name; - u8 version; /* depend on RTL8169 docs */ - u32 RxConfigMask; /* should clear the bits supported by this chip */ -} rtl_chip_info[] = { - { -"RTL-8169", 0x00, 0xff7e1880,},}; - enum _DescStatusBit { OWNbit = 0x80000000, EORbit = 0x40000000, @@ -281,6 +299,8 @@ struct rtl8169_private { struct net_device_stats stats; /* statistics of net device */ spinlock_t lock; /* spin lock flag */ int chipset; + int mac_version; + int phy_version; u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ u32 dirty_rx; @@ -347,13 +367,95 @@ mdio_read(void *ioaddr, int RegAddr) if (RTL_R32(PHYAR) & 0x80000000) { value = (int) (RTL_R32(PHYAR) & 0xFFFF); break; - } else { - udelay(100); } + udelay(100); } return value; } +static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) +{ + const struct { + u32 mask; + int mac_version; + } mac_info[] = { + { 0x1 << 26, RTL_GIGA_MAC_VER_E }, + { 0x1 << 23, RTL_GIGA_MAC_VER_D }, + { 0x00000000, RTL_GIGA_MAC_VER_B } /* Catch-all */ + }, *p = mac_info; + u32 reg; + + reg = RTL_R32(TxConfig) & 0x7c800000; + while ((reg & p->mask) != p->mask) + p++; + tp->mac_version = p->mac_version; +} + +static void rtl8169_print_mac_version(struct rtl8169_private *tp) +{ + struct { + int version; + char *msg; + } mac_print[] = { + { RTL_GIGA_MAC_VER_E, "RTL_GIGA_MAC_VER_E" }, + { RTL_GIGA_MAC_VER_D, "RTL_GIGA_MAC_VER_D" }, + { RTL_GIGA_MAC_VER_B, "RTL_GIGA_MAC_VER_B" }, + { 0, NULL } + }, *p; + + for (p = mac_print; p->msg; p++) { + if (tp->mac_version == p->version) { + dprintk("mac_version == %s (%04d)\n", p->msg, + p->version); + return; + } + } + dprintk("mac_version == Unknown\n"); +} + +static void rtl8169_get_phy_version(struct rtl8169_private *tp, void *ioaddr) +{ + const struct { + u16 mask; + u16 set; + int phy_version; + } phy_info[] = { + { 0x000f, 0x0002, RTL_GIGA_PHY_VER_G }, + { 0x000f, 0x0001, RTL_GIGA_PHY_VER_F }, + { 0x000f, 0x0000, RTL_GIGA_PHY_VER_E }, + { 0x0000, 0x0000, RTL_GIGA_PHY_VER_D } /* Catch-all */ + }, *p = phy_info; + u16 reg; + + reg = mdio_read(ioaddr, 3) & 0xffff; + while ((reg & p->mask) != p->set) + p++; + tp->phy_version = p->phy_version; +} + +static void rtl8169_print_phy_version(struct rtl8169_private *tp) +{ + struct { + int version; + char *msg; + u32 reg; + } phy_print[] = { + { RTL_GIGA_PHY_VER_G, "RTL_GIGA_PHY_VER_G", 0x0002 }, + { RTL_GIGA_PHY_VER_F, "RTL_GIGA_PHY_VER_F", 0x0001 }, + { RTL_GIGA_PHY_VER_E, "RTL_GIGA_PHY_VER_E", 0x0000 }, + { RTL_GIGA_PHY_VER_D, "RTL_GIGA_PHY_VER_D", 0x0000 }, + { 0, NULL, 0x0000 } + }, *p; + + for (p = phy_print; p->msg; p++) { + if (tp->phy_version == p->version) { + dprintk("phy_version == %s (%04x)\n", p->msg, p->reg); + return; + } + } + dprintk("phy_version == Unknown\n"); +} + static int __devinit rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, void **ioaddr_out) @@ -363,7 +465,6 @@ rtl8169_init_board(struct pci_dev *pdev, struct rtl8169_private *tp; int rc, i; unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; - u32 tmp; assert(pdev != NULL); assert(ioaddr_out != NULL); @@ -425,30 +526,32 @@ rtl8169_init_board(struct pci_dev *pdev, RTL_W8(ChipCmd, CmdReset); // Check that the chip has finished the reset. - for (i = 1000; i > 0; i--) + for (i = 1000; i > 0; i--) { if ((RTL_R8(ChipCmd) & CmdReset) == 0) break; - else - udelay(10); + udelay(10); + } - // identify chip attached to board - tmp = RTL_R32(TxConfig); - tmp = ((tmp & 0x7c000000) + ((tmp & 0x00800000) << 2)) >> 24; - - for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) - if (tmp == rtl_chip_info[i].version) { - tp->chipset = i; - goto match; - } - //if unknown chip, assume array element #0, original RTL-8169 in this case - printk(KERN_DEBUG PFX - "PCI device %s: unknown chip version, assuming RTL-8169\n", - pci_name(pdev)); - printk(KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", - pci_name(pdev), (unsigned long) RTL_R32(TxConfig)); - tp->chipset = 0; + // Identify chip attached to board + rtl8169_get_mac_version(tp, ioaddr); + rtl8169_get_phy_version(tp, ioaddr); + + rtl8169_print_mac_version(tp); + rtl8169_print_phy_version(tp); + + for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) { + if (tp->mac_version == rtl_chip_info[i].mac_version) + break; + } + if (i < 0) { + /* Unknown chip: assume array element #0, original RTL-8169 */ + printk(KERN_DEBUG PFX + "PCI device %s: unknown chip version, assuming %s\n", + pci_name(pdev), rtl_chip_info[0].name); + i++; + } + tp->chipset = i; -match: *ioaddr_out = ioaddr; *dev_out = dev; return 0; @@ -533,7 +636,7 @@ rtl8169_init_one(struct pci_dev *pdev, c "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " "IRQ %d\n", dev->name, - board_info[ent->driver_data].name, + rtl_chip_info[ent->driver_data].name, dev->base_addr, dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], dev->dev_addr[3], _ --ReaqsoxgOBHFXBhH-- From brad@mcve.com Sun Nov 23 15:18:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 15:19:10 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hANNIu25015219 for ; Sun, 23 Nov 2003 15:18:56 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 08BAF85774; Sun, 23 Nov 2003 18:32:25 -0500 (EST) Message-ID: <3FC14058.4010600@mcve.com> Date: Sun, 23 Nov 2003 18:18:48 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Jeff Garzik , brad_mssw@gentoo.org Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> In-Reply-To: <20031124000939.A456@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1637 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Content-Length: 8661 Lines: 287 cool. Did those previous patches you posted get merged into the current netdrvr-exp1, or do those need to be applied as well ? I'm going to see if I can test this out tonight... -Brad Francois Romieu wrote: > Jeff Garzik : > [...] > >>* r8169 stuff from Francois > > > First round of merge of Brad/Realtek's stuff. > > Applies on top of bk27 + bk25-netdrvr-exp1. > > -- > Ueimor > > > ------------------------------------------------------------------------ > > > Add {mac/phy}_version. > - change of identification logic in rtl8169_init_board(); > - {chip/rtl_chip}_info are merged in rtl_chip_info; > - misc style nits (lazy braces, SHOUTING MACROS from realtek converted to > functions). > > > drivers/net/r8169.c | 177 +++++++++++++++++++++++++++++++++++++++++----------- > 1 files changed, 140 insertions(+), 37 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-mac-phy-version drivers/net/r8169.c > --- linux-2.6.0-test9-bk27-netdrvr-exp1/drivers/net/r8169.c~r8169-mac-phy-version 2003-11-24 00:07:21.000000000 +0100 > +++ linux-2.6.0-test9-bk27-netdrvr-exp1-fr/drivers/net/r8169.c 2003-11-24 00:07:21.000000000 +0100 > @@ -56,9 +56,11 @@ VERSION 1.2 <2002/11/30> > printk( "Assertion failed! %s,%s,%s,line=%d\n", \ > #expr,__FILE__,__FUNCTION__,__LINE__); \ > } > +#define dprintk(fmt, args...) do { printk(PFX fmt, ## args) } while (0) > #else > #define assert(expr) do {} while (0) > -#endif > +#define dprintk(fmt, args...) do {} while (0) > +#endif /* RTL8169_DEBUG */ > > /* media options */ > #define MAX_UNITS 8 > @@ -103,11 +105,35 @@ static int multicast_filter_limit = 32; > #define RTL_R16(reg) readw (ioaddr + (reg)) > #define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg))) > > -static struct { > +enum mac_version { > + RTL_GIGA_MAC_VER_B = 0x00, > + /* RTL_GIGA_MAC_VER_C = 0x03, */ > + RTL_GIGA_MAC_VER_D = 0x01, > + RTL_GIGA_MAC_VER_E = 0x02 > +}; > + > +enum phy_version { > + RTL_GIGA_PHY_VER_C = 0x03, /* PHY Reg 0x03 bit0-3 == 0x0000 */ > + RTL_GIGA_PHY_VER_D = 0x04, /* PHY Reg 0x03 bit0-3 == 0x0000 */ > + RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */ > + RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */ > + RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */ > +}; > + > + > +#define _R(NAME,MAC,MASK) \ > + { .name = NAME, .mac_version = MAC, .RxConfigMask = MASK } > + > +const static struct { > const char *name; > -} board_info[] __devinitdata = { > - { > -"RealTek RTL8169 Gigabit Ethernet"},}; > + u8 mac_version; > + u32 RxConfigMask; /* Clears the bits supported by this chip */ > +} rtl_chip_info[] __devinitdata = { > + _R("RTL8169", RTL_GIGA_MAC_VER_B, 0xff7e1880), > + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_D, 0xff7e1880), > + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880) > +}; > +#undef _R > > static struct pci_device_id rtl8169_pci_tbl[] = { > {0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, > @@ -246,14 +272,6 @@ enum RTL8169_register_content { > TBILinkOK = 0x02000000, > }; > > -const static struct { > - const char *name; > - u8 version; /* depend on RTL8169 docs */ > - u32 RxConfigMask; /* should clear the bits supported by this chip */ > -} rtl_chip_info[] = { > - { > -"RTL-8169", 0x00, 0xff7e1880,},}; > - > enum _DescStatusBit { > OWNbit = 0x80000000, > EORbit = 0x40000000, > @@ -281,6 +299,8 @@ struct rtl8169_private { > struct net_device_stats stats; /* statistics of net device */ > spinlock_t lock; /* spin lock flag */ > int chipset; > + int mac_version; > + int phy_version; > u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ > u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ > u32 dirty_rx; > @@ -347,13 +367,95 @@ mdio_read(void *ioaddr, int RegAddr) > if (RTL_R32(PHYAR) & 0x80000000) { > value = (int) (RTL_R32(PHYAR) & 0xFFFF); > break; > - } else { > - udelay(100); > } > + udelay(100); > } > return value; > } > > +static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) > +{ > + const struct { > + u32 mask; > + int mac_version; > + } mac_info[] = { > + { 0x1 << 26, RTL_GIGA_MAC_VER_E }, > + { 0x1 << 23, RTL_GIGA_MAC_VER_D }, > + { 0x00000000, RTL_GIGA_MAC_VER_B } /* Catch-all */ > + }, *p = mac_info; > + u32 reg; > + > + reg = RTL_R32(TxConfig) & 0x7c800000; > + while ((reg & p->mask) != p->mask) > + p++; > + tp->mac_version = p->mac_version; > +} > + > +static void rtl8169_print_mac_version(struct rtl8169_private *tp) > +{ > + struct { > + int version; > + char *msg; > + } mac_print[] = { > + { RTL_GIGA_MAC_VER_E, "RTL_GIGA_MAC_VER_E" }, > + { RTL_GIGA_MAC_VER_D, "RTL_GIGA_MAC_VER_D" }, > + { RTL_GIGA_MAC_VER_B, "RTL_GIGA_MAC_VER_B" }, > + { 0, NULL } > + }, *p; > + > + for (p = mac_print; p->msg; p++) { > + if (tp->mac_version == p->version) { > + dprintk("mac_version == %s (%04d)\n", p->msg, > + p->version); > + return; > + } > + } > + dprintk("mac_version == Unknown\n"); > +} > + > +static void rtl8169_get_phy_version(struct rtl8169_private *tp, void *ioaddr) > +{ > + const struct { > + u16 mask; > + u16 set; > + int phy_version; > + } phy_info[] = { > + { 0x000f, 0x0002, RTL_GIGA_PHY_VER_G }, > + { 0x000f, 0x0001, RTL_GIGA_PHY_VER_F }, > + { 0x000f, 0x0000, RTL_GIGA_PHY_VER_E }, > + { 0x0000, 0x0000, RTL_GIGA_PHY_VER_D } /* Catch-all */ > + }, *p = phy_info; > + u16 reg; > + > + reg = mdio_read(ioaddr, 3) & 0xffff; > + while ((reg & p->mask) != p->set) > + p++; > + tp->phy_version = p->phy_version; > +} > + > +static void rtl8169_print_phy_version(struct rtl8169_private *tp) > +{ > + struct { > + int version; > + char *msg; > + u32 reg; > + } phy_print[] = { > + { RTL_GIGA_PHY_VER_G, "RTL_GIGA_PHY_VER_G", 0x0002 }, > + { RTL_GIGA_PHY_VER_F, "RTL_GIGA_PHY_VER_F", 0x0001 }, > + { RTL_GIGA_PHY_VER_E, "RTL_GIGA_PHY_VER_E", 0x0000 }, > + { RTL_GIGA_PHY_VER_D, "RTL_GIGA_PHY_VER_D", 0x0000 }, > + { 0, NULL, 0x0000 } > + }, *p; > + > + for (p = phy_print; p->msg; p++) { > + if (tp->phy_version == p->version) { > + dprintk("phy_version == %s (%04x)\n", p->msg, p->reg); > + return; > + } > + } > + dprintk("phy_version == Unknown\n"); > +} > + > static int __devinit > rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, > void **ioaddr_out) > @@ -363,7 +465,6 @@ rtl8169_init_board(struct pci_dev *pdev, > struct rtl8169_private *tp; > int rc, i; > unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; > - u32 tmp; > > assert(pdev != NULL); > assert(ioaddr_out != NULL); > @@ -425,30 +526,32 @@ rtl8169_init_board(struct pci_dev *pdev, > RTL_W8(ChipCmd, CmdReset); > > // Check that the chip has finished the reset. > - for (i = 1000; i > 0; i--) > + for (i = 1000; i > 0; i--) { > if ((RTL_R8(ChipCmd) & CmdReset) == 0) > break; > - else > - udelay(10); > + udelay(10); > + } > > - // identify chip attached to board > - tmp = RTL_R32(TxConfig); > - tmp = ((tmp & 0x7c000000) + ((tmp & 0x00800000) << 2)) >> 24; > - > - for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) > - if (tmp == rtl_chip_info[i].version) { > - tp->chipset = i; > - goto match; > - } > - //if unknown chip, assume array element #0, original RTL-8169 in this case > - printk(KERN_DEBUG PFX > - "PCI device %s: unknown chip version, assuming RTL-8169\n", > - pci_name(pdev)); > - printk(KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", > - pci_name(pdev), (unsigned long) RTL_R32(TxConfig)); > - tp->chipset = 0; > + // Identify chip attached to board > + rtl8169_get_mac_version(tp, ioaddr); > + rtl8169_get_phy_version(tp, ioaddr); > + > + rtl8169_print_mac_version(tp); > + rtl8169_print_phy_version(tp); > + > + for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) { > + if (tp->mac_version == rtl_chip_info[i].mac_version) > + break; > + } > + if (i < 0) { > + /* Unknown chip: assume array element #0, original RTL-8169 */ > + printk(KERN_DEBUG PFX > + "PCI device %s: unknown chip version, assuming %s\n", > + pci_name(pdev), rtl_chip_info[0].name); > + i++; > + } > + tp->chipset = i; > > -match: > *ioaddr_out = ioaddr; > *dev_out = dev; > return 0; > @@ -533,7 +636,7 @@ rtl8169_init_one(struct pci_dev *pdev, c > "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " > "IRQ %d\n", > dev->name, > - board_info[ent->driver_data].name, > + rtl_chip_info[ent->driver_data].name, > dev->base_addr, > dev->dev_addr[0], dev->dev_addr[1], > dev->dev_addr[2], dev->dev_addr[3], > > _ From davem@pizda.ninka.net Sun Nov 23 15:26:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 15:26:34 -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 hANNQL25015684 for ; Sun, 23 Nov 2003 15:26:21 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA02953; Sun, 23 Nov 2003 15:26:01 -0800 Date: Sun, 23 Nov 2003 15:26:01 -0800 From: "David S. Miller" To: Linus Torvalds Cc: anand@eis.iisc.ernet.in, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.0-test9 : bridge freezes Message-Id: <20031123152601.67646dc1.davem@redhat.com> In-Reply-To: References: <200311221527.UAA29684@eis.iisc.ernet.in> 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: 1638 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: 553 Lines: 14 On Sat, 22 Nov 2003 08:20:40 -0800 (PST) Linus Torvalds wrote: > On Sat, 22 Nov 2003, SVR Anand wrote: > > > > The problem is : After 3 to 4 hours of functioning, the bridge stops working > > and the machine becomes unusable where it doesn't respond to keyboard, and > > there is no video display. > > Sounds like a memory leak somewhere. It would probably be interesting to > watch /proc/slabinfo every five minutes or so, and see what happens.. Also, we've certainly fixed some serious networking bugs since test9 came out. From davem@pizda.ninka.net Sun Nov 23 15:44:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 15:44: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 hANNiD25016202 for ; Sun, 23 Nov 2003 15:44:13 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA02986; Sun, 23 Nov 2003 15:43:44 -0800 Date: Sun, 23 Nov 2003 15:43:44 -0800 From: "David S. Miller" To: Harald Welte Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: IPv6 multicast (MLD,IGMP) code bypasses netfilter hooks Message-Id: <20031123154344.3e2b0b1a.davem@redhat.com> In-Reply-To: <20031122090330.GB2745@obroa-skai.de.gnumonks.org> References: <20031122090330.GB2745@obroa-skai.de.gnumonks.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: 1640 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: 456 Lines: 15 On Sat, 22 Nov 2003 10:03:30 +0100 Harald Welte wrote: > At least to me it was not known (until very recently) that the IPv6 > multicast code in net/ipv6/mcast.c bypasses the netfilter hooks - but it > does. ... > Dave: I think this would be post 2.6.0 stuff, wouldn't it? If the fix is simple enough (1 or 2 one-liner changes) and easy to verify, I would consider it for 2.6.0 I may even look into this myself. Thanks Harald. From romieu@fr.zoreil.com Sun Nov 23 15:43:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 15:44:07 -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 hANNhq25016168 for ; Sun, 23 Nov 2003 15:43:54 -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 hANNeNK7001241; Mon, 24 Nov 2003 00:40:23 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hANNeNgJ001240; Mon, 24 Nov 2003 00:40:23 +0100 Date: Mon, 24 Nov 2003 00:40:23 +0100 From: Francois Romieu To: Brad House Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031124004023.A1140@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.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: <3FC14058.4010600@mcve.com>; from brad@mcve.com on Sun, Nov 23, 2003 at 06:18:48PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1639 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 Content-Length: 460 Lines: 13 Brad House : > cool. Did those previous patches you posted get merged into the > current netdrvr-exp1, or do those need to be applied as well ? It is built on top of 2.6.0-test9-bk27 + (latest) netdrvr-exp: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk25-netdrvr-exp1.patch.bz2 > I'm going to see if I can test this out tonight... There is still a pile of code from realtek to merge. Tomorrow. -- Ueimor From brad@mcve.com Sun Nov 23 16:02:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 16:03:00 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAO02j25017138 for ; Sun, 23 Nov 2003 16:02:46 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 18F4885774; Sun, 23 Nov 2003 19:16:18 -0500 (EST) Message-ID: <3FC14AA3.9050009@mcve.com> Date: Sun, 23 Nov 2003 19:02:43 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> In-Reply-To: <20031124004023.A1140@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1641 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Heh, know you still have stuff to do on this, but I just compiled it up and tested it, and figured I'd let you know what I saw ... The kernel locked hard on running a dhcpcd eth0 no panic output to the screen (I don't have a serial cable hooked up, or anything, so I don't know if it output anything there) I'm sure the 'pile' of code left from realtek left will fix it though ;) -Brad Francois Romieu wrote: > Brad House : > >>cool. Did those previous patches you posted get merged into the >>current netdrvr-exp1, or do those need to be applied as well ? > > > It is built on top of 2.6.0-test9-bk27 + (latest) netdrvr-exp: > ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk25-netdrvr-exp1.patch.bz2 > > >>I'm going to see if I can test this out tonight... > > > There is still a pile of code from realtek to merge. Tomorrow. > > -- > Ueimor > From rask@sygehus.dk Sun Nov 23 16:05:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 16:05:40 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAO05625017523 for ; Sun, 23 Nov 2003 16:05:27 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 9BE863EB8; Mon, 24 Nov 2003 01:05:05 +0100 (CET) Date: Mon, 24 Nov 2003 01:05:05 +0100 From: Rask Ingemann Lambertsen To: Linux netdev mailing list Subject: Re: RFC: Enabling ethernet drivers to return FCS in the skb? Message-ID: <20031124010501.C1657@sygehus.dk> References: <3FB94311.10004@candelatech.com> <20031119123556.A7622@sygehus.dk> <3FBB8D61.6010106@candelatech.com> <20031120173404.A1538@sygehus.dk> <3FC077B1.1050807@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: <3FC077B1.1050807@candelatech.com>; from greearb@candelatech.com on Sun, Nov 23, 2003 at 01:02:41AM -0800 X-archive-position: 1642 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 Sun, Nov 23, 2003 at 01:02:41AM -0800, Ben Greear wrote: [Intel i82557/8/9 Ethernet chips] Saving bad frames to memory is controlled by CB_CFIG_SAVE_BAD_FRAMES in byte 6. Saving the FCS to memory is controlled by CB_CFIG_CRC_IN_MEM in byte 18. See drivers/net/e100/e100_config.h. > It's less clear what happens when you turn off the FCS generation. One part of > the document mentions it gets it from RAM, which I assume means it uses the last > part of the DMA'd packet??? Yes. The last four octets from the skb will be interpreted as an FCS by whichever board receives that frame. > Another explanation of the transmit state machine does > not mention that you can disable FCS generation... I'm going to print this out > and read it again in detail... There is a bit in the command word of a TX command which disables FCS generation. I can't find that bit defined in drivers/net/e100/e100.h, so you'll have to find it in the docs. -- Regards, Rask Ingemann Lambertsen From davem@pizda.ninka.net Sun Nov 23 22:44:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Nov 2003 22:44:58 -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 hAO6id25028877 for ; Sun, 23 Nov 2003 22:44:39 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA01145; Sun, 23 Nov 2003 22:44:14 -0800 Date: Sun, 23 Nov 2003 22:44:14 -0800 From: "David S. Miller" To: David Stevens Cc: laforge@netfilter.org, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: IPv6 multicast (MLD,IGMP) code bypasses netfilter hooks Message-Id: <20031123224414.0bea3633.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: 1643 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, 23 Nov 2003 04:13:39 -0700 David Stevens wrote: > Here's a patch to add netfilter hooks for MLD v1 & v2. Can you take > quick look at it, Harald? Whoa, David beat me to it, on a weekend no less :))) It looks good to me. Applied, thanks. From romieu@fr.zoreil.com Mon Nov 24 00:13:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 00:14:16 -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 hAO8Dr25030291 for ; Mon, 24 Nov 2003 00:13:54 -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 hAO84MK7004562; Mon, 24 Nov 2003 09:04:22 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAO84Lo5004561; Mon, 24 Nov 2003 09:04:21 +0100 Date: Mon, 24 Nov 2003 09:04:21 +0100 From: Francois Romieu To: Brad House Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031124090421.A4482@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> <3FC14AA3.9050009@mcve.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: <3FC14AA3.9050009@mcve.com>; from brad@mcve.com on Sun, Nov 23, 2003 at 07:02:43PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1644 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 Brad House : [...] > The kernel locked hard on running a dhcpcd eth0 > no panic output to the screen (I don't have a serial cable > hooked up, or anything, so I don't know if it output anything > there) Well, thanks anyway. > I'm sure the 'pile' of code left from realtek left will fix it > though ;) Just to be sure: 1) you are running x86-64; 2) vanilla 2.6.0-test9 does not work either. If 2) if false I can/must search an error in the proposed changes. -- Ueimor From laforge@netfilter.org Mon Nov 24 02:25:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 02:25:57 -0800 (PST) Received: from dagobah.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAOAPJ25002134 for ; Mon, 24 Nov 2003 02:25:34 -0800 Received: from uucp by dagobah.gnumonks.org with local-bsmtp (Exim 4.22) id 1AODu7-0002ye-HW for netdev@oss.sgi.com; Mon, 24 Nov 2003 11:25:15 +0100 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1AODtj-0004Kv-00; Mon, 24 Nov 2003 11:24:51 +0100 Date: Mon, 24 Nov 2003 11:24:51 +0100 From: Harald Welte To: "David S. Miller" Cc: David Stevens , netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: IPv6 multicast (MLD,IGMP) code bypasses netfilter hooks Message-ID: <20031124102451.GJ4888@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , "David S. Miller" , David Stevens , netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org References: <20031123224414.0bea3633.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/+CTqSGWdiRg+8j" Content-Disposition: inline In-Reply-To: <20031123224414.0bea3633.davem@redhat.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.4.23-pre7-ben0 X-Date: Today is Boomtime, the 35th day of The Aftermath in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 1645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev --W/+CTqSGWdiRg+8j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 23, 2003 at 10:44:14PM -0800, David S. Miller wrote: > David Stevens wrote: >=20 > > Here's a patch to add netfilter hooks for MLD v1 & v2. Can you take > > quick look at it, Harald? >=20 > Whoa, David beat me to it, on a weekend no less :))) Thanks, David & David :) > It looks good to me. Applied, thanks. obviously fine with mee, too. --=20 - Harald Welte http://www.netfilter.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 "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --W/+CTqSGWdiRg+8j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/wdxzXaXGVTD0i/8RAvskAKCa3uDiy7EsfvZs5+/R903R+s6otwCfU5Hz Asp39O69bw/z9cTCgun7ujs= =Suf4 -----END PGP SIGNATURE----- --W/+CTqSGWdiRg+8j-- From brad@mcve.com Mon Nov 24 06:40:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 06:40:50 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAOEe525011403 for ; Mon, 24 Nov 2003 06:40:25 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 9B2B1857CA; Mon, 24 Nov 2003 09:53:40 -0500 (EST) Message-ID: <3FC21843.2080805@mcve.com> Date: Mon, 24 Nov 2003 09:40:03 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> <3FC14AA3.9050009@mcve.com> <20031124090421.A4482@electric-eye.fr.zoreil.com> In-Reply-To: <20031124090421.A4482@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1646 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev > Just to be sure: > 1) you are running x86-64; yep > 2) vanilla 2.6.0-test9 does not work either. correct, but the system doesn't lock up with vanilla -test9, dhcpcd just hangs, then will eventually return. From romieu@fr.zoreil.com Mon Nov 24 09:53:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 09:54:08 -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 hAOHrr25032672 for ; Mon, 24 Nov 2003 09:53:54 -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 hAOHn9K7009672; Mon, 24 Nov 2003 18:49:09 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAOHn8SC009671; Mon, 24 Nov 2003 18:49:08 +0100 Date: Mon, 24 Nov 2003 18:49:08 +0100 From: Francois Romieu To: Brad House Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031124184908.A9566@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> <3FC14AA3.9050009@mcve.com> <20031124090421.A4482@electric-eye.fr.zoreil.com> <3FC21843.2080805@mcve.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: <3FC21843.2080805@mcve.com>; from brad@mcve.com on Mon, Nov 24, 2003 at 09:40:03AM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1647 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 Brad House : [...] > > 2) vanilla 2.6.0-test9 does not work either. > > correct, but the system doesn't lock up with vanilla -test9, > dhcpcd just hangs, then will eventually return. I have fscked something then. Could you apply the patches in order to figure which one triggers the lock-up ? -- Ueimor From brad@mainstreetsoftworks.com Mon Nov 24 10:21:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 10:21:47 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id hAOILW25011452 for ; Mon, 24 Nov 2003 10:21:32 -0800 Received: from mainstreetsoftworks.com (shop.mcve.com [209.251.159.140]) by nameserver1.mcve.com (Postfix) with ESMTP id F075283C3E; Mon, 24 Nov 2003 13:35:08 -0500 (EST) Message-ID: <3FC24C2B.1030007@mainstreetsoftworks.com> Date: Mon, 24 Nov 2003 13:21:31 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031118 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: Brad House , netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> <3FC14AA3.9050009@mcve.com> <20031124090421.A4482@electric-eye.fr.zoreil.com> <3FC21843.2080805@mcve.com> <20031124184908.A9566@electric-eye.fr.zoreil.com> In-Reply-To: <20031124184908.A9566@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1648 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mainstreetsoftworks.com Precedence: bulk X-list: netdev Yes, I can do that. These are the patches I applied: -ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk25-netdrvr-exp1.patch.bz2 -r8169-mac-phy-version.patch I did not apply these patches below because your answer suggested that I should not as per the e-mail on 11/23: >> cool. Did those previous patches you posted get merged into the >> current netdrvr-exp1, or do those need to be applied as well ? > It is built on top of 2.6.0-test9-bk27 + (latest) netdrvr-exp: These are the patches _NOT_applied: From 11/20/03 -r8169-start-xmit-fixes.patch -r8169-dma-api-tx-buffers.patch -r8169-rx_copybreak.patch From 11/19/03 -r8169-dma-api-tx.patch -r8169-dma-api-data-buffers.patch Let me know where to begin, and I'll do it. -Brad Francois Romieu wrote: > Brad House : > [...] > >>>2) vanilla 2.6.0-test9 does not work either. >> >>correct, but the system doesn't lock up with vanilla -test9, >>dhcpcd just hangs, then will eventually return. > > > I have fscked something then. Could you apply the patches in order to > figure which one triggers the lock-up ? > > -- > Ueimor > -- ----------------------------- Brad House Sr. Developer Main Street Softworks, Inc. brad@mainstreetsoftworks.com (386) 462-9522 Ext. 112 ----------------------------- From yoshfuji@linux-ipv6.org Mon Nov 24 10:55:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 10:55:36 -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 hAOIt125013635 for ; Mon, 24 Nov 2003 10:55:22 -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 hAOItWlg005310; Tue, 25 Nov 2003 03:55:32 +0900 Date: Tue, 25 Nov 2003 03:55:31 +0900 (JST) Message-Id: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> To: vnuorval@tcs.hut.fi Cc: davem@redhat.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: 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: 1649 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 (at Wed, 5 Nov 2003 15:07:32 +0200 (EET)), Ville Nuorvala says: > 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. Sorry for long silence. > +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; > +} > + I prefer ipv6_inherit_linklocal() or something like that because this does not seem ip6_tun specific. I'm ok with other portion. Thanks. --yoshfuji From romieu@fr.zoreil.com Mon Nov 24 13:43:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 13:44:10 -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 hAOLhq25024109 for ; Mon, 24 Nov 2003 13:43:54 -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 hAOLZ0K7012242; Mon, 24 Nov 2003 22:35:00 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAOLYx8S012241; Mon, 24 Nov 2003 22:34:59 +0100 Date: Mon, 24 Nov 2003 22:34:59 +0100 From: Francois Romieu To: Brad House Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test9-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031124223459.A11435@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <3FC14058.4010600@mcve.com> <20031124004023.A1140@electric-eye.fr.zoreil.com> <3FC14AA3.9050009@mcve.com> <20031124090421.A4482@electric-eye.fr.zoreil.com> <3FC21843.2080805@mcve.com> <20031124184908.A9566@electric-eye.fr.zoreil.com> <3FC24C2B.1030007@mainstreetsoftworks.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: <3FC24C2B.1030007@mainstreetsoftworks.com>; from brad@mainstreetsoftworks.com on Mon, Nov 24, 2003 at 01:21:31PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1650 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 Brad House : > Yes, I can do that. These are the patches I applied: > -ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test9-bk25-netdrvr-exp1.patch.bz2 > -r8169-mac-phy-version.patch [...] > Let me know where to begin, and I'll do it. You patch -R in the following order until you get the behavior of vanilla kernel (or return to vanilla and patch in reverse order but you will notice a small reject for rx_copybreak due to an inserted GPL_MODULE in -netdrvr-exp). - r8169-mac-phy-version.patch - r8169-rx_copybreak.patch (11/22/2003 in euroland) - r8169-dma-api-tx-buffers.patch - r8169-start-xmit-fixes.patch - r8169-dma-api-data-buffers.patch - r8169-dma-api-tx.patch 1 - If you don't get the usual behavior at this point, something is _wrong_. 2 - You will have a one line offset, don't worry. Thank you. -- Ueimor From greearb@candelatech.com Mon Nov 24 15:24:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 15:24:49 -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 hAONOX25026253 for ; Mon, 24 Nov 2003 15:24:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAONOBKt022015; Mon, 24 Nov 2003 15:24:12 -0800 Message-ID: <3FC2931B.3070903@candelatech.com> Date: Mon, 24 Nov 2003 15:24:11 -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'" , "Feldman, Scott" Subject: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Content-Type: multipart/mixed; boundary="------------080006090804050407060406" X-archive-position: 1651 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. --------------080006090804050407060406 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks to those who pointed me in the right direction, here is a patch to the e100 (2.4.23-pre9) that allows it to capture all frames, bogons included. It also coppies the FCS to the skb so ethereal et al can read it. It utilizes ethtool commands to get/set the rx-all feature, and uses a new flag in the skbuff (and socket struct) structure to determine when to disable generating the FCS on transmit. I have the entire patch that adds the management bits and flags, but as usual, it's mixed in with various other things... I've done some initial testing and it seems to work as planned... If this patch or some version thereof has a possibility of being accepted, I'll be happy to break out the other bits into a clean patch for a more thorough review. If this is DOA, then I thank you for your time anyway! Jeff, Dave, et al, please let me know if this is of interest! Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------080006090804050407060406 Content-Type: text/plain; name="e100_rxall.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="e100_rxall.patch" --- linux-2.4.22/drivers/net/e100/e100_main.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_main.c 2003-11-24 14:52:47.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/** -*-linux-c-*- ************************************************************ Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -175,7 +175,7 @@ MODULE_PARM_DESC(X, S); /* ====================================================================== */ -static u8 e100_D101M_checksum(struct e100_private *, struct sk_buff *); +static u8 e100_D101M_checksum(struct e100_private *, struct sk_buff *, int crc_there); static u8 e100_D102_check_checksum(rfd_t *); static int e100_ioctl(struct net_device *, struct ifreq *, int); static int e100_change_mtu(struct net_device *, int); @@ -1198,11 +1198,17 @@ struct e100_private *bdp = dev->priv; unsigned char promisc_enbl; unsigned char mulcast_enbl; + unsigned char enable_rx_all; promisc_enbl = ((dev->flags & IFF_PROMISC) == IFF_PROMISC); mulcast_enbl = ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > MAX_MULTICAST_ADDRS)); + enable_rx_all = ((dev->priv_flags & IFF_ACCEPT_ALL_FRAMES) == IFF_ACCEPT_ALL_FRAMES); + printk("e100_set_rx_multi (%s), promisc: %d mcast: %d rxall: %d\n", + dev->name, promisc_enbl, mulcast_enbl, enable_rx_all); + /* NOTE: rx_long is unconditionally set to TRUE if the chipset supports it. */ + e100_config_rx_all(bdp, enable_rx_all); e100_config_promisc(bdp, promisc_enbl); e100_config_mulcast_enbl(bdp, mulcast_enbl); @@ -2016,8 +2022,14 @@ /* do not free & unmap badly received packet. * move it to the end of skb list for reuse */ if (!(rfd_status & RFD_STATUS_OK)) { - e100_add_skb_to_end(bdp, rx_struct); - continue; + if (unlikely(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)) { + /* printk("%s: Accepting a bogon, rfd_status: 0x%x\n", + dev->name, rfd_status); */ + } + else { + e100_add_skb_to_end(bdp, rx_struct); + continue; + } } data_sz = min_t(u16, (le16_to_cpu(rfd->rfd_act_cnt) & 0x3fff), @@ -2052,12 +2064,25 @@ if (bdp->rev_id >= D102_REV_ID) { skb->ip_summed = e100_D102_check_checksum(rfd); } else { - skb->ip_summed = e100_D101M_checksum(bdp, skb); + skb->ip_summed = e100_D101M_checksum(bdp, skb, !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)); } } else { skb->ip_summed = CHECKSUM_NONE; } + /* Show the FCS when in RX-ALL mode */ + if (unlikely(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)) { + if (bdp->rev_id < D102_REV_ID) { + /* Have to over-write the two IP checksum bytes + * TODO: Will this break vlan_hwaccel_rx??? + */ + skb->tail[-4] = skb->tail[-2]; + skb->tail[-3] = skb->tail[-1]; + skb->tail[-2] = skb->tail[0]; + skb->tail[-1] = skb->tail[1]; + } + } + bdp->drv_stats.net_stats.rx_bytes += skb->len; if(bdp->vlgrp && (rfd_status & CB_STATUS_VLAN)) { @@ -2175,6 +2200,18 @@ /* Clear I bit on other packets */ tcb->tcb_hdr.cb_cmd &= ~__constant_cpu_to_le16(CB_I_BIT); +#ifdef CONFIG_SUPPORT_SEND_BAD_CRC + /* Use the last 4 bytes of the SKB payload packet as the CRC, used for + * testing, ie sending bogus stuff. + */ + if (unlikely(skb->general_flags & DONT_DO_TX_CRC)) { + tcb->tcb_hdr.cb_cmd |= __constant_cpu_to_le16(CB_TX_NC_BIT); + } + else { + tcb->tcb_hdr.cb_cmd &= ~__constant_cpu_to_le16(CB_TX_NC_BIT); + } +#endif + tcb->tcb_skb = skb; if (skb->ip_summed == CHECKSUM_HW) { @@ -2934,13 +2971,16 @@ * assign this value to skb->csum. */ static unsigned char -e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb) +e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb, int crc_there) { unsigned short proto = (skb->protocol); - + int offset = 0; + if (unlikely(crc_there)) { + offset = -4; + } if (proto == __constant_htons(ETH_P_IP)) { - skb->csum = get_unaligned((u16 *) (skb->tail)); + skb->csum = get_unaligned((u16 *) (skb->tail - offset)); return CHECKSUM_HW; } return CHECKSUM_NONE; @@ -3143,6 +3183,27 @@ } } +static int e100_ethtool_setrxall(struct net_device *netdev, uint32_t val) { + unsigned short old_flags = netdev->priv_flags; + if (val) { + netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES; + } + else { + netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES); + } + + /* printk("e100_ethtool_setrxall (%s) val: %d\n", + netdev->name, val); */ + if (old_flags != netdev->priv_flags) { + /* Kick the driver to flush the values... + * TODO: Needs review of driver folks to make sure locking is sane, etc + */ + /*printk("Kicking e100_set_multi..\n");*/ + e100_set_multi(netdev); + } + return 0; +} + static int e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr) { @@ -3342,7 +3403,25 @@ return 0; } #endif + case ETHTOOL_SETRXALL: { + struct ethtool_value id; + if (copy_from_user(&id, ifr->ifr_data, sizeof(id))) + return -EFAULT; + spin_lock_bh(&dev->xmit_lock); + e100_ethtool_setrxall(dev, id.data); + spin_unlock_bh(&dev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXALL: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES); + /*printk("GETRXALL, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(ifr->ifr_data, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } default: break; } //switch --- linux-2.4.22/drivers/net/e100/e100_config.c 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.c 2003-11-24 14:56:14.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/**** -*-linux-c-*- *********************************************************** Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -326,42 +326,92 @@ { spin_lock_bh(&(bdp->config_lock)); - /* if in promiscuous mode, save bad frames */ + /* Promiscuity */ if (enable) { + if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { + bdp->config[15] |= CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + + } else { /* not in promiscuous mode */ + + if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { + bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + } + + spin_unlock_bh(&(bdp->config_lock)); +} + + +/** + * e100_config_promisc - configure promiscuous mode + * @bdp: atapter's private data struct + * @enable: should we enable this option or not + * + * This routine will enable or disable receiving all frames to + * memory, including bad ones, short ones, and long ones. It also + * causes the Frame Check Sum (FCS) to be transferred to memory. + */ +void +e100_config_rx_all(struct e100_private *bdp, unsigned char enable) +{ + spin_lock_bh(&(bdp->config_lock)); + + /* Should we save bad frames? */ + if (enable) { if (!(bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES)) { bdp->config[6] |= CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (bdp->config[7] & (u8) BIT_0) { - bdp->config[7] &= (u8) (~BIT_0); + /* Don't discard short-receive */ + if (bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES) { + bdp->config[7] &= (u8) (~CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { - bdp->config[15] |= CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Save over-runs */ + if (!(bdp->config[6] & CB_CFIG_SAVE_OVERRUNS)) { + bdp->config[6] |= CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } else { /* not in promiscuous mode */ - + /* Transfer the etherne CRC to memory too */ + if (!(bdp->config[18] & CB_CFIG_CRC_IN_MEM)) { + bdp->config[18] |= CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + + } + else { + /* Don't discard short frames */ if (bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES) { bdp->config[6] &= ~CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (!(bdp->config[7] & (u8) BIT_0)) { - bdp->config[7] |= (u8) (BIT_0); + /* Discard short-receive */ + if (!(bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES)) { + bdp->config[7] |= (u8) (CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { - bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Discard over-runs */ + if (bdp->config[6] & CB_CFIG_SAVE_OVERRUNS) { + bdp->config[6] &= !CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } + + /* Don't send CRC (FCS) to memory */ + if (bdp->config[18] & CB_CFIG_CRC_IN_MEM) { + bdp->config[18] &= !CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + } spin_unlock_bh(&(bdp->config_lock)); } --- linux-2.4.22/drivers/net/e100/e100_config.h 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.h 2003-11-24 00:57:14.000000000 -0800 @@ -67,6 +67,7 @@ #define CB_CFIG_CI_INT BIT_3 /* Command Complete Interrupt */ #define CB_CFIG_EXT_TCB_DIS BIT_4 /* Extended TCB */ #define CB_CFIG_EXT_STAT_DIS BIT_5 /* Extended Stats */ +#define CB_CFIG_SAVE_OVERRUNS BIT_6 /* Save over-run frames if != 0 */ #define CB_CFIG_SAVE_BAD_FRAMES BIT_7 /* Save Bad Frames Enabled */ /* byte 7 bit definitions*/ @@ -117,6 +118,8 @@ #define CB_CFIG_STRIPPING BIT_0 /* Padding Disabled */ #define CB_CFIG_PADDING BIT_1 /* Padding Disabled */ #define CB_CFIG_CRC_IN_MEM BIT_2 /* Transfer CRC To Memory */ +/* Only valid for 82558 and 82559. Must be zero for 82557 */ +#define CB_CFIG_LONG_RX_OK BIT_3 /* OK to receive Long frames */ /* byte 19 bit definitions*/ #define CB_CFIG_TX_ADDR_WAKE BIT_0 /* Address Wakeup */ @@ -142,8 +145,7 @@ /* byte 22 bit defines */ #define CB_CFIG_RECEIVE_GAMLA_MODE BIT_0 /* D102 receive mode */ #define CB_CFIG_VLAN_DROP_ENABLE BIT_1 /* vlan stripping */ - -#define CB_CFIG_LONG_RX_OK BIT_3 +/* LONG-RX OK (needed for VLAN) is in byte 18, bit 3, see above */ #define NO_LOOPBACK 0 #define MAC_LOOPBACK 0x01 @@ -155,6 +157,7 @@ extern unsigned char e100_config(struct e100_private *bdp); extern void e100_config_fc(struct e100_private *bdp); extern void e100_config_promisc(struct e100_private *bdp, unsigned char enable); +extern void e100_config_rx_all(struct e100_private *bdp, unsigned char enable); extern void e100_config_brdcast_dsbl(struct e100_private *bdp); extern void e100_config_mulcast_enbl(struct e100_private *bdp, unsigned char enable); --------------080006090804050407060406-- From davem@pizda.ninka.net Mon Nov 24 15:29:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 15:30:11 -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 hAONTo25026653 for ; Mon, 24 Nov 2003 15:29:51 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA16174; Mon, 24 Nov 2003 15:29:33 -0800 Date: Mon, 24 Nov 2003 15:29:33 -0800 From: "David S. Miller" To: Ben Greear Cc: netdev@oss.sgi.com, scott.feldman@intel.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Message-Id: <20031124152933.1420f6cf.davem@redhat.com> In-Reply-To: <3FC2931B.3070903@candelatech.com> References: <3FC2931B.3070903@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: 1652 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, 24 Nov 2003 15:24:11 -0800 Ben Greear wrote: > Jeff, Dave, et al, please let me know if this is of interest! I think the rx_all facility is very useful. Secondarily, I think we should address the other features seperately. What I think you should do is split out the rx_all functionality into a seperate patch, and once we've refined and integrated that we can work one-by-one on the CRC and other bits. From shemminger@osdl.org Mon Nov 24 15:44:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 15:44: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 hAONiX25027084 for ; Mon, 24 Nov 2003 15:44: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 hAONiOC15540; Mon, 24 Nov 2003 15:44:24 -0800 Date: Mon, 24 Nov 2003 15:44:59 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] hp100 -- fixes for new probing. Message-Id: <20031124154459.6fe02a94.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: 1653 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 Fixes to net-drivers-2.5-exp patches for hp100 * EISA device id table needs a terminating string. * if one driver built for all variations (ISA, EISA, PCI) then try to have sane error handling on probe. diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Mon Nov 24 15:34:53 2003 +++ b/drivers/net/hp100.c Mon Nov 24 15:34:53 2003 @@ -201,6 +201,7 @@ { "HWP1990" }, /* HP J2577 */ { "CPX0301" }, /* ReadyLink ENET100-VG4 */ { "CPX0401" }, /* FreedomLine 100/VG */ + { "" } }; MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl); #endif @@ -3045,10 +3046,16 @@ err = hp100_isa_init(); #ifdef CONFIG_EISA - err |= eisa_driver_register(&hp100_eisa_driver); + if (err && err != -ENODEV) + return err; + + err = eisa_driver_register(&hp100_eisa_driver); #endif #ifdef CONFIG_PCI - err |= pci_module_init(&hp100_pci_driver); + if (err && err != -ENODEV) + return err; + + err = pci_module_init(&hp100_pci_driver); #endif return err; } From greearb@candelatech.com Mon Nov 24 15:48:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 15:48:47 -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 hAONmX25027556 for ; Mon, 24 Nov 2003 15:48:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAONmPKt025072; Mon, 24 Nov 2003 15:48:26 -0800 Message-ID: <3FC298C9.8080302@candelatech.com> Date: Mon, 24 Nov 2003 15:48:25 -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, scott.feldman@intel.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> In-Reply-To: <20031124152933.1420f6cf.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1654 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 Mon, 24 Nov 2003 15:24:11 -0800 > Ben Greear wrote: > > >>Jeff, Dave, et al, please let me know if this is of interest! > > > I think the rx_all facility is very useful. > > Secondarily, I think we should address the other features > seperately. > > What I think you should do is split out the rx_all functionality > into a seperate patch, and once we've refined and integrated that > we can work one-by-one on the CRC and other bits. So, RX-ALL can be one flag, another for RX-FCS, and the TX-CUSTOM-FCS can be a separate patch altogether? It would also be possible to add individual 'rx-foo', ie long, bad-crc, bad-frame, etc. But, I think that would probably be over-kill at this point. Any problem with using the netdev->priv_flags to hold the RX-ALL and RX-FCS flags? Btw, it's impossible (afaik) to see the CRC errors generically w/out accessing netlink (which I assume works, but have never actually tried), ie there is no column in /proc/net/dev for rx-crc-errors. It would be an excellent time to allow me to add the ethtool hook to read the net_device_stats struct via a single ioctl call! :) Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Mon Nov 24 15:50:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 15:50: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 hAONoW25027933 for ; Mon, 24 Nov 2003 15:50: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 hAONoOC17669; Mon, 24 Nov 2003 15:50:24 -0800 Date: Mon, 24 Nov 2003 15:51:00 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] pc300 - get rid of MOD_INC/MOD_DEC Message-Id: <20031124155100.17b7a4ca.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: 1655 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 Remove old style mod inc/dec from this WAN driver. diff -Nru a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c --- a/drivers/net/wan/pc300_drv.c Mon Nov 24 15:36:51 2003 +++ b/drivers/net/wan/pc300_drv.c Mon Nov 24 15:36:51 2003 @@ -3165,7 +3165,6 @@ return result; } - MOD_INC_USE_COUNT; sprintf(ifr.ifr_name, "%s", dev->name); cpc_opench(d); netif_start_queue(dev); @@ -3201,7 +3200,6 @@ } #endif - MOD_DEC_USE_COUNT; return 0; } From davem@pizda.ninka.net Mon Nov 24 17:33:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 17:34: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 hAP1Xj25032444 for ; Mon, 24 Nov 2003 17:33:45 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA16406; Mon, 24 Nov 2003 17:33:30 -0800 Date: Mon, 24 Nov 2003 17:33:30 -0800 From: "David S. Miller" To: Ben Greear Cc: netdev@oss.sgi.com, scott.feldman@intel.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Message-Id: <20031124173330.096c0751.davem@redhat.com> In-Reply-To: <3FC298C9.8080302@candelatech.com> References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> <3FC298C9.8080302@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: 1656 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, 24 Nov 2003 15:48:25 -0800 Ben Greear wrote: > So, RX-ALL can be one flag, another for RX-FCS, and the TX-CUSTOM-FCS > can be a separate patch altogether? That is the basic idea, yes. > Any problem with using the netdev->priv_flags to hold the RX-ALL and RX-FCS flags? I see no problem with that. Another option is to let the driver maintain the state bits internally, but I see no reason to do that. > Btw, it's impossible (afaik) to see the CRC errors generically w/out > accessing netlink (which I assume works, but have never actually tried), ie > there is no column in /proc/net/dev for rx-crc-errors. It would be > an excellent time to allow me to add the ethtool hook to read the > net_device_stats struct via a single ioctl call! :) The netlink thing does work, trust me :) You could argue that 'ip -s link' should print this out, and I'd agree with you on that. However, one thing I want to make absolutely clear is that I do not want multiple ways to get the same information out of the kernel. We decided to build netlink into the kernel always because this means it is present in everyone's kernel. And therefore, we don't need to add another way to obtain the same config information already available via netlink. The existing cases where an ioctl() style call exists to obtain the same info available via netlink is merely for compatability with older BSD tools. No new such things will be added. From davem@pizda.ninka.net Mon Nov 24 18:58:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 18:59: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 hAP2wr25008813 for ; Mon, 24 Nov 2003 18:58:53 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA16609; Mon, 24 Nov 2003 18:58:37 -0800 Date: Mon, 24 Nov 2003 18:58:37 -0800 From: "David S. Miller" To: maxk@qualcomm.com Cc: netdev@oss.sgi.com Subject: Possible bluetooth HCI socket bug Message-Id: <20031124185837.50811788.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: 1657 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 Hello Maxim. I was auditing something independantly (sock_queue_rcv_skb() usage, some protocols were racy) when I ran into some issues that might be bugs we need to fix in the bluetooth stack. In hci_send_frame(), I'm highly doubtful of the skb_orphan() call you make there. Socket ownership of the buffer should be sustained until the transmission by the device is complete and it frees up the buffer via dev_kfree_skb() or similar. Even in the cases where hci_send_to_sock() is called, that code clones a new SKB for those purposes so it does not change the situation as far as hci_send_frame() is concerned. If socket ownership of an SKB buffer is liberated too early, this gives the socket a window in which to over-commit it's socket buffer queue limits. From davem@pizda.ninka.net Mon Nov 24 19:32:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 19:33:16 -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 hAP3Ww25011171 for ; Mon, 24 Nov 2003 19:32:58 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA16707; Mon, 24 Nov 2003 19:30:42 -0800 Date: Mon, 24 Nov 2003 19:30:42 -0800 From: "David S. Miller" To: jt@hpl.hp.com Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Possible IRDA SKB leaks Message-Id: <20031124193042.2c1013a2.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: 1658 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 Hello Jean, I think I've found some SKB handling bugs in the IRDA stack. I was verifying all the paths that use sock_queue_rcv_skb(). If any non-zero value is returned from this function the caller must either free the SKB or queue the packet some place else. Here is one example where IRDA appears to do the wrong thing. In irttp_udata_indication(), we pass the packet down into the next layer via self->notify.udata_indication(). One example implementation of this is af_irda.c:irda_data_indication(). This calls sock_queue_rcv_skb() and returns any error to the caller. Our caller in this case, irttp_udata_indication(), for some reason treats -ENOMEM specially. This is wrong, there are many other errors that sock_queue_rcv_skb() can return, for example -EPERM from socket filtering. All such error cases need to cause the SKB to be freed or similar, it should not be done only for an error of -ENOMEM. I have not done an exhaustive audit of this problem in the IRDA stack. But I do suspect there are other places doing something similar. If someone could finish the audit and submit a patch to fix this I'd really appreciate it. Thanks a lot. From jt@bougret.hpl.hp.com Mon Nov 24 19:36:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 19:36:24 -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 hAP3a325011552 for ; Mon, 24 Nov 2003 19:36:03 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id E2B901C01E22; Mon, 24 Nov 2003 19:36: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 TAA21094; Mon, 24 Nov 2003 19:36:02 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AOTze-0001Aq-00; Mon, 24 Nov 2003 19:36:02 -0800 Date: Mon, 24 Nov 2003 19:36:02 -0800 To: "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Possible IRDA SKB leaks Message-ID: <20031125033602.GA4483@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031124193042.2c1013a2.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031124193042.2c1013a2.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: 1659 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 Mon, Nov 24, 2003 at 07:30:42PM -0800, David S. Miller wrote: > > Hello Jean, I think I've found some SKB handling bugs in > the IRDA stack. > > I was verifying all the paths that use sock_queue_rcv_skb(). > If any non-zero value is returned from this function the caller > must either free the SKB or queue the packet some place else. > > Here is one example where IRDA appears to do the wrong thing. > In irttp_udata_indication(), we pass the packet down into the > next layer via self->notify.udata_indication(). > > One example implementation of this is af_irda.c:irda_data_indication(). > This calls sock_queue_rcv_skb() and returns any error to the caller. > > Our caller in this case, irttp_udata_indication(), for some reason > treats -ENOMEM specially. This is wrong, there are many other errors > that sock_queue_rcv_skb() can return, for example -EPERM from socket > filtering. All such error cases need to cause the SKB to be freed > or similar, it should not be done only for an error of -ENOMEM. > > I have not done an exhaustive audit of this problem in the IRDA stack. > But I do suspect there are other places doing something similar. > > If someone could finish the audit and submit a patch to fix this I'd > really appreciate it. Thanks a lot. Ok, I got it. The module af_irda is only ever called by irttp.c, so that is going to be doable. I'll try to find time before Thanksgiving, but it's short (meetings and co.). Thanks. Jean From davem@pizda.ninka.net Mon Nov 24 19:55:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 19:55:24 -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 hAP3t825012090 for ; Mon, 24 Nov 2003 19:55:08 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA16788; Mon, 24 Nov 2003 19:54:53 -0800 Date: Mon, 24 Nov 2003 19:54:53 -0800 From: "David S. Miller" To: mostrows@speakeasy.net Cc: netdev@oss.sgi.com Subject: PPPOE skb leak Message-Id: <20031124195453.0e438915.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: 1660 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 PPPOE packet reception does not check the return value of sock_queue_rcv_skb() and therefore can leak packets. Here is the fix I've installed. # 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.1486 -> 1.1487 # drivers/net/pppoe.c 1.35 -> 1.36 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/24 davem@nuts.ninka.net 1.1487 # [PPPOE]: Do not leak SKB if sock_queue_rcv_skb() fails. # -------------------------------------------- # diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c --- a/drivers/net/pppoe.c Mon Nov 24 19:50:44 2003 +++ b/drivers/net/pppoe.c Mon Nov 24 19:50:44 2003 @@ -352,7 +352,8 @@ if (!__pppoe_xmit( relay_po->sk, skb)) goto abort_put; } else { - sock_queue_rcv_skb(sk, skb); + if (sock_queue_rcv_skb(sk, skb)) + goto abort_kfree; } return NET_RX_SUCCESS; From davem@pizda.ninka.net Mon Nov 24 20:05:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 20:05: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 hAP45225012530 for ; Mon, 24 Nov 2003 20:05:22 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16844; Mon, 24 Nov 2003 20:04:47 -0800 Date: Mon, 24 Nov 2003 20:04:47 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Subject: ECONET skb leak fix Message-Id: <20031124200447.7696f2c5.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: 1661 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 Econet had one spot where it could leak SKBs due to a missing return value check. Nobody really maintains this thing anymore so I did not CC: any maintainer :) Also return NET_RX_DROP as appropriate. # 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.1487 -> 1.1488 # net/econet/af_econet.c 1.27 -> 1.28 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/24 davem@nuts.ninka.net 1.1488 # [ECONET]: Do not leak SKBs if ec_queue_packet() fails. # # Also, make sure NET_RX_DROP is returned if we did not accept the # packet. # -------------------------------------------- # diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c --- a/net/econet/af_econet.c Mon Nov 24 20:01:24 2003 +++ b/net/econet/af_econet.c Mon Nov 24 20:01:24 2003 @@ -1041,12 +1041,15 @@ if (!sk) goto drop; - return ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, - hdr->port); + if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, + hdr->port)) + goto drop; + + return 0; drop: kfree_skb(skb); - return 0; + return NET_RX_DROP; } static struct packet_type econet_packet_type = { From greearb@candelatech.com Mon Nov 24 23:54:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 23:54:16 -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 hAP7s125020272 for ; Mon, 24 Nov 2003 23:54: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 hAP7rrKt030457 for ; Mon, 24 Nov 2003 23:53:54 -0800 Message-ID: <3FC30A91.6090309@candelatech.com> Date: Mon, 24 Nov 2003 23:53:53 -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 1/3] rx_all_ethtool.patch Content-Type: multipart/mixed; boundary="------------020803080508050906080400" X-archive-position: 1662 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. --------------020803080508050906080400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------020803080508050906080400 Content-Type: text/plain; name="rx_all_ethtool.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rx_all_ethtool.patch" --- linux-2.4.22/include/linux/ethtool.h 2003-11-24 23:14:20.000000000 -0800 +++ linux-2.4.22.p4s/include/linux/ethtool.h 2003-11-24 23:18:29.000000000 -0800 @@ -1,4 +1,4 @@ -/* +/* -*-linux-c-*- * ethtool.h: Defines for Linux ethtool. * * Copyright (C) 1998 David S. Miller (davem@redhat.com) @@ -289,6 +289,10 @@ * get_strings: Return a set of strings that describe the requested objects * phys_id: Identify the device * get_stats: Return statistics about the device + * set_rx_all: Set or clear IFF_ACCEPT_ALL_FRAMES, see if.h + * get_rx_all: Return 1 if set, 0 if not. + * set_save_fcs: Set or clear IFF_SAVE_FCS, see if.h + * get_save_fcs: Return 1 if set, 0 if not. * * Description: * @@ -345,7 +349,11 @@ int (*phys_id)(struct net_device *, u32); int (*get_stats_count)(struct net_device *); void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); + int (*set_rx_all)(struct net_device *, u32); + int (*get_rx_all)(struct net_device *, u32 *); + int (*set_save_fcs)(struct net_device *, u32); + int (*get_save_fcs)(struct net_device *, u32 *); }; /* CMDs currently supported */ @@ -381,7 +396,15 @@ #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ + +#define ETHTOOL_GETRXALL 0x00000071 /* Retrieve whether or not + * IFF_ACCEPT_ALL_FRAMES is set. */ +#define ETHTOOL_SETRXALL 0x00000072 /* Set IFF_ACCEPT_ALL_FRAMES */ +#define ETHTOOL_GETRXFCS 0x00000073 /* Set IFF_SAVE_FCS */ +#define ETHTOOL_SETRXFCS 0x00000074 /* Set IFF_SAVE_FCS */ + + /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET #define SPARC_ETH_SSET ETHTOOL_SSET --- linux-2.4.22/net/core/ethtool.c 2003-11-24 23:14:22.000000000 -0800 +++ linux-2.4.22.p4s/net/core/ethtool.c 2003-11-18 22:40:06.000000000 -0800 @@ -1,4 +1,4 @@ -/* +/* -*- linux-c -*- * net/core/ethtool.c - Ethtool ioctl handler * Copyright (c) 2003 Matthew Wilcox * @@ -31,6 +31,12 @@ return (dev->features & NETIF_F_IP_CSUM) != 0; } +u32 ethtool_op_get_rx_all(struct net_device *dev, u32* retval) +{ + *retval = ((dev->priv_flags & IFF_ACCEPT_ALL_FRAMES) != 0); + return 0; +} + int ethtool_op_set_tx_csum(struct net_device *dev, u32 data) { if (data) @@ -569,6 +575,38 @@ return dev->ethtool_ops->phys_id(dev, id.data); } + +static int ethtool_get_rx_all(struct net_device *dev, char *useraddr) +{ + struct ethtool_value edata = { ETHTOOL_GSG }; + int rv = 0; + + if (!dev->ethtool_ops->get_rx_all) + return -EOPNOTSUPP; + + if ((rv = dev->ethtool_ops->get_rx_all(dev, &edata.data)) < 0) { + return rv; + } + + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; +} + + +static int ethtool_set_rx_all(struct net_device *dev, void *useraddr) +{ + struct ethtool_value id; + + if (!dev->ethtool_ops->set_rx_all) + return -EOPNOTSUPP; + + if (copy_from_user(&id, useraddr, sizeof(id))) + return -EFAULT; + + return dev->ethtool_ops->set_rx_all(dev, id.data); +} + static int ethtool_get_stats(struct net_device *dev, void *useraddr) { struct ethtool_stats stats; @@ -602,5 +640,5 @@ return ret; } /* The main entry point in this file. Called from net/core/dev.c */ @@ -681,6 +747,10 @@ return ethtool_get_strings(dev, useraddr); case ETHTOOL_PHYS_ID: return ethtool_phys_id(dev, useraddr); + case ETHTOOL_SETRXALL: + return ethtool_set_rx_all(dev, useraddr); + case ETHTOOL_GETRXALL: + return ethtool_get_rx_all(dev, useraddr); case ETHTOOL_GSTATS: return ethtool_get_stats(dev, useraddr); default: --------------020803080508050906080400-- From greearb@candelatech.com Mon Nov 24 23:55:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 23:55:48 -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 hAP7tX25020457 for ; Mon, 24 Nov 2003 23:55:33 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAP7tQKt030667 for ; Mon, 24 Nov 2003 23:55:27 -0800 Message-ID: <3FC30AEE.7000005@candelatech.com> Date: Mon, 24 Nov 2003 23:55:26 -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 3/3] rx_all e100 patch Content-Type: multipart/mixed; boundary="------------080305050402040001000303" X-archive-position: 1664 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. --------------080305050402040001000303 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------080305050402040001000303 Content-Type: text/plain; name="rx_all_e100.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rx_all_e100.patch" --- linux-2.4.22/drivers/net/e100/e100_main.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_main.c 2003-11-24 21:50:49.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/** -*-linux-c-*- ************************************************************ Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -175,7 +175,7 @@ MODULE_PARM_DESC(X, S); /* ====================================================================== */ -static u8 e100_D101M_checksum(struct e100_private *, struct sk_buff *); +static u8 e100_D101M_checksum(struct e100_private *, struct sk_buff *, int crc_there); static u8 e100_D102_check_checksum(rfd_t *); static int e100_ioctl(struct net_device *, struct ifreq *, int); static int e100_change_mtu(struct net_device *, int); @@ -644,8 +644,9 @@ dev->do_ioctl = &e100_ioctl; if (bdp->flags & USE_IPCB) - dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | + NETIF_F_RX_ALL | NETIF_F_SAVE_CRC; if ((rc = register_netdev(dev)) != 0) { goto err_pci; @@ -1198,11 +1199,17 @@ struct e100_private *bdp = dev->priv; unsigned char promisc_enbl; unsigned char mulcast_enbl; + unsigned char enable_rx_all; promisc_enbl = ((dev->flags & IFF_PROMISC) == IFF_PROMISC); mulcast_enbl = ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > MAX_MULTICAST_ADDRS)); + enable_rx_all = ((dev->priv_flags & IFF_ACCEPT_ALL_FRAMES) == IFF_ACCEPT_ALL_FRAMES); + printk("e100_set_rx_multi (%s), promisc: %d mcast: %d rxall: %d\n", + dev->name, promisc_enbl, mulcast_enbl, enable_rx_all); + /* NOTE: rx_long is unconditionally set to TRUE if the chipset supports it. */ + e100_config_rx_all(bdp, enable_rx_all); e100_config_promisc(bdp, promisc_enbl); e100_config_mulcast_enbl(bdp, mulcast_enbl); @@ -2016,8 +2023,14 @@ /* do not free & unmap badly received packet. * move it to the end of skb list for reuse */ if (!(rfd_status & RFD_STATUS_OK)) { - e100_add_skb_to_end(bdp, rx_struct); - continue; + if (unlikely(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)) { + /* printk("%s: Accepting a bogon, rfd_status: 0x%x\n", + dev->name, rfd_status); */ + } + else { + e100_add_skb_to_end(bdp, rx_struct); + continue; + } } data_sz = min_t(u16, (le16_to_cpu(rfd->rfd_act_cnt) & 0x3fff), @@ -2052,13 +2065,26 @@ if (bdp->rev_id >= D102_REV_ID) { skb->ip_summed = e100_D102_check_checksum(rfd); } else { - skb->ip_summed = e100_D101M_checksum(bdp, skb); + skb->ip_summed = e100_D101M_checksum(bdp, skb, !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)); } } else { skb->ip_summed = CHECKSUM_NONE; } + /* Show the FCS? */ + if (unlikely(dev->priv_flags & IFF_SAVE_FCS)) { + if (bdp->rev_id < D102_REV_ID) { + /* Have to over-write the two IP checksum bytes + * TODO: Will this break vlan_hwaccel_rx??? + */ + skb->tail[-4] = skb->tail[-2]; + skb->tail[-3] = skb->tail[-1]; + skb->tail[-2] = skb->tail[0]; + skb->tail[-1] = skb->tail[1]; + } + } + bdp->drv_stats.net_stats.rx_bytes += skb->len; if(bdp->vlgrp && (rfd_status & CB_STATUS_VLAN)) { @@ -2934,13 +2972,16 @@ * assign this value to skb->csum. */ static unsigned char -e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb) +e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb, int crc_there) { unsigned short proto = (skb->protocol); - + int offset = 0; + if (unlikely(crc_there)) { + offset = -4; + } if (proto == __constant_htons(ETH_P_IP)) { - skb->csum = get_unaligned((u16 *) (skb->tail)); + skb->csum = get_unaligned((u16 *) (skb->tail - offset)); return CHECKSUM_HW; } return CHECKSUM_NONE; @@ -3143,6 +3184,27 @@ } } +static int e100_ethtool_setrxall(struct net_device *netdev, uint32_t val) { + unsigned short old_flags = netdev->priv_flags; + if (val) { + netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES; + } + else { + netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES); + } + + /* printk("e100_ethtool_setrxall (%s) val: %d\n", + netdev->name, val); */ + if (old_flags != netdev->priv_flags) { + /* Kick the driver to flush the values... + * TODO: Needs review of driver folks to make sure locking is sane, etc + */ + /*printk("Kicking e100_set_multi..\n");*/ + e100_set_multi(netdev); + } + return 0; +} + static int e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr) { @@ -3342,7 +3404,43 @@ return 0; } #endif + case ETHTOOL_SETRXALL: { + struct ethtool_value id; + if (copy_from_user(&id, ifr->ifr_data, sizeof(id))) + return -EFAULT; + spin_lock_bh(&dev->xmit_lock); + e100_ethtool_setrxall(dev, id.data); + spin_unlock_bh(&dev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXALL: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES); + /*printk("GETRXALL, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(ifr->ifr_data, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SETRXFCS: { + struct ethtool_value id; + if (copy_from_user(&id, ifr->ifr_data, sizeof(id))) + return -EFAULT; + spin_lock_bh(&dev->xmit_lock); + dev->priv_flags |= IFF_SAVE_FCS; + spin_unlock_bh(&dev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXFCS: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(dev->priv_flags & IFF_SAVE_FCS); + /*printk("GETRXFCS, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(ifr->ifr_data, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } default: break; } //switch --- linux-2.4.22/drivers/net/e100/e100_config.c 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.c 2003-11-24 14:56:14.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/**** -*-linux-c-*- *********************************************************** Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -326,42 +326,92 @@ { spin_lock_bh(&(bdp->config_lock)); - /* if in promiscuous mode, save bad frames */ + /* Promiscuity */ if (enable) { + if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { + bdp->config[15] |= CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + + } else { /* not in promiscuous mode */ + + if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { + bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + } + + spin_unlock_bh(&(bdp->config_lock)); +} + + +/** + * e100_config_promisc - configure promiscuous mode + * @bdp: atapter's private data struct + * @enable: should we enable this option or not + * + * This routine will enable or disable receiving all frames to + * memory, including bad ones, short ones, and long ones. It also + * causes the Frame Check Sum (FCS) to be transferred to memory. + */ +void +e100_config_rx_all(struct e100_private *bdp, unsigned char enable) +{ + spin_lock_bh(&(bdp->config_lock)); + + /* Should we save bad frames? */ + if (enable) { if (!(bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES)) { bdp->config[6] |= CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (bdp->config[7] & (u8) BIT_0) { - bdp->config[7] &= (u8) (~BIT_0); + /* Don't discard short-receive */ + if (bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES) { + bdp->config[7] &= (u8) (~CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { - bdp->config[15] |= CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Save over-runs */ + if (!(bdp->config[6] & CB_CFIG_SAVE_OVERRUNS)) { + bdp->config[6] |= CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } else { /* not in promiscuous mode */ - + /* Transfer the etherne CRC to memory too */ + if (!(bdp->config[18] & CB_CFIG_CRC_IN_MEM)) { + bdp->config[18] |= CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + + } + else { + /* Don't discard short frames */ if (bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES) { bdp->config[6] &= ~CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (!(bdp->config[7] & (u8) BIT_0)) { - bdp->config[7] |= (u8) (BIT_0); + /* Discard short-receive */ + if (!(bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES)) { + bdp->config[7] |= (u8) (CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { - bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Discard over-runs */ + if (bdp->config[6] & CB_CFIG_SAVE_OVERRUNS) { + bdp->config[6] &= !CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } + + /* Don't send CRC (FCS) to memory */ + if (bdp->config[18] & CB_CFIG_CRC_IN_MEM) { + bdp->config[18] &= !CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + } spin_unlock_bh(&(bdp->config_lock)); } --- linux-2.4.22/drivers/net/e100/e100_config.h 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.h 2003-11-24 21:15:03.000000000 -0800 @@ -67,6 +67,7 @@ #define CB_CFIG_CI_INT BIT_3 /* Command Complete Interrupt */ #define CB_CFIG_EXT_TCB_DIS BIT_4 /* Extended TCB */ #define CB_CFIG_EXT_STAT_DIS BIT_5 /* Extended Stats */ +#define CB_CFIG_SAVE_OVERRUNS BIT_6 /* Save over-run frames if != 0 */ #define CB_CFIG_SAVE_BAD_FRAMES BIT_7 /* Save Bad Frames Enabled */ /* byte 7 bit definitions*/ @@ -117,6 +118,8 @@ #define CB_CFIG_STRIPPING BIT_0 /* Padding Disabled */ #define CB_CFIG_PADDING BIT_1 /* Padding Disabled */ #define CB_CFIG_CRC_IN_MEM BIT_2 /* Transfer CRC To Memory */ +/* Only valid for 82558 and 82559. Must be zero for 82557 */ +#define CB_CFIG_LONG_RX_OK BIT_3 /* OK to receive Long frames */ /* byte 19 bit definitions*/ #define CB_CFIG_TX_ADDR_WAKE BIT_0 /* Address Wakeup */ @@ -142,8 +145,7 @@ /* byte 22 bit defines */ #define CB_CFIG_RECEIVE_GAMLA_MODE BIT_0 /* D102 receive mode */ #define CB_CFIG_VLAN_DROP_ENABLE BIT_1 /* vlan stripping */ - -#define CB_CFIG_LONG_RX_OK BIT_3 +/* LONG-RX OK (needed for VLAN) is in byte 18, bit 3, see above */ #define NO_LOOPBACK 0 #define MAC_LOOPBACK 0x01 @@ -155,7 +157,8 @@ extern unsigned char e100_config(struct e100_private *bdp); extern void e100_config_fc(struct e100_private *bdp); extern void e100_config_promisc(struct e100_private *bdp, unsigned char enable); +extern void e100_config_rx_all(struct e100_private *bdp, unsigned char enable); extern void e100_config_brdcast_dsbl(struct e100_private *bdp); extern void e100_config_mulcast_enbl(struct e100_private *bdp, unsigned char enable); --- linux-2.4.22/drivers/net/e100/e100.h 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100.h 2003-11-24 21:15:03.000000000 -0800 @@ -362,6 +362,7 @@ #define CB_EL_BIT BIT_15 /* CB EL Bit */ #define CB_S_BIT BIT_14 /* CB Suspend Bit */ #define CB_I_BIT BIT_13 /* CB Interrupt Bit */ +#define CB_TX_NC_BIT BIT_4 /* If true, do not calculate FCS */ #define CB_TX_SF_BIT BIT_3 /* TX CB Flexible Mode */ #define CB_CMD_MASK BIT_0_3 /* CB 4-bit CMD Mask */ #define CB_CID_DEFAULT (0x1f << 8) /* CB 5-bit CID (max value) */ --------------080305050402040001000303-- From greearb@candelatech.com Mon Nov 24 23:54:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Nov 2003 23:55:08 -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 hAP7st25020322 for ; Mon, 24 Nov 2003 23:54:55 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAP7snKt030576 for ; Mon, 24 Nov 2003 23:54:49 -0800 Message-ID: <3FC30AC8.3080600@candelatech.com> Date: Mon, 24 Nov 2003 23:54:48 -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 2/3] rx_all_headers patch Content-Type: multipart/mixed; boundary="------------010906000305060703090904" X-archive-position: 1663 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. --------------010906000305060703090904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------010906000305060703090904 Content-Type: text/plain; name="rx_all_headers.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rx_all_headers.patch" --- linux-2.4.22/include/linux/netdevice.h 2003-11-24 23:14:20.000000000 -0800 +++ linux-2.4.22.p4s/include/linux/netdevice.h 2003-11-24 19:57:08.000000000 -0800 @@ -310,7 +310,9 @@ unsigned short flags; /* interface flags (a la BSD) */ unsigned short gflags; - unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ + unsigned short priv_flags; /* Like 'flags' but invisible to userspace, + * see: if.h for flag definitions. + */ unsigned short unused_alignment_fixer; /* Because we need priv_flags, * and we want to be 32-bit aligned. */ @@ -381,8 +383,14 @@ #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ +#define NETIF_F_RX_ALL 2048 /* Can be configured to receive all packets, even + * ones with busted CRC. May disable VLAN filtering + * in the NIC, users should NOT enable this feature + * unless they understand the consequences. */ +#define NETIF_F_SAVE_CRC 4096 /* Can save FCS in skb, last 4 bytes for ethernet */ + /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); /* Called after last user reference disappears. */ --- linux-2.4.22/include/linux/if.h 2003-11-24 23:14:20.000000000 -0800 +++ linux-2.4.22.p4s/include/linux/if.h 2003-11-24 19:15:27.000000000 -0800 @@ -50,6 +50,18 @@ /* Private (from user) interface flags (netdevice->priv_flags). */ #define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ +#define IFF_PKTGEN_RCV 0x2 /* Registered to receive & consume Pktgen skbs */ +#define IFF_ACCEPT_LOCAL_ADDRS 0x4 /** Accept pkts even if they come from a local + * address. This lets use send pkts to ourselves + * over external interfaces (when used in conjunction + * with SO_BINDTODEVICE + */ +#define IFF_ACCEPT_ALL_FRAMES 0x8 /** Accept all frames, even ones with bad CRCs. + * Should only be used in debugging/testing situations + * Do NOT enable this unless you understand the + * consequences! */ +#define IFF_SAVE_FCS 0x10 /** Save the Frame Check Sum (FCS) on receive, if + * possible. */ #define IF_GET_IFACE 0x0001 /* for querying only */ --------------010906000305060703090904-- From greearb@candelatech.com Tue Nov 25 01:17:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 01:17:52 -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 hAP9HY25027406 for ; Tue, 25 Nov 2003 01:17:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAP9HSKt008581 for ; Tue, 25 Nov 2003 01:17:28 -0800 Message-ID: <3FC31E28.8060106@candelatech.com> Date: Tue, 25 Nov 2003 01:17:28 -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 0/3] e100: Enable receiving bogus packets and saving FCS Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1665 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 Mon, 24 Nov 2003 15:48:25 -0800 > Ben Greear wrote: > > >>So, RX-ALL can be one flag, another for RX-FCS, and the TX-CUSTOM-FCS >>can be a separate patch altogether? > > > That is the basic idea, yes. Here are three patches. These were extracted manually from my big patchset. Where flags are defined, I left in the pktgen receive flag and the send-to-self flag from my larger patch set. If this is unacceptable, I can shuffle the flags around.... rx_all_ethtool.patch is the ethtool glue to turn on/off the RX-ALL and SAVE-FCS flags. I have not tested any of the ethtool-ops code branches as e100 and e1000 does not appear to use it. rx_all_headers.patch should take care of defining the flags in if.h and netdevice.h rx_all_e100.patch converts the e100 driver to support these features. I've ripped out the tx-custom-fcs code, but the rx-all and save-fcs code is there. The default behaviour is virtually identical, because while the old code was enabling receiving a lot of bad packets when in PROMISC mode, the check in e100_main rx code was throwing away anything that was not marked as good anyway... > However, one thing I want to make absolutely clear is that I do not > want multiple ways to get the same information out of the kernel. > We decided to build netlink into the kernel always because this means > it is present in everyone's kernel. And therefore, we don't need to > add another way to obtain the same config information already > available via netlink. The existing cases where an ioctl() style > call exists to obtain the same info available via netlink is merely > for compatability with older BSD tools. No new such things will be > added. Ok, I won't ask again. I attempted to get rid of all the 'ndstats' code from these patches. If some is still in there, it's an accident and I'll remove it. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From greearb@candelatech.com Mon Nov 24 23:53:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 04:11:45 -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 hAP7rH25020255 for ; Mon, 24 Nov 2003 23:53:19 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAP7rBKt030359 for ; Mon, 24 Nov 2003 23:53:11 -0800 Message-ID: <3FC30A67.2010602@candelatech.com> Date: Mon, 24 Nov 2003 23:53:11 -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 CC: netdev@oss.sgi.com Subject: [PATCH 0/3] e100: Enable receiving bogus packets and saving FCS References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> <3FC298C9.8080302@candelatech.com> <20031124173330.096c0751.davem@redhat.com> In-Reply-To: <20031124173330.096c0751.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1666 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: greearb@candelatech.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Mon, 24 Nov 2003 15:48:25 -0800 > Ben Greear wrote: > > >>So, RX-ALL can be one flag, another for RX-FCS, and the TX-CUSTOM-FCS >>can be a separate patch altogether? > > > That is the basic idea, yes. Here are three patches. These were extracted manually from my big patchset. Where flags are defined, I left in the pktgen receive flag and the send-to-self flag from my larger patch set. If this is unacceptable, I can shuffle the flags around.... rx_all_ethtool.patch is the ethtool glue to turn on/off the RX-ALL and SAVE-FCS flags. I have not tested any of the ethtool-ops code branches as e100 and e1000 does not appear to use it. rx_all_headers.patch should take care of defining the flags in if.h and netdevice.h rx_all_e100.patch converts the e100 driver to support these features. I've ripped out the tx-custom-fcs code, but the rx-all and save-fcs code is there. The default behaviour is virtually identical, because while the old code was enabling receiving a lot of bad packets when in PROMISC mode, the check in e100_main rx code was throwing away anything that was not marked as good anyway... > However, one thing I want to make absolutely clear is that I do not > want multiple ways to get the same information out of the kernel. > We decided to build netlink into the kernel always because this means > it is present in everyone's kernel. And therefore, we don't need to > add another way to obtain the same config information already > available via netlink. The existing cases where an ioctl() style > call exists to obtain the same info available via netlink is merely > for compatability with older BSD tools. No new such things will be > added. Ok, I won't ask again. I attempted to get rid of all the 'ndstats' code from these patches. If some is still in there, it's an accident and I'll remove it. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From rask@sygehus.dk Tue Nov 25 04:57:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 04:57:36 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPCvGTa012455 for ; Tue, 25 Nov 2003 04:57:17 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 5745919196; Tue, 25 Nov 2003 13:57:14 +0100 (CET) Date: Tue, 25 Nov 2003 13:57:14 +0100 From: Rask Ingemann Lambertsen To: Jeff Garzik Cc: Linux Kernel , akpm@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH/CFT] de2104x fixes Message-ID: <20031125135713.A9450@sygehus.dk> References: <200311212051.32352.russell@coker.com.au> <3FBE5E70.9060102@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FBE5E70.9060102@pobox.com>; from jgarzik@pobox.com on Fri, Nov 21, 2003 at 01:50:24PM -0500 X-archive-position: 1667 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 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 21, 2003 at 01:50:24PM -0500, Jeff Garzik wrote: > So, can people give this a test? It includes a change that, I hope, > addresses Russell's problem, as well as a patch from Rask. I have attached a patch which fixes two problems I found during compilation: 1) de_open() no longer uses the flags variable because the spinlocking is gone, but I forgot to remove the variable. 2) __de_set_settings() now references dev which is undefined. The patch should be applied on top of your patch, Jeff. -- Regards, Rask Ingemann Lambertsen --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="de2104x-fix-for-jeff.patch" --- linux-2.6.0-test8/drivers/net/tulip/de2104x.c-orig Tue Nov 25 13:20:25 2003 +++ linux-2.6.0-test8/drivers/net/tulip/de2104x.c Tue Nov 25 13:20:25 2003 @@ -1384,7 +1384,6 @@ static int de_open (struct net_device *d { struct de_private *de = dev->priv; int rc; - unsigned long flags; if (netif_msg_ifup(de)) printk(KERN_DEBUG "%s: enabling interface\n", dev->name); @@ -1601,7 +1600,7 @@ static int __de_set_settings(struct de_p (ecmd->advertising == de->media_advertise)) return 0; /* nothing to change */ - if (netif_running(dev)) { + if (netif_running(de->dev)) { de_link_down(de); de_stop_rxtx(de); } @@ -1610,7 +1609,7 @@ static int __de_set_settings(struct de_p de->media_lock = media_lock; de->media_advertise = ecmd->advertising; - if (netif_running(dev)) + if (netif_running(de->dev)) de_set_media(de); return 0; --uAKRQypu60I7Lcqm-- From yoshfuji@linux-ipv6.org Tue Nov 25 05:40:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 05:40:39 -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.9) with SMTP id hAPDe5Ta013224 for ; Tue, 25 Nov 2003 05:40:26 -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 hAPDeclg010207; Tue, 25 Nov 2003 22:40:38 +0900 Date: Tue, 25 Nov 2003 22:40:37 +0900 (JST) Message-Id: <20031125.224037.85040739.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] IPV6: redo stateless addrconf properly 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: 1668 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. Interface that had configured via stateless addrconf did not do stateless addrconf again correctly after interface was down. Forget IF_RS_SENT|IF_RA_RCVD flags when interface goes down. Patch is against 2.6.0-test10, but similar logic applies to 2.4.x and 2.2.x. Thanks. ===== net/ipv6/addrconf.c 1.76 vs edited ===== --- 1.76/net/ipv6/addrconf.c Sun Nov 9 15:32:54 2003 +++ edited/net/ipv6/addrconf.c Tue Nov 25 22:23:03 2003 @@ -1924,9 +1924,13 @@ write_unlock_bh(&addrconf_hash_lock); } - /* Step 3: clear address list */ - write_lock_bh(&idev->lock); + + /* Step 3: clear flags for stateless addrconf */ + if (how != 1) + idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); + + /* Step 4: clear address list */ #ifdef CONFIG_IPV6_PRIVACY if (how == 1 && del_timer(&idev->regen_timer)) in6_dev_put(idev); @@ -1962,7 +1966,7 @@ } write_unlock_bh(&idev->lock); - /* Step 4: Discard multicast list */ + /* Step 5: Discard multicast list */ if (how == 1) ipv6_mc_destroy_dev(idev); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From rask@sygehus.dk Tue Nov 25 06:42:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 06:43:08 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPEgpTa015026 for ; Tue, 25 Nov 2003 06:42:52 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 89E7D1933F; Tue, 25 Nov 2003 15:42:50 +0100 (CET) Date: Tue, 25 Nov 2003 15:42:49 +0100 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Message-ID: <20031125154249.B1107@sygehus.dk> References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> <3FC298C9.8080302@candelatech.com> <20031124173330.096c0751.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: <20031124173330.096c0751.davem@redhat.com>; from davem@redhat.com on Mon, Nov 24, 2003 at 05:33:30PM -0800 X-archive-position: 1669 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 Mon, Nov 24, 2003 at 05:33:30PM -0800, David S. Miller wrote: > On Mon, 24 Nov 2003 15:48:25 -0800 > Ben Greear wrote: > > > Btw, it's impossible (afaik) to see the CRC errors generically w/out > > accessing netlink (which I assume works, but have never actually tried), ie > The netlink thing does work, trust me :) > You could argue that 'ip -s link' should print this out, and I'd > agree with you on that. Give it another -s, i.e. 'ip -s -s link', and it does. :-) -- Regards, Rask Ingemann Lambertsen From davem@pizda.ninka.net Tue Nov 25 06:45:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 06:46: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.9) with SMTP id hAPEjsTa015416 for ; Tue, 25 Nov 2003 06:45:54 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id GAA31258; Tue, 25 Nov 2003 06:45:33 -0800 Date: Tue, 25 Nov 2003 06:45:33 -0800 From: "David S. Miller" To: Rask Ingemann Lambertsen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Message-Id: <20031125064533.44400654.davem@redhat.com> In-Reply-To: <20031125154249.B1107@sygehus.dk> References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> <3FC298C9.8080302@candelatech.com> <20031124173330.096c0751.davem@redhat.com> <20031125154249.B1107@sygehus.dk> 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: 1670 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, 25 Nov 2003 15:42:49 +0100 Rask Ingemann Lambertsen wrote: > On Mon, Nov 24, 2003 at 05:33:30PM -0800, David S. Miller wrote: > > The netlink thing does work, trust me :) > > You could argue that 'ip -s link' should print this out, and I'd > > agree with you on that. > > Give it another -s, i.e. 'ip -s -s link', and it does. :-) I certainly learned something today :) From rask@sygehus.dk Tue Nov 25 06:56:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 06:56:30 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPEuETa015901 for ; Tue, 25 Nov 2003 06:56:15 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 7686E1934A; Tue, 25 Nov 2003 15:56:13 +0100 (CET) Date: Tue, 25 Nov 2003 15:56:12 +0100 From: Rask Ingemann Lambertsen To: netdev@oss.sgi.com Subject: Re: [PATCH] e100: Enable receiving bogus packets, and transmitting bad/custom CRC Message-ID: <20031125155612.C1107@sygehus.dk> References: <3FC2931B.3070903@candelatech.com> <20031124152933.1420f6cf.davem@redhat.com> <3FC298C9.8080302@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: <3FC298C9.8080302@candelatech.com>; from greearb@candelatech.com on Mon, Nov 24, 2003 at 03:48:25PM -0800 X-archive-position: 1671 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 Mon, Nov 24, 2003 at 03:48:25PM -0800, Ben Greear wrote: > > So, RX-ALL can be one flag, another for RX-FCS, and the TX-CUSTOM-FCS > can be a separate patch altogether? Yes. For example, the i82586 can support RX-ALL but not RX-FCS, and TX-CUSTOM-FCS would be more work than with i82596 and i82557/8/9. Since the i82586 has a global (as opposed to per TX cmd) TX-CUSTOM-FCS flag, it would be necessary to send a configure command whenever this flag changes from one TX skb to another. So yes, please separate these features. -- Regards, Rask Ingemann Lambertsen From rask@sygehus.dk Tue Nov 25 07:21:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 07:22:12 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPFLvTa017028 for ; Tue, 25 Nov 2003 07:21:58 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id BF76719357; Tue, 25 Nov 2003 16:21:56 +0100 (CET) Date: Tue, 25 Nov 2003 16:21:56 +0100 From: Rask Ingemann Lambertsen To: Ben Greear Cc: "'netdev@oss.sgi.com'" Subject: Re: [PATCH 3/3] rx_all e100 patch Message-ID: <20031125162152.D1107@sygehus.dk> References: <3FC30AEE.7000005@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: <3FC30AEE.7000005@candelatech.com>; from greearb@candelatech.com on Mon, Nov 24, 2003 at 11:55:26PM -0800 X-archive-position: 1672 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 Mon, Nov 24, 2003 at 11:55:26PM -0800, Ben Greear wrote: > @@ -2052,13 +2065,26 @@ > if (bdp->rev_id >= D102_REV_ID) { > skb->ip_summed = e100_D102_check_checksum(rfd); > } else { > - skb->ip_summed = e100_D101M_checksum(bdp, skb); > + skb->ip_summed = e100_D101M_checksum(bdp, skb, !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)); > } Shouldn't that be IFF_SAVE_FCS rather than IFF_ACCEPT_ALL_FRAMES? > } else { > skb->ip_summed = CHECKSUM_NONE; > } > > + /* Show the FCS? */ > + if (unlikely(dev->priv_flags & IFF_SAVE_FCS)) { > + if (bdp->rev_id < D102_REV_ID) { > + /* Have to over-write the two IP checksum bytes > + * TODO: Will this break vlan_hwaccel_rx??? > + */ > + skb->tail[-4] = skb->tail[-2]; > + skb->tail[-3] = skb->tail[-1]; > + skb->tail[-2] = skb->tail[0]; > + skb->tail[-1] = skb->tail[1]; > + } > + } > + I don't understand this part of the code. The 55x docs say that the IP checksum bytes are transferred to memory _following_ the FCS. > +/** > + * e100_config_promisc - configure promiscuous mode > + * @bdp: atapter's private data struct > + * @enable: should we enable this option or not s/atapter/adapter/g s/etherne /ethernet /g too, somewhere, IIRC. > +/* Only valid for 82558 and 82559. Must be zero for 82557 */ > +#define CB_CFIG_LONG_RX_OK BIT_3 /* OK to receive Long frames */ I find it disappointing that the good, old 82586 transfers long frames to memory without complaint while newer chips such as the 82557 and tulip can't/don't. -- Regards, Rask Ingemann Lambertsen From jeroen@science.uva.nl Tue Nov 25 08:35:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 08:35:42 -0800 (PST) Received: from mail.science.uva.nl (root@mail.science.uva.nl [146.50.4.51]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPGZ6Ta022891 for ; Tue, 25 Nov 2003 08:35:28 -0800 Received: from knuth.science.uva.nl [146.50.3.24] by mail.science.uva.nl with ESMTP (sendmail 8.11.6p2/config 11.34). id hAPGZ3E25217; Tue, 25 Nov 2003 17:35:03 +0100 (MET) X-Organisation: Faculty of Science, University of Amsterdam, The Netherlands X-URL: http://www.science.uva.nl/ Subject: Forcedeth v18 Success! From: Jeroen Roodhart To: netdev@oss.sgi.com Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ioqOJhyG6iHlqwQ9D+F4" Organization: University of Amsterdam, Science Faculty, ICT Group Message-Id: <1069778103.29938.4.camel@knuth.science.uva.nl> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 25 Nov 2003 17:35:03 +0100 X-archive-position: 1673 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeroen@science.uva.nl Precedence: bulk X-list: netdev --=-ioqOJhyG6iHlqwQ9D+F4 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Just wanted to let you know: Your forcdeth v18 driver runs without problem thus far on an Asus A7N8X-X mobo, Arjan de Ven's 2.6 kernel (based on=20 2.6-pre9++) on Fedora core 1. (gcc-3.3 compiled) Great job, thank you very much! Jeroen --=20 Jeroen Roodhart University of Amsterdam =20 jeroen@science.uva.nl Faculty of Science / ICT-Group =20 Systeem- en netwerkbeheer Tel. 020 525 7203 / 06 51338165 -- See http://www.science.uva.nl/~jeroen for openPGP public key=20 --=-ioqOJhyG6iHlqwQ9D+F4 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/w4S237AP1zFtDU0RAuGCAKDp5yES+U+GGWNhxxJJsyHtI5Y+AQCfSCkl ZBWSlcgrkW05LNgLNVgKELw= =ccFI -----END PGP SIGNATURE----- --=-ioqOJhyG6iHlqwQ9D+F4-- From rask@sygehus.dk Tue Nov 25 08:56:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 08:56:31 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPGuETa024275 for ; Tue, 25 Nov 2003 08:56:15 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 1127119376; Tue, 25 Nov 2003 17:56:12 +0100 (CET) Date: Tue, 25 Nov 2003 17:56:11 +0100 From: Rask Ingemann Lambertsen To: Ben Greear Cc: "'netdev@oss.sgi.com'" Subject: Re: [PATCH 3/3] rx_all e100 patch Message-ID: <20031125175611.A1506@sygehus.dk> References: <3FC30AEE.7000005@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: <3FC30AEE.7000005@candelatech.com>; from greearb@candelatech.com on Mon, Nov 24, 2003 at 11:55:26PM -0800 X-archive-position: 1674 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 Mon, Nov 24, 2003 at 11:55:26PM -0800, Ben Greear wrote: > + /* Discard over-runs */ > + if (bdp->config[6] & CB_CFIG_SAVE_OVERRUNS) { > + bdp->config[6] &= !CB_CFIG_SAVE_OVERRUNS; > + E100_CONFIG(bdp, 6); > } > - } > + > + /* Don't send CRC (FCS) to memory */ > + if (bdp->config[18] & CB_CFIG_CRC_IN_MEM) { > + bdp->config[18] &= !CB_CFIG_CRC_IN_MEM; > + E100_CONFIG(bdp, 18); > + } > + } I think you want ~CB_CFIG_XXX instead of !CB_CFIG_XXX. -- Regards, Rask Ingemann Lambertsen From anand@eis.iisc.ernet.in Tue Nov 25 09:21:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 09:21:50 -0800 (PST) Received: from iisc.ernet.in (iisc.ernet.in [144.16.64.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPHLYTa024945 for ; Tue, 25 Nov 2003 09:21:36 -0800 Received: from eis.iisc.ernet.in (eis.iisc.ernet.in [144.16.64.5]) by iisc.ernet.in (8.11.6/8.11.6) with SMTP id hAPHPGQ03987; Tue, 25 Nov 2003 22:55:16 +0530 Received: by eis.iisc.ernet.in (SMI-8.6/SMI-4.1) id WAA25695; Tue, 25 Nov 2003 22:51:21 +0530 From: anand@eis.iisc.ernet.in (SVR Anand) Message-Id: <200311251721.WAA25695@eis.iisc.ernet.in> Subject: Re: 2.6.0-test9-bk25 : bridge works fine To: davem@redhat.com (David S. Miller) Date: Tue, 25 Nov 2003 22:51:21 +0530 (GMT+05:30) Cc: torvalds@osdl.org (Linus Torvalds), linux-kernel@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20031123152601.67646dc1.davem@redhat.com> from "David S. Miller" at Nov 23, 2003 03:26:01 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1675 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anand@eis.iisc.ernet.in Precedence: bulk X-list: netdev Hi, With test9-bk25, I am not facing any problem for the past many hours which was not to be the case with test9. I am hopeful that it will work for ever. Thanks a lot for all the help. Next time I should make it a point to try on the latest of the latest before shooting off a mail :) Anand > > On Sat, 22 Nov 2003 08:20:40 -0800 (PST) > Linus Torvalds wrote: > > > On Sat, 22 Nov 2003, SVR Anand wrote: > > > > > > The problem is : After 3 to 4 hours of functioning, the bridge stops working > > > and the machine becomes unusable where it doesn't respond to keyboard, and > > > there is no video display. > > > > Sounds like a memory leak somewhere. It would probably be interesting to > > watch /proc/slabinfo every five minutes or so, and see what happens.. > > Also, we've certainly fixed some serious networking bugs since test9 > came out. > From scott.feldman@intel.com Tue Nov 25 09:39:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 09:39:57 -0800 (PST) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPHdhTa029720 for ; Tue, 25 Nov 2003 09:39:44 -0800 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.11.6/d: major-outer.mc,v 1.9 2003/11/03 20:24:21 root Exp $) with ESMTP id hAPHdsao024944; Tue, 25 Nov 2003 17:39:55 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.jf.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 hAPHXYR04265; Tue, 25 Nov 2003 17:33:34 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.1.32) with SMTP id M2003112509393007474 ; Tue, 25 Nov 2003 09:39:30 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 25 Nov 2003 09:39:30 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: [PATCH 3/3] rx_all e100 patch Date: Tue, 25 Nov 2003 09:39:29 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 3/3] rx_all e100 patch Thread-Index: AcOzKbZoLKdeVpCoSn+Ycoa7iIHGygAUHnKQ From: "Feldman, Scott" To: "Ben Greear" , X-OriginalArrivalTime: 25 Nov 2003 17:39:30.0192 (UTC) FILETIME=[1472C100:01C3B37B] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAPHdhTa029720 X-archive-position: 1676 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev Ben, I'd rather not touch e100-2.3.x as it's going to be replaced soon with e100-3.0.x. Can you switch over to e100-3.0.x for this development? It's up on the sf.net/projects/e1000 web site. I think you'll find this patch collapses into much fewer lines with the new driver. It has ethtool_ops support also. I can work on the e100-3.0.x patch if you don't want to redo the work. Let me know. -scott From scott.feldman@intel.com Tue Nov 25 09:50:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 09:51:12 -0800 (PST) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPHowTa031037 for ; Tue, 25 Nov 2003 09:50:58 -0800 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.11.6/d: major-outer.mc,v 1.9 2003/11/03 20:24:21 root Exp $) with ESMTP id hAPHpGao002534 for ; Tue, 25 Nov 2003 17:51:16 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.jf.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 hAPHitR17648 for ; Tue, 25 Nov 2003 17:44:55 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003112509505100187 for ; Tue, 25 Nov 2003 09:50:51 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 25 Nov 2003 09:50:51 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: netdev->mem_start, etc Date: Tue, 25 Nov 2003 09:50:50 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: netdev->mem_start, etc Thread-Index: AcOzfUC51mv2LEoWTMuC8kxG+CGA0w== From: "Feldman, Scott" To: X-OriginalArrivalTime: 25 Nov 2003 17:50:51.0013 (UTC) FILETIME=[AA3FCB50:01C3B37C] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAPHowTa031037 X-archive-position: 1677 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev Is there any reason why these fields should be set for a PCI nic driver? netdev->mem_start netdev->mem_end netdev->base_addr They seem to be vestigial. (I'm trying to prune a e100/e1000 dependency with a app that's matching on these fields to figure out PCI device ID). -scott From rddunlap@osdl.org Tue Nov 25 10:00:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 10:00:51 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPI0CTa031587 for ; Tue, 25 Nov 2003 10:00:34 -0800 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id hAPHxxC26401; Tue, 25 Nov 2003 09:59:59 -0800 Date: Tue, 25 Nov 2003 09:53:57 -0800 From: "Randy.Dunlap" To: "Feldman, Scott" Cc: netdev@oss.sgi.com Subject: Re: netdev->mem_start, etc Message-Id: <20031125095357.72a06e17.rddunlap@osdl.org> In-Reply-To: References: Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1678 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 Tue, 25 Nov 2003 09:50:50 -0800 "Feldman, Scott" wrote: | Is there any reason why these fields should be set for a PCI nic driver? | | netdev->mem_start | netdev->mem_end | netdev->base_addr | | They seem to be vestigial. | | (I'm trying to prune a e100/e1000 dependency with a app that's matching | on these fields to figure out PCI device ID). In several drivers mem_start has been overloaded to pass something often called 'options', like media type, connector, auto-negotiate, duplex, etc. settings. -- ~Randy MOTD: Always include version info. From greearb@candelatech.com Tue Nov 25 10:03:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 10:03:49 -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.9) with SMTP id hAPI3YTa032370 for ; Tue, 25 Nov 2003 10:03:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAPI3LKt013721; Tue, 25 Nov 2003 10:03:23 -0800 Message-ID: <3FC39969.4030609@candelatech.com> Date: Tue, 25 Nov 2003 10:03:21 -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: Rask Ingemann Lambertsen CC: "'netdev@oss.sgi.com'" Subject: Re: [PATCH 3/3] rx_all e100 patch References: <3FC30AEE.7000005@candelatech.com> <20031125162152.D1107@sygehus.dk> In-Reply-To: <20031125162152.D1107@sygehus.dk> Content-Type: multipart/mixed; boundary="------------070408020408090403060907" X-archive-position: 1679 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. --------------070408020408090403060907 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Rask Ingemann Lambertsen wrote: > On Mon, Nov 24, 2003 at 11:55:26PM -0800, Ben Greear wrote: > >>@@ -2052,13 +2065,26 @@ >> if (bdp->rev_id >= D102_REV_ID) { >> skb->ip_summed = e100_D102_check_checksum(rfd); >> } else { >>- skb->ip_summed = e100_D101M_checksum(bdp, skb); >>+ skb->ip_summed = e100_D101M_checksum(bdp, skb, !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)); >> } > > > Shouldn't that be IFF_SAVE_FCS rather than IFF_ACCEPT_ALL_FRAMES? Yes, will fix, actually, considering your next comment, it should not even be needed at all, eh? >> } else { >> skb->ip_summed = CHECKSUM_NONE; >> } >> >>+ /* Show the FCS? */ >>+ if (unlikely(dev->priv_flags & IFF_SAVE_FCS)) { >>+ if (bdp->rev_id < D102_REV_ID) { >>+ /* Have to over-write the two IP checksum bytes >>+ * TODO: Will this break vlan_hwaccel_rx??? >>+ */ >>+ skb->tail[-4] = skb->tail[-2]; >>+ skb->tail[-3] = skb->tail[-1]; >>+ skb->tail[-2] = skb->tail[0]; >>+ skb->tail[-1] = skb->tail[1]; >>+ } >>+ } >>+ > > > I don't understand this part of the code. The 55x docs say that the IP > checksum bytes are transferred to memory _following_ the FCS. I can't find this in the docs, but it could easily be true. If you have a page/section number, please let me know. I don't appear to have hardware that takes this branch at any rate. Anyone know which chipset/NIC has this particular rev-id? Also, this should invalidate all of the hacks from the e100_D101M_checksum code... > > >>+/** >>+ * e100_config_promisc - configure promiscuous mode >>+ * @bdp: atapter's private data struct >>+ * @enable: should we enable this option or not > > > s/atapter/adapter/g > > s/etherne /ethernet /g too, somewhere, IIRC. > > >>+/* Only valid for 82558 and 82559. Must be zero for 82557 */ >>+#define CB_CFIG_LONG_RX_OK BIT_3 /* OK to receive Long frames */ > > > I find it disappointing that the good, old 82586 transfers long frames to > memory without complaint while newer chips such as the 82557 and tulip > can't/don't. Tulip can at least work with VLANs with a hack or two, but not sure how it's max longness. There may be other ways to get the 82557 to do VLANs, but the docs definately indicate the rx-long bit does not exist for 82557 (page 62-64, byte 18, bit 3) of the e100 docs from sourceforge. Thanks for the thorough review. Attached is a new patch that I believe addresses these problems. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------070408020408090403060907 Content-Type: text/plain; name="rx_all_e100.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rx_all_e100.patch" --- linux-2.4.22/drivers/net/e100/e100_main.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_main.c 2003-11-25 09:56:38.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/** -*-linux-c-*- ************************************************************ Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -644,8 +644,9 @@ dev->do_ioctl = &e100_ioctl; if (bdp->flags & USE_IPCB) - dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | + NETIF_F_RX_ALL | NETIF_F_SAVE_CRC; if ((rc = register_netdev(dev)) != 0) { goto err_pci; @@ -830,7 +831,7 @@ /** * e100_check_options - check command line options * @board: board number - * @bdp: atapter's private data struct + * @bdp: adapter's private data struct * * This routine does range checking on command-line options */ @@ -1198,11 +1199,17 @@ struct e100_private *bdp = dev->priv; unsigned char promisc_enbl; unsigned char mulcast_enbl; + unsigned char enable_rx_all; promisc_enbl = ((dev->flags & IFF_PROMISC) == IFF_PROMISC); mulcast_enbl = ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > MAX_MULTICAST_ADDRS)); + enable_rx_all = ((dev->priv_flags & IFF_ACCEPT_ALL_FRAMES) == IFF_ACCEPT_ALL_FRAMES); + printk("e100_set_rx_multi (%s), promisc: %d mcast: %d rxall: %d\n", + dev->name, promisc_enbl, mulcast_enbl, enable_rx_all); + /* NOTE: rx_long is unconditionally set to TRUE if the chipset supports it. */ + e100_config_rx_all(bdp, enable_rx_all); e100_config_promisc(bdp, promisc_enbl); e100_config_mulcast_enbl(bdp, mulcast_enbl); @@ -2016,9 +2023,15 @@ /* do not free & unmap badly received packet. * move it to the end of skb list for reuse */ if (!(rfd_status & RFD_STATUS_OK)) { - e100_add_skb_to_end(bdp, rx_struct); - continue; + if (unlikely(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES)) { + /* printk("%s: Accepting a bogon, rfd_status: 0x%x\n", + dev->name, rfd_status); */ + } + else { + e100_add_skb_to_end(bdp, rx_struct); + continue; + } } data_sz = min_t(u16, (le16_to_cpu(rfd->rfd_act_cnt) & 0x3fff), @@ -2925,7 +2950,7 @@ /** * e100_D101M_checksum - * @bdp: atapter's private data struct + * @bdp: adapter's private data struct * @skb: skb received * * Sets the skb->csum value from D101 csum found at the end of the Rx frame. The @@ -3143,6 +3168,27 @@ } } +static int e100_ethtool_setrxall(struct net_device *netdev, uint32_t val) { + unsigned short old_flags = netdev->priv_flags; + if (val) { + netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES; + } + else { + netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES); + } + + /* printk("e100_ethtool_setrxall (%s) val: %d\n", + netdev->name, val); */ + if (old_flags != netdev->priv_flags) { + /* Kick the driver to flush the values... + * TODO: Needs review of driver folks to make sure locking is sane, etc + */ + /*printk("Kicking e100_set_multi..\n");*/ + e100_set_multi(netdev); + } + return 0; +} + static int e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr) { @@ -3342,7 +3388,43 @@ return 0; } #endif + case ETHTOOL_SETRXALL: { + struct ethtool_value id; + if (copy_from_user(&id, ifr->ifr_data, sizeof(id))) + return -EFAULT; + spin_lock_bh(&dev->xmit_lock); + e100_ethtool_setrxall(dev, id.data); + spin_unlock_bh(&dev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXALL: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(dev->priv_flags & IFF_ACCEPT_ALL_FRAMES); + /*printk("GETRXALL, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(ifr->ifr_data, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SETRXFCS: { + struct ethtool_value id; + if (copy_from_user(&id, ifr->ifr_data, sizeof(id))) + return -EFAULT; + spin_lock_bh(&dev->xmit_lock); + dev->priv_flags |= IFF_SAVE_FCS; + spin_unlock_bh(&dev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXFCS: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(dev->priv_flags & IFF_SAVE_FCS); + /*printk("GETRXFCS, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(ifr->ifr_data, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } default: break; } //switch --- linux-2.4.22/drivers/net/e100/e100_config.c 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.c 2003-11-25 09:05:26.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/**** -*-linux-c-*- *********************************************************** Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -326,42 +326,92 @@ { spin_lock_bh(&(bdp->config_lock)); - /* if in promiscuous mode, save bad frames */ + /* Promiscuity */ if (enable) { + if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { + bdp->config[15] |= CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + + } else { /* not in promiscuous mode */ + + if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { + bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; + E100_CONFIG(bdp, 15); + } + } + + spin_unlock_bh(&(bdp->config_lock)); +} + + +/** + * e100_config_promisc - configure promiscuous mode + * @bdp: adapter's private data struct + * @enable: should we enable this option or not + * + * This routine will enable or disable receiving all frames to + * memory, including bad ones, short ones, and long ones. It also + * causes the Frame Check Sum (FCS) to be transferred to memory. + */ +void +e100_config_rx_all(struct e100_private *bdp, unsigned char enable) +{ + spin_lock_bh(&(bdp->config_lock)); + + /* Should we save bad frames? */ + if (enable) { if (!(bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES)) { bdp->config[6] |= CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (bdp->config[7] & (u8) BIT_0) { - bdp->config[7] &= (u8) (~BIT_0); + /* Don't discard short-receive */ + if (bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES) { + bdp->config[7] &= (u8) (~CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (!(bdp->config[15] & CB_CFIG_PROMISCUOUS)) { - bdp->config[15] |= CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Save over-runs */ + if (!(bdp->config[6] & CB_CFIG_SAVE_OVERRUNS)) { + bdp->config[6] |= CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } else { /* not in promiscuous mode */ - + /* Transfer the etherne CRC to memory too */ + if (!(bdp->config[18] & CB_CFIG_CRC_IN_MEM)) { + bdp->config[18] |= CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + + } + else { + /* Don't discard short frames */ if (bdp->config[6] & CB_CFIG_SAVE_BAD_FRAMES) { bdp->config[6] &= ~CB_CFIG_SAVE_BAD_FRAMES; E100_CONFIG(bdp, 6); } - if (!(bdp->config[7] & (u8) BIT_0)) { - bdp->config[7] |= (u8) (BIT_0); + /* Discard short-receive */ + if (!(bdp->config[7] & (u8) CB_CFIG_DISC_SHORT_FRAMES)) { + bdp->config[7] |= (u8) (CB_CFIG_DISC_SHORT_FRAMES); E100_CONFIG(bdp, 7); } - if (bdp->config[15] & CB_CFIG_PROMISCUOUS) { - bdp->config[15] &= ~CB_CFIG_PROMISCUOUS; - E100_CONFIG(bdp, 15); + /* Discard over-runs */ + if (bdp->config[6] & CB_CFIG_SAVE_OVERRUNS) { + bdp->config[6] &= ~CB_CFIG_SAVE_OVERRUNS; + E100_CONFIG(bdp, 6); } - } + + /* Don't send CRC (FCS) to memory */ + if (bdp->config[18] & CB_CFIG_CRC_IN_MEM) { + bdp->config[18] &= ~CB_CFIG_CRC_IN_MEM; + E100_CONFIG(bdp, 18); + } + } spin_unlock_bh(&(bdp->config_lock)); } --- linux-2.4.22/drivers/net/e100/e100_config.h 2003-06-13 07:51:34.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100_config.h 2003-11-24 23:21:53.000000000 -0800 @@ -67,6 +67,7 @@ #define CB_CFIG_CI_INT BIT_3 /* Command Complete Interrupt */ #define CB_CFIG_EXT_TCB_DIS BIT_4 /* Extended TCB */ #define CB_CFIG_EXT_STAT_DIS BIT_5 /* Extended Stats */ +#define CB_CFIG_SAVE_OVERRUNS BIT_6 /* Save over-run frames if != 0 */ #define CB_CFIG_SAVE_BAD_FRAMES BIT_7 /* Save Bad Frames Enabled */ /* byte 7 bit definitions*/ @@ -117,6 +118,8 @@ #define CB_CFIG_STRIPPING BIT_0 /* Padding Disabled */ #define CB_CFIG_PADDING BIT_1 /* Padding Disabled */ #define CB_CFIG_CRC_IN_MEM BIT_2 /* Transfer CRC To Memory */ +/* Only valid for 82558 and 82559. Must be zero for 82557 */ +#define CB_CFIG_LONG_RX_OK BIT_3 /* OK to receive Long frames */ /* byte 19 bit definitions*/ #define CB_CFIG_TX_ADDR_WAKE BIT_0 /* Address Wakeup */ @@ -142,8 +145,7 @@ /* byte 22 bit defines */ #define CB_CFIG_RECEIVE_GAMLA_MODE BIT_0 /* D102 receive mode */ #define CB_CFIG_VLAN_DROP_ENABLE BIT_1 /* vlan stripping */ - -#define CB_CFIG_LONG_RX_OK BIT_3 +/* LONG-RX OK (needed for VLAN) is in byte 18, bit 3, see above */ #define NO_LOOPBACK 0 #define MAC_LOOPBACK 0x01 @@ -155,7 +157,8 @@ extern unsigned char e100_config(struct e100_private *bdp); extern void e100_config_fc(struct e100_private *bdp); extern void e100_config_promisc(struct e100_private *bdp, unsigned char enable); +extern void e100_config_rx_all(struct e100_private *bdp, unsigned char enable); extern void e100_config_brdcast_dsbl(struct e100_private *bdp); extern void e100_config_mulcast_enbl(struct e100_private *bdp, unsigned char enable); --- linux-2.4.22/drivers/net/e100/e100.h 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22.p4s/drivers/net/e100/e100.h 2003-11-24 23:21:53.000000000 -0800 @@ -362,6 +362,7 @@ #define CB_EL_BIT BIT_15 /* CB EL Bit */ #define CB_S_BIT BIT_14 /* CB Suspend Bit */ #define CB_I_BIT BIT_13 /* CB Interrupt Bit */ +#define CB_TX_NC_BIT BIT_4 /* If true, do not calculate FCS */ #define CB_TX_SF_BIT BIT_3 /* TX CB Flexible Mode */ #define CB_CMD_MASK BIT_0_3 /* CB 4-bit CMD Mask */ #define CB_CID_DEFAULT (0x1f << 8) /* CB 5-bit CID (max value) */ --------------070408020408090403060907-- From greearb@candelatech.com Tue Nov 25 10:05:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 10:05:48 -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.9) with SMTP id hAPI5ZTa000324 for ; Tue, 25 Nov 2003 10:05:35 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAPI5OKt013984; Tue, 25 Nov 2003 10:05:24 -0800 Message-ID: <3FC399E4.2080509@candelatech.com> Date: Tue, 25 Nov 2003 10:05:24 -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: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [PATCH 3/3] rx_all e100 patch References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1680 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 Feldman, Scott wrote: > Ben, I'd rather not touch e100-2.3.x as it's going to be replaced soon > with e100-3.0.x. Can you switch over to e100-3.0.x for this > development? It's up on the sf.net/projects/e1000 web site. I think > you'll find this patch collapses into much fewer lines with the new > driver. It has ethtool_ops support also. I can work on the e100-3.0.x > patch if you don't want to redo the work. Let me know. > > -scott > When is 3.0.X destined to hit 2.4? My personal priority is to get a patch that works against vanilla 2.4.$CURRENT, so I'll need to follow it in my own patch set. However, late-night typos aside, the changes to e100 are quite trivial, so I imagine you could make the changes in very short time to your other driver(s). I have to ship my own patchset for other features anyway, so one more doesn't hinder me too badly, ie if this takes a while to become mainline, that's ok. If we can get the ethtool and flags changes in soon, it will also be easy for you to do the testing, as ethereal works out-of-the-box. Dave seems interested, and the flags & ethtool changes are relatively trivial as well, so hopefully these will go in sometime soon. PS. Scott, is there an e1000 document similar to the e100 one available? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Tue Nov 25 11:43:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 11:43:28 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPJhFTa003113 for ; Tue, 25 Nov 2003 11:43:15 -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 hAPJh2C12743; Tue, 25 Nov 2003 11:43:03 -0800 Date: Tue, 25 Nov 2003 11:43:39 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/2) wan/hostess_sv11 -- get rid of mod inc/dec Message-Id: <20031125114339.36372791.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: 1681 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 explicit inc/dec are no longer needed in 2.6. Jeff, please add to net-drivers-2.5-exp diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c --- a/drivers/net/wan/hostess_sv11.c Mon Nov 24 15:37:26 2003 +++ b/drivers/net/wan/hostess_sv11.c Mon Nov 24 15:37:26 2003 @@ -122,7 +122,6 @@ */ netif_start_queue(d); - MOD_INC_USE_COUNT; return 0; } @@ -154,7 +153,6 @@ z8530_sync_txdma_close(d, &sv11->sync.chanA); break; } - MOD_DEC_USE_COUNT; return 0; } From shemminger@osdl.org Tue Nov 25 11:47:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 11:48:02 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPJlnTa003525 for ; Tue, 25 Nov 2003 11:47: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 hAPJlgC13694; Tue, 25 Nov 2003 11:47:42 -0800 Date: Tue, 25 Nov 2003 11:48:19 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/2) wan/hostess_sv11 - use alloc_netdev instead of kmalloc Message-Id: <20031125114819.19f8dda6.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: 1682 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 Convert this driver from doing explicit kmalloc() for net_device to using alloc_netdev(). Jeff, please apply to net-drivers-2.5-exp diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c --- a/drivers/net/wan/hostess_sv11.c Mon Nov 24 15:37:10 2003 +++ b/drivers/net/wan/hostess_sv11.c Mon Nov 24 15:37:10 2003 @@ -201,6 +201,18 @@ return 0; } +static __init void sv11_setup(struct net_device *d) +{ + d->open = hostess_open; + d->stop = hostess_close; + d->hard_start_xmit = hostess_queue_xmit; + d->get_stats = hostess_get_stats; + d->set_multicast_list = NULL; + d->do_ioctl = hostess_ioctl; + d->neigh_setup = hostess_neigh_setup_dev; + d->set_mac_address = NULL; +} + /* * Description block for a Comtrol Hostess SV11 card */ @@ -209,6 +221,7 @@ { struct z8530_dev *dev; struct sv11_device *sv; + struct net_device *d; /* * Get the needed I/O space @@ -220,17 +233,14 @@ return NULL; } - sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL); - if(!sv) - goto fail3; - - memset(sv, 0, sizeof(*sv)); - sv->if_ptr=&sv->netdev; - - sv->netdev.dev=(struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL); - if(!sv->netdev.dev) - goto fail2; + d = alloc_netdev(sizeof(struct sv11_device), + "hdlc%d", sv11_setup); + if (!d) + goto fail1; + sv = d->priv; + sv->if_ptr = &sv->netdev; + sv->netdev.dev=d; dev=&sv->sync; /* @@ -254,7 +264,7 @@ if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "Hostess SV/11", dev)<0) { printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq); - goto fail1; + goto fail2; } dev->irq=irq; @@ -273,7 +283,7 @@ dev->chanA.rxdma=1; outb(0x03|0x08, iobase+4); /* DMA on */ if(request_dma(dev->chanA.txdma, "Hostess SV/11 (TX)")!=0) - goto fail; + goto fail3; if(dma==1) { @@ -308,66 +318,53 @@ /* * Now we can take the IRQ */ - if(dev_alloc_name(dev->chanA.netdevice,"hdlc%d")>=0) - { - struct net_device *d=dev->chanA.netdevice; - /* - * Initialise the PPP components - */ - sppp_attach(&sv->netdev); - - /* - * Local fields - */ + /* + * Initialise the PPP components + */ + sppp_attach(&sv->netdev); - d->base_addr = iobase; - d->irq = irq; - d->priv = sv; - d->init = NULL; + /* + * Local fields + */ - d->open = hostess_open; - d->stop = hostess_close; - d->hard_start_xmit = hostess_queue_xmit; - d->get_stats = hostess_get_stats; - d->set_multicast_list = NULL; - d->do_ioctl = hostess_ioctl; - d->neigh_setup = hostess_neigh_setup_dev; - d->set_mac_address = NULL; + d->base_addr = iobase; + d->irq = irq; - if(register_netdev(d)) - { - printk(KERN_ERR "%s: unable to register device.\n", - d->name); - goto fail; - } - - z8530_describe(dev, "I/O", iobase); - dev->active=1; - return sv; - } + if(register_netdev(d)) { + printk(KERN_ERR "%s: unable to register device.\n", + d->name); + goto regfail; + } + + z8530_describe(dev, "I/O", iobase); + dev->active=1; + return sv; +regfail: + sppp_detach(sv->netdev.dev); + dmafail2: if(dma==1) free_dma(dev->chanA.rxdma); dmafail: if(dma) free_dma(dev->chanA.txdma); -fail: +fail3: free_irq(irq, dev); -fail1: - kfree(sv->netdev.dev); fail2: - kfree(sv); -fail3: + free_netdev(d); +fail1: release_region(iobase,8); return NULL; } -static void sv11_shutdown(struct sv11_device *dev) +static void __exit sv11_shutdown(struct sv11_device *dev) { - sppp_detach(dev->netdev.dev); + struct net_device *d = dev->netdev.dev; + + sppp_detach(d); z8530_shutdown(&dev->sync); - unregister_netdev(dev->netdev.dev); + unregister_netdev(d); free_irq(dev->sync.irq, dev); if(dma) { @@ -376,6 +373,7 @@ free_dma(dev->sync.chanA.txdma); } release_region(dev->sync.chanA.ctrlio-1, 8); + free_netdev(d); } #ifdef MODULE From shemminger@osdl.org Tue Nov 25 11:51:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 11:52:07 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPJpsTa003920 for ; Tue, 25 Nov 2003 11:51:54 -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 hAPJpkC14649; Tue, 25 Nov 2003 11:51:46 -0800 Date: Tue, 25 Nov 2003 11:52:22 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/3) wan/cosa - channel name pointer Message-Id: <20031125115222.593d074c.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: 1683 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 This driver keeps a copy of the device name in the local data structure; the problem is that the network device name can be changed with nameif but the local copy won't change. Changing this to a pointer rather than a copy and it is not a problem. diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Mon Nov 24 15:38:28 2003 +++ b/drivers/net/wan/cosa.c Mon Nov 24 15:38:28 2003 @@ -120,7 +120,7 @@ struct cosa_data *cosa; /* Pointer to the per-card structure */ int txsize; /* Size of transmitted data */ char *txbuf; /* Transmit buffer */ - char name[COSA_MAX_NAME]; /* channel name */ + char *name; /* network device name */ /* The HW layer interface */ /* routine called from the RX interrupt */ @@ -429,8 +429,6 @@ */ static __inline__ void channel_init(struct channel_data *chan) { - sprintf(chan->name, "cosa%dc%d", chan->cosa->num, chan->num); - /* Initialize the chardev data structures */ chardev_channel_init(chan); @@ -603,7 +601,8 @@ memset(chan->pppdev.dev, 0, sizeof(struct net_device)); sppp_attach(&chan->pppdev); d=chan->pppdev.dev; - strcpy(d->name, chan->name); + sprintf(d->name, "cosa%dc%d", chan->cosa->num, chan->num); + chan->name = d->name; d->base_addr = chan->cosa->datareg; d->irq = chan->cosa->irq; d->dma = chan->cosa->dma; -- Stephen Hemminger mailto:shemminger@osdl.org Open Source Development Lab http://developer.osdl.org/shemminger From shemminger@osdl.org Tue Nov 25 11:54:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 11:54:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPJsKTa004334 for ; Tue, 25 Nov 2003 11:54:20 -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 hAPJsBC14855; Tue, 25 Nov 2003 11:54:12 -0800 Date: Tue, 25 Nov 2003 11:54:48 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (3/3) wan/cosa - use alloc_netdev Message-Id: <20031125115448.33fb623b.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 hAPJsKTa004334 X-archive-position: 1684 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 Convert this driver: * use alloc_netdev to create the network device * use space from alloc_netdev for local channel data structure diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Mon Nov 24 15:38:43 2003 +++ b/drivers/net/wan/cosa.c Mon Nov 24 15:38:43 2003 @@ -166,7 +166,7 @@ struct channel_data *rxchan; char *bouncebuf; char *txbuf, *rxbuf; - struct channel_data *chan; + struct channel_data **chan; spinlock_t lock; /* For exclusive operations on this structure */ char id_string[COSA_MAX_ID_STRING]; /* ROM monitor ID string */ char *type; /* card type */ @@ -280,7 +280,7 @@ static int cosa_dma_able(struct channel_data *chan, char *buf, int data); /* SPPP/HDLC stuff */ -static void sppp_channel_init(struct channel_data *chan); +static struct channel_data *sppp_channel_alloc(struct cosa_data *cosa, int n); static void sppp_channel_delete(struct channel_data *chan); static int cosa_sppp_open(struct net_device *d); static int cosa_sppp_close(struct net_device *d); @@ -293,7 +293,6 @@ static struct net_device_stats *cosa_net_stats(struct net_device *dev); /* Character device */ -static void chardev_channel_init(struct channel_data *chan); static char *chrdev_setup_rx(struct channel_data *channel, int size); static int chrdev_rx_done(struct channel_data *channel); static int chrdev_tx_done(struct channel_data *channel, int size); @@ -410,7 +409,7 @@ /* Clean up the per-channel data */ for (i=0; inchannels; i++) { /* Chardev driver has no alloc'd per-channel data */ - sppp_channel_delete(cosa->chan+i); + sppp_channel_delete(cosa->chan[i]); } /* Clean up the per-card data */ kfree(cosa->chan); @@ -422,19 +421,6 @@ unregister_chrdev(cosa_major, "cosa"); } module_exit(cosa_exit); - -/* - * This function should register all the net devices needed for the - * single channel. - */ -static __inline__ void channel_init(struct channel_data *chan) -{ - /* Initialize the chardev data structures */ - chardev_channel_init(chan); - - /* Register the sppp interface */ - sppp_channel_init(chan); -} static int cosa_probe(int base, int irq, int dma) { @@ -559,17 +545,20 @@ sprintf(cosa->name, "cosa%d", cosa->num); /* Initialize the per-channel data */ - cosa->chan = kmalloc(sizeof(struct channel_data)*cosa->nchannels, + cosa->chan = kmalloc(sizeof(struct channel_data *)*cosa->nchannels, GFP_KERNEL); if (!cosa->chan) { err = -ENOMEM; goto err_out3; } - memset(cosa->chan, 0, sizeof(struct channel_data)*cosa->nchannels); + memset(cosa->chan, 0, sizeof(struct channel_data *)*cosa->nchannels); for (i=0; inchannels; i++) { - cosa->chan[i].cosa = cosa; - cosa->chan[i].num = i; - channel_init(cosa->chan+i); + struct channel_data *chan = sppp_channel_alloc(cosa, i); + if (IS_ERR(chan)) { + err = PTR_ERR(chan); + goto err_out4; + } + cosa->chan[i] = chan; } printk (KERN_INFO "cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n", @@ -577,6 +566,11 @@ cosa->datareg, cosa->irq, cosa->dma, cosa->nchannels); return nr_cards++; +err_out4: + for (i=0; inchannels; i++) + if (cosa->chan[i]) + sppp_channel_delete(cosa->chan[i]); + kfree(cosa->chan); err_out3: kfree(cosa->bouncebuf); err_out2: @@ -592,22 +586,8 @@ /*---------- SPPP/HDLC netdevice ---------- */ - -static void sppp_channel_init(struct channel_data *chan) +static __init void sppp_channel_setup(struct net_device *d) { - struct net_device *d; - chan->if_ptr = &chan->pppdev; - chan->pppdev.dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); - memset(chan->pppdev.dev, 0, sizeof(struct net_device)); - sppp_attach(&chan->pppdev); - d=chan->pppdev.dev; - sprintf(d->name, "cosa%dc%d", chan->cosa->num, chan->num); - chan->name = d->name; - d->base_addr = chan->cosa->datareg; - d->irq = chan->cosa->irq; - d->dma = chan->cosa->dma; - d->priv = chan; - d->init = NULL; d->open = cosa_sppp_open; d->stop = cosa_sppp_close; d->hard_start_xmit = cosa_sppp_tx; @@ -615,12 +595,43 @@ d->get_stats = cosa_net_stats; d->tx_timeout = cosa_sppp_timeout; d->watchdog_timeo = TX_TIMEOUT; - if (register_netdev(d)) { +} + +static __init struct channel_data *sppp_channel_alloc(struct cosa_data *cosa, + int num) +{ + struct net_device *d; + struct channel_data *chan; + int err; + + d = alloc_netdev(sizeof(*chan), "cosa", sppp_channel_setup); + if (!d) + return ERR_PTR(-ENOMEM); + + chan = d->priv; + chan->if_ptr = &chan->pppdev; + chan->pppdev.dev = d; + chan->name = d->name; + chan->cosa = cosa; + chan->num = num; + sprintf(d->name, "cosa%dc%d", cosa->num, num); + init_MUTEX(&chan->rsem); + init_MUTEX(&chan->wsem); + + sppp_attach(&chan->pppdev); + + d->base_addr = cosa->datareg; + d->irq = cosa->irq; + d->dma = cosa->dma; + + err = register_netdev(d); + if (err) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(chan->pppdev.dev); - free_netdev(chan->pppdev.dev); - return; + free_netdev(d); + return ERR_PTR(err); } + return chan; } static void sppp_channel_delete(struct channel_data *chan) @@ -788,13 +799,6 @@ /*---------- Character device ---------- */ - -static void chardev_channel_init(struct channel_data *chan) -{ - init_MUTEX(&chan->rsem); - init_MUTEX(&chan->wsem); -} - static ssize_t cosa_read(struct file *file, char *buf, size_t count, loff_t *ppos) { @@ -961,7 +965,7 @@ if ((n=iminor(file->f_dentry->d_inode) & ((1<= cosa->nchannels) return -ENODEV; - chan = cosa->chan + n; + chan = cosa->chan[n]; file->private_data = chan; @@ -1684,6 +1688,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status) { unsigned long flags, flags1; + struct channel_data *chan; #ifdef DEBUG_IRQS printk(KERN_INFO "cosa%d: SR_DOWN_REQUEST status=0x%04x\n", cosa->num, status); @@ -1723,13 +1728,12 @@ } } - cosa->txsize = cosa->chan[cosa->txchan].txsize; - if (cosa_dma_able(cosa->chan+cosa->txchan, - cosa->chan[cosa->txchan].txbuf, cosa->txsize)) { - cosa->txbuf = cosa->chan[cosa->txchan].txbuf; + chan = cosa->chan[cosa->txchan]; + cosa->txsize = chan->txsize; + if (cosa_dma_able(chan, chan->txbuf, cosa->txsize)) { + cosa->txbuf = chan->txbuf; } else { - memcpy(cosa->bouncebuf, cosa->chan[cosa->txchan].txbuf, - cosa->txsize); + memcpy(cosa->bouncebuf, chan->txbuf, cosa->txsize); cosa->txbuf = cosa->bouncebuf; } } @@ -1865,7 +1869,7 @@ spin_unlock_irqrestore(&cosa->lock, flags); goto reject; } - cosa->rxchan = cosa->chan + ((cosa->rxsize & 0xe000) >> 13); + cosa->rxchan = cosa->chan[(cosa->rxsize & 0xe000) >> 13]; cosa->rxsize &= 0x1fff; spin_unlock_irqrestore(&cosa->lock, flags); @@ -1914,7 +1918,7 @@ clear_dma_ff(cosa->dma); release_dma_lock(flags1); if (test_bit(TXBIT, &cosa->rxtx)) { - struct channel_data *chan = cosa->chan+cosa->txchan; + struct channel_data *chan = cosa->chan[cosa->txchan]; if (chan->tx_done) if (chan->tx_done(chan, cosa->txsize)) clear_bit(chan->num, &cosa->txbitmap); From shemminger@osdl.org Tue Nov 25 13:11:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 13:11:46 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPLBWTa008742 for ; Tue, 25 Nov 2003 13:11:33 -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 hAPLBPC29650; Tue, 25 Nov 2003 13:11:25 -0800 Date: Tue, 25 Nov 2003 13:12:02 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/3) wan/cosa - put major number in major.h Message-Id: <20031125131202.77d0ca53.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: 1685 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 Rather than hiding the hard coded major number in the driver, put it in major.h where conflicts can be spotted. Jeff, please add to net-drivers-2.5-exp diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Mon Nov 24 15:38:12 2003 +++ b/drivers/net/wan/cosa.c Mon Nov 24 15:38:12 2003 @@ -90,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -181,7 +182,7 @@ * Character device major number. 117 was allocated for us. * The value of 0 means to allocate a first free one. */ -static int cosa_major = 117; +static int cosa_major = COSA_MAJOR; /* * Encoding of the minor numbers: diff -Nru a/include/linux/major.h b/include/linux/major.h --- a/include/linux/major.h Mon Nov 24 15:38:12 2003 +++ b/include/linux/major.h Mon Nov 24 15:38:12 2003 @@ -128,6 +128,8 @@ #define ATARAID_MAJOR 114 +#define COSA_MAJOR 117 + #define SCSI_DISK8_MAJOR 128 #define SCSI_DISK9_MAJOR 129 #define SCSI_DISK10_MAJOR 130 From akpm@osdl.org Tue Nov 25 14:35:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 14:35:40 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAPMZ6Ta011012 for ; Tue, 25 Nov 2003 14:35:26 -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 hAPMZ0C13041; Tue, 25 Nov 2003 14:35:00 -0800 Date: Tue, 25 Nov 2003 14:35:37 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: shal@free.fr Subject: Fw: [Bug 1597] New: kernel BUG at mm/slab.c:1708! Message-Id: <20031125143537.7b446ff2.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (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: 1686 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 Beats me. Networking skb refcounting problem perhaps? Begin forwarded message: Date: Tue, 25 Nov 2003 14:27:34 -0800 From: bugme-daemon@osdl.org To: akpm@digeo.com Subject: [Bug 1597] New: kernel BUG at mm/slab.c:1708! http://bugme.osdl.org/show_bug.cgi?id=1597 Summary: kernel BUG at mm/slab.c:1708! Kernel Version: kernel-2.6.0-test9-mm5 Status: NEW Severity: normal Owner: akpm@digeo.com Submitter: shal@free.fr Distribution: slackware-current Hardware Environment: Athlon XP1600+ via KT333 mother card Software Environment: grep -v "not set" .config | grep CONFIG : CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_KALLSYMS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y CONFIG_KMOD=y CONFIG_X86_PC=y CONFIG_MK7=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=6 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_X86_USE_3DNOW=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y CONFIG_X86_MCE_NONFATAL=y CONFIG_NOHIGHMEM=y CONFIG_MTRR=y CONFIG_PM=y CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y CONFIG_PCI=y CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_HOTPLUG=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_MISC=y CONFIG_PNP=y CONFIG_BLK_DEV_FD=y CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_LBD=y CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDECD=y CONFIG_IDE_TASKFILE_IO=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_IDEDMA_PCI_AUTO=y CONFIG_BLK_DEV_ADMA=y CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_VIA82CXXX=m CONFIG_BLK_DEV_IDEDMA=y CONFIG_IDEDMA_AUTO=y CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y CONFIG_BLK_DEV_SD=m CONFIG_MAX_SD_DISKS=256 CONFIG_BLK_DEV_SR=m CONFIG_CHR_DEV_SG=m CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_XFRM=y CONFIG_XFRM_USER=m CONFIG_IPV6_SCTP__=y CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_TUN=m CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_NET_PCI=y CONFIG_8139TOO=m CONFIG_PHONE=m CONFIG_PHONE_IXJ=m CONFIG_INPUT=y CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_CORE=y CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 CONFIG_I2C=m CONFIG_I2C_CHARDEV=m CONFIG_I2C_ALGOBIT=m CONFIG_RTC=m CONFIG_DRM=y CONFIG_DRM_TDFX=m CONFIG_VIDEO_DEV=m CONFIG_VIDEO_BT848=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_FB=y CONFIG_FB_3DFX=m CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_SEQUENCER=y CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=y CONFIG_SND_PCM_OSS=y CONFIG_SND_ENS1371=m CONFIG_SND_USB_AUDIO=m CONFIG_USB=y CONFIG_USB_DEVICEFS=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_AUDIO=m CONFIG_USB_STORAGE=y CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y CONFIG_USB_PWC=m CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_JBD=y CONFIG_FS_MBCACHE=y CONFIG_AUTOFS4_FS=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_UDF_FS=y CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_DEVPTS_FS=y CONFIG_TMPFS=y CONFIG_RAMFS=y CONFIG_MSDOS_PARTITION=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_852=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_15=y CONFIG_NLS_UTF8=y CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_SLAB=y CONFIG_DEBUG_IOVIRT=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_PAGEALLOC=y CONFIG_SPINLINE=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_SPINLOCK_SLEEP=y CONFIG_FRAME_POINTER=y CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRC32=m CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m CONFIG_X86_BIOS_REBOOT=y CONFIG_PC=y For information,a external module is added : the eagle usb modem module. Problem Description: a Oops is produced, the process is passed on the DW state: Nov 23 20:00:07 shal kernel: slab error in cache_free_debugcheck(): cache `size-2048': double free, or memory outs ide object was overwritten Nov 23 20:00:07 shal kernel: Call Trace: Nov 23 20:00:07 shal kernel: [] kfree+0x2e4/0x410 Nov 23 20:00:07 shal kernel: [] kfree_skbmem+0x14/0x30 Nov 23 20:00:07 shal kernel: [] kfree_skbmem+0x14/0x30 Nov 23 20:00:07 shal kernel: [] __kfree_skb+0x66/0xd0 Nov 23 20:00:07 shal kernel: [] tcp_recvmsg+0xb18/0xe10 Nov 23 20:00:07 shal kernel: [] inet_recvmsg+0x54/0x70 Nov 23 20:00:07 shal kernel: [] sock_aio_read+0xc4/0xe0 Nov 23 20:00:07 shal kernel: [] do_sync_read+0xc2/0x100 Nov 23 20:00:07 shal kernel: [] __get_free_pages+0x22/0x50 Nov 23 20:00:07 shal kernel: [] autoremove_wake_function+0x0/0x50 Nov 23 20:00:07 shal kernel: [] poll_freewait+0x3a/0x50 Nov 23 20:00:07 shal kernel: [] vfs_read+0xe1/0x120 Nov 23 20:00:07 shal kernel: [] sys_read+0x3f/0x60 Nov 23 20:00:07 shal kernel: [] syscall_call+0x7/0xb Nov 23 20:00:07 shal kernel: Nov 23 20:00:07 shal kernel: c19c301e: redzone 1: 0x5a5a5a5a, redzone 2: 0xe09e0002. Nov 23 20:00:07 shal kernel: ------------[ cut here ]------------ Nov 23 20:00:07 shal kernel: kernel BUG at mm/slab.c:1708! Nov 23 20:00:07 shal kernel: invalid operand: 0000 [#1] Nov 23 20:00:07 shal kernel: DEBUG_PAGEALLOC Nov 23 20:00:07 shal kernel: CPU: 0 Nov 23 20:00:07 shal kernel: EIP: 0060:[] Not tainted VLI Nov 23 20:00:07 shal kernel: EFLAGS: 00010006 Nov 23 20:00:07 shal kernel: EIP is at kfree+0x27b/0x410 Nov 23 20:00:07 shal kernel: eax: c19c3000 ebx: 80010c00 ecx: 00001000 edx: 0000001e Nov 23 20:00:07 shal kernel: esi: cffefb00 edi: c19c3000 ebp: c3f99d84 esp: c3f99d54 Nov 23 20:00:07 shal kernel: ds: 007b es: 007b ss: 0068 Nov 23 20:00:07 shal kernel: Process mlnet (pid: 777, threadinfo=c3f98000 task=cc07b950) Nov 23 20:00:07 shal kernel: Stack: cffefb00 c19c301e 5a5a5a5a e09e0002 019c301e c0312f04 c19c301e cffe8f78 Nov 23 20:00:07 shal kernel: 00000282 cbfd3f60 00000000 558f8d7b c3f99d98 c0312f04 c19c3816 00000000 Nov 23 20:00:07 shal kernel: c91e6f00 c3f99db0 c0312f86 cbfd3f60 cbfd3f60 00000000 cbfd3f60 c3f99e14 Nov 23 20:00:07 shal kernel: Call Trace: Nov 23 20:00:07 shal kernel: [] kfree_skbmem+0x14/0x30 Nov 23 20:00:07 shal kernel: [] kfree_skbmem+0x14/0x30 Nov 23 20:00:07 shal kernel: [] __kfree_skb+0x66/0xd0 Nov 23 20:00:07 shal kernel: [] tcp_recvmsg+0xb18/0xe10 Nov 23 20:00:07 shal kernel: [] inet_recvmsg+0x54/0x70 Nov 23 20:00:07 shal kernel: [] sock_aio_read+0xc4/0xe0 Nov 23 20:00:07 shal kernel: [] do_sync_read+0xc2/0x100 Nov 23 20:00:07 shal kernel: [] __get_free_pages+0x22/0x50 Nov 23 20:00:07 shal kernel: [] autoremove_wake_function+0x0/0x50 Nov 23 20:00:07 shal kernel: [] poll_freewait+0x3a/0x50 Nov 23 20:00:07 shal kernel: [] vfs_read+0xe1/0x120 Nov 23 20:00:07 shal kernel: [] sys_read+0x3f/0x60 Nov 23 20:00:07 shal kernel: [] syscall_call+0x7/0xb Nov 23 20:00:07 shal kernel: Nov 23 20:00:07 shal kernel: Code: 8b 5e 38 e9 2b ff ff ff 8b 45 e8 03 86 b8 00 00 00 89 74 24 04 c7 44 24 08 05 00 00 00 89 04 24 ff 56 78 8b 5e 38 e9 f8 fe ff ff <0f> 0b ac 06 d7 af 38 c0 e9 e2 fe ff ff 0f 0b ab 06 d7 af 38 c0 Steps to reproduce: don't know , but I have it few times. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From romieu@fr.zoreil.com Tue Nov 25 15:53:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 15:54:11 -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.9) with SMTP id hAPNrsTa013202 for ; Tue, 25 Nov 2003 15:53:55 -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 hAPNjpK7026786; Wed, 26 Nov 2003 00:45:51 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAPNjoBR026785; Wed, 26 Nov 2003 00:45:50 +0100 Date: Wed, 26 Nov 2003 00:45:50 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik , brad_mssw@gentoo.org Subject: [PATCH] 2.6.0-test10-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031126004550.A25408@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031124000939.A456@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Nov 24, 2003 at 12:09:39AM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 1687 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 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline More Brad/Realtek's merging. Bugs are mine, of course. Applies on top of: 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version Brad, if you haven't found time to identify where the problem happens, could you wait 24h before patching anything ? There may be something on the radar. Thanks. -- Ueimor --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-init_one.patch" Merge of changes done by Realtek to rtl8169_init_one(): - phy capability settings allows lower or equal capability as suggested in Realtek's changes; - I/O voodoo; - no need to s/mdio_write/RTL8169_WRITE_GMII_REG/; - s/rtl8169_hw_PHY_config/rtl8169_hw_phy_config/; - rtl8169_hw_phy_config(): ad-hoc struct "phy_magic" to limit duplication of code (yep, the u16 -> int conversions should work as expected); - variable renames and whitepace changes ignored. drivers/net/r8169.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 107 insertions(+), 8 deletions(-) diff -puN drivers/net/r8169.c~r8169-init_one drivers/net/r8169.c --- linux-2.6.0-test10/drivers/net/r8169.c~r8169-init_one 2003-11-24 22:55:05.000000000 +0100 +++ linux-2.6.0-test10-romieu/drivers/net/r8169.c 2003-11-26 00:15:59.000000000 +0100 @@ -336,6 +336,11 @@ static const u16 rtl8169_intr_mask = static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); +#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half +#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less +#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less +#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less + void mdio_write(void *ioaddr, int RegAddr, int value) { @@ -373,6 +378,17 @@ mdio_read(void *ioaddr, int RegAddr) return value; } +static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, + int bitval) +{ + int val; + + val = mdio_read(ioaddr, reg); + val = (bitval == 1) ? + val | (bitval << bitnum) : val & ~(0x0001 << bitnum); + mdio_write(ioaddr, reg, val & 0xffff); +} + static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) { const struct { @@ -456,6 +472,74 @@ static void rtl8169_print_phy_version(st dprintk("phy_version == Unknown\n"); } +static void rtl8169_hw_phy_config(struct net_device *dev) +{ + struct rtl8169_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; + struct { + u16 regs[5]; /* Beware of bit-sign propagation */ + } phy_magic[5] = { { + { 0x0000, //w 4 15 12 0 + 0x00a1, //w 3 15 0 00a1 + 0x0008, //w 2 15 0 0008 + 0x1020, //w 1 15 0 1020 + 0x1000 } },{ //w 0 15 0 1000 + { 0x7000, //w 4 15 12 7 + 0xff41, //w 3 15 0 ff41 + 0xde60, //w 2 15 0 de60 + 0x0140, //w 1 15 0 0140 + 0x0077 } },{ //w 0 15 0 0077 + { 0xa000, //w 4 15 12 a + 0xdf01, //w 3 15 0 df01 + 0xdf20, //w 2 15 0 df20 + 0xff95, //w 1 15 0 ff95 + 0xfa00 } },{ //w 0 15 0 fa00 + { 0xb000, //w 4 15 12 b + 0xff41, //w 3 15 0 ff41 + 0xde20, //w 2 15 0 de20 + 0x0140, //w 1 15 0 0140 + 0x00bb } },{ //w 0 15 0 00bb + { 0xf000, //w 4 15 12 f + 0xdf01, //w 3 15 0 df01 + 0xdf20, //w 2 15 0 df20 + 0xff95, //w 1 15 0 ff95 + 0xbf00 } //w 0 15 0 bf00 + } + }, *p = phy_magic; + int i; + + rtl8169_print_mac_version(tp); + rtl8169_print_phy_version(tp); + + if (tp->mac_version <= RTL_GIGA_MAC_VER_B) + return; + if (tp->phy_version >= RTL_GIGA_PHY_VER_F) + return; + + dprintk("MAC version != 0 && PHY version == 0 or 1\n"); + dprintk("Do final_reg2.cfg\n"); + + /* Shazam ! */ + + // phy config for RTL8169s mac_version C chip + mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 + mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 + mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 + + for (i = ARRAY_SIZE(phy_magic); i > 0; i++, p++) { + int val, pos = 4; + + val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff); + mdio_write(ioaddr, pos, val); + while (--pos >= 0) + mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff); + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1 + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 + } + mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 +} + static int __devinit rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, void **ioaddr_out) @@ -642,6 +726,23 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], dev->irq); + rtl8169_hw_phy_config(dev); + + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); + RTL_W8(0x82, 0x01); + + if (tp->mac_version < RTL_GIGA_MAC_VER_E) { + dprintk("Set PCI Latency=0x40\n"); + pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); + } + + if (tp->mac_version == RTL_GIGA_MAC_VER_D) { + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); + RTL_W8(0x82, 0x01); + dprintk("Set PHY Reg 0x0bh = 0x00h\n"); + mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 + } + // if TBI is not endbled if (!(RTL_R8(PHYstatus) & TBI_Enable)) { int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); @@ -654,23 +755,23 @@ rtl8169_init_one(struct pci_dev *pdev, c Cap10_100 = 0, Cap1000 = 0; switch (option) { case _10_Half: - Cap10_100 = PHY_Cap_10_Half; + Cap10_100 = PHY_Cap_10_Half_Or_Less; Cap1000 = PHY_Cap_Null; break; case _10_Full: - Cap10_100 = PHY_Cap_10_Full; + Cap10_100 = PHY_Cap_10_Full_Or_Less; Cap1000 = PHY_Cap_Null; break; case _100_Half: - Cap10_100 = PHY_Cap_100_Half; + Cap10_100 = PHY_Cap_100_Half_Or_Less; Cap1000 = PHY_Cap_Null; break; case _100_Full: - Cap10_100 = PHY_Cap_100_Full; + Cap10_100 = PHY_Cap_100_Full_Or_Less; Cap1000 = PHY_Cap_Null; break; case _1000_Full: - Cap10_100 = PHY_Cap_Null; + Cap10_100 = PHY_Cap_100_Full_Or_Less; Cap1000 = PHY_Cap_1000_Full; break; default: @@ -684,9 +785,7 @@ rtl8169_init_one(struct pci_dev *pdev, c // enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged mdio_write(ioaddr, PHY_AUTO_NEGO_REG, - PHY_Cap_10_Half | PHY_Cap_10_Full | - PHY_Cap_100_Half | PHY_Cap_100_Full | (val & - 0x1F)); + PHY_Cap_100_Full_Or_Less | (val & 0x1f)); // enable 1000 Full Mode mdio_write(ioaddr, PHY_1000_CTRL_REG, _ --opJtzjQTFsWo+cga-- From shemminger@osdl.org Tue Nov 25 16:24:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 16:24:41 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ0ONTa016683 for ; Tue, 25 Nov 2003 16:24:23 -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 hAQ0ODC02615; Tue, 25 Nov 2003 16:24:14 -0800 Date: Tue, 25 Nov 2003 16:24:50 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] convert dgrs to driver bus model probing. Message-Id: <20031125162450.204422b1.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: 1688 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 Convert the net/dgrs.c driver to use pci and eisa driver to use the common bus interface for device location. Tested for the no board case. diff -Nru a/drivers/net/dgrs.c b/drivers/net/dgrs.c --- a/drivers/net/dgrs.c Tue Nov 25 16:21:05 2003 +++ b/drivers/net/dgrs.c Tue Nov 25 16:21:05 2003 @@ -121,11 +121,22 @@ #include "dgrs_asstruct.h" #include "dgrs_bcomm.h" +#ifdef CONFIG_PCI static struct pci_device_id dgrs_pci_tbl[] = { { SE6_PCI_VENDOR_ID, SE6_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, }, { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(pci, dgrs_pci_tbl); +#endif + +#ifdef CONFIG_EISA +static struct eisa_device_id dgrs_eisa_tbl[] = { + { "DBI0A01" }, + { } +}; +MODULE_DEVICE_TABLE(eisa, dgrs_eisa_tbl); +#endif + MODULE_LICENSE("GPL"); @@ -179,11 +190,6 @@ static int dgrs_nicmode; /* - * Chain of device structures - */ -static struct net_device *dgrs_root_dev; - -/* * Private per-board data structure (dev->priv) */ typedef struct @@ -191,7 +197,6 @@ /* * Stuff for generic ethercard I/F */ - struct net_device *next_dev; struct net_device_stats stats; /* @@ -1242,22 +1247,23 @@ return (0); } -static int __init +static struct net_device * __init dgrs_found_device( int io, ulong mem, int irq, ulong plxreg, - ulong plxdma + ulong plxdma, + struct device *pdev ) { - DGRS_PRIV *priv; - struct net_device *dev, *aux; + DGRS_PRIV *priv; + struct net_device *dev; int i, ret; dev = alloc_etherdev(sizeof(DGRS_PRIV)); if (!dev) - return -ENOMEM; + return ERR_PTR(-ENOMEM); priv = (DGRS_PRIV *)dev->priv; @@ -1274,17 +1280,15 @@ dev->init = dgrs_probe1; SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, pdev); if (register_netdev(dev) != 0) { free_netdev(dev); - return -EIO; + return ERR_PTR(-EIO); } - priv->next_dev = dgrs_root_dev; - dgrs_root_dev = dev; - if ( !dgrs_nicmode ) - return (0); /* Switch mode, we are done */ + return dev; /* Switch mode, we are done */ /* * Operating card as N separate NICs @@ -1297,13 +1301,12 @@ struct net_device *devN; DGRS_PRIV *privN; /* Allocate new dev and priv structures */ - devN = alloc_etherdev(sizeof(DGRS_PRIV)); + devN = alloc_etherdev(sizeof(DGRS_PRIV )); ret = -ENOMEM; if (!devN) goto fail; - /* Make it an exact copy of dev[0]... */ - *devN = *dev; + /* Don't copy the network device structure! */ /* copy the priv structure of dev[0] */ privN = (DGRS_PRIV *)devN->priv; @@ -1317,9 +1320,9 @@ /* ... and base MAC address off address of 1st port */ devN->dev_addr[5] += i; /* ... choose a new name */ - strncpy(devN->name, "eth%d", IFNAMSIZ); devN->init = dgrs_initclone; SET_MODULE_OWNER(devN); + SET_NETDEV_DEV(dev, pdev); ret = -EIO; if (register_netdev(devN)) { @@ -1328,110 +1331,165 @@ } privN->chan = i+1; priv->devtbl[i] = devN; - privN->next_dev = dgrs_root_dev; - dgrs_root_dev = devN; } - return 0; -fail: aux = priv->next_dev; - while (dgrs_root_dev != aux) { - struct net_device *d = dgrs_root_dev; - - dgrs_root_dev = ((DGRS_PRIV *)d->priv)->next_dev; + return dev; + + fail: + while (i >= 0) { + struct net_device *d = priv->devtbl[i--]; unregister_netdev(d); free_netdev(d); } - return ret; + return ERR_PTR(ret); } -/* - * Scan for all boards - */ -static int is2iv[8] __initdata = { 0, 3, 5, 7, 10, 11, 12, 15 }; +static void __devexit dgrs_remove(struct net_device *dev) +{ + DGRS_PRIV *priv = dev->priv; + int i; -static int __init dgrs_scan(void) + unregister_netdev(dev); + + for (i = 1; i < priv->nports; ++i) { + struct net_device *d = priv->devtbl[i]; + if (d) { + unregister_netdev(d); + free_netdev(d); + } + } + + proc_reset(priv->devtbl[0], 1); + + if (priv->vmem) + iounmap(priv->vmem); + if (priv->vplxdma) + iounmap((uchar *) priv->vplxdma); + + release_region(dev->base_addr, 256); + + if (dev->irq) + free_irq(dev->irq, dev); + + for (i = 1; i < priv->nports; ++i) { + if (priv->devtbl[i]) + unregister_netdev(priv->devtbl[i]); + } + free_netdev(dev); +} + +#ifdef CONFIG_PCI +static int __init dgrs_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { - int cards_found = 0; + struct net_device *dev; + int err; uint io; uint mem; uint irq; uint plxreg; uint plxdma; - struct pci_dev *pdev = NULL; /* - * First, check for PCI boards - */ - while ((pdev = pci_find_device(SE6_PCI_VENDOR_ID, SE6_PCI_DEVICE_ID, pdev)) != NULL) - { - /* - * Get and check the bus-master and latency values. - * Some PCI BIOSes fail to set the master-enable bit, - * and the latency timer must be set to the maximum - * value to avoid data corruption that occurs when the - * timer expires during a transfer. Yes, it's a bug. - */ - if (pci_enable_device(pdev)) - continue; - pci_set_master(pdev); - - plxreg = pci_resource_start (pdev, 0); - io = pci_resource_start (pdev, 1); - mem = pci_resource_start (pdev, 2); - pci_read_config_dword(pdev, 0x30, &plxdma); - irq = pdev->irq; - plxdma &= ~15; + * Get and check the bus-master and latency values. + * Some PCI BIOSes fail to set the master-enable bit, + * and the latency timer must be set to the maximum + * value to avoid data corruption that occurs when the + * timer expires during a transfer. Yes, it's a bug. + */ + err = pci_enable_device(pdev); + if (err) + return err; + pci_set_master(pdev); + + plxreg = pci_resource_start (pdev, 0); + io = pci_resource_start (pdev, 1); + mem = pci_resource_start (pdev, 2); + pci_read_config_dword(pdev, 0x30, &plxdma); + irq = pdev->irq; + plxdma &= ~15; + + /* + * On some BIOSES, the PLX "expansion rom" (used for DMA) + * address comes up as "0". This is probably because + * the BIOS doesn't see a valid 55 AA ROM signature at + * the "ROM" start and zeroes the address. To get + * around this problem the SE-6 is configured to ask + * for 4 MB of space for the dual port memory. We then + * must set its range back to 2 MB, and use the upper + * half for DMA register access + */ + OUTL(io + PLX_SPACE0_RANGE, 0xFFE00000L); + if (plxdma == 0) + plxdma = mem + (2048L * 1024L); + pci_write_config_dword(pdev, 0x30, plxdma + 1); + pci_read_config_dword(pdev, 0x30, &plxdma); + plxdma &= ~15; + + dev = dgrs_found_device(io, mem, irq, plxreg, plxdma, &pdev->dev); + if (IS_ERR(dev)) + return PTR_ERR(dev); - /* - * On some BIOSES, the PLX "expansion rom" (used for DMA) - * address comes up as "0". This is probably because - * the BIOS doesn't see a valid 55 AA ROM signature at - * the "ROM" start and zeroes the address. To get - * around this problem the SE-6 is configured to ask - * for 4 MB of space for the dual port memory. We then - * must set its range back to 2 MB, and use the upper - * half for DMA register access - */ - OUTL(io + PLX_SPACE0_RANGE, 0xFFE00000L); - if (plxdma == 0) - plxdma = mem + (2048L * 1024L); - pci_write_config_dword(pdev, 0x30, plxdma + 1); - pci_read_config_dword(pdev, 0x30, &plxdma); - plxdma &= ~15; + pci_set_drvdata(pdev, dev); + return 0; +} + +static void __devexit dgrs_pci_remove(struct pci_dev *pdev) +{ + dgrs_remove(pci_get_drvdata(pdev)); +} - dgrs_found_device(io, mem, irq, plxreg, plxdma); +static struct pci_driver dgrs_pci_driver = { + .name = "dgrs", + .id_table = dgrs_pci_tbl, + .probe = dgrs_pci_probe, + .remove = __devexit_p(dgrs_pci_remove), +}; +#endif - cards_found++; - } - /* - * Second, check for EISA boards - */ - if (EISA_bus) - { - for (io = 0x1000; io < 0x9000; io += 0x1000) - { - if (inb(io+ES4H_MANUFmsb) != 0x10 - || inb(io+ES4H_MANUFlsb) != 0x49 - || inb(io+ES4H_PRODUCT) != ES4H_PRODUCT_CODE) - continue; +#ifdef CONFIG_EISA +static int is2iv[8] __initdata = { 0, 3, 5, 7, 10, 11, 12, 15 }; - if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) ) - continue; /* Not EISA configured */ +static int __init dgrs_eisa_probe (struct device *gendev) +{ + struct net_device *dev; + struct eisa_device *edev = to_eisa_device(gendev); + uint io = edev->base_addr; + uint mem; + uint irq; - mem = (inb(io+ES4H_AS_31_24) << 24) - + (inb(io+ES4H_AS_23_16) << 16); + if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) ) + return -ENODEV; /* Not EISA configured */ - irq = is2iv[ inb(io+ES4H_IS) & ES4H_IS_INTMASK ]; + mem = (inb(io+ES4H_AS_31_24) << 24) + + (inb(io+ES4H_AS_23_16) << 16); - dgrs_found_device(io, mem, irq, 0L, 0L); + irq = is2iv[ inb(io+ES4H_IS) & ES4H_IS_INTMASK ]; - ++cards_found; - } - } + dev = dgrs_found_device(io, mem, irq, 0L, 0L, gendev); + if (IS_ERR(dev)) + return PTR_ERR(dev); - return cards_found; + gendev->driver_data = dev; + return 0; } +static int __devexit dgrs_eisa_remove(struct device *gendev) +{ + dgrs_remove(gendev->driver_data); + return 0; +} + + +static struct eisa_driver dgrs_eisa_driver = { + .id_table = dgrs_eisa_tbl, + .driver = { + .name = "dgrs", + .probe = dgrs_eisa_probe, + .remove = __devexit_p(dgrs_eisa_remove), + } +}; +#endif /* * Variables that can be overriden from module command line @@ -1459,8 +1517,8 @@ static int __init dgrs_init_module (void) { - int cards_found; int i; + int eisacount = 0, pcicount = 0; /* * Command line variable overrides @@ -1501,38 +1559,27 @@ /* * Find and configure all the cards */ - dgrs_root_dev = NULL; - cards_found = dgrs_scan(); - - return cards_found ? 0 : -ENODEV; +#ifdef CONFIG_EISA + eisacount = eisa_driver_register(&dgrs_eisa_driver); + if (eisacount < 0) + return eisacount; +#endif +#ifdef CONFIG_PCI + pcicount = pci_module_init(&dgrs_pci_driver); + if (pcicount < 0) + return pcicount; +#endif + return (eisacount + pcicount) == 0 ? -ENODEV : 0; } static void __exit dgrs_cleanup_module (void) { - while (dgrs_root_dev) - { - struct net_device *next_dev; - DGRS_PRIV *priv; - - priv = (DGRS_PRIV *) dgrs_root_dev->priv; - next_dev = priv->next_dev; - unregister_netdev(dgrs_root_dev); - - proc_reset(priv->devtbl[0], 1); - - if (priv->vmem) - iounmap(priv->vmem); - if (priv->vplxdma) - iounmap((uchar *) priv->vplxdma); - - release_region(dgrs_root_dev->base_addr, 256); - - if (dgrs_root_dev->irq) - free_irq(dgrs_root_dev->irq, dgrs_root_dev); - - free_netdev(dgrs_root_dev); - dgrs_root_dev = next_dev; - } +#ifdef CONFIG_EISA + eisa_driver_unregister (&dgrs_eisa_driver); +#endif +#ifdef CONFIG_PCI + pci_unregister_driver (&dgrs_pci_driver); +#endif } module_init(dgrs_init_module); From brad@mcve.com Tue Nov 25 16:45:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 16:45:46 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ0jKTa019824 for ; Tue, 25 Nov 2003 16:45:33 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 068BA857CC; Tue, 25 Nov 2003 19:59:03 -0500 (EST) Message-ID: <3FC3F79D.1070202@mcve.com> Date: Tue, 25 Nov 2003 19:45:17 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Jeff Garzik , brad_mssw@gentoo.org Subject: Re: [PATCH] 2.6.0-test10-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> In-Reply-To: <20031126004550.A25408@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1689 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Well, I didn't get to do all the testing, but here's what I've done so far, with results, all as modules, not statically built in: - 2.6.0-test10 w/v1.6 realtek patch I provided - loads ok - dhcpcd works fine - rmmod ok - 2.6.0-test10 vanilla - loads ok - dhcpcd eth0 hangs (but eventually times out) - oops on rmmod - 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version - loads ok - dhcpcd eth0 locks entire system - rmmod -- no idea ;) - 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 - loads ok - dhcpcd eth0 locks entire system - rmmod -- no idea ;) - 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 - r8169-rx_copybreak (yes, I manually removed the reject as well) - loads ok - dhcpcd eth0 locks entire system - rmmod -- no idea ;) do you want me to continue ?? -Brad Francois Romieu wrote: > More Brad/Realtek's merging. Bugs are mine, of course. > > Applies on top of: > 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version > > Brad, if you haven't found time to identify where the problem happens, > could you wait 24h before patching anything ? There may be something on the > radar. > > Thanks. > > -- > Ueimor > > > ------------------------------------------------------------------------ > > > Merge of changes done by Realtek to rtl8169_init_one(): > - phy capability settings allows lower or equal capability as suggested > in Realtek's changes; > - I/O voodoo; > - no need to s/mdio_write/RTL8169_WRITE_GMII_REG/; > - s/rtl8169_hw_PHY_config/rtl8169_hw_phy_config/; > - rtl8169_hw_phy_config(): ad-hoc struct "phy_magic" to limit duplication > of code (yep, the u16 -> int conversions should work as expected); > - variable renames and whitepace changes ignored. > > > drivers/net/r8169.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++---- > 1 files changed, 107 insertions(+), 8 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-init_one drivers/net/r8169.c > --- linux-2.6.0-test10/drivers/net/r8169.c~r8169-init_one 2003-11-24 22:55:05.000000000 +0100 > +++ linux-2.6.0-test10-romieu/drivers/net/r8169.c 2003-11-26 00:15:59.000000000 +0100 > @@ -336,6 +336,11 @@ static const u16 rtl8169_intr_mask = > static const unsigned int rtl8169_rx_config = > (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); > > +#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half > +#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less > +#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less > +#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less > + > void > mdio_write(void *ioaddr, int RegAddr, int value) > { > @@ -373,6 +378,17 @@ mdio_read(void *ioaddr, int RegAddr) > return value; > } > > +static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, > + int bitval) > +{ > + int val; > + > + val = mdio_read(ioaddr, reg); > + val = (bitval == 1) ? > + val | (bitval << bitnum) : val & ~(0x0001 << bitnum); > + mdio_write(ioaddr, reg, val & 0xffff); > +} > + > static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) > { > const struct { > @@ -456,6 +472,74 @@ static void rtl8169_print_phy_version(st > dprintk("phy_version == Unknown\n"); > } > > +static void rtl8169_hw_phy_config(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + void *ioaddr = tp->mmio_addr; > + struct { > + u16 regs[5]; /* Beware of bit-sign propagation */ > + } phy_magic[5] = { { > + { 0x0000, //w 4 15 12 0 > + 0x00a1, //w 3 15 0 00a1 > + 0x0008, //w 2 15 0 0008 > + 0x1020, //w 1 15 0 1020 > + 0x1000 } },{ //w 0 15 0 1000 > + { 0x7000, //w 4 15 12 7 > + 0xff41, //w 3 15 0 ff41 > + 0xde60, //w 2 15 0 de60 > + 0x0140, //w 1 15 0 0140 > + 0x0077 } },{ //w 0 15 0 0077 > + { 0xa000, //w 4 15 12 a > + 0xdf01, //w 3 15 0 df01 > + 0xdf20, //w 2 15 0 df20 > + 0xff95, //w 1 15 0 ff95 > + 0xfa00 } },{ //w 0 15 0 fa00 > + { 0xb000, //w 4 15 12 b > + 0xff41, //w 3 15 0 ff41 > + 0xde20, //w 2 15 0 de20 > + 0x0140, //w 1 15 0 0140 > + 0x00bb } },{ //w 0 15 0 00bb > + { 0xf000, //w 4 15 12 f > + 0xdf01, //w 3 15 0 df01 > + 0xdf20, //w 2 15 0 df20 > + 0xff95, //w 1 15 0 ff95 > + 0xbf00 } //w 0 15 0 bf00 > + } > + }, *p = phy_magic; > + int i; > + > + rtl8169_print_mac_version(tp); > + rtl8169_print_phy_version(tp); > + > + if (tp->mac_version <= RTL_GIGA_MAC_VER_B) > + return; > + if (tp->phy_version >= RTL_GIGA_PHY_VER_F) > + return; > + > + dprintk("MAC version != 0 && PHY version == 0 or 1\n"); > + dprintk("Do final_reg2.cfg\n"); > + > + /* Shazam ! */ > + > + // phy config for RTL8169s mac_version C chip > + mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 > + mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 > + mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 > + > + for (i = ARRAY_SIZE(phy_magic); i > 0; i++, p++) { > + int val, pos = 4; > + > + val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff); > + mdio_write(ioaddr, pos, val); > + while (--pos >= 0) > + mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff); > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1 > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 > + } > + mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 > +} > + > static int __devinit > rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, > void **ioaddr_out) > @@ -642,6 +726,23 @@ rtl8169_init_one(struct pci_dev *pdev, c > dev->dev_addr[2], dev->dev_addr[3], > dev->dev_addr[4], dev->dev_addr[5], dev->irq); > > + rtl8169_hw_phy_config(dev); > + > + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); > + RTL_W8(0x82, 0x01); > + > + if (tp->mac_version < RTL_GIGA_MAC_VER_E) { > + dprintk("Set PCI Latency=0x40\n"); > + pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); > + } > + > + if (tp->mac_version == RTL_GIGA_MAC_VER_D) { > + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); > + RTL_W8(0x82, 0x01); > + dprintk("Set PHY Reg 0x0bh = 0x00h\n"); > + mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 > + } > + > // if TBI is not endbled > if (!(RTL_R8(PHYstatus) & TBI_Enable)) { > int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); > @@ -654,23 +755,23 @@ rtl8169_init_one(struct pci_dev *pdev, c > Cap10_100 = 0, Cap1000 = 0; > switch (option) { > case _10_Half: > - Cap10_100 = PHY_Cap_10_Half; > + Cap10_100 = PHY_Cap_10_Half_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _10_Full: > - Cap10_100 = PHY_Cap_10_Full; > + Cap10_100 = PHY_Cap_10_Full_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _100_Half: > - Cap10_100 = PHY_Cap_100_Half; > + Cap10_100 = PHY_Cap_100_Half_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _100_Full: > - Cap10_100 = PHY_Cap_100_Full; > + Cap10_100 = PHY_Cap_100_Full_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _1000_Full: > - Cap10_100 = PHY_Cap_Null; > + Cap10_100 = PHY_Cap_100_Full_Or_Less; > Cap1000 = PHY_Cap_1000_Full; > break; > default: > @@ -684,9 +785,7 @@ rtl8169_init_one(struct pci_dev *pdev, c > > // enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged > mdio_write(ioaddr, PHY_AUTO_NEGO_REG, > - PHY_Cap_10_Half | PHY_Cap_10_Full | > - PHY_Cap_100_Half | PHY_Cap_100_Full | (val & > - 0x1F)); > + PHY_Cap_100_Full_Or_Less | (val & 0x1f)); > > // enable 1000 Full Mode > mdio_write(ioaddr, PHY_1000_CTRL_REG, > > _ From brad@mcve.com Tue Nov 25 16:55:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 16:55:28 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ0t6Ta020288 for ; Tue, 25 Nov 2003 16:55:07 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id F21A2857CC; Tue, 25 Nov 2003 20:08:49 -0500 (EST) Message-ID: <3FC3F9E8.7040403@mcve.com> Date: Tue, 25 Nov 2003 19:55:04 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Jeff Garzik , brad_mssw@gentoo.org Subject: r8169 -- bad patch References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> In-Reply-To: <20031126004550.A25408@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1690 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev it appears as though the r8169-start-xmit-fixes.patch is the culprit for the system lockups ... After reverting that patch, it went back to vanilla behavior. -Brad Francois Romieu wrote: > More Brad/Realtek's merging. Bugs are mine, of course. > > Applies on top of: > 2.6.0-test10 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version > > Brad, if you haven't found time to identify where the problem happens, > could you wait 24h before patching anything ? There may be something on the > radar. > > Thanks. > > -- > Ueimor > > > ------------------------------------------------------------------------ > > > Merge of changes done by Realtek to rtl8169_init_one(): > - phy capability settings allows lower or equal capability as suggested > in Realtek's changes; > - I/O voodoo; > - no need to s/mdio_write/RTL8169_WRITE_GMII_REG/; > - s/rtl8169_hw_PHY_config/rtl8169_hw_phy_config/; > - rtl8169_hw_phy_config(): ad-hoc struct "phy_magic" to limit duplication > of code (yep, the u16 -> int conversions should work as expected); > - variable renames and whitepace changes ignored. > > > drivers/net/r8169.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++---- > 1 files changed, 107 insertions(+), 8 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-init_one drivers/net/r8169.c > --- linux-2.6.0-test10/drivers/net/r8169.c~r8169-init_one 2003-11-24 22:55:05.000000000 +0100 > +++ linux-2.6.0-test10-romieu/drivers/net/r8169.c 2003-11-26 00:15:59.000000000 +0100 > @@ -336,6 +336,11 @@ static const u16 rtl8169_intr_mask = > static const unsigned int rtl8169_rx_config = > (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); > > +#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half > +#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less > +#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less > +#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less > + > void > mdio_write(void *ioaddr, int RegAddr, int value) > { > @@ -373,6 +378,17 @@ mdio_read(void *ioaddr, int RegAddr) > return value; > } > > +static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, > + int bitval) > +{ > + int val; > + > + val = mdio_read(ioaddr, reg); > + val = (bitval == 1) ? > + val | (bitval << bitnum) : val & ~(0x0001 << bitnum); > + mdio_write(ioaddr, reg, val & 0xffff); > +} > + > static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) > { > const struct { > @@ -456,6 +472,74 @@ static void rtl8169_print_phy_version(st > dprintk("phy_version == Unknown\n"); > } > > +static void rtl8169_hw_phy_config(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + void *ioaddr = tp->mmio_addr; > + struct { > + u16 regs[5]; /* Beware of bit-sign propagation */ > + } phy_magic[5] = { { > + { 0x0000, //w 4 15 12 0 > + 0x00a1, //w 3 15 0 00a1 > + 0x0008, //w 2 15 0 0008 > + 0x1020, //w 1 15 0 1020 > + 0x1000 } },{ //w 0 15 0 1000 > + { 0x7000, //w 4 15 12 7 > + 0xff41, //w 3 15 0 ff41 > + 0xde60, //w 2 15 0 de60 > + 0x0140, //w 1 15 0 0140 > + 0x0077 } },{ //w 0 15 0 0077 > + { 0xa000, //w 4 15 12 a > + 0xdf01, //w 3 15 0 df01 > + 0xdf20, //w 2 15 0 df20 > + 0xff95, //w 1 15 0 ff95 > + 0xfa00 } },{ //w 0 15 0 fa00 > + { 0xb000, //w 4 15 12 b > + 0xff41, //w 3 15 0 ff41 > + 0xde20, //w 2 15 0 de20 > + 0x0140, //w 1 15 0 0140 > + 0x00bb } },{ //w 0 15 0 00bb > + { 0xf000, //w 4 15 12 f > + 0xdf01, //w 3 15 0 df01 > + 0xdf20, //w 2 15 0 df20 > + 0xff95, //w 1 15 0 ff95 > + 0xbf00 } //w 0 15 0 bf00 > + } > + }, *p = phy_magic; > + int i; > + > + rtl8169_print_mac_version(tp); > + rtl8169_print_phy_version(tp); > + > + if (tp->mac_version <= RTL_GIGA_MAC_VER_B) > + return; > + if (tp->phy_version >= RTL_GIGA_PHY_VER_F) > + return; > + > + dprintk("MAC version != 0 && PHY version == 0 or 1\n"); > + dprintk("Do final_reg2.cfg\n"); > + > + /* Shazam ! */ > + > + // phy config for RTL8169s mac_version C chip > + mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 > + mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 > + mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 > + > + for (i = ARRAY_SIZE(phy_magic); i > 0; i++, p++) { > + int val, pos = 4; > + > + val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff); > + mdio_write(ioaddr, pos, val); > + while (--pos >= 0) > + mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff); > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1 > + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 > + } > + mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 > +} > + > static int __devinit > rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, > void **ioaddr_out) > @@ -642,6 +726,23 @@ rtl8169_init_one(struct pci_dev *pdev, c > dev->dev_addr[2], dev->dev_addr[3], > dev->dev_addr[4], dev->dev_addr[5], dev->irq); > > + rtl8169_hw_phy_config(dev); > + > + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); > + RTL_W8(0x82, 0x01); > + > + if (tp->mac_version < RTL_GIGA_MAC_VER_E) { > + dprintk("Set PCI Latency=0x40\n"); > + pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); > + } > + > + if (tp->mac_version == RTL_GIGA_MAC_VER_D) { > + dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); > + RTL_W8(0x82, 0x01); > + dprintk("Set PHY Reg 0x0bh = 0x00h\n"); > + mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 > + } > + > // if TBI is not endbled > if (!(RTL_R8(PHYstatus) & TBI_Enable)) { > int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); > @@ -654,23 +755,23 @@ rtl8169_init_one(struct pci_dev *pdev, c > Cap10_100 = 0, Cap1000 = 0; > switch (option) { > case _10_Half: > - Cap10_100 = PHY_Cap_10_Half; > + Cap10_100 = PHY_Cap_10_Half_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _10_Full: > - Cap10_100 = PHY_Cap_10_Full; > + Cap10_100 = PHY_Cap_10_Full_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _100_Half: > - Cap10_100 = PHY_Cap_100_Half; > + Cap10_100 = PHY_Cap_100_Half_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _100_Full: > - Cap10_100 = PHY_Cap_100_Full; > + Cap10_100 = PHY_Cap_100_Full_Or_Less; > Cap1000 = PHY_Cap_Null; > break; > case _1000_Full: > - Cap10_100 = PHY_Cap_Null; > + Cap10_100 = PHY_Cap_100_Full_Or_Less; > Cap1000 = PHY_Cap_1000_Full; > break; > default: > @@ -684,9 +785,7 @@ rtl8169_init_one(struct pci_dev *pdev, c > > // enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged > mdio_write(ioaddr, PHY_AUTO_NEGO_REG, > - PHY_Cap_10_Half | PHY_Cap_10_Full | > - PHY_Cap_100_Half | PHY_Cap_100_Full | (val & > - 0x1F)); > + PHY_Cap_100_Full_Or_Less | (val & 0x1f)); > > // enable 1000 Full Mode > mdio_write(ioaddr, PHY_1000_CTRL_REG, > > _ From davem@pizda.ninka.net Tue Nov 25 17:10:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 17:10:45 -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.9) with SMTP id hAQ1A9Ta020846 for ; Tue, 25 Nov 2003 17:10:29 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA32539; Tue, 25 Nov 2003 17:09:42 -0800 Date: Tue, 25 Nov 2003 17:09:42 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: redo stateless addrconf properly Message-Id: <20031125170942.7bef08fe.davem@redhat.com> In-Reply-To: <20031125.224037.85040739.yoshfuji@linux-ipv6.org> References: <20031125.224037.85040739.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: 1691 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, 25 Nov 2003 22:40:37 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Interface that had configured via stateless addrconf did not do > stateless addrconf again correctly after interface was down. > Forget IF_RS_SENT|IF_RA_RCVD flags when interface goes down. > > Patch is against 2.6.0-test10, but similar logic applies to > 2.4.x and 2.2.x. Applied, arigato Yoshfuji. From jt@bougret.hpl.hp.com Tue Nov 25 18:34:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 18:34:15 -0800 (PST) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ2XxTa030308 for ; Tue, 25 Nov 2003 18:34:00 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 091821C01BAC; Tue, 25 Nov 2003 18:33:59 -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 SAA01727; Tue, 25 Nov 2003 18:33:58 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AOpV8-0003yR-00; Tue, 25 Nov 2003 18:33:58 -0800 Date: Tue, 25 Nov 2003 18:33:58 -0800 To: "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Possible IRDA SKB leaks Message-ID: <20031126023358.GA15162@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20031124193042.2c1013a2.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031124193042.2c1013a2.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: 1692 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 Mon, Nov 24, 2003 at 07:30:42PM -0800, David S. Miller wrote: > > Hello Jean, I think I've found some SKB handling bugs in > the IRDA stack. > > I was verifying all the paths that use sock_queue_rcv_skb(). > If any non-zero value is returned from this function the caller > must either free the SKB or queue the packet some place else. > > Here is one example where IRDA appears to do the wrong thing. > In irttp_udata_indication(), we pass the packet down into the > next layer via self->notify.udata_indication(). > > One example implementation of this is af_irda.c:irda_data_indication(). > This calls sock_queue_rcv_skb() and returns any error to the caller. > > Our caller in this case, irttp_udata_indication(), for some reason > treats -ENOMEM specially. This is wrong, there are many other errors > that sock_queue_rcv_skb() can return, for example -EPERM from socket > filtering. All such error cases need to cause the SKB to be freed > or similar, it should not be done only for an error of -ENOMEM. I would need to ask Dag to know the real reason. This code was unchanged since 2.2.X days. What was true for 2.2.X is no longer true. > I have not done an exhaustive audit of this problem in the IRDA stack. > But I do suspect there are other places doing something similar. > > If someone could finish the audit and submit a patch to fix this I'd > really appreciate it. Thanks a lot. I did the audit, and there was not many places to fix. Tested on 2.6.0-test9 (both data and udata path). Patch is trivial and attached below. Thanks for the heads up ! Have fun... Jean P.S. : I've got other important IrDA patches, but a freeze is a freeze ;-) --------------------------------------- diff -u -p linux/net/irda/irttp.d6.c linux/net/irda/irttp.c --- linux/net/irda/irttp.d6.c Tue Nov 25 18:12:19 2003 +++ linux/net/irda/irttp.c Tue Nov 25 18:17:24 2003 @@ -859,10 +859,10 @@ static int irttp_udata_indication(void * err = self->notify.udata_indication(self->notify.instance, self,skb); /* Same comment as in irttp_do_data_indication() */ - if (err != -ENOMEM) + if (!err) return 0; } - /* Either no handler, or -ENOMEM */ + /* Either no handler, or handler returns an error */ dev_kfree_skb(skb); return 0; @@ -1620,7 +1620,7 @@ void irttp_do_data_indication(struct tsa * be difficult, so it can instead just refuse to eat it and just * give an error back */ - if (err == -ENOMEM) { + if (err) { IRDA_DEBUG(0, "%s() requeueing skb!\n", __FUNCTION__); /* Make sure we take a break */ From davem@pizda.ninka.net Tue Nov 25 18:58:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 18:59: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.9) with SMTP id hAQ2wkTa003209 for ; Tue, 25 Nov 2003 18:58:48 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA00377; Tue, 25 Nov 2003 18:56:19 -0800 Date: Tue, 25 Nov 2003 18:56:19 -0800 From: "David S. Miller" To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Possible IRDA SKB leaks Message-Id: <20031125185619.40a004f1.davem@redhat.com> In-Reply-To: <20031126023358.GA15162@bougret.hpl.hp.com> References: <20031124193042.2c1013a2.davem@redhat.com> <20031126023358.GA15162@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: 1693 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, 25 Nov 2003 18:33:58 -0800 Jean Tourrilhes wrote: > I did the audit, and there was not many places to fix. Tested > on 2.6.0-test9 (both data and udata path). Patch is trivial and > attached below. > Thanks for the heads up ! Thanks a lot for following through on this Jean. Patch applied. From francois@baligant.net Tue Nov 25 20:26:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 20:26:52 -0800 (PST) Received: from casimir.nikita.cx (casimir.nikita.cx [198.63.211.44]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ4QbTc015665 for ; Tue, 25 Nov 2003 20:26:39 -0800 Received: from fortress (fbaligant.net1.nerim.net [213.41.146.186]) by casimir.nikita.cx (8.12.8/8.12.8) with SMTP id hAPMIHa4016443 for ; Tue, 25 Nov 2003 16:18:18 -0600 Message-ID: <16f901c3b3a1$c17235e0$15fea8c0@fortress> From: "Francois Baligant" To: Subject: 2.6.0-test9 [Bug 1595] New: Oops in tcp_v4_get_port Date: Tue, 25 Nov 2003 23:16:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Copied-To: backup@casimir.nikita.cx (by Synonym - http://www.modulo.ro/synonym) X-Scanned-By: MIMEDefang 2.37 X-archive-position: 1695 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: francois@baligant.net Precedence: bulk X-list: netdev From: To: Sent: Tuesday, November 25, 2003 9:26 PM Subject: [Bug 1595] New: Oops in tcp_v4_get_port > http://bugme.osdl.org/show_bug.cgi?id=1595 > > Summary: Oops in tcp_v4_get_port > Kernel Version: 2.6.0-test9 > Status: NEW > Severity: high > Owner: bugme-janitors@lists.osdl.org > Submitter: francois+kernel@nikita.cx > > > Distribution: > > Redhat Linux 7.3 > > Hardware Environment: > > Intel Xeon P4, SMP HyperThreading activated > > Software Environment: > > # lsmod > Module Size Used by > netconsole 3968 0 > softdog 5188 0 > ipv6 259936 16 > autofs 18432 0 > tg3 64640 0 > e100 60804 0 > ipt_REJECT 7360 1 > iptable_filter 3616 1 > ip_tables 18896 2 ipt_REJECT,iptable_filter > > Problem Description: > > Unable to handle kernel NULL pointer dereference at virtual address 00000049 > printing eip: > 802771a7 > *pde = 00000000 > Oops: 0000 [#1] > CPU: 1 > EIP: 0060:[<802771a7>] Not tainted > EFLAGS: 00010246 > EIP is at tcp_v4_get_port+0x1b7/0x300 > eax: 00000000 ebx: f43f5c90 ecx: 00000001 edx: f43f5c80 > esi: f56c1510 edi: f4330b10 ebp: 84837326 esp: f4e11e88 > ds: 007b es: 007b ss: 0068 > Process thttpd (pid: 5659, threadinfo=f4e10000 task=f5a68080) > Stack: 00000001 00000000 00000000 00000001 f7880280 00000050 bffa6d48 bffa6c00 > ffffffea 00000002 80287fd8 bffa6c00 00000050 00000050 f50af380 f4e11ee4 > 00000010 00000000 80241736 f50af380 f4e11ee4 00000010 00000000 50000002 > Call Trace: > [<80287fd8>] inet_bind+0x158/0x260 > [<80241736>] sys_bind+0x56/0x80 > [<802406be>] sock_map_fd+0xbe/0x120 > [<8024070d>] sock_map_fd+0x10d/0x120 > [<80287985>] inet_setsockopt+0x25/0x30 > [<80241cec>] sys_setsockopt+0x4c/0x80 > [<80241d0e>] sys_setsockopt+0x6e/0x80 > [<802422e3>] sys_socketcall+0xc3/0x250 > [<80165529>] sys_fcntl64+0x69/0x70 > [<8010aa73>] syscall_call+0x7/0xb > > Code: f6 40 49 20 75 52 8d 76 00 8b 44 24 2c 8b 48 04 85 c9 74 0b > <0>Kernel panic: Fatal exception in interrupt > In interrupt handler - not syncing > <0>Rebooting in 15 seconds.. > > (gdb) list *(tcp_v4_get_port+0x1b7) > 0x802771a7 is in tcp_v4_get_port (tcp_ipv4.c:195). > 190 struct sock *sk2; > 191 struct hlist_node *node; > 192 int reuse = sk->sk_reuse; > 193 > 194 sk_for_each_bound(sk2, node, &tb->owners) { > 195 if (sk != sk2 && > 196 !ipv6_only_sock(sk2) && > 197 (!sk->sk_bound_dev_if || > 198 !sk2->sk_bound_dev_if || > 199 sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { > > Steps to reproduce: > > eth0 is 10.0.0.1 > eth0:0 is 10.0.0.2 > > thttpd listening on 10.0.0.1:80 and serving lots of clients > modify configuration so thttpd listen on 10.0.0.2:80 > kill thttpd ; restart thttpd > kernel oops > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > From francois@baligant.net Tue Nov 25 20:26:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 20:26:52 -0800 (PST) Received: from casimir.nikita.cx (casimir.nikita.cx [198.63.211.44]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQ4QbTa015665 for ; Tue, 25 Nov 2003 20:26:38 -0800 Received: from fortress (fbaligant.net1.nerim.net [213.41.146.186]) by casimir.nikita.cx (8.12.8/8.12.8) with SMTP id hAQ16Ra4022922 for ; Tue, 25 Nov 2003 19:06:28 -0600 Message-ID: <177601c3b3b9$3f2c37d0$15fea8c0@fortress> From: "Francois Baligant" To: Subject: Fw: [Bug 1595] New: Oops in tcp_v4_get_port Date: Wed, 26 Nov 2003 02:04:29 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Copied-To: backup@casimir.nikita.cx (by Synonym - http://www.modulo.ro/synonym) X-Scanned-By: MIMEDefang 2.37 X-archive-position: 1694 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: francois@baligant.net Precedence: bulk X-list: netdev Hi, I have been told the following Kernel Oops in networking code could be of interest to netdev people. ----- Original Message ----- From: To: Sent: Tuesday, November 25, 2003 9:26 PM Subject: [Bug 1595] New: Oops in tcp_v4_get_port > http://bugme.osdl.org/show_bug.cgi?id=1595 > > Summary: Oops in tcp_v4_get_port > Kernel Version: 2.6.0-test9 > Status: NEW > Severity: high > Owner: bugme-janitors@lists.osdl.org > Submitter: francois+kernel@nikita.cx > > > Distribution: > > Redhat Linux 7.3 > > Hardware Environment: > > Intel Xeon P4, SMP HyperThreading activated > > Software Environment: > > # lsmod > Module Size Used by > netconsole 3968 0 > softdog 5188 0 > ipv6 259936 16 > autofs 18432 0 > tg3 64640 0 > e100 60804 0 > ipt_REJECT 7360 1 > iptable_filter 3616 1 > ip_tables 18896 2 ipt_REJECT,iptable_filter > > Problem Description: > > Unable to handle kernel NULL pointer dereference at virtual address 00000049 > printing eip: > 802771a7 > *pde = 00000000 > Oops: 0000 [#1] > CPU: 1 > EIP: 0060:[<802771a7>] Not tainted > EFLAGS: 00010246 > EIP is at tcp_v4_get_port+0x1b7/0x300 > eax: 00000000 ebx: f43f5c90 ecx: 00000001 edx: f43f5c80 > esi: f56c1510 edi: f4330b10 ebp: 84837326 esp: f4e11e88 > ds: 007b es: 007b ss: 0068 > Process thttpd (pid: 5659, threadinfo=f4e10000 task=f5a68080) > Stack: 00000001 00000000 00000000 00000001 f7880280 00000050 bffa6d48 bffa6c00 > ffffffea 00000002 80287fd8 bffa6c00 00000050 00000050 f50af380 f4e11ee4 > 00000010 00000000 80241736 f50af380 f4e11ee4 00000010 00000000 50000002 > Call Trace: > [<80287fd8>] inet_bind+0x158/0x260 > [<80241736>] sys_bind+0x56/0x80 > [<802406be>] sock_map_fd+0xbe/0x120 > [<8024070d>] sock_map_fd+0x10d/0x120 > [<80287985>] inet_setsockopt+0x25/0x30 > [<80241cec>] sys_setsockopt+0x4c/0x80 > [<80241d0e>] sys_setsockopt+0x6e/0x80 > [<802422e3>] sys_socketcall+0xc3/0x250 > [<80165529>] sys_fcntl64+0x69/0x70 > [<8010aa73>] syscall_call+0x7/0xb > > Code: f6 40 49 20 75 52 8d 76 00 8b 44 24 2c 8b 48 04 85 c9 74 0b > <0>Kernel panic: Fatal exception in interrupt > In interrupt handler - not syncing > <0>Rebooting in 15 seconds.. > > (gdb) list *(tcp_v4_get_port+0x1b7) > 0x802771a7 is in tcp_v4_get_port (tcp_ipv4.c:195). > 190 struct sock *sk2; > 191 struct hlist_node *node; > 192 int reuse = sk->sk_reuse; > 193 > 194 sk_for_each_bound(sk2, node, &tb->owners) { > 195 if (sk != sk2 && > 196 !ipv6_only_sock(sk2) && > 197 (!sk->sk_bound_dev_if || > 198 !sk2->sk_bound_dev_if || > 199 sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { > > Steps to reproduce: > > eth0 is 10.0.0.1 > eth0:0 is 10.0.0.2 > > thttpd listening on 10.0.0.1:80 and serving lots of clients > modify configuration so thttpd listen on 10.0.0.2:80 > kill thttpd ; restart thttpd > kernel oops > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > From davem@pizda.ninka.net Tue Nov 25 20:59:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Nov 2003 20:59: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.9) with SMTP id hAQ4xETa017799 for ; Tue, 25 Nov 2003 20:59:14 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA00682; Tue, 25 Nov 2003 20:58:45 -0800 Date: Tue, 25 Nov 2003 20:58:44 -0800 From: "David S. Miller" To: "Francois Baligant" Cc: netdev@oss.sgi.com Subject: Re: Fw: [Bug 1595] New: Oops in tcp_v4_get_port Message-Id: <20031125205844.64422f4c.davem@redhat.com> In-Reply-To: <177601c3b3b9$3f2c37d0$15fea8c0@fortress> References: <177601c3b3b9$3f2c37d0$15fea8c0@fortress> 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: 1696 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, 26 Nov 2003 02:04:29 +0100 "Francois Baligant" wrote: > I have been told the following Kernel Oops in networking code could be of > interest to netdev people. As I posted in response on linux-kernel, this bug is fixed in test10 already. From romieu@fr.zoreil.com Wed Nov 26 00:03:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 00:04:09 -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.9) with SMTP id hAQ83sTa011689 for ; Wed, 26 Nov 2003 00:03:55 -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 hAQ7vLK7030432; Wed, 26 Nov 2003 08:57:21 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAQ7vKOt030431; Wed, 26 Nov 2003 08:57:20 +0100 Date: Wed, 26 Nov 2003 08:57:20 +0100 From: Francois Romieu To: Brad House Cc: netdev@oss.sgi.com, Jeff Garzik Subject: Re: r8169 -- bad patch Message-ID: <20031126085720.A30194@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> <3FC3F9E8.7040403@mcve.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3FC3F9E8.7040403@mcve.com>; from brad@mcve.com on Tue, Nov 25, 2003 at 07:55:04PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 1697 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 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Brad House : > it appears as though the > r8169-start-xmit-fixes.patch > is the culprit for the system lockups ... > After reverting that patch, it went back to vanilla behavior. Could you replace it with the attached version of r8169-start-xmit-fixes.patch ? -- Ueimor --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-start-xmit-fixes.patch" rtl8169_start_xmit fixes: - it forgot to update stats if the skb couldn't be expanded; - it didn't free it either if the descriptor was not available. drivers/net/r8169.c | 30 ++++++++++++++++++------------ 1 files changed, 18 insertions(+), 12 deletions(-) diff -puN drivers/net/r8169.c~r8169-start-xmit-fixes drivers/net/r8169.c --- linux-2.6.0-test9/drivers/net/r8169.c~r8169-start-xmit-fixes 2003-11-26 08:29:40.000000000 +0100 +++ linux-2.6.0-test9-fr/drivers/net/r8169.c 2003-11-26 08:31:25.000000000 +0100 @@ -918,11 +918,13 @@ rtl8169_start_xmit(struct sk_buff *skb, struct rtl8169_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; int entry = tp->cur_tx % NUM_TX_DESC; + u32 len = skb->len; - if (skb->len < ETH_ZLEN) { + if (unlikely(skb->len < ETH_ZLEN)) { skb = skb_padto(skb, ETH_ZLEN); - if (skb == NULL) - return 0; + if (!skb) + goto err_update_stats; + len = ETH_ZLEN; } spin_lock_irq(&tp->lock); @@ -930,21 +932,17 @@ rtl8169_start_xmit(struct sk_buff *skb, if ((tp->TxDescArray[entry].status & OWNbit) == 0) { tp->Tx_skbuff[entry] = skb; tp->TxDescArray[entry].buf_addr = virt_to_bus(skb->data); - if (entry != (NUM_TX_DESC - 1)) - tp->TxDescArray[entry].status = - (OWNbit | FSbit | LSbit) | ((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); + tp->TxDescArray[entry].status = OWNbit | FSbit | LSbit | len | + (EORbit * !((entry + 1) % NUM_TX_DESC)); + RTL_W8(TxPoll, 0x40); //set polling bit dev->trans_start = jiffies; tp->cur_tx++; - } + } else + goto err_drop; spin_unlock_irq(&tp->lock); @@ -952,7 +950,15 @@ rtl8169_start_xmit(struct sk_buff *skb, netif_stop_queue(dev); } +out: return 0; + +err_drop: + spin_unlock_irq(&tp->lock); + dev_kfree_skb(skb); +err_update_stats: + tp->stats.tx_dropped++; + goto out; } static void _ --OXfL5xGRrasGEqWY-- From yoshfuji@wide.ad.jp Wed Nov 26 00:49:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 00:50: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.9) with SMTP id hAQ8niTa016505 for ; Wed, 26 Nov 2003 00:49:45 -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 hAQ8oIlg015092 for ; Wed, 26 Nov 2003 17:50:18 +0900 Resent-Date: Wed, 26 Nov 2003 17:50:18 +0900 (JST) Resent-Message-Id: <20031126.175018.52712920.yoshfuji@wide.ad.jp> Resent-To: netdev@oss.sgi.com Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Date: Wed, 26 Nov 2003 09:17:45 +0100 From: Felix von Leitner To: linux-kernel@vger.kernel.org Subject: ipv4-mapped ipv4 connect() for UDP broken in test10 Message-ID: <20031126081745.GA31415@codeblau.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 1698 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@wide.ad.jp Precedence: bulk X-list: netdev My IPv6 port for djbdns' dnscache does not work with -test10. The symptom is that all queries time out. Some digging reveals that djbdns does this (with scope_id 0): socket(PF_INET6,...) bind socket to :: connect() socket to IP of peer (in this case, 210.81.13.179) send() dns query at this point, the query is not sent over ppp0 as it should, but it is sent to lo. Not only that, but the queries are _received_ by the same djbdns (with servfail), although the destination IP is as said above 210.81.13.179 and none of my local IPs: 10.0.0.6, 127.0.0.1, or 217.88.123.45. Any ideas? Please do not ship 2.6.0-final with a bug like this in it! Felix - 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 yoshfuji@linux-ipv6.org Wed Nov 26 02:03:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 02:04:08 -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.9) with SMTP id hAQA3qTa030961 for ; Wed, 26 Nov 2003 02:03:53 -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 hAQA47lg015400; Wed, 26 Nov 2003 19:04:07 +0900 Date: Wed, 26 Nov 2003 19:04:07 +0900 (JST) Message-Id: <20031126.190407.102714104.yoshfuji@linux-ipv6.org> To: felix-kernel@fefe.de Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org, davem@redhat.com Subject: Re: ipv4-mapped ipv4 connect() for UDP broken in test10 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031126081745.GA31415@codeblau.de> References: <20031126081745.GA31415@codeblau.de> 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: 1699 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 <20031126081745.GA31415@codeblau.de> (at Wed, 26 Nov 2003 09:17:45 +0100), Felix von Leitner says: > Some digging reveals that djbdns does this (with scope_id 0): > > socket(PF_INET6,...) > bind socket to :: > connect() socket to IP of peer (in this case, 210.81.13.179) > send() dns query > > at this point, the query is not sent over ppp0 as it should, but it is > sent to lo. Not only that, but the queries are _received_ by the same > djbdns (with servfail), although the destination IP is as said above > 210.81.13.179 and none of my local IPs: 10.0.0.6, 127.0.0.1, or > 217.88.123.45. Please apply this patch. (But I'm not sure this fix your problem...) ===== net/ipv6/udp.c 1.54 vs edited ===== --- 1.54/net/ipv6/udp.c Tue Nov 18 11:41:56 2003 +++ edited/net/ipv6/udp.c Wed Nov 26 19:01:15 2003 @@ -825,7 +825,7 @@ struct sockaddr_in sin; sin.sin_family = AF_INET; sin.sin_port = sin6 ? sin6->sin6_port : inet->dport; - sin.sin_addr.s_addr = daddr->s6_addr[3]; + sin.sin_addr.s_addr = daddr->s6_addr32[3]; msg->msg_name = &sin; msg->msg_namelen = sizeof(sin); do_udp_sendmsg: -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From rask@sygehus.dk Wed Nov 26 03:17:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 03:17:57 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQBHWTa001468 for ; Wed, 26 Nov 2003 03:17:33 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 8FA66193C5; Wed, 26 Nov 2003 00:41:53 +0100 (CET) Date: Wed, 26 Nov 2003 00:41:52 +0100 From: Rask Ingemann Lambertsen To: Ben Greear Cc: "'netdev@oss.sgi.com'" Subject: Re: [PATCH 3/3] rx_all e100 patch Message-ID: <20031126004149.A1264@sygehus.dk> References: <3FC30AEE.7000005@candelatech.com> <20031125162152.D1107@sygehus.dk> <3FC39969.4030609@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: <3FC39969.4030609@candelatech.com>; from greearb@candelatech.com on Tue, Nov 25, 2003 at 10:03:21AM -0800 X-archive-position: 1701 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 Tue, Nov 25, 2003 at 10:03:21AM -0800, Ben Greear wrote: > Rask Ingemann Lambertsen wrote: > > > > I don't understand this part of the code. The 55x docs say that the IP > > checksum bytes are transferred to memory _following_ the FCS. > > I can't find this in the docs, but it could easily be true. If you have a page/section > number, please let me know. Section 6.4.3.4.1, page 102 if you go by the document page numbers or page 110 if you go by xpdf's page numbers. > I don't appear to have hardware that takes this > branch at any rate. Anyone know which chipset/NIC has this particular rev-id? The i82559. I wouldn't mind a few comment lines that map Intel's internal names like D101M, D102 etc. into externally visible part numbers. > Also, this should invalidate all of the hacks from the e100_D101M_checksum code... I guess it does if you skb_put() the FCS along with the payload. I haven't checked that, but I think you're right. -- Regards, Rask Ingemann Lambertsen From rask@sygehus.dk Wed Nov 26 03:17:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 03:17:57 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQBHWTa001469 for ; Wed, 26 Nov 2003 03:17:33 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 44DD6193DB; Wed, 26 Nov 2003 01:04:00 +0100 (CET) Date: Wed, 26 Nov 2003 01:04:00 +0100 From: Rask Ingemann Lambertsen To: Felix Radensky Cc: netdev@oss.sgi.com Subject: Re: hw tcp v4 csum failed on 2.4.23-rc2 with e100 Message-ID: <20031126010359.B1264@sygehus.dk> References: <3FBDE9BF.2070909@allot.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: <3FBDE9BF.2070909@allot.com>; from felix@allot.com on Fri, Nov 21, 2003 at 12:32:31PM +0200 X-archive-position: 1700 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 21, 2003 at 12:32:31PM +0200, Felix Radensky wrote: > Hi, > > I keep getting tons of this messages with 2.4.23-rc2 > and e100 driver: > > hw tcp v4 csum failed > hw tcp v4 csum failed I just got (e100 with i82559, kernel 2.4.22-bk45) Nov 25 23:17:13 linddaase kernel: udp v4 hw csum failure. Nov 25 23:20:51 linddaase kernel: udp v4 hw csum failure. Nov 25 23:26:59 linddaase kernel: udp v4 hw csum failure. Nov 25 23:26:59 linddaase kernel: UDP: bad checksum. From 130.233.41.46:47064 to 80.161.68.244:1026 ulen 421 while playing XPilot on kallio.cs.hut.fi. Two false alarms and one real checksum failure. What the deal is with the false alarms is a good question since no useful information about the packets is logged. -- Regards, Rask Ingemann Lambertsen From rask@sygehus.dk Wed Nov 26 04:41:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 04:42:13 -0800 (PST) Received: from 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (0x50a144f4.albnxx15.adsl-dhcp.tele.dk [80.161.68.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQCfgTa006607 for ; Wed, 26 Nov 2003 04:41:43 -0800 Received: by 0x50a144f4.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 36D93194D2; Wed, 26 Nov 2003 13:41:40 +0100 (CET) Date: Wed, 26 Nov 2003 13:41:40 +0100 From: Rask Ingemann Lambertsen To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: de2104x problems (and perhaps a clue as to why) Message-ID: <20031126134140.A7327@sygehus.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-archive-position: 1702 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 Hi. I'm trying to get the de2104x driver to work with a DE450 board. It looks like something is wrong with either the code to start/stop the chip. This is with 2.6.0-test10 with your 2.6.0-test9-bk24-netdrv-exp1 patch and the de2104x fixes posted in the last few days. $ modprobe -k de2104x $ ethtool -s eth0 port bnc $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe00000 ffffffff ffffffff 016dc000 016dc400 fc000000 7ffc0040 fffe0000 0x40: fffe0000 ffff4bf8 ffffffff fffe0000 000000c4 ffff0000 ffffffff ffff0000 Port selection is half-duplex. Transmit stopped, Receive stopped. The Rx process state is 'Stopped'. The Tx process state is 'Stopped'. The transmit unit is set to store-and-forward. The NWay status register is 000000c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Autonegotiation disabled'. $ ifconfig eth0 up $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe00000 ffffffff ffffffff 014c5000 014c5400 fc660000 7ffc2002 ffffb0d5 0x40: fffe0000 ffff03ff ffffffff fffe0000 000020c4 ffffef09 fffff7fd ffff0006 Port selection is half-duplex. Transmit started, Receive started. The Rx process state is 'Waiting for packets'. The Tx process state is 'Idle'. The transmit unit is set to store-and-forward. The NWay status register is 000020c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Ability detect'. $ ifconfig eth0 down $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe00000 ffffffff ffffffff 014c5000 014c5400 fc000000 7ffc0000 fffe0000 0x40: fffe0000 ffff4bf8 ffffffff fffe0000 000020c4 ffffef09 fffff7fd ffff0006 Port selection is half-duplex. Transmit stopped, Receive stopped. The Rx process state is 'Stopped'. The Tx process state is 'Stopped'. The transmit unit is set to store-and-forward. The NWay status register is 000020c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Ability detect'. So far so good. Now, if I try to bring the interface up again, the trouble starts: $ ifconfig eth0 up $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe00000 ffffffff ffffffff 0171a000 0171a400 fc120000 7ffc2002 ffffb0d5 0x40: fffe0000 ffff03ff ffffffff fffe0000 000020c4 ffffef09 fffff7fd ffff0006 Port selection is half-duplex. Transmit started, Receive started. The Rx process state is 'Reading a Rx descriptor'. The Tx process state is 'Reading a Tx descriptor'. The transmit unit is set to store-and-forward. The NWay status register is 000020c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Ability detect'. Taking the interface down no longer works either: $ ifconfig eth0 down eth0: timeout expired stopping dma $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe00000 ffffffff ffffffff 0171a000 0171a400 fc120000 7ffc0000 fffe0000 0x40: fffe0000 ffff4bf8 ffffffff fffe0000 000020c4 ffffef09 fffff7fd ffff0006 Port selection is half-duplex. Transmit stopped, Receive stopped. The Rx process state is 'Reading a Rx descriptor'. The Tx process state is 'Reading a Tx descriptor'. The transmit unit is set to store-and-forward. The NWay status register is 000020c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Ability detect'. The chip appears to get stuck reading the descriptors. Reloading the module is necessary to make the interface work again. The de4x5 driver works fine. $ rmmod de2104x $ modprobe -k de4x5 $ ifconfig eth0 up $ ifconfig eth0 down $ ifconfig eth0 up $ tulip-diag -faa tulip-diag.c:v2.17 5/6/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Index #1: Found a Digital DC21041 Tulip adapter at 0x2080. Digital DC21041 Tulip chip registers at 0x2080: 0x00: ffe08400 ffffffff ffffffff 0139a000 0139a080 fc660000 7ffc2002 ffff8065 0x40: fffe0000 ffff03ff ffffffff fffe0000 000000c4 ffffef09 fffff73d ffff0006 Port selection is half-duplex. Transmit started, Receive started. The Rx process state is 'Waiting for packets'. The Tx process state is 'Idle'. The transmit unit is set to store-and-forward. The NWay status register is 000000c4. 100baseTx link good. 10baseT link good. Internal autonegotiation state is 'Autonegotiation disabled'. lspci dug up something interesting: $ modprobe -k de2104x $ ethtool -s eth0 port bnc $ ifconfig eth0 up $ ifconfig eth0 down $ ifconfig eth0 up $ lspci -vvv [...] 00:0e.0 Ethernet controller: Digital Equipment Corporation DECchip 21041 [Tulip Pass 3] (rev 11) Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- [disabled] [size=256K] [...] Say what? It says "BusMaster-", which means busmaster DMA is disabled, right? Then of course it won't work. Is this because de_close() calls pci_disable_device() and de_open() doesn't not reenable the device? -- Regards, Rask Ingemann Lambertsen From akpm@osdl.org Wed Nov 26 05:46:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 05:46:36 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQDkMTa008598 for ; Wed, 26 Nov 2003 05:46:23 -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 hAQDkAC02445; Wed, 26 Nov 2003 05:46:10 -0800 Date: Wed, 26 Nov 2003 05:52:58 -0800 From: Andrew Morton To: Christian Schlittchen Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.0-test10: Badness in local_bh_enable at kernel/softirq.c:121 Message-Id: <20031126055258.7526a09d.akpm@osdl.org> In-Reply-To: <20031126104243.GA1395@amber.kn-bremen.de> References: <20031126104243.GA1395@amber.kn-bremen.de> 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: 1703 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 Christian Schlittchen wrote: > > > When trying to establish a ppp/pppoe connection I get the following > and the connection fails: > > Badness in local_bh_enable at kernel/softirq.c:121 > Call Trace: > [] local_bh_enable+0x8c/0x90 > [] ppp_sync_push+0x6e/0x1a0 [ppp_synctty] > [] __lookup_hash+0x70/0xd0 > [] ppp_sync_wakeup+0x31/0x70 [ppp_synctty] > [] pty_unthrottle+0x59/0x60 > [] check_unthrottle+0x3a/0x40 > [] n_tty_flush_buffer+0x13/0x60 > [] pty_flush_buffer+0x6d/0x70 > [] do_tty_hangup+0x3fe/0x460 The warning is a pest, and is due to do_tty_hangup() bogusly disabling interrupts in the hope that it does something useful. It needs to be fixed up. But it is unrelated to the PPP failure. I'm afraid it is so long since I used PPP and pppd that I cannot suggest how you should set about gathering extra info on that. From clem@clem.clem-digital.net Wed Nov 26 07:27:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 07:27:59 -0800 (PST) Received: from clem.clem-digital.net (clem.clem-digital.net [68.16.168.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAQFRhTa010944 for ; Wed, 26 Nov 2003 07:27:43 -0800 Received: (from clem@localhost) by clem.clem-digital.net (8.9.3p2/8.9.3) id KAA00655; Wed, 26 Nov 2003 10:27:22 -0500 From: Pete Clements Message-Id: <200311261527.KAA00655@clem.clem-digital.net> Subject: Re: 2.6.0-test10: Badness in local_bh_enable at kernel/softirq.c:121 In-Reply-To: <20031126055258.7526a09d.akpm@osdl.org> from Andrew Morton at "Nov 26, 2003 5:52:58 am" To: akpm@osdl.org (Andrew Morton) Date: Wed, 26 Nov 2003 10:27:22 -0500 (EST) Cc: corwin@amber.kn-bremen.de, linux-kernel@vger.kernel.org, netdev@oss.sgi.com X-Mailer: ELM [version 2.4ME+ PL48 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1704 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: clem@clem.clem-digital.net Precedence: bulk X-list: netdev Quoting Andrew Morton > Christian Schlittchen wrote: > > > > > > When trying to establish a ppp/pppoe connection I get the following > > and the connection fails: > > > > Badness in local_bh_enable at kernel/softirq.c:121 > > Call Trace: > > [] local_bh_enable+0x8c/0x90 > > [] ppp_sync_push+0x6e/0x1a0 [ppp_synctty] > > [] __lookup_hash+0x70/0xd0 > > [] ppp_sync_wakeup+0x31/0x70 [ppp_synctty] > > [] pty_unthrottle+0x59/0x60 > > [] check_unthrottle+0x3a/0x40 > > [] n_tty_flush_buffer+0x13/0x60 > > [] pty_flush_buffer+0x6d/0x70 > > [] do_tty_hangup+0x3fe/0x460 > > The warning is a pest, and is due to do_tty_hangup() bogusly disabling > interrupts in the hope that it does something useful. It needs to be fixed > up. > > But it is unrelated to the PPP failure. I'm afraid it is so long since I > used PPP and pppd that I cannot suggest how you should set about gathering > extra info on that. > What network card? Multi-cards? Is the card detected? Around 2.5.71 the 3c509 init/detect changed such that the second card is not detected. Will get the badness when attempting to bring up ppp/ppoe on a non-existent card. The 3c509 multi card breakage still exists at test10. I replace the driver with 2.5.7x version to get my pppoe. -- Pete Clements From brazilnut@us.ibm.com Wed Nov 26 10:51:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 10:51:20 -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.9) with SMTP id hAQIp0Ta016144 for ; Wed, 26 Nov 2003 10:51:06 -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 hAQIolh3727074; Wed, 26 Nov 2003 13:50:47 -0500 Received: from dyn318364bld.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 hAQIoiCx204246; Wed, 26 Nov 2003 13:50:44 -0500 Received: (from donf@localhost) by dyn318364bld.beaverton.ibm.com (8.11.6/8.11.6) id hAQIn9V10044; Wed, 26 Nov 2003 10:49:09 -0800 From: Don Fry Message-Id: <200311261849.hAQIn9V10044@dyn318364bld.beaverton.ibm.com> Subject: [PATCH] rmmod pcnet32 OOPS with 2.6.0-test10 To: tsbogend@alpha.franken.de Date: Wed, 26 Nov 2003 10:49:09 -0800 (PST) Cc: netdev@oss.sgi.com 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: 1705 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev When trying to rmmod pcnet32 multiple pci_unregister_driver calls causes a null pointer to be dereferenced. Fix tested with 2.6.0-test10-bk2. --- linux-2.6.0-test10-bk2/drivers/net/pcnet32.c Sun Nov 23 17:31:27 2003 +++ linux-2.6.0-test10-bk2p/drivers/net/pcnet32.c Wed Nov 26 10:40:35 2003 @@ -1766,8 +1766,6 @@ next_dev = lp->next; unregister_netdev(pcnet32_dev); release_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE); - if (lp->pci_dev) - pci_unregister_driver(&pcnet32_driver); pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr); free_netdev(pcnet32_dev); pcnet32_dev = next_dev; -- Don Fry brazilnut@us.ibm.com From jgarzik@pobox.com Wed Nov 26 12:12:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 12:12: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.9) with SMTP id hAQKCQTa017787 for ; Wed, 26 Nov 2003 12:12:27 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36291 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AP61R-0006ko-0j for netdev@oss.sgi.com; Wed, 26 Nov 2003 20:12:25 +0000 Message-ID: <3FC5091C.30705@pobox.com> Date: Wed, 26 Nov 2003 15:12:12 -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: netdev@oss.sgi.com Subject: Happy T-giving... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1706 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 Just FYI, patches sent through Sunday of this week will be delayed due to holidays. There appears to be pending stuff from Francois, shemminger, and others at the moment... From dave@thedillows.org Wed Nov 26 20:09:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 20:09:27 -0800 (PST) Received: from ori.thedillows.org (pcp03710388pcs.westk01.tn.comcast.net [68.34.200.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAR49DTa007959 for ; Wed, 26 Nov 2003 20:09:13 -0800 Received: from ori.thedillows.org (localhost.thedillows.org [127.0.0.1]) by ori.thedillows.org (8.12.8/8.12.8) with ESMTP id hAR498uB004596; Wed, 26 Nov 2003 23:09:08 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.12.8/8.12.8/Submit) id hAR498r6004594; Wed, 26 Nov 2003 23:09:08 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: [PATCH] Typhoon (3CR990) updates for 2.5 From: David Dillow To: Jeff Garzik Cc: Netdev Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1069906147.4552.10.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 26 Nov 2003 23:09:08 -0500 X-archive-position: 1710 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # 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.1486 -> 1.1487 # drivers/net/typhoon.c 1.8 -> 1.12 # # The following is the BitKeeper ChangeSet Log # -- # 03/11/26 dave@thedillows.org 1.1487 # Bug fixes: # * Avoid short timeouts when waiting for a reset # * Fix issue with loading runtime image on newer versions of the sleep image # * Fix link status reporting # -- # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c -- a/drivers/net/typhoon.c Wed Nov 26 01:28:53 2003 +++ b/drivers/net/typhoon.c Wed Nov 26 01:28:53 2003 @@ -85,8 +85,8 @@ #define PKT_BUF_SZ 1536 #define DRV_MODULE_NAME "typhoon" -#define DRV_MODULE_VERSION "1.5.1" -#define DRV_MODULE_RELDATE "03/06/26" +#define DRV_MODULE_VERSION "1.5.2" +#define DRV_MODULE_RELDATE "03/11/25" #define PFX DRV_MODULE_NAME ": " #define ERR_PFX KERN_ERR PFX @@ -127,7 +127,7 @@ static char version[] __devinitdata = "typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; -MODULE_AUTHOR("David Dillow "); +MODULE_AUTHOR("David Dillow "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("3Com Typhoon Family (3C990, 3CR990, and variants)"); MODULE_PARM(rx_copybreak, "i"); @@ -146,11 +146,12 @@ int capabilities; }; -#define TYPHOON_CRYPTO_NONE 0 -#define TYPHOON_CRYPTO_DES 1 -#define TYPHOON_CRYPTO_3DES 2 -#define TYPHOON_CRYPTO_VARIABLE 4 -#define TYPHOON_FIBER 8 +#define TYPHOON_CRYPTO_NONE 0x00 +#define TYPHOON_CRYPTO_DES 0x01 +#define TYPHOON_CRYPTO_3DES 0x02 +#define TYPHOON_CRYPTO_VARIABLE 0x04 +#define TYPHOON_FIBER 0x08 +#define TYPHOON_WAKEUP_NEEDS_RESET 0x10 enum typhoon_cards { TYPHOON_TX = 0, TYPHOON_TX95, TYPHOON_TX97, TYPHOON_SVR, @@ -307,7 +308,8 @@ /* We'll wait up to six seconds for a reset, and half a second normally. */ #define TYPHOON_UDELAY 50 -#define TYPHOON_RESET_TIMEOUT (6 * HZ) +#define TYPHOON_RESET_TIMEOUT_SLEEP (6 * HZ) +#define TYPHOON_RESET_TIMEOUT_NOSLEEP ((6 * 1000000) / TYPHOON_UDELAY) #define TYPHOON_WAIT_TIMEOUT ((1000000 / 2) / TYPHOON_UDELAY) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28) @@ -375,10 +377,12 @@ typhoon_reset(unsigned long ioaddr, int wait_type) { int i, err = 0; - int timeout = TYPHOON_RESET_TIMEOUT; + int timeout; if(wait_type == WaitNoSleep) - timeout = (timeout * 1000000) / (HZ * TYPHOON_UDELAY); + timeout = TYPHOON_RESET_TIMEOUT_NOSLEEP; + else + timeout = TYPHOON_RESET_TIMEOUT_SLEEP; writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_MASK); writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_STATUS); @@ -1858,6 +1862,11 @@ if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_SLEEPING) < 0) return -ETIMEDOUT; + /* Since we cannot monitor the status of the link while sleeping, + * tell the world it went away. + */ + netif_carrier_off(tp->dev); + pci_enable_wake(tp->pdev, state, 1); pci_disable_device(pdev); return pci_set_power_state(pdev, state); @@ -1872,8 +1881,13 @@ pci_set_power_state(pdev, 0); pci_restore_state(pdev, tp->pci_state); + /* Post 2.x.x versions of the Sleep Image require a reset before + * we can download the Runtime Image. But let's not make users of + * the old firmware pay for the reset. + */ writel(TYPHOON_BOOTCMD_WAKEUP, ioaddr + TYPHOON_REG_COMMAND); - if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) + if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0 || + (tp->capabilities & TYPHOON_WAKEUP_NEEDS_RESET)) return typhoon_reset(ioaddr, wait_type); return 0; @@ -2251,7 +2265,7 @@ void *shared; dma_addr_t shared_dma; struct cmd_desc xp_cmd; - struct resp_desc xp_resp; + struct resp_desc xp_resp[3]; int i; int err = 0; @@ -2380,15 +2394,15 @@ } INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS); - if(typhoon_issue_command(tp, 1, &xp_cmd, 1, &xp_resp) < 0) { + if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) { printk(ERR_PFX "%s: cannot read MAC address\n", pci_name(pdev)); err = -EIO; goto error_out_reset; } - *(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp.parm1)); - *(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp.parm2)); + *(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1)); + *(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2)); if(!is_valid_ether_addr(dev->dev_addr)) { printk(ERR_PFX "%s: Could not obtain valid ethernet address, " @@ -2396,6 +2410,28 @@ goto error_out_reset; } + /* Read the Sleep Image version last, so the response is valid + * later when we print out the version reported. + */ + INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS); + if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { + printk(ERR_PFX "%s: Could not get Sleep Image version\n", + pdev->slot_name); + goto error_out_reset; + } + + tp->capabilities = typhoon_card_info[card_id].capabilities; + tp->xcvr_select = TYPHOON_XCVR_AUTONEG; + + /* Typhoon 1.0 Sleep Images return one response descriptor to the + * READ_VERSIONS command. Those versions are OK after waking up + * from sleep without needing a reset. Typhoon 1.1+ Sleep Images + * seem to need a little extra help to get started. Since we don't + * know how to nudge it along, just kick it. + */ + if(xp_resp[0].numDesc != 0) + tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET; + if(typhoon_sleep(tp, 3, 0) < 0) { printk(ERR_PFX "%s: cannot put adapter to sleep\n", pci_name(pdev)); @@ -2403,9 +2439,6 @@ goto error_out_reset; } - tp->capabilities = typhoon_card_info[card_id].capabilities; - tp->xcvr_select = TYPHOON_XCVR_AUTONEG; - /* The chip-specific entries in the device structure. */ dev->open = typhoon_open; dev->hard_start_xmit = typhoon_start_tx; @@ -2442,6 +2475,32 @@ printk("%2.2x:", dev->dev_addr[i]); printk("%2.2x\n", dev->dev_addr[i]); + /* xp_resp still contains the response to the READ_VERSIONS command. + * For debugging, let the user know what version he has. + */ + if(xp_resp[0].numDesc == 0) { + /* This is the Typhoon 1.0 type Sleep Image, last 16 bits + * of version is Month/Day of build. + */ + u16 monthday = le32_to_cpu(xp_resp[0].parm2) & 0xffff; + printk(KERN_INFO "%s: Typhoon 1.0 Sleep Image built " + "%02u/%02u/2000\n", dev->name, monthday >> 8, + monthday & 0xff); + } else if(xp_resp[0].numDesc == 2) { + /* This is the Typhoon 1.1+ type Sleep Image + */ + u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2); + u8 *ver_string = (u8 *) &xp_resp[1]; + ver_string[25] = 0; + printk(KERN_INFO "%s: Typhoon 1.1+ Sleep Image version " + "%u.%u.%u.%u %s\n", dev->name, HIPQUAD(sleep_ver), + ver_string); + } else { + printk(KERN_WARNING "%s: Unknown Sleep Image version " + "(%u:%04x)\n", dev->name, xp_resp[0].numDesc, + le32_to_cpu(xp_resp[0].parm2)); + } + return 0; error_out_reset: From dave@thedillows.org Wed Nov 26 20:09:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 20:09:19 -0800 (PST) Received: from ori.thedillows.org (pcp03710388pcs.westk01.tn.comcast.net [68.34.200.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAR495Ta007948 for ; Wed, 26 Nov 2003 20:09:06 -0800 Received: from ori.thedillows.org (localhost.thedillows.org [127.0.0.1]) by ori.thedillows.org (8.12.8/8.12.8) with ESMTP id hAR48xuB004578; Wed, 26 Nov 2003 23:08:59 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.12.8/8.12.8/Submit) id hAR48xOd004576; Wed, 26 Nov 2003 23:08:59 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: [BK] Typhoon (3CR990) updates for 2.4 From: David Dillow To: Jeff Garzik Cc: Netdev Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1069906138.4552.4.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 26 Nov 2003 23:08:59 -0500 X-archive-position: 1707 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev Jeff, please do a bk pull http://typhoon.bkbits.net/typhoon-2.4 This will update the following files: drivers/net/typhoon.c | 97 ++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 78 insertions(+), 19 deletions(-) through these ChangeSets: (03/11/25 1.1063.47.1) Bug fixes: * Avoid short timeouts when waiting for a reset * Support newer versions of the sleep image * Fix link status reporting From dave@thedillows.org Wed Nov 26 20:09:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 20:09:24 -0800 (PST) Received: from ori.thedillows.org (pcp03710388pcs.westk01.tn.comcast.net [68.34.200.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAR49ATa007950 for ; Wed, 26 Nov 2003 20:09:11 -0800 Received: from ori.thedillows.org (localhost.thedillows.org [127.0.0.1]) by ori.thedillows.org (8.12.8/8.12.8) with ESMTP id hAR495uB004590; Wed, 26 Nov 2003 23:09:05 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.12.8/8.12.8/Submit) id hAR495hL004588; Wed, 26 Nov 2003 23:09:05 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: [BK] Typhoon (3CR990) updates for 2.5 From: David Dillow To: Jeff Garzik Cc: Netdev Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1069906145.4552.8.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 26 Nov 2003 23:09:05 -0500 X-archive-position: 1709 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev Jeff, please do a bk pull http://typhoon.bkbits.net/typhoon-2.5 This will update the following files: drivers/net/typhoon.c | 97 ++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 78 insertions(+), 19 deletions(-) through these ChangeSets: (03/11/26 1.1487) Bug fixes: * Avoid short timeouts when waiting for a reset * Fix issue with loading runtime image on newer versions of the sleep image * Fix link status reporting From dave@thedillows.org Wed Nov 26 20:09:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Nov 2003 20:09:21 -0800 (PST) Received: from ori.thedillows.org (pcp03710388pcs.westk01.tn.comcast.net [68.34.200.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAR497Ta007949 for ; Wed, 26 Nov 2003 20:09:07 -0800 Received: from ori.thedillows.org (localhost.thedillows.org [127.0.0.1]) by ori.thedillows.org (8.12.8/8.12.8) with ESMTP id hAR491uB004584; Wed, 26 Nov 2003 23:09:01 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.12.8/8.12.8/Submit) id hAR491Pj004582; Wed, 26 Nov 2003 23:09:01 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: [PATCH] Typhoon (3CR990) updates for 2.4 From: David Dillow To: Jeff Garzik Cc: Netdev Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1069906141.4557.6.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 26 Nov 2003 23:09:01 -0500 X-archive-position: 1708 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # 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.1063.4.32 -> 1.1063.47.1 # drivers/net/typhoon.c 1.4 -> 1.8 # # The following is the BitKeeper ChangeSet Log # -- # 03/11/25 dave@thedillows.org 1.1063.47.1 # Bug fixes: # * Avoid short timeouts when waiting for a reset # * Support newer versions of the sleep image # * Fix link status reporting # -- # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c -- a/drivers/net/typhoon.c Wed Nov 26 00:45:39 2003 +++ b/drivers/net/typhoon.c Wed Nov 26 00:45:39 2003 @@ -85,8 +85,8 @@ #define PKT_BUF_SZ 1536 #define DRV_MODULE_NAME "typhoon" -#define DRV_MODULE_VERSION "1.4.1" -#define DRV_MODULE_RELDATE "03/06/26" +#define DRV_MODULE_VERSION "1.4.2" +#define DRV_MODULE_RELDATE "03/11/25" #define PFX DRV_MODULE_NAME ": " #define ERR_PFX KERN_ERR PFX @@ -127,7 +127,7 @@ static char version[] __devinitdata = "typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; -MODULE_AUTHOR("David Dillow "); +MODULE_AUTHOR("David Dillow "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("3Com Typhoon Family (3C990, 3CR990, and variants)"); MODULE_PARM(rx_copybreak, "i"); @@ -146,11 +146,12 @@ int capabilities; }; -#define TYPHOON_CRYPTO_NONE 0 -#define TYPHOON_CRYPTO_DES 1 -#define TYPHOON_CRYPTO_3DES 2 -#define TYPHOON_CRYPTO_VARIABLE 4 -#define TYPHOON_FIBER 8 +#define TYPHOON_CRYPTO_NONE 0x00 +#define TYPHOON_CRYPTO_DES 0x01 +#define TYPHOON_CRYPTO_3DES 0x02 +#define TYPHOON_CRYPTO_VARIABLE 0x04 +#define TYPHOON_FIBER 0x08 +#define TYPHOON_WAKEUP_NEEDS_RESET 0x10 enum typhoon_cards { TYPHOON_TX = 0, TYPHOON_TX95, TYPHOON_TX97, TYPHOON_SVR, @@ -307,7 +308,8 @@ /* We'll wait up to six seconds for a reset, and half a second normally. */ #define TYPHOON_UDELAY 50 -#define TYPHOON_RESET_TIMEOUT (6 * HZ) +#define TYPHOON_RESET_TIMEOUT_SLEEP (6 * HZ) +#define TYPHOON_RESET_TIMEOUT_NOSLEEP ((6 * 1000000) / TYPHOON_UDELAY) #define TYPHOON_WAIT_TIMEOUT ((1000000 / 2) / TYPHOON_UDELAY) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28) @@ -375,10 +377,12 @@ typhoon_reset(unsigned long ioaddr, int wait_type) { int i, err = 0; - int timeout = TYPHOON_RESET_TIMEOUT; + int timeout; if(wait_type == WaitNoSleep) - timeout = (timeout * 1000000) / (HZ * TYPHOON_UDELAY); + timeout = TYPHOON_RESET_TIMEOUT_NOSLEEP; + else + timeout = TYPHOON_RESET_TIMEOUT_SLEEP; writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_MASK); writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_STATUS); @@ -1857,6 +1861,11 @@ if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_SLEEPING) < 0) return -ETIMEDOUT; + /* Since we cannot monitor the status of the link while sleeping, + * tell the world it went away. + */ + netif_carrier_off(tp->dev); + pci_enable_wake(tp->pdev, state, 1); pci_disable_device(pdev); return pci_set_power_state(pdev, state); @@ -1871,8 +1880,13 @@ pci_set_power_state(pdev, 0); pci_restore_state(pdev, tp->pci_state); + /* Post 2.x.x versions of the Sleep Image require a reset before + * we can download the Runtime Image. But let's not make users of + * the old firmware pay for the reset. + */ writel(TYPHOON_BOOTCMD_WAKEUP, ioaddr + TYPHOON_REG_COMMAND); - if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) + if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0 || + (tp->capabilities & TYPHOON_WAKEUP_NEEDS_RESET)) return typhoon_reset(ioaddr, wait_type); return 0; @@ -2250,7 +2264,7 @@ void *shared; dma_addr_t shared_dma; struct cmd_desc xp_cmd; - struct resp_desc xp_resp; + struct resp_desc xp_resp[3]; int i; int err = 0; @@ -2378,15 +2392,15 @@ } INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS); - if(typhoon_issue_command(tp, 1, &xp_cmd, 1, &xp_resp) < 0) { + if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) { printk(ERR_PFX "%s: cannot read MAC address\n", pdev->slot_name); err = -EIO; goto error_out_reset; } - *(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp.parm1)); - *(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp.parm2)); + *(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1)); + *(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2)); if(!is_valid_ether_addr(dev->dev_addr)) { printk(ERR_PFX "%s: Could not obtain valid ethernet address, " @@ -2394,6 +2408,28 @@ goto error_out_reset; } + /* Read the Sleep Image version last, so the response is valid + * later when we print out the version reported. + */ + INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS); + if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { + printk(ERR_PFX "%s: Could not get Sleep Image version\n", + pdev->slot_name); + goto error_out_reset; + } + + tp->capabilities = typhoon_card_info[card_id].capabilities; + tp->xcvr_select = TYPHOON_XCVR_AUTONEG; + + /* Typhoon 1.0 Sleep Images return one response descriptor to the + * READ_VERSIONS command. Those versions are OK after waking up + * from sleep without needing a reset. Typhoon 1.1+ Sleep Images + * seem to need a little extra help to get started. Since we don't + * know how to nudge it along, just kick it. + */ + if(xp_resp[0].numDesc != 0) + tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET; + if(typhoon_sleep(tp, 3, 0) < 0) { printk(ERR_PFX "%s: cannot put adapter to sleep\n", pdev->slot_name); @@ -2401,9 +2437,6 @@ goto error_out_reset; } - tp->capabilities = typhoon_card_info[card_id].capabilities; - tp->xcvr_select = TYPHOON_XCVR_AUTONEG; - /* The chip-specific entries in the device structure. */ dev->open = typhoon_open; dev->hard_start_xmit = typhoon_start_tx; @@ -2440,6 +2473,32 @@ printk("%2.2x:", dev->dev_addr[i]); printk("%2.2x\n", dev->dev_addr[i]); + /* xp_resp still contains the response to the READ_VERSIONS command. + * For debugging, let the user know what version he has. + */ + if(xp_resp[0].numDesc == 0) { + /* This is the Typhoon 1.0 type Sleep Image, last 16 bits + * of version is Month/Day of build. + */ + u16 monthday = le32_to_cpu(xp_resp[0].parm2) & 0xffff; + printk(KERN_INFO "%s: Typhoon 1.0 Sleep Image built " + "%02u/%02u/2000\n", dev->name, monthday >> 8, + monthday & 0xff); + } else if(xp_resp[0].numDesc == 2) { + /* This is the Typhoon 1.1+ type Sleep Image + */ + u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2); + u8 *ver_string = (u8 *) &xp_resp[1]; + ver_string[25] = 0; + printk(KERN_INFO "%s: Typhoon 1.1+ Sleep Image version " + "%u.%u.%u.%u %s\n", dev->name, HIPQUAD(sleep_ver), + ver_string); + } else { + printk(KERN_WARNING "%s: Unknown Sleep Image version " + "(%u:%04x)\n", dev->name, xp_resp[0].numDesc, + le32_to_cpu(xp_resp[0].parm2)); + } + return 0; error_out_reset: From yoshfuji@linux-ipv6.org Thu Nov 27 00:33:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 00:33:28 -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.9) with SMTP id hAR8XCTa032172 for ; Thu, 27 Nov 2003 00:33:13 -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 hAR8XKlg021227; Thu, 27 Nov 2003 17:33:20 +0900 Date: Thu, 27 Nov 2003 17:33:20 +0900 (JST) Message-Id: <20031127.173320.19253188.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: davem@redhat.com, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <1069920883.2476.1.camel@teapot.felipe-alfaro.com> References: <1069920883.2476.1.camel@teapot.felipe-alfaro.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: 1711 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 <1069920883.2476.1.camel@teapot.felipe-alfaro.com> (at Thu, 27 Nov 2003 09:14:44 +0100), Felipe Alfaro Solana says: > Attached is a patch against 2.6.0-test11 to convert all strcpy() calls > to their corresponding strlcpy() for IPv6. Compiled and tested. I don't like this coding style. diff -uNr linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c linux-2.6.0-test11/net/ipv6/ip6_tunnel.c --- linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c 2003-11-26 21:42:56.000000000 +0100 +++ linux-2.6.0-test11/net/ipv6/ip6_tunnel.c 2003-11-27 00:27:09.000000000 +0100 - strcpy(t->parms.name, dev->name); + strlcpy(t->parms.name, dev->name, IFNAMSIZ); sizeof(t->parms.name) or something like that. --yoshfuji From xose@wanadoo.es Thu Nov 27 00:43:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 00:43:37 -0800 (PST) Received: from smtp14.eresmas.com (smtp14.eresmas.com [62.81.235.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAR8hNTa000530 for ; Thu, 27 Nov 2003 00:43:23 -0800 Received: from [192.168.108.53] (helo=mx03.in.mad.eresmas.com) by smtp14.eresmas.com with esmtp (Exim 4.10) id 1AOo4i-0000Kb-00 for netdev@oss.sgi.com; Wed, 26 Nov 2003 02:02:36 +0100 Received: from [80.102.71.246] (helo=wanadoo.es) by mx03.in.mad.eresmas.com with esmtp (Exim 4.20) id 1AOo4h-0001Mb-QU for netdev@oss.sgi.com; Wed, 26 Nov 2003 02:02:36 +0100 Message-ID: <3FC3FB99.70700@wanadoo.es> Date: Wed, 26 Nov 2003 02:02:17 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Level One LXT1001 GE chip X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1712 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev hi, Months ago I sent a question to netdev to know if SMC TigerCard 1000 (SMC9462SX) was supported under LiNUX. Today I know that the answer is NO, officially. Maybe because it's little extended and it's an strange chip with only a few clone boards out there, smc dlink planex... I got more info from FreeBSD: "The lge driver provides support for various NICs based on the Level 1 LXT1001 NetCellerator gigabit ethernet controller chip, including the following: o SMC TigerCard 1000 (SMC9462SX) o D-Link DGE-500SX These NICs are capable of 1000mbps speeds over fiber optic cable. The LXT1001 also supports a GMII port for use with 10/100/1000 copper PHYs, however there aren't currently any NICs on the market that use this fea- ture." Searching arround NET I found the LXT1001 Developer Manual: http://people.freebsd.org/~wpaul/Level1/LXT1001SRM.pdf and an unofficial LiNUX 2.4 driver, 2002/01/22, v 1.04.05, under an ugly URL: http://tsd.dlink.com.tw/info.nsf/80d023dbef05f90048256adf002a91be/ee44db010731cedb48256c9f00248656?OpenDocument 'wpaul' looks like the official ethernet drivers writer for *BSD and he has _lot of NET manuals/docs_ under his $HOME: http://people.freebsd.org/~wpaul/ If someone complains about this NIC, he/she already has information to write a better driver. I only use intel NICs ;-) -thanks for your time- -- HTML mails are going to trash automagically From davem@pizda.ninka.net Thu Nov 27 01:04:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 01:04:20 -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.9) with SMTP id hAR945Ta001131 for ; Thu, 27 Nov 2003 01:04:05 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA17070; Thu, 27 Nov 2003 01:03:24 -0800 Date: Thu, 27 Nov 2003 01:03:24 -0800 From: "David S. Miller" To: Xose Vazquez Perez Cc: netdev@oss.sgi.com Subject: Re: Level One LXT1001 GE chip Message-Id: <20031127010324.061cac3b.davem@redhat.com> In-Reply-To: <3FC3FB99.70700@wanadoo.es> References: <3FC3FB99.70700@wanadoo.es> 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: 1713 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, 26 Nov 2003 02:02:17 +0100 Xose Vazquez Perez wrote: > http://people.freebsd.org/~wpaul/Level1/LXT1001SRM.pdf Looks mildly interesting, I might be inspired to cook up a fresh driver :) From yoshfuji@linux-ipv6.org Thu Nov 27 02:38:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 02:39: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.9) with SMTP id hARAcjTa013354 for ; Thu, 27 Nov 2003 02:38:49 -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 hARAdAlg022818; Thu, 27 Nov 2003 19:39:11 +0900 Date: Thu, 27 Nov 2003 19:39:10 +0900 (JST) Message-Id: <20031127.193910.96333709.yoshfuji@linux-ipv6.org> To: vnuorval@tcs.hut.fi Cc: davem@redhat.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> 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: 1714 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 (at Thu, 27 Nov 2003 12:31:58 +0200 (EET)), Ville Nuorvala says: > here is a new version. I made some other minor changes to it too. looks fine. --yoshfuji From davem@pizda.ninka.net Thu Nov 27 03:00:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 03:00: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.9) with SMTP id hARB07Ta015630 for ; Thu, 27 Nov 2003 03:00:27 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA17283; Thu, 27 Nov 2003 02:59:21 -0800 Date: Thu, 27 Nov 2003 02:59:21 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: felipe_alfaro@linuxmail.org, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-Id: <20031127025921.3fed8dd4.davem@redhat.com> In-Reply-To: <20031127.173320.19253188.yoshfuji@linux-ipv6.org> References: <1069920883.2476.1.camel@teapot.felipe-alfaro.com> <20031127.173320.19253188.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: 1715 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, 27 Nov 2003 17:33:20 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > - strcpy(t->parms.name, dev->name); > + strlcpy(t->parms.name, dev->name, IFNAMSIZ); > sizeof(t->parms.name) > > or something like that. I agree, using sizeof() is the less error prone way of doing things like this. Felipe could you please rewrite your patch like this? Thank you. From herbert@gondor.apana.org.au Thu Nov 27 03:04:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 03:04:20 -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.9) with SMTP id hARB42Ta016028 for ; Thu, 27 Nov 2003 03:04:04 -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 1APJrb-0000Lh-00; Thu, 27 Nov 2003 21:59:11 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1APJrX-0003PB-00; Thu, 27 Nov 2003 21:59:07 +1100 Date: Thu, 27 Nov 2003 21:59:07 +1100 To: "David S. Miller" Cc: kuznet@ms2.inr.ac.ru, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [XFRM] Handle device down/unregister events Message-ID: <20031127105907.GA13047@gondor.apana.org.au> References: <20031126044355.GA18805@gondor.apana.org.au> <20031125222059.6730f242.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <20031125222059.6730f242.davem@redhat.com> User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1716 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 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 25, 2003 at 10:20:59PM -0800, David S. Miller wrote: > > Thanks for catching this, I'll review and apply your patch soon. Hmm, it looks like my patch has a slight race in it. It is possible for a device to be added to a dst, go down and unregister, and then the dst is added to a bundle. This isn't really a problem for net devices without destructors though since the UNREGISTER event is rebroadcast at regular intervals. However, it also affects xfrm_flush_bundle() and xfrm states don't enjoy the benefit of repeated flushes. Here is an updated patch that checks whether a dst is still valid before adding it to a bundle. 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 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: kernel-source-2.5/include/net/xfrm.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/xfrm.h,v retrieving revision 1.17 diff -u -r1.17 xfrm.h --- kernel-source-2.5/include/net/xfrm.h 18 Oct 2003 10:52:14 -0000 1.17 +++ kernel-source-2.5/include/net/xfrm.h 27 Nov 2003 10:32:15 -0000 @@ -860,7 +860,7 @@ extern void xfrm_policy_kill(struct xfrm_policy *); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl); -extern int xfrm_flush_bundles(struct xfrm_state *x); +extern int xfrm_flush_bundles(void); extern wait_queue_head_t km_waitq; extern void km_state_expired(struct xfrm_state *x, int hard); Index: kernel-source-2.5/net/xfrm/xfrm_policy.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/xfrm/xfrm_policy.c,v retrieving revision 1.30 diff -u -r1.30 xfrm_policy.c --- kernel-source-2.5/net/xfrm/xfrm_policy.c 28 Oct 2003 09:58:40 -0000 1.30 +++ kernel-source-2.5/net/xfrm/xfrm_policy.c 27 Nov 2003 10:47:29 -0000 @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -695,6 +697,8 @@ }; } +static int stale_bundle(struct dst_entry *dst); + /* Main function: finds/creates a bundle for given flow. * * At the moment we eat a raw IP route. Mostly to speed up lookups @@ -819,10 +823,11 @@ } write_lock_bh(&policy->lock); - if (unlikely(policy->dead)) { + if (unlikely(policy->dead || stale_bundle(dst))) { /* Wow! While we worked on resolving, this * policy has gone. Retry. It is not paranoia, * we just cannot enlist new bundle to dead object. + * We can't enlist stable bundles either. */ write_unlock_bh(&policy->lock); @@ -990,18 +995,27 @@ static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie) { + if (!stale_bundle(dst)) + return dst; + + dst_release(dst); + return NULL; +} + +static int stale_bundle(struct dst_entry *dst) +{ struct dst_entry *child = dst; while (child) { if (child->obsolete > 0 || + (child->dev && !netif_running(child->dev)) || (child->xfrm && child->xfrm->km.state != XFRM_STATE_VALID)) { - dst_release(dst); - return NULL; + return 1; } child = child->child; } - return dst; + return 0; } static void xfrm_dst_destroy(struct dst_entry *dst) @@ -1027,7 +1041,7 @@ return dst; } -static void __xfrm_garbage_collect(void) +static void xfrm_prune_bundles(int (*func)(struct dst_entry *)) { int i; struct xfrm_policy *pol; @@ -1039,7 +1053,7 @@ write_lock(&pol->lock); dstp = &pol->bundles; while ((dst=*dstp) != NULL) { - if (atomic_read(&dst->__refcnt) == 0) { + if (func(dst)) { *dstp = dst->next; dst->next = gc_list; gc_list = dst; @@ -1059,46 +1073,19 @@ } } -static int bundle_depends_on(struct dst_entry *dst, struct xfrm_state *x) +static int unused_bundle(struct dst_entry *dst) { - do { - if (dst->xfrm == x) - return 1; - } while ((dst = dst->child) != NULL); - return 0; + return !atomic_read(&dst->__refcnt); } -int xfrm_flush_bundles(struct xfrm_state *x) +static void __xfrm_garbage_collect(void) { - int i; - struct xfrm_policy *pol; - struct dst_entry *dst, **dstp, *gc_list = NULL; - - read_lock_bh(&xfrm_policy_lock); - for (i=0; i<2*XFRM_POLICY_MAX; i++) { - for (pol = xfrm_policy_list[i]; pol; pol = pol->next) { - write_lock(&pol->lock); - dstp = &pol->bundles; - while ((dst=*dstp) != NULL) { - if (bundle_depends_on(dst, x)) { - *dstp = dst->next; - dst->next = gc_list; - gc_list = dst; - } else { - dstp = &dst->next; - } - } - write_unlock(&pol->lock); - } - } - read_unlock_bh(&xfrm_policy_lock); - - while (gc_list) { - dst = gc_list; - gc_list = dst->next; - dst_free(dst); - } + xfrm_prune_bundles(unused_bundle); +} +int xfrm_flush_bundles(void) +{ + xfrm_prune_bundles(stale_bundle); return 0; } @@ -1221,6 +1208,21 @@ read_unlock(&afinfo->lock); } +static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr) +{ + switch (event) { + case NETDEV_DOWN: + xfrm_flush_bundles(); + } + return NOTIFY_DONE; +} + +struct notifier_block xfrm_dev_notifier = { + xfrm_dev_event, + NULL, + 0 +}; + void __init xfrm_policy_init(void) { xfrm_dst_cache = kmem_cache_create("xfrm_dst_cache", @@ -1231,6 +1233,7 @@ panic("XFRM: failed to allocate xfrm_dst_cache\n"); INIT_WORK(&xfrm_policy_gc_work, xfrm_policy_gc_task, NULL); + register_netdevice_notifier(&xfrm_dev_notifier); } void __init xfrm_init(void) Index: kernel-source-2.5/net/xfrm/xfrm_state.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/xfrm/xfrm_state.c,v retrieving revision 1.11 diff -u -r1.11 xfrm_state.c --- kernel-source-2.5/net/xfrm/xfrm_state.c 28 Oct 2003 09:58:40 -0000 1.11 +++ kernel-source-2.5/net/xfrm/xfrm_state.c 27 Nov 2003 10:32:01 -0000 @@ -219,7 +219,7 @@ * there are DSTs attached to this xfrm_state. */ if (atomic_read(&x->refcnt) > 2) - xfrm_flush_bundles(x); + xfrm_flush_bundles(); /* All xfrm_state objects are created by one of two possible * paths: --Qxx1br4bt0+wmkIi-- From vnuorval@tcs.hut.fi Thu Nov 27 03:05:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 03:05:17 -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.9) with SMTP id hARB4rTa016280 for ; Thu, 27 Nov 2003 03:04:53 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id E507880023B; Thu, 27 Nov 2003 12:32:00 +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 hARAW0sj003474; Thu, 27 Nov 2003 12:32:00 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hARAVx0H003470; Thu, 27 Nov 2003 12:32:00 +0200 Date: Thu, 27 Nov 2003 12:31:58 +0200 (EET) From: Ville Nuorvala To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device In-Reply-To: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> Message-ID: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id hARB4rTa016280 X-archive-position: 1717 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 On Tue, 25 Nov 2003, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > I prefer ipv6_inherit_linklocal() or something like that > because this does not seem ip6_tun specific. > > I'm ok with other portion. > > Thanks. > > --yoshfuji Ok, here is a new version. I made some other minor changes to it too. I removed the CONFIG_IPV6_TUNNEL ifdefs, so you don't need to recompile the whole ipv6 stack and reboot just because you decide to compile ip6_tunnel.c later as a module. I also added the check for ifp->idev->cnf.rtr_solicits > 0 so you don't send any Router Solicitations if rtr_solicits is zero. This way we avoid sending tunneled RS messages (which will result in ICMPv6 destination unreachable errors if the other end-point isn't set up yet) by setting ipv6_devconf_dflt.rtr_solicits to zero before setting up the tunnel link. Are you ok with these changes? Regards, Ville ===== net/ipv6/ip6_tunnel.c 1.12.1.2 vs 1.16 ===== --- 1.12.1.2/net/ipv6/ip6_tunnel.c Wed Nov 5 22:36:56 2003 +++ 1.16/net/ipv6/ip6_tunnel.c Thu Nov 6 17:00:52 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); } ===== net/ipv6/addrconf.c 1.74.1.3 vs 1.79 ===== --- 1.74.1.3/net/ipv6/addrconf.c Wed Nov 26 03:06:32 2003 +++ 1.79/net/ipv6/addrconf.c Thu Nov 27 11:14:09 2003 @@ -1809,6 +1809,54 @@ sit_route_add(dev); } +static inline int +ipv6_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 (!ipv6_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 (!ipv6_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); +} int addrconf_notify(struct notifier_block *this, unsigned long event, void * data) @@ -1822,7 +1870,9 @@ case ARPHRD_SIT: addrconf_sit_config(dev); break; - + case ARPHRD_TUNNEL6: + addrconf_ip6_tnl_config(dev); + break; case ARPHRD_LOOPBACK: init_loopback(dev); break; @@ -2121,6 +2171,7 @@ */ if (ifp->idev->cnf.forwarding == 0 && + ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { struct in6_addr all_routers; -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From ak@suse.de Thu Nov 27 03:20:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 03:20:49 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARBKVTa016954 for ; Thu, 27 Nov 2003 03:20:36 -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 A0A1018107D5; Thu, 27 Nov 2003 12:20:25 +0100 (CET) Date: Thu, 27 Nov 2003 12:20:21 +0100 From: Andi Kleen To: "David S. Miller" Cc: xose@wanadoo.es, netdev@oss.sgi.com Subject: Re: Level One LXT1001 GE chip Message-Id: <20031127122021.3ac80a86.ak@suse.de> In-Reply-To: <20031127010324.061cac3b.davem@redhat.com> References: <3FC3FB99.70700@wanadoo.es> <20031127010324.061cac3b.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (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: 1718 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 On Thu, 27 Nov 2003 01:03:24 -0800 "David S. Miller" wrote: > On Wed, 26 Nov 2003 02:02:17 +0100 > Xose Vazquez Perez wrote: > > > http://people.freebsd.org/~wpaul/Level1/LXT1001SRM.pdf > > Looks mildly interesting, I might be inspired to cook up > a fresh driver :) Actually there is an old vendor driver for the lxt1001 (but it is quite ugly and will probably need some porting for 2.6 or even 2.4) I've been also slowly working on a new driver, but still nothing releasable. -Andi From ak@suse.de Thu Nov 27 04:03:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 04:04:08 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARC3RTa018464 for ; Thu, 27 Nov 2003 04:03:28 -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 A30BC184DECD; Thu, 27 Nov 2003 12:26:43 +0100 (CET) Date: Thu, 27 Nov 2003 12:26:42 +0100 From: Andi Kleen To: Andi Kleen Cc: davem@redhat.com, xose@wanadoo.es, netdev@oss.sgi.com Subject: Re: Level One LXT1001 GE chip Message-Id: <20031127122642.046d07ce.ak@suse.de> In-Reply-To: <20031127122021.3ac80a86.ak@suse.de> References: <3FC3FB99.70700@wanadoo.es> <20031127010324.061cac3b.davem@redhat.com> <20031127122021.3ac80a86.ak@suse.de> X-Mailer: Sylpheed version 0.9.7 (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: 1719 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 On Thu, 27 Nov 2003 12:20:21 +0100 Andi Kleen wrote: > On Thu, 27 Nov 2003 01:03:24 -0800 > "David S. Miller" wrote: > > > On Wed, 26 Nov 2003 02:02:17 +0100 > > Xose Vazquez Perez wrote: > > > > > http://people.freebsd.org/~wpaul/Level1/LXT1001SRM.pdf > > > > Looks mildly interesting, I might be inspired to cook up > > a fresh driver :) > > Actually there is an old vendor driver for the lxt1001 > (but it is quite ugly and will probably need some porting for 2.6 > or even 2.4) > > I've been also slowly working on a new driver, but still nothing > releasable. BTW I should add - the chipset is really dead. Intel has bought LevelOne and killed it. You are unlikely to be able to get any new cards for it. But it is an quite interesting architecture (with some complete stupidity and some interesting features) and rather different from a classic Tulip/AMD like network card. -Andi From felipe_alfaro@linuxmail.org Thu Nov 27 04:04:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 04:05:01 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARC4XTa018521 for ; Thu, 27 Nov 2003 04:04:45 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 673D942E81; Thu, 27 Nov 2003 13:04:23 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: Felipe Alfaro Solana To: "David S. Miller" Cc: "YOSHIFUJI Hideaki / _$B5HF#1QL@" , Linux Kernel Mailinglist , netdev@oss.sgi.com In-Reply-To: <20031127025921.3fed8dd4.davem@redhat.com> References: <1069920883.2476.1.camel@teapot.felipe-alfaro.com> <20031127.173320.19253188.yoshfuji@linux-ipv6.org> <20031127025921.3fed8dd4.davem@redhat.com> Content-Type: multipart/mixed; boundary="=-rEH+SkxJJ+Bjdn2tnFIv" Message-Id: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Thu, 27 Nov 2003 13:04:04 +0100 X-archive-position: 1720 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev --=-rEH+SkxJJ+Bjdn2tnFIv Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2003-11-27 at 11:59, David S. Miller wrote: > I agree, using sizeof() is the less error prone way of > doing things like this. > > Felipe could you please rewrite your patch like this? Done! --=-rEH+SkxJJ+Bjdn2tnFIv Content-Disposition: attachment; filename=strlcpy-ipv6.patch Content-Type: text/x-patch; name=strlcpy-ipv6.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -uNr linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c linux-2.6.0-test11/net/ipv6/ip6_tunnel.c --- linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c 2003-11-26 21:42:56.000000000 +0100 +++ linux-2.6.0-test11/net/ipv6/ip6_tunnel.c 2003-11-27 00:27:09.000000000 +0100 @@ -1056,7 +1056,7 @@ struct ip6_tnl *t = (struct ip6_tnl *) dev->priv; t->fl.proto = IPPROTO_IPV6; t->dev = dev; - strcpy(t->parms.name, dev->name); + strlcpy(t->parms.name, dev->name, sizeof(t->parms.name)); } /** diff -uNr linux-2.6.0-test11.orig/net/ipv6/netfilter/ip6_queue.c linux-2.6.0-test11/net/ipv6/netfilter/ip6_queue.c --- linux-2.6.0-test11.orig/net/ipv6/netfilter/ip6_queue.c 2003-11-26 21:43:27.000000000 +0100 +++ linux-2.6.0-test11/net/ipv6/netfilter/ip6_queue.c 2003-11-27 00:26:47.000000000 +0100 @@ -240,12 +240,12 @@ pmsg->hw_protocol = entry->skb->protocol; if (entry->info->indev) - strcpy(pmsg->indev_name, entry->info->indev->name); + strlcpy(pmsg->indev_name, entry->info->indev->name, sizeof(pmsg->indev_name)); else pmsg->indev_name[0] = '\0'; if (entry->info->outdev) - strcpy(pmsg->outdev_name, entry->info->outdev->name); + strlcpy(pmsg->outdev_name, entry->info->outdev->name, sizeof(pmsg->outdev_name)); else pmsg->outdev_name[0] = '\0'; diff -uNr linux-2.6.0-test11.orig/net/ipv6/netfilter/ip6_tables.c linux-2.6.0-test11/net/ipv6/netfilter/ip6_tables.c --- linux-2.6.0-test11.orig/net/ipv6/netfilter/ip6_tables.c 2003-11-26 21:45:30.000000000 +0100 +++ linux-2.6.0-test11/net/ipv6/netfilter/ip6_tables.c 2003-11-27 00:24:07.000000000 +0100 @@ -1357,7 +1357,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; diff -uNr linux-2.6.0-test11.orig/net/ipv6/sit.c linux-2.6.0-test11/net/ipv6/sit.c --- linux-2.6.0-test11.orig/net/ipv6/sit.c 2003-11-26 21:45:36.000000000 +0100 +++ linux-2.6.0-test11/net/ipv6/sit.c 2003-11-27 00:27:01.000000000 +0100 @@ -747,7 +747,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -786,7 +786,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_IPV6; --=-rEH+SkxJJ+Bjdn2tnFIv-- From yoshfuji@linux-ipv6.org Thu Nov 27 04:09:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 04:09:57 -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.9) with SMTP id hARC9hTa019319 for ; Thu, 27 Nov 2003 04:09:44 -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 hARC9rlg023226; Thu, 27 Nov 2003 21:09:53 +0900 Date: Thu, 27 Nov 2003 21:09:53 +0900 (JST) Message-Id: <20031127.210953.116254624.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> References: <20031127.173320.19253188.yoshfuji@linux-ipv6.org> <20031127025921.3fed8dd4.davem@redhat.com> <1069934643.2393.0.camel@teapot.felipe-alfaro.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: 1721 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 <1069934643.2393.0.camel@teapot.felipe-alfaro.com> (at Thu, 27 Nov 2003 13:04:04 +0100), Felipe Alfaro Solana says: > On Thu, 2003-11-27 at 11:59, David S. Miller wrote: > > > I agree, using sizeof() is the less error prone way of > > doing things like this. > > > > Felipe could you please rewrite your patch like this? > > Done! Thanks. Ok to me. --yoshfuji From yoshfuji@linux-ipv6.org Thu Nov 27 04:11:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 04:11:32 -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.9) with SMTP id hARCBITa019693 for ; Thu, 27 Nov 2003 04:11:19 -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 hARCBZlg023257; Thu, 27 Nov 2003 21:11:35 +0900 Date: Thu, 27 Nov 2003 21:11:35 +0900 (JST) Message-Id: <20031127.211135.09649297.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org, felix-kernel@fefe.de Subject: Re: ipv4-mapped ipv4 connect() for UDP broken in test10 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031126.190407.102714104.yoshfuji@linux-ipv6.org> References: <20031126081745.GA31415@codeblau.de> <20031126.190407.102714104.yoshfuji@linux-ipv6.org> 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=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 1722 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 <20031126.190407.102714104.yoshfuji@linux-ipv6.org> (at Wed, 26 Nov 2003 19:04:07 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > (But I'm not sure this fix your problem...) Well, let me clarify: I'm sure the original code has a bug. I do think that it is related to your report (but I don't have time to confirm it.) s6_addr[3] should be s6_addr32[3] because the code is intended to extract IPv4 address from the IPv4-mapped address (::ffff:0.0.0.0/96) to convert sockaddr_in6{} to sockaddr_in{}. My analysis against the report is as follows: Because the address is IPv4-mapped address (::ffff:0.0.0.0/96) at the point, s6_addr[3] is always 0. The socket will be always connected to 0.0.0.0, which means 127.0.0.1. The patch is definitely logically correct. Please apply this. Thanks. ===== net/ipv6/udp.c 1.54 vs edited ===== --- 1.54/net/ipv6/udp.c Tue Nov 18 11:41:56 2003 +++ edited/net/ipv6/udp.c Wed Nov 26 19:01:15 2003 @@ -825,7 +825,7 @@ struct sockaddr_in sin; sin.sin_family = AF_INET; sin.sin_port = sin6 ? sin6->sin6_port : inet->dport; - sin.sin_addr.s_addr = daddr->s6_addr[3]; + sin.sin_addr.s_addr = daddr->s6_addr32[3]; msg->msg_name = &sin; msg->msg_namelen = sizeof(sin); do_udp_sendmsg: --yoshfuji From hadi@cyberus.ca Thu Nov 27 05:52:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 05:53:10 -0800 (PST) Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARDqaTa023641 for ; Thu, 27 Nov 2003 05:52:56 -0800 Received: from [24.103.99.32] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1APMZO-0002nf-OS; Thu, 27 Nov 2003 08:52:35 -0500 Subject: Re: Level One LXT1001 GE chip From: jamal Reply-To: hadi@cyberus.ca To: Andi Kleen Cc: "David S. Miller" , xose@wanadoo.es, netdev@oss.sgi.com In-Reply-To: <20031127122642.046d07ce.ak@suse.de> References: <3FC3FB99.70700@wanadoo.es> <20031127010324.061cac3b.davem@redhat.com> <20031127122021.3ac80a86.ak@suse.de> <20031127122642.046d07ce.ak@suse.de> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069941123.1027.6.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 27 Nov 2003 08:52:03 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1723 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 The reading of CSR32 equating to clearing it makes it a little pathetic. I like the fact that reading that register also disables interupts because that makes it NAPI friendly. If you are NAPIizing it then the only style you could use is in the wat the e1000 is done. Andi, is this the driver you were playing those neat tricks with getting rid of some of the nastiness in eth_type_trans()? cheers, jamal On Thu, 2003-11-27 at 06:26, Andi Kleen wrote: > > > > Actually there is an old vendor driver for the lxt1001 > > (but it is quite ugly and will probably need some porting for 2.6 > > or even 2.4) > > > > I've been also slowly working on a new driver, but still nothing > > releasable. > > BTW I should add - the chipset is really dead. Intel has bought > LevelOne and killed it. You are unlikely to be able to get any > new cards for it. But it is an quite interesting architecture > (with some complete stupidity and some interesting features) and rather > different from a classic Tulip/AMD like network card. > > -Andi > > From xose@wanadoo.es Thu Nov 27 07:23:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 07:23:33 -0800 (PST) Received: from smtp11.eresmas.com (smtp11.eresmas.com [62.81.235.111]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARFNITa027466 for ; Thu, 27 Nov 2003 07:23:19 -0800 Received: from [192.168.108.57] (helo=mx07.eresmas.com) by smtp11.eresmas.com with esmtp (Exim 4.10) id 1APNz8-0001ox-00 for netdev@oss.sgi.com; Thu, 27 Nov 2003 16:23:14 +0100 Received: from [80.102.88.148] (helo=wanadoo.es) by mx07.eresmas.com with esmtp (Exim 4.20) id 1APNz9-0001Jp-Jl for netdev@oss.sgi.com; Thu, 27 Nov 2003 16:23:15 +0100 Message-ID: <3FC616CE.2060208@wanadoo.es> Date: Thu, 27 Nov 2003 16:22:54 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: Level One LXT1001 GE chip References: <3FC3FB99.70700@wanadoo.es> <20031127010324.061cac3b.davem@redhat.com> X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1724 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev David S. Miller wrote: > Looks mildly interesting, I might be inspired to cook up > a fresh driver :) I thought that you already got homework, tg3TsoFwText firmware ;-) -- HTML mails are going to trash automagically From felipe_alfaro@linuxmail.org Thu Nov 27 07:25:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 07:26:02 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARFPkTa027858 for ; Thu, 27 Nov 2003 07:25:47 -0800 Received: from [192.168.0.2] (glass.felipe-alfaro.com [192.168.0.2]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 7DAEF42E74; Thu, 27 Nov 2003 16:25:39 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy From: Felipe Alfaro Solana To: David Roundy Cc: Linux Kernel Mailinglist , davem@redhat.com, netdev@oss.sgi.com In-Reply-To: <20031127142125.GG8276@jdj5.mit.edu> References: <1069941882.1680.2.camel@teapot.felipe-alfaro.com> <20031127142125.GG8276@jdj5.mit.edu> Content-Type: multipart/mixed; boundary="=-q4sPoIHRO5v0JWbWxtEW" Message-Id: <1069946737.10246.1.camel@glass.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Thu, 27 Nov 2003 16:25:38 +0100 X-archive-position: 1725 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev --=-q4sPoIHRO5v0JWbWxtEW Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2003-11-27 at 15:21, David Roundy wrote: > On Thu, Nov 27, 2003 at 03:04:42PM +0100, Felipe Alfaro Solana wrote: > > diff -uNr linux-2.6.0-test11.orig/net/core/dev.c linux-2.6.0-test11/net/core/dev.c > > +++ linux-2.6.0-test11/net/core/dev.c 2003-11-27 13:21:12.791315993 +0100 > > @@ -335,7 +335,7 @@ > > for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { > > if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { > > memset(s[i].name, 0, sizeof(s[i].name)); > > - strcpy(s[i].name, name); > > + strlcpy(s[i].name, name, sizeof(s[i].map)); > ^^^ > I believe this should be name. Yes, you're right. Sorry, my fault. Corrected patch attached. Thanks! --=-q4sPoIHRO5v0JWbWxtEW Content-Disposition: attachment; filename=strlcpy-ipv4.patch Content-Type: text/x-patch; name=strlcpy-ipv4.patch; charset= Content-Transfer-Encoding: 7bit diff -uNr linux-2.6.0-test11.orig/net/core/dev.c linux-2.6.0-test11/net/core/dev.c --- linux-2.6.0-test11.orig/net/core/dev.c 2003-11-26 21:44:11.000000000 +0100 +++ linux-2.6.0-test11/net/core/dev.c 2003-11-27 13:21:12.791315993 +0100 @@ -335,7 +335,7 @@ for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { memset(s[i].name, 0, sizeof(s[i].name)); - strcpy(s[i].name, name); + strlcpy(s[i].name, name, sizeof(s[i].name)); memcpy(&s[i].map, map, sizeof(s[i].map)); break; } @@ -653,7 +653,7 @@ for (i = 0; i < 100; i++) { snprintf(buf, sizeof(buf), name, i); if (!__dev_get_by_name(buf)) { - strcpy(dev->name, buf); + strlcpy(dev->name, buf, sizeof(dev->name)); return i; } } @@ -1773,7 +1773,7 @@ return -ENODEV; } - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); read_unlock(&dev_base_lock); if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) diff -uNr linux-2.6.0-test11.orig/net/core/sock.c linux-2.6.0-test11/net/core/sock.c --- linux-2.6.0-test11.orig/net/core/sock.c 2003-11-26 21:44:57.000000000 +0100 +++ linux-2.6.0-test11/net/core/sock.c 2003-11-27 13:22:22.150223793 +0100 @@ -157,7 +157,7 @@ static int warned; static char warncomm[16]; if (strcmp(warncomm, current->comm) && warned < 5) { - strcpy(warncomm, current->comm); + strlcpy(warncomm, current->comm, sizeof(warncomm)); printk(KERN_WARNING "process `%s' is using obsolete " "%s SO_BSDCOMPAT\n", warncomm, name); warned++; diff -uNr linux-2.6.0-test11.orig/net/ipv4/devinet.c linux-2.6.0-test11/net/ipv4/devinet.c --- linux-2.6.0-test11.orig/net/ipv4/devinet.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/devinet.c 2003-11-27 13:31:43.971262502 +0100 @@ -731,9 +731,9 @@ break; memset(&ifr, 0, sizeof(struct ifreq)); if (ifa->ifa_label) - strcpy(ifr.ifr_name, ifa->ifa_label); + strlcpy(ifr.ifr_name, ifa->ifa_label, sizeof(ifr.ifr_name)); else - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); (*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET; (*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr = diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-test11/net/ipv4/ipconfig.c --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650818 +0100 @@ -299,7 +299,7 @@ int err; memset(&ir, 0, sizeof(ir)); - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_ifrn.ifrn_name)); set_sockaddr(sin, ic_myaddr, 0); if ((err = ic_dev_ioctl(SIOCSIFADDR, &ir)) < 0) { printk(KERN_ERR "IP-Config: Unable to set interface address (%d).\n", err); diff -uNr linux-2.6.0-test11.orig/net/ipv4/ip_gre.c linux-2.6.0-test11/net/ipv4/ip_gre.c --- linux-2.6.0-test11.orig/net/ipv4/ip_gre.c 2003-11-26 21:44:59.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ip_gre.c 2003-11-27 13:30:13.342198122 +0100 @@ -1163,7 +1163,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -1227,7 +1227,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_GRE; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipip.c linux-2.6.0-test11/net/ipv4/ipip.c --- linux-2.6.0-test11.orig/net/ipv4/ipip.c 2003-11-26 21:46:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipip.c 2003-11-27 13:30:42.476717090 +0100 @@ -815,7 +815,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -853,7 +853,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_IPIP; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-26 21:45:33.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-27 13:36:43.776537082 +0100 @@ -1918,7 +1918,7 @@ dst->addr = src->addr; dst->port = src->port; dst->fwmark = src->fwmark; - strcpy(dst->sched_name, src->scheduler->name); + strlcpy(dst->sched_name, src->scheduler->name, sizeof(dst->sched_name)); dst->flags = src->flags; dst->timeout = src->timeout / HZ; dst->netmask = src->netmask; @@ -2163,12 +2163,12 @@ memset(&d, 0, sizeof(d)); if (ip_vs_sync_state & IP_VS_STATE_MASTER) { d[0].state = IP_VS_STATE_MASTER; - strcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn); + strlcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn, sizeof(d[0].mcast_ifn)); d[0].syncid = ip_vs_master_syncid; } if (ip_vs_sync_state & IP_VS_STATE_BACKUP) { d[1].state = IP_VS_STATE_BACKUP; - strcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn); + strlcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn, sizeof(d[1].mcast_ifn)); d[1].syncid = ip_vs_backup_syncid; } if (copy_to_user(user, &d, sizeof(d)) != 0) diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c 2003-11-26 21:42:47.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c 2003-11-27 13:34:51.218619748 +0100 @@ -854,10 +854,10 @@ ip_vs_sync_state |= state; if (state == IP_VS_STATE_MASTER) { - strcpy(ip_vs_master_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_master_mcast_ifn, mcast_ifn, sizeof(ip_vs_master_mcast_ifn)); ip_vs_master_syncid = syncid; } else { - strcpy(ip_vs_backup_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_backup_mcast_ifn, mcast_ifn, sizeof(ip_vs_backup_mcast_ifn)); ip_vs_backup_syncid = syncid; } diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c 2003-11-26 21:45:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c 2003-11-27 13:23:24.284474101 +0100 @@ -1086,7 +1086,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c 2003-11-26 21:45:26.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c 2003-11-27 13:28:39.884442527 +0100 @@ -1173,7 +1173,7 @@ = kmalloc(SIZEOF_STRUCT_IP_CHAIN, GFP_KERNEL); if (label == NULL) panic("Can't kmalloc for firewall chains.\n"); - strcpy(label->label,name); + strlcpy(label->label, name, sizeof(label->name)); label->next = NULL; label->chain = NULL; label->refcount = ref; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c 2003-11-26 21:46:12.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c 2003-11-27 13:29:19.651041898 +0100 @@ -235,12 +235,12 @@ pmsg->hw_protocol = entry->skb->protocol; if (entry->info->indev) - strcpy(pmsg->indev_name, entry->info->indev->name); + strlcpy(pmsg->indev_name, entry->info->indev->name, sizeof(pmsg->indev_name)); else pmsg->indev_name[0] = '\0'; if (entry->info->outdev) - strcpy(pmsg->outdev_name, entry->info->outdev->name); + strlcpy(pmsg->outdev_name, entry->info->outdev->name, sizeof(pmsg->outdev_name)); else pmsg->outdev_name[0] = '\0'; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c 2003-11-27 13:23:11.366451326 +0100 @@ -1277,7 +1277,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; --=-q4sPoIHRO5v0JWbWxtEW-- From yoshfuji@linux-ipv6.org Thu Nov 27 10:23:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 10:24:06 -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.9) with SMTP id hARINqTa002319 for ; Thu, 27 Nov 2003 10:23:53 -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 hARIOElg024982; Fri, 28 Nov 2003 03:24:14 +0900 Date: Fri, 28 Nov 2003 03:24:14 +0900 (JST) Message-Id: <20031128.032414.10121318.yoshfuji@linux-ipv6.org> To: felix-kernel@fefe.de CC: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, davem@redhat.com Subject: Re: ipv4-mapped ipv4 connect() for UDP broken in test10 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031127165620.GA13079@codeblau.de> References: <20031126081745.GA31415@codeblau.de> <20031126.190407.102714104.yoshfuji@linux-ipv6.org> <20031127165620.GA13079@codeblau.de> 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: 1726 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 <20031127165620.GA13079@codeblau.de> (at Thu, 27 Nov 2003 17:56:20 +0100), Felix von Leitner says: > Thus spake YOSHIFUJI Hideaki / ?$B5HF#1QL@ (yoshfuji@linux-ipv6.org): > > Please apply this patch. > > (But I'm not sure this fix your problem...) > > Does not help. really? > dnscache is still sending the packets out, but I don't see them in > tcpdump on any interface. Hmm... BTW, Seeing is believing; please specify the exact source / code, setting and the log. They will help us much better than tons of descriptions. --yoshfuji From rmk@arm.linux.org.uk Thu Nov 27 11:46:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 11:46:34 -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.9) with SMTP id hARJkETa003502 for ; Thu, 27 Nov 2003 11:46:18 -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 1APS5T-0004Rw-N7; Thu, 27 Nov 2003 19:46:03 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1APS5S-0006xe-MV; Thu, 27 Nov 2003 19:46:02 +0000 Date: Thu, 27 Nov 2003 19:46:02 +0000 From: Russell King To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" Cc: felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031127194602.A25015@flint.arm.linux.org.uk> Mail-Followup-To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20031127.173320.19253188.yoshfuji@linux-ipv6.org> <20031127025921.3fed8dd4.davem@redhat.com> <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.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: <20031127.210953.116254624.yoshfuji@linux-ipv6.org>; from yoshfuji@linux-ipv6.org on Thu, Nov 27, 2003 at 09:09:53PM +0900 X-archive-position: 1727 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev On Thu, Nov 27, 2003 at 09:09:53PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B wrote: > In article <1069934643.2393.0.camel@teapot.felipe-alfaro.com> (at Thu, 27 Nov 2003 13:04:04 +0100), Felipe Alfaro Solana says: > > > On Thu, 2003-11-27 at 11:59, David S. Miller wrote: > > > > > I agree, using sizeof() is the less error prone way of > > > doing things like this. > > > > > > Felipe could you please rewrite your patch like this? > > > > Done! > > Thanks. Ok to me. I'm slightly cautious here, although I haven't read the patch yet. Did anyone consider whether any of these structures were copied to user space, and whether, as a result of this change, we're now copying uninitialised data to users? -- 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 yoshfuji@linux-ipv6.org Thu Nov 27 11:54:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 11:54:42 -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.9) with SMTP id hARJsQTa003960 for ; Thu, 27 Nov 2003 11:54: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 hARJsDlg025493; Fri, 28 Nov 2003 04:54:13 +0900 Date: Fri, 28 Nov 2003 04:54:13 +0900 (JST) Message-Id: <20031128.045413.133305490.yoshfuji@linux-ipv6.org> To: rmk+lkml@arm.linux.org.uk Cc: felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031127194602.A25015@flint.arm.linux.org.uk> References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> 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: 1728 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 <20031127194602.A25015@flint.arm.linux.org.uk> (at Thu, 27 Nov 2003 19:46:02 +0000), Russell King says: > > > > I agree, using sizeof() is the less error prone way of > > > > doing things like this. > > > > > > > > Felipe could you please rewrite your patch like this? > > > > > > Done! > > > > Thanks. Ok to me. > > I'm slightly cautious here, although I haven't read the patch yet. > Did anyone consider whether any of these structures were copied to > user space, and whether, as a result of this change, we're now > copying uninitialised data to users? I believe that it, to change from strcpy() to strlcpy(), just eliminates possibility of buffer-overrun. --yoshfuji From rmk@arm.linux.org.uk Thu Nov 27 12:00:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 12:01:03 -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.9) with SMTP id hARK0nTa004410 for ; Thu, 27 Nov 2003 12:00:50 -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 1APSJe-0004T0-FA; Thu, 27 Nov 2003 20:00:42 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1APSJd-00075O-J7; Thu, 27 Nov 2003 20:00:41 +0000 Date: Thu, 27 Nov 2003 20:00:41 +0000 From: Russell King To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" Cc: felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031127200041.B25015@flint.arm.linux.org.uk> Mail-Followup-To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.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: <20031128.045413.133305490.yoshfuji@linux-ipv6.org>; from yoshfuji@linux-ipv6.org on Fri, Nov 28, 2003 at 04:54:13AM +0900 X-archive-position: 1729 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev On Fri, Nov 28, 2003 at 04:54:13AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B wrote: > In article <20031127194602.A25015@flint.arm.linux.org.uk> (at Thu, 27 Nov 2003 19:46:02 +0000), Russell King says: > > I'm slightly cautious here, although I haven't read the patch yet. > > Did anyone consider whether any of these structures were copied to > > user space, and whether, as a result of this change, we're now > > copying uninitialised data to users? > > I believe that it, to change from strcpy() to strlcpy(), just > eliminates possibility of buffer-overrun. While this is 100% correct, the bit which raised my attention was the original message which didn't seem to show that the above had been considered. The thing that worries me is that an incorrect strlcpy() conversion gives the impression that someone has thought about buffer underruns as well as overruns, and, unless someone /has/ actually thought about it, there could well still be a security problem lurking there. I'm just overly wary of all strlcpy() conversions. -- 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 yoshfuji@linux-ipv6.org Thu Nov 27 12:47:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 12:48: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.9) with SMTP id hARKlMTa007871 for ; Thu, 27 Nov 2003 12:47:43 -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 hARKlPlg025783; Fri, 28 Nov 2003 05:47:25 +0900 Date: Fri, 28 Nov 2003 05:47:24 +0900 (JST) Message-Id: <20031128.054724.116712136.yoshfuji@linux-ipv6.org> To: rmk+lkml@arm.linux.org.uk Cc: felipe_alfaro@linuxmail.org, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031127200041.B25015@flint.arm.linux.org.uk> References: <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> 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: 1730 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 <20031127200041.B25015@flint.arm.linux.org.uk> (at Thu, 27 Nov 2003 20:00:41 +0000), Russell King says: > The thing that worries me is that an incorrect strlcpy() conversion > gives the impression that someone has thought about buffer underruns > as well as overruns, and, unless someone /has/ actually thought about > it, there could well still be a security problem lurking there. Hmm, what do you actually mean by "buffer underruns?" (If I'm correct) do you suggest that we should zero-out rest of destination buffer? if so, we may want to have a function, say strlcpy0(), like this: size_t strlcpy0(char *dst, const char *src, size_t maxlen) { size_t len = strlcpy(dst, src, maxlen); if (maxlen && len < maxlen - 1) memset(dst + len + 1, 0, maxlen - len - 1); return len; } --yoshfuji From felipe_alfaro@linuxmail.org Thu Nov 27 14:06:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 14:06:50 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARM6ZTa010801 for ; Thu, 27 Nov 2003 14:06:36 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id C708842E59; Thu, 27 Nov 2003 23:06:28 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: Felipe Alfaro Solana To: Russell King Cc: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com In-Reply-To: <20031127200041.B25015@flint.arm.linux.org.uk> References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> Content-Type: text/plain Message-Id: <1069970770.2138.10.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Thu, 27 Nov 2003 23:06:10 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 1731 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev On Thu, 2003-11-27 at 21:00, Russell King wrote: > > > > I believe that it, to change from strcpy() to strlcpy(), just > > eliminates possibility of buffer-overrun. > > While this is 100% correct, the bit which raised my attention was the > original message which didn't seem to show that the above had been > considered. Well, I can't see the difference between using strcpy() and strlcpy(). Let be: char destination[MAX]; char * source; N = strlen(source); We could use strlcpy(destination, source, MAX) or strcpy(destination, source). We have the following scenarios: - N < MAX. In this case, both strcpy() and strlcpy() should yield the same results. No buffer overflows. If the source strings does not already contain uninitialised data, there's no way for strlcpy() to copy them. - N >= MAX. In this case, strlcpy() will copy less bytes than strcpy(). To be exact, strlcpy() will copy N-MAX+1 bytes less than strcpy(). Again, no buffer overflows. Also, it's still impossible to copy uninitialised data since we just stop at \0 or when we fill up the destination buffer. So I don't see how using strlcpy() could copy uninitialised data from kernel space to user space. If we used memcpy() we could end up copying uninitialised data, but I can't see how using strlcpy() would do that. In general terms, strlcpy() will copy *at most* the same number of bytes as strcpy(), but there is no single case when strlcpy() will copy more bytes than strcpy(). Can someone throw some light on this? From felipe_alfaro@linuxmail.org Thu Nov 27 14:09:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 14:09:51 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARM9VTa011205 for ; Thu, 27 Nov 2003 14:09:32 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id AC1F242E59; Thu, 27 Nov 2003 23:09:24 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy From: Felipe Alfaro Solana To: Timo Kamph Cc: Linux Kernel Mailinglist , netdev@oss.sgi.com, davem@redhat.com In-Reply-To: <3FC67128.14704.30155D53@localhost> References: <20031127142125.GG8276@jdj5.mit.edu> <3FC67128.14704.30155D53@localhost> Content-Type: multipart/mixed; boundary="=-H2KzLXVDXFWGoIKEFjkO" Message-Id: <1069970946.2138.13.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Thu, 27 Nov 2003 23:09:06 +0100 X-archive-position: 1732 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev --=-H2KzLXVDXFWGoIKEFjkO Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2003-11-27 at 21:48, Timo Kamph wrote: > > + strlcpy(label->label, name, sizeof(label->name)); > ^^^^^^ > I guess this shoud be label->label, or am I wrong? Oh my god! Two consecutive mistakes with the same patch! I should have some sleep... Here's the one with the typo corrected. Thanks for pointing it out. Sorry for resending this patch so many times. --=-H2KzLXVDXFWGoIKEFjkO Content-Disposition: attachment; filename=strlcpy-ipv4.patch Content-Type: text/x-patch; name=strlcpy-ipv4.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -uNr linux-2.6.0-test11.orig/net/core/dev.c linux-2.6.0-test11/net/core/dev.c --- linux-2.6.0-test11.orig/net/core/dev.c 2003-11-26 21:44:11.000000000 +0100 +++ linux-2.6.0-test11/net/core/dev.c 2003-11-27 13:21:12.791315993 +0100 @@ -335,7 +335,7 @@ for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { memset(s[i].name, 0, sizeof(s[i].name)); - strcpy(s[i].name, name); + strlcpy(s[i].name, name, sizeof(s[i].name)); memcpy(&s[i].map, map, sizeof(s[i].map)); break; } @@ -653,7 +653,7 @@ for (i = 0; i < 100; i++) { snprintf(buf, sizeof(buf), name, i); if (!__dev_get_by_name(buf)) { - strcpy(dev->name, buf); + strlcpy(dev->name, buf, sizeof(dev->name)); return i; } } @@ -1773,7 +1773,7 @@ return -ENODEV; } - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); read_unlock(&dev_base_lock); if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) diff -uNr linux-2.6.0-test11.orig/net/core/sock.c linux-2.6.0-test11/net/core/sock.c --- linux-2.6.0-test11.orig/net/core/sock.c 2003-11-26 21:44:57.000000000 +0100 +++ linux-2.6.0-test11/net/core/sock.c 2003-11-27 13:22:22.150223793 +0100 @@ -157,7 +157,7 @@ static int warned; static char warncomm[16]; if (strcmp(warncomm, current->comm) && warned < 5) { - strcpy(warncomm, current->comm); + strlcpy(warncomm, current->comm, sizeof(warncomm)); printk(KERN_WARNING "process `%s' is using obsolete " "%s SO_BSDCOMPAT\n", warncomm, name); warned++; diff -uNr linux-2.6.0-test11.orig/net/ipv4/devinet.c linux-2.6.0-test11/net/ipv4/devinet.c --- linux-2.6.0-test11.orig/net/ipv4/devinet.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/devinet.c 2003-11-27 13:31:43.971262502 +0100 @@ -731,9 +731,9 @@ break; memset(&ifr, 0, sizeof(struct ifreq)); if (ifa->ifa_label) - strcpy(ifr.ifr_name, ifa->ifa_label); + strlcpy(ifr.ifr_name, ifa->ifa_label, sizeof(ifr.ifr_name)); else - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); (*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET; (*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr = diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-test11/net/ipv4/ipconfig.c --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650818 +0100 @@ -299,7 +299,7 @@ int err; memset(&ir, 0, sizeof(ir)); - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_ifrn.ifrn_name)); set_sockaddr(sin, ic_myaddr, 0); if ((err = ic_dev_ioctl(SIOCSIFADDR, &ir)) < 0) { printk(KERN_ERR "IP-Config: Unable to set interface address (%d).\n", err); diff -uNr linux-2.6.0-test11.orig/net/ipv4/ip_gre.c linux-2.6.0-test11/net/ipv4/ip_gre.c --- linux-2.6.0-test11.orig/net/ipv4/ip_gre.c 2003-11-26 21:44:59.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ip_gre.c 2003-11-27 13:30:13.342198122 +0100 @@ -1163,7 +1163,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -1227,7 +1227,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_GRE; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipip.c linux-2.6.0-test11/net/ipv4/ipip.c --- linux-2.6.0-test11.orig/net/ipv4/ipip.c 2003-11-26 21:46:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipip.c 2003-11-27 13:30:42.476717090 +0100 @@ -815,7 +815,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -853,7 +853,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_IPIP; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-26 21:45:33.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-27 13:36:43.776537082 +0100 @@ -1918,7 +1918,7 @@ dst->addr = src->addr; dst->port = src->port; dst->fwmark = src->fwmark; - strcpy(dst->sched_name, src->scheduler->name); + strlcpy(dst->sched_name, src->scheduler->name, sizeof(dst->sched_name)); dst->flags = src->flags; dst->timeout = src->timeout / HZ; dst->netmask = src->netmask; @@ -2163,12 +2163,12 @@ memset(&d, 0, sizeof(d)); if (ip_vs_sync_state & IP_VS_STATE_MASTER) { d[0].state = IP_VS_STATE_MASTER; - strcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn); + strlcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn, sizeof(d[0].mcast_ifn)); d[0].syncid = ip_vs_master_syncid; } if (ip_vs_sync_state & IP_VS_STATE_BACKUP) { d[1].state = IP_VS_STATE_BACKUP; - strcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn); + strlcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn, sizeof(d[1].mcast_ifn)); d[1].syncid = ip_vs_backup_syncid; } if (copy_to_user(user, &d, sizeof(d)) != 0) diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c 2003-11-26 21:42:47.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c 2003-11-27 13:34:51.218619748 +0100 @@ -854,10 +854,10 @@ ip_vs_sync_state |= state; if (state == IP_VS_STATE_MASTER) { - strcpy(ip_vs_master_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_master_mcast_ifn, mcast_ifn, sizeof(ip_vs_master_mcast_ifn)); ip_vs_master_syncid = syncid; } else { - strcpy(ip_vs_backup_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_backup_mcast_ifn, mcast_ifn, sizeof(ip_vs_backup_mcast_ifn)); ip_vs_backup_syncid = syncid; } diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c 2003-11-26 21:45:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c 2003-11-27 13:23:24.284474101 +0100 @@ -1086,7 +1086,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c 2003-11-26 21:45:26.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c 2003-11-27 13:28:39.884442527 +0100 @@ -1173,7 +1173,7 @@ = kmalloc(SIZEOF_STRUCT_IP_CHAIN, GFP_KERNEL); if (label == NULL) panic("Can't kmalloc for firewall chains.\n"); - strcpy(label->label,name); + strlcpy(label->label, name, sizeof(label->label)); label->next = NULL; label->chain = NULL; label->refcount = ref; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c 2003-11-26 21:46:12.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c 2003-11-27 13:29:19.651041898 +0100 @@ -235,12 +235,12 @@ pmsg->hw_protocol = entry->skb->protocol; if (entry->info->indev) - strcpy(pmsg->indev_name, entry->info->indev->name); + strlcpy(pmsg->indev_name, entry->info->indev->name, sizeof(pmsg->indev_name)); else pmsg->indev_name[0] = '\0'; if (entry->info->outdev) - strcpy(pmsg->outdev_name, entry->info->outdev->name); + strlcpy(pmsg->outdev_name, entry->info->outdev->name, sizeof(pmsg->outdev_name)); else pmsg->outdev_name[0] = '\0'; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c 2003-11-27 13:23:11.366451326 +0100 @@ -1277,7 +1277,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; --=-H2KzLXVDXFWGoIKEFjkO-- From rmk@arm.linux.org.uk Thu Nov 27 14:19:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 14:19:51 -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.9) with SMTP id hARMJaTa012131 for ; Thu, 27 Nov 2003 14:19:37 -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 1APUTx-0004bI-2V; Thu, 27 Nov 2003 22:19:29 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1APUTw-0008Cz-5P; Thu, 27 Nov 2003 22:19:28 +0000 Date: Thu, 27 Nov 2003 22:19:28 +0000 From: Russell King To: Felipe Alfaro Solana Cc: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031127221928.F25015@flint.arm.linux.org.uk> Mail-Followup-To: Felipe Alfaro Solana , "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> <1069970770.2138.10.camel@teapot.felipe-alfaro.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: <1069970770.2138.10.camel@teapot.felipe-alfaro.com>; from felipe_alfaro@linuxmail.org on Thu, Nov 27, 2003 at 11:06:10PM +0100 X-archive-position: 1733 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev On Thu, Nov 27, 2003 at 11:06:10PM +0100, Felipe Alfaro Solana wrote: > On Thu, 2003-11-27 at 21:00, Russell King wrote: > > > > > > I believe that it, to change from strcpy() to strlcpy(), just > > > eliminates possibility of buffer-overrun. > > > > While this is 100% correct, the bit which raised my attention was the > > original message which didn't seem to show that the above had been > > considered. > > Well, I can't see the difference between using strcpy() and strlcpy(). You misunderstand me. Consider the difference between: strcpy(d, s) strlcpy(d, s, sizeof(d)); strncpy(d, s, sizeof(d)); strncpy zeros the remainder of d if strlen(s) < sizeof(d), but does not zero terminate the buffer if strlen(s) == sizeof(d). (Note: this is how strncpy under the Linux kernel is supposed to work, and yes, the generic strncpy version in lib/string.c is still buggy.) strlcpy copies up to the smaller of strlen(s)-1 and sizeof(d)-1, and ensures that the string is null terminated. If strlen(s) < sizeof(d)-1, bytes in d will not be written. Note my final sentence there. Consider the following: char foo[256]; strlcpy(foo, "hello", sizeof(foo); copy_to_user(uptr, foo, sizeof(foo)); That ends up writing uninitialised kernel data to (unprivileged) user space. So would strcpy() used in that situation. strncpy() on the other hand, will zero the rest of the buffer (on x86 at least) but you'll have to manually ensure that there is a terminator on the end. Or, you use strlcpy but memset the entire space you're copying the string into beforehand, which could be wasteful. Note: we should really fix the generic strncpy() - there are places in the kernel source which rely on the x86 strncpy() behaviour today (eg, binfmt_*.c core file generation.) -- 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 rmk@arm.linux.org.uk Thu Nov 27 14:33:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 14:34:19 -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.9) with SMTP id hARMXuTa013010 for ; Thu, 27 Nov 2003 14:33:57 -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 1APUhp-0004c6-CR; Thu, 27 Nov 2003 22:33:49 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.22) id 1APUho-0008Kf-Gn; Thu, 27 Nov 2003 22:33:48 +0000 Date: Thu, 27 Nov 2003 22:33:48 +0000 From: Russell King To: Felipe Alfaro Solana , "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031127223348.G25015@flint.arm.linux.org.uk> Mail-Followup-To: Felipe Alfaro Solana , "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> <1069970770.2138.10.camel@teapot.felipe-alfaro.com> <20031127221928.F25015@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031127221928.F25015@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Thu, Nov 27, 2003 at 10:19:28PM +0000 X-archive-position: 1734 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev On Thu, Nov 27, 2003 at 10:19:28PM +0000, Russell King wrote: > Note: we should really fix the generic strncpy() - there are places in > the kernel source which rely on the x86 strncpy() behaviour today (eg, > binfmt_*.c core file generation.) Sorry, bad example. Hmm, from a glance around, it seems that all of the places which use strncpy() implicitly zero the buffer prior to using strncpy(). This means that the x86 strncpy is doing unnecessary zeroing. I do remember Alan complaining about the last set of strlcpy() stuff introducing information leaks - maybe those got fixed though. Ok, I don't know where the kernel stands on this issue anymore. Can someone definitively provide a statement of exactly what the kernel expects of strncpy() ? -- 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 romieu@fr.zoreil.com Thu Nov 27 14:53:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 14:54:10 -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.9) with SMTP id hARMrtTa013636 for ; Thu, 27 Nov 2003 14:53:57 -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 hARMpiK7017910; Thu, 27 Nov 2003 23:51:44 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hARMphj2017909; Thu, 27 Nov 2003 23:51:43 +0100 Date: Thu, 27 Nov 2003 23:51:43 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik , brad_mssw@gentoo.org Subject: [PATCH] 2.6.0-test11-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031127235143.A16767@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031126004550.A25408@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Wed, Nov 26, 2003 at 12:45:50AM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 1735 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 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Even more Brad/Realtek's merging. Applies on top of: 2.6.0-test11 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version + r8169-init_one -- Ueimor --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-timer.patch" Merge of timer related changes from Realtek: - changed their timeout value from 100 to HZ to trigger rtl8169_phy_timer(); - s/TX_TIMEOUT/RTL8169_TX_TIMEOUT/ to have RTL8169_{TX/PHY}_TIMEOUT. drivers/net/r8169.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 92 insertions(+), 2 deletions(-) diff -puN drivers/net/r8169.c~r8169-timer drivers/net/r8169.c --- linux-2.6.0-test11/drivers/net/r8169.c~r8169-timer 2003-11-27 22:14:24.000000000 +0100 +++ linux-2.6.0-test11-fr/drivers/net/r8169.c 2003-11-27 23:50:41.000000000 +0100 @@ -95,7 +95,8 @@ static int multicast_filter_limit = 32; #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) #define RTL_MIN_IO_SIZE 0x80 -#define TX_TIMEOUT (6*HZ) +#define RTL8169_TX_TIMEOUT (6*HZ) +#define RTL8169_PHY_TIMEOUT (HZ) /* write/read MMIO register */ #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) @@ -311,6 +312,8 @@ struct rtl8169_private { dma_addr_t RxPhyAddr; struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ + struct timer_list timer; + unsigned long phy_link_down_cnt; }; MODULE_AUTHOR("Realtek"); @@ -540,6 +543,90 @@ static void rtl8169_hw_phy_config(struct mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 } +static void rtl8169_hw_phy_reset(struct net_device *dev) +{ + struct rtl8169_private *tp = dev->priv; + void *ioaddr = tp->mmio_addr; + int i, val; + + printk(KERN_WARNING PFX "%s: Reset RTL8169s PHY\n", dev->name); + + val = (mdio_read(ioaddr, 0) | 0x8000) & 0xffff; + mdio_write(ioaddr, 0, val); + + for (i = 50; i >= 0; i--) { + if (!(mdio_read(ioaddr, 0) & 0x8000)) + break; + udelay(100); /* Gross */ + } + + if (i < 0) { + printk(KERN_WARNING PFX "%s: no PHY Reset ack. Giving up.\n", + dev->name); + } +} + +static void rtl8169_phy_timer(unsigned long __opaque) +{ + struct net_device *dev = (struct net_device *)__opaque; + struct rtl8169_private *tp = dev->priv; + struct timer_list *timer = &tp->timer; + void *ioaddr = tp->mmio_addr; + + assert(tp->mac_version > RTL_GIGA_MAC_VER_B); + assert(tp->phy_version < RTL_GIGA_PHY_VER_G); + + if (RTL_R8(PHYstatus) & LinkStatus) + tp->phy_link_down_cnt = 0; + else { + tp->phy_link_down_cnt++; + if (tp->phy_link_down_cnt >= 12) { + int reg; + + // If link on 1000, perform phy reset. + reg = mdio_read(ioaddr, PHY_1000_CTRL_REG); + if (reg & PHY_Cap_1000_Full) + rtl8169_hw_phy_reset(dev); + + tp->phy_link_down_cnt = 0; + } + } + + mod_timer(timer, RTL8169_PHY_TIMEOUT); +} + +static inline void rtl8169_delete_timer(struct net_device *dev) +{ + struct rtl8169_private *tp = dev->priv; + struct timer_list *timer = &tp->timer; + + if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || + (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + return; + + del_timer_sync(timer); + + tp->phy_link_down_cnt = 0; +} + +static inline void rtl8169_request_timer(struct net_device *dev) +{ + struct rtl8169_private *tp = dev->priv; + struct timer_list *timer = &tp->timer; + + if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || + (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + return; + + tp->phy_link_down_cnt = 0; + + init_timer(timer); + timer->expires = jiffies + RTL8169_PHY_TIMEOUT; + timer->data = (unsigned long)(dev); + timer->function = rtl8169_phy_timer; + add_timer(timer); +} + static int __devinit rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, void **ioaddr_out) @@ -691,7 +778,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->stop = rtl8169_close; dev->tx_timeout = rtl8169_tx_timeout; dev->set_multicast_list = rtl8169_set_rx_mode; - dev->watchdog_timeo = TX_TIMEOUT; + dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; // dev->do_ioctl = mii_ioctl; @@ -892,6 +979,7 @@ rtl8169_open(struct net_device *dev) rtl8169_hw_start(dev); + rtl8169_request_timer(dev); out: return retval; @@ -1385,6 +1473,8 @@ rtl8169_close(struct net_device *dev) netif_stop_queue(dev); + rtl8169_delete_timer(dev); + spin_lock_irq(&tp->lock); /* Stop the chip's Tx and Rx DMA processes. */ _ --ReaqsoxgOBHFXBhH-- From felipe_alfaro@linuxmail.org Thu Nov 27 15:03:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 15:03:55 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hARN3dTa014142 for ; Thu, 27 Nov 2003 15:03:40 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 07DE442E7E; Fri, 28 Nov 2003 00:03:30 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: Felipe Alfaro Solana To: Russell King Cc: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com In-Reply-To: <20031127221928.F25015@flint.arm.linux.org.uk> References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> <1069970770.2138.10.camel@teapot.felipe-alfaro.com> <20031127221928.F25015@flint.arm.linux.org.uk> Content-Type: text/plain Message-Id: <1069974209.5349.7.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Fri, 28 Nov 2003 00:03:29 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 1736 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev On Thu, 2003-11-27 at 23:19, Russell King wrote: > You misunderstand me. Consider the difference between: OK, it's perfectly clear now :-) > Note my final sentence there. Consider the following: > > char foo[256]; > > strlcpy(foo, "hello", sizeof(foo); > > copy_to_user(uptr, foo, sizeof(foo)); > > That ends up writing uninitialised kernel data to (unprivileged) user > space. So would strcpy() used in that situation. > > strncpy() on the other hand, will zero the rest of the buffer (on x86 > at least) but you'll have to manually ensure that there is a terminator > on the end. Or, you use strlcpy but memset the entire space you're > copying the string into beforehand, which could be wasteful. > > Note: we should really fix the generic strncpy() - there are places in > the kernel source which rely on the x86 strncpy() behaviour today (eg, > binfmt_*.c core file generation.) So, as I see: 1. We should fix strncpy() 2. I should replace strlcpy() with strncpy() in my patches. From yoshfuji@linux-ipv6.org Thu Nov 27 16:23:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 16:23:30 -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.9) with SMTP id hAS0NGTa018262 for ; Thu, 27 Nov 2003 16:23:17 -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 hAS0NQlg026843; Fri, 28 Nov 2003 09:23:26 +0900 Date: Fri, 28 Nov 2003 09:23:26 +0900 (JST) Message-Id: <20031128.092326.39861126.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: rmk+lkml@arm.linux.org.uk, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <1069974209.5349.7.camel@teapot.felipe-alfaro.com> References: <1069970770.2138.10.camel@teapot.felipe-alfaro.com> <20031127221928.F25015@flint.arm.linux.org.uk> <1069974209.5349.7.camel@teapot.felipe-alfaro.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: 1738 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 Content-Length: 724 Lines: 35 In article <1069974209.5349.7.camel@teapot.felipe-alfaro.com> (at Fri, 28 Nov 2003 00:03:29 +0100), Felipe Alfaro Solana says: > So, as I see: > > 1. We should fix strncpy() > 2. I should replace strlcpy() with strncpy() in my patches. I think it is NOT correct. It SEEMS unsafe to use strncpy() even if it terminated string correctly. So, I'd suggest to replace strlcpy(dst, src, len); with 1) strlcpy0(dst, src, len); where strlcpy0() is provided in my previous mail, or with 2) memset(dst, 0, len); strncpy(dst, src, len); (or say, strncpy0()) or, with 3) if (len) strncpy(dst, src, len - 1); dst[len] = 0; (or, say, strncpy0()). --yoshfuji From yoshfuji@linux-ipv6.org Thu Nov 27 16:26:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 16:26:47 -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.9) with SMTP id hAS0QXTa018659 for ; Thu, 27 Nov 2003 16:26:34 -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 hAS0Qglg026862; Fri, 28 Nov 2003 09:26:42 +0900 Date: Fri, 28 Nov 2003 09:26:42 +0900 (JST) Message-Id: <20031128.092642.47232575.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: rmk+lkml@arm.linux.org.uk, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031128.092326.39861126.yoshfuji@linux-ipv6.org> References: <20031127221928.F25015@flint.arm.linux.org.uk> <1069974209.5349.7.camel@teapot.felipe-alfaro.com> <20031128.092326.39861126.yoshfuji@linux-ipv6.org> 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=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 1739 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 Content-Length: 559 Lines: 22 In article <20031128.092326.39861126.yoshfuji@linux-ipv6.org> (at Fri, 28 Nov 2003 09:23:26 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > 2) memset(dst, 0, len); > strncpy(dst, src, len); oops, this should be memset(dst, 0, len); if (len > 0) strncpy(dst, src, len - 1); > 3) if (len) > strncpy(dst, src, len - 1); > dst[len] = 0; > > (or, say, strncpy0()). Note: in this case, we need to fix strncpy() first to zero-out rest of destination buffer. --yoshfuji From yoshfuji@linux-ipv6.org Thu Nov 27 16:40:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 16:40:44 -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.9) with SMTP id hAS0eLTa019151 for ; Thu, 27 Nov 2003 16:40:22 -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 hAS0eMlg026935; Fri, 28 Nov 2003 09:40:22 +0900 Date: Fri, 28 Nov 2003 09:40:22 +0900 (JST) Message-Id: <20031128.094022.106776635.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: rmk+lkml@arm.linux.org.uk, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20031128.092642.47232575.yoshfuji@linux-ipv6.org> References: <1069974209.5349.7.camel@teapot.felipe-alfaro.com> <20031128.092326.39861126.yoshfuji@linux-ipv6.org> <20031128.092642.47232575.yoshfuji@linux-ipv6.org> 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=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 1740 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 Content-Length: 1108 Lines: 47 In article <20031128.092642.47232575.yoshfuji@linux-ipv6.org> (at Fri, 28 Nov 2003 09:26:42 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > 3) if (len) > > strncpy(dst, src, len - 1); > > dst[len] = 0; grr, another mistake...: if (len) { strncpy(dst, src, len - 1); dst[len - 1]; } ---------------- 1) use strlcpy0(dst, src, len) size_t strlcpy0(char *dst, const char *src, size_t maxlen) { size_t len = strlcpy(dst, src, maxlen); if (likely(maxlen != 0) && len < maxlen - 1) memset(dst + len + 1, 0, maxlen - len - 1); } 2a) use strncpy0(dst, src, len) char *strncpy0(char *dst, const char *src, size_t maxlen) { memset(dst, 0, maxlen); if (likely(maxlen != 0)) strncpy(dst, src, maxlen - 1); } 2b) fix strncpy() to zero-out rest of destination buffer and use strncpy0(dst, src, len) char *strncpy0(char *dst, const char *src, size_t maxlen) { if (likely(maxlen != 0)) { strncpy(dst, src, maxlen - 1); dst[maxlen - 1] = 0; } } I prefer 1 > 2b >> 2a. --yoshfuji From andi@averellmail.firstfloor.org Thu Nov 27 16:44:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 16:45:08 -0800 (PST) Received: from zero.aec.at (Theodore_Roosevelt@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS0irTa019578 for ; Thu, 27 Nov 2003 16:44:54 -0800 Received: from fred.muc.de (Joel_Huck@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id hAS0ieS18438; Fri, 28 Nov 2003 01:44:41 +0100 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 0ADC65BC08; Fri, 28 Nov 2003 01:44:45 +0100 (CET) Date: Fri, 28 Nov 2003 01:44:45 +0100 From: Andi Kleen To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] Allow multiple dummy devices again Message-ID: <20031128004445.GA2870@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 1741 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 2006 Lines: 84 In 2.6 the old trick of copying the dummy module to get multiple dummy devices doesn't work anymore because the "dummy" device name is embedded in the module. This patch adds a new module option that allows to specify how many dummy devices you want. -Andi diff -u linux/drivers/net/dummy.c-o linux-2.6.0test11-amd64/drivers/net/dummy.c --- linux/drivers/net/dummy.c-o 2003-09-11 04:12:33.000000000 +0200 +++ linux/drivers/net/dummy.c 2003-11-28 01:40:47.000000000 +0100 @@ -34,6 +34,8 @@ #include #include +static int numdummies = 1; + static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); static struct net_device_stats *dummy_get_stats(struct net_device *dev); @@ -83,10 +85,14 @@ return dev->priv; } -static struct net_device *dev_dummy; +static struct net_device **dummies; -static int __init dummy_init_module(void) +/* Number of dummy devices to be set up by this module. */ +MODULE_PARM(numdummies, "i") + +static int __init dummy_init_one(int index) { + struct net_device *dev_dummy; int err; dev_dummy = alloc_netdev(sizeof(struct net_device_stats), @@ -98,15 +104,40 @@ if ((err = register_netdev(dev_dummy))) { kfree(dev_dummy); dev_dummy = NULL; + } else { + dummies[index] = dev_dummy; } + return err; } +static void __exit dummy_free_one(int index) +{ + unregister_netdev(dummies[index]); + free_netdev(dummies[index]); +} + +static int __init dummy_init_module(void) +{ + int i, err = 0; + dummies = kmalloc(numdummies * sizeof(void *), GFP_KERNEL); + if (!dummies) + return -ENOMEM; + for (i = 0; i < numdummies && !err; i++) + err = dummy_init_one(i); + if (err) { + while (--i >= 0) + dummy_free_one(i); + } + return err; +} + static void __exit dummy_cleanup_module(void) { - unregister_netdev(dev_dummy); - free_netdev(dev_dummy); - dev_dummy = NULL; + int i; + for (i = 0; i < numdummies; i++) + dummy_free_one(i); + kfree(dummies); } module_init(dummy_init_module); From davem@pizda.ninka.net Thu Nov 27 17:03:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17:04: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.9) with SMTP id hAS13pTa020167 for ; Thu, 27 Nov 2003 17:03:51 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA09369; Thu, 27 Nov 2003 17:03:37 -0800 Date: Thu, 27 Nov 2003 17:03:37 -0800 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org, felix-kernel@fefe.de Subject: Re: ipv4-mapped ipv4 connect() for UDP broken in test10 Message-Id: <20031127170337.7210df24.davem@redhat.com> In-Reply-To: <20031127.211135.09649297.yoshfuji@linux-ipv6.org> References: <20031126081745.GA31415@codeblau.de> <20031126.190407.102714104.yoshfuji@linux-ipv6.org> <20031127.211135.09649297.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: 1742 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: 693 Lines: 18 On Thu, 27 Nov 2003 21:11:35 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > In article <20031126.190407.102714104.yoshfuji@linux-ipv6.org> (at Wed, 26 Nov 2003 19:04:07 +0900 (JST)), YOSHIFUJI Hideaki / _$B5HF#1QL@ says: > > I'm sure the original code has a bug. > I do think that it is related to your report > (but I don't have time to confirm it.) > > s6_addr[3] should be s6_addr32[3] because the code is intended to extract > IPv4 address from the IPv4-mapped address (::ffff:0.0.0.0/96) > to convert sockaddr_in6{} to sockaddr_in{}. I know, I know. I did apply your patch already, sorry for not telling you this. Thanks. From davem@pizda.ninka.net Thu Nov 27 17:13:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17: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.9) with SMTP id hAS1DITa020631 for ; Thu, 27 Nov 2003 17:13:18 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA13811; Thu, 27 Nov 2003 17:13:13 -0800 Date: Thu, 27 Nov 2003 17:13:13 -0800 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] Allow multiple dummy devices again Message-Id: <20031127171313.04f89baa.davem@redhat.com> In-Reply-To: <20031128004445.GA2870@averell> References: <20031128004445.GA2870@averell> 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: 1743 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: 486 Lines: 14 On Fri, 28 Nov 2003 01:44:45 +0100 Andi Kleen wrote: > In 2.6 the old trick of copying the dummy module to get multiple dummy > devices doesn't work anymore because the "dummy" device name is embedded > in the module. > > This patch adds a new module option that allows to specify how many > dummy devices you want. Jeff, FWIW I'm fine with this. Even though we generally frown upon module options for networking devices, I think it's wholly appropriate for this case. From ak@suse.de Thu Nov 27 17:14:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17:15:03 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS1ElTa020850 for ; Thu, 27 Nov 2003 17:14:48 -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 00D501862BAF; Fri, 28 Nov 2003 02:14:42 +0100 (CET) Date: Fri, 28 Nov 2003 02:14:39 +0100 From: Andi Kleen To: hadi@cyberus.ca Cc: davem@redhat.com, xose@wanadoo.es, netdev@oss.sgi.com Subject: Re: Level One LXT1001 GE chip Message-Id: <20031128021439.0f48de70.ak@suse.de> In-Reply-To: <1069941123.1027.6.camel@jzny.localdomain> References: <3FC3FB99.70700@wanadoo.es> <20031127010324.061cac3b.davem@redhat.com> <20031127122021.3ac80a86.ak@suse.de> <20031127122642.046d07ce.ak@suse.de> <1069941123.1027.6.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.7 (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: 1744 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 Content-Length: 276 Lines: 12 On 27 Nov 2003 08:52:03 -0500 jamal wrote: > Andi, is this the driver you were playing those neat tricks with > getting rid of some of the nastiness in eth_type_trans()? Yep. I didn't attempt to NAPIize it though. Also it is still somewhat buggy. -Andi From mitch@sfgoth.com Thu Nov 27 17:29:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17:29:49 -0800 (PST) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS1TVTa021522 for ; Thu, 27 Nov 2003 17:29:33 -0800 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id hAS1Y9ob025799; Thu, 27 Nov 2003 17:34:09 -0800 (PST) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id hAS1Y8jP025797; Thu, 27 Nov 2003 17:34:08 -0800 (PST) (envelope-from mitch) Date: Thu, 27 Nov 2003 17:34:08 -0800 From: Mitchell Blank Jr To: Felipe Alfaro Solana , "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" , davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031128013408.GD73661@gaz.sfgoth.com> References: <1069934643.2393.0.camel@teapot.felipe-alfaro.com> <20031127.210953.116254624.yoshfuji@linux-ipv6.org> <20031127194602.A25015@flint.arm.linux.org.uk> <20031128.045413.133305490.yoshfuji@linux-ipv6.org> <20031127200041.B25015@flint.arm.linux.org.uk> <1069970770.2138.10.camel@teapot.felipe-alfaro.com> <20031127221928.F25015@flint.arm.linux.org.uk> <20031127223348.G25015@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031127223348.G25015@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-archive-position: 1745 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Content-Length: 1594 Lines: 33 Russell King wrote: > Sorry, bad example. Hmm, from a glance around, it seems that all of > the places which use strncpy() implicitly zero the buffer prior to > using strncpy(). > > This means that the x86 strncpy is doing unnecessary zeroing. I do > remember Alan complaining about the last set of strlcpy() stuff > introducing information leaks - maybe those got fixed though. The problem is that most places you're filling in an array in a struct. So even if you use strncpy() everywhere you can still get bitten if the compiler inserts any padding for alignment on some architecture (since even if you fully initialize each char[] array in the structure using strncpy you might still leak info in padding bytes) The safest thing to do in these cases is: 1. memset() the array before you start 2. strlcpy() for filling each char[] array (since strncpy would just re-zero those bytes it's wasteful) Yes, the full memset() is a small waste, but its safe. In 99% of these cases we're talking about some weird ioctl() or something that's way off the fast path anyways. I pointed this out some months ago and someone (forgot who) replied that there shouldn't be any padding in any struct exported from the kernel. They added a compiler warning for structure padding in the -mm series for a few days, but I guess it caused so many warnings that they took it right out again, so I believe that there ARE plenty of places that user-visible struct's get padded by the ABI of some platforms. If there's some difinitive evidence that padding never happens I'd like to see it. -Mitch From hadi@cyberus.ca Thu Nov 27 17:33:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17:34:11 -0800 (PST) Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS1XwTa021934 for ; Thu, 27 Nov 2003 17:33:58 -0800 Received: from [24.103.99.32] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1APXW9-0000SC-26; Thu, 27 Nov 2003 20:33:57 -0500 Subject: Re: [PATCH] Allow multiple dummy devices again From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Andi Kleen , netdev@oss.sgi.com, jgarzik@pobox.com In-Reply-To: <20031127171313.04f89baa.davem@redhat.com> References: <20031128004445.GA2870@averell> <20031127171313.04f89baa.davem@redhat.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1069983202.1041.5.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 27 Nov 2003 20:33:22 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 1746 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 Content-Length: 232 Lines: 10 On Thu, 2003-11-27 at 20:13, David S. Miller wrote: > Even though we generally frown upon module options for networking > devices, I think it's wholly appropriate for this case. Why not make it also a boot option? cheers, jamal From davem@pizda.ninka.net Thu Nov 27 17:40:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 17:40:30 -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.9) with SMTP id hAS1eHTa022346 for ; Thu, 27 Nov 2003 17:40:17 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA21070; Thu, 27 Nov 2003 17:40:12 -0800 Date: Thu, 27 Nov 2003 17:40:12 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: ak@muc.de, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] Allow multiple dummy devices again Message-Id: <20031127174012.0bab844e.davem@redhat.com> In-Reply-To: <1069983202.1041.5.camel@jzny.localdomain> References: <20031128004445.GA2870@averell> <20031127171313.04f89baa.davem@redhat.com> <1069983202.1041.5.camel@jzny.localdomain> 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: 1747 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: 457 Lines: 14 On 27 Nov 2003 20:33:22 -0500 jamal wrote: > On Thu, 2003-11-27 at 20:13, David S. Miller wrote: > > > Even though we generally frown upon module options for networking > > devices, I think it's wholly appropriate for this case. > > Why not make it also a boot option? They're one in the same these days. If the driver is built as a module, you pass the option in with at modload time, else you pass it in on the kernel command line. From yoshfuji@linux-ipv6.org Thu Nov 27 18:05:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 18:05:57 -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.9) with SMTP id hAS25OTa023078 for ; Thu, 27 Nov 2003 18:05:44 -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 hAS25Qlg027398; Fri, 28 Nov 2003 11:05:26 +0900 Date: Fri, 28 Nov 2003 11:05:25 +0900 (JST) Message-Id: <20031128.110525.113293143.yoshfuji@linux-ipv6.org> To: felipe_alfaro@linuxmail.org Cc: timo@kamph.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, davem@redhat.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <1069970946.2138.13.camel@teapot.felipe-alfaro.com> References: <20031127142125.GG8276@jdj5.mit.edu> <3FC67128.14704.30155D53@localhost> <1069970946.2138.13.camel@teapot.felipe-alfaro.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: 1748 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 Content-Length: 713 Lines: 17 In article <1069970946.2138.13.camel@teapot.felipe-alfaro.com> (at Thu, 27 Nov 2003 23:09:06 +0100), Felipe Alfaro Solana says: > diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-test11/net/ipv4/ipconfig.c > --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.000000000 +0100 > +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650818 +0100 > @@ -299,7 +299,7 @@ > int err; > > memset(&ir, 0, sizeof(ir)); > - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); > + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_ifrn.ifrn_name)); please use strlcpy(ir.ifr_name, ic_dev->name, sizeof(ir.ifr_name)); instead. --yoshfuji From hch@infradead.org Thu Nov 27 23:04:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Nov 2003 23:04:58 -0800 (PST) Received: from phoenix.infradead.org (phoenix.infradead.org [213.86.99.234]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS74gTa029029 for ; Thu, 27 Nov 2003 23:04:43 -0800 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 1APcg9-0001Vq-6O; Fri, 28 Nov 2003 07:04:37 +0000 Date: Fri, 28 Nov 2003 07:04:37 +0000 From: Christoph Hellwig To: "David S. Miller" Cc: hadi@cyberus.ca, ak@muc.de, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] Allow multiple dummy devices again Message-ID: <20031128070437.A5765@infradead.org> References: <20031128004445.GA2870@averell> <20031127171313.04f89baa.davem@redhat.com> <1069983202.1041.5.camel@jzny.localdomain> <20031127174012.0bab844e.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: <20031127174012.0bab844e.davem@redhat.com>; from davem@redhat.com on Thu, Nov 27, 2003 at 05:40:12PM -0800 X-archive-position: 1749 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 Content-Length: 655 Lines: 19 On Thu, Nov 27, 2003 at 05:40:12PM -0800, David S. Miller wrote: > On 27 Nov 2003 20:33:22 -0500 > jamal wrote: > > > On Thu, 2003-11-27 at 20:13, David S. Miller wrote: > > > > > Even though we generally frown upon module options for networking > > > devices, I think it's wholly appropriate for this case. > > > > Why not make it also a boot option? > > They're one in the same these days. > > If the driver is built as a module, you pass the option in with > at modload time, else you pass it in on the kernel command line. You'd have to use module_param for that, but it appears the driver uses the deprectated MODULE_PARAM.. From davem@pizda.ninka.net Fri Nov 28 00:32:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 00:32: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.9) with SMTP id hAS8WQTa002558 for ; Fri, 28 Nov 2003 00:32:29 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA28638; Fri, 28 Nov 2003 00:30:40 -0800 Date: Fri, 28 Nov 2003 00:30:40 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: hadi@cyberus.ca, ak@muc.de, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] Allow multiple dummy devices again Message-Id: <20031128003040.76abab84.davem@redhat.com> In-Reply-To: <20031128070437.A5765@infradead.org> References: <20031128004445.GA2870@averell> <20031127171313.04f89baa.davem@redhat.com> <1069983202.1041.5.camel@jzny.localdomain> <20031127174012.0bab844e.davem@redhat.com> <20031128070437.A5765@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: 1750 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: 232 Lines: 7 On Fri, 28 Nov 2003 07:04:37 +0000 Christoph Hellwig wrote: > You'd have to use module_param for that, but it appears the driver uses > the deprectated MODULE_PARAM.. Indeed, that should be fixed. Good catch. From dwmw2@infradead.org Fri Nov 28 01:42:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 01:42:41 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.86.99.235]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS9gOTa006236 for ; Fri, 28 Nov 2003 01:42:25 -0800 Received: from fish.redhat.com ([213.86.99.237] helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.22 #5 (Red Hat Linux)) id 1APfAF-0003QD-PH; Fri, 28 Nov 2003 09:43:51 +0000 Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy From: David Woodhouse To: Felipe Alfaro Solana Cc: Timo Kamph , Linux Kernel Mailinglist , netdev@oss.sgi.com, davem@redhat.com In-Reply-To: <1069970946.2138.13.camel@teapot.felipe-alfaro.com> References: <20031127142125.GG8276@jdj5.mit.edu> <3FC67128.14704.30155D53@localhost> <1069970946.2138.13.camel@teapot.felipe-alfaro.com> Content-Type: text/plain Message-Id: <1070012538.10048.13.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.1) Date: Fri, 28 Nov 2003 09:42:18 +0000 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Pentafluge-Mail-From: X-archive-position: 1751 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 537 Lines: 17 On Thu, 2003-11-27 at 23:09 +0100, Felipe Alfaro Solana wrote: > On Thu, 2003-11-27 at 21:48, Timo Kamph wrote: > > > > + strlcpy(label->label, name, sizeof(label->name)); > > ^^^^^^ > > I guess this shoud be label->label, or am I wrong? > > Oh my god! Two consecutive mistakes with the same patch! I should have > some sleep... Here's the one with the typo corrected. Perhaps we should consider #define strsizecpy(x, y) strlcpy((x), (y), sizeof(x)) -- dwmw2 From felipe_alfaro@linuxmail.org Fri Nov 28 01:52:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 01:52:44 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS9qFTa006674 for ; Fri, 28 Nov 2003 01:52:23 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 7075E42E7F; Fri, 28 Nov 2003 10:52:04 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy From: Felipe Alfaro Solana To: YOSHIFUJI Hideaki / =?UTF-8?Q?=E5=90=89=E8=97=A4=E8=8B=B1?= =?UTF-8?Q?=E6=98=8E?= Cc: timo@kamph.org, Linux Kernel Mailinglist , netdev@oss.sgi.com, davem@redhat.com In-Reply-To: <20031128.110525.113293143.yoshfuji@linux-ipv6.org> References: <20031127142125.GG8276@jdj5.mit.edu> <3FC67128.14704.30155D53@localhost> <1069970946.2138.13.camel@teapot.felipe-alfaro.com> <20031128.110525.113293143.yoshfuji@linux-ipv6.org> Content-Type: multipart/mixed; boundary="=-YRJqItfl9E4mCW150N5n" Message-Id: <1070013124.2144.0.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Fri, 28 Nov 2003 10:52:04 +0100 X-archive-position: 1752 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev Content-Length: 10099 Lines: 247 --=-YRJqItfl9E4mCW150N5n Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 2003-11-28 at 03:05, YOSHIFUJI Hideaki / =E5=90=89=E8=97=A4=E8=8B= =B1=E6=98=8E wrote: > In article <1069970946.2138.13.camel@teapot.felipe-alfaro.com> (at Thu,= 27 Nov 2003 23:09:06 +0100), Felipe Alfaro Solana says: >=20 > > diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-tes= t11/net/ipv4/ipconfig.c > > --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.0= 00000000 +0100 > > +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650= 818 +0100 > > @@ -299,7 +299,7 @@ > > int err; > > =20 > > memset(&ir, 0, sizeof(ir)); > > - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); > > + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_ifrn.ifr= n_name)); >=20 > please use > strlcpy(ir.ifr_name, ic_dev->name, sizeof(ir.ifr_name)); > instead. Done! --=-YRJqItfl9E4mCW150N5n Content-Disposition: attachment; filename=strlcpy-ipv4.patch Content-Type: text/x-patch; name=strlcpy-ipv4.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -uNr linux-2.6.0-test11.orig/net/core/dev.c linux-2.6.0-test11/net/core/dev.c --- linux-2.6.0-test11.orig/net/core/dev.c 2003-11-26 21:44:11.000000000 +0100 +++ linux-2.6.0-test11/net/core/dev.c 2003-11-27 13:21:12.791315993 +0100 @@ -335,7 +335,7 @@ for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { memset(s[i].name, 0, sizeof(s[i].name)); - strcpy(s[i].name, name); + strlcpy(s[i].name, name, sizeof(s[i].name)); memcpy(&s[i].map, map, sizeof(s[i].map)); break; } @@ -653,7 +653,7 @@ for (i = 0; i < 100; i++) { snprintf(buf, sizeof(buf), name, i); if (!__dev_get_by_name(buf)) { - strcpy(dev->name, buf); + strlcpy(dev->name, buf, sizeof(dev->name)); return i; } } @@ -1773,7 +1773,7 @@ return -ENODEV; } - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); read_unlock(&dev_base_lock); if (copy_to_user(arg, &ifr, sizeof(struct ifreq))) diff -uNr linux-2.6.0-test11.orig/net/core/sock.c linux-2.6.0-test11/net/core/sock.c --- linux-2.6.0-test11.orig/net/core/sock.c 2003-11-26 21:44:57.000000000 +0100 +++ linux-2.6.0-test11/net/core/sock.c 2003-11-27 13:22:22.150223793 +0100 @@ -157,7 +157,7 @@ static int warned; static char warncomm[16]; if (strcmp(warncomm, current->comm) && warned < 5) { - strcpy(warncomm, current->comm); + strlcpy(warncomm, current->comm, sizeof(warncomm)); printk(KERN_WARNING "process `%s' is using obsolete " "%s SO_BSDCOMPAT\n", warncomm, name); warned++; diff -uNr linux-2.6.0-test11.orig/net/ipv4/devinet.c linux-2.6.0-test11/net/ipv4/devinet.c --- linux-2.6.0-test11.orig/net/ipv4/devinet.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/devinet.c 2003-11-27 13:31:43.971262502 +0100 @@ -731,9 +731,9 @@ break; memset(&ifr, 0, sizeof(struct ifreq)); if (ifa->ifa_label) - strcpy(ifr.ifr_name, ifa->ifa_label); + strlcpy(ifr.ifr_name, ifa->ifa_label, sizeof(ifr.ifr_name)); else - strcpy(ifr.ifr_name, dev->name); + strlcpy(ifr.ifr_name, dev->name, sizeof(ifr.ifr_name)); (*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET; (*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr = diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-test11/net/ipv4/ipconfig.c --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650818 +0100 @@ -299,7 +299,7 @@ int err; memset(&ir, 0, sizeof(ir)); - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_name)); set_sockaddr(sin, ic_myaddr, 0); if ((err = ic_dev_ioctl(SIOCSIFADDR, &ir)) < 0) { printk(KERN_ERR "IP-Config: Unable to set interface address (%d).\n", err); diff -uNr linux-2.6.0-test11.orig/net/ipv4/ip_gre.c linux-2.6.0-test11/net/ipv4/ip_gre.c --- linux-2.6.0-test11.orig/net/ipv4/ip_gre.c 2003-11-26 21:44:59.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ip_gre.c 2003-11-27 13:30:13.342198122 +0100 @@ -1163,7 +1163,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -1227,7 +1227,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_GRE; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipip.c linux-2.6.0-test11/net/ipv4/ipip.c --- linux-2.6.0-test11.orig/net/ipv4/ipip.c 2003-11-26 21:46:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipip.c 2003-11-27 13:30:42.476717090 +0100 @@ -815,7 +815,7 @@ iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); @@ -853,7 +853,7 @@ struct iphdr *iph = &tunnel->parms.iph; tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); + strlcpy(tunnel->parms.name, dev->name, sizeof(tunnel->parms.name)); iph->version = 4; iph->protocol = IPPROTO_IPIP; diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-26 21:45:33.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_ctl.c 2003-11-27 13:36:43.776537082 +0100 @@ -1918,7 +1918,7 @@ dst->addr = src->addr; dst->port = src->port; dst->fwmark = src->fwmark; - strcpy(dst->sched_name, src->scheduler->name); + strlcpy(dst->sched_name, src->scheduler->name, sizeof(dst->sched_name)); dst->flags = src->flags; dst->timeout = src->timeout / HZ; dst->netmask = src->netmask; @@ -2163,12 +2163,12 @@ memset(&d, 0, sizeof(d)); if (ip_vs_sync_state & IP_VS_STATE_MASTER) { d[0].state = IP_VS_STATE_MASTER; - strcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn); + strlcpy(d[0].mcast_ifn, ip_vs_master_mcast_ifn, sizeof(d[0].mcast_ifn)); d[0].syncid = ip_vs_master_syncid; } if (ip_vs_sync_state & IP_VS_STATE_BACKUP) { d[1].state = IP_VS_STATE_BACKUP; - strcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn); + strlcpy(d[1].mcast_ifn, ip_vs_backup_mcast_ifn, sizeof(d[1].mcast_ifn)); d[1].syncid = ip_vs_backup_syncid; } if (copy_to_user(user, &d, sizeof(d)) != 0) diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c --- linux-2.6.0-test11.orig/net/ipv4/ipvs/ip_vs_sync.c 2003-11-26 21:42:47.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/ipvs/ip_vs_sync.c 2003-11-27 13:34:51.218619748 +0100 @@ -854,10 +854,10 @@ ip_vs_sync_state |= state; if (state == IP_VS_STATE_MASTER) { - strcpy(ip_vs_master_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_master_mcast_ifn, mcast_ifn, sizeof(ip_vs_master_mcast_ifn)); ip_vs_master_syncid = syncid; } else { - strcpy(ip_vs_backup_mcast_ifn, mcast_ifn); + strlcpy(ip_vs_backup_mcast_ifn, mcast_ifn, sizeof(ip_vs_backup_mcast_ifn)); ip_vs_backup_syncid = syncid; } diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/arp_tables.c 2003-11-26 21:45:10.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/arp_tables.c 2003-11-27 13:23:24.284474101 +0100 @@ -1086,7 +1086,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ipchains_core.c 2003-11-26 21:45:26.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ipchains_core.c 2003-11-27 13:28:39.884442527 +0100 @@ -1173,7 +1173,7 @@ = kmalloc(SIZEOF_STRUCT_IP_CHAIN, GFP_KERNEL); if (label == NULL) panic("Can't kmalloc for firewall chains.\n"); - strcpy(label->label,name); + strlcpy(label->label, name, sizeof(label->label)); label->next = NULL; label->chain = NULL; label->refcount = ref; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_queue.c 2003-11-26 21:46:12.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_queue.c 2003-11-27 13:29:19.651041898 +0100 @@ -235,12 +235,12 @@ pmsg->hw_protocol = entry->skb->protocol; if (entry->info->indev) - strcpy(pmsg->indev_name, entry->info->indev->name); + strlcpy(pmsg->indev_name, entry->info->indev->name, sizeof(pmsg->indev_name)); else pmsg->indev_name[0] = '\0'; if (entry->info->outdev) - strcpy(pmsg->outdev_name, entry->info->outdev->name); + strlcpy(pmsg->outdev_name, entry->info->outdev->name, sizeof(pmsg->outdev_name)); else pmsg->outdev_name[0] = '\0'; diff -uNr linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c --- linux-2.6.0-test11.orig/net/ipv4/netfilter/ip_tables.c 2003-11-26 21:43:25.000000000 +0100 +++ linux-2.6.0-test11/net/ipv4/netfilter/ip_tables.c 2003-11-27 13:23:11.366451326 +0100 @@ -1277,7 +1277,7 @@ sizeof(info.underflow)); info.num_entries = t->private->number; info.size = t->private->size; - strcpy(info.name, name); + strlcpy(info.name, name, sizeof(info.name)); if (copy_to_user(user, &info, *len) != 0) ret = -EFAULT; --=-YRJqItfl9E4mCW150N5n-- From felipe_alfaro@linuxmail.org Fri Nov 28 01:54:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 01:54:58 -0800 (PST) Received: from kerberos.felipe-alfaro.com (153.Red-213-4-13.pooles.rima-tde.net [213.4.13.153]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAS9sfTa007031 for ; Fri, 28 Nov 2003 01:54:42 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 6438242E7E; Fri, 28 Nov 2003 10:54:33 +0100 (CET) Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy From: Felipe Alfaro Solana To: YOSHIFUJI Hideaki / =?UTF-8?Q?=E5=90=89=E8=97=A4=E8=8B=B1?= =?UTF-8?Q?=E6=98=8E?= Cc: rmk+lkml@arm.linux.org.uk, davem@redhat.com, Linux Kernel Mailinglist , netdev@oss.sgi.com In-Reply-To: <20031128.094022.106776635.yoshfuji@linux-ipv6.org> References: <1069974209.5349.7.camel@teapot.felipe-alfaro.com> <20031128.092326.39861126.yoshfuji@linux-ipv6.org> <20031128.092642.47232575.yoshfuji@linux-ipv6.org> <20031128.094022.106776635.yoshfuji@linux-ipv6.org> Content-Type: text/plain; charset=UTF-8 Message-Id: <1070013272.2144.4.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Fri, 28 Nov 2003 10:54:33 +0100 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAS9sfTa007031 X-archive-position: 1753 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipe_alfaro@linuxmail.org Precedence: bulk X-list: netdev Content-Length: 1943 Lines: 75 On Fri, 2003-11-28 at 01:40, YOSHIFUJI Hideaki / å‰è—¤è‹±æ˜Ž wrote: > In article <20031128.092642.47232575.yoshfuji@linux-ipv6.org> (at Fri, 28 Nov 2003 09:26:42 +0900 (JST)), YOSHIFUJI Hideaki / å‰è—¤è‹±æ˜Ž says: > > > > 3) if (len) > > > strncpy(dst, src, len - 1); > > > dst[len] = 0; > > grr, another mistake...: > > if (len) { > strncpy(dst, src, len - 1); > dst[len - 1]; > } > > ---------------- > 1) use strlcpy0(dst, src, len) > > size_t strlcpy0(char *dst, const char *src, size_t maxlen) > { > size_t len = strlcpy(dst, src, maxlen); > if (likely(maxlen != 0) && len < maxlen - 1) > memset(dst + len + 1, 0, maxlen - len - 1); > } > > 2a) use strncpy0(dst, src, len) > > char *strncpy0(char *dst, const char *src, size_t maxlen) > { > memset(dst, 0, maxlen); > if (likely(maxlen != 0)) > strncpy(dst, src, maxlen - 1); > } > > 2b) fix strncpy() to zero-out rest of destination buffer > and use strncpy0(dst, src, len) > > char *strncpy0(char *dst, const char *src, size_t maxlen) > { > if (likely(maxlen != 0)) { > strncpy(dst, src, maxlen - 1); > dst[maxlen - 1] = 0; > } > } > > > I prefer 1 > 2b >> 2a. What about coding a new function str0cpy()? /** * str0cpy - Copy a length-limited, %NUL-terminated string * @dest: Where to copy the string to * @src: Where to copy the string from * @count: The maximum number of bytes to copy */ char * str0cpy(char * dest,const char *src,size_t count) { if (count) { char *tmp = dest; count--; while (count) { if ((*tmp = *src) != 0) src++; tmp++; count--; } *tmp = 0; } return dest; } It behaves like strncpy() but correctly null-terminates the string in every case. From vnuorval@tcs.hut.fi Fri Nov 28 02:34:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 02:34:38 -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.9) with SMTP id hASAYETa013569 for ; Fri, 28 Nov 2003 02:34:15 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 85CB1800234; Fri, 28 Nov 2003 12:34:13 +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 hASAYDsj009761; Fri, 28 Nov 2003 12:34:13 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hASAYC4e009757; Fri, 28 Nov 2003 12:34:12 +0200 Date: Fri, 28 Nov 2003 12:34:12 +0200 (EET) From: Ville Nuorvala To: davem@redhat.com Cc: =?iso-8859-15?Q?YOSHIFUJI_Hideaki_=2F_=B5=C8=C6=A3=B1=D1=CC=C0?= , netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device In-Reply-To: <20031127.193910.96333709.yoshfuji@linux-ipv6.org> Message-ID: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> <20031127.193910.96333709.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id hASAYETa013569 X-archive-position: 1754 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 Content-Length: 3476 Lines: 130 On Thu, 27 Nov 2003, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > In article (at Thu, 27 Nov 2003 12:31:58 +0200 (EET)), Ville Nuorvala says: > > > here is a new version. I made some other minor changes to it too. > > looks fine. > --yoshfuji Hi Dave, Yoshifuji-san is now ok with this patch :) Would you apply it? Its purpose is to enable autoconfiguration of link-local addresses on the ip6-ip6 tunnel devices. Thanks, Ville ===== net/ipv6/ip6_tunnel.c 1.12.1.2 vs 1.16 ===== --- 1.12.1.2/net/ipv6/ip6_tunnel.c Wed Nov 5 22:36:56 2003 +++ 1.16/net/ipv6/ip6_tunnel.c Thu Nov 6 17:00:52 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); } ===== net/ipv6/addrconf.c 1.74.1.3 vs 1.79 ===== --- 1.74.1.3/net/ipv6/addrconf.c Wed Nov 26 03:06:32 2003 +++ 1.79/net/ipv6/addrconf.c Thu Nov 27 11:14:09 2003 @@ -1809,6 +1809,54 @@ sit_route_add(dev); } +static inline int +ipv6_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 (!ipv6_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 (!ipv6_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); +} int addrconf_notify(struct notifier_block *this, unsigned long event, void * data) @@ -1822,7 +1870,9 @@ case ARPHRD_SIT: addrconf_sit_config(dev); break; - + case ARPHRD_TUNNEL6: + addrconf_ip6_tnl_config(dev); + break; case ARPHRD_LOOPBACK: init_loopback(dev); break; @@ -2121,6 +2171,7 @@ */ if (ifp->idev->cnf.forwarding == 0 && + ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { struct in6_addr all_routers; -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From joern@wohnheim.fh-wedel.de Fri Nov 28 03:23:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 03:24:11 -0800 (PST) Received: from mail.fh-wedel.de (mail.fh-wedel.de [213.39.232.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hASBNmTa015901 for ; Fri, 28 Nov 2003 03:23:53 -0800 Received: from wohnheim.fh-wedel.de (wohnheim.fh-wedel.de [213.39.233.138]) by mail.fh-wedel.de (8.12.9/8.12.9/Debian-1) with ESMTP id hASBL7rs015336; Fri, 28 Nov 2003 12:21:10 +0100 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 1APgi3-0004wM-00; Fri, 28 Nov 2003 12:22:51 +0100 Date: Fri, 28 Nov 2003 12:22:51 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: felipe_alfaro@linuxmail.org, rmk+lkml@arm.linux.org.uk, davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy Message-ID: <20031128112251.GA18276@wohnheim.fh-wedel.de> References: <1069974209.5349.7.camel@teapot.felipe-alfaro.com> <20031128.092326.39861126.yoshfuji@linux-ipv6.org> <20031128.092642.47232575.yoshfuji@linux-ipv6.org> <20031128.094022.106776635.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20031128.094022.106776635.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.3.28i X-MIME-Autoconverted: from 8bit to quoted-printable by mail.fh-wedel.de id hASBL7rs015336 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hASBNmTa015901 X-archive-position: 1755 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev Content-Length: 651 Lines: 25 On Fri, 28 November 2003 09:40:22 +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20031128.092642.47232575.yoshfuji@linux-ipv6.org> (at Fri, 28 Nov 2003 09:26:42 +0900 (JST)), YOSHIFUJI Hideaki / ?$B5HF#1QL@ says: > > > > 3) if (len) > > > strncpy(dst, src, len - 1); > > > dst[len] = 0; > > grr, another mistake...: > > if (len) { > strncpy(dst, src, len - 1); > dst[len - 1]; ^ > } Did you forget ' = 0' there? ;) Jörn -- ticks = jiffies; while (ticks == jiffies); ticks = jiffies; -- /usr/src/linux/init/main.c From davem@pizda.ninka.net Fri Nov 28 04:09:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 04:09: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.9) with SMTP id hASC95Ta017726 for ; Fri, 28 Nov 2003 04:09:12 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA29194; Fri, 28 Nov 2003 04:07:30 -0800 Date: Fri, 28 Nov 2003 04:07:30 -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: <20031128040730.244b76da.davem@redhat.com> In-Reply-To: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> <20031127.193910.96333709.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: 1756 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: 374 Lines: 10 On Fri, 28 Nov 2003 12:34:12 +0200 (EET) Ville Nuorvala wrote: > Hi Dave, Yoshifuji-san is now ok with this patch :) Would you apply it? > > Its purpose is to enable autoconfiguration of link-local addresses on > the ip6-ip6 tunnel devices. I will, just that I'm in no rush to do this since Linus won't look at anything until at least next week. :) From brad@mcve.com Fri Nov 28 08:46:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 08:46:58 -0800 (PST) Received: from nameserver1.mcve.com (nameserver1.brainwerkz.net [209.251.159.130]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hASGkiTa030151 for ; Fri, 28 Nov 2003 08:46:44 -0800 Received: from mcve.com (ip68-105-173-45.ga.at.cox.net [68.105.173.45]) by nameserver1.mcve.com (Postfix) with ESMTP id 9CA24856CA; Fri, 28 Nov 2003 12:00:41 -0500 (EST) Message-ID: <3FC77BEE.5090600@mcve.com> Date: Fri, 28 Nov 2003 11:46:38 -0500 From: Brad House User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Jeff Garzik , brad_mssw@gentoo.org Subject: Re: [PATCH] 2.6.0-test11-bk27-netdrvr-exp1 - r8169 update References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> <20031127235143.A16767@electric-eye.fr.zoreil.com> In-Reply-To: <20031127235143.A16767@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1758 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brad@mcve.com Precedence: bulk X-list: netdev Just wanted to check and make sure you got my e-mail about r8169-start-xmit-fixes.patch being the culprit to the hardlocks. -Brad Francois Romieu wrote: > Even more Brad/Realtek's merging. > > Applies on top of: > 2.6.0-test11 > + 2.6.0-test9-bk25-netdrvr-exp1 > + r8169-mac-phy-version > + r8169-init_one > > -- > Ueimor > > > ------------------------------------------------------------------------ > > > Merge of timer related changes from Realtek: > - changed their timeout value from 100 to HZ to trigger rtl8169_phy_timer(); > - s/TX_TIMEOUT/RTL8169_TX_TIMEOUT/ to have RTL8169_{TX/PHY}_TIMEOUT. > > > drivers/net/r8169.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 files changed, 92 insertions(+), 2 deletions(-) > > diff -puN drivers/net/r8169.c~r8169-timer drivers/net/r8169.c > --- linux-2.6.0-test11/drivers/net/r8169.c~r8169-timer 2003-11-27 22:14:24.000000000 +0100 > +++ linux-2.6.0-test11-fr/drivers/net/r8169.c 2003-11-27 23:50:41.000000000 +0100 > @@ -95,7 +95,8 @@ static int multicast_filter_limit = 32; > #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) > > #define RTL_MIN_IO_SIZE 0x80 > -#define TX_TIMEOUT (6*HZ) > +#define RTL8169_TX_TIMEOUT (6*HZ) > +#define RTL8169_PHY_TIMEOUT (HZ) > > /* write/read MMIO register */ > #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) > @@ -311,6 +312,8 @@ struct rtl8169_private { > dma_addr_t RxPhyAddr; > struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ > struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ > + struct timer_list timer; > + unsigned long phy_link_down_cnt; > }; > > MODULE_AUTHOR("Realtek"); > @@ -540,6 +543,90 @@ static void rtl8169_hw_phy_config(struct > mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 > } > > +static void rtl8169_hw_phy_reset(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + void *ioaddr = tp->mmio_addr; > + int i, val; > + > + printk(KERN_WARNING PFX "%s: Reset RTL8169s PHY\n", dev->name); > + > + val = (mdio_read(ioaddr, 0) | 0x8000) & 0xffff; > + mdio_write(ioaddr, 0, val); > + > + for (i = 50; i >= 0; i--) { > + if (!(mdio_read(ioaddr, 0) & 0x8000)) > + break; > + udelay(100); /* Gross */ > + } > + > + if (i < 0) { > + printk(KERN_WARNING PFX "%s: no PHY Reset ack. Giving up.\n", > + dev->name); > + } > +} > + > +static void rtl8169_phy_timer(unsigned long __opaque) > +{ > + struct net_device *dev = (struct net_device *)__opaque; > + struct rtl8169_private *tp = dev->priv; > + struct timer_list *timer = &tp->timer; > + void *ioaddr = tp->mmio_addr; > + > + assert(tp->mac_version > RTL_GIGA_MAC_VER_B); > + assert(tp->phy_version < RTL_GIGA_PHY_VER_G); > + > + if (RTL_R8(PHYstatus) & LinkStatus) > + tp->phy_link_down_cnt = 0; > + else { > + tp->phy_link_down_cnt++; > + if (tp->phy_link_down_cnt >= 12) { > + int reg; > + > + // If link on 1000, perform phy reset. > + reg = mdio_read(ioaddr, PHY_1000_CTRL_REG); > + if (reg & PHY_Cap_1000_Full) > + rtl8169_hw_phy_reset(dev); > + > + tp->phy_link_down_cnt = 0; > + } > + } > + > + mod_timer(timer, RTL8169_PHY_TIMEOUT); > +} > + > +static inline void rtl8169_delete_timer(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + struct timer_list *timer = &tp->timer; > + > + if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || > + (tp->phy_version >= RTL_GIGA_PHY_VER_G)) > + return; > + > + del_timer_sync(timer); > + > + tp->phy_link_down_cnt = 0; > +} > + > +static inline void rtl8169_request_timer(struct net_device *dev) > +{ > + struct rtl8169_private *tp = dev->priv; > + struct timer_list *timer = &tp->timer; > + > + if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || > + (tp->phy_version >= RTL_GIGA_PHY_VER_G)) > + return; > + > + tp->phy_link_down_cnt = 0; > + > + init_timer(timer); > + timer->expires = jiffies + RTL8169_PHY_TIMEOUT; > + timer->data = (unsigned long)(dev); > + timer->function = rtl8169_phy_timer; > + add_timer(timer); > +} > + > static int __devinit > rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, > void **ioaddr_out) > @@ -691,7 +778,7 @@ rtl8169_init_one(struct pci_dev *pdev, c > dev->stop = rtl8169_close; > dev->tx_timeout = rtl8169_tx_timeout; > dev->set_multicast_list = rtl8169_set_rx_mode; > - dev->watchdog_timeo = TX_TIMEOUT; > + dev->watchdog_timeo = RTL8169_TX_TIMEOUT; > dev->irq = pdev->irq; > dev->base_addr = (unsigned long) ioaddr; > // dev->do_ioctl = mii_ioctl; > @@ -892,6 +979,7 @@ rtl8169_open(struct net_device *dev) > > rtl8169_hw_start(dev); > > + rtl8169_request_timer(dev); > out: > return retval; > > @@ -1385,6 +1473,8 @@ rtl8169_close(struct net_device *dev) > > netif_stop_queue(dev); > > + rtl8169_delete_timer(dev); > + > spin_lock_irq(&tp->lock); > > /* Stop the chip's Tx and Rx DMA processes. */ > > _ From gandalf@netfilter.org Fri Nov 28 11:07:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 11:07:14 -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.9) with SMTP id hASJ6xTa002835 for ; Fri, 28 Nov 2003 11:07:00 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id 5300B2C0013; Fri, 28 Nov 2003 20:06:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id EF82E2C0014; Fri, 28 Nov 2003 20:06:55 +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 24342-01; Fri, 28 Nov 2003 20:06:55 +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 4493F2C0013; Fri, 28 Nov 2003 20:06:55 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id 1AD763F8E; Fri, 28 Nov 2003 20:06:55 +0100 (CET) Subject: [PATCH 2.6] Netfilter: Sane ip_ct_tcp_timeout_close_wait value From: Martin Josefsson To: "David S. Miller" Cc: Harald Welte , Netfilter-devel , netdev@oss.sgi.com Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Z8Pz66szwxPS3LCKFoY/" Message-Id: <1070046413.18456.23.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 28 Nov 2003 20:06:54 +0100 X-Virus-Scanned: by amavisd-new-20030616-p5 X-archive-position: 1759 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@netfilter.org Precedence: bulk X-list: netdev --=-Z8Pz66szwxPS3LCKFoY/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Dave. Harald submitted this to you for 2.4.23 It's needed for 2.6 as well, couldn't find the original mail on any list so here's the bk-commits-24 mail (slightly edited) It applies fine to -test11. It's needed before 2.6.0 is out. ChangeSet 1.1211, 2003/11/17 15:26:43-02:00, laforge@netfilter.org [PATCH] Netfilter: Sane ip_ct_tcp_timeout_close_wait value =09 Hi Dave, hi Marcelo. =09 The following (trivial) patch _needs_ to go into 2.4.22-preX before 2.4.23 is released. =09 While doing the backport of the tune-conntrack-timeouts-via-procfs patch, we have made the default for the CLOSE_WAIT state accidentially to 3 days. 3 days are the timeout when using the tcp window tracking patch, but not for the stock kernel. =09 Please apply, thanks. diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilte= r/ip_conntrack_proto_tcp.c --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c Mon Nov 17 10:02:36 2003 +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c Mon Nov 17 10:02:36 2003 @@ -53,7 +53,7 @@ unsigned long ip_ct_tcp_timeout_syn_recv =3D 60 SECS; unsigned long ip_ct_tcp_timeout_established =3D 5 DAYS; unsigned long ip_ct_tcp_timeout_fin_wait =3D 2 MINS; -unsigned long ip_ct_tcp_timeout_close_wait =3D 3 DAYS; +unsigned long ip_ct_tcp_timeout_close_wait =3D 60 SECS; unsigned long ip_ct_tcp_timeout_last_ack =3D 30 SECS; unsigned long ip_ct_tcp_timeout_time_wait =3D 2 MINS; unsigned long ip_ct_tcp_timeout_close =3D 10 SECS; --=20 /Martin --=-Z8Pz66szwxPS3LCKFoY/ 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/x5zNWm2vlfa207ERAowZAJ0RzFCCL/KVaLrTCukkkSWBkkWA6gCguYUN Qrv0yjWDTKlfxP+ErcQ75jc= =HKdP -----END PGP SIGNATURE----- --=-Z8Pz66szwxPS3LCKFoY/-- From zwane@arm.linux.org.uk Fri Nov 28 22:49:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Nov 2003 22:49:51 -0800 (PST) Received: from montezuma.fsmlabs.com (modemcable067.88-70-69.mc.videotron.ca [69.70.88.67]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAT6nbTa003246 for ; Fri, 28 Nov 2003 22:49:37 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by montezuma.fsmlabs.com (8.12.8/8.12.8) with ESMTP id hAT6mQfN001714; Sat, 29 Nov 2003 01:48:26 -0500 Date: Sat, 29 Nov 2003 01:48:26 -0500 (EST) From: Zwane Mwaikambo To: Linux Kernel cc: netdev@oss.sgi.com Subject: [PATCH][2.6] e100_phy.c uses free'd .text after init Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zwane@arm.linux.org.uk Precedence: bulk X-list: netdev This was causing an oops when using mii-tool due to the .text being free'd after initialisation. Unable to handle kernel paging request at virtual address 0000f6b6 printing eip: c064e997 *pde = 00000000 Oops: 0002 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010296 EIP is at e100_phy_init+0x1/0x80 eax: 00000001 ebx: f7b6b200 ecx: c05ab020 edx: f7b6b200 esi: bffff64d edi: e4ec5d98 ebp: f7b6b000 esp: e4ec5d68 ds: 007b es: 007b ss: 0068 Process ethtool (pid: 846, threadinfo=e4ec4000 task=e97ac6b0) Stack: c0385415 f7b6b200 c038506b f7b6b200 f7b6b000 00000000 c0387e8b f7b6b200 bffff620 0000002c f7b6b200 e4ec5d9a 00000002 000002cf 000000cf 00010064 00010001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 Call Trace: [] e100_hw_init+0x13/0x11d [] e100_close+0x66/0x7a [] e100_ethtool_set_settings+0xf1/0x17e [] e100_do_ethtool_ioctl+0xc9/0x6d7 [] update_wall_time+0xd/0x36 [] do_timer+0xc0/0xc5 [] timer_interrupt+0x62/0x11b [] find_get_page+0x28/0x3c [] filemap_nopage+0x23b/0x31a [] do_no_page+0x1a8/0x36f [] vsnprintf+0x21a/0x47e [] handle_mm_fault+0xf7/0x162 [] dev_ethtool+0x2cc/0x2d2 [] dev_ioctl+0x16e/0x2cf [] inet_ioctl+0xf4/0x104 [] sock_ioctl+0xe5/0x286 [] sys_ioctl+0x118/0x294 [] do_page_fault+0x0/0x51b [] sysenter_past_esp+0x52/0x71 Code: 67 20 64 69 73 63 6c 61 69 6d 65 72 20 69 6e 20 74 68 65 0d Index: linux-2.6.0-test11/drivers/net/e100/e100_phy.c =================================================================== RCS file: /build/cvsroot/linux-2.6.0-test11/drivers/net/e100/e100_phy.c,v retrieving revision 1.1.1.1 diff -u -p -B -r1.1.1.1 e100_phy.c --- linux-2.6.0-test11/drivers/net/e100/e100_phy.c 28 Nov 2003 18:03:05 -0000 1.1.1.1 +++ linux-2.6.0-test11/drivers/net/e100/e100_phy.c 29 Nov 2003 05:39:53 -0000 @@ -132,7 +132,7 @@ e100_mdi_read(struct e100_private *bdp, } } -static unsigned char __devinit +static unsigned char e100_phy_valid(struct e100_private *bdp, unsigned int phy_address) { u16 ctrl_reg, stat_reg; @@ -150,7 +150,7 @@ e100_phy_valid(struct e100_private *bdp, return true; } -static void __devinit +static void e100_phy_address_detect(struct e100_private *bdp) { unsigned int addr; @@ -180,7 +180,7 @@ e100_phy_address_detect(struct e100_priv } } -static void __devinit +static void e100_phy_id_detect(struct e100_private *bdp) { u16 low_id_reg, high_id_reg; @@ -204,7 +204,7 @@ e100_phy_id_detect(struct e100_private * ((unsigned int) high_id_reg << 16)); } -static void __devinit +static void e100_phy_isolate(struct e100_private *bdp) { unsigned int phy_address; @@ -227,7 +227,7 @@ e100_phy_isolate(struct e100_private *bd } } -static unsigned char __devinit +static unsigned char e100_phy_specific_setup(struct e100_private *bdp) { u16 misc_reg; @@ -380,7 +380,7 @@ e100_phy_fix_squelch(struct e100_private * Returns: * NOTHING */ -static void __devinit +static void e100_fix_polarity(struct e100_private *bdp) { u16 status; @@ -916,7 +916,7 @@ e100_phy_reset(struct e100_private *bdp) schedule_timeout(HZ / 2); } -unsigned char __devinit +unsigned char e100_phy_init(struct e100_private *bdp) { e100_phy_reset(bdp); From anand@eis.iisc.ernet.in Sat Nov 29 01:44:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 01:44:40 -0800 (PST) Received: from iisc.ernet.in (iisc.ernet.in [144.16.64.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAT9iHTa021278 for ; Sat, 29 Nov 2003 01:44:20 -0800 Received: from eis.iisc.ernet.in (eis.iisc.ernet.in [144.16.64.5]) by iisc.ernet.in (8.11.6/8.11.6) with SMTP id hAT9mHx03607; Sat, 29 Nov 2003 15:18:17 +0530 Received: by eis.iisc.ernet.in (SMI-8.6/SMI-4.1) id PAA27304; Sat, 29 Nov 2003 15:14:08 +0530 From: anand@eis.iisc.ernet.in (SVR Anand) Message-Id: <200311290944.PAA27304@eis.iisc.ernet.in> Subject: Bridging woes after 3 days To: davem@redhat.com (David S. Miller) Date: Sat, 29 Nov 2003 15:14:08 +0530 (GMT+05:30) Cc: netdev@oss.sgi.com In-Reply-To: <20031123152601.67646dc1.davem@redhat.com> from "David S. Miller" at Nov 23, 2003 03:26:01 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 1761 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anand@eis.iisc.ernet.in Precedence: bulk X-list: netdev Hi, After a continous run for 3 days the bridge came down crashing with the following kernel panic screen dump. The kernel is 2.6.0-test9-bk25 with kernel preemption disabled. The following call stack is what I have seen on the console. The ethernet cards are RTL8139. Please let me know if you want more information or finer debugging method, I will pass it on when the bridge fails the next time. When it worked it really worked. Anand ---------------------------------------------------------------------------- nf_hook_slow br_nf_pre_routing_finish br_nf_pre_routing br_nf_pre_finish nf_iterate br_handle_frame_finish nf_hook_slow br_handle_frame_finish br_handle_frame br_handle_frame_finish netif_recieve_skb process_backlog net_rx_action do_selfirq do_IRQ common_interrupt default_idle default_idle cpu_idle printk code: 8b 40 18 85 c0 75 7f 85 ff 74 44 89 7b 70 0f ba 6b 40 00 89 <0> kernel panic : Fatal exception in interrupt In interrupt handles - not syncing ---------------------------------------------------------------------------- From ronnie_sahlberg@ozemail.com.au Sat Nov 29 01:02:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 04:16:51 -0800 (PST) Received: from smta00.mail.ozemail.net (smta00.mail.ozemail.net [203.103.165.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAT92VTa020948 for ; Sat, 29 Nov 2003 01:02:34 -0800 Received: from C5043436 ([203.102.163.176]) by smta00.mail.ozemail.net with SMTP id <20031129090143.CGRK21896.smta00.mail.ozemail.net@C5043436> for ; Sat, 29 Nov 2003 09:01:43 +0000 Message-ID: <010801c3b657$e3093fb0$6501010a@C5043436> From: "Ronnie Sahlberg" To: Subject: TCP retransmission timers, questions Date: Sat, 29 Nov 2003 20:05:08 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 1762 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: ronnie_sahlberg@ozemail.com.au Precedence: bulk X-list: netdev Hi list, hope this mail arrives (Im not subscribe to the list, but dont worry, I read the list through the mailarchive) By looking at the kernel sources it seems that the minimum TCP retransmission timeout is hardcoded to 200ms. Is this correct? While I understand why it is important to not be too aggressive in retransmitting I wounder if it would be possible to get and interface in proc where one could "tune" this. The reason for this is that in some applications you do have a completely private, dedicated network used for one specific application. Those networks can be dimensioned so that congestion "should" not occur. However, packets are lost from time to time and sometimes packets will be lost. In those isolated dedicated subnets, with end to end network latency in the sub ms range, would it not be useful to be able to allow the retransmission timeout to drop down to 5-10ms? Do anyone know of any work/research in the area of tcp retransmission timeouts for very high bandwidth, low latency networks? I have checked both the IETF list of drafts, Sally Floyds pages and google but could not find anything. It seems to me that all research/experimentation in high throughput is for high bandwidth high latency links and tuning the slowstart/congestion avoidance algorithms. What about high throughput, very low latency? Does nayone know of any papers in that area? For specific applications, running on completely isolated dedicated networks, dimensioned to make congestion unlikely, isolated so it will NEVER compete about bandwidth with normal TCPs on the internet, to me it would make sense to allow the retransmission timeout to be allowed to drop significantly below 200ms. Another question, I think it was RFC2988 (but an not find it again) that discussed that a TCP may add an artificial delay in sending the packets based on the RTT so that when sending an entire window the packets are spaced equidistantly across the RTT interval instead of in just one big burst. This to prevent the burstinessd of the traffic and make buffer overruns/congestion less likely. I have seen indications that w2k/bsd might in some conditions do this. Doe Linux do this? my search through the sources came up with nothing. Does anyone know whether there are other TCPs that do this? As i said I have seen something that looked like that on a BSD stack but it could have been related to something else. best regards ronnie From herbert@gondor.apana.org.au Sat Nov 29 14:06:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 14:06:54 -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.9) with SMTP id hATM6YTa013563 for ; Sat, 29 Nov 2003 14:06:36 -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 1AQDEP-0007BH-00; Sun, 30 Nov 2003 09:06:25 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AQDEN-0002v9-00; Sun, 30 Nov 2003 09:06:23 +1100 Date: Sun, 30 Nov 2003 09:06:23 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [SCTP] Fix incestuous header relations Message-ID: <20031129220623.GA11019@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1763 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 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch fixes the sm.h + sctp.h inclusion loop by including sm.h only in the files that need 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 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: kernel-source-2.5/include/net/sctp/sctp.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/net/sctp/sctp.h,v retrieving revision 1.1.1.13 diff -u -r1.1.1.13 sctp.h --- kernel-source-2.5/include/net/sctp/sctp.h 8 Oct 2003 19:24:03 -0000 1.1.1.13 +++ kernel-source-2.5/include/net/sctp/sctp.h 29 Nov 2003 21:49:45 -0000 @@ -90,7 +90,6 @@ #include #include #include -#include /* Set SCTP_DEBUG flag via config if not already set. */ Index: kernel-source-2.5/net/sctp/associola.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/sctp/associola.c,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 associola.c --- kernel-source-2.5/net/sctp/associola.c 8 Oct 2003 19:24:01 -0000 1.1.1.14 +++ kernel-source-2.5/net/sctp/associola.c 29 Nov 2003 21:49:54 -0000 @@ -58,6 +58,7 @@ #include #include #include +#include /* Forward declarations for internal functions. */ static void sctp_assoc_bh_rcv(struct sctp_association *asoc); Index: kernel-source-2.5/net/sctp/outqueue.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/sctp/outqueue.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 outqueue.c --- kernel-source-2.5/net/sctp/outqueue.c 27 Jul 2003 17:00:11 -0000 1.1.1.10 +++ kernel-source-2.5/net/sctp/outqueue.c 29 Nov 2003 21:56:18 -0000 @@ -53,6 +53,7 @@ #include /* For skb_set_owner_w */ #include +#include /* Declare internal functions here. */ static int sctp_acked(struct sctp_sackhdr *sack, __u32 tsn); Index: kernel-source-2.5/net/sctp/socket.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/sctp/socket.c,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 socket.c --- kernel-source-2.5/net/sctp/socket.c 8 Oct 2003 19:24:53 -0000 1.1.1.14 +++ kernel-source-2.5/net/sctp/socket.c 29 Nov 2003 22:02:02 -0000 @@ -77,6 +77,7 @@ #include /* for sa_family_t */ #include #include +#include /* WARNING: Please do not remove the SCTP_STATIC attribute to * any of the functions below as they are used to export functions Index: kernel-source-2.5/net/sctp/transport.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/sctp/transport.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 transport.c --- kernel-source-2.5/net/sctp/transport.c 27 Jul 2003 16:57:51 -0000 1.1.1.8 +++ kernel-source-2.5/net/sctp/transport.c 29 Nov 2003 21:57:55 -0000 @@ -50,6 +50,7 @@ #include #include +#include /* 1st Level Abstractions. */ --5mCyUwZo2JvN/JJP-- From davem@pizda.ninka.net Sat Nov 29 14:09:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 14:10:04 -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.9) with SMTP id hATM9pTa013927 for ; Sat, 29 Nov 2003 14:09:51 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA15695; Sat, 29 Nov 2003 14:09:19 -0800 Date: Sat, 29 Nov 2003 14:09:19 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [SCTP] Fix incestuous header relations Message-Id: <20031129140919.5bd9e73a.davem@redhat.com> In-Reply-To: <20031129220623.GA11019@gondor.apana.org.au> References: <20031129220623.GA11019@gondor.apana.org.au> 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: 1764 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, 30 Nov 2003 09:06:23 +1100 Herbert Xu wrote: > This patch fixes the sm.h + sctp.h inclusion loop by including sm.h only > in the files that need it. Thanks. I think 2.4.x has the same problem, could you cook me up a patch for there too? From herbert@gondor.apana.org.au Sat Nov 29 14:10:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 14:10:58 -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.9) with SMTP id hATMAhTa014207 for ; Sat, 29 Nov 2003 14:10:44 -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 1AQDIS-0007Cy-00; Sun, 30 Nov 2003 09:10:36 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1AQDIR-0002wK-00; Sun, 30 Nov 2003 09:10:35 +1100 Date: Sun, 30 Nov 2003 09:10:35 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [SCTP] Fix incestuous header relations Message-ID: <20031129221035.GA11291@gondor.apana.org.au> References: <20031129220623.GA11019@gondor.apana.org.au> <20031129140919.5bd9e73a.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031129140919.5bd9e73a.davem@redhat.com> User-Agent: Mutt/1.5.4i From: Herbert Xu X-archive-position: 1765 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 On Sat, Nov 29, 2003 at 02:09:19PM -0800, David S. Miller wrote: > > I think 2.4.x has the same problem, could you cook me up a patch > for there too? The same patch worked for me. -- 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 From anton@samba.org Sat Nov 29 15:17:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 15:17:27 -0800 (PST) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hATNHATa015284 for ; Sat, 29 Nov 2003 15:17:12 -0800 Received: by lists.samba.org (Postfix, from userid 504) id 7ED252C0F5; Sat, 29 Nov 2003 23:17:09 +0000 (GMT) Date: Sun, 30 Nov 2003 09:35:52 +1100 From: Anton Blanchard To: Zwane Mwaikambo Cc: Linux Kernel , netdev@oss.sgi.com Subject: Re: [PATCH][2.6] e100_phy.c uses free'd .text after init Message-ID: <20031129223552.GA24362@krispykreme> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-archive-position: 1766 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anton@samba.org Precedence: bulk X-list: netdev Hi Zwane, > This was causing an oops when using mii-tool due to the .text being free'd > after initialisation. We stumbled across this a few weeks ago, Jeff's BK tree should have a fix. Anton From romieu@fr.zoreil.com Sat Nov 29 16:53:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 16:54:10 -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.9) with SMTP id hAU0rtTa019714 for ; Sat, 29 Nov 2003 16:53:56 -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 hAU0leK7003900; Sun, 30 Nov 2003 01:47:40 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hAU0ldR6003899; Sun, 30 Nov 2003 01:47:39 +0100 Date: Sun, 30 Nov 2003 01:47:38 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik , brad_mssw@gentoo.org Subject: Re: [PATCH] 2.6.0-test11-bk27-netdrvr-exp1 - r8169 update Message-ID: <20031130014738.A2589@electric-eye.fr.zoreil.com> References: <20031122183001.GA16993@gtf.org> <20031124000939.A456@electric-eye.fr.zoreil.com> <20031126004550.A25408@electric-eye.fr.zoreil.com> <20031127235143.A16767@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20031127235143.A16767@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Thu, Nov 27, 2003 at 11:51:43PM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 1767 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 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hopefully last round of Brad/Realtek's merging. Patches apply in this order: 1 - r8169-hw_start.patch 2 - r8169-missing-tx-stats.patch 3 - r8169-intr_mask.patch on top of: 2.6.0-test11 + 2.6.0-test9-bk25-netdrvr-exp1 + r8169-mac-phy-version + r8169-init_one + r8169-timer The unconditional calls to rtl8169_{rx/tx}_interrupt in rtl8169_interrupt() are not integrated. That should not make a huge difference. -- Ueimor --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-hw_start.patch" Merge of changes from Realtek: - register voodoo in rtl8169_hw_start(). drivers/net/r8169.c | 6 ++++++ 1 files changed, 6 insertions(+) diff -puN drivers/net/r8169.c~r8169-hw_start drivers/net/r8169.c --- linux-2.6.0-test11/drivers/net/r8169.c~r8169-hw_start 2003-11-29 20:36:12.000000000 +0100 +++ linux-2.6.0-test11-fr/drivers/net/r8169.c 2003-11-29 20:44:17.000000000 +0100 @@ -1028,6 +1028,12 @@ rtl8169_hw_start(struct net_device *dev) RTL_W32(TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift)); + RTL_W16(CPlusCmd, RTL_R16(CPlusCmd)); + + if (tp->mac_version == RTL_GIGA_MAC_VER_D) { + dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n"); + RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3)); + } tp->cur_rx = 0; _ --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-missing-tx-stats.patch" Driver forgot to update the transmitted bytes counter. Originally done in rtl8169_start_xmit() by Realtek. drivers/net/r8169.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) diff -puN drivers/net/r8169.c~r8169-missing-tx-stats drivers/net/r8169.c --- linux-2.6.0-test11/drivers/net/r8169.c~r8169-missing-tx-stats 2003-11-29 22:34:10.000000000 +0100 +++ linux-2.6.0-test11-fr/drivers/net/r8169.c 2003-11-30 00:26:09.000000000 +0100 @@ -1303,10 +1303,13 @@ rtl8169_tx_interrupt(struct net_device * int cur = dirty_tx % NUM_TX_DESC; struct sk_buff *skb = tp->Tx_skbuff[cur]; + /* FIXME: is it really accurate for TxErr ? */ + tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? + skb->len : ETH_ZLEN; + tp->stats.tx_packets++; rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + cur, tp->TxDescArray + cur); dev_kfree_skb_irq(skb); - tp->stats.tx_packets++; dirty_tx++; tx_left--; entry++; _ --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-intr_mask.patch" drivers/net/r8169.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff -puN drivers/net/r8169.c~r8169-intr_mask drivers/net/r8169.c --- linux-2.6.0-test11/drivers/net/r8169.c~r8169-intr_mask 2003-11-30 01:16:48.000000000 +0100 +++ linux-2.6.0-test11-fr/drivers/net/r8169.c 2003-11-30 01:18:22.000000000 +0100 @@ -334,8 +334,7 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static const u16 rtl8169_intr_mask = - SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | - RxErr | RxOK; + RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); @@ -1445,9 +1444,7 @@ rtl8169_interrupt(int irq, void *dev_ins RTL_W16(IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status); - if ((status & - (SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver - | TxErr | TxOK | RxErr | RxOK)) == 0) + if (!(status & rtl8169_intr_mask)) break; // Rx interrupt _ --u3/rZRmxL6MmkK24-- From davem@pizda.ninka.net Sat Nov 29 20:28:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 20:28: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.9) with SMTP id hAU4SYTa024627 for ; Sat, 29 Nov 2003 20:28:35 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16137; Sat, 29 Nov 2003 20:27:55 -0800 Date: Sat, 29 Nov 2003 20:27:55 -0800 From: "David S. Miller" To: Herbert Xu Cc: kuznet@ms2.inr.ac.ru, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [XFRM] Handle device down/unregister events Message-Id: <20031129202755.292602a6.davem@redhat.com> In-Reply-To: <20031127105907.GA13047@gondor.apana.org.au> References: <20031126044355.GA18805@gondor.apana.org.au> <20031125222059.6730f242.davem@redhat.com> <20031127105907.GA13047@gondor.apana.org.au> 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: 1768 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, 27 Nov 2003 21:59:07 +1100 Herbert Xu wrote: > Here is an updated patch that checks whether a dst is still valid > before adding it to a bundle. Applied. I had already applied your previous patch, so it would have been nice to have a relative patch, please do this next time. Thanks. From davem@pizda.ninka.net Sat Nov 29 20:48:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 20:48:47 -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.9) with SMTP id hAU4mYTa025071 for ; Sat, 29 Nov 2003 20:48:34 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16225; Sat, 29 Nov 2003 20:47:01 -0800 Date: Sat, 29 Nov 2003 20:47:01 -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: <20031129204701.37a06847.davem@redhat.com> In-Reply-To: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> <20031127.193910.96333709.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=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAU4mYTa025071 X-archive-position: 1769 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, 28 Nov 2003 12:34:12 +0200 (EET) Ville Nuorvala wrote: > On Thu, 27 Nov 2003, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > > > In article (at Thu, 27 Nov 2003 12:31:58 +0200 (EET)), Ville Nuorvala says: > > > > > here is a new version. I made some other minor changes to it too. > > > > looks fine. > > --yoshfuji > > Hi Dave, Yoshifuji-san is now ok with this patch :) Would you apply it? I thought some more about this and I am realizing this is not a pure bug fix, I am very sure Linus will not take the change. We can hold onto this until 2.6.1, ok? From greearb@candelatech.com Sat Nov 29 23:08:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Nov 2003 23:09:09 -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.9) with SMTP id hAU78rTa026642 for ; Sat, 29 Nov 2003 23:08:54 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAU78bKt027596; Sat, 29 Nov 2003 23:08:39 -0800 Message-ID: <3FC99775.5020300@candelatech.com> Date: Sat, 29 Nov 2003 23:08:37 -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'" , "Feldman, Scott" Subject: Problems with e1000 in 2.4.23 Content-Type: multipart/mixed; boundary="------------090505070403080406040904" X-archive-position: 1770 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. --------------090505070403080406040904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I just started doing some testing on 2.4.23 with a dual-port Intel NIC. I have seen several crashes and reproducible 'TX watchdog timeout' messages when connecting an e1000 port to both an e100 on the same machine and to a tulip on another machine... I did not see problems when passing traffic between the two e1000 ports, so the tx-timeout issue seems confined to e1000 -> 100bt. I'm running on a dual-amd box which has had issues in the past, but a bios update seems to have fixed it's pci-routing issues. Also, I am running some personal networking patches. That said, I have not seen any of these issues on 2.4.23-pre9 (+ my patches), and I saw the same problems on 2.4.23 both with my patched e1000 and with an unpatched e1000. Attached is an oops that did not hang the machine. The hard hang looked like memory corruption (a few of the registers were 0x15141312, and the payload of the packets I was sending was incrementing bytes, ie 0x010203040506...). I'll crank up the serial console and see if I can capture some of the hard crashes... The lspci and dmesg files are from a 2.4.23-pre9 boot. As usual, it could all be my fault, so I'd like to hear if anyone can confirm or deny the e1000 -> 100bt issue. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com --------------090505070403080406040904 Content-Type: text/plain; name="e1000_dump.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="e1000_dump.txt" ksymoops 2.4.5 on i686 2.4.23. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.4.23/ (default) -m /boot/System.map-2.4.23 (default) Warning: You did not tell me where to find symbol information. I will assume that the log matches the kernel and modules that are running right now and I'll use the default options above for symbol resolution. If the current kernel and/or modules do not match the log, you can get more accurate output by telling me the kernel version and where to find map, modules, ksyms etc. ksymoops -h explains the options. Error (expand_objects): cannot stat(/lib/ext3.o) for ext3 Error (expand_objects): cannot stat(/lib/jbd.o) for jbd Warning (map_ksym_to_module): cannot match loaded module ext3 to a unique module object. Trace may not be reliable. Nov 29 22:22:17 athlon2 kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000007 Nov 29 22:22:17 athlon2 kernel: c01f0d5a Nov 29 22:22:17 athlon2 kernel: *pde = 00000000 Nov 29 22:22:17 athlon2 kernel: Oops: 0002 Nov 29 22:22:17 athlon2 kernel: CPU: 1 Nov 29 22:22:17 athlon2 kernel: EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 Nov 29 22:22:17 athlon2 kernel: EFLAGS: 00010206 Nov 29 22:22:17 athlon2 kernel: eax: 00000003 ebx: d620d9c0 ecx: dfeb9690 edx: d620d9c0 Nov 29 22:22:17 athlon2 kernel: esi: dba46a50 edi: d83c0000 ebp: 00002e68 esp: d4e23e9c Nov 29 22:22:17 athlon2 kernel: ds: 0018 es: 0018 ss: 0018 Nov 29 22:22:17 athlon2 kernel: Process ip (pid: 3963, stackpage=d4e23000) Nov 29 22:22:17 athlon2 kernel: Stack: d620d900 00000000 00000030 Nov 29 22:22:17 athlon2 kernel: d83c2e68 e0912333 d620d9c0 00001042 00000000 Nov 29 22:22:17 athlon2 kernel: 000001ef Nov 29 22:22:17 athlon2 kernel: dba46980 00001003 00001042 00000000 e0911af6 dba46980 dba46800 Nov 29 22:22:17 athlon2 kernel: c01f4d87 dba46800 00000009 dba46800 dba46800 00001003 Nov 29 22:22:17 athlon2 kernel: c01f62d9 dba46800 Nov 29 22:22:17 athlon2 kernel: Call Trace: [] [] Nov 29 22:22:17 athlon2 kernel: [] [] [] Nov 29 22:22:17 athlon2 kernel: [] [] Nov 29 22:22:17 athlon2 kernel: [] [] [] Nov 29 22:22:17 athlon2 kernel: Code: f0 ff 48 04 >>EIP; c01f0d5a <__kfree_skb+1a/170> <===== >>ebx; d620d9c0 <_end+15ebad88/204ba448> >>ecx; dfeb9690 <_end+1fb66a58/204ba448> >>edx; d620d9c0 <_end+15ebad88/204ba448> >>esi; dba46a50 <_end+1b6f3e18/204ba448> >>edi; d83c0000 <_end+1806d3c8/204ba448> >>ebp; 00002e68 Before first symbol >>esp; d4e23e9c <_end+14ad1264/204ba448> Trace; e0912333 <[e1000]e1000_clean_rx_ring+53/110> Trace; e0911af6 <[e1000]e1000_close+16/30> Trace; c01f4d87 Trace; c01f62d9 Trace; c01f482e Trace; c02367d0 Trace; c01ed3e0 Trace; c01ed420 Trace; c0155540 Trace; c01091ff Code; c01f0d5a <__kfree_skb+1a/170> 00000000 <_EIP>: Code; c01f0d5a <__kfree_skb+1a/170> 0: f0 ff 48 04 lock decl 0x4(%eax) 2 warnings and 2 errors issued. Results may not be reliable. --------------090505070403080406040904 Content-Type: text/plain; name="amd_lspci.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="amd_lspci.txt" 00:00.0 Host bridge: Advanced Micro Devices [AMD] AMD-760 MP [IGD4-2P] System Controller (rev 11) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- 00:01.0 PCI bridge: Advanced Micro Devices [AMD] AMD-760 MP [IGD4-2P] AGP Bridge (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- 00:07.0 ISA bridge: Advanced Micro Devices [AMD] AMD-768 [Opus] ISA (rev 05) 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- Reset- FastB2B- Capabilities: [dc] Power Management version 1 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Bridge: PM- B3+ 00:10.0 PCI bridge: Advanced Micro Devices [AMD] AMD-768 [Opus] PCI (rev 05) (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- 02:00.0 Ethernet controller: Intel Corp. 82559ER (rev 10) Subsystem: Ramix Inc: Unknown device 0610 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- [disabled] [size=128K] Capabilities: [5c] 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- 03:08.0 Ethernet controller: 3Com Corporation 3c980-TX 10/100baseTX NIC [Python-T] (rev 78) Subsystem: Tyan Computer Thunder K7 S2462 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- [disabled] [size=128K] 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- 03:09.0 Ethernet controller: 3Com Corporation 3c980-TX 10/100baseTX NIC [Python-T] (rev 78) Subsystem: Tyan Computer Thunder K7 S2462 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- [disabled] [size=128K] 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- --------------090505070403080406040904 Content-Type: text/plain; name="amd_dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="amd_dmesg.txt" Linux version 2.4.23-pre9 (greear@grok.yi.org) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #28 SMP Thu Nov 20 00:31:38 PST 2003 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ca000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001fef0000 (usable) BIOS-e820: 000000001fef0000 - 000000001fef6000 (ACPI data) BIOS-e820: 000000001fef6000 - 000000001ff00000 (ACPI NVS) BIOS-e820: 000000001ff00000 - 000000001ff80000 (usable) BIOS-e820: 000000001ff80000 - 0000000020000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec04000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved) BIOS-e820: 00000000fff80000 - 0000000100000000 (reserved) 511MB LOWMEM available. found SMP MP-table at 000f7110 hm, page 000f7000 reserved twice. hm, page 000f8000 reserved twice. hm, page 0009f000 reserved twice. hm, page 000a0000 reserved twice. On node 0 totalpages: 130944 zone(0): 4096 pages. zone(1): 126848 pages. zone(2): 0 pages. ACPI: RSDP (v000 PTLTD ) @ 0x000f70a0 ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) @ 0x1fef3f4a ACPI: FADT (v001 AMD TECATE 0x06040000 PTL 0x000f4240) @ 0x1fef5f2e ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x1fef5fa2 ACPI: DSDT (v001 AMD AMDACPI 0x06040000 MSFT 0x0100000d) @ 0x00000000 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x01] enabled) Processor #1 Pentium(tm) Pro APIC version 16 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) Processor #0 Pentium(tm) Pro APIC version 16 ACPI: LAPIC_NMI (acpi_id[0x00] polarity[0x1] trigger[0x1] lint[0x1]) ACPI: LAPIC_NMI (acpi_id[0x01] polarity[0x1] trigger[0x1] lint[0x1]) Using ACPI for processor (LAPIC) configuration information Intel MultiProcessor Specification v1.4 Virtual Wire compatibility mode. OEM ID: TYAN Product ID: PAULANER APIC at: 0xFEE00000 I/O APIC #2 Version 17 at 0xFEC00000. Enabling APIC mode: Flat. Using 1 I/O APICs Processors: 2 Kernel command line: ro root=/dev/hda2 console=ttyS0,38400 console=tty0 Initializing CPU#0 Detected 1666.731 MHz processor. Console: colour VGA+ 80x25 Calibrating delay loop... 3329.22 BogoMIPS Memory: 515108k/523776k available (1407k kernel code, 8216k reserved, 524k data, 152k init, 0k highmem) Dentry cache hash table entries: 65536 (order: 7, 524288 bytes) Inode cache hash table entries: 32768 (order: 6, 262144 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 32768 (order: 5, 131072 bytes) Page-cache hash table entries: 131072 (order: 7, 524288 bytes) CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 256K (64 bytes/line) Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: After generic, caps: 0383fbff c1cbfbff 00000000 00000000 CPU: Common caps: 0383fbff c1cbfbff 00000000 00000000 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au) mtrr: detected mtrr type: Intel CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 256K (64 bytes/line) Intel machine check reporting enabled on CPU#0. CPU: After generic, caps: 0383fbff c1cbfbff 00000000 00000000 CPU: Common caps: 0383fbff c1cbfbff 00000000 00000000 CPU0: AMD Athlon(tm) MP 2000+ stepping 02 per-CPU timeslice cutoff: 731.44 usecs. masked 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... 3329.22 BogoMIPS CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 256K (64 bytes/line) Intel machine check reporting enabled on CPU#1. CPU: After generic, caps: 0383fbff c1cbfbff 00000000 00000000 CPU: Common caps: 0383fbff c1cbfbff 00000000 00000000 CPU1: AMD Athlon(tm) Processor stepping 02 Total of 2 processors activated (6658.45 BogoMIPS). ENABLING IO-APIC IRQs Setting 2 in the phys_id_present_map ...changing IO-APIC physical APIC ID to 2 ... ok. init IO_APIC IRQs IO-APIC (apicid-pin) 2-0, 2-5, 2-9, 2-10, 2-11, 2-20, 2-21, 2-22, 2-23 not connected. ..TIMER: vector=0x31 pin1=2 pin2=0 number of MP IRQ sources: 21. number of IO-APIC #2 registers: 24. testing the IO APIC....................... IO APIC #2...... .... register #00: 02000000 ....... : physical APIC id: 02 ....... : Delivery Type: 0 ....... : LTS : 0 .... register #01: 00170011 ....... : max redirection entries: 0017 ....... : PRQ implemented: 0 ....... : IO APIC version: 0011 .... register #02: 00000000 ....... : arbitration: 00 .... IRQ redirection table: NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect: 00 000 00 1 0 0 0 0 0 0 00 01 003 03 0 0 0 0 0 1 1 39 02 003 03 0 0 0 0 0 1 1 31 03 003 03 0 0 0 0 0 1 1 41 04 003 03 0 0 0 0 0 1 1 49 05 000 00 1 0 0 0 0 0 0 00 06 003 03 0 0 0 0 0 1 1 51 07 003 03 0 0 0 0 0 1 1 59 08 003 03 0 0 0 0 0 1 1 61 09 000 00 1 0 0 0 0 0 0 00 0a 000 00 1 0 0 0 0 0 0 00 0b 000 00 1 0 0 0 0 0 0 00 0c 003 03 0 0 0 0 0 1 1 69 0d 003 03 0 0 0 0 0 1 1 71 0e 003 03 0 0 0 0 0 1 1 79 0f 003 03 0 0 0 0 0 1 1 81 10 003 03 1 1 0 1 0 1 1 89 11 003 03 1 1 0 1 0 1 1 91 12 003 03 1 1 0 1 0 1 1 99 13 003 03 1 1 0 1 0 1 1 A1 14 000 00 1 0 0 0 0 0 0 00 15 000 00 1 0 0 0 0 0 0 00 16 000 00 1 0 0 0 0 0 0 00 17 000 00 1 0 0 0 0 0 0 00 IRQ to pin mappings: IRQ0 -> 0:2 IRQ1 -> 0:1 IRQ3 -> 0:3 IRQ4 -> 0:4 IRQ6 -> 0:6 IRQ7 -> 0:7 IRQ8 -> 0:8 IRQ12 -> 0:12 IRQ13 -> 0:13 IRQ14 -> 0:14 IRQ15 -> 0:15 IRQ16 -> 0:16 IRQ17 -> 0:17 IRQ18 -> 0:18 IRQ19 -> 0:19 .................................... done. Using local APIC timer interrupts. calibrating APIC timer ... ..... CPU clock speed is 1666.8222 MHz. ..... host bus clock speed is 266.6915 MHz. cpu: 0, clocks: 2666915, slice: 888971 CPU0 cpu: 1, clocks: 2666915, slice: 888971 CPU1 checking TSC synchronization across CPUs: passed. Waiting on wait_init_idle (map = 0x2) All processors have done init_idle mtrr: your CPUs had inconsistent fixed MTRR settings mtrr: probably your BIOS does not setup all CPUs PCI: PCI BIOS revision 2.10 entry at 0xfd790, last bus=3 PCI: Using configuration type 1 PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Using IRQ router AMD768 [1022/7443] at 00:07.3 PCI->APIC IRQ transform: (B0,I8,P0) -> 16 PCI->APIC IRQ transform: (B0,I8,P1) -> 17 PCI->APIC IRQ transform: (B2,I0,P0) -> 17 PCI->APIC IRQ transform: (B2,I1,P0) -> 18 PCI->APIC IRQ transform: (B2,I2,P0) -> 16 PCI->APIC IRQ transform: (B2,I3,P0) -> 17 PCI->APIC IRQ transform: (B3,I0,P3) -> 19 PCI->APIC IRQ transform: (B3,I8,P0) -> 18 PCI->APIC IRQ transform: (B3,I9,P0) -> 19 BIOS failed to enable PCI standards compliance, fixing this error. isapnp: Scanning for PnP cards... isapnp: No Plug & Play device found Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16) apm: disabled - APM is not SMP safe. Starting kswapd VFS: Disk quotas vdquot_6.5.1 pty: 512 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with MANY_PORTS MULTIPORT SHARE_IRQ SERIAL_PCI ISAPNP enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A Real Time Clock Driver v1.10e Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 NET4: Frame Diverter 0.46 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx AMD7441: IDE controller at PCI slot 00:07.1 AMD7441: chipset revision 4 AMD7441: not 100% native mode: will probe irqs later ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx AMD_IDE: Advanced Micro Devices [AMD] AMD-768 [Opus] IDE (rev 04) UDMA100 controller on pci00:07.1 ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:pio hda: WDC WD200BB-75CAA0, ATA DISK drive blk: queue c03449a0, I/O limit 4095Mb (mask 0xffffffff) hdc: SAMSUNG CD-ROM SC-152L, ATAPI CD/DVD-ROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: attached ide-disk driver. hda: host protected area => 1 hda: 39062500 sectors (20000 MB) w/2048KiB Cache, CHS=2431/255/63, UDMA(100) Partition check: hda: hda1 hda2 hda3 ide: late registration of driver. md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27 md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 4096 buckets, 32Kbytes TCP: Hash tables configured (established 32768 bind 32768) Linux IP multicast router 0.06 plus PIM-SM NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. RAMDISK: Compressed image found at block 0 Freeing initrd memory: 146k freed VFS: Mounted root (ext2 filesystem). Journalled Block Device driver loaded kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. Freeing unused kernel memory: 152k freed usb.c: registered new driver usbdevfs usb.c: registered new driver hub usb-ohci.c: USB OHCI at membase 0xe084d000, IRQ 19 usb-ohci.c: usb-03:00.0, Advanced Micro Devices [AMD] AMD-768 [Opus] USB usb.c: new USB bus registered, assigned bus number 1 hub.c: USB hub found hub.c: 4 ports detected usb.c: registered new driver hiddev usb.c: registered new driver hid hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik hid-core.c: USB HID support drivers mice: PS/2 mouse device common for all mice EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,2), internal journal Adding Swap: 1048312k swap-space (priority -1) kjournald starting. Commit interval 5 seconds EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,1), internal journal EXT3-fs: mounted filesystem with ordered data mode. parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,EPP] parport0: irq 7 detected ip_tables: (C) 2000-2002 Netfilter core team 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 03:08.0: 3Com PCI 3c980C Python-T at 0x3400. Vers LK1.1.18-ac 00:e0:81:21:7d:c8, IRQ 18 product code 0000 rev 00.6 date 00-00-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 782d. Enabling bus-master transmits and whole-frame receives. 03:08.0: scatter/gather enabled. h/w checksums enabled divert: allocating divert_blk for eth0 See Documentation/networking/vortex.txt 03:09.0: 3Com PCI 3c980C Python-T at 0x3480. Vers LK1.1.18-ac 00:e0:81:21:7d:c9, IRQ 19 product code 0000 rev 00.6 date 00-00-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 7809. Enabling bus-master transmits and whole-frame receives. 03:09.0: scatter/gather enabled. h/w checksums enabled divert: allocating divert_blk for eth1 ip_tables: (C) 2000-2002 Netfilter core team parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,EPP] parport0: irq 7 detected lp0: using parport0 (polling). lp0: console ready pktgen.c: v1.7: Packet Generator for packet performance testing. pktgen: cycles_calibrate, cycles_per_ns: 1 per_us: 1666 per_ms: 1666000 Intel(R) PRO/1000 Network Driver - version 5.2.16-k2 Copyright (c) 1999-2003 Intel Corporation. divert: allocating divert_blk for eth2 eth2: Intel(R) PRO/1000 Network Connection Transmit Descriptors set to 1024 Receive Descriptors set to 4096 divert: allocating divert_blk for eth3 eth3: Intel(R) PRO/1000 Network Connection Transmit Descriptors set to 1024 Receive Descriptors set to 4096 Intel(R) PRO/100 Network Driver - version 2.3.18-k1 Copyright (c) 2003 Intel Corporation divert: allocating divert_blk for eth4 e100: selftest OK. e1000: eth2 NIC Link is Up 100 Mbps Full Duplex e100: eth4: Intel(R) PRO/100 Network Connection Hardware receive checksums enabled divert: allocating divert_blk for eth5 e100: selftest OK. e100: eth5: Intel(R) PRO/100 Network Connection Hardware receive checksums enabled divert: allocating divert_blk for eth6 e100: selftest OK. e100: eth6: Intel(R) PRO/100 Network Connection Hardware receive checksums enabled divert: allocating divert_blk for eth7 e100: selftest OK. e100: eth7: Intel(R) PRO/100 Network Connection Hardware receive checksums enabled MAC address based VLAN support Revision: 1.3 e1000: eth2 NIC Link is Up 100 Mbps Full Duplex e1000: eth2 NIC Link is Up 100 Mbps Full Duplex e1000: eth2 NIC Link is Up 100 Mbps Full Duplex --------------090505070403080406040904-- From greearb@candelatech.com Sun Nov 30 00:35:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 00:35:47 -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.9) with SMTP id hAU8ZXTa030650 for ; Sun, 30 Nov 2003 00:35:34 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hAU8ZOKt026483; Sun, 30 Nov 2003 00:35:25 -0800 Message-ID: <3FC9ABCC.2050006@candelatech.com> Date: Sun, 30 Nov 2003 00:35:24 -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'" CC: "Feldman, Scott" Subject: Re: Problems with e1000 in 2.4.23 References: <3FC99775.5020300@candelatech.com> In-Reply-To: <3FC99775.5020300@candelatech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1771 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 3 more data points: I copied the e1000 from 2.4.23-pre9 to 2.4.23, tx-watchdog problem still happened. I tried vanilla 2.4.23 (ie, none of my hacks), tx-watchdog problem still happened, but took slightly longer (around 2 minutes instead of 30 seconds). Booted 2.4.23-pre9 again just to make sure, ran for quite a while w/out a problem, then crashed hard (hand-copied from console and ran through ksymoops, its possible I typo'd something). So, not sure what to blame, but if anyone wants a used Dual-AMD box, I now have one for sale! Ben ksymoops 2.4.5 on i686 2.4.23-pre9. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.4.23-pre9/ (default) -m /boot/System.map-2.4.23-pre9 (default) Warning: You did not tell me where to find symbol information. I will assume that the log matches the kernel and modules that are running right now and I'll use the default options above for symbol resolution. If the current kernel and/or modules do not match the log, you can get more accurate output by telling me the kernel version and where to find map, modules, ksyms etc. ksymoops -h explains the options. Error (expand_objects): cannot stat(/lib/ext3.o) for ext3 Error (expand_objects): cannot stat(/lib/jbd.o) for jbd Warning (map_ksym_to_module): cannot match loaded module ext3 to a unique module object. Trace may not be reliable. invalid operand: 0000 CPU: 1 EFLAGS: 00010286 eax: 00000026 ebx: b1b0afae ecx: 00000092 edx: ded2df7c esi: dd35f080 edi: dae28890 ebp: 00000889 esp: c158fea0 ds: 0018 es: 0018 ss:0018 Process swapper (pid: 0, stackpage=c158f000) Stack: c026f5e0 00000320 e0903f3e 00000320 c01f0bd7 dc84b380 00000000 00000030 dcf80000 e090ebbe 00000001 00000049 dd6accd8 dd614800 dd614a50 c158ff24 00000040 dd614800 dd614980 e090e963 dd614980 c158fefc 00000040 00000001 Call Trace: [] [] [] [] [] [] [] [] [] [] [] [] [] [] Code: 0f 0b 95 00 1a 03 27 c0 90 eb fe 90 90 90 90 90 90 90 90 90 Using defaults from ksymoops -t elf32-i386 -a i386 >>ebx; b1b0afae Before first symbol >>edx; ded2df7c <_end+1e9db344/204ba448> >>esi; dd35f080 <_end+1d00c448/204ba448> >>edi; dae28890 <_end+1aad5c58/204ba448> >>ebp; 00000889 Before first symbol >>esp; c158fea0 <_end+123d268/204ba448> Trace; e090ef3e <[e1000]e1000_clean_rx_irq+36e/370> Trace; c01f0bd7 <__kfree_skb+117/170> Trace; e090ebbe <[e1000]e1000_clean_tx_irq+1ee/200> Trace; e090e963 <[e1000]e1000_clean+43/b0> Trace; c01f584e Trace; c012538e Trace; c010adec Trace; c0106f20 Trace; c010d818 Trace; c0106f20 Trace; c0106f4c Trace; c0106fc2 Trace; c01200db Trace; c0120347 Code; 00000000 Before first symbol 00000000 <_EIP>: Code; 00000000 Before first symbol 0: 0f 0b ud2a Code; 00000002 Before first symbol 2: 95 xchg %eax,%ebp Code; 00000003 Before first symbol 3: 00 1a add %bl,(%edx) Code; 00000005 Before first symbol 5: 03 27 add (%edi),%esp Code; 00000007 Before first symbol 7: c0 90 eb fe 90 90 90 rclb $0x90,0x9090feeb(%eax) Code; 0000000e Before first symbol e: 90 nop Code; 0000000f Before first symbol f: 90 nop Code; 00000010 Before first symbol 10: 90 nop Code; 00000011 Before first symbol 11: 90 nop Code; 00000012 Before first symbol 12: 90 nop Code; 00000013 Before first symbol 13: 90 nop <0>Kernel panic: Aiee, killing interrupt handler! 2 warnings and 2 errors issued. Results may not be reliable. -- Ben Greear Candela Technologies Inc http://www.candelatech.com From ioe-lkml@rameria.de Sun Nov 30 02:56:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 02:57:13 -0800 (PST) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [62.67.200.156]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAUAuvTa001798 for ; Sun, 30 Nov 2003 02:56:58 -0800 Received: (qmail 31987 invoked from network); 30 Nov 2003 10:56:55 -0000 Received: from unknown (HELO bertha.s4u) (696817@[80.145.19.200]) (envelope-sender ) by smtprelay01.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 30 Nov 2003 10:56:55 -0000 From: Ingo Oeser To: David Woodhouse Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy Date: Sun, 30 Nov 2003 11:26:22 +0100 User-Agent: KMail/1.5.4 Cc: Timo Kamph , Linux Kernel Mailinglist , netdev@oss.sgi.com, davem@redhat.com References: <20031127142125.GG8276@jdj5.mit.edu> <1069970946.2138.13.camel@teapot.felipe-alfaro.com> <1070012538.10048.13.camel@hades.cambridge.redhat.com> In-Reply-To: <1070012538.10048.13.camel@hades.cambridge.redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200311301126.24035.ioe-lkml@rameria.de> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hAUAuvTa001798 X-archive-position: 1772 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ioe-lkml@rameria.de Precedence: bulk X-list: netdev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 28 November 2003 10:42, David Woodhouse wrote: > On Thu, 2003-11-27 at 23:09 +0100, Felipe Alfaro Solana wrote: > > On Thu, 2003-11-27 at 21:48, Timo Kamph wrote: > > > > + strlcpy(label->label, name, sizeof(label->name)); > > > > > > > > > ^^^^^^ I guess this shoud be label->label, or am I wrong? > > > > Oh my god! Two consecutive mistakes with the same patch! I should have > > some sleep... Here's the one with the typo corrected. > > Perhaps we should consider > > #define strsizecpy(x, y) strlcpy((x), (y), sizeof(x)) Then we should do: #define strsizecpy(x, y) strlcpy(x, y, sizeof(x)/sizeof(x[0])) to rule out passing the wrong variables or dereferencing to much. Unfortunatly there is no simple way in C to differentiate between array and pointer. There is a way with typeof, but that is hackish. Regards Ingo Oeser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ycXOU56oYWuOrkARAiJ8AJ9wkl1ijJVn5M+lGhUwSwWRxzxxHwCg2nAU t+9HdAasQDZo/GQFuj9s5ZU= =py/4 -----END PGP SIGNATURE----- From pekkas@netcore.fi Sun Nov 30 06:03:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 06:03:27 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAUE3DTa011731 for ; Sun, 30 Nov 2003 06:03:14 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id hAUE0ph01335; Sun, 30 Nov 2003 16:00:51 +0200 Date: Sun, 30 Nov 2003 16:00:51 +0200 (EET) From: Pekka Savola To: "David S. Miller" cc: Ville Nuorvala , , Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device In-Reply-To: <20031129204701.37a06847.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1773 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 Sat, 29 Nov 2003, David S. Miller wrote: > > Hi Dave, Yoshifuji-san is now ok with this patch :) Would you apply it? > > I thought some more about this and I am realizing this is not > a pure bug fix, I am very sure Linus will not take the change. > > We can hold onto this until 2.6.1, ok? Another perspective: Well, the specs say very strongly that all interfaces MUST have lik-local addresses, so it's a pretty big bug, implementation-of-the-spec -wise. However, it's probably not a bug in the current code, though. But I'm personally fine with waiting.. -- 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 vnuorval@tcs.hut.fi Sun Nov 30 08:35:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 08:35:18 -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.9) with SMTP id hAUGYsTa025030 for ; Sun, 30 Nov 2003 08:34:55 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id C16B08001DA; Sun, 30 Nov 2003 17:59:00 +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 hAUFx0sj017688; Sun, 30 Nov 2003 17:59:00 +0200 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAUFwxs2017684; Sun, 30 Nov 2003 17:58:59 +0200 Date: Sun, 30 Nov 2003 17:58:58 +0200 (EET) From: Ville Nuorvala To: "David S. Miller" Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: Autoconfig link-local address on ip6-ip6 tunnel device In-Reply-To: <20031129204701.37a06847.davem@redhat.com> Message-ID: References: <20031125.035531.94714784.yoshfuji@linux-ipv6.org> <20031127.193910.96333709.yoshfuji@linux-ipv6.org> <20031129204701.37a06847.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1774 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 On Sat, 29 Nov 2003, David S. Miller wrote: > I thought some more about this and I am realizing this is not > a pure bug fix, I am very sure Linus will not take the change. > > We can hold onto this until 2.6.1, ok? Yes that's fine. -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From Geert.Uytterhoeven@sonycom.com Sun Nov 30 10:55:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 10:56:08 -0800 (PST) Received: from witte.sonytel.be (witte.sonytel.be [80.88.33.193]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hAUItpTa026514 for ; Sun, 30 Nov 2003 10:55:55 -0800 Received: from waterleaf.sonytel.be (localhost [127.0.0.1]) by witte.sonytel.be (8.12.10/8.12.10) with ESMTP id hAUItmQG020210; Sun, 30 Nov 2003 19:55:48 +0100 (MET) Date: Sun, 30 Nov 2003 19:55:48 +0100 (MET) From: Geert Uytterhoeven To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org, Linux Kernel Development Subject: 2.4.23 and CONFIG_PROC_FS=n Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 1775 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: geert@linux-m68k.org Precedence: bulk X-list: netdev When compiling 2.4.23 with CONFIG_PROC_FS disabled, I found a few network-related files that don't compile: 1. net/atm/br2684.c 2. net/core/pktgen.c 3. net/ipv4/netfilter/ipt_recent.c The patch below fixes 1 and 3. Note that 3 still generates a compiler warning (`ip_list_perms' defined but not used). The packet generator is a bit trickier, since its functionality seems to depend completely on the proc file system. --- linux-2.4.23/net/atm/br2684.c.orig 2003-10-01 20:49:26.000000000 +0200 +++ linux-2.4.23/net/atm/br2684.c 2003-11-30 12:06:32.000000000 +0100 @@ -678,6 +678,7 @@ return -ENOIOCTLCMD; } +#ifdef CONFIG_PROC_FS /* Never put more than 256 bytes in at once */ static int br2684_proc_engine(loff_t pos, char *buf) { @@ -770,16 +771,19 @@ }; extern struct proc_dir_entry *atm_proc_root; /* from proc.c */ +#endif /* CONFIG_PROC_FS */ /* the following avoids some spurious warnings from the compiler */ #define UNUSED __attribute__((unused)) static int __init UNUSED br2684_init(void) { +#ifdef CONFIG_PROC_FS struct proc_dir_entry *p; if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL) return -ENOMEM; p->proc_fops = &br2684_proc_operations; +#endif /* CONFIG_PROC_FS */ br2684_ioctl_set(br2684_ioctl); return 0; } @@ -788,7 +792,9 @@ { struct br2684_dev *brdev; br2684_ioctl_set(NULL); +#ifdef CONFIG_PROC_FS remove_proc_entry("br2684", atm_proc_root); +#endif /* CONFIG_PROC_FS */ while (!list_empty(&br2684_devs)) { brdev = list_entry_brdev(br2684_devs.next); unregister_netdev(&brdev->net_dev); --- linux-2.4.23/net/ipv4/netfilter/ipt_recent.c.orig 2003-07-08 13:31:59.000000000 +0200 +++ linux-2.4.23/net/ipv4/netfilter/ipt_recent.c 2003-11-30 19:24:09.000000000 +0100 @@ -91,9 +91,6 @@ */ static spinlock_t recent_lock = SPIN_LOCK_UNLOCKED; -/* Our /proc/net/ipt_recent entry */ -static struct proc_dir_entry *proc_net_ipt_recent = NULL; - /* Function declaration for later. */ static int match(const struct sk_buff *skb, @@ -123,6 +120,9 @@ } #ifdef CONFIG_PROC_FS +/* Our /proc/net/ipt_recent entry */ +static struct proc_dir_entry *proc_net_ipt_recent = NULL; + /* This is the function which produces the output for our /proc output * interface which lists each IP address, the last seen time and the * other recent times the address was seen. @@ -963,8 +963,10 @@ int count; printk(version); +#ifdef CONFIG_PROC_FS proc_net_ipt_recent = proc_mkdir("ipt_recent",proc_net); if(!proc_net_ipt_recent) return -ENOMEM; +#endif /* CONFIG_PROC_FS */ if(ip_list_hash_size && ip_list_hash_size <= ip_list_tot) { printk(KERN_WARNING RECENT_NAME ": ip_list_hash_size too small, resetting to default.\n"); @@ -990,7 +992,9 @@ { ipt_unregister_match(&recent_match); +#ifdef CONFIG_PROC_FS remove_proc_entry("ipt_recent",proc_net); +#endif /* CONFIG_PROC_FS */ } /* Register our module with the kernel. */ Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From davem@pizda.ninka.net Sun Nov 30 10:59:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 10:59:20 -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.9) with SMTP id hAUIx6Ta026865 for ; Sun, 30 Nov 2003 10:59:07 -0800 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id KAA04054; Sun, 30 Nov 2003 10:58:29 -0800 Date: Sun, 30 Nov 2003 10:58:29 -0800 From: "David S. Miller" To: Geert Uytterhoeven Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: 2.4.23 and CONFIG_PROC_FS=n Message-Id: <20031130105829.478e408a.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: 1776 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, 30 Nov 2003 19:55:48 +0100 (MET) Geert Uytterhoeven wrote: > > When compiling 2.4.23 with CONFIG_PROC_FS disabled, I found a few > network-related files that don't compile: > 1. net/atm/br2684.c > 2. net/core/pktgen.c > 3. net/ipv4/netfilter/ipt_recent.c > > The patch below fixes 1 and 3. Note that 3 still generates a compiler warning > (`ip_list_perms' defined but not used). Thanks Geert, I'll review and probably apply this. > The packet generator is a bit trickier, since its functionality seems to > depend completely on the proc file system. Yes, it does, should just add the dependency to the config. Thanks again. From francois@baligant.net Sun Nov 30 16:27:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 16:28:16 -0800 (PST) Received: from casimir.nikita.cx (casimir.nikita.cx [198.63.211.44]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hB10RxTa003810 for ; Sun, 30 Nov 2003 16:27:59 -0800 Received: from fortress (fbaligant.net1.nerim.net [213.41.146.186]) by casimir.nikita.cx (8.12.8/8.12.8) with SMTP id hAULF8h0016648 for ; Sun, 30 Nov 2003 15:15:13 -0600 Message-ID: <054201c3b787$0cb93c40$15fea8c0@fortress> From: "Francois Baligant" To: Subject: Kernel panic 2.6.0-test11 in release_sock Date: Sun, 30 Nov 2003 22:15:10 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_053F_01C3B78F.6B19B8C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Copied-To: backup@casimir.nikita.cx (by Synonym - http://www.modulo.ro/synonym) X-Scanned-By: MIMEDefang 2.37 X-archive-position: 1777 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: francois@baligant.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format... ------=_NextPart_000_053F_01C3B78F.6B19B8C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline If it helps, box is running a epoll syscalls enabled application and handli= ng a fair share of connected sockets. ksymoops 2.4.9 on i686 2.6.0-test11-mjb1. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.6.0-test11-mjb1/ (default) -m /usr/src/linux/System.map (default) Warning: You did not tell me where to find symbol information. I will assume that the log matches the kernel and modules that are running right now and I'll use the default options above for symbol resolution. If the current kernel and/or modules do not match the log, you can get more accurate output by telling me the kernel version and where to find map, modules, ksyms etc. ksymoops -h explains the options. Error (regular_file): read_ksyms stat /proc/ksyms failed ksymoops: No such file or directory No modules in ksyms, skipping objects No ksyms, skipping lsmod Unable to handle kernel NULL pointer dereference at virtual address 00000000 837a8e0a *pde =3D 00000000 Oops: 0002 [#1] CPU: 0 EIP: 0060:[<837a8e0a>] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010206 eax: 00000000 ebx: ca2afd44 ecx: 837a766c edx: 41a54000 esi: cd4ec600 edi: 0b07ebdf ebp: 00000040 esp: ca2afd2c ds: 007b es: 007b ss: 0068 Stack: 00000000 f8819080 f88119c0 f6bd2800 00000001 d0c12840 00000000 ca2af= dcc=20 803c5fa8 80000000 8030da88 00000000 b3cb9380 00000002 8025f63b b3cb9= 380=20 f8813b40 00000000 8025217d 00000001 ca2afdfc f6bd2800 00000000 8025f= 560=20 Call Trace: [<8025f63b>] ip_local_deliver_finish+0xdb/0x1a0 [<8025217d>] nf_iterate+0x3d/0xa0 [<8025f560>] ip_local_deliver_finish+0x0/0x1a0 [<80288f7d>] inet_sendmsg+0x3d/0x50 [<80240f02>] sock_sendmsg+0x82/0xa0 [<8010c99e>] handle_IRQ_event+0x3e/0x70 [<801257eb>] do_softirq+0x6b/0xd0 [<8010cd2f>] do_IRQ+0x10f/0x120 [<8010b3e0>] common_interrupt+0x18/0x20 [<80240d28>] sockfd_lookup+0x28/0x70 [<80240d11>] sockfd_lookup+0x11/0x70 [<80242100>] sys_sendto+0xd0/0xf0 [<80275e22>] tcp_send_ack+0xc2/0xd0 [] e100_rx_srv+0x4be/0x520 [e100] [<80248e7d>] netif_receive_skb+0x1dd/0x220 [<80131a73>] rcu_process_callbacks+0x163/0x170 [<802446b8>] kfree_skbmem+0x18/0x20 [<8024213d>] sys_send+0x1d/0x30 [<80242961>] sys_socketcall+0x161/0x250 [<8010cd2f>] do_IRQ+0x10f/0x120 [<8010aa73>] syscall_call+0x7/0xb Code: 7a 83 fc 8c 7a 83 40 00 00 00 40 00 00 00 00 00 00 00 00 00=20 >>EIP; 837a8e0a <__crc___release_sock+15aeb5/47c4ae> <=3D=3D=3D=3D=3D >>ebx; ca2afd44 <__crc_skb_copy_datagram_iovec+30f1af/5d1d75> >>ecx; 837a766c <__crc___release_sock+159717/47c4ae> >>edx; 41a54000 <__crc_pci_request_region+134a3f/2126d1> >>esi; cd4ec600 <__crc_mb_cache_entry_get+36fb25/40fd55> >>edi; 0b07ebdf <__crc_blk_queue_invalidate_tags+67c46/17d2da> >>esp; ca2afd2c <__crc_skb_copy_datagram_iovec+30f197/5d1d75> Trace; 8025f63b Trace; 8025217d Trace; 8025f560 Trace; 80288f7d Trace; 80240f02 Trace; 8010c99e Trace; 801257eb Trace; 8010cd2f Trace; 8010b3e0 Trace; 80240d28 Trace; 80240d11 Trace; 80242100 Trace; 80275e22 Trace; f88216ce <__crc_utf8_wctomb+5305c5/61ed76> Trace; 80248e7d Trace; 80131a73 Trace; 802446b8 Trace; 8024213d Trace; 80242961 Trace; 8010cd2f Trace; 8010aa73 Code; 837a8e0a <__crc___release_sock+15aeb5/47c4ae> 00000000 <_EIP>: Code; 837a8e0a <__crc___release_sock+15aeb5/47c4ae> <=3D=3D=3D=3D=3D 0: 7a 83 jp ffffff85 <_EIP+0xffffff85> 837a8d8= f <__crc___release_sock+15ae3a/47c4ae> <=3D=3D=3D=3D=3D Code; 837a8e0c <__crc___release_sock+15aeb7/47c4ae> 2: fc cld=20=20=20=20 Code; 837a8e0d <__crc___release_sock+15aeb8/47c4ae> 3: 8c 7a 83 movl %?,0xffffff83(%edx) Code; 837a8e10 <__crc___release_sock+15aebb/47c4ae> 6: 40 inc %eax Code; 837a8e11 <__crc___release_sock+15aebc/47c4ae> 7: 00 00 add %al,(%eax) Code; 837a8e13 <__crc___release_sock+15aebe/47c4ae> 9: 00 40 00 add %al,0x0(%eax) <0>Kernel panic: Fatal exception in interrupt 1 warning and 1 error issued. Results may not be reliable. Francois Baligant - http://www.pingouin.be Change the numbers, change your Life! ------=_NextPart_000_053F_01C3B78F.6B19B8C0-- From romieu@fr.zoreil.com Sun Nov 30 17:13:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 17:14:09 -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.9) with SMTP id hB11DtTa005209 for ; Sun, 30 Nov 2003 17:13:56 -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 hB114tK7018496; Mon, 1 Dec 2003 02:04:55 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id hB114rO6018495; Mon, 1 Dec 2003 02:04:53 +0100 Date: Mon, 1 Dec 2003 02:04:53 +0100 From: Francois Romieu To: =?iso-8859-1?Q?Fernando_Alencar_Mar=F3stica?= Cc: Brad House , netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 2.6] RTL8169 Suspend and Resume Stuff Message-ID: <20031201020453.A16405@electric-eye.fr.zoreil.com> References: <1070212415.1607.17.camel@oxygenium> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1070212415.1607.17.camel@oxygenium>; from famarost@unimep.br on Sun, Nov 30, 2003 at 03:13:35PM -0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 1778 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 I have queued it with the following modifications (mostly to keep the style of the driver consistent): - no whitespace before parenthesis for functions; - s/ethernet_device/dev/ (like other drivers in drivers/net); - write{b/w/l} -> RTL_W{8/16/32}; - netif_start_queue() done in rtl8169_hw_start(). See http://www.fr.zoreil.com/people/francois/misc/r8169/r8169-suspend.patch for patch. Btw, there is a flaw in r8169-dma-api-rx-buffers.patch so don't bother testing it. I'll do it again tomorrow. -- Ueimor From scott.feldman@intel.com Sun Nov 30 18:19:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 18:20:07 -0800 (PST) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hB12JjTa006089 for ; Sun, 30 Nov 2003 18:19:46 -0800 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.11.6/d: major-outer.mc,v 1.9 2003/11/03 20:24:21 root Exp $) with ESMTP id hB12JWv5020145; Mon, 1 Dec 2003 02:19:32 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by talaria.jf.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 hB128XO16521; Mon, 1 Dec 2003 02:08:33 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.1.32) with SMTP id M2003113018190124615 ; Sun, 30 Nov 2003 18:19:01 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Sun, 30 Nov 2003 18:19:01 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Problems with e1000 in 2.4.23 Date: Sun, 30 Nov 2003 18:19:01 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems with e1000 in 2.4.23 Thread-Index: AcO3EM1mNPGI9Ig+RjKSK1hSsktLxwAn8zQw From: "Feldman, Scott" To: "Ben Greear" , X-OriginalArrivalTime: 01 Dec 2003 02:19:01.0753 (UTC) FILETIME=[7C363E90:01C3B7B1] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hB12JjTa006089 X-archive-position: 1779 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev > Attached is an oops that did not hang the machine. Re: e1000_dump.txt: I'm 99% sure this shows dev_close being called without a matching dev_open, or a dev_close after failed dev_open. e1000 doesn't guard against that (and shouldn't), so we need to figure out how you're getting here and fix that. What's above e1000? Are you using bonding or pktgen or ? -scott From greearb@candelatech.com Sun Nov 30 18:51:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 18:52:00 -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.9) with SMTP id hB12pkTa006670 for ; Sun, 30 Nov 2003 18:51:47 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hB12pPKt017124; Sun, 30 Nov 2003 18:51:27 -0800 Message-ID: <3FCAACAD.7090609@candelatech.com> Date: Sun, 30 Nov 2003 18:51:25 -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: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: Problems with e1000 in 2.4.23 References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1780 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 Feldman, Scott wrote: >>Attached is an oops that did not hang the machine. > > > Re: e1000_dump.txt: I'm 99% sure this shows dev_close being called > without a matching dev_open, or a dev_close after failed dev_open. > e1000 doesn't guard against that (and shouldn't), so we need to figure > out how you're getting here and fix that. What's above e1000? Are you > using bonding or pktgen or ? It's possible I had a mac-vlan interface on it, but I don't think I did. I definately was not running bonding or pktgen. I was running with the patch below, and this crash was shortly after or during I configured the NIC to receive all (or, maybe configured it from rx-all to not-rx-all.) Could the problem happen because I do the set-multi even if the NIC is down? Is there enough locking in the e1000_ethtool additions? Also, I am seeing bogus things on this machine regardless of which kernel and which e1000 driver I use, so it's quite possible that either the NIC hardware or the MB/RAM/CPU/Whatever is just plain not quite right. I'm ordering pieces for a nice new dual Xeon now....so hopefully I'll have a more stable test environment soon.... Thanks, Ben --- linux-2.4.23/drivers/net/e1000/e1000_main.c 2003-11-28 10:26:20.000000000 -0800 +++ linux-2.4.23.p4s/drivers/net/e1000/e1000_main.c 2003-11-28 14:25:12.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/** -*-linux-c -*- *************************************************************** Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -462,6 +462,9 @@ netdev->features |= NETIF_F_TSO; #endif + /* Has ability to receive all frames (even bad CRCs and such) */ + netdev->features |= NETIF_F_RX_ALL | NETIF_F_SAVE_CRC; + if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; @@ -1218,7 +1221,7 @@ * promiscuous mode, and all-multi behavior. **/ -static void +void e1000_set_multi(struct net_device *netdev) { struct e1000_adapter *adapter = netdev->priv; @@ -1243,6 +1246,34 @@ E1000_WRITE_REG(hw, RCTL, rctl); + + /* This is useful for using ethereal or tcpdump to sniff + * packets in promiscuous mode without stripping VLAN/priority + * information, and also letting bad packets through. + * + * THIS IS NOT PRODUCTION CODE - FOR INTERNAL USE ONLY!!! + * + */ + if (netdev->priv_flags & IFF_ACCEPT_ALL_FRAMES) { + uint32_t ctrl; + printk("Enabling acceptance of ALL frames (bad CRC too).\n"); + /* store bad packets, promisc/multicast all, no VLAN + * filter */ + rctl = E1000_READ_REG(hw, RCTL); + rctl |= (E1000_RCTL_SBP | E1000_RCTL_UPE | E1000_RCTL_MPE); + rctl &= ~(E1000_RCTL_VFE | E1000_RCTL_CFIEN); + E1000_WRITE_REG(hw, RCTL, rctl); + /* disable VLAN tagging/striping */ + ctrl = E1000_READ_REG(hw, CTRL); + ctrl &= ~E1000_CTRL_VME; + E1000_WRITE_REG(hw, CTRL, ctrl); + } + else { + /* TODO: Do we need a way to explicitly turn this off if it was + * previously enabled, or will it magically go back to normal??? --Ben + */ + } + /* 82542 2.0 needs to be in reset to write receive address registers */ if(hw->mac_type == e1000_82542_rev2_0) @@ -1455,6 +1486,7 @@ #define E1000_TX_FLAGS_CSUM 0x00000001 #define E1000_TX_FLAGS_VLAN 0x00000002 #define E1000_TX_FLAGS_TSO 0x00000004 +#define E1000_TX_FLAGS_NO_FCS 0x00000008 #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 #define E1000_TX_FLAGS_VLAN_SHIFT 16 @@ -1714,6 +1746,13 @@ txd_upper |= (tx_flags & E1000_TX_FLAGS_VLAN_MASK); } +#ifdef CONFIG_SUPPORT_SEND_BAD_CRC + if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS)) { + txd_lower &= ~(E1000_TXD_CMD_IFCS); + /* printk("Disabling CRC in tx_queue, txd_lower: 0x%x\n", txd_lower); */ + } +#endif + i = tx_ring->next_to_use; while(count--) { @@ -1728,6 +1767,14 @@ tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd); +#ifdef CONFIG_SUPPORT_SEND_BAD_CRC + /* txd_cmd re-enables FCS, so we'll re-disable it here as desired. */ + if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS)) { + tx_desc->lower.data &= ~(cpu_to_le32(E1000_TXD_CMD_IFCS)); + /* printk("Disabling2 CRC in tx_queue, txd_lower: 0x%x\n", tx_desc->lower.data); */ + } +#endif + /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs, @@ -1809,6 +1856,12 @@ else if(e1000_tx_csum(adapter, skb)) tx_flags |= E1000_TX_FLAGS_CSUM; +#ifdef CONFIG_SUPPORT_SEND_BAD_CRC + if (unlikely(skb->general_flags & DONT_DO_TX_CRC)) { + tx_flags |= E1000_TX_FLAGS_NO_FCS; + } +#endif + if((count = e1000_tx_map(adapter, skb, first))) e1000_tx_queue(adapter, count, tx_flags); else { @@ -2281,7 +2334,11 @@ continue; } - if(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK) { + /* If we are accepting all frames, then do not pay attention to the + * framing errors. + */ + if (!(netdev->priv_flags & IFF_ACCEPT_ALL_FRAMES) && + (rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) { last_byte = *(skb->data + length - 1); @@ -2311,7 +2368,12 @@ } /* Good Receive */ - skb_put(skb, length - ETHERNET_FCS_SIZE); + if (netdev->priv_flags & IFF_SAVE_FCS) { + skb_put(skb, length); + } + else { + skb_put(skb, length - ETHERNET_FCS_SIZE); + } /* Receive Checksum Offload */ e1000_rx_checksum(adapter, rx_desc, skb); --- linux-2.4.23/drivers/net/e1000/e1000_ethtool.c 2003-11-28 10:26:20.000000000 -0800 +++ linux-2.4.23.p4s/drivers/net/e1000/e1000_ethtool.c 2003-11-28 14:25:12.000000000 -0800 @@ -1,4 +1,4 @@ -/******************************************************************************* +/*** -*-linux-c-*- ************************************************************** Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. @@ -39,6 +39,7 @@ extern void e1000_down(struct e1000_adapter *adapter); extern void e1000_reset(struct e1000_adapter *adapter); extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx); +extern void e1000_set_multi(struct net_device *netdev); struct e1000_stats { char stat_string[ETH_GSTRING_LEN]; @@ -1335,6 +1336,28 @@ return 0; } +/* Hold xmit lock before calling this */ +static int e1000_ethtool_setrxall(struct net_device *netdev, uint32_t val) { + unsigned short old_flags = netdev->priv_flags; + if (val) { + netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES; + } + else { + netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES); + } + + /* printk("e1000_ethtool_setrxall (%s) val: %d\n", + netdev->name, val); */ + if (old_flags != netdev->priv_flags) { + /* Kick the driver to flush the values... + * TODO: Needs review of driver folks to make sure locking is sane, etc + */ + /*printk("Kicking e1000_set_multi..\n");*/ + e1000_set_multi(netdev); + } + return 0; +} + int e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr) { @@ -1624,6 +1647,47 @@ return 0; } + case ETHTOOL_SETRXALL: { + struct ethtool_value id; + if (copy_from_user(&id, addr, sizeof(id))) + return -EFAULT; + spin_lock_bh(&netdev->xmit_lock); + e1000_ethtool_setrxall(netdev, id.data); + spin_unlock_bh(&netdev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXALL: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(netdev->priv_flags & IFF_ACCEPT_ALL_FRAMES); + /*printk("GETRXALL, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(addr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + case ETHTOOL_SETRXFCS: { + struct ethtool_value id; + if (copy_from_user(&id, addr, sizeof(id))) + return -EFAULT; + spin_lock_bh(&netdev->xmit_lock); + if (id.data) { + netdev->priv_flags |= IFF_SAVE_FCS; + } + else { + netdev->priv_flags &= ~IFF_SAVE_FCS; + } + spin_unlock_bh(&netdev->xmit_lock); + return 0; + } + case ETHTOOL_GETRXFCS: { + struct ethtool_value edata = { ETHTOOL_GSG }; + edata.data = !!(netdev->priv_flags & IFF_SAVE_FCS); + /*printk("GETRXALL, data: %d priv_flags: %hx\n", + edata.data, netdev->priv_flags);*/ + if (copy_to_user(addr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } #ifdef NETIF_F_TSO case ETHTOOL_GTSO: { struct ethtool_value edata = { ETHTOOL_GTSO }; > > -scott > > -- Ben Greear Candela Technologies Inc http://www.candelatech.com From jgarzik@pobox.com Sun Nov 30 19:49:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 19:49:32 -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.9) with SMTP id hB13nGTa010836 for ; Sun, 30 Nov 2003 19:49:17 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36458 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1AQWvu-0003Cs-No; Sun, 30 Nov 2003 19:08:38 +0000 Message-ID: <3FCA4028.7050201@pobox.com> Date: Sun, 30 Nov 2003 14:08:24 -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: Zwane Mwaikambo CC: Linux Kernel , netdev@oss.sgi.com Subject: Re: [PATCH][2.6] e100_phy.c uses free'd .text after init References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1781 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 Zwane Mwaikambo wrote: > diff -u -p -B -r1.1.1.1 e100_phy.c > --- linux-2.6.0-test11/drivers/net/e100/e100_phy.c 28 Nov 2003 18:03:05 -0000 1.1.1.1 > +++ linux-2.6.0-test11/drivers/net/e100/e100_phy.c 29 Nov 2003 05:39:53 -0000 > @@ -132,7 +132,7 @@ e100_mdi_read(struct e100_private *bdp, > } > } > > -static unsigned char __devinit > +static unsigned char > e100_phy_valid(struct e100_private *bdp, unsigned int phy_address) > { > u16 ctrl_reg, stat_reg; > @@ -150,7 +150,7 @@ e100_phy_valid(struct e100_private *bdp, > return true; > } > > -static void __devinit > +static void > e100_phy_address_detect(struct e100_private *bdp) > { > unsigned int addr; I should probably move that patch from net-drivers-2.5-exp to mainline, it sounds like... Jeff From scott.feldman@intel.com Sun Nov 30 20:06:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 20:06:38 -0800 (PST) Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id hB146NTa011426 for ; Sun, 30 Nov 2003 20:06:23 -0800 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by hermes.jf.intel.com (8.12.9-20030918-01/8.11.6/d: major-outer.mc,v 1.9 2003/11/03 20:24:21 root Exp $) with ESMTP id hB147GD5019563 for ; Mon, 1 Dec 2003 04:07:16 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.jf.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 hB140IC07116 for ; Mon, 1 Dec 2003 04:00:18 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003113020061714669 ; Sun, 30 Nov 2003 20:06:17 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Sun, 30 Nov 2003 20:06:17 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Problems with e1000 in 2.4.23 Date: Sun, 30 Nov 2003 20:06:16 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems with e1000 in 2.4.23 Thread-Index: AcO3tgocNjgR3NUHT7u9liZ1t4t5ggACUBTAAAAyT+A= From: "Feldman, Scott" To: "Ben Greear" Cc: X-OriginalArrivalTime: 01 Dec 2003 04:06:17.0241 (UTC) FILETIME=[780FC890:01C3B7C0] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id hB146NTa011426 X-archive-position: 1782 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scott.feldman@intel.com Precedence: bulk X-list: netdev > Could the problem happen because I do the set-multi even if > the NIC is down? Is there enough locking in the > e1000_ethtool additions? Change ETHTOOL_SETRXALL to work more like ETHTOOL_SRXCSUM, with the check for netif_running and down/up or reset. -scott From greearb@candelatech.com Sun Nov 30 21:39:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Nov 2003 21:40:13 -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.9) with SMTP id hB15dwTa015375 for ; Sun, 30 Nov 2003 21:39:58 -0800 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id hB15dmKt019534; Sun, 30 Nov 2003 21:39:49 -0800 Message-ID: <3FCAD424.70103@candelatech.com> Date: Sun, 30 Nov 2003 21:39:48 -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: "Feldman, Scott" , "'netdev@oss.sgi.com'" Subject: Re: Problems with e1000 in 2.4.23 References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 1783 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 Feldman, Scott wrote: >>Could the problem happen because I do the set-multi even if >>the NIC is down? Is there enough locking in the >>e1000_ethtool additions? > > > Change ETHTOOL_SETRXALL to work more like ETHTOOL_SRXCSUM, with the > check for netif_running and down/up or reset. The set_multi is called from net/core/dev.c (or near-abouts) when the promisc changes, and I'm quite sure that does not require the NIC to be bounced. So, if I really have to bounce the NIC to change the 'rx-all' flags, then I'll have to move that code path out of the 'set-multi' method and have it be a stand-alone method. Or, is the problem just that I should NOT be twiddling any bits when the NIC is down? Unless I'm confused, the only lock acquired when changing PROMISC (which on e100 at least used to flush a bunch of the rx-all flags, even though the receive logic threw them away later) is the tx-lock. For instance, would this perhaps be a better method: static int e1000_ethtool_setrxall(struct net_device *netdev, uint32_t val) { unsigned short old_flags = netdev->priv_flags; if (val) { netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES; } else { netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES); } /* printk("e1000_ethtool_setrxall (%s) val: %d\n", netdev->name, val); */ if (old_flags != netdev->priv_flags) { spin_lock_bh(&netdev->xmit_lock); if (netif_running(netdev)) { /*printk("Kicking e1000 for setrxall..\n");*/ e1000_set_multi(netdev); } else { /* Value will be flushed into the hardware when the device is * brought up. */ } spin_unlock_bh(&netdev->xmit_lock); } return 0; } ... case ETHTOOL_SETRXALL: { struct ethtool_value id; if (copy_from_user(&id, addr, sizeof(id))) return -EFAULT; e1000_ethtool_setrxall(netdev, id.data); return 0; } Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com