Am 26.07.2021 um 14:31 schrieb Ibtisam Tariq:
> Hi,
>
> I am creating an app by integrating lwIP with DPDK. I am using
> socket-level APIs. For receiving packets from the interface and
> processing, there are two threads.
> Thread-1: Receiving packets from the interface, call pbuf_alloc to
> transfer packet data into pbuf and then call netif->input.
> Thread-2: lwIP core thread: tcpip_thread.
>
> If I run both threads on one core, they work fine. But if I run both on
> separate cores using pthread_setaffinity_np() it gives an error after ~5
> minutes. The error is :
> /Assertion "memp sanity" failed at line 389 in
> ../lwip/contrib/../src/core/memp.c /

Sorry for taking so long to answer this, but I hope the answer still helps:

I suspect that the sys_arch_protect/unprotect macros are not correctly
set up for multiprocessing. For a single core, the default behaviour is
to lock interrupts and therefore to prevent a task switch (as we don't
call OS functions leading to a task switch in locked sections).

When you have multiple CPUs, multiple threads can run concurrently on
your system. That means locking interrupts is not enough and you will
have to convert sys_arch_protect/unprotect to lock by using a mutex.

Regards,
Simon

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to