2022-07-23 15:45:23

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

Sat, Jul 23, 2022 at 06:22:05AM CEST, [email protected] wrote:
>Add a framework for running selftests.
>Framework exposes devlink commands and test suite(s) to the user
>to execute and query the supported tests by the driver.
>
>Below are new entries in devlink_nl_ops
>devlink_nl_cmd_selftests_show_doit/dumpit: To query the supported
>selftests by the drivers.
>devlink_nl_cmd_selftests_run: To execute selftests. Users can
>provide a test mask for executing group tests or standalone tests.
>
>Documentation/networking/devlink/ path is already part of MAINTAINERS &
>the new files come under this path. Hence no update needed to the
>MAINTAINERS
>
>Signed-off-by: Vikas Gupta <[email protected]>
>Reviewed-by: Michael Chan <[email protected]>
>Reviewed-by: Andy Gospodarek <[email protected]>

Reviewed-by: Jiri Pirko <[email protected]>

2022-07-23 16:06:40

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH net-next v6 2/2] bnxt_en: implement callbacks for devlink selftests

Sat, Jul 23, 2022 at 06:22:06AM CEST, [email protected] wrote:
>Add callbacks
>=============
>.selftest_check: returns true for flash selftest.
>.selftest_run: runs a flash selftest.
>
>Also, refactor NVM APIs so that they can be
>used with devlink and ethtool both.
>
>Signed-off-by: Vikas Gupta <[email protected]>
>Reviewed-by: Michael Chan <[email protected]>
>Reviewed-by: Andy Gospodarek <[email protected]>

Reviewed-by: Jiri Pirko <[email protected]>

2022-07-23 16:54:19

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

