Re: udev events for iscsi

2020-04-21 Thread robert
Wondering myself.

> On Apr 21, 2020, at 2:31 AM, Gionatan Danti  wrote:
> 
> 
> [reposting, as the previous one seems to be lost]
> 
> Hi all,
> I have a question regarding udev events when using iscsi disks.
> 
> By using "udevadm monitor" I can see that events are generated when I login 
> and logout from an iscsi portal/resource, creating/destroying the relative 
> links under /dev/

So running “udevadm monitor” on the initiator, you can see when a block device 
becomes available locally.   


> 
> However, I can not see anything when the remote machine simple 
> dies/reboots/disconnects: while "dmesg" shows the iscsi timeout expiring, I 
> don't see anything about a removed disk (and the links under /dev/ remains 
> unaltered, indeed). At the same time, when the remote machine and disk become 
> available again, no reconnection events happen.

As someone who has had an inordinate amount of experience with the iSCSi 
connection breaking ( power outage, Network switch dies,  wrong ethernet cable 
pulled, the target server machine hardware crashes, ...) in the middle of 
production, the more info the better.   Udev event triggers would help.   I 
wonder exactly how XenServer handles this as it itself seemed more resilient.  

XenServer host initiators  do something correct to recover and wonder how that 
compares to the normal iSCSi initiator.   

But unfortunately, XenServer LVM-over-iSCSi  does not pass the message along to 
its Linux virtual drives and VMs in the same way as Windows VMs.

When the target drives became available again,   MS Windows virtual machines 
would gracefully recover on their own.All Linux VM  filesystems went read 
only and those VM machines required forceful  rebooting.   mount remount would 
not work. 


> 
> I can read here that, years ago, a patch was in progress to give better 
> integration with udev when a device disconnects/reconnects. Did the patch got 
> merged? Or does the one I described above remain the expected behavior? Can 
> be changed?
> 
> Thanks.
> -- 
> 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 open-iscsi+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/open-iscsi/13d4c963-b633-4672-97d9-dd41eec5fb5b%40googlegroups.com.

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/9D54680A-F97E-4465-BA6C-566562C5DC91%40eyeconsultantspc.com.


Re: Who know more about this issue for iscsid?

2020-01-07 Thread Robert ECEO Townley
On Tue, Jan 7, 2020 at 2:20 AM can zhu  wrote:

