make csum_partial obj-y
Subsystems (14)
PATCH 1/1 make csum_partial obj-y
From: Randy Dunlap <[email protected]>
Fixes kernel bugzilla #8242:
Move csum_partial() from lib-y to obj-$(CONFIG_CSUM_PARTIAL) so that modules can use it.
CONFIG_BLK_DEV_MD (md/raid driver) needs csum_partial(), even when CONFIG_NET=n and BLK_DEV_MD=m, so build it as an object to force it being built and available.
REISERFS with XATTR=y also needs csum_partial(), so that is enforced here.
powerpc, ppc, & um use obj-, not lib-, so they don't need any Makefile changes. s390 uses a header file for csum_partial(), so it doesn't need any changes.
CONFIG_CSUM_PARTIAL is boolean since lib/ obj-m is not supported.
Built on i386, sparc, sparc64, alpha, ia64, ppc64, x86_64, arm, um, with many config varieties on x86_64.
--- arch/alpha/Kconfig | 3 +++ arch/alpha/lib/Makefile | 3 ++- arch/arm/Kconfig | 3 +++ arch/arm/lib/Makefile | 4 +++- arch/arm26/Kconfig | 3 +++ arch/arm26/lib/Makefile | 4 +++- arch/avr32/Kconfig | 3 +++ arch/avr32/lib/Makefile | 4 +++- arch/cris/Kconfig | 3 +++ arch/cris/arch-v10/lib/Makefile | 3 +++ arch/cris/arch-v32/lib/Makefile | 3 +++ arch/frv/Kconfig | 3 +++ arch/frv/lib/Makefile | 4 +++- arch/h8300/Kconfig | 3 +++ arch/h8300/lib/Makefile | 4 +++- arch/i386/Kconfig | 3 +++ arch/i386/lib/Makefile | 4 ++-- arch/ia64/Kconfig | 3 +++ arch/ia64/lib/Makefile | 3 ++- arch/m32r/Kconfig | 3 +++ arch/m32r/lib/Makefile | 3 ++- arch/m68k/Kconfig | 3 +++ arch/m68k/lib/Makefile | 4 +++- arch/m68knommu/Kconfig | 3 +++ arch/m68knommu/lib/Makefile | 4 +++- arch/mips/Kconfig | 3 +++ arch/mips/lib/Makefile | 3 ++- arch/parisc/Kconfig | 3 +++ arch/parisc/lib/Makefile | 3 ++- arch/powerpc/Kconfig | 3 +++ arch/ppc/Kconfig | 3 +++ arch/sh/Kconfig | 3 +++ arch/sh/lib/Makefile | 3 ++- arch/sh64/Kconfig | 3 +++ arch/sh64/lib/Makefile | 3 ++- arch/sparc/Kconfig | 3 +++ arch/sparc/lib/Makefile | 4 ++-- arch/sparc64/Kconfig | 3 +++ arch/sparc64/lib/Makefile | 3 ++- arch/um/Kconfig | 3 +++ arch/v850/Kconfig | 3 +++ arch/v850/lib/Makefile | 4 +++- arch/x86_64/Kconfig | 3 +++ arch/x86_64/lib/Makefile | 3 ++- arch/xtensa/Kconfig | 3 +++ arch/xtensa/lib/Makefile | 4 +++- drivers/md/Kconfig | 1 + fs/Kconfig | 1 + net/Kconfig | 1 + 49 files changed, 130 insertions(+), 22 deletions(-)
arch/x86_64/lib/Makefile +2 -1
@@ -6,8 +6,9 @@ CFLAGS_csum-partial.o := -funroll-loops obj-y := io.o iomap_copy.o obj-$(CONFIG_SMP) += msr-on-cpu.o +obj-$(CONFIG_CSUM_PARTIAL) += csum-partial.o -lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ +lib-y := csum-copy.o csum-wrappers.o delay.o \ usercopy.o getuser.o putuser.o \ thunk.o clear_page.o copy_page.o bitstr.o bitops.o lib-y += memcpy.o memmove.o memset.o copy_user.o rwlock.o copy_user_nocache.o
drivers/md/Kconfig +1 -0
@@ -15,6 +15,7 @@ config MD config BLK_DEV_MD tristate "RAID support" depends on MD + select CSUM_PARTIAL ---help--- This driver lets you combine several hard disk partitions into one logical block device. This can be used to simply append one
arch/x86_64/Kconfig +3 -0
@@ -121,6 +121,9 @@ config ARCH_HAS_ILOG2_U64 bool default n +config CSUM_PARTIAL + def_bool n + source "init/Kconfig"
arch/alpha/Kconfig +3 -0
@@ -66,6 +66,9 @@ config AUTO_IRQ_AFFINITY depends on SMP default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig"
arch/alpha/lib/Makefile +2 -1
@@ -17,7 +17,6 @@ lib-y = __divqu.o __remqu.o __divlu.o __ $(ev6-y)memset.o \ $(ev6-y)memcpy.o \ memmove.o \ - checksum.o \ csum_partial_copy.o \ $(ev67-y)strlen.o \ $(ev67-y)strcat.o \
@@ -42,6 +41,8 @@ lib-y = __divqu.o __remqu.o __divlu.o __ lib-$(CONFIG_SMP) += dec_and_lock.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o + # The division routines are built from single source, with different defines. AFLAGS___divqu.o = -DDIV AFLAGS___remqu.o = -DREM
arch/frv/Kconfig +3 -0
@@ -53,6 +53,9 @@ config ARCH_HAS_ILOG2_U64 bool default y +config CSUM_PARTIAL + def_bool n + mainmenu "Fujitsu FR-V Kernel Configuration" source "init/Kconfig"
arch/frv/lib/Makefile +3 -1
@@ -4,5 +4,7 @@ lib-y := \ __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \ - checksum.o memcpy.o memset.o atomic-ops.o \ + memcpy.o memset.o atomic-ops.o \ outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/h8300/Kconfig +3 -0
@@ -68,6 +68,9 @@ config PCI bool default n +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" source "arch/h8300/Kconfig.cpu"
arch/h8300/lib/Makefile +3 -1
@@ -5,4 +5,6 @@ .S.o: $(CC) $(AFLAGS) -D__ASSEMBLY__ -c $< -o $@ -lib-y = ashrdi3.o checksum.o memcpy.o memset.o abs.o romfs.o +lib-y = ashrdi3.o memcpy.o memset.o abs.o romfs.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/m32r/Kconfig +3 -0
@@ -31,6 +31,9 @@ config GENERIC_IRQ_PROBE config NO_IOPORT def_bool y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig"
arch/m32r/lib/Makefile +2 -1
@@ -2,6 +2,7 @@ # Makefile for M32R-specific library files.. # -lib-y := checksum.o ashxdi3.o memset.o memcpy.o \ +lib-y := ashxdi3.o memset.o memcpy.o \ delay.o strlen.o usercopy.o csum_partial_copy.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/sh64/Kconfig +3 -0
@@ -44,6 +44,9 @@ config ARCH_HAS_ILOG2_U64 bool default n +config CSUM_PARTIAL + def_bool n + source init/Kconfig menu "System type"
arch/sh64/lib/Makefile +2 -1
@@ -14,6 +14,7 @@ # # Panic should really be compiled as PIC -lib-y := udelay.o c-checksum.o dbg.o io.o panic.o memcpy.o copy_user_memcpy.o \ +lib-y := udelay.o dbg.o io.o panic.o memcpy.o copy_user_memcpy.o \ page_copy.o page_clear.o iomap.o +obj-$(CONFIG_CSUM_PARTIAL) += c-checksum.o
arch/v850/Kconfig +3 -0
@@ -49,6 +49,9 @@ config ARCH_HAS_ILOG2_U64 bool default n +config CSUM_PARTIAL + def_bool n + # Turn off some random 386 crap that can affect device config config ISA bool
arch/v850/lib/Makefile +3 -1
@@ -3,4 +3,6 @@ # lib-y = ashrdi3.o ashldi3.o lshrdi3.o muldi3.o negdi2.o \ - checksum.o memcpy.o memset.o + memcpy.o memset.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/parisc/Kconfig +3 -0
@@ -81,6 +81,9 @@ config ARCH_MAY_HAVE_PC_FDC depends on BROKEN default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig"
arch/parisc/lib/Makefile +2 -1
@@ -2,6 +2,7 @@ # Makefile for parisc-specific library files # -lib-y := lusercopy.o bitops.o checksum.o io.o memset.o fixup.o memcpy.o +lib-y := lusercopy.o bitops.o io.o memset.o fixup.o memcpy.o obj-y := iomap.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/ia64/Kconfig +3 -0
@@ -85,6 +85,9 @@ config AUDIT_ARCH bool default y +config CSUM_PARTIAL + def_bool n + choice prompt "System type" default IA64_GENERIC
arch/ia64/lib/Makefile +2 -1
@@ -3,10 +3,11 @@ # obj-y := io.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ - checksum.o clear_page.o csum_partial_copy.o \ + clear_page.o csum_partial_copy.o \ clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ flush.o ip_fast_csum.o do_csum.o \ memset.o strlen.o xor.o
arch/m68k/Kconfig +3 -0
@@ -45,6 +45,9 @@ config ARCH_MAY_HAVE_PC_FDC config NO_IOPORT def_bool y +config CSUM_PARTIAL + def_bool n + mainmenu "Linux/68k Kernel Configuration" source "init/Kconfig"
arch/m68k/lib/Makefile +3 -1
@@ -5,4 +5,6 @@ EXTRA_AFLAGS := -traditional lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ - checksum.o string.o semaphore.o uaccess.o + string.o semaphore.o uaccess.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/m68knommu/Kconfig +3 -0
@@ -56,6 +56,9 @@ config TIME_LOW_RES config NO_IOPORT def_bool y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "Processor type and features"
arch/m68knommu/lib/Makefile +3 -1
@@ -4,4 +4,6 @@ lib-y := ashldi3.o ashrdi3.o lshrdi3.o \ muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \ - checksum.o semaphore.o memcpy.o memset.o delay.o + semaphore.o memcpy.o memset.o delay.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/i386/Kconfig +3 -0
@@ -83,6 +83,9 @@ config DMI bool default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "Processor type and features"
arch/i386/lib/Makefile +2 -2
@@ -2,10 +2,10 @@ # Makefile for i386-specific library files.. # - -lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ +lib-y = delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ bitops.o semaphore.o lib-$(CONFIG_X86_USE_3DNOW) += mmx.o obj-$(CONFIG_SMP) += msr-on-cpu.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/cris/Kconfig +3 -0
@@ -51,6 +51,9 @@ config CRIS bool default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "General setup"
arch/cris/arch-v10/lib/Makefile +3 -0
@@ -7,3 +7,6 @@ EXTRA_AFLAGS := -traditional lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o +obj-y := +obj-m := +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/cris/arch-v32/lib/Makefile +3 -0
@@ -4,3 +4,6 @@ lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o spinlock.o +obj-y := +obj-m := +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/sh/Kconfig +3 -0
@@ -70,6 +70,9 @@ config ARCH_HAS_ILOG2_U64 bool default n +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "System type"
arch/sh/lib/Makefile +2 -1
@@ -3,7 +3,7 @@ # lib-y = delay.o memset.o memmove.o memchr.o \ - checksum.o strcasecmp.o strlen.o div64.o udivdi3.o \ + strcasecmp.o strlen.o div64.o udivdi3.o \ div64-generic.o memcpy-y := memcpy.o
@@ -11,3 +11,4 @@ memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o lib-y += $(memcpy-y) +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/sparc/Kconfig +3 -0
@@ -21,6 +21,9 @@ config GENERIC_ISA_DMA bool default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "General machine setup"
arch/sparc/lib/Makefile +2 -2
@@ -5,9 +5,9 @@ EXTRA_AFLAGS := -ansi -DST_DIV0=0x02 lib-y := mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \ - strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \ + strlen.o blockops.o memscan.o memcmp.o strncmp.o \ strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ copy_user.o locks.o atomic.o \ lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o -obj-y += iomap.o atomic32.o +obj-y += iomap.o atomic32.o checksum.o
arch/sparc64/Kconfig +3 -0
@@ -98,6 +98,9 @@ config SECCOMP If unsure, say Y. Only embedded should say N here. +config CSUM_PARTIAL + def_bool n + source kernel/Kconfig.hz source "init/Kconfig"
arch/sparc64/lib/Makefile +2 -1
@@ -6,7 +6,7 @@ EXTRA_AFLAGS := -ansi EXTRA_CFLAGS := -Werror lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \ - memscan.o strncpy_from_user.o strlen_user.o memcmp.o checksum.o \ + memscan.o strncpy_from_user.o strlen_user.o memcmp.o \ bzero.o csum_copy.o csum_copy_from_user.o csum_copy_to_user.o \ VISsave.o atomic.o bitops.o \ U1memcpy.o U1copy_from_user.o U1copy_to_user.o \
@@ -17,3 +17,4 @@ lib-y := PeeCeeI.o copy_page.o clear_pag mcount.o ipcsum.o rwsem.o xor.o delay.o obj-y += iomap.o +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/xtensa/Kconfig +3 -0
@@ -49,6 +49,9 @@ config ARCH_HAS_ILOG2_U64 config NO_IOPORT def_bool y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "Processor type and features"
arch/xtensa/lib/Makefile +3 -1
@@ -2,6 +2,8 @@ # Makefile for Xtensa-specific library files. # -lib-y += memcopy.o memset.o checksum.o strcasecmp.o \ +lib-y += memcopy.o memset.o strcasecmp.o \ usercopy.o strncpy_user.o strnlen_user.o lib-$(CONFIG_PCI) += pci-auto.o + +obj-$(CONFIG_CSUM_PARTIAL) += checksum.o
arch/mips/Kconfig +3 -0
@@ -12,6 +12,9 @@ config ZONE_DMA bool default y +config CSUM_PARTIAL + def_bool n + choice prompt "System type" default SGI_IP22
arch/mips/lib/Makefile +2 -1
@@ -2,11 +2,12 @@ # Makefile for MIPS-specific library files.. # -lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o strlen_user.o \ +lib-y += memcpy.o memcpy-inatomic.o memset.o strlen_user.o \ strncpy_user.o strnlen_user.o uncached.o obj-y += iomap.o obj-$(CONFIG_PCI) += iomap-pci.o +obj-$(CONFIG_CSUM_PARTIAL) += csum_partial.o # libgcc-style stuff needed in the kernel lib-y += ashldi3.o ashrdi3.o lshrdi3.o
arch/avr32/Kconfig +3 -0
@@ -68,6 +68,9 @@ config GENERIC_CALIBRATE_DELAY bool default y +config CSUM_PARTIAL + def_bool n + source "init/Kconfig" menu "System Type and features"
arch/avr32/lib/Makefile +3 -1
@@ -5,7 +5,9 @@ lib-y := copy_user.o clear_user.o lib-y += strncpy_from_user.o strnlen_user.o lib-y += delay.o memset.o memcpy.o findbit.o -lib-y += csum_partial.o csum_partial_copy_generic.o +lib-y += csum_partial_copy_generic.o lib-y += io-readsw.o io-readsl.o io-writesw.o io-writesl.o lib-y += io-readsb.o io-writesb.o lib-y += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o + +obj-$(CONFIG_CSUM_PARTIAL) += csum_partial.o
arch/arm/lib/Makefile +3 -1
@@ -4,7 +4,7 @@ # Copyright (C) 1995-2000 Russell King # -lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ +lib-y := backtrace.o changebit.o csumipv6.o \ csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ delay.o findbit.o memchr.o memcpy.o \ memmove.o memset.o memzero.o setbit.o \
@@ -42,5 +42,7 @@ lib-$(CONFIG_ARCH_CLPS7500) += io-acorn. lib-$(CONFIG_ARCH_L7200) += io-acorn.o lib-$(CONFIG_ARCH_SHARK) += io-shark.o +obj-$(CONFIG_CSUM_PARTIAL) += csumpartial.o + $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
arch/arm26/Kconfig +3 -0
@@ -70,6 +70,9 @@ config GENERIC_ISA_DMA config ARCH_MAY_HAVE_PC_FDC bool +config CSUM_PARTIAL + def_bool n + source "init/Kconfig"
arch/arm26/lib/Makefile +3 -1
@@ -4,7 +4,7 @@ # Copyright (C) 1995-2000 Russell King # -lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ +lib-y := backtrace.o changebit.o csumipv6.o \ csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ copy_page.o delay.o findbit.o memchr.o memcpy.o \ memset.o memzero.o setbit.o \
@@ -21,6 +21,8 @@ lib-n := lib-$(CONFIG_VT)+= kbd.o +obj-$(CONFIG_CSUM_PARTIAL) += csumpartial.o + csumpartialcopy.o: csumpartialcopygeneric.S csumpartialcopyuser.o: csumpartialcopygeneric.S
arch/powerpc/Kconfig +3 -0
@@ -118,6 +118,9 @@ config DEFAULT_UIMAGE Used to allow a board to specify it wants a uImage built by default default n +config CSUM_PARTIAL + def_bool y + menu "Processor support" choice prompt "Processor Type"
arch/arm/Kconfig +3 -0
@@ -129,6 +129,9 @@ config VECTORS_BASE help The base address of exception vectors. +config CSUM_PARTIAL + def_bool y + source "init/Kconfig" menu "System Type"
fs/Kconfig +1 -0
@@ -326,6 +326,7 @@ config REISERFS_PROC_INFO config REISERFS_FS_XATTR bool "ReiserFS extended attributes" depends on REISERFS_FS + select CSUM_PARTIAL help Extended attributes are name:value pairs associated with inodes by the kernel or by users (see the attr(5) manual page, or visit
net/Kconfig +1 -0
@@ -6,6 +6,7 @@ menu "Networking" config NET bool "Networking support" + select CSUM_PARTIAL ---help--- Unless you really know what you are doing, you should say Y here. The reason is that some programs need kernel networking support even
arch/ppc/Kconfig +3 -0
@@ -43,6 +43,9 @@ config PPC32 bool default y +config CSUM_PARTIAL + def_bool y + # All PPCs use generic nvram driver through ppc_md config GENERIC_NVRAM bool
arch/um/Kconfig +3 -0
@@ -60,6 +60,9 @@ config IRQ_RELEASE_METHOD bool default y +config CSUM_PARTIAL + def_bool y + menu "UML-specific options" config MODE_TT
Quoted 7 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fixes kernel bugzilla #8242:
Move
csum_partial()from lib-y to obj-$(CONFIG_CSUM_PARTIAL) so that modules can use it.
Quoted 6 lines
CONFIG_BLK_DEV_MD(md/raid driver) needscsum_partial(), even whenCONFIG_NET=nand BLK_DEV_MD=m, so build it as an object to force it being built and available.REISERFS with XATTR=y also needs
csum_partial(), so that is enforced here.
They are all broken because csum_partial gives different values
on different architectures. You're just extending that to
possibly more subsystems.
-Andi
Quoted 13 lines · Andi Kleen
Quoted 11 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fixes kernel bugzilla #8242:
Move
csum_partial()from lib-y to obj-$(CONFIG_CSUM_PARTIAL) so that modules can use it.
CONFIG_BLK_DEV_MD(md/raid driver) needscsum_partial(), even whenCONFIG_NET=nand BLK_DEV_MD=m, so build it as an object to force it being built and available.
Quoted 6 lines
Quoted 2 lines
REISERFS with XATTR=y also needs
csum_partial(), so that is enforced here.They are all broken because
csum_partialgives different values
on different architectures. You're just extending that to
possibly more subsystems.
So the ones that can be localized (BLK_DEV_MD and REISERFS) should have their own versions?
How does the networking code work across multiple architectures?
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 17 lines · Randy Dunlap
Quoted 16 lines · Andi Kleen
Quoted 13 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fixes kernel bugzilla #8242:
Move
csum_partial()from lib-y to obj-$(CONFIG_CSUM_PARTIAL) so that modules can use it.
CONFIG_BLK_DEV_MD(md/raid driver) needscsum_partial(), even whenCONFIG_NET=nand BLK_DEV_MD=m, so build it as an object to force it being built and available.REISERFS with XATTR=y also needs
csum_partial(), so that is enforced here.
Quoted 6 lines
Quoted 3 lines
They are all broken because
csum_partialgives different values
on different architectures. You're just extending that to
possibly more subsystems.So the ones that can be localized (
BLK_DEV_MDand REISERFS) should have their own versions?
They would need some compat code to still be able to read old versions and a new format that is portable.
Currently it means you likely have architecture specific MD and reiserfs data structures on disk which is broken.
BTW It might be better to just switch to a stronger checksum. The TCP checksum is quite weak and we already have CRC functions.
Quoted 1 line
How does the networking code work across multiple architectures?
It folds the csum_partial output together with a pseudo header into the final checksum. Just skipping the folding step is broken because the presentation before that is architecture specific. e.g. some hold it in 32bit and others in 64bit.
-Andi
David Miller
maintainerFrom: Randy Dunlap <[email protected]>
Date: Tue, 03 Apr 2007 12:09:33 -0700
Quoted 1 line
How does the networking code work across multiple architectures?
This has been discussed before.
The csum_partial() result value is only well defined modulo 0xffff.
The networking does csum_fold() or similar on the results, and so the right thing always happens there.
The reiserfs case is the worst because even ignoring the differences in csum_partial() return values, it always feeds this into cpu_to_le32() which basically means that it is putting a cpu-endian dependent value onto disk. csum_partial() returns a fixed-endian, not cpu endian, value. So feeding it into cpu_to_anything() is quite wrong.
Quoted 12 lines · David Miller
From: Randy Dunlap <[email protected]>
Date: Tue, 03 Apr 2007 12:09:33 -0700Quoted 1 line
How does the networking code work across multiple architectures?
This has been discussed before.
The
csum_partial()result value is only well defined modulo0xffff.The networking does
csum_fold()or similar on the results, and so the right thing always happens there.
Quoted 6 lines
The reiserfs case is the worst because even ignoring the differences in
csum_partial()return values, it always feeds this intocpu_to_le32()which basically means that it is putting a cpu-endian dependent value onto disk.csum_partial()returns a fixed-endian, not cpu endian, value. So feeding it intocpu_to_anything()is quite wrong.
Thanks David and Andi. I get it.
Signature · 2 lines
~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***