netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] devlink: Compare to size_new in case of resource child validation
@ 2018-02-26  9:59 Jiri Pirko
  2018-02-27 15:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2018-02-26  9:59 UTC (permalink / raw)
  To: netdev; +Cc: davem, arkadis, mlxsw

From: Arkadi Sharshevsky <arkadis@mellanox.com>

The current implementation checks the combined size of the children with
the 'size' of the parent. The correct behavior is to check the combined
size vs the pending change and to compare vs the 'size_new'.

Fixes: d9f9b9a4d05f ("devlink: Add support for resource abstraction")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Tested-by: Yuval Mintz <yuvalm@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 18d385ed8237..92aad7c46383 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2332,7 +2332,7 @@ devlink_resource_validate_children(struct devlink_resource *resource)
 	list_for_each_entry(child_resource, &resource->resource_list, list)
 		parts_size += child_resource->size_new;
 
-	if (parts_size > resource->size)
+	if (parts_size > resource->size_new)
 		size_valid = false;
 out:
 	resource->size_valid = size_valid;
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch net] devlink: Compare to size_new in case of resource child validation
  2018-02-26  9:59 [patch net] devlink: Compare to size_new in case of resource child validation Jiri Pirko
@ 2018-02-27 15:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-02-27 15:53 UTC (permalink / raw)
  To: jiri; +Cc: netdev, arkadis, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 26 Feb 2018 10:59:53 +0100

> From: Arkadi Sharshevsky <arkadis@mellanox.com>
> 
> The current implementation checks the combined size of the children with
> the 'size' of the parent. The correct behavior is to check the combined
> size vs the pending change and to compare vs the 'size_new'.
> 
> Fixes: d9f9b9a4d05f ("devlink: Add support for resource abstraction")
> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
> Tested-by: Yuval Mintz <yuvalm@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-27 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26  9:59 [patch net] devlink: Compare to size_new in case of resource child validation Jiri Pirko
2018-02-27 15:53 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).