> kernel: connection2:0: detected conn error (1020)
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: Kernel reported iSCSI connection 2:0 error (1020 -
> ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (1)
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> systemd: Started Session 3742 of user root.
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
> iscsid: conn 0 login rejected: initiator failed authorization with target
>
>
> *env*
>
> kernel:3.10.0-693.el7.x86_64
>
> os:CentOS Linux release 7.4.1708 (Core)
>
> *iscsi*-initiator-utils: *iscsi*-initiator-utils-6.2.0.874-11.el7.x86_64
>
>
> I can't configure acl and username、password.
>
>
>
> --
> 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 open-iscsi+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/open-iscsi/f0bab99e-accd-46cc-9d37-7700773ffc47%40googlegroups.com
> 
> .
>

I get the names of all the different iSCSi projects out there mixed up, so
forgive me if i am on the wrong list to mention about the targetcli
freebranch by Andy Grover of RedHat.   It is the one built into the kernel
and the default for RHEL 7 and newer versions of Ubuntu.  He calls it
freebranch but Datera.io contributed it to the kernel?

Do you have root access on both target (server) and initiator (client)?

If you have root on the server side / target, *targetcli *is used to set
the username and password.  yum search targetcli.  There is an attribute to
set the password.  If you forgot, info can tell you as well as

` cat /etc/targetcli/saveconfig.json | egrep -i '(CHAP|PASS)' `

*targetcli*
*ls*
*cd
/iscsi/iqn.-MM.us.domain.iscsiServer:ramdisk4gb/tpg1/acls/iqn.-MM.us.domain.iscsiClient:client*
*info*


Would watch Andy Grovers targetcli videos on youtube.

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/CACE8FwnY%3DurpRfL4jNENFXY_6MN4TJ%2BAN_aZD0Uac2F%2BBPyRqg%40mail.gmail.com.


Re: reboot hangs with "Reached target shutdown", who can help me?

2019-12-13 Thread Robert ECEO Townley
If you enter the mount command at this point, what mount points are still
mounted?   Screenshot has some contradictions.



On Thu, Dec 12, 2019 at 8:08 PM can zhu  wrote:

>
> @The Lee-Man  Thanks, In my environment, the default value of the
> node.startup is automatic in config
>
>
>
> The Lee-Man  于2019年12月13日周五 上午5:17写道:
>
>> Okay, I checked CentOS 8, and the services seem very similar to what I'm
>> familiar with.
>>
>> You do indeed need to make sure your nodes have startup set to automatic.
>>
>> Use something like:
>>
>> > zsh> sudo iscsiadm -m node --op update --name 'node.conn[0].startup'
>> --value automatic
>>
>> to update all nodes to start and stop automatically, and update startup
>> in /etc/iscsi/iscsid.conf to change the default.
>>
>> --
>> 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 open-iscsi+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/open-iscsi/5bdc3a89-e685-453d-8908-5a5c0e2f7332%40googlegroups.com
>> 
>> .
>>
> --
> 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 open-iscsi+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/open-iscsi/CAGJK1K%3DU0UsEn9Sv0%3DtOFo2hgBeWEE4gDaRtsgEg3-08g829BA%40mail.gmail.com
> 
> .
>

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/CACE8Fw%3D30hiKc%3DRm4%3Dk_2vPm%2BzTzponTMKt2um9xTmOc-qoTgA%40mail.gmail.com.


Re: [PATCH 0/7] Enable iSCSI offload drivers to use information from iface.

2017-07-24 Thread Robert LeBlanc
On Wed, Jun 14, 2017 at 10:47 AM, Robert LeBlanc <rob...@leblancnet.us> wrote:
> On Wed, Jun 14, 2017 at 3:20 AM, Rangankar, Manish
> <manish.rangan...@cavium.com> wrote:
>>
>> On 13/06/17 10:19 PM, "Robert LeBlanc" <rob...@leblancnet.us> wrote:
>>
>>>On Wed, Jun 7, 2017 at 12:30 PM, Robert LeBlanc <rob...@leblancnet.us>
>>>wrote:
>>>> On Wed, Jun 7, 2017 at 10:28 AM, Chris Leech <cle...@redhat.com> wrote:
>>>>> On Tue, Jun 06, 2017 at 12:07:10PM -0600, Robert LeBlanc wrote:
>>>>>> This patchset enables iSCSI offload drivers to have access to the
>>>>>>iface
>>>>>> information provided by iscsid. This allows users to have more control
>>>>>> of how the driver connects to the iSCSI target. iSER is updated to use
>>>>>> iface.ipaddress to set the source IP address if configured. This
>>>>>>allows
>>>>>> iSER to use multiple ports on the same network or in more complicated
>>>>>> routed configurations.
>>>>>>
>>>>>> Since there is already a change to the function parameters, dst_addr
>>>>>> is upgraded to sockaddr_storage so that it is more future proof and
>>>>>>makes
>>>>>> the size of the struct static and not dependent on checking the
>>>>>>SA_FAMILY.
>>>>>>
>>>>>> This is dependent on updates to Open-iSCSI.
>>>>>
>>>>> Hi Robert,
>>>>>
>>>>> I don't think that passing the iface_rec structure directly from the
>>>>> iscsid internals into a netlink message is a good way to go about this.
>>>>> It's really big, there's an embedded list_head with user address
>>>>> pointers that needs to be left out, and there are 32/64-bit layout
>>>>> differences.
>>>>>
>>>>> Let me take a look at how you're proposing using this info for iSER, if
>>>>> it makes sense I think we should come up with a better designed
>>>>> structure for passing the information.
>>>>>
>>>>> Thanks,
>>>>> Chris
>>>>>
>>>>
>>>> Chris,
>>>>
>>>> Thank you for your feedback. I agree that the entire iface is probably
>>>> overkill, it was more of a proof of concept. We are only using the
>>>> ipaddress in the iface for iSER (in my patch), but I could see other
>>>> drivers benefiting from some of the other data in the iface (mac,
>>>> interface_name, vlan, etc) so I didn't want to be too restrictive so
>>>> that it wouldn't have to be extended later. I've not worked on
>>>> userspace/kernel interaction before so I need some guidance to make
>>>> the transition between userspace and kernel versions smoother.
>>>>
>>>> This patchset works for what we need and it is very important for us
>>>> (and I'm sure others once the feature is available) and I'm happy to
>>>> put in the time to get it accepted upstream, I'm just new to kernel
>>>> development and need some guidance.
>>>
>>>Are there other comments/ideas/suggestions specifically from the
>>>iSCSI/iSER guys? I'd like to keep this patch moving.
>>
>> Considering partial iSCSI offload solution (like bnx2i and qedi) point of
>> view, we liked the idea from Hannes to create TAP interface to associate
>> with each iSCSI offload interface, which will allow us to use userspace
>> tools for configuration. I haven't dig into its details yet, but at higher
>> level it looks like this will help us to move away from our dependency
>> over iscsiuio.
>
> I'm having a hard time wrapping my head around this idea. How can
> configuring a TAP (separate Ethernet device) affect the offload NIC. I
> don't see how you can bind to the right interface with the IP address
> or how that is passed to rdma_connect() using a TAP. Is TAP used
> instead of netlink for communicating between userspace and the kernel?
> Obviously by my questions, at the moment I'm not sure how to approach
> this at all and would be the wrong person to make this happen.
>
> If someone can explain how this would work and point to some code that
> does something like this (examples are good for me), I can try to
> create a patch with TAPs. As I mentioned before, this is important for
> us and I'm willing to put in the time to learn and code, but I'm
> really lost at this point.
>
> Thank you,
>
> 
> Robert LeBlanc
> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

Can we get some more discussion/enlightenment on this? It would be
really nice to have this in 4.14 and time is getting short.

Thanks.


Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 0/7] Enable iSCSI offload drivers to use information from iface.

2017-06-13 Thread Robert LeBlanc
On Wed, Jun 7, 2017 at 12:30 PM, Robert LeBlanc <rob...@leblancnet.us> wrote:
> On Wed, Jun 7, 2017 at 10:28 AM, Chris Leech <cle...@redhat.com> wrote:
>> On Tue, Jun 06, 2017 at 12:07:10PM -0600, Robert LeBlanc wrote:
>>> This patchset enables iSCSI offload drivers to have access to the iface
>>> information provided by iscsid. This allows users to have more control
>>> of how the driver connects to the iSCSI target. iSER is updated to use
>>> iface.ipaddress to set the source IP address if configured. This allows
>>> iSER to use multiple ports on the same network or in more complicated
>>> routed configurations.
>>>
>>> Since there is already a change to the function parameters, dst_addr
>>> is upgraded to sockaddr_storage so that it is more future proof and makes
>>> the size of the struct static and not dependent on checking the SA_FAMILY.
>>>
>>> This is dependent on updates to Open-iSCSI.
>>
>> Hi Robert,
>>
>> I don't think that passing the iface_rec structure directly from the
>> iscsid internals into a netlink message is a good way to go about this.
>> It's really big, there's an embedded list_head with user address
>> pointers that needs to be left out, and there are 32/64-bit layout
>> differences.
>>
>> Let me take a look at how you're proposing using this info for iSER, if
>> it makes sense I think we should come up with a better designed
>> structure for passing the information.
>>
>> Thanks,
>> Chris
>>
>
> Chris,
>
> Thank you for your feedback. I agree that the entire iface is probably
> overkill, it was more of a proof of concept. We are only using the
> ipaddress in the iface for iSER (in my patch), but I could see other
> drivers benefiting from some of the other data in the iface (mac,
> interface_name, vlan, etc) so I didn't want to be too restrictive so
> that it wouldn't have to be extended later. I've not worked on
> userspace/kernel interaction before so I need some guidance to make
> the transition between userspace and kernel versions smoother.
>
> This patchset works for what we need and it is very important for us
> (and I'm sure others once the feature is available) and I'm happy to
> put in the time to get it accepted upstream, I'm just new to kernel
> development and need some guidance.

Are there other comments/ideas/suggestions specifically from the
iSCSI/iSER guys? I'd like to keep this patch moving.

Thanks.


Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 0/7] Enable iSCSI offload drivers to use information from iface.

2017-06-07 Thread Robert LeBlanc
On Wed, Jun 7, 2017 at 10:28 AM, Chris Leech <cle...@redhat.com> wrote:
> On Tue, Jun 06, 2017 at 12:07:10PM -0600, Robert LeBlanc wrote:
>> This patchset enables iSCSI offload drivers to have access to the iface
>> information provided by iscsid. This allows users to have more control
>> of how the driver connects to the iSCSI target. iSER is updated to use
>> iface.ipaddress to set the source IP address if configured. This allows
>> iSER to use multiple ports on the same network or in more complicated
>> routed configurations.
>>
>> Since there is already a change to the function parameters, dst_addr
>> is upgraded to sockaddr_storage so that it is more future proof and makes
>> the size of the struct static and not dependent on checking the SA_FAMILY.
>>
>> This is dependent on updates to Open-iSCSI.
>
> Hi Robert,
>
> I don't think that passing the iface_rec structure directly from the
> iscsid internals into a netlink message is a good way to go about this.
> It's really big, there's an embedded list_head with user address
> pointers that needs to be left out, and there are 32/64-bit layout
> differences.
>
> Let me take a look at how you're proposing using this info for iSER, if
> it makes sense I think we should come up with a better designed
> structure for passing the information.
>
> Thanks,
> Chris
>

Chris,

Thank you for your feedback. I agree that the entire iface is probably
overkill, it was more of a proof of concept. We are only using the
ipaddress in the iface for iSER (in my patch), but I could see other
drivers benefiting from some of the other data in the iface (mac,
interface_name, vlan, etc) so I didn't want to be too restrictive so
that it wouldn't have to be extended later. I've not worked on
userspace/kernel interaction before so I need some guidance to make
the transition between userspace and kernel versions smoother.

This patchset works for what we need and it is very important for us
(and I'm sure others once the feature is available) and I'm happy to
put in the time to get it accepted upstream, I'm just new to kernel
development and need some guidance.

Thanks,

Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH] Pass iface for connection

2017-06-06 Thread Robert LeBlanc
---
 usr/netlink.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/usr/netlink.c b/usr/netlink.c
index 1a0bf80..c474375 100644
--- a/usr/netlink.c
+++ b/usr/netlink.c
@@ -848,10 +848,13 @@ krecv_pdu_end(struct iscsi_conn *conn)
 int
 ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking)
 {
-   int rc, addrlen;
+   int rc, addrlen = sizeof(struct sockaddr_storage);
struct iscsi_uevent *ev;
-   struct sockaddr *dst_addr = (struct sockaddr *)>saddr;
+   struct sockaddr_storage *dst_addr = (struct sockaddr_storage 
*)>saddr;
struct iovec iov[2];
+   struct iscsi_session *tmp_session = (struct iscsi_session 
*)conn->session;
+   node_rec_t *tmp_rec = (node_rec_t *)_session->nrec;
+   iface_rec_t *tmp_iface = (iface_rec_t *)_rec->iface;
 
log_debug(7, "in %s", __FUNCTION__);
 
@@ -868,19 +871,16 @@ ktransport_ep_connect(iscsi_conn_t *conn, int 
non_blocking)
ev->u.ep_connect.non_blocking = non_blocking;
}
 
