packed ring layout proposal v3
Hi Michael,
I'm trying to understand your Sep 28 13:32 example (text copied below). I've in-lined my questions [#lga#].
Quoted 11 lines
Let's assume device promised to consume packets in order
ring size = 2
Ring is 0 initialized.
Device initially polls DESC[0].flags for WRAP bit to change.
driver adds:
Quoted 7 lines
DESC[0].addr = 1234
DESC[0].id = 0
DESC[0].flags =DESC_DRIVER|DESC_MORE|DESC_WRAPand
DESC[0].addr = 5678
[#lga#] Is index 0 above a typo (makes more sense if it is 1)?
Quoted 11 lines
DESC[1].id = 1
DESC[1].flags =DESC_DRIVER|DESC_WRAPit now starts polling DESC[0] flags.
Device reads 1234, executes it, does not use it.
Device reads 5678, executes it, and uses it:
DESC[0].id = 1
DESC[0].flags = 0
[#lga#] Should above line be: "DESC[0].flags = DESC[1].flags & DESC_WRAP"?
Quoted 5 lines
Device now polls DESC[0].flags for WRAP bit to change.
Now driver sees that DRIVER bit has been cleared, so it nows that id is valid. I sees id 1, therefore id 0 and 1 has been read and are safe to overwrite.
[#lga#] At this point, has the device returned both buffers *(1234) and *(5678) to the driver? [#lga#] If so, how would out-of-order completion avoid head of line blocking? [#lga#] E.g. the device is done with id=1 and *(5678), but not id=0 and *(1234).
Quoted 11 lines
So it writes it out. It wrapped around to beginning of ring, so it flips the WRAP bit to 0 on all descriptors now:
DESC[0].addr = 9ABC
DESC[0].id = 0
DESC[0].flags =DESC_DRIVER|DESC_MOREDESC[0].addr = DEF0
DESC[0].id = 1
DESC[0].flags =DESC_DRIVER
[#lga#] Index typo in all 3 lines above? DESC[1] makes more sense.
Quoted 8 lines
Next round wrap will be 1 again.
To summarise:
DRIVER bit is used by driver to detect device has used one or more descriptors. WRAP is is used by device to detect driver has made a new descriptor available.
Best Regards,
-Lars
Disclaimer: This email and any files transmitted with it may contain confidential information intended for the addressee(s) only. The information is not to be surrendered or copied to unauthorized persons. If you have received this communication in error, please notify the sender immediately and delete this e-mail from your system.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]