Enable iBFT IPv6 booting with prefix length
Subsystems (3)
Lee Duncan
maintainerPATCH v2 1/1 Enable iBFT IPv6 booting with prefix length
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 (1):
iscsi_ibft: Add prefix-len attr and 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(+)
Signature · 1 line
1.8.5.2
Lee Duncan
maintainerPATCH v2 1/1 iscsi_ibft: Add prefix-len attr and display netmask
From: Hannes Reinecke <[email protected]>
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.
Some older user-space code might rely on the netmask attribute being present, so we should always display it.
Changes from v1:
- Combined two patches into one
--- 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(+)
drivers/firmware/iscsi_ibft.c +4 -0
@@ -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,6 +463,7 @@ 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_PREFIX_LEN :case ISCSI_BOOT_ETH_SUBNET_MASK :if (nic->subnet_mask_prefix) rc =S_IRUGO ;
drivers/scsi/iscsi_boot_sysfs.c +5 -0
@@ -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 );
include/linux/iscsi_boot_sysfs.h +1 -0
@@ -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,
Signature · 1 line
1.8.5.2
Re: [PATCHv2] iscsi_ibft: Add prefix-len attr and display netmask
Quoted 6 lines · Lee Duncan
From: Hannes Reinecke <[email protected]>
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.
The code looks ok to me, but I think this ipv4 comment was left over from the last posting since it conflicts with the comment below about always displaying it. Maybe it can just be edited when the patch is merged to avoid having to resend again. If so,
Quoted 80 lines
Some older user-space code might rely on the netmask attribute being present, so we should always display it.
Changes from v1:
- Combined two patches into oneSigned-off-by Hannes Reinecke <[email protected]>Signed-off-by Lee Duncan <[email protected]>--- 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(+)drivers/firmware/iscsi_ibft.c +4
-0@@ -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,6 +463,7 @@ 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_PREFIX_LEN :case ISCSI_BOOT_ETH_SUBNET_MASK :if (nic->subnet_mask_prefix) rc =S_IRUGO ;drivers/scsi/iscsi_boot_sysfs.c +5
-0@@ -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 );include/linux/iscsi_boot_sysfs.h +1
-0@@ -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,
Konrad Rzeszutek Wilk
maintainerRe: [PATCHv2] iscsi_ibft: Add prefix-len attr and display netmask
Quoted 8 lines · Mike Christie
Quoted 6 lines · Lee Duncan
From: Hannes Reinecke <[email protected]>
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.
Quoted 7 lines
The code looks ok to me, but I think this ipv4 comment was left over from the last posting since it conflicts with the comment below about always displaying it. Maybe it can just be edited when the patch is merged to avoid having to resend again. If so,
Reviewed-by Mike Christie <[email protected]>
Cool. Let me roll it up and send the git pull to Linus.
This does not seem be super-urgent so it can wait for the upcoming merge window?
Quoted 10 lines
Quoted 10 lines
Some older user-space code might rely on the netmask attribute being present, so we should always display it.
Changes from v1:
- Combined two patches into oneSigned-off-by Hannes Reinecke <[email protected]>Signed-off-by Lee Duncan <[email protected]>
Lee Duncan
maintainerRe: [PATCHv2] iscsi_ibft: Add prefix-len attr and display netmask
Quoted 14 lines · Konrad Rzeszutek Wilk
Quoted 13 lines · Mike Christie
Quoted 6 lines · Lee Duncan
From: Hannes Reinecke <[email protected]>
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.
The code looks ok to me, but I think this ipv4 comment was left over from the last posting since it conflicts with the comment below about always displaying it. Maybe it can just be edited when the patch is merged to avoid having to resend again. If so,
Quoted 4 lines
Quoted 2 lines
Reviewed-by Mike Christie <[email protected]>Cool. Let me roll it up and send the git pull to Linus.
I actually just resent it, but the only change was to truncate the last line of first paragraph of the comment to:
So introduce a new attribute 'prefix-len'.
Quoted 14 lines
This does not seem be super-urgent so it can wait for the upcoming merge window?
Quoted 10 lines
Quoted 10 lines
Some older user-space code might rely on the netmask attribute being present, so we should always display it.
Changes from v1:
- Combined two patches into oneSigned-off-by Hannes Reinecke <[email protected]>Signed-off-by Lee Duncan <[email protected]>
Signature · 2 lines
Lee Duncan SUSE Labs
Lee Duncan
maintainerRe: [PATCHv2] iscsi_ibft: Add prefix-len attr and display netmask
In reply to Mike ChristieQuoted 8 lines · Mike Christie
Quoted 6 lines · Lee Duncan
From: Hannes Reinecke <[email protected]>
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.
Quoted 8 lines
The code looks ok to me, but I think this ipv4 comment was left over from the last posting since it conflicts with the comment below about always displaying it. Maybe it can just be edited when the patch is merged to avoid having to resend again. If so,
Reviewed-by Mike Christie <[email protected]>...
Since there are no other comments, I will resubmit it with the comment fixed.
Signature · 1 line
Lee Duncan