lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] asynchronous transmissions


From: Olaf Peters
Subject: RE: [lwip-users] asynchronous transmissions
Date: Fri, 17 Jun 2005 10:06:50 +0200

Adrian,

Regarding 3: the ARP queuing mechanism does increase the reference count,
via a call to pbuf_ref(). See the following statements in etharp_query():

        /* queue packet ... */
        if (arp_table[i].p == NULL) {
                /* ... in the empty queue */
                pbuf_ref(p);
                arp_table[i].p = p;
#if 0 /* multi-packet-queueing disabled, see bug #11400 */
        } else {
                /* ... at tail of non-empty queue */
          pbuf_queue(arp_table[i].p, p);
#endif
        }

So you could do pbuf_take() followed by pbuf_ref() to keep things in your
driver until transmitted. After transmission you can call pbuf_free().

Olaf.

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Adrian Godwin
Sent: donderdag 16 juni 2005 16:03
To: Mailing list for lwIP users
Subject: [lwip-users] asynchronous transmissions

Lwip expects pbufs to have been used when the ip output routine
has completed, so that they can be freed if necessary. The ARP
mechanism, which might delay transmission while an ARP response
is obtained, copies the pbuf in order to achieve this.

I'm using lwip with an ethernet driver that accepts a chain of
buffers and executes a callback when the last has been sent.

I could either :

1. Copy the pbufs with pbuf_take and then transmit the copies

2. Wait for completion of transmission (a semaphore on
the callback) before returning from the output routine.

Either of these is less efficient than the driver allows,
which seems a shame. I'd prefer to :

3. Increase the reference count to the pbuf chain and
free it in the callback. But presumably if this were
possible, the ARP queue would do it, too.

Can anyone suggest a better method, please ?

-adrian



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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