-   if (dst_addr->sa_family == PF_INET)
-   addrlen = sizeof(struct sockaddr_in);
-   else if (dst_addr->sa_family == PF_INET6)
-   addrlen = sizeof(struct sockaddr_in6);
-   else {
+   if (dst_addr->ss_family != AF_INET && dst_addr->ss_family != AF_INET6) {
log_error("%s unknown addr family %d",
-__FUNCTION__, dst_addr->sa_family);
+__FUNCTION__, dst_addr->ss_family);
return -EINVAL;
}
memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen);
+   iface_copy(setparam_buf + sizeof(*ev) + addrlen, tmp_iface);
 
iov[1].iov_base = ev;
-   iov[1].iov_len = sizeof(*ev) + addrlen;
+   iov[1].iov_len = sizeof(*ev) + addrlen + sizeof(iface_rec_t);
rc = __kipc_call(iov, 2);
if (rc < 0)
return rc;
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 4/7] scsi/be2iscsi: Update beiscsi_ep_connect to accept iface and sockaddr_storage.

2017-06-06 Thread Robert LeBlanc
Update Emulex BladeEngine driver to accept the session iface for
creating the iSCSI connection. Also accept dst_addr as sockaddr_storage
instead of sockaddr.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/scsi/be2iscsi/be_cmds.c  | 1 +
 drivers/scsi/be2iscsi/be_iscsi.c | 8 +---
 drivers/scsi/be2iscsi/be_iscsi.h | 5 +++--
 drivers/scsi/be2iscsi/be_main.c  | 1 +
 drivers/scsi/be2iscsi/be_mgmt.c  | 1 +
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index a79a5e72c777..6617f2add9c6 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 
 #include "be_main.h"
 #include "be.h"
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 97dca4681784..90adf20dc373 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -12,6 +12,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -1161,8 +1162,8 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
  * This routines first asks chip to create a connection and then allocates an 
EP
  */
 struct iscsi_endpoint *
-beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
-  int non_blocking)
+beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr_storage *dst_addr,
+  int non_blocking, struct iface_rec *iface)
 {
struct beiscsi_hba *phba;
struct beiscsi_endpoint *beiscsi_ep;
@@ -1198,7 +1199,8 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct 
sockaddr *dst_addr,
beiscsi_ep = ep->dd_data;
beiscsi_ep->phba = phba;
beiscsi_ep->openiscsi_ep = ep;
-   ret = beiscsi_open_conn(ep, NULL, dst_addr, non_blocking);
+   ret = beiscsi_open_conn(ep, NULL, (struct sockaddr *)dst_addr,
+   non_blocking);
if (ret) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
"BS_%d : Failed in beiscsi_open_conn\n");
diff --git a/drivers/scsi/be2iscsi/be_iscsi.h b/drivers/scsi/be2iscsi/be_iscsi.h
index b9d459a21f25..68616f81a12f 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.h
+++ b/drivers/scsi/be2iscsi/be_iscsi.h
@@ -68,8 +68,9 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
 int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn);
 
 struct iscsi_endpoint *beiscsi_ep_connect(struct Scsi_Host *shost,
- struct sockaddr *dst_addr,
- int non_blocking);
+ struct sockaddr_storage *dst_addr,
+ int non_blocking,
+ struct iface_rec *iface);
 
 int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms);
 
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index f862332261f8..aab7772e2678 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index c73775368d09..926afa4ddb9d 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include "be_mgmt.h"
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 2/7] scsi/scsi_transport_iscsi: Update ep_connect to include iface.

2017-06-06 Thread Robert LeBlanc
Update the ep_connect function to include the iface in the parameters
passed to the driver. Since we have to make a change, also change the
dst_addr to sockaddr_storage so that it is future proof and a static
size.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/scsi/scsi_transport_iscsi.c | 9 ++---
 include/scsi/scsi_transport_iscsi.h | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index a424eaeafeb0..64157a1d62e6 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define ISCSI_TRANSPORT_VERSION "2.0-870"
 
@@ -2794,7 +2795,8 @@ static int iscsi_if_ep_connect(struct iscsi_transport 
*transport,
   struct iscsi_uevent *ev, int msg_type)
 {
struct iscsi_endpoint *ep;
-   struct sockaddr *dst_addr;
+   struct sockaddr_storage *dst_addr;
+   struct iface_rec *iface;
struct Scsi_Host *shost = NULL;
int non_blocking, err = 0;
 
@@ -2813,8 +2815,9 @@ static int iscsi_if_ep_connect(struct iscsi_transport 
*transport,
} else
non_blocking = ev->u.ep_connect.non_blocking;
 
-   dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev));
-   ep = transport->ep_connect(shost, dst_addr, non_blocking);
+   dst_addr = (struct sockaddr_storage *)((char*)ev + sizeof(*ev));
+   iface = (struct iface_rec *)((char*)ev + sizeof(*ev) + 
sizeof(*dst_addr));
+   ep = transport->ep_connect(shost, dst_addr, non_blocking, iface);
if (IS_ERR(ep)) {
err = PTR_ERR(ep);
goto release_host;
diff --git a/include/scsi/scsi_transport_iscsi.h 
b/include/scsi/scsi_transport_iscsi.h
index 26fe284daf9a..c146e90e912b 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -133,8 +133,9 @@ struct iscsi_transport {
 
void (*session_recovery_timedout) (struct iscsi_cls_session *session);
struct iscsi_endpoint *(*ep_connect) (struct Scsi_Host *shost,
- struct sockaddr *dst_addr,
- int non_blocking);
+ struct sockaddr_storage *dst_addr,
+ int non_blocking,
+ struct iface_rec *iface);
int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms);
void (*ep_disconnect) (struct iscsi_endpoint *ep);
int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 3/7] ib/iSER: Add binding to source IP address.

