Re: open-iscsi does not detect logical volume
@mike: When you run service iscsi-target start to start IET, do you see any errors in /var/log/messages? Yes. May 1 09:57:55 sunny2 kernel: iSCSI Enterprise Target Software - version 0.4.16 May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type fileio May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type blockio May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type nullio May 1 09:57:55 sunny2 kernel: iscsi_trgt: open_path(119) Can't open /dev/vg/ocfs -2 May 1 09:57:55 sunny2 kernel: iscsi_trgt: fileio_attach(283) -2 May 1 09:57:55 sunny2 ietd: Can't create a logical unit 2 1 0 Path=/dev/vg/ocfs,Type=fileio cd /home/sunny/Desktop dd if=/dev/zero of=test bs=1G count=1 opened ietd.conf and did Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/home/sunny/Desktop/test,Type=fileio service iscsi-target stop service iscsi-target start May 1 10:15:37 sunny2 kernel: iSCSI Enterprise Target Software - version 0.4.16 May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type fileio May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type blockio May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type nullio iscsiadm -m session -P 3 iSCSI Transport Class version 2.0-870 iscsiadm version 2.0-870 Target: iqn.2009-09.com.ezhome:ocfs Current Portal: 10.1.1.1:3260,1 Persistent Portal: 10.1.1.1:3260,1 ** Interface: ** Iface Name: default Iface Transport: tcp Iface Initiatorname: iqn.1996-04.de.suse:01:79a5ecb15528 Iface IPaddress: 10.1.1.2 Iface HWaddress: default Iface Netdev: default SID: 1 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE Negotiated iSCSI params: HeaderDigest: None DataDigest: None MaxRecvDataSegmentLength: 131072 MaxXmitDataSegmentLength: 8192 FirstBurstLength: 65536 MaxBurstLength: 262144 ImmediateData: Yes InitialR2T: Yes MaxOutstandingR2T: 1 Attached SCSI devices: Host Number: 2 State: running But there are no messages in /var/log/messages about new disk getting added. I even tried sunny1:~ # iscsiadm -m node -T iqn.2009-09.com.ezhome:ocfs -p 10.1.1.1 -l Logging in to [iface: default, target: iqn.2009-09.com.ezhome:ocfs, portal: 10.1.1.1,3260] iscsiadm: Could not login to [iface: default, target: iqn.2009-09.com.ezhome:ocfs, portal: 10.1.1.1,3260]: iscsiadm: initiator reported error (15 - already exists) sunny1:~ # /var/log/messages - May 1 10:21:11 sunny1 iscsid: session [iqn.2009-09.com.ezhome:ocfs,10.1.1.1,3260] already running. Help pls! On Thu, Apr 30, 2009 at 3:38 PM, Mike Christie micha...@cs.wisc.edu wrote: Mike Christie wrote: sundar mahadevan wrote: As i said before, there is no real file for /dev/vg/ocfs but lvdisplay shows /dev/vg/ocfs as my logical volume and ls -ail /dev/vg/ocfs 35413 lrwxrwxrwx 1 root root 19 Apr 30 14:33 /dev/vg/ocfs - /dev/mapper/vg-ocfs Now i'm really confused. Mike: As i said before there are only 2 uncommented lines in /etc/ietd.conf Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/dev/vg/ocfs,Type=fileio When you run service iscsi-target start to start IET, do you see any errors in /var/log/messages? You might just want to try something simple first. - dd if=/dev/zero of=file bs=1G count=1 - open ietd.conf and do Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/where_you_put_file/file,Type=fileio service iscsi-target stop service iscsi-target start then on the initiator try to login. Do you see a disk getting added in /var/log/messages. if you do iscsiadm -m session -P 3 do you see your disk? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups open-iscsi group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~--~~~~--~~--~--~---
Re: open-iscsi does not detect logical volume
Hi All, I have figured out what the problem is: On reboot i found out that the volume group becomes inactive. So i did a vgchange -a y and it becomes active and restart both iscsitarget and open-iscsi services and you are good to go. Many Thanks to mike and Konrad for helping me out. I haven't yet figured out as to why the volume group goes inactive on reboot and how to automate this process of activating it on reboot. Thanks to one and all who helped me resolve this issue. I believe this is an issue with opensuse. On Fri, May 1, 2009 at 10:44 AM, sundar mahadevan sundarmahadeva...@gmail.com wrote: @mike: it works fine now. i restarted the service in the initiator and there is a new device detected in /var/log/messages as well as in fdisk -l What do i do now for this to work with logical volume. any help is greatly appreciated. many thanks for your help, mike. On Fri, May 1, 2009 at 10:36 AM, sundar mahadevan sundarmahadeva...@gmail.com wrote: @mike: When you run service iscsi-target start to start IET, do you see any errors in /var/log/messages? Yes. May 1 09:57:55 sunny2 kernel: iSCSI Enterprise Target Software - version 0.4.16 May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type fileio May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type blockio May 1 09:57:55 sunny2 kernel: iscsi_trgt: Registered io type nullio May 1 09:57:55 sunny2 kernel: iscsi_trgt: open_path(119) Can't open /dev/vg/ocfs -2 May 1 09:57:55 sunny2 kernel: iscsi_trgt: fileio_attach(283) -2 May 1 09:57:55 sunny2 ietd: Can't create a logical unit 2 1 0 Path=/dev/vg/ocfs,Type=fileio cd /home/sunny/Desktop dd if=/dev/zero of=test bs=1G count=1 opened ietd.conf and did Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/home/sunny/Desktop/test,Type=fileio service iscsi-target stop service iscsi-target start May 1 10:15:37 sunny2 kernel: iSCSI Enterprise Target Software - version 0.4.16 May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type fileio May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type blockio May 1 10:15:37 sunny2 kernel: iscsi_trgt: Registered io type nullio iscsiadm -m session -P 3 iSCSI Transport Class version 2.0-870 iscsiadm version 2.0-870 Target: iqn.2009-09.com.ezhome:ocfs Current Portal: 10.1.1.1:3260,1 Persistent Portal: 10.1.1.1:3260,1 ** Interface: ** Iface Name: default Iface Transport: tcp Iface Initiatorname: iqn.1996-04.de.suse:01:79a5ecb15528 Iface IPaddress: 10.1.1.2 Iface HWaddress: default Iface Netdev: default SID: 1 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE Negotiated iSCSI params: HeaderDigest: None DataDigest: None MaxRecvDataSegmentLength: 131072 MaxXmitDataSegmentLength: 8192 FirstBurstLength: 65536 MaxBurstLength: 262144 ImmediateData: Yes InitialR2T: Yes MaxOutstandingR2T: 1 Attached SCSI devices: Host Number: 2 State: running But there are no messages in /var/log/messages about new disk getting added. I even tried sunny1:~ # iscsiadm -m node -T iqn.2009-09.com.ezhome:ocfs -p 10.1.1.1 -l Logging in to [iface: default, target: iqn.2009-09.com.ezhome:ocfs, portal: 10.1.1.1,3260] iscsiadm: Could not login to [iface: default, target: iqn.2009-09.com.ezhome:ocfs, portal: 10.1.1.1,3260]: iscsiadm: initiator reported error (15 - already exists) sunny1:~ # /var/log/messages - May 1 10:21:11 sunny1 iscsid: session [iqn.2009-09.com.ezhome:ocfs,10.1.1.1,3260] already running. Help pls! On Thu, Apr 30, 2009 at 3:38 PM, Mike Christie micha...@cs.wisc.edu wrote: Mike Christie wrote: sundar mahadevan wrote: As i said before, there is no real file for /dev/vg/ocfs but lvdisplay shows /dev/vg/ocfs as my logical volume and ls -ail /dev/vg/ocfs 35413 lrwxrwxrwx 1 root root 19 Apr 30 14:33 /dev/vg/ocfs - /dev/mapper/vg-ocfs Now i'm really confused. Mike: As i said before there are only 2 uncommented lines in /etc/ietd.conf Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/dev/vg/ocfs,Type=fileio When you run service iscsi-target start to start IET, do you see any errors in /var/log/messages? You might just want to try something simple first. - dd if=/dev/zero of=file bs=1G count=1 - open ietd.conf and do Target iqn.2009-09.com.ezhome:ocfs Lun 0 Path=/where_you_put_file/file,Type=fileio service iscsi-target stop
[PATCH 3/4] iscsi class, libiscsi: Add net config.
Add ISCSI_NETLINK messages to get/set vendor specific information. This is to support bnx2i that handles net config of private iSCSI IP address in userspace. Signed-off-by: Anil Veerabhadrappa ani...@broadcom.com Signed-off-by: Michael Chan mc...@broadcom.com Signed-off-by: Mike Christie micha...@cs.wisc.edu Acked-by: David S. Miller da...@davemloft.net --- drivers/scsi/scsi_transport_iscsi.c | 59 ++- include/scsi/iscsi_if.h | 14 include/scsi/scsi_transport_iscsi.h |6 +++ 3 files changed, 78 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 0947954..ef3af96 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -995,6 +995,37 @@ int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, } EXPORT_SYMBOL_GPL(iscsi_recv_pdu); +extern int iscsi_vendor_priv_mesg(struct Scsi_Host *shost, + struct iscsi_transport *transport, + uint16_t priv_op, + char *data, uint16_t data_size) +{ + struct nlmsghdr *nlh; + struct sk_buff *skb; + struct iscsi_uevent *ev; + int len = NLMSG_SPACE(sizeof(*ev) + data_size); + + skb = alloc_skb(len, GFP_ATOMIC); + if (!skb) { + printk(KERN_ERR can not deliver vendor private message:OOM\n); + return -ENOMEM; + } + + nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); + ev = NLMSG_DATA(nlh); + memset(ev, 0, sizeof(*ev)); + ev-type = ISCSI_KEVENT_PRIVATE_MESG; + ev-transport_handle = iscsi_handle(transport); + ev-r.vendor_priv.host_no = shost-host_no; + ev-r.vendor_priv.priv_op = priv_op; + ev-r.vendor_priv.mesg_size = data_size; + + memcpy((char*)ev + sizeof(*ev), data, data_size); + + return iscsi_broadcast_skb(skb, GFP_KERNEL); +} +EXPORT_SYMBOL_GPL(iscsi_vendor_priv_mesg); + void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error) { struct nlmsghdr *nlh; @@ -1365,6 +1396,28 @@ iscsi_set_host_param(struct iscsi_transport *transport, } static int +iscsi_vendor_priv_msg(struct iscsi_transport *transport, + struct iscsi_uevent *ev) +{ + struct Scsi_Host *shost; + int err; + + shost = scsi_host_lookup(ev-u.vendor_priv.host_no); + if (!shost) { + printk(KERN_ERR target discovery could not find host no %u\n, + ev-u.tgt_dscvr.host_no); + return -ENODEV; + } + + err = transport-nl_priv_recv(shost, ev-u.vendor_priv.priv_op, + ev-u.vendor_priv.status, + (char *)((char*)ev + sizeof(*ev)), + ev-u.vendor_priv.mesg_size); + scsi_host_put(shost); + return err; +} + +static int iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) { int err = 0; @@ -1383,7 +1436,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) if (!try_module_get(transport-owner)) return -EINVAL; - priv-daemon_pid = NETLINK_CREDS(skb)-pid; + if (nlh-nlmsg_type != ISCSI_UEVENT_PRIVATE_MESG) + priv-daemon_pid = NETLINK_CREDS(skb)-pid; switch (nlh-nlmsg_type) { case ISCSI_UEVENT_CREATE_SESSION: @@ -1477,6 +1531,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) case ISCSI_UEVENT_SET_HOST_PARAM: err = iscsi_set_host_param(transport, ev); break; + case ISCSI_UEVENT_PRIVATE_MESG: + err = iscsi_vendor_priv_msg(transport, ev); + break; default: err = -ENOSYS; break; diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d0ed522..9e67946 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -52,6 +52,8 @@ enum iscsi_uevent_e { ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, + ISCSI_UEVENT_PRIVATE_MESG = UEVENT_BASE + 20, + /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, @@ -59,6 +61,7 @@ enum iscsi_uevent_e { ISCSI_KEVENT_DESTROY_SESSION= KEVENT_BASE + 4, ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, + ISCSI_KEVENT_PRIVATE_MESG = KEVENT_BASE + 7, }; enum iscsi_tgt_dscvr { @@ -154,6 +157,12 @@ struct iscsi_uevent { uint32_tparam; /* enum iscsi_host_param */ uint32_tlen; } set_host_param; + struct msg_vendor_priv { +
[PATCH 0/4] Add bnx2 iscsi support.
Adding linux-scsi and James to CC, please review. David has ACK'ed the networking portion. We have also fixed up some sparse warnings. The iscsi patches require these 2 patches from the iscsi tree: libiscsi: export iscsi_itt_to_task for bnx2i iscsi: pass ep connect shost --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups open-iscsi group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~--~~~~--~~--~--~---
[PATCH 1/4] bnx2: Add support for CNIC driver.
Add interface and functions to support a new CNIC driver to drive the hardware for iSCSI offload. Signed-off-by: Michael Chan mc...@broadcom.com Acked-by: David S. Miller da...@davemloft.net --- drivers/net/bnx2.c | 193 +++- drivers/net/bnx2.h | 18 + 2 files changed, 208 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d478391..aabc030 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -49,6 +49,10 @@ #include linux/firmware.h #include linux/log2.h +#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE) +#define BCM_CNIC 1 +#include cnic_if.h +#endif #include bnx2.h #include bnx2_fw.h @@ -315,6 +319,158 @@ bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val) spin_unlock_bh(bp-indirect_lock); } +#ifdef BCM_CNIC +static int +bnx2_drv_ctl(struct net_device *dev, struct drv_ctl_info *info) +{ + struct bnx2 *bp = netdev_priv(dev); + struct drv_ctl_io *io = info-data.io; + + switch (info-cmd) { + case DRV_CTL_IO_WR_CMD: + bnx2_reg_wr_ind(bp, io-offset, io-data); + break; + case DRV_CTL_IO_RD_CMD: + io-data = bnx2_reg_rd_ind(bp, io-offset); + break; + case DRV_CTL_CTX_WR_CMD: + bnx2_ctx_wr(bp, io-cid_addr, io-offset, io-data); + break; + default: + return -EINVAL; + } + return 0; +} + +static void bnx2_setup_cnic_irq_info(struct bnx2 *bp) +{ + struct cnic_eth_dev *cp = bp-cnic_eth_dev; + struct bnx2_napi *bnapi = bp-bnx2_napi[0]; + int sb_id; + + if (bp-flags BNX2_FLAG_USING_MSIX) { + cp-drv_state |= CNIC_DRV_STATE_USING_MSIX; + bnapi-cnic_present = 0; + sb_id = bp-irq_nvecs; + cp-irq_arr[0].irq_flags |= CNIC_IRQ_FL_MSIX; + } else { + cp-drv_state = ~CNIC_DRV_STATE_USING_MSIX; + bnapi-cnic_tag = bnapi-last_status_idx; + bnapi-cnic_present = 1; + sb_id = 0; + cp-irq_arr[0].irq_flags = ~CNIC_IRQ_FL_MSIX; + } + + cp-irq_arr[0].vector = bp-irq_tbl[sb_id].vector; + cp-irq_arr[0].status_blk = (void *) + ((unsigned long) bnapi-status_blk.msi + + (BNX2_SBLK_MSIX_ALIGN_SIZE * sb_id)); + cp-irq_arr[0].status_blk_num = sb_id; + cp-num_irq = 1; +} + +static int bnx2_register_cnic(struct net_device *dev, struct cnic_ops *ops, + void *data) +{ + struct bnx2 *bp = netdev_priv(dev); + struct cnic_eth_dev *cp = bp-cnic_eth_dev; + + if (ops == NULL) + return -EINVAL; + + if (cp-drv_state CNIC_DRV_STATE_REGD) + return -EBUSY; + + bp-cnic_data = data; + rcu_assign_pointer(bp-cnic_ops, ops); + + cp-num_irq = 0; + cp-drv_state = CNIC_DRV_STATE_REGD; + + bnx2_setup_cnic_irq_info(bp); + + return 0; +} + +static int bnx2_unregister_cnic(struct net_device *dev) +{ + struct bnx2 *bp = netdev_priv(dev); + struct bnx2_napi *bnapi = bp-bnx2_napi[0]; + struct cnic_eth_dev *cp = bp-cnic_eth_dev; + + cp-drv_state = 0; + bnapi-cnic_present = 0; + rcu_assign_pointer(bp-cnic_ops, NULL); + synchronize_rcu(); + return 0; +} + +struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev) +{ + struct bnx2 *bp = netdev_priv(dev); + struct cnic_eth_dev *cp = bp-cnic_eth_dev; + + cp-drv_owner = THIS_MODULE; + cp-chip_id = bp-chip_id; + cp-pdev = bp-pdev; + cp-io_base = bp-regview; + cp-drv_ctl = bnx2_drv_ctl; + cp-drv_register_cnic = bnx2_register_cnic; + cp-drv_unregister_cnic = bnx2_unregister_cnic; + + return cp; +} +EXPORT_SYMBOL(bnx2_cnic_probe); + +static void +bnx2_cnic_stop(struct bnx2 *bp) +{ + struct cnic_ops *c_ops; + struct cnic_ctl_info info; + + rcu_read_lock(); + c_ops = rcu_dereference(bp-cnic_ops); + if (c_ops) { + info.cmd = CNIC_CTL_STOP_CMD; + c_ops-cnic_ctl(bp-cnic_data, info); + } + rcu_read_unlock(); +} + +static void +bnx2_cnic_start(struct bnx2 *bp) +{ + struct cnic_ops *c_ops; + struct cnic_ctl_info info; + + rcu_read_lock(); + c_ops = rcu_dereference(bp-cnic_ops); + if (c_ops) { + if (!(bp-flags BNX2_FLAG_USING_MSIX)) { + struct bnx2_napi *bnapi = bp-bnx2_napi[0]; + + bnapi-cnic_tag = bnapi-last_status_idx; + } + info.cmd = CNIC_CTL_START_CMD; + c_ops-cnic_ctl(bp-cnic_data, info); + } + rcu_read_unlock(); +} + +#else + +static void +bnx2_cnic_stop(struct bnx2 *bp) +{ +} + +static void +bnx2_cnic_start(struct bnx2 *bp) +{ +} + +#endif + static int bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val)
[no subject]
unsubscribe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups open-iscsi group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~--~~~~--~~--~--~---