From: Hannes Reinecke <hare@suse.de>
To: Lee Duncan <leeman.duncan@gmail.com>,
linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com,
netdev@vger.kernel.org
Cc: Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>
Subject: Re: [RFC PATCH 2/9] iscsi: associate endpoints with a host
Date: Tue, 14 Mar 2023 17:23:26 +0100 [thread overview]
Message-ID: <a9f8cc4f-5d60-be5e-d294-c4a9baa16ec4@suse.de> (raw)
In-Reply-To: <154c7602b3cc59f8af44439249ea5e5eb75f92d3.1675876734.git.lduncan@suse.com>
On 2/8/23 18:40, Lee Duncan wrote:
> From: Lee Duncan <lduncan@suse.com>
>
> Right now the iscsi_endpoint is only linked to a connection once that
> connection has been established. For net namespace filtering of the
> sysfs objects, associate an endpoint with the host that it was
> allocated for when it is created.
>
> Signed-off-by: Chris Leech <cleech@redhat.com>
> Signed-off-by: Lee Duncan <lduncan@suse.com>
> ---
> drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +-
> drivers/scsi/be2iscsi/be_iscsi.c | 2 +-
> drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +-
> drivers/scsi/cxgbi/libcxgbi.c | 2 +-
> drivers/scsi/qedi/qedi_iscsi.c | 2 +-
> drivers/scsi/qla4xxx/ql4_os.c | 2 +-
> drivers/scsi/scsi_transport_iscsi.c | 3 ++-
> include/scsi/scsi_transport_iscsi.h | 6 +++++-
> 8 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
> index 620ae5b2d80d..d38c909b462f 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.c
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
> @@ -802,7 +802,7 @@ static struct iscsi_endpoint *iscsi_iser_ep_connect(struct Scsi_Host *shost,
> struct iser_conn *iser_conn;
> struct iscsi_endpoint *ep;
>
> - ep = iscsi_create_endpoint(0);
> + ep = iscsi_create_endpoint(shost, 0);
> if (!ep)
> return ERR_PTR(-ENOMEM);
>
> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
> index 8aeaddc93b16..c893d193f5ef 100644
> --- a/drivers/scsi/be2iscsi/be_iscsi.c
> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
> @@ -1168,7 +1168,7 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
> return ERR_PTR(ret);
> }
>
> - ep = iscsi_create_endpoint(sizeof(struct beiscsi_endpoint));
> + ep = iscsi_create_endpoint(shost, sizeof(struct beiscsi_endpoint));
> if (!ep) {
> ret = -ENOMEM;
> return ERR_PTR(ret);
> diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> index a3c800e04a2e..ac63e93e07c6 100644
> --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> @@ -384,7 +384,7 @@ static struct iscsi_endpoint *bnx2i_alloc_ep(struct bnx2i_hba *hba)
> struct bnx2i_endpoint *bnx2i_ep;
> u32 ec_div;
>
> - ep = iscsi_create_endpoint(sizeof(*bnx2i_ep));
> + ep = iscsi_create_endpoint(hba->shost, sizeof(*bnx2i_ep));
> if (!ep) {
> printk(KERN_ERR "bnx2i: Could not allocate ep\n");
> return NULL;
> diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
> index af281e271f88..94edf8e1fb0c 100644
> --- a/drivers/scsi/cxgbi/libcxgbi.c
> +++ b/drivers/scsi/cxgbi/libcxgbi.c
> @@ -2926,7 +2926,7 @@ struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *shost,
> goto release_conn;
> }
>
> - ep = iscsi_create_endpoint(sizeof(*cep));
> + ep = iscsi_create_endpoint(shost, sizeof(*cep));
> if (!ep) {
> err = -ENOMEM;
> pr_info("iscsi alloc ep, OOM.\n");
> diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
> index 31ec429104e2..4baf1dbb8e92 100644
> --- a/drivers/scsi/qedi/qedi_iscsi.c
> +++ b/drivers/scsi/qedi/qedi_iscsi.c
> @@ -931,7 +931,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
> return ERR_PTR(-ENXIO);
> }
>
> - ep = iscsi_create_endpoint(sizeof(struct qedi_endpoint));
> + ep = iscsi_create_endpoint(shost, sizeof(struct qedi_endpoint));
> if (!ep) {
> QEDI_ERR(&qedi->dbg_ctx, "endpoint create fail\n");
> ret = -ENOMEM;
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index 005502125b27..acebf9c92c04 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -1717,7 +1717,7 @@ qla4xxx_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
> }
>
> ha = iscsi_host_priv(shost);
> - ep = iscsi_create_endpoint(sizeof(struct qla_endpoint));
> + ep = iscsi_create_endpoint(shost, sizeof(struct qla_endpoint));
> if (!ep) {
> ret = -ENOMEM;
> return ERR_PTR(ret);
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index be69cea9c6f8..86bafdb862a5 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -204,7 +204,7 @@ static struct attribute_group iscsi_endpoint_group = {
> };
>
> struct iscsi_endpoint *
> -iscsi_create_endpoint(int dd_size)
> +iscsi_create_endpoint(struct Scsi_Host *shost, int dd_size)
> {
> struct iscsi_endpoint *ep;
> int err, id;
> @@ -230,6 +230,7 @@ iscsi_create_endpoint(int dd_size)
>
> ep->id = id;
> ep->dev.class = &iscsi_endpoint_class;
> + ep->dev.parent = &shost->shost_gendev;
> dev_set_name(&ep->dev, "ep-%d", id);
> err = device_register(&ep->dev);
> if (err)
Umm... doesn't this change the sysfs layout?
IE won't the endpoint node be moved under the Scsi_Host directory?
But even if it does: do we care?
Cheers,
Hannes
next prev parent reply other threads:[~2023-03-14 16:24 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 17:40 [RFC 0/9] Make iscsid-kernel communications namespace-aware Lee Duncan
2023-02-08 17:40 ` [RFC PATCH 1/9] iscsi: create per-net iscsi netlink kernel sockets Lee Duncan
2023-03-14 16:21 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 2/9] iscsi: associate endpoints with a host Lee Duncan
2023-03-14 16:23 ` Hannes Reinecke [this message]
2023-03-17 21:42 ` Lee Duncan
2023-04-12 2:31 ` Chris Leech
2023-04-20 16:42 ` Chris Leech
2023-02-08 17:40 ` [RFC PATCH 3/9] iscsi: sysfs filtering by network namespace Lee Duncan
2023-03-14 16:24 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 4/9] iscsi: make all iSCSI netlink multicast namespace aware Lee Duncan
2023-03-14 16:27 ` Hannes Reinecke
2023-04-10 19:10 ` Chris Leech
2023-04-11 6:22 ` Hannes Reinecke
2023-04-10 19:10 ` [PATCH 10/11] iscsi: make session and connection lists per-net Chris Leech
2023-04-11 6:17 ` Hannes Reinecke
2023-04-10 19:10 ` [PATCH 11/11] iscsi: force destroy sesions when a network namespace exits Chris Leech
2023-04-11 6:21 ` Hannes Reinecke
2023-04-11 18:19 ` Chris Leech
2023-04-12 6:02 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 5/9] iscsi: set netns for iscsi_tcp hosts Lee Duncan
2023-03-14 16:29 ` Hannes Reinecke
2023-04-11 0:21 ` Chris Leech
2023-04-11 6:58 ` Hannes Reinecke
2023-04-11 18:03 ` Chris Leech
2023-02-08 17:40 ` [RFC PATCH 6/9] iscsi: check net namespace for all iscsi lookup Lee Duncan
2023-03-14 17:44 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 7/9] iscsi: convert flashnode devices from bus to class Lee Duncan
2023-03-14 17:45 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 8/9] iscsi: rename iscsi_bus_flash_* to iscsi_flash_* Lee Duncan
2023-03-14 17:46 ` Hannes Reinecke
2023-02-08 17:40 ` [RFC PATCH 9/9] iscsi: filter flashnode sysfs by net namespace Lee Duncan
2023-03-14 17:47 ` Hannes Reinecke
2023-02-08 19:23 ` [RFC 0/9] Make iscsid-kernel communications namespace-aware (resent) Lee Duncan
2023-03-14 16:20 ` [RFC 0/9] Make iscsid-kernel communications namespace-aware Hannes Reinecke
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=a9f8cc4f-5d60-be5e-d294-c4a9baa16ec4@suse.de \
--to=hare@suse.de \
--cc=cleech@redhat.com \
--cc=lduncan@suse.com \
--cc=leeman.duncan@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=open-iscsi@googlegroups.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 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).