2017-06-06 Thread Robert LeBlanc
If the iface passed in has ip address set, then attept to create an RDMA
connection using it as the source IP address. This allows iSER to use
multiple ports on the same network or in more complex routing
configurations. Also update to accepting sockaddr_storage.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/infiniband/ulp/iser/iscsi_iser.c | 33 
 drivers/infiniband/ulp/iser/iscsi_iser.h |  4 ++--
 drivers/infiniband/ulp/iser/iser_initiator.c |  1 +
 drivers/infiniband/ulp/iser/iser_memory.c|  1 +
 drivers/infiniband/ulp/iser/iser_verbs.c |  8 ---
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 5a887efb4bdf..7ba5ed9afe05 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -808,12 +809,16 @@ static int iscsi_iser_get_ep_param(struct iscsi_endpoint 
*ep,
  * if fails.
  */
 static struct iscsi_endpoint *
-iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
- int non_blocking)
+iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr_storage 
*dst_addr,
+ int non_blocking, struct iface_rec *iface)
 {
int err;
struct iser_conn *iser_conn;
struct iscsi_endpoint *ep;
+   struct sockaddr_storage src_addr;
+   struct sockaddr_in *tmp_addr;
+   struct sockaddr_in6 *tmp_addr6;
+   memset(_addr, 0, sizeof(src_addr));
 
ep = iscsi_create_endpoint(0);
if (!ep)
@@ -828,8 +833,28 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct 
sockaddr *dst_addr,
ep->dd_data = iser_conn;
iser_conn->ep = ep;
iser_conn_init(iser_conn);
-
-   err = iser_connect(iser_conn, NULL, dst_addr, non_blocking);
+   if (iface && iface->ipaddress[0]) {
+   if (strchr(iface->ipaddress, ':')) {
+   tmp_addr6 = (struct sockaddr_in6 *)_addr;
+   tmp_addr6->sin6_family = AF_INET6;
+   if(!in6_pton(iface->ipaddress, -1,
+tmp_addr6->sin6_addr.s6_addr,
+-1, NULL)) {
+   err = -EINVAL;
+   goto failure;
+   }
+   } else {
+   tmp_addr = (struct sockaddr_in *)_addr;
+   tmp_addr->sin_family = AF_INET;
+   if (!in4_pton(iface->ipaddress, -1,
+(u8 *)_addr->sin_addr.s_addr,
+-1, NULL)) {
+   err = -EINVAL;
+   goto failure;
+   }
+   }
+   }
+   err = iser_connect(iser_conn, _addr, dst_addr, non_blocking);
if (err)
goto failure;
 
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h 
b/drivers/infiniband/ulp/iser/iscsi_iser.h
index c1ae4aeae2f9..1eda6ff49bdc 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -628,8 +628,8 @@ void iser_unreg_rdma_mem(struct iscsi_iser_task *task,
 enum iser_data_dir dir);
 
 int  iser_connect(struct iser_conn *iser_conn,
- struct sockaddr *src_addr,
- struct sockaddr *dst_addr,
+ struct sockaddr_storage *src_addr,
+ struct sockaddr_storage *dst_addr,
  int non_blocking);
 
 void iser_unreg_mem_fmr(struct iscsi_iser_task *iser_task,
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c 
b/drivers/infiniband/ulp/iser/iser_initiator.c
index 12ed62ce9ff7..361d5e411fe7 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c 
b/drivers/infiniband/ulp/iser/iser_memory.c
index 9c3e9ab53a41..c9d95b997820 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "iscsi_iser.h"
 static
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c 
b/drivers/infiniband/ulp/iser/iser_verbs.c
index c538a38c91ce..0a43009296b6 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "iscsi_iser.h"
 
@@ -941,8 +942,8 @@ void iser_conn_init(struct iser_conn *iser_conn)
  * sleeps until the connection is established or rejected
  */
 int iser_connect(struct iser_

[PATCH 5/7] scsi/bnx2i: Update bnx2i_ep_connect to accept iface and sockaddr_storage.

2017-06-06 Thread Robert LeBlanc
Update QLogic NetXtreme II driver to accept the session iface for creating
the iSCSI connection. Also accept dst_addr as sockaddr_storage instead of
sockaddr.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/scsi/bnx2i/bnx2i_hwi.c   |  1 +
 drivers/scsi/bnx2i/bnx2i_iscsi.c | 13 -
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 42921dbba927..ce87ce2c2dc1 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -15,6 +15,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include "bnx2i.h"
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index f32a66f89d25..515106367426 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -16,8 +16,10 @@
  */
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include "bnx2i.h"
 
 struct scsi_transport_template *bnx2i_scsi_xport_template;
@@ -1771,8 +1773,9 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba,
  * sending down option-2 request to complete TCP 3-way handshake
  */
 static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
-  struct sockaddr *dst_addr,
-  int non_blocking)
+  struct sockaddr_storage 
*dst_addr,
+  int non_blocking,
+  struct iface_rec *iface)
 {
u32 iscsi_cid = BNX2I_CID_RESERVED;
struct sockaddr_in *desti = (struct sockaddr_in *) dst_addr;
@@ -1792,7 +1795,7 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct 
Scsi_Host *shost,
 * check if the given destination can be reached through
 * a iscsi capable NetXtreme2 device
 */
-   hba = bnx2i_check_route(dst_addr);
+   hba = bnx2i_check_route((struct sockaddr *)dst_addr);
 
if (!hba) {
rc = -EINVAL;
@@ -1887,11 +1890,11 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct 
Scsi_Host *shost,
clear_bit(SK_TCP_TIMESTAMP, _ep->cm_sk->tcp_flags);
 
memset(, 0, sizeof(saddr));
-   if (dst_addr->sa_family == AF_INET) {
+   if (dst_addr->ss_family == AF_INET) {
desti = (struct sockaddr_in *) dst_addr;
saddr.remote.v4 = *desti;
saddr.local.v4.sin_family = desti->sin_family;
-   } else if (dst_addr->sa_family == AF_INET6) {
+   } else if (dst_addr->ss_family == AF_INET6) {
desti6 = (struct sockaddr_in6 *) dst_addr;
saddr.remote.v6 = *desti6;
saddr.local.v6.sin6_family = desti6->sin6_family;
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 7/7] scsi/qla4xxx: Update qla4xxx_ep_connect to accept iface and sockaddr_storage.

2017-06-06 Thread Robert LeBlanc
Update QLogic ISP4XXX and ISP82XX drivers to accept the session iface for
creating the iSCSI connection. Also accept dst_addr as sockaddr_storage
instead of sockaddr.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/scsi/qla4xxx/ql4_os.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 64c6fa563fdb..4fccb580bd48 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -119,8 +119,9 @@ static int qla4xxx_get_iface_param(struct iscsi_iface 
*iface,
   int param, char *buf);
 static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);
 static struct iscsi_endpoint *qla4xxx_ep_connect(struct Scsi_Host *shost,
-struct sockaddr *dst_addr,
-int non_blocking);
+struct sockaddr_storage 
*dst_addr,
+int non_blocking,
+struct iface_rec *iface);
 static int qla4xxx_ep_poll(struct iscsi_endpoint *ep, int timeout_ms);
 static void qla4xxx_ep_disconnect(struct iscsi_endpoint *ep);
 static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep,
@@ -1656,8 +1657,8 @@ static int qla4xxx_get_iface_param(struct iscsi_iface 
*iface,
 }
 
 static struct iscsi_endpoint *
-qla4xxx_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
-  int non_blocking)
+qla4xxx_ep_connect(struct Scsi_Host *shost, struct sockaddr_storage *dst_addr,
+  int non_blocking, struct iface_rec *iface)
 {
int ret;
struct iscsi_endpoint *ep;
@@ -1681,12 +1682,12 @@ qla4xxx_ep_connect(struct Scsi_Host *shost, struct 
sockaddr *dst_addr,
 
qla_ep = ep->dd_data;
memset(qla_ep, 0, sizeof(struct qla_endpoint));
-   if (dst_addr->sa_family == AF_INET) {
+   if (dst_addr->ss_family == AF_INET) {
memcpy(_ep->dst_addr, dst_addr, sizeof(struct sockaddr_in));
addr = (struct sockaddr_in *)_ep->dst_addr;
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: %pI4\n", __func__,
  (char *)>sin_addr));
-   } else if (dst_addr->sa_family == AF_INET6) {
+   } else if (dst_addr->ss_family == AF_INET6) {
memcpy(_ep->dst_addr, dst_addr,
   sizeof(struct sockaddr_in6));
addr6 = (struct sockaddr_in6 *)_ep->dst_addr;
@@ -6569,7 +6570,7 @@ static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct 
scsi_qla_host *ha,
addr->sin_port = htons(le16_to_cpu(fw_ddb_entry->port));
}
 
-   ep = qla4xxx_ep_connect(ha->host, (struct sockaddr *)dst_addr, 0);
+   ep = qla4xxx_ep_connect(ha->host, dst_addr, 0, NULL);
vfree(dst_addr);
return ep;
 }
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 6/7] scsi/cxgbi: Update cxgbi_ep_connect to accept iface and sockaddr_storage.

