* [PATCH] tests/nvme: Set clear_ids for passthru targets
@ 2022-07-05 20:56 Alan Adamson
2022-07-06 0:18 ` Chaitanya Kulkarni
0 siblings, 1 reply; 6+ messages in thread
From: Alan Adamson @ 2022-07-05 20:56 UTC (permalink / raw)
To: linux-block; +Cc: alan.adamson, linux-nvme, shinichiro.kawasaki
This allows to connect to passthru targets when the client and target
are on the same host.
Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
---
tests/nvme/rc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/nvme/rc b/tests/nvme/rc
index 4bebbc762cbb..5e50e69fb3f0 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
_test_dev_nvme_ctrl > "${passthru_path}/device_path"
echo 1 > "${passthru_path}/enable"
+ if [ -f "${passthru_path}/clear_ids" ]; then
+ echo 1 > "${passthru_path}/clear_ids"
+ fi
}
_remove_nvmet_passhtru() {
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tests/nvme: Set clear_ids for passthru targets
2022-07-05 20:56 [PATCH] tests/nvme: Set clear_ids for passthru targets Alan Adamson
@ 2022-07-06 0:18 ` Chaitanya Kulkarni
2022-07-06 15:58 ` Alan Adamson
0 siblings, 1 reply; 6+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-06 0:18 UTC (permalink / raw)
To: Alan Adamson
Cc: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
shinichiro.kawasaki@wdc.com
On 7/5/22 13:56, Alan Adamson wrote:
> This allows to connect to passthru targets when the client and target
> are on the same host.
>
> Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
> ---
> tests/nvme/rc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 4bebbc762cbb..5e50e69fb3f0 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -303,6 +303,9 @@ _create_nvmet_passthru() {
>
> _test_dev_nvme_ctrl > "${passthru_path}/device_path"
> echo 1 > "${passthru_path}/enable"
> + if [ -f "${passthru_path}/clear_ids" ]; then
> + echo 1 > "${passthru_path}/clear_ids"
> + fi
> }
>
> _remove_nvmet_passhtru() {
without looking into the code, just wondering whether we need
an explicit check to ensure that both host and target on the
same machine something like checking nvme_trtype=loop ?
-ck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tests/nvme: Set clear_ids for passthru targets
2022-07-06 0:18 ` Chaitanya Kulkarni
@ 2022-07-06 15:58 ` Alan Adamson
2022-07-14 16:25 ` Alan Adamson
0 siblings, 1 reply; 6+ messages in thread
From: Alan Adamson @ 2022-07-06 15:58 UTC (permalink / raw)
To: Chaitanya Kulkarni
Cc: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
shinichiro.kawasaki@wdc.com
> On Jul 5, 2022, at 5:18 PM, Chaitanya Kulkarni <chaitanyak@nvidia.com> wrote:
>
> On 7/5/22 13:56, Alan Adamson wrote:
>> This allows to connect to passthru targets when the client and target
>> are on the same host.
>>
>> Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
>> ---
>> tests/nvme/rc | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/tests/nvme/rc b/tests/nvme/rc
>> index 4bebbc762cbb..5e50e69fb3f0 100644
>> --- a/tests/nvme/rc
>> +++ b/tests/nvme/rc
>> @@ -303,6 +303,9 @@ _create_nvmet_passthru() {
>>
>> _test_dev_nvme_ctrl > "${passthru_path}/device_path"
>> echo 1 > "${passthru_path}/enable"
>> + if [ -f "${passthru_path}/clear_ids" ]; then
>> + echo 1 > "${passthru_path}/clear_ids"
>> + fi
>> }
>>
>> _remove_nvmet_passhtru() {
>
> without looking into the code, just wondering whether we need
> an explicit check to ensure that both host and target on the
> same machine something like checking nvme_trtype=loop ?
If nvme_trtype=loop, this code isn’t necessary because loop defaults
to clear_ids, but it is necessary for tcp and rdma. The check is
for necessary when running a pre 5.19 kernel where clear_ids
isn’t present just to prevent a error message.
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tests/nvme: Set clear_ids for passthru targets
2022-07-06 15:58 ` Alan Adamson
@ 2022-07-14 16:25 ` Alan Adamson
2022-07-15 8:46 ` Shinichiro Kawasaki
0 siblings, 1 reply; 6+ messages in thread
From: Alan Adamson @ 2022-07-14 16:25 UTC (permalink / raw)
To: Chaitanya Kulkarni, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org
Cc: shinichiro.kawasaki@wdc.com
> On Jul 6, 2022, at 8:58 AM, Alan Adamson <alan.adamson@oracle.com> wrote:
>
>
>
>> On Jul 5, 2022, at 5:18 PM, Chaitanya Kulkarni <chaitanyak@nvidia.com> wrote:
>>
>> On 7/5/22 13:56, Alan Adamson wrote:
>>> This allows to connect to passthru targets when the client and target
>>> are on the same host.
>>>
>>> Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
>>> ---
>>> tests/nvme/rc | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/tests/nvme/rc b/tests/nvme/rc
>>> index 4bebbc762cbb..5e50e69fb3f0 100644
>>> --- a/tests/nvme/rc
>>> +++ b/tests/nvme/rc
>>> @@ -303,6 +303,9 @@ _create_nvmet_passthru() {
>>>
>>> _test_dev_nvme_ctrl > "${passthru_path}/device_path"
>>> echo 1 > "${passthru_path}/enable"
>>> + if [ -f "${passthru_path}/clear_ids" ]; then
>>> + echo 1 > "${passthru_path}/clear_ids"
>>> + fi
>>> }
>>>
>>> _remove_nvmet_passhtru() {
>>
>> without looking into the code, just wondering whether we need
>> an explicit check to ensure that both host and target on the
>> same machine something like checking nvme_trtype=loop ?
>
> If nvme_trtype=loop, this code isn’t necessary because loop defaults
> to clear_ids, but it is necessary for tcp and rdma. The check is
> for necessary when running a pre 5.19 kernel where clear_ids
> isn’t present just to prevent a error message.
>
> Alan
Any other comments or feedback?
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tests/nvme: Set clear_ids for passthru targets
2022-07-14 16:25 ` Alan Adamson
@ 2022-07-15 8:46 ` Shinichiro Kawasaki
2022-07-15 17:22 ` Alan Adamson
0 siblings, 1 reply; 6+ messages in thread
From: Shinichiro Kawasaki @ 2022-07-15 8:46 UTC (permalink / raw)
To: Alan Adamson
Cc: Chaitanya Kulkarni, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org
On Jul 14, 2022 / 16:25, Alan Adamson wrote:
>
>
> > On Jul 6, 2022, at 8:58 AM, Alan Adamson <alan.adamson@oracle.com> wrote:
> >
> >
> >
> >> On Jul 5, 2022, at 5:18 PM, Chaitanya Kulkarni <chaitanyak@nvidia.com> wrote:
> >>
> >> On 7/5/22 13:56, Alan Adamson wrote:
> >>> This allows to connect to passthru targets when the client and target
> >>> are on the same host.
> >>>
> >>> Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
> >>> ---
> >>> tests/nvme/rc | 3 +++
> >>> 1 file changed, 3 insertions(+)
> >>>
> >>> diff --git a/tests/nvme/rc b/tests/nvme/rc
> >>> index 4bebbc762cbb..5e50e69fb3f0 100644
> >>> --- a/tests/nvme/rc
> >>> +++ b/tests/nvme/rc
> >>> @@ -303,6 +303,9 @@ _create_nvmet_passthru() {
> >>>
> >>> _test_dev_nvme_ctrl > "${passthru_path}/device_path"
> >>> echo 1 > "${passthru_path}/enable"
> >>> + if [ -f "${passthru_path}/clear_ids" ]; then
> >>> + echo 1 > "${passthru_path}/clear_ids"
> >>> + fi
> >>> }
> >>>
> >>> _remove_nvmet_passhtru() {
> >>
> >> without looking into the code, just wondering whether we need
> >> an explicit check to ensure that both host and target on the
> >> same machine something like checking nvme_trtype=loop ?
> >
> > If nvme_trtype=loop, this code isn’t necessary because loop defaults
> > to clear_ids, but it is necessary for tcp and rdma. The check is
> > for necessary when running a pre 5.19 kernel where clear_ids
> > isn’t present just to prevent a error message.
> >
> > Alan
>
> Any other comments or feedback?
I've applied the patch with an edit to replace single bracket to double
brackets. Wish this edit is ok for you. Thanks!
--
Shin'ichiro Kawasaki
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tests/nvme: Set clear_ids for passthru targets
2022-07-15 8:46 ` Shinichiro Kawasaki
@ 2022-07-15 17:22 ` Alan Adamson
0 siblings, 0 replies; 6+ messages in thread
From: Alan Adamson @ 2022-07-15 17:22 UTC (permalink / raw)
To: Shinichiro Kawasaki
Cc: Chaitanya Kulkarni, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org
> On Jul 15, 2022, at 1:46 AM, Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com> wrote:
>
> On Jul 14, 2022 / 16:25, Alan Adamson wrote:
>>
>>
>>> On Jul 6, 2022, at 8:58 AM, Alan Adamson <alan.adamson@oracle.com> wrote:
>>>
>>>
>>>
>>>> On Jul 5, 2022, at 5:18 PM, Chaitanya Kulkarni <chaitanyak@nvidia.com> wrote:
>>>>
>>>> On 7/5/22 13:56, Alan Adamson wrote:
>>>>> This allows to connect to passthru targets when the client and target
>>>>> are on the same host.
>>>>>
>>>>> Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
>>>>> ---
>>>>> tests/nvme/rc | 3 +++
>>>>> 1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/tests/nvme/rc b/tests/nvme/rc
>>>>> index 4bebbc762cbb..5e50e69fb3f0 100644
>>>>> --- a/tests/nvme/rc
>>>>> +++ b/tests/nvme/rc
>>>>> @@ -303,6 +303,9 @@ _create_nvmet_passthru() {
>>>>>
>>>>> _test_dev_nvme_ctrl > "${passthru_path}/device_path"
>>>>> echo 1 > "${passthru_path}/enable"
>>>>> + if [ -f "${passthru_path}/clear_ids" ]; then
>>>>> + echo 1 > "${passthru_path}/clear_ids"
>>>>> + fi
>>>>> }
>>>>>
>>>>> _remove_nvmet_passhtru() {
>>>>
>>>> without looking into the code, just wondering whether we need
>>>> an explicit check to ensure that both host and target on the
>>>> same machine something like checking nvme_trtype=loop ?
>>>
>>> If nvme_trtype=loop, this code isn’t necessary because loop defaults
>>> to clear_ids, but it is necessary for tcp and rdma. The check is
>>> for necessary when running a pre 5.19 kernel where clear_ids
>>> isn’t present just to prevent a error message.
>>>
>>> Alan
>>
>> Any other comments or feedback?
>
> I've applied the patch with an edit to replace single bracket to double
> brackets. Wish this edit is ok for you. Thanks!
Looks good.
Thanks!
Alan
>
> --
> Shin'ichiro Kawasaki
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-15 17:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 20:56 [PATCH] tests/nvme: Set clear_ids for passthru targets Alan Adamson
2022-07-06 0:18 ` Chaitanya Kulkarni
2022-07-06 15:58 ` Alan Adamson
2022-07-14 16:25 ` Alan Adamson
2022-07-15 8:46 ` Shinichiro Kawasaki
2022-07-15 17:22 ` Alan Adamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox