Subject: Re: [PATCH net-next v3 1/3] devlink: introduce framework for selftests

From: Jakub Kicinski <[email-masked]>
Date: Mon, 18 Jul 2022 20:33:46 -0700

On Mon, 18 Jul 2022 11:50:30 +0530 Vikas Gupta wrote:
> +	for (i = 1; i < DEVLINK_SELFTEST_ATTR_MAX + 1; i++) {
> +		u8 res;
> +
> +		if (nla_get_flag(tb[i])) {
> +			res = devlink->ops->selftest_run(devlink, i,

Shouldn't we selftest_check() first to make sure the driver supports
given test?

> +	[DEVLINK_ATTR_SELFTESTS_INFO] = { .type = NLA_NESTED },

	... = NLA_POLICY_NESTED(devlink_selftest_nl_policy),