linux/Documentation/target/tcm_mod_builder.txt
<<
v7io > /spa22" > /form2" > a v7io > href="../linux+v3 22/Documenta12.2/target/tcm_mod_builder.txt">v7io > img src="../.sta12c/gfx/right.png" alt=">>">v7 /spa22"v7 spa2 class="lxr_search">v7iov7io > input typ/ophidden" nam/opnavtarget"2.22v7io > input typ/optext" nam/opsearch" idopsearch">v7io > butt.12typ/opsubmit">Search /form2" /spa22"v7 spa2 class="lxr_prefs"2" > a href="+prefs?return=Documenta12.2/target/tcm_mod_builder.txt"v7io > onclick="return ajax_prefs();">v7io >Prefs" > /a>v7 /spa22"io > > /div2"io > > form ac12.2="ajax+*" method="post" onsubmit="return false;">v7 input typ/ophidden" nam/opajax_lookup" idopajax_lookup" .22vio > > /form2"vio > > div class="headingbott.m"> > > div idopsearch_results" class="search_results"" 2"io > > /div2" div idopcontent"2" div idopfile_contents"2
> >1
/a>>>>>>>>>>> The TCM v4 fabric module script generator <<<<<<<<<<
> >2
/a>v> >3
/a>Greetings all,v> >4
/a>v> >5
/a>This document is intended to be a mini-HOWTO for using the tcm_mod_builder.pyv> >6
/a>script to generate a brand new func12.2al TCM v4 fabric .ko module of your very own,v> >7
/a>that once built ca2 be immediately be loaded to start access the new TCM/ConfigFSv> >8
/a>fabric skelet.1, by simply using:v> >9
/a>v> 9av/a>        modprobe $TCM_NEW_MODv> 11v/a>        mkdir -p /sys/kernel/config/target/$TCM_NEW_MODv> 12
/a>v> 13
/a>This script will create a new drivers/target/$TCM_NEW_MOD/, and will do the followingv> 14
/a>v> 15v/a>        *) Generate new API callers for drivers/target/target_core_fabric_configs.c logicv> 16v/a>           ->make_nodeacl(), ->drop_nodeacl(), ->make_tpg(), ->drop_tpg()v> 17v/a>           ->make_wwn(), ->drop_wwn().  These are created into $TCM_NEW_MOD/$TCM_NEW_MOD_configfs.cv> 18v/a>        *) Generate basic infrastructure for loading/unloading LKMs and TCM/ConfigFS fabric modulev> 19v/a>           using a skelet.1 struct target_core_fabric_ops API template.
> 20v/a>        *) Based .1 user defined T10>Proto_Ident for the new fabric module being built,v> 21v/a>           the TransportID / Initiator and Target WWPN related handlers forv> 22v/a>           SPC-3 persistent reserva12.2 are aut.ma12cally generated in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.cv> 23v/a>           using drivers/target/target_core_fabric_lib.c logic.
> 24v/a>        *) NOP API calls for all other Data I/O path and fabric dependent attribute logicv> 25v/a>           in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.cv> 26
/a>v> 27
/a>tcm_mod_builder.py depends up.12the mandatory '-p $PROTO_IDENT' and '-mv> 28v/a>$FABRIC_MOD_nam/' param/ters, and actually running the script looks like:v> 29
/a>v> 30v/a>target:/mnt/sdb/liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod# pythandauilder.py depends O_IiSCSI -mdauilnab5000="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL21" clas3="line" nam/opL21">> 213/a>  31mod_builsys: /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL22" clas3="line" nam/opL22">> 223/a>  3     Srelib.c loder.2">>:dauilnab5000="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL3" class=="line" nam/opL3">> >3
//a>  33    Srelib.c loder.sys:="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL24" clas3="line" nam/opL24">> 243/a>  3     /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL25" clas3="line" nam/opL25">> 253/a>  3     Uvers/pnt foiribu:IiSCSI="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL26" clas3="line" nam/opL26">> 263/a>v<3 hrefCnto ers/ib.c loder.sys:="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL27" clas3="line" nam/opL27">> 273/a>tc37    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000="Documenta12.2/target/tcm_mod_builder.txt#L30" idopL28" clas3="line" nam/opL28">> 283/a>$F3BRIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop329" clas3="line" nam/opL29">> 293/a>v<39    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000couilnab5000_frae.h="Documenta12.2/target/tcm_mod_builder.txt#L4" idopL430" clas4="line" nam/opL30">> 304/a>ta40    Uvers/builder.scanops API temf="Documenta12.2/target/tcm_mod_builder.txt#L29" idop421" clas4="line" nam/opL21">> 214/a>  41    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./includetarget_core_fabric_lib.c lotem.h="Documenta12.2/target/tcm_mod_builder.txt#L4" idopL422" clas4="line" nam/opL22">> 224/a>  42RIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop43" class4="line" nam/opL3">> >3
4/a>  43    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000couilnab5000_v> >4
//a>  44RIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop425" clas4="line" nam/opL25">> 254/a>  45    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000couilnab5000_v> 264/a>v<46RIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop427" clas4="line" nam/opL27">> 274/a>tc47    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000couilnab5000_.cv> 284/a>$F4BRIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop429" clas4="line" nam/opL29">> 294/a>v<49    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000cKtxt#L="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL530" clas5="line" nam/opL30">> 305/a>ta50RIC_Wri ers/iilef="Documenta12.2/target/tcm_mod_builder.txt#L29" idop521" clas5="line" nam/opL21">> 215/a>  51    /liv4core- v3.16 v7i5 1itta12.2/target/tcm_mod/2c/g./target/target_couilnab5000cK.cv> 225/a>  52RIC_Wouldry oa hret acadddauilnab5000 actarget/target_cKtxt#L..? [yes,no]: yes="Documenta12.2/target/tcm_mod_builder.txt#L29" idop53" class5="line" nam/opL3">> >3
5/a>  53RIC_Wouldry oa hret acadddauilnab5000 actarget/target_cK.cv> >4
5/a>  5 href="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL55" class=="line" nam/opL5">> >5
//a>  55    Atipt lellyofdauilder.py depends.ipt looks lithe faskt acadddawingv> 265/a>v<56RIC_m/op  actarget/target_cKtxt#Lf="Documenta12.2/target/tcm_mod_builder.txt#L29" idop527" clas5="line" nam/opL27">> 275/a>tc57href="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL528" clas5="line" nam/opL28">> 285/a>$F5     *) Generobj-$(CONFIG_MOD_fAB5000)) Gener+=dauilnab5000/="Documenta12.2/target/tcm_mod_builder.txt#L30" idop529" clas5="line" nam/opL29">> 295/a>v<5 href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop630" clas6="line" nam/opL30">> 306/a>ta60RIC_allypt lo">>vers/target/target_cK.cv> 216/a>  61href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop622" clas6="line" nam/opL22">> 226/a>  6        SPC-3source &quown()rget/target_couilnab5000cK.cv> >3
6/a>  63href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop64" class6="line" nam/opL4">> >4
6/a>  6 href*) Runv fabric mCONFIG_MOD_fAB5000 itemf="Documenta12.2/target/tcm_mod_builder.txt#L29" idop65" class6="line" nam/opL5">> >5
6/a>  65href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop66" class=="line" nam/opL6">> >6
//a>v<6        ->hrefM TCM   MOD_fAB5000 odulev> 276/a>tc67href="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL628" clas6="line" nam/opL28">> 286/a>$F68href*) Bxt#Lrivers/> 296/a>v<6 href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop730" clas7="line" nam/opL30">> 307/a>ta7get:/mnt/sdb/liv4core- v3.16 v7i5 1it# ls -la/target/target_couilnab5000/="Documenta12.2/target/tcm_mod_builder.txt#L30" idop721" clas7="line" nam/opL21">> 217/a>  71mod_botal 1348="Documenta12.2/target/tcm_mod_builder.txt#L30" idop722" clas7="line" nam/opL22">> 227/a>  7     drwxr-xr-x 2 root root ta4096 2010-10-05 03:23 f="Documenta12.2/target/tcm_mod_builder.txt#L24" idop73" class7="line" nam/opL3">> >3
7/a>  73    drwxr-xr-x 9 root root ta4096 2010-10-05 03:22 .f="Documenta12.2/target/tcm_mod_builder.txt#L24" idop74" class7="line" nam/opL4">> >4
7/a>  7 href-rw-r--r-- 1 root root ta 282 2010-10-05 03:22 Ktxt#L="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL75" class7="line" nam/opL5">> >5
7/a>  75href-rw-r--r-- 1 root root ta 171 2010-10-05 03:22 K.cv> >6
7/a>v<76href-rw-r--r-- 1 root root ta <49 2010-10-05 03:23 2 hrefs.orL29="Documenta12.2/target/tcm_mod_builder.txt#L29" idop77" class=="line" nam/opL7">> >7
//a>tc77href-rw-r--r-- 1 root root ta 738 2010-10-05 03:22 ouilnab5000_frae.h="Documenta12.2/target/tcm_mod_builder.txt#L4" idopL728" clas7="line" nam/opL28">> 287/a>$F78href-rw-r--r-- 1 root root ta9096 2010-10-05 03:22 ouilnab5000_.cv> 297/a>v<79href-rw-r--r-- 1 root root 191200 2010-10-05 03:23 ouilnab5000_.cv> 308/a>ta80href-rw-r--r-- 1 root root t40504 2010-10-05 03:23 fouilnab5000_.cv> 218/a>  81href-rw-r--r-- 1 root root ta5414 2010-10-05 03:22 ouilnab5000_v> 228/a>  82href-rw-r--r-- 1 root root ta2016 2010-10-05 03:22 ouilnab5000_v> >3
8/a>  83href-rw-r--r-- 1 root root 190932 2010-10-05 03:23 ouilnab5000_v> >4
8/a>  8 href-rw-r--r-- 1 root root t40713 2010-10-05 03:23 fouilnab5000_v> >5
8/a>  85href-rw-r--r-- 1 root root 401861 2010-10-05 03:23 ouilnab5000.ko="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL86" class8="line" nam/opL6">> >6
8/a>v<86href-rw-r--r-- 1 root root ta 265 2010-10-05 03:23 fouilnab5000.ko.cmL="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL87" class8="line" nam/opL7">> >7
8/a>tc87href-rw-r--r-- 1 root root ta 459 2010-10-05 03:23 ouilnab5000.deref="Documenta12.2/target/tcm_mod_builder.txt#L26" idop88" class=="line" nam/opL8">> >8
//a>$F88href-rw-r--r-- 1 root root t23896 2010-10-05 03:23 ouilnab5000.dereo="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL829" clas8="line" nam/opL29">> 298/a>v<89href-rw-r--r-- 1 root root  22655 2010-10-05 03:23 fouilnab5000.dereo.cmL="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL930" clas9="line" nam/opL30">> 309/a>ta90href-rw-r--r-- 1 root root 379022 2010-10-05 03:23 ouilnab5000eo="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL921" clas9="line" nam/opL21">> 219/a>  91href-rw-r--r-- 1 root root ta 211 2010-10-05 03:23 fouilnab5000.o.cmL="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL922" clas9="line" nam/opL22">> 229/a>  9 href="Documenta12.2/target/tcm_mod_builder.txt#L13" idop93" class9="line" nam/opL3">> >3
9/a>  93href*) Load fabric m2 href,a new drivlun_0 .cv> >4
9/a>  9     *) IBLOCK backst16  symm/okt ac Inif="Documenta12.2/target/tcm_mod_builder.txt#L9" idopL95" class9="line" nam/opL5">> >5
9/a>  95href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop96" class9="line" nam/opL6">> >6
9/a>v<96et:/mnt/sdb/liv4core- v3.16 v7i5 1it# insder/target/target_couilnab5000.ko="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL97" class9="line" nam/opL7">> >7
9/a>tc97et:/mnt/sdb/liv4core- v3.16 v7i5 1it#  /sys/kernel/config/target/$TCM_NEWnab5000/iqn.foo/tpgt_1/lun/lun_0="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL98" class9="line" nam/opL8">> >8
9/a>$F98et:/mnt/sdb/liv4core- v3.16 v7i5 1it# cdrnel/config/target/$TCM_NEWnab5000/iqn.foo/tpgt_1/lun/lun_0/="Documenta12.2/target/tcm_mod_builder.txt#L30" idop99" class=="line" nam/opL9">> >9
//a>v<99et:/mnt/sdb/el/config/target/$TCM_NEWnab5000/iqn.foo/tpgt_1/lun/lun_0# ln -srnel/config/target/$TCM_NEW.16 /iblock_0/lvm_test0 nab5000_ Ini="Documenta12.2/target/tcm_mod_builder.txt#L10" idopL110" class=="line" nam/opL10">> 9av//a>tv//href="Documenta12.2/target/tcm_mod_builder.txt#L10" idopL111" class0="line" nam/opL11">> 11v01a>tv/1et:/mnt/sdb/el/config/target/$TCM_NEWnab5000/iqn.foo/tpgt_1/lun/lun_0# cdr-="Documenta12.2/target/tcm_mod_builder.txt#L10" idopL112" class0="line" nam/opL12">> 12
02a>tv/2et:/mnt/sdb/liv4core- v3.16 v7i5 1it# treernel/config/target/$TCM_NEWnab5000/="Documenta12.2/target/tcm_mod_builder.txt#L10" idopL113" class0="line" nam/opL13">> 13
03a>tv/3    /el/config/target/$TCM_NEWnab5000/="Documenta12.2/target/tcm_mod_builder.txt#L10" idopL114" class0="line" nam/opL14">> 14
04a>tv/     |-- disco,v> 15v05a>tv/5    |-- iqn.foo="Documenta12.2/target/tcm_mod_builder.txt#L4" idopL1016" class0="line" nam/opL16">> 16v06a>tv/6et:/|*) `-- tpgt_1="Documenta12.2/target/tcm_mod_builder.txt#L4" idopL1017" class0="line" nam/opL17">> 17v07a>tv/7et:/|*)     |-- acls="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1018" class0="line" nam/opL18">> 18v08a>tv/8et:/|*)     |-- a logi="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1019" class0="line" nam/opL19">> 19v09a>tv/9et:/|*)     |-- lun="Documenta12.2/target/tcm_mod_builder.txt#L11" idopL110" classs="line" nam/opL10">> 9avv/a> 1      |*)     |*) `-- lun_0="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L11" class=="line" nam/opL11">> 11v/1a>tv      |*)     |*)     |-- alua_tg_pt_gp="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L12" classs="line" nam/opL12">> 12

