All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: vikas.chaudhary@qlogic.com
Cc: James.Bottomley@suse.de, linux-scsi@vger.kernel.org,
	open-iscsi@googlegroups.com, lalit.chandivade@qlogic.com,
	ravi.anand@qlogic.com, Jayamohan.Kallickal@Emulex.Com
Subject: Re: [RFC-V2 PATCH 4/5] iscsi_transport: show network configuration in sysfs
Date: Tue, 12 Apr 2011 23:23:01 -0500	[thread overview]
Message-ID: <4DA52525.3020405@cs.wisc.edu> (raw)
In-Reply-To: <1301769261-29896-5-git-send-email-vikas.chaudhary@qlogic.com>

ccing Jay from Emulex to answer question below about lots of ips in his 
card.

On 04/02/2011 01:34 PM, vikas.chaudhary@qlogic.com wrote:
> From: Vikas Chaudhary<vikas.chaudhary@qlogic.com>
>
> To support multiple network addresses per adapter need to have a new way to
> represent network interface (net iface) in sysfs.
>
> Currently only one ipaddress and hwaddress is displayed
>
> \# ls /sys/class/iscsi_host/host18
> device  hwaddress  initiatorname  ipaddress  power  subsystem  uevent
>
> In this patch the net iface is presented as a separate class device.
> The one that can be added/removed dynamically or statically, based on how
> the user configures the multiple net iface on the adapter.
>
> The new sysfs directory would look like this
> \# /sys/class/iscsi_iface/
> |
> |- ipv4-iface-<host_no>-<iface_no>/<-- for ipv4
>                                  |- ipaddress
>                                  |- subnet
>                                  |- gateway
>                                  |- bootproto
>                                  |- state
> |- ipv6-iface-<host_no>-<iface_no>/<-- for ipv6
>                                  |- ipaddress
>                                  |- link_local_addr
>                                  |- router_addr
>                                  |- ipaddr_autocfg
>                                  |- linklocal_autocfg
>                                  |- state
>


My only issue with this is that in userpsace we have the iscsi_iface 
abstraction and that handles hw, software, scsi, and net abstractions. 
This patch adds a iscsi_iface abstraction that seems more related to 
just network interfaces.

For example with the userspace iscsi_iface abstraction we can create 
virtual iscsi initiator ports by having each iface set its own initiator 
name (or we could also set the ISID or both but we do not allow that 
right now). And then for the same host you can also define userspace 
iscsi ifaces with different net settings like ip addresses, and you can 
go crazy and define those with different iscsi initiator port settings 
if you wanted to too.

With the kernel iscsi iface it seems we are just supporting net settings.

Do we want to make the kernel iscsi iface more generic or maybe just 
rename it to reflect it is just based on net settings?

The issue with making it more generic is that with the current drivers, 
we do not care what info like the initiatorname in the kernel code. That 
is all handled in userspace because all the session management is there, 
so there is no point in adding that complexity here. But will Qlogic 
need this? Will we have to tell the firmware to create a virtual iscsi 
port, then pass it the initiator name or part of the isid to use? If so 
then maybe it would be good to have a kernel interface in place to 
set/get those values on per initiator port basis.



I think you want to link the iscsi_session to the iface it is being 
accessed through, right?




Jay, for be2iscsi if you support multiple ips per host, can you end up 
with a case where a session is running through IP1, but then something 
happens to that, and you end up running through IP2? Or do the 
interfaces for the different IPs not know anything about each other 
(there is not common route table)?



> +struct iscsi_iface *
> +iscsi_create_iface(struct Scsi_Host *shost, struct iscsi_transport *transport,
> +		   uint32_t iface_type, uint32_t iface_num, int dd_size)
> +{
> +	struct iscsi_iface *iface;
> +	int id;
> +	int err;
> +
> +	iface = kzalloc(sizeof(*iface) + dd_size, GFP_KERNEL);
> +	if (!iface)
> +		return NULL;
> +
> +iface_idr_again:
> +	if (!idr_pre_get(&iscsi_iface_idr, GFP_KERNEL))
> +		goto free_iface;
> +
> +	spin_lock(&iscsi_iface_lock);
> +	err = idr_get_new(&iscsi_iface_idr, iface,&id);
> +	if (err == -EAGAIN) {
> +		spin_unlock(&iscsi_iface_lock);
> +		goto iface_idr_again;
> +	}
> +	spin_unlock(&iscsi_iface_lock);
> +
> +	if (err)
> +		goto free_iface;
> +
> +	iface->id = id;


It looks like we can just kill id, because it is never used.

  reply	other threads:[~2011-04-13  4:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02 18:34 [RFC-V2 PATCH 0/5] Proposal for iSCSI Network Configuration vikas.chaudhary
2011-04-02 18:34 ` [RFC-V2 PATCH 1/5] iscsi_transport: add support for set_net_config vikas.chaudhary
2011-04-13  3:41   ` Mike Christie
2011-04-02 18:34 ` [RFC-V2 PATCH 2/5] qla4xxx: " vikas.chaudhary
2011-04-13  3:55   ` Mike Christie
     [not found]     ` <4DA51ECA.1020507-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2011-04-13 14:40       ` Vikas Chaudhary
2011-04-02 18:34 ` [RFC-V2 PATCH 3/5] qla4xxx: Added new "struct ipaddress_config" vikas.chaudhary
2011-04-02 18:34 ` [RFC-V2 PATCH 4/5] iscsi_transport: show network configuration in sysfs vikas.chaudhary
2011-04-13  4:23   ` Mike Christie [this message]
2011-04-13  4:40     ` Mike Christie
2011-04-13 14:48       ` Vikas Chaudhary
     [not found]         ` <5E4F49720D0BAD499EE1F01232234BA8728A8CB623-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2011-04-13 16:44           ` Mike Christie
2011-04-14  4:15             ` Vikas Chaudhary
2011-04-14  5:18               ` Mike Christie
2011-04-14  5:54                 ` Vikas Chaudhary
2011-04-21 22:10     ` Jayamohan.Kallickal
2011-04-13 17:00   ` Mike Christie
2011-04-13 22:47     ` Shyam_Iyer
2011-04-14  3:07       ` Mike Christie
2011-04-13 22:53     ` Michael Chan
2011-04-14  3:24       ` Mike Christie
2011-04-19  2:41   ` Mike Christie
2011-04-19 13:47     ` Vikas Chaudhary
2011-04-02 18:34 ` [RFC-V2 PATCH 5/5] qla4xxx: added support to show multiple iface " vikas.chaudhary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA52525.3020405@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@suse.de \
    --cc=Jayamohan.Kallickal@Emulex.Com \
    --cc=lalit.chandivade@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=open-iscsi@googlegroups.com \
    --cc=ravi.anand@qlogic.com \
    --cc=vikas.chaudhary@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.