* [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length @ 2016-01-22 19:49 Lee Duncan 2016-01-22 19:49 ` [PATCH 1/2] iscsi_ibft: Add prefix-len attribute Lee Duncan ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Lee Duncan @ 2016-01-22 19:49 UTC (permalink / raw) To: linux-scsi; +Cc: hare, Lee Duncan [Resending. Apologies if you get this twice.] It turns out that IPv6 doesn't care about netmask, but instead uses "prefix length" to determine the subnet, but the iBFT subsystem still just supports netmask. These two patches enable IPv6 iBFT (iscsi booting) by adding support for IPv6 prefix and prefix length. Open-iscsi changes to use these new values will be introduced once these changes are present. Hannes Reinecke (2): iscsi_ibft: Add prefix-len attribute iscsi_ibft: Always display netmask drivers/firmware/iscsi_ibft.c | 4 ++++ drivers/scsi/iscsi_boot_sysfs.c | 5 +++++ include/linux/iscsi_boot_sysfs.h | 1 + 3 files changed, 10 insertions(+) -- 1.8.5.2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] iscsi_ibft: Add prefix-len attribute 2016-01-22 19:49 [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Lee Duncan @ 2016-01-22 19:49 ` Lee Duncan 2016-01-22 19:49 ` [PATCH 2/2] iscsi_ibft: Always display netmask Lee Duncan 2016-02-02 1:17 ` [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Martin K. Petersen 2 siblings, 0 replies; 6+ messages in thread From: Lee Duncan @ 2016-01-22 19:49 UTC (permalink / raw) To: linux-scsi; +Cc: hare, Lee Duncan From: Hannes Reinecke <hare@suse.de> The iBFT table only specifies a prefix length, not a netmask. And the netmask is pretty much pointless for IPv6. So introduce a new attribute 'prefix-len' and display the netmask attribute only for IPv4 addresses. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Lee Duncan <lduncan@suse.com> --- drivers/firmware/iscsi_ibft.c | 12 +++++++++++- drivers/scsi/iscsi_boot_sysfs.c | 5 +++++ include/linux/iscsi_boot_sysfs.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 72791232e46b..2dd1fbb8cccc 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -319,6 +319,9 @@ static ssize_t ibft_attr_show_nic(void *data, int type, char *buf) val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1)); str += sprintf(str, "%pI4", &val); break; + case ISCSI_BOOT_ETH_PREFIX_LEN: + str += sprintf(str, "%d\n", nic->subnet_mask_prefix); + break; case ISCSI_BOOT_ETH_ORIGIN: str += sprintf(str, "%d\n", nic->origin); break; @@ -460,10 +463,17 @@ static umode_t ibft_check_nic_for(void *data, int type) if (address_not_null(nic->ip_addr)) rc = S_IRUGO; break; - case ISCSI_BOOT_ETH_SUBNET_MASK: + case ISCSI_BOOT_ETH_PREFIX_LEN: if (nic->subnet_mask_prefix) rc = S_IRUGO; break; + case ISCSI_BOOT_ETH_SUBNET_MASK: + if (!memcmp(nic->ip_addr, nulls, 10) && + (nic->ip_addr[10] == 0xff) && + (nic->ip_addr[11] == 0xff) && + nic->subnet_mask_prefix) + rc = S_IRUGO; + break; case ISCSI_BOOT_ETH_ORIGIN: rc = S_IRUGO; break; diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c index 680bf6f0ce76..8f0ea97cf31f 100644 --- a/drivers/scsi/iscsi_boot_sysfs.c +++ b/drivers/scsi/iscsi_boot_sysfs.c @@ -166,6 +166,7 @@ static struct attribute_group iscsi_boot_target_attr_group = { iscsi_boot_rd_attr(eth_index, index, ISCSI_BOOT_ETH_INDEX); iscsi_boot_rd_attr(eth_flags, flags, ISCSI_BOOT_ETH_FLAGS); iscsi_boot_rd_attr(eth_ip, ip-addr, ISCSI_BOOT_ETH_IP_ADDR); +iscsi_boot_rd_attr(eth_prefix, prefix-len, ISCSI_BOOT_ETH_PREFIX_LEN); iscsi_boot_rd_attr(eth_subnet, subnet-mask, ISCSI_BOOT_ETH_SUBNET_MASK); iscsi_boot_rd_attr(eth_origin, origin, ISCSI_BOOT_ETH_ORIGIN); iscsi_boot_rd_attr(eth_gateway, gateway, ISCSI_BOOT_ETH_GATEWAY); @@ -181,6 +182,7 @@ static struct attribute *ethernet_attrs[] = { &iscsi_boot_attr_eth_index.attr, &iscsi_boot_attr_eth_flags.attr, &iscsi_boot_attr_eth_ip.attr, + &iscsi_boot_attr_eth_prefix.attr, &iscsi_boot_attr_eth_subnet.attr, &iscsi_boot_attr_eth_origin.attr, &iscsi_boot_attr_eth_gateway.attr, @@ -208,6 +210,9 @@ static umode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj, else if (attr == &iscsi_boot_attr_eth_ip.attr) return boot_kobj->is_visible(boot_kobj->data, ISCSI_BOOT_ETH_IP_ADDR); + else if (attr == &iscsi_boot_attr_eth_prefix.attr) + return boot_kobj->is_visible(boot_kobj->data, + ISCSI_BOOT_ETH_PREFIX_LEN); else if (attr == &iscsi_boot_attr_eth_subnet.attr) return boot_kobj->is_visible(boot_kobj->data, ISCSI_BOOT_ETH_SUBNET_MASK); diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h index 2a8b1659bf35..548d55395488 100644 --- a/include/linux/iscsi_boot_sysfs.h +++ b/include/linux/iscsi_boot_sysfs.h @@ -23,6 +23,7 @@ enum iscsi_boot_eth_properties_enum { ISCSI_BOOT_ETH_INDEX, ISCSI_BOOT_ETH_FLAGS, ISCSI_BOOT_ETH_IP_ADDR, + ISCSI_BOOT_ETH_PREFIX_LEN, ISCSI_BOOT_ETH_SUBNET_MASK, ISCSI_BOOT_ETH_ORIGIN, ISCSI_BOOT_ETH_GATEWAY, -- 1.8.5.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] iscsi_ibft: Always display netmask 2016-01-22 19:49 [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Lee Duncan 2016-01-22 19:49 ` [PATCH 1/2] iscsi_ibft: Add prefix-len attribute Lee Duncan @ 2016-01-22 19:49 ` Lee Duncan 2016-02-02 6:45 ` Mike Christie 2016-02-02 1:17 ` [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Martin K. Petersen 2 siblings, 1 reply; 6+ messages in thread From: Lee Duncan @ 2016-01-22 19:49 UTC (permalink / raw) To: linux-scsi; +Cc: hare, Lee Duncan From: Hannes Reinecke <hare@suse.de> Some older user-space code might rely on the netmask attribute being present, so we should always display it. This fixes a regression introduced by commit 0b2eb3c4060a16f3ec11a4d6d4c934e7e5d5334f. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Lee Duncan <lduncan@suse.com> --- drivers/firmware/iscsi_ibft.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 2dd1fbb8cccc..81037e5fe301 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -464,14 +464,8 @@ static umode_t ibft_check_nic_for(void *data, int type) rc = S_IRUGO; break; case ISCSI_BOOT_ETH_PREFIX_LEN: - if (nic->subnet_mask_prefix) - rc = S_IRUGO; - break; case ISCSI_BOOT_ETH_SUBNET_MASK: - if (!memcmp(nic->ip_addr, nulls, 10) && - (nic->ip_addr[10] == 0xff) && - (nic->ip_addr[11] == 0xff) && - nic->subnet_mask_prefix) + if (nic->subnet_mask_prefix) rc = S_IRUGO; break; case ISCSI_BOOT_ETH_ORIGIN: -- 1.8.5.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iscsi_ibft: Always display netmask 2016-01-22 19:49 ` [PATCH 2/2] iscsi_ibft: Always display netmask Lee Duncan @ 2016-02-02 6:45 ` Mike Christie 2016-02-25 16:49 ` Lee Duncan 0 siblings, 1 reply; 6+ messages in thread From: Mike Christie @ 2016-02-02 6:45 UTC (permalink / raw) To: Lee Duncan, linux-scsi; +Cc: hare On 01/22/2016 01:49 PM, Lee Duncan wrote: > From: Hannes Reinecke <hare@suse.de> > > Some older user-space code might rely on the netmask attribute > being present, so we should always display it. > This fixes a regression introduced by commit > 0b2eb3c4060a16f3ec11a4d6d4c934e7e5d5334f. > > Signed-off-by: Hannes Reinecke <hare@suse.de> > Signed-off-by: Lee Duncan <lduncan@suse.com> > --- > drivers/firmware/iscsi_ibft.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c > index 2dd1fbb8cccc..81037e5fe301 100644 > --- a/drivers/firmware/iscsi_ibft.c > +++ b/drivers/firmware/iscsi_ibft.c > @@ -464,14 +464,8 @@ static umode_t ibft_check_nic_for(void *data, int type) > rc = S_IRUGO; > break; > case ISCSI_BOOT_ETH_PREFIX_LEN: > - if (nic->subnet_mask_prefix) > - rc = S_IRUGO; > - break; > case ISCSI_BOOT_ETH_SUBNET_MASK: > - if (!memcmp(nic->ip_addr, nulls, 10) && > - (nic->ip_addr[10] == 0xff) && > - (nic->ip_addr[11] == 0xff) && > - nic->subnet_mask_prefix) > + if (nic->subnet_mask_prefix) > rc = S_IRUGO; > break; > case ISCSI_BOOT_ETH_ORIGIN: > Sorry. I thought I sent this mail already. Is the commit id above supposed to be referencing the first patch? I could not match it to anything. If so, then shouldn't this patch just be combined with the second patch and some comment about us always displaying it for compat reasons added to the code? Also, you should normally cc Konrad for iscsi_ibft.c patches, because he is actually the maintainer. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iscsi_ibft: Always display netmask 2016-02-02 6:45 ` Mike Christie @ 2016-02-25 16:49 ` Lee Duncan 0 siblings, 0 replies; 6+ messages in thread From: Lee Duncan @ 2016-02-25 16:49 UTC (permalink / raw) To: Mike Christie, linux-scsi; +Cc: hare, konrad On 02/01/2016 10:45 PM, Mike Christie wrote: > On 01/22/2016 01:49 PM, Lee Duncan wrote: >> From: Hannes Reinecke <hare@suse.de> >> >> Some older user-space code might rely on the netmask attribute >> being present, so we should always display it. >> This fixes a regression introduced by commit >> 0b2eb3c4060a16f3ec11a4d6d4c934e7e5d5334f. >> >> Signed-off-by: Hannes Reinecke <hare@suse.de> >> Signed-off-by: Lee Duncan <lduncan@suse.com> >> --- >> drivers/firmware/iscsi_ibft.c | 8 +------- >> 1 file changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c >> index 2dd1fbb8cccc..81037e5fe301 100644 >> --- a/drivers/firmware/iscsi_ibft.c >> +++ b/drivers/firmware/iscsi_ibft.c >> @@ -464,14 +464,8 @@ static umode_t ibft_check_nic_for(void *data, int type) >> rc = S_IRUGO; >> break; >> case ISCSI_BOOT_ETH_PREFIX_LEN: >> - if (nic->subnet_mask_prefix) >> - rc = S_IRUGO; >> - break; >> case ISCSI_BOOT_ETH_SUBNET_MASK: >> - if (!memcmp(nic->ip_addr, nulls, 10) && >> - (nic->ip_addr[10] == 0xff) && >> - (nic->ip_addr[11] == 0xff) && >> - nic->subnet_mask_prefix) >> + if (nic->subnet_mask_prefix) >> rc = S_IRUGO; >> break; >> case ISCSI_BOOT_ETH_ORIGIN: >> > > Sorry. I thought I sent this mail already. > > Is the commit id above supposed to be referencing the first patch? I > could not match it to anything. If so, then shouldn't this patch just be > combined with the second patch and some comment about us always > displaying it for compat reasons added to the code? > > Also, you should normally cc Konrad for iscsi_ibft.c patches, because he > is actually the maintainer. Hi Mike: I'm sorry I didn't reply sooner. I let this get buried in a side folder and missed it. The commit ID in Patch 2 was from the SUSE repository. The bottom line is that I think you are correct, these two patches could easily be combined. I will resubmit them as one combined patch. I submitted them as two because I was just feeding patching that Hannes had done upstream, but I should have noticed they could be combined. -- Lee Duncan SUSE Labs ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length 2016-01-22 19:49 [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Lee Duncan 2016-01-22 19:49 ` [PATCH 1/2] iscsi_ibft: Add prefix-len attribute Lee Duncan 2016-01-22 19:49 ` [PATCH 2/2] iscsi_ibft: Always display netmask Lee Duncan @ 2016-02-02 1:17 ` Martin K. Petersen 2 siblings, 0 replies; 6+ messages in thread From: Martin K. Petersen @ 2016-02-02 1:17 UTC (permalink / raw) To: Mike Christie; +Cc: linux-scsi, hare, Lee Duncan >>>>> "Lee" == Lee Duncan <lduncan@suse.com> writes: Lee> [Resending. Apologies if you get this twice.] It turns out that Lee> IPv6 doesn't care about netmask, but instead uses "prefix length" Lee> to determine the subnet, but the iBFT subsystem still just supports Lee> netmask. Mike, care to review? https://patchwork.kernel.org/patch/8092511/ https://patchwork.kernel.org/patch/8092501/ -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-25 16:52 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-22 19:49 [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Lee Duncan 2016-01-22 19:49 ` [PATCH 1/2] iscsi_ibft: Add prefix-len attribute Lee Duncan 2016-01-22 19:49 ` [PATCH 2/2] iscsi_ibft: Always display netmask Lee Duncan 2016-02-02 6:45 ` Mike Christie 2016-02-25 16:49 ` Lee Duncan 2016-02-02 1:17 ` [PATCH 0/2] RESEND: Enable iBFT IPv6 booting with prefix length Martin K. Petersen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).