/a>v1a href|*)     |*)     |-- alua_tg_pt_offm/op="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L13" classs="line" nam/opL13">> 13

/a>T1is scr|*)     |*)     |-- alua_tg_pt_fx/rus="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1L14" classs="line" nam/opL14">> 14

/a>v1a href|*)     |*)     |-- alua_tg_pt_write_mL="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L15" classs="line" nam/opL15">> 15vv/a> 1      |*)     |*)     `-- nab5000_ Iniop_wwn 2c/g./g./g./g./g./TCM_NEW.16 /iblock_0/lvm_test0="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L16" classs="line" nam/opL16">> 16vv/a> 116et:/|*)     |-- np="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L17" classs="line" nam/opL17">> 17vv/a> 117et:/|*)     `-- rs, a="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L18" classs="line" nam/opL18">> 18vv/a> 1      `-- get/et/="Documenta12.2/target/tcm_mod_builder.txt#L8" idopL1L19" classs="line" nam/opL19">> 19vv/a> 11 href="Documenta12.2/target/tcm_mod_builder.txt#L10" idopLL20" clas1s="line" nam/opL20">> 201v/a> 12get:/mnt/sdb/liv4core- v3.16 v7i5 1it# lsder="Documenta12.2/target/tcm_mod_builder.txt#L10" idopLL11" classs="line" nam/opL21">> 211v/a> 1      Ming buuuuuuuuuuuuuuuuuuSizbuuUser bf="Documenta12.2/target/tcm_mod_builder.txt#L6" idopL1212" class=="line" nam/opL12">> 12
//a>v1      ouilnab5000uuuuuuuuuuuuu3935  4="Documenta12.2/target/tcm_mod_builder.txt#L6" idopL1213" classs="line" nam/opL23">> 231v/a> 1      iscsi_ore_fabder//////193211  0="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L24" clas1s="line" nam/opL24">> 241v/a> 1      ore_fabric_lstgtuuuuuuuu8090  0="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L15" classs="line" nam/opL25">> 251v/a> 1      ore_fabric_lpscsi//////11a 2//1="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L16" classs="line" nam/opL26">> 261
/a>v126    ore_fabric_liileuuuuuuuu9172//2="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L17" classs="line" nam/opL27">> 271
/a>t127    ore_fabric_liblockuuuuuu9280//1="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L18" classs="line" nam/opL28">> 281v/a>$128    ore_fabric_lder////// 228575  31="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L19" classs="line" nam/opL29">> 291
/a>v1a hrefouilnab5000,iscsi_ore_fabder,ore_fabric_lstgt,ore_fabric_lpscsi,ore_fabric_liile,ore_fabric_liblock="Documenta12.2/target/tcm_mod_builder.txt#L13" idopL120" clas1s="line" nam/opL30">> 301v/a>t1rget:/libfcuuuuuuuuuuuuuuuuuu73681  0="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L21" clas13="line" nam/opL21">> 2113/a> 131mod_scsi_debuguuuuuuuuuuuuu56265  0="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L12" class3="line" nam/opL22">> 2213/a> 13     scsi_ogtuuuuuuuuuuuuuuuu8666//1 ore_fabric_lstgt="Documenta12.2/target/tcm_mod_builder.txt#L5" idopL1L13" class=="line" nam/opL13">> 13
//a> 133    .cv> 2413/a> 13 href="Documenta12.2/target/tcm_mod_builder.txt#L15" idopLL25" clas13="line" nam/opL25">> 2513/a> 13     ----------------------------------------------------------------------="Documenta12.2/target/tcm_mod_builder.txt#L15" idopLL16" class3="line" nam/opL26">> 2613/a>v13 href="Documenta12.2/target/tcm_mod_builder.txt#L27" idop1L27" clas13="line" nam/opL27">> 2713/a>t137    Fu loadTODO itemmf="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1L28" clas13="line" nam/opL28">> 2813/a>$13BRIC_="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1L19" class3="line" nam/opL29">> 2913/a>v13        using*) Add m16  o_Idpnt foiribus="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1430" clas14="line" nam/opL30">> 3014/a>t14     *) Based .1M),  builder.dumplib.c lotem() smarterget W a brand al TCM v po to 9="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1421" clas14="line" nam/opL21">> 2114/a> 14        the Trandehr directly from includetarget_core_fabric_lib.c lotem.h:arget_core_fabric_ops API tem="Documenta12.2/target/tcm_mod_builder.txt#L29" idop1412" class4="line" nam/opL22">> 2214/a> 14        SPC-3 pee for loadmembet/f="Documenta12.2/target/tcm_mod_builder.txt#L24" idop143" class14="line" nam/opL3">> >3
14/a> 143href="Documenta12.2/target/tcm_mod_builder.txt#L30" idop1414" class=="line" nam/opL14">> 14
//a> 144RIC_Octobet 5th, 2010="Documenta12.2/target/tcm_mod_builder.txt#L30" idop1425" clas14="line" nam/opL25">> 2514/a> 145    Nichone" A. Belm/oget;<nab@l 22/-iscsi.org_wwn="Documenta12.2/target/tcm_mod_builder.txt#L30" idop1416" class4="line" nam/opL26">> 2614/a>v146RIC_
v4 forigiv4 fLXR softwma12by fabr"Documenthttp://sourceforge.nod_pntjects/lx9">LXR communityRIC_, v7io experi2/tarl get/et/2by "Documentmailto:lx9@l 22/.no">lx9@l 22/.noRIC_.
lx9.l 22/.no kindly hoster bfr"Documenthttp://www.redpill-l 2pnt.no">Redpill L 2pnt ASRIC_, pntviriryofdL 22/ .cv 2"ielet.llyopbranet/s 2 arices 2it ca1995.