1*4b83e99eSJens Axboesysfs interface 2*4b83e99eSJens Axboe--------------- 3*4b83e99eSJens AxboeThe pktcdvd module (packet writing driver) creates the following files in the 4*4b83e99eSJens Axboesysfs: (<devid> is in the format major:minor) 5*4b83e99eSJens Axboe 6*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/add 7*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/remove 8*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/device_map 9*4b83e99eSJens AxboeDate: Oct. 2006 10*4b83e99eSJens AxboeKernelVersion: 2.6.20 11*4b83e99eSJens AxboeContact: Thomas Maier <balagi@justmail.de> 12*4b83e99eSJens AxboeDescription: 13*4b83e99eSJens Axboe 14*4b83e99eSJens Axboe ========== ============================================== 15*4b83e99eSJens Axboe add (WO) Write a block device id (major:minor) to 16*4b83e99eSJens Axboe create a new pktcdvd device and map it to the 17*4b83e99eSJens Axboe block device. 18*4b83e99eSJens Axboe 19*4b83e99eSJens Axboe remove (WO) Write the pktcdvd device id (major:minor) 20*4b83e99eSJens Axboe to remove the pktcdvd device. 21*4b83e99eSJens Axboe 22*4b83e99eSJens Axboe device_map (RO) Shows the device mapping in format: 23*4b83e99eSJens Axboe pktcdvd[0-7] <pktdevid> <blkdevid> 24*4b83e99eSJens Axboe ========== ============================================== 25*4b83e99eSJens Axboe 26*4b83e99eSJens Axboe 27*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/dev 28*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/uevent 29*4b83e99eSJens AxboeDate: Oct. 2006 30*4b83e99eSJens AxboeKernelVersion: 2.6.20 31*4b83e99eSJens AxboeContact: Thomas Maier <balagi@justmail.de> 32*4b83e99eSJens AxboeDescription: 33*4b83e99eSJens Axboe dev: (RO) Device id 34*4b83e99eSJens Axboe 35*4b83e99eSJens Axboe uevent: (WO) To send a uevent 36*4b83e99eSJens Axboe 37*4b83e99eSJens Axboe 38*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started 39*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished 40*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written 41*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read 42*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather 43*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset 44*4b83e99eSJens AxboeDate: Oct. 2006 45*4b83e99eSJens AxboeKernelVersion: 2.6.20 46*4b83e99eSJens AxboeContact: Thomas Maier <balagi@justmail.de> 47*4b83e99eSJens AxboeDescription: 48*4b83e99eSJens Axboe packets_started: (RO) Number of started packets. 49*4b83e99eSJens Axboe 50*4b83e99eSJens Axboe packets_finished: (RO) Number of finished packets. 51*4b83e99eSJens Axboe 52*4b83e99eSJens Axboe kb_written: (RO) kBytes written. 53*4b83e99eSJens Axboe 54*4b83e99eSJens Axboe kb_read: (RO) kBytes read. 55*4b83e99eSJens Axboe 56*4b83e99eSJens Axboe kb_read_gather: (RO) kBytes read to fill write packets. 57*4b83e99eSJens Axboe 58*4b83e99eSJens Axboe reset: (WO) Write any value to it to reset 59*4b83e99eSJens Axboe pktcdvd device statistic values, like 60*4b83e99eSJens Axboe bytes read/written. 61*4b83e99eSJens Axboe 62*4b83e99eSJens Axboe 63*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size 64*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off 65*4b83e99eSJens AxboeWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on 66*4b83e99eSJens AxboeDate: Oct. 2006 67*4b83e99eSJens AxboeKernelVersion: 2.6.20 68*4b83e99eSJens AxboeContact: Thomas Maier <balagi@justmail.de> 69*4b83e99eSJens AxboeDescription: 70*4b83e99eSJens Axboe ============== ================================================ 71*4b83e99eSJens Axboe size (RO) Contains the size of the bio write queue. 72*4b83e99eSJens Axboe 73*4b83e99eSJens Axboe congestion_off (RW) If bio write queue size is below this mark, 74*4b83e99eSJens Axboe accept new bio requests from the block layer. 75*4b83e99eSJens Axboe 76*4b83e99eSJens Axboe congestion_on (RW) If bio write queue size is higher as this 77*4b83e99eSJens Axboe mark, do no longer accept bio write requests 78*4b83e99eSJens Axboe from the block layer and wait till the pktcdvd 79*4b83e99eSJens Axboe device has processed enough bio's so that bio 80*4b83e99eSJens Axboe write queue size is below congestion off mark. 81*4b83e99eSJens Axboe A value of <= 0 disables congestion control. 82*4b83e99eSJens Axboe ============== ================================================ 83*4b83e99eSJens Axboe 84*4b83e99eSJens Axboe 85*4b83e99eSJens AxboeExample: 86*4b83e99eSJens Axboe-------- 87*4b83e99eSJens AxboeTo use the pktcdvd sysfs interface directly, you can do:: 88*4b83e99eSJens Axboe 89*4b83e99eSJens Axboe # create a new pktcdvd device mapped to /dev/hdc 90*4b83e99eSJens Axboe echo "22:0" >/sys/class/pktcdvd/add 91*4b83e99eSJens Axboe cat /sys/class/pktcdvd/device_map 92*4b83e99eSJens Axboe # assuming device pktcdvd0 was created, look at stat's 93*4b83e99eSJens Axboe cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written 94*4b83e99eSJens Axboe # print the device id of the mapped block device 95*4b83e99eSJens Axboe fgrep pktcdvd0 /sys/class/pktcdvd/device_map 96*4b83e99eSJens Axboe # remove device, using pktcdvd0 device id 253:0 97*4b83e99eSJens Axboe echo "253:0" >/sys/class/pktcdvd/remove 98