lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] RFC: linking multiple pbuf chains ("pbuf queue")


From: leon . woestenberg
Subject: [lwip-users] RFC: linking multiple pbuf chains ("pbuf queue")
Date: Tue, 29 Apr 2003 12:26:28 +0200


In order to support queueing, I have this proposed change for the pbuf structures.

The change is transparent to the current code IF the algorithm for finding the
last pbuf in a packet uses the ->tot_len and ->len fields instead of the ->next
field.

I will traverse through the current lwIP code to see that this is the case first
before committing anything.

Packet queueing can then be implemented transparently in ARP, as it will
dequeue the packets itself (so that Ethernet drivers only receive single
packet pbuf chains). A next proposal would be that Ethernet drivers can
handle packet queues themselves.

Leon.

/**
 * @file
 * Packet buffer management
 *
 * Packets are built from the pbuf data structure. It supports dynamic
 * memory allocation for packet contents or can reference externally
 * managed packet contents both in RAM and ROM. Quick allocation for
 * incoming packets is provided through pools with fixed sized pbufs.
 *
 * A packet may span over multiple pbufs, chained as a singly linked
 * list. This is called a "pbuf chain".
 *
 * Multiple packets may be queued using this singly linked list. This
 * is called a "pbuf queue". So, a pbuf queue consists of one or more
 * pbuf chains, each of which consist of one or more pbufs.
 *
 * In order to find the last pbuf of a packet, traverse the linked list
 * until the ->tot_len field equals the ->len field. If the ->next field
 * of this packet is not NULL, more packets are on the queue.
 */
reply via email to

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