[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46d88c0b-7f68-0e03-bab6-544d407566c8@mellanox.com>
Date: Thu, 23 Nov 2017 14:25:24 +0200
From: Arkadi Sharshevsky <arkadis@...lanox.com>
To: David Ahern <dsa@...ulusnetworks.com>,
Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, mlxsw@...lanox.com, andrew@...n.ch,
vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
michael.chan@...adcom.com, ganeshgr@...lsio.com,
saeedm@...lanox.com, matanb@...lanox.com, leonro@...lanox.com,
idosch@...lanox.com, jakub.kicinski@...ronome.com, ast@...nel.org,
daniel@...earbox.net, simon.horman@...ronome.com,
pieter.jansenvanvuuren@...ronome.com, john.hurley@...ronome.com,
alexander.h.duyck@...el.com, linville@...driver.com,
gospo@...adcom.com, steven.lin1@...adcom.com, yuvalm@...lanox.com,
ogerlitz@...lanox.com, roopa@...ulusnetworks.com
Subject: Re: [patch net-next RFC v2 02/11] devlink: Add support for resource
abstraction
[...]
>>>> +
>>>> + resource = devlink_resource_find(devlink, NULL, resource_id);
>>>> + if (!resource)
>>>> + return -EINVAL;
>>>> +
>>>> + if (!resource->resource_ops->size_validate)
>>>> + return -EINVAL;
>>>
>>> genl_info has extack; please add user messages for the above failures.
>>>
>>
>> Isn't EOPNOTSUPP enough ?
>
> No, I mean every failure above returns EINVAL. Add an extack message
> telling the user what is wrong. e.g,
>
> resource = devlink_resource_find(devlink, NULL, resource_id);
> if (!resource) {
> NL_SET_ERR_MSG(extack, "Invalid resource id");
> return -EINVAL;
> }
>
> similarly for the rest.
>
I don't understand why actually, extended ack should be used when
typical errno is not enough, for example something driver specific
like "KVD overlapping is not supported".
But here if the user provided id for setting the resource, I think
EINVAL is enough if devlink cannot find it.
Powered by blists - more mailing lists