Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Md Haris Iqbal" <haris.iqbal@ionos.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH 1/9] RDMA/rtrs-clt: Add mpath_policy module parameter
Date: Mon, 23 Nov 2026 14:44:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-229435@kernel.org> (raw)
In-Reply-To: <20261123143719.938876-2-haris.iqbal@ionos.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] RDMA/rtrs-clt: unclamped runtime sysfs writes to mpath_policy
  in alloc_clt()
- [Low] RDMA/rtrs-clt: __stringify() on enum MP_POLICY_MIN_INFLIGHT in
  MODULE_PARM_DESC
--

commit 9f1bdddc73a41e6280e607ffdea1faff0f78b52e
Author: Danil Kipnis <danil.kipnis1@ionos.com>

RDMA/rtrs-clt: Add mpath_policy module parameter

This commit adds a runtime-adjustable mpath_policy module parameter to
configure the default multipath policy for newly created RTRS client
sessions.

> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index bf3a0377da3ff..573beb5ccdf07 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -39,6 +39,13 @@
>  MODULE_DESCRIPTION("RDMA Transport Client");
>  MODULE_LICENSE("GPL");
>  
> +static int mpath_policy = MP_POLICY_MIN_INFLIGHT;
> +module_param_named(mpath_policy, mpath_policy, int, 0644);
> +MODULE_PARM_DESC(mpath_policy,
> +		 "Default multipath policy for new sessions (default: "
> +		 __stringify(MP_POLICY_MIN_INFLIGHT)
> +		 " (min-inflight), 0: round-robin, 1: min-inflight, 2: min-latency)");

[Severity: Low]
Does __stringify(MP_POLICY_MIN_INFLIGHT) expand to the literal token name
"MP_POLICY_MIN_INFLIGHT" in modinfo rather than "1"?
MP_POLICY_MIN_INFLIGHT is an enum constant in enum rtrs_mp_policy, not a
preprocessor macro.

> @@ -2758,7 +2765,7 @@ static struct rtrs_clt_sess *alloc_clt(const char *sessname, size_t paths_num,
>  	clt->max_reconnect_attempts = max_reconnect_attempts;
>  	clt->priv = priv;
>  	clt->link_ev = link_ev;
> -	clt->mp_policy = MP_POLICY_MIN_INFLIGHT;
> +	clt->mp_policy = mpath_policy;
>  	strscpy(clt->sessname, sessname, sizeof(clt->sessname));
>  	init_waitqueue_head(&clt->permits_wait);
>  	mutex_init(&clt->paths_ev_mutex);
> @@ -3220,6 +3227,10 @@ static int __init rtrs_client_init(void)
>  	int ret = 0;
>  
>  	rtrs_rdma_dev_pd_init(0, &dev_pd);
> +
> +	/* Validate and clamp mpath_policy to valid range */
> +	mpath_policy = clamp(mpath_policy, MP_POLICY_RR, MP_POLICY_MIN_LATENCY);
> +
>  	ret = class_register(&rtrs_clt_dev_class);
>  	if (ret) {
>  		pr_err("Failed to create rtrs-client dev class\n");

[Severity: Medium]
Does clamping mpath_policy only in rtrs_client_init() leave runtime writes
to /sys/module/rtrs_client/parameters/mpath_policy unclamped?

Because mpath_policy uses mode 0644 with standard param_ops_int, writing
an out-of-range value via sysfs after module load stores that value
directly into clt->mp_policy in alloc_clt().  New sessions then report
"Unknown (<val>)" in mpath_policy_show(), and negative values fall through
path_it_init() to get_next_path_min_latency instead of clamping to
MP_POLICY_RR.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123143719.938876-1-haris.iqbal@ionos.com?part=1

  reply	other threads:[~2026-11-23 14:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 14:37 [PATCH 0/9] Misc patches for RTRS Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 1/9] RDMA/rtrs-clt: Add mpath_policy module parameter Md Haris Iqbal
2026-11-23 14:44   ` sashiko-bot [this message]
2026-11-23 14:37 ` [PATCH 2/9] RDMA/rtrs-clt: Fix refcount imbalance in rtrs_clt_write_req error path Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 3/9] RDMA/rtrs-clt: Trigger error recovery when posting LOCAL_INV fails Md Haris Iqbal
2026-11-23 15:02   ` sashiko-bot
2026-11-23 14:37 ` [PATCH 4/9] RDMA/rtrs-srv: Fix processing messages for Big-Endian archs Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 5/9] RDMA/rtrs-clt: rename pathname parameter to sessname in rtrs_clt_open() Md Haris Iqbal
2026-11-23 14:42   ` sashiko-bot
2026-11-23 14:37 ` [PATCH 6/9] RDMA/rtrs-clt: Fix reconnect jitter being applied in milliseconds Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 7/9] RDMA/rtrs-clt: Back off the reconnect delay exponentially Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 8/9] RDMA/rtrs-srv: Snapshot the READ request header instead of reusing it Md Haris Iqbal
2026-11-23 14:37 ` [PATCH 9/9] RDMA/rtrs-clt: Close all paths before freeing any in rtrs_clt_close() Md Haris Iqbal
2026-11-23 15:02 ` [PATCH 0/9] Misc patches for RTRS sashiko-bot

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=sashiko-outbox-229435@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=haris.iqbal@ionos.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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