Re: iscsi-tools in a 32bit userland running 64bit kernel

2017-02-09 Thread Matthias Lay


Hi Chris,

thx for the fast reply


> Hi, unfortunately it doesn't look like this is going to work with any
> easy fix.

thx for the info.

Doesnt sound like there is a fix approaching in the next time, so I
think I will have to stick with the 32bit kernel and have to change the
VMSPLIT to 2/2 as I encounter massive IO Perfomance Issues with a big
amount of RAM.



> 
> It looks to me like the netlink message protocol between iscsid and
> the kernel isn't actually functional for this :(
> 
> The struct iscsi_uevent differs in size between 32 and 64 bit
> architectures due to internal padding for alignment.  It's so close
> to being safe that it's pretty frustrating to find this.  The
> iscsi_uevent.u union is padded out from 20 to 24 bytes, shifting the
> kernel response (iscsi_uevent.r) by 4 bytes.

what do you think would be the best solution to fix this? maybe I can
help out. 
I already have a test system up and running ;)


Greetz loomy

-- 
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: iscsi daemon in docker container

2017-02-09 Thread ayyanar1985


On Wednesday, March 9, 2016 at 10:53:58 PM UTC+5:30, Chris Leech wrote:
>
> On Tue, Mar 08, 2016 at 02:54:29AM +, Serguei Bezverkhi (sbezverk) 
> wrote: 
> > Hello, 
> > 
> > As per Michael Christie suggestion, I am reaching out to a wider 
> > audience.  I am trying to run iscsid inside of a Docker container but 
> > without using systemd. When I start iscsid -d 8 -f, it fails with 
> > "Cannot bind IPC socket". I would appreciate if somebody who managed 
> > to get it working, share his/her steps. 
>
> You'll probably need to run it using dockers host mode networking, not 
> using a container specific network namespace. The iSCSI netlink control 
> code in the kernel is not network namespace aware, and can only be 
> accessed from the default/original network namespace (that's the IPC 
> socket). Not being able to use a new network namespace also means that 
> you can only run a single iscsid instance on the system. 
>
> I had the start of a kernel patch series to deal with this posted a 
> while back.  I never finished the sysfs object filtering by network 
> namespace for iSCSI, particularly moving the flash node db sysfs code 
> from bus to class devices to allow for namespace filtering was still an 
> open issue. 
>
> - Chris 
>
>
Hi Chris,

Do you any latest update on this?

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 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: iscsi-tools in a 32bit userland running 64bit kernel

2017-02-09 Thread Chris Leech
I'm curious as to what would prevent you from running a 64-bit iscsid in this 
case, but that's OK.

The real fix, without breaking backwards compatibility, is going to need to be 
a kernel patch to use the 32-bit layout when talking to a compat process.  It's 
not as straightforward with netlink as ioctls, but I think it's doable if 
needed.  There are other kernel features that punt on 32/64 compat, like IP 
XFRM, and we should at least fail sanely if it's not going to be supported.

The other option, breaking the interface, is to fix the alignment in the 32-bit 
tools to match the 64-bit kernel.  This test patch should work if you define 
BUILD_32_64.  I've checked the resulting layout of everything in iscsi_if.h.  
That will build 32-bit binaries that only work on a 64-bit kernel.

-Chris

---

diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index 9d15811..758dc0a 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -37,6 +37,13 @@
 #define KEVENT_BASE100
 #define ISCSI_ERR_BASE 1000
 
+/* internal allignment hack to build a 32-bit binary to run a on 64-bit kernel 
*/
+#ifdef BUILD_32_64
+   #define __32_64_fix(x) __attribute__((aligned (x)))
+#else
+   #define __32_64_fix(x)
+#endif
+
 enum iscsi_uevent_e {
ISCSI_UEVENT_UNKNOWN= 0,
 
@@ -254,8 +261,7 @@ struct iscsi_uevent {
struct msg_get_host_stats {
uint32_thost_no;
} get_host_stats;
-
-   } u;
+   } __32_64_fix(sizeof(uint64_t)) u;
union {
/* messages k -> u */
int retcode;
@@ -315,7 +321,7 @@ struct iscsi_uevent {
struct msg_new_flashnode_ret {
uint32_tflashnode_idx;
} new_flashnode_ret;
-   } r;
+   } __32_64_fix(sizeof(uint64_t)) r;
 } __attribute__ ((aligned (sizeof(uint64_t;
 
 enum iscsi_param_type {

-- 
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.
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index 9d15811..758dc0a 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -37,6 +37,13 @@
 #define KEVENT_BASE			100
 #define ISCSI_ERR_BASE			1000
 
+/* internal allignment hack to build a 32-bit binary to run a on 64-bit kernel */
+#ifdef BUILD_32_64
+	#define __32_64_fix(x) __attribute__((aligned (x)))
+#else
+	#define __32_64_fix(x)
+#endif
+
 enum iscsi_uevent_e {
 	ISCSI_UEVENT_UNKNOWN		= 0,
 
@@ -254,8 +261,7 @@ struct iscsi_uevent {
 		struct msg_get_host_stats {
 			uint32_t	host_no;
 		} get_host_stats;
-
-	} u;
+	} __32_64_fix(sizeof(uint64_t)) u;
 	union {
 		/* messages k -> u */
 		int			retcode;
@@ -315,7 +321,7 @@ struct iscsi_uevent {
 		struct msg_new_flashnode_ret {
 			uint32_t	flashnode_idx;
 		} new_flashnode_ret;
-	} r;
+	} __32_64_fix(sizeof(uint64_t)) r;
 } __attribute__ ((aligned (sizeof(uint64_t;
 
 enum iscsi_param_type {