* [patch net-next] devlink: Prevent port_type_set() callback when it's not needed
@ 2016-10-23 15:43 Jiri Pirko
2016-10-26 21:30 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2016-10-23 15:43 UTC (permalink / raw)
To: netdev; +Cc: davem, eladr
From: Elad Raz <eladr@mellanox.com>
When a port_type_set() is been called and the new port type set is the same
as the old one, just return success.
Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
net/core/devlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 1b50630..d2fd736 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -608,6 +608,8 @@ static int devlink_port_type_set(struct devlink *devlink,
if (devlink->ops && devlink->ops->port_type_set) {
if (port_type == DEVLINK_PORT_TYPE_NOTSET)
return -EINVAL;
+ if (port_type == devlink_port->type)
+ return 0;
err = devlink->ops->port_type_set(devlink_port, port_type);
if (err)
return err;
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch net-next] devlink: Prevent port_type_set() callback when it's not needed
2016-10-23 15:43 [patch net-next] devlink: Prevent port_type_set() callback when it's not needed Jiri Pirko
@ 2016-10-26 21:30 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-26 21:30 UTC (permalink / raw)
To: jiri; +Cc: netdev, eladr
From: Jiri Pirko <jiri@resnulli.us>
Date: Sun, 23 Oct 2016 17:43:05 +0200
> From: Elad Raz <eladr@mellanox.com>
>
> When a port_type_set() is been called and the new port type set is the same
> as the old one, just return success.
>
> Signed-off-by: Elad Raz <eladr@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-26 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-23 15:43 [patch net-next] devlink: Prevent port_type_set() callback when it's not needed Jiri Pirko
2016-10-26 21:30 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.