mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: "Oğuzhan Kaynak" <kaynak.oguzhan0@gmail.com>,
	"Koichiro Den" <den@valinux.co.jp>
Cc: Jon Mason <jdmason@kudzu.us>, Allen Hubbe <allenbh@gmail.com>,
	ntb@lists.linux.dev, linux-kernel@vger.kernel.org,
	regressions@lists.linux.dev, yangqixiao <yangqixiao@inspur.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] ntb: ntb_tool: accept hexadecimal addresses in peer_mw_trans again
Date: Mon, 30 Nov 2026 11:07:44 -0700	[thread overview]
Message-ID: <9e0508a5-5718-49ed-9552-1e3f407f5754@intel.com> (raw)
In-Reply-To: <CAAKAQ7LG8hws9tFJpyvxqhC06VOWvfMES+Vp+mDPV=uBkLWEfA@mail.gmail.com>



On 11/30/26 9:02 AM, Oğuzhan Kaynak wrote:
> On Sun, Nov 30, 2026, Koichiro Den wrote:
>> With v2, "0x1000:0x1000" now just clears the MW and returns success.
>> Shouldn't that only happen when the whole size field really represents zero
>> (e.g. "0x1000:0")?
> 
> Yes, the size is still parsed with %zu there, which stops at the 'x'.
> 
>> My first thought was to use kstrtou64(.., 0, ..) for both fields. But should
>> "010" mean 8 or 10? Looking into it, it seems that "010:010" was (8, 8) before
>> 21fbdc4d0b1e, is (10, 10) on mainline, and would be (8, 10) with v2.. :(
>>
>> I think the choice of base is the maintainer's call, but AFAIC it would be nice
>> to document whichever rule we settle on.
> 
> Thanks, good catch. Unless Jon prefers otherwise, I'd use base 0 for both
> fields in v3 (kstrtou64() for the address, kstrtoul() for the size): that
> is what "%lli:%zi" did before 21fbdc4d0b1e, so "010:010" would be (8, 8)
> again, and it matches every other number ntb_tool parses (kstrto*() with
> base 0, or %lli). Trailing garbage would be rejected in both fields, so
> "0x1000:0x1000" maps 0x1000 bytes and only a real zero unmaps, and I'd
> document the rule next to the usage example at the top of ntb_tool.c.
> 
> I'll send v3 in a couple of days if there are no objections.

Sounds good to me. Thanks for documenting.

> 
> Best regards,
> Oguzhan


      reply	other threads:[~2026-11-30 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:41 Oguzhan KAYNAK
2026-11-30 12:32 ` Koichiro Den
2026-11-30 16:02   ` Oğuzhan Kaynak
2026-11-30 18:07     ` Dave Jiang [this message]

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=9e0508a5-5718-49ed-9552-1e3f407f5754@intel.com \
    --to=dave.jiang@intel.com \
    --cc=allenbh@gmail.com \
    --cc=den@valinux.co.jp \
    --cc=jdmason@kudzu.us \
    --cc=kaynak.oguzhan0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntb@lists.linux.dev \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=yangqixiao@inspur.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

all inboxes | Powered by JetHome®