2017-06-06 Thread Robert LeBlanc
Update Chelsio iSCSI driver to accept the session iface for creating the
iSCSI connection. Also accept dst_addr as sockaddr_storage instead of
sockaddr.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 drivers/scsi/cxgbi/libcxgbi.c | 15 ---
 drivers/scsi/cxgbi/libcxgbi.h |  2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index bd7d39ecbd24..62f62305be49 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2499,8 +2499,9 @@ int cxgbi_get_host_param(struct Scsi_Host *shost, enum 
iscsi_host_param param,
 EXPORT_SYMBOL_GPL(cxgbi_get_host_param);
 
 struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *shost,
-   struct sockaddr *dst_addr,
-   int non_blocking)
+   struct sockaddr_storage *dst_addr,
+   int non_blocking,
+   struct iface_rec *iface)
 {
struct iscsi_endpoint *ep;
struct cxgbi_endpoint *cep;
@@ -2520,15 +2521,15 @@ struct iscsi_endpoint *cxgbi_ep_connect(struct 
Scsi_Host *shost,
}
}
 
-   if (dst_addr->sa_family == AF_INET) {
-   csk = cxgbi_check_route(dst_addr);
+   if (dst_addr->ss_family == AF_INET) {
+   csk = cxgbi_check_route((struct sockaddr *)dst_addr);
 #if IS_ENABLED(CONFIG_IPV6)
-   } else if (dst_addr->sa_family == AF_INET6) {
-   csk = cxgbi_check_route6(dst_addr);
+   } else if (dst_addr->ss_family == AF_INET6) {
+   csk = cxgbi_check_route6((struct sockaddr *)dst_addr);
 #endif
} else {
pr_info("address family 0x%x NOT supported.\n",
-   dst_addr->sa_family);
+   dst_addr->ss_family);
err = -EAFNOSUPPORT;
return (struct iscsi_endpoint *)ERR_PTR(err);
}
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index 18e0ea83d361..e2e0c4dc7abc 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -596,7 +596,7 @@ int cxgbi_set_host_param(struct Scsi_Host *,
enum iscsi_host_param, char *, int);
 int cxgbi_get_host_param(struct Scsi_Host *, enum iscsi_host_param, char *);
 struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *,
-   struct sockaddr *, int);
+   struct sockaddr_storage *, int, struct iface_rec *);
 int cxgbi_ep_poll(struct iscsi_endpoint *, int);
 void cxgbi_ep_disconnect(struct iscsi_endpoint *);
 
-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/7] scsi/scsi_transport_iscsi: Add iface struct to kernel.

2017-06-06 Thread Robert LeBlanc
Allow the userspace iscsiadm to pass the iface struct of the connection
so that the underlying driver can use what is most appropriate to create
the iSCSI connection.

Signed-off-by: Robert LeBlanc <rob...@leblancnet.us>
---
 include/scsi/scsi_transport_iscsi.h | 95 +
 1 file changed, 95 insertions(+)

diff --git a/include/scsi/scsi_transport_iscsi.h 
b/include/scsi/scsi_transport_iscsi.h
index 6183d20a01fb..26fe284daf9a 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -37,6 +37,7 @@ struct iscsi_cls_conn;
 struct iscsi_conn;
 struct iscsi_task;
 struct sockaddr;
+struct iface_rec;
 struct iscsi_iface;
 struct bsg_job;
 struct iscsi_bus_flash_session;
@@ -291,6 +292,100 @@ struct iscsi_endpoint {
struct iscsi_cls_conn *conn;
 };
 
