linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: switchdev: don't abort unsupported operations
@ 2015-07-10 23:48 Vivien Didelot
  2015-07-11  9:55 ` Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vivien Didelot @ 2015-07-10 23:48 UTC (permalink / raw)
  To: netdev
  Cc: Scott Feldman, Jiri Pirko, David S. Miller, linux-kernel, kernel,
	Vivien Didelot

There is no need to abort attribute setting or object addition, if the
prepare phase returned operation not supported.

Thus, abort these two transactions only if the error is not -EOPNOTSUPP.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/switchdev/switchdev.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 84f77a0..9f2add3 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -171,8 +171,10 @@ int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
 		 * released.
 		 */
 
-		attr->trans = SWITCHDEV_TRANS_ABORT;
-		__switchdev_port_attr_set(dev, attr);
+		if (err != -EOPNOTSUPP) {
+			attr->trans = SWITCHDEV_TRANS_ABORT;
+			__switchdev_port_attr_set(dev, attr);
+		}
 
 		return err;
 	}
@@ -249,8 +251,10 @@ int switchdev_port_obj_add(struct net_device *dev, struct switchdev_obj *obj)
 		 * released.
 		 */
 
-		obj->trans = SWITCHDEV_TRANS_ABORT;
-		__switchdev_port_obj_add(dev, obj);
+		if (err != -EOPNOTSUPP) {
+			obj->trans = SWITCHDEV_TRANS_ABORT;
+			__switchdev_port_obj_add(dev, obj);
+		}
 
 		return err;
 	}
-- 
2.4.5


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

* Re: [PATCH] net: switchdev: don't abort unsupported operations
  2015-07-10 23:48 [PATCH] net: switchdev: don't abort unsupported operations Vivien Didelot
@ 2015-07-11  9:55 ` Jiri Pirko
  2015-07-11 17:10 ` Scott Feldman
  2015-07-12  4:30 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2015-07-11  9:55 UTC (permalink / raw)
  To: Vivien Didelot
  Cc: netdev, Scott Feldman, David S. Miller, linux-kernel, kernel

Sat, Jul 11, 2015 at 01:48:58AM CEST, vivien.didelot@savoirfairelinux.com wrote:
>There is no need to abort attribute setting or object addition, if the
>prepare phase returned operation not supported.
>
>Thus, abort these two transactions only if the error is not -EOPNOTSUPP.
>
>Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Sounds reasonable.

Acked-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH] net: switchdev: don't abort unsupported operations
  2015-07-10 23:48 [PATCH] net: switchdev: don't abort unsupported operations Vivien Didelot
  2015-07-11  9:55 ` Jiri Pirko
@ 2015-07-11 17:10 ` Scott Feldman
  2015-07-12  4:30 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Scott Feldman @ 2015-07-11 17:10 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: Netdev, Jiri Pirko, David S. Miller, linux-kernel, kernel

On Fri, Jul 10, 2015 at 4:48 PM, Vivien Didelot
<vivien.didelot@savoirfairelinux.com> wrote:
> There is no need to abort attribute setting or object addition, if the
> prepare phase returned operation not supported.
>
> Thus, abort these two transactions only if the error is not -EOPNOTSUPP.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Acked-by: Scott Feldman <sfeldma@gmail.com>

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

* Re: [PATCH] net: switchdev: don't abort unsupported operations
  2015-07-10 23:48 [PATCH] net: switchdev: don't abort unsupported operations Vivien Didelot
  2015-07-11  9:55 ` Jiri Pirko
  2015-07-11 17:10 ` Scott Feldman
@ 2015-07-12  4:30 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-07-12  4:30 UTC (permalink / raw)
  To: vivien.didelot; +Cc: netdev, sfeldma, jiri, linux-kernel, kernel

From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Fri, 10 Jul 2015 19:48:58 -0400

> There is no need to abort attribute setting or object addition, if the
> prepare phase returned operation not supported.
> 
> Thus, abort these two transactions only if the error is not -EOPNOTSUPP.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Applied, thanks.

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

end of thread, other threads:[~2015-07-12  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10 23:48 [PATCH] net: switchdev: don't abort unsupported operations Vivien Didelot
2015-07-11  9:55 ` Jiri Pirko
2015-07-11 17:10 ` Scott Feldman
2015-07-12  4:30 ` 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).