F-Stack / f-stack

F-Stack is an user space network development kit with high performance based on DPDK, FreeBSD TCP/IP stack and coroutine API.
http://www.f-stack.org
Other
3.82k stars 891 forks source link

Support for arm64? #152

Open shockx2 opened 6 years ago

shockx2 commented 6 years ago

I tried to port f-stack with reference board include SoC that support DPDK. (SoC vender: NXP or Marvell...) I modifed lib/Makefile and complete cross compile. But, Segmentation fault occured in ff_freebsd_init() Do you have any plan to support arm64 architecture? And Do you have nice idea to resolve the Segmentation fault?

0 get_curthread () at ./machine_include/machine/pcpu.h:62

1 0x000000000042d988 in sysctl_load_tunable_by_oid_locked (

oidp=0x7d5390 <sysctl___kern_smp_disabled>)
at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:221

2 0x000000000042e03c in sysctl_register_oid (

oidp=0x7d5390 <sysctl___kern_smp_disabled>)
at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:423

3 0x000000000042ebfc in sysctl_register_all (arg=0x0)

at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:797

4 0x00000000004075c0 in mi_startup () at ff_init_main.c:260

5 0x00000000004070c0 in ff_freebsd_init () at ff_freebsd_init.c:111

6 0x0000000000510234 in ff_init (argc=5, argv=0x7ffffffc28) at ff_init.c:47

Thread 1 "udp_receiver" hit Breakpoint 4, get_curthread () at ./machine_include/machine/pcpu.h:62 62 asm volatile("ldr %0, [x18]" : "=&r"(td)); (gdb) list 57 static inline struct thread 58 get_curthread(void) 59 { 60 struct thread td; 61 62 asm volatile("ldr %0, [x18]" : "=&r"(td)); 63 return (td); 64 } 65 66 #define curthread get_curthread()

whl739 commented 6 years ago

Do you have any plan to support arm64 architecture?

No, becuase we don't have any arm64 machine for now.

About the segment fault, it seemed that you havn't include the lib/include/machine/pcpu.h first. See the file:

#include_next <machine/pcpu.h>

#undef __curthread

static __inline struct thread *
__curthread_ff(void)
{
    return (pcurthread);
}
#define __curthread __curthread_ff

Or, maybe you need add:

#undef curthread
jeff-lv-github commented 2 years ago

I tried to port f-stack with reference board include SoC that support DPDK. (SoC vender: NXP or Marvell...) I modifed lib/Makefile and complete cross compile. But, Segmentation fault occured in ff_freebsd_init() Do you have any plan to support arm64 architecture? And Do you have nice idea to resolve the Segmentation fault?

0 get_curthread () at ./machine_include/machine/pcpu.h:62 #1 0x000000000042d988 in sysctl_load_tunable_by_oid_locked ( oidp=0x7d5390 ) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:221 #2 0x000000000042e03c in sysctl_register_oid ( oidp=0x7d5390 ) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:423 #3 0x000000000042ebfc in sysctl_register_all (arg=0x0) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:797 #4 0x00000000004075c0 in mi_startup () at ff_init_main.c:260 #5 0x00000000004070c0 in ff_freebsd_init () at ff_freebsd_init.c:111 #6 0x0000000000510234 in ff_init (argc=5, argv=0x7ffffffc28) at ff_init.c:47

Thread 1 "udp_receiver" hit Breakpoint 4, get_curthread () at ./machine_include/machine/pcpu.h:62 62 asm volatile("ldr %0, [x18]" : "=&r"(td)); (gdb) list 57 static inline struct thread 58 get_curthread(void) 59 { 60 struct thread td; 61 62 asm volatile("ldr %0, [x18]" : "=&r"(td)); 63 return (td); 64 } 65 66 #define curthread get_curthread()

I am porting the project to arm64 and meet some crash problems; Could you share your setps in porting f-stack?

jeff-lv-github commented 2 years ago

Do you have any plan to support arm64 architecture?

No, becuase we don't have any arm64 machine for now.

About the segment fault, it seemed that you havn't include the lib/include/machine/pcpu.h first. See the file:

#include_next <machine/pcpu.h>

#undef __curthread

static __inline struct thread *
__curthread_ff(void)
{
    return (pcurthread);
}
#define __curthread __curthread_ff

Or, maybe you need add:

#undef curthread

Could you share the experience about porting freebsd in x86?