+/* max len of interface */
+#define ISCSI_MAX_IFACE_LEN65
+#define NI_MAXHOST 1025
+#define ISCSI_HWADDRESS_BUF_SIZE 18
+#define ISCSI_TRANSPORT_NAME_MAXLEN 16
+#define ISCSI_MAX_STR_LEN 80
+
+struct iface_rec {
+   struct list_headlist;
+   /* iscsi iface record name */
+   charname[ISCSI_MAX_IFACE_LEN];
+   uint32_tiface_num;
+   /* network layer iface name (eth0) */
+   charnetdev[IFNAMSIZ];
+   charipaddress[NI_MAXHOST];
+   charsubnet_mask[NI_MAXHOST];
+   chargateway[NI_MAXHOST];
+   charbootproto[ISCSI_MAX_STR_LEN];
+   charipv6_linklocal[NI_MAXHOST];
+   charipv6_router[NI_MAXHOST];
+   charipv6_autocfg[NI_MAXHOST];
+   charlinklocal_autocfg[NI_MAXHOST];
+   charrouter_autocfg[NI_MAXHOST];
+   uint16_tvlan_id;
+   uint8_t vlan_priority;
+   charvlan_state[ISCSI_MAX_STR_LEN];
+   charstate[ISCSI_MAX_STR_LEN]; /* 0 = disable,
+  * 1 = enable */
+   uint16_tmtu;
+   uint16_tport;
+   chardelayed_ack[ISCSI_MAX_STR_LEN];
+   charnagle[ISCSI_MAX_STR_LEN];
+   chartcp_wsf_state[ISCSI_MAX_STR_LEN];
+   uint8_t tcp_wsf;
+   uint8_t tcp_timer_scale;
+   chartcp_timestamp[ISCSI_MAX_STR_LEN];
+   chardhcp_dns[ISCSI_MAX_STR_LEN];
+   chardhcp_slp_da[ISCSI_MAX_STR_LEN];
+   chartos_state[ISCSI_MAX_STR_LEN];
+   uint8_t tos;
+   chargratuitous_arp[ISCSI_MAX_STR_LEN];
+   chardhcp_alt_client_id_state[ISCSI_MAX_STR_LEN];
+   chardhcp_alt_client_id[ISCSI_MAX_STR_LEN];
+   chardhcp_req_vendor_id_state[ISCSI_MAX_STR_LEN];
+   chardhcp_vendor_id_state[ISCSI_MAX_STR_LEN];
+   chardhcp_vendor_id[ISCSI_MAX_STR_LEN];
+   chardhcp_learn_iqn[ISCSI_MAX_STR_LEN];
+   charfragmentation[ISCSI_MAX_STR_LEN];
+   charincoming_forwarding[ISCSI_MAX_STR_LEN];
+   uint8_t ttl;
+   chargratuitous_neighbor_adv[ISCSI_MAX_STR_LEN];
+   charredirect[ISCSI_MAX_STR_LEN];
+   charmld[ISCSI_MAX_STR_LEN];
+   uint32_tflow_label;
+   uint32_ttraffic_class;
+   uint8_t hop_limit;
+   uint32_tnd_reachable_tmo;
+   uint32_tnd_rexmit_time;
+   uint32_tnd_stale_tmo;
+   uint8_t dup_addr_detect_cnt;
+   uint32_trouter_adv_link_mtu;
+   uint16_tdef_task_mgmt_tmo;
+   charheader_digest[ISCSI_MAX_STR_LEN];
+   chardata_digest[ISCSI_MAX_STR_LEN];
+   charimmediate_data[ISCSI_MAX_STR_LEN];
+   charinitial_r2t[ISCSI_MAX_STR_LEN];
+   chardata_seq_inorder[ISCSI_MAX_STR_LEN];
+   chardata_pdu_inorder[ISCSI_MAX_STR_LEN];
+   uint8_t erl;
+   uint32_tmax_recv_dlength;
+   uint32_tfirst_burst_len;
+   uint16_tmax_out_r2t;
+   uint32_tmax_burst_len;
+   charchap_auth[ISCSI_MAX_STR_LEN];
+   charbidi_chap[ISCSI_MAX_STR_LEN];
+   charstrict_login_comp[ISCSI_MAX_STR_LEN];
+   chardiscovery_auth[ISCSI_MAX_STR_LEN];
+ 

[PATCH 0/7] Enable iSCSI offload drivers to use information from iface.

2017-06-06 Thread Robert LeBlanc
This patchset enables iSCSI offload drivers to have access to the iface
information provided by iscsid. This allows users to have more control
of how the driver connects to the iSCSI target. iSER is updated to use
iface.ipaddress to set the source IP address if configured. This allows
iSER to use multiple ports on the same network or in more complicated
routed configurations.

Since there is already a change to the function parameters, dst_addr
is upgraded to sockaddr_storage so that it is more future proof and makes
the size of the struct static and not dependent on checking the SA_FAMILY.

This is dependent on updates to Open-iSCSI.

Robert LeBlanc (7):
  scsi/scsi_transport_iscsi: Add iface struct to kernel.
  scsi/scsi_transport_iscsi: Update ep_connect to include iface.
  ib/iSER: Add binding to source IP address.
  scsi/be2iscsi: Update beiscsi_ep_connect to accept iface and
sockaddr_storage.
  scsi/bnx2i: Update bnx2i_ep_connect to accept iface and
sockaddr_storage.
  scsi/cxgbi: Update cxgbi_ep_connect to accept iface and
sockaddr_storage.
  scsi/qla4xxx: Update qla4xxx_ep_connect to accept iface and
sockaddr_storage.

 drivers/infiniband/ulp/iser/iscsi_iser.c |  33 +++--
 drivers/infiniband/ulp/iser/iscsi_iser.h |   4 +-
 drivers/infiniband/ulp/iser/iser_initiator.c |   1 +
 drivers/infiniband/ulp/iser/iser_memory.c|   1 +
 drivers/infiniband/ulp/iser/iser_verbs.c |   8 ++-
 drivers/scsi/be2iscsi/be_cmds.c  |   1 +
 drivers/scsi/be2iscsi/be_iscsi.c |   8 ++-
 drivers/scsi/be2iscsi/be_iscsi.h |   5 +-
 drivers/scsi/be2iscsi/be_main.c  |   1 +
 drivers/scsi/be2iscsi/be_mgmt.c  |   1 +
 drivers/scsi/bnx2i/bnx2i_hwi.c   |   1 +
 drivers/scsi/bnx2i/bnx2i_iscsi.c |  13 ++--
 drivers/scsi/cxgbi/libcxgbi.c|  15 ++--
 drivers/scsi/cxgbi/libcxgbi.h|   2 +-
 drivers/scsi/qla4xxx/ql4_os.c|  15 ++--
 drivers/scsi/scsi_transport_iscsi.c  |   9 ++-
 include/scsi/scsi_transport_iscsi.h  | 100 ++-
 17 files changed, 179 insertions(+), 39 deletions(-)

-- 
2.11.0

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [RFC] Add source address binding to iSER

2017-06-02 Thread Robert LeBlanc
The error that I was getting was due to the distro version of iscsid
running. Once I stopped that and ran iscsid from the patched source,
it logged in just fine.

Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1


On Fri, Jun 2, 2017 at 2:29 PM, Robert LeBlanc <rob...@leblancnet.us> wrote:
> Attaching patches in case they are mangled.
> --------
> Robert LeBlanc
> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1
>
>
> On Fri, Jun 2, 2017 at 1:13 PM, Robert LeBlanc <rob...@leblancnet.us> wrote:
>> First off, I've never done anything this complicated, please be gentle.
>>
>> Second, I know this will need to be broken up, but I'm not clear if
>> each commit should be able to compile. It seems having a commit for
>> each driver would make sense, but it won't compile cleanly without the
>> others. How do I go about that?
>>
>> Third, this required a change to the kernel API(?) and I'm not sure
>> the best way to to make that change backwards compatible.
>>
>> Forth, I'm getting an error on login. I don't think the kernel is even
>> trying the login. Maybe I can get a pointer to help me get this
>> resolved.
>>
>> # usr/iscsiadm -m iface -I iser3
>> # BEGIN RECORD 2.0-874
>> iface.iscsi_ifacename = iser3
>> iface.net_ifacename = 
>> iface.ipaddress = fd00::14
>> ...
>> # usr/iscsiadm -m iface -I iser4
>> # BEGIN RECORD 2.0-874
>> iface.iscsi_ifacename = iser4
>> iface.net_ifacename = 
>> iface.ipaddress = fd00::114
>> ...
>> # usr/iscsiadm -m discovery -t st -p fd00::13 -I iser3 -I iser4
>> [fd00::13]:3260,1 iqn.2016-12.com.betterservers
>> [fd00::13]:3260,1 iqn.2016-12.com.betterservers
>> # usr/iscsiadm -m node -T iqn.2016-12.com.betterservers -p [fd00::13]:3260 -l
>> Logging in to [iface: iser3, target: iqn.2016-12.com.betterservers,
>> portal: fd00::13,3260] (multiple)
>> Logging in to [iface: iser4, target: iqn.2016-12.com.betterservers,
>> portal: fd00::13,3260] (multiple)
>> iscsiadm: Could not login to [iface: iser3, target:
>> iqn.2016-12.com.betterservers, portal: fd00::13,3260].
>> iscsiadm: initiator reported error (12 - iSCSI driver not found.
>> Please make sure it is loaded, and retry the operation)
>> iscsiadm: Could not login to [iface: iser4, target:
>> iqn.2016-12.com.betterservers, portal: fd00::13,3260].
>> iscsiadm: initiator reported error (12 - iSCSI driver not found.
>> Please make sure it is loaded, and retry the operation)
>> iscsiadm: Could not log into all portals
>>
>> Patch to open-iscsi
>> 
>> diff --git a/usr/netlink.c b/usr/netlink.c
>> index 1a0bf80..c474375 100644
>> --- a/usr/netlink.c
>> +++ b/usr/netlink.c
>> @@ -848,10 +848,13 @@ krecv_pdu_end(struct iscsi_conn *conn)
>>  int
>>  ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking)
>>  {
>> -int rc, addrlen;
>> +int rc, addrlen = sizeof(struct sockaddr_storage);
>>  struct iscsi_uevent *ev;
>> -struct sockaddr *dst_addr = (struct sockaddr *)>saddr;
>> +struct sockaddr_storage *dst_addr = (struct sockaddr_storage
>> *)>saddr;
>>  struct iovec iov[2];
>> +struct iscsi_session *tmp_session = (struct iscsi_session
>> *)conn->session;
>> +node_rec_t *tmp_rec = (node_rec_t *)_session->nrec;
>> +iface_rec_t *tmp_iface = (iface_rec_t *)_rec->iface;
>>
>>  log_debug(7, "in %s", __FUNCTION__);
>>
>> @@ -868,19 +871,16 @@ ktransport_ep_connect(iscsi_conn_t *conn, int
>> non_blocking)
>>  ev->u.ep_connect.non_blocking = non_blocking;
>>  }
>>
>> -if (dst_addr->sa_family == PF_INET)
>> -addrlen = sizeof(struct sockaddr_in);
>> -else if (dst_addr->sa_family == PF_INET6)
>> -addrlen = sizeof(struct sockaddr_in6);
>> -else {
>> +if (dst_addr->ss_family != AF_INET && dst_addr->ss_family !=
>> AF_INET6) {
>>  log_error("%s unknown addr family %d",
>> - __FUNCTION__, dst_addr->sa_family);
>> + __FUNCTION__, dst_addr->ss_family);
>>  return -EINVAL;
>>  }
>>  memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen);
>> +iface_copy(setparam_buf + sizeof(*ev) + addrlen, tmp_iface);
>>
>>  iov[1].iov_base = ev;
>> -iov[1].iov_len = 

