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, Eddie Wai <waie@broadcom.com>,
	Michael Chan <mchan@broadcom.com>
Subject: Re: [RFC-V2 PATCH 4/5] iscsi_transport: show network configuration in sysfs
Date: Wed, 13 Apr 2011 12:00:00 -0500	[thread overview]
Message-ID: <4DA5D690.3040501@cs.wisc.edu> (raw)
In-Reply-To: <1301769261-29896-5-git-send-email-vikas.chaudhary@qlogic.com>

ccing Broadcom devs, Some questions for you guys below


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
>


With patch "[RFC-V2 PATCH 1/5] iscsi_transport: add support for 
set_net_config" userspace would send down the vlan info.

If we add a vlan sysfs file to the iscsi_iface, to export the info was 
bnx2i going call iscsi_create_iface for each vlan? If so I am not sure 
what bnx2i will use for the iface_num. It is supposed to be persistent, 
right?

For bnx2i, when doing iscsi offload and vlans, do you have to have a 
netdev like ethX.Y setup for each vlan or can bnx2i operate without it 
(the call to cnic_get_vlan always throws me and I cannot remember if we 
were going to still do that or change something in the driver so you did 
not need it).

And just to confirm for vlans and bnx2i, when we make a ep and session, 
cnic_get_route/cnic_cm_select_dev will do the magic to figure out what 
vlan to use?




> +
> +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;
> +	iface->transport = transport;
> +	iface->iface_type = iface_type;
> +	iface->iface_num = iface_num;
> +	iface->dev.class =&iscsi_iface_class;
> +	/* parent reference */
> +	iface->dev.parent = get_device(&shost->shost_gendev);
> +	if (iface_type == IFACE_TYPE_IPV4)
> +		dev_set_name(&iface->dev, "ipv4-iface-%u-%u", shost->host_no,
> +			     iface_num);
> +	else if (iface_type == IFACE_TYPE_IPV6)
> +		dev_set_name(&iface->dev, "ipv6-iface-%u-%u", shost->host_no,
> +			     iface_num);
> +	else
> +		goto free_iface;
> +
> +	err = device_register(&iface->dev);
> +	if (err)
> +		goto free_iface;
> +
> +	if (iface_type == IFACE_TYPE_IPV4)
> +		err = sysfs_create_group(&iface->dev.kobj,
> +					&iscsi_ipv4_iface_group);
> +	else if (iface_type == IFACE_TYPE_IPV6)
> +		err = sysfs_create_group(&iface->dev.kobj,
> +					&iscsi_ipv6_iface_group);
> +
> +	if (err)
> +		goto iface_unregister_dev;
> +
> +	if (dd_size)
> +		iface->dd_data =&iface[1];
> +	return iface;
> +
> +iface_unregister_dev:
> +	idr_remove(&iscsi_iface_idr, id);
> +	device_unregister(&iface->dev);
> +
> +free_iface:
> +	kfree(iface);
> +	return NULL;
> +}
> +EXPORT_SYMBOL_GPL(iscsi_create_iface);

  parent reply	other threads:[~2011-04-13 17:00 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
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 [this message]
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=4DA5D690.3040501@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@suse.de \
    --cc=lalit.chandivade@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=open-iscsi@googlegroups.com \
    --cc=ravi.anand@qlogic.com \
    --cc=vikas.chaudhary@qlogic.com \
    --cc=waie@broadcom.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.