# open-iscsi with 2.6.17 (second issue solved)

## jimbo_2006

Hi all,

i am trying to test iscsi and believe i have successfully set up a target using iscsitarget but am having problems emerging open-iscsi with a 2.6.17 kernel.

Heres the result after setting up a target

gonzo# cat /proc/net/iet/volume 

tid:1 name:iqn.2001-04.com.example:storage.disk2.sys1.xyz

        lun:0 state:0 iotype:fileio path:/dev/hdb

So looks ok...but i really have no idea.

So then i went onto setting up an initiator.

Here is the result of compiling open-iscsi ebuild sys-block/open-iscsi-1.0.514 with 2.6.17-beyond1.1 kernel (also tried with default gentoo-sources 2.6.17 kernel but same issues).

 * Preparing iscsi_tcp module

kernel check... OTHER KERNEL DETECTED

make -C /usr/src/linux M=`pwd` KBUILD_OUTPUT=  V=0 modules

make[1]: Entering directory `/usr/src/linux-2.6.17'

  CC [M]  /var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/scsi_transport_iscsi.o

  CC [M]  /var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.o

/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.c: In function `iscsi_tcp_init':

/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.c:3832: error: `SLAB_NO_REAP' undeclared (first use in this function)

/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.c:3832: error: (Each undeclared identifier is reported only once

/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.c:3832: error: for each function it appears in.)

make[2]: *** [/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel/iscsi_tcp.o] Error 1

make[1]: *** [_module_/var/tmp/portage/open-iscsi-1.0.514/work/open-iscsi-1.0-514/kernel] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.17'

make: *** [all] Error 2

!!! ERROR: sys-block/open-iscsi-1.0.514 failed.

Call stack:

  ebuild.sh, line 1539:   Called dyn_compile

  ebuild.sh, line 939:   Called src_compile

  open-iscsi-1.0.514.ebuild, line 62:   Called linux-mod_src_compile

  linux-mod.eclass, line 515:   Called die

I believe that SLAB_NO_REAP was removed in 2.6.16 or 2.6.17 and hence causing the problem..but could be wrong.  :Smile: 

So thats my first question...does anyone have any ideas on how to correct this...or if a newer ebuild is available for 2.6.17 kernels. Would much prefer to use portage then compile myself...which is the next problem  :Smile: 

Looking at the open-iscsi list i found a version which will compile with 2.6.17 kernel at

http://groups.google.com/group/open-iscsi/browse_thread/thread/ed43661e2df06ba7/04fd79bf2ffd0e4d#04fd79bf2ffd0e4d

and it seems to compile ok

**********************

EDIT: Solved this issue of unknown symbols...i had 

CONFIG_SCSI_ISCSI_ATTRS=y and

CONFIG_ISCSI_TCP=y in kernel config which was conflicting with open-iscsi modules

**********************

scsi_transport_iscsi: exports duplicate symbol iscsi_create_session (owned by kernel)

libiscsi: Unknown symbol iscsi_unblock_session

libiscsi: Unknown symbol iscsi_block_session

iscsi_tcp: Unknown symbol iscsi_eh_host_reset

iscsi_tcp: Unknown symbol iscsi_conn_setup

iscsi_tcp: Unknown symbol iscsi_verify_itt

iscsi_tcp: Unknown symbol iscsi_pool_free

iscsi_tcp: Unknown symbol iscsi_session_recovery_timedout

iscsi_tcp: Unknown symbol __iscsi_complete_pdu

iscsi_tcp: Unknown symbol iscsi_conn_bind

iscsi_tcp: Unknown symbol iscsi_session_setup

iscsi_tcp: Unknown symbol class_to_transport_session

iscsi_tcp: Unknown symbol iscsi_eh_abort

iscsi_tcp: Unknown symbol iscsi_conn_failure

iscsi_tcp: Unknown symbol iscsi_complete_pdu

iscsi_tcp: Unknown symbol iscsi_conn_teardown

iscsi_tcp: Unknown symbol iscsi_conn_send_pdu

iscsi_tcp: Unknown symbol iscsi_conn_start

iscsi_tcp: Unknown symbol iscsi_prep_unsolicit_data_pdu

iscsi_tcp: Unknown symbol iscsi_pool_init

iscsi_tcp: Unknown symbol iscsi_session_teardown

iscsi_tcp: Unknown symbol iscsi_conn_stop

iscsi_tcp: Unknown symbol iscsi_queuecommand

iscsi_tcp: Unknown symbol iscsi_change_queue_depth

iscsi_tcp: Unknown symbol iscsi_check_assign_cmdsn

Anyways...if anyone can help would be most appreciative...ive seen a few howtos on setting up iscsi targets, but not many on initiators, so am trial and errorring at the moment.

Any suggestions greatly appreciated.

Cheers

----------

## tgh

So basically you had to download a tarball and build a custom e-build to get it to install?

Looking at my .config, I don't have either of those items set, but I'm getting the same error as you did while trying to compile build 514.

```
# grep -i 'iscsi' .config

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_ISCSI_TCP is not set
```

----------

## eightn

I think, that 

if kernel already have iscsi_tcp.ko module, then open_iscsi.ko module do not need.

-----

CONFIG_SCSI_ISCSI_ATTRS=y

CONFIG_ISCSI_TCP=y

-----

After compiling open_iscsi, I delete open_iscsi.ko module (from open_iscsi package) and restore original kernel module.

Partially openscsi worked:

iscsid -d8 -f

----

iscsiadm -m discovery -t sendtargets -p 127.0.0.1:3260

[f5fa53] 127.0.0.1:3260,1 iqn.2006-05.deep.local:storage.first

----

But I can't login to this node:

-----

iscsiadm -m node -r f5fa53 -l

iscsiadm: initiator reported error (9 - internal error)

-----

from iscsid -d8 -f:

-----

iscsid: updating defaults from '/etc/iscsid.conf'

iscsid: updated 'discovery.sendtargets.auth.authmethod', 'None' => 'CHAP'

iscsid: updated 'discovery.sendtargets.auth.username', '<empty>' => 'test'

iscsid: updated 'discovery.sendtargets.auth.password', '<empty>' => 'test2'

iscsid: updated 'discovery.sendtargets.auth.password_length', '0' => '5'

iscsid: updated 'node.startup', 'manual' => 'manual'

iscsid: updated 'node.session.auth.authmethod', 'None' => 'CHAP'

iscsid: updated 'node.session.auth.username', '<empty>' => 'test'

iscsid: updated 'node.session.auth.password', '<empty>' => 'test2'

iscsid: updated 'node.session.auth.password_length', '0' => '5'

iscsid: updated 'node.session.timeo.replacement_timeout', '120' => '120'

iscsid: updated 'node.session.err_timeo.abort_timeout', '10' => '10'

iscsid: updated 'node.session.err_timeo.reset_timeout', '30' => '30'

iscsid: updated 'node.session.iscsi.InitialR2T', 'No' => 'No'

iscsid: updated 'node.session.iscsi.ImmediateData', 'Yes' => 'Yes'

iscsid: updated 'node.session.iscsi.FirstBurstLength', '262144' => '262144'

iscsid: updated 'node.session.iscsi.MaxBurstLength', '16776192' => '16776192'

iscsid: updated 'node.session.iscsi.DefaultTime2Wait', '0' => '0'

iscsid: updated 'node.session.iscsi.DefaultTime2Retain', '0' => '0'

iscsid: updated 'node.session.iscsi.MaxConnections', '1' => '0'

iscsid: updated 'node.conn[0].iscsi.HeaderDigest', 'None,CRC32C' => 'None'

iscsid: updated 'node.conn[0].iscsi.DataDigest', 'None' => 'None'

iscsid: updated 'node.conn[0].iscsi.MaxRecvDataSegmentLength', '131072' => '65536'

iscsid: searching for key '127.0.0.1:3260#127.0.0.1:3260,1#iqn.2006-05.deep.local:storage.first'

iscsid: in ktrans_list

iscsid: thread b7ce6c88 schedule: delay 0 state 2

iscsid: authentication setup complete...

iscsid: resolved 127.0.0.1 to 127.0.0.1

iscsid: set TCP recv window size to 524288, actually got 262142

iscsid: set TCP send window size to 524288, actually got 262142

iscsid: connecting to 127.0.0.1:3260

iscsid: event_type: 2 adding to the tail: 0x0x80727a8:0x0x80727a8:0x0x80727bc:0x0x80767a8 elem 0x0x80727a8 length 20

iscsid: thread b7ce6c88 schedule: delay 0 state 1

iscsid: thread b7cc18f4 schedule: delay 60 state 2

iscsid: exec thread b7ce6c88 callback

iscsid: in ktrans_list

x0x80727a8 length 20

iscsid: event_type: 2 adding to the tail: 0x0x80767e8:0x0x80767e8:0x0x80767fc:0x0x807a7e8 elem 0x0x80767e8 length 20

iscsid: event_type: 2 removing from the head: 0x0x80767e8:0x0x80767fc:0x0x80767fc:0x0x807a7e8 elem 0x0x80767e8 length 20

iscsid: connected local port 42379 to 127.0.0.1:3260

iscsid: thread b7cc18f4 delete: state 0

iscsid: deleting a scheduled/waiting thread!

iscsid: in kcreate_session

iscsid: in __kipc_call

iscsid: in kwritev

iscsid: in nlpayload_read

iscsid: in nlpayload_read

iscsid: created new iSCSI session 0

iscsid: in kcreate_conn

iscsid: in __kipc_call

iscsid: in kwritev

iscsid: in nlpayload_read

iscsid: expecting event 13, got 103, handling...

iscsid: in nlpayload_read

iscsid: received iferror -22

iscsid: returned -22

iscsid: can't create connection (115)

iscsid: in kdestroy_session

iscsid: in __kipc_call

iscsid: in kwritev

iscsid: in nlpayload_read

iscsid: expecting event 13, got 103, handling...

iscsid: in nlpayload_read

iscsid: received iferror -22

iscsid: returned -22

iscsid: can't create connection (115)

iscsid: in kdestroy_session

iscsid: in __kipc_call

iscsid: in kwritev

iscsid: in nlpayload_read

iscsid: expecting event 12, got 103, handling...

iscsid: in nlpayload_read

iscsid: received iferror -22

iscsid: can not safely destroy session 0

iscsid: thread b7cc18f4 delete: state 2

iscsid: destroying session

-----

grep -Ev "^.*#|^$" /etc/ietd.conf

------

IncomingUser test test2

Target iqn.2006-05.deep.local:storage.first

        IncomingUser test test2

        Lun 0 Path=/dev/sda,Type=fileio

        Alias Test

        MaxConnections 1

        ImmediateData Yes

------

Whats wrong ?  :Sad: 

----------

## eightn

I'am tupo  :Wink: 

In open-iscsi-1.1.619 also exist module libiscsi.

For compiling and working, only need to add at

open-iscsi-1.1.619-r1.ebuild (custom ebuild):

MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG}) libiscsi(${MODULE_NAMES_ARG})"

and unset kernel modules

---

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_ISCSI_TCP is not set

---

----------

## CrimsonMirage

I think I have an ebuild that fixes this... what do I do with it?

(not exactly a pro with contributing back to Gentoo   :Shocked: )

----------

