Subject: Re: [PATCH] Packet socket: mmapped IO: PACKET_TX_RING

From: Evgeniy Polyakov <[email-masked]>
Date: Wed, 12 Nov 2008 16:58:28 +0300

Hi.

On Wed, Nov 12, 2008 at 02:43:07PM +0100, Johann Baudy ([email-masked]) wrote:
> Thanks a lot for this list :)
> So for example, is using of skb->mark to store a buffer index a good solution ?
> Or do you prefer another solution?

Qdisk uses various classification models, and for example dsmark uses
skb->mark in particular. Most of others use priority field. tc_verd is
used to store classification verdict.

> > At the first place I do not understand, why do you want to change the
> > skb, since you can mmap whatever area you need and provide those pages
> > into skb, which at free time will drop the reference counter. Skb lives
> > in socket queue, so until it is empty you can sleep not allowing mapped
> > buffer to shrink.
> We need to get the tpacket_hdr associated to data in skb in order to
> inform user that buffer is now available (This is done through status
> field, which is not sent over the network). What do you mean with
> "provide those pages", through frags? If yes, is it ok when frags are
> linearized?

Hmm, for example splice() is supposed to do the same what you have, but
because of udp_send*() limitations it can't. Splice does not care if
data was overwritten during transfer, i.e. when ->sendpage() returns all
code assumes that data has been successfully transmitted, so userspace
can overwrite mapped area or file content, and this new data will
actually be transmitted. I believe you can use the same model and do not
care about userspace notifications after execution returned to the
userspace from the 'sending call'.

-- 
	Evgeniy Polyakov