All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Dmitry Bogdanov <d.bogdanov@yadro.com>,
	Martin Petersen <martin.petersen@oracle.com>,
	target-devel@vger.kernel.org
Cc: 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: Mon, 12 Sep 2022 12:49:22 -0500	[thread overview]
Message-ID: <92f6024a-7898-e281-099a-c79b67fecafe@oracle.com> (raw)
In-Reply-To: <20220912125457.22573-1-d.bogdanov@yadro.com>

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?

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?


> 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.


  parent reply	other threads:[~2022-09-12 17:49 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 ` Mike Christie [this message]
2022-09-12 21:45   ` [PATCH v2] scsi: target: alua: do not report emtpy port group Dmitry Bogdanov
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=92f6024a-7898-e281-099a-c79b67fecafe@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=d.bogdanov@yadro.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@yadro.com \
    --cc=martin.petersen@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 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.