dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [dm-devel] [PATCH V2 01/11] libmultipath: add group_by_tpg path_grouping_policy
Date: Wed, 7 Jun 2023 13:46:28 -0500	[thread overview]
Message-ID: <20230607184628.GE32239@octiron.msp.redhat.com> (raw)
In-Reply-To: <ba8f322db61002338353839fbd2d4921a5c11ebd.camel@suse.com>

On Wed, Jun 07, 2023 at 06:31:19PM +0000, Martin Wilck wrote:
> On Tue, 2023-06-06 at 15:13 -0500, Benjamin Marzinski wrote:
> >  #endif
> > diff --git a/libmultipath/prioritizers/alua.c
> > b/libmultipath/prioritizers/alua.c
> > index 0ab06e2b..4888a974 100644
> > --- a/libmultipath/prioritizers/alua.c
> > +++ b/libmultipath/prioritizers/alua.c
> > @@ -65,6 +65,7 @@ get_alua_info(struct path * pp, unsigned int
> > timeout)
> >                         return -ALUA_PRIO_NOT_SUPPORTED;
> >                 return -ALUA_PRIO_RTPG_FAILED;
> >         }
> > +       pp->tpg_id = tpg;
> >         condlog(3, "%s: reported target port group is %i", pp->dev,
> 
> 
> I still think that we should log a change here. Perhaps we should keep
> the existing condlog() and just use prio 2 if the tpg_id changed, and
> prio 4 if it didn't (the current 3 clutters the logs quite a bit).

Oops. My Bad. I meant to add that. I'll send a follow-on patch. 

-Ben

> 
> Regards
> Martin
> 
> 
> 
> > tpg);
> >         rc = get_asymmetric_access_state(pp, tpg, timeout);
> >         if (rc < 0) {
> > diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
> > index a25cc921..841fa247 100644
> > --- a/libmultipath/propsel.c
> > +++ b/libmultipath/propsel.c
> > @@ -35,7 +35,8 @@ pgpolicyfn *pgpolicies[] = {
> >         one_group,
> >         group_by_serial,
> >         group_by_prio,
> > -       group_by_node_name
> > +       group_by_node_name,
> > +       group_by_tpg,
> >  };
> >  
> >  #define do_set(var, src, dest,
> > msg)                                    \
> > @@ -249,10 +250,26 @@ out:
> >         return 0;
> >  }
> >  
> > +static bool
> > +verify_alua_prio(struct multipath *mp)
> > +{
> > +       int i;
> > +       struct path *pp;
> > +
> > +       vector_foreach_slot(mp->paths, pp, i) {
> > +               const char *name = prio_name(&pp->prio);
> > +               if (strncmp(name, PRIO_ALUA, PRIO_NAME_LEN) &&
> > +                   strncmp(name, PRIO_SYSFS, PRIO_NAME_LEN))
> > +                        return false;
> > +       }
> > +       return true;
> > +}
> > +
> >  int select_pgpolicy(struct config *conf, struct multipath * mp)
> >  {
> >         const char *origin;
> >         char buff[POLICY_NAME_SIZE];
> > +       int log_prio = 3;
> >  
> >         if (conf->pgpolicy_flag > 0) {
> >                 mp->pgpolicy = conf->pgpolicy_flag;
> > @@ -265,9 +282,15 @@ int select_pgpolicy(struct config *conf, struct
> > multipath * mp)
> >         mp_set_conf(pgpolicy);
> >         mp_set_default(pgpolicy, DEFAULT_PGPOLICY);
> >  out:
> > +       if (mp->pgpolicy == GROUP_BY_TPG && !verify_alua_prio(mp)) {
> > +               mp->pgpolicy = DEFAULT_PGPOLICY;
> > +               origin = "(setting: emergency fallback - not all
> > paths use alua prio)";
> > +               log_prio = 1;
> > +       }
> >         mp->pgpolicyfn = pgpolicies[mp->pgpolicy];
> >         get_pgpolicy_name(buff, POLICY_NAME_SIZE, mp->pgpolicy);
> > -       condlog(3, "%s: path_grouping_policy = %s %s", mp->alias,
> > buff, origin);
> > +       condlog(log_prio, "%s: path_grouping_policy = %s %s", mp-
> > >alias, buff,
> > +               origin);
> >         return 0;
> >  }
> >  
> > diff --git a/libmultipath/structs.c b/libmultipath/structs.c
> > index 87e84d5d..39504dca 100644
> > --- a/libmultipath/structs.c
> > +++ b/libmultipath/structs.c
> > @@ -125,6 +125,7 @@ alloc_path (void)
> >                 pp->sg_id.proto_id = PROTOCOL_UNSET;
> >                 pp->fd = -1;
> >                 pp->tpgs = TPGS_UNDEF;
> > +               pp->tpg_id = GROUP_ID_UNDEF;
> >                 pp->priority = PRIO_UNDEF;
> >                 pp->checkint = CHECKINT_UNDEF;
> >                 checker_clear(&pp->checker);
> > diff --git a/libmultipath/structs.h b/libmultipath/structs.h
> > index a1208751..0eea19b4 100644
> > --- a/libmultipath/structs.h
> > +++ b/libmultipath/structs.h
> > @@ -317,6 +317,8 @@ struct hd_geometry {
> >  };
> >  #endif
> >  
> > +#define GROUP_ID_UNDEF -1
> > +
> >  struct path {
> >         char dev[FILE_NAME_SIZE];
> >         char dev_t[BLK_DEV_SIZE];
> > @@ -372,6 +374,7 @@ struct path {
> >         /* configlet pointers */
> >         vector hwe;
> >         struct gen_path generic_path;
> > +       int tpg_id;
> >  };
> >  
> >  typedef int (pgpolicyfn) (struct multipath *, vector);
> > diff --git a/multipath/main.c b/multipath/main.c
> > index 90f940f1..b78f3162 100644
> > --- a/multipath/main.c
> > +++ b/multipath/main.c
> > @@ -157,6 +157,7 @@ usage (char * progname)
> >                 "          . group_by_serial     one priority group
> > per serial\n"
> >                 "          . group_by_prio       one priority group
> > per priority lvl\n"
> >                 "          . group_by_node_name  one priority group
> > per target node\n"
> > +               "          . group_by_tpg        one priority group
> > per ALUA target port group\n"
> >                 "  -v lvl  verbosity level:\n"
> >                 "          . 0 no output\n"
> >                 "          . 1 print created devmap names only\n"
> > diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
> > index b4dccd1b..b65a543d 100644
> > --- a/multipath/multipath.conf.5
> > +++ b/multipath/multipath.conf.5
> > @@ -233,6 +233,10 @@ per-multipath option in the configuration file.
> >  One priority group per target node name. Target node names are
> > fetched
> >  in \fI/sys/class/fc_transport/target*/node_name\fR.
> >  .TP
> > +.I group_by_tpg
> > +One priority group per ALUA target port group. In order to use this
> > policy,
> > +all paths in the multipath device must have \fIprio\fR set to
> > \fBalua\fR.
> > +.TP
> >  The default is: \fBfailover\fR
> >  .RE
> >  .
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2023-06-07 18:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 20:13 [dm-devel] [PATCH V2 00/11] multipath: Add a group_by_tgp pgpolicy Benjamin Marzinski
2023-06-06 20:13 ` [dm-devel] [PATCH V2 01/11] libmultipath: add group_by_tpg path_grouping_policy Benjamin Marzinski
2023-06-07 18:31   ` Martin Wilck
2023-06-07 18:46     ` Benjamin Marzinski [this message]
2023-06-06 20:13 ` [dm-devel] [PATCH V2 02/11] libmultipath: don't copy pgpolicy string in get_pgpolicy_name Benjamin Marzinski
2023-06-06 20:13 ` [dm-devel] [PATCH V2 03/11] libmultipath: add ALUA tpg path wildcard Benjamin Marzinski
2023-06-06 20:13 ` [dm-devel] [PATCH V2 04/11] multipath-tools tests: add tests for group_by_tpg policy Benjamin Marzinski
2023-06-07 18:35   ` Martin Wilck
2023-06-06 20:13 ` [dm-devel] [PATCH V2 05/11] libmultipath: add "detect_pgpolicy" config option Benjamin Marzinski
2023-06-07 18:36   ` Martin Wilck
2023-06-06 20:13 ` [dm-devel] [PATCH V2 06/11] libmultipath: add "detect_pgpolicy_use_tpg" " Benjamin Marzinski
2023-06-07 18:46   ` Martin Wilck
2023-06-06 20:13 ` [dm-devel] [PATCH V2 07/11] libmultipath: don't count PRIO_UNDEF paths for pathgroup priority Benjamin Marzinski
2023-06-06 20:13 ` [dm-devel] [PATCH V2 08/11] multipath-tools tests: add tests to verify PRIO_UDEF changes Benjamin Marzinski
2023-06-07 18:32   ` Martin Wilck
2023-06-06 20:13 ` [dm-devel] [PATCH V2 09/11] multipathd: only refresh priorities in update_prio() Benjamin Marzinski
2023-06-07 19:00   ` Martin Wilck
2023-06-06 20:13 ` [dm-devel] [PATCH V2 10/11] multipathd: reload map if the path groups are out of order Benjamin Marzinski
2023-06-07 18:59   ` Martin Wilck
2023-06-07 19:43     ` Benjamin Marzinski
2023-06-06 20:13 ` [dm-devel] [PATCH V2 11/11] multipathd: don't assume mpp->paths will exist in need_switch_pathgroup Benjamin Marzinski
2023-06-07 18:42 ` [dm-devel] [PATCH V2 00/11] multipath: Add a group_by_tgp pgpolicy Martin Wilck

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=20230607184628.GE32239@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=martin.wilck@suse.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).