lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Threading Question using LWIP with TM4C1294NCPDT


From: vr roriz
Subject: Re: [lwip-users] Threading Question using LWIP with TM4C1294NCPDT
Date: Fri, 26 Oct 2018 10:27:29 +0200

> and only one interrupt runs at a time and isn't interrupted by another 
> interrupt while using
lwIP - you should be safe.

Simon, could you clarify why nesting interrupts are a problem and
non-nesting are not? Do you mean that, if an interrupt executes lwIP
code then it should not be interrupted by another?
My interrupts never execute lwIP code, they just trigger processes
that run lwIP, and all of these processes have the same priority.
Before I was not experiecing problems, while I had one interrupt
(timer) triggerig a process to call network_timeouts_checker and one
interrupt (ETH controller) to trigger a process to handle income ETH
Rx data. Now, I am trying to also trigger a process to handle ETH Tx
transmission done and I am always having an exception (data access
asynchronous error) at tcp_output, at:

       /* In the case of fast retransmit, the packet should not go to the tail
         * of the unacked queue, but rather somewhere before it. We
need to check for
         * this case. -STJ Jul 27, 2004 */
        if (TCP_SEQ_LT(lwip_ntohl(seg->tcphdr->seqno),
lwip_ntohl(useg->tcphdr->seqno))) {

Would you have some insight/comment?

MfG,
Vitor
Em seg, 22 de out de 2018 às 20:16, address@hidden
<address@hidden> escreveu:
>
> On 18.10.2018 22:27, Terence Darwen wrote:
> > I'm using LWIP for TCP/IP communication on a TI Tiva microcontroller
> > (a TM4C1294NCPDT).  TI includes LWIP 1.4.1 in its TivaWare package.
> > I've read that LWIP is not threadsafe, however, I'm not sure exactly
> > what that means in my context where I'm using it with no operating
> > system on the single core TI Tiva microcontroller.
> > [..]
> > Can anyone please clarify?  Thank you.
>
> Honestly, I don't know the setup of this TI port. However, I can clarify
> on the "not threadsafe" thing:
>
> lwIP does *not* include locking schemes to protect against being called
> from multiple threads *or* from a thread/main-loop and/or one or more
> interrupt levels at the same time.
> There is some protection (a.k.a. "lightweight prot"), but that mainly
> covers pool allocation.
>
> So if this port is written in a way that calls to lwIP don't run from
> main loop and from interrupt at the same time - and only one interrupt
> runs at a time and isn't interrupted by another interrupt while using
> lwIP - you should be safe.
>
> I can't tell you if it is that way for your port, though.
>
>
> Simon
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]