From: Calvin M. <cal...@co...> - 2006-02-27 17:21:39
|
Vladislav Bolkhovitin wrote: > Hm, my manual on Qlogic 2300 doesn't contain description of > atio->initiator_port_name field, it's called "RESERVED" there. Looks > like it's an addition of the newer firmware. So, I think, we should > use that field directly not doing any translation at all and get rid > of all current loopId->WWN code. Although, I'm not sure about 2200, > Nate's code has "/* on qla23xx */" comment. If 2200 doesn't have such > feature, seems we will have to use the current way. > > Could somebody confirm either atio->initiator_port_name works on 2200 > or not? I can confirm it does work. All I have are 2200 based cards at the moment, with the 1.83 firmware. With the release of Nate's enhancements, I think it becomes a non-issue, though it was a good learning experience and has helped me to get more familiar with the code (trying to shake off 5 years of C rust is an interesting experience :) ). Calvin > > Vlad > > Calvin Morrow wrote: >> I made some changes to try and address what I wrote earlier, namely >> in WWN authentication mode, comparing WWNs to WWNs, rather than >> trying to match up loop ids. The changes address the issues where >> loop_ids didn't match up, but WWNs did. >> >> The one issue outstanding, is that there seem to be circumstances >> (first powering on an initiator) that SCST is looking for loop_ids >> and WWNs before the internal qlogic database has added the new nodes. >> >> q2t_send_cmd_to_scst:New command instance=0 loop_id=2 tag=49168 >> wwpn=0021e000038be3fb (210000e08b03fbe3) >> q2t_make_name:comparing port_name of 210000e08b03fbe3 to >> 210000e08b0573f1 >> q2t_make_name:comparing port_name of 210000e08b03fbe3 to >> 10000000c9231e0e >> q2t_make_name:***ERROR*** qla2x00tgt(0): Unable to find wwn login for >> loop id 2, using loop id instead >> >> After a LIP reset, the database is refreshed and everything works. >> Any idea how we can force a qlogic database refresh without messing >> things up? >> >> >> scsi(0): Waiting for LIP to complete... >> scsi(0): GID_PT entry - nn 200000e08b04a27f pn 210000e08b04a27f >> portid=011400. >> scsi(0): GID_PT entry - nn 200000e08b0573f1 pn 210000e08b0573f1 >> portid=011600. >> scsi(0): GID_PT entry - nn 20000000c9231e0e pn 10000000c9231e0e >> portid=011800. >> scsi(0): device wrap (011800) >> qla2x00_configure_loop: exiting normally >> qla2x00: DPC handler sleeping >> q2t_response_pkt:IMMED_NOTIFY >> q2t_handle_imm_notify:Port logout (S 00000000 I 0x2 -> L 0x0) >> q2t_unreg_sess:Unregistering session d7b78bc0 (loop_id=2, >> scst_sess=d3f719c4) >> q2t_free_session_done:tgt 0 list_empty 1 >> q2t_response_pkt:NOTIFY_ACK seq 00000000 status 1 >> scsi(0): Asynchronous PORT UPDATE ignored 0004/ffff/1411. >> scsi(0): ha state 5 init_done 1 oper_mode 1 topo 8 >> q2t_async_event:Async event 0x8014 occured >> q2t_clear_tgt_db:Clearing targets DB >> q2t_response_pkt:ACCEPT_TGT_IO instance 0 status 003d lun 0000 >> read/write 0 data_length 0000 target_id 02 exchange_id c238 >> q2t_send_cmd_to_scst:New command instance=0 loop_id=2 tag=49720 >> wwpn=0021e000038be3fb (210000e08b03fbe3) >> q2t_make_name:comparing port_name of 210000e08b03fbe3 to >> 210000e08b0573f1 >> q2t_make_name:comparing port_name of 210000e08b03fbe3 to >> 10000000c9231e0e >> q2t_make_name:comparing port_name of 210000e08b03fbe3 to >> 210000e08b03fbe3 >> q2t_make_name:found wwn: 21:00:00:e0:8b:03:fb:e3 for loop_id: 2 >> >> Mark Buechler wrote: >> >>> I was the original one who put the WWN authentication in. I knew and >>> still know very little about the qlogic driver. All I did was poke >>> around and found the correct struct. Vlad then took the code and >>> integrated it better. >>> >>> - Mark. >>> >>> On 2/26/06, *Calvin Morrow* <cal...@co... >>> <mailto:cal...@co...>> wrote: >>> >>> I started looking at the WWN auth code today in the Qla target >>> driver to >>> see if I could figure out why the WWN auth code doesn't work the >>> first >>> time an initiator connects, but does seem to recognize an >>> initiator the >>> second and subsequent times going forward. >>> >>> I put in some debug code to see what was going on inside of the >>> make >>> name function. What seems to be happening, is that the adapter >>> registers the WWN with a loop ID of > 129, but SCST recognizes >>> connection attempts with a different loop_id. If you look at the >>> debug >>> below, you'll see that SCST thinks my Emulex adapter has loop_id >>> = 1, >>> but the qlogic adapter has it recorded as loop_id = 132. When it >>> can't >>> compare the loop_ids, the q2t_make_name function fails. >>> >>> q2t_send_cmd_to_scst:New command instance=0 loop_id=1 tag=49120 >>> wwpn=0010000023c90e1e (10000000c9231e0e) >>> q2t_make_name:looking at loop_id 1 comparing to 130, recorded >>> wwn is >>> 21:00:00:e0:8b:05:73:f1 >>> q2t_make_name:looking at loop_id 1 comparing to 131, recorded >>> wwn is >>> 21:00:00:e0:8b:03:fb:e3 >>> q2t_make_name:looking at loop_id 1 comparing to 132, recorded >>> wwn is >>> 10:00:00:00:c9:23:1e:0e >>> q2t_make_name:***ERROR*** qla2x00tgt(0): Unable to find wwn >>> login for >>> loop id 1, using loop id instead >>> q2t_do_send_cmd_to_scst:Context 2 >>> [3120]: scst_init_session:scst: Name 1 not found, using default >>> group >>> >>> After a reboot, my adapter will be recorded in the qlogic list as >>> loop_id of 1, and q2t_make_name will succeed as the loop_ids will >>> match. >>> >>> My questions to you are twofold: 1) Does anyone know why this >>> behavior >>> is being exhibited, and 2) If we enable WWN Auth, is there any >>> reason >>> why we should be trying to match loop_id - loop_id to >>> WWN? Wouldn't it >>> make more sense to try and match the WWNs in q2t_make_name >>> instead? I'd >>> be happy to attempt to change the code, but would like to know >>> first if >>> there are any reasons why the system currently acts in this >>> fashion. >>> >>> Calvin >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>> language >>> that extends applications into web and mobile media. Attend the >>> live webcast >>> and join the prime developer group breaking into this new coding >>> territory! >>> >>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >>> >>> >>> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> >>> >>> _______________________________________________ >>> Scst-devel mailing list >>> Scs...@li... >>> <mailto:Scs...@li...> >>> https://lists.sourceforge.net/lists/listinfo/scst-devel >>> <https://lists.sourceforge.net/lists/listinfo/scst-devel> >>> >>> >> >> >> ------------------------------------------------------------------------ >> >> --- qla2x00t.c 2006-02-26 21:54:27.000000000 -0700 >> +++ qla2x00t.c.wwn 2006-02-26 21:54:21.000000000 -0700 >> @@ -1149,12 +1153,17 @@ STATIC void q2t_alloc_session_done(struc >> } >> >> >> -static char* q2t_make_name(scsi_qla_host_t *ha, int loop_id) >> +static char* q2t_make_name(scsi_qla_host_t *ha, atio_entry_t *atio) >> #ifdef FC_SCST_WWN_AUTH >> { >> int wwn_found = 0; >> char *wwn_str; >> fc_port_t *fcl; >> + uint16_t *pn; >> + int loop_id; >> + >> + loop_id = GET_TARGET_ID(ha, atio); >> + pn = (uint16_t *)(((char *)atio)+0x2a); >> >> wwn_str = kmalloc(2*WWN_SIZE, GFP_ATOMIC); >> if (wwn_str == NULL) { >> @@ -1162,9 +1171,16 @@ static char* q2t_make_name(scsi_qla_host >> goto out; >> } >> >> - /* Find the WWN in the port db given the loop_id */ >> + /* Find the WWN in the port db that matches the initiator port >> name */ >> list_for_each_entry(fcl, &ha->fcports, list) { >> - if (loop_id == (fcl->loop_id & 0xFF)) { >> + if ((pn[0] == (uint16_t)((fcl->port_name[0] << 8) >> + + fcl->port_name[1])) && >> + (pn[1] == (uint16_t)((fcl->port_name[2] << 8) >> + + fcl->port_name[3])) && >> + (pn[2] == (uint16_t)((fcl->port_name[4] << 8) >> + + fcl->port_name[5])) && >> + (pn[3] == (uint16_t)((fcl->port_name[6] << 8) >> + + fcl->port_name[7]))) { sprintf(wwn_str, >> "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", >> fcl->port_name[0], fcl->port_name[1], >> fcl->port_name[2], fcl->port_name[3], @@ -1188,6 +1204,9 @@ out: >> #else >> { >> char *s; >> + int loop_id; >> + >> + loop_id = GET_TARGET_ID(ha, atio); >> s = kmalloc(12, GFP_ATOMIC); >> if (s != NULL) >> snprintf(s, 12, "%d", loop_id); >> @@ -1265,7 +1284,7 @@ STATIC int q2t_send_cmd_to_scst(scsi_qla >> >> /* register session (remote initiator) */ >> { >> - char *name = q2t_make_name(ha, loop_id); >> + char *name = q2t_make_name(ha, atio); >> if (name == NULL) >> goto out_free_sess; >> sess->scst_sess = scst_register_session( > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Scst-devel mailing list > Scs...@li... > https://lists.sourceforge.net/lists/listinfo/scst-devel > |