Re: iSCSI resets and raid1
On 23 Apr 2009 at 4:48, Omko wrote: The situation: I have 2 sans (brand is: open-e, runs open-iscsi I think). on both san's I create a target. I have 1 server. the recieves the targets from both san's. next the server does a raid1 on the two iSCSI disks. I do run multipath to the san and this works like a charm. When one of the san's fails, my server continues working. The problem: When I add a new target on the SAN it has to do a iSCSI reset. If I do this the server drops the connection to the san, the raid1 is broken. And I have to add the iSCSI disk to the raid set again and sync. The question: Does anybody here have a idea how to prevent the raid from dropping the disk and having to rebuild again? Maybe I can adjust some timers? I have been searching a lot, but I am unable to find anything. please help! Hi, I vaguely remember having read for SLES that md (software RAID) on top of iSCSI is not supported. I don't know the details, however. Regards, Ulrich --~--~-~--~~~---~--~~ 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: iSCSI resets and raid1
Omko schrieb: The situation: I have 2 sans (brand is: open-e, runs open-iscsi I think). on both san's I create a target. I have 1 server. the recieves the targets from both san's. next the server does a raid1 on the two iSCSI disks. I do run multipath to the san and this works like a charm. When one of the san's fails, my server continues working. The problem: When I add a new target on the SAN it has to do a iSCSI reset. If I do this the server drops the connection to the san, the raid1 is broken. And I have to add the iSCSI disk to the raid set again and sync. The question: Does anybody here have a idea how to prevent the raid from dropping the disk and having to rebuild again? Maybe I can adjust some timers? I have been searching a lot, but I am unable to find anything. Please see if it helps: http://www.open-iscsi.org/docs/README Chapter: 8.2 iSCSI settings for iSCSI root AFAIK, open-e is based on an old kernel and an old version of IET, I'm not sure how it reloads settings. Last I used it, it needed full daemon restart and was not very reliable - so the above link may not help you. -- Tomasz Chmielewski http://wpkg.org --~--~-~--~~~---~--~~ 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 --- 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) { @@ -488,6 +644,7 @@ bnx2_napi_enable(struct
[PATCH 3/4] iscsi class, libiscsi: Add net config.
Add ISCSI_NETLINK messages to set/get iSCSI network parameters and vendor specific information. 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 --- drivers/scsi/scsi_transport_iscsi.c | 87 ++- include/scsi/iscsi_if.h | 45 ++ include/scsi/scsi_transport_iscsi.h | 58 +++ 3 files changed, 188 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 0947954..925f9b0 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -995,6 +995,36 @@ 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, 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-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; @@ -1332,7 +1362,6 @@ iscsi_tgt_dscvr(struct iscsi_transport *transport, return -ENODEV; } - dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev)); err = transport-tgt_dscvr(shost, ev-u.tgt_dscvr.type, ev-u.tgt_dscvr.enable, dst_addr); @@ -1364,6 +1393,52 @@ iscsi_set_host_param(struct iscsi_transport *transport, return err; } + +static int +iscsi_set_host_net_cfg(struct iscsi_transport *transport, + struct iscsi_uevent *ev, int msg_type) +{ + char *data = (char*)ev + sizeof(*ev); + struct Scsi_Host *shost; + int err; + + if (!transport-set_net_config) + return -ENOSYS; + + shost = scsi_host_lookup(ev-u.set_net_config.host_no); + if (!shost) { + printk(KERN_ERR set_net_config could not find host no %u\n, + ev-u.set_host_param.host_no); + return -ENODEV; + } + + err = transport-set_net_config(shost, data, ev-u.set_net_config.len); + scsi_host_put(shost); + return err; +} + +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) { @@ -1383,7 +1458,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 +1553,13 @@ 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_SET_NET_CONFIG: + case ISCSI_UEVENT_GET_NET_CONFIG: + err = iscsi_set_host_net_cfg(transport, ev, nlh-nlmsg_type); + 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..9b602fe 100644 ---
[PATCH 0/4] Add bnx2 iSCSI support.
New Broadcom iSCSI driver for review. Compared to the last version we posted in 2008, we've changed it to use a separate and private MAC address/IP address for iSCSI. We are creating a UIO interface to handle the non-offloaded packets such as ARP, etc. in user space. Thanks. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---