On Tue, 27 Nov 2012 14:45:13 +0800
Jason Wang <jasowang@xxxxxxxxxx> wrote:
On 11/27/2012 01:37 AM, Stephen Hemminger wrote:Yes. Register a destructor that does something like update a counter (number of packets pending),On Mon, 26 Nov 2012 15:56:52 +0800Hi Stephen:
Jason Wang <jasowang@xxxxxxxxxx> wrote:
Some deivces do not free the old tx skbs immediately after it has been sentAnother alternative would be using skb_orphan() and skb->destructor.
(usually in tx interrupt). One such example is virtio-net which optimizes for
virt and only free the possible old tx skbs during the next packet sending. This
would lead the pktgen to wait forever in the refcount of the skb if no other
pakcet will be sent afterwards.
Solving this issue by introducing a new flag IFF_TX_SKB_FREE_DELAY which could
notify the pktgen that the device does not free skb immediately after it has
been sent and let it not to wait for the refcount to be one.
Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
There are other cases where skb's are not freed right away.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Do you mean registering a skb->destructor for pktgen then set and check
bits in skb->tx_flag?
then just spin while number of packets pending is over threshold.
--