Re: [RFC] Add source address binding to iSER

2017-06-02 Thread Robert LeBlanc
Attaching patches in case they are mangled.

Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1


On Fri, Jun 2, 2017 at 1:13 PM, Robert LeBlanc <rob...@leblancnet.us> wrote:
> First off, I've never done anything this complicated, please be gentle.
>
> Second, I know this will need to be broken up, but I'm not clear if
> each commit should be able to compile. It seems having a commit for
> each driver would make sense, but it won't compile cleanly without the
> others. How do I go about that?
>
> Third, this required a change to the kernel API(?) and I'm not sure
> the best way to to make that change backwards compatible.
>
> Forth, I'm getting an error on login. I don't think the kernel is even
> trying the login. Maybe I can get a pointer to help me get this
> resolved.
>
> # usr/iscsiadm -m iface -I iser3
> # BEGIN RECORD 2.0-874
> iface.iscsi_ifacename = iser3
> iface.net_ifacename = 
> iface.ipaddress = fd00::14
> ...
> # usr/iscsiadm -m iface -I iser4
> # BEGIN RECORD 2.0-874
> iface.iscsi_ifacename = iser4
> iface.net_ifacename = 
> iface.ipaddress = fd00::114
> ...
> # usr/iscsiadm -m discovery -t st -p fd00::13 -I iser3 -I iser4
> [fd00::13]:3260,1 iqn.2016-12.com.betterservers
> [fd00::13]:3260,1 iqn.2016-12.com.betterservers
> # usr/iscsiadm -m node -T iqn.2016-12.com.betterservers -p [fd00::13]:3260 -l
> Logging in to [iface: iser3, target: iqn.2016-12.com.betterservers,
> portal: fd00::13,3260] (multiple)
> Logging in to [iface: iser4, target: iqn.2016-12.com.betterservers,
> portal: fd00::13,3260] (multiple)
> iscsiadm: Could not login to [iface: iser3, target:
> iqn.2016-12.com.betterservers, portal: fd00::13,3260].
> iscsiadm: initiator reported error (12 - iSCSI driver not found.
> Please make sure it is loaded, and retry the operation)
> iscsiadm: Could not login to [iface: iser4, target:
> iqn.2016-12.com.betterservers, portal: fd00::13,3260].
> iscsiadm: initiator reported error (12 - iSCSI driver not found.
> Please make sure it is loaded, and retry the operation)
> iscsiadm: Could not log into all portals
>
> Patch to open-iscsi
> 
> diff --git a/usr/netlink.c b/usr/netlink.c
> index 1a0bf80..c474375 100644
> --- a/usr/netlink.c
> +++ b/usr/netlink.c
> @@ -848,10 +848,13 @@ krecv_pdu_end(struct iscsi_conn *conn)
>  int
>  ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking)
>  {
> -int rc, addrlen;
> +int rc, addrlen = sizeof(struct sockaddr_storage);
>  struct iscsi_uevent *ev;
> -struct sockaddr *dst_addr = (struct sockaddr *)>saddr;
> +struct sockaddr_storage *dst_addr = (struct sockaddr_storage
> *)>saddr;
>  struct iovec iov[2];
> +struct iscsi_session *tmp_session = (struct iscsi_session
> *)conn->session;
> +node_rec_t *tmp_rec = (node_rec_t *)_session->nrec;
> +iface_rec_t *tmp_iface = (iface_rec_t *)_rec->iface;
>
>  log_debug(7, "in %s", __FUNCTION__);
>
> @@ -868,19 +871,16 @@ ktransport_ep_connect(iscsi_conn_t *conn, int
> non_blocking)
>  ev->u.ep_connect.non_blocking = non_blocking;
>  }
>
> -if (dst_addr->sa_family == PF_INET)
> -addrlen = sizeof(struct sockaddr_in);
> -else if (dst_addr->sa_family == PF_INET6)
> -addrlen = sizeof(struct sockaddr_in6);
> -else {
> +if (dst_addr->ss_family != AF_INET && dst_addr->ss_family !=
> AF_INET6) {
>  log_error("%s unknown addr family %d",
> - __FUNCTION__, dst_addr->sa_family);
> + __FUNCTION__, dst_addr->ss_family);
>  return -EINVAL;
>  }
>  memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen);
> +iface_copy(setparam_buf + sizeof(*ev) + addrlen, tmp_iface);
>
>  iov[1].iov_base = ev;
> -iov[1].iov_len = sizeof(*ev) + addrlen;
> +iov[1].iov_len = sizeof(*ev) + addrlen + sizeof(iface_rec_t);
>  rc = __kipc_call(iov, 2);
>  if (rc < 0)
>  return rc;
>
> Patch to kernel
> --
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c
> b/drivers/infiniband/ulp/iser/iscsi_iser.c
> index 5a887ef..7ba5ed9 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.c
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
> @@ -59,6 +59,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>
> @@ -808,12 +809,16 @@ static int iscsi_iser_get_ep_param(struct
> iscsi_endpoint *ep,
>   * if fails.
&

[RFC] Add source address binding to iSER

2017-06-02 Thread Robert LeBlanc
   mld[ISCSI_MAX_STR_LEN];
+uint32_tflow_label;
+uint32_ttraffic_class;
+uint8_thop_limit;
+uint32_tnd_reachable_tmo;
+uint32_tnd_rexmit_time;
+uint32_tnd_stale_tmo;
+uint8_tdup_addr_detect_cnt;
+uint32_trouter_adv_link_mtu;
+uint16_tdef_task_mgmt_tmo;
+charheader_digest[ISCSI_MAX_STR_LEN];
+chardata_digest[ISCSI_MAX_STR_LEN];
+charimmediate_data[ISCSI_MAX_STR_LEN];
+charinitial_r2t[ISCSI_MAX_STR_LEN];
+chardata_seq_inorder[ISCSI_MAX_STR_LEN];
+chardata_pdu_inorder[ISCSI_MAX_STR_LEN];
+uint8_terl;
+uint32_tmax_recv_dlength;
+uint32_tfirst_burst_len;
+uint16_tmax_out_r2t;
+uint32_tmax_burst_len;
+charchap_auth[ISCSI_MAX_STR_LEN];
+charbidi_chap[ISCSI_MAX_STR_LEN];
+charstrict_login_comp[ISCSI_MAX_STR_LEN];
+chardiscovery_auth[ISCSI_MAX_STR_LEN];
+chardiscovery_logout[ISCSI_MAX_STR_LEN];
+charport_state[ISCSI_MAX_STR_LEN];
+charport_speed[ISCSI_MAX_STR_LEN];
+/*
+ * TODO: we may have to make this bigger and interconnect
+ * specific for infiniband
+ */
+charhwaddress[ISCSI_HWADDRESS_BUF_SIZE];
+char
transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
+/*
+ * This is only used for boot now, but the iser guys
+ * can use this for their virtualization idea.
+ */
+charalias[TARGET_NAME_MAXLEN + 1];
+chariname[TARGET_NAME_MAXLEN + 1];
+};
+
 struct iscsi_iface {
 struct device dev;
 struct iscsi_transport *transport;

Thank you,


Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Revisit: [iscsi ifaces / multipathing / etc] thread from 2010

2017-05-25 Thread Robert LeBlanc
We have a need to have iSER bind to specific addresses in order to
accomplish the multipathing discussing in the previous thread [1]. In
inspecting the code, I can pass in a source IP address in the iSER
kernel module [2] and the connection happens as expected. I started
looking at how to get the source address from the iface I configured
and that is where things get messy. I'm looking for some direction and
pointers to get something that could be accepted upstream.
Userland/kernel integration is something new for me, so I'm trying to
learn without asking too many questions.

Or Gerlitz pointed me to where the userland tools communicates with
the kernel and I _think_ I know how I would have to change the
relevant code, but it raises a number of questions.

1. I can't find the iface information in the iscsi_conn_t struct that
is passed in ktransport_ep_connect(). I thought that the iface would
be tied to a specific connection, but maybe I misunderstand that
concept. I would have to extend iscsi_conn_t (or some child struct) to
hold the source IP address, but it seems that other technologies may
prefer something different, so it seems that the ideal case would to
just link the entire iface struct in iscsi_conn_t so that each
technology could choose what they like from it. I'm still not sure
where the best place would be to link the iface to iscsi_conn_t.
2. The source address would have to be appended to the parameter list
passed into ep_connect. If we pass in source_address, that seems
simple enough, but if we pass in the iface, the kernel then has to
know the iface format. In any case, I'm not sure how to address the
change in API. It seems that the iface info could make the cxgb[3,4]i
code simpler as it may not have to search for the adapter itself if
defined in an iface.
3. Is there some other way I should approach this issue?

Thank you.

[1] https://groups.google.com/forum/#!topic/open-iscsi/IywifztV7Xs
[2] diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 5a887ef..e9741df 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -59,6 +59,7 @@
#include 
#include 
#include 
+#include 

#include 

@@ -814,6 +815,10 @@ static int iscsi_iser_get_ep_param(struct
iscsi_endpoint *ep,
   int err;
   struct iser_conn *iser_conn;
   struct iscsi_endpoint *ep;
+   struct sockaddr_in s_addr;
+   memset(_addr, 0, sizeof(s_addr));
+   s_addr.sin_family = AF_INET;
+   s_addr.sin_addr.s_addr = in_aton("192.168.13.14");

   ep = iscsi_create_endpoint(0);
   if (!ep)
@@ -829,7 +834,8 @@ static int iscsi_iser_get_ep_param(struct
iscsi_endpoint *ep,
   iser_conn->ep = ep;
   iser_conn_init(iser_conn);

-   err = iser_connect(iser_conn, NULL, dst_addr, non_blocking);
+   err = iser_connect(iser_conn, (struct sockaddr *) _addr,
dst_addr, non_blocking);
   if (err)
   goto failure;

diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c
b/drivers/infiniband/ulp/iser/iser_verbs.c
index c538a38..6ce1845 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -953,6 +953,7 @@ int iser_connect(struct iser_conn   *iser_conn,
   sprintf(iser_conn->name, "%pISp", dst_addr);

   iser_info("connecting to: %s\n", iser_conn->name);
+   iser_err("connecting from: %p\n", src_addr);

   /* the device is known only --after-- address resolution */
   ib_conn->device = NULL;

Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


iSCSI and SNMP

2013-10-09 Thread Robert Fisher
Any chance to get SNMP integrated into open-iSCSI?  I am using the IETF 
proposed iSCSI MIB but it doesn't seem to be working.  If by any chance 
that it is supposed to work, does anyone have decent documentation on how 
to install it?

-- 
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 open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/groups/opt_out.