On Sat, 23 Jul 2022 09:52:05 +0530 Vikas Gupta wrote:
> +enum devlink_attr_selftest_test_id {
> + DEVLINK_ATTR_SELFTEST_TEST_ID_UNSPEC,
> + DEVLINK_ATTR_SELFTEST_TEST_ID_FLASH, /* flag */
> +
> + __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX,
> + DEVLINK_ATTR_SELFTEST_TEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX - 1
> +};
> +
> +enum devlink_selftest_test_status {
> + DEVLINK_SELFTEST_TEST_STATUS_SKIP,
> + DEVLINK_SELFTEST_TEST_STATUS_PASS,
> + DEVLINK_SELFTEST_TEST_STATUS_FAIL
> +};
> +
> +enum devlink_attr_selftest_result {
> + DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC,
> + DEVLINK_ATTR_SELFTEST_RESULT, /* nested */
> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID, /* u32,
> + * enum devlink_attr_selftest_test_id
> + */
> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS, /* u8,
> + * enum devlink_selftest_test_status
> + */
> +
> + __DEVLINK_ATTR_SELFTEST_RESULT_MAX,
> + DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1

Any thoughts on running:

sed -i '/_SELFTEST/ {s/_TEST_/_/g}' $patch

on this patch? For example DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS
is 40 characters long, ain't nobody typing that, and _TEST is repeated..

Otherwise LGTM!

2022-07-23 17:32:46

by David Ahern

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

On 7/23/22 10:16 AM, Jakub Kicinski wrote:
> Any thoughts on running:
>
> sed -i '/_SELFTEST/ {s/_TEST_/_/g}' $patch
>
> on this patch? For example DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS
> is 40 characters long, ain't nobody typing that, and _TEST is repeated..
>

+1

2022-07-25 07:56:04

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

Sat, Jul 23, 2022 at 06:16:00PM CEST, [email protected] wrote:
>On Sat, 23 Jul 2022 09:52:05 +0530 Vikas Gupta wrote:
>> +enum devlink_attr_selftest_test_id {
>> + DEVLINK_ATTR_SELFTEST_TEST_ID_UNSPEC,
>> + DEVLINK_ATTR_SELFTEST_TEST_ID_FLASH, /* flag */
>> +
>> + __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX,
>> + DEVLINK_ATTR_SELFTEST_TEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX - 1
>> +};
>> +
>> +enum devlink_selftest_test_status {
>> + DEVLINK_SELFTEST_TEST_STATUS_SKIP,
>> + DEVLINK_SELFTEST_TEST_STATUS_PASS,
>> + DEVLINK_SELFTEST_TEST_STATUS_FAIL
>> +};
>> +
>> +enum devlink_attr_selftest_result {
>> + DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC,
>> + DEVLINK_ATTR_SELFTEST_RESULT, /* nested */
>> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID, /* u32,
>> + * enum devlink_attr_selftest_test_id
>> + */
>> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS, /* u8,
>> + * enum devlink_selftest_test_status
>> + */
>> +
>> + __DEVLINK_ATTR_SELFTEST_RESULT_MAX,
>> + DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1
>
>Any thoughts on running:
>
> sed -i '/_SELFTEST/ {s/_TEST_/_/g}' $patch

Sure, why not. But please make sure you keep all other related things
(variables, cmdline opts) consistent.

Thanks!


>
>on this patch? For example DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS
>is 40 characters long, ain't nobody typing that, and _TEST is repeated..
>
>Otherwise LGTM!

2022-07-25 09:31:35

by Vikas Gupta

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

Hi Jiri,

On Mon, Jul 25, 2022 at 1:23 PM Jiri Pirko <[email protected]> wrote:
>
> Sat, Jul 23, 2022 at 06:16:00PM CEST, [email protected] wrote:
> >On Sat, 23 Jul 2022 09:52:05 +0530 Vikas Gupta wrote:
> >> +enum devlink_attr_selftest_test_id {
> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_UNSPEC,
> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_FLASH, /* flag */
> >> +
> >> + __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX,
> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX - 1
> >> +};
> >> +
> >> +enum devlink_selftest_test_status {
> >> + DEVLINK_SELFTEST_TEST_STATUS_SKIP,
> >> + DEVLINK_SELFTEST_TEST_STATUS_PASS,
> >> + DEVLINK_SELFTEST_TEST_STATUS_FAIL
> >> +};
> >> +
> >> +enum devlink_attr_selftest_result {
> >> + DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC,
> >> + DEVLINK_ATTR_SELFTEST_RESULT, /* nested */
> >> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID, /* u32,
> >> + * enum devlink_attr_selftest_test_id
> >> + */
> >> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS, /* u8,
> >> + * enum devlink_selftest_test_status
> >> + */
> >> +
> >> + __DEVLINK_ATTR_SELFTEST_RESULT_MAX,
> >> + DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1
> >
> >Any thoughts on running:
> >
> > sed -i '/_SELFTEST/ {s/_TEST_/_/g}' $patch
>
> Sure, why not. But please make sure you keep all other related things
> (variables, cmdline opts) consistent.
>
> Thanks!
Does the 'test_id' in command line
'devlink dev selftests run DEV test_id flash'
will still hold good if DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID changes
to DEVLINK_ATTR_SELFTEST_RESULT_ID ?
or it should be
'devlink dev selftests run DEV selftest_id flash' ?

Thanks,
Vikas


>
>
> >
> >on this patch? For example DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS
> >is 40 characters long, ain't nobody typing that, and _TEST is repeated..
> >
> >Otherwise LGTM!


Attachments:
smime.p7s (4.11 kB)
S/MIME Cryptographic Signature

2022-07-25 11:17:07

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH net-next v6 1/2] devlink: introduce framework for selftests

Mon, Jul 25, 2022 at 10:48:39AM CEST, [email protected] wrote:
>Hi Jiri,
>
>On Mon, Jul 25, 2022 at 1:23 PM Jiri Pirko <[email protected]> wrote:
>>
>> Sat, Jul 23, 2022 at 06:16:00PM CEST, [email protected] wrote:
>> >On Sat, 23 Jul 2022 09:52:05 +0530 Vikas Gupta wrote:
>> >> +enum devlink_attr_selftest_test_id {
>> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_UNSPEC,
>> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_FLASH, /* flag */
>> >> +
>> >> + __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX,
>> >> + DEVLINK_ATTR_SELFTEST_TEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_TEST_ID_MAX - 1
>> >> +};
>> >> +
>> >> +enum devlink_selftest_test_status {
>> >> + DEVLINK_SELFTEST_TEST_STATUS_SKIP,
>> >> + DEVLINK_SELFTEST_TEST_STATUS_PASS,
>> >> + DEVLINK_SELFTEST_TEST_STATUS_FAIL
>> >> +};
>> >> +
>> >> +enum devlink_attr_selftest_result {
>> >> + DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC,
>> >> + DEVLINK_ATTR_SELFTEST_RESULT, /* nested */
>> >> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID, /* u32,
>> >> + * enum devlink_attr_selftest_test_id
>> >> + */
>> >> + DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS, /* u8,
>> >> + * enum devlink_selftest_test_status
>> >> + */
>> >> +
>> >> + __DEVLINK_ATTR_SELFTEST_RESULT_MAX,
>> >> + DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1
>> >
>> >Any thoughts on running:
>> >
>> > sed -i '/_SELFTEST/ {s/_TEST_/_/g}' $patch
>>
>> Sure, why not. But please make sure you keep all other related things
>> (variables, cmdline opts) consistent.
>>
>> Thanks!
>Does the 'test_id' in command line
> 'devlink dev selftests run DEV test_id flash'
>will still hold good if DEVLINK_ATTR_SELFTEST_RESULT_TEST_ID changes
>to DEVLINK_ATTR_SELFTEST_RESULT_ID ?
>or it should be
>'devlink dev selftests run DEV selftest_id flash' ?

Just "id". Thanks!


>
>Thanks,
>Vikas
>
>
>>
>>
>> >
>> >on this patch? For example DEVLINK_ATTR_SELFTEST_RESULT_TEST_STATUS
>> >is 40 characters long, ain't nobody typing that, and _TEST is repeated..
>> >
>> >Otherwise LGTM!