Re: [PATCHES] Fixup iBFT and IPv6, some cleanup

2014-11-14 Thread Michael Christie

On Nov 13, 2014, at 5:56 PM, The Lee-Man leeman.dun...@gmail.com wrote:

 On Tuesday, November 11, 2014 8:25:56 PM UTC-8, Mike Christie wrote:
 On 10/30/2014 08:16 PM, The Lee-Man wrote: 
  0002-Represent-DHCP-origin-as-an-integer-not-string.patch 
  
  This just changes the origin attribute from a string, to a number, 
  which 
  is what it really is. 
  
 
 Could you send me a link to where origin is defined? In the doc I have 
 it is a dead link. 
 
 This is defined in the iBFT document, available here on the web here: iBFT 
 Layout - Microsoft
 (if my hper-link works)
 
 In section 3.6 NIC Structure, the table shows that origin 1 byte long at 
 offset 23 bytes. And table points at a C++ definition of the values here: 
 http://msdn.microsoft.com/en-us/library/aa366281.aspx
 
 It looks like:
 
 typedef enum  { 
   IpPrefixOriginOther= 0,
   IpPrefixOriginManual,
   IpPrefixOriginWellKnown,
   IpPrefixOriginDhcp,
   IpPrefixOriginRouterAdvertisement,
   IpPrefixOriginUnchanged= 16
 } IP_PREFIX_ORIGIN;
 The open-iscsi code current checks this for the value 3 (i.e. a string 
 representing the number 3), and our code already has a patch that instead 
 reads this value in as an integer, and then compares it with the number 3.

Could you add a enum for these values in fw_context.h and then check for it 
instead of the numerical value?

-- 
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/d/optout.


Re: [PATCHES] Fixup iBFT and IPv6, some cleanup

2014-11-14 Thread The Lee-Man
On Friday, November 14, 2014 9:12:41 AM UTC-8, Mike Christie wrote:


 On Nov 13, 2014, at 5:56 PM, The Lee-Man leeman...@gmail.com 
 javascript: wrote:

 On Tuesday, November 11, 2014 8:25:56 PM UTC-8, Mike Christie wrote:

 On 10/30/2014 08:16 PM, The Lee-Man wrote: 
  0002-Represent-DHCP-origin-as-an-integer-not-string.patch 
  
  This just changes the origin attribute from a string, to a 
 number, 
  which 
  is what it really is. 
  

 Could you send me a link to where origin is defined? In the doc I have 
 it is a dead link. 


 This is defined in the iBFT document, available here on the web here: iBFT 
 Layout - Microsoft 
 http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CCAQFjAAurl=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F7%2FE%2F7%2F7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2%2FiBFT.docxei=TjZlVKeNKYzVoASDn4GAAwusg=AFQjCNHY7NV8Y8wg4cHMzEOHi-4oUnWNLQsig2=9mkbWXrDlIra2lY3Qbe-Vgbvm=bv.79400599,d.cGU
 (if my hper-link works)

 In section 3.6 NIC Structure, the table shows that origin 1 byte long at 
 offset 23 bytes. And table points at a C++ definition of the values here: 
 http://msdn.microsoft.com/en-us/library/aa366281.aspx

 It looks like:

 typedef enum  { 
   IpPrefixOriginOther= 0,
   IpPrefixOriginManual,
   IpPrefixOriginWellKnown,
   IpPrefixOriginDhcp,
   IpPrefixOriginRouterAdvertisement,
   IpPrefixOriginUnchanged= 16
 } IP_PREFIX_ORIGIN;

 The open-iscsi code current checks this for the value 3 (i.e. a string 
 representing the number 3), and our code already has a patch that instead 
 reads this value in as an integer, and then compares it with the number 3.

 Could you add a enum for these values in fw_context.h and then check for 
 it instead of the numerical value?


I will submit the set again against current 'master' branch, minus patch 4 
(for now). 

-- 
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/d/optout.


[PATCHESv2] Fixup iBFT and IPv6, some cleanup

2014-11-14 Thread The Lee-Man
Hi Mike:

Here are the updated patches, based on your feedback:

0001-Code-cleanup-no-functional-changes.patch
0002-Represent-DHCP-origin-as-an-enum-not-a-string.patch
0003-fwparam_ibft-Check-iBFT-target-and-NIC-flags.patch
0004-Allow-modifications-for-iface.gateway-and-iface.subn.patch

Changes from last version:

patch 2: uses an enum now. Not sure if the state should be kept as an
integer or an enum. feedback welcome

also, the original path 4 was removed, for later discussion (once we get 
prefix-len figured out).

Patches are attached (since the groups.google.com interface doesn't easily 
do plain text)

Thanks.
-- 
Lee Duncan

-- 
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/d/optout.
From 7517894b701e13f43aafb0dc7f8301a53cf67d97 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke h...@suse.de
Date: Wed, 29 Oct 2014 11:03:56 -0700
Subject: [PATCH 1/4] Code cleanup: no functional changes

---
 usr/iface.c| 3 ++-
 utils/fwparam_ibft/fw_entry.c  | 8 
 utils/fwparam_ibft/fwparam_sysfs.c | 4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/usr/iface.c b/usr/iface.c
index 870dba0a1fcc..940ee2388945 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -1002,7 +1002,8 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
 			sizeof(iface-iname));
 
 	if (strlen(context-scsi_host_name)) {
-		if (sscanf(context-scsi_host_name, iscsi_boot%u, hostno) != 		1) {
+		if (sscanf(context-scsi_host_name,
+			   iscsi_boot%u, hostno) != 1) {
 			log_error(Could not parse %s's host no.,
   context-scsi_host_name);
 			return 0;
diff --git a/utils/fwparam_ibft/fw_entry.c b/utils/fwparam_ibft/fw_entry.c
index 295e905620eb..9f0797fdceb2 100644
--- a/utils/fwparam_ibft/fw_entry.c
+++ b/utils/fwparam_ibft/fw_entry.c
@@ -67,15 +67,15 @@ int fw_setup_nics(void)
 	 * to force iSCSI traffic through correct NIC
 	 */
 	list_for_each_entry(context, targets, list) {			
-	/* if it is a offload nic ignore it */
-	if (!net_get_transport_name_from_netdev(context-iface,
+		/* if it is a offload nic ignore it */
+		if (!net_get_transport_name_from_netdev(context-iface,
 			transport))
 			continue;
 
 		if (iface_prev == NULL || strcmp(context-iface, iface_prev)) {
 			/* Note: test above works because there is a
- 			 * maximum of two targets in the iBFT
- 			 */
+			 * maximum of two targets in the iBFT
+			 */
 			iface_prev = context-iface;
 			needs_bringup = 1;
 		}
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
index 09dd9fd5cbbc..b5319063785b 100644
--- a/utils/fwparam_ibft/fwparam_sysfs.c
+++ b/utils/fwparam_ibft/fwparam_sysfs.c
@@ -325,7 +325,7 @@ static int get_boot_info(struct boot_context *context, char *rootdir,
 	nic_cnt = 0;
 	tgt_cnt = 0;
 	if (file_exist(initiator_dir)) {
-		/* Find the target's and the ethernet's */
+		/* Find the targets and the ethernets */
 		rc = nftw(rootdir, find_sysfs_dirs, 20, 1);
 
 		/* Find wihch target and which ethernet have
@@ -401,7 +401,7 @@ static int get_targets(struct list_head *list, char *rootdir, char *subsys)
 	nic_cnt = 0;
 	tgt_cnt = 0;
 
-	/* Find the target's and the ethernet's */
+	/* Find the targets and the ethernets */
 	nftw(rootdir, find_sysfs_dirs, 20, 1);
 	for (i = 0; i  tgt_cnt; i++) {
 		context = calloc(1, sizeof(*context));
-- 
2.1.2

From 6d094af5064206b36f99c338f6447293f197425e Mon Sep 17 00:00:00 2001
From: Hannes Reinecke h...@suse.de
Date: Fri, 14 Nov 2014 11:19:10 -0800
Subject: [PATCH 2/4] Represent DHCP origin as an enum, not a string.

See IBFT standard for location of origin field in iBFT table,
and see MS document: http://msdn.microsoft.com/en-us/library/aa366281.aspx
for description of enums, duplicated here in part:

	typedef enum  {
	  IpPrefixOriginOther= 0,
	  IpPrefixOriginManual,
	  IpPrefixOriginWellKnown,
	  IpPrefixOriginDhcp,
	  IpPrefixOriginRouterAdvertisement,
	  IpPrefixOriginUnchanged= 16
	} IP_PREFIX_ORIGIN;
---
 include/fw_context.h   | 11 ++-
 utils/fwparam_ibft/fw_entry.c  |  5 +++--
 utils/fwparam_ibft/fwparam_sysfs.c |  3 +--
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/include/fw_context.h b/include/fw_context.h
index 295b54d3d0c9..6a7ec1a64967 100644
--- a/include/fw_context.h
+++ b/include/fw_context.h
@@ -28,6 +28,15 @@
 #include list.h
 #include auth.h
 
+enum ibft_ip_prefix_origin {
+	IBFT_IP_PREFIX_ORIGIN_OTHER	= 0,
+	IBFT_IP_PREFIX_ORIGIN_MANUAL,
+	IBFT_IP_PREFIX_ORIGIN_WELL_KNOWN,
+	IBFT_IP_PREFIX_ORIGIN_DHCP,
+	IBFT_IP_PREFIX_ORIGIN_ROUTER_ADVERTISEMENT,
+	IBFT_IP_PREFIX_ORIGIN_UNCHANGED = 

Re: [PATCHESv2] Fixup iBFT and IPv6, some cleanup

2014-11-14 Thread Mike Christie
On 11/14/2014 01:38 PM, The Lee-Man wrote:
 Hi Mike:
 
 Here are the updated patches, based on your feedback:
 
 0001-Code-cleanup-no-functional-changes.patch
 0002-Represent-DHCP-origin-as-an-enum-not-a-string.patch
 0003-fwparam_ibft-Check-iBFT-target-and-NIC-flags.patch
 0004-Allow-modifications-for-iface.gateway-and-iface.subn.patch
 
 Changes from last version:
 
 patch 2: uses an enum now. Not sure if the state should be kept as an
 integer or an enum. feedback welcome
 

It's fine as is.

 also, the original path 4 was removed, for later discussion (once we get
 prefix-len figured out).
 

All patches merged and should be up on github.

 Patches are attached (since the groups.google.com interface doesn't
 easily do plain text)
 

Just use git send-email?

-- 
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/d/optout.


Re: [PATCHESv2] Fixup iBFT and IPv6, some cleanup

2014-11-14 Thread Lee Duncan

 On Nov 14, 2014, at 12:13 PM, Mike Christie micha...@cs.wisc.edu wrote:
 
 On 11/14/2014 01:38 PM, The Lee-Man wrote:
 Hi Mike:
 
 Here are the updated patches, based on your feedback:
 
 0001-Code-cleanup-no-functional-changes.patch
 0002-Represent-DHCP-origin-as-an-enum-not-a-string.patch
 0003-fwparam_ibft-Check-iBFT-target-and-NIC-flags.patch
 0004-Allow-modifications-for-iface.gateway-and-iface.subn.patch
 
 Changes from last version:
 
 patch 2: uses an enum now. Not sure if the state should be kept as an
 integer or an enum. feedback welcome
 
 
 It's fine as is.
 
 also, the original path 4 was removed, for later discussion (once we get
 prefix-len figured out).
 
 
 All patches merged and should be up on github.

Thanks.

 
 Patches are attached (since the groups.google.com interface doesn't
 easily do plain text)
 
 
 Just use git send-email?

Not easily possible, since the email address for this group is not available on 
my 'git' systems.

If you do not like attachments, I can figure it out, though. Just let me know, 
as I'm about to submit some open-isns patches.
-- 
Lee Duncan

-- 
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/d/optout.