From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Mike Christie <michael.christie@oracle.com>
Cc: Martin Petersen <martin.petersen@oracle.com>,
<target-devel@vger.kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
<linux-scsi@vger.kernel.org>, <linux@yadro.com>
Subject: Re: [PATCH v2] scsi: target: alua: do not report emtpy port group
Date: Tue, 13 Sep 2022 00:45:21 +0300 [thread overview]
Message-ID: <20220912214521.GF9218@yadro.com> (raw)
In-Reply-To: <92f6024a-7898-e281-099a-c79b67fecafe@oracle.com>
On Mon, Sep 12, 2022 at 12:49:22PM -0500, Mike Christie wrote:
>
> On 9/12/22 7:54 AM, Dmitry Bogdanov wrote:
> > Default target port group is always returned in the list of port
> > groups, even if the behaviour is unwanted, i.e. it has no members and
> > non-default port groups are primary port groups.
> >
> > SPC-4 ("5.15.2.7 Target port asymmetric access state reporting")
> > states that a target MAY not provide info about port groups that do not
> > contain the current port through that the RTPG is received.
> >
>
> Where is that? I see where it says the state value for a group might not
> be up to date when the RTPG is sent through a different port. Are you
> taking that to mean we don't have to report entire groups?
Yes, you are right, I mixed something up here. Actually, a target
do not MAY not send, it SHALL not send an empty port group:
SPC-4 "6.37 REPORT TARGET PORT GROUPS command":
The TARGET PORT COUNT field indicates the number of target ports that
are in that target port group and the number of target port descriptors
in the target port group descriptor. Every target port group shall
contain at least one target port. The target port group descriptor
shall include one target port descriptor for each target port in the
target port group.
>
> Note that I also don't see where it says we have to return every group.
>
> Remember how ESX used to send a RTPG to one port and expect that it got
> every group and that the state info was all in sync (basically opposite
> if what's in the spec now)?
>
> The spec and ESX were updated, but I don't know if other OSs did this and
> if/when everyone was updated. Do you know this info? Are the old ESX versions
> that worked like that end of life?
ESXi is kinda a pain. But fortunately it has nothing to do with that
patch :)
>
> > This patch hides port groups with no ports in REPORT TARGET PORT GROUPS
> > response.
> >
> > Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
> > ---
> > v2:
> > new solution - just skip all empty groups
> > ---
> > drivers/target/target_core_alua.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
> > index fb91423a4e2e..c8470e7c0e10 100644
> > --- a/drivers/target/target_core_alua.c
> > +++ b/drivers/target/target_core_alua.c
> > @@ -164,6 +164,9 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
> > spin_lock(&dev->t10_alua.tg_pt_gps_lock);
> > list_for_each_entry(tg_pt_gp, &dev->t10_alua.tg_pt_gps_list,
> > tg_pt_gp_list) {
> > + /* Skip empty port groups */
> > + if (!tg_pt_gp->tg_pt_gp_members)
> > + continue;
> > /*
> > * Check if the Target port group and Target port descriptor list
> > * based on tg_pt_gp_members count will fit into the response payload.
>
next prev parent reply other threads:[~2022-09-12 21:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 12:54 [PATCH v2] scsi: target: alua: do not report emtpy port group Dmitry Bogdanov
2022-09-12 12:54 ` [PATCH v2] scsi: target: core: Set MULTIP bit for se_device with multiple ports Dmitry Bogdanov
2022-09-12 17:50 ` Mike Christie
2022-09-16 1:40 ` Martin K. Petersen
2022-09-12 17:49 ` [PATCH v2] scsi: target: alua: do not report emtpy port group Mike Christie
2022-09-12 21:45 ` Dmitry Bogdanov [this message]
2022-09-14 19:18 ` Mike Christie
2022-09-15 6:08 ` Dmitry Bogdanov
2022-09-22 16:26 ` michael.christie
2022-09-23 11:38 ` Dmitry Bogdanov
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=20220912214521.GF9218@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.com \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.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 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).