From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Martin Petersen <martin.petersen@oracle.com>,
<target-devel@vger.kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
<linux-scsi@vger.kernel.org>, <linux@yadro.com>,
Roman Bolshakov <r.bolshakov@yadro.com>,
Christoph Hellwig <hch@lst.de>,
Dmitry Bogdanov <d.bogdanov@yadro.com>
Subject: [PATCH v3 3/5] scsi: target: core: Drop device-based RTPI
Date: Fri, 2 Dec 2022 15:11:37 +0300 [thread overview]
Message-ID: <20221202121139.28180-4-d.bogdanov@yadro.com> (raw)
In-Reply-To: <20221202121139.28180-1-d.bogdanov@yadro.com>
From: Roman Bolshakov <r.bolshakov@yadro.com>
The code is not needed since target port-based RTPI allocation replaced
it.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
---
drivers/target/target_core_device.c | 41 ---------------------------
drivers/target/target_core_internal.h | 1 -
drivers/target/target_core_tpg.c | 6 ----
include/target/target_core_base.h | 4 ---
4 files changed, 52 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index bf13eb06b76f..cce2475b5324 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -460,47 +460,6 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
mutex_unlock(&tpg->acl_node_mutex);
}
-int core_alloc_rtpi(struct se_lun *lun, struct se_device *dev)
-{
- struct se_lun *tmp;
-
- spin_lock(&dev->se_port_lock);
- if (dev->export_count == 0x0000ffff) {
- pr_warn("Reached dev->dev_port_count =="
- " 0x0000ffff\n");
- spin_unlock(&dev->se_port_lock);
- return -ENOSPC;
- }
-again:
- /*
- * Allocate the next RELATIVE TARGET PORT IDENTIFIER for this struct se_device
- * Here is the table from spc4r17 section 7.7.3.8.
- *
- * Table 473 -- RELATIVE TARGET PORT IDENTIFIER field
- *
- * Code Description
- * 0h Reserved
- * 1h Relative port 1, historically known as port A
- * 2h Relative port 2, historically known as port B
- * 3h to FFFFh Relative port 3 through 65 535
- */
- lun->lun_rtpi = dev->dev_rpti_counter++;
- if (!lun->lun_rtpi)
- goto again;
-
- list_for_each_entry(tmp, &dev->dev_sep_list, lun_dev_link) {
- /*
- * Make sure RELATIVE TARGET PORT IDENTIFIER is unique
- * for 16-bit wrap..
- */
- if (lun->lun_rtpi == tmp->lun_rtpi)
- goto again;
- }
- spin_unlock(&dev->se_port_lock);
-
- return 0;
-}
-
static void se_release_vpd_for_dev(struct se_device *dev)
{
struct t10_vpd *vpd, *vpd_tmp;
diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h
index 3e720a35567c..40550c702e2a 100644
--- a/drivers/target/target_core_internal.h
+++ b/drivers/target/target_core_internal.h
@@ -59,7 +59,6 @@ struct target_fabric_configfs {
extern struct t10_alua_lu_gp *default_lu_gp;
/* target_core_device.c */
-int core_alloc_rtpi(struct se_lun *lun, struct se_device *dev);
struct se_dev_entry *core_get_se_deve_from_rtpi(struct se_node_acl *, u16);
void target_pr_kref_release(struct kref *);
void core_free_device_list_for_node(struct se_node_acl *,
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index 5c8794a264aa..f33a1419a601 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -625,10 +625,6 @@ int core_tpg_add_lun(
if (ret < 0)
goto out;
- ret = core_alloc_rtpi(lun, dev);
- if (ret)
- goto out_kill_ref;
-
if (!(dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_ALUA) &&
!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE))
target_attach_tg_pt_gp(lun, dev->t10_alua.default_tg_pt_gp);
@@ -652,8 +648,6 @@ int core_tpg_add_lun(
return 0;
-out_kill_ref:
- percpu_ref_exit(&lun->lun_ref);
out:
return ret;
}
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 60ada63c4e04..2e6de5ba8172 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -735,8 +735,6 @@ struct se_lun {
bool lun_access_ro;
u32 lun_index;
- /* RELATIVE TARGET PORT IDENTIFER */
- u16 lun_rtpi;
atomic_t lun_acl_count;
struct se_device __rcu *lun_se_dev;
@@ -788,8 +786,6 @@ struct se_device_queue {
};
struct se_device {
- /* RELATIVE TARGET PORT IDENTIFER Counter */
- u16 dev_rpti_counter;
/* Used for SAM Task Attribute ordering */
u32 dev_cur_ordered_id;
u32 dev_flags;
--
2.25.1
next prev parent reply other threads:[~2022-12-02 12:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 12:11 [PATCH v3 0/5] scsi: target: make RTPI an TPG identifier Dmitry Bogdanov
2022-12-02 12:11 ` [PATCH v3 1/5] scsi: target: core: Add RTPI field to target port Dmitry Bogdanov
2022-12-02 15:14 ` kernel test robot
2022-12-02 12:11 ` [PATCH v3 2/5] scsi: target: core: Use RTPI from " Dmitry Bogdanov
2022-12-02 12:11 ` Dmitry Bogdanov [this message]
2022-12-02 12:11 ` [PATCH v3 4/5] scsi: target: core: Add common port attributes Dmitry Bogdanov
2022-12-02 12:11 ` [PATCH v3 5/5] scsi: target: core: Add RTPI attribute for target port Dmitry Bogdanov
2022-12-02 17:05 ` kernel test robot
2022-12-02 19:17 ` kernel test robot
2022-12-02 21:18 ` kernel test robot
2022-12-21 0:15 ` Mike Christie
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=20221202121139.28180-4-d.bogdanov@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.com \
--cc=martin.petersen@oracle.com \
--cc=r.bolshakov@yadro.com \
--cc=target-devel@vger.kernel.org \
/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.