Legacy Networking | PowerPC in_cksum() requires optimization (#15)

Trac Migrate (@tracmigrate) gitlab at rtems.org
Fri Jan 31 00:31:54 UTC 2025



Trac Migrate created an issue: https://gitlab.rtems.org/rtems/pkg/rtems-net-legacy/-/issues/15

Assignee: Trac Migrate

Original author: dufault

I had built with optimization off for debugging.  Without optimization the in_cksum() in rtems/cpukit/libnetworking/netinet/in_cksum_powerpc.h is returning 1.  With -O2 in effect it is returning 0.

I put a breakpoint after the call to in_cksum() (tcp_input.c:320) with the only change recompiling tcp_input.c with and without optimization.

Checksum with tcp_input.c compiled with -O2:
(gdb) print ti->ti_t.th_sum
$1 = 0x0
(gdb)

Checksum with tcp_input.c compiled without any optimization:
(gdb) print ti->ti_t.th_sum
$1 = 0x1
(gdb)

This is for the MPC5554, with the same compilation flags as for the MPC55xxevb.  Here is what the compilation line is for in_cksum.c and tcp_input.c (with -O2 taken out and I added -DDEBUG=1):

powerpc-rtems4.10-gcc --pipe -DHAVE_CONFIG_H   -I.. -I../../cpukit/../../../mpc5554som/lib/include -I../../../../../../rtems-4.9.99.0/c/src/../../cpukit/libnetworking -DINET -DNFS -DDIAGNOSTIC -DBOOTP_COMPAT -D_KERNEL -D__BSD_VISIBLE  -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -fasm -mcpu=8540 -meabi -msdata -fno-common -msoft-float -DDEBUG=1 -D__ppc_generic -mstrict-align -g -fno-keep-inline-functions -MT netinet/libnetworking_a-in_cksum.o -MD -MP -MF netinet/.deps/libnetworking_a-in_cksum.Tpo -c -o netinet/libnetworking_a-in_cksum.o `test -f 'netinet/in_cksum.c' || echo '../../../../../../rtems-4.9.99.0/c/src/../../cpukit/libnetworking/'`netinet/in_cksum.c

powerpc-rtems4.10-gcc --pipe -DHAVE_CONFIG_H   -I.. -I../../cpukit/../../../mpc5554som/lib/include -I../../../../../../rtems-4.9.99.0/c/src/../../cpukit/libnetworking -DINET -DNFS -DDIAGNOSTIC -DBOOTP_COMPAT -D_KERNEL -D__BSD_VISIBLE  -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -fasm -mcpu=8540 -meabi -msdata -fno-common -msoft-float -DDEBUG=1 -D__ppc_generic -mstrict-align -g -fno-keep-inline-functions -MT netinet/libnetworking_a-tcp_input.o -MD -MP -MF netinet/.deps/libnetworking_a-tcp_input.Tpo -c -o netinet/libnetworking_a-tcp_input.o `test -f 'netinet/tcp_input.c' || echo '../../../../../../rtems-4.9.99.0/c/src/../../cpukit/libnetworking/'`netinet/tcp_input.c

* [in_cksum_powerpc.h](/assets/tracmigration/ticket_attachments/in_cksum_powerpc.h)
* [in_cksum_powerpc.h.freebsd](/assets/tracmigration/ticket_attachments/in_cksum_powerpc.h.freebsd)
* [in_cksum_powerpc_v1.h](/assets/tracmigration/ticket_attachments/in_cksum_powerpc_v1.h)


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-net-legacy/-/issues/15
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250131/6e76e76a/attachment.htm>


More information about the bugs mailing list