-----Original Message----- From: Mike Christie [mailto:[email protected]] Sent: Thursday, March 07, 2013 10:05 PM To: [email protected] Cc: Vikas Chaudhary; Lalit Chandivade; Ravi Anand; Poornima Vonti; Manish Rangankar; Adheer Chandravanshi Subject: Re: [RFC_V5 PATCH 3/3] qla4xxx: Add flash node mgmt support
On 03/07/2013 02:26 AM, Vikas Chaudhary wrote: > -----Original Message----- > From: Mike Christie <[email protected]> > Date: Thursday 7 March 2013 1:01 PM > To: "[email protected]" <[email protected]> > Cc: Vikas <[email protected]>, Lalit Chandivade > <[email protected]>, Ravi Anand <[email protected]>, > Poornima Vonti <[email protected]>, Manish Rangankar > <[email protected]>, Adheer Chandravanshi > <[email protected]> > Subject: Re: [RFC_V5 PATCH 3/3] qla4xxx: Add flash node mgmt support > >> On 02/19/2013 06:05 AM, [email protected] wrote: >>> +static int qla4xxx_copy_from_fwddb_param(struct >>> iscsi_bus_flash_session *sess, >>> + struct iscsi_bus_flash_conn *conn, >>> + struct dev_db_entry >>> +*fw_ddb_entry) { >>> + unsigned long options = 0; >>> + char ip_addr[DDB_IPADDR_LEN]; >>> + int rc = 0; >>> + >>> + options = le16_to_cpu(fw_ddb_entry->options); >>> + conn->is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, >>> &options); >>> + if (test_bit(OPT_IPV6_DEVICE, &options)) { >>> + rc = iscsi_switch_str_param(&sess->portal_type, DEV_TYPE_IPV6); >>> + if (rc) >>> + goto exit_copy; >>> + } else { >>> + rc = iscsi_switch_str_param(&sess->portal_type, DEV_TYPE_IPV4); >>> + if (rc) >>> + goto exit_copy; >>> + } >>> + >>> + sess->auto_snd_tgt_disable = test_bit(OPT_AUTO_SENDTGTS_DISABLE, >>> + &options); >>> + sess->discovery_sess = test_bit(OPT_DISC_SESSION, &options); >>> + sess->entry_state = test_bit(OPT_ENTRY_STATE, &options); >>> + >>> + options = le16_to_cpu(fw_ddb_entry->iscsi_options); >>> + conn->hdrdgst_en = test_bit(ISCSIOPT_HEADER_DIGEST_EN, &options); >>> + conn->datadgst_en = test_bit(ISCSIOPT_DATA_DIGEST_EN, &options); >>> + sess->imm_data_en = test_bit(ISCSIOPT_IMMEDIATE_DATA_EN, &options); >>> + sess->initial_r2t_en = test_bit(ISCSIOPT_INITIAL_R2T_EN, &options); >>> + sess->dataseq_inorder_en = test_bit(ISCSIOPT_DATA_SEQ_IN_ORDER, >>> + &options); >>> + sess->pdu_inorder_en = test_bit(ISCSIOPT_DATA_PDU_IN_ORDER, &options); >>> + sess->chap_auth_en = test_bit(ISCSIOPT_CHAP_AUTH_EN, &options); >>> + conn->snack_req_en = test_bit(ISCSIOPT_SNACK_REQ_EN, &options); >>> + sess->discovery_logout_en = test_bit(ISCSIOPT_DISCOVERY_LOGOUT_EN, >>> + &options); >>> + sess->bidi_chap_en = test_bit(ISCSIOPT_BIDI_CHAP_EN, &options); >>> + sess->discovery_auth_optional = >>> + test_bit(ISCSIOPT_DISCOVERY_AUTH_OPTIONAL, &options); >>> + if (test_bit(ISCSIOPT_ERL1, &options)) >>> + sess->erl |= BIT_1; >>> + if (test_bit(ISCSIOPT_ERL0, &options)) >>> + sess->erl |= BIT_0; >> >> >> This is kinda weird. For ERL0 we will print 1 and for ERL1 we will >> print 2? Make it store/print what users would expect. > > We are printing correct value to users. > Our firmware uses two bits to define erl levels in iscsi_options field. Ah, are you having iscsiadm pass erl down as value= erl=0 erl=1 or in your format? None of these should hry/set settings in your format. > So in above code we are just creating erl value using BIT_1 and BIT_0 > combined. For erl0 what are you printing? If it's not printing 0. For erl1 it should print 1. If not, then change it. Mike, User will see correct erl value as 0, 1, 2 for corresponding erl level. Similarly, to set the erl value using iscsiadm, user needs to pass the erl value as either 0 or 1 or 2 . None of the get/set operation is performed using values in the format specific to us. I guess the confusion is because of the macro names ISCSIOPT_ERL1 and ISCSIOPT_ERL0. These do not correspond to actual erl level 1 and 0. They just indicate bits at position 1 and 0 in iscsi_options field which are internally used by us to store the erl value. So in iscsi_options field, if: Bit1 = 0 and Bit0 = 0 then erl = 0 Bit1 = 0 and Bit0 = 1 then erl = 1 Bit1 = 1 and Bit0 = 0 then erl = 2 In the qla4xxx code we are just combining the values of different bits to create erl value to export to the user. -- Adheer ________________________________ This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message. -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/open-iscsi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
